new pdn - tapcell inversion - rail vios
diff --git a/flow.tcl b/flow.tcl
index 00d44ce..90560c3 100755
--- a/flow.tcl
+++ b/flow.tcl
@@ -99,8 +99,8 @@
 	{opensta synthesis/opensta}
 	{verilog2def floorplan/verilog2def}
 	{ioPlacer floorplan/ioPlacer}
-	{pdn floorplan/pdn}
 	{tapcell floorplan/tapcell}
+	{pdn floorplan/pdn}
 	{replaceio placement/replace}
 	{psn placement/psn}
 	{opendp placement/opendp}
@@ -114,7 +114,7 @@
 set final_output \
 	[list  \
 		[list yosys synthesis/$::env(DESIGN_NAME).synthesis] \
-		[list tapcell floorplan/$::env(DESIGN_NAME).floorplan] \
+		[list pdn floorplan/$::env(DESIGN_NAME).floorplan] \
 		[list opendp placement/$::env(DESIGN_NAME).placement] \
 		[list tritonRoute routing/$::env(DESIGN_NAME).routing] \
 		[list cts cts/$::env(DESIGN_NAME).cts] \
@@ -326,27 +326,31 @@
 TIMER::timer_stop
 exec echo "[TIMER::get_runtime]" >> $::env(ioPlacer_log_file_tag)_runtime.txt
 
-# pdn generation
-TIMER::timer_start
-try_catch apply_pdn ./pdks/$::env(PDK)/common_pdn.tcl \
-        |& tee $::env(TERMINAL_OUTPUT) $::env(pdn_log_file_tag).log
-try_catch mv $::env(TMP_DIR)/$::env(CURRENT_STAGE)/$::env(DESIGN_NAME)_post_T8.def $::env(pdn_tmp_file_tag).def
-TIMER::timer_stop
-exec echo "[TIMER::get_runtime]" >> $::env(pdn_log_file_tag)_runtime.txt
-# try_catch mv $::env(DESIGN_NAME)_pdn.def $::env(pdn_tmp_file_tag)_empty.def
-# try_catch cp $::env(RESULTS_DIR)/$::env(CURRENT_STAGE)/3_2_floorplan.def $::env(RESULTS_DIR)/$::env(CURRENT_STAGE)/3_3_pdn.def
-
-# tapcell
-try_catch cp $::env(pdn_tmp_file_tag).def $::env(tapcell_result_file_tag).def
+try_catch cp $::env(ioPlacer_tmp_file_tag).def $::env(tapcell_tmp_file_tag).def
 TIMER::timer_start
 try_catch tapcell -lef $::env(MERGED_LEF) \
-	-def $::env(tapcell_result_file_tag).def \
+	-def $::env(tapcell_tmp_file_tag).def \
 	-welltap $::env(FP_WELLTAP_CELL) \
 	-endcap $::env(FP_ENDCAP_CELL) \
-	-outdef $::env(tapcell_result_file_tag).def \
+	-outdef $::env(tapcell_tmp_file_tag).def \
 	|& tee $::env(TERMINAL_OUTPUT) $::env(tapcell_log_file_tag).log
 TIMER::timer_stop
+
 exec echo "[TIMER::get_runtime]" >> $::env(tapcell_log_file_tag)_runtime.txt
+# pdn generation
+TIMER::timer_start
+puts "Initializing openDB"
+catch {exec opendbtcl $::env(SCRIPTS_DIR)/pdn/init_db.tcl}
+puts "Applying PDN"
+try_catch opendbtcl $::env(SCRIPTS_DIR)/pdn/apply_pdn.tcl ./pdks/$::env(PDK)/common_pdn.tcl \
+	  |& tee $::env(TERMINAL_OUTPUT) $::env(pdn_log_file_tag).log
+try_catch sed -i "s/+ ROWCOL.*;/;/g" $::env(pdn_result_file_tag).def
+
+TIMER::timer_stop
+exec echo "[TIMER::get_runtime]" >> $::env(pdn_log_file_tag)_runtime.txt
+#try_catch cp $::env(replacemacro_tmp_file_tag).def $::env(pdn_tmp_file_tag).def
+
+# tapcell
 
 
 # outputs: 3_floorplan.def, 3_floorplan.v, 3_floorplan.sdc
diff --git a/pdks/skywater130/common_pdn.tcl b/pdks/skywater130/common_pdn.tcl
index 2eeef50..8470596 100644
--- a/pdks/skywater130/common_pdn.tcl
+++ b/pdks/skywater130/common_pdn.tcl
@@ -1,36 +1,9 @@
-### PDN Config. All units in micrometer (um)
-## The values used in this config are for reference only and do not correspond to any specific foundry
-## design name to be used in DEF
-set ::design $::env(DESIGN_NAME)
-
-## DEF DBU
-set ::def_units $::env(DEF_UNITS_PER_MACRON)
-
-##Input DEF with macros packed
-set ::FpOutDef $::env(ioPlacer_tmp_file_tag).def
-
-#### input tech lef path
-#set ::techLef $::env(TECH_LEF)
-
-#### input cell lef path
-set ::cellLef [list $::env(MERGED_LEF)]
-
-#### input flat lef path. FLAT LEF that contains physical views of all standard cells and macros in the design
-# Ensure that the file ends with END LIBRARY
-set ::flatLef $::env(MERGED_LEF)
-
-set ::macro_power_pins $::env(VDD_PIN)
-set ::macro_ground_pins $::env(GND_PIN)
-
-#### placement SITE name from LEF
-set ::site_name $::env(PLACE_SITE)
-set ::site_width $::env(PLACE_SITE_WIDTH)
-
 # Floorplan information - core boundary coordinates, std. cell row height,
 # minimum track pitch as defined in LEF
 #
 
-set coreinfo [join [exec $::env(SCRIPTS_DIR)/extract_coreinfo.sh $::FpOutDef] " "]
+set ::def_units $::env(DEF_UNITS_PER_MACRON)
+set coreinfo [join [exec $::env(SCRIPTS_DIR)/extract_coreinfo.sh $::env(tapcell_tmp_file_tag).def] " "]
 # DIEAREA ( 0 0 ) ( 93930 93930 ) ;
 # ROW ROW_0 unit 0 0 FS DO 195 by 1 STEP 480 0 ;
 # ROW ROW_27 unit 0 89910 N DO 195 by 1 STEP 480 0 ;
@@ -43,60 +16,43 @@
 set ::core_area_urx [expr { ([lindex $coreinfo 6]+$step*$sites_per_row)/double($::def_units) }]
 set ::core_area_ury [expr { [lindex $coreinfo 7]/double($::def_units) }]
 
-set ::die_area_llx [expr { [lindex $coreinfo 0]/double($::def_units) }]
-set ::die_area_lly [expr { [lindex $coreinfo 1]/double($::def_units) }]
-set ::die_area_urx [expr { [lindex $coreinfo 2]/double($::def_units) }]
-set ::die_area_ury [expr { [lindex $coreinfo 3]/double($::def_units) }]
+puts "($::core_area_llx $::core_area_lly) ($::core_area_urx $::core_area_ury)"
 
-set ::row_height $::env(PLACE_SITE_HEIGHT)
+set ::halo 4
+
+# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
+set ::rails_start_with "POWER" ;
+
+# POWER or GROUND #Upper metal stripes starting with power or ground rails at the left/bottom of the core area
+set ::stripes_start_with "POWER" ;
+
+
 
 # Power nets
 set ::power_nets "VDD"
 set ::ground_nets "VSS"
 
-set ::macro_blockage_layer_list ""
+## PDN STRATEGY:
 
-# Details from techlef (BEOL LEF)
-set ::met_layer_list "met1 met2 met3 met4 met5"  ;#From met1 and upwards
-set ::met_layer_dir  "hor ver hor ver hor"
+#set ::row_height $::env(PLACE_SITE_HEIGHT)
 
-# Ensure pitches will make the stripes fall on track
-# Ensure offsets will make the stripes fall on track
-
-pdn specify_grid stdcell [list \
-    layers    "met1 met4 met5" \
-    dir       "hor ver hor" \
-    widths    "0.14 0.3 1.6" \
-    pitches   "$::row_height $::env(FP_PDN_VPITCH) $::env(FP_PDN_HPITCH)" \
-    loffset   "0 $::env(FP_PDN_VOFFSET) 0" \
-    boffset   "0 0 $::env(FP_PDN_HOFFSET)" \
-    connect   "{met1 met4} {met4 met5}" \
-    vias      "M1M2_PR M2M3_PR M3M4_PR M4M5_PR" \
-]
-
-#pdn specify_grid macro [list \
-#    layers    "M6" \
-#    dir       "ver" \
-#    widths    "0.93" \
-#    pitches   "40" \
-#    loffset   2 \
-#    boffset   0 \
-#    min_pitch 0.2 \
-#    connect   "{M4_PIN_hor M6} {M6 M7}" \
-#    vias      "VIA1_RULE_1 VIA2_RULE_1 VIA3_RULE_1 VIA4_RULE_293 VIA5_RULE_360 VIA6_RULE_21 VIA7_RULE_18 VIA8_RULE_1" \
-#]
-#set ::halo 4
-
-# Metal layer for rails on every row
-set ::rails_mlayer "met1" ;
-
-# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
-set ::rails_start_with "GROUND" ;
-
-# POWER or GROUND #Upper metal stripes starting with power or ground rails at the left/bottom of the core area
-set ::stripes_start_with "GROUND" ;
-
-proc generate_viarules {} {
+pdn specify_grid stdcell {
+    rails met1
+    layers {
+        met1 {width 0.14 pitch  3.33 offset 0.07} 
+        met4 {width 0.3 pitch 153.6 offset 16.32}
+        met5 {width 1.6 pitch 153.6 offset 16.65}
+    }
+    connect {{met1 met4} {met4 met5}}
 }
 
-cd $::env(TMP_DIR)/floorplan
+pdn specify_grid macro {
+    orient {N FN S FS E FE W FW}
+    power_pins "$::env(VDD_PIN)"
+    ground_pins "$::env(GND_PIN)"
+    blockages "li1 met1 met2"
+    layers {
+        met3 {width 0.333 pitch 40.293 offset 2}
+    } 
+    connect {{met2_PIN_ver met3} {met3 met5}}
+}
diff --git a/pdks/skywater130/scs8lp/lef/merged.lef b/pdks/skywater130/scs8lp/lef/merged.lef
index 4f357f7..7e28eb4 100644
--- a/pdks/skywater130/scs8lp/lef/merged.lef
+++ b/pdks/skywater130/scs8lp/lef/merged.lef
@@ -17,18 +17,18 @@
 
 #### end of header section  #######
 
-SITE unithd
-    SYMMETRY Y  ;
-    CLASS CORE  ;
-    SIZE  0.460 BY 2.720 ;
-END unithd
-
 SITE unit
     SYMMETRY Y  ;
     CLASS CORE  ;
     SIZE  0.480 BY 3.330 ;
 END unit
 
+SITE unithd
+    SYMMETRY Y  ;
+    CLASS CORE  ;
+    SIZE  0.460 BY 2.720 ;
+END unithd
+
 SITE unithv
     SYMMETRY Y  ;
     CLASS CORE  ;
diff --git a/scripts/pdn/.dockerignore b/scripts/pdn/.dockerignore
new file mode 100644
index 0000000..e613fbf
--- /dev/null
+++ b/scripts/pdn/.dockerignore
@@ -0,0 +1,10 @@
+.git
+Dockerfile
+.dockerignore
+.gitignore
+
+# from .gitignore file
+*.def
+*.lef
+*.lib
+*.v
\ No newline at end of file
diff --git a/scripts/pdn/.gitignore b/scripts/pdn/.gitignore
new file mode 100644
index 0000000..d1d602e
--- /dev/null
+++ b/scripts/pdn/.gitignore
@@ -0,0 +1,11 @@
+*.def
+*.lef
+*.lib
+*.v
+*.odb
+dummy.guide
+macrocell.list
+pin_dumper.log
+run.param
+src/PdnPinDumper/build
+
diff --git a/scripts/pdn/.gitmodules b/scripts/pdn/.gitmodules
new file mode 100644
index 0000000..350e2e4
--- /dev/null
+++ b/scripts/pdn/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "module/OpenDB"]
+	path = module/OpenDB
+	url = https://github.com/The-OpenROAD-Project/OpenDB.git
diff --git a/scripts/pdn/apply_pdn.tcl b/scripts/pdn/apply_pdn.tcl
new file mode 100644
index 0000000..0f03925
--- /dev/null
+++ b/scripts/pdn/apply_pdn.tcl
@@ -0,0 +1,18 @@
+if { $::argc > 0 } {
+	set PDN_CFG [lindex $::argv 0]
+} else {
+	puts "no command line argument passed"
+	exit
+}
+set dir $::env(SCRIPTS_DIR)/pdn/src/scripts
+source $dir/pkgIndex.tcl
+
+package require pdn
+
+set db [dbDatabase_create]
+odb_import_db $db $::env(pdn_tmp_file_tag).odb
+
+set block [[$db getChip] getBlock]
+pdn apply $block $PDN_CFG
+
+odb_write_def $block $::env(pdn_result_file_tag).def DEF_5_6
diff --git a/scripts/pdn/doc/PDN.md b/scripts/pdn/doc/PDN.md
deleted file mode 100644
index c8b9007..0000000
--- a/scripts/pdn/doc/PDN.md
+++ /dev/null
@@ -1,134 +0,0 @@
-# Elements of a configuration file
-
-A configuration file for apply_pdn consists of the following parts
-1. Global variable definitions
-1. Call a TCL procedure to create grid specifications
-1. Define a TCL procedure to write out the required set of VIAs
-
-## Required Global Variables
-Global variables are prefixed by ```::``` and force the variable to be declared in the global scope, rather than the local scope. This make the values of these variables available everywhere in the TCL code.
-The ```apply_pdn``` command requires the following global variables to exist
-
-| Variable Name | Description |
-|:---|:---|
-|  ```::design``` |  Name of the design |
-|  ```::def_units``` | Number of database unit that make 1 micron |
-| ```::FpOutDef``` | Name of the floorplan DEF containing macro and pin placement |
-| ```::flatLef``` | File containing technology and library cell data |
-| ```::macro_power_pins``` | List of names of power pins on macros |
-| ```::macro_ground_pins``` | List of names of ground pins on macros |
-| ```::site_name``` | Name of the stdcell site  |
-| ```::site_width``` | Width of the stdcell site |
-| ```::row_height``` | Height of a stdcell row |
-| ```::core_area_llx``` | Core area llx |
-| ```::core_area_lly``` | Core area lly |
-| ```::core_area_urx``` | Core area urx |
-| ```::core_area_ury``` | Core area ury |
-| ```::die_area_llx``` | Die area llx |
-| ```::die_area_llx``` | Die area lly |
-| ```::die_area_llx``` | Die area urx |
-| ```::die_area_llx``` | Die area ury |
-| ```::power_nets``` | Name of the power net |
-| ```::ground_nets``` | Name of the ground net |
-| ```::macro_blockage_layer_list``` | List of metal layer names blocked by macros |
-| ```::met_layer_list``` | List of metal layer names - bottom to top |
-| ```::met_layer_dir``` | List of preferred direction for the layer names - bottom to top |
-| ```::rails_mlayer``` | Layer used as stdcell rail |
-| ```::rails_start_with``` | POWER\|GROUND |
-| ```::stripes_start_with``` | POWER\|GROUND |
-
-## Optional Global Variables
-
-| Variable Name | Description |
-|---|:---|
-| ```::halo``` | Halo to apply around macros. Specify one, two or four values. If a HALO is defined in the floorplan DEF, then this will be ignored. |
-
-
-## Call TCL procedure
-A set of power grid specifications are provided by calling the ```pdn specify_grid``` command. 
-At least one power grid specification must be defined.
-
-The command has the following form
-
-```TCL
-pdn specify_grid (stdcell|macro) <specification>
-```
-
-Where specification is a list of key value pairs
-
-| Key | Description |
-|:---|:---|
-| ```layers``` | List of layers on which to draw stripes |
-| ```dir``` | List of directions of layers |
-| ```widths``` | List of width of stripes  |
-| ```pitches``` | List of pitches of stripes |
-| ```loffset``` | List of left hand offsets of stripes |
-| ```boffset``` | List of bottom offsets of stripes |
-| ```connect``` | List of connections to be made between layers |
-| ```vias``` | List of vias to use to connect layers - match ::met_layer_list |
-| ```instance``` |  |
-| ```macro``` |  |
-
-The lists for dir, widths, pitches, loffset, boffset must all be the same length as the list for layers
-such that the nth element in the list gives the values for the layer whose name is also nth in the
-list of layers
-
-The key connect specifies two layers to be connected together where the stripes the same net of the first layer 
-overlaps with stripes of the second layer
-
-Macro pins are extracted from the LEF/DEF and are specified on a layer called ```\<layer_name>_PIN_\<dir>```, where ```\<layer_name>```
-is the name of the layer as specified in ::met_layer_list, and '''\<dir>``` is hor to indicate horizontal pins in the floorplan and is 
-```ver``` to indicate that the pins are oriented vertically in the floorplan.
-
-The key vias contains a list of vias to be used to connect to the next higher layer. The first element of the 
-list is for M1 to M2 VIAs, the second element for M2 to M3 vias etc. Hence, this list should be 1 element shorter
-than the list ::met_layer_list
-
-A separate grid is built for each macro. The list of macro specification sthat have been defined are searched to 
-find a specification with a matcing instance name key, failing that a macro specification with a matching macro name key, 
-or else the first specification with neither an instance or macro key is used.
-
-### Examples of grid specifications
-
-1. Stdcell grid specification
-```TCL
-pdn specify_grid stdcell {
-    layers    "M1 M4 M7" 
-    dir       "hor ver hor" 
-    widths    "0.64 0.93 0.93" 
-    pitches   "2.40 40.0 40.0" 
-    loffset   "0 2 2" 
-    boffset   "0 2 2" 
-    connect   "{M1 M4} {M4 M7}" 
-    vias      "VIA1_RULE_1 VIA2_RULE_1 VIA3_RULE_1 VIA4_RULE_1 VIA5_RULE_264 VIA6_RULE_18 VIA7_RULE_18 VIA8_RULE_1"
-}
-```
-This specification adds a grid over the stdcell area, with an M1 horizontal followpin width of 0.64,connecting to 
-M4 vertical stripes of 0.93 every 40.0, connecting in turn to horizontal M7 stripes, also 0.93 wide and 40.0 pitch
-
-2. Macro grid specification
-```TCL
-pdn specify_grid macro {
-    layers    "M6" 
-    dir       "ver"
-    widths    "0.93"
-    pitches   "40" 
-    loffset   2 
-    boffset   0 
-    connect   "{M4_PIN_hor M6} {M6 M7}"
-    vias      "VIA1_RULE_1 VIA2_RULE_1 VIA3_RULE_1 VIA4_RULE_293 VIA5_RULE_360 VIA6_RULE_21 VIA7_RULE_18 VIA8_RULE_1"
-}
-```
-
-If this the only macro grid specification defined, then it will be applied over all the macros in the design.
-
-All horizontal M4 pins on the macros are connected to vertical M6, which is then connected to horizontal M7. In this way macros that
-have their pins oriented in non-preferred routing directions can still be connected up to the power grid.
-
-## Define TCL Procedure
-A function call generate_vias must be created that writes out a definition of VIAs that are referenced by the grid specfications, but do not already exist in the technology LEF.
-
-It is unlikely that the VIAs needed to connect the layers of the power grid will already exist in the technology LEF. The technology LEF provides a mechanism to create VIAs using VIARULES. VIAs referenced in the grid specifications that do not already exist in the technology file are must be created using available VIARULEs. 
-
-The function calls the ```pdn def_out``` function to write DEF for the required VIAs.
-
diff --git a/scripts/pdn/doc/README.md b/scripts/pdn/doc/README.md
deleted file mode 100644
index 5dc2a0e..0000000
--- a/scripts/pdn/doc/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# OpenROAD-pdn

-

-This utility aims to simplify the process of adding a power grid into a floorplan. The aim is to specify a small set of power grid policies to be applied to the design, such as layers to use, stripe width and spacing, then have the utility generate the actual metal straps. Grid policies can be defined over the stdcell area, and over areas occupied by macros.

-

-## Installation and Setup

-

-This package contains the following subdirectories

-* src/ containing source code and executables to run power grid insertion

-* doc/ detailed documentation and examples

-

-To use the src/scripts directory must be added to the PATH environment variable, and to the TCLLIBPATH environment variable (a space delimited list of directories)

-

-```

-% setenv PATH "${PATH}:<pdnDir>/src/scripts"

-% setenv TCLLIBPATH "$TCLLIBPATH <pdnDir>/src/scripts"

-```

-

-where \<pdnDir> is the path to where the installation can be found.

- 

-## Usage

-

-```

-% apply_pdn <configuration_file>

-```

-

-All inputs and power grid policies are specified in a TCL format \<configuration file> 

-

-e.g.

-

-```

-% apply_pdn PDN.cfg

-```

-

-## Config File

-

-For further information on the config file, and to review an example config see the following:

-

-* [PDN.md](PDN.md)

-* [example_PDN.cfg](example_PDN.cfg)

-

-## Assumptions and Limitations

-

-Currently the following assumptions are made:

-

-1. The design is rectangular

-1. The input floorplan def file defines the size of the design, includes the placement of all macro blocks and IO pins

-1. The user must provide a function that will write out the VIAs that are required to connect the layers together. In order to get a DRC clean power grid, it is important that these VIA definitions are themselves DRC clean, and will cause no DRC violations when instantiated in the design.

-

diff --git a/scripts/pdn/doc/example_PDN.cfg b/scripts/pdn/doc/example_PDN.cfg
deleted file mode 100644
index 42ec64a..0000000
--- a/scripts/pdn/doc/example_PDN.cfg
+++ /dev/null
@@ -1,111 +0,0 @@
-### PDN Config. All units in micrometer (um)
-## The values used in this config are for reference only and do not correspond to any specific foundry
-## design name to be used in DEF
-set ::design "ariane"
-
-## DEF DBU 
-set ::def_units "2000"
-
-##Input DEF with macros packed
-set ::FpOutDef "/projects/ssg/pj10000064_diphda/users/colhol01/openroad/TritonFPlan/test/ariane/floorplan.def"
-
-#### input tech lef path
-set ::techLef "/home/zf4_techdata/tsmc65/arm_nda/all_extracted_files/arm/tsmc/cln65lp/arm_tech/r2p0/lef/1p9m_6x2z/sc12_tech.lef"
- 
-#### input cell lef path
-set ::cellLef [list \
-/projects/ssg/pj10000064_diphda/users/colhol01/openroad/TritonFPlan/test/tsmc-65lp/merged.lef]
-
-#### input flat lef path. FLAT LEF that contains physical views of all standard cells and macros in the design
-# Ensure that the file ends with END LIBRARY 
-set ::flatLef /projects/ssg/pj10000064_diphda/users/colhol01/openroad/TritonFPlan/test/tsmc-65lp/merged.lef
-
-set ::macro_power_pins "VDDPE VDDCE"
-set ::macro_ground_pins "VSSE"
-
-#### placement SITE name from LEF
-set ::site_name "sc12_cln65lp" 
-set ::site_width 0.2 
-
-# Floorplan information - core boundary coordinates, std. cell row height,
-# minimum track pitch as defined in LEF
-set ::core_area_llx "14.0000"
-set ::core_area_lly "14.0000"
-set ::core_area_urx "1663.800"
-set ::core_area_ury "1331.600"
-set ::die_area_llx "0"
-set ::die_area_lly "0"
-set ::die_area_urx "1677.8"
-set ::die_area_ury "1345.6"
-set ::row_height "2.4"
-
-# Power nets
-set ::power_nets "VDD"
-set ::ground_nets "VSS"
-
-set ::macro_blockage_layer_list "M1 M2 M3 M4" 
-
-# Details from techlef (BEOL LEF)
-set ::met_layer_list "M1 M2 M3 M4 M5 M6 M7 M8 M9"  ;#From M1 and upwards
-set ::met_layer_dir  "hor ver hor ver hor ver hor ver hor"
-
-# Ensure pitches will make the stripes fall on track
-# Ensure offsets will make the stripes fall on track
-
-pdn specify_grid stdcell [list \
-    layers    "M1 M4 M7" \
-    dir       "hor ver hor" \
-    widths    "0.64 0.93 0.93" \
-    pitches   "2.40 40.0 40.0" \
-    loffset   "0 2 2" \
-    boffset   "0 2 2" \
-    connect   "{M1 M4} {M4 M7}" \
-    vias      "VIA1_RULE_1 VIA2_RULE_1 VIA3_RULE_1 VIA4_RULE_1 VIA5_RULE_264 VIA6_RULE_18 VIA7_RULE_18 VIA8_RULE_1" \
-]
-pdn specify_grid macro [list \
-    layers    "M6" \
-    dir       "ver" \
-    widths    "0.93" \
-    pitches   "40" \
-    loffset   2 \
-    boffset   0 \
-    min_pitch 0.2 \
-    connect   "{M4_PIN_hor M6} {M6 M7}" \
-    vias      "VIA1_RULE_1 VIA2_RULE_1 VIA3_RULE_1 VIA4_RULE_293 VIA5_RULE_360 VIA6_RULE_21 VIA7_RULE_18 VIA8_RULE_1" \
-]
-
-set ::halo 4
-
-# Metal layer for rails on every row
-set ::rails_mlayer "M1" ;
-
-# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
-set ::rails_start_with "GROUND" ;
-
-# POWER or GROUND #Upper metal stripes starting with power or ground rails at the left/bottom of the core area
-set ::stripes_start_with "GROUND" ;
-
-proc generate_viarules {} {
-   pdn def_out "\n\nVIAS 14 ;\n"
-
-   pdn def_out "- VIA1_RULE_1 \n + VIARULE VIA1_RULE \n + CUTSIZE 200 200 \n + LAYERS M1 VIA1 M2 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 80 140 80 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA2_RULE_1 \n + VIARULE VIA2_RULE \n + CUTSIZE 200 200 \n + LAYERS M2 VIA2 M3 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 80 140 80 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA3_RULE_1 \n + VIARULE VIA3_RULE \n + CUTSIZE 200 200 \n + LAYERS M3 VIA3 M4 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 80 140 80 \n + ROWCOL 1 4 \n ;"
-  
-   pdn def_out "- VIA4_RULE_1 \n + VIARULE VIA4_RULE \n + CUTSIZE 200 200 \n + LAYERS M4 VIA4 M5 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 80 140 80 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA4_RULE_6 \n + VIARULE VIA4_RULE \n + CUTSIZE 200 200 \n + LAYERS M4 VIA4 M5 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 20 140 20 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA4_RULE_293 \n + VIARULE VIA4_RULE \n + CUTSIZE 200 200 \n + LAYERS M4 VIA4 M5 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 20 140 20 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA4_RULE_294 \n + VIARULE VIA4_RULE \n + CUTSIZE 200 200 \n + LAYERS M4 VIA4 M5 \n + CUTSPACING 260 260 \n + ENCLOSURE 60 100 60 100 \n + ROWCOL 4 1 \n ;"
-  
-   pdn def_out "- VIA5_RULE_275 \n + VIARULE VIA5_RULE \n + CUTSIZE 200 200 \n + LAYERS M5 VIA4 M6 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 20 140 20 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA5_RULE_264 \n + VIARULE VIA5_RULE \n + CUTSIZE 200 200 \n + LAYERS M5 VIA5 M6 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 80 140 80 \n + ROWCOL 1 4 \n ;"
-   pdn def_out "- VIA5_RULE_360 \n + VIARULE VIA5_RULE \n + CUTSIZE 200 200 \n + LAYERS M5 VIA5 M6 \n + CUTSPACING 260 260 \n + ENCLOSURE 20 220 20 220 \n + ROWCOL 1 4 \n ;"
-
-   pdn def_out "- VIA6_RULE_18 \n + VIARULE VIA6_RULE \n + CUTSIZE 200 200 \n + LAYERS M6 VIA6 M7 \n + CUTSPACING 260 260 \n + ENCLOSURE 140 220 140 220 \n + ROWCOL 2 2 \n ;"
-   pdn def_out "- VIA6_RULE_21 \n + VIARULE VIA6_RULE \n + CUTSIZE 200 200 \n + LAYERS M6 VIA6 M7 \n + CUTSPACING 260 260 \n + ENCLOSURE 20 220 20 220 \n + ROWCOL 2 2 \n ;"
-
-   pdn def_out "- VIA7_RULE_18 \n + VIARULE VIA7_RULE \n + CUTSIZE 720 720 \n + LAYERS M7 VIA7 M8 \n + CUTSPACING 1120 680 \n + ENCLOSURE 1040 140 1040 140 \n + ROWCOL 2 2 \n ;"
-   pdn def_out "- VIA8_RULE_1 \n + VIARULE VIA8_RULE \n + CUTSIZE 720 720 \n + LAYERS M8 VIA8 M9 \n + CUTSPACING 680 1120 \n + ENCLOSURE 40 280 40 280 \n + ROWCOL 2 2 \n ;"
-   pdn def_out "END VIAS"
-}
-
diff --git a/scripts/pdn/init_db.tcl b/scripts/pdn/init_db.tcl
new file mode 100644
index 0000000..f5a58d2
--- /dev/null
+++ b/scripts/pdn/init_db.tcl
@@ -0,0 +1,7 @@
+set db [dbDatabase_create]
+
+set libs [odb_read_lef $db $::env(MERGED_LEF)]
+set chip [odb_read_def $libs $::env(tapcell_tmp_file_tag).def]
+#set chip [odb_read_design $db $:env(MERGED_LEF) $::env(mplace_tmp_file_tag).def]
+
+odb_export_db $db $::env(pdn_tmp_file_tag).odb
diff --git a/scripts/pdn/src/PdnPinDumper/CMakeLists.txt b/scripts/pdn/src/PdnPinDumper/CMakeLists.txt
deleted file mode 100644
index 7dbf7de..0000000
--- a/scripts/pdn/src/PdnPinDumper/CMakeLists.txt
+++ /dev/null
@@ -1,226 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-
-project(PdnPinDumper
-  LANGUAGES CXX
-)
-
-set(CMAKE_CXX_STANDARD 17)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-
-if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
-  message(FATAL_ERROR "PdnPinDumper requires GCC 7 and above! \nuse -DCMAKE_CXX_COMPILER to assign your compiler path")
-endif()
-
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
-set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3")
-
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-
-set(FLEXROUTE_HOME ${PROJECT_SOURCE_DIR} )
-
-set(DEFLIB_HOME
-  ${PROJECT_SOURCE_DIR}/module/def/5.8-p029
-)
-set(LEFLIB_HOME
-  ${PROJECT_SOURCE_DIR}/module/lef/5.8-p029
-)
-
-## include subdirectories 
-add_subdirectory(${DEFLIB_HOME})
-add_subdirectory(${LEFLIB_HOME})
-
-
-## configure settings
-find_package(ZLIB REQUIRED)
-find_package(BISON REQUIRED)
-
-find_package(Boost 1.68.0 REQUIRED)
-find_package(Threads REQUIRED)
-
-set (FLEXROUTE_SRC
-  ${FLEXROUTE_HOME}/src/global.cpp
-  ${FLEXROUTE_HOME}/src/drc/frDRC_util.cpp
-  ${FLEXROUTE_HOME}/src/drc/frDRC_setup.cpp
-  ${FLEXROUTE_HOME}/src/drc/frDRC_init.cpp
-  ${FLEXROUTE_HOME}/src/drc/frDRC_main.cpp
-  ${FLEXROUTE_HOME}/src/io/io_guide.cpp
-  ${FLEXROUTE_HOME}/src/io/frAPG.cpp
-  ${FLEXROUTE_HOME}/src/io/io_parser_helper.cpp
-  ${FLEXROUTE_HOME}/src/io/io.cpp
-  ${FLEXROUTE_HOME}/src/io/defw.cpp
-  ${FLEXROUTE_HOME}/src/io/io_pin.cpp
-  ${FLEXROUTE_HOME}/src/io/frPinPrep.cpp
-  ${FLEXROUTE_HOME}/src/io/frShapeUtil.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexGridGraph.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexGridGraph_maze.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR_maze.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR_end.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR_init.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR_conn.cpp
-  ${FLEXROUTE_HOME}/src/dr/FlexDR_rq.cpp
-  ${FLEXROUTE_HOME}/src/FlexRoute.cpp
-  ${FLEXROUTE_HOME}/src/ta/FlexTA_rq.cpp
-  ${FLEXROUTE_HOME}/src/ta/FlexTA_assign.cpp
-  ${FLEXROUTE_HOME}/src/ta/FlexTA_end.cpp
-  ${FLEXROUTE_HOME}/src/ta/FlexTA_init.cpp
-  ${FLEXROUTE_HOME}/src/ta/FlexTA.cpp
-  ${FLEXROUTE_HOME}/src/frRegionQuery.cpp
-  ${FLEXROUTE_HOME}/src/utility.cpp
-  ${FLEXROUTE_HOME}/src/main.cpp
-  ${FLEXROUTE_HOME}/src/db/obj/frInst.cpp
-  ${FLEXROUTE_HOME}/src/db/obj/frPin.cpp
-  ${FLEXROUTE_HOME}/src/db/obj/frShape.cpp
-  ${FLEXROUTE_HOME}/src/db/obj/frVia.cpp
-  ${FLEXROUTE_HOME}/src/db/taObj/taTrack.cpp
-  ${FLEXROUTE_HOME}/src/db/taObj/taShape.cpp
-  ${FLEXROUTE_HOME}/src/db/infra/frBox.cpp
-  ${FLEXROUTE_HOME}/src/db/infra/frTime.cpp
-  ${FLEXROUTE_HOME}/src/db/infra/frTime_helper.cpp
-  ${FLEXROUTE_HOME}/src/db/infra/frPoint.cpp
-  ${FLEXROUTE_HOME}/src/db/drObj/drVia.cpp
-  ${FLEXROUTE_HOME}/src/db/drObj/drShape.cpp
-  )
-
-
-set (FLEXROUTE_HEADER
-  ${FLEXROUTE_HOME}/src/drc/frDRC.h
-  ${FLEXROUTE_HOME}/src/FlexRoute.h
-  ${FLEXROUTE_HOME}/src/io/frGuidePrep.h
-  ${FLEXROUTE_HOME}/src/io/frAPG.h
-  ${FLEXROUTE_HOME}/src/io/frPinPrep.h
-  ${FLEXROUTE_HOME}/src/io/io.h
-  ${FLEXROUTE_HOME}/src/io/frShapeUtil.h
-  ${FLEXROUTE_HOME}/src/io/frUtil.h
-  ${FLEXROUTE_HOME}/src/frRegionQuery.h
-  ${FLEXROUTE_HOME}/src/frDesign.h
-  ${FLEXROUTE_HOME}/src/frBaseTypes.h
-  ${FLEXROUTE_HOME}/src/dr/FlexDR.h
-  ${FLEXROUTE_HOME}/src/dr/FlexGridGraph.h
-  ${FLEXROUTE_HOME}/src/dr/FlexWavefront.h
-  ${FLEXROUTE_HOME}/src/dr/FlexRegionQuery.h
-  ${FLEXROUTE_HOME}/src/dr/FlexMazeTypes.h
-  ${FLEXROUTE_HOME}/src/ta/FlexTA.h
-  ${FLEXROUTE_HOME}/src/FlexAccessPattern.h
-  ${FLEXROUTE_HOME}/src/global.h
-  ${FLEXROUTE_HOME}/src/db/obj/frTrackPattern.h
-  ${FLEXROUTE_HOME}/src/db/obj/frPin.h
-  ${FLEXROUTE_HOME}/src/db/obj/frInstTerm.h
-  ${FLEXROUTE_HOME}/src/db/obj/frMarker.h
-  ${FLEXROUTE_HOME}/src/db/obj/frRef.h
-  ${FLEXROUTE_HOME}/src/db/obj/frFig.h
-  ${FLEXROUTE_HOME}/src/db/obj/frTerm.h
-  ${FLEXROUTE_HOME}/src/db/obj/frBoundary.h
-  ${FLEXROUTE_HOME}/src/db/obj/frBlock.h
-  ${FLEXROUTE_HOME}/src/db/obj/frVia.h
-  ${FLEXROUTE_HOME}/src/db/obj/frInst.h
-  ${FLEXROUTE_HOME}/src/db/obj/frShape.h
-  ${FLEXROUTE_HOME}/src/db/obj/frGuide.h
-  ${FLEXROUTE_HOME}/src/db/obj/frBlockObject.h
-  ${FLEXROUTE_HOME}/src/db/obj/frInstBlockage.h
-  ${FLEXROUTE_HOME}/src/db/obj/frNet.h
-  ${FLEXROUTE_HOME}/src/db/obj/frBlockage.h
-  ${FLEXROUTE_HOME}/src/db/obj/frCMap.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taShape.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taFig.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taVia.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taTrack.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taBlockObject.h
-  ${FLEXROUTE_HOME}/src/db/taObj/taPin.h
-  ${FLEXROUTE_HOME}/src/db/infra/frBox.h
-  ${FLEXROUTE_HOME}/src/db/infra/frOrient.h
-  ${FLEXROUTE_HOME}/src/db/infra/frPrefRoutingDir.h
-  ${FLEXROUTE_HOME}/src/db/infra/frSegStyle.h
-  ${FLEXROUTE_HOME}/src/db/infra/frTime.h
-  ${FLEXROUTE_HOME}/src/db/infra/frPoint.h
-  ${FLEXROUTE_HOME}/src/db/infra/frTransform.h
-  ${FLEXROUTE_HOME}/src/db/tech/frTechObject.h
-  ${FLEXROUTE_HOME}/src/db/tech/frConstraint.h
-  ${FLEXROUTE_HOME}/src/db/tech/frLayer.h
-  ${FLEXROUTE_HOME}/src/db/tech/frLookupTbl.h
-  ${FLEXROUTE_HOME}/src/db/tech/frViaRuleGenerate.h
-  ${FLEXROUTE_HOME}/src/db/tech/frViaDef.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drBlockObject.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drNet.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drFig.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drVia.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drMarker.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drShape.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drRef.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drAccessPattern.h
-  ${FLEXROUTE_HOME}/src/db/drObj/drPin.h
-  )
-
-############################################################
-# include directories 
-############################################################
-include_directories(
-  ${BOOST_INCLUDEDIR}
-  ${BOOST_ROOT}/include
-
-  ${DEFLIB_HOME}/def
-  ${DEFLIB_HOME}/defzlib
-  ${DEFLIB_HOME}/cdef
-  ${DEFLIB_HOME}/cdefzlib
-
-  ${LEFLIB_HOME}/lef
-  ${LEFLIB_HOME}/lefzlib
-  ${LEFLIB_HOME}/clef
-  ${LEFLIB_HOME}/clefzlib
-
-  ${FLEXROUTE_HOME}/src
-)
-
-############################################################
-# Create a library 
-############################################################
-add_library( flexroutelib STATIC
-  ${FLEXROUTE_SRC}
-)
-
-set_target_properties( flexroutelib 
-  PROPERTIES OUTPUT_NAME "flexroute"
-)
-
-############################################################
-# Create an executable
-############################################################
-add_executable( PdnPinDumper 
-  ${FLEXROUTE_SRC}
-)
-
-add_dependencies( PdnPinDumper def )
-add_dependencies( PdnPinDumper lef )
-
-add_dependencies( flexroutelib def )
-add_dependencies( flexroutelib lef )
-
-target_link_libraries( PdnPinDumper 
-  PUBLIC
-  def
-  #defzlib
-  #cdef
-  #cdefzlib
-  lef
-  #lefzlib
-  #clef
-  #clefzlib
-
-  ${ZLIB_LIBRARIES}
-  Threads::Threads
-  -static 
-  )
-
-############################################################
-# Install  
-############################################################
-
-install(FILES ${FLEXROUTE_HEADER} DESTINATION include)
-install(TARGETS PdnPinDumper DESTINATION bin)
-install(TARGETS PdnPinDumper DESTINATION lib)
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/LICENSE b/scripts/pdn/src/PdnPinDumper/LICENSE
deleted file mode 100644
index c30dd48..0000000
--- a/scripts/pdn/src/PdnPinDumper/LICENSE
+++ /dev/null
@@ -1,58 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2019, The Regents of the University of California
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
-================================================
-Physical Memory Use
-====
-Author:  David Robert Nadeau
-Site:    http://NadeauSoftware.com/
-License: Creative Commons Attribution 3.0 Unported License
-         http://creativecommons.org/licenses/by/3.0/deed.en_US
-================================================
-
-================================================
-LEF/DEF v5.8 and Above Toolkit
-====
-Copyright 2012 - 2017, Cadence Design Systems
- 
-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
- 
-    http://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 
-================================================
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/README.md b/scripts/pdn/src/PdnPinDumper/README.md
deleted file mode 100644
index d1c0f8c..0000000
--- a/scripts/pdn/src/PdnPinDumper/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# PdnPinDumper
-**PdnPinDumper** is a temporary utility to get MACRO pin location for PDN construction.
-It is based on TritonRoute database and will be replaced by 
-[OpenROAD](https://theopenroadproject.org/) database once available.
-
-## Installation ##
-PdnPinDumper is tested in 64-bit CentOS 6/7 environments with the following
-prerequisites:
-* A compatible C++ compiler supporting C++17 (GCC 7 and above)
-* Boost >= 1.68.0
-* Bison >= 3.0.4
-* zlib >= 1.2.7
-* CMake >= 3.1
-
-To install PdnPinDumper:
-```
-$ cd PdnPinDumper
-$ mkdir build
-$ cd build
-$ cmake -DBOOST_ROOT=<BOOST_ROOT> ../
-$ make
-```
-   
-## Supported Technologies ##
-* CLN65LP (with limited selection of macros)
-
-## License ##
-* [BSD 3-clause License](LICENSE) 
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/.gitignore b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/.gitignore
deleted file mode 100644
index 9996f00..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-bin/
-bin/defdiff
-bin/defrw
-bin/defwrite
-bin/lefdefdiff
-def/*.output
-def/*.tab.h
-def/*.tab.cpp
-defdiff/defdiff
-defrw/defrw
-defwrite/defwrite
-defzlib/*.a
-include/*.h
-include/*.hpp
-lib/*.a
-*.a
-**/*.a
-
-Makefile
-CMakeCache.txt
-*.cmake
-CMakeFiles
-install_manifest.txt
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/CMakeLists.txt b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/CMakeLists.txt
deleted file mode 100644
index c014826..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/CMakeLists.txt
+++ /dev/null
@@ -1,256 +0,0 @@
-# DEF PARSER CMAKE Compile Settings
-project(DEF_PARSER 
-  LANGUAGES CXX 
-)
-
-cmake_minimum_required(VERSION 3.1)
-
-set(DEFLIB_HOME ${CMAKE_CURRENT_SOURCE_DIR})
-
-set(CMAKE_CXX_FLAGS_DEBUG "-g -ggdb")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3")
-
-# BISON and ZLIB is required to compile DEF/LEF Parsers.
-find_package(BISON)
-find_package(ZLIB)
-
-############################################################
-# Create a library for DEF
-############################################################
-set( DEFLIB_DEF_SRC
-  def/defiAlias.cpp
-  def/defiAssertion.cpp
-  def/defiBlockage.cpp
-  def/defiComponent.cpp
-  def/defiDebug.cpp
-  def/defiFill.cpp
-  def/defiFPC.cpp
-  def/defiGroup.cpp
-  def/defiIOTiming.cpp
-  def/defiMisc.cpp
-  def/defiNet.cpp
-  def/defiNonDefault.cpp
-  def/defiPartition.cpp
-  def/defiPath.cpp
-  def/defiPinCap.cpp
-  def/defiPinProp.cpp
-  def/defiProp.cpp
-  def/defiPropType.cpp
-  def/defiRegion.cpp
-  def/defiRowTrack.cpp
-  def/defiScanchain.cpp
-  def/defiSite.cpp
-  def/defiSlot.cpp
-  def/defiTimingDisable.cpp
-  def/defiUtil.cpp
-  def/defiVia.cpp
-  def/def_keywords.cpp
-  def/defrCallbacks.cpp
-  def/defrData.cpp
-  def/defrReader.cpp
-  def/defrSettings.cpp
-  def/defwWriterCalls.cpp
-  def/defwWriter.cpp
-  def/def.tab.cpp
-  )
-
-set( DEFLIB_DEFZLIB_SRC 
-  defzlib/defzlib.cpp
-  )
-
-set ( DEFLIB_CDEF_SRC 
-  cdef/xdefiAssertion.cpp
-  cdef/xdefiBlockage.cpp
-  cdef/xdefiComponent.cpp
-  cdef/xdefiDebug.cpp
-  cdef/xdefiFill.cpp
-  cdef/xdefiFPC.cpp
-  cdef/xdefiGroup.cpp
-  cdef/xdefiIOTiming.cpp
-  cdef/xdefiMisc.cpp
-  cdef/xdefiNet.cpp
-  cdef/xdefiNonDefault.cpp
-  cdef/xdefiPartition.cpp
-  cdef/xdefiPath.cpp
-  cdef/xdefiPinCap.cpp
-  cdef/xdefiPinProp.cpp
-  cdef/xdefiProp.cpp
-  cdef/xdefiPropType.cpp
-  cdef/xdefiRegion.cpp
-  cdef/xdefiRowTrack.cpp
-  cdef/xdefiScanchain.cpp
-  cdef/xdefiSite.cpp
-  cdef/xdefiSlot.cpp
-  cdef/xdefiTimingDisable.cpp
-  cdef/xdefiVia.cpp
-  cdef/xdefrReader.cpp
-  cdef/xdefwWriterCalls.cpp
-  cdef/xdefwWriter.cpp
-  )
-
-set (DEFLIB_CDEFZLIB_SRC
-  cdefzlib/cdefzlib.c
-  )
-
-set (DEFLIB_HEADERS
-  def/def.tab.h
-  def/lex.h
-  def/defiAlias.hpp
-  def/defiAssertion.hpp
-  def/defiBlockage.hpp
-  def/defiComponent.hpp
-  def/defiDebug.hpp
-  def/defiDefs.hpp
-  def/defiFill.hpp
-  def/defiFPC.hpp
-  def/defiGroup.hpp
-  def/defiIOTiming.hpp
-  def/defiKRDefs.hpp
-  def/defiMisc.hpp
-  def/defiNet.hpp
-  def/defiNonDefault.hpp
-  def/defiPartition.hpp
-  def/defiPath.hpp
-  def/defiPinCap.hpp
-  def/defiPinProp.hpp
-  def/defiProp.hpp
-  def/defiPropType.hpp
-  def/defiRegion.hpp
-  def/defiRowTrack.hpp
-  def/defiScanchain.hpp
-  def/defiSite.hpp
-  def/defiSlot.hpp
-  def/defiTimingDisable.hpp
-  def/defiUser.hpp
-  def/defiUtil.hpp
-  def/defiVia.hpp
-  def/defrCallBacks.hpp
-  def/defrData.hpp
-  def/defrReader.hpp
-  def/defrSettings.hpp
-  def/defwWriterCalls.hpp
-  def/defwWriter.hpp
-
-  defzlib/defzlib.hpp
-
-  cdef/defiAlias.h
-  cdef/defiAssertion.h
-  cdef/defiBlockage.h
-  cdef/defiComponent.h
-  cdef/defiDebug.h
-  cdef/defiDefs.h
-  cdef/defiFill.h
-  cdef/defiFPC.h
-  cdef/defiGroup.h
-  cdef/defiIOTiming.h
-  cdef/defiKRDefs.h
-  cdef/defiMisc.h
-  cdef/defiNet.h
-  cdef/defiNonDefault.h
-  cdef/defiPartition.h
-  cdef/defiPath.h
-  cdef/defiPinCap.h
-  cdef/defiPinProp.h
-  cdef/defiProp.h
-  cdef/defiPropType.h
-  cdef/defiRegion.h
-  cdef/defiRowTrack.h
-  cdef/defiScanchain.h
-  cdef/defiSite.h
-  cdef/defiSlot.h
-  cdef/defiTimingDisable.h
-  cdef/defiTypedefs.h
-  cdef/defiUser.h
-  cdef/defiVia.h
-  cdef/defMsgTable.h
-  cdef/defrReader.h
-  cdef/defwWriterCalls.h
-  cdef/defwWriter.h
-
-  cdefzlib/defzlib.h
-)
-
-
-# BISON dependencies
-add_custom_command( 
-  OUTPUT ${DEFLIB_HOME}/def/def.tab.cpp
-  COMMAND ${BISON_EXECUTABLE} -v -pdefyy -d ${DEFLIB_HOME}/def/def.y 
-  COMMAND mv def.tab.h ${DEFLIB_HOME}/def/def.tab.h
-  COMMAND mv def.tab.c ${DEFLIB_HOME}/def/def.tab.cpp
-)
-add_custom_target(DefBisonTarget ALL DEPENDS def/def.tab.cpp)
-
-
-add_library( def STATIC ${DEFLIB_DEF_SRC} )
-add_library( defzlib STATIC ${DEFLIB_DEFZLIB_SRC} )
-
-add_library( cdef STATIC ${DEFLIB_CDEF_SRC} )
-add_library( cdefzlib STATIC ${DEFLIB_CDEFZLIB_SRC})
-
-
-set_target_properties( def
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-)
-
-set_target_properties( defzlib
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-)
-
-set_target_properties( cdef
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-)
-
-set_target_properties( cdefzlib 
-  PROPERTIES 
-  ARCHIVE_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${DEFLIB_HOME}/lib
-  LINKER_LANGUAGE CXX 
-)
-
-# include directory settings
-target_include_directories( def
-  PUBLIC
-  def/
-  )
-
-target_include_directories( defzlib
-  PUBLIC
-  def/
-  defzlib/
-  )
-
-target_include_directories( cdef 
-  PUBLIC
-  def/
-  cdef/
-  )
-
-target_include_directories( cdefzlib
-  PUBLIC
-  def/
-  defzlib/
-  cdef/
-  cdefzlib/
-  )
-
-add_dependencies( cdef def )
-add_dependencies( def DefBisonTarget )
-add_dependencies( defzlib def )
-add_dependencies( cdefzlib cdef )
-
-######################################################
-# install
-
-install(FILES ${DEFLIB_HEADERS} DESTINATION include)
-install(TARGETS def defzlib cdef cdefzlib DESTINATION lib)
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/LICENSE.TXT b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/LICENSE.TXT
deleted file mode 100644
index b7802a4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/LICENSE.TXT
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2012 - 2017, Cadence Design Systems
- 
-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
- 
-    http://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.
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def
deleted file mode 100644
index ec4af50..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def
+++ /dev/null
@@ -1,1007 +0,0 @@
-###############################################################################
-# DEF57_01 testcase
-###############################################################################
-VERSION 5.8 ; 
-NAMESCASESENSITIVE ON ;
-DIVIDERCHAR "/" ;
-BUSBITCHARS "[]" ;
-DESIGN design ;
-TECHNOLOGY technology ;
-UNITS DISTANCE MICRONS 1000 ;
-
-
-
-###############################################################################
-# PROPERTYDEFINITIONS 
-#    objectType propName propType [ RANGE min max ] [ value ] ; ... 
-# END PROPERTYDEFINITIONS 
-###############################################################################
-PROPERTYDEFINITIONS
-  DESIGN strprop STRING "aString" ;
-  DESIGN intprop INTEGER 1 ;
-  DESIGN realprop REAL 1.1 ;
-  DESIGN intrangeprop INTEGER RANGE 1 100 25 ;
-  DESIGN realrangeprop REAL RANGE 1.1 100.1 25.25 ;
-  REGION strprop STRING ;
-  REGION intprop INTEGER ;
-  REGION realprop REAL ;
-  REGION intrangeprop INTEGER RANGE 1 100 ;
-  REGION realrangeprop REAL RANGE 1.1 100.1 ;
-  GROUP strprop STRING ;
-  GROUP intprop INTEGER ;
-  GROUP realprop REAL ;
-  GROUP intrangeprop INTEGER RANGE 1 100 ;
-  GROUP realrangeprop REAL RANGE 1.1 100.1 ;
-  COMPONENT strprop STRING ;
-  COMPONENT intprop INTEGER ;
-  COMPONENT realprop REAL ;
-  COMPONENT intrangeprop INTEGER RANGE 1 100 ;
-  COMPONENT realrangeprop REAL RANGE 1.1 100.1 ;
-  NET strprop STRING ;
-  NET intprop INTEGER ;
-  NET realprop REAL ;
-  NET intrangeprop INTEGER RANGE 1 100 ;
-  NET realrangeprop REAL RANGE 1.1 100.1 ;
-  SPECIALNET strprop STRING ;
-  SPECIALNET intprop INTEGER ;
-  SPECIALNET realprop REAL ;
-  SPECIALNET intrangeprop INTEGER RANGE 1 100 ;
-  SPECIALNET realrangeprop REAL RANGE 1.1 100.1 ;
-  ROW strprop STRING ;
-  ROW intprop INTEGER ;
-  ROW realprop REAL ;
-  ROW intrangeprop INTEGER RANGE 1 100 ;
-  ROW realrangeprop REAL RANGE 1.1 100.1 ;
-  COMPONENTPIN strprop STRING ;
-  COMPONENTPIN intprop INTEGER ;
-  COMPONENTPIN realprop REAL ;
-  COMPONENTPIN intrangeprop INTEGER RANGE 1 100 ;
-  COMPONENTPIN realrangeprop REAL RANGE 1.1 100.1 ;
-  NONDEFAULTRULE strprop STRING ;
-  NONDEFAULTRULE intprop INTEGER ;
-  NONDEFAULTRULE realprop REAL ;
-  NONDEFAULTRULE intrangeprop INTEGER RANGE 1 100 ;
-  NONDEFAULTRULE realrangeprop REAL RANGE 1.1 100.1 ;
-END PROPERTYDEFINITIONS
-
-
-
-###############################################################################
-# DIEAREA pt pt ;
-###############################################################################
-DIEAREA ( -190000 -120000 ) ( -190000 350000 ) ( 190000 350000 )
-        ( 190000 190000 ) ( 190360 190000 ) ( 190360 -120000 ) ;
-
-
-
-###############################################################################
-# ROW rowName rowType origX origY orient
-#     { DO numX BY 1 STEP spaceX 0
-#     | DO 1 BY numY STEP 0 spaceY }
-#     + PROPERTY { propName propVal }... ;
-###############################################################################
-ROW ROW_1 CORE 1000 1000 N DO 100 BY 1 STEP 700 0
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-ROW ROW_2 CORE 1000 2000 S DO 100 BY 1 STEP 700 0 ;
-ROW ROW_3 CORE 1000 3000 E DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_4 CORE 1000 4000 W DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_5 CORE 1000 5000 FN DO 100 BY 1 STEP 700 0 ;
-ROW ROW_6 CORE 1000 6000 FS DO 100 BY 1 STEP 700 0 ;
-ROW ROW_7 CORE 1000 7000 FE DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_8 CORE 1000 8000 FW DO 100 BY 1 STEP 8400 0 ;
-
-ROW ROW_VERT_1 CORE -10000 -10000 N DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_2 CORE -9000 -10000 S DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_3 CORE -8000 -10000 E DO 1 BY 10 STEP 0 700 ;
-ROW ROW_VERT_4 CORE -7000 -10000 W DO 1 BY 10 STEP 0 700 ;
-ROW ROW_VERT_5 CORE -6000 -10000 FN DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_6 CORE -5000 -10000 FS DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_7 CORE -4000 -10000 FE DO 1 BY 10 STEP 0 700 ;
-ROW ROW_VERT_8 CORE -3000 -10000 FW DO 1 BY 1 STEP 0 700 ;
-
-ROW ROW_array0 ARRAYSITE 10000 10000 N DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array1 ARRAYSITE 10000 17000 W DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array2 ARRAYSITE 10000 17000 S DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array3 ARRAYSITE 10000 17000 E DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array4 ARRAYSITE 10000 17000 FN DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array5 ARRAYSITE 10000 17000 FE DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array6 ARRAYSITE 10000 17000 FS DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array7 ARRAYSITE 10000 17000 FW DO 100 BY 1 STEP 16000 0 ;
-
-
-
-###############################################################################
-# TRACKS 
-#    {X | Y} start 
-#    DO numtracks STEP space 
-#    [ MASK maskNum {SAMEMASK]]
-#    [ LAYER layerName ...] ;
-###############################################################################
-TRACKS Y 52 DO 857 STEP 104 MASK 1 ;
-TRACKS Y 52 DO 857 STEP 104 MASK 1 SAMEMASK LAYER M1 M2 ;
-TRACKS X 52 DO 1720 STEP 104 MASK 2 LAYER M2 ;
-TRACKS X 52 DO 1720 STEP 104 ;
-
-
-###############################################################################
-# GCELLGRID 
-#    X start DO numColumns+1 STEP space 
-#    Y start DO numRows+1 STEP space ;
-###############################################################################
-GCELLGRID X 0 DO 100 STEP 600 ;
-GCELLGRID Y 10 DO 120 STEP 400 ;
-
-
-
-###############################################################################
-# VIAS numVias ;
-#     [- viaName 
-#     [+ PATTERNNAME patternName]
-#      + RECT layerName [+ MASK maskNUM] pt pt
-#       | + POLYGON layerName [+ MASK maskNUM] pt pt pt]...;]... 
-# END VIAS
-###############################################################################
-VIAS 6 ;
-- VIAGEN12_0
-    + PATTERNNAME VIAGEN_12_12.800_7.600_I5
-    + RECT METAL1 ( -4400 -3800 ) ( 4400 3800 )
-    + RECT M2 + MASK 3 ( -4500 -3800 ) ( 4500 3800 )
-    + RECT V1 + MASK 2 ( -3600 -3800 ) ( -2000 -2200 )
-    + RECT V1 + MASK 1 ( -3600 2200 ) ( -2000 3800 )
-    + RECT V1 + MASK 2 ( 2000 -3800 ) ( 3600 -2200 )
-    + RECT V1 + MASK 3 ( 2000 2200 ) ( 3600 3800 ) ;
-
-- VIAGEN12_2
-    + PATTERNNAME VIAGEN_12_5.0000_3.000_1.5600_-0.1600_1.0400_1.0400_D
-    + RECT METAL1 ( -2500 -1500 ) ( 2500 1500 )
-    + RECT M2 ( -2500 -1500 ) ( 2500 1500 )
-    + RECT V1 ( -2360 -960 ) ( -760 640 )
-    + RECT V1 ( -1320 -960 ) ( 280 640 )
-    + RECT V1 ( 760 -960 ) ( 2360 640 ) ;
-
-- VIAGEN12_3
-    + PATTERNNAME VIAGEN12
-    + RECT METAL1 ( -1600 -1600 ) ( 1600 1600 )
-    + RECT M2 ( -1600 -1600 ) ( 1600 1600 )
-    + RECT V1 ( -800 -800 ) ( 800 800 ) ;
-
-- VIAGEN12_4
-    + VIARULE VIAGEN12
-    + CUTSIZE 1600 1600
-    + LAYERS M1 V1 M2
-    + CUTSPACING 5600 6100
-    + ENCLOSURE 100 100 150 150
-    + ROWCOL 5 14
-    + PATTERN 2_FFE0_3_FFFF 
-    + ORIGIN 10 -10
-    + OFFSET 0 0 20 -20 ;
-
-- M2_M1rct_0
-  + RECT V1 ( -25 -65 ) ( 25 65 )
-  + RECT M1 ( -35 -95 ) ( 35 95 )
-  + RECT M2 ( -65 -65 ) ( 65 65 ) ;
-
-- VIAGEN12_1
-    + POLYGON METAL1 + MASK 2 ( -2500 -1500 ) ( -2500 2500 ) ( 1500 2500 ) ( 1500 1500 ) ( 2500 1500 ) ( 2500 -1500 )
-    + RECT M2 ( -2500 -1500 ) ( 2500 1500 )
-    + RECT V1 ( -2400 -960 ) ( -700 640 ) ;
-    
-- CUSTOMVIA
-    + POLYGON METAL1 + MASK 3 ( -2500 -1500 ) ( -2500 2500 ) ( 1500 2500 ) ( 1500 1500 ) ( 2500 1500 ) ( 2500 -1500 ) ;
-    
-- TURNM1_1
-    + RECT METAL1 ( -100 -60 ) ( 100 60 ) ;
-- TURNM2_1
-    + RECT M2 ( -100 -60 ) ( 100 60 ) ;
-- TURNM3_1
-    + RECT M3 ( -100 -60 ) ( 100 60 ) ;
-- myvia1
-    + RECT METAL1 + MASK 2 ( 0 0 ) ( 40000 40000 )
-    + RECT V1 + MASK 3 ( 0 0 ) ( 40000 40000 )
-    + RECT M2 ( 0 0 ) ( 40000 40000 ) ;
-END VIAS
-
-
-
-###############################################################################
-# [STYLES numStyles ;
-#     {- STYLE styleNum pt pt pt Â… ;} ...
-# END STYLES]
-###############################################################################
-STYLES 10 ;
-- STYLE 0 ( 30 10 ) ( 10 30 ) ( -10 30 ) ( -30 10 ) ( -30 -10 ) ( -10 -30 ) ( 10 -30 ) ( 30 -10 ) ;
-- STYLE 1 ( 25 25 ) ( -25 25 ) ( -25 -25 ) ( 25 -25 ) ;
-- STYLE 2 ( 50 50 ) ( -50 50 ) ( -50 -50 ) ( 50 -50 ) ;
-- STYLE 3 ( 50 21 ) ( 21 50 ) ( -21 50 ) ( -50 21 ) ( -50 -21 ) ( -21 -50 ) ( 21 -50 ) ( 50 -21 ) ;
-- STYLE 4 ( -30 -20 ) ( 10 -60 ) ( 50 -20 ) ( 50 40 ) ( 0 40 ) ( -30 10 ) ;
-- STYLE 5 ( 0 2000 ) ( 0 -2000 ) ( 0 2000 ) ( 0 -2000 ) ;
-- STYLE 6 ( -2000 2000 ) ( 2000 -2000 ) ( * * ) ;
-- STYLE 7 ( 0 0 ) ( 0 1000 ) ( 1000 0 ) ;
-- STYLE 8 ( -7500 -3110 ) ( -3110 -7500 ) ( 3110 -7500 ) ( 7500 -3110 ) ( 7500 7500 ) ( -7500 7500 ) ;
-- STYLE 9 ( 0 -10610 ) ( 7500 -3110 ) ( 7500 3110 ) ( 3110 7500 ) ( -3110 7500 ) ( -10610 0 ) ;
-END STYLES
-
-
-
-###############################################################################
-# [NONDEFAULTRULES numNDRs ;
-#     {- STYLE styleNum pt pt pt Â… ;} ...
-# END NONDEFAULTRULES]
-###############################################################################
-NONDEFAULTRULES 1 ;
-- DEFAULT
-  + LAYER METAL1
-      WIDTH 10.1
-      DIAGWIDTH 8.01
-      SPACING 2.2
-      WIREEXT 1.1
-  + LAYER M2
-      WIDTH 10.1
-      SPACING 2.2
-  + LAYER M3
-      WIDTH 11.1
-      SPACING 3.2
-  + VIA M1_M2
-  + VIA M2_M3
-  + VIARULE VIAGEN12
-  + MINCUTS V1 2
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- RULE2
-  + HARDSPACING 
-  + LAYER METAL1
-      WIDTH 10.1
-      DIAGWIDTH 8.01
-      SPACING 2.2
-      WIREEXT 1.1
-  + LAYER M2
-      WIDTH 10.1
-      SPACING 2.2
-  + LAYER M3
-      WIDTH 11.1
-      SPACING 3.2
-  + VIA M1_M2
-  + VIA M2_M3
-  + VIARULE VIAGEN12
-  + MINCUTS V1 2
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-END NONDEFAULTRULES
-
-
-###############################################################################
-# REGIONS numRegions; 
-#     [- regionName pt pt [pt pt]... 
-#     [+ TYPE [ FENCE | GUIDE ]
-#     [+ PROPERTY {propName propVal}...]...;]... 
-# END REGIONS
-###############################################################################
-REGIONS 2 ;
-- region1 ( -500 -500 ) ( 300 100 ) ( 500 500 ) ( 1000 1000 )
-  + TYPE FENCE
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- region2 ( 4000 0 ) ( 5000 1000 )
-  + TYPE GUIDE ;
-END REGIONS
-
-
-
-###############################################################################
-# COMPONENTS numComps ; 
-#     [- compName modelName[netName | *]... 
-#         [+ EEQMASTER macroname] 
-#         [+ GENERATE generatorName [parameters]] 
-#         [+ SOURCE {NETLIST | DIST | USER | TIMING}] 
-#         [+ FOREIGN foreignCellName pt orient]... 
-#         [+ {FIXED pt orient | COVER pt orient | PLACED pt orient | UNPLACED}]
-#         [+ WEIGHT weight] 
-#         [+ REGION {pt pt | regionName}] 
-#         [+ PROPERTY {propName propVal}...]...; 
-#     ]... 
-# END COMPONENTS
-###############################################################################
-COMPONENTMASKSHIFT M3 M2 V1 M1 ;
-
-COMPONENTS 13 ;
-- I1 B
-  + EEQMASTER A
-  + GENERATE generator 
-  + SOURCE NETLIST
-  + FOREIGN gds2name ( -500 -500 ) N
-  + PLACED ( 100 100 ) N
-  + WEIGHT 100
-  + REGION region1 
-  + MASKSHIFT 1102
-  + HALO 5 6 7 8
-  + HALO SOFT 5 6 7 8
-  + ROUTEHALO 100 METAL1 M3
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- I2 A
-  + SOURCE DIST
-  + ROUTEHALO 100 M2 M3
-  + PLACED ( 200 200 ) S ;
-- I3 A
-  + SOURCE USER
-  + PLACED ( 300 300 ) E ;
-- I4 A
-  + SOURCE TIMING
-  + PLACED ( 400 400 ) W ;
-- I5 A
-  + PLACED ( 500 500 ) FN ;
-- I6 A
-  + PLACED ( 600 600 ) FS ;
-- I7 A
-  + PLACED ( 700 700 ) FE ;
-- I8 A
-  + PLACED ( 800 800 ) FW ;
-- I9 A
-  + FIXED ( 900 900 ) N ;
-- I10 A
-  + COVER ( 1000 1000 ) N ;
-- I11 A
-  + UNPLACED ;
-- I12[0] A ;
-- I12[1] A ;
-- I13[0][10] A ;
-- I14\[1\] A ;
-- vectormodule[1]/scalarname A ;
-- vectormodule[1]/vectorname[1] A ;
-- scancell1 CHK3A ;
-- scancell2 CHK3A ;
-- scancell3 CHK3A ;
-- scancell4 CHK3A ;
-- scancell5 CHK3A ;
-- scancell6 CHK3A ;
-- scancell7 CHK3A ;
-- scancell8 CHK3A ;
-- scancell9 CHK3A ;
-- scancell10 CHK3A ;
-- scancell11 CHK3A ;
-- scancell12 CHK3A ;
-- nobrackets A ;
-- somethingwith[1] A ;
-- more[]brackets A ;
-- more[1]brackets A ;
-- more\[1\]brackets A ;
-- more[1][2] A ;
-- more\[1\]\[2\] A ;
-- more\[2\] A ;
-- foo\[1\]\[2\]/haha\[3\]\[4\] A ;
-- foo[2][3]/haha[4][5] A ;
-- foo\[3\]\[4\]/haha[5][6] A ;
-- foo[4][5]/haha\[6\]\[7\] A ;
-- foo[5][6]bar/haha\[7\]\[8\] A ;
-- foo[6][7]bar/haha[8][9] A ;
-END COMPONENTS
-
-
-###############################################################################
-# PINS numPins ; 
-#     [ - pinName + NET netName 
-#        [+ SPECIAL] 
-#        [+ DIRECTION {INPUT | OUTPUT | INOUT | FEEDTHRU}] 
-#        [+ USE {SIGNAL | POWER | GROUND | CLOCK
-#                    | ANALOG |  SCAN  |  RESET}] 
-#        [+ LAYER layerName pt pt] 
-#        [+ {FIXED | PLACED | COVER} pt orient] 
-#        [+ ANTENNAPINPARTIALMETALAREA      integer [LAYER layerName] ] ... 
-#        [+ ANTENNAPINPARTIALMETALSIDEAREA  integer [LAYER layerName] ] ... 
-#        [+ ANTENNAPINDIFFAREA              integer [LAYER layerName] ] ... 
-#        [+ ANTENNAPINPARTIALCUTAREA        integer [LAYER cutLayerName] ] ... 
-#        [+ ANTENNAMODEL OXIDE{1,2,3,4} ]
-#        [+ ANTENNAPINGATEAREA              integer [LAYER layerName] ] ... 
-#        [+ ANTENNAPINMAXAREACAR            integer LAYER layerName ] 
-#        [+ ANTENNAPINMAXSIDEAREACAR        integer LAYER layerName ] 
-#        [+ ANTENNAPINMAXCUTCAR             integer LAYER layerName ] 
-#     ; 
-#     ]... 
-# END PINS 
-###############################################################################
-PINS 11 ;
-- P0 + NET N0
-  + SPECIAL
-  + DIRECTION INPUT
-  + USE SIGNAL
-  + PORT
-    + LAYER M2 MASK 2 ( 0 0 ) ( 30 135 )
-    + VIA VIAGEN12_0 ( 0 100 )
-    + FIXED ( 45 -2160 ) N
-  + PORT
-    + LAYER M1 ( 0 0 ) ( 30 135 )
-    + VIA M1_M2 MASK 23 ( 100 0 )
-    + COVER ( 0 -1000 ) N
-  + PORT
-    + LAYER M3 ( 0 0 ) ( 30 135 )
-    + PLACED ( 1000 -1000 ) N
-  + NETEXPR "power1 VDD"
-  + SUPPLYSENSITIVITY P1
-  + GROUNDSENSITIVITY P2
-  + ANTENNAPINPARTIALMETALAREA      5 LAYER METAL1
-  + ANTENNAPINPARTIALMETALAREA      5 LAYER M2
-  + ANTENNAPINPARTIALMETALSIDEAREA  10 LAYER METAL1
-  + ANTENNAPINPARTIALMETALSIDEAREA  10 LAYER M2
-  + ANTENNAPINDIFFAREA              20 LAYER M1
-  + ANTENNAPINDIFFAREA              20 LAYER M2
-  + ANTENNAPINPARTIALCUTAREA        35 LAYER V1
-  + ANTENNAPINPARTIALCUTAREA        35 LAYER V2
-  + ANTENNAMODEL OXIDE1
-  + ANTENNAPINGATEAREA              15 LAYER M1
-  + ANTENNAPINGATEAREA              15 LAYER M2
-  + ANTENNAPINMAXAREACAR            25 LAYER M1
-  + ANTENNAPINMAXSIDEAREACAR        30 LAYER M1
-  + ANTENNAPINMAXCUTCAR             40 LAYER M1 
-  + ANTENNAMODEL OXIDE2
-  + ANTENNAPINGATEAREA              115 LAYER M1
-  + ANTENNAPINGATEAREA              115 LAYER M2
-  + ANTENNAPINMAXAREACAR            125 LAYER M1
-  + ANTENNAPINMAXSIDEAREACAR        130 LAYER M1
-  + ANTENNAPINMAXCUTCAR             140 LAYER M1
-  + ANTENNAMODEL OXIDE3
-  + ANTENNAPINGATEAREA              115 LAYER M1
-  + ANTENNAPINGATEAREA              115 LAYER M2
-  + ANTENNAPINMAXAREACAR            125 LAYER M1
-  + ANTENNAPINMAXSIDEAREACAR        130 LAYER M1
-  + ANTENNAPINMAXCUTCAR             140 LAYER M1
-  + ANTENNAMODEL OXIDE4
-  + ANTENNAPINGATEAREA              115 LAYER M1
-  + ANTENNAPINGATEAREA              115 LAYER M2
-  + ANTENNAPINMAXAREACAR            125 LAYER M1
-  + ANTENNAPINMAXSIDEAREACAR        130 LAYER M1
-  + ANTENNAPINMAXCUTCAR             140 LAYER M1 ;
-- P1  + NET N1
-  + DIRECTION OUTPUT
-  + USE POWER
-  + POLYGON M2 MASK 3 ( 0 0 ) ( 0 100 ) ( 50 100 ) ( 50 50 ) ( 100 50 ) ( 100 0 )
-  + PLACED ( 45 -2160 ) N 
-  + NETEXPR "power1 VDD[1]"
-  + ANTENNAPINPARTIALMETALAREA      5
-  + ANTENNAPINPARTIALMETALSIDEAREA  10
-  + ANTENNAPINGATEAREA              15
-  + ANTENNAPINDIFFAREA              20
-  + ANTENNAPINPARTIALCUTAREA        35 ;
-- P2  + NET N2
-  + DIRECTION INOUT
-  + USE GROUND
-  + LAYER M2 MASK 2 ( 0 0 ) ( 30 135 )
-  + COVER ( 45 -2160 ) N ;
-- P2.extra1 + NET N2
-  + DIRECTION INOUT
-  + USE GROUND
-  + LAYER METAL1 ( 0 0 ) ( 10 10 )
-  + COVER ( 0 0 ) N ;
-- P3  + NET N3
-  + DIRECTION FEEDTHRU
-  + USE CLOCK ;
-- P4  + NET N4
-  + USE SIGNAL ;
-- P5 + NET N5
-  + USE ANALOG ;
-- P6 + NET N6
-  + USE SCAN ;
-- P7 + NET N7
-  + USE RESET ;
-- ARRAYPIN[0][10] + NET ARRAYNET[0][10]
-  + LAYER M2 ( 0 0 ) ( 30 135 ) ;
-- ARRAYPIN.extra2[0][10] + NET ARRAYNET[0][10]
-  + LAYER M2 ( 0 0 ) ( 10 10 ) ;
-- scanpin + NET SCAN 
-  + USE SCAN ;
-- scanpin2 + NET SCAN 
-  + USE SCAN ;
-- INBUS[1] + NET INBUS<1>
-  + LAYER METAL1 ( 0 0 ) ( 10 10 ) ;
-- OUTBUS<1> + NET OUTBUS<1> ;
-- INBUS.extra1[1] + NET INBUS<1>
-  + LAYER M1 ( 10 10 ) ( 100 100 ) ;
-- vectorpin[0] + NET vectormodule[1]/vectornet[0] ;
-- scalarpin + NET vectormodule[1]/scalarnet ;
-- RE_RDY_2 + NET RE_RDY_2 + DIRECTION OUTPUT + USE SIGNAL
- + PORT
- + VIA myvia1 MASK 123 ( 500 500 )
-   + FIXED ( -390000 0 ) N
- + PORT
- + POLYGON METAL1 MASK 22 ( 40000 40000 ) ( 80000 40000 ) ( 80000 -40000 ) ( 40000 -40000 ) ( 40000 -80000 )
-                  ( -40000 -80000 ) ( -40000 -40000 ) ( -80000 -40000 ) ( -80000 40000 ) ( -40000 40000 ) ( -40000 80000 )
-                  ( 40000 80000 )
-   + FIXED ( -190000 0 ) N
- + PORT
- + VIA myvia1 ( 100 100 )
-   + FIXED ( 290000 0 ) N ;
-END PINS
-
-
-###############################################################################
-# PINPROPERTIES num; 
-#     [- { compName | PIN } pinName 
-#            [+ PROPERTY {propName propVal}...]...; 
-#     ]... 
-# END PINPROPERTIES
-###############################################################################
-PINPROPERTIES 2 ;
-- PIN P0
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- I1 A 
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-END PINPROPERTIES
-
-
-###############################################################################
-# BLOCKAGES numBlockages ; 
-#     -    { LAYER layerName 
-#                 [+ COMPONENT compName 
-#                 |+ SLOTS 
-#                 |+ FILLS 
-#                 | + PUSHDOWN ] 
-#             | PLACEMENT 
-#                 [ + COMPONENT compName 
-#                 | + PUSHDOWN ] 
-#             } 
-#             RECT pt pt 
-#             [RECT pt pt ] ... ; 
-#     ... 
-# END BLOCKAGES
-###############################################################################
-BLOCKAGES 8 ;
-    - LAYER METAL1 + MASK 1
-        RECT ( 60 70 ) ( 80 90 ) ;
-    - LAYER M2 + SLOTS + PUSHDOWN + EXCEPTPGNET + COMPONENT I1 + MASK 3
-        POLYGON ( 100 100 ) ( 100 200 ) ( 150 200 ) ( 150 150 ) ( 200 150 ) ( 200 100 ) ;
-    - LAYER M2 + SLOTS + MASK 2
-        RECT ( 10 20 ) ( 40 50 ) ;
-    - LAYER METAL1 + FILLS + MASK 1 
-        RECT ( -10 20 ) ( 30 40 ) ;
-    - LAYER M1 + PUSHDOWN + SPACING 3 + MASK 1
-        RECT ( 50 30 ) ( 55 40 ) ;
-    - LAYER M1 + EXCEPTPGNET + DESIGNRULEWIDTH 45 + MASK 1
-        RECT ( 50 30 ) ( 55 40 ) ;
-    - PLACEMENT                       
-#        POLYGON ( 100 100 ) ( 100 200 ) ( 150 200 ) ( 150 150 ) ( 200 150 ) ( 200 100 ) ;
-        RECT ( -15 0 ) ( 0  20 )
-        RECT ( -15 20 ) ( 30 40 )
-        RECT ( 30  5 ) ( 50 40 )
-        RECT ( -10 -15 ) ( 50 0 ) ;   #floating  
-    - PLACEMENT + PARTIAL 0.40 + PUSHDOWN + COMPONENT I1 
-        RECT ( -10 0 ) ( 0  20 )
-        RECT ( -10 20 ) ( 30 40 )
-        RECT ( 30  0 ) ( 50 40 )
-        RECT ( -10 -5 ) ( 50 0 ) ;  #coordinate are absolute
-    - PLACEMENT + PUSHDOWN 
-        RECT ( -5 0 ) ( 0  20 )
-        RECT ( -5 20 ) ( 30 40 )
-        RECT ( 30  0 ) ( 25 40 )
-        RECT ( -5 0 ) ( 50 10 ) ;  #coordinate are absolute
-    - PLACEMENT + SOFT
-        RECT ( 50 30 ) ( 55 40 ) ;
-    - PLACEMENT + PARTIAL 0.40
-        RECT ( 50 30 ) ( 55 40 ) ;
-
-END BLOCKAGES
-
-
-
-###############################################################################
-# SPECIALNETS numNets ; 
-#     [- netName [(compNameRegExpr pinName[+ SYNTHESIZED])]... 
-#        [+ WIDTH layerName width]... 
-#         [+ VOLTAGE mvolts] 
-#         [+ SOURCE {NETLIST | DIST | USER | TIMING}] 
-#         [+ FIXEDBUMP ] 
-#         [+ ORIGINAL netName] 
-#         [+ USE 
-#             { SIGNAL | POWER | GROUND | CLOCK 
-#                 | SCAN | RESET | TIEOFF | ANALOG }] 
-#        [+PATTERN 
-#             {STEINER | BALANCED | TRUNK}] 
-#         [+ ESTCAP wireCapacitance] 
-#         [+ WEIGHT weight] 
-#         [+ PROPERTY {propName propVal}...]...;]... 
-#         [+ {ROUTED | FIXED | COVER} layerName width 
-#             [+ SHAPE {RING | STRIPE | FOLLOWPIN | IOWIRE 
-#                         | COREWIRE | BLOCKWIRE | FILLWIRE 
-#                         | PADRING | BLOCKRING | BLOCKAGEWIRE}] 
-#                 (x y) [ (x *) | (* y) | viaName ]... 
-#                 [ NEW layerName width 
-#                     [+ SHAPE {RING | STRIPE | FOLLOWPIN | IOWIRE | COREWIRE 
-#                                 | BLOCKWIRE | FILLWIRE 
-#                                 | PADRING | BLOCKRING | BLOCKAGEWIRE}] 
-#                     (x y) [ (x *) | (* y) | 
-#                        viaName [ DO numX by numY STEP stepX stepY] ]...]...] 
-#         [+ SHIELD shieldedNetName layerName width 
-#             [+ SHAPE {RING | STRIPE | FOLLOWPIN | IOWIRE 
-#                         | COREWIRE | BLOCKWIRE | FILLWIRE 
-#                         | PADRING | BLOCKRING | BLOCKAGEWIRE}] 
-#                 (x y) [ (x *) | (* y) | viaName ]... 
-#                 [NEW layerName width 
-#                   [+ SHAPE {RING | STRIPE | FOLLOWPIN | IOWIRE 
-#                         | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIRE}] 
-#                   (x y) [ [ MASK maskNum ](x *) | [ MASK maskNum ] (* y) | 
-#                     [ MASK viaMaskNum ] viaName [ DO numX by numY STEP stepX stepY] ]...]...]... 
-#     ;]... 
-# END SPECIALNETS
-###############################################################################
-SPECIALNETS 5 ;
-- SN1 ( I1 Z.extra1 ) ( I2 Z ) ( I3 Z ) ( * Z )
-  + WIDTH METAL1 200
-  + WIDTH M2 300
-  + VOLTAGE 3200
-  + SOURCE NETLIST
-  + FIXEDBUMP
-  + ORIGINAL VDD
-  + USE SIGNAL
-  + PATTERN STEINER
-  + ESTCAP 1500000
-  + WEIGHT 30
- + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25
-  
-  + ROUTED M1 120 + SHAPE RING ( 14000 341440 ) ( 9600 * ) ( * 282400 ) M1_M2 DO 2 BY 2 STEP 200 200 ( 2400 * )
-    NEW METAL1 120 + SHAPE STRIPE    ( 2400 282400 ) ( 240 * ) M1_M2 
-    NEW M1 120 + SHAPE FOLLOWPIN ( 2500 282400 ) ( 250 * ) VIAGEN12_0 N
-    NEW M1 120 + SHAPE IOWIRE    ( 2600 282400 ) ( 260 * ) VIAGEN12_2
-    NEW METAL1 120 + SHAPE COREWIRE  ( 2700 282400 ) ( 270 * ) VIAGEN12_3
-    NEW M1 120 + SHAPE BLOCKWIRE ( 2800 282400 ) ( 280 * ) CUSTOMVIA VIAGEN12_1
-   NEW M1 120 + SHAPE FILLWIRE  ( 2900 282400 ) ( 290 * ) VIAGEN12_4
-    NEW M1 120 + SHAPE FILLWIREOPC  ( 2900 282400 ) VIAGEN12_4
-    NEW M1 120 + SHAPE BLOCKAGEWIRE ( 2000 282400 ) ( 200 * ) VIAGEN12
-   NEW M1 120 + SHAPE BLOCKRING ( 2100 282400 ) ( 210 * )
-    NEW M1 120 + SHAPE PADRING   ( 2200 282400 ) ( 220 * )
-
-    NEW M1 200 ( 3000 3000 ) TURNM1_1
-    NEW M2 200 ( 3100 3100 ) ( 3200 3100 ) TURNM2_1
-   NEW M2 200 ( 3300 3300 ) ( 3400 3300 ) TURNM2_1 ( 3400 3600 )
-    
-    NEW M2 200 ( 400 400 ) M1_M2 ( * * )           # case : pt via ( * * )
-    NEW M2 200 ( 500 500 ) M1_M2 ( * * ) M1_M2     # case : pt via ( * * ) via
-    NEW M2 200 ( 700 700 ) M1_M2 ( * * ) ( * 800 ) # case : pt via ( * * ) pt
-   
-   NEW M2 15000 + STYLE 9 ( 105000 105000 ) ( 50000 50000 )
-    NEW M2 15000 + STYLE 8 ( 105000 155000 ) ( * 105000 )
-  + COVER METAL1 100 ( 100 100 ) ( 100 200 )
- + FIXED M1 100 ( 200 200 ) ( 300 200 )
-  + ROUTED M1 120 + SHAPE DRCFILL ( 8000 8000 ) ( 8000 8200 ) ( 8400 8200 )
-  + SHIELD N1 M2 90 ( 14100 340440 ) ( 8160 * ) M1_M2  ( * 301600 ) M1_M2 FN DO 2 BY 2 STEP 200 200 ( 2400 * )
-  ;
-- VDD
-  + VOLTAGE 5000
-  + FIXED + SHAPE RING + MASK 2 + POLYGON METAL1 ( 0  0 ) ( 0 100 ) ( 100 100 ) ( 200 200 ) ( 200 0 )
-  + COVER + SHAPE RING + MASK 3 + POLYGON M2 ( 100 100 ) ( * 200 ) ( 200 * ) ( 300 300 ) ( 300 100 ) 
-  + VIA M1_M2 N ( 2400 0 ) ( 10 10 )
-  + FIXED + SHAPE RING + RECT M3 ( 0 0 ) ( 10 10 )
-  + SHIELD N1 + SHAPE BLOCKRING + RECT M3 ( 0 0 ) ( 10 10 )
-  + ROUTED M1 20 ( 10 0 ) MASK 3 ( 10 20 ) VIAGEN12_4
-    NEW M2 100 ( 10 10 ) ( 20 10 ) MASK 1 ( 20 20 ) MASK 031 VIAGEN12_3
-  + SHAPE STRIPE + VIA VIA12_2 ( 30 30 ) ( 40 40 )
-  + ROUTED M1 100 ( 0 0 100 ) ( 0 0 50 ) ( 100 0 50 ) M1_M2 ( 100 100 50 ) 
-  + ROUTED M1 50 + STYLE 0 ( 0 0 ) ( 150 150 )
-  + ROUTED M1 50 + STYLE 0 ( 150 150 ) ( 0 0 )
-  + ROUTED M1 50 + STYLE 0 ( 150 0 ) ( 0 150 )
-  + ROUTED M1 50 + STYLE 0 ( 0 150 ) ( 150 0 )
-  + ROUTED M1 50 + STYLE 1 ( 150 150 ) ( 300 0 ) ( 400 0 )
-  + ROUTED M2 100 + SHAPE RING + STYLE 0 ( 0 0 ) ( 100 100 ) ( 200 100 )
-  + ROUTED M1 100 + STYLE  2 ( 0 0 ) M1_M2 (  600 * ) M1_M2
-  + ROUTED M1 50 ( 150 150 ) ( 300 300 ) 
-  ;
-- SN2 
-  + ROUTED M2 100 + STYLE 3 ( 0 0 ) ( 150 150 ) ( 300 0 )
-    NEW M2 100 ( 300 0 ) ( 400 0 )
-  + ROUTED M1 100 ( 0 0 ) ( 150 150 ) ( 300 0 ) ( 400 0 )
- + ROUTED M1 4000 + STYLE 5 ( 0 0 ) ( 1000 0 )
-  + ROUTED M1 4000 + STYLE 6 ( 0 0 ) ( 1000 1000 )
-  + ROUTED M1 1000 + STYLE 7 ( 0 0 ) ( * * ) ;
-- SN3
-  + USE GROUND
-  + ROUTED M2 100 ( 100 0 ) ( * 3000 )
-  NEW M3 100 ( 0 1000 ) ( 3000 * )
-  + SHIELD N1 M2 40 + SHAPE FILLWIRE ( 300 80 ) ( * 1920 )
-  NEW M2 40 + SHAPE FILLWIRE ( 500 80 ) ( * 1920 ) ;
-- DUMMY
-  + ROUTED M1 100 + SHAPE FILLWIRE ( 0 0 ) ( 100 0 ) ;
-- DUMMY2
-  + ROUTED M2 100 + SHAPE FILLWIREOPC ( 0 0 ) ( 100 0 ) ;
-END SPECIALNETS
-
-
-###############################################################################
-# NETS numNets ; 
-#     [- { netName [( {compName | PIN} pinName 
-#           [+ SYNTHESIZED])]... 
-#        | MUSTJOIN (compName pinName) } 
-#         [+ SHIELDNET shieldNetName ] ... 
-#         [+ NOSHIELD lastSegment ] ... 
-#         [+ VPIN vpinName [LAYER layerName] pt pt 
-#             [ { PLACED | FIXED | COVER } pt orient ] ]... 
-#         [+ SUBNET subnetName 
-#             [( {compName | PIN} pinName)| (VPIN vpinName)]... 
-#             [NONDEFAULTRULE rulename] 
-#             [regularWiring]] 
-#         [+ XTALK num] 
-#         [+ NONDEFAULTRULE ruleName] 
-#         [regularWiring]... 
-#         [+ SOURCE {NETLIST | DIST | USER | TEST | TIMING}] 
-#         [+ FIXEDBUMP ]
-#         [+ FREQUENCY freq ]
-#         [+ ORIGINAL netName] 
-#         [+ USE 
-#             { SIGNAL | POWER | GROUND | CLOCK 
-#                 | SCAN | RESET | TIEOFF | ANALOG}] 
-#         [+ PATTERN 
-#             {STEINER | BALANCED }] 
-#         [+ ESTCAP wireCapacitance] 
-#         [+ WEIGHT weight] 
-#         [+ PROPERTY {propName propVal}...]...; 
-#     ]... 
-# END NETS 
-# 
-# regularWiring = 
-# {+ ROUTED | + FIXED | + COVER | + NOSHIELD} 
-# layerName [TAPER | TAPERRULE rulename] [STYLE styleNum ] 
-#    routingPoints
-# [NEW layerName [TAPER | TAPERRULE rulename] [STYLE styleNum ]
-#    routingPoints
-# ] ...
-#
-# routingPoints =
-# ( x y [value] ) 
-# {( x * [value]) | ( * y [value]) | ( * * [value] ) | viaName | + RECT ( delta1x delta1y delta2x delta2y ) | + VIRTUAL ( x y ) ]...] 
-###############################################################################
-NETS 6 ;
-- SCAN ( scancell1 PA10 + SYNTHESIZED ) ( scancell2 PA2 + SYNTHESIZED )
-  + SOURCE TEST ;
-- N1 ( I1 A ) ( PIN P0 )
-  + SHIELDNET SN1
-  + SHIELDNET VDD
-  + FIXED M3 ( 10 0 ) MASK 3 ( 10 20 ) MASK 031 M1_M2
-  + ROUTED M1 ( 0 0 ) ( 5 0 ) VIRTUAL ( 2 3 ) MASK 1 ( 7 7 )
-  + ROUTED M1 ( 0 0 ) ( 5 0 ) VIRTUAL ( 2 3 ) RECT ( 1 2 3 4 ) ( 7 7 )
-  + FIXED M1 ( 0 0 ) ( 5 0 ) ( 7 7 ) 
-  + FIXED M1 ( 0 0 ) ( 5 0 ) MASK 3 RECT ( 1 2 3 4 ) ( 7 7 ) 
-  + NOSHIELD M2 ( 14100 341440 ) ( 14000 * ) M1_M2
-  + VPIN N1_VP0 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) N
-  + VPIN N1_VP1 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) S
-  + VPIN N1_VP2 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) E
-  + VPIN N1_VP3 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) W
-  + VPIN N1_VP4 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) FN
-  + VPIN N1_VP5 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) FS
-  + VPIN N1_VP6 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) FE
-  + VPIN N1_VP7 LAYER M3 ( -333 -333 ) ( 333 333 ) PLACED ( 189560 27300 ) FW
-  + VPIN N1_VP8 ( -333 -333 ) ( 333 333 )
-  + SUBNET N1_SUB0 ( I2 A ) ( PIN P1 ) ( VPIN N1_VP9 )
-    NONDEFAULTRULE RULE1
-    ROUTED M1 ( 168280 63300 700 ) ( * 64500 ) M1_M2 ( 169400 * 800 ) M2_M3
-  + XTALK 2
-  + NONDEFAULTRULE RULE1
-  + ROUTED
-    M2 ( 14000 341440 ) ( 9600 * ) ( * 282400 ) nd1VIA12 ( 2400 * ) TURNM1_1
-    NEW M1 TAPER ( 2400 282400 ) ( 240 * )
-  + SOURCE NETLIST
-  + FIXEDBUMP
-  + FREQUENCY 100
-  + ORIGINAL N2
-  + USE SIGNAL
-  + PATTERN STEINER
-  + ESTCAP 1500000
-  + WEIGHT 100
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- N2 ( I3 A ) ( PIN P2 )
-  + FIXED
-    M2 ( 14000 341440 ) ( 9600 * ) ( * 282400 ) M1_M2 ( 2400 * )
-    NEW M1 TAPERRULE RULE1 ( 2400 282400 ) ( 240 * )
-  + SOURCE DIST
-  + PATTERN BALANCED
-  + WEIGHT 500 ;
-- N3 ( I4 A ) ( PIN P3 )
-  + COVER
-    M2 ( 14000 341440 ) ( 9600 * ) ( * 282400 ) M1_M2 ( 2400 * ) VIAGEN12_0 N
-    NEW M1 ( 2400 282400 ) ( 240 * )
-    NEW M2 ( 400 400 ) M1_M2 N ( * * )           # case : pt via ( * * )
-    NEW M2 ( 500 500 ) M1_M2 ( * * ) M1_M2     # case : pt via ( * * ) via
-    NEW M2 ( 600 600 10 ) M1_M2 S ( * * 30 ) ( * 800 )    # case : pt via ( * * ext ) 
-    NEW M2 ( 700 700 ) M1_M2 ( * * ) ( * 800 ) # case : pt via ( * * ) pt
-    NEW M1 ( 0 0 ) M1_M2 FS M2_M3
-    NEW M3 ( 0 0 ) M2_M3 W M1_M2
-    NEW M1 ( 10 10 ) ( 20 10 ) MASK 1 ( 20 20 ) MASK 031 VIA1_2
-  + SOURCE USER
-  + PATTERN TRUNK ;
-- N4 ( I5 A ) ( PIN P4 )
-  + SOURCE TEST
-  + ROUTED M2 STYLE 1 ( 0 0 ) ( 150 150 ) ( 300 0 ) ( 400 0 )
-  + ROUTED M1 ( 150 150 ) MASK 3 ( 300 300 ) MASK 032 VIAGEN12
-  + NOSHIELD M1 ( 150 150 30 ) ( 150 300 30 )
-  + ROUTED M1 STYLE 0 ( 0 0 ) ( 150 150 )
-    NEW M1 STYLE 1 ( 150 150 ) MASK 2 ( 300 0 ) ( 400 0 )
-  + USE GROUND ;
-- N5 ( I6 A ) ( PIN P5 )
-  + ROUTED M2 STYLE 3 ( 0 1000 ) ( 150 1150 ) ( 300 1000 ) ( 400 1000 )
-  + ROUTED M1 ( 0 1000 ) ( 150 1150 ) ( 300 1000 ) ( 400 1000 )
-  + SOURCE TIMING ;
-- N6
-  + NONDEFAULTRULE RULE2
-  + ROUTED M1 STYLE 4 ( 1000 0 ) ( 1100 100 )
-  + ROUTED M1 STYLE 4 ( 1200 100 ) ( 1300 0 )
-  + ROUTED M1 STYLE 4 ( 1000 -100 ) ( 1300 -100 ) ;
-- SCAN ( scancell1 PA10 + SYNTHESIZED ) ( scancell2 PA2 + SYNTHESIZED )
-  + SOURCE TEST ;
-- MUSTJOIN_1 ( I7 A ) ;
-- ARRAYNET[0][10] ;
-- vectormodule[1]/vectornet[0] ;
-- vectormodule[1]/scalarnet ;
-END NETS
-
-
-###############################################################################
-# SCANCHAINS numScanChains ; 
-#     [- chainName 
-#     [+ COMMONSCANPINS [(IN pin)][(OUT pin)]] 
-#     [+ START {fixedInComp | PIN} [outPin] ] 
-#     {+ FLOATING {floatingComp [(IN pin)] [(OUT pin)]}...} 
-#     [+ ORDERED 
-#         {fixedComp [(IN pin)] [(OUT pin)] 
-#         fixedComp [(IN pin)] [(OUT pin)]} 
-#         [fixedComp [(IN pin)] [(OUT pin)]] ...}] 
-#     [+ STOP {fixedOutComp | PIN} [inPin] ] 
-#     ;] 
-#     ... 
-# END SCANCHAINS
-###############################################################################
-SCANCHAINS 2 ;
-- chain1
-  + PARTITION clock1 MAXBITS 256	# DEF5.5 
-  + COMMONSCANPINS ( IN PA1 ) ( OUT PA2 )
-  + START I1 B
-  + STOP  I4 B
-  + ORDERED 
-     scancell1 ( IN PA2 )
-     scancell2 ( OUT PA10 )
-     ( BITS 4 )
-  + FLOATING
-     scancell3 ( IN PA2 )
-     scancell4 ( OUT PA10 )
-     ( BITS 4 ) ;
-- chain2
-  + PARTITION clock1 MAXBITS 256	# DEF5.5 
-  + COMMONSCANPINS ( IN PA1 ) ( OUT PA2 )
-  + START PIN scanpin
-  + STOP  PIN scanpin2
-  + ORDERED 
-     scancell5 ( IN PA2 )
-     scancell6 ( OUT PA10 )
-     ( BITS 4 )
-  + FLOATING
-     scancell7 ( IN PA2 )
-     scancell8 ( OUT PA10 )
-     ( BITS 4 ) ;
-- chain3
-  + PARTITION clock1 MAXBITS 256	# DEF5.5 
-  + COMMONSCANPINS ( IN PA1 ) ( OUT PA2 )
-  + START I5 B
-  + STOP  I6 B
-  + ORDERED 
-     scancell9 ( IN PA2 )
-     scancell10 ( OUT PA10 )
-     ( BITS 4 )
-  + FLOATING
-     scancell11 ( IN PA2 )
-     scancell12 ( OUT PA10 )
-     ( BITS 4 ) ;
-END SCANCHAINS
-
-
-###############################################################################
-# GROUPS numGroups ; 
-#     [- groupName compNameRegExpr... 
-#         [+ SOFT 
-#             [MAXHALFPERIMETER value] 
-#             [MAXX value][MAXY value]] 
-#         [+ REGION {pt pt | regionName} ] 
-#         [+ PROPERTY {propName propVal}...]...;]... 
-# END GROUPS
-###############################################################################
-GROUPS 3 ;
-- group1 I3 I2
-  + SOFT MAXHALFPERIMETER 4000 MAXX 100000 MAXY 100000
-  + REGION region1
-  + PROPERTY strprop "aString" 
-  + PROPERTY intprop 1 
-  + PROPERTY realprop 1.1 
-  + PROPERTY intrangeprop 25
-  + PROPERTY realrangeprop 25.25 ;
-- group2 I4
-  + SOFT MAXHALFPERIMETER 4000
-  + REGION ( 0 0 ) ( 100 100 ) ;
-- region2 I7 I8
-  + REGION region2 ;
-END GROUPS
-
-
-###############################################################################
-# SLOTS numSlots ; 
-#     - { LAYER layerName 
-#             RECT pt pt 
-#             [RECT pt pt] ... ; 
-#         } 
-#     ... 
-# END SLOTS
-###############################################################################
-SLOTS 3 ;
-  -  LAYER M1
-        RECT ( 3 3 )  ( 6 8 ) ;
-  -  LAYER M2
-        RECT ( 3 3 )  ( 6 8 )
-        POLYGON ( 0 0 ) ( 0 10 ) ( 10 10 ) ( 10 20 ) ( 20 20 ) ( 20 0 ) ;
-  -  LAYER M3
-        RECT ( 3 3 )  ( 6 8 ) ;
-END SLOTS     
-
-
-###############################################################################
-# FILLS numFills ; 
-#     - { LAYER layerName 
-#             RECT pt pt 
-#             [RECT pt pt] ... ; 
-#         } 
-#     ... 
-# END FILLS
-###############################################################################
-FILLS 5 ;
-   - VIA myvia1 + MASK 2 + OPC
-    ( 5000 5000 )
-    ( 800 800 ) ;
-   -  LAYER M1 + MASK 2
-        RECT ( 0 2 )  ( 1 10 ) ;
-   -  LAYER M2 + OPC
-        RECT ( 0 2 )  ( 1 10 )
-        POLYGON ( 0 0 ) ( 0 10 ) ( 10 10 ) ( 10 20 ) ( 20 20 ) ( 20 0 ) ;
-   -  LAYER M3    
-        RECT ( 0 2 )  ( 1 10 ) ;
-   - VIA M1_M2 + MASK 202 + OPC ( 2400 0 ) ( 10 10 ) ;
-   - VIA VIAGEN12_0 + OPC ( 100 100 ) ( 200 100 ) ;
-END FILLS     	   
-
-
-###############################################################################
-# BEGINEXT "tag" 
-#   extensionText 
-# ENDEXT 
-###############################################################################
-BEGINEXT "tag"
-- CREATOR "Cadence" ;
-- OTTER furry
-  + PROPERTY arrg later
-  ;
-- SEAL cousin to WALRUS ;
-ENDEXT
-
-END DESIGN
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def.au b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def.au
deleted file mode 100644
index e620da3..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/TEST/complete.5.8.def.au
+++ /dev/null
@@ -1,808 +0,0 @@
-VERSION 5.8 ;
-ALIAS alias1 aliasValue1 1 ;
-ALIAS alias2 aliasValue2 0 ;
-DIVIDERCHAR "/" ;
-BUSBITCHARS "[]" ;
-DESIGN design ;
-TECHNOLOGY technology ;
-UNITS DISTANCE MICRONS 1000 ;
-
-PROPERTYDEFINITIONS
-DESIGN strprop STRING "aString" ;
-DESIGN intprop INTEGER 1 ;
-DESIGN realprop REAL 1.1 ;
-DESIGN intrangeprop INTEGER RANGE 1 100 25 ;
-DESIGN realrangeprop REAL RANGE 1.1 100.1 25.25 ;
-REGION strprop STRING ;
-REGION intprop INTEGER ;
-REGION realprop REAL ;
-REGION intrangeprop INTEGER RANGE 1 100 ;
-REGION realrangeprop REAL RANGE 1.1 100.1 ;
-GROUP strprop STRING ;
-GROUP intprop INTEGER ;
-GROUP realprop REAL ;
-GROUP intrangeprop INTEGER RANGE 1 100 ;
-GROUP realrangeprop REAL RANGE 1.1 100.1 ;
-COMPONENT strprop STRING ;
-COMPONENT intprop INTEGER ;
-COMPONENT realprop REAL ;
-COMPONENT intrangeprop INTEGER RANGE 1 100 ;
-COMPONENT realrangeprop REAL RANGE 1.1 100.1 ;
-NET strprop STRING ;
-NET intprop INTEGER ;
-NET realprop REAL ;
-NET intrangeprop INTEGER RANGE 1 100 ;
-NET realrangeprop REAL RANGE 1.1 100.1 ;
-SPECIALNET strprop STRING ;
-SPECIALNET intprop INTEGER ;
-SPECIALNET realprop REAL ;
-SPECIALNET intrangeprop INTEGER RANGE 1 100 ;
-SPECIALNET realrangeprop REAL RANGE 1.1 100.1 ;
-Parsed 50 number of lines!!
-ROW strprop STRING ;
-ROW intprop INTEGER ;
-ROW realprop REAL ;
-ROW intrangeprop INTEGER RANGE 1 100 ;
-ROW realrangeprop REAL RANGE 1.1 100.1 ;
-COMPONENTPIN strprop STRING ;
-COMPONENTPIN intprop INTEGER ;
-COMPONENTPIN realprop REAL ;
-COMPONENTPIN intrangeprop INTEGER RANGE 1 100 ;
-COMPONENTPIN realrangeprop REAL RANGE 1.1 100.1 ;
-NONDEFAULTRULE strprop STRING ;
-NONDEFAULTRULE intprop INTEGER ;
-NONDEFAULTRULE realprop REAL ;
-NONDEFAULTRULE intrangeprop INTEGER RANGE 1 100 ;
-NONDEFAULTRULE realrangeprop REAL RANGE 1.1 100.1 ;
-END PROPERTYDEFINITIONS
-
-DIEAREA -190000 -120000 -190000 350000 ;
-DIEAREA -190000 -120000 -190000 350000 190000 350000 190000 190000 190360 190000 190360 -120000 ;
-ROW ROW_1 CORE 1000 1000 N DO 100 BY 1 STEP 700 0 ;
-  + PROPERTY strprop aString STRING   + PROPERTY intprop 1 INTEGER   + PROPERTY realprop 1.1 REAL   + PROPERTY intrangeprop 25 INTEGER   + PROPERTY realrangeprop 25.25 REAL ;
-ROW ROW_2 CORE 1000 2000 S DO 100 BY 1 STEP 700 0 ;
-ROW ROW_3 CORE 1000 3000 E DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_4 CORE 1000 4000 W DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_5 CORE 1000 5000 FN DO 100 BY 1 STEP 700 0 ;
-ROW ROW_6 CORE 1000 6000 FS DO 100 BY 1 STEP 700 0 ;
-ROW ROW_7 CORE 1000 7000 FE DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_8 CORE 1000 8000 FW DO 100 BY 1 STEP 8400 0 ;
-ROW ROW_VERT_1 CORE -10000 -10000 N DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_2 CORE -9000 -10000 S DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_3 CORE -8000 -10000 E DO 1 BY 10 STEP 0 700 ;
-Parsed 100 number of lines!!
-ROW ROW_VERT_4 CORE -7000 -10000 W DO 1 BY 10 STEP 0 700 ;
-ROW ROW_VERT_5 CORE -6000 -10000 FN DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_6 CORE -5000 -10000 FS DO 1 BY 10 STEP 0 8400 ;
-ROW ROW_VERT_7 CORE -4000 -10000 FE DO 1 BY 10 STEP 0 700 ;
-ROW ROW_VERT_8 CORE -3000 -10000 FW DO 1 BY 1 STEP 0 700 ;
-ROW ROW_array0 ARRAYSITE 10000 10000 N DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array1 ARRAYSITE 10000 17000 W DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array2 ARRAYSITE 10000 17000 S DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array3 ARRAYSITE 10000 17000 E DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array4 ARRAYSITE 10000 17000 FN DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array5 ARRAYSITE 10000 17000 FE DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array6 ARRAYSITE 10000 17000 FS DO 100 BY 1 STEP 16000 0 ;
-ROW ROW_array7 ARRAYSITE 10000 17000 FW DO 100 BY 1 STEP 16000 0 ;
-TRACKS Y 52 DO 857 STEP 104 MASK 1 LAYER ;
-TRACKS Y 52 DO 857 STEP 104 MASK 1 SAMEMASK LAYER M1 M2 ;
-TRACKS X 52 DO 1720 STEP 104 MASK 2 LAYER M2 ;
-TRACKS X 52 DO 1720 STEP 104 LAYER ;
-GCELLGRID X 0 DO 100 STEP 600 ;
-GCELLGRID Y 10 DO 120 STEP 400 ;
-
-VIAS 6 ;
-Parsed 150 number of lines!!
-- VIAGEN12_0 + RECT METAL1 -4400 -3800 4400 3800 
-+ RECT M2 + MASK 3 -4500 -3800 4500 3800 
-+ RECT V1 + MASK 2 -3600 -3800 -2000 -2200 
-+ RECT V1 + MASK 1 -3600 2200 -2000 3800 
-+ RECT V1 + MASK 2 2000 -3800 3600 -2200 
-+ RECT V1 + MASK 3 2000 2200 3600 3800 
- ;
-- VIAGEN12_2 + RECT METAL1 -2500 -1500 2500 1500 
-+ RECT M2 -2500 -1500 2500 1500 
-+ RECT V1 -2360 -960 -760 640 
-+ RECT V1 -1320 -960 280 640 
-+ RECT V1 760 -960 2360 640 
- ;
-- VIAGEN12_3 + RECT METAL1 -1600 -1600 1600 1600 
-+ RECT M2 -1600 -1600 1600 1600 
-+ RECT V1 -800 -800 800 800 
- ;
-- VIAGEN12_4  ;
-+ VIARULE 'VIAGEN12'
-  + CUTSIZE 1600 1600
-  + LAYERS M1 V1 M2
-  + CUTSPACING 5600 6100
-  + ENCLOSURE 100 100 150 150
-  + ROWCOL 5 14
-  + ORIGIN 10 -10
-  + OFFSET 0 0 20 -20
-  + PATTERN '2_FFE0_3_FFFF'
-- M2_M1rct_0 + RECT V1 -25 -65 25 65 
-+ RECT M1 -35 -95 35 95 
-+ RECT M2 -65 -65 65 65 
- ;
-- VIAGEN12_1 + RECT M2 -2500 -1500 2500 1500 
-+ RECT V1 -2400 -960 -700 640 
-
-  + POLYGON METAL1 + MASK 2 -2500 -1500 -2500 2500 1500 2500 1500 1500 2500 1500 2500 -1500  ;
-END VIAS
-- CUSTOMVIA 
-  + POLYGON METAL1 + MASK 3 -2500 -1500 -2500 2500 1500 2500 1500 1500 2500 1500 2500 -1500  ;
-END VIAS
-- TURNM1_1 + RECT METAL1 -100 -60 100 60 
- ;
-END VIAS
-- TURNM2_1 + RECT M2 -100 -60 100 60 
- ;
-END VIAS
-Parsed 200 number of lines!!
-- TURNM3_1 + RECT M3 -100 -60 100 60 
- ;
-END VIAS
-- myvia1 + RECT METAL1 + MASK 2 0 0 40000 40000 
-+ RECT V1 + MASK 3 0 0 40000 40000 
-+ RECT M2 0 0 40000 40000 
- ;
-END VIAS
-
-STYLES 10 ;
-- STYLE 0 30 10 10 30 -10 30 -30 10 -30 -10 -10 -30 10 -30 30 -10 ;
-- STYLE 1 25 25 -25 25 -25 -25 25 -25 ;
-- STYLE 2 50 50 -50 50 -50 -50 50 -50 ;
-- STYLE 3 50 21 21 50 -21 50 -50 21 -50 -21 -21 -50 21 -50 50 -21 ;
-- STYLE 4 -30 -20 10 -60 50 -20 50 40 0 40 -30 10 ;
-- STYLE 5 0 2000 0 -2000 0 2000 0 -2000 ;
-- STYLE 6 -2000 2000 2000 -2000 2000 -2000 ;
-- STYLE 7 0 0 0 1000 1000 0 ;
-- STYLE 8 -7500 -3110 -3110 -7500 3110 -7500 7500 -3110 7500 7500 -7500 7500 ;
-- STYLE 9 0 -10610 7500 -3110 7500 3110 3110 7500 -3110 7500 -10610 0 ;
-END STYLES
-
-NONDEFAULTRULES 1 ;
-Parsed 250 number of lines!!
-- DEFAULT
-   + LAYER METAL1 WIDTH 10 DIAGWIDTH 8 SPACING 2 WIREEXT 1
-   + LAYER M2 WIDTH 10 SPACING 2
-   + LAYER M3 WIDTH 11 SPACING 3
-   + VIA M1_M2
-   + VIA M2_M3
-   + VIARULE VIAGEN12
-   + MINCUTS V1 2
-   + PROPERTY strprop aString STRING
-   + PROPERTY intprop 1 INTEGER
-   + PROPERTY realprop 1.1 REAL
-   + PROPERTY intrangeprop 25 INTEGER
-   + PROPERTY realrangeprop 25.25 REAL
-END NONDEFAULTRULES
-- RULE2
-   + HARDSPACING
-   + LAYER METAL1 WIDTH 10 DIAGWIDTH 8 SPACING 2 WIREEXT 1
-   + LAYER M2 WIDTH 10 SPACING 2
-   + LAYER M3 WIDTH 11 SPACING 3
-   + VIA M1_M2
-   + VIA M2_M3
-   + VIARULE VIAGEN12
-   + MINCUTS V1 2
-   + PROPERTY strprop aString STRING
-   + PROPERTY intprop 1 INTEGER
-   + PROPERTY realprop 1.1 REAL
-   + PROPERTY intrangeprop 25 INTEGER
-   + PROPERTY realrangeprop 25.25 REAL
-END NONDEFAULTRULES
-
-REGIONS 2 ;
-- region1 -500 -500 300 100 
-500 500 1000 1000 
-+ TYPE FENCE
-+ PROPERTY strprop aString STRING + PROPERTY intprop 1 INTEGER + PROPERTY realprop 1.1 REAL + PROPERTY intrangeprop 25 INTEGER + PROPERTY realrangeprop 25.25 REAL ;
-- region2 4000 0 5000 1000 
-+ TYPE GUIDE
-;
-END REGIONS
-Parsed 300 number of lines!!
-
-COMPONENTMASKSHIFT M3 M2 V1 M1 ;
-
-COMPONENTS 13 ;
-- I1 B + PLACED 100 100 N + SOURCE NETLIST + GENERATE generator + WEIGHT 100 + EEQMASTER A + REGION region1 + MASKSHIFT 1102
-+ HALO SOFT 5 6 7 8
-+ ROUTEHALO 100 METAL1 M3
-+ PROPERTY strprop aString STRING + PROPERTY intprop 1 INTEGER + PROPERTY realprop 1.1 REAL + PROPERTY intrangeprop 25 INTEGER + PROPERTY realrangeprop 25.25 REAL ;
-- I2 A + PLACED 200 200 S + SOURCE DIST + ROUTEHALO 100 M2 M3
-;
-- I3 A + PLACED 300 300 E + SOURCE USER ;
-- I4 A + PLACED 400 400 W + SOURCE TIMING ;
-- I5 A + PLACED 500 500 FN ;
-Parsed 350 number of lines!!
-- I6 A + PLACED 600 600 FS ;
-- I7 A + PLACED 700 700 FE ;
-- I8 A + PLACED 800 800 FW ;
-- I9 A + FIXED 900 900 N ;
-- I10 A + COVER 1000 1000 N ;
-- I11 A + UNPLACED ;
-- I12[0] A ;
-- I12[1] A ;
-END COMPONENTS
-- I13[0][10] A ;
-END COMPONENTS
-- I14\[1\] A ;
-END COMPONENTS
-- vectormodule[1]/scalarname A ;
-END COMPONENTS
-- vectormodule[1]/vectorname[1] A ;
-END COMPONENTS
-- scancell1 CHK3A ;
-END COMPONENTS
-- scancell2 CHK3A ;
-END COMPONENTS
-- scancell3 CHK3A ;
-END COMPONENTS
-- scancell4 CHK3A ;
-END COMPONENTS
-- scancell5 CHK3A ;
-END COMPONENTS
-- scancell6 CHK3A ;
-END COMPONENTS
-- scancell7 CHK3A ;
-END COMPONENTS
-- scancell8 CHK3A ;
-END COMPONENTS
-- scancell9 CHK3A ;
-END COMPONENTS
-- scancell10 CHK3A ;
-END COMPONENTS
-- scancell11 CHK3A ;
-END COMPONENTS
-- scancell12 CHK3A ;
-END COMPONENTS
-- nobrackets A ;
-END COMPONENTS
-- somethingwith[1] A ;
-END COMPONENTS
-- more[]brackets A ;
-END COMPONENTS
-- more[1]brackets A ;
-END COMPONENTS
-- more\[1\]brackets A ;
-END COMPONENTS
-- more[1][2] A ;
-END COMPONENTS
-- more\[1\]\[2\] A ;
-END COMPONENTS
-- more\[2\] A ;
-END COMPONENTS
-- foo\[1\]\[2\]/haha\[3\]\[4\] A ;
-END COMPONENTS
-- foo[2][3]/haha[4][5] A ;
-END COMPONENTS
-- foo\[3\]\[4\]/haha[5][6] A ;
-END COMPONENTS
-- foo[4][5]/haha\[6\]\[7\] A ;
-END COMPONENTS
-- foo[5][6]bar/haha\[7\]\[8\] A ;
-END COMPONENTS
-- foo[6][7]bar/haha[8][9] A ;
-END COMPONENTS
-Parsed 400 number of lines!!
-
-PINS 11 ;
-Parsed 450 number of lines!!
-- P0 + NET N0 + DIRECTION INPUT + USE SIGNAL + NETEXPR "power1 VDD" + SUPPLYSENSITIVITY P1 + GROUNDSENSITIVITY P2 
-  + PORT
-     + LAYER M2 MASK 2 0 0 30 135 
-     + VIA VIAGEN12_0 ( 0 100 ) 
-     + FIXED ( 45 -2160 ) N 
-  + PORT
-     + LAYER M1 0 0 30 135 
-     + VIA M1_M2 MASK 023 ( 100 0 ) 
-     + COVER ( 0 -1000 ) N 
-  + PORT
-     + LAYER M3 0 0 30 135 
-     + PLACED ( 1000 -1000 ) N + SPECIAL ANTENNAPINPARTIALMETALAREA 5 LAYER METAL1
-ANTENNAPINPARTIALMETALAREA 5 LAYER M2
-ANTENNAPINPARTIALMETALSIDEAREA 10 LAYER METAL1
-ANTENNAPINPARTIALMETALSIDEAREA 10 LAYER M2
-ANTENNAPINDIFFAREA 20 LAYER M1
-ANTENNAPINDIFFAREA 20 LAYER M2
-ANTENNAPINPARTIALCUTAREA 35 LAYER V1
-ANTENNAPINPARTIALCUTAREA 35 LAYER V2
-ANTENNAMODEL OXIDE1
-ANTENNAPINGATEAREA 15 LAYER M1
-ANTENNAPINGATEAREA 15 LAYER M2
-ANTENNAPINMAXAREACAR 25 LAYER M1
-ANTENNAPINMAXSIDEAREACAR 30 LAYER M1
-ANTENNAPINMAXCUTCAR 40 LAYER M1
-ANTENNAMODEL OXIDE2
-ANTENNAPINGATEAREA 115 LAYER M1
-ANTENNAPINGATEAREA 115 LAYER M2
-ANTENNAPINMAXAREACAR 125 LAYER M1
-ANTENNAPINMAXSIDEAREACAR 130 LAYER M1
-ANTENNAPINMAXCUTCAR 140 LAYER M1
-ANTENNAMODEL OXIDE3
-ANTENNAPINGATEAREA 115 LAYER M1
-ANTENNAPINGATEAREA 115 LAYER M2
-ANTENNAPINMAXAREACAR 125 LAYER M1
-ANTENNAPINMAXSIDEAREACAR 130 LAYER M1
-ANTENNAPINMAXCUTCAR 140 LAYER M1
-ANTENNAMODEL OXIDE4
-ANTENNAPINGATEAREA 115 LAYER M1
-ANTENNAPINGATEAREA 115 LAYER M2
-ANTENNAPINMAXAREACAR 125 LAYER M1
-ANTENNAPINMAXSIDEAREACAR 130 LAYER M1
-ANTENNAPINMAXCUTCAR 140 LAYER M1
-;
-- P1 + NET N1 + DIRECTION OUTPUT + USE POWER + NETEXPR "power1 VDD[1]" 
-  + POLYGON M2 MASK 3 0 0 0 100 50 100 50 50 100 50 100 0 + PLACED ( 45 -2160 ) N ANTENNAPINPARTIALMETALAREA 5
-ANTENNAPINPARTIALMETALSIDEAREA 10
-ANTENNAPINDIFFAREA 20
-ANTENNAPINPARTIALCUTAREA 35
-ANTENNAMODEL OXIDE1
-ANTENNAPINGATEAREA 15
-;
-- P2 + NET N2 + DIRECTION INOUT + USE GROUND 
-  + LAYER M2 MASK 2 0 0 30 135 + COVER ( 45 -2160 ) N ;
-- P2.extra1 + NET N2 + DIRECTION INOUT + USE GROUND 
-  + LAYER METAL1 0 0 10 10 + COVER ( 0 0 ) N ;
-- P3 + NET N3 + DIRECTION FEEDTHRU + USE CLOCK ;
-- P4 + NET N4 + USE SIGNAL ;
-- P5 + NET N5 + USE ANALOG ;
-- P6 + NET N6 + USE SCAN ;
-Parsed 500 number of lines!!
-- P7 + NET N7 + USE RESET ;
-- ARRAYPIN[0][10] + NET ARRAYNET[0][10] 
-  + LAYER M2 0 0 30 135 ;
-- ARRAYPIN.extra2[0][10] + NET ARRAYNET[0][10] 
-  + LAYER M2 0 0 10 10 ;
-END PINS
-- scanpin + NET SCAN + USE SCAN ;
-END PINS
-- scanpin2 + NET SCAN + USE SCAN ;
-END PINS
-- INBUS[1] + NET INBUS<1> 
-  + LAYER METAL1 0 0 10 10 ;
-END PINS
-- OUTBUS<1> + NET OUTBUS<1> ;
-END PINS
-- INBUS.extra1[1] + NET INBUS<1> 
-  + LAYER M1 10 10 100 100 ;
-END PINS
-- vectorpin[0] + NET vectormodule[1]/vectornet[0] ;
-END PINS
-- scalarpin + NET vectormodule[1]/scalarnet ;
-END PINS
-- RE_RDY_2 + NET RE_RDY_2 + DIRECTION OUTPUT + USE SIGNAL 
-  + PORT
-     + VIA myvia1 MASK 123 ( 500 500 ) 
-     + FIXED ( -390000 0 ) N 
-  + PORT
-     + POLYGON METAL1 MASK 22 ( 40000 40000 ) ( 80000 40000 ) ( 80000 -40000 ) ( 40000 -40000 ) ( 40000 -80000 ) ( -40000 -80000 ) ( -40000 -40000 ) ( -80000 -40000 ) ( -80000 40000 ) ( -40000 40000 ) ( -40000 80000 ) ( 40000 80000 ) 
-     + FIXED ( -190000 0 ) N 
-  + PORT
-     + VIA myvia1 ( 100 100 ) 
-     + FIXED ( 290000 0 ) N ;
-END PINS
-
-PINPROPERTIES 2 ;
-- PIN P0 ;
-  + PROPERTY strprop aString STRING   + PROPERTY intprop 1 INTEGER   + PROPERTY realprop 1.1 REAL   + PROPERTY intrangeprop 25 INTEGER   + PROPERTY realrangeprop 25.25 REAL ;
-Parsed 550 number of lines!!
-- I1 A ;
-  + PROPERTY strprop aString STRING   + PROPERTY intprop 1 INTEGER   + PROPERTY realprop 1.1 REAL   + PROPERTY intrangeprop 25 INTEGER   + PROPERTY realrangeprop 25.25 REAL ;
-END PINPROPERTIES
-
-BLOCKAGES 8 ;
-- LAYER METAL1
-   + MASK 1
-   RECT 60 70 80 90
-;
-- LAYER M2
-   + COMPONENT I1
-   + SLOTS
-   + PUSHDOWN
-   + EXCEPTPGNET
-   + MASK 3
-   POLYGON 100 100 100 200 150 200 150 150 200 150 200 100 
-;
-- LAYER M2
-   + SLOTS
-   + MASK 2
-   RECT 10 20 40 50
-;
-- LAYER METAL1
-   + FILLS
-   + MASK 1
-   RECT -10 20 30 40
-;
-- LAYER M1
-   + PUSHDOWN
-   + MASK 1
-   + SPACING 3
-   RECT 50 30 55 40
-;
-- LAYER M1
-   + EXCEPTPGNET
-   + MASK 1
-   + DESIGNRULEWIDTH 45
-   RECT 50 30 55 40
-;
-- PLACEMENT
-   RECT -15 0 0 20
-   RECT -15 20 30 40
-   RECT 30 5 50 40
-   RECT -10 -15 50 0
-;
-- PLACEMENT
-   + PARTIAL 0.4
-   + COMPONENT I1
-   + PUSHDOWN
-   RECT -10 0 0 20
-   RECT -10 20 30 40
-   RECT 30 0 50 40
-   RECT -10 -5 50 0
-;
-END BLOCKAGES
-- PLACEMENT
-   + PUSHDOWN
-   RECT -5 0 0 20
-   RECT -5 20 30 40
-   RECT 30 0 25 40
-   RECT -5 0 50 10
-;
-END BLOCKAGES
-Parsed 600 number of lines!!
-- PLACEMENT
-   + SOFT
-   RECT 50 30 55 40
-;
-END BLOCKAGES
-- PLACEMENT
-   + PARTIAL 0.4
-   RECT 50 30 55 40
-;
-END BLOCKAGES
-
-SPECIALNETS 5 ;
-- SN1 Parsed 650 number of lines!!
-( I1 Z.extra1 ) ( I2 Z ) ( I3 Z ) ( * Z ) 
-  + ROUTED 
-M1 120 + SHAPE RING ( 14000 341440 ) ( 9600 341440 ) 
-( 9600 282400 ) M1_M2 DO 2 BY 2 STEP 200 200 ( 2400 282400 ) NEW METAL1 
-120 + SHAPE STRIPE ( 2400 282400 ) ( 240 282400 ) M1_M2 
-NEW M1 120 + SHAPE FOLLOWPIN ( 2500 282400 ) ( 250 282400 ) 
-VIAGEN12_0 N NEW M1 120 + SHAPE IOWIRE 
-( 2600 282400 ) ( 260 282400 ) VIAGEN12_2 NEW METAL1 120 
-+ SHAPE COREWIRE ( 2700 282400 ) ( 270 282400 ) VIAGEN12_3 NEW M1 
-120 + SHAPE BLOCKWIRE ( 2800 282400 ) ( 280 282400 ) CUSTOMVIA 
-VIAGEN12_1 NEW M1 120 + SHAPE FILLWIRE ( 2900 282400 ) 
-( 290 282400 ) VIAGEN12_4 NEW M1 120 + SHAPE FILLWIREOPC 
-( 2900 282400 ) VIAGEN12_4 NEW M1 120 + SHAPE BLOCKAGEWIRE 
-( 2000 282400 ) ( 200 282400 ) VIAGEN12 NEW M1 120 
-+ SHAPE BLOCKRING ( 2100 282400 ) ( 210 282400 ) NEW M1 120 
-+ SHAPE PADRING ( 2200 282400 ) ( 220 282400 ) NEW M1 200 
-( 3000 3000 ) TURNM1_1 NEW M2 200 ( 3100 3100 ) 
-( 3200 3100 ) TURNM2_1 NEW M2 200 ( 3300 3300 ) 
-( 3400 3300 ) TURNM2_1 ( 3400 3600 ) NEW M2 200 
-( 400 400 ) M1_M2 ( 400 400 ) NEW M2 200 
-( 500 500 ) M1_M2 ( 500 500 ) M1_M2 NEW M2 
-200 ( 700 700 ) M1_M2 ( 700 700 ) ( 700 800 ) 
-NEW M2 15000 + STYLE 9 ( 105000 105000 ) ( 50000 50000 ) 
-NEW M2 15000 + STYLE 8 ( 105000 155000 ) ( 105000 105000 ) 
-
-  + COVER METAL1 100 ( 100 100 ) ( 100 200 ) 
-
-  + FIXED M1 100 ( 200 200 ) ( 300 200 ) 
-
-  + ROUTED M1 120 + SHAPE DRCFILL ( 8000 8000 ) 
-( 8000 8200 ) ( 8400 8200 ) 
-
-  + SHIELD N1 M2 90 ( 14100 340440 ) ( 8160 340440 ) 
-M1_M2 ( 8160 301600 ) M1_M2 FN DO 2 BY 2 STEP 200 200 
-( 2400 301600 ) 
-  + PROPERTY strprop aString STRING 
-  + PROPERTY intprop 1 INTEGER 
-  + PROPERTY realprop 1.1 REAL 
-  + PROPERTY intrangeprop 25 INTEGER 
-  + PROPERTY realrangeprop 25.25 REAL 
-
-  + FIXEDBUMP 
-  + VOLTAGE 3200 
-  + WEIGHT 30 
-  + SOURCE NETLIST 
-  + PATTERN STEINER 
-  + ORIGINAL VDD 
-  + USE SIGNAL ;
-- VDD Parsed 700 number of lines!!
-
-  + ROUTED M1 20 ( 10 0 ) MASK 3 
-( 10 20 ) VIAGEN12_4 NEW M2 100 ( 10 10 ) 
-( 20 10 ) MASK 1 ( 20 20 ) MASK 031 VIAGEN12_3 
-
-  + ROUTED M1 100 ( 0 0 100 ) ( 0 0 50 ) 
-( 100 0 50 ) M1_M2 ( 100 100 50 ) 
-
-  + ROUTED M1 50 + STYLE 0 ( 0 0 ) 
-( 150 150 ) 
-
-  + ROUTED M1 50 + STYLE 0 ( 150 150 ) 
-( 0 0 ) 
-
-  + ROUTED M1 50 + STYLE 0 ( 150 0 ) 
-( 0 150 ) 
-
-  + ROUTED M1 50 + STYLE 0 ( 0 150 ) 
-( 150 0 ) 
-
-  + ROUTED M1 50 + STYLE 1 ( 150 150 ) 
-( 300 0 ) ( 400 0 ) 
-
-  + ROUTED M2 100 + SHAPE RING + STYLE 0 
-( 0 0 ) ( 100 100 ) ( 200 100 ) 
-
-  + ROUTED M1 100 + STYLE 2 ( 0 0 ) 
-M1_M2 ( 600 0 ) M1_M2 
-
-  + ROUTED M1 50 ( 150 150 ) ( 300 300 ) 
-
-  + FIXED 
-  + SHAPE RING 
-  + MASK 2 + POLYGON METAL1 0 0 0 100 100 100 200 200 200 0 
-  + COVER 
-  + SHAPE RING 
-  + MASK 3 + POLYGON M2 100 100 100 200 200 200 300 300 300 100 
-  + FIXED 
-  + SHAPE RING 
-  + RECT M3 0 0 10 10
-  + SHIELD 
-  + N1 
-  + SHAPE BLOCKRING 
-  + RECT M3 0 0 10 10
-  + ROUTED 
-  + VIA M1_M2  N 2400 0 10 10;
-
-  + ROUTED 
-  + SHAPE STRIPE 
-  + VIA VIA12_2  N 30 30 40 40;
-
-  + VOLTAGE 5000 ;
-- SN2 
-  + ROUTED M2 100 + STYLE 3 ( 0 0 ) 
-( 150 150 ) ( 300 0 ) NEW M2 100 ( 300 0 ) 
-( 400 0 ) 
-
-  + ROUTED M1 100 ( 0 0 ) ( 150 150 ) 
-( 300 0 ) ( 400 0 ) 
-
-  + ROUTED M1 4000 + STYLE 5 ( 0 0 ) 
-( 1000 0 ) 
-
-  + ROUTED M1 4000 + STYLE 6 ( 0 0 ) 
-( 1000 1000 ) 
-
-  + ROUTED M1 1000 + STYLE 7 ( 0 0 ) 
-( 0 0 ) 
-;
-- SN3 
-  + ROUTED M2 100 ( 100 0 ) ( 100 3000 ) 
-NEW M3 100 ( 0 1000 ) ( 3000 1000 ) 
-
-  + SHIELD N1 M2 40 + SHAPE FILLWIRE ( 300 80 ) 
-( 300 1920 ) NEW M2 40 + SHAPE FILLWIRE ( 500 80 ) 
-( 500 1920 ) 
-
-  + USE GROUND ;
-- DUMMY 
-  + ROUTED M1 100 + SHAPE FILLWIRE ( 0 0 ) 
-( 100 0 ) 
-;
-END SPECIALNETS
-- DUMMY2 
-  + ROUTED M2 100 + SHAPE FILLWIREOPC ( 0 0 ) 
-( 100 0 ) 
-;
-END SPECIALNETS
-Parsed 750 number of lines!!
-
-NETS 6 ;
-- SCAN ( scancell1 PA10 ) + SYNTHESIZED ( scancell2 PA2 ) + SYNTHESIZED + SOURCE TEST ;
-- N1    + SUBNET CBK N1_SUB0 Parsed 800 number of lines!!
-   + NONDEFAULTRULE CBK RULE1 ( I1 A ) ( PIN P0 ) + NONDEFAULTRULE RULE1
-  + N1_VP0 M3 -333 -333 333 333 P 189560 27300 N
-  + N1_VP1 M3 -333 -333 333 333 P 189560 27300 S
-  + N1_VP2 M3 -333 -333 333 333 P 189560 27300 E
-  + N1_VP3 M3 -333 -333 333 333 P 189560 27300 W
-  + N1_VP4 M3 -333 -333 333 333 P 189560 27300 FN
-  + N1_VP5 M3 -333 -333 333 333 P 189560 27300 FS
-  + N1_VP6 M3 -333 -333 333 333 P 189560 27300 FE
-  + N1_VP7 M3 -333 -333 333 333 P 189560 27300 FW
-  + N1_VP8 -333 -333 333 333
-
-  + FIXED M3 ( 10 0 ) MASK 3 ( 10 20 ) 
-MASK 031 M1_M2 
-
-  + ROUTED M1 ( 0 0 ) ( 5 0 ) VIRTUAL ( 2 3 ) 
-MASK 1 ( 7 7 ) 
-
-  + ROUTED M1 ( 0 0 ) ( 5 0 ) VIRTUAL ( 2 3 ) 
-RECT ( 1 2 3 4 ) ( 7 7 ) 
-
-  + FIXED M1 ( 0 0 ) ( 5 0 ) ( 7 7 ) 
-
-  + FIXED M1 ( 0 0 ) ( 5 0 ) MASK 3 
-RECT ( 1 2 3 4 ) ( 7 7 ) 
-
-  + NOSHIELD M2 ( 14100 341440 ) ( 14000 341440 ) M1_M2 
-
-  + ROUTED M2 ( 14000 341440 ) ( 9600 341440 ) ( 9600 282400 ) 
-nd1VIA12 ( 2400 282400 ) TURNM1_1 NEW M1 TAPER 
-( 2400 282400 ) ( 240 282400 ) 
-
-  + SHIELDNET SN1
-  + SHIELDNET VDD
-  + SUBNET N1_SUB0  ( I2 A )
- ( PIN P1 )
- ( VPIN N1_VP9 )
-  ROUTED M1 ( 168280 63300 700 ) ( 168280 64500 ) M1_M2 
-( 169400 64500 800 ) M2_M3   + PROPERTY strprop aString STRING 
-  + PROPERTY intprop 1 INTEGER 
-  + PROPERTY realprop 1.1 REAL 
-  + PROPERTY intrangeprop 25 INTEGER 
-  + PROPERTY realrangeprop 25.25 REAL 
-+ WEIGHT 100 + ESTCAP 1.5e+06 + SOURCE NETLIST + FIXEDBUMP + FREQUENCY 100 + PATTERN STEINER + ORIGINAL N2 + USE SIGNAL ;
-- N2 ( I3 A ) ( PIN P2 ) 
-  + FIXED M2 ( 14000 341440 ) ( 9600 341440 ) ( 9600 282400 ) 
-M1_M2 ( 2400 282400 ) NEW M1 TAPERRULE RULE1 ( 2400 282400 ) 
-( 240 282400 ) 
-+ WEIGHT 500 + SOURCE DIST + PATTERN BALANCED ;
-- N3 ( I4 A ) ( PIN P3 ) 
-  + COVER M2 ( 14000 341440 ) ( 9600 341440 ) ( 9600 282400 ) 
-M1_M2 ( 2400 282400 ) VIAGEN12_0 N NEW M1 
-( 2400 282400 ) ( 240 282400 ) NEW M2 ( 400 400 ) M1_M2 
-N ( 400 400 ) NEW M2 ( 500 500 ) M1_M2 
-( 500 500 ) M1_M2 NEW M2 ( 600 600 10 ) M1_M2 
-S ( 600 600 30 ) ( 600 800 ) NEW M2 ( 700 700 ) 
-M1_M2 ( 700 700 ) ( 700 800 ) NEW M1 ( 0 0 ) 
-M1_M2 FS M2_M3 NEW M3 ( 0 0 ) 
-M2_M3 W M1_M2 NEW M1 ( 10 10 ) 
-( 20 10 ) MASK 1 ( 20 20 ) MASK 031 VIA1_2 
-+ SOURCE USER + PATTERN TRUNK ;
-- N4 ( I5 A ) ( PIN P4 ) 
-  + ROUTED M2 STYLE 1 ( 0 0 ) ( 150 150 ) 
-( 300 0 ) ( 400 0 ) 
-
-  + ROUTED M1 ( 150 150 ) MASK 3 ( 300 300 ) 
-MASK 032 VIAGEN12 
-
-  + NOSHIELD M1 ( 150 150 30 ) ( 150 300 30 ) 
-
-  + ROUTED M1 STYLE 0 ( 0 0 ) ( 150 150 ) 
-NEW M1 STYLE 1 ( 150 150 ) MASK 2 ( 300 0 ) 
-( 400 0 ) 
-+ SOURCE TEST + USE GROUND ;
-- N5 ( I6 A ) ( PIN P5 ) 
-  + ROUTED M2 STYLE 3 ( 0 1000 ) ( 150 1150 ) 
-( 300 1000 ) ( 400 1000 ) 
-
-  + ROUTED M1 ( 0 1000 ) ( 150 1150 ) ( 300 1000 ) 
-( 400 1000 ) 
-+ SOURCE TIMING ;
-END NETS
-Parsed 850 number of lines!!
-- N6    + NONDEFAULTRULE CBK RULE2 + NONDEFAULTRULE RULE2
-
-  + ROUTED M1 STYLE 4 ( 1000 0 ) ( 1100 100 ) 
-
-  + ROUTED M1 STYLE 4 ( 1200 100 ) ( 1300 0 ) 
-
-  + ROUTED M1 STYLE 4 ( 1000 -100 ) ( 1300 -100 ) 
-;
-END NETS
-- SCAN ( scancell1 PA10 ) + SYNTHESIZED ( scancell2 PA2 ) + SYNTHESIZED + SOURCE TEST ;
-END NETS
-- MUSTJOIN_1 ( I7 A ) ;
-END NETS
-- ARRAYNET[0][10] ;
-END NETS
-- vectormodule[1]/vectornet[0] ;
-END NETS
-- vectormodule[1]/scalarnet ;
-END NETS
-
-SCANCHAINS 2 ;
-- chain1
-  + START I1 B
-  + STOP I4 B
-  + COMMONSCANPINS  ( IN PA1 )  ( OUT PA2 ) 
-  + FLOATING
-    scancell3 ( IN PA2 ) 
-    scancell4 ( OUT PA10 ) ( BITS 4 ) 
-  + ORDERED
-    scancell1 ( IN PA2 ) 
-    scancell2 ( OUT PA10 ) ( BITS 4 ) 
-  + PARTITION clock1 MAXBITS 256 ;
-Parsed 900 number of lines!!
-- chain2
-  + START PIN scanpin
-  + STOP PIN scanpin2
-  + COMMONSCANPINS  ( IN PA1 )  ( OUT PA2 ) 
-  + FLOATING
-    scancell7 ( IN PA2 ) 
-    scancell8 ( OUT PA10 ) ( BITS 4 ) 
-  + ORDERED
-    scancell5 ( IN PA2 ) 
-    scancell6 ( OUT PA10 ) ( BITS 4 ) 
-  + PARTITION clock1 MAXBITS 256 ;
-END SCANCHAINS
-- chain3
-  + START I5 B
-  + STOP I6 B
-  + COMMONSCANPINS  ( IN PA1 )  ( OUT PA2 ) 
-  + FLOATING
-    scancell11 ( IN PA2 ) 
-    scancell12 ( OUT PA10 ) ( BITS 4 ) 
-  + ORDERED
-    scancell9 ( IN PA2 ) 
-    scancell10 ( OUT PA10 ) ( BITS 4 ) 
-  + PARTITION clock1 MAXBITS 256 ;
-END SCANCHAINS
-
-GROUPS 3 ;
-- group1 I3 I2
-  + REGION region1 
-  + PROPERTY strprop aString STRING 
-  + PROPERTY intprop 1 INTEGER 
-  + PROPERTY realprop 1.1 REAL 
-  + PROPERTY intrangeprop 25 INTEGER 
-  + PROPERTY realrangeprop 25.25 REAL  ;
-- group2 I4 ;
-- region2 I7 I8
-  + REGION region2  ;
-END GROUPS
-Parsed 950 number of lines!!
-
-SLOTS 3 ;
-- LAYER M1
-   RECT 3 3 6 8
-;
-- LAYER M2
-   RECT 3 3 6 8
-   POLYGON 0 0 0 10 10 10 10 20 20 20 20 0 ;
-;
-- LAYER M3
-   RECT 3 3 6 8
-;
-END SLOTS
-
-FILLS 5 ;
-- VIA myvia1 + MASK 002 + OPC
- 5000 5000 800 800;
-;
-- LAYER M1 + MASK 2
-   RECT 0 2 1 10
-;
-- LAYER M2 + OPC
-   RECT 0 2 1 10
-   POLYGON 0 0 0 10 10 10 10 20 20 20 20 0 ;
-;
-- LAYER M3
-   RECT 0 2 1 10
-;
-- VIA M1_M2 + MASK 202 + OPC
- 2400 0 10 10;
-;
-END FILLS
-- VIA VIAGEN12_0 + OPC
- 100 100 200 100;
-;
-END FILLS
-Parsed 1000 number of lines!!
-BEGINEXT  "tag"
-- CREATOR "Cadence" ;
-- OTTER furry
-  + PROPERTY arrg later
-  ;
-- SEAL cousin to WALRUS ;
-ENDEXT
-END DESIGN
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defMsgTable.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defMsgTable.h
deleted file mode 100644
index 34eb534..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defMsgTable.h
+++ /dev/null
@@ -1,154 +0,0 @@
-
-/*
- * emsMkError:
-*/
-
-#include <stdio.h>
-#include "ems.h"
-
-#ifdef TSIZE
-#undef TSIZE
-#define TSIZE 2048
-#endif
-
-emsError_t DEFEmsMsgTable[] =
-{
-    {5000   , EMS_NONE, "The 'defrRead' function has been called before the 'defrInit' function.\nThe 'defrInit' function should be called prior to the 'defrRead' function.", -1, 0},
-    {5001   , EMS_NONE, "DEF statement found in the def file with no callback set.", -1, 0},
-    {6000   , EMS_NONE, "The syntax for an ALIAS statement is \"&ALIAS aliasName = aliasDefinition &ENDALIAS\". '=' is missing after the aliasName.", -1, 0},
-    {6001   , EMS_NONE, "End of file is reached while parsing in the middle of an ALIAS statement.\nReview you def file and add '&ENDALIAS' in the ALIAS statement.", -1, 0},
-    {6002   , EMS_NONE, "The def file is incomplete.", -1, 0},
-    {6003   , EMS_NONE, "The BEGINEXT tag is missing in the DEF file. Include the tag and then try again.", -1, 0},
-    {6004   , EMS_NONE, "The BEGINEXT tag is empty. Specify a value for the tag and try again.", -1, 0},
-    {6005   , EMS_NONE, "The '\"' is missing within the tag. Specify the '\"' in the tag and then try again.", -1, 0},
-    {6006   , EMS_NONE, "The ending '\"' is missing in the tag. Specify the ending '\"' in the tag and then try again.", -1, 0},
-    {6007   , EMS_NONE, "The ENDEXT statement is missing in the DEF file. Include the statement and then try again.", -1, 0},
-    {6008   , EMS_NONE, "Invalid characters found in \'%s\'.\nThese characters might be using the character types other than English.\nCreate characters by specifying valid characters types.", -1, 0},
-    {6010   , EMS_NONE, "An error has been reported in callback.", -1, 0},
-    {6011   , EMS_NONE, "Too many syntax errors have been reported.", -1, 0},
-    {6030   , EMS_NONE, "Invalid direction specified with FPC name. The valid direction is either 'H' or 'V'. Specify a valid vale and then try again.", -1, 0},
-    {6060   , EMS_NONE, "Invalid value specified for IOTIMING rise/fall. The valid value for rise is 'R' and for fall is 'F'. Specify a valid value and then try again.", -1, 0},
-    {6080   , EMS_NONE, "An internal error has occurred. The index number for the SUBNET wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", -1, 0},
-    {6081   , EMS_NONE, "An internal error has occurred. The index number for the NET PATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", -1, 0},
-    {6082   , EMS_NONE, "An internal error has occurred. The index number for the NET SHIELDPATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", -1, 0},
-    {6083   , EMS_NONE, "The index number %d specified for the NET INSTANCE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6084   , EMS_NONE, "The index number %d specified for the NET PIN is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6085   , EMS_NONE, "The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6086   , EMS_NONE, "The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6090   , EMS_NONE, "The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6091   , EMS_NONE, "The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6100   , EMS_NONE, "The value spefified for PARTITION SETUP is invalid. The valid value for SETUP is 'R' or 'F'. Specify a valid value for SETUP and then try again.", -1, 0},
-    {6101   , EMS_NONE, "The value spefified for PARTITION HOLD is invalid. The valid value for HOLD is 'R' or 'F'. Specify a valid value for HOLD and then try again.", -1, 0},
-    {6120   , EMS_NONE, "The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6130   , EMS_NONE, "The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6131   , EMS_NONE, "The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6140   , EMS_NONE, "The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6150   , EMS_NONE, "The START statement in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one START statement and then try again.", -1, 0},
-    {6151   , EMS_NONE, "The STOP statment in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one STOP statement and then try again.", -1, 0},
-    {6160   , EMS_NONE, "The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again.", -1, 0},
-    {6170   , EMS_NONE, "The TimingDisable type is invalid. The valid types are FROMPIN, & THRUPIN. Specify the valid type and then try again.", -1, 0},
-    {6180   , EMS_NONE, "The index number %d specified for the VIA POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again", -1, 0},
-    {6200   , EMS_NONE, "The ASSERTION statement is invalid because it has an invalid operand rule.\nValid operand rule is either NET or PATH. Specify a valid operand and then try again.", -1, 0},
-    {6201   , EMS_NONE, "Unable to process the DEF file. Both WIREDLOGIC and DELAY statements are defined in constraint/assertion.\nUpdate the DEF file to define either a WIREDLOGIC or DELAY statement only.", -1, 0},
-    {6202   , EMS_NONE, "Unable to process the DEF file. Both SUM and DIFF statements are defined in constraint/assertion.\nUpdate the DEF file to define either a SUM or DIFF statement only.", -1, 0},
-    {6501   , EMS_NONE, "An error has been found while processing the DEF file '%s'\nUnit %d is a 5.6 or later syntax. Define the DEF file as 5.6 and then try again.", -1, 0},
-    {6502   , EMS_NONE, "The value %d defined for DEF UNITS DISTANCE MICRON is invalid\n. The valid values are 100, 200, 1000, 2000, 10000, or 20000. Specify a valid value and then try again.", -1, 0},
-    {6503   , EMS_NONE, "The execution has been stopped because the DEF parser 5.7 does not support DEF file with version %s.\nUpdate your DEF file to version 5.7 or earlier.", -1, 0},
-    {6504   , EMS_NONE, "Def parser version 5.7 and later does not support NAMESCASESENSITIVE OFF.\nEither remove this optional construct or set it to ON.", -1, 0},
-    {6505   , EMS_NONE, "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6506   , EMS_NONE, "The NETEXPR statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6507   , EMS_NONE, "The SUPPLYSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6508   , EMS_NONE, "The GROUNDSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6509   , EMS_NONE, "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6510   , EMS_NONE, "The ANTENNAPINPARTIALMETALAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6511   , EMS_NONE, "The ANTENNAPINPARTIALMETALSIDEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6512   , EMS_NONE, "The ANTENNAPINGATEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6513   , EMS_NONE, "The ANTENNAPINDIFFAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6514   , EMS_NONE, "The ANTENNAPINMAXAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6515   , EMS_NONE, "The ANTENNAPINMAXSIDEAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6516   , EMS_NONE, "The ANTENNAPINPARTIALCUTAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6517   , EMS_NONE, "The ANTENNAPINMAXCUTCAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6518   , EMS_NONE, "The ANTENNAMODEL statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6519   , EMS_NONE, "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6520   , EMS_NONE, "The DESIGNRULEWIDTH statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6523   , EMS_NONE, "Invalid ROW statement defined in the DEF file. The DO statement which is required in the ROW statement is not defined.\nUpdate your DEF file with a DO statement.", -1, 0},
-    {6524   , EMS_NONE, "Invalid syntax specified. The valid syntax is either \"DO 1 BY num or DO num BY 1\". Specify the valid syntax and try again.", -1, 0},
-    {6525   , EMS_NONE, "The DO number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", -1, 0},
-    {6526   , EMS_NONE, "The STEP number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", -1, 0},
-    {6527   , EMS_NONE, "The DO number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", -1, 0},
-    {6528   , EMS_NONE, "The STEP number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", -1, 0},
-    {6529   , EMS_NONE, "The HALO statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6530   , EMS_NONE, "The FIXEDBUMP statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6531   , EMS_NONE, "The layerName which is required in path is missing. Include the layerName in the path and then try again.", -1, 0},
-    {6532   , EMS_NONE, "The VIA DO statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6533   , EMS_NONE, "Either the numX or numY in the VIA DO statement has invalid value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again.", -1, 0},
-    {6534   , EMS_NONE, "The STYLE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6535   , EMS_NONE, "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6536   , EMS_NONE, "The RECT statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6537   , EMS_NONE, "The value %s for statement VOLTAGE is invalid. The value can only be integer.\nSpecify a valid value in units of millivolts", -1, 0},
-    {6538   , EMS_NONE, "The PARTITION statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6539   , EMS_NONE, "Invalid BLOCKAGE statement defined in the DEF file. The BLOCKAGE statment has both the LAYER and the PLACEMENT statements defined.\nUpdate your DEF file to have either BLOCKAGE or PLACEMENT statement only.", -1, 0},
-    {6540   , EMS_NONE, "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6541   , EMS_NONE, "The SPACING statement is defined in the LAYER statement,\nbut there is already either a SPACING statement or DESIGNRULEWIDTH  statement has defined in the LAYER statement.\nUpdate your DEF file to have either SPACING statement or a DESIGNRULEWIDTH statement.", -1, 0},
-    {6542   , EMS_NONE, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.", -1, 0},
-    {6543   , EMS_NONE, "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement.", -1, 0},
-    {6544   , EMS_NONE, "A POLYGON statement is defined in the BLOCKAGE statement,\nbut it is not defined in the BLOCKAGE LAYER statement.\nUpdate your DEF file to either remove the POLYGON statement from the BLOCKAGE statement or\ndefine the POLYGON statement in a BLOCKAGE LAYER statement.", -1, 0},
-    {6545   , EMS_NONE, "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6546   , EMS_NONE, "The STYLES statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6547   , EMS_NONE, "The PLACEMENT SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6548   , EMS_NONE, "The PARTIAL is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6549   , EMS_NONE, "The EXCEPTPGNET is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6550   , EMS_NONE, "The HALO SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6551   , EMS_NONE, "The ROUTEHALO is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6552   , EMS_NONE, "The FILLWIREOPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6553   , EMS_NONE, "The LAYER OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6554   , EMS_NONE, "The VIA OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6555   , EMS_NONE, "The PORT in PINS is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6556   , EMS_NONE, "The PIN VIA statement is available in version 5.7 and later.\nHowever, your DEF file is defined with version %g.", -1, 0},
-    {6557   , EMS_NONE, "The VIARULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g,", -1, 0},
-    {6558   , EMS_NONE, "The FREQUENCY statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", -1, 0},
-    {6559   , EMS_NONE, "The ROWCOL statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.", -1, 0},
-    {6560   , EMS_NONE, "The ORIGIN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.", -1, 0},
-    {6561   , EMS_NONE, " The OFFSET statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.", -1, 0},
-    {6562   , EMS_NONE, "The PATTERN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.", -1, 0},
-    {6563   , EMS_NONE, "The TYPE statement already exists. It has been defined in the REGION statement.", -1, 0},
-    {6564   , EMS_NONE, "POLYGON statement in FILLS LAYER is a version 5.6 and later syntax.\nYour def file is defined with version %g,", -1, 0},
-    {7000   , EMS_NONE, "The specified string has exceeded 4096 characters. The extra characters will be truncated. Specify a string less than or equal to 4096 characters.", -1, 0},
-    {7010   , EMS_NONE, "The PropName %s is not defined for %s.", -1, 0},
-    {7011   , EMS_NONE, "The NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7012   , EMS_NONE, "The DEF file is invalid because the VERSION statement is not defined in it.\nThe VERSION statement is required in DEF file. Define this statement by refering to the LEF/DEF Language Reference manual.", -1, 0},
-    {7013   , EMS_NONE, "The DEF file is invalid if NAMESCASESENSITIVE is undefined.\nNAMESCASESENSITIVE is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the NAMESCASESENSITIVE statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.", -1, 0},
-    {7014   , EMS_NONE, "The DEF file is invalid if BUSBITCHARS is undefined.\nBUSBITCHARS is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the BUSBITCHARS statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.", -1, 0},
-    {7015   , EMS_NONE, "The DEF file is invalid if DIVIDERCHAR is undefined.\nDIVIDERCHAR is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the DIVIDERCHAR statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.", -1, 0},
-    {7016   , EMS_NONE, "DESIGN is a mandatory statement in the DEF file. Ensure that it exists in the file.", -1, 0},
-    {7017   , EMS_NONE, "The DEFAULTCAP statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7018   , EMS_NONE, "The DO statement in the ROW statement with the name %s has invalid syntax.\nThe valid syntax is \"DO numX BY 1 STEP spaceX 0 | DO 1 BY numY STEP 0 spaceY\".\nSpecify the valid syntax and try again.", -1, 0},
-    {7019   , EMS_NONE, "The PATTERNNAME statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7020   , EMS_NONE, "The REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7021   , EMS_NONE, "The FOREIGN statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7022   , EMS_NONE, "In the COMPONENT UNPLACED statement, the point and orient are invalid in version 5.4 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7023   , EMS_NONE, "The SPECIAL NET statement, with type %s, does not have any net statement defined.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7024   , EMS_NONE, "The ESTCAP statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7025   , EMS_NONE, "The SPECIAL NET SHIELD statement, does not have any shield net statement defined.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7026   , EMS_NONE, "The WIDTH statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7027   , EMS_NONE, "The GROUP REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7028   , EMS_NONE, "The GROUP SOFT MAXX statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7029   , EMS_NONE, "The GROUP SOFT MAXY statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7030   , EMS_NONE, "The GROUP SOFT MAXHALFPERIMETER statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7031   , EMS_NONE, "The ASSERTIONS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7032   , EMS_NONE, "The CONSTRAINTS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7035   , EMS_NONE, "The IOTIMINGS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.", -1, 0},
-    {7500   , EMS_NONE, "Unable to open the file defRWarning.log in %s.\nWarning messages will not be written out in the log file.\nCheck if you have write permission on the directory.", -1, 0},
-    {8000   , EMS_NONE, "The data still exists after the END DESIGN statement. The DEF parser will ignore this data.", -1, 0},
-    {8500   , EMS_NONE, "Unable to open the file defRWarning.log in %s.\nInfo messages will not be written out in the log file.\nCheck if you have write permission on the directory.", -1, 0},
-    {9000   , EMS_NONE, "The DEF writer has detected that the function defwInitCbk has already been called and you are trying to call defwInit.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again.", -1, 0},
-    {9001   , EMS_NONE, "The DEF writer has detected that the function defwInit has already been called and you are trying to call defwInitCbk.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again.", -1, 0},
-    {9010   , EMS_NONE, "The function defwWrite is called before the function defwInitCbk.\nYou need to call defwInitCbk before calling any other functions.\nUpdate your program and then try again.", -1, 0},
-    {9011   , EMS_NONE, "You program has called the function defwInit to initialize the writer.\nIf you want to use the callback option you need to use the function defwInitCbk.", -1, 0},
-    {9012   , EMS_NONE, "You are calling the function defwPrintUnusedCallbacks but you did call the function defwSetRegisterUnusedCallbacks which is required before you can call defwPrintUnusedCallbacks.", -1, 0},
-    {-1     , EMS_NONE, "", -1, 0}
-};
-
-/*
- * End machine generated table.
-*/
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAlias.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAlias.h
deleted file mode 100644
index f6a9bf4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAlias.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: arakhman $                                                       */
-/*  $Revision: #4 $                                                           */
-/*  $Date: 2014/04/30 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIALIAS_H
-#define CDEFIALIAS_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAssertion.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAssertion.h
deleted file mode 100644
index bf4dca2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiAssertion.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIASSERTION_H
-#define CDEFIASSERTION_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data for one assertion/constraint.                        */
-/* An assertion or constraint is either a net/path rule or a                  */
-/* wired logic rule.                                                          */
-/*                                                                            */
-/*  A net/path rule is an item or list of items plus specifications.          */
-/*    The specifications are: rise/fall min/max.                              */
-/*    The items are a list of (one or more) net names or paths or a           */
-/*    combination of both.                                                    */
-/*                                                                            */
-/*  A wired logic rule is a netname and a distance.                           */
-/*                                                                            */
-/*  We will NOT allow the mixing of wired logic rules and net/path delays     */
-/*  in the same assertion/constraint.                                         */
-/*                                                                            */
-/*  We will allow the rule to be a sum of sums (which will be interpreted     */
-/*  as just one list).                                                        */
-/*                                                                            */
-
-EXTERN int defiAssertion_isAssertion (const defiAssertion* obj);
-EXTERN int defiAssertion_isConstraint (const defiAssertion* obj);
-EXTERN int defiAssertion_isWiredlogic (const defiAssertion* obj);
-EXTERN int defiAssertion_isDelay (const defiAssertion* obj);
-EXTERN int defiAssertion_isSum (const defiAssertion* obj);
-EXTERN int defiAssertion_isDiff (const defiAssertion* obj);
-EXTERN int defiAssertion_hasRiseMin (const defiAssertion* obj);
-EXTERN int defiAssertion_hasRiseMax (const defiAssertion* obj);
-EXTERN int defiAssertion_hasFallMin (const defiAssertion* obj);
-EXTERN int defiAssertion_hasFallMax (const defiAssertion* obj);
-EXTERN double defiAssertion_riseMin (const defiAssertion* obj);
-EXTERN double defiAssertion_riseMax (const defiAssertion* obj);
-EXTERN double defiAssertion_fallMin (const defiAssertion* obj);
-EXTERN double defiAssertion_fallMax (const defiAssertion* obj);
-EXTERN const char* defiAssertion_netName (const defiAssertion* obj);
-EXTERN double defiAssertion_distance (const defiAssertion* obj);
-EXTERN int defiAssertion_numItems (const defiAssertion* obj);
-EXTERN int defiAssertion_isPath (const defiAssertion* obj, int  index);
-EXTERN int defiAssertion_isNet (const defiAssertion* obj, int  index);
-EXTERN void defiAssertion_path (const defiAssertion* obj, int  index, char**  fromInst, char**  fromPin, char**  toInst, char**  toPin);
-EXTERN void defiAssertion_net (const defiAssertion* obj, int  index, char**  netName);
-
-EXTERN void defiAssertion_print (const defiAssertion* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiBlockage.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiBlockage.h
deleted file mode 100644
index 7c19408..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiBlockage.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIBLOCKAGE_H
-#define CDEFIBLOCKAGE_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiBlockage_hasLayer (const defiBlockage* obj);
-EXTERN int defiBlockage_hasPlacement (const defiBlockage* obj);
-EXTERN int defiBlockage_hasComponent (const defiBlockage* obj);
-EXTERN int defiBlockage_hasSlots (const defiBlockage* obj);
-EXTERN int defiBlockage_hasFills (const defiBlockage* obj);
-EXTERN int defiBlockage_hasPushdown (const defiBlockage* obj);
-EXTERN int defiBlockage_hasExceptpgnet (const defiBlockage* obj);
-EXTERN int defiBlockage_hasSoft (const defiBlockage* obj);
-EXTERN int defiBlockage_hasPartial (const defiBlockage* obj);
-EXTERN int defiBlockage_hasSpacing (const defiBlockage* obj);
-EXTERN int defiBlockage_hasDesignRuleWidth (const defiBlockage* obj);
-EXTERN int defiBlockage_hasMask (const defiBlockage* obj);
-EXTERN int defiBlockage_mask (const defiBlockage* obj);
-EXTERN int defiBlockage_minSpacing (const defiBlockage* obj);
-EXTERN int defiBlockage_designRuleWidth (const defiBlockage* obj);
-EXTERN double defiBlockage_placementMaxDensity (const defiBlockage* obj);
-EXTERN const char* defiBlockage_layerName (const defiBlockage* obj);
-EXTERN const char* defiBlockage_layerComponentName (const defiBlockage* obj);
-EXTERN const char* defiBlockage_placementComponentName (const defiBlockage* obj);
-
-EXTERN int defiBlockage_numRectangles (const defiBlockage* obj);
-EXTERN int defiBlockage_xl (const defiBlockage* obj, int  index);
-EXTERN int defiBlockage_yl (const defiBlockage* obj, int  index);
-EXTERN int defiBlockage_xh (const defiBlockage* obj, int  index);
-EXTERN int defiBlockage_yh (const defiBlockage* obj, int  index);
-
-EXTERN int defiBlockage_numPolygons (const defiBlockage* obj);
-EXTERN struct defiPoints defiBlockage_getPolygon (const defiBlockage* obj, int  index);
-
-EXTERN void defiBlockage_print (const defiBlockage* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiComponent.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiComponent.h
deleted file mode 100644
index d3f0c2f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiComponent.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFICOMPONENT_H
-#define CDEFICOMPONENT_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Placement status for the component.                                        */
-/* Default is 0                                                               */
-#define DEFI_COMPONENT_UNPLACED 1
-#define DEFI_COMPONENT_PLACED 2
-#define DEFI_COMPONENT_FIXED 3
-#define DEFI_COMPONENT_COVER 4
-
-/* Struct holds the data for componentMaskShiftLayers.                        */
-
-EXTERN int defiComponentMaskShiftLayer_numMaskShiftLayers (const defiComponentMaskShiftLayer* obj);
-EXTERN const char* defiComponentMaskShiftLayer_maskShiftLayer (const defiComponentMaskShiftLayer* obj, int  index);
-
-/* Struct holds the data for one component.                                   */
-
-                                                            /* 5.7            */
-
-  /* For OA to modify the Id & Name                                           */
-
-EXTERN const char* defiComponent_id (const defiComponent* obj);
-EXTERN const char* defiComponent_name (const defiComponent* obj);
-EXTERN int defiComponent_placementStatus (const defiComponent* obj);
-EXTERN int defiComponent_isUnplaced (const defiComponent* obj);
-EXTERN int defiComponent_isPlaced (const defiComponent* obj);
-EXTERN int defiComponent_isFixed (const defiComponent* obj);
-EXTERN int defiComponent_isCover (const defiComponent* obj);
-EXTERN int defiComponent_placementX (const defiComponent* obj);
-EXTERN int defiComponent_placementY (const defiComponent* obj);
-EXTERN int defiComponent_placementOrient (const defiComponent* obj);
-EXTERN const char* defiComponent_placementOrientStr (const defiComponent* obj);
-EXTERN int defiComponent_hasRegionName (const defiComponent* obj);
-EXTERN int defiComponent_hasRegionBounds (const defiComponent* obj);
-EXTERN int defiComponent_hasEEQ (const defiComponent* obj);
-EXTERN int defiComponent_hasGenerate (const defiComponent* obj);
-EXTERN int defiComponent_hasSource (const defiComponent* obj);
-EXTERN int defiComponent_hasWeight (const defiComponent* obj);
-EXTERN int defiComponent_weight (const defiComponent* obj);
-EXTERN int defiComponent_maskShiftSize (const defiComponent* obj);
-EXTERN int defiComponent_maskShift (const defiComponent* obj, int  index);
-EXTERN int defiComponent_hasNets (const defiComponent* obj);
-EXTERN int defiComponent_numNets (const defiComponent* obj);
-EXTERN const char* defiComponent_net (const defiComponent* obj, int  index);
-EXTERN const char* defiComponent_regionName (const defiComponent* obj);
-EXTERN const char* defiComponent_source (const defiComponent* obj);
-EXTERN const char* defiComponent_EEQ (const defiComponent* obj);
-EXTERN const char* defiComponent_generateName (const defiComponent* obj);
-EXTERN const char* defiComponent_macroName (const defiComponent* obj);
-EXTERN int defiComponent_hasHalo (const defiComponent* obj);
-EXTERN int defiComponent_hasHaloSoft (const defiComponent* obj);
-EXTERN int defiComponent_hasRouteHalo (const defiComponent* obj);
-EXTERN int defiComponent_haloDist (const defiComponent* obj);
-EXTERN const char* defiComponent_minLayer (const defiComponent* obj);
-EXTERN const char* defiComponent_maxLayer (const defiComponent* obj);
-
-  /* Returns arrays for the ll and ur of the rectangles in the region.        */
-  /* The number of items in the arrays is given in size.                      */
-EXTERN void defiComponent_regionBounds (const defiComponent* obj, int* size, int**  xl, int**  yl, int**  xh, int**  yh);
-
-EXTERN int defiComponent_hasForeignName (const defiComponent* obj);
-EXTERN const char* defiComponent_foreignName (const defiComponent* obj);
-EXTERN int defiComponent_foreignX (const defiComponent* obj);
-EXTERN int defiComponent_foreignY (const defiComponent* obj);
-EXTERN const char* defiComponent_foreignOri (const defiComponent* obj);
-EXTERN int defiComponent_foreignOrient (const defiComponent* obj);
-EXTERN int defiComponent_hasFori (const defiComponent* obj);
-
-EXTERN int defiComponent_numProps (const defiComponent* obj);
-EXTERN char* defiComponent_propName (const defiComponent* obj, int  index);
-EXTERN char* defiComponent_propValue (const defiComponent* obj, int  index);
-EXTERN double defiComponent_propNumber (const defiComponent* obj, int  index);
-EXTERN char defiComponent_propType (const defiComponent* obj, int  index);
-EXTERN int defiComponent_propIsNumber (const defiComponent* obj, int  index);
-EXTERN int defiComponent_propIsString (const defiComponent* obj, int  index);
-
-  /* Debug printing                                                           */
-EXTERN void defiComponent_print (const defiComponent* obj, FILE*  fout);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDebug.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDebug.h
deleted file mode 100644
index 233b113..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDebug.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                           */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIDEBUG_H
-#define CDEFIDEBUG_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Set flag */
-EXTERN void defiSetDebug (int  num, int  value);
-
-/* Read flag */
-EXTERN int defiDebug (int  num);
-
-/* Error loggin function */
-EXTERN void defiError (int  check, int  msgNum, const char*  message);
-
-/* for auto upshifting names in case insensitive files */
-EXTERN const char* upperCase (const char*  c);
-EXTERN const char* DEFCASE (const char*  ch);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDefs.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDefs.h
deleted file mode 100644
index 40bcd1c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiDefs.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*************************************************************************
- * Copyright 2012, Cadence Design Systems
- *
- * This file is part of the Cadence LEF/DEF Open Source Distribution,
- * Product Version 5.8. 
- *
- * 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
- *
- * http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *
-*************************************************************************/
-
-/*************************************************************************
- * THE FILE WAS OBSOLETED IN LEF/DEF 5.8
-*************************************************************************/
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFPC.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFPC.h
deleted file mode 100644
index b63c058..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFPC.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIFPC_H
-#define CDEFIFPC_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN const char* defiFPC_name (const defiFPC* obj);
-EXTERN int defiFPC_isVertical (const defiFPC* obj);
-EXTERN int defiFPC_isHorizontal (const defiFPC* obj);
-EXTERN int defiFPC_hasAlign (const defiFPC* obj);
-EXTERN int defiFPC_hasMax (const defiFPC* obj);
-EXTERN int defiFPC_hasMin (const defiFPC* obj);
-EXTERN int defiFPC_hasEqual (const defiFPC* obj);
-EXTERN double defiFPC_alignMax (const defiFPC* obj);
-EXTERN double defiFPC_alignMin (const defiFPC* obj);
-EXTERN double defiFPC_equal (const defiFPC* obj);
-
-EXTERN int defiFPC_numParts (const defiFPC* obj);
-
-  /* Return the constraint number "index" where index is                      */
-  /*    from 0 to numParts()                                                  */
-  /* The returned corner is 'B' for bottom left  'T' for topright             */
-  /* The returned typ is 'R' for rows   'C' for comps                         */
-  /* The returned char* points to name of the item.                           */
-EXTERN void defiFPC_getPart (const defiFPC* obj, int  index, int*  corner, int*  typ, char**  name);
-
-  /* debug print                                                              */
-EXTERN void defiFPC_print (const defiFPC* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFill.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFill.h
deleted file mode 100644
index e016b10..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiFill.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIFILL_H
-#define CDEFIFILL_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiFill_hasLayer (const defiFill* obj);
-EXTERN const char* defiFill_layerName (const defiFill* obj);
-EXTERN int defiFill_hasLayerOpc (const defiFill* obj);
-
-EXTERN int defiFill_layerMask (const defiFill* obj);
-EXTERN int defiFill_viaTopMask (const defiFill* obj);
-EXTERN int defiFill_viaCutMask (const defiFill* obj);
-EXTERN int defiFill_viaBottomMask (const defiFill* obj);
-
-EXTERN int defiFill_numRectangles (const defiFill* obj);
-EXTERN int defiFill_xl (const defiFill* obj, int  index);
-EXTERN int defiFill_yl (const defiFill* obj, int  index);
-EXTERN int defiFill_xh (const defiFill* obj, int  index);
-EXTERN int defiFill_yh (const defiFill* obj, int  index);
-
-EXTERN int defiFill_numPolygons (const defiFill* obj);
-EXTERN struct defiPoints defiFill_getPolygon (const defiFill* obj, int  index);
-
-EXTERN int defiFill_hasVia (const defiFill* obj);
-EXTERN const char* defiFill_viaName (const defiFill* obj);
-EXTERN int defiFill_hasViaOpc (const defiFill* obj);
-
-EXTERN int defiFill_numViaPts (const defiFill* obj);
-EXTERN struct defiPoints defiFill_getViaPts (const defiFill* obj, int  index);
-
-EXTERN void defiFill_print (const defiFill* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiGroup.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiGroup.h
deleted file mode 100644
index 1964ebe..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiGroup.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIGROUP_H
-#define CDEFIGROUP_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data for one property.                                    */
-
-EXTERN const char* defiGroup_name (const defiGroup* obj);
-EXTERN const char* defiGroup_regionName (const defiGroup* obj);
-EXTERN int defiGroup_hasRegionBox (const defiGroup* obj);
-EXTERN int defiGroup_hasRegionName (const defiGroup* obj);
-EXTERN int defiGroup_hasMaxX (const defiGroup* obj);
-EXTERN int defiGroup_hasMaxY (const defiGroup* obj);
-EXTERN int defiGroup_hasPerim (const defiGroup* obj);
-EXTERN void defiGroup_regionRects (const defiGroup* obj, int*  size, int**  xl, int** yl, int**  xh, int**  yh);
-EXTERN int defiGroup_maxX (const defiGroup* obj);
-EXTERN int defiGroup_maxY (const defiGroup* obj);
-EXTERN int defiGroup_perim (const defiGroup* obj);
-
-EXTERN int defiGroup_numProps (const defiGroup* obj);
-EXTERN const char* defiGroup_propName (const defiGroup* obj, int  index);
-EXTERN const char* defiGroup_propValue (const defiGroup* obj, int  index);
-EXTERN double defiGroup_propNumber (const defiGroup* obj, int  index);
-EXTERN const char defiGroup_propType (const defiGroup* obj, int  index);
-EXTERN int defiGroup_propIsNumber (const defiGroup* obj, int  index);
-EXTERN int defiGroup_propIsString (const defiGroup* obj, int  index);
-
-  /* debug print                                                              */
-EXTERN void defiGroup_print (const defiGroup* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiIOTiming.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiIOTiming.h
deleted file mode 100644
index c206443..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiIOTiming.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIIOTIMING_H
-#define CDEFIIOTIMING_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiIOTiming_hasVariableRise (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasVariableFall (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasSlewRise (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasSlewFall (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasCapacitance (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasDriveCell (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasFrom (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasTo (const defiIOTiming* obj);
-EXTERN int defiIOTiming_hasParallel (const defiIOTiming* obj);
-
-EXTERN const char* defiIOTiming_inst (const defiIOTiming* obj);
-EXTERN const char* defiIOTiming_pin (const defiIOTiming* obj);
-EXTERN double defiIOTiming_variableFallMin (const defiIOTiming* obj);
-EXTERN double defiIOTiming_variableRiseMin (const defiIOTiming* obj);
-EXTERN double defiIOTiming_variableFallMax (const defiIOTiming* obj);
-EXTERN double defiIOTiming_variableRiseMax (const defiIOTiming* obj);
-EXTERN double defiIOTiming_slewFallMin (const defiIOTiming* obj);
-EXTERN double defiIOTiming_slewRiseMin (const defiIOTiming* obj);
-EXTERN double defiIOTiming_slewFallMax (const defiIOTiming* obj);
-EXTERN double defiIOTiming_slewRiseMax (const defiIOTiming* obj);
-EXTERN double defiIOTiming_capacitance (const defiIOTiming* obj);
-EXTERN const char* defiIOTiming_driveCell (const defiIOTiming* obj);
-EXTERN const char* defiIOTiming_from (const defiIOTiming* obj);
-EXTERN const char* defiIOTiming_to (const defiIOTiming* obj);
-EXTERN double defiIOTiming_parallel (const defiIOTiming* obj);
-
-  /* debug print                                                              */
-EXTERN void defiIOTiming_print (const defiIOTiming* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiKRDefs.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiKRDefs.h
deleted file mode 100644
index 40bcd1c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiKRDefs.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*************************************************************************
- * Copyright 2012, Cadence Design Systems
- *
- * This file is part of the Cadence LEF/DEF Open Source Distribution,
- * Product Version 5.8. 
- *
- * 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
- *
- * http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *
-*************************************************************************/
-
-/*************************************************************************
- * THE FILE WAS OBSOLETED IN LEF/DEF 5.8
-*************************************************************************/
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiMisc.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiMisc.h
deleted file mode 100644
index f0b0eed..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiMisc.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIMISC_H
-#define CDEFIMISC_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiGeometries_numPoints (const defiGeometries* obj);
-EXTERN void defiGeometries_points (const defiGeometries* obj, int  index, int*  x, int*  y);
-
-EXTERN int defiStyles_style (const defiStyles* obj);
-EXTERN struct defiPoints defiStyles_getPolygon (const defiStyles* obj);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNet.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNet.h
deleted file mode 100644
index 5e52bfc..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNet.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFINET_H
-#define CDEFINET_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Return codes for defiNet::viaOrient 
-    DEF_ORIENT_N  0
-    DEF_ORIENT_W  1
-    DEF_ORIENT_S  2
-    DEF_ORIENT_E  3
-    DEF_ORIENT_FN 4
-    DEF_ORIENT_FW 5
-    DEF_ORIENT_FS 6
-    DEF_ORIENT_FE 7
-*/
-
-EXTERN const char* defiWire_wireType (const defiWire* obj);
-EXTERN const char* defiWire_wireShieldNetName (const defiWire* obj);
-EXTERN int defiWire_numPaths (const defiWire* obj);
-
-EXTERN const defiPath* defiWire_path (const defiWire* obj, int  index);
-
-  /* WMD -- the following will be removed by the next release                 */
-
-  /* NEW: a net can have more than 1 wire                                     */
-
-  /* Debug printing                                                           */
-EXTERN void defiSubnet_print (const defiSubnet* obj, FILE*  f);
-
-EXTERN const char* defiSubnet_name (const defiSubnet* obj);
-EXTERN int defiSubnet_numConnections (const defiSubnet* obj);
-EXTERN const char* defiSubnet_instance (const defiSubnet* obj, int  index);
-EXTERN const char* defiSubnet_pin (const defiSubnet* obj, int  index);
-EXTERN int defiSubnet_pinIsSynthesized (const defiSubnet* obj, int  index);
-EXTERN int defiSubnet_pinIsMustJoin (const defiSubnet* obj, int  index);
-
-  /* WMD -- the following will be removed by the next release                 */
-EXTERN int defiSubnet_isFixed (const defiSubnet* obj);
-EXTERN int defiSubnet_isRouted (const defiSubnet* obj);
-EXTERN int defiSubnet_isCover (const defiSubnet* obj);
-
-EXTERN int defiSubnet_hasNonDefaultRule (const defiSubnet* obj);
-
-  /* WMD -- the following will be removed by the next release                 */
-EXTERN int defiSubnet_numPaths (const defiSubnet* obj);
-EXTERN const defiPath* defiSubnet_path (const defiSubnet* obj, int  index);
-
-EXTERN const char* defiSubnet_nonDefaultRule (const defiSubnet* obj);
-
-EXTERN int defiSubnet_numWires (const defiSubnet* obj);
-EXTERN const defiWire* defiSubnet_wire (const defiSubnet* obj, int  index);
-
-  /* WMD -- the following will be removed by the next release                 */
-
-EXTERN int defiVpin_xl (const defiVpin* obj);
-EXTERN int defiVpin_yl (const defiVpin* obj);
-EXTERN int defiVpin_xh (const defiVpin* obj);
-EXTERN int defiVpin_yh (const defiVpin* obj);
-EXTERN char defiVpin_status (const defiVpin* obj);
-EXTERN int defiVpin_orient (const defiVpin* obj);
-EXTERN const char* defiVpin_orientStr (const defiVpin* obj);
-EXTERN int defiVpin_xLoc (const defiVpin* obj);
-EXTERN int defiVpin_yLoc (const defiVpin* obj);
-EXTERN const char* defiVpin_name (const defiVpin* obj);
-EXTERN const char* defiVpin_layer (const defiVpin* obj);
-
-/* Pre 5.4                                                                    */
-
-EXTERN const char* defiShield_shieldName (const defiShield* obj);
-EXTERN int defiShield_numPaths (const defiShield* obj);
-
-EXTERN const defiPath* defiShield_path (const defiShield* obj, int  index);
-
-/* Struct holds the data for one component.                                   */
-
-  /* Routines used by YACC to set the fields in the net.                      */
-
-  /* WMD -- the following will be removed by the next release                 */
-
-  /* NEW: a net can have more than 1 wire                                     */
-
-  /* 5.6                                                                      */
-
-  /* For OA to modify the netName, id & pinName                               */
-
-  /* Routines to return the value of net data.                                */
-EXTERN const char* defiNet_name (const defiNet* obj);
-EXTERN int defiNet_weight (const defiNet* obj);
-EXTERN int defiNet_numProps (const defiNet* obj);
-EXTERN const char* defiNet_propName (const defiNet* obj, int  index);
-EXTERN const char* defiNet_propValue (const defiNet* obj, int  index);
-EXTERN double defiNet_propNumber (const defiNet* obj, int  index);
-EXTERN const char defiNet_propType (const defiNet* obj, int  index);
-EXTERN int defiNet_propIsNumber (const defiNet* obj, int  index);
-EXTERN int defiNet_propIsString (const defiNet* obj, int  index);
-EXTERN int defiNet_numConnections (const defiNet* obj);
-EXTERN const char* defiNet_instance (const defiNet* obj, int  index);
-EXTERN const char* defiNet_pin (const defiNet* obj, int  index);
-EXTERN int defiNet_pinIsMustJoin (const defiNet* obj, int  index);
-EXTERN int defiNet_pinIsSynthesized (const defiNet* obj, int  index);
-EXTERN int defiNet_numSubnets (const defiNet* obj);
-
-EXTERN const defiSubnet* defiNet_subnet (const defiNet* obj, int  index);
-
-  /* WMD -- the following will be removed by the next release                 */
-EXTERN int defiNet_isFixed (const defiNet* obj);
-EXTERN int defiNet_isRouted (const defiNet* obj);
-EXTERN int defiNet_isCover (const defiNet* obj);
-
-  /* The following routines are for wiring */
-EXTERN int defiNet_numWires (const defiNet* obj);
-
-EXTERN const defiWire* defiNet_wire (const defiNet* obj, int  index);
-
-  /* Routines to get the information about Virtual Pins. */
-EXTERN int defiNet_numVpins (const defiNet* obj);
-
-EXTERN const defiVpin* defiNet_vpin (const defiNet* obj, int  index);
-
-EXTERN int defiNet_hasProps (const defiNet* obj);
-EXTERN int defiNet_hasWeight (const defiNet* obj);
-EXTERN int defiNet_hasSubnets (const defiNet* obj);
-EXTERN int defiNet_hasSource (const defiNet* obj);
-EXTERN int defiNet_hasFixedbump (const defiNet* obj);
-EXTERN int defiNet_hasFrequency (const defiNet* obj);
-EXTERN int defiNet_hasPattern (const defiNet* obj);
-EXTERN int defiNet_hasOriginal (const defiNet* obj);
-EXTERN int defiNet_hasCap (const defiNet* obj);
-EXTERN int defiNet_hasUse (const defiNet* obj);
-EXTERN int defiNet_hasStyle (const defiNet* obj);
-EXTERN int defiNet_hasNonDefaultRule (const defiNet* obj);
-EXTERN int defiNet_hasVoltage (const defiNet* obj);
-EXTERN int defiNet_hasSpacingRules (const defiNet* obj);
-EXTERN int defiNet_hasWidthRules (const defiNet* obj);
-EXTERN int defiNet_hasXTalk (const defiNet* obj);
-
-EXTERN int defiNet_numSpacingRules (const defiNet* obj);
-EXTERN void defiNet_spacingRule (const defiNet* obj, int  index, char**  layer, double*  dist, double*  left, double*  right);
-EXTERN int defiNet_numWidthRules (const defiNet* obj);
-EXTERN void defiNet_widthRule (const defiNet* obj, int  index, char**  layer, double*  dist);
-EXTERN double defiNet_voltage (const defiNet* obj);
-
-EXTERN int defiNet_XTalk (const defiNet* obj);
-EXTERN const char* defiNet_source (const defiNet* obj);
-EXTERN double defiNet_frequency (const defiNet* obj);
-EXTERN const char* defiNet_original (const defiNet* obj);
-EXTERN const char* defiNet_pattern (const defiNet* obj);
-EXTERN double defiNet_cap (const defiNet* obj);
-EXTERN const char* defiNet_use (const defiNet* obj);
-EXTERN int defiNet_style (const defiNet* obj);
-EXTERN const char* defiNet_nonDefaultRule (const defiNet* obj);
-
-  /* WMD -- the following will be removed by the next release                 */
-EXTERN int defiNet_numPaths (const defiNet* obj);
-
-EXTERN const defiPath* defiNet_path (const defiNet* obj, int  index);
-
-EXTERN int defiNet_numShields (const defiNet* obj);
-
-EXTERN const defiShield* defiNet_shield (const defiNet* obj, int  index);
-
-EXTERN int defiNet_numShieldNets (const defiNet* obj);
-EXTERN const char* defiNet_shieldNet (const defiNet* obj, int  index);
-EXTERN int defiNet_numNoShields (const defiNet* obj);
-
-EXTERN const defiShield* defiNet_noShield (const defiNet* obj, int  index);
-
-  /* 5.6                                                                      */
-EXTERN int defiNet_numPolygons (const defiNet* obj);
-EXTERN const char* defiNet_polygonName (const defiNet* obj, int  index);
-EXTERN struct defiPoints defiNet_getPolygon (const defiNet* obj, int  index);
-EXTERN int defiNet_polyMask (const defiNet* obj, int  index);
-EXTERN const char* defiNet_polyRouteStatus (const defiNet* obj, int  index);
-EXTERN const char* defiNet_polyRouteStatusShieldName (const defiNet* obj, int  index);
-EXTERN const char* defiNet_polyShapeType (const defiNet* obj, int  index);
-
-EXTERN int defiNet_numRectangles (const defiNet* obj);
-EXTERN const char* defiNet_rectName (const defiNet* obj, int  index);
-EXTERN int defiNet_xl (const defiNet* obj, int  index);
-EXTERN int defiNet_yl (const defiNet* obj, int  index);
-EXTERN int defiNet_xh (const defiNet* obj, int  index);
-EXTERN int defiNet_yh (const defiNet* obj, int  index);
-EXTERN int defiNet_rectMask (const defiNet* obj, int  index);
-EXTERN const char* defiNet_rectRouteStatus (const defiNet* obj, int  index);
-EXTERN const char* defiNet_rectRouteStatusShieldName (const defiNet* obj, int  index);
-EXTERN const char* defiNet_rectShapeType (const defiNet* obj, int  index);
-
-  /* 5.8                                                                      */
-EXTERN int defiNet_numViaSpecs (const defiNet* obj);
-EXTERN struct defiPoints defiNet_getViaPts (const defiNet* obj, int  index);
-EXTERN const char* defiNet_viaName (const defiNet* obj, int  index);
-EXTERN const int defiNet_viaOrient (const defiNet* obj, int  index);
-EXTERN const char* defiNet_viaOrientStr (const defiNet* obj, int  index);
-EXTERN const int defiNet_topMaskNum (const defiNet* obj, int  index);
-EXTERN const int defiNet_cutMaskNum (const defiNet* obj, int  index);
-EXTERN const int defiNet_bottomMaskNum (const defiNet* obj, int  index);
-EXTERN const char* defiNet_viaRouteStatus (const defiNet* obj, int  index);
-EXTERN const char* defiNet_viaRouteStatusShieldName (const defiNet* obj, int  index);
-EXTERN const char* defiNet_viaShapeType (const defiNet* obj, int  index);
-
-  /* Debug printing                                                           */
-EXTERN void defiNet_print (const defiNet* obj, FILE*  f);
-
-  /* The method freeWire() is added is user select to have a callback         */
-  /* per wire within a net This is an internal method and is not public       */
-
-  /* Clear the rectangles & polygons data if partial path callback is set     */
-
-  /* WMD -- the following will be removed by the nex release                  */
-
-  /* WMD -- the following will be removed by the nex release                  */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNonDefault.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNonDefault.h
deleted file mode 100644
index 697bde1..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiNonDefault.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFINONDEFAULT_H
-#define CDEFINONDEFAULT_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN const char* defiNonDefault_name (const defiNonDefault* obj);
-EXTERN int defiNonDefault_hasHardspacing (const defiNonDefault* obj);
-
-EXTERN int defiNonDefault_numProps (const defiNonDefault* obj);
-EXTERN const char* defiNonDefault_propName (const defiNonDefault* obj, int  index);
-EXTERN const char* defiNonDefault_propValue (const defiNonDefault* obj, int  index);
-EXTERN double defiNonDefault_propNumber (const defiNonDefault* obj, int  index);
-EXTERN const char defiNonDefault_propType (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_propIsNumber (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_propIsString (const defiNonDefault* obj, int  index);
-
-  /* A non default rule can have one or more layers.                          */
-  /* The layer information is kept in an array.                               */
-EXTERN int defiNonDefault_numLayers (const defiNonDefault* obj);
-EXTERN const char* defiNonDefault_layerName (const defiNonDefault* obj, int  index);
-EXTERN double defiNonDefault_layerWidth (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_layerWidthVal (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_hasLayerDiagWidth (const defiNonDefault* obj, int  index);
-EXTERN double defiNonDefault_layerDiagWidth (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_layerDiagWidthVal (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_hasLayerSpacing (const defiNonDefault* obj, int  index);
-EXTERN double defiNonDefault_layerSpacing (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_layerSpacingVal (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_hasLayerWireExt (const defiNonDefault* obj, int  index);
-EXTERN double defiNonDefault_layerWireExt (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_layerWireExtVal (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_numVias (const defiNonDefault* obj);
-EXTERN const char* defiNonDefault_viaName (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_numViaRules (const defiNonDefault* obj);
-EXTERN const char* defiNonDefault_viaRuleName (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_numMinCuts (const defiNonDefault* obj);
-EXTERN const char* defiNonDefault_cutLayerName (const defiNonDefault* obj, int  index);
-EXTERN int defiNonDefault_numCuts (const defiNonDefault* obj, int  index);
-
-  /* Debug print                                                              */
-EXTERN void defiNonDefault_print (const defiNonDefault* obj, FILE*  f);
-
-  /* Layer information                                                        */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPartition.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPartition.h
deleted file mode 100644
index 183af73..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPartition.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPARTITION_H
-#define CDEFIPARTITION_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN const char* defiPartition_name (const defiPartition* obj);
-EXTERN char defiPartition_direction (const defiPartition* obj);
-EXTERN const char* defiPartition_itemType (const defiPartition* obj);
-EXTERN const char* defiPartition_pinName (const defiPartition* obj);
-EXTERN const char* defiPartition_instName (const defiPartition* obj);
-
-EXTERN int defiPartition_numPins (const defiPartition* obj);
-EXTERN const char* defiPartition_pin (const defiPartition* obj, int  index);
-
-EXTERN int defiPartition_isSetupRise (const defiPartition* obj);
-EXTERN int defiPartition_isSetupFall (const defiPartition* obj);
-EXTERN int defiPartition_isHoldRise (const defiPartition* obj);
-EXTERN int defiPartition_isHoldFall (const defiPartition* obj);
-EXTERN int defiPartition_hasMin (const defiPartition* obj);
-EXTERN int defiPartition_hasMax (const defiPartition* obj);
-EXTERN int defiPartition_hasRiseMin (const defiPartition* obj);
-EXTERN int defiPartition_hasFallMin (const defiPartition* obj);
-EXTERN int defiPartition_hasRiseMax (const defiPartition* obj);
-EXTERN int defiPartition_hasFallMax (const defiPartition* obj);
-EXTERN int defiPartition_hasRiseMinRange (const defiPartition* obj);
-EXTERN int defiPartition_hasFallMinRange (const defiPartition* obj);
-EXTERN int defiPartition_hasRiseMaxRange (const defiPartition* obj);
-EXTERN int defiPartition_hasFallMaxRange (const defiPartition* obj);
-
-EXTERN double defiPartition_partitionMin (const defiPartition* obj);
-EXTERN double defiPartition_partitionMax (const defiPartition* obj);
-
-EXTERN double defiPartition_riseMin (const defiPartition* obj);
-EXTERN double defiPartition_fallMin (const defiPartition* obj);
-EXTERN double defiPartition_riseMax (const defiPartition* obj);
-EXTERN double defiPartition_fallMax (const defiPartition* obj);
-
-EXTERN double defiPartition_riseMinLeft (const defiPartition* obj);
-EXTERN double defiPartition_fallMinLeft (const defiPartition* obj);
-EXTERN double defiPartition_riseMaxLeft (const defiPartition* obj);
-EXTERN double defiPartition_fallMaxLeft (const defiPartition* obj);
-EXTERN double defiPartition_riseMinRight (const defiPartition* obj);
-EXTERN double defiPartition_fallMinRight (const defiPartition* obj);
-EXTERN double defiPartition_riseMaxRight (const defiPartition* obj);
-EXTERN double defiPartition_fallMaxRight (const defiPartition* obj);
-
-  /* debug print                                                              */
-EXTERN void defiPartition_print (const defiPartition* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPath.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPath.h
deleted file mode 100644
index ab0daf9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPath.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013-2014, Cadence Design Systems                                */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                       */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPATH_H
-#define CDEFIPATH_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* TX_DIR:TRANSLATION ON                                                      */
-
-/* 5.4.1 1-D & 2-D Arrays of Vias in SPECIALNET Section                       */
-
-/* value returned by the next() routine.                                      */
-enum defiPath_e {
-  DEFIPATH_DONE = 0,
-  DEFIPATH_LAYER = 1,
-  DEFIPATH_VIA = 2,
-  DEFIPATH_VIAROTATION = 3,
-  DEFIPATH_WIDTH = 4,
-  DEFIPATH_POINT = 5,
-  DEFIPATH_FLUSHPOINT = 6,
-  DEFIPATH_TAPER = 7,
-  DEFIPATH_SHAPE = 8,
-  DEFIPATH_STYLE = 9,
-  DEFIPATH_TAPERRULE = 10,
-  DEFIPATH_VIADATA = 11,
-  DEFIPATH_RECT = 12,
-  DEFIPATH_VIRTUALPOINT = 13,
-  DEFIPATH_MASK = 14,
-  DEFIPATH_VIAMASK = 15
-  } ;
-
-  /* This is 'data ownership transfer' constructor.                           */
-
-  /* To traverse the path and get the parts.                                  */
-EXTERN void defiPath_initTraverse (const defiPath* obj);
-EXTERN void defiPath_initTraverseBackwards (const defiPath* obj);
-EXTERN int defiPath_next (const defiPath* obj);
-EXTERN int defiPath_prev (const defiPath* obj);
-EXTERN const char* defiPath_getLayer (const defiPath* obj);
-EXTERN const char* defiPath_getTaperRule (const defiPath* obj);
-EXTERN const char* defiPath_getVia (const defiPath* obj);
-EXTERN const char* defiPath_getShape (const defiPath* obj);
-EXTERN int defiPath_getTaper (const defiPath* obj);
-EXTERN int defiPath_getStyle (const defiPath* obj);
-EXTERN int defiPath_getViaRotation (const defiPath* obj);
-EXTERN void defiPath_getViaRect (const defiPath* obj, int*  deltaX1, int*  deltaY1, int*  deltaX2, int*  deltaY2);
-EXTERN const char* defiPath_getViaRotationStr (const defiPath* obj);
-EXTERN void defiPath_getViaData (const defiPath* obj, int*  numX, int*  numY, int*  stepX, int*  stepY);
-EXTERN int defiPath_getWidth (const defiPath* obj);
-EXTERN void defiPath_getPoint (const defiPath* obj, int*  x, int*  y);
-EXTERN void defiPath_getFlushPoint (const defiPath* obj, int*  x, int*  y, int*  ext);
-EXTERN void defiPath_getVirtualPoint (const defiPath* obj, int*  x, int*  y);
-EXTERN int defiPath_getMask (const defiPath* obj);
-EXTERN int defiPath_getViaTopMask (const defiPath* obj);
-EXTERN int defiPath_getViaCutMask (const defiPath* obj);
-EXTERN int defiPath_getViaBottomMask (const defiPath* obj);
-EXTERN int defiPath_getRectMask (const defiPath* obj);
-
-  /* These routines are called by the parser to fill the path.                */
-
-  /* debug printing                                                           */
-EXTERN void defiPath_print (const defiPath* obj, FILE*  fout);
-
-                        /* as iterator in const traversal functions.          */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinCap.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinCap.h
deleted file mode 100644
index 5b483db..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinCap.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPINCAP_H
-#define CDEFIPINCAP_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiPinCap_pin (const defiPinCap* obj);
-EXTERN double defiPinCap_cap (const defiPinCap* obj);
-
-EXTERN void defiPinCap_print (const defiPinCap* obj, FILE*  f);
-
-/* 5.5                                                                        */
-
-EXTERN char* defiPinAntennaModel_antennaOxide (const defiPinAntennaModel* obj);
-
-EXTERN int defiPinAntennaModel_hasAPinGateArea (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_numAPinGateArea (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_APinGateArea (const defiPinAntennaModel* obj, int  index);
-EXTERN int defiPinAntennaModel_hasAPinGateAreaLayer (const defiPinAntennaModel* obj, int  index);
-EXTERN const char* defiPinAntennaModel_APinGateAreaLayer (const defiPinAntennaModel* obj, int  index);
-
-EXTERN int defiPinAntennaModel_hasAPinMaxAreaCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_numAPinMaxAreaCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_APinMaxAreaCar (const defiPinAntennaModel* obj, int  index);
-EXTERN int defiPinAntennaModel_hasAPinMaxAreaCarLayer (const defiPinAntennaModel* obj, int  index);
-EXTERN const char* defiPinAntennaModel_APinMaxAreaCarLayer (const defiPinAntennaModel* obj, int  index);
-
-EXTERN int defiPinAntennaModel_hasAPinMaxSideAreaCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_numAPinMaxSideAreaCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_APinMaxSideAreaCar (const defiPinAntennaModel* obj, int  index);
-EXTERN int defiPinAntennaModel_hasAPinMaxSideAreaCarLayer (const defiPinAntennaModel* obj, int  index);
-EXTERN const char* defiPinAntennaModel_APinMaxSideAreaCarLayer (const defiPinAntennaModel* obj, int  index);
-
-EXTERN int defiPinAntennaModel_hasAPinMaxCutCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_numAPinMaxCutCar (const defiPinAntennaModel* obj);
-EXTERN int defiPinAntennaModel_APinMaxCutCar (const defiPinAntennaModel* obj, int  index);
-EXTERN int defiPinAntennaModel_hasAPinMaxCutCarLayer (const defiPinAntennaModel* obj, int  index);
-EXTERN const char* defiPinAntennaModel_APinMaxCutCarLayer (const defiPinAntennaModel* obj, int  index);
-
-EXTERN int defiPinPort_numLayer (const defiPinPort* obj);
-EXTERN const char* defiPinPort_layer (const defiPinPort* obj, int  index);
-EXTERN void defiPinPort_bounds (const defiPinPort* obj, int  index, int*  xl, int*  yl, int*  xh, int*  yh);
-EXTERN int defiPinPort_hasLayerSpacing (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_hasLayerDesignRuleWidth (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_layerSpacing (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_layerMask (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_layerDesignRuleWidth (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_numPolygons (const defiPinPort* obj);
-EXTERN const char* defiPinPort_polygonName (const defiPinPort* obj, int  index);
-EXTERN struct defiPoints defiPinPort_getPolygon (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_hasPolygonSpacing (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_hasPolygonDesignRuleWidth (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_polygonSpacing (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_polygonDesignRuleWidth (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_polygonMask (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_numVias (const defiPinPort* obj);
-EXTERN const char* defiPinPort_viaName (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_viaPtX (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_viaPtY (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_viaTopMask (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_viaCutMask (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_viaBottomMask (const defiPinPort* obj, int  index);
-EXTERN int defiPinPort_hasPlacement (const defiPinPort* obj);
-EXTERN int defiPinPort_isPlaced (const defiPinPort* obj);
-EXTERN int defiPinPort_isCover (const defiPinPort* obj);
-EXTERN int defiPinPort_isFixed (const defiPinPort* obj);
-EXTERN int defiPinPort_placementX (const defiPinPort* obj);
-EXTERN int defiPinPort_placementY (const defiPinPort* obj);
-EXTERN int defiPinPort_orient (const defiPinPort* obj);
-EXTERN const char* defiPinPort_orientStr (const defiPinPort* obj);
-
-  /* 5.6 setLayer is changed to addLayer due to multiple LAYER are allowed    */
-  /* in 5.6                                                                   */
-  /* 5.7 port statements, which may have LAYER, POLYGON, &| VIA               */
-
-EXTERN const char* defiPin_pinName (const defiPin* obj);
-EXTERN const char* defiPin_netName (const defiPin* obj);
-  /* optional parts                                                           */
-EXTERN int defiPin_hasDirection (const defiPin* obj);
-EXTERN int defiPin_hasUse (const defiPin* obj);
-EXTERN int defiPin_hasLayer (const defiPin* obj);
-EXTERN int defiPin_hasPlacement (const defiPin* obj);
-EXTERN int defiPin_isUnplaced (const defiPin* obj);
-EXTERN int defiPin_isPlaced (const defiPin* obj);
-EXTERN int defiPin_isCover (const defiPin* obj);
-EXTERN int defiPin_isFixed (const defiPin* obj);
-EXTERN int defiPin_placementX (const defiPin* obj);
-EXTERN int defiPin_placementY (const defiPin* obj);
-EXTERN const char* defiPin_direction (const defiPin* obj);
-EXTERN const char* defiPin_use (const defiPin* obj);
-EXTERN int defiPin_numLayer (const defiPin* obj);
-EXTERN const char* defiPin_layer (const defiPin* obj, int  index);
-EXTERN void defiPin_bounds (const defiPin* obj, int  index, int*  xl, int*  yl, int*  xh, int*  yh);
-EXTERN int defiPin_layerMask (const defiPin* obj, int  index);
-EXTERN int defiPin_hasLayerSpacing (const defiPin* obj, int  index);
-EXTERN int defiPin_hasLayerDesignRuleWidth (const defiPin* obj, int  index);
-EXTERN int defiPin_layerSpacing (const defiPin* obj, int  index);
-EXTERN int defiPin_layerDesignRuleWidth (const defiPin* obj, int  index);
-EXTERN int defiPin_numPolygons (const defiPin* obj);
-EXTERN const char* defiPin_polygonName (const defiPin* obj, int  index);
-EXTERN struct defiPoints defiPin_getPolygon (const defiPin* obj, int  index);
-EXTERN int defiPin_polygonMask (const defiPin* obj, int  index);
-EXTERN int defiPin_hasPolygonSpacing (const defiPin* obj, int  index);
-EXTERN int defiPin_hasPolygonDesignRuleWidth (const defiPin* obj, int  index);
-EXTERN int defiPin_polygonSpacing (const defiPin* obj, int  index);
-EXTERN int defiPin_polygonDesignRuleWidth (const defiPin* obj, int  index);
-EXTERN int defiPin_hasNetExpr (const defiPin* obj);
-EXTERN int defiPin_hasSupplySensitivity (const defiPin* obj);
-EXTERN int defiPin_hasGroundSensitivity (const defiPin* obj);
-EXTERN const char* defiPin_netExpr (const defiPin* obj);
-EXTERN const char* defiPin_supplySensitivity (const defiPin* obj);
-EXTERN const char* defiPin_groundSensitivity (const defiPin* obj);
-EXTERN int defiPin_orient (const defiPin* obj);
-EXTERN const char* defiPin_orientStr (const defiPin* obj);
-EXTERN int defiPin_hasSpecial (const defiPin* obj);
-EXTERN int defiPin_numVias (const defiPin* obj);
-EXTERN const char* defiPin_viaName (const defiPin* obj, int  index);
-EXTERN int defiPin_viaTopMask (const defiPin* obj, int  index);
-EXTERN int defiPin_viaCutMask (const defiPin* obj, int  index);
-EXTERN int defiPin_viaBottomMask (const defiPin* obj, int  index);
-EXTERN int defiPin_viaPtX (const defiPin* obj, int  index);
-EXTERN int defiPin_viaPtY (const defiPin* obj, int  index);
-
-  /* 5.4                                                                      */
-EXTERN int defiPin_hasAPinPartialMetalArea (const defiPin* obj);
-EXTERN int defiPin_numAPinPartialMetalArea (const defiPin* obj);
-EXTERN int defiPin_APinPartialMetalArea (const defiPin* obj, int  index);
-EXTERN int defiPin_hasAPinPartialMetalAreaLayer (const defiPin* obj, int  index);
-EXTERN const char* defiPin_APinPartialMetalAreaLayer (const defiPin* obj, int  index);
-
-EXTERN int defiPin_hasAPinPartialMetalSideArea (const defiPin* obj);
-EXTERN int defiPin_numAPinPartialMetalSideArea (const defiPin* obj);
-EXTERN int defiPin_APinPartialMetalSideArea (const defiPin* obj, int  index);
-EXTERN int defiPin_hasAPinPartialMetalSideAreaLayer (const defiPin* obj, int  index);
-EXTERN const char* defiPin_APinPartialMetalSideAreaLayer (const defiPin* obj, int  index);
-
-EXTERN int defiPin_hasAPinDiffArea (const defiPin* obj);
-EXTERN int defiPin_numAPinDiffArea (const defiPin* obj);
-EXTERN int defiPin_APinDiffArea (const defiPin* obj, int  index);
-EXTERN int defiPin_hasAPinDiffAreaLayer (const defiPin* obj, int  index);
-EXTERN const char* defiPin_APinDiffAreaLayer (const defiPin* obj, int  index);
-
-EXTERN int defiPin_hasAPinPartialCutArea (const defiPin* obj);
-EXTERN int defiPin_numAPinPartialCutArea (const defiPin* obj);
-EXTERN int defiPin_APinPartialCutArea (const defiPin* obj, int  index);
-EXTERN int defiPin_hasAPinPartialCutAreaLayer (const defiPin* obj, int  index);
-EXTERN const char* defiPin_APinPartialCutAreaLayer (const defiPin* obj, int  index);
-
-  /* 5.5                                                                      */
-EXTERN int defiPin_numAntennaModel (const defiPin* obj);
-EXTERN const defiPinAntennaModel* defiPin_antennaModel (const defiPin* obj, int  index);
-
-  /* 5.7                                                                      */
-EXTERN int defiPin_hasPort (const defiPin* obj);
-EXTERN int defiPin_numPorts (const defiPin* obj);
-EXTERN const defiPinPort* defiPin_pinPort (const defiPin* obj, int  index);
-EXTERN void defiPin_print (const defiPin* obj, FILE*  f);
-
-  /* 5.5 AntennaModel                                                         */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinProp.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinProp.h
deleted file mode 100644
index 7cef41b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPinProp.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPINPROP_H
-#define CDEFIPINPROP_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiPinProp_isPin (const defiPinProp* obj);
-EXTERN const char* defiPinProp_instName (const defiPinProp* obj);
-EXTERN const char* defiPinProp_pinName (const defiPinProp* obj);
-
-EXTERN int defiPinProp_numProps (const defiPinProp* obj);
-EXTERN const char* defiPinProp_propName (const defiPinProp* obj, int  index);
-EXTERN const char* defiPinProp_propValue (const defiPinProp* obj, int  index);
-EXTERN double defiPinProp_propNumber (const defiPinProp* obj, int  index);
-EXTERN const char defiPinProp_propType (const defiPinProp* obj, int  index);
-EXTERN int defiPinProp_propIsNumber (const defiPinProp* obj, int  index);
-EXTERN int defiPinProp_propIsString (const defiPinProp* obj, int  index);
-
-EXTERN void defiPinProp_print (const defiPinProp* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiProp.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiProp.h
deleted file mode 100644
index d8a9cca..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiProp.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPROP_H
-#define CDEFIPROP_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data for one property.                                    */
-
-EXTERN const char* defiProp_string (const defiProp* obj);
-EXTERN const char* defiProp_propType (const defiProp* obj);
-EXTERN const char* defiProp_propName (const defiProp* obj);
-EXTERN char defiProp_dataType (const defiProp* obj);
-       /* either I:integer R:real S:string Q:quotedstring N:nameMapString     */
-EXTERN int defiProp_hasNumber (const defiProp* obj);
-EXTERN int defiProp_hasRange (const defiProp* obj);
-EXTERN int defiProp_hasString (const defiProp* obj);
-EXTERN int defiProp_hasNameMapString (const defiProp* obj);
-EXTERN double defiProp_number (const defiProp* obj);
-EXTERN double defiProp_left (const defiProp* obj);
-EXTERN double defiProp_right (const defiProp* obj);
-
-EXTERN void defiProp_print (const defiProp* obj, FILE*  f);
-
-                        /*   N:nameMapString                                  */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPropType.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPropType.h
deleted file mode 100644
index 260fc8e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiPropType.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIPROPTYPE_H
-#define CDEFIPROPTYPE_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data type for one property, if the property is            */
-/* either REAL or INTEGER.                                                    */
-
-EXTERN const char defiPropType_propType (const defiPropType* obj, char*  name);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRegion.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRegion.h
deleted file mode 100644
index feb50f1..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRegion.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIREGION_H
-#define CDEFIREGION_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data for one property.                                    */
-
-EXTERN const char* defiRegion_name (const defiRegion* obj);
-
-EXTERN int defiRegion_numProps (const defiRegion* obj);
-EXTERN const char* defiRegion_propName (const defiRegion* obj, int  index);
-EXTERN const char* defiRegion_propValue (const defiRegion* obj, int  index);
-EXTERN double defiRegion_propNumber (const defiRegion* obj, int  index);
-EXTERN const char defiRegion_propType (const defiRegion* obj, int  index);
-EXTERN int defiRegion_propIsNumber (const defiRegion* obj, int  index);
-EXTERN int defiRegion_propIsString (const defiRegion* obj, int  index);
-
-EXTERN int defiRegion_hasType (const defiRegion* obj);
-EXTERN const char* defiRegion_type (const defiRegion* obj);
-
-EXTERN int defiRegion_numRectangles (const defiRegion* obj);
-EXTERN int defiRegion_xl (const defiRegion* obj, int  index);
-EXTERN int defiRegion_yl (const defiRegion* obj, int  index);
-EXTERN int defiRegion_xh (const defiRegion* obj, int  index);
-EXTERN int defiRegion_yh (const defiRegion* obj, int  index);
-
-EXTERN void defiRegion_print (const defiRegion* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRowTrack.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRowTrack.h
deleted file mode 100644
index ba0d4ab..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiRowTrack.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIROWTRACK_H
-#define CDEFIROWTRACK_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN const char* defiRow_name (const defiRow* obj);
-EXTERN const char* defiRow_macro (const defiRow* obj);
-EXTERN double defiRow_x (const defiRow* obj);
-EXTERN double defiRow_y (const defiRow* obj);
-EXTERN int defiRow_orient (const defiRow* obj);
-EXTERN const char* defiRow_orientStr (const defiRow* obj);
-EXTERN int defiRow_hasDo (const defiRow* obj);
-EXTERN double defiRow_xNum (const defiRow* obj);
-EXTERN double defiRow_yNum (const defiRow* obj);
-EXTERN int defiRow_hasDoStep (const defiRow* obj);
-EXTERN double defiRow_xStep (const defiRow* obj);
-EXTERN double defiRow_yStep (const defiRow* obj);
-
-EXTERN int defiRow_numProps (const defiRow* obj);
-EXTERN const char* defiRow_propName (const defiRow* obj, int  index);
-EXTERN const char* defiRow_propValue (const defiRow* obj, int  index);
-EXTERN double defiRow_propNumber (const defiRow* obj, int  index);
-EXTERN const char defiRow_propType (const defiRow* obj, int  index);
-EXTERN int defiRow_propIsNumber (const defiRow* obj, int  index);
-EXTERN int defiRow_propIsString (const defiRow* obj, int  index);
-
-EXTERN void defiRow_print (const defiRow* obj, FILE*  f);
-
-EXTERN const char* defiTrack_macro (const defiTrack* obj);
-EXTERN double defiTrack_x (const defiTrack* obj);
-EXTERN double defiTrack_xNum (const defiTrack* obj);
-EXTERN double defiTrack_xStep (const defiTrack* obj);
-EXTERN int defiTrack_numLayers (const defiTrack* obj);
-EXTERN const char* defiTrack_layer (const defiTrack* obj, int  index);
-EXTERN int defiTrack_firstTrackMask (const defiTrack* obj);
-EXTERN int defiTrack_sameMask (const defiTrack* obj);
-
-EXTERN void defiTrack_print (const defiTrack* obj, FILE*  f);
-
-EXTERN const char* defiGcellGrid_macro (const defiGcellGrid* obj);
-EXTERN int defiGcellGrid_x (const defiGcellGrid* obj);
-EXTERN int defiGcellGrid_xNum (const defiGcellGrid* obj);
-EXTERN double defiGcellGrid_xStep (const defiGcellGrid* obj);
-
-EXTERN void defiGcellGrid_print (const defiGcellGrid* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiScanchain.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiScanchain.h
deleted file mode 100644
index 8449c4f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiScanchain.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFISCANCHAIN_H
-#define CDEFISCANCHAIN_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiOrdered_num (const defiOrdered* obj);
-EXTERN char** defiOrdered_inst (const defiOrdered* obj);
-EXTERN char** defiOrdered_in (const defiOrdered* obj);
-EXTERN char** defiOrdered_out (const defiOrdered* obj);
-EXTERN int* defiOrdered_bits (const defiOrdered* obj);
-
-/* Struct holds the data for one Scan chain.                                  */
-/*                                                                            */
-
-EXTERN const char* defiScanchain_name (const defiScanchain* obj);
-EXTERN int defiScanchain_hasStart (const defiScanchain* obj);
-EXTERN int defiScanchain_hasStop (const defiScanchain* obj);
-EXTERN int defiScanchain_hasFloating (const defiScanchain* obj);
-EXTERN int defiScanchain_hasOrdered (const defiScanchain* obj);
-EXTERN int defiScanchain_hasCommonInPin (const defiScanchain* obj);
-EXTERN int defiScanchain_hasCommonOutPin (const defiScanchain* obj);
-EXTERN int defiScanchain_hasPartition (const defiScanchain* obj);
-EXTERN int defiScanchain_hasPartitionMaxBits (const defiScanchain* obj);
-
-  /* If the pin part of these routines were not supplied in the DEF           */
-  /* then a NULL pointer will be returned.                                    */
-EXTERN void defiScanchain_start (const defiScanchain* obj, char**  inst, char**  pin);
-EXTERN void defiScanchain_stop (const defiScanchain* obj, char**  inst, char**  pin);
-
-  /* There could be many ORDERED constructs in the DEF.  The data in          */
-  /* each ORDERED construct is stored in its own array.  The numOrderedLists( */
-  /* routine tells how many lists there are.                                  */
-EXTERN int defiScanchain_numOrderedLists (const defiScanchain* obj);
-
-  /* This routine will return an array of instances and                       */
-  /* an array of in and out pins.                                             */
-  /* The number if things in the arrays is returned in size.                  */
-  /* The inPin and outPin entry is optional for each instance.                */
-  /* If an entry is not given, then that char* is NULL.                       */
-  /* For example if the second instance has                                   */
-  /* instnam= "FOO" and IN="A", but no OUT given, then inst[1] points         */
-  /* to "FOO"  inPin[1] points to "A" and outPin[1] is a NULL pointer.        */
-EXTERN void defiScanchain_ordered (const defiScanchain* obj, int  index, int*  size, char***  inst, char***  inPin, char***  outPin, int**  bits);
-
-  /* All of the floating constructs in the scan chain are                     */
-  /* stored in this one array.                                                */
-  /* If the IN or OUT of an entry is not supplied then the array will have    */
-  /* a NULL pointer in that place.                                            */
-EXTERN void defiScanchain_floating (const defiScanchain* obj, int*  size, char***  inst, char***  inPin, char***  outPin, int**  bits);
-
-EXTERN const char* defiScanchain_commonInPin (const defiScanchain* obj);
-EXTERN const char* defiScanchain_commonOutPin (const defiScanchain* obj);
-
-EXTERN const char* defiScanchain_partitionName (const defiScanchain* obj);
-EXTERN int defiScanchain_partitionMaxBits (const defiScanchain* obj);
-
-EXTERN void defiScanchain_print (const defiScanchain* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSite.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSite.h
deleted file mode 100644
index 7353ceb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSite.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFISITE_H
-#define CDEFISITE_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/*
- * Struct holds the data for one site.
- * It is also used for a canplace and cannotoccupy.
- */
-
-EXTERN double defiSite_x_num (const defiSite* obj);
-EXTERN double defiSite_y_num (const defiSite* obj);
-EXTERN double defiSite_x_step (const defiSite* obj);
-EXTERN double defiSite_y_step (const defiSite* obj);
-EXTERN double defiSite_x_orig (const defiSite* obj);
-EXTERN double defiSite_y_orig (const defiSite* obj);
-EXTERN int defiSite_orient (const defiSite* obj);
-EXTERN const char* defiSite_orientStr (const defiSite* obj);
-EXTERN const char* defiSite_name (const defiSite* obj);
-
-EXTERN void defiSite_print (const defiSite* obj, FILE*  f);
-
-/* Struct holds the data for a Box */
-  /* Use the default destructor and constructor.                              */
-  /* 5.6 changed to use it own constructor & destructor                       */
-
-  /* NOTE: 5.6                                                                */
-  /* The following methods are still here for backward compatibility          */
-  /* For new reader they should use numPoints & getPoint to get the           */
-  /* data.                                                                    */
-EXTERN int defiBox_xl (const defiBox* obj);
-EXTERN int defiBox_yl (const defiBox* obj);
-EXTERN int defiBox_xh (const defiBox* obj);
-EXTERN int defiBox_yh (const defiBox* obj);
-
-EXTERN struct defiPoints defiBox_getPoint (const defiBox* obj);
-
-EXTERN void defiBox_print (const defiBox* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSlot.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSlot.h
deleted file mode 100644
index a119423..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiSlot.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFISLOT_H
-#define CDEFISLOT_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-EXTERN int defiSlot_hasLayer (const defiSlot* obj);
-EXTERN const char* defiSlot_layerName (const defiSlot* obj);
-
-EXTERN int defiSlot_numRectangles (const defiSlot* obj);
-EXTERN int defiSlot_xl (const defiSlot* obj, int  index);
-EXTERN int defiSlot_yl (const defiSlot* obj, int  index);
-EXTERN int defiSlot_xh (const defiSlot* obj, int  index);
-EXTERN int defiSlot_yh (const defiSlot* obj, int  index);
-
-EXTERN int defiSlot_numPolygons (const defiSlot* obj);
-EXTERN struct defiPoints defiSlot_getPolygon (const defiSlot* obj, int  index);
-
-EXTERN void defiSlot_print (const defiSlot* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTimingDisable.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTimingDisable.h
deleted file mode 100644
index 5106ae9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTimingDisable.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFITIMINGDISABLE_H
-#define CDEFITIMINGDISABLE_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* A Timing disable can be a from-to  or a thru or a macro.                   */
-/*   A macro is either a fromto macro or a thru macro.                        */
-
-EXTERN int defiTimingDisable_hasMacroThru (const defiTimingDisable* obj);
-EXTERN int defiTimingDisable_hasMacroFromTo (const defiTimingDisable* obj);
-EXTERN int defiTimingDisable_hasThru (const defiTimingDisable* obj);
-EXTERN int defiTimingDisable_hasFromTo (const defiTimingDisable* obj);
-EXTERN int defiTimingDisable_hasReentrantPathsFlag (const defiTimingDisable* obj);
-
-EXTERN const char* defiTimingDisable_fromPin (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_toPin (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_fromInst (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_toInst (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_macroName (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_thruPin (const defiTimingDisable* obj);
-EXTERN const char* defiTimingDisable_thruInst (const defiTimingDisable* obj);
-
-  /* debug print                                                              */
-EXTERN void defiTimingDisable_print (const defiTimingDisable* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTypedefs.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTypedefs.h
deleted file mode 100644
index 0858094..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiTypedefs.h
+++ /dev/null
@@ -1,115 +0,0 @@
- /* ***************************************************************************** */
- /* ***************************************************************************** */
- /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */
- /* ***************************************************************************** */
- /* ***************************************************************************** */
- /* Copyright 2012, Cadence Design Systems */
- /*  */
- /* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source */
- /* Distribution,  Product Version 5.8.  */
- /*  */
- /* 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 */
- /*  */
- /*        http://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. */
- /*  */
- /*  */
- /* For updates, support, or to become part of the LEF/DEF Community, */
- /* check www.openeda.org for details. */
- /*  */
- /*  $Author: xxx $ */
- /*  $Revision: xxx $ */
- /*  $Date: xxx $ */
- /*  $State: xxx $ */
- /* ***************************************************************************** */
- /* ***************************************************************************** */
-
-#ifndef CLEFITYPEDEFS_H
-#define CLEFITYPEDEFS_H
-
-#ifndef EXTERN
-#define EXTERN extern
-#endif
-
-#define bool int
-#define defiUserData void *
-#define defiUserDataHandle void **
-
-/* Typedefs */
-
-/* Pointers to C++ classes */
-typedef void *defiPinPort;
-typedef void *defiTimingDisable;
-typedef void *defiPartition;
-typedef void *defiAssertion;
-typedef void *defiPinAntennaModel;
-typedef void *defiIOTiming;
-typedef void *defiRegion;
-typedef void *defiSubnet;
-typedef void *defiTrack;
-typedef void *defiProp;
-typedef void *defiRow;
-typedef void *defiFPC;
-typedef void *defiShield;
-typedef void *defiVia;
-typedef void *defiNonDefault;
-typedef void *defiBox;
-typedef void *defiWire;
-typedef void *defiOrdered;
-typedef void *defiPropType;
-typedef void *defiAlias_itr;
-typedef void *defiScanchain;
-typedef void *defiComponent;
-typedef void *defiFill;
-typedef void *defiSite;
-typedef void *defiPin;
-typedef void *defiPinProp;
-typedef void *defiStyles;
-typedef void *defiBlockage;
-typedef void *defiGeometries;
-typedef void *defiVpin;
-typedef void *defiNet;
-typedef void *defiSlot;
-typedef void *defiGcellGrid;
-typedef void *defiPath;
-typedef void *defiGroup;
-typedef void *defiPinCap;
-typedef void *defiComponentMaskShiftLayer;
-typedef void *defrData;
-
-/* Data structures definitions */
-struct defiPoints {
-  int numPoints;
-  int* x;
-  int* y;
-};
-
-struct defiPnt {
-  int x;
-  int y;
-  int ext;
-};
-
-struct defiViaData {
-  int numX;
-  int numY;
-  int stepX;
-  int stepY;
-};
-
-struct defiViaRect {
-  int deltaX1;
-  int deltaY1;
-  int deltaX2;
-  int deltaY2;
-};
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiUser.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiUser.h
deleted file mode 100644
index 6a113a5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiUser.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                       */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-/*
- * User header file for the DEF Interface.  This includes
- * all of the header files which are relevant to both the
- * reader and the writer.
- *
- * defrReader.h and defwWriter.h include this file, so that
- * an application only needs to include either defwReader.h
- * or defwWriter.h.
- */
-
-
-#ifndef CDEFIUSER_H
-#define CDEFIUSER_H
-
-#include "defiAlias.h"
-#include "defiAssertion.h"
-#include "defiBlockage.h"
-#include "defiComponent.h"
-#include "defiDebug.h"
-#include "defiFill.h"
-#include "defiFPC.h"
-#include "defiGroup.h"
-#include "defiIOTiming.h"
-#include "defiMisc.h"
-#include "defiNet.h"
-#include "defiNonDefault.h"
-#include "defiPartition.h"
-#include "defiPath.h"
-#include "defiPinCap.h"
-#include "defiPinProp.h"
-#include "defiProp.h"
-#include "defiPropType.h"
-#include "defiRegion.h"
-#include "defiRowTrack.h"
-#include "defiScanchain.h"
-#include "defiSite.h"
-#include "defiSlot.h"
-#include "defiTimingDisable.h"
-#include "defiVia.h"
-
-
-/* General utilities. */
-/* #include "defiMalloc.hpp" */
-/* #include "defiUtils.hpp" */
-
-/*
- * API objects
- */
-
-/* NEW CALLBACK - If you are creating a new .cpp and .hpp file to
- * describe a new class of object in the parser, then add a reference
- * to the .hpp here.
- *
- *  You must also add an entry for the .h and the .hpp in the package_list
- * file of the ../../../release directory. */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiVia.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiVia.h
deleted file mode 100644
index 9d3d417..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defiVia.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFIVIA_H
-#define CDEFIVIA_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Struct holds the data for one property.                                    */
-
-  /* 5.6                                                                      */
-
-EXTERN const char* defiVia_name (const defiVia* obj);
-EXTERN const char* defiVia_pattern (const defiVia* obj);
-EXTERN int defiVia_hasPattern (const defiVia* obj);
-EXTERN int defiVia_numLayers (const defiVia* obj);
-EXTERN void defiVia_layer (const defiVia* obj, int  index, char**  layer, int*  xl, int*  yl, int*  xh, int*  yh);
-EXTERN int defiVia_numPolygons (const defiVia* obj);
-EXTERN const char* defiVia_polygonName (const defiVia* obj, int  index);
-EXTERN struct defiPoints defiVia_getPolygon (const defiVia* obj, int  index);
-EXTERN int defiVia_hasViaRule (const defiVia* obj);
-EXTERN void defiVia_viaRule (const defiVia* obj, char**  viaRuleName, int*  xSize, int*  ySize, char**  botLayer, char**  cutLayer, char**  topLayer, int*  xCutSpacing, int*  yCutSpacing, int*  xBotEnc, int*  yBotEnc, int*  xTopEnc, int*  yTopEnc);
-EXTERN int defiVia_hasRowCol (const defiVia* obj);
-EXTERN void defiVia_rowCol (const defiVia* obj, int*  numCutRows, int*  numCutCols);
-EXTERN int defiVia_hasOrigin (const defiVia* obj);
-EXTERN void defiVia_origin (const defiVia* obj, int*  xOffset, int*  yOffset);
-EXTERN int defiVia_hasOffset (const defiVia* obj);
-EXTERN void defiVia_offset (const defiVia* obj, int*  xBotOffset, int*  yBotOffset, int*  xTopOffset, int*  yTopOffset);
-EXTERN int defiVia_hasCutPattern (const defiVia* obj);
-EXTERN const char* defiVia_cutPattern (const defiVia* obj);
-EXTERN int defiVia_hasRectMask (const defiVia* obj, int  index);
-EXTERN int defiVia_rectMask (const defiVia* obj, int  index);
-EXTERN int defiVia_hasPolyMask (const defiVia* obj, int  index);
-EXTERN int defiVia_polyMask (const defiVia* obj, int  index);
-
-EXTERN void defiVia_print (const defiVia* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defrReader.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defrReader.h
deleted file mode 100644
index de48194..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defrReader.h
+++ /dev/null
@@ -1,668 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013-2014, Cadence Design Systems                                */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                           */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFRREADER_H
-#define CDEFRREADER_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-#define DEF_MSGS 4013
-#define CBMAX 150    
-
-/* An enum describing all of the types of reader callbacks.                   */
-typedef enum {
-  defrUnspecifiedCbkType = 0,
-  defrDesignStartCbkType = 1,
-  defrTechNameCbkType = 2,
-  defrPropCbkType = 3,
-  defrPropDefEndCbkType = 4,
-  defrPropDefStartCbkType = 5,
-  defrFloorPlanNameCbkType = 6,
-  defrArrayNameCbkType = 7,
-  defrUnitsCbkType = 8,
-  defrDividerCbkType = 9,
-  defrBusBitCbkType = 10,
-  defrSiteCbkType = 11,
-  defrComponentStartCbkType = 12,
-  defrComponentCbkType = 13,
-  defrComponentEndCbkType = 14,
-  defrNetStartCbkType = 15,
-  defrNetCbkType = 16,
-  defrNetNameCbkType = 17,
-  defrNetNonDefaultRuleCbkType = 18,
-  defrNetSubnetNameCbkType = 19,
-  defrNetEndCbkType = 20,
-  defrPathCbkType = 21,
-  defrVersionCbkType = 22,
-  defrVersionStrCbkType = 23,
-  defrComponentExtCbkType = 24,
-  defrPinExtCbkType = 25,
-  defrViaExtCbkType = 26,
-  defrNetConnectionExtCbkType = 27,
-  defrNetExtCbkType = 28,
-  defrGroupExtCbkType = 29,
-  defrScanChainExtCbkType = 30,
-  defrIoTimingsExtCbkType = 31,
-  defrPartitionsExtCbkType = 32,
-  defrHistoryCbkType = 33,
-  defrDieAreaCbkType = 34,
-  defrCanplaceCbkType = 35,
-  defrCannotOccupyCbkType = 36,
-  defrPinCapCbkType = 37,
-  defrDefaultCapCbkType = 38,
-  defrStartPinsCbkType = 39,
-  defrPinCbkType = 40,
-  defrPinEndCbkType = 41,
-  defrRowCbkType = 42,
-  defrTrackCbkType = 43,
-  defrGcellGridCbkType = 44,
-  defrViaStartCbkType = 45,
-  defrViaCbkType = 46,
-  defrViaEndCbkType = 47,
-  defrRegionStartCbkType = 48,
-  defrRegionCbkType = 49,
-  defrRegionEndCbkType = 50,
-  defrSNetStartCbkType = 51,
-  defrSNetCbkType = 52,
-  defrSNetPartialPathCbkType = 53,
-  defrSNetWireCbkType = 54,
-  defrSNetEndCbkType = 55,
-  defrGroupsStartCbkType = 56,
-  defrGroupNameCbkType = 57,
-  defrGroupMemberCbkType = 58,
-  defrGroupCbkType = 59,
-  defrGroupsEndCbkType = 60,
-  defrAssertionsStartCbkType = 61,
-  defrAssertionCbkType = 62,
-  defrAssertionsEndCbkType = 63,
-  defrConstraintsStartCbkType = 64,
-  defrConstraintCbkType = 65,
-  defrConstraintsEndCbkType = 66,
-  defrScanchainsStartCbkType = 67,
-  defrScanchainCbkType = 68,
-  defrScanchainsEndCbkType = 69,
-  defrIOTimingsStartCbkType = 70,
-  defrIOTimingCbkType = 71,
-  defrIOTimingsEndCbkType = 72,
-  defrFPCStartCbkType = 73,
-  defrFPCCbkType = 74,
-  defrFPCEndCbkType = 75,
-  defrTimingDisablesStartCbkType = 76,
-  defrTimingDisableCbkType = 77,
-  defrTimingDisablesEndCbkType = 78,
-  defrPartitionsStartCbkType = 79,
-  defrPartitionCbkType = 80,
-  defrPartitionsEndCbkType = 81,
-  defrPinPropStartCbkType = 82,
-  defrPinPropCbkType = 83,
-  defrPinPropEndCbkType = 84,
-  defrBlockageStartCbkType = 85,
-  defrBlockageCbkType = 86,
-  defrBlockageEndCbkType = 87,
-  defrSlotStartCbkType = 88,
-  defrSlotCbkType = 89,
-  defrSlotEndCbkType = 90,
-  defrFillStartCbkType = 91,
-  defrFillCbkType = 92,
-  defrFillEndCbkType = 93,
-  defrCaseSensitiveCbkType = 94,
-  defrNonDefaultStartCbkType = 95,
-  defrNonDefaultCbkType = 96,
-  defrNonDefaultEndCbkType = 97,
-  defrStylesStartCbkType = 98,
-  defrStylesCbkType = 99,
-  defrStylesEndCbkType = 100,
-  defrExtensionCbkType = 101,
-
-  /* NEW CALLBACK - If you are creating a new callback, you must add          */
-  /* a unique item to this enum for each callback routine. When the           */
-  /* callback is called in def.y you have to supply this enum item            */
-  /* as an argument in the call.                                              */
-
-  defrComponentMaskShiftLayerCbkType = 102,
-  defrDesignEndCbkType = 103
-} defrCallbackType_e;
-
-/* Declarations of function signatures for each type of callback.             */
-/* These declarations are type-safe when compiling with ANSI C                */
-/* or C++; you will only be able to register a function pointer               */
-/* with the correct signature for a given type of callback.                   */
-/*                                                                            */
-/* Each callback function is expected to return 0 if successful.              */
-/* A non-zero return code will cause the reader to abort.                     */
-/*                                                                            */
-/* The defrDesignStart and defrDesignEnd callback is only called once.        */
-/* Other callbacks may be called multiple times, each time with a different   */
-/* set of data.                                                               */
-/*                                                                            */
-/* For each callback, the Def API will make the callback to the               */
-/* function supplied by the client, which should either make a copy           */
-/* of the Def object, or store the data in the client's own data structures.  */
-/* The Def API will delete or reuse each object after making the callback,    */
-/* so the client should not keep a pointer to it.                             */
-/*                                                                            */
-/* All callbacks pass the user data pointer provided in defrRead()            */
-/* or defrSetUserData() back to the client; this can be used by the           */
-/* client to obtain access to the rest of the client's data structures.       */
-/*                                                                            */
-/* The user data pointer is obtained using defrGetUserData() immediately      */
-/* prior to making each callback, so the client is free to change the         */
-/* user data on the fly if necessary.                                         */
-/*                                                                            */
-/* Callbacks with the same signature are passed a callback type               */
-/* parameter, which allows an application to write a single callback          */
-/* function, register that function for multiple callbacks, then              */
-/* switch based on the callback type to handle the appropriate type of        */
-/* data.                                                                      */
-
-/* A declaration of the signature of all callbacks that return nothing.       */
-typedef int (*defrVoidCbkFnType) (defrCallbackType_e, void* v, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a string.      */
-typedef int (*defrStringCbkFnType) (defrCallbackType_e, const char *string, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a integer.     */
-typedef int (*defrIntegerCbkFnType) (defrCallbackType_e, int number, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a double.      */
-typedef int (*defrDoubleCbkFnType) (defrCallbackType_e, double number, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiProp.    */
-typedef int (*defrPropCbkFnType) (defrCallbackType_e, defiProp *prop, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiSite.    */
-typedef int (*defrSiteCbkFnType) (defrCallbackType_e, defiSite *site, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defComponent */
-typedef int (*defrComponentCbkFnType) (defrCallbackType_e, defiComponent *comp, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defComponent */
-typedef int (*defrComponentMaskShiftLayerCbkFnType) (defrCallbackType_e, defiComponentMaskShiftLayer *comp, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defNet.      */
-typedef int (*defrNetCbkFnType) (defrCallbackType_e, defiNet *net, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defPath.     */
-typedef int (*defrPathCbkFnType) (defrCallbackType_e, defiPath *path, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiBox.     */
-typedef int (*defrBoxCbkFnType) (defrCallbackType_e, defiBox *box, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiPinCap.  */
-typedef int (*defrPinCapCbkFnType) (defrCallbackType_e, defiPinCap *pincap, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiPin.     */
-typedef int (*defrPinCbkFnType) (defrCallbackType_e, defiPin *pin, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiRow.     */
-typedef int (*defrRowCbkFnType) (defrCallbackType_e, defiRow *row, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiTrack.   */
-typedef int (*defrTrackCbkFnType) (defrCallbackType_e, defiTrack *track, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiGcellGri */
-typedef int (*defrGcellGridCbkFnType) (defrCallbackType_e, defiGcellGrid *grid, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiVia.     */
-typedef int (*defrViaCbkFnType) (defrCallbackType_e, defiVia *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiRegion.  */
-typedef int (*defrRegionCbkFnType) (defrCallbackType_e, defiRegion *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiGroup.   */
-typedef int (*defrGroupCbkFnType) (defrCallbackType_e, defiGroup *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiAssertio */
-typedef int (*defrAssertionCbkFnType) (defrCallbackType_e, defiAssertion *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiScanChai */
-typedef int (*defrScanchainCbkFnType) (defrCallbackType_e, defiScanchain *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiIOTiming */
-typedef int (*defrIOTimingCbkFnType) (defrCallbackType_e, defiIOTiming *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiFPC.     */
-typedef int (*defrFPCCbkFnType) (defrCallbackType_e, defiFPC *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiTimingDi */
-typedef int (*defrTimingDisableCbkFnType) (defrCallbackType_e, defiTimingDisable *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiPartitio */
-typedef int (*defrPartitionCbkFnType) (defrCallbackType_e, defiPartition *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiPinProp. */
-typedef int (*defrPinPropCbkFnType) (defrCallbackType_e, defiPinProp *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiBlockage */
-typedef int (*defrBlockageCbkFnType) (defrCallbackType_e, defiBlockage *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiSlot.    */
-typedef int (*defrSlotCbkFnType) (defrCallbackType_e, defiSlot *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiFill.    */
-typedef int (*defrFillCbkFnType) (defrCallbackType_e, defiFill *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiNonDefau */
-typedef int (*defrNonDefaultCbkFnType) (defrCallbackType_e, defiNonDefault *, defiUserData);
-
-/* A declaration of the signature of all callbacks that return a defiStyles.  */
-typedef int (*defrStylesCbkFnType) (defrCallbackType_e, defiStyles *, defiUserData);
-
-/* NEW CALLBACK - Each callback must return user data, enum, and              */
-/*   OUR-DATA item.  We must define a callback function type for              */
-/*   each type of OUR-DATA.  Some routines return a string, some              */
-/*   return an integer, and some return a pointer to a class.                 */
-/*   If you create a new class, then you must create a new function           */
-/*   type here to return that class to the user.                              */
-
-/* The reader initialization.  Must be called before defrRead().              */
-EXTERN int defrInit ();
-EXTERN int defrInitSession (int  startSession);
-
-/* obsoleted now.                                                             */
-EXTERN int defrReset ();
-
-/*Sets all parser memory into init state.                                     */
-EXTERN int defrClear ();
-
-/* Change the comment character in the DEF file.  The default                 */
-/* is '#'                                                                     */
-EXTERN void defrSetCommentChar (char  c);
-
-/* Functions to call to set specific actions in the parser.                   */
-EXTERN void defrSetAddPathToNet ();
-EXTERN void defrSetAllowComponentNets ();
-EXTERN int defrGetAllowComponentNets ();
-EXTERN void defrSetCaseSensitivity (int  caseSense);
-
-/* Functions to keep track of callbacks that the user did not                 */
-/* supply.  Normally all parts of the DEF file that the user                  */
-/* does not supply a callback for will be ignored.  These                     */
-/* routines tell the parser count the DEF constructs that are                 */
-/* present in the input file, but did not trigger a callback.                 */
-/* This should help you find any "important" DEF constructs that              */
-/* you are ignoring.                                                          */
-EXTERN void defrSetRegisterUnusedCallbacks ();
-EXTERN void defrPrintUnusedCallbacks (FILE*  log);
-
-/* Obsoleted now.                                                             */
-EXTERN int  defrReleaseNResetMemory ();
-
-/* The main reader function.                                                  */
-/* The file should already be opened.  This requirement allows                */
-/* the reader to be used with stdin or a pipe.  The file name                 */
-/* is only used for error messages.                                           */
-EXTERN int defrRead (FILE * file, const char * fileName, defiUserData  userData, int  case_sensitive);
-
-/* Set/get the client-provided user data.  defi doesn't look at               */
-/* this data at all, it simply passes the opaque defiUserData pointer         */
-/* back to the application with each callback.  The client can                */
-/* change the data at any time, and it will take effect on the                */
-/* next callback.  The defi reader and writer maintain separate               */
-/* user data pointers.                                                        */
-EXTERN void defrSetUserData (defiUserData p0);
-EXTERN defiUserData defrGetUserData ();
-
-/* Functions to call to register a callback function or get the function      */
-/*pointer after it has been registered.                                       */
-/*                                                                            */
-
-/* Register one function for all callbacks with the same signature            */
-EXTERN void defrSetArrayNameCbk (defrStringCbkFnType p0);
-EXTERN void defrSetAssertionCbk (defrAssertionCbkFnType p0);
-EXTERN void defrSetAssertionsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetAssertionsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetBlockageCbk (defrBlockageCbkFnType p0);
-EXTERN void defrSetBlockageStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetBlockageEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetBusBitCbk (defrStringCbkFnType p0);
-EXTERN void defrSetCannotOccupyCbk (defrSiteCbkFnType p0);
-EXTERN void defrSetCanplaceCbk (defrSiteCbkFnType p0);
-EXTERN void defrSetCaseSensitiveCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetComponentCbk (defrComponentCbkFnType p0);
-EXTERN void defrSetComponentExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetComponentStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetComponentEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetConstraintCbk (defrAssertionCbkFnType p0);
-EXTERN void defrSetConstraintsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetConstraintsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetDefaultCapCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetDesignCbk (defrStringCbkFnType p0);
-EXTERN void defrSetDesignEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetDieAreaCbk (defrBoxCbkFnType p0);
-EXTERN void defrSetDividerCbk (defrStringCbkFnType p0);
-EXTERN void defrSetExtensionCbk (defrStringCbkFnType p0);
-EXTERN void defrSetFillCbk (defrFillCbkFnType p0);
-EXTERN void defrSetFillStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetFillEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetFPCCbk (defrFPCCbkFnType p0);
-EXTERN void defrSetFPCStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetFPCEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetFloorPlanNameCbk (defrStringCbkFnType p0);
-EXTERN void defrSetGcellGridCbk (defrGcellGridCbkFnType p0);
-EXTERN void defrSetGroupNameCbk (defrStringCbkFnType p0);
-EXTERN void defrSetGroupMemberCbk (defrStringCbkFnType p0);
-EXTERN void defrSetComponentMaskShiftLayerCbk (defrComponentMaskShiftLayerCbkFnType p0);
-EXTERN void defrSetGroupCbk (defrGroupCbkFnType p0);
-EXTERN void defrSetGroupExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetGroupsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetGroupsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetHistoryCbk (defrStringCbkFnType p0);
-EXTERN void defrSetIOTimingCbk (defrIOTimingCbkFnType p0);
-EXTERN void defrSetIOTimingsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetIOTimingsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetIoTimingsExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetCbk (defrNetCbkFnType p0);
-EXTERN void defrSetNetNameCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetNonDefaultRuleCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetConnectionExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetPartialPathCbk (defrNetCbkFnType p0);
-EXTERN void defrSetNetSubnetNameCbk (defrStringCbkFnType p0);
-EXTERN void defrSetNetStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetNetEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetNonDefaultCbk (defrNonDefaultCbkFnType p0);
-EXTERN void defrSetNonDefaultStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetNonDefaultEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetPartitionCbk (defrPartitionCbkFnType p0);
-EXTERN void defrSetPartitionsExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetPartitionsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetPartitionsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetPathCbk (defrPathCbkFnType p0);
-EXTERN void defrSetPinCapCbk (defrPinCapCbkFnType p0);
-EXTERN void defrSetPinCbk (defrPinCbkFnType p0);
-EXTERN void defrSetPinExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetPinPropCbk (defrPinPropCbkFnType p0);
-EXTERN void defrSetPinPropStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetPinPropEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetPropCbk (defrPropCbkFnType p0);
-EXTERN void defrSetPropDefEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetPropDefStartCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetRegionCbk (defrRegionCbkFnType p0);
-EXTERN void defrSetRegionStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetRegionEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetRowCbk (defrRowCbkFnType p0);
-EXTERN void defrSetSNetCbk (defrNetCbkFnType p0);
-EXTERN void defrSetSNetStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetSNetEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetSNetPartialPathCbk (defrNetCbkFnType p0);
-EXTERN void defrSetSNetWireCbk (defrNetCbkFnType p0);
-EXTERN void defrSetScanChainExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetScanchainCbk (defrScanchainCbkFnType p0);
-EXTERN void defrSetScanchainsStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetScanchainsEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetSiteCbk (defrSiteCbkFnType p0);
-EXTERN void defrSetSlotCbk (defrSlotCbkFnType p0);
-EXTERN void defrSetSlotStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetSlotEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetStartPinsCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetStylesCbk (defrStylesCbkFnType p0);
-EXTERN void defrSetStylesStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetStylesEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetPinEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetTechnologyCbk (defrStringCbkFnType p0);
-EXTERN void defrSetTimingDisableCbk (defrTimingDisableCbkFnType p0);
-EXTERN void defrSetTimingDisablesStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetTimingDisablesEndCbk (defrVoidCbkFnType p0);
-EXTERN void defrSetTrackCbk (defrTrackCbkFnType p0);
-EXTERN void defrSetUnitsCbk (defrDoubleCbkFnType p0);
-EXTERN void defrSetVersionCbk (defrDoubleCbkFnType p0);
-EXTERN void defrSetVersionStrCbk (defrStringCbkFnType p0);
-EXTERN void defrSetViaCbk (defrViaCbkFnType p0);
-EXTERN void defrSetViaExtCbk (defrStringCbkFnType p0);
-EXTERN void defrSetViaStartCbk (defrIntegerCbkFnType p0);
-EXTERN void defrSetViaEndCbk (defrVoidCbkFnType p0);
-
-/* NEW CALLBACK - For each new callback you create, you must                  */
-/* create a routine that allows the user to set it.  Add the                  */
-/* setting routines here.                                                     */
-
-/*Set all of the callbacks that have not yet been set to the following        */
-/*function.  This is especially useful if you want to check to see            */
-/*if you forgot anything.                                                     */
-EXTERN void defrUnsetCallbacks ();
-
-/* Functions to call to unregister a callback function.                       */
-EXTERN void defrUnsetArrayNameCbk ();
-EXTERN void defrUnsetAssertionCbk ();
-EXTERN void defrUnsetAssertionsStartCbk ();
-EXTERN void defrUnsetAssertionsEndCbk ();
-EXTERN void defrUnsetBlockageCbk ();
-EXTERN void defrUnsetBlockageStartCbk ();
-EXTERN void defrUnsetBlockageEndCbk ();
-EXTERN void defrUnsetBusBitCbk ();
-EXTERN void defrUnsetCannotOccupyCbk ();
-EXTERN void defrUnsetCanplaceCbk ();
-EXTERN void defrUnsetCaseSensitiveCbk ();
-EXTERN void defrUnsetComponentCbk ();
-EXTERN void defrUnsetComponentExtCbk ();
-EXTERN void defrUnsetComponentStartCbk ();
-EXTERN void defrUnsetComponentEndCbk ();
-EXTERN void defrUnsetConstraintCbk ();
-EXTERN void defrUnsetConstraintsStartCbk ();
-EXTERN void defrUnsetConstraintsEndCbk ();
-EXTERN void defrUnsetDefaultCapCbk ();
-EXTERN void defrUnsetDesignCbk ();
-EXTERN void defrUnsetDesignEndCbk ();
-EXTERN void defrUnsetDieAreaCbk ();
-EXTERN void defrUnsetDividerCbk ();
-EXTERN void defrUnsetExtensionCbk ();
-EXTERN void defrUnsetFillCbk ();
-EXTERN void defrUnsetFillStartCbk ();
-EXTERN void defrUnsetFillEndCbk ();
-EXTERN void defrUnsetFPCCbk ();
-EXTERN void defrUnsetFPCStartCbk ();
-EXTERN void defrUnsetFPCEndCbk ();
-EXTERN void defrUnsetFloorPlanNameCbk ();
-EXTERN void defrUnsetGcellGridCbk ();
-EXTERN void defrUnsetGroupCbk ();
-EXTERN void defrUnsetGroupExtCbk ();
-EXTERN void defrUnsetGroupMemberCbk ();
-EXTERN void defrUnsetComponentMaskShiftLayerCbk ();
-EXTERN void defrUnsetGroupNameCbk ();
-EXTERN void defrUnsetGroupsStartCbk ();
-EXTERN void defrUnsetGroupsEndCbk ();
-EXTERN void defrUnsetHistoryCbk ();
-EXTERN void defrUnsetIOTimingCbk ();
-EXTERN void defrUnsetIOTimingsStartCbk ();
-EXTERN void defrUnsetIOTimingsEndCbk ();
-EXTERN void defrUnsetIOTimingsExtCbk ();
-EXTERN void defrUnsetNetCbk ();
-EXTERN void defrUnsetNetNameCbk ();
-EXTERN void defrUnsetNetNonDefaultRuleCbk ();
-EXTERN void defrUnsetNetConnectionExtCbk ();
-EXTERN void defrUnsetNetExtCbk ();
-EXTERN void defrUnsetNetPartialPathCbk ();
-EXTERN void defrUnsetNetSubnetNameCbk ();
-EXTERN void defrUnsetNetStartCbk ();
-EXTERN void defrUnsetNetEndCbk ();
-EXTERN void defrUnsetNonDefaultCbk ();
-EXTERN void defrUnsetNonDefaultStartCbk ();
-EXTERN void defrUnsetNonDefaultEndCbk ();
-EXTERN void defrUnsetPartitionCbk ();
-EXTERN void defrUnsetPartitionsExtCbk ();
-EXTERN void defrUnsetPartitionsStartCbk ();
-EXTERN void defrUnsetPartitionsEndCbk ();
-EXTERN void defrUnsetPathCbk ();
-EXTERN void defrUnsetPinCapCbk ();
-EXTERN void defrUnsetPinCbk ();
-EXTERN void defrUnsetPinEndCbk ();
-EXTERN void defrUnsetPinExtCbk ();
-EXTERN void defrUnsetPinPropCbk ();
-EXTERN void defrUnsetPinPropStartCbk ();
-EXTERN void defrUnsetPinPropEndCbk ();
-EXTERN void defrUnsetPropCbk ();
-EXTERN void defrUnsetPropDefEndCbk ();
-EXTERN void defrUnsetPropDefStartCbk ();
-EXTERN void defrUnsetRegionCbk ();
-EXTERN void defrUnsetRegionStartCbk ();
-EXTERN void defrUnsetRegionEndCbk ();
-EXTERN void defrUnsetRowCbk ();
-EXTERN void defrUnsetScanChainExtCbk ();
-EXTERN void defrUnsetScanchainCbk ();
-EXTERN void defrUnsetScanchainsStartCbk ();
-EXTERN void defrUnsetScanchainsEndCbk ();
-EXTERN void defrUnsetSiteCbk ();
-EXTERN void defrUnsetSlotCbk ();
-EXTERN void defrUnsetSlotStartCbk ();
-EXTERN void defrUnsetSlotEndCbk ();
-EXTERN void defrUnsetSNetWireCbk ();
-EXTERN void defrUnsetSNetCbk ();
-EXTERN void defrUnsetSNetStartCbk ();
-EXTERN void defrUnsetSNetEndCbk ();
-EXTERN void defrUnsetSNetPartialPathCbk ();
-EXTERN void defrUnsetStartPinsCbk ();
-EXTERN void defrUnsetStylesCbk ();
-EXTERN void defrUnsetStylesStartCbk ();
-EXTERN void defrUnsetStylesEndCbk ();
-EXTERN void defrUnsetTechnologyCbk ();
-EXTERN void defrUnsetTimingDisableCbk ();
-EXTERN void defrUnsetTimingDisablesStartCbk ();
-EXTERN void defrUnsetTimingDisablesEndCbk ();
-EXTERN void defrUnsetTrackCbk ();
-EXTERN void defrUnsetUnitsCbk ();
-EXTERN void defrUnsetVersionCbk ();
-EXTERN void defrUnsetVersionStrCbk ();
-EXTERN void defrUnsetViaCbk ();
-EXTERN void defrUnsetViaExtCbk ();
-EXTERN void defrUnsetViaStartCbk ();
-EXTERN void defrUnsetViaEndCbk ();
-
-/* Routine to set all unused callbacks. This is useful for checking           */
-/*to see if you missed something.                                             */
-EXTERN void defrSetUnusedCallbacks (defrVoidCbkFnType  func);
-
-/* Return the current line number in the input file.                          */
-EXTERN int defrLineNumber ();
-EXTERN long long defrLongLineNumber ();
-
-/* Routine to set the message logging routine for errors                      */
-    typedef void (*DEFI_LOG_FUNCTION) (const char*);
-EXTERN void defrSetLogFunction (DEFI_LOG_FUNCTION p0);
-
-/* Routine to set the message logging routine for warnings                    */
-#ifndef DEFI_WARNING_LOG_FUNCTION
-    typedef void (*DEFI_WARNING_LOG_FUNCTION) (const char*);
-#endif
-EXTERN void defrSetWarningLogFunction (DEFI_WARNING_LOG_FUNCTION p0);
-
-/* Routine to set the user defined malloc routine                             */
-typedef void* (*DEFI_MALLOC_FUNCTION) (size_t);
-EXTERN void defrSetMallocFunction (DEFI_MALLOC_FUNCTION p0);
-
-/* Routine to set the user defined realloc routine                            */
-typedef void* (*DEFI_REALLOC_FUNCTION) (void*, size_t);
-EXTERN void defrSetReallocFunction (DEFI_REALLOC_FUNCTION p0);
-
-/* Routine to set the user defined free routine                               */
-typedef void (*DEFI_FREE_FUNCTION) (void *);
-EXTERN void defrSetFreeFunction (DEFI_FREE_FUNCTION p0);
-
-/* Routine to set the line number of the file that is parsing routine (takes  */
-typedef void (*DEFI_LINE_NUMBER_FUNCTION)  (int);
-EXTERN void defrSetLineNumberFunction (DEFI_LINE_NUMBER_FUNCTION p0);
-
-/* Routine to set the line number of the file that is parsing routine (takes  */
-typedef void (*DEFI_LONG_LINE_NUMBER_FUNCTION)  (long long);
-EXTERN void defrSetLongLineNumberFunction (DEFI_LONG_LINE_NUMBER_FUNCTION p0);
-
-/* Set the number of lines before calling the line function callback routine  */
-/* Default is 10000                                                           */
-EXTERN void defrSetDeltaNumberLines (int p0);
-
-/* Routine to set the read function                                           */
-typedef size_t (*DEFI_READ_FUNCTION)  (FILE*, char*, size_t);
-EXTERN void defrSetReadFunction (DEFI_READ_FUNCTION p0);
-EXTERN void defrUnsetReadFunction ();
-
-/* Routine to set the defrWarning.log to open as append instead for write     */
-/* New in 5.7                                                                 */
-EXTERN void defrSetOpenLogFileAppend ();
-EXTERN void defrUnsetOpenLogFileAppend ();
-
-/* Routine to set the magic comment found routine                             */
-typedef void (*DEFI_MAGIC_COMMENT_FOUND_FUNCTION) ();
-EXTERN void defrSetMagicCommentFoundFunction (DEFI_MAGIC_COMMENT_FOUND_FUNCTION p0);
-
-/* Routine to set the magic comment string                                    */
-EXTERN void defrSetMagicCommentString (char * p0);
-
-/* Routine to disable string property value process, default it will process  */
-/* the value string                                                           */
-EXTERN void defrDisablePropStrProcess ();
-
-/* Testing purposes only                                                      */
-EXTERN void defrSetNLines (long long  n);
-
-/* Routine to set the max number of warnings for a perticular section         */
-
-EXTERN void defrSetAssertionWarnings (int  warn);
-EXTERN void defrSetBlockageWarnings (int  warn);
-EXTERN void defrSetCaseSensitiveWarnings (int  warn);
-EXTERN void defrSetComponentWarnings (int  warn);
-EXTERN void defrSetConstraintWarnings (int  warn);
-EXTERN void defrSetDefaultCapWarnings (int  warn);
-EXTERN void defrSetGcellGridWarnings (int  warn);
-EXTERN void defrSetIOTimingWarnings (int  warn);
-EXTERN void defrSetNetWarnings (int  warn);
-EXTERN void defrSetNonDefaultWarnings (int  warn);
-EXTERN void defrSetPinExtWarnings (int  warn);
-EXTERN void defrSetPinWarnings (int  warn);
-EXTERN void defrSetRegionWarnings (int  warn);
-EXTERN void defrSetRowWarnings (int  warn);
-EXTERN void defrSetScanchainWarnings (int  warn);
-EXTERN void defrSetSNetWarnings (int  warn);
-EXTERN void defrSetStylesWarnings (int  warn);
-EXTERN void defrSetTrackWarnings (int  warn);
-EXTERN void defrSetUnitsWarnings (int  warn);
-EXTERN void defrSetVersionWarnings (int  warn);
-EXTERN void defrSetViaWarnings (int  warn);
-
-/* Handling output messages                                                   */
-EXTERN void defrDisableParserMsgs (int  nMsg, int*  msgs);
-EXTERN void defrEnableParserMsgs (int  nMsg, int*  msgs);
-EXTERN void defrEnableAllMsgs ();
-EXTERN void defrSetTotalMsgLimit (int  totNumMsgs);
-EXTERN void defrSetLimitPerMsg (int  msgId, int  numMsg);
-
-/* Return codes for the user callbacks.                                       */
-/*The user should return one of these values.                                 */
-#define PARSE_OK 0      
-#define STOP_PARSE 1    
-#define PARSE_ERROR 2   
-
-/* Add this alias to the list for the parser                                  */
-EXTERN void defrAddAlias (const char*  key, const char*  value, int  marked, defrData * data);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriter.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriter.h
deleted file mode 100644
index d880c8b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriter.h
+++ /dev/null
@@ -1,1455 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013, Cadence Design Systems                                     */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFWWRITER_H
-#define CDEFWWRITER_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/* Return codes for writing functions: */
-#define DEFW_OK                0
-#define DEFW_UNINITIALIZED     1
-#define DEFW_BAD_ORDER         2
-#define DEFW_BAD_DATA          3
-#define DEFW_ALREADY_DEFINED   4
-#define DEFW_WRONG_VERSION     5
-#define DEFW_OBSOLETE          6
-#define DEFW_TOO_MANY_STMS     7  
-                                  /* section is smaller than the actual numbe */
-                                  /* of statements defined in that section    */
-
-/* orient
-   0 = N
-   1 = W
-   2 = S
-   3 = E
-   4 = FN
-   5 = FW
-   6 = FS
-   7 = FE
-*/
-
-/* This routine will write a new line */
-EXTERN int defwNewLine ();
-
-/* The DEF writer initialization.  Must be called first.
- * Either this routine or defwInitCbk should be call only.
- * Can't call both routines in one program.
- * This routine is for user who does not want to use the callback machanism.
- * Returns 0 if successful. */
-EXTERN int defwInit (FILE*  f, int  vers1, int  version2, const char*  caseSensitive, const char*  dividerChar, const char*  busBitChars, const char*  designName, const char*  technology, const char*  array, const char*  floorplan, double  units);
-
-/* The DEF writer initialization.  Must be called first.
- * Either this routine or defwInit should be call only.
- * Can't call both routines in one program.
- * This routine is for user who choose to use the callback machanism.
- * If user uses the callback for the writer, they need to provide
- * callbacks for Version, NamesCaseSensitive, BusBitChars and DividerChar.
- * These sections are required by the def.  If any of these callbacks
- * are missing, defaults will be used.
- * Returns 0 if successful. */
-EXTERN int defwInitCbk (FILE*  f);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwVersion (int  vers1, int  vers2);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwCaseSensitive (const char*  caseSensitive);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwBusBitChars (const char*  busBitChars);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwDividerChar (const char*  dividerChar);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwDesignName (const char*  name);
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwTechnology (const char*  technology);
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwArray (const char*  array);
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwFloorplan (const char*  floorplan);
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwUnits (int  units);
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called 0 to many times. */
-EXTERN int defwHistory (const char*  string);
-
-/* This routine must be called after the history routines (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwStartPropDef ();
-
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds integer property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-                                      /* NONDEFAULTRULE | MACRO | PIN         */
-EXTERN int defwIntPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, int     propValue);
-
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds real property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-                                      /* NONDEFAULTRULE | MACRO | PIN         */
-EXTERN int defwRealPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, double  propValue);
-
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds string property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-                                       /* NONDEFAULTRULE | MACRO | PIN        */
-EXTERN int defwStringPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, const char*  propValue);
-
-/* This routine must be called after all the properties have been
- * added to the file.
- * If you called defwPropertyDefinitions then this routine is NOT optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwEndPropDef ();
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds string property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-EXTERN int defwStringProperty (const char*  propName, const char*  propValue);
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds real property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-EXTERN int defwRealProperty (const char*  propName, double  propValue);
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds int property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-EXTERN int defwIntProperty (const char*  propName, int  propValue);
-
-/* This routine must be called after the property definitions (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwDieArea (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine must be called after the property definitions (if any).
- * This routine is optional.
- * This routine is the same as defwDieArea, but accept more than 2 points
- * This is a 5.6 syntax
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwDieAreaList (int  num_points, int*  xl, int*  yh);
-
-/* This routine must be called after the Die Area (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The integer "orient" and operation of the do is explained in
- * the documentation.
- * In 5.6, the DO syntax is optional and the STEP syntax is optional in DO */
-EXTERN int defwRow (const char*  rowName, const char*  rowType, int  x_orig, int  y_orig, int  orient, int  do_count, int  do_increment, int  xstep, int  ystep);
-
-/* This routine must be called after the Die Area (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * This routine is the same as defwRow, excpet orient is a char* */
-EXTERN int defwRowStr (const char*  rowName, const char*  rowType, int  x_orig, int  y_orig, const char*  orient, int  do_count, int  do_increment, int  xstep, int  ystep);
-
-/* This routine must be called after the defwRow (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The operation of the do is explained in the documentation. */
-EXTERN int defwTracks (const char*  master, int  doStart, int  doCount, int  doStep, int  numLayers, const char**  layers, int  mask, int  sameMask);
-
-/* This routine must be called after the defwTracks (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The operation of the do is explained in the documentation. */
-EXTERN int defwGcellGrid (const char*  master, int  doStart, int  doCount, int  doStep);
-
-/* This routine must be called after the defwTracks (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the default capacitance section.   All of the
- * capacitances must follow.
- * The count is the number of defwDefaultCap calls to follow.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-EXTERN int defwStartDefaultCap (int  count);
-
-/* This routine is called once for each default cap.  The calls must
- * be preceeded by a call to defwStartDefaultCap and must be
- * terminated by a call to defwEndDefaultCap.
- * Returns 0 if successful.
- * This api is obsolete in 5.4. */
-EXTERN int defwDefaultCap (int  pins, double  cap);
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * Returns 0 if successful.
- * If the count in StartDefaultCap is not the same as the number of
- * calls to DefaultCap then DEFW_BAD_DATA will return returned.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-EXTERN int defwEndDefaultCap ();
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times. */
-EXTERN int defwCanPlace (const char*  master, int  xOrig, int  yOrig, int  orient, int  doCnt, int  doInc, int  xStep, int  yStep);
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwCanPlace, except orient is a char* */
-EXTERN int defwCanPlaceStr (const char*  master, int  xOrig, int  yOrig, const char*  orient, int  doCnt, int  doInc, int  xStep, int  yStep);
-
-/* This routine must be called after the defwCanPlace calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times. */
-EXTERN int defwCannotOccupy (const char*  master, int  xOrig, int  yOrig, int  orient, int  doCnt, int  doInc, int  xStep, int  yStep);
-
-/* This routine must be called after the defwCanPlace calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwCannotOccupy, except orient is a char* */
-EXTERN int defwCannotOccupyStr (const char*  master, int  xOrig, int  yOrig, const char*  orient, int  doCnt, int  doInc, int  xStep, int  yStep);
-
-/* This routine must be called after defwCannotOccupy (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the via section.   All of the vias must follow.
- * The count is the number of defwVia calls to follow.
- * The routine can be called only once. */
-EXTERN int defwStartVias (int  count);
-
-/* These routines enter each via into the file.
- * These routines must be called after the defwStartVias call.
- * defwViaName should be called first, follow either by defwViaPattern or
- * defwViaLayer.  At the end of each via, defwOneViaEnd should be called
- * These routines are for [- viaName [+ PATTERNNAME patternName + RECT layerName
- * pt pt]...;]...
- * Returns 0 if successful.
- * The routines can be called many times. */
-EXTERN int defwViaName (const char*  name);
-
-EXTERN int defwViaPattern (const char*  patternName);
-
-/* This routine can be called multiple times. */
-/* mask is 5.8 syntax */
-EXTERN int defwViaRect (const char*  layerName, int  xl, int  yl, int  xh, int  yh, int  mask);
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-/* mask is 5.8 syntax */
-EXTERN int defwViaPolygon (const char*  layerName, int  num_polys, double*  xl, double*  yl, int  mask);
-
-/* These routine must be called after defwViaName.
- * Either this routine or defwViaPattern can be called after each
- * defwViaName is called.
- * This is a 5.6 syntax
- * Returns 0 if successful
- * The routine can be called only once per defwViaName called. */
-EXTERN int defwViaViarule (const char*  viaRuleName, double  xCutSize, double  yCutSize, const char*  botMetalLayer, const char*  cutLayer, const char*  topMetalLayer, double  xCutSpacing, double  yCutSpacing, double  xBotEnc, double  yBotEnc, double  xTopEnc, double  yTopEnc);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwViaViaruleRowCol (int  numCutRows, int  numCutCols);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwViaViaruleOrigin (int  xOffset, int  yOffset);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwViaViaruleOffset (int  xBotOffset, int  yBotOffset, int  xTopOffset, int  yTopOffset);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwViaViarulePattern (const char*  cutPattern);
-
-EXTERN int defwOneViaEnd ();
-
-/* This routine must be called after the defwVia calls.
- * Returns 0 if successful.
- * If the count in StartVias is not the same as the number of
- * calls to Via or ViaPattern then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-EXTERN int defwEndVias ();
-
-/* This routine must be called after via section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the region section.   All of the regions must follow.
- * The count is the number of defwRegion calls to follow.
- * The routine can be called only once. */
-EXTERN int defwStartRegions (int  count);
-
-/* This routine enter each region into the file.
- * This routine must be called after the defwStartRegions call.
- * Returns 0 if successful.
- * The routine can be called many times. */
-EXTERN int defwRegionName (const char*  name);
-
-/* This routine enter the region point to the region name.
- * This routine must be called after the defwRegionName call.
- * Returns 0 if successful.
- * The routine can be called many times. */
-EXTERN int defwRegionPoints (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine enter the region type, FENCE | GUIDE.
- * This routine must be called after the defwRegionName call.
- * This is a 5.4.1 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwRegionType (const char*  type);
-
-/* This routine must be called after the defwRegion calls.
- * Returns 0 if successful.
- * If the count in StartRegions is not the same as the number of
- * calls to Region or RegionPattern then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-EXTERN int defwEndRegions ();
-
-/* This is a 5.8 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwComponentMaskShiftLayers (const char**  layerNames, int           numLayerName);
-
-/* This routine must be called after the regions section (if any).
- * This section of routines is NOT optional.
- * Returns 0 if successful.
- * The routine starts the components section. All of the components
- * must follow.
- * The count is the number of defwComponent calls to follow.
- * The routine can be called only once. */
-EXTERN int defwStartComponents (int  count);
-
-/* This routine enter each component into the file.
- * This routine must be called after the defwStartComponents call.
- * The optional fields will be ignored if they are set to zero
- * (except for weight which must be set to -1.0).
- * Returns 0 if successful.
- * The routine can be called many times. */
-
-                                            /* USER | TIMING                  */
-                                            /* foreignx, foreigny & orients   */
-                                            /*  PLACED | UNPLACED             */
-                                            /* xh, yh or region               */
-EXTERN int defwComponent (const char*  instance, const char*  master, int    numNetName, const char**  netNames, const char*  eeq, const char*  genName, const char*  genParemeters, const char*  source, int  numForeign, const char**  foreigns, int*  foreignX, int*  foreignY, int*  foreignOrients, const char*  status, int  statusX, int  statusY, int  statusOrient, double  weight, const char*  region, int  xl, int  yl, int  xh, int  yh);
-
-/* This routine enter each component into the file.
- * This routine must be called after the defwStartComponents call.
- * The optional fields will be ignored if they are set to zero
- * (except for weight which must be set to -1.0).
- * Returns 0 if successful.
- * The routine can be called many times. 
- * This routine is the same as defwComponent, except orient is a char** */
-                                            /*                                */
-                                            /* USER | TIMING                  */
-                                            /* foreignx, foreigny & orients   */
-                                            /* PLACED | UNPLACED              */
-                                            /* xh, yh or region               */
-EXTERN int defwComponentStr (const char*  instance, const char*  master, int    numNetName, const char**  netNames, const char*  eeq, const char*  genName, const char*  genParemeters, const char*  source, int  numForeign, const char**  foreigns, int*  foreignX, int*  foreignY, const char**  foreignOrients, const char*  status, int  statusX, int  statusY, const char*  statusOrient, double  weight, const char*  region, int  xl, int  yl, int  xh, int  yh);
-
-/* This is a 5.8 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-EXTERN int defwComponentMaskShift (int  shiftLayerMasks);
-
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * Either this routine or defwComponentHaloSoft can be called, but not both
- * This routine is optional.
- * This is a 5.6 syntax.
- * Returns 0 if successful.  */
-EXTERN int defwComponentHalo (int  left, int  bottom, int  right, int  top);
-
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * This routine is just like defwComponentHalo, except it writes the option SOFT
- * Either this routine or defwComponentHalo can be called, but not both
- * This routine is optional.
- * This is a 5.7 syntax.
- * Returns 0 if successful.  */
-EXTERN int defwComponentHaloSoft (int  left, int  bottom, int  right, int  top);
-
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * This routine is optional.
- * This is a 5.7 syntax.
- * Returns 0 if successful.  */
-EXTERN int defwComponentRouteHalo (int  haloDist, const char*  minLayer, const char*  maxLayer);
-
-/* This routine must be called after the defwComponent calls.
- * Returns 0 if successful.
- * If the count in StartComponents is not the same as the number of
- * calls to Component then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-EXTERN int defwEndComponents ();
-
-/* This routine must be called after the components section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the pins section. All of the pins must follow.
- * The count is the number of defwPin calls to follow.
- * The routine can be called only once. */
-EXTERN int defwStartPins (int  count);
-
-/* This routine enter each pin into the file.
- * This routine must be called after the defwStartPins call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times.
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-                                         /* INOUT | FEEDTHRU                  */
-                                         /* GROUND | CLOCK | TIEOFF | ANALOG  */
-                                         /* COVER                             */
-EXTERN int defwPin (const char*  name, const char*  net, int  special, const char*  direction, const char*  use, const char*  status, int  statusX, int  statusY, int  orient, const char*  layer, int  xl, int  yl, int  xh, int  yh);
-
-/* This routine enter each pin into the file.
- * This routine must be called after the defwStartPins call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwPin, except orient is a char*
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-                                         /* INOUT | FEEDTHRU                  */
-                                         /* GROUND | CLOCK | TIEOFF | ANALOG  */
-                                         /* COVER                             */
-EXTERN int defwPinStr (const char*  name, const char*  net, int  special, const char*  direction, const char*  use, const char*  status, int  statusX, int  statusY, const char*  orient, const char*  layer, int  xl, int  yl, int  xh, int  yh);
-
-/* This routine should be called if the layer has either SPACING or
- * DESIGNRULEWIDTH.  If this routine is used and the pin has only one
- * layer, the layer in defwPin or defwPinStr has to be null, otherwise
- * the layer will be written out twice.
- * This routine must be called after defwPin or defwPinStr.
- * This is a 5.6 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * This routine can be called multiple times within a pin. */
-EXTERN int defwPinLayer (const char*  layerName, int  spacing, int  designRuleWidth, int  xl, int  yl, int  xh, int  yh, int  mask);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out layer with polygon.
- * This is a 5.6 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-EXTERN int defwPinPolygon (const char*  layerName, int  spacing, int  designRuleWidth, int  num_polys, double*  xl, double*  yl, int  mask);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out layer with via.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-EXTERN int defwPinVia (const char*  viaName, int  xl, int  yl, int  mask);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out pin with port.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-EXTERN int defwPinPort ();
-
-/* This routine is called after defwPinPort. 
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * This routine can be called multiple times within a pin. */
-EXTERN int defwPinPortLayer (const char*  layerName, int  spacing, int  designRuleWidth, int  xl, int  yl, int  xh, int  yh, int  mask);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-EXTERN int defwPinPortPolygon (const char*  layerName, int  spacing, int  designRuleWidth, int  num_polys, double*  xl, double*  yl, int  mask);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-EXTERN int defwPinPortVia (const char*  viaName, int  xl, int  yl, int  mask);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-EXTERN int defwPinPortLocation (const char*  status, int  statusX, int  statusY, const char*  orient);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-EXTERN int defwPinNetExpr (const char*  pinExpr);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-EXTERN int defwPinSupplySensitivity (const char*  pinName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-EXTERN int defwPinGroundSensitivity (const char*  pinName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinPartialMetalArea (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinPartialMetalSideArea (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinPartialCutArea (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinDiffArea (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.5 syntax.
- * The oxide can be either OXIDE1, OXIDE2, OXIDE3, or OXIDE4.
- * Each oxide value can be called only once after defwPin. */
-EXTERN int defwPinAntennaModel (const char*  oxide);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinGateArea (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinMaxAreaCar (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinMaxSideAreaCar (int  value, const char*  layerName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-EXTERN int defwPinAntennaPinMaxCutCar (int  value, const char*  layerName);
-
-/* This routine must be called after the defwPin calls.
- * Returns 0 if successful.
- * If the count in StartPins is not the same as the number of
- * calls to Pin then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-EXTERN int defwEndPins ();
-
-/* This routine must be called after the pin section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the pinproperties section. All of the pinproperties
- * must follow.
- * The count is the number of defwPinProp calls to follow.
- * The routine can be called only once. */
-EXTERN int defwStartPinProperties (int  count);
-
-/* This routine enter each pinproperty into the file.
- * This routine must be called after the defwStartPinProperties call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times. */
-EXTERN int defwPinProperty (const char*  name, const char*  pinName);
-
-/* This routine must be called after the defwPinProperty calls.
- * Returns 0 if successful.
- * If the count in StartPins is not the same as the number of
- * calls to Pin then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-EXTERN int defwEndPinProperties ();
-
-/* Routines to enter a special net or nets into the file.
- * You must first call defwStartSpecialNets with the number of
- * nets. This section is required, even if you do not have any nets.
- * For each net you should call defwSpecialNet followed by
- * one or more defwSpecialNetConnection calls.
- * After the connections come the options.  Options are
- * NOT required.
- * Each net is completed by calling defwSpecialNetEndOneNet().
- * The nets section is finished by calling defwEndNets(). */
-EXTERN int defwStartSpecialNets (int  count);
-
-/* This routine must be called after the defwStartSpecialNets it is for
- * - netName */
-EXTERN int defwSpecialNet (const char*  name);
-
-/* This routine is for compNameRegExpr, pinName, and SYNTHESIZED */
-/* It can be called multiple times */
-EXTERN int defwSpecialNetConnection (const char*  inst, const char*  pin, int  synthesized);
-
-/* This routine is for + FIXEDBUMP
- * This is a 5.4.1 syntax */
-EXTERN int defwSpecialNetFixedbump ();
-
-/* This routine is for + VOLTAGE volts */
-EXTERN int defwSpecialNetVoltage (double  v);
-
-/* This routine is for + SPACING layerName spacing [RANGE minwidth maxwidth */
-EXTERN int defwSpecialNetSpacing (const char*  layer, int  spacing, double  minwidth, double  maxwidth);
-
-/* This routine is for + WIDTH layerName width */
-EXTERN int defwSpecialNetWidth (const char*  layer, int  width);
-
-/* This routine is for + SOURCE {NETLIST | DIST | USER | TIMING} */
-EXTERN int defwSpecialNetSource (const char*  name);
-
-/* This routine is for + ORIGINAL netName */
-EXTERN int defwSpecialNetOriginal (const char*  name);
-
-/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC | TRUNK} */
-EXTERN int defwSpecialNetPattern (const char*  name);
-
-/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF |
-   ANALOG | SCAN | RESET} */
-EXTERN int defwSpecialNetUse (const char*  name);
-
-/* This routine is for + WEIGHT weight */
-EXTERN int defwSpecialNetWeight (double  value);
-
-/* This routine is for + ESTCAP wireCapacitance */
-EXTERN int defwSpecialNetEstCap (double  value);
-
-/* Paths are a special type of option.  A path must begin
- * with a defwSpecialNetPathStart and end with a defwSpecialNetPathEnd().
- * The individual parts of the path can be entered in
- * any order. */
-EXTERN int defwSpecialNetPathStart (const char*  typ);
-                                                     /* SHIELD | NEW          */
-EXTERN int defwSpecialNetShieldNetName (const char*  name);
-
-EXTERN int defwSpecialNetPathLayer (const char*  name);
-
-EXTERN int defwSpecialNetPathWidth (int  width);
-
-/* This routine is optional.
- * This is a 5.6 syntax. */
-EXTERN int defwSpecialNetPathStyle (int  styleNum);
-
-EXTERN int defwSpecialNetPathShape (const char*  shapeType);
-        /* FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIR */
-
-/* This routine is optional.
-   This is a 5.8 syntax.
- * Returns 0 if successful. */
-EXTERN int defwSpecialNetPathMask (int  colorMask);
-
-/* x and y location of the path */
-EXTERN int defwSpecialNetPathPoint (int  numPts, double*  pointx, double*  pointy);
-EXTERN int defwSpecialNetPathVia (const char*  name);
-
-/* This routine is called after defwSpecialNetPath
- * This is a 5.4.1 syntax */
-EXTERN int defwSpecialNetPathViaData (int  numX, int  numY, int  stepX, int  stepY);
-
-/* x and y location of the path */
-EXTERN int defwSpecialNetPathPointWithWireExt (int  numPts, double*  pointx, double*  pointy, double*  optValue);
-
-EXTERN int defwSpecialNetPathEnd ();
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-EXTERN int defwSpecialNetPolygon (const char*  layerName, int  num_polys, double*  xl, double*  yl);
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-EXTERN int defwSpecialNetRect (const char*  layerName, int  xl, int  yl, int  xh, int  yh);
-
-EXTERN int defwSpecialNetVia (const char*  layerName);
-
-EXTERN int defwSpecialNetViaWithOrient (const char*  layerName, int  orient);
-
-EXTERN int defwSpecialNetViaPoints (int  num_points, double*  xl, double*  yl);
-
-/* This routine is called at the end of each net */
-EXTERN int defwSpecialNetEndOneNet ();
-
-/* 5.3 for special net */
-/* Shields are a special type of option.  A shield must begin
- * with a defwSpecialNetShieldStart and end with a defwSpecialNetShieldEnd().
- * The individual parts of the shield can be entered in
- * any order. */
-EXTERN int defwSpecialNetShieldStart (const char*  name);
-
-EXTERN int defwSpecialNetShieldLayer (const char*  name);
-EXTERN int defwSpecialNetShieldWidth (int  width);
-EXTERN int defwSpecialNetShieldShape (const char*  shapeType);
-        /* FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIR */
-
-/* x and y location of the path */
-EXTERN int defwSpecialNetShieldPoint (int  numPts, double*  pointx, double*  pointy);
-EXTERN int defwSpecialNetShieldVia (const char*  name);
-
-/* A 5.4.1 syntax */
-EXTERN int defwSpecialNetShieldViaData (int  numX, int  numY, int  stepX, int  stepY);
-EXTERN int defwSpecialNetShieldEnd ();
-/* end 5.3 */
-
-/* This routine is called at the end of the special net section */
-EXTERN int defwEndSpecialNets ();
-
-/* Routines to enter a net or nets into the file.
- * You must first call defwNets with the number of nets.
- * This section is required, even if you do not have any nets.
- * For each net you should call defwNet followed by one or
- * more defwNetConnection calls.
- * After the connections come the options.  Options are
- * NOT required.
- * Each net is completed by calling defwNetEndOneNet().
- * The nets section is finished by calling defwEndNets(). */
-EXTERN int defwStartNets (int  count);
-
-/* This routine must be called after the defwStartNets, it is for - netName */
-EXTERN int defwNet (const char*  name);
-
-/* This routine is for { compName | PIN } pinName [+ SYNTHESIZED] */
-/* It can be called multiple times */
-EXTERN int defwNetConnection (const char*  inst, const char*  pin, int  synthesized);
-
-/* This routine is for MUSTJOIN, compName, pinName */
-EXTERN int defwNetMustjoinConnection (const char*  inst, const char*  pin);
-
-/* This routine is for + VPIN vpinName [LAYER layerName pt pt
- * [{ PLACED | FIXED | COVER } pt orient] */
-EXTERN int defwNetVpin (const char*  vpinName, const char*  layerName, int  layerXl, int  layerYl, int  layerXh, int  layerYh, const char*  status, int  statusX, int  statusY, int  orient);
-
-/* This routine is for + VPIN vpinName [LAYER layerName pt pt
- * [{ PLACED | FIXED | COVER } pt orient]
- * This routine is the same as defwNetVpin, except orient is a char* */
-EXTERN int defwNetVpinStr (const char*  vpinName, const char*  layerName, int  layerXl, int  layerYl, int  layerXh, int  layerYh, const char*  status, int  statusX, int  statusY, const char*  orient);
-
-/* This routine can be called either within net or subnet.
- * it is for NONDEFAULTRULE rulename */
-EXTERN int defwNetNondefaultRule (const char*  name);
-
-/* This routine is for + XTALK num */
-EXTERN int defwNetXtalk (int  xtalk);
-
-/* This routine is for + FIXEDBUMP
- * This is a 5.4.1 syntax */
-EXTERN int defwNetFixedbump ();
-
-/* This routine is for + FREQUENCY
- * This is a 5.4.1 syntax */
-EXTERN int defwNetFrequency (double  frequency);
-
-/* This routine is for + SOURCE {NETLIST | DIST | USER | TEST | TIMING} */
-EXTERN int defwNetSource (const char*  name);
-
-/* This routine is for + ORIGINAL netname */
-EXTERN int defwNetOriginal (const char*  name);
-
-/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF | 
- * ANALOG} */
-EXTERN int defwNetUse (const char*  name);
-
-/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC} */
-EXTERN int defwNetPattern (const char*  name);
-
-/* This routine is for + ESTCAP wireCapacitance */
-EXTERN int defwNetEstCap (double  value);
-
-/* This routine is for + WEIGHT weight */
-EXTERN int defwNetWeight (double  value);
-
-/* 5.3 for net */
-/* This routine is for + SHIELDNET weight */
-EXTERN int defwNetShieldnet (const char*  name);
-
-/* Noshield are a special type of option.  A noshield must begin
- * with a defwNetNoshieldStart and end with a defwNetNoshieldEnd().
- * The individual parts of the noshield can be entered in
- * any order. */
-EXTERN int defwNetNoshieldStart (const char*  name);
-
-/* x and y location of the path */
-EXTERN int defwNetNoshieldPoint (int  numPts, const char**  pointx, const char**  pointy);
-EXTERN int defwNetNoshieldVia (const char*  name);
-EXTERN int defwNetNoshieldEnd ();
-/* end 5.3 */
-
-/* Subnet are a special type of option. A subnet must begin
- * with a defwNetSubnetStart and end with a defwNetSubnetEnd().
- * Routines to call within the subnet are: defwNetSubnetPin,
- * defwNetNondefaultRule and defwNetPathStart... */
-EXTERN int defwNetSubnetStart (const char*  name);
-
-/* This routine is called after the defwNetSubnet, it is for
- * [({compName | PIN} pinName) | (VPIN vpinName)]... */
-EXTERN int defwNetSubnetPin (const char*  compName, const char*  pinName);
-
-EXTERN int defwNetSubnetEnd ();
-
-/* Paths are a special type of option.  A path must begin
- * with a defwNetPathStart and end with a defwPathEnd().
- * The individual parts of the path can be entered in
- * any order. */
-EXTERN int defwNetPathStart (const char*  typ);
-                                              /* NOSHIELD | NEW               */
-EXTERN int defwNetPathWidth (int  w);
-EXTERN int defwNetPathLayer (const char*  name, int  isTaper, const char*  rulename);
-                                              /*rulename can be assigned */
-/* This routine is optional.
- * This is a 5.6 syntax. */
-EXTERN int defwNetPathStyle (int  styleNum);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-EXTERN int defwNetPathMask (int  maskNum);
-
-EXTERN int defwNetPathRect (int  deltaX1, int  deltaY1, int  deltaX2, int  deltaY2);
-
-EXTERN int defwNetPathVirtual (int  x, int  y);
-
-/* x and y location of the path */
-EXTERN int defwNetPathPoint (int  numPts, double*  pointx, double*  pointy);
-
-EXTERN int defwNetPathPointWithExt (int  numPts, double*  pointx, double*  pointy, double*  optValue);
-
-EXTERN int defwNetPathVia (const char*  name);
-
-EXTERN int defwNetPathViaWithOrient (const char*  name, int  orient);
-
-EXTERN int defwNetPathViaWithOrientStr (const char*  name, const char*  orient);
-EXTERN int defwNetPathEnd ();
-
-/* This routine is called at the end of each net */
-EXTERN int defwNetEndOneNet ();
-
-/* This routine is called at the end of the net section */
-EXTERN int defwEndNets ();
-
-/* This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the I/O Timing section. All of the iotimings options
- * must follow.
- * The count is the number of defwIOTiming calls to follow.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-EXTERN int defwStartIOTimings (int  count);
-
-/* This routine can be called after defwStaratIOTiming
- * It is for - - {(comp pin) | (PIN name)}
- * This api is obsolete in 5.4. */
-EXTERN int defwIOTiming (const char*  inst, const char*  pin);
-
-/* This routine is for + { RISE | FALL } VARIABLE min max
- * This api is obsolete in 5.4. */
-EXTERN int defwIOTimingVariable (const char*  riseFall, int  num1, int  num2);
-
-/* This routine is for + { RISE | FALL } SLEWRATE min max
- * This api is obsolete in 5.4. */
-EXTERN int defwIOTimingSlewrate (const char*  riseFall, int  num1, int  num2);
-
-/* This routine is for + DRIVECELL macroName [[FROMPIN pinName] TOPIN pinName]
- * [PARALLEL numDrivers]
- * This api is obsolete in 5.4. */
-EXTERN int defwIOTimingDrivecell (const char*  name, const char*  fromPin, const char*  toPin, int  numDrivers);
-
-/* This routine is for + CAPACITANCE capacitance
- * This api is obsolete in 5.4. */
-EXTERN int defwIOTimingCapacitance (double  num);
-
-/* This api is obsolete in 5.4. */
-EXTERN int defwEndIOTimings ();
-
-/* Routines to enter scan chains.  This section is optional
- * The section must start with a defwStartScanchains() call and
- * end with a defwEndScanchain() call.
- * Each scan chain begins with a defwScanchain() call.
- * The rest of the calls follow.  */
-EXTERN int defwStartScanchains (int  count);
-
-/* This routine can be called after defwStartScanchains
- * It is for - chainName */
-EXTERN int defwScanchain (const char*  name);
-
-/* This routine is for + COMMONSCANPINS [IN pin] [OUT pin] */
-EXTERN int defwScanchainCommonscanpins (const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2);
-
-/* This routine is for + PARTITION paratitionName [MAXBITS maxBits] */
-/* This is 5.4.1 syntax */
-EXTERN int defwScanchainPartition (const char*  name, int  maxBits);
-
-/* This routine is for + START {fixedInComp | PIN } [outPin] */
-EXTERN int defwScanchainStart (const char*  inst, const char*  pin);
-
-/* This routine is for + STOP {fixedOutComp | PIN } [inPin] */
-EXTERN int defwScanchainStop (const char*  inst, const char*  pin);
-
-/* This routine is for + FLOATING {floatingComp [IN pin] [OUT pin]}
- * This is a 5.4.1 syntax */
-EXTERN int defwScanchainFloating (const char*  name, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2);
-
-/* This routine is for + FLOATING {floatingComp [IN pin] [OUT pin]}
- * This is a 5.4.1 syntax.
- * This routine is the same as defwScanchainFloating.  But also added
- * the option BITS. */
-EXTERN int defwScanchainFloatingBits (const char*  name, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, int    bits);
-
-/* This routine is for + ORDERED {fixedComp [IN pin] [OUT pin]
- * fixedComp [IN pin] [OUT pin].
- * When this routine is called for the 1st time within a scanchain, 
- * both name1 and name2 are required.  Only name1 is required is the
- * routine is called more than once. */
-EXTERN int defwScanchainOrdered (const char*  name1, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, const char*  name2, const char*  inst3, const char*  pin3, const char*  inst4, const char*  pin4);
-
-/* This routine is for + ORDERED {fixedComp [IN pin] [OUT pin]
- * fixedComp [IN pin] [OUT pin].
- * When this routine is called for the 1st time within a scanchain, 
- * both name1 and name2 are required.  Only name1 is required is the
- * routine is called more than once.
- * This is a 5.4.1 syntax.
- * This routine is the same as defwScanchainOrdered.  But also added
- * the option BITS */
-EXTERN int defwScanchainOrderedBits (const char*  name1, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, int    bits1, const char*  name2, const char*  inst3, const char*  pin3, const char*  inst4, const char*  pin4, int    bits2);
-
-EXTERN int defwEndScanchain ();
-
-/* Routines to enter constraints.  This section is optional
- * The section must start with a defwStartConstrains() call and
- * end with a defwEndConstraints() call.
- * Each contraint will call the defwConstraint...().
- * This api is obsolete in 5.4. */
-EXTERN int defwStartConstraints (int  count);
-
-/* The following routines are for - {operand [+ RISEMAX time] [+ FALLMAX time]
- * [+ RISEMIN time] [+ FALLMIN time] | WIREDLOGIC netName MAXDIST distance };}
- * operand - NET netName | PATH comp fromPin comp toPin | SUM (operand, ...)
- * The following apis are obsolete in 5.4. */ 
-EXTERN int defwConstraintOperand ();
-EXTERN int defwConstraintOperandNet (const char*  netName);
-EXTERN int defwConstraintOperandPath (const char*  comp1, const char*  fromPin, const char*  comp2, const char*  toPin);
-EXTERN int defwConstraintOperandSum ();
-EXTERN int defwConstraintOperandSumEnd ();
-EXTERN int defwConstraintOperandTime (const char*  timeType, int  time);
-EXTERN int defwConstraintOperandEnd ();
-
-/* This routine is for - WIRELOGIC netName MAXDIST distance */
-EXTERN int defwConstraintWiredlogic (const char*  netName, int  distance);
-
-EXTERN int defwEndConstraints ();
-
-/* Routines to enter groups.  This section is optional
- * The section must start with a defwStartGroups() call and
- * end with a defwEndGroups() call.
- * Each group will call the defwGroup...(). */
-EXTERN int defwStartGroups (int  count);
-
-/* This routine is for - groupName compNameRegExpr ... */
-EXTERN int defwGroup (const char*  groupName, int  numExpr, const char**  groupExpr);
-
-/* This routine is for + SOFT [MAXHALFPERIMETER value] [MAXX value]
- * [MAXY value] */
-EXTERN int defwGroupSoft (const char*  type1, double  value1, const char*  type2, double  value2, const char*  type3, double  value3);
-
-/* This routine is for + REGION {pt pt | regionName} */
-EXTERN int defwGroupRegion (int  xl, int  yl, int  xh, int  yh, const char*  regionName);
-
-EXTERN int defwEndGroups ();
-
-/* Routines to enter Blockages.  This section is optional
- * The section must start with a defwStartBlockages() call and
- * end with a defwEndBlockages() call.
- * Each blockage will call the defwBlockages...().
- * This is a 5.4 syntax. */
-EXTERN int defwStartBlockages (int  count);
-
-/* This routine is for - layerName
-* This routine is called per entry within a blockage for layer.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesLayer (const char*  layerName);
-
-/* This routine is for - slots 
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesLayerSlots ();
-
-/* This routine is for - fills
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesLayerFills ();
-
-/* This routine is for - pushdown
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesLayerPushdown ();
-
-/* This routine is for - exceptpgnet
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.7 syntax. */
-EXTERN int defwBlockagesLayerExceptpgnet ();
-
-/* This routine is for - component
-* This routine called per entry within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-EXTERN int defwBlockagesLayerComponent (const char*  compName);
-
-/* This routine is for - spacing
-* Either this routine or defwBlockagesDesignRuleWidth is called per entry
-* within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-EXTERN int defwBlockagesLayerSpacing (int  minSpacing);
-
-/* This routine is for - designrulewidth
-* Either this routine or defwBlockagesSpacing is called per entry
-* within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-EXTERN int defwBlockagesLayerDesignRuleWidth (int  effectiveWidth);
-
-/* This routine is for - mask.
-* This routine called per entry within a blockage layer, can't be more than one.
-* This is a 5.8 syntax. */
-EXTERN int defwBlockagesLayerMask (int  maskColor);
-
-/* This routine is for - layerName & compName
- * Either this routine, defBlockageLayerSlots, defBlockageLayerFills,
- * or defwBlockagePlacement is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockageLayer (const char*  layerName, const char*  compName);
-
-/* This routine is for - layerName & slots 
- * Either this routine, defBlockageLayer, defBlockageLayerFills,
- * defwBlockagePlacement, or defwBlockagePushdown is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockageLayerSlots (const char*  layerName);
-
-/* This routine is for - layerName & fills
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockagePushdown is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockageLayerFills (const char*  layerName);
-
-/* This routine is for - layerName & pushdown
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockageFills is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockageLayerPushdown (const char*  layerName);
-
-/* This routine is for - exceptpgnet
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockageFills is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.7 syntax. */
-EXTERN int defwBlockageLayerExceptpgnet (const char*  layerName);
-
-/* This routine is for - spacing
- * Either this routine or defwBlockageDesignRuleWidth is called per entry
- * within a blockage, can't be more than one.
- * This is a 5.6 syntax. */
-EXTERN int defwBlockageSpacing (int  minSpacing);
-
-/* This routine is for - designrulewidth
- * Either this routine or defwBlockageSpacing is called per entry
- * within a blockage, can't be more than one.
- * This is a 5.6 syntax. */
-EXTERN int defwBlockageDesignRuleWidth (int  effectiveWidth);
-
-/* This routine is for - placement
- * This routine is called per entry within blockage for placement.
- * This is a 5.4 syntax.
- * 11/25/2002 - bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
- * this routine allows to call blockage without a component. */
-EXTERN int defwBlockagesPlacement ();
-
-/* This routine is for - component
-* This routine is called per entry within blockage placement, can't be more then one.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesPlacementComponent (const char*  compName);
-
-/* This routine is for - Pushdown
-* This routine is called per entry within blockage placement, can't be more then one.
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesPlacementPushdown ();
-
-/* This routine is for - soft
-* Either this routine or defwBlockagesPlacementPartial
-* is called per entry within blockage placement, can't be more then one.
-* This is a 5.7 syntax. */
-EXTERN int defwBlockagesPlacementSoft ();
-
-/* This routine is for - Partial
-* Either this routine or defwBlockagesPlacementSoft
-* is called per entry within blockage placement, can't be more then one.
-* This is a 5.7 syntax. */
-EXTERN int defwBlockagesPlacementPartial (double  maxDensity);
-
-/* This routine is for rectangle.
-* This routine is optional and can be called multiple time. 
-* This is a 5.4 syntax. */
-EXTERN int defwBlockagesRect (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine is for polygon.
-* This routine is optional and can be called multiple time. 
-* This is a 5.6 syntax. */
-EXTERN int defwBlockagesPolygon (int  num_polys, int*  xl, int*  yl);
-
-/* This routine is for - placement
-* Either this routine or defBlockageLayer
-* is called per entry within blockage, can't be more then one.
-* This is a 5.4 syntax.
-* 11/25/2002 - bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
-* this routine allows to call blockage without a component. */
-EXTERN int defwBlockagePlacement ();
-
-/* This routine is for - placement & component
- * Either this routine or defwBlockagePlacementPushdown
- * is called per entry within blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockagePlacementComponent (const char*  compName);
-
-/* This routine is for - placement & Pushdown
- * Either this routine or defwBlockagePlacementComponent
- * is called per entry within blockage, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockagePlacementPushdown ();
-
-/* This routine is for - placement & soft
- * Either this routine or defwBlockagePlacementPushdown
- * is called per entry within blockage, can't be more then one.
- * This is a 5.7 syntax. */
-EXTERN int defwBlockagePlacementSoft ();
-
-/* This routine is for - placement & Partial
- * Either this routine or defwBlockagePlacementComponent
- * is called per entry within blockage, can't be more then one.
- * This is a 5.7 syntax. */
-EXTERN int defwBlockagePlacementPartial (double  maxDensity);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-EXTERN int defwBlockageMask (int  maskColor);
-
-/* This routine is for rectangle.
- * This is a 5.4 syntax. */
-EXTERN int defwBlockageRect (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine is for polygon.
- * This routine is optinal and can be called multiple time. 
- * This is a 5.6 syntax. */
-EXTERN int defwBlockagePolygon (int  num_polys, int*  xl, int*  yl);
-
-/* This is a 5.4 syntax. */
-EXTERN int defwEndBlockages ();
-
-/* Routines to enter Slots.  This section is optional
- * The section must start with a defwStartSlots() call and
- * end with a defwEndSlots() call.
- * Each slots will call the defwSlots...().
- * This is a 5.4 syntax. */
-EXTERN int defwStartSlots (int  count);
-
-/* This routine is for - layerName & compName
- * Either this routine, defSlots, defSlotsLayerFills,
- * or defwSlotsPlacement is called per entry within
- * a slot, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwSlotLayer (const char*  layerName);
-
-/* This routine is for rectangle
- * This is a 5.4 syntax. */
-EXTERN int defwSlotRect (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine is for rectangle
- * This is a 5.6 syntax and can be called multiple time. */
-EXTERN int defwSlotPolygon (int  num_polys, double*  xl, double*  yl);
-
-/* This is a 5.4 syntax. */
-EXTERN int defwEndSlots ();
-
-/* Routines to enter Fills.  This section is optional
- * The section must start with a defwStartFills() call and
- * end with a defwEndFills() call.
- * Each fills will call the defwFills...().
- * This is a 5.4 syntax. */
-EXTERN int defwStartFills (int  count);
-
-/* This routine is for - layerName & compName
- * Either this routine, defFills, defFillsLayerFills,
- * or defwFillsPlacement is called per entry within
- * a fill, can't be more then one.
- * This is a 5.4 syntax. */
-EXTERN int defwFillLayer (const char*  layerName);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-EXTERN int defwFillLayerMask (int  maskColor);
-
-/* This routine has to be called after defwFillLayer
- * This routine is optional.
- * This is a 5.7 syntax. */
-EXTERN int defwFillLayerOPC ();
-
-/* This routine is for rectangle.
- * This is a 5.4 syntax. */
-EXTERN int defwFillRect (int  xl, int  yl, int  xh, int  yh);
-
-/* This routine is for polygon.
- * This is a 5.6 syntax and can be called multiple time. */
-EXTERN int defwFillPolygon (int  num_polys, double*  xl, double*  yl);
-
-/* This routine is for via.
- * This routine is optional.
- * This is a 5.7 syntax and can be called multiple time. */
-EXTERN int defwFillVia (const char*  viaName);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-EXTERN int defwFillViaMask (int  colorMask);
-
-/* This routine is for via OPC.
- * This routine can only be called after defwFillVia.
- * This routine is optional.
- * This is a 5.7 syntax and can be called multiple time. */
-EXTERN int defwFillViaOPC ();
-
-/* This routine is for via OPC.
- * This routine can only be called after defwFillVia.
- * This routine is required following defwFillVia.
- * This is a 5.7 syntax and can be called multiple time. */
-EXTERN int defwFillPoints (int  num_points, double*  xl, double*  yl);
-
-/* This is a 5.4 syntax. */
-EXTERN int defwEndFills ();
-
-/* Routines to enter NONDEFAULTRULES.  This section is required
- * The section must start with a defwStartNonDefaultRules() and
- * end with defwEndNonDefaultRules() call.
- * This is a 5.6 syntax. */
-EXTERN int defwStartNonDefaultRules (int  count);
-
-/* This routine is for Layer within the NONDEFAULTRULES
- * This routine can be called multiple times.  It is required.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwNonDefaultRule (const char*  ruleName, int  hardSpacing);
-
-/* Routines to enter NONDEFAULTRULES.  This section is required
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwNonDefaultRuleLayer (const char*  layerName, int  width, int  diagWidth, int  spacing, int  wireExt);
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwNonDefaultRuleVia (const char*  viaName);
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwNonDefaultRuleViaRule (const char*  viaRuleName);
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwNonDefaultRuleMinCuts (const char*  cutLayerName, int  numCutS);
-
-/* This is a 5.4 syntax. */
-EXTERN int defwEndNonDefaultRules ();
-
-/* Routines to enter STYLES.  This section is required
- * The section must start with a defwStartStyles() and
- * end with defwEndStyles() call.
- * This is a 5.6 syntax. */
-EXTERN int defwStartStyles (int  count);
-
-/* This routine is for Layer within the NONDEFAULTRULES
- * This routine can be called multiple times.  It is required.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-EXTERN int defwStyles (int  styleNums, int  num_points, double*  xp, double*  yp);
-
-/* This is a 5.4 syntax. */
-EXTERN int defwEndStyles ();
-
-/* This routine is called after defwInit.
- * This routine is optional and it can be called only once.
- * Returns 0 if successful. */
-EXTERN int defwStartBeginext (const char*  name);
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * Returns 0 if successful. */
-EXTERN int defwBeginextCreator (const char*  creatorName);
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * It gets the current system time and date.
- * Returns 0 if successful. */
-EXTERN int defwBeginextDate ();
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * Returns 0 if successful. */
-EXTERN int defwBeginextRevision (int  vers1, int  vers2);
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called many times.
- * It allows user to customize their own syntax.
- * Returns 0 if successful. */
-EXTERN int defwBeginextSyntax (const char*  title, const char*  string);
-
-/* This routine is called after defwInit.
- * This routine is optional and it can be called only once.
- * Returns 0 if successful. */
-EXTERN int defwEndBeginext ();
-
-/* End the DEF file.
- * This routine IS NOT OPTIONAL.
- * The routine must be called LAST. */
-EXTERN int defwEnd ();
-
-/* General routines that can be called anytime after the Init is called.
- */
-EXTERN int defwCurrentLineNumber ();
-
-/*
- * extern void defwError ( const char *, ... );
- * extern void defwWarning ( const char *, ... );
- * extern void defwVError ( const char *, va_list );
- * extern void defwVWarning ( const char *, va_list );
- * extern int  defwGetCurrentLineNumber (void);
- * extern const char *defwGetCurrentFileName (void);
- */
-
-/* This routine will print the error message. */
-EXTERN void defwPrintError (int  status);
-
-/* This routine will allow user to write their own comemnt.  It will
- * automactically add a # infront of the line.
- */
-EXTERN void defwAddComment (const char*  comment);
-
-/* This routine will indent 3 blank spaces */
-EXTERN void defwAddIndent ();
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriterCalls.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriterCalls.h
deleted file mode 100644
index fee6d4e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/defwWriterCalls.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2013-2014, Cadence Design Systems                                */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                       */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CDEFWWRITERCALLS_H
-#define CDEFWWRITERCALLS_H
-
-#include <stdio.h>
-#include "defiTypedefs.h"
-
-/*
- * The main writer function.
- * The file should already be opened.  This requirement allows
- * the writer to be used with stdin or a pipe.  The file name
- * is only used for error messages.  The includeSearchPath is
- * a colon-delimited list of directories in which to find
- * include files.
- */
-EXTERN int defwWrite (FILE * file, const char * fileName, defiUserData  userData);
-
-/*
- * Set all of the callbacks that have not yet been set to a function
- * that will add up how many times a given def data type was ignored
- * (ie no callback was done).  The statistics can later be printed out.
- */
-EXTERN void defwSetRegisterUnusedCallbacks ();
-EXTERN void defwPrintUnusedCallbacks (FILE*  log);
-
-/*
- * Set/get the client-provided user data.  defi doesn't look at
- * this data at all, it simply passes the opaque defiUserData pointer
- * back to the application with each callback.  The client can
- * change the data at any time, and it will take effect on the
- * next callback.  The defi writer and writer maintain separate
- * user data pointers.
- */
-EXTERN void defwSetUserData (defiUserData  p0);
-EXTERN defiUserData defwGetUserData ();
-
-/*
- * An enum describing all of the types of writer callbacks.
- */
-typedef enum {
-  defwUnspecifiedCbkType = 0,
-  defwVersionCbkType = 1,
-  defwCaseSensitiveCbkType = 2,
-  defwBusBitCbkType = 3,
-  defwDividerCbkType = 4,
-  defwDesignCbkType = 5,
-  defwTechCbkType = 6,
-  defwArrayCbkType = 7,
-  defwFloorPlanCbkType = 8,
-  defwUnitsCbkType = 9,
-  defwHistoryCbkType = 10,
-  defwPropDefCbkType = 11,
-  defwDieAreaCbkType = 12,
-  defwRowCbkType = 13,
-  defwTrackCbkType = 14,
-  defwGcellGridCbkType = 15,
-  defwDefaultCapCbkType = 16,
-  defwCanplaceCbkType = 17,
-  defwCannotOccupyCbkType = 18,
-  defwViaCbkType = 19,
-  defwRegionCbkType = 20,
-  defwComponentCbkType = 21,
-  defwPinCbkType = 22,
-  defwPinPropCbkType = 23,
-  defwSNetCbkType = 24,
-  defwNetCbkType = 25,
-  defwIOTimingCbkType = 26,
-  defwScanchainCbkType = 27,
-  defwConstraintCbkType = 28,
-  defwAssertionCbkType = 29,
-  defwGroupCbkType = 30,
-  defwBlockageCbkType = 31,
-  defwExtCbkType = 32,
-  defwDesignEndCbkType = 33
-
-  /* NEW CALLBACKS - each callback has its own type.  For each callback
-   * that you add, you must add an item to this enum. */
-
-} defwCallbackType_e;
-
-/* Declarations of function signatures for each type of callback.
- * These declarations are type-safe when compiling with ANSI C
- * or C++; you will only be able to register a function pointer
- * with the correct signature for a given type of callback.
- *
- * Each callback function is expected to return 0 if successful.
- * A non-zero return code will cause the writer to abort.
- *
- * The defwDesignStart and defwDesignEnd callback is only called once.
- * Other callbacks may be called multiple times, each time with a different
- * set of data.
- *
- * For each callback, the Def API will make the callback to the
- * function supplied by the client, which should either make a copy
- * of the Def object, or store the data in the client's own data structures.
- * The Def API will delete or reuse each object after making the callback,
- * so the client should not keep a pointer to it.
- *
- * All callbacks pass the user data pointer provided in defwRead()
- * or defwSetUserData() back to the client; this can be used by the
- * client to obtain access to the rest of the client's data structures.
- *
- * The user data pointer is obtained using defwGetUserData() immediately
- * prior to making each callback, so the client is free to change the
- * user data on the fly if necessary.
- *
- * Callbacks with the same signature are passed a callback type
- * parameter, which allows an application to write a single callback
- * function, register that function for multiple callbacks, then
- * switch based on the callback type to handle the appropriate type of
- * data.
- */
-
-/* A declaration of the signature of all callbacks that return nothing. */
-typedef int (*defwVoidCbkFnType) ( defwCallbackType_e, defiUserData );
-
-/* Functions to call to register a callback function.
- */
-EXTERN void defwSetArrayCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetAssertionCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetBlockageCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetBusBitCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetCannotOccupyCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetCanplaceCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetCaseSensitiveCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetComponentCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetConstraintCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetDefaultCapCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetDesignCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetDesignEndCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetDieAreaCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetDividerCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetExtCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetFloorPlanCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetGcellGridCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetGroupCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetHistoryCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetIOTimingCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetNetCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetPinCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetPinPropCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetPropDefCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetRegionCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetRowCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetSNetCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetScanchainCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetTechnologyCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetTrackCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetUnitsCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetVersionCbk (defwVoidCbkFnType p0);
-EXTERN void defwSetViaCbk (defwVoidCbkFnType p0);
-
-/* NEW CALLBACK - each callback must have a function to allow the user
- * to set it.  Add the function here. */
-
-/*
- * Set all of the callbacks that have not yet been set to the following
- * function.  This is especially useful if you want to check to see
- * if you forgot anything.
- */
-EXTERN void defwSetUnusedCallbacks (defwVoidCbkFnType  func);
-
-/* Routine to set the message logging routine for errors */
-    typedef void (*DEFI_LOG_FUNCTION) (const char*);
-
-EXTERN void defwSetLogFunction (DEFI_LOG_FUNCTION  p0);
-
-/* Routine to set the message logging routine for warnings */
-#ifndef DEFI_WARNING_LOG_FUNCTION
-    typedef void (*DEFI_WARNING_LOG_FUNCTION)(const char*);
-#endif
-
-EXTERN void defwSetWarningLogFunction (DEFI_WARNING_LOG_FUNCTION  p0);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiAssertion.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiAssertion.cpp
deleted file mode 100644
index bd500e9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiAssertion.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiAssertion.h"
-#include "defiAssertion.hpp"
-
-// Wrappers definitions.
-int defiAssertion_isAssertion (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isAssertion();
-}
-
-int defiAssertion_isConstraint (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isConstraint();
-}
-
-int defiAssertion_isWiredlogic (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isWiredlogic();
-}
-
-int defiAssertion_isDelay (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isDelay();
-}
-
-int defiAssertion_isSum (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isSum();
-}
-
-int defiAssertion_isDiff (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->isDiff();
-}
-
-int defiAssertion_hasRiseMin (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->hasRiseMin();
-}
-
-int defiAssertion_hasRiseMax (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->hasRiseMax();
-}
-
-int defiAssertion_hasFallMin (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->hasFallMin();
-}
-
-int defiAssertion_hasFallMax (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->hasFallMax();
-}
-
-double defiAssertion_riseMin (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->riseMin();
-}
-
-double defiAssertion_riseMax (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->riseMax();
-}
-
-double defiAssertion_fallMin (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->fallMin();
-}
-
-double defiAssertion_fallMax (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->fallMax();
-}
-
-const char* defiAssertion_netName (const ::defiAssertion* obj) {
-    return ((const LefDefParser::defiAssertion*)obj)->netName();
-}
-
-double defiAssertion_distance (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->distance();
-}
-
-int defiAssertion_numItems (const ::defiAssertion* obj) {
-    return ((LefDefParser::defiAssertion*)obj)->numItems();
-}
-
-int defiAssertion_isPath (const ::defiAssertion* obj, int  index) {
-    return ((LefDefParser::defiAssertion*)obj)->isPath(index);
-}
-
-int defiAssertion_isNet (const ::defiAssertion* obj, int  index) {
-    return ((LefDefParser::defiAssertion*)obj)->isNet(index);
-}
-
-void defiAssertion_path (const ::defiAssertion* obj, int  index, char**  fromInst, char**  fromPin, char**  toInst, char**  toPin) {
-    ((LefDefParser::defiAssertion*)obj)->path(index, fromInst, fromPin, toInst, toPin);
-}
-
-void defiAssertion_net (const ::defiAssertion* obj, int  index, char**  netName) {
-    ((LefDefParser::defiAssertion*)obj)->net(index, netName);
-}
-
-void defiAssertion_print (const ::defiAssertion* obj, FILE*  f) {
-    ((LefDefParser::defiAssertion*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiBlockage.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiBlockage.cpp
deleted file mode 100644
index a800355..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiBlockage.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiBlockage.h"
-#include "defiBlockage.hpp"
-
-// Wrappers definitions.
-int defiBlockage_hasLayer (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasLayer();
-}
-
-int defiBlockage_hasPlacement (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasPlacement();
-}
-
-int defiBlockage_hasComponent (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasComponent();
-}
-
-int defiBlockage_hasSlots (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasSlots();
-}
-
-int defiBlockage_hasFills (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasFills();
-}
-
-int defiBlockage_hasPushdown (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasPushdown();
-}
-
-int defiBlockage_hasExceptpgnet (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasExceptpgnet();
-}
-
-int defiBlockage_hasSoft (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasSoft();
-}
-
-int defiBlockage_hasPartial (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasPartial();
-}
-
-int defiBlockage_hasSpacing (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasSpacing();
-}
-
-int defiBlockage_hasDesignRuleWidth (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasDesignRuleWidth();
-}
-
-int defiBlockage_hasMask (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->hasMask();
-}
-
-int defiBlockage_mask (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->mask();
-}
-
-int defiBlockage_minSpacing (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->minSpacing();
-}
-
-int defiBlockage_designRuleWidth (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->designRuleWidth();
-}
-
-double defiBlockage_placementMaxDensity (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->placementMaxDensity();
-}
-
-const char* defiBlockage_layerName (const ::defiBlockage* obj) {
-    return ((const LefDefParser::defiBlockage*)obj)->layerName();
-}
-
-const char* defiBlockage_layerComponentName (const ::defiBlockage* obj) {
-    return ((const LefDefParser::defiBlockage*)obj)->layerComponentName();
-}
-
-const char* defiBlockage_placementComponentName (const ::defiBlockage* obj) {
-    return ((const LefDefParser::defiBlockage*)obj)->placementComponentName();
-}
-
-int defiBlockage_numRectangles (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->numRectangles();
-}
-
-int defiBlockage_xl (const ::defiBlockage* obj, int  index) {
-    return ((LefDefParser::defiBlockage*)obj)->xl(index);
-}
-
-int defiBlockage_yl (const ::defiBlockage* obj, int  index) {
-    return ((LefDefParser::defiBlockage*)obj)->yl(index);
-}
-
-int defiBlockage_xh (const ::defiBlockage* obj, int  index) {
-    return ((LefDefParser::defiBlockage*)obj)->xh(index);
-}
-
-int defiBlockage_yh (const ::defiBlockage* obj, int  index) {
-    return ((LefDefParser::defiBlockage*)obj)->yh(index);
-}
-
-int defiBlockage_numPolygons (const ::defiBlockage* obj) {
-    return ((LefDefParser::defiBlockage*)obj)->numPolygons();
-}
-
-::defiPoints defiBlockage_getPolygon (const ::defiBlockage* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiBlockage*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-void defiBlockage_print (const ::defiBlockage* obj, FILE*  f) {
-    ((LefDefParser::defiBlockage*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiComponent.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiComponent.cpp
deleted file mode 100644
index a0896de..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiComponent.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiComponent.h"
-#include "defiComponent.hpp"
-
-// Wrappers definitions.
-int defiComponentMaskShiftLayer_numMaskShiftLayers (const ::defiComponentMaskShiftLayer* obj) {
-    return ((LefDefParser::defiComponentMaskShiftLayer*)obj)->numMaskShiftLayers();
-}
-
-const char* defiComponentMaskShiftLayer_maskShiftLayer (const ::defiComponentMaskShiftLayer* obj, int  index) {
-    return ((const LefDefParser::defiComponentMaskShiftLayer*)obj)->maskShiftLayer(index);
-}
-
-const char* defiComponent_id (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->id();
-}
-
-const char* defiComponent_name (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->name();
-}
-
-int defiComponent_placementStatus (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->placementStatus();
-}
-
-int defiComponent_isUnplaced (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->isUnplaced();
-}
-
-int defiComponent_isPlaced (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->isPlaced();
-}
-
-int defiComponent_isFixed (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->isFixed();
-}
-
-int defiComponent_isCover (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->isCover();
-}
-
-int defiComponent_placementX (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->placementX();
-}
-
-int defiComponent_placementY (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->placementY();
-}
-
-int defiComponent_placementOrient (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->placementOrient();
-}
-
-const char* defiComponent_placementOrientStr (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->placementOrientStr();
-}
-
-int defiComponent_hasRegionName (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasRegionName();
-}
-
-int defiComponent_hasRegionBounds (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasRegionBounds();
-}
-
-int defiComponent_hasEEQ (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasEEQ();
-}
-
-int defiComponent_hasGenerate (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasGenerate();
-}
-
-int defiComponent_hasSource (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasSource();
-}
-
-int defiComponent_hasWeight (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasWeight();
-}
-
-int defiComponent_weight (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->weight();
-}
-
-int defiComponent_maskShiftSize (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->maskShiftSize();
-}
-
-int defiComponent_maskShift (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->maskShift(index);
-}
-
-int defiComponent_hasNets (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasNets();
-}
-
-int defiComponent_numNets (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->numNets();
-}
-
-const char* defiComponent_net (const ::defiComponent* obj, int  index) {
-    return ((const LefDefParser::defiComponent*)obj)->net(index);
-}
-
-const char* defiComponent_regionName (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->regionName();
-}
-
-const char* defiComponent_source (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->source();
-}
-
-const char* defiComponent_EEQ (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->EEQ();
-}
-
-const char* defiComponent_generateName (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->generateName();
-}
-
-const char* defiComponent_macroName (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->macroName();
-}
-
-int defiComponent_hasHalo (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasHalo();
-}
-
-int defiComponent_hasHaloSoft (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasHaloSoft();
-}
-
-int defiComponent_hasRouteHalo (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasRouteHalo();
-}
-
-int defiComponent_haloDist (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->haloDist();
-}
-
-const char* defiComponent_minLayer (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->minLayer();
-}
-
-const char* defiComponent_maxLayer (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->maxLayer();
-}
-
-void defiComponent_regionBounds (const ::defiComponent* obj, int* size, int**  xl, int**  yl, int**  xh, int**  yh) {
-    ((LefDefParser::defiComponent*)obj)->regionBounds(size, xl, yl, xh, yh);
-}
-
-int defiComponent_hasForeignName (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasForeignName();
-}
-
-const char* defiComponent_foreignName (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->foreignName();
-}
-
-int defiComponent_foreignX (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->foreignX();
-}
-
-int defiComponent_foreignY (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->foreignY();
-}
-
-const char* defiComponent_foreignOri (const ::defiComponent* obj) {
-    return ((const LefDefParser::defiComponent*)obj)->foreignOri();
-}
-
-int defiComponent_foreignOrient (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->foreignOrient();
-}
-
-int defiComponent_hasFori (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->hasFori();
-}
-
-int defiComponent_numProps (const ::defiComponent* obj) {
-    return ((LefDefParser::defiComponent*)obj)->numProps();
-}
-
-char* defiComponent_propName (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propName(index);
-}
-
-char* defiComponent_propValue (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propValue(index);
-}
-
-double defiComponent_propNumber (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propNumber(index);
-}
-
-char defiComponent_propType (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propType(index);
-}
-
-int defiComponent_propIsNumber (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propIsNumber(index);
-}
-
-int defiComponent_propIsString (const ::defiComponent* obj, int  index) {
-    return ((LefDefParser::defiComponent*)obj)->propIsString(index);
-}
-
-void defiComponent_print (const ::defiComponent* obj, FILE*  fout) {
-    ((LefDefParser::defiComponent*)obj)->print(fout);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiDebug.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiDebug.cpp
deleted file mode 100644
index e1f0b56..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiDebug.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiDebug.h"
-#include "defiDebug.hpp"
-
-// Wrappers definitions.
-void defiSetDebug (int  num, int  value) {
-    LefDefParser::defiSetDebug(num, value);
-}
-
-int defiDebug (int  num) {
-    return LefDefParser::defiDebug(num);
-}
-
-void defiError (int  check, int  msgNum, const char*  message) {
-    LefDefParser::defiError(check, msgNum, message);
-}
-
-const char* upperCase (const char*  c) {
-    return LefDefParser::upperCase(c);
-}
-
-const char* DEFCASE (const char*  ch) {
-    return LefDefParser::DEFCASE(ch);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFPC.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFPC.cpp
deleted file mode 100644
index e6f73fb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFPC.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiFPC.h"
-#include "defiFPC.hpp"
-
-// Wrappers definitions.
-const char* defiFPC_name (const ::defiFPC* obj) {
-    return ((const LefDefParser::defiFPC*)obj)->name();
-}
-
-int defiFPC_isVertical (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->isVertical();
-}
-
-int defiFPC_isHorizontal (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->isHorizontal();
-}
-
-int defiFPC_hasAlign (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->hasAlign();
-}
-
-int defiFPC_hasMax (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->hasMax();
-}
-
-int defiFPC_hasMin (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->hasMin();
-}
-
-int defiFPC_hasEqual (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->hasEqual();
-}
-
-double defiFPC_alignMax (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->alignMax();
-}
-
-double defiFPC_alignMin (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->alignMin();
-}
-
-double defiFPC_equal (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->equal();
-}
-
-int defiFPC_numParts (const ::defiFPC* obj) {
-    return ((LefDefParser::defiFPC*)obj)->numParts();
-}
-
-void defiFPC_getPart (const ::defiFPC* obj, int  index, int*  corner, int*  typ, char**  name) {
-    ((LefDefParser::defiFPC*)obj)->getPart(index, corner, typ, name);
-}
-
-void defiFPC_print (const ::defiFPC* obj, FILE*  f) {
-    ((LefDefParser::defiFPC*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFill.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFill.cpp
deleted file mode 100644
index 5556aa4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiFill.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiFill.h"
-#include "defiFill.hpp"
-
-// Wrappers definitions.
-int defiFill_hasLayer (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->hasLayer();
-}
-
-const char* defiFill_layerName (const ::defiFill* obj) {
-    return ((const LefDefParser::defiFill*)obj)->layerName();
-}
-
-int defiFill_hasLayerOpc (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->hasLayerOpc();
-}
-
-int defiFill_layerMask (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->layerMask();
-}
-
-int defiFill_viaTopMask (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->viaTopMask();
-}
-
-int defiFill_viaCutMask (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->viaCutMask();
-}
-
-int defiFill_viaBottomMask (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->viaBottomMask();
-}
-
-int defiFill_numRectangles (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->numRectangles();
-}
-
-int defiFill_xl (const ::defiFill* obj, int  index) {
-    return ((LefDefParser::defiFill*)obj)->xl(index);
-}
-
-int defiFill_yl (const ::defiFill* obj, int  index) {
-    return ((LefDefParser::defiFill*)obj)->yl(index);
-}
-
-int defiFill_xh (const ::defiFill* obj, int  index) {
-    return ((LefDefParser::defiFill*)obj)->xh(index);
-}
-
-int defiFill_yh (const ::defiFill* obj, int  index) {
-    return ((LefDefParser::defiFill*)obj)->yh(index);
-}
-
-int defiFill_numPolygons (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->numPolygons();
-}
-
-::defiPoints defiFill_getPolygon (const ::defiFill* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiFill*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-int defiFill_hasVia (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->hasVia();
-}
-
-const char* defiFill_viaName (const ::defiFill* obj) {
-    return ((const LefDefParser::defiFill*)obj)->viaName();
-}
-
-int defiFill_hasViaOpc (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->hasViaOpc();
-}
-
-int defiFill_numViaPts (const ::defiFill* obj) {
-    return ((LefDefParser::defiFill*)obj)->numViaPts();
-}
-
-::defiPoints defiFill_getViaPts (const ::defiFill* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiFill*)obj)->getViaPts(index);
-    return *((::defiPoints*)&tmp);
-}
-
-void defiFill_print (const ::defiFill* obj, FILE*  f) {
-    ((LefDefParser::defiFill*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiGroup.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiGroup.cpp
deleted file mode 100644
index 44be39d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiGroup.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiGroup.h"
-#include "defiGroup.hpp"
-
-// Wrappers definitions.
-const char* defiGroup_name (const ::defiGroup* obj) {
-    return ((const LefDefParser::defiGroup*)obj)->name();
-}
-
-const char* defiGroup_regionName (const ::defiGroup* obj) {
-    return ((const LefDefParser::defiGroup*)obj)->regionName();
-}
-
-int defiGroup_hasRegionBox (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->hasRegionBox();
-}
-
-int defiGroup_hasRegionName (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->hasRegionName();
-}
-
-int defiGroup_hasMaxX (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->hasMaxX();
-}
-
-int defiGroup_hasMaxY (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->hasMaxY();
-}
-
-int defiGroup_hasPerim (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->hasPerim();
-}
-
-void defiGroup_regionRects (const ::defiGroup* obj, int*  size, int**  xl, int** yl, int**  xh, int**  yh) {
-    ((LefDefParser::defiGroup*)obj)->regionRects(size, xl, yl, xh, yh);
-}
-
-int defiGroup_maxX (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->maxX();
-}
-
-int defiGroup_maxY (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->maxY();
-}
-
-int defiGroup_perim (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->perim();
-}
-
-int defiGroup_numProps (const ::defiGroup* obj) {
-    return ((LefDefParser::defiGroup*)obj)->numProps();
-}
-
-const char* defiGroup_propName (const ::defiGroup* obj, int  index) {
-    return ((const LefDefParser::defiGroup*)obj)->propName(index);
-}
-
-const char* defiGroup_propValue (const ::defiGroup* obj, int  index) {
-    return ((const LefDefParser::defiGroup*)obj)->propValue(index);
-}
-
-double defiGroup_propNumber (const ::defiGroup* obj, int  index) {
-    return ((LefDefParser::defiGroup*)obj)->propNumber(index);
-}
-
-const char defiGroup_propType (const ::defiGroup* obj, int  index) {
-    return ((const LefDefParser::defiGroup*)obj)->propType(index);
-}
-
-int defiGroup_propIsNumber (const ::defiGroup* obj, int  index) {
-    return ((LefDefParser::defiGroup*)obj)->propIsNumber(index);
-}
-
-int defiGroup_propIsString (const ::defiGroup* obj, int  index) {
-    return ((LefDefParser::defiGroup*)obj)->propIsString(index);
-}
-
-void defiGroup_print (const ::defiGroup* obj, FILE*  f) {
-    ((LefDefParser::defiGroup*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiIOTiming.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiIOTiming.cpp
deleted file mode 100644
index 861a6f3..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiIOTiming.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiIOTiming.h"
-#include "defiIOTiming.hpp"
-
-// Wrappers definitions.
-int defiIOTiming_hasVariableRise (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasVariableRise();
-}
-
-int defiIOTiming_hasVariableFall (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasVariableFall();
-}
-
-int defiIOTiming_hasSlewRise (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasSlewRise();
-}
-
-int defiIOTiming_hasSlewFall (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasSlewFall();
-}
-
-int defiIOTiming_hasCapacitance (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasCapacitance();
-}
-
-int defiIOTiming_hasDriveCell (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasDriveCell();
-}
-
-int defiIOTiming_hasFrom (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasFrom();
-}
-
-int defiIOTiming_hasTo (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasTo();
-}
-
-int defiIOTiming_hasParallel (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->hasParallel();
-}
-
-const char* defiIOTiming_inst (const ::defiIOTiming* obj) {
-    return ((const LefDefParser::defiIOTiming*)obj)->inst();
-}
-
-const char* defiIOTiming_pin (const ::defiIOTiming* obj) {
-    return ((const LefDefParser::defiIOTiming*)obj)->pin();
-}
-
-double defiIOTiming_variableFallMin (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->variableFallMin();
-}
-
-double defiIOTiming_variableRiseMin (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->variableRiseMin();
-}
-
-double defiIOTiming_variableFallMax (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->variableFallMax();
-}
-
-double defiIOTiming_variableRiseMax (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->variableRiseMax();
-}
-
-double defiIOTiming_slewFallMin (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->slewFallMin();
-}
-
-double defiIOTiming_slewRiseMin (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->slewRiseMin();
-}
-
-double defiIOTiming_slewFallMax (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->slewFallMax();
-}
-
-double defiIOTiming_slewRiseMax (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->slewRiseMax();
-}
-
-double defiIOTiming_capacitance (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->capacitance();
-}
-
-const char* defiIOTiming_driveCell (const ::defiIOTiming* obj) {
-    return ((const LefDefParser::defiIOTiming*)obj)->driveCell();
-}
-
-const char* defiIOTiming_from (const ::defiIOTiming* obj) {
-    return ((const LefDefParser::defiIOTiming*)obj)->from();
-}
-
-const char* defiIOTiming_to (const ::defiIOTiming* obj) {
-    return ((const LefDefParser::defiIOTiming*)obj)->to();
-}
-
-double defiIOTiming_parallel (const ::defiIOTiming* obj) {
-    return ((LefDefParser::defiIOTiming*)obj)->parallel();
-}
-
-void defiIOTiming_print (const ::defiIOTiming* obj, FILE*  f) {
-    ((LefDefParser::defiIOTiming*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiMisc.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiMisc.cpp
deleted file mode 100644
index df6f2cb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiMisc.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiMisc.h"
-#include "defiMisc.hpp"
-
-// Wrappers definitions.
-int defiGeometries_numPoints (const ::defiGeometries* obj) {
-    return ((LefDefParser::defiGeometries*)obj)->numPoints();
-}
-
-void defiGeometries_points (const ::defiGeometries* obj, int  index, int*  x, int*  y) {
-    ((LefDefParser::defiGeometries*)obj)->points(index, x, y);
-}
-
-int defiStyles_style (const ::defiStyles* obj) {
-    return ((LefDefParser::defiStyles*)obj)->style();
-}
-
-::defiPoints defiStyles_getPolygon (const ::defiStyles* obj) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiStyles*)obj)->getPolygon();
-    return *((::defiPoints*)&tmp);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNet.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNet.cpp
deleted file mode 100644
index 53d5a57..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNet.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiNet.h"
-#include "defiNet.hpp"
-
-// Wrappers definitions.
-const char* defiWire_wireType (const ::defiWire* obj) {
-    return ((const LefDefParser::defiWire*)obj)->wireType();
-}
-
-const char* defiWire_wireShieldNetName (const ::defiWire* obj) {
-    return ((const LefDefParser::defiWire*)obj)->wireShieldNetName();
-}
-
-int defiWire_numPaths (const ::defiWire* obj) {
-    return ((LefDefParser::defiWire*)obj)->numPaths();
-}
-
-const ::defiPath* defiWire_path (const ::defiWire* obj, int  index) {
-    return (const ::defiPath*) ((const LefDefParser::defiWire*)obj)->path(index);
-}
-
-void defiSubnet_print (const ::defiSubnet* obj, FILE*  f) {
-    ((LefDefParser::defiSubnet*)obj)->print(f);
-}
-
-const char* defiSubnet_name (const ::defiSubnet* obj) {
-    return ((const LefDefParser::defiSubnet*)obj)->name();
-}
-
-int defiSubnet_numConnections (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->numConnections();
-}
-
-const char* defiSubnet_instance (const ::defiSubnet* obj, int  index) {
-    return ((const LefDefParser::defiSubnet*)obj)->instance(index);
-}
-
-const char* defiSubnet_pin (const ::defiSubnet* obj, int  index) {
-    return ((const LefDefParser::defiSubnet*)obj)->pin(index);
-}
-
-int defiSubnet_pinIsSynthesized (const ::defiSubnet* obj, int  index) {
-    return ((LefDefParser::defiSubnet*)obj)->pinIsSynthesized(index);
-}
-
-int defiSubnet_pinIsMustJoin (const ::defiSubnet* obj, int  index) {
-    return ((LefDefParser::defiSubnet*)obj)->pinIsMustJoin(index);
-}
-
-int defiSubnet_isFixed (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->isFixed();
-}
-
-int defiSubnet_isRouted (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->isRouted();
-}
-
-int defiSubnet_isCover (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->isCover();
-}
-
-int defiSubnet_hasNonDefaultRule (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->hasNonDefaultRule();
-}
-
-int defiSubnet_numPaths (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->numPaths();
-}
-
-const ::defiPath* defiSubnet_path (const ::defiSubnet* obj, int  index) {
-    return (const ::defiPath*) ((const LefDefParser::defiSubnet*)obj)->path(index);
-}
-
-const char* defiSubnet_nonDefaultRule (const ::defiSubnet* obj) {
-    return ((const LefDefParser::defiSubnet*)obj)->nonDefaultRule();
-}
-
-int defiSubnet_numWires (const ::defiSubnet* obj) {
-    return ((LefDefParser::defiSubnet*)obj)->numWires();
-}
-
-const ::defiWire* defiSubnet_wire (const ::defiSubnet* obj, int  index) {
-    return (const ::defiWire*) ((const LefDefParser::defiSubnet*)obj)->wire(index);
-}
-
-int defiVpin_xl (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->xl();
-}
-
-int defiVpin_yl (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->yl();
-}
-
-int defiVpin_xh (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->xh();
-}
-
-int defiVpin_yh (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->yh();
-}
-
-char defiVpin_status (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->status();
-}
-
-int defiVpin_orient (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->orient();
-}
-
-const char* defiVpin_orientStr (const ::defiVpin* obj) {
-    return ((const LefDefParser::defiVpin*)obj)->orientStr();
-}
-
-int defiVpin_xLoc (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->xLoc();
-}
-
-int defiVpin_yLoc (const ::defiVpin* obj) {
-    return ((LefDefParser::defiVpin*)obj)->yLoc();
-}
-
-const char* defiVpin_name (const ::defiVpin* obj) {
-    return ((const LefDefParser::defiVpin*)obj)->name();
-}
-
-const char* defiVpin_layer (const ::defiVpin* obj) {
-    return ((const LefDefParser::defiVpin*)obj)->layer();
-}
-
-const char* defiShield_shieldName (const ::defiShield* obj) {
-    return ((const LefDefParser::defiShield*)obj)->shieldName();
-}
-
-int defiShield_numPaths (const ::defiShield* obj) {
-    return ((LefDefParser::defiShield*)obj)->numPaths();
-}
-
-const ::defiPath* defiShield_path (const ::defiShield* obj, int  index) {
-    return (const ::defiPath*) ((const LefDefParser::defiShield*)obj)->path(index);
-}
-
-const char* defiNet_name (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->name();
-}
-
-int defiNet_weight (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->weight();
-}
-
-int defiNet_numProps (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numProps();
-}
-
-const char* defiNet_propName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->propName(index);
-}
-
-const char* defiNet_propValue (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->propValue(index);
-}
-
-double defiNet_propNumber (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->propNumber(index);
-}
-
-const char defiNet_propType (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->propType(index);
-}
-
-int defiNet_propIsNumber (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->propIsNumber(index);
-}
-
-int defiNet_propIsString (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->propIsString(index);
-}
-
-int defiNet_numConnections (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numConnections();
-}
-
-const char* defiNet_instance (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->instance(index);
-}
-
-const char* defiNet_pin (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->pin(index);
-}
-
-int defiNet_pinIsMustJoin (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->pinIsMustJoin(index);
-}
-
-int defiNet_pinIsSynthesized (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->pinIsSynthesized(index);
-}
-
-int defiNet_numSubnets (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numSubnets();
-}
-
-const ::defiSubnet* defiNet_subnet (const ::defiNet* obj, int  index) {
-    return (const ::defiSubnet*) ((const LefDefParser::defiNet*)obj)->subnet(index);
-}
-
-int defiNet_isFixed (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->isFixed();
-}
-
-int defiNet_isRouted (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->isRouted();
-}
-
-int defiNet_isCover (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->isCover();
-}
-
-int defiNet_numWires (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numWires();
-}
-
-const ::defiWire* defiNet_wire (const ::defiNet* obj, int  index) {
-    return (const ::defiWire*) ((const LefDefParser::defiNet*)obj)->wire(index);
-}
-
-int defiNet_numVpins (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numVpins();
-}
-
-const ::defiVpin* defiNet_vpin (const ::defiNet* obj, int  index) {
-    return (const ::defiVpin*) ((const LefDefParser::defiNet*)obj)->vpin(index);
-}
-
-int defiNet_hasProps (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasProps();
-}
-
-int defiNet_hasWeight (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasWeight();
-}
-
-int defiNet_hasSubnets (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasSubnets();
-}
-
-int defiNet_hasSource (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasSource();
-}
-
-int defiNet_hasFixedbump (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasFixedbump();
-}
-
-int defiNet_hasFrequency (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasFrequency();
-}
-
-int defiNet_hasPattern (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasPattern();
-}
-
-int defiNet_hasOriginal (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasOriginal();
-}
-
-int defiNet_hasCap (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasCap();
-}
-
-int defiNet_hasUse (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasUse();
-}
-
-int defiNet_hasStyle (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasStyle();
-}
-
-int defiNet_hasNonDefaultRule (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasNonDefaultRule();
-}
-
-int defiNet_hasVoltage (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasVoltage();
-}
-
-int defiNet_hasSpacingRules (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasSpacingRules();
-}
-
-int defiNet_hasWidthRules (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasWidthRules();
-}
-
-int defiNet_hasXTalk (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->hasXTalk();
-}
-
-int defiNet_numSpacingRules (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numSpacingRules();
-}
-
-void defiNet_spacingRule (const ::defiNet* obj, int  index, char**  layer, double*  dist, double*  left, double*  right) {
-    ((LefDefParser::defiNet*)obj)->spacingRule(index, layer, dist, left, right);
-}
-
-int defiNet_numWidthRules (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numWidthRules();
-}
-
-void defiNet_widthRule (const ::defiNet* obj, int  index, char**  layer, double*  dist) {
-    ((LefDefParser::defiNet*)obj)->widthRule(index, layer, dist);
-}
-
-double defiNet_voltage (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->voltage();
-}
-
-int defiNet_XTalk (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->XTalk();
-}
-
-const char* defiNet_source (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->source();
-}
-
-double defiNet_frequency (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->frequency();
-}
-
-const char* defiNet_original (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->original();
-}
-
-const char* defiNet_pattern (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->pattern();
-}
-
-double defiNet_cap (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->cap();
-}
-
-const char* defiNet_use (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->use();
-}
-
-int defiNet_style (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->style();
-}
-
-const char* defiNet_nonDefaultRule (const ::defiNet* obj) {
-    return ((const LefDefParser::defiNet*)obj)->nonDefaultRule();
-}
-
-int defiNet_numPaths (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numPaths();
-}
-
-const ::defiPath* defiNet_path (const ::defiNet* obj, int  index) {
-    return (const ::defiPath*) ((const LefDefParser::defiNet*)obj)->path(index);
-}
-
-int defiNet_numShields (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numShields();
-}
-
-const ::defiShield* defiNet_shield (const ::defiNet* obj, int  index) {
-    return (const ::defiShield*) ((const LefDefParser::defiNet*)obj)->shield(index);
-}
-
-int defiNet_numShieldNets (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numShieldNets();
-}
-
-const char* defiNet_shieldNet (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->shieldNet(index);
-}
-
-int defiNet_numNoShields (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numNoShields();
-}
-
-const ::defiShield* defiNet_noShield (const ::defiNet* obj, int  index) {
-    return (const ::defiShield*) ((const LefDefParser::defiNet*)obj)->noShield(index);
-}
-
-int defiNet_numPolygons (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numPolygons();
-}
-
-const char* defiNet_polygonName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->polygonName(index);
-}
-
-::defiPoints defiNet_getPolygon (const ::defiNet* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiNet*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-int defiNet_polyMask (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->polyMask(index);
-}
-
-const char* defiNet_polyRouteStatus (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->polyRouteStatus(index);
-}
-
-const char* defiNet_polyRouteStatusShieldName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->polyRouteStatusShieldName(index);
-}
-
-const char* defiNet_polyShapeType (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->polyShapeType(index);
-}
-
-int defiNet_numRectangles (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numRectangles();
-}
-
-const char* defiNet_rectName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->rectName(index);
-}
-
-int defiNet_xl (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->xl(index);
-}
-
-int defiNet_yl (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->yl(index);
-}
-
-int defiNet_xh (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->xh(index);
-}
-
-int defiNet_yh (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->yh(index);
-}
-
-int defiNet_rectMask (const ::defiNet* obj, int  index) {
-    return ((LefDefParser::defiNet*)obj)->rectMask(index);
-}
-
-const char* defiNet_rectRouteStatus (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->rectRouteStatus(index);
-}
-
-const char* defiNet_rectRouteStatusShieldName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->rectRouteStatusShieldName(index);
-}
-
-const char* defiNet_rectShapeType (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->rectShapeType(index);
-}
-
-int defiNet_numViaSpecs (const ::defiNet* obj) {
-    return ((LefDefParser::defiNet*)obj)->numViaSpecs();
-}
-
-::defiPoints defiNet_getViaPts (const ::defiNet* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiNet*)obj)->getViaPts(index);
-    return *((::defiPoints*)&tmp);
-}
-
-const char* defiNet_viaName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaName(index);
-}
-
-const int defiNet_viaOrient (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaOrient(index);
-}
-
-const char* defiNet_viaOrientStr (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaOrientStr(index);
-}
-
-const int defiNet_topMaskNum (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->topMaskNum(index);
-}
-
-const int defiNet_cutMaskNum (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->cutMaskNum(index);
-}
-
-const int defiNet_bottomMaskNum (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->bottomMaskNum(index);
-}
-
-const char* defiNet_viaRouteStatus (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaRouteStatus(index);
-}
-
-const char* defiNet_viaRouteStatusShieldName (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaRouteStatusShieldName(index);
-}
-
-const char* defiNet_viaShapeType (const ::defiNet* obj, int  index) {
-    return ((const LefDefParser::defiNet*)obj)->viaShapeType(index);
-}
-
-void defiNet_print (const ::defiNet* obj, FILE*  f) {
-    ((LefDefParser::defiNet*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNonDefault.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNonDefault.cpp
deleted file mode 100644
index 95c915f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiNonDefault.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiNonDefault.h"
-#include "defiNonDefault.hpp"
-
-// Wrappers definitions.
-const char* defiNonDefault_name (const ::defiNonDefault* obj) {
-    return ((const LefDefParser::defiNonDefault*)obj)->name();
-}
-
-int defiNonDefault_hasHardspacing (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->hasHardspacing();
-}
-
-int defiNonDefault_numProps (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->numProps();
-}
-
-const char* defiNonDefault_propName (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->propName(index);
-}
-
-const char* defiNonDefault_propValue (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->propValue(index);
-}
-
-double defiNonDefault_propNumber (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->propNumber(index);
-}
-
-const char defiNonDefault_propType (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->propType(index);
-}
-
-int defiNonDefault_propIsNumber (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->propIsNumber(index);
-}
-
-int defiNonDefault_propIsString (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->propIsString(index);
-}
-
-int defiNonDefault_numLayers (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->numLayers();
-}
-
-const char* defiNonDefault_layerName (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->layerName(index);
-}
-
-double defiNonDefault_layerWidth (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerWidth(index);
-}
-
-int defiNonDefault_layerWidthVal (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerWidthVal(index);
-}
-
-int defiNonDefault_hasLayerDiagWidth (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->hasLayerDiagWidth(index);
-}
-
-double defiNonDefault_layerDiagWidth (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerDiagWidth(index);
-}
-
-int defiNonDefault_layerDiagWidthVal (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerDiagWidthVal(index);
-}
-
-int defiNonDefault_hasLayerSpacing (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->hasLayerSpacing(index);
-}
-
-double defiNonDefault_layerSpacing (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerSpacing(index);
-}
-
-int defiNonDefault_layerSpacingVal (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerSpacingVal(index);
-}
-
-int defiNonDefault_hasLayerWireExt (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->hasLayerWireExt(index);
-}
-
-double defiNonDefault_layerWireExt (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerWireExt(index);
-}
-
-int defiNonDefault_layerWireExtVal (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->layerWireExtVal(index);
-}
-
-int defiNonDefault_numVias (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->numVias();
-}
-
-const char* defiNonDefault_viaName (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->viaName(index);
-}
-
-int defiNonDefault_numViaRules (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->numViaRules();
-}
-
-const char* defiNonDefault_viaRuleName (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->viaRuleName(index);
-}
-
-int defiNonDefault_numMinCuts (const ::defiNonDefault* obj) {
-    return ((LefDefParser::defiNonDefault*)obj)->numMinCuts();
-}
-
-const char* defiNonDefault_cutLayerName (const ::defiNonDefault* obj, int  index) {
-    return ((const LefDefParser::defiNonDefault*)obj)->cutLayerName(index);
-}
-
-int defiNonDefault_numCuts (const ::defiNonDefault* obj, int  index) {
-    return ((LefDefParser::defiNonDefault*)obj)->numCuts(index);
-}
-
-void defiNonDefault_print (const ::defiNonDefault* obj, FILE*  f) {
-    ((LefDefParser::defiNonDefault*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPartition.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPartition.cpp
deleted file mode 100644
index daab84d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPartition.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiPartition.h"
-#include "defiPartition.hpp"
-
-// Wrappers definitions.
-const char* defiPartition_name (const ::defiPartition* obj) {
-    return ((const LefDefParser::defiPartition*)obj)->name();
-}
-
-char defiPartition_direction (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->direction();
-}
-
-const char* defiPartition_itemType (const ::defiPartition* obj) {
-    return ((const LefDefParser::defiPartition*)obj)->itemType();
-}
-
-const char* defiPartition_pinName (const ::defiPartition* obj) {
-    return ((const LefDefParser::defiPartition*)obj)->pinName();
-}
-
-const char* defiPartition_instName (const ::defiPartition* obj) {
-    return ((const LefDefParser::defiPartition*)obj)->instName();
-}
-
-int defiPartition_numPins (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->numPins();
-}
-
-const char* defiPartition_pin (const ::defiPartition* obj, int  index) {
-    return ((const LefDefParser::defiPartition*)obj)->pin(index);
-}
-
-int defiPartition_isSetupRise (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->isSetupRise();
-}
-
-int defiPartition_isSetupFall (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->isSetupFall();
-}
-
-int defiPartition_isHoldRise (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->isHoldRise();
-}
-
-int defiPartition_isHoldFall (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->isHoldFall();
-}
-
-int defiPartition_hasMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasMin();
-}
-
-int defiPartition_hasMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasMax();
-}
-
-int defiPartition_hasRiseMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasRiseMin();
-}
-
-int defiPartition_hasFallMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasFallMin();
-}
-
-int defiPartition_hasRiseMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasRiseMax();
-}
-
-int defiPartition_hasFallMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasFallMax();
-}
-
-int defiPartition_hasRiseMinRange (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasRiseMinRange();
-}
-
-int defiPartition_hasFallMinRange (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasFallMinRange();
-}
-
-int defiPartition_hasRiseMaxRange (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasRiseMaxRange();
-}
-
-int defiPartition_hasFallMaxRange (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->hasFallMaxRange();
-}
-
-double defiPartition_partitionMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->partitionMin();
-}
-
-double defiPartition_partitionMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->partitionMax();
-}
-
-double defiPartition_riseMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMin();
-}
-
-double defiPartition_fallMin (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMin();
-}
-
-double defiPartition_riseMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMax();
-}
-
-double defiPartition_fallMax (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMax();
-}
-
-double defiPartition_riseMinLeft (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMinLeft();
-}
-
-double defiPartition_fallMinLeft (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMinLeft();
-}
-
-double defiPartition_riseMaxLeft (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMaxLeft();
-}
-
-double defiPartition_fallMaxLeft (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMaxLeft();
-}
-
-double defiPartition_riseMinRight (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMinRight();
-}
-
-double defiPartition_fallMinRight (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMinRight();
-}
-
-double defiPartition_riseMaxRight (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->riseMaxRight();
-}
-
-double defiPartition_fallMaxRight (const ::defiPartition* obj) {
-    return ((LefDefParser::defiPartition*)obj)->fallMaxRight();
-}
-
-void defiPartition_print (const ::defiPartition* obj, FILE*  f) {
-    ((LefDefParser::defiPartition*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPath.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPath.cpp
deleted file mode 100644
index ef904fd..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPath.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiPath.h"
-#include "defiPath.hpp"
-
-// Wrappers definitions.
-void defiPath_initTraverse (const ::defiPath* obj) {
-    ((LefDefParser::defiPath*)obj)->initTraverse();
-}
-
-void defiPath_initTraverseBackwards (const ::defiPath* obj) {
-    ((LefDefParser::defiPath*)obj)->initTraverseBackwards();
-}
-
-int defiPath_next (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->next();
-}
-
-int defiPath_prev (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->prev();
-}
-
-const char* defiPath_getLayer (const ::defiPath* obj) {
-    return ((const LefDefParser::defiPath*)obj)->getLayer();
-}
-
-const char* defiPath_getTaperRule (const ::defiPath* obj) {
-    return ((const LefDefParser::defiPath*)obj)->getTaperRule();
-}
-
-const char* defiPath_getVia (const ::defiPath* obj) {
-    return ((const LefDefParser::defiPath*)obj)->getVia();
-}
-
-const char* defiPath_getShape (const ::defiPath* obj) {
-    return ((const LefDefParser::defiPath*)obj)->getShape();
-}
-
-int defiPath_getTaper (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getTaper();
-}
-
-int defiPath_getStyle (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getStyle();
-}
-
-int defiPath_getViaRotation (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getViaRotation();
-}
-
-void defiPath_getViaRect (const ::defiPath* obj, int*  deltaX1, int*  deltaY1, int*  deltaX2, int*  deltaY2) {
-    ((LefDefParser::defiPath*)obj)->getViaRect(deltaX1, deltaY1, deltaX2, deltaY2);
-}
-
-const char* defiPath_getViaRotationStr (const ::defiPath* obj) {
-    return ((const LefDefParser::defiPath*)obj)->getViaRotationStr();
-}
-
-void defiPath_getViaData (const ::defiPath* obj, int*  numX, int*  numY, int*  stepX, int*  stepY) {
-    ((LefDefParser::defiPath*)obj)->getViaData(numX, numY, stepX, stepY);
-}
-
-int defiPath_getWidth (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getWidth();
-}
-
-void defiPath_getPoint (const ::defiPath* obj, int*  x, int*  y) {
-    ((LefDefParser::defiPath*)obj)->getPoint(x, y);
-}
-
-void defiPath_getFlushPoint (const ::defiPath* obj, int*  x, int*  y, int*  ext) {
-    ((LefDefParser::defiPath*)obj)->getFlushPoint(x, y, ext);
-}
-
-void defiPath_getVirtualPoint (const ::defiPath* obj, int*  x, int*  y) {
-    ((LefDefParser::defiPath*)obj)->getVirtualPoint(x, y);
-}
-
-int defiPath_getMask (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getMask();
-}
-
-int defiPath_getViaTopMask (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getViaTopMask();
-}
-
-int defiPath_getViaCutMask (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getViaCutMask();
-}
-
-int defiPath_getViaBottomMask (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getViaBottomMask();
-}
-
-int defiPath_getRectMask (const ::defiPath* obj) {
-    return ((LefDefParser::defiPath*)obj)->getRectMask();
-}
-
-void defiPath_print (const ::defiPath* obj, FILE*  fout) {
-    ((LefDefParser::defiPath*)obj)->print(fout);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinCap.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinCap.cpp
deleted file mode 100644
index 76a0f91..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinCap.cpp
+++ /dev/null
@@ -1,551 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiPinCap.h"
-#include "defiPinCap.hpp"
-
-// Wrappers definitions.
-int defiPinCap_pin (const ::defiPinCap* obj) {
-    return ((LefDefParser::defiPinCap*)obj)->pin();
-}
-
-double defiPinCap_cap (const ::defiPinCap* obj) {
-    return ((LefDefParser::defiPinCap*)obj)->cap();
-}
-
-void defiPinCap_print (const ::defiPinCap* obj, FILE*  f) {
-    ((LefDefParser::defiPinCap*)obj)->print(f);
-}
-
-char* defiPinAntennaModel_antennaOxide (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->antennaOxide();
-}
-
-int defiPinAntennaModel_hasAPinGateArea (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinGateArea();
-}
-
-int defiPinAntennaModel_numAPinGateArea (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->numAPinGateArea();
-}
-
-int defiPinAntennaModel_APinGateArea (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->APinGateArea(index);
-}
-
-int defiPinAntennaModel_hasAPinGateAreaLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinGateAreaLayer(index);
-}
-
-const char* defiPinAntennaModel_APinGateAreaLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::defiPinAntennaModel*)obj)->APinGateAreaLayer(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxAreaCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxAreaCar();
-}
-
-int defiPinAntennaModel_numAPinMaxAreaCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->numAPinMaxAreaCar();
-}
-
-int defiPinAntennaModel_APinMaxAreaCar (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->APinMaxAreaCar(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxAreaCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxAreaCarLayer(index);
-}
-
-const char* defiPinAntennaModel_APinMaxAreaCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::defiPinAntennaModel*)obj)->APinMaxAreaCarLayer(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxSideAreaCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxSideAreaCar();
-}
-
-int defiPinAntennaModel_numAPinMaxSideAreaCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->numAPinMaxSideAreaCar();
-}
-
-int defiPinAntennaModel_APinMaxSideAreaCar (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->APinMaxSideAreaCar(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxSideAreaCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxSideAreaCarLayer(index);
-}
-
-const char* defiPinAntennaModel_APinMaxSideAreaCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::defiPinAntennaModel*)obj)->APinMaxSideAreaCarLayer(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxCutCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxCutCar();
-}
-
-int defiPinAntennaModel_numAPinMaxCutCar (const ::defiPinAntennaModel* obj) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->numAPinMaxCutCar();
-}
-
-int defiPinAntennaModel_APinMaxCutCar (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->APinMaxCutCar(index);
-}
-
-int defiPinAntennaModel_hasAPinMaxCutCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::defiPinAntennaModel*)obj)->hasAPinMaxCutCarLayer(index);
-}
-
-const char* defiPinAntennaModel_APinMaxCutCarLayer (const ::defiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::defiPinAntennaModel*)obj)->APinMaxCutCarLayer(index);
-}
-
-int defiPinPort_numLayer (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->numLayer();
-}
-
-const char* defiPinPort_layer (const ::defiPinPort* obj, int  index) {
-    return ((const LefDefParser::defiPinPort*)obj)->layer(index);
-}
-
-void defiPinPort_bounds (const ::defiPinPort* obj, int  index, int*  xl, int*  yl, int*  xh, int*  yh) {
-    ((LefDefParser::defiPinPort*)obj)->bounds(index, xl, yl, xh, yh);
-}
-
-int defiPinPort_hasLayerSpacing (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->hasLayerSpacing(index);
-}
-
-int defiPinPort_hasLayerDesignRuleWidth (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->hasLayerDesignRuleWidth(index);
-}
-
-int defiPinPort_layerSpacing (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->layerSpacing(index);
-}
-
-int defiPinPort_layerMask (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->layerMask(index);
-}
-
-int defiPinPort_layerDesignRuleWidth (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->layerDesignRuleWidth(index);
-}
-
-int defiPinPort_numPolygons (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->numPolygons();
-}
-
-const char* defiPinPort_polygonName (const ::defiPinPort* obj, int  index) {
-    return ((const LefDefParser::defiPinPort*)obj)->polygonName(index);
-}
-
-::defiPoints defiPinPort_getPolygon (const ::defiPinPort* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiPinPort*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-int defiPinPort_hasPolygonSpacing (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->hasPolygonSpacing(index);
-}
-
-int defiPinPort_hasPolygonDesignRuleWidth (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->hasPolygonDesignRuleWidth(index);
-}
-
-int defiPinPort_polygonSpacing (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->polygonSpacing(index);
-}
-
-int defiPinPort_polygonDesignRuleWidth (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->polygonDesignRuleWidth(index);
-}
-
-int defiPinPort_polygonMask (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->polygonMask(index);
-}
-
-int defiPinPort_numVias (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->numVias();
-}
-
-const char* defiPinPort_viaName (const ::defiPinPort* obj, int  index) {
-    return ((const LefDefParser::defiPinPort*)obj)->viaName(index);
-}
-
-int defiPinPort_viaPtX (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->viaPtX(index);
-}
-
-int defiPinPort_viaPtY (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->viaPtY(index);
-}
-
-int defiPinPort_viaTopMask (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->viaTopMask(index);
-}
-
-int defiPinPort_viaCutMask (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->viaCutMask(index);
-}
-
-int defiPinPort_viaBottomMask (const ::defiPinPort* obj, int  index) {
-    return ((LefDefParser::defiPinPort*)obj)->viaBottomMask(index);
-}
-
-int defiPinPort_hasPlacement (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->hasPlacement();
-}
-
-int defiPinPort_isPlaced (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->isPlaced();
-}
-
-int defiPinPort_isCover (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->isCover();
-}
-
-int defiPinPort_isFixed (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->isFixed();
-}
-
-int defiPinPort_placementX (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->placementX();
-}
-
-int defiPinPort_placementY (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->placementY();
-}
-
-int defiPinPort_orient (const ::defiPinPort* obj) {
-    return ((LefDefParser::defiPinPort*)obj)->orient();
-}
-
-const char* defiPinPort_orientStr (const ::defiPinPort* obj) {
-    return ((const LefDefParser::defiPinPort*)obj)->orientStr();
-}
-
-const char* defiPin_pinName (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->pinName();
-}
-
-const char* defiPin_netName (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->netName();
-}
-
-int defiPin_hasDirection (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasDirection();
-}
-
-int defiPin_hasUse (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasUse();
-}
-
-int defiPin_hasLayer (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasLayer();
-}
-
-int defiPin_hasPlacement (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasPlacement();
-}
-
-int defiPin_isUnplaced (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->isUnplaced();
-}
-
-int defiPin_isPlaced (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->isPlaced();
-}
-
-int defiPin_isCover (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->isCover();
-}
-
-int defiPin_isFixed (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->isFixed();
-}
-
-int defiPin_placementX (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->placementX();
-}
-
-int defiPin_placementY (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->placementY();
-}
-
-const char* defiPin_direction (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->direction();
-}
-
-const char* defiPin_use (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->use();
-}
-
-int defiPin_numLayer (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numLayer();
-}
-
-const char* defiPin_layer (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->layer(index);
-}
-
-void defiPin_bounds (const ::defiPin* obj, int  index, int*  xl, int*  yl, int*  xh, int*  yh) {
-    ((LefDefParser::defiPin*)obj)->bounds(index, xl, yl, xh, yh);
-}
-
-int defiPin_layerMask (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->layerMask(index);
-}
-
-int defiPin_hasLayerSpacing (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasLayerSpacing(index);
-}
-
-int defiPin_hasLayerDesignRuleWidth (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasLayerDesignRuleWidth(index);
-}
-
-int defiPin_layerSpacing (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->layerSpacing(index);
-}
-
-int defiPin_layerDesignRuleWidth (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->layerDesignRuleWidth(index);
-}
-
-int defiPin_numPolygons (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numPolygons();
-}
-
-const char* defiPin_polygonName (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->polygonName(index);
-}
-
-::defiPoints defiPin_getPolygon (const ::defiPin* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiPin*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-int defiPin_polygonMask (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->polygonMask(index);
-}
-
-int defiPin_hasPolygonSpacing (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasPolygonSpacing(index);
-}
-
-int defiPin_hasPolygonDesignRuleWidth (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasPolygonDesignRuleWidth(index);
-}
-
-int defiPin_polygonSpacing (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->polygonSpacing(index);
-}
-
-int defiPin_polygonDesignRuleWidth (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->polygonDesignRuleWidth(index);
-}
-
-int defiPin_hasNetExpr (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasNetExpr();
-}
-
-int defiPin_hasSupplySensitivity (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasSupplySensitivity();
-}
-
-int defiPin_hasGroundSensitivity (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasGroundSensitivity();
-}
-
-const char* defiPin_netExpr (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->netExpr();
-}
-
-const char* defiPin_supplySensitivity (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->supplySensitivity();
-}
-
-const char* defiPin_groundSensitivity (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->groundSensitivity();
-}
-
-int defiPin_orient (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->orient();
-}
-
-const char* defiPin_orientStr (const ::defiPin* obj) {
-    return ((const LefDefParser::defiPin*)obj)->orientStr();
-}
-
-int defiPin_hasSpecial (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasSpecial();
-}
-
-int defiPin_numVias (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numVias();
-}
-
-const char* defiPin_viaName (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->viaName(index);
-}
-
-int defiPin_viaTopMask (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->viaTopMask(index);
-}
-
-int defiPin_viaCutMask (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->viaCutMask(index);
-}
-
-int defiPin_viaBottomMask (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->viaBottomMask(index);
-}
-
-int defiPin_viaPtX (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->viaPtX(index);
-}
-
-int defiPin_viaPtY (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->viaPtY(index);
-}
-
-int defiPin_hasAPinPartialMetalArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialMetalArea();
-}
-
-int defiPin_numAPinPartialMetalArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numAPinPartialMetalArea();
-}
-
-int defiPin_APinPartialMetalArea (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->APinPartialMetalArea(index);
-}
-
-int defiPin_hasAPinPartialMetalAreaLayer (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialMetalAreaLayer(index);
-}
-
-const char* defiPin_APinPartialMetalAreaLayer (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->APinPartialMetalAreaLayer(index);
-}
-
-int defiPin_hasAPinPartialMetalSideArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialMetalSideArea();
-}
-
-int defiPin_numAPinPartialMetalSideArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numAPinPartialMetalSideArea();
-}
-
-int defiPin_APinPartialMetalSideArea (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->APinPartialMetalSideArea(index);
-}
-
-int defiPin_hasAPinPartialMetalSideAreaLayer (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialMetalSideAreaLayer(index);
-}
-
-const char* defiPin_APinPartialMetalSideAreaLayer (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->APinPartialMetalSideAreaLayer(index);
-}
-
-int defiPin_hasAPinDiffArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinDiffArea();
-}
-
-int defiPin_numAPinDiffArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numAPinDiffArea();
-}
-
-int defiPin_APinDiffArea (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->APinDiffArea(index);
-}
-
-int defiPin_hasAPinDiffAreaLayer (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinDiffAreaLayer(index);
-}
-
-const char* defiPin_APinDiffAreaLayer (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->APinDiffAreaLayer(index);
-}
-
-int defiPin_hasAPinPartialCutArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialCutArea();
-}
-
-int defiPin_numAPinPartialCutArea (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numAPinPartialCutArea();
-}
-
-int defiPin_APinPartialCutArea (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->APinPartialCutArea(index);
-}
-
-int defiPin_hasAPinPartialCutAreaLayer (const ::defiPin* obj, int  index) {
-    return ((LefDefParser::defiPin*)obj)->hasAPinPartialCutAreaLayer(index);
-}
-
-const char* defiPin_APinPartialCutAreaLayer (const ::defiPin* obj, int  index) {
-    return ((const LefDefParser::defiPin*)obj)->APinPartialCutAreaLayer(index);
-}
-
-int defiPin_numAntennaModel (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numAntennaModel();
-}
-
-const ::defiPinAntennaModel* defiPin_antennaModel (const ::defiPin* obj, int  index) {
-    return (const ::defiPinAntennaModel*) ((LefDefParser::defiPin*)obj)->antennaModel(index);
-}
-
-int defiPin_hasPort (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->hasPort();
-}
-
-int defiPin_numPorts (const ::defiPin* obj) {
-    return ((LefDefParser::defiPin*)obj)->numPorts();
-}
-
-const ::defiPinPort* defiPin_pinPort (const ::defiPin* obj, int  index) {
-    return (const ::defiPinPort*) ((LefDefParser::defiPin*)obj)->pinPort(index);
-}
-
-void defiPin_print (const ::defiPin* obj, FILE*  f) {
-    ((LefDefParser::defiPin*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinProp.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinProp.cpp
deleted file mode 100644
index 722765f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPinProp.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiPinProp.h"
-#include "defiPinProp.hpp"
-
-// Wrappers definitions.
-int defiPinProp_isPin (const ::defiPinProp* obj) {
-    return ((LefDefParser::defiPinProp*)obj)->isPin();
-}
-
-const char* defiPinProp_instName (const ::defiPinProp* obj) {
-    return ((const LefDefParser::defiPinProp*)obj)->instName();
-}
-
-const char* defiPinProp_pinName (const ::defiPinProp* obj) {
-    return ((const LefDefParser::defiPinProp*)obj)->pinName();
-}
-
-int defiPinProp_numProps (const ::defiPinProp* obj) {
-    return ((LefDefParser::defiPinProp*)obj)->numProps();
-}
-
-const char* defiPinProp_propName (const ::defiPinProp* obj, int  index) {
-    return ((const LefDefParser::defiPinProp*)obj)->propName(index);
-}
-
-const char* defiPinProp_propValue (const ::defiPinProp* obj, int  index) {
-    return ((const LefDefParser::defiPinProp*)obj)->propValue(index);
-}
-
-double defiPinProp_propNumber (const ::defiPinProp* obj, int  index) {
-    return ((LefDefParser::defiPinProp*)obj)->propNumber(index);
-}
-
-const char defiPinProp_propType (const ::defiPinProp* obj, int  index) {
-    return ((const LefDefParser::defiPinProp*)obj)->propType(index);
-}
-
-int defiPinProp_propIsNumber (const ::defiPinProp* obj, int  index) {
-    return ((LefDefParser::defiPinProp*)obj)->propIsNumber(index);
-}
-
-int defiPinProp_propIsString (const ::defiPinProp* obj, int  index) {
-    return ((LefDefParser::defiPinProp*)obj)->propIsString(index);
-}
-
-void defiPinProp_print (const ::defiPinProp* obj, FILE*  f) {
-    ((LefDefParser::defiPinProp*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiProp.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiProp.cpp
deleted file mode 100644
index 8db5457..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiProp.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiProp.h"
-#include "defiProp.hpp"
-
-// Wrappers definitions.
-const char* defiProp_string (const ::defiProp* obj) {
-    return ((const LefDefParser::defiProp*)obj)->string();
-}
-
-const char* defiProp_propType (const ::defiProp* obj) {
-    return ((const LefDefParser::defiProp*)obj)->propType();
-}
-
-const char* defiProp_propName (const ::defiProp* obj) {
-    return ((const LefDefParser::defiProp*)obj)->propName();
-}
-
-char defiProp_dataType (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->dataType();
-}
-
-int defiProp_hasNumber (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->hasNumber();
-}
-
-int defiProp_hasRange (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->hasRange();
-}
-
-int defiProp_hasString (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->hasString();
-}
-
-int defiProp_hasNameMapString (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->hasNameMapString();
-}
-
-double defiProp_number (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->number();
-}
-
-double defiProp_left (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->left();
-}
-
-double defiProp_right (const ::defiProp* obj) {
-    return ((LefDefParser::defiProp*)obj)->right();
-}
-
-void defiProp_print (const ::defiProp* obj, FILE*  f) {
-    ((LefDefParser::defiProp*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPropType.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPropType.cpp
deleted file mode 100644
index 7e0c044..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiPropType.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiPropType.h"
-#include "defiPropType.hpp"
-
-// Wrappers definitions.
-const char defiPropType_propType (const ::defiPropType* obj, char*  name) {
-    return ((const LefDefParser::defiPropType*)obj)->propType(name);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRegion.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRegion.cpp
deleted file mode 100644
index 4e4e3cb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRegion.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiRegion.h"
-#include "defiRegion.hpp"
-
-// Wrappers definitions.
-const char* defiRegion_name (const ::defiRegion* obj) {
-    return ((const LefDefParser::defiRegion*)obj)->name();
-}
-
-int defiRegion_numProps (const ::defiRegion* obj) {
-    return ((LefDefParser::defiRegion*)obj)->numProps();
-}
-
-const char* defiRegion_propName (const ::defiRegion* obj, int  index) {
-    return ((const LefDefParser::defiRegion*)obj)->propName(index);
-}
-
-const char* defiRegion_propValue (const ::defiRegion* obj, int  index) {
-    return ((const LefDefParser::defiRegion*)obj)->propValue(index);
-}
-
-double defiRegion_propNumber (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->propNumber(index);
-}
-
-const char defiRegion_propType (const ::defiRegion* obj, int  index) {
-    return ((const LefDefParser::defiRegion*)obj)->propType(index);
-}
-
-int defiRegion_propIsNumber (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->propIsNumber(index);
-}
-
-int defiRegion_propIsString (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->propIsString(index);
-}
-
-int defiRegion_hasType (const ::defiRegion* obj) {
-    return ((LefDefParser::defiRegion*)obj)->hasType();
-}
-
-const char* defiRegion_type (const ::defiRegion* obj) {
-    return ((const LefDefParser::defiRegion*)obj)->type();
-}
-
-int defiRegion_numRectangles (const ::defiRegion* obj) {
-    return ((LefDefParser::defiRegion*)obj)->numRectangles();
-}
-
-int defiRegion_xl (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->xl(index);
-}
-
-int defiRegion_yl (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->yl(index);
-}
-
-int defiRegion_xh (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->xh(index);
-}
-
-int defiRegion_yh (const ::defiRegion* obj, int  index) {
-    return ((LefDefParser::defiRegion*)obj)->yh(index);
-}
-
-void defiRegion_print (const ::defiRegion* obj, FILE*  f) {
-    ((LefDefParser::defiRegion*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRowTrack.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRowTrack.cpp
deleted file mode 100644
index 66506b3..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiRowTrack.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiRowTrack.h"
-#include "defiRowTrack.hpp"
-
-// Wrappers definitions.
-const char* defiRow_name (const ::defiRow* obj) {
-    return ((const LefDefParser::defiRow*)obj)->name();
-}
-
-const char* defiRow_macro (const ::defiRow* obj) {
-    return ((const LefDefParser::defiRow*)obj)->macro();
-}
-
-double defiRow_x (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->x();
-}
-
-double defiRow_y (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->y();
-}
-
-int defiRow_orient (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->orient();
-}
-
-const char* defiRow_orientStr (const ::defiRow* obj) {
-    return ((const LefDefParser::defiRow*)obj)->orientStr();
-}
-
-int defiRow_hasDo (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->hasDo();
-}
-
-double defiRow_xNum (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->xNum();
-}
-
-double defiRow_yNum (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->yNum();
-}
-
-int defiRow_hasDoStep (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->hasDoStep();
-}
-
-double defiRow_xStep (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->xStep();
-}
-
-double defiRow_yStep (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->yStep();
-}
-
-int defiRow_numProps (const ::defiRow* obj) {
-    return ((LefDefParser::defiRow*)obj)->numProps();
-}
-
-const char* defiRow_propName (const ::defiRow* obj, int  index) {
-    return ((const LefDefParser::defiRow*)obj)->propName(index);
-}
-
-const char* defiRow_propValue (const ::defiRow* obj, int  index) {
-    return ((const LefDefParser::defiRow*)obj)->propValue(index);
-}
-
-double defiRow_propNumber (const ::defiRow* obj, int  index) {
-    return ((LefDefParser::defiRow*)obj)->propNumber(index);
-}
-
-const char defiRow_propType (const ::defiRow* obj, int  index) {
-    return ((const LefDefParser::defiRow*)obj)->propType(index);
-}
-
-int defiRow_propIsNumber (const ::defiRow* obj, int  index) {
-    return ((LefDefParser::defiRow*)obj)->propIsNumber(index);
-}
-
-int defiRow_propIsString (const ::defiRow* obj, int  index) {
-    return ((LefDefParser::defiRow*)obj)->propIsString(index);
-}
-
-void defiRow_print (const ::defiRow* obj, FILE*  f) {
-    ((LefDefParser::defiRow*)obj)->print(f);
-}
-
-const char* defiTrack_macro (const ::defiTrack* obj) {
-    return ((const LefDefParser::defiTrack*)obj)->macro();
-}
-
-double defiTrack_x (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->x();
-}
-
-double defiTrack_xNum (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->xNum();
-}
-
-double defiTrack_xStep (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->xStep();
-}
-
-int defiTrack_numLayers (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->numLayers();
-}
-
-const char* defiTrack_layer (const ::defiTrack* obj, int  index) {
-    return ((const LefDefParser::defiTrack*)obj)->layer(index);
-}
-
-int defiTrack_firstTrackMask (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->firstTrackMask();
-}
-
-int defiTrack_sameMask (const ::defiTrack* obj) {
-    return ((LefDefParser::defiTrack*)obj)->sameMask();
-}
-
-void defiTrack_print (const ::defiTrack* obj, FILE*  f) {
-    ((LefDefParser::defiTrack*)obj)->print(f);
-}
-
-const char* defiGcellGrid_macro (const ::defiGcellGrid* obj) {
-    return ((const LefDefParser::defiGcellGrid*)obj)->macro();
-}
-
-int defiGcellGrid_x (const ::defiGcellGrid* obj) {
-    return ((LefDefParser::defiGcellGrid*)obj)->x();
-}
-
-int defiGcellGrid_xNum (const ::defiGcellGrid* obj) {
-    return ((LefDefParser::defiGcellGrid*)obj)->xNum();
-}
-
-double defiGcellGrid_xStep (const ::defiGcellGrid* obj) {
-    return ((LefDefParser::defiGcellGrid*)obj)->xStep();
-}
-
-void defiGcellGrid_print (const ::defiGcellGrid* obj, FILE*  f) {
-    ((LefDefParser::defiGcellGrid*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiScanchain.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiScanchain.cpp
deleted file mode 100644
index 53e360c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiScanchain.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiScanchain.h"
-#include "defiScanchain.hpp"
-
-// Wrappers definitions.
-int defiOrdered_num (const ::defiOrdered* obj) {
-    return ((LefDefParser::defiOrdered*)obj)->num();
-}
-
-char** defiOrdered_inst (const ::defiOrdered* obj) {
-    return ((LefDefParser::defiOrdered*)obj)->inst();
-}
-
-char** defiOrdered_in (const ::defiOrdered* obj) {
-    return ((LefDefParser::defiOrdered*)obj)->in();
-}
-
-char** defiOrdered_out (const ::defiOrdered* obj) {
-    return ((LefDefParser::defiOrdered*)obj)->out();
-}
-
-int* defiOrdered_bits (const ::defiOrdered* obj) {
-    return ((LefDefParser::defiOrdered*)obj)->bits();
-}
-
-const char* defiScanchain_name (const ::defiScanchain* obj) {
-    return ((const LefDefParser::defiScanchain*)obj)->name();
-}
-
-int defiScanchain_hasStart (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasStart();
-}
-
-int defiScanchain_hasStop (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasStop();
-}
-
-int defiScanchain_hasFloating (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasFloating();
-}
-
-int defiScanchain_hasOrdered (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasOrdered();
-}
-
-int defiScanchain_hasCommonInPin (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasCommonInPin();
-}
-
-int defiScanchain_hasCommonOutPin (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasCommonOutPin();
-}
-
-int defiScanchain_hasPartition (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasPartition();
-}
-
-int defiScanchain_hasPartitionMaxBits (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->hasPartitionMaxBits();
-}
-
-void defiScanchain_start (const ::defiScanchain* obj, char**  inst, char**  pin) {
-    ((LefDefParser::defiScanchain*)obj)->start(inst, pin);
-}
-
-void defiScanchain_stop (const ::defiScanchain* obj, char**  inst, char**  pin) {
-    ((LefDefParser::defiScanchain*)obj)->stop(inst, pin);
-}
-
-int defiScanchain_numOrderedLists (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->numOrderedLists();
-}
-
-void defiScanchain_ordered (const ::defiScanchain* obj, int  index, int*  size, char***  inst, char***  inPin, char***  outPin, int**  bits) {
-    ((LefDefParser::defiScanchain*)obj)->ordered(index, size, inst, inPin, outPin, bits);
-}
-
-void defiScanchain_floating (const ::defiScanchain* obj, int*  size, char***  inst, char***  inPin, char***  outPin, int**  bits) {
-    ((LefDefParser::defiScanchain*)obj)->floating(size, inst, inPin, outPin, bits);
-}
-
-const char* defiScanchain_commonInPin (const ::defiScanchain* obj) {
-    return ((const LefDefParser::defiScanchain*)obj)->commonInPin();
-}
-
-const char* defiScanchain_commonOutPin (const ::defiScanchain* obj) {
-    return ((const LefDefParser::defiScanchain*)obj)->commonOutPin();
-}
-
-const char* defiScanchain_partitionName (const ::defiScanchain* obj) {
-    return ((const LefDefParser::defiScanchain*)obj)->partitionName();
-}
-
-int defiScanchain_partitionMaxBits (const ::defiScanchain* obj) {
-    return ((LefDefParser::defiScanchain*)obj)->partitionMaxBits();
-}
-
-void defiScanchain_print (const ::defiScanchain* obj, FILE*  f) {
-    ((LefDefParser::defiScanchain*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSite.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSite.cpp
deleted file mode 100644
index d80664e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSite.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiSite.h"
-#include "defiSite.hpp"
-
-// Wrappers definitions.
-double defiSite_x_num (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->x_num();
-}
-
-double defiSite_y_num (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->y_num();
-}
-
-double defiSite_x_step (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->x_step();
-}
-
-double defiSite_y_step (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->y_step();
-}
-
-double defiSite_x_orig (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->x_orig();
-}
-
-double defiSite_y_orig (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->y_orig();
-}
-
-int defiSite_orient (const ::defiSite* obj) {
-    return ((LefDefParser::defiSite*)obj)->orient();
-}
-
-const char* defiSite_orientStr (const ::defiSite* obj) {
-    return ((const LefDefParser::defiSite*)obj)->orientStr();
-}
-
-const char* defiSite_name (const ::defiSite* obj) {
-    return ((const LefDefParser::defiSite*)obj)->name();
-}
-
-void defiSite_print (const ::defiSite* obj, FILE*  f) {
-    ((LefDefParser::defiSite*)obj)->print(f);
-}
-
-int defiBox_xl (const ::defiBox* obj) {
-    return ((LefDefParser::defiBox*)obj)->xl();
-}
-
-int defiBox_yl (const ::defiBox* obj) {
-    return ((LefDefParser::defiBox*)obj)->yl();
-}
-
-int defiBox_xh (const ::defiBox* obj) {
-    return ((LefDefParser::defiBox*)obj)->xh();
-}
-
-int defiBox_yh (const ::defiBox* obj) {
-    return ((LefDefParser::defiBox*)obj)->yh();
-}
-
-::defiPoints defiBox_getPoint (const ::defiBox* obj) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiBox*)obj)->getPoint();
-    return *((::defiPoints*)&tmp);
-}
-
-void defiBox_print (const ::defiBox* obj, FILE*  f) {
-    ((LefDefParser::defiBox*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSlot.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSlot.cpp
deleted file mode 100644
index e610b58..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiSlot.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiSlot.h"
-#include "defiSlot.hpp"
-
-// Wrappers definitions.
-int defiSlot_hasLayer (const ::defiSlot* obj) {
-    return ((LefDefParser::defiSlot*)obj)->hasLayer();
-}
-
-const char* defiSlot_layerName (const ::defiSlot* obj) {
-    return ((const LefDefParser::defiSlot*)obj)->layerName();
-}
-
-int defiSlot_numRectangles (const ::defiSlot* obj) {
-    return ((LefDefParser::defiSlot*)obj)->numRectangles();
-}
-
-int defiSlot_xl (const ::defiSlot* obj, int  index) {
-    return ((LefDefParser::defiSlot*)obj)->xl(index);
-}
-
-int defiSlot_yl (const ::defiSlot* obj, int  index) {
-    return ((LefDefParser::defiSlot*)obj)->yl(index);
-}
-
-int defiSlot_xh (const ::defiSlot* obj, int  index) {
-    return ((LefDefParser::defiSlot*)obj)->xh(index);
-}
-
-int defiSlot_yh (const ::defiSlot* obj, int  index) {
-    return ((LefDefParser::defiSlot*)obj)->yh(index);
-}
-
-int defiSlot_numPolygons (const ::defiSlot* obj) {
-    return ((LefDefParser::defiSlot*)obj)->numPolygons();
-}
-
-::defiPoints defiSlot_getPolygon (const ::defiSlot* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiSlot*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-void defiSlot_print (const ::defiSlot* obj, FILE*  f) {
-    ((LefDefParser::defiSlot*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiTimingDisable.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiTimingDisable.cpp
deleted file mode 100644
index ae1d0f8..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiTimingDisable.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiTimingDisable.h"
-#include "defiTimingDisable.hpp"
-
-// Wrappers definitions.
-int defiTimingDisable_hasMacroThru (const ::defiTimingDisable* obj) {
-    return ((LefDefParser::defiTimingDisable*)obj)->hasMacroThru();
-}
-
-int defiTimingDisable_hasMacroFromTo (const ::defiTimingDisable* obj) {
-    return ((LefDefParser::defiTimingDisable*)obj)->hasMacroFromTo();
-}
-
-int defiTimingDisable_hasThru (const ::defiTimingDisable* obj) {
-    return ((LefDefParser::defiTimingDisable*)obj)->hasThru();
-}
-
-int defiTimingDisable_hasFromTo (const ::defiTimingDisable* obj) {
-    return ((LefDefParser::defiTimingDisable*)obj)->hasFromTo();
-}
-
-int defiTimingDisable_hasReentrantPathsFlag (const ::defiTimingDisable* obj) {
-    return ((LefDefParser::defiTimingDisable*)obj)->hasReentrantPathsFlag();
-}
-
-const char* defiTimingDisable_fromPin (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->fromPin();
-}
-
-const char* defiTimingDisable_toPin (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->toPin();
-}
-
-const char* defiTimingDisable_fromInst (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->fromInst();
-}
-
-const char* defiTimingDisable_toInst (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->toInst();
-}
-
-const char* defiTimingDisable_macroName (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->macroName();
-}
-
-const char* defiTimingDisable_thruPin (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->thruPin();
-}
-
-const char* defiTimingDisable_thruInst (const ::defiTimingDisable* obj) {
-    return ((const LefDefParser::defiTimingDisable*)obj)->thruInst();
-}
-
-void defiTimingDisable_print (const ::defiTimingDisable* obj, FILE*  f) {
-    ((LefDefParser::defiTimingDisable*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiVia.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiVia.cpp
deleted file mode 100644
index bf8ebcb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefiVia.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defiVia.h"
-#include "defiVia.hpp"
-
-// Wrappers definitions.
-const char* defiVia_name (const ::defiVia* obj) {
-    return ((const LefDefParser::defiVia*)obj)->name();
-}
-
-const char* defiVia_pattern (const ::defiVia* obj) {
-    return ((const LefDefParser::defiVia*)obj)->pattern();
-}
-
-int defiVia_hasPattern (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasPattern();
-}
-
-int defiVia_numLayers (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->numLayers();
-}
-
-void defiVia_layer (const ::defiVia* obj, int  index, char**  layer, int*  xl, int*  yl, int*  xh, int*  yh) {
-    ((LefDefParser::defiVia*)obj)->layer(index, layer, xl, yl, xh, yh);
-}
-
-int defiVia_numPolygons (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->numPolygons();
-}
-
-const char* defiVia_polygonName (const ::defiVia* obj, int  index) {
-    return ((const LefDefParser::defiVia*)obj)->polygonName(index);
-}
-
-::defiPoints defiVia_getPolygon (const ::defiVia* obj, int  index) {
-    LefDefParser::defiPoints tmp;
-    tmp = ((LefDefParser::defiVia*)obj)->getPolygon(index);
-    return *((::defiPoints*)&tmp);
-}
-
-int defiVia_hasViaRule (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasViaRule();
-}
-
-void defiVia_viaRule (const ::defiVia* obj, char**  viaRuleName, int*  xSize, int*  ySize, char**  botLayer, char**  cutLayer, char**  topLayer, int*  xCutSpacing, int*  yCutSpacing, int*  xBotEnc, int*  yBotEnc, int*  xTopEnc, int*  yTopEnc) {
-    ((LefDefParser::defiVia*)obj)->viaRule(viaRuleName, xSize, ySize, botLayer, cutLayer, topLayer, xCutSpacing, yCutSpacing, xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-}
-
-int defiVia_hasRowCol (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasRowCol();
-}
-
-void defiVia_rowCol (const ::defiVia* obj, int*  numCutRows, int*  numCutCols) {
-    ((LefDefParser::defiVia*)obj)->rowCol(numCutRows, numCutCols);
-}
-
-int defiVia_hasOrigin (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasOrigin();
-}
-
-void defiVia_origin (const ::defiVia* obj, int*  xOffset, int*  yOffset) {
-    ((LefDefParser::defiVia*)obj)->origin(xOffset, yOffset);
-}
-
-int defiVia_hasOffset (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasOffset();
-}
-
-void defiVia_offset (const ::defiVia* obj, int*  xBotOffset, int*  yBotOffset, int*  xTopOffset, int*  yTopOffset) {
-    ((LefDefParser::defiVia*)obj)->offset(xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-}
-
-int defiVia_hasCutPattern (const ::defiVia* obj) {
-    return ((LefDefParser::defiVia*)obj)->hasCutPattern();
-}
-
-const char* defiVia_cutPattern (const ::defiVia* obj) {
-    return ((const LefDefParser::defiVia*)obj)->cutPattern();
-}
-
-int defiVia_hasRectMask (const ::defiVia* obj, int  index) {
-    return ((LefDefParser::defiVia*)obj)->hasRectMask(index);
-}
-
-int defiVia_rectMask (const ::defiVia* obj, int  index) {
-    return ((LefDefParser::defiVia*)obj)->rectMask(index);
-}
-
-int defiVia_hasPolyMask (const ::defiVia* obj, int  index) {
-    return ((LefDefParser::defiVia*)obj)->hasPolyMask(index);
-}
-
-int defiVia_polyMask (const ::defiVia* obj, int  index) {
-    return ((LefDefParser::defiVia*)obj)->polyMask(index);
-}
-
-void defiVia_print (const ::defiVia* obj, FILE*  f) {
-    ((LefDefParser::defiVia*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefrReader.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefrReader.cpp
deleted file mode 100644
index fa1faaa..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefrReader.cpp
+++ /dev/null
@@ -1,1119 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defrReader.h"
-#include "defrReader.hpp"
-
-// Wrappers definitions.
-int defrInit () {
-    return LefDefParser::defrInit();
-}
-
-int defrInitSession (int  startSession) {
-    return LefDefParser::defrInitSession(startSession);
-}
-
-int defrReset () {
-    return LefDefParser::defrReset();
-}
-
-int defrClear () {
-    return LefDefParser::defrClear();
-}
-
-void defrSetCommentChar (char  c) {
-    LefDefParser::defrSetCommentChar(c);
-}
-
-void defrSetAddPathToNet () {
-    LefDefParser::defrSetAddPathToNet();
-}
-
-void defrSetAllowComponentNets () {
-    LefDefParser::defrSetAllowComponentNets();
-}
-
-int defrGetAllowComponentNets () {
-    return LefDefParser::defrGetAllowComponentNets();
-}
-
-void defrSetCaseSensitivity (int  caseSense) {
-    LefDefParser::defrSetCaseSensitivity(caseSense);
-}
-
-void defrSetRegisterUnusedCallbacks () {
-    LefDefParser::defrSetRegisterUnusedCallbacks();
-}
-
-void defrPrintUnusedCallbacks (FILE*  log) {
-    LefDefParser::defrPrintUnusedCallbacks(log);
-}
-
-int  defrReleaseNResetMemory () {
-    return LefDefParser::defrReleaseNResetMemory();
-}
-
-int defrRead (FILE * file, const char * fileName, defiUserData  userData, int  case_sensitive) {
-    return LefDefParser::defrRead(file, fileName, userData, case_sensitive);
-}
-
-void defrSetUserData (defiUserData p0) {
-    LefDefParser::defrSetUserData(p0);
-}
-
-defiUserData defrGetUserData () {
-    return LefDefParser::defrGetUserData();
-}
-
-void defrSetArrayNameCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetArrayNameCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetAssertionCbk (::defrAssertionCbkFnType p0) {
-    LefDefParser::defrSetAssertionCbk((LefDefParser::defrAssertionCbkFnType) p0);
-}
-
-void defrSetAssertionsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetAssertionsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetAssertionsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetAssertionsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetBlockageCbk (::defrBlockageCbkFnType p0) {
-    LefDefParser::defrSetBlockageCbk((LefDefParser::defrBlockageCbkFnType) p0);
-}
-
-void defrSetBlockageStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetBlockageStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetBlockageEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetBlockageEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetBusBitCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetBusBitCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetCannotOccupyCbk (::defrSiteCbkFnType p0) {
-    LefDefParser::defrSetCannotOccupyCbk((LefDefParser::defrSiteCbkFnType) p0);
-}
-
-void defrSetCanplaceCbk (::defrSiteCbkFnType p0) {
-    LefDefParser::defrSetCanplaceCbk((LefDefParser::defrSiteCbkFnType) p0);
-}
-
-void defrSetCaseSensitiveCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetCaseSensitiveCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetComponentCbk (::defrComponentCbkFnType p0) {
-    LefDefParser::defrSetComponentCbk((LefDefParser::defrComponentCbkFnType) p0);
-}
-
-void defrSetComponentExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetComponentExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetComponentStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetComponentStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetComponentEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetComponentEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetConstraintCbk (::defrAssertionCbkFnType p0) {
-    LefDefParser::defrSetConstraintCbk((LefDefParser::defrAssertionCbkFnType) p0);
-}
-
-void defrSetConstraintsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetConstraintsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetConstraintsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetConstraintsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetDefaultCapCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetDefaultCapCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetDesignCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetDesignCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetDesignEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetDesignEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetDieAreaCbk (::defrBoxCbkFnType p0) {
-    LefDefParser::defrSetDieAreaCbk((LefDefParser::defrBoxCbkFnType) p0);
-}
-
-void defrSetDividerCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetDividerCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetExtensionCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetExtensionCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetFillCbk (::defrFillCbkFnType p0) {
-    LefDefParser::defrSetFillCbk((LefDefParser::defrFillCbkFnType) p0);
-}
-
-void defrSetFillStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetFillStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetFillEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetFillEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetFPCCbk (::defrFPCCbkFnType p0) {
-    LefDefParser::defrSetFPCCbk((LefDefParser::defrFPCCbkFnType) p0);
-}
-
-void defrSetFPCStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetFPCStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetFPCEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetFPCEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetFloorPlanNameCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetFloorPlanNameCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetGcellGridCbk (::defrGcellGridCbkFnType p0) {
-    LefDefParser::defrSetGcellGridCbk((LefDefParser::defrGcellGridCbkFnType) p0);
-}
-
-void defrSetGroupNameCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetGroupNameCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetGroupMemberCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetGroupMemberCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetComponentMaskShiftLayerCbk (::defrComponentMaskShiftLayerCbkFnType p0) {
-    LefDefParser::defrSetComponentMaskShiftLayerCbk((LefDefParser::defrComponentMaskShiftLayerCbkFnType) p0);
-}
-
-void defrSetGroupCbk (::defrGroupCbkFnType p0) {
-    LefDefParser::defrSetGroupCbk((LefDefParser::defrGroupCbkFnType) p0);
-}
-
-void defrSetGroupExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetGroupExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetGroupsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetGroupsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetGroupsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetGroupsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetHistoryCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetHistoryCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetIOTimingCbk (::defrIOTimingCbkFnType p0) {
-    LefDefParser::defrSetIOTimingCbk((LefDefParser::defrIOTimingCbkFnType) p0);
-}
-
-void defrSetIOTimingsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetIOTimingsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetIOTimingsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetIOTimingsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetIoTimingsExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetIoTimingsExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetCbk (::defrNetCbkFnType p0) {
-    LefDefParser::defrSetNetCbk((LefDefParser::defrNetCbkFnType) p0);
-}
-
-void defrSetNetNameCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetNetNameCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetNonDefaultRuleCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetNetNonDefaultRuleCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetConnectionExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetNetConnectionExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetNetExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetPartialPathCbk (::defrNetCbkFnType p0) {
-    LefDefParser::defrSetNetPartialPathCbk((LefDefParser::defrNetCbkFnType) p0);
-}
-
-void defrSetNetSubnetNameCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetNetSubnetNameCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetNetStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetNetStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetNetEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetNetEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetNonDefaultCbk (::defrNonDefaultCbkFnType p0) {
-    LefDefParser::defrSetNonDefaultCbk((LefDefParser::defrNonDefaultCbkFnType) p0);
-}
-
-void defrSetNonDefaultStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetNonDefaultStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetNonDefaultEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetNonDefaultEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetPartitionCbk (::defrPartitionCbkFnType p0) {
-    LefDefParser::defrSetPartitionCbk((LefDefParser::defrPartitionCbkFnType) p0);
-}
-
-void defrSetPartitionsExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetPartitionsExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetPartitionsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetPartitionsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetPartitionsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetPartitionsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetPathCbk (::defrPathCbkFnType p0) {
-    LefDefParser::defrSetPathCbk((LefDefParser::defrPathCbkFnType) p0);
-}
-
-void defrSetPinCapCbk (::defrPinCapCbkFnType p0) {
-    LefDefParser::defrSetPinCapCbk((LefDefParser::defrPinCapCbkFnType) p0);
-}
-
-void defrSetPinCbk (::defrPinCbkFnType p0) {
-    LefDefParser::defrSetPinCbk((LefDefParser::defrPinCbkFnType) p0);
-}
-
-void defrSetPinExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetPinExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetPinPropCbk (::defrPinPropCbkFnType p0) {
-    LefDefParser::defrSetPinPropCbk((LefDefParser::defrPinPropCbkFnType) p0);
-}
-
-void defrSetPinPropStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetPinPropStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetPinPropEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetPinPropEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetPropCbk (::defrPropCbkFnType p0) {
-    LefDefParser::defrSetPropCbk((LefDefParser::defrPropCbkFnType) p0);
-}
-
-void defrSetPropDefEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetPropDefEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetPropDefStartCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetPropDefStartCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetRegionCbk (::defrRegionCbkFnType p0) {
-    LefDefParser::defrSetRegionCbk((LefDefParser::defrRegionCbkFnType) p0);
-}
-
-void defrSetRegionStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetRegionStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetRegionEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetRegionEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetRowCbk (::defrRowCbkFnType p0) {
-    LefDefParser::defrSetRowCbk((LefDefParser::defrRowCbkFnType) p0);
-}
-
-void defrSetSNetCbk (::defrNetCbkFnType p0) {
-    LefDefParser::defrSetSNetCbk((LefDefParser::defrNetCbkFnType) p0);
-}
-
-void defrSetSNetStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetSNetStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetSNetEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetSNetEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetSNetPartialPathCbk (::defrNetCbkFnType p0) {
-    LefDefParser::defrSetSNetPartialPathCbk((LefDefParser::defrNetCbkFnType) p0);
-}
-
-void defrSetSNetWireCbk (::defrNetCbkFnType p0) {
-    LefDefParser::defrSetSNetWireCbk((LefDefParser::defrNetCbkFnType) p0);
-}
-
-void defrSetScanChainExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetScanChainExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetScanchainCbk (::defrScanchainCbkFnType p0) {
-    LefDefParser::defrSetScanchainCbk((LefDefParser::defrScanchainCbkFnType) p0);
-}
-
-void defrSetScanchainsStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetScanchainsStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetScanchainsEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetScanchainsEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetSiteCbk (::defrSiteCbkFnType p0) {
-    LefDefParser::defrSetSiteCbk((LefDefParser::defrSiteCbkFnType) p0);
-}
-
-void defrSetSlotCbk (::defrSlotCbkFnType p0) {
-    LefDefParser::defrSetSlotCbk((LefDefParser::defrSlotCbkFnType) p0);
-}
-
-void defrSetSlotStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetSlotStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetSlotEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetSlotEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetStartPinsCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetStartPinsCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetStylesCbk (::defrStylesCbkFnType p0) {
-    LefDefParser::defrSetStylesCbk((LefDefParser::defrStylesCbkFnType) p0);
-}
-
-void defrSetStylesStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetStylesStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetStylesEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetStylesEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetPinEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetPinEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetTechnologyCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetTechnologyCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetTimingDisableCbk (::defrTimingDisableCbkFnType p0) {
-    LefDefParser::defrSetTimingDisableCbk((LefDefParser::defrTimingDisableCbkFnType) p0);
-}
-
-void defrSetTimingDisablesStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetTimingDisablesStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetTimingDisablesEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetTimingDisablesEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrSetTrackCbk (::defrTrackCbkFnType p0) {
-    LefDefParser::defrSetTrackCbk((LefDefParser::defrTrackCbkFnType) p0);
-}
-
-void defrSetUnitsCbk (::defrDoubleCbkFnType p0) {
-    LefDefParser::defrSetUnitsCbk((LefDefParser::defrDoubleCbkFnType) p0);
-}
-
-void defrSetVersionCbk (::defrDoubleCbkFnType p0) {
-    LefDefParser::defrSetVersionCbk((LefDefParser::defrDoubleCbkFnType) p0);
-}
-
-void defrSetVersionStrCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetVersionStrCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetViaCbk (::defrViaCbkFnType p0) {
-    LefDefParser::defrSetViaCbk((LefDefParser::defrViaCbkFnType) p0);
-}
-
-void defrSetViaExtCbk (::defrStringCbkFnType p0) {
-    LefDefParser::defrSetViaExtCbk((LefDefParser::defrStringCbkFnType) p0);
-}
-
-void defrSetViaStartCbk (::defrIntegerCbkFnType p0) {
-    LefDefParser::defrSetViaStartCbk((LefDefParser::defrIntegerCbkFnType) p0);
-}
-
-void defrSetViaEndCbk (::defrVoidCbkFnType p0) {
-    LefDefParser::defrSetViaEndCbk((LefDefParser::defrVoidCbkFnType) p0);
-}
-
-void defrUnsetCallbacks () {
-    LefDefParser::defrUnsetCallbacks();
-}
-
-void defrUnsetArrayNameCbk () {
-    LefDefParser::defrUnsetArrayNameCbk();
-}
-
-void defrUnsetAssertionCbk () {
-    LefDefParser::defrUnsetAssertionCbk();
-}
-
-void defrUnsetAssertionsStartCbk () {
-    LefDefParser::defrUnsetAssertionsStartCbk();
-}
-
-void defrUnsetAssertionsEndCbk () {
-    LefDefParser::defrUnsetAssertionsEndCbk();
-}
-
-void defrUnsetBlockageCbk () {
-    LefDefParser::defrUnsetBlockageCbk();
-}
-
-void defrUnsetBlockageStartCbk () {
-    LefDefParser::defrUnsetBlockageStartCbk();
-}
-
-void defrUnsetBlockageEndCbk () {
-    LefDefParser::defrUnsetBlockageEndCbk();
-}
-
-void defrUnsetBusBitCbk () {
-    LefDefParser::defrUnsetBusBitCbk();
-}
-
-void defrUnsetCannotOccupyCbk () {
-    LefDefParser::defrUnsetCannotOccupyCbk();
-}
-
-void defrUnsetCanplaceCbk () {
-    LefDefParser::defrUnsetCanplaceCbk();
-}
-
-void defrUnsetCaseSensitiveCbk () {
-    LefDefParser::defrUnsetCaseSensitiveCbk();
-}
-
-void defrUnsetComponentCbk () {
-    LefDefParser::defrUnsetComponentCbk();
-}
-
-void defrUnsetComponentExtCbk () {
-    LefDefParser::defrUnsetComponentExtCbk();
-}
-
-void defrUnsetComponentStartCbk () {
-    LefDefParser::defrUnsetComponentStartCbk();
-}
-
-void defrUnsetComponentEndCbk () {
-    LefDefParser::defrUnsetComponentEndCbk();
-}
-
-void defrUnsetConstraintCbk () {
-    LefDefParser::defrUnsetConstraintCbk();
-}
-
-void defrUnsetConstraintsStartCbk () {
-    LefDefParser::defrUnsetConstraintsStartCbk();
-}
-
-void defrUnsetConstraintsEndCbk () {
-    LefDefParser::defrUnsetConstraintsEndCbk();
-}
-
-void defrUnsetDefaultCapCbk () {
-    LefDefParser::defrUnsetDefaultCapCbk();
-}
-
-void defrUnsetDesignCbk () {
-    LefDefParser::defrUnsetDesignCbk();
-}
-
-void defrUnsetDesignEndCbk () {
-    LefDefParser::defrUnsetDesignEndCbk();
-}
-
-void defrUnsetDieAreaCbk () {
-    LefDefParser::defrUnsetDieAreaCbk();
-}
-
-void defrUnsetDividerCbk () {
-    LefDefParser::defrUnsetDividerCbk();
-}
-
-void defrUnsetExtensionCbk () {
-    LefDefParser::defrUnsetExtensionCbk();
-}
-
-void defrUnsetFillCbk () {
-    LefDefParser::defrUnsetFillCbk();
-}
-
-void defrUnsetFillStartCbk () {
-    LefDefParser::defrUnsetFillStartCbk();
-}
-
-void defrUnsetFillEndCbk () {
-    LefDefParser::defrUnsetFillEndCbk();
-}
-
-void defrUnsetFPCCbk () {
-    LefDefParser::defrUnsetFPCCbk();
-}
-
-void defrUnsetFPCStartCbk () {
-    LefDefParser::defrUnsetFPCStartCbk();
-}
-
-void defrUnsetFPCEndCbk () {
-    LefDefParser::defrUnsetFPCEndCbk();
-}
-
-void defrUnsetFloorPlanNameCbk () {
-    LefDefParser::defrUnsetFloorPlanNameCbk();
-}
-
-void defrUnsetGcellGridCbk () {
-    LefDefParser::defrUnsetGcellGridCbk();
-}
-
-void defrUnsetGroupCbk () {
-    LefDefParser::defrUnsetGroupCbk();
-}
-
-void defrUnsetGroupExtCbk () {
-    LefDefParser::defrUnsetGroupExtCbk();
-}
-
-void defrUnsetGroupMemberCbk () {
-    LefDefParser::defrUnsetGroupMemberCbk();
-}
-
-void defrUnsetComponentMaskShiftLayerCbk () {
-    LefDefParser::defrUnsetComponentMaskShiftLayerCbk();
-}
-
-void defrUnsetGroupNameCbk () {
-    LefDefParser::defrUnsetGroupNameCbk();
-}
-
-void defrUnsetGroupsStartCbk () {
-    LefDefParser::defrUnsetGroupsStartCbk();
-}
-
-void defrUnsetGroupsEndCbk () {
-    LefDefParser::defrUnsetGroupsEndCbk();
-}
-
-void defrUnsetHistoryCbk () {
-    LefDefParser::defrUnsetHistoryCbk();
-}
-
-void defrUnsetIOTimingCbk () {
-    LefDefParser::defrUnsetIOTimingCbk();
-}
-
-void defrUnsetIOTimingsStartCbk () {
-    LefDefParser::defrUnsetIOTimingsStartCbk();
-}
-
-void defrUnsetIOTimingsEndCbk () {
-    LefDefParser::defrUnsetIOTimingsEndCbk();
-}
-
-void defrUnsetIOTimingsExtCbk () {
-    LefDefParser::defrUnsetIOTimingsExtCbk();
-}
-
-void defrUnsetNetCbk () {
-    LefDefParser::defrUnsetNetCbk();
-}
-
-void defrUnsetNetNameCbk () {
-    LefDefParser::defrUnsetNetNameCbk();
-}
-
-void defrUnsetNetNonDefaultRuleCbk () {
-    LefDefParser::defrUnsetNetNonDefaultRuleCbk();
-}
-
-void defrUnsetNetConnectionExtCbk () {
-    LefDefParser::defrUnsetNetConnectionExtCbk();
-}
-
-void defrUnsetNetExtCbk () {
-    LefDefParser::defrUnsetNetExtCbk();
-}
-
-void defrUnsetNetPartialPathCbk () {
-    LefDefParser::defrUnsetNetPartialPathCbk();
-}
-
-void defrUnsetNetSubnetNameCbk () {
-    LefDefParser::defrUnsetNetSubnetNameCbk();
-}
-
-void defrUnsetNetStartCbk () {
-    LefDefParser::defrUnsetNetStartCbk();
-}
-
-void defrUnsetNetEndCbk () {
-    LefDefParser::defrUnsetNetEndCbk();
-}
-
-void defrUnsetNonDefaultCbk () {
-    LefDefParser::defrUnsetNonDefaultCbk();
-}
-
-void defrUnsetNonDefaultStartCbk () {
-    LefDefParser::defrUnsetNonDefaultStartCbk();
-}
-
-void defrUnsetNonDefaultEndCbk () {
-    LefDefParser::defrUnsetNonDefaultEndCbk();
-}
-
-void defrUnsetPartitionCbk () {
-    LefDefParser::defrUnsetPartitionCbk();
-}
-
-void defrUnsetPartitionsExtCbk () {
-    LefDefParser::defrUnsetPartitionsExtCbk();
-}
-
-void defrUnsetPartitionsStartCbk () {
-    LefDefParser::defrUnsetPartitionsStartCbk();
-}
-
-void defrUnsetPartitionsEndCbk () {
-    LefDefParser::defrUnsetPartitionsEndCbk();
-}
-
-void defrUnsetPathCbk () {
-    LefDefParser::defrUnsetPathCbk();
-}
-
-void defrUnsetPinCapCbk () {
-    LefDefParser::defrUnsetPinCapCbk();
-}
-
-void defrUnsetPinCbk () {
-    LefDefParser::defrUnsetPinCbk();
-}
-
-void defrUnsetPinEndCbk () {
-    LefDefParser::defrUnsetPinEndCbk();
-}
-
-void defrUnsetPinExtCbk () {
-    LefDefParser::defrUnsetPinExtCbk();
-}
-
-void defrUnsetPinPropCbk () {
-    LefDefParser::defrUnsetPinPropCbk();
-}
-
-void defrUnsetPinPropStartCbk () {
-    LefDefParser::defrUnsetPinPropStartCbk();
-}
-
-void defrUnsetPinPropEndCbk () {
-    LefDefParser::defrUnsetPinPropEndCbk();
-}
-
-void defrUnsetPropCbk () {
-    LefDefParser::defrUnsetPropCbk();
-}
-
-void defrUnsetPropDefEndCbk () {
-    LefDefParser::defrUnsetPropDefEndCbk();
-}
-
-void defrUnsetPropDefStartCbk () {
-    LefDefParser::defrUnsetPropDefStartCbk();
-}
-
-void defrUnsetRegionCbk () {
-    LefDefParser::defrUnsetRegionCbk();
-}
-
-void defrUnsetRegionStartCbk () {
-    LefDefParser::defrUnsetRegionStartCbk();
-}
-
-void defrUnsetRegionEndCbk () {
-    LefDefParser::defrUnsetRegionEndCbk();
-}
-
-void defrUnsetRowCbk () {
-    LefDefParser::defrUnsetRowCbk();
-}
-
-void defrUnsetScanChainExtCbk () {
-    LefDefParser::defrUnsetScanChainExtCbk();
-}
-
-void defrUnsetScanchainCbk () {
-    LefDefParser::defrUnsetScanchainCbk();
-}
-
-void defrUnsetScanchainsStartCbk () {
-    LefDefParser::defrUnsetScanchainsStartCbk();
-}
-
-void defrUnsetScanchainsEndCbk () {
-    LefDefParser::defrUnsetScanchainsEndCbk();
-}
-
-void defrUnsetSiteCbk () {
-    LefDefParser::defrUnsetSiteCbk();
-}
-
-void defrUnsetSlotCbk () {
-    LefDefParser::defrUnsetSlotCbk();
-}
-
-void defrUnsetSlotStartCbk () {
-    LefDefParser::defrUnsetSlotStartCbk();
-}
-
-void defrUnsetSlotEndCbk () {
-    LefDefParser::defrUnsetSlotEndCbk();
-}
-
-void defrUnsetSNetWireCbk () {
-    LefDefParser::defrUnsetSNetWireCbk();
-}
-
-void defrUnsetSNetCbk () {
-    LefDefParser::defrUnsetSNetCbk();
-}
-
-void defrUnsetSNetStartCbk () {
-    LefDefParser::defrUnsetSNetStartCbk();
-}
-
-void defrUnsetSNetEndCbk () {
-    LefDefParser::defrUnsetSNetEndCbk();
-}
-
-void defrUnsetSNetPartialPathCbk () {
-    LefDefParser::defrUnsetSNetPartialPathCbk();
-}
-
-void defrUnsetStartPinsCbk () {
-    LefDefParser::defrUnsetStartPinsCbk();
-}
-
-void defrUnsetStylesCbk () {
-    LefDefParser::defrUnsetStylesCbk();
-}
-
-void defrUnsetStylesStartCbk () {
-    LefDefParser::defrUnsetStylesStartCbk();
-}
-
-void defrUnsetStylesEndCbk () {
-    LefDefParser::defrUnsetStylesEndCbk();
-}
-
-void defrUnsetTechnologyCbk () {
-    LefDefParser::defrUnsetTechnologyCbk();
-}
-
-void defrUnsetTimingDisableCbk () {
-    LefDefParser::defrUnsetTimingDisableCbk();
-}
-
-void defrUnsetTimingDisablesStartCbk () {
-    LefDefParser::defrUnsetTimingDisablesStartCbk();
-}
-
-void defrUnsetTimingDisablesEndCbk () {
-    LefDefParser::defrUnsetTimingDisablesEndCbk();
-}
-
-void defrUnsetTrackCbk () {
-    LefDefParser::defrUnsetTrackCbk();
-}
-
-void defrUnsetUnitsCbk () {
-    LefDefParser::defrUnsetUnitsCbk();
-}
-
-void defrUnsetVersionCbk () {
-    LefDefParser::defrUnsetVersionCbk();
-}
-
-void defrUnsetVersionStrCbk () {
-    LefDefParser::defrUnsetVersionStrCbk();
-}
-
-void defrUnsetViaCbk () {
-    LefDefParser::defrUnsetViaCbk();
-}
-
-void defrUnsetViaExtCbk () {
-    LefDefParser::defrUnsetViaExtCbk();
-}
-
-void defrUnsetViaStartCbk () {
-    LefDefParser::defrUnsetViaStartCbk();
-}
-
-void defrUnsetViaEndCbk () {
-    LefDefParser::defrUnsetViaEndCbk();
-}
-
-void defrSetUnusedCallbacks (::defrVoidCbkFnType  func) {
-    LefDefParser::defrSetUnusedCallbacks((LefDefParser::defrVoidCbkFnType ) func);
-}
-
-int defrLineNumber () {
-    return LefDefParser::defrLineNumber();
-}
-
-long long defrLongLineNumber () {
-    return LefDefParser::defrLongLineNumber();
-}
-
-void defrSetLogFunction (::DEFI_LOG_FUNCTION p0) {
-    LefDefParser::defrSetLogFunction(p0);
-}
-
-void defrSetWarningLogFunction (::DEFI_WARNING_LOG_FUNCTION p0) {
-    LefDefParser::defrSetWarningLogFunction(p0);
-}
-
-void defrSetMallocFunction (::DEFI_MALLOC_FUNCTION p0) {
-    LefDefParser::defrSetMallocFunction(p0);
-}
-
-void defrSetReallocFunction (::DEFI_REALLOC_FUNCTION p0) {
-    LefDefParser::defrSetReallocFunction(p0);
-}
-
-void defrSetFreeFunction (::DEFI_FREE_FUNCTION p0) {
-    LefDefParser::defrSetFreeFunction(p0);
-}
-
-void defrSetLineNumberFunction (::DEFI_LINE_NUMBER_FUNCTION p0) {
-    LefDefParser::defrSetLineNumberFunction(p0);
-}
-
-void defrSetLongLineNumberFunction (::DEFI_LONG_LINE_NUMBER_FUNCTION p0) {
-    LefDefParser::defrSetLongLineNumberFunction(p0);
-}
-
-void defrSetDeltaNumberLines (int p0) {
-    LefDefParser::defrSetDeltaNumberLines(p0);
-}
-
-void defrSetReadFunction (::DEFI_READ_FUNCTION p0) {
-    LefDefParser::defrSetReadFunction(p0);
-}
-
-void defrUnsetReadFunction () {
-    LefDefParser::defrUnsetReadFunction();
-}
-
-void defrSetOpenLogFileAppend () {
-    LefDefParser::defrSetOpenLogFileAppend();
-}
-
-void defrUnsetOpenLogFileAppend () {
-    LefDefParser::defrUnsetOpenLogFileAppend();
-}
-
-void defrSetMagicCommentFoundFunction (::DEFI_MAGIC_COMMENT_FOUND_FUNCTION p0) {
-    LefDefParser::defrSetMagicCommentFoundFunction(p0);
-}
-
-void defrSetMagicCommentString (char * p0) {
-    LefDefParser::defrSetMagicCommentString(p0);
-}
-
-void defrDisablePropStrProcess () {
-    LefDefParser::defrDisablePropStrProcess();
-}
-
-void defrSetNLines (long long  n) {
-    LefDefParser::defrSetNLines(n);
-}
-
-void defrSetAssertionWarnings (int  warn) {
-    LefDefParser::defrSetAssertionWarnings(warn);
-}
-
-void defrSetBlockageWarnings (int  warn) {
-    LefDefParser::defrSetBlockageWarnings(warn);
-}
-
-void defrSetCaseSensitiveWarnings (int  warn) {
-    LefDefParser::defrSetCaseSensitiveWarnings(warn);
-}
-
-void defrSetComponentWarnings (int  warn) {
-    LefDefParser::defrSetComponentWarnings(warn);
-}
-
-void defrSetConstraintWarnings (int  warn) {
-    LefDefParser::defrSetConstraintWarnings(warn);
-}
-
-void defrSetDefaultCapWarnings (int  warn) {
-    LefDefParser::defrSetDefaultCapWarnings(warn);
-}
-
-void defrSetGcellGridWarnings (int  warn) {
-    LefDefParser::defrSetGcellGridWarnings(warn);
-}
-
-void defrSetIOTimingWarnings (int  warn) {
-    LefDefParser::defrSetIOTimingWarnings(warn);
-}
-
-void defrSetNetWarnings (int  warn) {
-    LefDefParser::defrSetNetWarnings(warn);
-}
-
-void defrSetNonDefaultWarnings (int  warn) {
-    LefDefParser::defrSetNonDefaultWarnings(warn);
-}
-
-void defrSetPinExtWarnings (int  warn) {
-    LefDefParser::defrSetPinExtWarnings(warn);
-}
-
-void defrSetPinWarnings (int  warn) {
-    LefDefParser::defrSetPinWarnings(warn);
-}
-
-void defrSetRegionWarnings (int  warn) {
-    LefDefParser::defrSetRegionWarnings(warn);
-}
-
-void defrSetRowWarnings (int  warn) {
-    LefDefParser::defrSetRowWarnings(warn);
-}
-
-void defrSetScanchainWarnings (int  warn) {
-    LefDefParser::defrSetScanchainWarnings(warn);
-}
-
-void defrSetSNetWarnings (int  warn) {
-    LefDefParser::defrSetSNetWarnings(warn);
-}
-
-void defrSetStylesWarnings (int  warn) {
-    LefDefParser::defrSetStylesWarnings(warn);
-}
-
-void defrSetTrackWarnings (int  warn) {
-    LefDefParser::defrSetTrackWarnings(warn);
-}
-
-void defrSetUnitsWarnings (int  warn) {
-    LefDefParser::defrSetUnitsWarnings(warn);
-}
-
-void defrSetVersionWarnings (int  warn) {
-    LefDefParser::defrSetVersionWarnings(warn);
-}
-
-void defrSetViaWarnings (int  warn) {
-    LefDefParser::defrSetViaWarnings(warn);
-}
-
-void defrDisableParserMsgs (int  nMsg, int*  msgs) {
-    LefDefParser::defrDisableParserMsgs(nMsg, msgs);
-}
-
-void defrEnableParserMsgs (int  nMsg, int*  msgs) {
-    LefDefParser::defrEnableParserMsgs(nMsg, msgs);
-}
-
-void defrEnableAllMsgs () {
-    LefDefParser::defrEnableAllMsgs();
-}
-
-void defrSetTotalMsgLimit (int  totNumMsgs) {
-    LefDefParser::defrSetTotalMsgLimit(totNumMsgs);
-}
-
-void defrSetLimitPerMsg (int  msgId, int  numMsg) {
-    LefDefParser::defrSetLimitPerMsg(msgId, numMsg);
-}
-
-void defrAddAlias (const char*  key, const char*  value, int  marked) {
-    LefDefParser::defrAddAlias(key, value, marked);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriter.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriter.cpp
deleted file mode 100644
index c736a7e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriter.cpp
+++ /dev/null
@@ -1,1115 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defwWriter.h"
-#include "defwWriter.hpp"
-
-// Wrappers definitions.
-int defwNewLine () {
-    return LefDefParser::defwNewLine();
-}
-
-int defwInit (FILE*  f, int  vers1, int  version2, const char*  caseSensitive, const char*  dividerChar, const char*  busBitChars, const char*  designName, const char*  technology, const char*  array, const char*  floorplan, double  units) {
-    return LefDefParser::defwInit(f, vers1, version2, caseSensitive, dividerChar, busBitChars, designName, technology, array, floorplan, units);
-}
-
-int defwInitCbk (FILE*  f) {
-    return LefDefParser::defwInitCbk(f);
-}
-
-int defwVersion (int  vers1, int  vers2) {
-    return LefDefParser::defwVersion(vers1, vers2);
-}
-
-int defwCaseSensitive (const char*  caseSensitive) {
-    return LefDefParser::defwCaseSensitive(caseSensitive);
-}
-
-int defwBusBitChars (const char*  busBitChars) {
-    return LefDefParser::defwBusBitChars(busBitChars);
-}
-
-int defwDividerChar (const char*  dividerChar) {
-    return LefDefParser::defwDividerChar(dividerChar);
-}
-
-int defwDesignName (const char*  name) {
-    return LefDefParser::defwDesignName(name);
-}
-
-int defwTechnology (const char*  technology) {
-    return LefDefParser::defwTechnology(technology);
-}
-
-int defwArray (const char*  array) {
-    return LefDefParser::defwArray(array);
-}
-
-int defwFloorplan (const char*  floorplan) {
-    return LefDefParser::defwFloorplan(floorplan);
-}
-
-int defwUnits (int  units) {
-    return LefDefParser::defwUnits(units);
-}
-
-int defwHistory (const char*  string) {
-    return LefDefParser::defwHistory(string);
-}
-
-int defwStartPropDef () {
-    return LefDefParser::defwStartPropDef();
-}
-
-int defwIntPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, int     propValue) {
-    return LefDefParser::defwIntPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int defwRealPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, double  propValue) {
-    return LefDefParser::defwRealPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int defwStringPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, const char*  propValue) {
-    return LefDefParser::defwStringPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int defwEndPropDef () {
-    return LefDefParser::defwEndPropDef();
-}
-
-int defwStringProperty (const char*  propName, const char*  propValue) {
-    return LefDefParser::defwStringProperty(propName, propValue);
-}
-
-int defwRealProperty (const char*  propName, double  propValue) {
-    return LefDefParser::defwRealProperty(propName, propValue);
-}
-
-int defwIntProperty (const char*  propName, int  propValue) {
-    return LefDefParser::defwIntProperty(propName, propValue);
-}
-
-int defwDieArea (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwDieArea(xl, yl, xh, yh);
-}
-
-int defwDieAreaList (int  num_points, int*  xl, int*  yh) {
-    return LefDefParser::defwDieAreaList(num_points, xl, yh);
-}
-
-int defwRow (const char*  rowName, const char*  rowType, int  x_orig, int  y_orig, int  orient, int  do_count, int  do_increment, int  xstep, int  ystep) {
-    return LefDefParser::defwRow(rowName, rowType, x_orig, y_orig, orient, do_count, do_increment, xstep, ystep);
-}
-
-int defwRowStr (const char*  rowName, const char*  rowType, int  x_orig, int  y_orig, const char*  orient, int  do_count, int  do_increment, int  xstep, int  ystep) {
-    return LefDefParser::defwRowStr(rowName, rowType, x_orig, y_orig, orient, do_count, do_increment, xstep, ystep);
-}
-
-int defwTracks (const char*  master, int  doStart, int  doCount, int  doStep, int  numLayers, const char**  layers, int  mask, int  sameMask) {
-    return LefDefParser::defwTracks(master, doStart, doCount, doStep, numLayers, layers, mask, sameMask);
-}
-
-int defwGcellGrid (const char*  master, int  doStart, int  doCount, int  doStep) {
-    return LefDefParser::defwGcellGrid(master, doStart, doCount, doStep);
-}
-
-int defwStartDefaultCap (int  count) {
-    return LefDefParser::defwStartDefaultCap(count);
-}
-
-int defwDefaultCap (int  pins, double  cap) {
-    return LefDefParser::defwDefaultCap(pins, cap);
-}
-
-int defwEndDefaultCap () {
-    return LefDefParser::defwEndDefaultCap();
-}
-
-int defwCanPlace (const char*  master, int  xOrig, int  yOrig, int  orient, int  doCnt, int  doInc, int  xStep, int  yStep) {
-    return LefDefParser::defwCanPlace(master, xOrig, yOrig, orient, doCnt, doInc, xStep, yStep);
-}
-
-int defwCanPlaceStr (const char*  master, int  xOrig, int  yOrig, const char*  orient, int  doCnt, int  doInc, int  xStep, int  yStep) {
-    return LefDefParser::defwCanPlaceStr(master, xOrig, yOrig, orient, doCnt, doInc, xStep, yStep);
-}
-
-int defwCannotOccupy (const char*  master, int  xOrig, int  yOrig, int  orient, int  doCnt, int  doInc, int  xStep, int  yStep) {
-    return LefDefParser::defwCannotOccupy(master, xOrig, yOrig, orient, doCnt, doInc, xStep, yStep);
-}
-
-int defwCannotOccupyStr (const char*  master, int  xOrig, int  yOrig, const char*  orient, int  doCnt, int  doInc, int  xStep, int  yStep) {
-    return LefDefParser::defwCannotOccupyStr(master, xOrig, yOrig, orient, doCnt, doInc, xStep, yStep);
-}
-
-int defwStartVias (int  count) {
-    return LefDefParser::defwStartVias(count);
-}
-
-int defwViaName (const char*  name) {
-    return LefDefParser::defwViaName(name);
-}
-
-int defwViaPattern (const char*  patternName) {
-    return LefDefParser::defwViaPattern(patternName);
-}
-
-int defwViaRect (const char*  layerName, int  xl, int  yl, int  xh, int  yh, int  mask) {
-    return LefDefParser::defwViaRect(layerName, xl, yl, xh, yh, mask);
-}
-
-int defwViaPolygon (const char*  layerName, int  num_polys, double*  xl, double*  yl, int  mask) {
-    return LefDefParser::defwViaPolygon(layerName, num_polys, xl, yl, mask);
-}
-
-int defwViaViarule (const char*  viaRuleName, double  xCutSize, double  yCutSize, const char*  botMetalLayer, const char*  cutLayer, const char*  topMetalLayer, double  xCutSpacing, double  yCutSpacing, double  xBotEnc, double  yBotEnc, double  xTopEnc, double  yTopEnc) {
-    return LefDefParser::defwViaViarule(viaRuleName, xCutSize, yCutSize, botMetalLayer, cutLayer, topMetalLayer, xCutSpacing, yCutSpacing, xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-}
-
-int defwViaViaruleRowCol (int  numCutRows, int  numCutCols) {
-    return LefDefParser::defwViaViaruleRowCol(numCutRows, numCutCols);
-}
-
-int defwViaViaruleOrigin (int  xOffset, int  yOffset) {
-    return LefDefParser::defwViaViaruleOrigin(xOffset, yOffset);
-}
-
-int defwViaViaruleOffset (int  xBotOffset, int  yBotOffset, int  xTopOffset, int  yTopOffset) {
-    return LefDefParser::defwViaViaruleOffset(xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-}
-
-int defwViaViarulePattern (const char*  cutPattern) {
-    return LefDefParser::defwViaViarulePattern(cutPattern);
-}
-
-int defwOneViaEnd () {
-    return LefDefParser::defwOneViaEnd();
-}
-
-int defwEndVias () {
-    return LefDefParser::defwEndVias();
-}
-
-int defwStartRegions (int  count) {
-    return LefDefParser::defwStartRegions(count);
-}
-
-int defwRegionName (const char*  name) {
-    return LefDefParser::defwRegionName(name);
-}
-
-int defwRegionPoints (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwRegionPoints(xl, yl, xh, yh);
-}
-
-int defwRegionType (const char*  type) {
-    return LefDefParser::defwRegionType(type);
-}
-
-int defwEndRegions () {
-    return LefDefParser::defwEndRegions();
-}
-
-int defwComponentMaskShiftLayers (const char**  layerNames, int           numLayerName) {
-    return LefDefParser::defwComponentMaskShiftLayers(layerNames, numLayerName);
-}
-
-int defwStartComponents (int  count) {
-    return LefDefParser::defwStartComponents(count);
-}
-
-int defwComponent (const char*  instance, const char*  master, int    numNetName, const char**  netNames, const char*  eeq, const char*  genName, const char*  genParemeters, const char*  source, int  numForeign, const char**  foreigns, int*  foreignX, int*  foreignY, int*  foreignOrients, const char*  status, int  statusX, int  statusY, int  statusOrient, double  weight, const char*  region, int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwComponent(instance, master, numNetName, netNames, eeq, genName, genParemeters, source, numForeign, foreigns, foreignX, foreignY, foreignOrients, status, statusX, statusY, statusOrient, weight, region, xl, yl, xh, yh);
-}
-
-int defwComponentStr (const char*  instance, const char*  master, int    numNetName, const char**  netNames, const char*  eeq, const char*  genName, const char*  genParemeters, const char*  source, int  numForeign, const char**  foreigns, int*  foreignX, int*  foreignY, const char**  foreignOrients, const char*  status, int  statusX, int  statusY, const char*  statusOrient, double  weight, const char*  region, int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwComponentStr(instance, master, numNetName, netNames, eeq, genName, genParemeters, source, numForeign, foreigns, foreignX, foreignY, foreignOrients, status, statusX, statusY, statusOrient, weight, region, xl, yl, xh, yh);
-}
-
-int defwComponentMaskShift (int  shiftLayerMasks) {
-    return LefDefParser::defwComponentMaskShift(shiftLayerMasks);
-}
-
-int defwComponentHalo (int  left, int  bottom, int  right, int  top) {
-    return LefDefParser::defwComponentHalo(left, bottom, right, top);
-}
-
-int defwComponentHaloSoft (int  left, int  bottom, int  right, int  top) {
-    return LefDefParser::defwComponentHaloSoft(left, bottom, right, top);
-}
-
-int defwComponentRouteHalo (int  haloDist, const char*  minLayer, const char*  maxLayer) {
-    return LefDefParser::defwComponentRouteHalo(haloDist, minLayer, maxLayer);
-}
-
-int defwEndComponents () {
-    return LefDefParser::defwEndComponents();
-}
-
-int defwStartPins (int  count) {
-    return LefDefParser::defwStartPins(count);
-}
-
-int defwPin (const char*  name, const char*  net, int  special, const char*  direction, const char*  use, const char*  status, int  statusX, int  statusY, int  orient, const char*  layer, int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwPin(name, net, special, direction, use, status, statusX, statusY, orient, layer, xl, yl, xh, yh);
-}
-
-int defwPinStr (const char*  name, const char*  net, int  special, const char*  direction, const char*  use, const char*  status, int  statusX, int  statusY, const char*  orient, const char*  layer, int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwPinStr(name, net, special, direction, use, status, statusX, statusY, orient, layer, xl, yl, xh, yh);
-}
-
-int defwPinLayer (const char*  layerName, int  spacing, int  designRuleWidth, int  xl, int  yl, int  xh, int  yh, int  mask) {
-    return LefDefParser::defwPinLayer(layerName, spacing, designRuleWidth, xl, yl, xh, yh, mask);
-}
-
-int defwPinPolygon (const char*  layerName, int  spacing, int  designRuleWidth, int  num_polys, double*  xl, double*  yl, int  mask) {
-    return LefDefParser::defwPinPolygon(layerName, spacing, designRuleWidth, num_polys, xl, yl, mask);
-}
-
-int defwPinVia (const char*  viaName, int  xl, int  yl, int  mask) {
-    return LefDefParser::defwPinVia(viaName, xl, yl, mask);
-}
-
-int defwPinPort () {
-    return LefDefParser::defwPinPort();
-}
-
-int defwPinPortLayer (const char*  layerName, int  spacing, int  designRuleWidth, int  xl, int  yl, int  xh, int  yh, int  mask) {
-    return LefDefParser::defwPinPortLayer(layerName, spacing, designRuleWidth, xl, yl, xh, yh, mask);
-}
-
-int defwPinPortPolygon (const char*  layerName, int  spacing, int  designRuleWidth, int  num_polys, double*  xl, double*  yl, int  mask) {
-    return LefDefParser::defwPinPortPolygon(layerName, spacing, designRuleWidth, num_polys, xl, yl, mask);
-}
-
-int defwPinPortVia (const char*  viaName, int  xl, int  yl, int  mask) {
-    return LefDefParser::defwPinPortVia(viaName, xl, yl, mask);
-}
-
-int defwPinPortLocation (const char*  status, int  statusX, int  statusY, const char*  orient) {
-    return LefDefParser::defwPinPortLocation(status, statusX, statusY, orient);
-}
-
-int defwPinNetExpr (const char*  pinExpr) {
-    return LefDefParser::defwPinNetExpr(pinExpr);
-}
-
-int defwPinSupplySensitivity (const char*  pinName) {
-    return LefDefParser::defwPinSupplySensitivity(pinName);
-}
-
-int defwPinGroundSensitivity (const char*  pinName) {
-    return LefDefParser::defwPinGroundSensitivity(pinName);
-}
-
-int defwPinAntennaPinPartialMetalArea (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinPartialMetalArea(value, layerName);
-}
-
-int defwPinAntennaPinPartialMetalSideArea (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinPartialMetalSideArea(value, layerName);
-}
-
-int defwPinAntennaPinPartialCutArea (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinPartialCutArea(value, layerName);
-}
-
-int defwPinAntennaPinDiffArea (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinDiffArea(value, layerName);
-}
-
-int defwPinAntennaModel (const char*  oxide) {
-    return LefDefParser::defwPinAntennaModel(oxide);
-}
-
-int defwPinAntennaPinGateArea (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinGateArea(value, layerName);
-}
-
-int defwPinAntennaPinMaxAreaCar (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinMaxAreaCar(value, layerName);
-}
-
-int defwPinAntennaPinMaxSideAreaCar (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinMaxSideAreaCar(value, layerName);
-}
-
-int defwPinAntennaPinMaxCutCar (int  value, const char*  layerName) {
-    return LefDefParser::defwPinAntennaPinMaxCutCar(value, layerName);
-}
-
-int defwEndPins () {
-    return LefDefParser::defwEndPins();
-}
-
-int defwStartPinProperties (int  count) {
-    return LefDefParser::defwStartPinProperties(count);
-}
-
-int defwPinProperty (const char*  name, const char*  pinName) {
-    return LefDefParser::defwPinProperty(name, pinName);
-}
-
-int defwEndPinProperties () {
-    return LefDefParser::defwEndPinProperties();
-}
-
-int defwStartSpecialNets (int  count) {
-    return LefDefParser::defwStartSpecialNets(count);
-}
-
-int defwSpecialNet (const char*  name) {
-    return LefDefParser::defwSpecialNet(name);
-}
-
-int defwSpecialNetConnection (const char*  inst, const char*  pin, int  synthesized) {
-    return LefDefParser::defwSpecialNetConnection(inst, pin, synthesized);
-}
-
-int defwSpecialNetFixedbump () {
-    return LefDefParser::defwSpecialNetFixedbump();
-}
-
-int defwSpecialNetVoltage (double  v) {
-    return LefDefParser::defwSpecialNetVoltage(v);
-}
-
-int defwSpecialNetSpacing (const char*  layer, int  spacing, double  minwidth, double  maxwidth) {
-    return LefDefParser::defwSpecialNetSpacing(layer, spacing, minwidth, maxwidth);
-}
-
-int defwSpecialNetWidth (const char*  layer, int  width) {
-    return LefDefParser::defwSpecialNetWidth(layer, width);
-}
-
-int defwSpecialNetSource (const char*  name) {
-    return LefDefParser::defwSpecialNetSource(name);
-}
-
-int defwSpecialNetOriginal (const char*  name) {
-    return LefDefParser::defwSpecialNetOriginal(name);
-}
-
-int defwSpecialNetPattern (const char*  name) {
-    return LefDefParser::defwSpecialNetPattern(name);
-}
-
-int defwSpecialNetUse (const char*  name) {
-    return LefDefParser::defwSpecialNetUse(name);
-}
-
-int defwSpecialNetWeight (double  value) {
-    return LefDefParser::defwSpecialNetWeight(value);
-}
-
-int defwSpecialNetEstCap (double  value) {
-    return LefDefParser::defwSpecialNetEstCap(value);
-}
-
-int defwSpecialNetPathStart (const char*  typ) {
-    return LefDefParser::defwSpecialNetPathStart(typ);
-}
-
-int defwSpecialNetShieldNetName (const char*  name) {
-    return LefDefParser::defwSpecialNetShieldNetName(name);
-}
-
-int defwSpecialNetPathLayer (const char*  name) {
-    return LefDefParser::defwSpecialNetPathLayer(name);
-}
-
-int defwSpecialNetPathWidth (int  width) {
-    return LefDefParser::defwSpecialNetPathWidth(width);
-}
-
-int defwSpecialNetPathStyle (int  styleNum) {
-    return LefDefParser::defwSpecialNetPathStyle(styleNum);
-}
-
-int defwSpecialNetPathShape (const char*  shapeType) {
-    return LefDefParser::defwSpecialNetPathShape(shapeType);
-}
-
-int defwSpecialNetPathMask (int  colorMask) {
-    return LefDefParser::defwSpecialNetPathMask(colorMask);
-}
-
-int defwSpecialNetPathPoint (int  numPts, double*  pointx, double*  pointy) {
-    return LefDefParser::defwSpecialNetPathPoint(numPts, pointx, pointy);
-}
-
-int defwSpecialNetPathVia (const char*  name) {
-    return LefDefParser::defwSpecialNetPathVia(name);
-}
-
-int defwSpecialNetPathViaData (int  numX, int  numY, int  stepX, int  stepY) {
-    return LefDefParser::defwSpecialNetPathViaData(numX, numY, stepX, stepY);
-}
-
-int defwSpecialNetPathPointWithWireExt (int  numPts, double*  pointx, double*  pointy, double*  optValue) {
-    return LefDefParser::defwSpecialNetPathPointWithWireExt(numPts, pointx, pointy, optValue);
-}
-
-int defwSpecialNetPathEnd () {
-    return LefDefParser::defwSpecialNetPathEnd();
-}
-
-int defwSpecialNetPolygon (const char*  layerName, int  num_polys, double*  xl, double*  yl) {
-    return LefDefParser::defwSpecialNetPolygon(layerName, num_polys, xl, yl);
-}
-
-int defwSpecialNetRect (const char*  layerName, int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwSpecialNetRect(layerName, xl, yl, xh, yh);
-}
-
-int defwSpecialNetVia (const char*  layerName) {
-    return LefDefParser::defwSpecialNetVia(layerName);
-}
-
-int defwSpecialNetViaWithOrient (const char*  layerName, int  orient) {
-    return LefDefParser::defwSpecialNetViaWithOrient(layerName, orient);
-}
-
-int defwSpecialNetViaPoints (int  num_points, double*  xl, double*  yl) {
-    return LefDefParser::defwSpecialNetViaPoints(num_points, xl, yl);
-}
-
-int defwSpecialNetEndOneNet () {
-    return LefDefParser::defwSpecialNetEndOneNet();
-}
-
-int defwSpecialNetShieldStart (const char*  name) {
-    return LefDefParser::defwSpecialNetShieldStart(name);
-}
-
-int defwSpecialNetShieldLayer (const char*  name) {
-    return LefDefParser::defwSpecialNetShieldLayer(name);
-}
-
-int defwSpecialNetShieldWidth (int  width) {
-    return LefDefParser::defwSpecialNetShieldWidth(width);
-}
-
-int defwSpecialNetShieldShape (const char*  shapeType) {
-    return LefDefParser::defwSpecialNetShieldShape(shapeType);
-}
-
-int defwSpecialNetShieldPoint (int  numPts, double*  pointx, double*  pointy) {
-    return LefDefParser::defwSpecialNetShieldPoint(numPts, pointx, pointy);
-}
-
-int defwSpecialNetShieldVia (const char*  name) {
-    return LefDefParser::defwSpecialNetShieldVia(name);
-}
-
-int defwSpecialNetShieldViaData (int  numX, int  numY, int  stepX, int  stepY) {
-    return LefDefParser::defwSpecialNetShieldViaData(numX, numY, stepX, stepY);
-}
-
-int defwSpecialNetShieldEnd () {
-    return LefDefParser::defwSpecialNetShieldEnd();
-}
-
-int defwEndSpecialNets () {
-    return LefDefParser::defwEndSpecialNets();
-}
-
-int defwStartNets (int  count) {
-    return LefDefParser::defwStartNets(count);
-}
-
-int defwNet (const char*  name) {
-    return LefDefParser::defwNet(name);
-}
-
-int defwNetConnection (const char*  inst, const char*  pin, int  synthesized) {
-    return LefDefParser::defwNetConnection(inst, pin, synthesized);
-}
-
-int defwNetMustjoinConnection (const char*  inst, const char*  pin) {
-    return LefDefParser::defwNetMustjoinConnection(inst, pin);
-}
-
-int defwNetVpin (const char*  vpinName, const char*  layerName, int  layerXl, int  layerYl, int  layerXh, int  layerYh, const char*  status, int  statusX, int  statusY, int  orient) {
-    return LefDefParser::defwNetVpin(vpinName, layerName, layerXl, layerYl, layerXh, layerYh, status, statusX, statusY, orient);
-}
-
-int defwNetVpinStr (const char*  vpinName, const char*  layerName, int  layerXl, int  layerYl, int  layerXh, int  layerYh, const char*  status, int  statusX, int  statusY, const char*  orient) {
-    return LefDefParser::defwNetVpinStr(vpinName, layerName, layerXl, layerYl, layerXh, layerYh, status, statusX, statusY, orient);
-}
-
-int defwNetNondefaultRule (const char*  name) {
-    return LefDefParser::defwNetNondefaultRule(name);
-}
-
-int defwNetXtalk (int  xtalk) {
-    return LefDefParser::defwNetXtalk(xtalk);
-}
-
-int defwNetFixedbump () {
-    return LefDefParser::defwNetFixedbump();
-}
-
-int defwNetFrequency (double  frequency) {
-    return LefDefParser::defwNetFrequency(frequency);
-}
-
-int defwNetSource (const char*  name) {
-    return LefDefParser::defwNetSource(name);
-}
-
-int defwNetOriginal (const char*  name) {
-    return LefDefParser::defwNetOriginal(name);
-}
-
-int defwNetUse (const char*  name) {
-    return LefDefParser::defwNetUse(name);
-}
-
-int defwNetPattern (const char*  name) {
-    return LefDefParser::defwNetPattern(name);
-}
-
-int defwNetEstCap (double  value) {
-    return LefDefParser::defwNetEstCap(value);
-}
-
-int defwNetWeight (double  value) {
-    return LefDefParser::defwNetWeight(value);
-}
-
-int defwNetShieldnet (const char*  name) {
-    return LefDefParser::defwNetShieldnet(name);
-}
-
-int defwNetNoshieldStart (const char*  name) {
-    return LefDefParser::defwNetNoshieldStart(name);
-}
-
-int defwNetNoshieldPoint (int  numPts, const char**  pointx, const char**  pointy) {
-    return LefDefParser::defwNetNoshieldPoint(numPts, pointx, pointy);
-}
-
-int defwNetNoshieldVia (const char*  name) {
-    return LefDefParser::defwNetNoshieldVia(name);
-}
-
-int defwNetNoshieldEnd () {
-    return LefDefParser::defwNetNoshieldEnd();
-}
-
-int defwNetSubnetStart (const char*  name) {
-    return LefDefParser::defwNetSubnetStart(name);
-}
-
-int defwNetSubnetPin (const char*  compName, const char*  pinName) {
-    return LefDefParser::defwNetSubnetPin(compName, pinName);
-}
-
-int defwNetSubnetEnd () {
-    return LefDefParser::defwNetSubnetEnd();
-}
-
-int defwNetPathStart (const char*  typ) {
-    return LefDefParser::defwNetPathStart(typ);
-}
-
-int defwNetPathWidth (int  w) {
-    return LefDefParser::defwNetPathWidth(w);
-}
-
-int defwNetPathLayer (const char*  name, int  isTaper, const char*  rulename) {
-    return LefDefParser::defwNetPathLayer(name, isTaper, rulename);
-}
-
-int defwNetPathStyle (int  styleNum) {
-    return LefDefParser::defwNetPathStyle(styleNum);
-}
-
-int defwNetPathMask (int  maskNum) {
-    return LefDefParser::defwNetPathMask(maskNum);
-}
-
-int defwNetPathRect (int  deltaX1, int  deltaY1, int  deltaX2, int  deltaY2) {
-    return LefDefParser::defwNetPathRect(deltaX1, deltaY1, deltaX2, deltaY2);
-}
-
-int defwNetPathVirtual (int  x, int  y) {
-    return LefDefParser::defwNetPathVirtual(x, y);
-}
-
-int defwNetPathPoint (int  numPts, double*  pointx, double*  pointy) {
-    return LefDefParser::defwNetPathPoint(numPts, pointx, pointy);
-}
-
-int defwNetPathPointWithExt (int  numPts, double*  pointx, double*  pointy, double*  optValue) {
-    return LefDefParser::defwNetPathPointWithExt(numPts, pointx, pointy, optValue);
-}
-
-int defwNetPathVia (const char*  name) {
-    return LefDefParser::defwNetPathVia(name);
-}
-
-int defwNetPathViaWithOrient (const char*  name, int  orient) {
-    return LefDefParser::defwNetPathViaWithOrient(name, orient);
-}
-
-int defwNetPathViaWithOrientStr (const char*  name, const char*  orient) {
-    return LefDefParser::defwNetPathViaWithOrientStr(name, orient);
-}
-
-int defwNetPathEnd () {
-    return LefDefParser::defwNetPathEnd();
-}
-
-int defwNetEndOneNet () {
-    return LefDefParser::defwNetEndOneNet();
-}
-
-int defwEndNets () {
-    return LefDefParser::defwEndNets();
-}
-
-int defwStartIOTimings (int  count) {
-    return LefDefParser::defwStartIOTimings(count);
-}
-
-int defwIOTiming (const char*  inst, const char*  pin) {
-    return LefDefParser::defwIOTiming(inst, pin);
-}
-
-int defwIOTimingVariable (const char*  riseFall, int  num1, int  num2) {
-    return LefDefParser::defwIOTimingVariable(riseFall, num1, num2);
-}
-
-int defwIOTimingSlewrate (const char*  riseFall, int  num1, int  num2) {
-    return LefDefParser::defwIOTimingSlewrate(riseFall, num1, num2);
-}
-
-int defwIOTimingDrivecell (const char*  name, const char*  fromPin, const char*  toPin, int  numDrivers) {
-    return LefDefParser::defwIOTimingDrivecell(name, fromPin, toPin, numDrivers);
-}
-
-int defwIOTimingCapacitance (double  num) {
-    return LefDefParser::defwIOTimingCapacitance(num);
-}
-
-int defwEndIOTimings () {
-    return LefDefParser::defwEndIOTimings();
-}
-
-int defwStartScanchains (int  count) {
-    return LefDefParser::defwStartScanchains(count);
-}
-
-int defwScanchain (const char*  name) {
-    return LefDefParser::defwScanchain(name);
-}
-
-int defwScanchainCommonscanpins (const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2) {
-    return LefDefParser::defwScanchainCommonscanpins(inst1, pin1, inst2, pin2);
-}
-
-int defwScanchainPartition (const char*  name, int  maxBits) {
-    return LefDefParser::defwScanchainPartition(name, maxBits);
-}
-
-int defwScanchainStart (const char*  inst, const char*  pin) {
-    return LefDefParser::defwScanchainStart(inst, pin);
-}
-
-int defwScanchainStop (const char*  inst, const char*  pin) {
-    return LefDefParser::defwScanchainStop(inst, pin);
-}
-
-int defwScanchainFloating (const char*  name, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2) {
-    return LefDefParser::defwScanchainFloating(name, inst1, pin1, inst2, pin2);
-}
-
-int defwScanchainFloatingBits (const char*  name, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, int    bits) {
-    return LefDefParser::defwScanchainFloatingBits(name, inst1, pin1, inst2, pin2, bits);
-}
-
-int defwScanchainOrdered (const char*  name1, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, const char*  name2, const char*  inst3, const char*  pin3, const char*  inst4, const char*  pin4) {
-    return LefDefParser::defwScanchainOrdered(name1, inst1, pin1, inst2, pin2, name2, inst3, pin3, inst4, pin4);
-}
-
-int defwScanchainOrderedBits (const char*  name1, const char*  inst1, const char*  pin1, const char*  inst2, const char*  pin2, int    bits1, const char*  name2, const char*  inst3, const char*  pin3, const char*  inst4, const char*  pin4, int    bits2) {
-    return LefDefParser::defwScanchainOrderedBits(name1, inst1, pin1, inst2, pin2, bits1, name2, inst3, pin3, inst4, pin4, bits2);
-}
-
-int defwEndScanchain () {
-    return LefDefParser::defwEndScanchain();
-}
-
-int defwStartConstraints (int  count) {
-    return LefDefParser::defwStartConstraints(count);
-}
-
-int defwConstraintOperand () {
-    return LefDefParser::defwConstraintOperand();
-}
-
-int defwConstraintOperandNet (const char*  netName) {
-    return LefDefParser::defwConstraintOperandNet(netName);
-}
-
-int defwConstraintOperandPath (const char*  comp1, const char*  fromPin, const char*  comp2, const char*  toPin) {
-    return LefDefParser::defwConstraintOperandPath(comp1, fromPin, comp2, toPin);
-}
-
-int defwConstraintOperandSum () {
-    return LefDefParser::defwConstraintOperandSum();
-}
-
-int defwConstraintOperandSumEnd () {
-    return LefDefParser::defwConstraintOperandSumEnd();
-}
-
-int defwConstraintOperandTime (const char*  timeType, int  time) {
-    return LefDefParser::defwConstraintOperandTime(timeType, time);
-}
-
-int defwConstraintOperandEnd () {
-    return LefDefParser::defwConstraintOperandEnd();
-}
-
-int defwConstraintWiredlogic (const char*  netName, int  distance) {
-    return LefDefParser::defwConstraintWiredlogic(netName, distance);
-}
-
-int defwEndConstraints () {
-    return LefDefParser::defwEndConstraints();
-}
-
-int defwStartGroups (int  count) {
-    return LefDefParser::defwStartGroups(count);
-}
-
-int defwGroup (const char*  groupName, int  numExpr, const char**  groupExpr) {
-    return LefDefParser::defwGroup(groupName, numExpr, groupExpr);
-}
-
-int defwGroupSoft (const char*  type1, double  value1, const char*  type2, double  value2, const char*  type3, double  value3) {
-    return LefDefParser::defwGroupSoft(type1, value1, type2, value2, type3, value3);
-}
-
-int defwGroupRegion (int  xl, int  yl, int  xh, int  yh, const char*  regionName) {
-    return LefDefParser::defwGroupRegion(xl, yl, xh, yh, regionName);
-}
-
-int defwEndGroups () {
-    return LefDefParser::defwEndGroups();
-}
-
-int defwStartBlockages (int  count) {
-    return LefDefParser::defwStartBlockages(count);
-}
-
-int defwBlockagesLayer (const char*  layerName) {
-    return LefDefParser::defwBlockagesLayer(layerName);
-}
-
-int defwBlockagesLayerSlots () {
-    return LefDefParser::defwBlockagesLayerSlots();
-}
-
-int defwBlockagesLayerFills () {
-    return LefDefParser::defwBlockagesLayerFills();
-}
-
-int defwBlockagesLayerPushdown () {
-    return LefDefParser::defwBlockagesLayerPushdown();
-}
-
-int defwBlockagesLayerExceptpgnet () {
-    return LefDefParser::defwBlockagesLayerExceptpgnet();
-}
-
-int defwBlockagesLayerComponent (const char*  compName) {
-    return LefDefParser::defwBlockagesLayerComponent(compName);
-}
-
-int defwBlockagesLayerSpacing (int  minSpacing) {
-    return LefDefParser::defwBlockagesLayerSpacing(minSpacing);
-}
-
-int defwBlockagesLayerDesignRuleWidth (int  effectiveWidth) {
-    return LefDefParser::defwBlockagesLayerDesignRuleWidth(effectiveWidth);
-}
-
-int defwBlockagesLayerMask (int  maskColor) {
-    return LefDefParser::defwBlockagesLayerMask(maskColor);
-}
-
-int defwBlockageLayer (const char*  layerName, const char*  compName) {
-    return LefDefParser::defwBlockageLayer(layerName, compName);
-}
-
-int defwBlockageLayerSlots (const char*  layerName) {
-    return LefDefParser::defwBlockageLayerSlots(layerName);
-}
-
-int defwBlockageLayerFills (const char*  layerName) {
-    return LefDefParser::defwBlockageLayerFills(layerName);
-}
-
-int defwBlockageLayerPushdown (const char*  layerName) {
-    return LefDefParser::defwBlockageLayerPushdown(layerName);
-}
-
-int defwBlockageLayerExceptpgnet (const char*  layerName) {
-    return LefDefParser::defwBlockageLayerExceptpgnet(layerName);
-}
-
-int defwBlockageSpacing (int  minSpacing) {
-    return LefDefParser::defwBlockageSpacing(minSpacing);
-}
-
-int defwBlockageDesignRuleWidth (int  effectiveWidth) {
-    return LefDefParser::defwBlockageDesignRuleWidth(effectiveWidth);
-}
-
-int defwBlockagesPlacement () {
-    return LefDefParser::defwBlockagesPlacement();
-}
-
-int defwBlockagesPlacementComponent (const char*  compName) {
-    return LefDefParser::defwBlockagesPlacementComponent(compName);
-}
-
-int defwBlockagesPlacementPushdown () {
-    return LefDefParser::defwBlockagesPlacementPushdown();
-}
-
-int defwBlockagesPlacementSoft () {
-    return LefDefParser::defwBlockagesPlacementSoft();
-}
-
-int defwBlockagesPlacementPartial (double  maxDensity) {
-    return LefDefParser::defwBlockagesPlacementPartial(maxDensity);
-}
-
-int defwBlockagesRect (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwBlockagesRect(xl, yl, xh, yh);
-}
-
-int defwBlockagesPolygon (int  num_polys, int*  xl, int*  yl) {
-    return LefDefParser::defwBlockagesPolygon(num_polys, xl, yl);
-}
-
-int defwBlockagePlacement () {
-    return LefDefParser::defwBlockagePlacement();
-}
-
-int defwBlockagePlacementComponent (const char*  compName) {
-    return LefDefParser::defwBlockagePlacementComponent(compName);
-}
-
-int defwBlockagePlacementPushdown () {
-    return LefDefParser::defwBlockagePlacementPushdown();
-}
-
-int defwBlockagePlacementSoft () {
-    return LefDefParser::defwBlockagePlacementSoft();
-}
-
-int defwBlockagePlacementPartial (double  maxDensity) {
-    return LefDefParser::defwBlockagePlacementPartial(maxDensity);
-}
-
-int defwBlockageMask (int  maskColor) {
-    return LefDefParser::defwBlockageMask(maskColor);
-}
-
-int defwBlockageRect (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwBlockageRect(xl, yl, xh, yh);
-}
-
-int defwBlockagePolygon (int  num_polys, int*  xl, int*  yl) {
-    return LefDefParser::defwBlockagePolygon(num_polys, xl, yl);
-}
-
-int defwEndBlockages () {
-    return LefDefParser::defwEndBlockages();
-}
-
-int defwStartSlots (int  count) {
-    return LefDefParser::defwStartSlots(count);
-}
-
-int defwSlotLayer (const char*  layerName) {
-    return LefDefParser::defwSlotLayer(layerName);
-}
-
-int defwSlotRect (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwSlotRect(xl, yl, xh, yh);
-}
-
-int defwSlotPolygon (int  num_polys, double*  xl, double*  yl) {
-    return LefDefParser::defwSlotPolygon(num_polys, xl, yl);
-}
-
-int defwEndSlots () {
-    return LefDefParser::defwEndSlots();
-}
-
-int defwStartFills (int  count) {
-    return LefDefParser::defwStartFills(count);
-}
-
-int defwFillLayer (const char*  layerName) {
-    return LefDefParser::defwFillLayer(layerName);
-}
-
-int defwFillLayerMask (int  maskColor) {
-    return LefDefParser::defwFillLayerMask(maskColor);
-}
-
-int defwFillLayerOPC () {
-    return LefDefParser::defwFillLayerOPC();
-}
-
-int defwFillRect (int  xl, int  yl, int  xh, int  yh) {
-    return LefDefParser::defwFillRect(xl, yl, xh, yh);
-}
-
-int defwFillPolygon (int  num_polys, double*  xl, double*  yl) {
-    return LefDefParser::defwFillPolygon(num_polys, xl, yl);
-}
-
-int defwFillVia (const char*  viaName) {
-    return LefDefParser::defwFillVia(viaName);
-}
-
-int defwFillViaMask (int  colorMask) {
-    return LefDefParser::defwFillViaMask(colorMask);
-}
-
-int defwFillViaOPC () {
-    return LefDefParser::defwFillViaOPC();
-}
-
-int defwFillPoints (int  num_points, double*  xl, double*  yl) {
-    return LefDefParser::defwFillPoints(num_points, xl, yl);
-}
-
-int defwEndFills () {
-    return LefDefParser::defwEndFills();
-}
-
-int defwStartNonDefaultRules (int  count) {
-    return LefDefParser::defwStartNonDefaultRules(count);
-}
-
-int defwNonDefaultRule (const char*  ruleName, int  hardSpacing) {
-    return LefDefParser::defwNonDefaultRule(ruleName, hardSpacing);
-}
-
-int defwNonDefaultRuleLayer (const char*  layerName, int  width, int  diagWidth, int  spacing, int  wireExt) {
-    return LefDefParser::defwNonDefaultRuleLayer(layerName, width, diagWidth, spacing, wireExt);
-}
-
-int defwNonDefaultRuleVia (const char*  viaName) {
-    return LefDefParser::defwNonDefaultRuleVia(viaName);
-}
-
-int defwNonDefaultRuleViaRule (const char*  viaRuleName) {
-    return LefDefParser::defwNonDefaultRuleViaRule(viaRuleName);
-}
-
-int defwNonDefaultRuleMinCuts (const char*  cutLayerName, int  numCutS) {
-    return LefDefParser::defwNonDefaultRuleMinCuts(cutLayerName, numCutS);
-}
-
-int defwEndNonDefaultRules () {
-    return LefDefParser::defwEndNonDefaultRules();
-}
-
-int defwStartStyles (int  count) {
-    return LefDefParser::defwStartStyles(count);
-}
-
-int defwStyles (int  styleNums, int  num_points, double*  xp, double*  yp) {
-    return LefDefParser::defwStyles(styleNums, num_points, xp, yp);
-}
-
-int defwEndStyles () {
-    return LefDefParser::defwEndStyles();
-}
-
-int defwStartBeginext (const char*  name) {
-    return LefDefParser::defwStartBeginext(name);
-}
-
-int defwBeginextCreator (const char*  creatorName) {
-    return LefDefParser::defwBeginextCreator(creatorName);
-}
-
-int defwBeginextDate () {
-    return LefDefParser::defwBeginextDate();
-}
-
-int defwBeginextRevision (int  vers1, int  vers2) {
-    return LefDefParser::defwBeginextRevision(vers1, vers2);
-}
-
-int defwBeginextSyntax (const char*  title, const char*  string) {
-    return LefDefParser::defwBeginextSyntax(title, string);
-}
-
-int defwEndBeginext () {
-    return LefDefParser::defwEndBeginext();
-}
-
-int defwEnd () {
-    return LefDefParser::defwEnd();
-}
-
-int defwCurrentLineNumber () {
-    return LefDefParser::defwCurrentLineNumber();
-}
-
-void defwPrintError (int  status) {
-    LefDefParser::defwPrintError(status);
-}
-
-void defwAddComment (const char*  comment) {
-    LefDefParser::defwAddComment(comment);
-}
-
-void defwAddIndent () {
-    LefDefParser::defwAddIndent();
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriterCalls.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriterCalls.cpp
deleted file mode 100644
index ec61589..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdef/xdefwWriterCalls.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: xxx $
-//  $Revision: xxx $
-//  $Date: xxx $
-//  $State: xxx $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "defwWriterCalls.h"
-#include "defwWriterCalls.hpp"
-
-// Wrappers definitions.
-int defwWrite (FILE * file, const char * fileName, defiUserData  userData) {
-    return LefDefParser::defwWrite(file, fileName, userData);
-}
-
-void defwSetRegisterUnusedCallbacks () {
-    LefDefParser::defwSetRegisterUnusedCallbacks();
-}
-
-void defwPrintUnusedCallbacks (FILE*  log) {
-    LefDefParser::defwPrintUnusedCallbacks(log);
-}
-
-void defwSetUserData (defiUserData  p0) {
-    LefDefParser::defwSetUserData(p0);
-}
-
-defiUserData defwGetUserData () {
-    return LefDefParser::defwGetUserData();
-}
-
-void defwSetArrayCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetArrayCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetAssertionCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetAssertionCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetBlockageCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetBlockageCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetBusBitCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetBusBitCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetCannotOccupyCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetCannotOccupyCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetCanplaceCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetCanplaceCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetCaseSensitiveCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetCaseSensitiveCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetComponentCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetComponentCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetConstraintCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetConstraintCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetDefaultCapCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetDefaultCapCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetDesignCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetDesignCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetDesignEndCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetDesignEndCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetDieAreaCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetDieAreaCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetDividerCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetDividerCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetExtCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetExtCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetFloorPlanCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetFloorPlanCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetGcellGridCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetGcellGridCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetGroupCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetGroupCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetHistoryCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetHistoryCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetIOTimingCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetIOTimingCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetNetCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetNetCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetPinCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetPinCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetPinPropCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetPinPropCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetPropDefCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetPropDefCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetRegionCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetRegionCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetRowCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetRowCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetSNetCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetSNetCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetScanchainCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetScanchainCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetTechnologyCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetTechnologyCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetTrackCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetTrackCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetUnitsCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetUnitsCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetVersionCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetVersionCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetViaCbk (::defwVoidCbkFnType p0) {
-    LefDefParser::defwSetViaCbk((LefDefParser::defwVoidCbkFnType) p0);
-}
-
-void defwSetUnusedCallbacks (::defwVoidCbkFnType  func) {
-    LefDefParser::defwSetUnusedCallbacks((LefDefParser::defwVoidCbkFnType ) func);
-}
-
-void defwSetLogFunction (::DEFI_LOG_FUNCTION  p0) {
-    LefDefParser::defwSetLogFunction(p0);
-}
-
-void defwSetWarningLogFunction (::DEFI_WARNING_LOG_FUNCTION  p0) {
-    LefDefParser::defwSetWarningLogFunction(p0);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/cdefzlib.c b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/cdefzlib.c
deleted file mode 100644
index 0deddf0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/cdefzlib.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2014, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- ******************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "zlib.h"
-#include "defzlib.h"
-#include "defrReader.h"
-
-/*
- * Private functions:
- */
-size_t defGZip_read(FILE* file, char* buf, size_t len) {
-  return gzread((gzFile)file, buf, (unsigned int)len);
-}
-
-/*
- * Public functions:
- */
-defGZFile 
-defGZipOpen(const char *gzipPath, const char* mode) {
-  defGZFile fptr;
-
-  if (!gzipPath)
-    return NULL;
-
-  fptr = gzopen(gzipPath, mode);
-
-  if (fptr) {
-    /* successfully open the gzip file */
-    /* set the read function to read from a compressed file */
-    defrSetReadFunction(defGZip_read);
-    return (defGZFile)fptr;
-  } else
-    return NULL;
-}
-
-int defGZipClose(defGZFile filePtr) {
-  return (gzclose((gzFile)filePtr));
-}
-
-int defrReadGZip(defGZFile file, const char* gzipFile, defiUserData uData) {
-  return defrRead((FILE*)file, gzipFile, uData, 1);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/defzlib.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/defzlib.h
deleted file mode 100644
index dc5a689..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/cdefzlib/defzlib.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2012, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- ******************************************************************************/
-
-#ifndef CLEFDEFZIP_H
-#define CLEFDEFZIP_H
-
-typedef void* defGZFile;
-
-/* 
- * Name: defGZipOpen
- * Description: Open a gzip file
- * Returns: A file pointer
- */
-extern defGZFile defGZipOpen(const char* gzipFile, const char* mode);
-
-/* 
- * Name: defGZipClose
- * Description: Close a gzip file
- * Returns: 0 if no errors
- */
-extern int defGZipClose(defGZFile filePtr);
-
-/*
- * Name: defrReadGZip
- * Description: Parse a def gzip file
- * Returns: 0 if no errors
- */
-extern int defrReadGZip(defGZFile file, const char* gzipFile, void* uData);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.msg b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.msg
deleted file mode 100644
index eb58c0d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.msg
+++ /dev/null
@@ -1,163 +0,0 @@
-# Error message number:
-#   6000 - out of memory
-#   6010 - defiBlockage.cpp
-#   6020 - defiComponent.cpp
-#   6030 - defiFPC.cpp
-#   6040 - defiFill.cpp
-#   6050 - defiGroup.cpp
-#   6060 - defiIOTiming.cpp
-#   6070 - defiMisc.cpp
-#   6080 - defiNet.cpp
-#   6090 - defiNonDefault.cpp
-#   6100 - defiPartition.cpp
-#   6110 - defiPinCap.cpp
-#   6120 - defiPinProp.cpp
-#   6130 - defiRegion.cpp
-#   6140 - defiRowTrack.cpp
-#   6150 - defiScanchain.cpp
-#   6160 - defiSlot.cpp
-#   6170 - defiTimingDisable.cpp
-#   6180 - defiVia.cpp
-#   6200 - defiAssertion.cpp
-# 5000 - def reader, defrReader.cpp
-# 5500 - lex.cpph, yyerror
-# 6000 - def parser, error, lex.cpph, def.y (CALLBACK and CHKERR)
-# 6500 - def parser, error, def.y
-# 7000 - def parser, warning, lex.cpph
-# 7500 - def parser, warning, lef.y
-# 8000 - def parser, info, lex.cpph
-# 9000 - def writer
-# emsMkError DEF -b defMsgTable -m def.msg -e -n
-5000 "The 'defrRead' function has been called before the 'defrInit' function.\nThe 'defrInit' function should be called prior to the 'defrRead' function."
-5001 "DEF statement found in the def file with no callback set."
-6000 "The syntax for an ALIAS statement is \"&ALIAS aliasName = aliasDefinition &ENDALIAS\". '=' is missing after the aliasName."
-6001 "End of file is reached while parsing in the middle of an ALIAS statement.\nReview you def file and add '&ENDALIAS' in the ALIAS statement."
-6002 "The def file is incomplete."
-6003 "The BEGINEXT tag is missing in the DEF file. Include the tag and then try again."
-6004 "The BEGINEXT tag is empty. Specify a value for the tag and try again."
-6005 "The '\"' is missing within the tag. Specify the '\"' in the tag and then try again."
-6006 "The ending '\"' is missing in the tag. Specify the ending '\"' in the tag and then try again."
-6007 "The ENDEXT statement is missing in the DEF file. Include the statement and then try again."
-6008 "Invalid characters found in \'%s\'.\nThese characters might be using the character types other than English.\nCreate characters by specifying valid characters types."
-6010 "An error has been reported in callback."
-6011 "Too many syntax errors have been reported."
-6030 "Invalid direction specified with FPC name. The valid direction is either 'H' or 'V'. Specify a valid vale and then try again."
-6060 "Invalid value specified for IOTIMING rise/fall. The valid value for rise is 'R' and for fall is 'F'. Specify a valid value and then try again."
-6080 "An internal error has occurred. The index number for the SUBNET wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information."
-6081 "An internal error has occurred. The index number for the NET PATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information."
-6082 "An internal error has occurred. The index number for the NET SHIELDPATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information."
-6083 "The index number %d specified for the NET INSTANCE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6084 "The index number %d specified for the NET PIN is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6085 "The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6086 "The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6090 "The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6091 "The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again."
-6100 "The value spefified for PARTITION SETUP is invalid. The valid value for SETUP is 'R' or 'F'. Specify a valid value for SETUP and then try again."
-6101 "The value spefified for PARTITION HOLD is invalid. The valid value for HOLD is 'R' or 'F'. Specify a valid value for HOLD and then try again."
-6120 "The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again."
-6130 "The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again."
-6131 "The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again."
-6140 "The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again."
-6150 "The START statement in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one START statement and then try again."
-6151 "The STOP statment in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one STOP statement and then try again."
-6160 "The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again."
-6170 "The TimingDisable type is invalid. The valid types are FROMPIN, & THRUPIN. Specify the valid type and then try again."
-6180 "The index number %d specified for the VIA POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again"
-6200 "The ASSERTION statement is invalid because it has an invalid operand rule.\nValid operand rule is either NET or PATH. Specify a valid operand and then try again."
-6201 "Unable to process the DEF file. Both WIREDLOGIC and DELAY statements are defined in constraint/assertion.\nUpdate the DEF file to define either a WIREDLOGIC or DELAY statement only."
-6202 "Unable to process the DEF file. Both SUM and DIFF statements are defined in constraint/assertion.\nUpdate the DEF file to define either a SUM or DIFF statement only."
-6501 "An error has been found while processing the DEF file '%s'\nUnit %d is a 5.6 or later syntax. Define the DEF file as 5.6 and then try again."
-6502 "The value %d defined for DEF UNITS DISTANCE MICRON is invalid\n. The valid values are 100, 200, 1000, 2000, 10000, or 20000. Specify a valid value and then try again."
-6503 "The execution has been stopped because the DEF parser 5.7 does not support DEF file with version %s.\nUpdate your DEF file to version 5.7 or earlier."
-6504 "Def parser version 5.7 and later does not support NAMESCASESENSITIVE OFF.\nEither remove this optional construct or set it to ON."
-6505 "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6506 "The NETEXPR statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6507 "The SUPPLYSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6508 "The GROUNDSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6509 "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6510 "The ANTENNAPINPARTIALMETALAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g."
-6511 "The ANTENNAPINPARTIALMETALSIDEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6512 "The ANTENNAPINGATEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6513 "The ANTENNAPINDIFFAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6514 "The ANTENNAPINMAXAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6515 "The ANTENNAPINMAXSIDEAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6516 "The ANTENNAPINPARTIALCUTAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6517 "The ANTENNAPINMAXCUTCAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g"
-6518 "The ANTENNAMODEL statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g"
-6519 "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6520 "The DESIGNRULEWIDTH statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6523 "Invalid ROW statement defined in the DEF file. The DO statement which is required in the ROW statement is not defined.\nUpdate your DEF file with a DO statement."
-6524 "Invalid syntax specified. The valid syntax is either \"DO 1 BY num or DO num BY 1\". Specify the valid syntax and try again."
-6525 "The DO number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again."
-6526 "The STEP number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again."
-6527 "The DO number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again."
-6528 "The STEP number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again."
-6529 "The HALO statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6530 "The FIXEDBUMP statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g"
-6531 "The layerName which is required in path is missing. Include the layerName in the path and then try again."
-6532 "The VIA DO statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g"
-6533 "Either the numX or numY in the VIA DO statement has invalid value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again."
-6534 "The STYLE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6535 "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6536 "The RECT statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6537 "The value %s for statement VOLTAGE is invalid. The value can only be integer.\nSpecify a valid value in units of millivolts"
-6538 "The PARTITION statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g"
-6539 "Invalid BLOCKAGE statement defined in the DEF file. The BLOCKAGE statment has both the LAYER and the PLACEMENT statements defined.\nUpdate your DEF file to have either BLOCKAGE or PLACEMENT statement only."
-6540 "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6541 "The SPACING statement is defined in the LAYER statement,\nbut there is already either a SPACING statement or DESIGNRULEWIDTH  statement has defined in the LAYER statement.\nUpdate your DEF file to have either SPACING statement or a DESIGNRULEWIDTH statement."
-6542 "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer."
-6543 "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement."
-6544 "A POLYGON statement is defined in the BLOCKAGE statement,\nbut it is not defined in the BLOCKAGE LAYER statement.\nUpdate your DEF file to either remove the POLYGON statement from the BLOCKAGE statement or\ndefine the POLYGON statement in a BLOCKAGE LAYER statement."
-6545 "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g."
-6546 "The STYLES statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g"
-6547 "The PLACEMENT SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6548 "The PARTIAL is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6549 "The EXCEPTPGNET is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6550 "The HALO SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6551 "The ROUTEHALO is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6552 "The FILLWIREOPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6553 "The LAYER OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6554 "The VIA OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6555 "The PORT in PINS is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g."
-6556 "The PIN VIA statement is available in version 5.7 and later.\nHowever, your DEF file is defined with version %g."
-6557 "The VIARULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g",
-6558 "The FREQUENCY statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g"
-6559 "The ROWCOL statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement."
-6560 "The ORIGIN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement."
-6561 " The OFFSET statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement."
-6562 "The PATTERN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement."
-6563 "The TYPE statement already exists. It has been defined in the REGION statement."
-6564 "POLYGON statement in FILLS LAYER is a version 5.6 and later syntax.\nYour def file is defined with version %g",
-7000 "The specified string has exceeded 4096 characters. The extra characters will be truncated. Specify a string less than or equal to 4096 characters."
-7010 "The PropName %s is not defined for %s."
-7011 "The NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement."
-7012 "No VERSION statement found, using the default value %2g."
-7013 "The DEF file is invalid if NAMESCASESENSITIVE is undefined.\nNAMESCASESENSITIVE is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the NAMESCASESENSITIVE statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual."
-7014 "The DEF file is invalid if BUSBITCHARS is undefined.\nBUSBITCHARS is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the BUSBITCHARS statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual."
-7015 "The DEF file is invalid if DIVIDERCHAR is undefined.\nDIVIDERCHAR is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the DIVIDERCHAR statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual."
-7016 "DESIGN is a mandatory statement in the DEF file. Ensure that it exists in the file."
-7017 "The DEFAULTCAP statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement."
-7018 "The DO statement in the ROW statement with the name %s has invalid syntax.\nThe valid syntax is \"DO numX BY 1 STEP spaceX 0 | DO 1 BY numY STEP 0 spaceY\".\nSpecify the valid syntax and try again."
-7019 "The PATTERNNAME statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement."
-7020 "The REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7021 "The FOREIGN statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement."
-7022 "In the COMPONENT UNPLACED statement, the point and orient are invalid in version 5.4 and later.\nThe DEF parser will ignore this statement."
-7023 "The SPECIAL NET statement, with type %s, does not have any net statement defined.\nThe DEF parser will ignore this statement."
-7024 "The ESTCAP statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7025 "The SPECIAL NET SHIELD statement, does not have any shield net statement defined.\nThe DEF parser will ignore this statement."
-7026 "The WIDTH statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7027 "The GROUP REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7028 "The GROUP SOFT MAXX statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7029 "The GROUP SOFT MAXY statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7030 "The GROUP SOFT MAXHALFPERIMETER statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement."
-7031 "The ASSERTIONS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement."
-7032 "The CONSTRAINTS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement."
-7035 "The IOTIMINGS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement."
-7500 "Unable to open the file defRWarning.log in %s.\nWarning messages will not be written out in the log file.\nCheck if you have write permission on the directory."
-8000 "The data still exists after the END DESIGN statement. The DEF parser will ignore this data."
-8500 "Unable to open the file defRWarning.log in %s.\nInfo messages will not be written out in the log file.\nCheck if you have write permission on the directory."
-9000 "The DEF writer has detected that the function defwInitCbk has already been called and you are trying to call defwInit.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again."
-9001 "The DEF writer has detected that the function defwInit has already been called and you are trying to call defwInitCbk.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again."
-9010 "The function defwWrite is called before the function defwInitCbk.\nYou need to call defwInitCbk before calling any other functions.\nUpdate your program and then try again."
-9011 "You program has called the function defwInit to initialize the writer.\nIf you want to use the callback option you need to use the function defwInitCbk."
-9012 "You are calling the function defwPrintUnusedCallbacks but you did call the function defwSetRegisterUnusedCallbacks which is required before you can call defwPrintUnusedCallbacks."
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.y b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.y
deleted file mode 100644
index cf8f79c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def.y
+++ /dev/null
@@ -1,5184 +0,0 @@
-// ******************************************************************************
-// ******************************************************************************
-// Copyright 2013-2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// ******************************************************************************
-// 
-//  $Author: icftcm $
-//  $Revision: #2 $
-//  $Date: 2017/06/07 $
-//  $State:  $
-// ****************************************************************************
-
-//  Error message number:
-//  5000 - def reader, defrReader.cpp
-//  5500 - lex.cpph, yyerror
-//  6000 - def parser, error, lex.cpph, def.y (CALLBACK & CHKERR)
-//  6010 - defiBlockage.cpp
-//  6020 - defiComponent.cpp
-//  6030 - defiFPC.cpp
-//  6040 - defiFill.cpp
-//  6050 - defiGroup.cpp
-//  6060 - defiIOTiming.cpp
-//  6070 - defiMisc.cpp
-//  6080 - defiNet.cpp
-//  6090 - defiNonDefault.cpp
-//  6100 - defiPartition.cpp
-//  6110 - defiPinCap.cpp
-//  6120 - defiPinProp.cpp
-//  6130 - defiRegion.cpp
-//  6140 - defiRowTrack.cpp
-//  6150 - defiScanchain.cpp
-//  6160 - defiSlot.cpp
-//  6170 - defiTimingDisable.cpp
-//  6180 - defiVia.cpp
-//  6500 - def parser, error, def.y
-%pure-parser
-%lex-param {defrData *defData}
-%parse-param {defrData *defData}
-
-
-%{
-#include <stdlib.h>
-#include <string.h>
-#include "defrReader.hpp"
-#include "defiUser.hpp"
-#include "defrCallBacks.hpp"
-#include "lex.h"
-
-#define DEF_MAX_INT 2147483647
-#define YYDEBUG 1     // this is temp fix for pcr 755132 
-// TX_DIR:TRANSLATION ON
-
-
-#include "defrData.hpp"
-#include "defrSettings.hpp"
-#include "defrCallBacks.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Macro to describe how we handle a callback.
-// If the function was set then call it.
-// If the function returns non zero then there was an error
-// so call the error routine and exit.
-//
-#define CALLBACK(func, typ, data) \
-    if (!defData->errors) {\
-      if (func) { \
-        if ((defData->defRetVal = (*func)(typ, data, defData->session->UserData)) == PARSE_OK) { \
-        } else if (defData->defRetVal == STOP_PARSE) { \
-          return defData->defRetVal; \
-        } else { \
-          defData->defError(6010, "An error has been reported in callback."); \
-          return defData->defRetVal; \
-        } \
-      } \
-    }
-
-#define CHKERR() \
-    if (defData->checkErrors()) { \
-      return 1; \
-    }
-
-#define CHKPROPTYPE(propType, propName, name) \
-    if (propType == 'N') { \
-       defData->warningMsg = (char*)malloc(strlen(propName)+strlen(name)+40); \
-       sprintf(defData->warningMsg, "The PropName %s is not defined for %s.", \
-               propName, name); \
-       defData->defWarning(7010, defData->warningMsg); \
-       free(defData->warningMsg); \
-    }
-
-int yylex(YYSTYPE *pYylval, defrData *defData)
-{
-    return defData->defyylex(pYylval);
-}
-
-
-void yyerror(defrData *defData, const char *s)
-{
-    return defData->defyyerror(s);
-}
-
-
-
-
-#define FIXED 1
-#define COVER 2
-#define PLACED 3
-#define UNPLACED 4
-%}
-
-
-
-
-
-
-
-
-
-
-%token <string>  QSTRING
-%token <string>  T_STRING SITE_PATTERN
-%token <dval>    NUMBER
-%token <keyword> K_HISTORY K_NAMESCASESENSITIVE
-%token <keyword> K_DESIGN K_VIAS K_TECH K_UNITS K_ARRAY K_FLOORPLAN
-%token <keyword> K_SITE K_CANPLACE K_CANNOTOCCUPY K_DIEAREA
-%token <keyword> K_PINS
-%token <keyword> K_DEFAULTCAP K_MINPINS K_WIRECAP
-%token <keyword> K_TRACKS K_GCELLGRID
-%token <keyword> K_DO K_BY K_STEP K_LAYER K_ROW K_RECT
-%token <keyword> K_COMPS K_COMP_GEN K_SOURCE K_WEIGHT K_EEQMASTER
-%token <keyword> K_FIXED K_COVER K_UNPLACED K_PLACED K_FOREIGN K_REGION 
-%token <keyword> K_REGIONS
-%token <keyword> K_NETS K_START_NET K_MUSTJOIN K_ORIGINAL K_USE K_STYLE
-%token <keyword> K_PATTERN K_PATTERNNAME K_ESTCAP K_ROUTED K_NEW 
-%token <keyword> K_SNETS K_SHAPE K_WIDTH K_VOLTAGE K_SPACING K_NONDEFAULTRULE
-%token <keyword> K_NONDEFAULTRULES
-%token <keyword> K_N K_S K_E K_W K_FN K_FE K_FS K_FW
-%token <keyword> K_GROUPS K_GROUP K_SOFT K_MAXX K_MAXY K_MAXHALFPERIMETER
-%token <keyword> K_CONSTRAINTS K_NET K_PATH K_SUM K_DIFF 
-%token <keyword> K_SCANCHAINS K_START K_FLOATING K_ORDERED K_STOP K_IN K_OUT
-%token <keyword> K_RISEMIN K_RISEMAX K_FALLMIN K_FALLMAX K_WIREDLOGIC
-%token <keyword> K_MAXDIST
-%token <keyword> K_ASSERTIONS
-%token <keyword> K_DISTANCE K_MICRONS
-%token <keyword> K_END
-%token <keyword> K_IOTIMINGS K_RISE K_FALL K_VARIABLE K_SLEWRATE K_CAPACITANCE
-%token <keyword> K_DRIVECELL K_FROMPIN K_TOPIN K_PARALLEL
-%token <keyword> K_TIMINGDISABLES K_THRUPIN K_MACRO
-%token <keyword> K_PARTITIONS K_TURNOFF
-%token <keyword> K_FROMCLOCKPIN K_FROMCOMPPIN K_FROMIOPIN
-%token <keyword> K_TOCLOCKPIN K_TOCOMPPIN K_TOIOPIN
-%token <keyword> K_SETUPRISE K_SETUPFALL K_HOLDRISE K_HOLDFALL
-%token <keyword> K_VPIN K_SUBNET K_XTALK K_PIN K_SYNTHESIZED
-%token <keyword> K_DEFINE K_DEFINES K_DEFINEB K_IF K_THEN K_ELSE K_FALSE K_TRUE 
-%token <keyword> K_EQ K_NE K_LE K_LT K_GE K_GT K_OR K_AND K_NOT
-%token <keyword> K_SPECIAL K_DIRECTION K_RANGE
-%token <keyword> K_FPC K_HORIZONTAL K_VERTICAL K_ALIGN K_MIN K_MAX K_EQUAL
-%token <keyword> K_BOTTOMLEFT K_TOPRIGHT K_ROWS K_TAPER K_TAPERRULE
-%token <keyword> K_VERSION K_DIVIDERCHAR K_BUSBITCHARS
-%token <keyword> K_PROPERTYDEFINITIONS K_STRING K_REAL K_INTEGER K_PROPERTY
-%token <keyword> K_BEGINEXT K_ENDEXT K_NAMEMAPSTRING K_ON K_OFF K_X K_Y
-%token <keyword> K_COMPONENT K_MASK K_MASKSHIFT K_COMPSMASKSHIFT K_SAMEMASK
-%token <keyword> K_PINPROPERTIES K_TEST
-%token <keyword> K_COMMONSCANPINS K_SNET K_COMPONENTPIN K_REENTRANTPATHS
-%token <keyword> K_SHIELD K_SHIELDNET K_NOSHIELD K_VIRTUAL
-%token <keyword> K_ANTENNAPINPARTIALMETALAREA K_ANTENNAPINPARTIALMETALSIDEAREA
-%token <keyword> K_ANTENNAPINGATEAREA K_ANTENNAPINDIFFAREA
-%token <keyword> K_ANTENNAPINMAXAREACAR K_ANTENNAPINMAXSIDEAREACAR
-%token <keyword> K_ANTENNAPINPARTIALCUTAREA K_ANTENNAPINMAXCUTCAR
-%token <keyword> K_SIGNAL K_POWER K_GROUND K_CLOCK K_TIEOFF K_ANALOG K_SCAN
-%token <keyword> K_RESET K_RING K_STRIPE K_FOLLOWPIN K_IOWIRE K_COREWIRE
-%token <keyword> K_BLOCKWIRE K_FILLWIRE K_BLOCKAGEWIRE K_PADRING K_BLOCKRING
-%token <keyword> K_BLOCKAGES K_PLACEMENT K_SLOTS K_FILLS K_PUSHDOWN
-%token <keyword> K_NETLIST K_DIST K_USER K_TIMING K_BALANCED K_STEINER K_TRUNK
-%token <keyword> K_FIXEDBUMP K_FENCE K_FREQUENCY K_GUIDE K_MAXBITS
-%token <keyword> K_PARTITION K_TYPE K_ANTENNAMODEL K_DRCFILL
-%token <keyword> K_OXIDE1 K_OXIDE2 K_OXIDE3 K_OXIDE4
-%token <keyword> K_CUTSIZE K_CUTSPACING K_DESIGNRULEWIDTH K_DIAGWIDTH
-%token <keyword> K_ENCLOSURE K_HALO K_GROUNDSENSITIVITY
-%token <keyword> K_HARDSPACING K_LAYERS K_MINCUTS K_NETEXPR 
-%token <keyword> K_OFFSET K_ORIGIN K_ROWCOL K_STYLES
-%token <keyword> K_POLYGON K_PORT K_SUPPLYSENSITIVITY K_VIA K_VIARULE K_WIREEXT
-%token <keyword> K_EXCEPTPGNET K_FILLWIREOPC K_OPC K_PARTIAL K_ROUTEHALO
-%type <pt>      pt opt_paren
-%type <integer> comp_net_list subnet_opt_syn
-%type <integer> orient pin_via_mask_opt
-%type <integer> placement_status
-%type <string>  net_type subnet_type track_start use_type shape_type source_type
-%type <string>  pattern_type netsource_type
-%type <tk>      path paths new_path
-%type <string>  risefall opt_pin opt_pattern pin_layer_opt
-%type <string>  vpin_status opt_plus track_type region_type
-%type <string>  h_or_v turnoff_setup turnoff_hold
-%type <integer> conn_opt partition_maxbits same_mask mask orient_pt
-
-%%
-
-def_file: version_stmt case_sens_stmt rules end_design
-            ;
-
-version_stmt:  // empty 
-    | K_VERSION { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ';'
-      {
-        defData->VersionNum = defrData::convert_defname2num($3);
-        if (defData->VersionNum > CURRENT_VERSION) {
-          char temp[300];
-          sprintf(temp,
-          "The execution has been stopped because the DEF parser %.1f does not support DEF file with version %s.\nUpdate your DEF file to version 5.8 or earlier.",
-                  CURRENT_VERSION, $3);
-          defData->defError(6503, temp);
-          return 1;
-        }
-        if (defData->callbacks->VersionStrCbk) {
-          CALLBACK(defData->callbacks->VersionStrCbk, defrVersionStrCbkType, $3);
-        } else if (defData->callbacks->VersionCbk) {
-            CALLBACK(defData->callbacks->VersionCbk, defrVersionCbkType, defData->VersionNum);
-        }
-        if (defData->VersionNum > 5.3 && defData->VersionNum < 5.4)
-          defData->defIgnoreVersion = 1;
-        if (defData->VersionNum < 5.6)     // default to false before 5.6
-          defData->names_case_sensitive = defData->session->reader_case_sensitive;
-        else
-          defData->names_case_sensitive = 1;
-        defData->hasVer = 1;
-        defData->doneDesign = 0;
-    }
-
-case_sens_stmt: // empty 
-    | K_NAMESCASESENSITIVE K_ON ';'
-      {
-        if (defData->VersionNum < 5.6) {
-          defData->names_case_sensitive = 1;
-          if (defData->callbacks->CaseSensitiveCbk)
-            CALLBACK(defData->callbacks->CaseSensitiveCbk, defrCaseSensitiveCbkType,
-                     defData->names_case_sensitive); 
-          defData->hasNameCase = 1;
-        } else
-          if (defData->callbacks->CaseSensitiveCbk) // write error only if cbk is set 
-             if (defData->caseSensitiveWarnings++ < defData->settings->CaseSensitiveWarnings)
-               defData->defWarning(7011, "The NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement.");
-      }
-    | K_NAMESCASESENSITIVE K_OFF ';'
-      {
-        if (defData->VersionNum < 5.6) {
-          defData->names_case_sensitive = 0;
-          if (defData->callbacks->CaseSensitiveCbk)
-            CALLBACK(defData->callbacks->CaseSensitiveCbk, defrCaseSensitiveCbkType,
-                     defData->names_case_sensitive);
-          defData->hasNameCase = 1;
-        } else {
-          if (defData->callbacks->CaseSensitiveCbk) { // write error only if cbk is set 
-            if (defData->caseSensitiveWarnings++ < defData->settings->CaseSensitiveWarnings) {
-              defData->defError(6504, "Def parser version 5.7 and later does not support NAMESCASESENSITIVE OFF.\nEither remove this optional construct or set it to ON.");
-              CHKERR();
-            }
-          }
-        }
-      }
-
-rules: // empty 
-        | rules rule
-        | error 
-            ;
-
-rule: design_section | assertions_section | blockage_section | comps_section
-      | constraint_section | extension_section | fill_section | comps_maskShift_section
-      | floorplan_contraints_section | groups_section | iotiming_section
-      | nets_section |  nondefaultrule_section | partitions_section
-      | pin_props_section | regions_section | scanchains_section
-      | slot_section | snets_section | styles_section | timingdisables_section
-      | via_section
-            ;
-
-design_section: array_name | bus_bit_chars | canplace | cannotoccupy |
-              design_name | die_area | divider_char | 
-              floorplan_name | gcellgrid | history |
-              pin_cap_rule | pin_rule | prop_def_section |
-              row_rule | tech_name | tracks_rule | units
-            ;
-
-
-
-design_name: K_DESIGN {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ';' 
-      {
-            if (defData->callbacks->DesignCbk)
-              CALLBACK(defData->callbacks->DesignCbk, defrDesignStartCbkType, $3);
-            defData->hasDes = 1;
-          }
-
-end_design: K_END K_DESIGN
-          {
-            defData->doneDesign = 1;
-            if (defData->callbacks->DesignEndCbk)
-              CALLBACK(defData->callbacks->DesignEndCbk, defrDesignEndCbkType, 0);
-            // 11/16/2001 - pcr 408334
-            // Return 1 if there is any defData->errors during parsing
-            if (defData->errors)
-                return 1;
-
-            if (!defData->hasVer) {
-              char temp[300];
-              sprintf(temp, "No VERSION statement found, using the default value %2g.", defData->VersionNum);
-              defData->defWarning(7012, temp);            
-            }
-            if (!defData->hasNameCase && defData->VersionNum < 5.6)
-              defData->defWarning(7013, "The DEF file is invalid if NAMESCASESENSITIVE is undefined.\nNAMESCASESENSITIVE is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the NAMESCASESENSITIVE statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.");
-            if (!defData->hasBusBit && defData->VersionNum < 5.6)
-              defData->defWarning(7014, "The DEF file is invalid if BUSBITCHARS is undefined.\nBUSBITCHARS is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the BUSBITCHARS statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.");
-            if (!defData->hasDivChar && defData->VersionNum < 5.6)
-              defData->defWarning(7015, "The DEF file is invalid if DIVIDERCHAR is undefined.\nDIVIDERCHAR is a mandatory statement in the DEF file with version 5.6 and earlier.\nTo define the DIVIDERCHAR statement, refer to the LEF/DEF 5.5 and earlier Language Reference manual.");
-            if (!defData->hasDes)
-              defData->defWarning(7016, "DESIGN is a mandatory statement in the DEF file. Ensure that it exists in the file.");
-          }
-
-tech_name: K_TECH { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ';'
-          { 
-            if (defData->callbacks->TechnologyCbk)
-              CALLBACK(defData->callbacks->TechnologyCbk, defrTechNameCbkType, $3);
-          }
-
-array_name: K_ARRAY {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING ';'
-          { 
-            if (defData->callbacks->ArrayNameCbk)
-              CALLBACK(defData->callbacks->ArrayNameCbk, defrArrayNameCbkType, $3);
-          }
-
-floorplan_name: K_FLOORPLAN { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ';'
-          { 
-            if (defData->callbacks->FloorPlanNameCbk)
-              CALLBACK(defData->callbacks->FloorPlanNameCbk, defrFloorPlanNameCbkType, $3);
-          }
-
-history: K_HISTORY
-          { 
-            if (defData->callbacks->HistoryCbk)
-              CALLBACK(defData->callbacks->HistoryCbk, defrHistoryCbkType, &defData->History_text[0]);
-          }
-
-prop_def_section: K_PROPERTYDEFINITIONS
-          {
-            if (defData->callbacks->PropDefStartCbk)
-              CALLBACK(defData->callbacks->PropDefStartCbk, defrPropDefStartCbkType, 0);
-          }
-    property_defs K_END K_PROPERTYDEFINITIONS
-          { 
-            if (defData->callbacks->PropDefEndCbk)
-              CALLBACK(defData->callbacks->PropDefEndCbk, defrPropDefEndCbkType, 0);
-            defData->real_num = 0;     // just want to make sure it is reset 
-          }
-
-property_defs: // empty 
-        | property_defs property_def
-            { }
-
-property_def: K_DESIGN {defData->dumb_mode = 1; defData->no_num = 1; defData->Prop.clear(); }
-              T_STRING property_type_and_val ';' 
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("design", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->DesignProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_NET { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("net", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->NetProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_SNET { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("specialnet", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->SNetProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_REGION { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("region", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->RegionProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_GROUP { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("group", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->GroupProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_COMPONENT { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("component", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->CompProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_ROW { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("row", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->RowProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-
-        | K_COMPONENTPIN
-          { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->callbacks->PropCbk) {
-                defData->Prop.setPropType("componentpin", $3);
-                CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-              }
-              defData->session->CompPinProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-            }
-        | K_NONDEFAULTRULE
-          { defData->dumb_mode = 1 ; defData->no_num = 1; defData->Prop.clear(); }
-          T_STRING property_type_and_val ';'
-            {
-              if (defData->VersionNum < 5.6) {
-                if (defData->nonDefaultWarnings++ < defData->settings->NonDefaultWarnings) {
-                  defData->defMsg = (char*)malloc(1000); 
-                  sprintf (defData->defMsg,
-                     "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6505, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              } else {
-                if (defData->callbacks->PropCbk) {
-                  defData->Prop.setPropType("nondefaultrule", $3);
-                  CALLBACK(defData->callbacks->PropCbk, defrPropCbkType, &defData->Prop);
-                }
-                defData->session->NDefProp.setPropType(defData->DEFCASE($3), defData->defPropDefType);
-              }
-            }
-        | error ';' { yyerrok; yyclearin;};
-
-property_type_and_val: K_INTEGER { defData->real_num = 0; } opt_range opt_num_val
-            {
-              if (defData->callbacks->PropCbk) defData->Prop.setPropInteger();
-              defData->defPropDefType = 'I';
-            }
-        | K_REAL { defData->real_num = 1; } opt_range opt_num_val
-            {
-              if (defData->callbacks->PropCbk) defData->Prop.setPropReal();
-              defData->defPropDefType = 'R';
-              defData->real_num = 0;
-            }
-        | K_STRING
-            {
-              if (defData->callbacks->PropCbk) defData->Prop.setPropString();
-              defData->defPropDefType = 'S';
-            }
-        | K_STRING QSTRING
-            {
-              if (defData->callbacks->PropCbk) defData->Prop.setPropQString($2);
-              defData->defPropDefType = 'Q';
-            }
-        | K_NAMEMAPSTRING T_STRING
-            {
-              if (defData->callbacks->PropCbk) defData->Prop.setPropNameMapString($2);
-              defData->defPropDefType = 'S';
-            }
-
-opt_num_val: // empty 
-        | NUMBER
-            { if (defData->callbacks->PropCbk) defData->Prop.setNumber($1); }
-
-units: K_UNITS K_DISTANCE K_MICRONS NUMBER ';'
-          {
-            if (defData->callbacks->UnitsCbk) {
-              if (defData->defValidNum((int)$4))
-                CALLBACK(defData->callbacks->UnitsCbk,  defrUnitsCbkType, $4);
-            }
-          }
-
-divider_char: K_DIVIDERCHAR QSTRING ';'
-          {
-            if (defData->callbacks->DividerCbk)
-              CALLBACK(defData->callbacks->DividerCbk, defrDividerCbkType, $2);
-            defData->hasDivChar = 1;
-          }
-
-bus_bit_chars: K_BUSBITCHARS QSTRING ';'
-          { 
-            if (defData->callbacks->BusBitCbk)
-              CALLBACK(defData->callbacks->BusBitCbk, defrBusBitCbkType, $2);
-            defData->hasBusBit = 1;
-          }
-
-canplace: K_CANPLACE {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING NUMBER NUMBER
-            orient K_DO NUMBER  K_BY NUMBER  K_STEP NUMBER NUMBER ';' 
-            {
-              if (defData->callbacks->CanplaceCbk) {
-                defData->Canplace.setName($3);
-                defData->Canplace.setLocation($4,$5);
-                defData->Canplace.setOrient($6);
-                defData->Canplace.setDo($8,$10,$12,$13);
-                CALLBACK(defData->callbacks->CanplaceCbk, defrCanplaceCbkType,
-                &(defData->Canplace));
-              }
-            }
-cannotoccupy: K_CANNOTOCCUPY {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING NUMBER NUMBER
-            orient K_DO NUMBER  K_BY NUMBER  K_STEP NUMBER NUMBER ';' 
-            {
-              if (defData->callbacks->CannotOccupyCbk) {
-                defData->CannotOccupy.setName($3);
-                defData->CannotOccupy.setLocation($4,$5);
-                defData->CannotOccupy.setOrient($6);
-                defData->CannotOccupy.setDo($8,$10,$12,$13);
-                CALLBACK(defData->callbacks->CannotOccupyCbk, defrCannotOccupyCbkType,
-                        &(defData->CannotOccupy));
-              }
-            }
-
-orient: K_N    {$$ = 0;}
-        | K_W  {$$ = 1;}
-        | K_S  {$$ = 2;}
-        | K_E  {$$ = 3;}
-        | K_FN {$$ = 4;}
-        | K_FW {$$ = 5;}
-        | K_FS {$$ = 6;}
-        | K_FE {$$ = 7;}
-
-die_area: K_DIEAREA
-          {
-            defData->Geometries.Reset();
-          }
-          firstPt nextPt otherPts ';'
-          {
-            if (defData->callbacks->DieAreaCbk) {
-               defData->DieArea.addPoint(&defData->Geometries);
-               CALLBACK(defData->callbacks->DieAreaCbk, defrDieAreaCbkType, &(defData->DieArea));
-            }
-          }
-
-// 8/31/2001 - This is obsolete in 5.4 
-pin_cap_rule: start_def_cap pin_caps end_def_cap
-            { }
-
-start_def_cap: K_DEFAULTCAP NUMBER 
-        {
-          if (defData->VersionNum < 5.4) {
-             if (defData->callbacks->DefaultCapCbk)
-                CALLBACK(defData->callbacks->DefaultCapCbk, defrDefaultCapCbkType, ROUND($2));
-          } else {
-             if (defData->callbacks->DefaultCapCbk) // write error only if cbk is set 
-                if (defData->defaultCapWarnings++ < defData->settings->DefaultCapWarnings)
-                   defData->defWarning(7017, "The DEFAULTCAP statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-          }
-        }
-
-pin_caps: // empty 
-        | pin_caps pin_cap
-            ;
-
-pin_cap: K_MINPINS NUMBER K_WIRECAP NUMBER ';'
-          {
-            if (defData->VersionNum < 5.4) {
-              if (defData->callbacks->PinCapCbk) {
-                defData->PinCap.setPin(ROUND($2));
-                defData->PinCap.setCap($4);
-                CALLBACK(defData->callbacks->PinCapCbk, defrPinCapCbkType, &(defData->PinCap));
-              }
-            }
-          }
-
-end_def_cap: K_END K_DEFAULTCAP 
-            { }
-
-pin_rule: start_pins pins end_pins
-            { }
-
-start_pins: K_PINS NUMBER ';'
-          { 
-            if (defData->callbacks->StartPinsCbk)
-              CALLBACK(defData->callbacks->StartPinsCbk, defrStartPinsCbkType, ROUND($2));
-          }
-
-pins: // empty 
-        | pins pin
-            ;
-
-pin: '-' {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING '+' K_NET
-         {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-              defData->Pin.Setup($3, $7);
-            }
-            defData->hasPort = 0;
-          }
-        pin_options ';'
-          { 
-            if (defData->callbacks->PinCbk)
-              CALLBACK(defData->callbacks->PinCbk, defrPinCbkType, &defData->Pin);
-          }
-
-pin_options: // empty 
-        | pin_options pin_option
-
-pin_option: '+' K_SPECIAL
-          {
-            if (defData->callbacks->PinCbk)
-              defData->Pin.setSpecial();
-          }
-
-        | extension_stmt
-          { 
-            if (defData->callbacks->PinExtCbk)
-              CALLBACK(defData->callbacks->PinExtCbk, defrPinExtCbkType, &defData->History_text[0]);
-          }
-
-        | '+' K_DIRECTION T_STRING
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.setDirection($3);
-          }
-
-        | '+' K_NETEXPR QSTRING
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The NETEXPR statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6506, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-                defData->Pin.setNetExpr($3);
-
-            }
-          }
-
-        | '+' K_SUPPLYSENSITIVITY { defData->dumb_mode = 1; } T_STRING
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The SUPPLYSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6507, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-                defData->Pin.setSupplySens($4);
-            }
-          }
-
-        | '+' K_GROUNDSENSITIVITY { defData->dumb_mode = 1; } T_STRING
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The GROUNDSENSITIVITY statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6508, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-                defData->Pin.setGroundSens($4);
-            }
-          }
-
-        | '+' K_USE use_type
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) defData->Pin.setUse($3);
-          }
-        | '+' K_PORT          // 5.7 
-          {
-            if (defData->VersionNum < 5.7) {
-               if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                 if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                     (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                   defData->defMsg = (char*)malloc(10000);
-                   sprintf (defData->defMsg,
-                     "The PORT in PINS is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                   defData->defError(6555, defData->defMsg);
-                   free(defData->defMsg);
-                   CHKERR();
-                 }
-               }
-            } else {
-               if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-                 defData->Pin.addPort();
-               defData->hasPort = 1;
-            }
-          }
-
-        | '+' K_LAYER { defData->dumb_mode = 1; } T_STRING
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-              if (defData->hasPort)
-                 defData->Pin.addPortLayer($4);
-              else
-                 defData->Pin.addLayer($4);
-            }
-          }
-          pin_layer_mask_opt pin_layer_spacing_opt pt pt
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-              if (defData->hasPort)
-                 defData->Pin.addPortLayerPts($8.x, $8.y, $9.x, $9.y);
-              else
-                 defData->Pin.addLayerPts($8.x, $8.y, $9.x, $9.y);
-            }
-          }
-
-        | '+' K_POLYGON { defData->dumb_mode = 1; } T_STRING
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6509, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortPolygon($4);
-                else
-                   defData->Pin.addPolygon($4);
-              }
-            }
-            
-            defData->Geometries.Reset();            
-          }
-          pin_poly_mask_opt pin_poly_spacing_opt firstPt nextPt nextPt otherPts
-          {
-            if (defData->VersionNum >= 5.6) {  // only add if 5.6 or beyond
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortPolygonPts(&defData->Geometries);
-                else
-                   defData->Pin.addPolygonPts(&defData->Geometries);
-              }
-            }
-          }
-        | '+' K_VIA { defData->dumb_mode = 1; } T_STRING pin_via_mask_opt '(' NUMBER NUMBER ')'   // 5.7
-          {
-            if (defData->VersionNum < 5.7) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The PIN VIA statement is available in version 5.7 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6556, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortVia($4, (int)$7,
-                                               (int)$8, $5);
-                else
-                   defData->Pin.addVia($4, (int)$7,
-                                               (int)$8, $5);
-              }
-            }
-          }
-  
-        | placement_status pt orient
-          {
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-              if (defData->hasPort) {
-                 defData->Pin.setPortPlacement($1, $2.x, $2.y, $3);
-                 defData->hasPort = 0;
-              } else
-                 defData->Pin.setPlacement($1, $2.x, $2.y, $3);
-            }
-          }
-
-        // The following is 5.4 syntax 
-        | '+' K_ANTENNAPINPARTIALMETALAREA NUMBER pin_layer_opt
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINPARTIALMETALAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6510, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinPartialMetalArea((int)$3, $4); 
-          }
-        | '+' K_ANTENNAPINPARTIALMETALSIDEAREA NUMBER pin_layer_opt
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINPARTIALMETALSIDEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6511, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinPartialMetalSideArea((int)$3, $4); 
-          }
-        | '+' K_ANTENNAPINGATEAREA NUMBER pin_layer_opt
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINGATEAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6512, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-                defData->Pin.addAPinGateArea((int)$3, $4); 
-            }
-        | '+' K_ANTENNAPINDIFFAREA NUMBER pin_layer_opt
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINDIFFAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6513, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinDiffArea((int)$3, $4); 
-          }
-        | '+' K_ANTENNAPINMAXAREACAR NUMBER K_LAYER {defData->dumb_mode=1;} T_STRING
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINMAXAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6514, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinMaxAreaCar((int)$3, $6); 
-          }
-        | '+' K_ANTENNAPINMAXSIDEAREACAR NUMBER K_LAYER {defData->dumb_mode=1;}
-           T_STRING
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINMAXSIDEAREACAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6515, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinMaxSideAreaCar((int)$3, $6); 
-          }
-        | '+' K_ANTENNAPINPARTIALCUTAREA NUMBER pin_layer_opt
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINPARTIALCUTAREA statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6516, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinPartialCutArea((int)$3, $4); 
-          }
-        | '+' K_ANTENNAPINMAXCUTCAR NUMBER K_LAYER {defData->dumb_mode=1;} T_STRING
-          {
-            if (defData->VersionNum <= 5.3) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAPINMAXCUTCAR statement is available in version 5.4 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6517, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAPinMaxCutCar((int)$3, $6); 
-          }
-        | '+' K_ANTENNAMODEL pin_oxide
-          {  // 5.5 syntax 
-            if (defData->VersionNum < 5.5) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The ANTENNAMODEL statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6518, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-          }
-
-pin_layer_mask_opt: // empty 
-        | K_MASK NUMBER
-         { 
-           if (defData->validateMaskInput((int)$2, defData->pinWarnings, defData->settings->PinWarnings)) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortLayerMask((int)$2);
-                else
-                   defData->Pin.addLayerMask((int)$2);
-              }
-           }
-         }
-         
-pin_via_mask_opt: 
-        // empty 
-        { $$ = 0; }
-        | K_MASK NUMBER
-         { 
-           if (defData->validateMaskInput((int)$2, defData->pinWarnings, defData->settings->PinWarnings)) {
-             $$ = $2;
-           }
-         }
-         
-pin_poly_mask_opt: // empty 
-        | K_MASK NUMBER
-         { 
-           if (defData->validateMaskInput((int)$2, defData->pinWarnings, defData->settings->PinWarnings)) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortPolyMask((int)$2);
-                else
-                   defData->Pin.addPolyMask((int)$2);
-              }
-           }
-         }
-   
-         
-pin_layer_spacing_opt: // empty 
-        | K_SPACING NUMBER
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6519, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortLayerSpacing((int)$2);
-                else
-                   defData->Pin.addLayerSpacing((int)$2);
-              }
-            }
-          }
-        | K_DESIGNRULEWIDTH NUMBER
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "DESIGNRULEWIDTH statement is a version 5.6 and later syntax.\nYour def file is defined with version %g", defData->VersionNum);
-                  defData->defError(6520, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortLayerDesignRuleWidth((int)$2);
-                else
-                   defData->Pin.addLayerDesignRuleWidth((int)$2);
-              }
-            }
-          }
-
-pin_poly_spacing_opt: // empty 
-        | K_SPACING NUMBER
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "SPACING statement is a version 5.6 and later syntax.\nYour def file is defined with version %g", defData->VersionNum);
-                  defData->defError(6521, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortPolySpacing((int)$2);
-                else
-                   defData->Pin.addPolySpacing((int)$2);
-              }
-            }
-          }
-        | K_DESIGNRULEWIDTH NUMBER
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if ((defData->pinWarnings++ < defData->settings->PinWarnings) &&
-                    (defData->pinWarnings++ < defData->settings->PinExtWarnings)) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The DESIGNRULEWIDTH statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                  defData->defError(6520, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            } else {
-              if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk) {
-                if (defData->hasPort)
-                   defData->Pin.addPortPolyDesignRuleWidth((int)$2);
-                else
-                   defData->Pin.addPolyDesignRuleWidth((int)$2);
-              }
-            }
-          }
-
-pin_oxide: K_OXIDE1
-          { defData->aOxide = 1;
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAntennaModel(defData->aOxide);
-          }
-        | K_OXIDE2
-          { defData->aOxide = 2;
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAntennaModel(defData->aOxide);
-          }
-        | K_OXIDE3
-          { defData->aOxide = 3;
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAntennaModel(defData->aOxide);
-          }
-        | K_OXIDE4
-          { defData->aOxide = 4;
-            if (defData->callbacks->PinCbk || defData->callbacks->PinExtCbk)
-              defData->Pin.addAntennaModel(defData->aOxide);
-          }
-
-use_type: K_SIGNAL
-          { $$ = (char*)"SIGNAL"; }
-        | K_POWER
-          { $$ = (char*)"POWER"; }
-        | K_GROUND
-          { $$ = (char*)"GROUND"; }
-        | K_CLOCK
-          { $$ = (char*)"CLOCK"; }
-        | K_TIEOFF
-          { $$ = (char*)"TIEOFF"; }
-        | K_ANALOG
-          { $$ = (char*)"ANALOG"; }
-        | K_SCAN
-          { $$ = (char*)"SCAN"; }
-        | K_RESET
-          { $$ = (char*)"RESET"; }
-
-pin_layer_opt:
-        // empty 
-          { $$ = (char*)""; }
-        | K_LAYER {defData->dumb_mode=1;} T_STRING
-          { $$ = $3; }
-
-end_pins: K_END K_PINS
-        { 
-          if (defData->callbacks->PinEndCbk)
-            CALLBACK(defData->callbacks->PinEndCbk, defrPinEndCbkType, 0);
-        }
-
-row_rule: K_ROW {defData->dumb_mode = 2; defData->no_num = 2; } T_STRING T_STRING NUMBER NUMBER
-      orient
-        {
-          if (defData->callbacks->RowCbk) {
-            defData->rowName = $3;
-            defData->Row.setup($3, $4, $5, $6, $7);
-          }
-        }
-      row_do_option
-      row_options ';'
-        {
-          if (defData->callbacks->RowCbk) 
-            CALLBACK(defData->callbacks->RowCbk, defrRowCbkType, &defData->Row);
-        }
-
-row_do_option: // empty 
-        {
-          if (defData->VersionNum < 5.6) {
-            if (defData->callbacks->RowCbk) {
-              if (defData->rowWarnings++ < defData->settings->RowWarnings) {
-                defData->defError(6523, "Invalid ROW statement defined in the DEF file. The DO statement which is required in the ROW statement is not defined.\nUpdate your DEF file with a DO statement.");
-                CHKERR();
-              }
-            }
-          }
-        }
-      | K_DO NUMBER K_BY NUMBER row_step_option
-        {
-          // 06/05/2002 - pcr 448455 
-          // Check for 1 and 0 in the correct position 
-          // 07/26/2002 - Commented out due to pcr 459218 
-          if (defData->hasDoStep) {
-            // 04/29/2004 - pcr 695535 
-            // changed the testing 
-            if ((($4 == 1) && (defData->yStep == 0)) ||
-                (($2 == 1) && (defData->xStep == 0))) {
-              // do nothing 
-            } else 
-              if (defData->VersionNum < 5.6) {
-                if (defData->callbacks->RowCbk) {
-                  if (defData->rowWarnings++ < defData->settings->RowWarnings) {
-                    defData->defMsg = (char*)malloc(1000);
-                    sprintf(defData->defMsg,
-                            "The DO statement in the ROW statement with the name %s has invalid syntax.\nThe valid syntax is \"DO numX BY 1 STEP spaceX 0 | DO 1 BY numY STEP 0 spaceY\".\nSpecify the valid syntax and try again.", defData->rowName);
-                    defData->defWarning(7018, defData->defMsg);
-                    free(defData->defMsg);
-                    }
-                  }
-              }
-          }
-          // pcr 459218 - Error if at least numX or numY does not equal 1 
-          if (($2 != 1) && ($4 != 1)) {
-            if (defData->callbacks->RowCbk) {
-              if (defData->rowWarnings++ < defData->settings->RowWarnings) {
-                defData->defError(6524, "Invalid syntax specified. The valid syntax is either \"DO 1 BY num or DO num BY 1\". Specify the valid syntax and try again.");
-                CHKERR();
-              }
-            }
-          }
-          if (defData->callbacks->RowCbk)
-            defData->Row.setDo(ROUND($2), ROUND($4), defData->xStep, defData->yStep);
-        }
-
-row_step_option: // empty 
-        {
-          defData->hasDoStep = 0;
-        }
-      | K_STEP NUMBER NUMBER
-        {
-          defData->hasDoStep = 1;
-          defData->Row.setHasDoStep();
-          defData->xStep = $2;
-          defData->yStep = $3;
-        }
-
-row_options: // empty 
-      | row_options row_option
-      ;
-
-row_option : '+' K_PROPERTY {defData->dumb_mode = DEF_MAX_INT; }
-             row_prop_list
-         { defData->dumb_mode = 0; }
-
-row_prop_list : // empty 
-       | row_prop_list row_prop
-       ;
-       
-row_prop : T_STRING NUMBER
-        {
-          if (defData->callbacks->RowCbk) {
-             char propTp;
-             char* str = defData->ringCopy("                       ");
-             propTp =  defData->session->RowProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "ROW");
-             // For backword compatibility, also set the string value 
-             sprintf(str, "%g", $2);
-             defData->Row.addNumProperty($1, $2, str, propTp);
-          }
-        }
-      | T_STRING QSTRING
-        {
-          if (defData->callbacks->RowCbk) {
-             char propTp;
-             propTp =  defData->session->RowProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "ROW");
-             defData->Row.addProperty($1, $2, propTp);
-          }
-        }
-      | T_STRING T_STRING
-        {
-          if (defData->callbacks->RowCbk) {
-             char propTp;
-             propTp =  defData->session->RowProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "ROW");
-             defData->Row.addProperty($1, $2, propTp);
-          }
-        }
-
-tracks_rule: track_start NUMBER
-        {
-          if (defData->callbacks->TrackCbk) {
-            defData->Track.setup($1);
-          }
-        }
-        K_DO NUMBER K_STEP NUMBER track_opts ';' 
-        {
-          if (($5 <= 0) && (defData->VersionNum >= 5.4)) {
-            if (defData->callbacks->TrackCbk)
-              if (defData->trackWarnings++ < defData->settings->TrackWarnings) {
-                defData->defMsg = (char*)malloc(1000);
-                sprintf (defData->defMsg,
-                   "The DO number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", $5);
-                defData->defError(6525, defData->defMsg);
-                free(defData->defMsg);
-              }
-          }
-          if ($7 < 0) {
-            if (defData->callbacks->TrackCbk)
-              if (defData->trackWarnings++ < defData->settings->TrackWarnings) {
-                defData->defMsg = (char*)malloc(1000);
-                sprintf (defData->defMsg,
-                   "The STEP number %g in TRACK is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", $7);
-                defData->defError(6526, defData->defMsg);
-                free(defData->defMsg);
-              }
-          }
-          if (defData->callbacks->TrackCbk) {
-            defData->Track.setDo(ROUND($2), ROUND($5), $7);
-            CALLBACK(defData->callbacks->TrackCbk, defrTrackCbkType, &defData->Track);
-          }
-        }
-
-track_start: K_TRACKS track_type
-        {
-          $$ = $2;
-        }
-
-track_type: K_X
-            { $$ = (char*)"X";}
-        | K_Y
-            { $$ = (char*)"Y";}
-            
-track_opts: track_mask_statement track_layer_statement
-        
-track_mask_statement: // empty 
-        | K_MASK NUMBER same_mask
-           { 
-              if (defData->validateMaskInput((int)$2, defData->trackWarnings, defData->settings->TrackWarnings)) {
-                  if (defData->callbacks->TrackCbk) {
-                    defData->Track.addMask($2, $3);
-                  }
-               }
-            }
-            
-same_mask: 
-        // empty 
-        { $$ = 0; }
-        | K_SAMEMASK
-        { $$ = 1; }
-        
-track_layer_statement: // empty 
-        | K_LAYER { defData->dumb_mode = 1000; } track_layer track_layers
-            { defData->dumb_mode = 0; }
-
-track_layers: // empty 
-        | track_layer track_layers 
-            ;
-
-track_layer: T_STRING
-        {
-          if (defData->callbacks->TrackCbk)
-            defData->Track.addLayer($1);
-        }
-
-gcellgrid: K_GCELLGRID track_type NUMBER 
-     K_DO NUMBER K_STEP NUMBER ';'
-        {
-          if ($5 <= 0) {
-            if (defData->callbacks->GcellGridCbk)
-              if (defData->gcellGridWarnings++ < defData->settings->GcellGridWarnings) {
-                defData->defMsg = (char*)malloc(1000);
-                sprintf (defData->defMsg,
-                   "The DO number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", $5);
-                defData->defError(6527, defData->defMsg);
-                free(defData->defMsg);
-              }
-          }
-          if ($7 < 0) {
-            if (defData->callbacks->GcellGridCbk)
-              if (defData->gcellGridWarnings++ < defData->settings->GcellGridWarnings) {
-                defData->defMsg = (char*)malloc(1000);
-                sprintf (defData->defMsg,
-                   "The STEP number %g in GCELLGRID is invalid.\nThe number value has to be greater than 0. Specify the valid syntax and try again.", $7);
-                defData->defError(6528, defData->defMsg);
-                free(defData->defMsg);
-              }
-          }
-          if (defData->callbacks->GcellGridCbk) {
-            defData->GcellGrid.setup($2, ROUND($3), ROUND($5), $7);
-            CALLBACK(defData->callbacks->GcellGridCbk, defrGcellGridCbkType, &defData->GcellGrid);
-          }
-        }
-
-extension_section: K_BEGINEXT
-        {
-          if (defData->callbacks->ExtensionCbk)
-             CALLBACK(defData->callbacks->ExtensionCbk, defrExtensionCbkType, &defData->History_text[0]);
-        }
-
-extension_stmt: '+' K_BEGINEXT
-        { }
-
-via_section: via via_declarations via_end
-            ;
-        
-via: K_VIAS NUMBER ';' 
-        {
-          if (defData->callbacks->ViaStartCbk)
-            CALLBACK(defData->callbacks->ViaStartCbk, defrViaStartCbkType, ROUND($2));
-        }
-
-via_declarations: // empty 
-        | via_declarations via_declaration
-            ;
-
-via_declaration: '-' {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING
-            {
-              if (defData->callbacks->ViaCbk) defData->Via.setup($3);
-              defData->viaRule = 0;
-            }
-        layer_stmts ';'
-            {
-              if (defData->callbacks->ViaCbk)
-                CALLBACK(defData->callbacks->ViaCbk, defrViaCbkType, &defData->Via);
-              defData->Via.clear();
-            }
-
-layer_stmts: // empty 
-        | layer_stmts layer_stmt
-            ;
-
-layer_stmt: '+' K_RECT {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING mask pt pt 
-            { 
-              if (defData->callbacks->ViaCbk)
-                if (defData->validateMaskInput($5, defData->viaWarnings, defData->settings->ViaWarnings)) {
-                    defData->Via.addLayer($4, $6.x, $6.y, $7.x, $7.y, $5);
-                }
-            }
-        | '+' K_POLYGON { defData->dumb_mode = 1; } T_STRING mask
-            {
-              if (defData->VersionNum < 5.6) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defMsg = (char*)malloc(1000);
-                    sprintf (defData->defMsg,
-                       "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                    defData->defError(6509, defData->defMsg);
-                    free(defData->defMsg);
-                    CHKERR();
-                  }
-                }
-              }
-              
-              defData->Geometries.Reset();
-              
-            }
-            firstPt nextPt nextPt otherPts
-            {
-              if (defData->VersionNum >= 5.6) {  // only add if 5.6 or beyond
-                if (defData->callbacks->ViaCbk)
-                  if (defData->validateMaskInput($5, defData->viaWarnings, defData->settings->ViaWarnings)) {
-                    defData->Via.addPolygon($4, &defData->Geometries, $5);
-                  }
-              }
-            }
-        | '+' K_PATTERNNAME {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING
-            {
-              if (defData->VersionNum < 5.6) {
-                if (defData->callbacks->ViaCbk)
-                  defData->Via.addPattern($4);
-              } else
-                if (defData->callbacks->ViaCbk)
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings)
-                    defData->defWarning(7019, "The PATTERNNAME statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement."); 
-            }
-        | '+' K_VIARULE {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING
-          '+' K_CUTSIZE NUMBER NUMBER
-          '+' K_LAYERS {defData->dumb_mode = 3;defData->no_num = 1; } T_STRING T_STRING T_STRING
-          '+' K_CUTSPACING NUMBER NUMBER
-          '+' K_ENCLOSURE NUMBER NUMBER NUMBER NUMBER
-            {
-               defData->viaRule = 1;
-               if (defData->VersionNum < 5.6) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defMsg = (char*)malloc(1000);
-                    sprintf (defData->defMsg,
-                       "The VIARULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                    defData->defError(6557, defData->defMsg);
-                    free(defData->defMsg);
-                    CHKERR();
-                  }
-                }
-              } else {
-                if (defData->callbacks->ViaCbk)
-                   defData->Via.addViaRule($4, (int)$7, (int)$8, $12, $13,
-                                             $14, (int)$17, (int)$18, (int)$21,
-                                             (int)$22, (int)$23, (int)$24); 
-              }
-            }
-        | layer_viarule_opts
-        | extension_stmt
-          { 
-            if (defData->callbacks->ViaExtCbk)
-              CALLBACK(defData->callbacks->ViaExtCbk, defrViaExtCbkType, &defData->History_text[0]);
-          }
-
-layer_viarule_opts: '+' K_ROWCOL NUMBER NUMBER
-            {
-              if (!defData->viaRule) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defError(6559, "The ROWCOL statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.");
-                    CHKERR();
-                  }
-                }
-              } else if (defData->callbacks->ViaCbk)
-                 defData->Via.addRowCol((int)$3, (int)$4);
-            }
-        | '+' K_ORIGIN NUMBER NUMBER
-            {
-              if (!defData->viaRule) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defError(6560, "The ORIGIN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.");
-                    CHKERR();
-                  }
-                }
-              } else if (defData->callbacks->ViaCbk)
-                 defData->Via.addOrigin((int)$3, (int)$4);
-            }
-        | '+' K_OFFSET NUMBER NUMBER NUMBER NUMBER
-            {
-              if (!defData->viaRule) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defError(6561, "The OFFSET statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.");
-                    CHKERR();
-                  }
-                }
-              } else if (defData->callbacks->ViaCbk)
-                 defData->Via.addOffset((int)$3, (int)$4, (int)$5, (int)$6);
-            }
-        | '+' K_PATTERN {defData->dumb_mode = 1;defData->no_num = 1; } T_STRING 
-            {
-              if (!defData->viaRule) {
-                if (defData->callbacks->ViaCbk) {
-                  if (defData->viaWarnings++ < defData->settings->ViaWarnings) {
-                    defData->defError(6562, "The PATTERN statement is missing from the VIARULE statement. Ensure that it exists in the VIARULE statement.");
-                    CHKERR();
-                  }
-                }
-              } else if (defData->callbacks->ViaCbk)
-                 defData->Via.addCutPattern($4);
-            }
-
-firstPt: pt
-          { defData->Geometries.startList($1.x, $1.y); }
-
-nextPt: pt
-          { defData->Geometries.addToList($1.x, $1.y); }
-
-otherPts: // empty 
-        | otherPts nextPt
-        ;
-
-pt: '(' NUMBER NUMBER ')'
-          {
-            defData->save_x = $2;
-            defData->save_y = $3;
-            $$.x = ROUND($2);
-            $$.y = ROUND($3);
-          }
-        | '(' '*' NUMBER ')'
-          {
-            defData->save_y = $3;
-            $$.x = ROUND(defData->save_x);
-            $$.y = ROUND($3);
-          }
-        | '(' NUMBER '*' ')'
-          {
-            defData->save_x = $2;
-            $$.x = ROUND($2);
-            $$.y = ROUND(defData->save_y);
-          }
-        | '(' '*' '*' ')'
-          {
-            $$.x = ROUND(defData->save_x);
-            $$.y = ROUND(defData->save_y);
-          }
-          
-mask: // empty 
-      { $$ = 0; }
-      | '+' K_MASK NUMBER
-      { $$ = $3; }
-
-via_end: K_END K_VIAS
-        { 
-          if (defData->callbacks->ViaEndCbk)
-            CALLBACK(defData->callbacks->ViaEndCbk, defrViaEndCbkType, 0);
-        }
-
-regions_section: regions_start regions_stmts K_END K_REGIONS
-        {
-          if (defData->callbacks->RegionEndCbk)
-            CALLBACK(defData->callbacks->RegionEndCbk, defrRegionEndCbkType, 0);
-        }
-
-regions_start: K_REGIONS NUMBER ';'
-        {
-          if (defData->callbacks->RegionStartCbk)
-            CALLBACK(defData->callbacks->RegionStartCbk, defrRegionStartCbkType, ROUND($2));
-        }
-
-regions_stmts: // empty 
-        | regions_stmts regions_stmt
-            {}
-
-regions_stmt: '-' { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        {
-          if (defData->callbacks->RegionCbk)
-             defData->Region.setup($3);
-          defData->regTypeDef = 0;
-        }
-     rect_list region_options ';'
-        { CALLBACK(defData->callbacks->RegionCbk, defrRegionCbkType, &defData->Region); }
-
-rect_list :
-      pt pt
-        { if (defData->callbacks->RegionCbk)
-          defData->Region.addRect($1.x, $1.y, $2.x, $2.y); }
-      | rect_list pt pt
-        { if (defData->callbacks->RegionCbk)
-          defData->Region.addRect($2.x, $2.y, $3.x, $3.y); }
-      ;
-
-region_options: // empty 
-      | region_options region_option
-      ;
-
-region_option : '+' K_PROPERTY {defData->dumb_mode = DEF_MAX_INT; }
-                region_prop_list
-         { defData->dumb_mode = 0; }
-      | '+' K_TYPE region_type      // 5.4.1 
-         {
-           if (defData->regTypeDef) {
-              if (defData->callbacks->RegionCbk) {
-                if (defData->regionWarnings++ < defData->settings->RegionWarnings) {
-                  defData->defError(6563, "The TYPE statement already exists. It has been defined in the REGION statement.");
-                  CHKERR();
-                }
-              }
-           }
-           if (defData->callbacks->RegionCbk) defData->Region.setType($3);
-           defData->regTypeDef = 1;
-         }
-      ;
-
-region_prop_list : // empty 
-       | region_prop_list region_prop
-       ;
-       
-region_prop : T_STRING NUMBER
-        {
-          if (defData->callbacks->RegionCbk) {
-             char propTp;
-             char* str = defData->ringCopy("                       ");
-             propTp = defData->session->RegionProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "REGION");
-             // For backword compatibility, also set the string value 
-             // We will use a temporary string to store the number.
-             // The string space is borrowed from the ring buffer
-             // in the lexer.
-             sprintf(str, "%g", $2);
-             defData->Region.addNumProperty($1, $2, str, propTp);
-          }
-        }
-      | T_STRING QSTRING
-        {
-          if (defData->callbacks->RegionCbk) {
-             char propTp;
-             propTp = defData->session->RegionProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "REGION");
-             defData->Region.addProperty($1, $2, propTp);
-          }
-        }
-      | T_STRING T_STRING
-        {
-          if (defData->callbacks->RegionCbk) {
-             char propTp;
-             propTp = defData->session->RegionProp.propType($1);
-             CHKPROPTYPE(propTp, $1, "REGION");
-             defData->Region.addProperty($1, $2, propTp);
-          }
-        }
-
-region_type: K_FENCE
-            { $$ = (char*)"FENCE"; }
-      | K_GUIDE
-            { $$ = (char*)"GUIDE"; }
-  
-comps_maskShift_section : K_COMPSMASKSHIFT  layer_statement ';'
-         {
-           if (defData->VersionNum < 5.8) {
-                if (defData->componentWarnings++ < defData->settings->ComponentWarnings) {
-                   defData->defMsg = (char*)malloc(10000);
-                   sprintf (defData->defMsg,
-                     "The MASKSHIFT statement is available in version 5.8 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                   defData->defError(7415, defData->defMsg);
-                   free(defData->defMsg);
-                   CHKERR();
-                }
-            }
-            if (defData->callbacks->ComponentMaskShiftLayerCbk) {
-                CALLBACK(defData->callbacks->ComponentMaskShiftLayerCbk, defrComponentMaskShiftLayerCbkType, &defData->ComponentMaskShiftLayer);
-            }
-         }
-                 
-comps_section: start_comps comps_rule end_comps
-            ;
-         
-start_comps: K_COMPS NUMBER ';'
-         { 
-            if (defData->callbacks->ComponentStartCbk)
-              CALLBACK(defData->callbacks->ComponentStartCbk, defrComponentStartCbkType,
-                       ROUND($2));
-         }
-         
-layer_statement : // empty 
-         | layer_statement maskLayer
-         ;
-         
-maskLayer: T_STRING
-        {
-            if (defData->callbacks->ComponentMaskShiftLayerCbk) {
-              defData->ComponentMaskShiftLayer.addMaskShiftLayer($1);
-            }
-        } 
-
-comps_rule: // empty 
-        | comps_rule comp
-            ;
-
-comp: comp_start comp_options ';'
-         {
-            if (defData->callbacks->ComponentCbk)
-              CALLBACK(defData->callbacks->ComponentCbk, defrComponentCbkType, &defData->Component);
-         }
-
-comp_start: comp_id_and_name comp_net_list
-         {
-            defData->dumb_mode = 0;
-            defData->no_num = 0;
-         }
-
-comp_id_and_name: '-' {defData->dumb_mode = DEF_MAX_INT; defData->no_num = DEF_MAX_INT; }
-       T_STRING T_STRING
-         {
-            if (defData->callbacks->ComponentCbk)
-              defData->Component.IdAndName($3, $4);
-         }
-
-comp_net_list: // empty 
-        { }
-        | comp_net_list '*'
-            {
-              if (defData->callbacks->ComponentCbk)
-                defData->Component.addNet("*");
-            }
-        | comp_net_list T_STRING
-            {
-              if (defData->callbacks->ComponentCbk)
-                defData->Component.addNet($2);
-            }
-            
-comp_options: // empty 
-        |     comp_options comp_option
-            ;
-    
-comp_option:  comp_generate | comp_source | comp_type | weight | maskShift |
-              comp_foreign | comp_region | comp_eeq | comp_halo |
-              comp_routehalo | comp_property | comp_extension_stmt
-            ;
-
-comp_extension_stmt: extension_stmt
-        {
-          if (defData->callbacks->ComponentCbk)
-            CALLBACK(defData->callbacks->ComponentExtCbk, defrComponentExtCbkType,
-                     &defData->History_text[0]);
-        }
-
-comp_eeq: '+' K_EEQMASTER {defData->dumb_mode=1; defData->no_num = 1; } T_STRING
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setEEQ($4);
-        }
-
-comp_generate: '+' K_COMP_GEN { defData->dumb_mode = 2;  defData->no_num = 2; } T_STRING
-    opt_pattern
-        {
-          if (defData->callbacks->ComponentCbk)
-             defData->Component.setGenerate($4, $5);
-        }
-opt_pattern :
-    // empty 
-      { $$ = (char*)""; }
-    | T_STRING
-      { $$ = $1; }
-
-comp_source: '+' K_SOURCE source_type 
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setSource($3);
-        }
-
-source_type: K_NETLIST
-            { $$ = (char*)"NETLIST"; }
-        | K_DIST
-            { $$ = (char*)"DIST"; }
-        | K_USER
-            { $$ = (char*)"USER"; }
-        | K_TIMING
-            { $$ = (char*)"TIMING"; }
-
-
-comp_region:
-        comp_region_start comp_pnt_list
-        { }
-        | comp_region_start T_STRING 
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setRegionName($2);
-        }
-
-comp_pnt_list: pt pt
-        { 
-          // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-          if (defData->VersionNum < 5.5) {
-            if (defData->callbacks->ComponentCbk)
-               defData->Component.setRegionBounds($1.x, $1.y, 
-                                                            $2.x, $2.y);
-          }
-          else
-            defData->defWarning(7020, "The REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-        } 
-    | comp_pnt_list pt pt
-        { 
-          // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-          if (defData->VersionNum < 5.5) {
-            if (defData->callbacks->ComponentCbk)
-               defData->Component.setRegionBounds($2.x, $2.y,
-                                                            $3.x, $3.y);
-          }
-          else
-            defData->defWarning(7020, "The REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-        } 
-
-comp_halo: '+' K_HALO                    // 5.7 
-        {
-          if (defData->VersionNum < 5.6) {
-             if (defData->callbacks->ComponentCbk) {
-               if (defData->componentWarnings++ < defData->settings->ComponentWarnings) {
-                 defData->defMsg = (char*)malloc(1000);
-                 sprintf (defData->defMsg,
-                    "The HALO statement is a version 5.6 and later syntax.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                 defData->defError(6529, defData->defMsg);
-                 free(defData->defMsg);
-                 CHKERR();
-               }
-             }
-          }
-        }
-        halo_soft NUMBER NUMBER NUMBER NUMBER 
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setHalo((int)$5, (int)$6,
-                                                 (int)$7, (int)$8);
-        }
-
-halo_soft: // 5.7 
-    | K_SOFT
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->ComponentCbk) {
-             if (defData->componentWarnings++ < defData->settings->ComponentWarnings) {
-                defData->defMsg = (char*)malloc(10000);
-                sprintf (defData->defMsg,
-                  "The HALO SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                defData->defError(6550, defData->defMsg);
-                free(defData->defMsg);
-                CHKERR();
-             }
-           }
-        } else {
-           if (defData->callbacks->ComponentCbk)
-             defData->Component.setHaloSoft();
-        }
-      }
-
-// 5.7 
-comp_routehalo: '+' K_ROUTEHALO NUMBER { defData->dumb_mode = 2; defData->no_num = 2; } T_STRING T_STRING
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->ComponentCbk) {
-             if (defData->componentWarnings++ < defData->settings->ComponentWarnings) {
-                defData->defMsg = (char*)malloc(10000);
-                sprintf (defData->defMsg,
-                  "The ROUTEHALO is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                defData->defError(6551, defData->defMsg);
-                free(defData->defMsg);
-                CHKERR();
-             }
-           }
-        } else {
-           if (defData->callbacks->ComponentCbk)
-             defData->Component.setRouteHalo(
-                            (int)$3, $5, $6);
-        }
-      }
-
-comp_property: '+' K_PROPERTY { defData->dumb_mode = DEF_MAX_INT; }
-      comp_prop_list
-      { defData->dumb_mode = 0; }
-
-comp_prop_list: comp_prop
-    | comp_prop_list comp_prop
-          ;
-
-comp_prop: T_STRING NUMBER
-        {
-          if (defData->callbacks->ComponentCbk) {
-            char propTp;
-            char* str = defData->ringCopy("                       ");
-            propTp = defData->session->CompProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "COMPONENT");
-            sprintf(str, "%g", $2);
-            defData->Component.addNumProperty($1, $2, str, propTp);
-          }
-        }
-     | T_STRING QSTRING
-        {
-          if (defData->callbacks->ComponentCbk) {
-            char propTp;
-            propTp = defData->session->CompProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "COMPONENT");
-            defData->Component.addProperty($1, $2, propTp);
-          }
-        }
-     | T_STRING T_STRING
-        {
-          if (defData->callbacks->ComponentCbk) {
-            char propTp;
-            propTp = defData->session->CompProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "COMPONENT");
-            defData->Component.addProperty($1, $2, propTp);
-          }
-        }
-
-comp_region_start: '+' K_REGION
-        { defData->dumb_mode = 1; defData->no_num = 1; }
-
-comp_foreign: '+' K_FOREIGN { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        opt_paren orient
-        { 
-          if (defData->VersionNum < 5.6) {
-            if (defData->callbacks->ComponentCbk) {
-              defData->Component.setForeignName($4);
-              defData->Component.setForeignLocation($5.x, $5.y, $6);
-            }
-         } else
-            if (defData->callbacks->ComponentCbk)
-              if (defData->componentWarnings++ < defData->settings->ComponentWarnings)
-                defData->defWarning(7021, "The FOREIGN statement is obsolete in version 5.6 and later.\nThe DEF parser will ignore this statement.");
-         }
-
-opt_paren:
-       pt
-         { $$ = $1; }
-       | NUMBER NUMBER
-         { $$.x = ROUND($1); $$.y = ROUND($2); }
-
-comp_type: placement_status pt orient
-        {
-          if (defData->callbacks->ComponentCbk) {
-            defData->Component.setPlacementStatus($1);
-            defData->Component.setPlacementLocation($2.x, $2.y, $3);
-          }
-        }
-        | '+' K_UNPLACED
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setPlacementStatus(
-                                         DEFI_COMPONENT_UNPLACED);
-            defData->Component.setPlacementLocation(-1, -1, -1);
-        }
-        | '+' K_UNPLACED pt orient
-        {
-          if (defData->VersionNum < 5.4) {   // PCR 495463 
-            if (defData->callbacks->ComponentCbk) {
-              defData->Component.setPlacementStatus(
-                                          DEFI_COMPONENT_UNPLACED);
-              defData->Component.setPlacementLocation($3.x, $3.y, $4);
-            }
-          } else {
-            if (defData->componentWarnings++ < defData->settings->ComponentWarnings)
-               defData->defWarning(7022, "In the COMPONENT UNPLACED statement, point and orient are invalid in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-          }
-        }
-
-        // Adding 'no_num' modification, otherwise the token will be parsed as number (double). 
-maskShift: '+' K_MASKSHIFT { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        {  
-          if (defData->callbacks->ComponentCbk) {
-            if (defData->validateMaskShiftInput($4, defData->componentWarnings, defData->settings->ComponentWarnings)) {
-                defData->Component.setMaskShift($4);
-            }
-          }
-        }
-        
-placement_status: '+' K_FIXED 
-        { $$ = DEFI_COMPONENT_FIXED; }
-        | '+' K_COVER 
-        { $$ = DEFI_COMPONENT_COVER; }
-        | '+' K_PLACED
-        { $$ = DEFI_COMPONENT_PLACED; }
-
-weight: '+' K_WEIGHT NUMBER 
-        {
-          if (defData->callbacks->ComponentCbk)
-            defData->Component.setWeight(ROUND($3));
-        }
-
-end_comps: K_END K_COMPS
-        { 
-          if (defData->callbacks->ComponentCbk)
-            CALLBACK(defData->callbacks->ComponentEndCbk, defrComponentEndCbkType, 0);
-        }
-
-nets_section:  start_nets net_rules end_nets
-        ;
-
-start_nets: K_NETS NUMBER ';'
-        { 
-          if (defData->callbacks->NetStartCbk)
-            CALLBACK(defData->callbacks->NetStartCbk, defrNetStartCbkType, ROUND($2));
-          defData->netOsnet = 1;
-        }
-
-net_rules: // empty 
-        | net_rules one_net
-            ;
-
-one_net: net_and_connections net_options ';'
-        { 
-          if (defData->callbacks->NetCbk)
-            CALLBACK(defData->callbacks->NetCbk, defrNetCbkType, &defData->Net);
-        }
-/*
-** net_and_connections: net_start {defData->dumb_mode = DEF_MAX_INT; no_num = DEF_MAX_INT;}
-**                      net_connections
-** wmd -- this can be used to replace
-**        | '(' K_PIN {defData->dumb_mode = 1; no_num = 1;} T_STRING conn_opt ')' (???)
-*/
-net_and_connections: net_start
-        {defData->dumb_mode = 0; defData->no_num = 0; }
-
-/* pcr 235555 & 236210 */
-net_start: '-' {defData->dumb_mode = DEF_MAX_INT; defData->no_num = DEF_MAX_INT; defData->nondef_is_keyword = TRUE; defData->mustjoin_is_keyword = TRUE;} net_name 
-
-net_name: T_STRING
-        {
-          // 9/22/1999 
-          // this is shared by both net and special net 
-          if ((defData->callbacks->NetCbk && (defData->netOsnet==1)) || (defData->callbacks->SNetCbk && (defData->netOsnet==2)))
-            defData->Net.setName($1);
-          if (defData->callbacks->NetNameCbk)
-            CALLBACK(defData->callbacks->NetNameCbk, defrNetNameCbkType, $1);
-        } net_connections
-        | K_MUSTJOIN '(' T_STRING {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING ')'
-        {
-          if ((defData->callbacks->NetCbk && (defData->netOsnet==1)) || (defData->callbacks->SNetCbk && (defData->netOsnet==2)))
-            defData->Net.addMustPin($3, $5, 0);
-          defData->dumb_mode = 3;
-          defData->no_num = 3;
-        }
-
-net_connections: // empty 
-        | net_connections net_connection 
-        ;
-
-net_connection: '(' T_STRING {defData->dumb_mode = DEF_MAX_INT; defData->no_num = DEF_MAX_INT;}
-                T_STRING conn_opt ')'
-        {
-          // 9/22/1999 
-          // since the code is shared by both net & special net, 
-          // need to check on both flags 
-          if ((defData->callbacks->NetCbk && (defData->netOsnet==1)) || (defData->callbacks->SNetCbk && (defData->netOsnet==2)))
-            defData->Net.addPin($2, $4, $5);
-          // 1/14/2000 - pcr 289156 
-          // reset defData->dumb_mode & defData->no_num to 3 , just in case 
-          // the next statement is another net_connection 
-          defData->dumb_mode = 3;
-          defData->no_num = 3;
-        }
-        | '(' '*' {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING conn_opt ')'
-        {
-          if ((defData->callbacks->NetCbk && (defData->netOsnet==1)) || (defData->callbacks->SNetCbk && (defData->netOsnet==2)))
-            defData->Net.addPin("*", $4, $5);
-          defData->dumb_mode = 3;
-          defData->no_num = 3;
-        }
-        | '(' K_PIN {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING conn_opt ')'
-        {
-          if ((defData->callbacks->NetCbk && (defData->netOsnet==1)) || (defData->callbacks->SNetCbk && (defData->netOsnet==2)))
-            defData->Net.addPin("PIN", $4, $5);
-          defData->dumb_mode = 3;
-          defData->no_num = 3;
-        }
-
-conn_opt: // empty 
-          { $$ = 0; }
-        | extension_stmt
-        {
-          if (defData->callbacks->NetConnectionExtCbk)
-            CALLBACK(defData->callbacks->NetConnectionExtCbk, defrNetConnectionExtCbkType,
-              &defData->History_text[0]);
-          $$ = 0;
-        }
-        | '+' K_SYNTHESIZED
-        { $$ = 1; }
-        
-        
-// These are all the optional fields for a net that go after the '+' 
-net_options: // empty 
-        | net_options net_option
-        ;
-
-net_option: '+' net_type 
-        {  
-          if (defData->callbacks->NetCbk) defData->Net.addWire($2, NULL);
-        }
-         paths
-        {
-          defData->by_is_keyword = FALSE;
-          defData->do_is_keyword = FALSE;
-          defData->new_is_keyword = FALSE;
-          defData->nondef_is_keyword = FALSE;
-          defData->mustjoin_is_keyword = FALSE;
-          defData->step_is_keyword = FALSE;
-          defData->orient_is_keyword = FALSE;
-          defData->virtual_is_keyword = FALSE;
-          defData->rect_is_keyword = FALSE;
-          defData->mask_is_keyword = FALSE;
-          defData->needNPCbk = 0;
-        }
-
-        | '+' K_SOURCE netsource_type
-        { if (defData->callbacks->NetCbk) defData->Net.setSource($3); }
-
-        | '+' K_FIXEDBUMP
-        {
-          if (defData->VersionNum < 5.5) {
-            if (defData->callbacks->NetCbk) {
-              if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                 defData->defMsg = (char*)malloc(1000);
-                 sprintf (defData->defMsg,
-                    "The FIXEDBUMP statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                 defData->defError(6530, defData->defMsg);
-                 free(defData->defMsg);
-                 CHKERR();
-              }
-            }
-          }
-          if (defData->callbacks->NetCbk) defData->Net.setFixedbump();
-        } 
-
-        | '+' K_FREQUENCY { defData->real_num = 1; } NUMBER
-        {
-          if (defData->VersionNum < 5.5) {
-            if (defData->callbacks->NetCbk) {
-              if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                 defData->defMsg = (char*)malloc(1000);
-                 sprintf (defData->defMsg,
-                    "The FREQUENCY statement is a version 5.5 and later syntax.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                 defData->defError(6558, defData->defMsg);
-                 free(defData->defMsg);
-                 CHKERR();
-              }
-            }
-          }
-          if (defData->callbacks->NetCbk) defData->Net.setFrequency($4);
-          defData->real_num = 0;
-        }
-
-        | '+' K_ORIGINAL {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING
-        { if (defData->callbacks->NetCbk) defData->Net.setOriginal($4); }
-
-        | '+' K_PATTERN pattern_type
-        { if (defData->callbacks->NetCbk) defData->Net.setPattern($3); }
-
-        | '+' K_WEIGHT NUMBER
-        { if (defData->callbacks->NetCbk) defData->Net.setWeight(ROUND($3)); }
-
-        | '+' K_XTALK NUMBER
-        { if (defData->callbacks->NetCbk) defData->Net.setXTalk(ROUND($3)); }
-
-        | '+' K_ESTCAP NUMBER
-        { if (defData->callbacks->NetCbk) defData->Net.setCap($3); }
-
-        | '+' K_USE use_type 
-        { if (defData->callbacks->NetCbk) defData->Net.setUse($3); }
-
-        | '+' K_STYLE NUMBER
-        { if (defData->callbacks->NetCbk) defData->Net.setStyle((int)$3); }
-
-        | '+' K_NONDEFAULTRULE { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        { 
-          if (defData->callbacks->NetCbk && defData->callbacks->NetNonDefaultRuleCbk) {
-             // User wants a callback on nondefaultrule 
-             CALLBACK(defData->callbacks->NetNonDefaultRuleCbk,
-                      defrNetNonDefaultRuleCbkType, $4);
-          }
-          // Still save data in the class 
-          if (defData->callbacks->NetCbk) defData->Net.setNonDefaultRule($4);
-        }
-
-        | vpin_stmt
-
-        | '+' K_SHIELDNET { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        { if (defData->callbacks->NetCbk) defData->Net.addShieldNet($4); }
-
-        | '+' K_NOSHIELD { defData->dumb_mode = 1; defData->no_num = 1; }
-        { // since the parser still support 5.3 and earlier, can't 
-          // move NOSHIELD in net_type 
-          if (defData->VersionNum < 5.4) {   // PCR 445209 
-            if (defData->callbacks->NetCbk) defData->Net.addNoShield("");
-            defData->by_is_keyword = FALSE;
-            defData->do_is_keyword = FALSE;
-            defData->new_is_keyword = FALSE;
-            defData->step_is_keyword = FALSE;
-            defData->orient_is_keyword = FALSE;
-            defData->virtual_is_keyword = FALSE;
-            defData->mask_is_keyword = FALSE;
-            defData->rect_is_keyword = FALSE;
-            defData->shield = TRUE;    // save the path info in the defData->shield paths 
-          } else
-            if (defData->callbacks->NetCbk) defData->Net.addWire("NOSHIELD", NULL);
-        }
-        paths
-        {
-          if (defData->VersionNum < 5.4) {   // PCR 445209 
-            defData->shield = FALSE;
-            defData->by_is_keyword = FALSE;
-            defData->do_is_keyword = FALSE;
-            defData->new_is_keyword = FALSE;
-            defData->step_is_keyword = FALSE;
-            defData->nondef_is_keyword = FALSE;
-            defData->mustjoin_is_keyword = FALSE;
-            defData->orient_is_keyword = FALSE;
-            defData->virtual_is_keyword = FALSE;
-            defData->rect_is_keyword = FALSE;
-            defData->mask_is_keyword = FALSE;
-          } else {
-            defData->by_is_keyword = FALSE;
-            defData->do_is_keyword = FALSE;
-            defData->new_is_keyword = FALSE;
-            defData->step_is_keyword = FALSE;
-            defData->nondef_is_keyword = FALSE;
-            defData->mustjoin_is_keyword = FALSE;
-            defData->orient_is_keyword = FALSE;
-            defData->virtual_is_keyword = FALSE;
-            defData->rect_is_keyword = FALSE;
-            defData->mask_is_keyword = FALSE;
-          }
-          defData->needNPCbk = 0;
-        }
-
-        | '+' K_SUBNET
-        { defData->dumb_mode = 1; defData->no_num = 1;
-          if (defData->callbacks->NetCbk) {
-            defData->Subnet = new defiSubnet(defData);
-          }
-        }
-        T_STRING {
-          if (defData->callbacks->NetCbk && defData->callbacks->NetSubnetNameCbk) {
-            // User wants a callback on Net subnetName 
-            CALLBACK(defData->callbacks->NetSubnetNameCbk, defrNetSubnetNameCbkType, $4);
-          }
-          // Still save the subnet name in the class 
-          if (defData->callbacks->NetCbk) {
-            defData->Subnet->setName($4);
-          }
-        } 
-        comp_names {
-          defData->routed_is_keyword = TRUE;
-          defData->fixed_is_keyword = TRUE;
-          defData->cover_is_keyword = TRUE;
-        } subnet_options {
-          if (defData->callbacks->NetCbk) {
-            defData->Net.addSubnet(defData->Subnet);
-            defData->Subnet = NULL;
-            defData->routed_is_keyword = FALSE;
-            defData->fixed_is_keyword = FALSE;
-            defData->cover_is_keyword = FALSE;
-          }
-        }
-
-        | '+' K_PROPERTY {defData->dumb_mode = DEF_MAX_INT; }
-          net_prop_list
-        { defData->dumb_mode = 0; }
-
-        | extension_stmt
-        { 
-          if (defData->callbacks->NetExtCbk)
-            CALLBACK(defData->callbacks->NetExtCbk, defrNetExtCbkType, &defData->History_text[0]);
-        }
-
-net_prop_list: net_prop
-      | net_prop_list net_prop
-      ;
-
-net_prop: T_STRING NUMBER
-        {
-          if (defData->callbacks->NetCbk) {
-            char propTp;
-            char* str = defData->ringCopy("                       ");
-            propTp = defData->session->NetProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "NET");
-            sprintf(str, "%g", $2);
-            defData->Net.addNumProp($1, $2, str, propTp);
-          }
-        }
-        | T_STRING QSTRING
-        {
-          if (defData->callbacks->NetCbk) {
-            char propTp;
-            propTp = defData->session->NetProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "NET");
-            defData->Net.addProp($1, $2, propTp);
-          }
-        }
-        | T_STRING T_STRING
-        {
-          if (defData->callbacks->NetCbk) {
-            char propTp;
-            propTp = defData->session->NetProp.propType($1);
-            CHKPROPTYPE(propTp, $1, "NET");
-            defData->Net.addProp($1, $2, propTp);
-          }
-        }
-
-netsource_type: K_NETLIST
-        { $$ = (char*)"NETLIST"; }
-        | K_DIST
-        { $$ = (char*)"DIST"; }
-        | K_USER
-        { $$ = (char*)"USER"; }
-        | K_TIMING
-        { $$ = (char*)"TIMING"; }
-        | K_TEST
-        { $$ = (char*)"TEST"; }
-
-vpin_stmt: vpin_begin vpin_layer_opt pt pt 
-        {
-          // vpin_options may have to deal with orient 
-          defData->orient_is_keyword = TRUE;
-        }
-        vpin_options
-        { if (defData->callbacks->NetCbk)
-            defData->Net.addVpinBounds($3.x, $3.y, $4.x, $4.y);
-          defData->orient_is_keyword = FALSE;
-        }
-
-vpin_begin: '+' K_VPIN {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING
-        { if (defData->callbacks->NetCbk) defData->Net.addVpin($4); }
-
-vpin_layer_opt: // empty 
-        | K_LAYER {defData->dumb_mode=1;} T_STRING
-        { if (defData->callbacks->NetCbk) defData->Net.addVpinLayer($3); }
-
-vpin_options: // empty 
-        | vpin_status pt orient
-        { if (defData->callbacks->NetCbk) defData->Net.addVpinLoc($1, $2.x, $2.y, $3); }
-
-vpin_status: K_PLACED 
-        { $$ = (char*)"PLACED"; }
-        | K_FIXED 
-        { $$ = (char*)"FIXED"; }
-        | K_COVER
-        { $$ = (char*)"COVER"; }
-
-net_type: K_FIXED
-        { $$ = (char*)"FIXED"; defData->dumb_mode = 1; }
-        | K_COVER
-        { $$ = (char*)"COVER"; defData->dumb_mode = 1; }
-        | K_ROUTED
-        { $$ = (char*)"ROUTED"; defData->dumb_mode = 1; }
-
-paths:
-    path   // not necessary to do partial callback for net yet
-      { if (defData->NeedPathData && defData->callbacks->NetCbk)
-          defData->pathIsDone(defData->shield, 0, defData->netOsnet, &defData->needNPCbk);
-      }
-    | paths new_path
-      { }
-
-new_path: K_NEW { defData->dumb_mode = 1; } path
-      { if (defData->NeedPathData && defData->callbacks->NetCbk)
-          defData->pathIsDone(defData->shield, 0, defData->netOsnet, &defData->needNPCbk);
-      }
-
-path:  T_STRING
-      {
-        if ((strcmp($1, "TAPER") == 0) || (strcmp($1, "TAPERRULE") == 0)) {
-          if (defData->NeedPathData && defData->callbacks->NetCbk) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defError(6531, "The layerName which is required in path is missing. Include the layerName in the path and then try again.");
-              CHKERR();
-            }
-          }
-          // Since there is already error, the next token is insignificant 
-          defData->dumb_mode = 1; defData->no_num = 1;
-        } else {
-          // CCR 766289 - Do not accummulate the layer information if there 
-          // is not a callback set 
-          if (defData->NeedPathData && defData->callbacks->NetCbk)
-              defData->PathObj.addLayer($1);
-          defData->dumb_mode = 0; defData->no_num = 0;
-        }
-      }
-    opt_taper_style_s  path_pt
-      { defData->dumb_mode = DEF_MAX_INT; defData->by_is_keyword = TRUE; defData->do_is_keyword = TRUE;
-/*
-       dumb_mode = 1; by_is_keyword = TRUE; do_is_keyword = TRUE;
-*/
-        defData->new_is_keyword = TRUE; defData->step_is_keyword = TRUE; 
-        defData->orient_is_keyword = TRUE; defData->virtual_is_keyword = TRUE;
-        defData->mask_is_keyword = TRUE, defData->rect_is_keyword = TRUE;  }
-    
-       path_item_list
-     
-      { defData->dumb_mode = 0;   defData->virtual_is_keyword = FALSE; defData->mask_is_keyword = FALSE,
-       defData->rect_is_keyword = FALSE; }
-    
-virtual_statement :
-    K_VIRTUAL virtual_pt
-    {
-      if (defData->VersionNum < 5.8) {
-              if (defData->callbacks->SNetCbk) {
-                if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The VIRTUAL statement is available in version 5.8 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                  defData->defError(6536, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-          }
-    } 
-  
-rect_statement : 
-    K_RECT rect_pts
-    {
-      if (defData->VersionNum < 5.8) {
-              if (defData->callbacks->SNetCbk) {
-                if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The RECT statement is available in version 5.8 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                  defData->defError(6536, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-      }
-    } 
-              
-    
-path_item_list: // empty 
-    | path_item_list path_item
-    ;
-
-
-path_item:
-     T_STRING
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-          if (strcmp($1, "TAPER") == 0)
-            defData->PathObj.setTaper();
-          else {
-            defData->PathObj.addVia($1);
-            }
-        }
-      }
-    | K_MASK NUMBER T_STRING
-      {
-        if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-            if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-                (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-              if (strcmp($3, "TAPER") == 0)
-                defData->PathObj.setTaper();
-              else {
-                defData->PathObj.addViaMask($2);
-                defData->PathObj.addVia($3);
-                }
-            }
-        }
-      }
-    | T_STRING orient
-      { if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-            defData->PathObj.addVia($1);
-            defData->PathObj.addViaRotation($2);
-        }
-      }
-    | K_MASK NUMBER T_STRING orient
-      { 
-        if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-            if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-                (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-                defData->PathObj.addViaMask($2);
-                defData->PathObj.addVia($3);
-                defData->PathObj.addViaRotation($4);
-            }
-        }
-      }
-    | K_MASK NUMBER T_STRING K_DO NUMBER K_BY NUMBER K_STEP NUMBER NUMBER
-      {
-        if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {      
-            if (($5 == 0) || ($7 == 0)) {
-              if (defData->NeedPathData &&
-                  defData->callbacks->SNetCbk) {
-                if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                  defData->defError(6533, "Either the numX or numY in the VIA DO statement has the value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again.\n");
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->NeedPathData && (defData->callbacks->SNetCbk && (defData->netOsnet==2))) {
-                defData->PathObj.addViaMask($2);
-                defData->PathObj.addVia($3);
-                defData->PathObj.addViaData((int)$5, (int)$7, (int)$9, (int)$10);
-            }  else if (defData->NeedPathData && (defData->callbacks->NetCbk && (defData->netOsnet==1))) {
-              if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                defData->defError(6567, "The VIA DO statement is defined in the NET statement and is invalid.\nRemove this statement from your DEF file and try again.");
-                CHKERR();
-              }
-            }
-        }
-      }
-    | T_STRING K_DO NUMBER K_BY NUMBER K_STEP NUMBER NUMBER
-      {
-        if (defData->VersionNum < 5.5) {
-          if (defData->NeedPathData && 
-              defData->callbacks->SNetCbk) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The VIA DO statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6532, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        }
-        if (($3 == 0) || ($5 == 0)) {
-          if (defData->NeedPathData &&
-              defData->callbacks->SNetCbk) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defError(6533, "Either the numX or numY in the VIA DO statement has the value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again.\n");
-              CHKERR();
-            }
-          }
-        }
-        if (defData->NeedPathData && (defData->callbacks->SNetCbk && (defData->netOsnet==2))) {
-            defData->PathObj.addVia($1);
-            defData->PathObj.addViaData((int)$3, (int)$5, (int)$7, (int)$8);
-        }  else if (defData->NeedPathData && (defData->callbacks->NetCbk && (defData->netOsnet==1))) {
-          if (defData->netWarnings++ < defData->settings->NetWarnings) {
-            defData->defError(6567, "The VIA DO statement is defined in the NET statement and is invalid.\nRemove this statement from your DEF file and try again.");
-            CHKERR();
-          }
-        }
-      }
-    | T_STRING orient K_DO NUMBER K_BY NUMBER K_STEP NUMBER NUMBER
-      {
-        if (defData->VersionNum < 5.5) {
-          if (defData->NeedPathData &&
-              defData->callbacks->SNetCbk) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The VIA DO statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6532, defData->defMsg);
-              CHKERR();
-            }
-          }
-        }
-        if (($4 == 0) || ($6 == 0)) {
-          if (defData->NeedPathData &&
-              defData->callbacks->SNetCbk) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defError(6533, "Either the numX or numY in the VIA DO statement has the value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again.\n");
-              CHKERR();
-            }
-          }
-        }
-        if (defData->NeedPathData && (defData->callbacks->SNetCbk && (defData->netOsnet==2))) {
-            defData->PathObj.addVia($1);
-            defData->PathObj.addViaRotation($2);
-            defData->PathObj.addViaData((int)$4, (int)$6, (int)$8, (int)$9);
-        } else if (defData->NeedPathData && (defData->callbacks->NetCbk && (defData->netOsnet==1))) {
-          if (defData->netWarnings++ < defData->settings->NetWarnings) {
-            defData->defError(6567, "The VIA DO statement is defined in the NET statement and is invalid.\nRemove this statement from your DEF file and try again.");
-            CHKERR();
-          }
-        }
-      }
-    | K_MASK NUMBER T_STRING orient K_DO NUMBER K_BY NUMBER K_STEP NUMBER NUMBER
-      {
-        if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-            if (($6 == 0) || ($8 == 0)) {
-              if (defData->NeedPathData &&
-                  defData->callbacks->SNetCbk) {
-                if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                  defData->defError(6533, "Either the numX or numY in the VIA DO statement has the value. The value specified is 0.\nUpdate your DEF file with the correct value and then try again.\n");
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->NeedPathData && (defData->callbacks->SNetCbk && (defData->netOsnet==2))) {
-                defData->PathObj.addViaMask($2); 
-                defData->PathObj.addVia($3);
-                defData->PathObj.addViaRotation($4);;
-                defData->PathObj.addViaData((int)$6, (int)$8, (int)$10, (int)$11);
-            } else if (defData->NeedPathData && (defData->callbacks->NetCbk && (defData->netOsnet==1))) {
-              if (defData->netWarnings++ < defData->settings->NetWarnings) {
-                defData->defError(6567, "The VIA DO statement is defined in the NET statement and is invalid.\nRemove this statement from your DEF file and try again.");
-                CHKERR();
-              }
-            }
-        }
-      }
-   | virtual_statement
-   | rect_statement 
-   | K_MASK NUMBER K_RECT { defData->dumb_mode = 6; } '(' NUMBER NUMBER NUMBER NUMBER ')'
-    {
-      if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-          defData->PathObj.addMask($2);
-          defData->PathObj.addViaRect($6, $7, $8, $9);
-        }
-      }
-    }
-   | K_MASK NUMBER
-    {
-       if (defData->validateMaskInput((int)$2, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-          defData->PathObj.addMask($2); 
-        }
-       }  
-    }
-    path_pt
-  | path_pt 
-    {
-       // reset defData->dumb_mode to 1 just incase the next token is a via of the path
-        // 2/5/2004 - pcr 686781
-        defData->dumb_mode = DEF_MAX_INT; defData->by_is_keyword = TRUE; defData->do_is_keyword = TRUE;
-        defData->new_is_keyword = TRUE; defData->step_is_keyword = TRUE;
-        defData->orient_is_keyword = TRUE;
-    }  
-
-      
-path_pt :
-     '(' NUMBER NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addPoint(ROUND($2), ROUND($3)); 
-        defData->save_x = $2;
-        defData->save_y = $3; 
-      }
-    | '(' '*' NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addPoint(ROUND(defData->save_x), ROUND($3)); 
-        defData->save_y = $3;
-      }
-    | '(' NUMBER '*' ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addPoint(ROUND($2), ROUND(defData->save_y)); 
-        defData->save_x = $2;
-      }
-    | '(' '*' '*' ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addPoint(ROUND(defData->save_x), ROUND(defData->save_y)); 
-      }
-    | '(' NUMBER NUMBER NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addFlushPoint(ROUND($2), ROUND($3), ROUND($4)); 
-        defData->save_x = $2;
-        defData->save_y = $3;
-      }
-    | '(' '*' NUMBER NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addFlushPoint(ROUND(defData->save_x), ROUND($3),
-          ROUND($4)); 
-        defData->save_y = $3;
-      }
-    | '(' NUMBER '*' NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addFlushPoint(ROUND($2), ROUND(defData->save_y),
-          ROUND($4)); 
-        defData->save_x = $2;
-      }
-    | '(' '*' '*' NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addFlushPoint(ROUND(defData->save_x), ROUND(defData->save_y),
-          ROUND($4)); 
-      }
-
-virtual_pt :
-     '(' NUMBER NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addVirtualPoint(ROUND($2), ROUND($3)); 
-        defData->save_x = $2;
-        defData->save_y = $3;
-      }
-    | '(' '*' NUMBER ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addVirtualPoint(ROUND(defData->save_x), ROUND($3)); 
-        defData->save_y = $3;
-      }
-    | '(' NUMBER '*' ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addVirtualPoint(ROUND($2), ROUND(defData->save_y)); 
-        defData->save_x = $2;
-      }
-    | '(' '*' '*' ')'
-      {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addVirtualPoint(ROUND(defData->save_x), ROUND(defData->save_y));
-      }
- 
-rect_pts :
-    '(' NUMBER NUMBER NUMBER NUMBER ')'
-    {
-        if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-          defData->PathObj.addViaRect($2, $3, $4, $5); 
-        }    
-    }   
-    
-                
-opt_taper_style_s: // empty 
-    | opt_taper_style_s opt_taper_style
-    ;
-opt_taper_style: opt_style
-    | opt_taper
-    ;
-
-opt_taper: K_TAPER
-      { if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.setTaper(); }
-    | K_TAPERRULE { defData->dumb_mode = 1; } T_STRING
-      { if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addTaperRule($3); }
-
-opt_style: K_STYLE NUMBER
-      { 
-        if (defData->VersionNum < 5.6) {
-           if (defData->NeedPathData && (defData->callbacks->NetCbk ||
-               defData->callbacks->SNetCbk)) {
-             if (defData->netWarnings++ < defData->settings->NetWarnings) {
-               defData->defMsg = (char*)malloc(1000);
-               sprintf (defData->defMsg,
-                  "The STYLE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-               defData->defError(6534, defData->defMsg);
-               free(defData->defMsg);
-               CHKERR();
-             }
-           }
-        } else
-           if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-             (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-             defData->PathObj.addStyle((int)$2);
-      }
-
-opt_spaths: // empty 
-    | opt_spaths opt_shape_style
-    ;
-
-opt_shape_style:
-    '+' K_SHAPE shape_type
-      { if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-          (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-          defData->PathObj.addShape($3); }
-    | '+' K_STYLE NUMBER
-      { if (defData->VersionNum < 5.6) {
-          if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2)))) {
-            if (defData->netWarnings++ < defData->settings->NetWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The STYLE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6534, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->NeedPathData && ((defData->callbacks->NetCbk && (defData->netOsnet==1)) ||
-            (defData->callbacks->SNetCbk && (defData->netOsnet==2))))
-            defData->PathObj.addStyle((int)$3);
-        }
-      }
-
-end_nets: K_END K_NETS 
-          { 
-            CALLBACK(defData->callbacks->NetEndCbk, defrNetEndCbkType, 0);
-            defData->netOsnet = 0;
-          }
-
-shape_type: K_RING
-            { $$ = (char*)"RING"; }
-        | K_STRIPE
-            { $$ = (char*)"STRIPE"; }
-        | K_FOLLOWPIN
-            { $$ = (char*)"FOLLOWPIN"; }
-        | K_IOWIRE
-            { $$ = (char*)"IOWIRE"; }
-        | K_COREWIRE
-            { $$ = (char*)"COREWIRE"; }
-        | K_BLOCKWIRE
-            { $$ = (char*)"BLOCKWIRE"; }
-        | K_FILLWIRE
-            { $$ = (char*)"FILLWIRE"; }
-        | K_FILLWIREOPC                         // 5.7 
-            {
-              if (defData->VersionNum < 5.7) {
-                 if (defData->NeedPathData) {
-                   if (defData->fillWarnings++ < defData->settings->FillWarnings) {
-                     defData->defMsg = (char*)malloc(10000);
-                     sprintf (defData->defMsg,
-                       "The FILLWIREOPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                     defData->defError(6552, defData->defMsg);
-                     free(defData->defMsg);
-                     CHKERR();
-                  }
-                }
-              }
-              $$ = (char*)"FILLWIREOPC";
-            }
-        | K_DRCFILL
-            { $$ = (char*)"DRCFILL"; }
-        | K_BLOCKAGEWIRE
-            { $$ = (char*)"BLOCKAGEWIRE"; }
-        | K_PADRING
-            { $$ = (char*)"PADRING"; }
-        | K_BLOCKRING
-            { $$ = (char*)"BLOCKRING"; }
-
-snets_section :  start_snets snet_rules end_snets
-            ;
-
-snet_rules: // empty 
-        | snet_rules snet_rule
-            ;
-
-snet_rule: net_and_connections snet_options ';'
-        { CALLBACK(defData->callbacks->SNetCbk, defrSNetCbkType, &defData->Net); }
-
-snet_options: // empty 
-        | snet_options snet_option
-            ;
-
-snet_option: snet_width | snet_voltage | 
-             snet_spacing | snet_other_option
-             ;
-
-snet_other_option: '+' net_type
-            {
-             if (defData->VersionNum >= 5.8) {
-                defData->specialWire_routeStatus = $2;
-             } else {
-                 if (defData->callbacks->SNetCbk) {   // PCR 902306 
-                   defData->defMsg = (char*)malloc(1024);
-                   sprintf(defData->defMsg, "The SPECIAL NET statement, with type %s, does not have any net statement defined.\nThe DEF parser will ignore this statemnet.", $2);
-                   defData->defWarning(7023, defData->defMsg);
-                   free(defData->defMsg);
-                 }
-             }
-            }
-        |  '+' net_type
-            {
-            if (defData->callbacks->SNetCbk) defData->Net.addWire($2, NULL);
-            }
-            spaths
-            {
-            // 7/17/2003 - Fix for pcr 604848, add a callback for each wire
-            if (defData->callbacks->SNetWireCbk) {
-               CALLBACK(defData->callbacks->SNetWireCbk, defrSNetWireCbkType, &defData->Net);
-               defData->Net.freeWire();
-            }
-            defData->by_is_keyword = FALSE;
-            defData->do_is_keyword = FALSE;
-            defData->new_is_keyword = FALSE;
-            defData->step_is_keyword = FALSE;
-            defData->orient_is_keyword = FALSE;
-            defData->virtual_is_keyword = FALSE;
-            defData->mask_is_keyword = FALSE;
-            defData->rect_is_keyword = FALSE;
-            defData->needSNPCbk = 0;
-            }
- 
-        | '+' K_SHIELD { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-            { defData->shieldName = $4; 
-              defData->specialWire_routeStatus = (char*)"SHIELD";
-              defData->specialWire_routeStatusName = $4; 
-            }
-            shield_layer
-            
-        | '+' K_SHAPE shape_type
-          {  
-            defData->specialWire_shapeType = $3;
-          }
-        | '+' K_MASK NUMBER
-          {
-            if (defData->validateMaskInput((int)$3, defData->sNetWarnings, defData->settings->SNetWarnings)) {
-                defData->specialWire_mask = $3;
-            }     
-          }
-        | '+' K_POLYGON { defData->dumb_mode = 1; } T_STRING
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->SNetCbk) {
-                if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The POLYGON statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                  defData->defError(6535, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            
-            defData->Geometries.Reset();
-          }
-          firstPt nextPt nextPt otherPts
-          {
-            if (defData->VersionNum >= 5.6) {  // only add if 5.6 or beyond
-              if (defData->callbacks->SNetCbk) {
-                // defData->needSNPCbk will indicate that it has reach the max
-                // memory and if user has set partialPathCBk, def parser
-                // will make the callback.
-                // This will improve performance
-                // This construct is only in specialnet
-                defData->Net.addPolygon($4, &defData->Geometries, &defData->needSNPCbk, defData->specialWire_mask, defData->specialWire_routeStatus, defData->specialWire_shapeType,
-                                                                defData->specialWire_routeStatusName);
-                defData->specialWire_mask = 0;
-                defData->specialWire_routeStatus = (char*)"ROUTED";
-                defData->specialWire_shapeType = (char*)"";
-                if (defData->needSNPCbk && defData->callbacks->SNetPartialPathCbk) {
-                   CALLBACK(defData->callbacks->SNetPartialPathCbk, defrSNetPartialPathCbkType,
-                            &defData->Net);
-                   defData->Net.clearRectPolyNPath();
-                   defData->Net.clearVia();
-                }
-              }
-            }
-          }
-
-        | '+' K_RECT { defData->dumb_mode = 1; } T_STRING pt pt
-          {
-            if (defData->VersionNum < 5.6) {
-              if (defData->callbacks->SNetCbk) {
-                if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The RECT statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                  defData->defError(6536, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-            }
-            if (defData->callbacks->SNetCbk) {
-              // defData->needSNPCbk will indicate that it has reach the max
-              // memory and if user has set partialPathCBk, def parser
-              // will make the callback.
-              // This will improve performance
-              // This construct is only in specialnet
-              defData->Net.addRect($4, $5.x, $5.y, $6.x, $6.y, &defData->needSNPCbk, defData->specialWire_mask, defData->specialWire_routeStatus, defData->specialWire_shapeType, defData->specialWire_routeStatusName);
-              defData->specialWire_mask = 0;
-              defData->specialWire_routeStatus = (char*)"ROUTED";
-              defData->specialWire_shapeType = (char*)"";
-              defData->specialWire_routeStatusName = (char*)"";
-              if (defData->needSNPCbk && defData->callbacks->SNetPartialPathCbk) {
-                 CALLBACK(defData->callbacks->SNetPartialPathCbk, defrSNetPartialPathCbkType,
-                          &defData->Net);
-                 defData->Net.clearRectPolyNPath();
-                 defData->Net.clearVia();
-              }
-            }
-          }
-        | '+' K_VIA { defData->dumb_mode = 1; } T_STRING orient_pt
-        {
-          if (defData->VersionNum < 5.8) {
-              if (defData->callbacks->SNetCbk) {
-                if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                  defData->defMsg = (char*)malloc(1000);
-                  sprintf (defData->defMsg,
-                     "The VIA statement is available in version 5.8 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-                  defData->defError(6536, defData->defMsg);
-                  free(defData->defMsg);
-                  CHKERR();
-                }
-              }
-          }
-        }
-        firstPt otherPts
-        {
-          if (defData->VersionNum >= 5.8 && defData->callbacks->SNetCbk) {
-              defData->Net.addPts($4, $5, &defData->Geometries, &defData->needSNPCbk, defData->specialWire_mask, defData->specialWire_routeStatus, defData->specialWire_shapeType,
-                                                          defData->specialWire_routeStatusName);
-              defData->specialWire_mask = 0;
-              defData->specialWire_routeStatus = (char*)"ROUTED";
-              defData->specialWire_shapeType = (char*)"";
-              defData->specialWire_routeStatusName = (char*)"";
-              if (defData->needSNPCbk && defData->callbacks->SNetPartialPathCbk) {
-                 CALLBACK(defData->callbacks->SNetPartialPathCbk, defrSNetPartialPathCbkType,
-                          &defData->Net);
-                 defData->Net.clearRectPolyNPath();
-                 defData->Net.clearVia();
-              }
-            }
-        }
- 
-        | '+' K_SOURCE source_type
-            { if (defData->callbacks->SNetCbk) defData->Net.setSource($3); }
-
-        | '+' K_FIXEDBUMP
-            { if (defData->callbacks->SNetCbk) defData->Net.setFixedbump(); }
- 
-        | '+' K_FREQUENCY NUMBER
-            { if (defData->callbacks->SNetCbk) defData->Net.setFrequency($3); }
-
-        | '+' K_ORIGINAL {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING
-            { if (defData->callbacks->SNetCbk) defData->Net.setOriginal($4); }
- 
-        | '+' K_PATTERN pattern_type
-            { if (defData->callbacks->SNetCbk) defData->Net.setPattern($3); }
- 
-        | '+' K_WEIGHT NUMBER
-            { if (defData->callbacks->SNetCbk) defData->Net.setWeight(ROUND($3)); }
- 
-        | '+' K_ESTCAP NUMBER
-            { 
-              // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-              if (defData->VersionNum < 5.5)
-                 if (defData->callbacks->SNetCbk) defData->Net.setCap($3);
-              else
-                 defData->defWarning(7024, "The ESTCAP statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-            }
- 
-        | '+' K_USE use_type
-            { if (defData->callbacks->SNetCbk) defData->Net.setUse($3); }
- 
-        | '+' K_STYLE NUMBER
-            { if (defData->callbacks->SNetCbk) defData->Net.setStyle((int)$3); }
- 
-        | '+' K_PROPERTY {defData->dumb_mode = DEF_MAX_INT; }
-          snet_prop_list
-            { defData->dumb_mode = 0; }
- 
-        | extension_stmt
-          { CALLBACK(defData->callbacks->NetExtCbk, defrNetExtCbkType, &defData->History_text[0]); }
-
-orient_pt: // empty 
-        { $$ = 0; }
-        | K_N  {$$ = 0;}
-        | K_W  {$$ = 1;}
-        | K_S  {$$ = 2;}
-        | K_E  {$$ = 3;}
-        | K_FN {$$ = 4;}
-        | K_FW {$$ = 5;}
-        | K_FS {$$ = 6;}
-        | K_FE {$$ = 7;}
-        
-shield_layer: // PCR 902306 
-            {
-                if (defData->callbacks->SNetCbk) {
-                    if (defData->VersionNum < 5.8) { 
-                        defData->defMsg = (char*)malloc(1024);
-                        sprintf(defData->defMsg, "The SPECIAL NET SHIELD statement doesn't have routing points definition.\nWill be ignored.");
-                        defData->defWarning(7025, defData->defMsg);
-                        free(defData->defMsg);
-                    } else {  // CCR 1244433
-                      defData->specialWire_routeStatus = (char*)"SHIELD";
-                      defData->specialWire_routeStatusName = defData->shieldName;
-                    }
-                }
-            }
-        |
-            { // since the parser still supports 5.3 and earlier, 
-              // can't just move SHIELD in net_type 
-              if (defData->VersionNum < 5.4) { // PCR 445209 
-                if (defData->callbacks->SNetCbk) defData->Net.addShield(defData->shieldName);
-                defData->by_is_keyword = FALSE;
-                defData->do_is_keyword = FALSE;
-                defData->new_is_keyword = FALSE;
-                defData->step_is_keyword = FALSE;
-                defData->orient_is_keyword = FALSE;
-                defData->virtual_is_keyword = FALSE;
-                defData->mask_is_keyword = FALSE;
-                defData->rect_is_keyword = FALSE;
-                defData->specialWire_routeStatus = (char*)"ROUTED";
-                defData->specialWire_routeStatusName = (char*)"";
-                defData->shield = TRUE;   // save the path info in the defData->shield paths 
-              } else
-                if (defData->callbacks->SNetCbk) defData->Net.addWire("SHIELD", defData->shieldName);
-                defData->specialWire_routeStatus = (char*)"ROUTED";
-                defData->specialWire_routeStatusName = (char*)"";
-            }
-            spaths
-            {
-              // 7/17/2003 - Fix for pcr 604848, add a callback for each wire
-              if (defData->callbacks->SNetWireCbk) {
-                 CALLBACK(defData->callbacks->SNetWireCbk, defrSNetWireCbkType, &defData->Net);
-                 if (defData->VersionNum < 5.4)
-                   defData->Net.freeShield();
-                 else
-                   defData->Net.freeWire();
-              }
-              if (defData->VersionNum < 5.4) {  // PCR 445209 
-                defData->shield = FALSE;
-                defData->by_is_keyword = FALSE;
-                defData->do_is_keyword = FALSE;
-                defData->new_is_keyword = FALSE;
-                defData->step_is_keyword = FALSE;
-                defData->nondef_is_keyword = FALSE;
-                defData->mustjoin_is_keyword = FALSE;
-                defData->orient_is_keyword = FALSE;
-                defData->virtual_is_keyword = FALSE;
-                defData->mask_is_keyword = FALSE;
-                defData->rect_is_keyword = FALSE;
-              } else {
-                defData->by_is_keyword = FALSE;
-                defData->do_is_keyword = FALSE;
-                defData->new_is_keyword = FALSE;
-                defData->step_is_keyword = FALSE;
-                defData->orient_is_keyword = FALSE;
-                defData->virtual_is_keyword = FALSE;
-                defData->mask_is_keyword = FALSE;
-                defData->rect_is_keyword = FALSE;
-              }
-              defData->needSNPCbk = 0;
-            }
-
-snet_width: '+' K_WIDTH { defData->dumb_mode = 1; } T_STRING NUMBER
-            {
-              // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-              if (defData->VersionNum < 5.5)
-                 if (defData->callbacks->SNetCbk) defData->Net.setWidth($4, $5);
-              else
-                 defData->defWarning(7026, "The WIDTH statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-            }
-
-snet_voltage: '+' K_VOLTAGE  { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-            {
-              if (defrData::numIsInt($4)) {
-                 if (defData->callbacks->SNetCbk) defData->Net.setVoltage(atoi($4));
-              } else {
-                 if (defData->callbacks->SNetCbk) {
-                   if (defData->sNetWarnings++ < defData->settings->SNetWarnings) {
-                     defData->defMsg = (char*)malloc(1000);
-                     sprintf (defData->defMsg,
-                        "The value %s for statement VOLTAGE is invalid. The value can only be integer.\nSpecify a valid value in units of millivolts", $4);
-                     defData->defError(6537, defData->defMsg);
-                     free(defData->defMsg);
-                     CHKERR();
-                   }
-                 }
-              }
-            }
-
-snet_spacing: '+' K_SPACING { defData->dumb_mode = 1; } T_STRING NUMBER
-            {
-              if (defData->callbacks->SNetCbk) defData->Net.setSpacing($4,$5);
-            }
-        opt_snet_range
-            {
-            }
-
-snet_prop_list: snet_prop
-      | snet_prop_list snet_prop
-      ;
-
-snet_prop: T_STRING NUMBER
-            {
-              if (defData->callbacks->SNetCbk) {
-                char propTp;
-                char* str = defData->ringCopy("                       ");
-                propTp = defData->session->SNetProp.propType($1);
-                CHKPROPTYPE(propTp, $1, "SPECIAL NET");
-                // For backword compatibility, also set the string value 
-                sprintf(str, "%g", $2);
-                defData->Net.addNumProp($1, $2, str, propTp);
-              }
-            }
-         | T_STRING QSTRING
-            {
-              if (defData->callbacks->SNetCbk) {
-                char propTp;
-                propTp = defData->session->SNetProp.propType($1);
-                CHKPROPTYPE(propTp, $1, "SPECIAL NET");
-                defData->Net.addProp($1, $2, propTp);
-              }
-            }
-         | T_STRING T_STRING
-            {
-              if (defData->callbacks->SNetCbk) {
-                char propTp;
-                propTp = defData->session->SNetProp.propType($1);
-                CHKPROPTYPE(propTp, $1, "SPECIAL NET");
-                defData->Net.addProp($1, $2, propTp);
-              }
-            }
-
-opt_snet_range: // nothing 
-        | K_RANGE NUMBER NUMBER
-            {
-              if (defData->callbacks->SNetCbk) defData->Net.setRange($2,$3);
-            }
-
-opt_range: // nothing 
-        | K_RANGE NUMBER NUMBER
-            { defData->Prop.setRange($2, $3); }
-
-pattern_type: K_BALANCED
-            { $$ = (char*)"BALANCED"; }
-        | K_STEINER
-            { $$ = (char*)"STEINER"; }
-        | K_TRUNK
-            { $$ = (char*)"TRUNK"; }
-        | K_WIREDLOGIC
-            { $$ = (char*)"WIREDLOGIC"; }
-
-spaths:
-    spath
-      { 
-        if (defData->NeedPathData && defData->callbacks->SNetCbk) {
-           if (defData->needSNPCbk && defData->callbacks->SNetPartialPathCbk) { 
-              // require a callback before proceed because defData->needSNPCbk must be
-              // set to 1 from the previous pathIsDone and user has registered
-              // a callback routine.
-              CALLBACK(defData->callbacks->SNetPartialPathCbk, defrSNetPartialPathCbkType,
-                       &defData->Net);
-              defData->needSNPCbk = 0;   // reset the flag
-              defData->pathIsDone(defData->shield, 1, defData->netOsnet, &defData->needSNPCbk);
-              defData->Net.clearRectPolyNPath();
-              defData->Net.clearVia();
-           } else
-              defData->pathIsDone(defData->shield, 0, defData->netOsnet, &defData->needSNPCbk);
-        }
-      }
-    | spaths snew_path
-      { }
-
-snew_path: K_NEW { defData->dumb_mode = 1; } spath
-      { if (defData->NeedPathData && defData->callbacks->SNetCbk) {
-           if (defData->needSNPCbk && defData->callbacks->SNetPartialPathCbk) {
-              // require a callback before proceed because defData->needSNPCbk must be
-              // set to 1 from the previous pathIsDone and user has registered
-              // a callback routine.
-              CALLBACK(defData->callbacks->SNetPartialPathCbk, defrSNetPartialPathCbkType,
-                       &defData->Net);
-              defData->needSNPCbk = 0;   // reset the flag
-              defData->pathIsDone(defData->shield, 1, defData->netOsnet, &defData->needSNPCbk);
-              // reset any poly or rect in special wiring statement
-              defData->Net.clearRectPolyNPath();
-              defData->Net.clearVia();
-           } else
-              defData->pathIsDone(defData->shield, 0, defData->netOsnet, &defData->needSNPCbk);
-        }
-      }
-
-spath:  T_STRING
-      { if (defData->NeedPathData && defData->callbacks->SNetCbk)
-           defData->PathObj.addLayer($1);
-        defData->dumb_mode = 0; defData->no_num = 0;
-      }
-    width opt_spaths path_pt
-/*
-      { dumb_mode = 1; new_is_keyword = TRUE; }
-*/
-      { defData->dumb_mode = DEF_MAX_INT; defData->by_is_keyword = TRUE; defData->do_is_keyword = TRUE;
-        defData->new_is_keyword = TRUE; defData->step_is_keyword = TRUE;
-         defData->orient_is_keyword = TRUE; defData->rect_is_keyword = TRUE, defData->mask_is_keyword = TRUE; 
-         defData->virtual_is_keyword = TRUE;  }
-
-    path_item_list
-      { defData->dumb_mode = 0; defData->rect_is_keyword = FALSE, defData->mask_is_keyword = FALSE, defData->virtual_is_keyword = FALSE; }
-
-width: NUMBER
-      { if (defData->NeedPathData && defData->callbacks->SNetCbk)
-          defData->PathObj.addWidth(ROUND($1));
-      }
-
-start_snets: K_SNETS NUMBER ';'
-      { 
-        if (defData->callbacks->SNetStartCbk)
-          CALLBACK(defData->callbacks->SNetStartCbk, defrSNetStartCbkType, ROUND($2));
-        defData->netOsnet = 2;
-      }
-
-end_snets: K_END K_SNETS 
-      { 
-        if (defData->callbacks->SNetEndCbk)
-          CALLBACK(defData->callbacks->SNetEndCbk, defrSNetEndCbkType, 0);
-        defData->netOsnet = 0;
-      }
-
-groups_section: groups_start group_rules groups_end
-      ;
-
-groups_start: K_GROUPS NUMBER ';'
-      {
-        if (defData->callbacks->GroupsStartCbk)
-           CALLBACK(defData->callbacks->GroupsStartCbk, defrGroupsStartCbkType, ROUND($2));
-      }
-
-group_rules: // empty 
-      | group_rules group_rule
-      ;
-
-group_rule: start_group group_members group_options ';'
-      {
-        if (defData->callbacks->GroupCbk)
-           CALLBACK(defData->callbacks->GroupCbk, defrGroupCbkType, &defData->Group);
-      }
-
-start_group: '-' { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING 
-      {
-        defData->dumb_mode = DEF_MAX_INT;
-        defData->no_num = DEF_MAX_INT;
-        /* dumb_mode is automatically turned off at the first
-         * + in the options or at the ; at the end of the group */
-        if (defData->callbacks->GroupCbk) defData->Group.setup($3);
-        if (defData->callbacks->GroupNameCbk)
-           CALLBACK(defData->callbacks->GroupNameCbk, defrGroupNameCbkType, $3);
-      }
-
-group_members: 
-      | group_members group_member
-      {  }
-
-group_member: T_STRING
-      {
-        // if (defData->callbacks->GroupCbk) defData->Group.addMember($1); 
-        if (defData->callbacks->GroupMemberCbk)
-          CALLBACK(defData->callbacks->GroupMemberCbk, defrGroupMemberCbkType, $1);
-      }
-
-group_options: // empty 
-      | group_options group_option 
-      ;
-
-group_option: '+' K_SOFT group_soft_options
-      { }
-      |     '+' K_PROPERTY { defData->dumb_mode = DEF_MAX_INT; }
-            group_prop_list
-      { defData->dumb_mode = 0; }
-      |     '+' K_REGION { defData->dumb_mode = 1;  defData->no_num = 1; } group_region
-      { }
-      | extension_stmt
-      { 
-        if (defData->callbacks->GroupMemberCbk)
-          CALLBACK(defData->callbacks->GroupExtCbk, defrGroupExtCbkType, &defData->History_text[0]);
-      }
-
-group_region: pt pt
-      {
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        if (defData->VersionNum < 5.5) {
-          if (defData->callbacks->GroupCbk)
-            defData->Group.addRegionRect($1.x, $1.y, $2.x, $2.y);
-        }
-        else
-          defData->defWarning(7027, "The GROUP REGION pt pt statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-      }
-      | T_STRING
-      { if (defData->callbacks->GroupCbk)
-          defData->Group.setRegionName($1);
-      }
-
-group_prop_list : // empty 
-      | group_prop_list group_prop
-      ;
-
-group_prop : T_STRING NUMBER
-      {
-        if (defData->callbacks->GroupCbk) {
-          char propTp;
-          char* str = defData->ringCopy("                       ");
-          propTp = defData->session->GroupProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "GROUP");
-          sprintf(str, "%g", $2);
-          defData->Group.addNumProperty($1, $2, str, propTp);
-        }
-      }
-      | T_STRING QSTRING
-      {
-        if (defData->callbacks->GroupCbk) {
-          char propTp;
-          propTp = defData->session->GroupProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "GROUP");
-          defData->Group.addProperty($1, $2, propTp);
-        }
-      }
-      | T_STRING T_STRING
-      {
-        if (defData->callbacks->GroupCbk) {
-          char propTp;
-          propTp = defData->session->GroupProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "GROUP");
-          defData->Group.addProperty($1, $2, propTp);
-        }
-      }
-
-group_soft_options: // empty 
-      | group_soft_options group_soft_option 
-      { }
-
-group_soft_option: K_MAXX NUMBER
-      {
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        if (defData->VersionNum < 5.5)
-          if (defData->callbacks->GroupCbk) defData->Group.setMaxX(ROUND($2));
-        else
-          defData->defWarning(7028, "The GROUP SOFT MAXX statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-      }
-      | K_MAXY NUMBER
-      { 
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        if (defData->VersionNum < 5.5)
-          if (defData->callbacks->GroupCbk) defData->Group.setMaxY(ROUND($2));
-        else
-          defData->defWarning(7029, "The GROUP SOFT MAXY statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-      }
-      | K_MAXHALFPERIMETER NUMBER
-      { 
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        if (defData->VersionNum < 5.5)
-          if (defData->callbacks->GroupCbk) defData->Group.setPerim(ROUND($2));
-        else
-          defData->defWarning(7030, "The GROUP SOFT MAXHALFPERIMETER statement is obsolete in version 5.5 and later.\nThe DEF parser will ignore this statement.");
-      }
-
-groups_end: K_END K_GROUPS 
-      { 
-        if (defData->callbacks->GroupsEndCbk)
-          CALLBACK(defData->callbacks->GroupsEndCbk, defrGroupsEndCbkType, 0);
-      }
-
-// 8/31/2001 - This is obsolete in 5.4 
-assertions_section: assertions_start constraint_rules assertions_end
-      ;
-
-// 8/31/2001 - This is obsolete in 5.4 
-constraint_section: constraints_start constraint_rules constraints_end
-      ;
-
-assertions_start: K_ASSERTIONS NUMBER ';'
-      {
-        if ((defData->VersionNum < 5.4) && (defData->callbacks->AssertionsStartCbk)) {
-          CALLBACK(defData->callbacks->AssertionsStartCbk, defrAssertionsStartCbkType,
-                   ROUND($2));
-        } else {
-          if (defData->callbacks->AssertionCbk)
-            if (defData->assertionWarnings++ < defData->settings->AssertionWarnings)
-              defData->defWarning(7031, "The ASSERTIONS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-        }
-        if (defData->callbacks->AssertionCbk)
-          defData->Assertion.setAssertionMode();
-      }
-
-constraints_start: K_CONSTRAINTS NUMBER ';'
-      {
-        if ((defData->VersionNum < 5.4) && (defData->callbacks->ConstraintsStartCbk)) {
-          CALLBACK(defData->callbacks->ConstraintsStartCbk, defrConstraintsStartCbkType,
-                   ROUND($2));
-        } else {
-          if (defData->callbacks->ConstraintCbk)
-            if (defData->constraintWarnings++ < defData->settings->ConstraintWarnings)
-              defData->defWarning(7032, "The CONSTRAINTS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-        }
-        if (defData->callbacks->ConstraintCbk)
-          defData->Assertion.setConstraintMode();
-      }
-
-constraint_rules: // empty 
-      | constraint_rules constraint_rule 
-      ;
-
-constraint_rule:   operand_rule 
-      | wiredlogic_rule 
-      {
-        if ((defData->VersionNum < 5.4) && (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)) {
-          if (defData->Assertion.isConstraint()) 
-            CALLBACK(defData->callbacks->ConstraintCbk, defrConstraintCbkType, &defData->Assertion);
-          if (defData->Assertion.isAssertion()) 
-            CALLBACK(defData->callbacks->AssertionCbk, defrAssertionCbkType, &defData->Assertion);
-        }
-      }
-
-operand_rule: '-' operand delay_specs ';'
-      { 
-        if ((defData->VersionNum < 5.4) && (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)) {
-          if (defData->Assertion.isConstraint()) 
-            CALLBACK(defData->callbacks->ConstraintCbk, defrConstraintCbkType, &defData->Assertion);
-          if (defData->Assertion.isAssertion()) 
-            CALLBACK(defData->callbacks->AssertionCbk, defrAssertionCbkType, &defData->Assertion);
-        }
-   
-        // reset all the flags and everything
-        defData->Assertion.clear();
-      }
-
-operand: K_NET { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING 
-      {
-         if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-           defData->Assertion.addNet($3);
-      }
-      | K_PATH {defData->dumb_mode = 4; defData->no_num = 4;} T_STRING T_STRING T_STRING T_STRING
-      {
-         if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-           defData->Assertion.addPath($3, $4, $5, $6);
-      }
-      | K_SUM  '(' operand_list ')'
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-           defData->Assertion.setSum();
-      }
-      | K_DIFF '(' operand_list ')'
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-           defData->Assertion.setDiff();
-      }
-
-operand_list: operand 
-      | operand_list operand
-      { }
-      | operand_list ',' operand
-
-wiredlogic_rule: '-' K_WIREDLOGIC { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      opt_plus K_MAXDIST NUMBER ';'
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-          defData->Assertion.setWiredlogic($4, $7);
-      }
-
-opt_plus:
-      // empty 
-      { $$ = (char*)""; }
-      | '+'
-      { $$ = (char*)"+"; }
-
-delay_specs: // empty 
-      | delay_specs delay_spec
-      ;
-
-delay_spec: '+' K_RISEMIN NUMBER 
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-          defData->Assertion.setRiseMin($3);
-      }
-      | '+' K_RISEMAX NUMBER 
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-          defData->Assertion.setRiseMax($3);
-      }
-      | '+' K_FALLMIN NUMBER 
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-          defData->Assertion.setFallMin($3);
-      }
-      | '+' K_FALLMAX NUMBER 
-      {
-        if (defData->callbacks->ConstraintCbk || defData->callbacks->AssertionCbk)
-          defData->Assertion.setFallMax($3);
-      }
-
-constraints_end: K_END K_CONSTRAINTS
-      { if ((defData->VersionNum < 5.4) && defData->callbacks->ConstraintsEndCbk) {
-          CALLBACK(defData->callbacks->ConstraintsEndCbk, defrConstraintsEndCbkType, 0);
-        } else {
-          if (defData->callbacks->ConstraintsEndCbk) {
-            if (defData->constraintWarnings++ < defData->settings->ConstraintWarnings)
-              defData->defWarning(7032, "The CONSTRAINTS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-          }
-        }
-      }
-
-assertions_end: K_END K_ASSERTIONS
-      { if ((defData->VersionNum < 5.4) && defData->callbacks->AssertionsEndCbk) {
-          CALLBACK(defData->callbacks->AssertionsEndCbk, defrAssertionsEndCbkType, 0);
-        } else {
-          if (defData->callbacks->AssertionsEndCbk) {
-            if (defData->assertionWarnings++ < defData->settings->AssertionWarnings)
-              defData->defWarning(7031, "The ASSERTIONS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-          }
-        }
-      }
-
-scanchains_section: scanchain_start scanchain_rules scanchain_end
-      ;
-
-scanchain_start: K_SCANCHAINS NUMBER ';'
-      { if (defData->callbacks->ScanchainsStartCbk)
-          CALLBACK(defData->callbacks->ScanchainsStartCbk, defrScanchainsStartCbkType,
-                   ROUND($2));
-      }
-
-scanchain_rules: // empty 
-      | scanchain_rules scan_rule
-      {}
-
-scan_rule: start_scan scan_members ';' 
-      { 
-        if (defData->callbacks->ScanchainCbk)
-          CALLBACK(defData->callbacks->ScanchainCbk, defrScanchainCbkType, &defData->Scanchain);
-      }
-
-start_scan: '-' {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING 
-      {
-        if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.setName($3);
-        defData->bit_is_keyword = TRUE;
-      }
-
-scan_members: 
-      | scan_members scan_member
-      ;
-
-opt_pin :
-      // empty 
-      { $$ = (char*)""; }
-      | T_STRING
-      { $$ = $1; }
-
-scan_member: '+' K_START {defData->dumb_mode = 2; defData->no_num = 2;} T_STRING opt_pin
-      { if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.setStart($4, $5);
-      }
-      | '+' K_FLOATING { defData->dumb_mode = 1; defData->no_num = 1; } floating_inst_list
-      { defData->dumb_mode = 0; defData->no_num = 0; }
-      | '+' K_ORDERED
-      {
-         defData->dumb_mode = 1;
-         defData->no_num = 1;
-         if (defData->callbacks->ScanchainCbk)
-           defData->Scanchain.addOrderedList();
-      }
-      ordered_inst_list
-      { defData->dumb_mode = 0; defData->no_num = 0; }
-      | '+' K_STOP {defData->dumb_mode = 2; defData->no_num = 2; } T_STRING opt_pin
-      { if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.setStop($4, $5);
-      }
-      | '+' K_COMMONSCANPINS { defData->dumb_mode = 10; defData->no_num = 10; } opt_common_pins
-      { defData->dumb_mode = 0;  defData->no_num = 0; }
-      | '+' K_PARTITION { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING  // 5.5 
-      partition_maxbits
-      {
-        if (defData->VersionNum < 5.5) {
-          if (defData->callbacks->ScanchainCbk) {
-            if (defData->scanchainWarnings++ < defData->settings->ScanchainWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The PARTITION statement is available in version 5.5 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6538, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        }
-        if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.setPartition($4, $5);
-      }
-      | extension_stmt
-      {
-        if (defData->callbacks->ScanChainExtCbk)
-          CALLBACK(defData->callbacks->ScanChainExtCbk, defrScanChainExtCbkType, &defData->History_text[0]);
-      }
-
-opt_common_pins: // empty 
-      { }
-      | '(' T_STRING T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.setCommonIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.setCommonOut($3);
-        }
-      }
-      | '(' T_STRING T_STRING ')' '(' T_STRING T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.setCommonIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.setCommonOut($3);
-          if (strcmp($6, "IN") == 0 || strcmp($6, "in") == 0)
-            defData->Scanchain.setCommonIn($7);
-          else if (strcmp($6, "OUT") == 0 || strcmp($6, "out") == 0)
-            defData->Scanchain.setCommonOut($7);
-        }
-      }
-
-floating_inst_list: // empty 
-      | floating_inst_list one_floating_inst
-      ;
-
-one_floating_inst: T_STRING
-      {
-        defData->dumb_mode = 1000;
-        defData->no_num = 1000;
-        if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.addFloatingInst($1);
-      }
-      floating_pins
-      { defData->dumb_mode = 1; defData->no_num = 1; }
-
-floating_pins: // empty  
-      { }
-      | '(' T_STRING  T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addFloatingIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addFloatingOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-        }
-      }
-      | '(' T_STRING  T_STRING ')' '(' T_STRING  T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addFloatingIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addFloatingOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-          if (strcmp($6, "IN") == 0 || strcmp($6, "in") == 0)
-            defData->Scanchain.addFloatingIn($7);
-          else if (strcmp($6, "OUT") == 0 || strcmp($6, "out") == 0)
-            defData->Scanchain.addFloatingOut($7);
-          else if (strcmp($6, "BITS") == 0 || strcmp($6, "bits") == 0) {
-            defData->bitsNum = atoi($7);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-        }
-      }
-      | '(' T_STRING  T_STRING ')' '(' T_STRING  T_STRING ')' '(' T_STRING
-      T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addFloatingIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addFloatingOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-          if (strcmp($6, "IN") == 0 || strcmp($6, "in") == 0)
-            defData->Scanchain.addFloatingIn($7);
-          else if (strcmp($6, "OUT") == 0 || strcmp($6, "out") == 0)
-            defData->Scanchain.addFloatingOut($7);
-          else if (strcmp($6, "BITS") == 0 || strcmp($6, "bits") == 0) {
-            defData->bitsNum = atoi($7);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-          if (strcmp($10, "IN") == 0 || strcmp($10, "in") == 0)
-            defData->Scanchain.addFloatingIn($11);
-          else if (strcmp($10, "OUT") == 0 || strcmp($10, "out") == 0)
-            defData->Scanchain.addFloatingOut($11);
-          else if (strcmp($10, "BITS") == 0 || strcmp($10, "bits") == 0) {
-            defData->bitsNum = atoi($11);
-            defData->Scanchain.setFloatingBits(defData->bitsNum);
-          }
-        }
-      }
-    
-ordered_inst_list: // empty 
-      | ordered_inst_list one_ordered_inst
-      ;
-
-one_ordered_inst: T_STRING
-      { defData->dumb_mode = 1000; defData->no_num = 1000; 
-        if (defData->callbacks->ScanchainCbk)
-          defData->Scanchain.addOrderedInst($1);
-      }
-      ordered_pins
-      { defData->dumb_mode = 1; defData->no_num = 1; }
-
-ordered_pins: // empty  
-      { }
-      | '(' T_STRING  T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addOrderedIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addOrderedOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-         }
-        }
-      }
-      | '(' T_STRING  T_STRING ')' '(' T_STRING  T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addOrderedIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addOrderedOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-          }
-          if (strcmp($6, "IN") == 0 || strcmp($6, "in") == 0)
-            defData->Scanchain.addOrderedIn($7);
-          else if (strcmp($6, "OUT") == 0 || strcmp($6, "out") == 0)
-            defData->Scanchain.addOrderedOut($7);
-          else if (strcmp($6, "BITS") == 0 || strcmp($6, "bits") == 0) {
-            defData->bitsNum = atoi($7);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-          }
-        }
-      }
-      | '(' T_STRING  T_STRING ')' '(' T_STRING  T_STRING ')' '(' T_STRING
-      T_STRING ')'
-      {
-        if (defData->callbacks->ScanchainCbk) {
-          if (strcmp($2, "IN") == 0 || strcmp($2, "in") == 0)
-            defData->Scanchain.addOrderedIn($3);
-          else if (strcmp($2, "OUT") == 0 || strcmp($2, "out") == 0)
-            defData->Scanchain.addOrderedOut($3);
-          else if (strcmp($2, "BITS") == 0 || strcmp($2, "bits") == 0) {
-            defData->bitsNum = atoi($3);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-          }
-          if (strcmp($6, "IN") == 0 || strcmp($6, "in") == 0)
-            defData->Scanchain.addOrderedIn($7);
-          else if (strcmp($6, "OUT") == 0 || strcmp($6, "out") == 0)
-            defData->Scanchain.addOrderedOut($7);
-          else if (strcmp($6, "BITS") == 0 || strcmp($6, "bits") == 0) {
-            defData->bitsNum = atoi($7);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-          }
-          if (strcmp($10, "IN") == 0 || strcmp($10, "in") == 0)
-            defData->Scanchain.addOrderedIn($11);
-          else if (strcmp($10, "OUT") == 0 || strcmp($10, "out") == 0)
-            defData->Scanchain.addOrderedOut($11);
-          else if (strcmp($10, "BITS") == 0 || strcmp($10, "bits") == 0) {
-            defData->bitsNum = atoi($11);
-            defData->Scanchain.setOrderedBits(defData->bitsNum);
-          }
-        }
-      }
-    
-partition_maxbits: // empty 
-      { $$ = -1; }
-      | K_MAXBITS NUMBER
-      { $$ = ROUND($2); }
-    
-scanchain_end: K_END K_SCANCHAINS
-      { 
-        if (defData->callbacks->ScanchainsEndCbk)
-          CALLBACK(defData->callbacks->ScanchainsEndCbk, defrScanchainsEndCbkType, 0);
-        defData->bit_is_keyword = FALSE;
-        defData->dumb_mode = 0; defData->no_num = 0;
-      }
-
-// 8/31/2001 - This is obsolete in 5.4 
-iotiming_section: iotiming_start iotiming_rules iotiming_end
-      ;
-
-iotiming_start: K_IOTIMINGS NUMBER ';'
-      {
-        if (defData->VersionNum < 5.4 && defData->callbacks->IOTimingsStartCbk) {
-          CALLBACK(defData->callbacks->IOTimingsStartCbk, defrIOTimingsStartCbkType, ROUND($2));
-        } else {
-          if (defData->callbacks->IOTimingsStartCbk)
-            if (defData->iOTimingWarnings++ < defData->settings->IOTimingWarnings)
-              defData->defWarning(7035, "The IOTIMINGS statement is obsolete in version 5.4 and later.\nThe DEF parser will ignore this statement.");
-        }
-      }
-
-iotiming_rules: // empty 
-      | iotiming_rules iotiming_rule
-      { }
-
-iotiming_rule: start_iotiming iotiming_members ';' 
-      { 
-        if (defData->VersionNum < 5.4 && defData->callbacks->IOTimingCbk)
-          CALLBACK(defData->callbacks->IOTimingCbk, defrIOTimingCbkType, &defData->IOTiming);
-      } 
-
-start_iotiming: '-' '(' {defData->dumb_mode = 2; defData->no_num = 2; } T_STRING T_STRING ')'
-      {
-        if (defData->callbacks->IOTimingCbk)
-          defData->IOTiming.setName($4, $5);
-      }
-
-iotiming_members: 
-      | iotiming_members iotiming_member
-      ;
-
-iotiming_member:
-      '+' risefall K_VARIABLE NUMBER NUMBER
-      {
-        if (defData->callbacks->IOTimingCbk) 
-          defData->IOTiming.setVariable($2, $4, $5);
-      }
-      | '+' risefall K_SLEWRATE NUMBER NUMBER
-      {
-        if (defData->callbacks->IOTimingCbk) 
-          defData->IOTiming.setSlewRate($2, $4, $5);
-      }
-      | '+' K_CAPACITANCE NUMBER
-      {
-        if (defData->callbacks->IOTimingCbk) 
-          defData->IOTiming.setCapacitance($3);
-      }
-      | '+' K_DRIVECELL {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->IOTimingCbk) 
-          defData->IOTiming.setDriveCell($4);
-      } iotiming_drivecell_opt
-      // | '+' K_FROMPIN   {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-
-      // | '+' K_PARALLEL NUMBER
-
-      | extension_stmt
-      {
-        if (defData->VersionNum < 5.4 && defData->callbacks->IoTimingsExtCbk)
-          CALLBACK(defData->callbacks->IoTimingsExtCbk, defrIoTimingsExtCbkType, &defData->History_text[0]);
-      }
-
-iotiming_drivecell_opt: iotiming_frompin
-      K_TOPIN {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->IOTimingCbk) 
-          defData->IOTiming.setTo($4);
-      }
-      iotiming_parallel
-
-iotiming_frompin: // empty 
-      | K_FROMPIN {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->IOTimingCbk)
-          defData->IOTiming.setFrom($3);
-      }
-
-iotiming_parallel: // empty 
-      | K_PARALLEL NUMBER
-      {
-        if (defData->callbacks->IOTimingCbk)
-          defData->IOTiming.setParallel($2);
-      }
-
-risefall: K_RISE { $$ = (char*)"RISE"; } | K_FALL { $$ = (char*)"FALL"; }
-
-iotiming_end: K_END K_IOTIMINGS
-      {
-        if (defData->VersionNum < 5.4 && defData->callbacks->IOTimingsEndCbk)
-          CALLBACK(defData->callbacks->IOTimingsEndCbk, defrIOTimingsEndCbkType, 0);
-      }
-
-floorplan_contraints_section: fp_start fp_stmts K_END K_FPC
-      { 
-        if (defData->callbacks->FPCEndCbk)
-          CALLBACK(defData->callbacks->FPCEndCbk, defrFPCEndCbkType, 0);
-      }
-
-fp_start: K_FPC NUMBER ';'
-      {
-        if (defData->callbacks->FPCStartCbk)
-          CALLBACK(defData->callbacks->FPCStartCbk, defrFPCStartCbkType, ROUND($2));
-      }
-
-fp_stmts: // empty 
-      | fp_stmts fp_stmt
-      {}
-
-fp_stmt: '-' { defData->dumb_mode = 1; defData->no_num = 1;  } T_STRING h_or_v
-      { if (defData->callbacks->FPCCbk) defData->FPC.setName($3, $4); }
-      constraint_type constrain_what_list ';'
-      { if (defData->callbacks->FPCCbk) CALLBACK(defData->callbacks->FPCCbk, defrFPCCbkType, &defData->FPC); }
-
-h_or_v: K_HORIZONTAL 
-      { $$ = (char*)"HORIZONTAL"; }
-      | K_VERTICAL
-      { $$ = (char*)"VERTICAL"; }
-
-constraint_type: K_ALIGN
-      { if (defData->callbacks->FPCCbk) defData->FPC.setAlign(); }
-      | K_MAX NUMBER
-      { if (defData->callbacks->FPCCbk) defData->FPC.setMax($2); }
-      | K_MIN NUMBER
-      { if (defData->callbacks->FPCCbk) defData->FPC.setMin($2); }
-      | K_EQUAL NUMBER
-      { if (defData->callbacks->FPCCbk) defData->FPC.setEqual($2); }
-
-constrain_what_list: // empty 
-      | constrain_what_list constrain_what
-      ;
-
-constrain_what: '+' K_BOTTOMLEFT
-      { if (defData->callbacks->FPCCbk) defData->FPC.setDoingBottomLeft(); }
-      row_or_comp_list 
-      |       '+' K_TOPRIGHT
-      { if (defData->callbacks->FPCCbk) defData->FPC.setDoingTopRight(); }
-      row_or_comp_list 
-      ;
-
-row_or_comp_list: // empty 
-      | row_or_comp_list row_or_comp
-
-row_or_comp: '(' K_ROWS  {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ')'
-      { if (defData->callbacks->FPCCbk) defData->FPC.addRow($4); }
-      |    '(' K_COMPS {defData->dumb_mode = 1; defData->no_num = 1; } T_STRING ')'
-      { if (defData->callbacks->FPCCbk) defData->FPC.addComps($4); }
-
-timingdisables_section: timingdisables_start timingdisables_rules
-      timingdisables_end
-      ;
-
-timingdisables_start: K_TIMINGDISABLES NUMBER ';'
-      { 
-        if (defData->callbacks->TimingDisablesStartCbk)
-          CALLBACK(defData->callbacks->TimingDisablesStartCbk, defrTimingDisablesStartCbkType,
-                   ROUND($2));
-      }
-
-timingdisables_rules: // empty 
-      | timingdisables_rules timingdisables_rule
-      {}
-
-timingdisables_rule: '-' K_FROMPIN { defData->dumb_mode = 2; defData->no_num = 2;  } T_STRING
-      T_STRING K_TOPIN { defData->dumb_mode = 2; defData->no_num = 2;  } T_STRING T_STRING ';'
-      {
-        if (defData->callbacks->TimingDisableCbk) {
-          defData->TimingDisable.setFromTo($4, $5, $8, $9);
-          CALLBACK(defData->callbacks->TimingDisableCbk, defrTimingDisableCbkType,
-                &defData->TimingDisable);
-        }
-      }
-      | '-' K_THRUPIN {defData->dumb_mode = 2; defData->no_num = 2; } T_STRING T_STRING ';'
-      {
-        if (defData->callbacks->TimingDisableCbk) {
-          defData->TimingDisable.setThru($4, $5);
-          CALLBACK(defData->callbacks->TimingDisableCbk, defrTimingDisableCbkType,
-                   &defData->TimingDisable);
-        }
-      }
-      | '-' K_MACRO {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING td_macro_option ';'
-      {
-        if (defData->callbacks->TimingDisableCbk) {
-          defData->TimingDisable.setMacro($4);
-          CALLBACK(defData->callbacks->TimingDisableCbk, defrTimingDisableCbkType,
-                &defData->TimingDisable);
-        }
-      }
-      | '-' K_REENTRANTPATHS ';'
-      { if (defData->callbacks->TimingDisableCbk)
-          defData->TimingDisable.setReentrantPathsFlag();
-      }
-
-
-td_macro_option: K_FROMPIN {defData->dumb_mode = 1; defData->no_num = 1;} T_STRING K_TOPIN
-      {defData->dumb_mode=1; defData->no_num = 1;} T_STRING
-      {
-        if (defData->callbacks->TimingDisableCbk)
-          defData->TimingDisable.setMacroFromTo($3,$6);
-      }
-      |        K_THRUPIN {defData->dumb_mode=1; defData->no_num = 1;} T_STRING
-      {
-        if (defData->callbacks->TimingDisableCbk)
-          defData->TimingDisable.setMacroThru($3);
-      }
-
-timingdisables_end: K_END K_TIMINGDISABLES
-      { 
-        if (defData->callbacks->TimingDisablesEndCbk)
-          CALLBACK(defData->callbacks->TimingDisablesEndCbk, defrTimingDisablesEndCbkType, 0);
-      }
-
-
-partitions_section: partitions_start partition_rules partitions_end
-      ;
-
-partitions_start: K_PARTITIONS NUMBER ';'
-      {
-        if (defData->callbacks->PartitionsStartCbk)
-          CALLBACK(defData->callbacks->PartitionsStartCbk, defrPartitionsStartCbkType,
-                   ROUND($2));
-      }
-
-partition_rules: // empty 
-      | partition_rules partition_rule
-      { }
-
-partition_rule: start_partition partition_members ';' 
-      { 
-        if (defData->callbacks->PartitionCbk)
-          CALLBACK(defData->callbacks->PartitionCbk, defrPartitionCbkType, &defData->Partition);
-      }
-
-start_partition: '-' { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING turnoff
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setName($3);
-      }
-
-turnoff: // empty 
-      | K_TURNOFF turnoff_setup turnoff_hold
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.addTurnOff($2, $3);
-      }
-
-turnoff_setup: // empty 
-      { $$ = (char*)" "; }
-      | K_SETUPRISE
-      { $$ = (char*)"R"; }
-      | K_SETUPFALL
-      { $$ = (char*)"F"; }
-
-turnoff_hold: // empty 
-      { $$ = (char*)" "; }
-      | K_HOLDRISE
-      { $$ = (char*)"R"; }
-      | K_HOLDFALL
-      { $$ = (char*)"F"; }
-
-partition_members: // empty 
-      | partition_members partition_member
-      ;
-
-partition_member: '+' K_FROMCLOCKPIN {defData->dumb_mode=2; defData->no_num = 2;}
-      T_STRING T_STRING risefall minmaxpins
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setFromClockPin($4, $5);
-      }
-      | '+' K_FROMCOMPPIN {defData->dumb_mode=2; defData->no_num = 2; }
-      T_STRING T_STRING risefallminmax2_list
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setFromCompPin($4, $5);
-      }
-      | '+' K_FROMIOPIN {defData->dumb_mode=1; defData->no_num = 1; } T_STRING
-      risefallminmax1_list
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setFromIOPin($4);
-      }
-      | '+' K_TOCLOCKPIN {defData->dumb_mode=2; defData->no_num = 2; }
-      T_STRING T_STRING risefall minmaxpins
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setToClockPin($4, $5);
-      }
-      | '+' K_TOCOMPPIN {defData->dumb_mode=2; defData->no_num = 2; }
-      T_STRING T_STRING risefallminmax2_list
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setToCompPin($4, $5);
-      }
-      | '+' K_TOIOPIN {defData->dumb_mode=1; defData->no_num = 2; } T_STRING risefallminmax1_list
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setToIOPin($4);
-      }
-      | extension_stmt
-      { 
-        if (defData->callbacks->PartitionsExtCbk)
-          CALLBACK(defData->callbacks->PartitionsExtCbk, defrPartitionsExtCbkType,
-                   &defData->History_text[0]);
-      }
-
-minmaxpins: min_or_max_list K_PINS
-      { defData->dumb_mode = DEF_MAX_INT; defData->no_num = DEF_MAX_INT; } pin_list
-      { defData->dumb_mode = 0; defData->no_num = 0; }
-
-min_or_max_list: // empty 
-      | min_or_max_list min_or_max_member
-      { }
-
-min_or_max_member: K_MIN NUMBER NUMBER
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setMin($2, $3);
-      }
-      | K_MAX NUMBER NUMBER
-      {
-        if (defData->callbacks->PartitionCbk)
-          defData->Partition.setMax($2, $3);
-      }
-
-pin_list: // empty 
-      | pin_list T_STRING
-      { if (defData->callbacks->PartitionCbk) defData->Partition.addPin($2); }
-
-risefallminmax1_list: // empty 
-      | risefallminmax1_list risefallminmax1
-
-risefallminmax1: K_RISEMIN NUMBER
-      { if (defData->callbacks->PartitionCbk) defData->Partition.addRiseMin($2); }
-      | K_FALLMIN NUMBER
-      { if (defData->callbacks->PartitionCbk) defData->Partition.addFallMin($2); }
-      | K_RISEMAX NUMBER
-      { if (defData->callbacks->PartitionCbk) defData->Partition.addRiseMax($2); }
-      | K_FALLMAX NUMBER
-      { if (defData->callbacks->PartitionCbk) defData->Partition.addFallMax($2); }
-
-risefallminmax2_list:
-      risefallminmax2
-      | risefallminmax2_list risefallminmax2
-      ;
-
-risefallminmax2: K_RISEMIN NUMBER NUMBER
-      { if (defData->callbacks->PartitionCbk)
-          defData->Partition.addRiseMinRange($2, $3); }
-      | K_FALLMIN NUMBER NUMBER
-      { if (defData->callbacks->PartitionCbk)
-          defData->Partition.addFallMinRange($2, $3); }
-      | K_RISEMAX NUMBER NUMBER
-      { if (defData->callbacks->PartitionCbk)
-          defData->Partition.addRiseMaxRange($2, $3); }
-      | K_FALLMAX NUMBER NUMBER
-      { if (defData->callbacks->PartitionCbk)
-          defData->Partition.addFallMaxRange($2, $3); }
-
-partitions_end: K_END K_PARTITIONS
-      { if (defData->callbacks->PartitionsEndCbk)
-          CALLBACK(defData->callbacks->PartitionsEndCbk, defrPartitionsEndCbkType, 0); }
-
-comp_names: // empty 
-      | comp_names comp_name
-      { }
-
-comp_name: '(' {defData->dumb_mode=2; defData->no_num = 2; } T_STRING
-      T_STRING subnet_opt_syn ')'
-      {
-        // note that the defData->first T_STRING could be the keyword VPIN 
-        if (defData->callbacks->NetCbk)
-          defData->Subnet->addPin($3, $4, $5);
-      }
-
-subnet_opt_syn: // empty 
-      { $$ = 0; }
-      | '+' K_SYNTHESIZED
-      { $$ = 1; }
-
-subnet_options: // empty 
-      | subnet_options subnet_option
-
-subnet_option: subnet_type
-      {  
-        if (defData->callbacks->NetCbk) defData->Subnet->addWire($1);
-      }
-      paths
-      {  
-        defData->by_is_keyword = FALSE;
-        defData->do_is_keyword = FALSE;
-        defData->new_is_keyword = FALSE;
-        defData->step_is_keyword = FALSE;
-        defData->orient_is_keyword = FALSE;
-        defData->needNPCbk = 0;
-      }
-      | K_NONDEFAULTRULE { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      { if (defData->callbacks->NetCbk) defData->Subnet->setNonDefault($3); }
-
-subnet_type: K_FIXED
-      { $$ = (char*)"FIXED"; defData->dumb_mode = 1; }
-      | K_COVER
-      { $$ = (char*)"COVER"; defData->dumb_mode = 1; }
-      | K_ROUTED
-      { $$ = (char*)"ROUTED"; defData->dumb_mode = 1; }
-      | K_NOSHIELD
-      { $$ = (char*)"NOSHIELD"; defData->dumb_mode = 1; }
-
-pin_props_section: begin_pin_props pin_prop_list end_pin_props ;
-
-begin_pin_props: K_PINPROPERTIES NUMBER opt_semi
-      { if (defData->callbacks->PinPropStartCbk)
-          CALLBACK(defData->callbacks->PinPropStartCbk, defrPinPropStartCbkType, ROUND($2)); }
-
-opt_semi:
-      // empty 
-      { }
-      | ';'
-      { }
-
-end_pin_props: K_END K_PINPROPERTIES
-      { if (defData->callbacks->PinPropEndCbk)
-          CALLBACK(defData->callbacks->PinPropEndCbk, defrPinPropEndCbkType, 0); }
-
-pin_prop_list: // empty 
-      | pin_prop_list pin_prop_terminal
-      ;
-
-pin_prop_terminal: '-' { defData->dumb_mode = 2; defData->no_num = 2; } T_STRING T_STRING
-      { if (defData->callbacks->PinPropCbk) defData->PinProp.setName($3, $4); }
-      pin_prop_options ';'
-      { if (defData->callbacks->PinPropCbk) {
-          CALLBACK(defData->callbacks->PinPropCbk, defrPinPropCbkType, &defData->PinProp);
-         // reset the property number
-         defData->PinProp.clear();
-        }
-      }
-
-pin_prop_options : // empty 
-      | pin_prop_options pin_prop ;
-
-pin_prop: '+' K_PROPERTY { defData->dumb_mode = DEF_MAX_INT; }
-      pin_prop_name_value_list 
-      { defData->dumb_mode = 0; }
-
-pin_prop_name_value_list : // empty 
-      | pin_prop_name_value_list pin_prop_name_value
-      ;
-
-pin_prop_name_value : T_STRING NUMBER
-      {
-        if (defData->callbacks->PinPropCbk) {
-          char propTp;
-          char* str = defData->ringCopy("                       ");
-          propTp = defData->session->CompPinProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "PINPROPERTIES");
-          sprintf(str, "%g", $2);
-          defData->PinProp.addNumProperty($1, $2, str, propTp);
-        }
-      }
- | T_STRING QSTRING
-      {
-        if (defData->callbacks->PinPropCbk) {
-          char propTp;
-          propTp = defData->session->CompPinProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "PINPROPERTIES");
-          defData->PinProp.addProperty($1, $2, propTp);
-        }
-      }
- | T_STRING T_STRING
-      {
-        if (defData->callbacks->PinPropCbk) {
-          char propTp;
-          propTp = defData->session->CompPinProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "PINPROPERTIES");
-          defData->PinProp.addProperty($1, $2, propTp);
-        }
-      }
-
-blockage_section: blockage_start blockage_defs blockage_end ;
-
-blockage_start: K_BLOCKAGES NUMBER ';'
-      { if (defData->callbacks->BlockageStartCbk)
-          CALLBACK(defData->callbacks->BlockageStartCbk, defrBlockageStartCbkType, ROUND($2)); }
-
-blockage_end: K_END K_BLOCKAGES
-      { if (defData->callbacks->BlockageEndCbk)
-          CALLBACK(defData->callbacks->BlockageEndCbk, defrBlockageEndCbkType, 0); }
-
-blockage_defs: // empty 
-      | blockage_defs blockage_def
-      ;
-
-blockage_def: blockage_rule rectPoly_blockage rectPoly_blockage_rules
-      ';'
-      {
-        if (defData->callbacks->BlockageCbk) {
-          CALLBACK(defData->callbacks->BlockageCbk, defrBlockageCbkType, &defData->Blockage);
-          defData->Blockage.clear();
-        }
-      }
-
-blockage_rule: '-' K_LAYER { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING 
-      {
-        if (defData->callbacks->BlockageCbk) {
-          if (defData->Blockage.hasPlacement() != 0) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6539, "Invalid BLOCKAGE statement defined in the DEF file. The BLOCKAGE statment has both the LAYER and the PLACEMENT statements defined.\nUpdate your DEF file to have either BLOCKAGE or PLACEMENT statement only.");
-              CHKERR();
-            }
-          }
-          defData->Blockage.setLayer($4);
-          defData->Blockage.clearPoly(); // free poly, if any
-        }
-        defData->hasBlkLayerComp = 0;
-        defData->hasBlkLayerSpac = 0;
-        defData->hasBlkLayerTypeComp = 0;
-      }
-
-      layer_blockage_rules
-      // 10/29/2001 - enhancement 
-      | '-' K_PLACEMENT
-      {
-        if (defData->callbacks->BlockageCbk) {
-          if (defData->Blockage.hasLayer() != 0) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6539, "Invalid BLOCKAGE statement defined in the DEF file. The BLOCKAGE statment has both the LAYER and the PLACEMENT statements defined.\nUpdate your DEF file to have either BLOCKAGE or PLACEMENT statement only.");
-              CHKERR();
-            }
-          }
-          defData->Blockage.setPlacement();
-          defData->Blockage.clearPoly(); // free poly, if any
-        }
-        defData->hasBlkPlaceComp = 0;
-        defData->hasBlkPlaceTypeComp = 0;
-      }
-      placement_comp_rules
-      
-layer_blockage_rules: // empty 
-      | layer_blockage_rules layer_blockage_rule
-      ;
-
-layer_blockage_rule: '+' K_SPACING NUMBER
-      {
-        if (defData->VersionNum < 5.6) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The SPACING statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6540, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        } else if (defData->hasBlkLayerSpac) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6541, "The SPACING statement is defined in the LAYER statement,\nbut there is already either a SPACING statement or DESIGNRULEWIDTH  statement has defined in the LAYER statement.\nUpdate your DEF file to have either SPACING statement or a DESIGNRULEWIDTH statement.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk)
-            defData->Blockage.setSpacing((int)$3);
-          defData->hasBlkLayerSpac = 1;
-        }
-      }
-      | '+' K_DESIGNRULEWIDTH NUMBER
-      {
-        if (defData->VersionNum < 5.6) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6541, "The SPACING statement is defined in the LAYER statement,\nbut there is already either a SPACING statement or DESIGNRULEWIDTH  statement has defined in the LAYER statement.\nUpdate your DEF file to have either SPACING statement or a DESIGNRULEWIDTH statement.");
-              CHKERR();
-            }
-          }
-        } else if (defData->hasBlkLayerSpac) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6541, "The SPACING statement is defined in the LAYER statement,\nbut there is already either a SPACING statement or DESIGNRULEWIDTH  statement has defined in the LAYER statement.\nUpdate your DEF file to have either SPACING statement or a DESIGNRULEWIDTH statement.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk)
-            defData->Blockage.setDesignRuleWidth((int)$3);
-          defData->hasBlkLayerSpac = 1;
-        }
-      }
-      | mask_blockage_rule
-      | comp_blockage_rule
-      
-mask_blockage_rule: 
-      '+' K_MASK NUMBER
-      {      
-        if (defData->validateMaskInput((int)$3, defData->blockageWarnings, defData->settings->BlockageWarnings)) {
-          defData->Blockage.setMask((int)$3);
-        }
-      } 
-
-comp_blockage_rule:
-      // 06/20/2001 - pcr 383204 = pcr 378102 
-      '+' K_COMPONENT { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->hasBlkLayerComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6542, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk) {
-            defData->Blockage.setComponent($4);
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkLayerComp = 1;
-          }
-        }
-      }
-      // 8/30/2001 - pcr 394394 
-      | '+' K_SLOTS
-      {
-        if (defData->hasBlkLayerComp || defData->hasBlkLayerTypeComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6542, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk) {
-            defData->Blockage.setSlots();
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkLayerComp = 1;
-          }
-          if (defData->VersionNum == 5.8) {
-            defData->hasBlkLayerTypeComp = 1;
-          }
-        }
-      }
-      | '+' K_FILLS
-      {
-        if (defData->hasBlkLayerComp || defData->hasBlkLayerTypeComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6542, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk){
-            defData->Blockage.setFills();
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkLayerComp = 1;
-          }
-          if (defData->VersionNum == 5.8) {
-            defData->hasBlkLayerTypeComp = 1;
-          }
-        }
-      }
-      | '+' K_PUSHDOWN
-      {
-        if (defData->hasBlkLayerComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6542, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk){
-            defData->Blockage.setPushdown();
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkLayerComp = 1;
-          }
-        }
-      }
-      | '+' K_EXCEPTPGNET              // 5.7 
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->BlockageCbk) {
-             if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-               defData->defMsg = (char*)malloc(10000);
-               sprintf (defData->defMsg,
-                 "The EXCEPTPGNET is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-               defData->defError(6549, defData->defMsg);
-               free(defData->defMsg);
-               CHKERR();
-              }
-           }
-        } else {
-           if (defData->hasBlkLayerComp) {
-             if (defData->callbacks->BlockageCbk) {
-               if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-                 defData->defError(6542, "The defined BLOCKAGES COMPONENT statement has either COMPONENT, SLOTS, FILLS, PUSHDOWN or EXCEPTPGNET defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES COMPONENT statement per layer.");
-                 CHKERR();
-               }
-             }
-           } else {
-             if (defData->callbacks->BlockageCbk){
-               defData->Blockage.setExceptpgnet();
-             }
-             if (defData->VersionNum < 5.8){
-               defData->hasBlkLayerComp = 1;
-             }
-           }
-        }
-      }
-
-placement_comp_rules: // empty 
-      | placement_comp_rules placement_comp_rule
-      ;
-      
-placement_comp_rule: // empty 
-      // 10/29/2001 - enhancement 
-      '+' K_COMPONENT { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->hasBlkPlaceComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6543, "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk){
-            defData->Blockage.setComponent($4);
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkPlaceComp = 1;
-          }
-        }
-      }
-      | '+' K_PUSHDOWN
-      {
-        if (defData->hasBlkPlaceComp) {
-          if (defData->callbacks->BlockageCbk) {
-            if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-              defData->defError(6543, "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement.");
-              CHKERR();
-            }
-          }
-        } else {
-          if (defData->callbacks->BlockageCbk){
-            defData->Blockage.setPushdown();
-          }
-          if (defData->VersionNum < 5.8) {
-            defData->hasBlkPlaceComp = 1;
-          }
-        }
-      }
-      | '+' K_SOFT                   // 5.7
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->BlockageCbk) {
-             if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-               defData->defMsg = (char*)malloc(10000);
-               sprintf (defData->defMsg,
-                 "The PLACEMENT SOFT is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-               defData->defError(6547, defData->defMsg);
-               free(defData->defMsg);
-               CHKERR();
-             }
-           }
-        } else {
-           if (defData->hasBlkPlaceComp || defData->hasBlkPlaceTypeComp) {
-             if (defData->callbacks->BlockageCbk) {
-               if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-                 defData->defError(6543, "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement.");
-                 CHKERR();
-               }
-             }
-           } else {
-             if (defData->callbacks->BlockageCbk){
-               defData->Blockage.setSoft();
-             }
-             if (defData->VersionNum < 5.8) {
-               defData->hasBlkPlaceComp = 1;
-             }
-             if (defData->VersionNum == 5.8) {
-               defData->hasBlkPlaceTypeComp = 1;
-             }
-           }
-        }
-      }
-      | '+' K_PARTIAL NUMBER         // 5.7
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->BlockageCbk) {
-             if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-                defData->defMsg = (char*)malloc(10000);
-                sprintf (defData->defMsg,
-                  "The PARTIAL is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-                defData->defError(6548, defData->defMsg);
-                free(defData->defMsg);
-                CHKERR();
-             }
-           }
-        } else {
-           if (defData->hasBlkPlaceComp || defData->hasBlkPlaceTypeComp) {
-             if (defData->callbacks->BlockageCbk) {
-               if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-                 defData->defError(6543, "The defined BLOCKAGES PLACEMENT statement has either COMPONENT, PUSHDOWN, SOFT or PARTIAL defined.\nOnly one of these statements is allowed per LAYER. Updated the DEF file to define a valid BLOCKAGES PLACEMENT statement.");
-                 CHKERR();
-               }
-             }
-           } else {
-             if (defData->callbacks->BlockageCbk){
-               defData->Blockage.setPartial($3);
-             } 
-             if (defData->VersionNum < 5.8) {
-               defData->hasBlkPlaceComp = 1;
-             }
-             if (defData->VersionNum == 5.8) {
-               defData->hasBlkPlaceTypeComp = 1;
-             }
-           }
-         }
-      }
-           
-
-rectPoly_blockage_rules: // empty 
-      | rectPoly_blockage_rules rectPoly_blockage
-      ;
-  
-rectPoly_blockage: K_RECT pt pt
-      {
-        if (defData->callbacks->BlockageCbk)
-          defData->Blockage.addRect($2.x, $2.y, $3.x, $3.y);
-      }
-      | K_POLYGON
-      {
-        if (defData->callbacks->BlockageCbk) {
-            defData->Geometries.Reset();
-        }
-      }
-      firstPt nextPt nextPt otherPts
-      {
-        if (defData->callbacks->BlockageCbk) {
-          if (defData->VersionNum >= 5.6) {  // only 5.6 and beyond
-            if (defData->Blockage.hasLayer()) {  // only in layer
-              if (defData->callbacks->BlockageCbk)
-                defData->Blockage.addPolygon(&defData->Geometries);
-            } else {
-              if (defData->callbacks->BlockageCbk) {
-                if (defData->blockageWarnings++ < defData->settings->BlockageWarnings) {
-                  defData->defError(6544, "A POLYGON statement is defined in the BLOCKAGE statement,\nbut it is not defined in the BLOCKAGE LAYER statement.\nUpdate your DEF file to either remove the POLYGON statement from the BLOCKAGE statement or\ndefine the POLYGON statement in a BLOCKAGE LAYER statement.");
-                  CHKERR();
-                }
-              }
-            }
-          }
-        }
-      }
-
-// 8/31/2001 - 5.4 enhancement 
-slot_section: slot_start slot_defs slot_end ;
-
-slot_start: K_SLOTS NUMBER ';'
-      { if (defData->callbacks->SlotStartCbk)
-          CALLBACK(defData->callbacks->SlotStartCbk, defrSlotStartCbkType, ROUND($2)); }
-
-slot_end: K_END K_SLOTS
-      { if (defData->callbacks->SlotEndCbk)
-          CALLBACK(defData->callbacks->SlotEndCbk, defrSlotEndCbkType, 0); }
-
-slot_defs: // empty 
-      | slot_defs slot_def
-      ;
-
-slot_def: slot_rule geom_slot_rules ';'
-      {
-        if (defData->callbacks->SlotCbk) {
-          CALLBACK(defData->callbacks->SlotCbk, defrSlotCbkType, &defData->Slot);
-          defData->Slot.clear();
-        }
-      }
-
-slot_rule: '-' K_LAYER { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING 
-      {
-        if (defData->callbacks->SlotCbk) {
-          defData->Slot.setLayer($4);
-          defData->Slot.clearPoly();     // free poly, if any
-        }
-      } geom_slot
-
-geom_slot_rules: // empty 
-      | geom_slot_rules geom_slot
-      ;
-
-geom_slot: K_RECT pt pt
-      {
-        if (defData->callbacks->SlotCbk)
-          defData->Slot.addRect($2.x, $2.y, $3.x, $3.y);
-      }
-      | K_POLYGON
-      {
-          defData->Geometries.Reset();
-      }
-      firstPt nextPt nextPt otherPts
-      {
-        if (defData->VersionNum >= 5.6) {  // only 5.6 and beyond
-          if (defData->callbacks->SlotCbk)
-            defData->Slot.addPolygon(&defData->Geometries);
-        }
-      }
-
-// 8/31/2001 -  5.4 enhancement 
-fill_section: fill_start fill_defs fill_end ;
-
-fill_start: K_FILLS NUMBER ';'
-      { if (defData->callbacks->FillStartCbk)
-          CALLBACK(defData->callbacks->FillStartCbk, defrFillStartCbkType, ROUND($2)); }
-
-fill_end: K_END K_FILLS
-      { if (defData->callbacks->FillEndCbk)
-          CALLBACK(defData->callbacks->FillEndCbk, defrFillEndCbkType, 0); }
-
-fill_defs: // empty 
-      | fill_defs fill_def
-      ;
-
-fill_def: fill_rule geom_fill_rules ';'
-      {
-        if (defData->callbacks->FillCbk) {
-          CALLBACK(defData->callbacks->FillCbk, defrFillCbkType, &defData->Fill);
-          defData->Fill.clear();
-        }
-      }
-      | '-' K_VIA { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING  // 5.7
-      {
-        if (defData->callbacks->FillCbk) {
-          defData->Fill.setVia($4);
-          defData->Fill.clearPts();
-          defData->Geometries.Reset();
-        }
-      }
-      fill_via_mask_opc_opt fill_via_pt ';'
-
-fill_rule: '-' K_LAYER { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->FillCbk) {
-          defData->Fill.setLayer($4);
-          defData->Fill.clearPoly();    // free poly, if any
-        }
-      } 
-      fill_layer_mask_opc_opt geom_fill            // 5.7
-
-geom_fill_rules: // empty 
-      | geom_fill_rules geom_fill
-      ;
-
-geom_fill: K_RECT pt pt
-      {
-        if (defData->callbacks->FillCbk)
-          defData->Fill.addRect($2.x, $2.y, $3.x, $3.y);
-      }
-      | K_POLYGON
-      {
-        defData->Geometries.Reset();
-      }
-      firstPt nextPt nextPt otherPts
-      {
-        if (defData->VersionNum >= 5.6) {  // only 5.6 and beyond
-          if (defData->callbacks->FillCbk)
-            defData->Fill.addPolygon(&defData->Geometries);
-        } else {
-            defData->defMsg = (char*)malloc(10000);
-            sprintf (defData->defMsg,
-              "POLYGON statement in FILLS LAYER is a version 5.6 and later syntax.\nYour def file is defined with version %g.", defData->VersionNum);
-            defData->defError(6564, defData->defMsg);
-            free(defData->defMsg);
-            CHKERR();
-        }
-      }
-
-fill_layer_mask_opc_opt: // empty 
-    | fill_layer_mask_opc_opt opt_mask_opc_l
-    ;
-opt_mask_opc_l: fill_layer_opc
-    | fill_mask
-    ;
-        
-// 5.7
-fill_layer_opc: 
-      '+' K_OPC
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->FillCbk) {
-             if (defData->fillWarnings++ < defData->settings->FillWarnings) {
-               defData->defMsg = (char*)malloc(10000);
-               sprintf (defData->defMsg,
-                 "The LAYER OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-               defData->defError(6553, defData->defMsg);
-               free(defData->defMsg);
-               CHKERR();
-             }
-           }
-        } else {
-           if (defData->callbacks->FillCbk)
-             defData->Fill.setLayerOpc();
-        }
-      }
-
-fill_via_pt: firstPt otherPts
-    {
-        if (defData->callbacks->FillCbk) {
-          defData->Fill.addPts(&defData->Geometries);
-          CALLBACK(defData->callbacks->FillCbk, defrFillCbkType, &defData->Fill);
-          defData->Fill.clear();
-        }
-    }
-      
-
-fill_via_mask_opc_opt: // empty 
-    | fill_via_mask_opc_opt opt_mask_opc
-    ;
-opt_mask_opc: fill_via_opc
-    | fill_viaMask
-    ;
-    
-// 5.7
-fill_via_opc:
-      '+' K_OPC
-      {
-        if (defData->VersionNum < 5.7) {
-           if (defData->callbacks->FillCbk) {
-             if (defData->fillWarnings++ < defData->settings->FillWarnings) {
-               defData->defMsg = (char*)malloc(10000);
-               sprintf (defData->defMsg,
-                 "The VIA OPC is available in version 5.7 or later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-               defData->defError(6554, defData->defMsg);
-               free(defData->defMsg);
-               CHKERR();
-             }
-           }
-        } else {
-           if (defData->callbacks->FillCbk)
-             defData->Fill.setViaOpc();
-        }
-      }
-      
-fill_mask:
-      '+' K_MASK NUMBER
-      { 
-        if (defData->validateMaskInput((int)$3, defData->fillWarnings, defData->settings->FillWarnings)) {
-             if (defData->callbacks->FillCbk) {
-                defData->Fill.setMask((int)$3);
-             }
-        }
-      }
-
-fill_viaMask:
-      '+' K_MASK NUMBER
-      { 
-        if (defData->validateMaskInput((int)$3, defData->fillWarnings, defData->settings->FillWarnings)) {
-             if (defData->callbacks->FillCbk) {
-                defData->Fill.setMask((int)$3);
-             }
-        }
-      }
-      
-// 11/17/2003 - 5.6 enhancement 
-nondefaultrule_section: nondefault_start nondefault_def nondefault_defs
-    nondefault_end ;
-
-nondefault_start: K_NONDEFAULTRULES NUMBER ';'
-      { 
-        if (defData->VersionNum < 5.6) {
-          if (defData->callbacks->NonDefaultStartCbk) {
-            if (defData->nonDefaultWarnings++ < defData->settings->NonDefaultWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The NONDEFAULTRULE statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g.", defData->VersionNum);
-              defData->defError(6545, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        } else if (defData->callbacks->NonDefaultStartCbk)
-          CALLBACK(defData->callbacks->NonDefaultStartCbk, defrNonDefaultStartCbkType,
-                   ROUND($2));
-      }
-
-nondefault_end: K_END K_NONDEFAULTRULES
-      { if (defData->callbacks->NonDefaultEndCbk)
-          CALLBACK(defData->callbacks->NonDefaultEndCbk, defrNonDefaultEndCbkType, 0); }
-
-nondefault_defs: // empty 
-      | nondefault_defs nondefault_def
-      ;
-
-nondefault_def: '-' { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.clear(); 
-          defData->NonDefault.setName($3);
-        }
-      }
-      nondefault_options ';'
-      { if (defData->callbacks->NonDefaultCbk)
-          CALLBACK(defData->callbacks->NonDefaultCbk, defrNonDefaultCbkType, &defData->NonDefault); }
-
-nondefault_options: // empty  
-      | nondefault_options nondefault_option
-      ;
-
-nondefault_option: '+' K_HARDSPACING
-      {
-        if (defData->callbacks->NonDefaultCbk)
-          defData->NonDefault.setHardspacing();
-      }
-      | '+' K_LAYER { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-        K_WIDTH NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addLayer($4);
-          defData->NonDefault.addWidth($6);
-        }
-      }
-      nondefault_layer_options
-      | '+' K_VIA { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addVia($4);
-        }
-      }
-      | '+' K_VIARULE { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addViaRule($4);
-        }
-      }
-      | '+' K_MINCUTS { defData->dumb_mode = 1; defData->no_num = 1; } T_STRING NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addMinCuts($4, (int)$5);
-        }
-      }
-      | nondefault_prop_opt
-      ;
-
-nondefault_layer_options: // empty 
-      | nondefault_layer_options nondefault_layer_option
-
-nondefault_layer_option:
-      K_DIAGWIDTH NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addDiagWidth($2);
-        }
-      }
-      | K_SPACING NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addSpacing($2);
-        }
-      }
-      | K_WIREEXT NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          defData->NonDefault.addWireExt($2);
-        }
-      }
-      ;
-
-nondefault_prop_opt: '+' K_PROPERTY { defData->dumb_mode = DEF_MAX_INT;  }
-                     nondefault_prop_list
-      { defData->dumb_mode = 0; }
-
-nondefault_prop_list: // empty 
-      | nondefault_prop_list nondefault_prop
-      ;
-
-nondefault_prop: T_STRING NUMBER
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          char propTp;
-          char* str = defData->ringCopy("                       ");
-          propTp = defData->session->NDefProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "NONDEFAULTRULE");
-          sprintf(str, "%g", $2);
-          defData->NonDefault.addNumProperty($1, $2, str, propTp);
-        }
-      }
-      | T_STRING QSTRING
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          char propTp;
-          propTp = defData->session->NDefProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "NONDEFAULTRULE");
-          defData->NonDefault.addProperty($1, $2, propTp);
-        }
-      }
-      | T_STRING T_STRING
-      {
-        if (defData->callbacks->NonDefaultCbk) {
-          char propTp;
-          propTp = defData->session->NDefProp.propType($1);
-          CHKPROPTYPE(propTp, $1, "NONDEFAULTRULE");
-          defData->NonDefault.addProperty($1, $2, propTp);
-        }
-      }
-
-// 12/2/2003 - 5.6 enhancement 
-styles_section: styles_start styles_rules styles_end ;
-
-styles_start: K_STYLES NUMBER ';'
-      {
-        if (defData->VersionNum < 5.6) {
-          if (defData->callbacks->StylesStartCbk) {
-            if (defData->stylesWarnings++ < defData->settings->StylesWarnings) {
-              defData->defMsg = (char*)malloc(1000);
-              sprintf (defData->defMsg,
-                 "The STYLES statement is available in version 5.6 and later.\nHowever, your DEF file is defined with version %g", defData->VersionNum);
-              defData->defError(6546, defData->defMsg);
-              free(defData->defMsg);
-              CHKERR();
-            }
-          }
-        } else if (defData->callbacks->StylesStartCbk)
-          CALLBACK(defData->callbacks->StylesStartCbk, defrStylesStartCbkType, ROUND($2));
-      }
-
-styles_end: K_END K_STYLES
-      { if (defData->callbacks->StylesEndCbk)
-          CALLBACK(defData->callbacks->StylesEndCbk, defrStylesEndCbkType, 0); }
-
-styles_rules: // empty 
-      | styles_rules styles_rule
-      ;
-
-styles_rule: '-' K_STYLE NUMBER
-      {
-        if (defData->callbacks->StylesCbk) defData->Styles.setStyle((int)$3);
-        defData->Geometries.Reset();
-      }
-      firstPt nextPt otherPts ';'
-      {
-        if (defData->VersionNum >= 5.6) {  // only 5.6 and beyond will call the callback
-          if (defData->callbacks->StylesCbk) {
-            defData->Styles.setPolygon(&defData->Geometries);
-            CALLBACK(defData->callbacks->StylesCbk, defrStylesCbkType, &defData->Styles);
-          }
-        }
-      }
-      
-
-%%
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_keywords.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_keywords.cpp
deleted file mode 100644
index ea1cfee..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_keywords.cpp
+++ /dev/null
@@ -1,1367 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: icftcm $
-//  $Revision: #2 $
-//  $Date: 2017/08/28 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-/*                                                                     */
-/*   Revision:                                                         */
-/*   03-15-2000 Wanda da Rosa - Add code to support 5.4, add keywords  */
-/*                              for PINS + USE, SPECIALNETS + SHAPE    */
-/*                              and other keywords                     */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "lex.h"
-#include "defiDefs.hpp"
-#include "defiDebug.hpp"
-#include "defrCallBacks.hpp"
-#include "defrData.hpp"
-#include "defrSettings.hpp"
-
-#ifdef WIN32
-#   include <direct.h>
-#else /* not WIN32 */
-#   include <unistd.h>
-#endif /* WIN32 */
-
-
-using namespace std;
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#include "def.tab.h"
-
-
-int defrData::defGetKeyword(const char* name, int *result) 
-{ 
-    map<const char*, int, defCompareCStrings>::const_iterator search = settings->Keyword_set.find(name);
-
-    if ( search != settings->Keyword_set.end()) {
-        *result = search->second;
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-int 
-defrData::defGetAlias(const string &name, string &result) 
-{ 
-    map<string, string, defCompareStrings>::iterator search = def_alias_set.find(name);
-
-    if ( search != def_alias_set.end()) {
-        result = search->second;
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-int defrData::defGetDefine(const string &name, string &result) 
-{ 
-    map<string, string, defCompareStrings>::iterator search = def_defines_set.find(name);
-
-    if ( search != def_defines_set.end()) {
-        result = search->second;
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-// lex.cpph starts here
-/* User defined if log file should be in append from the previous run */
-/* User defined if property string value should be process */
-/* Varible from lex.cpph to keep track of invalid nonEnglish character */
-/* in def file */
-
-/************Some simple file reading routines since ungetc() proves ****/
-/************to be quite slow, and we don't need multiple chars of pushback */
-#ifndef WIN32
-#   include <unistd.h>
-#endif
-
-void 
-defrData::reload_buffer() {
-   int nb = 0;
-
-   if (first_buffer) {
-      first_buffer = 0;
-      if (settings->ReadFunction) {
-         if ((nb = (*settings->ReadFunction)(File, buffer, 4)) != 4) {
-            next = NULL;
-            return;
-         }
-      } else {
-         if ((nb = fread(buffer, 1, 4, File)) != 4) {
-            next = NULL;
-            return;
-         }
-      }
-   }
-
-   if (nb == 0) {
-      if (settings->ReadFunction)
-         nb = (*settings->ReadFunction)(File, buffer, IN_BUF_SIZE);
-      else
-         /* This is a normal file so just read some bytes. */
-         nb = fread(buffer, 1, IN_BUF_SIZE, File);
-   }
-    
-   if (nb <= 0) {
-      next = NULL;
-   } else {
-      next = buffer;
-      last = buffer + nb - 1;
-   }
-}   
-
-int 
- defrData::GETC() {
-   // Remove '\r' symbols from Windows streams.
-    for(;;) {
-       if (next > last)
-          reload_buffer();
-       if(next == NULL)
-          return EOF;
-
-       int ch = *next++;
-
-       if (ch != '\r')
-           return ch;
-    }
-}
-
-void 
-defrData::UNGETC(char ch) {
-    if (next <= buffer) {
-        defError(6111, "UNGETC: buffer access violation.");
-    } else {
-        *(--next) = ch;
-    }
-}
-
-/* Return a copy of the string allocated from the ring buffer.
- * We will keep several strings in the buffer and just reuse them.
- * This could cause problems if we need to use more strings than we
- * have in the buffer.
- */
-char* 
-defrData::ringCopy(const char* string) 
-{
-   int len = strlen(string) + 1;
-   if (++(ringPlace) >= RING_SIZE) 
-       ringPlace = 0;
-   if (len > ringSizes[ringPlace]) {
-      free(ring[ringPlace]);
-      ring[ringPlace] = (char*)malloc(len);
-      ringSizes[ringPlace] = len;
-   }
-   strcpy(ring[ringPlace], string);
-   return ring[ringPlace];
-}
-
-
-int 
-defrData::DefGetTokenFromStack(char *s) {
-   const char *ch;        /* utility variable */
-   char *prS = NULL;          /* pointing to the previous char or s */
-
-   while(input_level >= 0) {
-      for(ch=stack[input_level].c_str(); *ch != 0; ch++)    /* skip white space */
-         if (*ch != ' ' && *ch != '\t' && (nl_token || *ch != '\n'))
-            break;
-      /* did we find anything?  If not, decrement level and try again */
-      if (*ch == 0)
-         input_level--;
-      else if (*ch == '\n') {
-         *s++ = *ch; 
-         *s = 0;
-         return TRUE;
-      }
-      else {            /* we found something */
-        for(; ; ch++)  {
-           if (*ch == ' ' || *ch == '\t' || *ch == '\n' || *ch == 0) {
-              /* 10/10/2000 - Wanda da Rosa, pcr 341032
-              ** Take out the last '"', the 1st will be skip later
-              */
-              if (*prS == '"') {
-                 *prS = '\0';
-              } else
-                 *s++ = '\0';
-              stack[input_level] = ch;
-
-              return TRUE;
-           }
-           /* 10/10/2000 - Wanda da Rosa, pcr 341032
-           ** Save the location of the previous s
-           */
-           prS = s;
-           *s++ = *ch;
-        }
-     }
-   }
-   return FALSE;    /* if we get here, we ran out of input levels */
-}
-
- void 
-defrData::print_lines(long long lines) 
-{
-    if (lines % settings->defiDeltaNumberLines) {
-        return;
-    }
-
-    if (settings->ContextLineNumberFunction) {
-        settings->ContextLineNumberFunction(session->UserData, (int)lines);
-    } else if (settings->ContextLongLineNumberFunction ) {
-        settings->ContextLongLineNumberFunction(session->UserData, lines);
-    }
-    if (settings->LineNumberFunction) {
-        settings->LineNumberFunction((int)lines);
-    } else if (settings->LongLineNumberFunction ) {
-        settings->LongLineNumberFunction(lines);
-    }
-}
-
-const char * 
-defrData::lines2str(long long lines) 
-{
-
-#ifdef _WIN32
-    sprintf(lineBuffer, "%I64d", lines);
-#else
-    sprintf(lineBuffer, "%lld", lines);
-#endif 
-
-    return lineBuffer;
-}
-
-
-// Increment current position of buffer pointer. 
-// Double buffer size if curPos is out of boundary.
-void  
-defrData::IncCurPos(char **curPos, char **buffer, int *bufferSize)
-{
-    (*curPos)++;
-    if (*curPos - *buffer < *bufferSize) {
-        return;
-    }
-
-    long offset = *curPos - *buffer;
-
-    *bufferSize *= 2;
-    *buffer = (char*) realloc(*buffer, *bufferSize);
-    *curPos = *buffer + offset;
-}
-
-
-int
-defrData::DefGetToken(char **buf, int *bufferSize)
-{
-    char *s = *buf;
-    int ch;
-
-    ntokens++;
-    defInvalidChar = 0;
-
-    if (input_level >= 0){  /* if we are expanding an alias */
-       if(DefGetTokenFromStack(s)) /* try to get a token from it */
-          return TRUE;               /* if we get one, return it */
-    }                                /* but if not, continue */
-
-    /* skip blanks and count lines */
-    while ((ch = GETC()) != EOF) {
-       if (ch == '\n') {
-          print_lines(++nlines);
-       }
-       if (ch != ' ' && ch != '\t' && (nl_token || ch != '\n'))
-          break;
-    }
-
-    if (ch == EOF) 
-        return FALSE;
-
-
-    if (ch == '\n') {
-       *s = ch; 
-       IncCurPos(&s, buf, bufferSize);
-
-       *s = '\0';
-       return TRUE;
-    }
-
-    /* now get the token */
-    if (ch == '"') {
-       do {
-          /* 5/5/2008 - CCR 556818
-          ** Check if the ch is a valid ascii character 0 =< ch < 128
-          ** If not write out an error
-          */
-          /* 8/7/2008 - CCR 586175
-          ** Some files may not end with \n or \0 or EOF as the last character
-          ** The parser allows this char instead of error out
-          */
-          if ((ch < -1) || (ch > 127)) {
-             defInvalidChar = 1;
-          }
-
-          /* 8/22/2000 - Wanda da Rosa, pcr 333334
-          ** save the previous char to allow backslash quote within quote
-          */
-          if (!settings->DisPropStrProcess) {
-             /* 3/4/2008 - CCR 523879 - convert \\ to \, \" to ", \x to x */
-             if (ch == '\\') {      /* got a \, save the next char only */
-                ch = GETC();
-                if ((ch == '\n') || (ch == EOF)) { /* senaty check */
-                    *s = '\0';
-                    return FALSE;
-                }
-             }
-          }
-
-          *s = ch;
-          IncCurPos(&s, buf, bufferSize);
-
-          ch = GETC();
-
-          if (ch == EOF) {
-             *s = '\0';
-             return FALSE;
-          }
-       } while (ch != '"');
-
-       *s = '\0';
-       return TRUE;
-    }
-
-    if (names_case_sensitive) {
-       for(; ; ch = GETC())  {
-
-          /* 5/5/2008 - CCR 556818
-          ** Check if the ch is a valid ascii character 0 =< ch < 128
-          ** If not write out an error
-          */
-          if ((ch < -1) || (ch > 127)) {
-             defInvalidChar = 1;
-          }
-
-          if (ch == ' ' || ch == '\t' || ch == '\n' || ch == EOF)
-             break;
-
-          *s = ch;
-          IncCurPos(&s, buf, bufferSize);        
-       }
-    }
-    else { /* we are case insensitive, use a different loop */
-       for(; ; ch = GETC())  {
-
-          /* 5/5/2008 - CCR 556818
-          ** Check if the ch is a valid ascii character 0 =< ch < 128
-          ** If not write out an error
-          */
-          if ((ch < -1) || (ch > 127)) {
-             defInvalidChar = 1;
-          }
-
-          if (ch == ' ' || ch == '\t' || ch == '\n' || ch == EOF)
-             break;
-
-          *s = (ch >= 'a' && ch <= 'z')? (ch -'a' + 'A') : ch;            
-          IncCurPos(&s, buf, bufferSize);
-       }
-    }
-   
-    /* If we got this far, the last char was whitespace */
-    *s = '\0';
-    if (ch != EOF)   /* shouldn't ungetc an EOF */
-       UNGETC((char)ch);
-    return TRUE;
-}
-
-/* creates an upper case copy of an array */
-void 
-defrData::uc_array(char *source, char *dest)
-{
-    for(; *source != 0; )
-    *dest++ = toupper(*source++);
-    *dest = 0;
-}
-
-
-void
-defrData::StoreAlias()
-{
-    int         tokenSize = TOKEN_SIZE;
-    char        *aname = (char*)malloc(tokenSize);
-
-    DefGetToken(&aname, &tokenSize);
-
-    char        *line = (char*)malloc(tokenSize);
-
-    DefGetToken(&line, &tokenSize);  
-
-    char        *uc_line = (char*)malloc(tokenSize);
-
-    string so_far;               /* contains alias contents as we build it */
-
-    if (strcmp(line,"=") != 0) {
-       defError(6000, "Expecting '='");
-       return;
-    }
-
-    /* now keep getting lines till we get one that contains &ENDALIAS */
-    for(char *p = NULL ;p == NULL;){
-        int i;
-        char *s = line;
-        for(i=0;i<tokenSize-1;i++) {
-            int ch = GETC();
-            if (ch == EOF) {
-                defError(6001, "End of file in &ALIAS");
-                return;
-            }
-
-            *s++ = ch;
-            
-            if (ch == '\n') {
-                print_lines(++nlines);             
-                break;
-            }
-        }
-
-        *s = '\0';
-
-        uc_array(line, uc_line);             /* make upper case copy */
-        p = strstr(uc_line, "&ENDALIAS");    /* look for END_ALIAS */
-        if (p != NULL)                       /* if we find it */
-            *(line + (p - uc_line)) = 0;     /* remove it from the line */
-
-        so_far += line;
-    }
-
-    def_alias_set[aname] = so_far;
-
-    free(aname);
-    free(line);
-    free(uc_line);
-}
-
-/* The main routine called by the YACC parser to get the next token.
- *    Returns 0 if no more tokens are available.
- *    Returns an integer for keywords (see the yacc_defines.h for values)
- *    Returns the character itself for punctuation
- *    Returns NUMBER for numeric looking tokens
- *    Returns T_STRING for anything else
- * If the global "dumb_mode" is > 0, it reads the next token in "dumb mode".
- * In this case, it does not do keyword lookup, or attempt to read a token
- * as a number; if the token is not punctuation, it's a T_STRING.  Each token
- * read decrements dumb_mode, so you can instruct the the lexer to read the
- * next N tokens in dumb mode by setting "dumb_mode" to that value.
- *
- * Newlines are in general silently ignored.  If the global nl_token is
- * true, however, they are returned as the token K_NL.
- */
-
-int 
-defrData::defyylex(YYSTYPE *pYylval) {
-
-   int v = sublex(pYylval);
-   if (defPrintTokens) {
-      if (v == 0) {
-         printf("yylex NIL\n");
-      } else if (v < 256) {
-         printf("yylex char %c\n", v);
-      } else if (v == QSTRING) {
-         printf("yylex quoted string '%s'\n", pYylval->string);
-      } else if (v == T_STRING) {
-         printf("yylex string '%s'\n", pYylval->string);
-      } else if (v == NUMBER) {
-         printf("yylex number %f\n", pYylval->dval);
-      } else {
-         printf("yylex keyword %s\n", defrData::defkywd(v));
-      }
-   }
-
-   if ((v == 0) && (!doneDesign)) {
-      defError(6002, "Incomplete def file.");
-      // Stop printing error messages after the EOF. 
-      hasFatalError = 1; 
-      return (-1);
-   }
-
-   return v;
-}
-
-int 
-defrData::sublex(YYSTYPE *pYylval)
-{
-   char fc;
-   double numVal;
-   char*  outMsg;
-
-   pv_deftoken = (char*)realloc(pv_deftoken, deftokenLength);
-   strcpy(pv_deftoken, deftoken);
-
-   /* First, we eat all the things the parser should be unaware of.
-    * This includes:
-    * a) Comments
-    * b) &alias definitions
-    * c) &alias expansions
-    */
-   for(;;) {
-      if(!DefGetToken(&deftoken, &deftokenLength)) {    /* get a raw token */
-         return 0;
-      }
-      fc = deftoken[0];
-      uc_token = (char*)realloc(uc_token, deftokenLength);
-
-      /* first, check for # comments or &alias statements.  # comments
-      we ignore, and &alias statements are eaten and recorded by the
-      lexer. */
-      if (fc == settings->CommentChar) {
-         // The code isn't work in correct way, no way to fix it exits 
-         // but keep it for compatibility reasons. 
-         int magic_count = -1;
-         for(fc = GETC();; fc = GETC()) {/* so skip to the end of line */
-            magic_count++;
-            if ((magic_count < (int)strlen(magic)) && (fc == magic[magic_count])) {
-              if ((int)strlen(magic) == (magic_count + 1)) {
-                if (settings->MagicCommentFoundFunction) {
-                  settings->MagicCommentFoundFunction();
-                }
-              }
-            }
-            if (fc == EOF) return 0;
-            if (fc == '\n') {
-                print_lines(++nlines);
-                break;
-            }
-         }
-      }
-      else if (fc == '&') {
-         /* begins with &.  If &alias, read contents and */
-         /* store them.  Otherwise it's a define, or a macro use. */
-         string alias;
-         uc_array(deftoken, uc_token);
-
-         if (strcmp(uc_token,"&ALIAS") == 0)
-            StoreAlias();    /* read and store the alias */
-         else if (defGetAlias(deftoken, alias))
-            stack[++input_level] = alias;
-         else
-            break;    /* begins with &, but not an &alias defn. or use. */
-      } else
-         break;    /* does not begin with commentChar or '&' */
-   }
-
-   if (defInvalidChar) {
-      outMsg = (char*)malloc(500 + strlen(deftoken));
-      sprintf(outMsg, "Invalid characters found in \'%s\'.\nThese characters might be using the character types other than English.\nCreate characters by specifying valid characters types.",
-              deftoken);
-      defError(6008, outMsg);
-      free(outMsg);
-      hasFatalError = 1;
-      return 0;
-   }
-
-   if (doneDesign) {
-      fc = EOF;
-      defInfo(8000, "There are still data after the END DESIGN statement");
-      return 0;    
-   }
-
-   if(fc == '\"') {
-      pYylval->string = ringCopy(&(deftoken[1]));
-
-      return QSTRING;
-   }
-
-   /* at this point we've read a token */
-   /* printf("Token is %s\n", deftoken); */
-   
-   // Protect the token counting variables form the decrement overflow.
-   if (dumb_mode >= 0) {
-       dumb_mode--;
-   }
-
-   if (no_num >= 0) {
-       no_num--;
-   }
-
-   if (isdigit(fc) || fc == '.' || (fc == '-' && deftoken[1] != '\0') ) {
-      char *ch;
-      /* 6/12/2003 - The following switching to use strtol first is a fix */
-      /* for FE for performance improvement. */
-      /* Adding the flag "parsing_property" is for pcr 594214, need to call */
-      /* strtod first to handle double number inside PROPERTY.  Only        */
-      /* property has real number (large number) */
-      if (!real_num) {
-         pYylval->dval = strtol(deftoken, &ch, 10); /* try string to long first */
-         if (no_num < 0 && *ch == '\0') { /* did we use the whole string? */
-            return NUMBER;
-         } else {  /* failed strtol, try double */
-            numVal = pYylval->dval = strtod(deftoken, &ch);
-            if (no_num < 0 && *ch == '\0') {  /* did we use the whole string? */
-               /* check if the integer has exceed the limit */
-               if ((numVal >= lVal) && (numVal <= rVal))
-                  return NUMBER;    /* YES, it's really a number */
-               else {
-                  char* str = (char*)malloc(strlen(deftoken)
-                               +strlen(session->FileName)+350);
-                  sprintf(str,
-                    "<Number has exceed the limit for an integer> in %s at line %s\n",
-                    session->FileName, lines2str(nlines));
-                  fflush(stdout);
-                  defiError(1, 0, str);
-                  free(str);
-                  errors++;
-                  return NUMBER;
-               }
-             } else {
-               pYylval->string = ringCopy(deftoken);  /* NO, it's a string */
-               return T_STRING;
-            }
-         }
-      } else {  /* handling PROPERTY, do strtod first instead of strtol */
-         numVal = pYylval->dval = strtod(deftoken, &ch);
-         if (no_num < 0 && *ch == '\0') { /* did we use the whole string? */
-            /* check if the integer has exceed the limit */
-            if (real_num)    /* this is for PROPERTYDEF with REAL */
-               return NUMBER;
-            if ((numVal >= lVal) && (numVal <= rVal)) 
-               return NUMBER;    /* YES, it's really a number */
-            else {
-               char* str = (char*)malloc(strlen(deftoken)
-                                +strlen(session->FileName)+350);
-               sprintf(str,
-                 "<Number has exceed the limit for an integer> in %s at line %s\n",
-                 session->FileName, lines2str(nlines));
-               fflush(stdout);
-               defiError(1, 0, str);
-               free(str);
-               errors++;
-               return NUMBER;
-            }
-         } else {  /* failed integer conversion, try floating point */
-            pYylval->dval = strtol(deftoken, &ch, 10);
-            if (no_num < 0 && *ch == '\0')  /* did we use the whole string? */
-               return NUMBER;
-            else {
-               pYylval->string = ringCopy(deftoken);  /* NO, it's a string */
-               return T_STRING;
-            }
-         }
-      }
-   }
-      
-   /* if we are dumb mode, all we return is punctuation and strings & numbers*/
-   /* until we see the next '+' or ';' deftoken */
-   if (dumb_mode >= 0) {
-      if (deftoken[1]=='\0' && (fc=='('||fc==')'||fc=='+'||fc==';'||fc=='*')){
-      
-         if (fc == ';' ||  fc == '+') {
-            dumb_mode = 0;
-            no_num = 0;
-         }   
-         return (int)fc;
-      }
-      if (by_is_keyword  && ((strcmp(deftoken,"BY") == 0) ||
-          (strcmp(deftoken, "by") == 0))) {
-         return K_BY; /* even in dumb mode, we must see the BY deftoken */
-      }
-      if (do_is_keyword  && ((strcmp(deftoken,"DO") == 0) ||
-          (strcmp(deftoken, "do") == 0))) {
-         return K_DO; /* even in dumb mode, we must see the DO deftoken */
-      }
-      if (new_is_keyword  && ((strcmp(deftoken,"NEW") == 0) ||
-          (strcmp(deftoken, "new") == 0))) {
-         return K_NEW; /* even in dumb mode, we must see the NEW deftoken */
-      }
-      if (nondef_is_keyword && ((strcmp(deftoken, "NONDEFAULTRULE") == 0) ||
-          (strcmp(deftoken, "nondefaultrule") == 0))){
-          return K_NONDEFAULTRULE; /* even in dumb mode, we must see the */
-                                   /* NONDEFAULTRULE deftoken */
-      }
-      if (mustjoin_is_keyword && ((strcmp(deftoken, "MUSTJOIN") == 0) ||
-          (strcmp(deftoken, "mustjoin") == 0))) {
-          return K_MUSTJOIN; /* even in dumb mode, we must see the */
-                             /* MUSTJOIN deftoken */
-      }
-      if (step_is_keyword  && ((strcmp(deftoken,"STEP") == 0) ||
-          (strcmp(deftoken, "step") == 0))) {
-          return K_STEP;/* even in dumb mode, we must see the STEP deftoken */
-      }
-      if (fixed_is_keyword  && ((strcmp(deftoken,"FIXED") == 0) ||
-          (strcmp(deftoken, "fixed") == 0))) {
-         return K_FIXED; /* even in dumb mode, we must see the FIXED deftoken */
-      }  
-      if (cover_is_keyword  && ((strcmp(deftoken,"COVER") == 0) ||
-          (strcmp(deftoken, "cover") == 0))) {
-         return K_COVER; /* even in dumb mode, we must see the COVER deftoken */
-      }
-      if (routed_is_keyword  && ((strcmp(deftoken,"ROUTED") == 0) ||
-          (strcmp(deftoken, "rounted") == 0))) {
-         return K_ROUTED; /* even in dumb mode, we must see the */
-                          /* ROUTED deftoken */
-      }
-      
-      if (virtual_is_keyword && ((strcmp(deftoken, "VIRTUAL") == 0 )
-         || (strcmp(deftoken, "virtual") == 0 ))) {
-         return K_VIRTUAL;
-      }
-      
-      if (rect_is_keyword && ((strcmp(deftoken, "RECT") == 0 )
-         || (strcmp(deftoken, "rect") == 0 ))) {
-         return K_RECT;
-      }
-      
-      if (virtual_is_keyword && ((strcmp(deftoken, "MASK") == 0 )
-         || (strcmp(deftoken, "mask") == 0 ))) {
-         return K_MASK;
-      }
-      
-      if (orient_is_keyword) {
-         int result;
-         uc_array(deftoken, uc_token);
-
-         if (defGetKeyword(uc_token, &result)) {
-            if (K_N == result)
-                return K_N;
-            if (K_W == result)
-                return K_W;
-            if (K_S == result)
-                return K_S;
-            if (K_E == result)
-                return K_E;
-            if (K_FN == result)
-                return K_FN;
-            if (K_FW == result)
-                return K_FW;
-            if (K_FS == result)
-                return K_FS;
-            if (K_FE == result)
-            if (strcmp(deftoken, "FE") == 0)
-                return K_FE;
-         }
-      }
-      pYylval->string = ringCopy(deftoken);
-      return T_STRING;
-   }
-
-   /* if we get here we are in smart mode.  Parse deftoken */
-   /* 2/19/2004 - add _ since name can starts with '_' */
-   /* 2/23/2004 - add the following characters which a name can starts with */
-   /*    ! $ | : , @ ~ = < . ? { ' ^ " */
-   if (isalpha(fc) || fc == '&' || fc == '_') {
-      int result;
-
-      History_text.resize(0);
-      uc_array(deftoken, uc_token);
-
-      if (defGetKeyword(uc_token, &result)) {
-         if (K_HISTORY == result) {  /* history - get up to ';' */
-            int n;
-            int c;
-            int prev;
-            n = 0;
-            prev = ' ';
-            while (1) {
-               c = GETC();
-               
-               if (c == EOF) {
-                   defError(6015, "Unexpected end of the DEF file.");
-                   break;
-               }
-
-               if (c == ';' && (prev == ' ' || prev == '\t' || prev == '\n'))
-                    break;
-               if (c == '\n') {
-                    print_lines(++nlines);
-               }
-               prev = c;
-               History_text.push_back(c);
-            }
-            History_text.push_back('\0');
-         } else if (K_BEGINEXT == result) { /* extension, get up to end */
-            int nn;
-            int cc;
-            int foundTag = 0;
-            int notEmpTag = 0;
-            int begQuote = 0;
-            nn = 0;
-            /* First make sure there is a name after BEGINEXT within quote */
-            /* BEGINEXT "name" */
-            while (1) {
-               cc = GETC();
-               
-               if (cc == EOF) {
-                   defError(6015, "Unexpected end of the DEF file.");
-                   break;
-               }
-
-               if (cc == '\n') {
-                  if (!foundTag) {
-                     defError(6003, "tag is missing for BEGINEXT");
-                     break;
-                  }
-               } else {
-
-                  History_text.push_back(cc);
-                  if (cc != ' ') {
-                     if (cc == '\"') {   /* found a quote */
-                        if (!begQuote)
-                           begQuote = 1;
-                        else if (notEmpTag) {
-                           foundTag = 1;
-                           break;      /* Found the quoted tag */
-                        } else {
-                           defError(6004, "The BEGINEXT tag is empty. Specify a value for the tag and try again.");
-                           break;
-                        }
-                     } else if (!begQuote) {   /* anything but a quote */
-                        defError(6005, "The '\"' is missing within the tag. Specify the '\"' in the tag and then try again.");
-                        break;
-                     }  else             /* anything but a quote and there */
-                        notEmpTag = 1;   /* is already a quote */
-                  }
-               }
-            }
-            if (foundTag) {
-               /* We have handle with the tag, just read the rest until */
-               /* ENDEXT */
-               begQuote = 0;
-               while (1) {
-                  cc = GETC();
-               
-                  if (cc == EOF) {
-                      defError(6015, "Unexpected end of the DEF file.");
-                      break;
-                  }
-
-                  if (cc == '\n') {
-                        print_lines(++nlines);
-                  } else if (cc == '\"') {
-                     if (!begQuote)
-                        begQuote = 1;
-                     else
-                        begQuote = 0;
-                  }
-
-                  History_text.push_back(cc);
-
-                  int histTextSize = History_text.size();
-
-                  if (histTextSize >= 6 && memcmp(&History_text[histTextSize - 6 ], "ENDEXT", 6) == 0) {
-                     if (begQuote)
-                        defError(6006, "The ending '\"' is missing in the tag. Specify the ending '\"' in the tag and then try again.");
-                     break;
-                  } else if (histTextSize >= 10 && memcmp(&History_text[histTextSize - 10 ], "END DESIGN", 10) == 0) {
-                     defError(6007, "The ENDEXT statement is missing in the DEF file. Include the statement and then try again.");
-                     nlines--;
-                     break;
-                  }
-               }
-            }
-            History_text.push_back('\0');
-         }
-         return result;        /* YES, return its value */
-      } else {  /* we don't have a keyword.  */
-         if (fc == '&')
-         return amper_lookup(pYylval, deftoken);
-         pYylval->string = ringCopy(deftoken);  /* NO, it's a string */
-         return T_STRING;
-      }
-   } else {  /* it should be a punctuation character */
-      if (deftoken[1] != '\0') {
-         if (strcmp(deftoken, ">=") == 0) return K_GE;
-         if (strcmp(deftoken, "<=") == 0) return K_LE;
-         if (strcmp(deftoken, "<>") == 0) return K_NE;
-
-         defError(6017, "Odd punctuation found.");
-         hasFatalError = 1;
-      } else if (strlen(deftoken) > 2
-                 || strlen(deftoken) == 0) {
-          defError(6017, "Odd punctuation found.");
-          hasFatalError = 1;
-      }
-      return (int)deftoken[0];
-   }
-}
-
-/* We have found a deftoken beginning with '&'.  If it has been previously
-   defined, substitute the definition.  Otherwise return it. */
-int 
-defrData::amper_lookup(YYSTYPE *pYylval, char *tkn)
-{
-   string   defValue;
-
-   /* printf("Amper_lookup: %s\n", tkn); */
-
-   /* &defines returns a T_STRING */
-   if (defGetDefine(tkn, defValue)) {
-      int value;
-      if (defGetKeyword(defValue.c_str(), &value))
-         return value;
-      if (defValue.c_str()[0] == '"')
-         pYylval->string = ringCopy(defValue.c_str()+1);
-      else
-         pYylval->string = ringCopy(defValue.c_str());
-      return (defValue.c_str()[0] == '\"' ? QSTRING : T_STRING);
-   }
-   /* if none of the above, just return the deftoken. */
-   pYylval->string = ringCopy(tkn);
-   return T_STRING;
-}
-
-void 
-defrData::defError(int msgNum, const char *s) {
-   char* str;
-   const char  *curToken = isgraph(deftoken[0]) ? deftoken
-                                                              : "<unprintable>";
-   const char  *pvToken = isgraph(pv_deftoken[0]) ? pv_deftoken
-                                                           : "<unprintable>";
-   int len = strlen(curToken)-1;
-   int pvLen = strlen(pvToken)-1;
-
-   if (hasFatalError)
-       return;
-   if ((settings->totalDefMsgLimit > 0) && (defMsgPrinted >= settings->totalDefMsgLimit))
-      return;
-   if (settings->MsgLimit[msgNum-5000] > 0) {
-      if (msgLimit[msgNum-5000] >= settings->MsgLimit[msgNum-5000])
-         return;             /* over the limit */
-      msgLimit[msgNum-5000] = msgLimit[msgNum-5000] + 1;
-   }
-
-   /* PCR 690679, probably missing space before a ';' */
-   if (strcmp(s, "parse error") == 0) {
-      if ((len > 1) && (deftoken[len] == ';')) {
-         str = (char*)malloc(len + strlen(s) + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): %s, file %s at line %s\nLast token was <%s>, space is missing before <;>\n",
-              msgNum, s, session->FileName, lines2str(nlines), curToken);
-      } else if ((pvLen > 1) && (pv_deftoken[pvLen] == ';')) {
-         str = (char*)malloc(pvLen + strlen(s) + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): %s, file %s at line %s\nLast token was <%s>, space is missing before <;>\n",
-              msgNum, s, session->FileName, lines2str(nlines-1), pvToken);
-      } else {
-         str = (char*)malloc(len + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): Def parser has encountered an error in file %s at line %s, on token %s.\nProblem can be syntax error on the def file or an invalid parameter name.\nDouble check the syntax on the def file with the LEFDEF Reference Manual.\n",
-              msgNum, session->FileName, lines2str(nlines), curToken);
-      }
-   } else if (strcmp(s, "syntax error") == 0) {
-      if ((len > 1) && (deftoken[len] == ';')) {
-         str = (char*)malloc(len + strlen(s) + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): %s, file %s at line %s\nLast token was <%s>, space is missing before <;>\n",
-              msgNum, s, session->FileName, lines2str(nlines), curToken);
-      } else if ((pvLen > 1) && (pv_deftoken[pvLen] == ';')) {
-         str = (char*)malloc(pvLen + strlen(s) + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): %s, file %s at line %s\nLast token was <%s>, space is missing before <;>\n",
-              msgNum, s, session->FileName, lines2str(nlines-1), pvToken);
-      } else {
-         str = (char*)malloc(len + strlen(session->FileName) + 350);
-         sprintf(str, "ERROR (DEFPARS-%d): Def parser has encountered an error in file %s at line %s, on token %s.\nProblem can be syntax error on the def file or an invalid parameter name.\nDouble check the syntax on the def file with the LEFDEF Reference Manual.\n",
-              msgNum, session->FileName, lines2str(nlines), curToken);
-      }
-   } else {
-      str = (char*)malloc(len + strlen(s) + strlen(session->FileName) + 350);
-      sprintf(str, "ERROR (DEFPARS-%d): %s Error in file %s at line %s, on token %s.\nUpdate the def file before parsing the file again.\n",
-           msgNum, s, session->FileName, lines2str(nlines), curToken);
-   }
-
-   fflush(stdout);
-   defiError(1, msgNum, str);
-   free(str);
-   errors++;
-}
-
-/* yydeferror is called by bison.simple */
-void 
-defrData::defyyerror(const char *s) {
-   defError(defMsgCnt++, s);
-}
-
-/* All info starts with 8000 */
-/* All info within defInfo starts with 8500 */
-void 
-defrData::defInfo(int msgNum, const char *s) {
-   int i;
-
-   for (i = 0; i < settings->nDDMsgs; i++) {  /* check if info has been disable */
-      if (settings->disableDMsgs[i] == msgNum)
-         return;  /* don't print out any info since msg has been disabled */
-   }
-   
-   if (settings->ContextWarningLogFunction) {
-      char* str = (char*)malloc(strlen(deftoken)+strlen(s)
-                                   +strlen(session->FileName)+350);
-      sprintf(str, "INFO (DEFPARS-%d): %s See file %s at line %s.\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-      (*settings->ContextWarningLogFunction)(session->UserData, str);
-      free(str);
-   } else if (settings->WarningLogFunction) {
-      char* str = (char*)malloc(strlen(deftoken)+strlen(s)
-                                   +strlen(session->FileName)+350);
-      sprintf(str, "INFO (DEFPARS-%d): %s See file %s at line %s.\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-      (*settings->WarningLogFunction)(str);
-      free(str);
-   } else if (defrLog) {
-      fprintf(defrLog, "INFO (DEFPARS-%d): %s See file %s at line %s\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-   } else {
-      if (!hasOpenedDefLogFile) {
-         if ((defrLog = fopen("defRWarning.log", "w")) == 0) {
-            printf("WARNING(DEFPARS-8500): Unable to open the file defRWarning.log in %s.\n",
-            getcwd(NULL, 64));
-            printf("Info messages will not be printed.\n");
-         } else {
-            hasOpenedDefLogFile = 1;
-            fprintf(defrLog, "Info from file: %s\n\n", session->FileName);
-            fprintf(defrLog, "INFO (DEFPARS-%d): %s See file %s at line %s\n",
-                    msgNum, s, session->FileName, lines2str(nlines));
-         }
-      } else {
-         if ((defrLog = fopen("defRWarning.log", "a")) == 0) {
-            printf("WARNING (DEFPARS-8500): Unable to open the file defRWarning.log in %s.\n",
-            getcwd(NULL, 64));
-            printf("Info messages will not be printed.\n");
-         } else {
-            hasOpenedDefLogFile = 1;
-            fprintf(defrLog, "\nInfo from file: %s\n\n", session->FileName);
-            fprintf(defrLog, "INFO (DEFPARS-%d): %s See file %s at line %s\n",
-                    msgNum, s, session->FileName, lines2str(nlines));
-         }
-      } 
-   }
-}
-
-/* All warning starts with 7000 */
-/* All warning within defWarning starts with 7500 */
-void 
-defrData::defWarning(int msgNum, const char *s) {
-   int i;
-
-   for (i = 0; i <settings->nDDMsgs; i++) {  /* check if warning has been disable */
-      if (settings->disableDMsgs[i] == msgNum)
-         return;  /* don't print out any warning since msg has been disabled */
-   }
-
-   if (settings->ContextWarningLogFunction) {
-      char* str = (char*)malloc(strlen(deftoken)+strlen(s)
-                                   +strlen(session->FileName)+350);
-      sprintf(str, "WARNING (DEFPARS-%d): %s See file %s at line %s.\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-      (*settings->ContextWarningLogFunction)(session->UserData, str);
-      free(str);
-   } else if (settings->WarningLogFunction) {
-      char* str = (char*)malloc(strlen(deftoken)+strlen(s)
-                                   +strlen(session->FileName)+350);
-      sprintf(str, "WARNING (DEFPARS-%d): %s See file %s at line %s.\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-      (*settings->WarningLogFunction)(str);
-      free(str);
-   } else if (defrLog) {
-      fprintf(defrLog, "WARNING (DEFPARS-%d): %s See file %s at line %s\n",
-              msgNum, s, session->FileName, lines2str(nlines));
-   } else {
-      if (!hasOpenedDefLogFile) {
-         if ((defrLog = fopen("defRWarning.log", "w")) == 0) {
-            printf("WARNING (DEFPARS-7500): Unable to open the file defRWarning.log in %s.\n",
-            getcwd(NULL, 64));
-            printf("Warning messages will not be printed.\n");
-         } else {
-            hasOpenedDefLogFile = 1;
-            fprintf(defrLog, "Warnings from file: %s\n\n", session->FileName);
-            fprintf(defrLog, "WARNING (DEFPARS-%d): %s See file %s at line %s\n",
-                    msgNum, s, session->FileName, lines2str(nlines));
-         }
-      } else {
-         if ((defrLog = fopen("defRWarning.log", "a")) == 0) {
-            printf("WARNING (DEFAPRS-7501): Unable to open the file defRWarning.log in %s.\n",
-            getcwd(NULL, 64));
-            printf("Warning messages will not be printed.\n");
-         } else {
-            hasOpenedDefLogFile = 1;
-            fprintf(defrLog, "\nWarnings from file: %s\n\n", session->FileName);
-            fprintf(defrLog, "WARNING (DEFPARS-%d): %s See file %s at line %s\n",
-                    msgNum, s, session->FileName, lines2str(nlines));
-         }
-      } 
-   }
-   def_warnings++;
-}
-
-const char* 
-defrData::defkywd(int num)
-{
-   switch (num) {
-      case QSTRING: return  "QSTRING";
-      case T_STRING: return  "T_STRING";
-      case SITE_PATTERN: return  "SITE_PATTERN";
-      case NUMBER: return "NUMBER";
-      case K_ALIGN: return "ALIGN";
-      case K_AND: return "AND";
-      case K_ARRAY: return "ARRAY";
-      case K_ASSERTIONS: return "ASSERTIONS";
-      case K_BEGINEXT: return "BEGINEXT";
-      case K_BOTTOMLEFT: return "BOTTOMLEFT";
-      case K_BUSBITCHARS: return "BUSBITCHARS";
-      case K_BY: return "BY";
-      case K_CANNOTOCCUPY: return "CANNOTOCCUPY";
-      case K_CANPLACE: return "CANPLACE";
-      case K_CAPACITANCE: return "CAPACITANCE";
-      case K_COMMONSCANPINS: return "COMMONSCANPINS";
-      case K_COMPONENT: return "COMPONENT";
-      case K_COMPONENTPIN: return "COMPONENTPIN";
-      case K_COMPS: return "COMPS";
-      case K_COMP_GEN: return "COMP_GEN";
-      case K_CONSTRAINTS: return "CONSTRAINTS";
-      case K_COVER: return "COVER";
-      case K_CUTSIZE: return "CUTSIZE";
-      case K_CUTSPACING: return "CUTSPACING";
-      case K_DEFAULTCAP: return "DEFAULTCAP";
-      case K_DEFINE: return "DEFINE";
-      case K_DEFINES: return "DEFINES";
-      case K_DEFINEB: return "DEFINEB";
-      case K_DESIGN: return "DESIGN";
-      case K_DESIGNRULEWIDTH: return "DESIGNRULEWIDTH";
-      case K_DIAGWIDTH: return "DIAGWIDTH";
-      case K_DIEAREA: return "DIEAREA";
-      case K_DIFF: return "DIFF";
-      case K_DIRECTION: return "DIRECTION";
-      case K_DIST: return "DIST";
-      case K_DISTANCE: return "DISTANCE";
-      case K_DIVIDERCHAR: return "DIVIDERCHAR";
-      case K_DO: return "DO";
-      case K_DRIVECELL: return "DRIVECELL";
-      case K_E: return "E";
-      case K_EEQMASTER: return "EEQMASTER";
-      case K_ELSE: return "ELSE";
-      case K_ENCLOSURE: return "ENCLOSURE";
-      case K_END: return "END";
-      case K_ENDEXT: return "ENDEXT";
-      case K_EQ: return "EQ";
-      case K_EQUAL: return "EQUAL";
-      case K_ESTCAP: return "ESTCAP";
-      case K_FE: return "FE";
-      case K_FALL: return "FALL";
-      case K_FALLMAX: return "FALLMAX";
-      case K_FALLMIN: return "FALLMIN";
-      case K_FALSE: return "FALSE";
-      case K_FIXED: return "FIXED";
-      case K_FLOATING: return "FLOATING";
-      case K_FLOORPLAN: return "FLOORPLAN";
-      case K_FN: return "FN";
-      case K_FOREIGN: return "FOREIGN";
-      case K_FPC: return "FPC";
-      case K_FROMCLOCKPIN: return "FROMCLOCKPIN";
-      case K_FROMCOMPPIN: return "FROMCOMPPIN";
-      case K_FROMPIN: return "FROMPIN";
-      case K_FROMIOPIN: return "FROMIOPIN";
-      case K_FS: return "FS";
-      case K_FW: return "FW";
-      case K_GCELLGRID: return "GCELLGRID";
-      case K_GE: return "GE";
-      case K_GT: return "GT";
-      case K_GROUND: return "GROUND";
-      case K_GROUNDSENSITIVITY: return "GROUNDSENSITIVITY";
-      case K_GROUP: return "GROUP";
-      case K_GROUPS: return "GROUPS";
-      case K_HALO: return "HALO";
-      case K_HARDSPACING: return "HARDSPACING";
-      case K_HISTORY: return "HISTORY";
-      case K_HOLDRISE: return "HOLDRISE";
-      case K_HOLDFALL: return "HOLDFALL";
-      case K_HORIZONTAL: return "HORIZONTAL";
-      case K_IF: return "IF";
-      case K_IN: return "IN";
-      case K_INTEGER: return "INTEGER";
-      case K_IOTIMINGS: return "IOTIMINGS";
-      case K_LAYER: return "LAYER";
-      case K_LAYERS: return "LAYERS";
-      case K_LE: return "LE";
-      case K_LT: return "LT";
-      case K_MACRO: return "MACRO";
-      case K_MASK: return "MASK";
-      case K_MAX: return "MAX";
-      case K_MAXDIST: return "MAXDIST";
-      case K_MAXHALFPERIMETER: return "MAXHALFPERIMETER";
-      case K_MAXX: return "MAXX";
-      case K_MAXY: return "MAXY";
-      case K_MICRONS: return "MICRONS";
-      case K_MIN: return "MIN";
-      case K_MINCUTS: return "MINCUTS";
-      case K_MINPINS: return "MINPINS";
-      case K_MUSTJOIN: return "MUSTJOIN";
-      case K_N: return "N";
-      case K_NAMESCASESENSITIVE: return "NAMESCASESENSITIVE";
-      case K_NAMEMAPSTRING: return "NAMEMAPSTRING";
-      case K_NE: return "NE";
-      case K_NET: return "NET";
-      case K_NETEXPR: return "NETEXPR";
-      case K_NETLIST: return "NETLIST";
-      case K_NETS: return "NETS";
-      case K_NEW: return "NEW";
-      case K_NONDEFAULTRULE: return "NONDEFAULTRULE";
-      case K_NOSHIELD: return "NOSHIELD";
-      case K_NOT: return "NOT";
-      case K_OFF: return "OFF";
-      case K_OFFSET: return "OFFSET";
-      case K_ON: return "ON";
-      case K_OR: return "OR";
-      case K_ORDERED: return "ORDERED";
-      case K_ORIGIN: return "ORIGIN";
-      case K_ORIGINAL: return "ORIGINAL";
-      case K_OUT: return "OUT";
-      case K_PARALLEL: return "PARALLEL";
-      case K_PARTITIONS: return "PARTITIONS";
-      case K_PATH: return "PATH";
-      case K_PATTERN: return "PATTERN";
-      case K_PATTERNNAME: return "PATTERNNAME";
-      case K_PINPROPERTIES: return "PINPROPERTIES";
-      case K_PINS: return "PINS";
-      case K_PLACED: return "PLACED";
-      case K_PIN: return "PIN";
-      case K_POLYGON: return "POLYGON";
-      case K_PROPERTY: return "PROPERTY";
-      case K_PROPERTYDEFINITIONS: return "PROPERTYDEFINITIONS";
-      case K_RANGE: return "RANGE";
-      case K_REAL: return "REAL";
-      case K_RECT: return "RECT";
-      case K_REENTRANTPATHS: return "REREENTRANTPATHS";
-      case K_REGION: return "REGION";
-      case K_REGIONS: return "REGIONS";
-      case K_RISE: return "RISE";
-      case K_RISEMAX: return "RISEMAX";
-      case K_RISEMIN: return "RISEMIN";
-      case K_ROUTED: return "ROUTED";
-      case K_ROW: return "ROW";
-      case K_ROWCOL: return "ROWCOL";
-      case K_ROWS: return "ROWS";
-      case K_S: return "S";
-      case K_SCANCHAINS: return "SCANCHAINS";
-      case K_SETUPRISE: return "SETUPRISE";
-      case K_SETUPFALL: return "SETUPFALL";
-      case K_SHAPE: return "SHAPE";
-      case K_SITE: return "SITE";
-      case K_SLEWRATE: return "SLEWRATE";
-      case K_SNET: return "SNET";
-      case K_SNETS: return "SNETS";
-      case K_SOURCE: return "SOURCE";
-      case K_SOFT: return "SOFT";
-      case K_SPACING: return "SPACING";
-      case K_SPECIAL: return "SPECIAL";
-      case K_START: return "START";
-      case K_START_NET: return "START_NET";
-      case K_STEP: return "STEP";
-      case K_STRING: return "STRING";
-      case K_STOP: return "STOP";
-      case K_SUBNET: return "SUBNET";
-      case K_SUM: return "SUM";
-      case K_SUPPLYSENSITIVITY: return "SUPPLYSENSITIVITY";
-      case K_STYLE: return "STYLE";
-      case K_STYLES: return "STYLES";
-      case K_SYNTHESIZED: return "SYNTHESIZED";
-      case K_TAPER: return "TAPER";
-      case K_TAPERRULE: return "TAPERRULE";
-      case K_THEN: return "THEN";
-      case K_THRUPIN: return "THRUPIN";
-      case K_TIMING: return "TIMING";
-      case K_TIMINGDISABLES: return "TIMINGDISABLES";
-      case K_TOCLOCKPIN: return "TOCLOCKPIN";
-      case K_TOCOMPPIN: return "TOCOMPPIN";
-      case K_TOIOPIN: return "TOIOPIN";
-      case K_TOPIN: return "TOPIN";
-      case K_TOPRIGHT: return "TOPRIGHT";
-      case K_TRACKS: return "TRACKS";
-      case K_TRUE: return "TRUE";
-      case K_TURNOFF: return "TURNOFF";
-      case K_VARIABLE: return "VARIABLE";
-      case K_VIA: return "VIA";
-      case K_VIARULE: return "VIARULE";
-      case K_VIAS: return "VIAS";
-      case K_VOLTAGE: return "VOLTAGE";
-      case K_TECH: return "TECH";
-      case K_UNITS: return "UNITS";
-      case K_UNPLACED: return "UNPLACED";
-      case K_USE: return "USE";
-      case K_USER: return "USER";
-      case K_VERSION: return "VERSION";
-      case K_VIRTUAL: return "VIRTUAL";
-      case K_VERTICAL: return "VERTICAL";
-      case K_VPIN: return "VPIN";
-      case K_W: return "W";
-      case K_WIRECAP: return "WIRECAP";
-      case K_WEIGHT: return "WEIGHT";
-      case K_WIDTH: return "WIDTH";
-      case K_WIREDLOGIC: return "WIREDLOGIC";
-      case K_WIREEXT: return "WIREEXT";
-      case K_XTALK: return "XTALK";
-      case K_X: return "X";
-      case K_Y: return "Y";
-      default: return "bogus";
-   }
-}
-
-const char* 
-defrData::DEFCASE(const char* ch)
-{
-    return names_case_sensitive ? ch : upperCase(ch);
-}
-
-void
-defrData::pathIsDone(int  sh, int  reset, int  osNet, int  *needCbk)
-{
-    if ((callbacks->NetCbk || callbacks->SNetCbk) && settings->AddPathToNet) {
-        //PathObj.reverseOrder();
-        if (Subnet) {
-            // if (sh)
-            //    defrSubnet->addShieldPath(defrPath);
-            // else 
-            Subnet->addWirePath(&PathObj, reset, osNet,
-                                         needCbk);
-        } else {
-            if (sh)
-                Net.addShieldPath(&PathObj, reset, osNet, needCbk);
-            else
-                Net.addWirePath(&PathObj, reset, osNet, needCbk);
-        }
-    } else if (callbacks->PathCbk) {
-        //defrPath->reverseOrder();
-        (*callbacks->PathCbk)(defrPathCbkType, &PathObj, session->UserData);
-        PathObj.Destroy();
-        free((char*) &PathObj);
-    }
-
-    PathObj.Init();
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
-
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_objs.defs b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_objs.defs
deleted file mode 100755
index 09c5753..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/def_objs.defs
+++ /dev/null
@@ -1,44 +0,0 @@
-##############################################################################
-#
-# def_objs.defs
-#
-
-DEF_SRCS	= \
-		  $(DEF_SRC_DIR)/DFEF_malloc.cpp \
-		  $(DEF_SRC_DIR)/DFEF_stringhash.cpp \
-		  $(DEF_SRC_DIR)/def.tab.cpp \
-		  $(DEF_SRC_DIR)/def_keywords.cpp \
-		  $(DEF_SRC_DIR)/defiAlias.cpp \
-		  $(DEF_SRC_DIR)/defiAssertion.cpp \
-		  $(DEF_SRC_DIR)/defiBlockage.cpp \
-		  $(DEF_SRC_DIR)/defiComponent.cpp \
-		  $(DEF_SRC_DIR)/defiDebug.cpp \
-		  $(DEF_SRC_DIR)/defiFill.cpp \
-		  $(DEF_SRC_DIR)/defiFPC.cpp \
-		  $(DEF_SRC_DIR)/defiGroup.cpp \
-		  $(DEF_SRC_DIR)/defiIOTiming.cpp \
-		  $(DEF_SRC_DIR)/defiMisc.cpp \
-		  $(DEF_SRC_DIR)/defiNet.cpp \
-		  $(DEF_SRC_DIR)/defiNonDefault.cpp \
-		  $(DEF_SRC_DIR)/defiPartition.cpp \
-		  $(DEF_SRC_DIR)/defiPath.cpp \
-		  $(DEF_SRC_DIR)/defiPinCap.cpp \
-		  $(DEF_SRC_DIR)/defiPinProp.cpp \
-		  $(DEF_SRC_DIR)/defiProp.cpp \
-		  $(DEF_SRC_DIR)/defiPropType.cpp \
-		  $(DEF_SRC_DIR)/defiRegion.cpp \
-		  $(DEF_SRC_DIR)/defiRowTrack.cpp \
-		  $(DEF_SRC_DIR)/defiScanchain.cpp \
-		  $(DEF_SRC_DIR)/defiSite.cpp \
-		  $(DEF_SRC_DIR)/defiSlot.cpp \
-		  $(DEF_SRC_DIR)/defiTimingDisable.cpp \
-		  $(DEF_SRC_DIR)/defiUtil.cpp \
-		  $(DEF_SRC_DIR)/defiVia.cpp \
-		  $(DEF_SRC_DIR)/defrReader.cpp \
-		  $(DEF_SRC_DIR)/defwWriter.cpp \
-		  $(DEF_SRC_DIR)/defwWriterCalls.cpp
-
-DEF_BISON_SRCS	= $(DEF_SRC_DIR)/def.y
-
-DEF_OBJS	= $(DEF_SRCS:.cpp=.o)
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.cpp
deleted file mode 100644
index 573ee1e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "defiAlias.hpp"
-#include "defrData.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern defrContext defContext;
-
-class defAliasIterator {
-public:
-    std::map<std::string, std::string, defCompareStrings>::iterator me; 
-}; 
-
-defiAlias_itr::defiAlias_itr(defrData *data) 
-: first(1),
-  iterator(NULL),
-  defData(data ? data : defContext.data)
-{
-    defiAlias_itr::Init();
-}
-
-
-void defiAlias_itr::Init() {
-    first = 1;
-    iterator = new defAliasIterator();
-}
- 
-
-void defiAlias_itr::Destroy() {
-    delete iterator;
-    iterator = NULL;
-}
-
-
-defiAlias_itr::~defiAlias_itr() {
-    defiAlias_itr::Destroy();
-}
-
- 
-int defiAlias_itr::Next() {
-    if (first) {
-        first = 0;
-        iterator->me = defData->def_alias_set.begin();
-    } else {
-        iterator->me++;
-    }
-
-    if (iterator->me == defData->def_alias_set.end()) {
-        return 0;
-    }
-
-    return 1;
-}
-
-
-const char* defiAlias_itr::Key() {
-    if (iterator->me == defData->def_alias_set.end()) {
-        return NULL;
-    }
-    
-    return iterator->me->first.c_str();
-}
-
-
-const char* defiAlias_itr::Data() {
-    if (iterator->me == defData->def_alias_set.end()) {
-        return NULL;
-    }
-
-    // First char is reserved for 'marked' symbol ('0' or '1')
-    return iterator->me->second.c_str() + 1;
-}
-
- 
-int defiAlias_itr::Marked() {
-    const char *value = iterator->me->second.c_str();
-
-    if ((value == NULL) || (value[0] == '0')) {
-        return 0;
-    }else {
-        return 1;
-    }
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.hpp
deleted file mode 100644
index 72a0e68..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAlias.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiALIAS_h
-#define defiALIAS_h
-
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defAliasIterator;
-class defrData;
-
-class defiAlias_itr {
-public:
-  defiAlias_itr(defrData *defData = 0);
-  void Init();
-
-  void Destroy();
-  ~defiAlias_itr();
-
-  int Next();
-  const char* Key();
-  const char* Data();
-  int Marked();
-
-protected:
-  defAliasIterator   *iterator;
-  int first;
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.cpp
deleted file mode 100644
index 3b7c87d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.cpp
+++ /dev/null
@@ -1,425 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiAssertion.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-struct defiAssertPath {
-  char* fromPin_;
-  char* toPin_;
-  char* fromInst_;
-  char* toInst_;
-};
-
-
-
-defiAssertion::defiAssertion(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-defiAssertion::~defiAssertion() {
-  Destroy();
-}
-
-
-void defiAssertion::Init() {
-  netName_ = (char*)malloc(32);
-  netNameLength_ = 32;
-  numItems_ = 0;
-  clear();
-  numItemsAllocated_ = 16;
-  items_ = (int**)malloc(sizeof(char*)*16);
-  itemTypes_ = (char*)malloc(16);
-}
-
-
-void defiAssertion::Destroy() {
-  free(netName_);
-  free((char*)(itemTypes_));
-  free((char*)(items_));
-}
-
-
-void defiAssertion::clear() {
-  int i;
-  struct defiAssertPath* s;
-
-  if (netName_)
-     *(netName_) = '\0';
-  isSum_ = 0;
-  isDiff_ = 0;
-  isAssertion_ = 0;
-  hasRiseMin_ = 0;
-  hasRiseMax_ = 0;
-  hasFallMin_ = 0;
-  hasFallMax_ = 0;
-  isDelay_ = 0;
-  isWiredlogic_ = 0;
-
-  for (i = 0; i < numItems_; i++) {
-    if (itemTypes_[i] == 'p') {
-      s = (struct defiAssertPath*)(items_[i]);
-      free(s->fromPin_);
-      free(s->toPin_);
-      free(s->fromInst_);
-      free(s->toInst_);
-      free((char*)s);
-    } else if (itemTypes_[i] == 'n') {
-      free((char*)(items_[i]));
-    } else {
-      defiError(0, 6009, "ERROR (DEFPARSE-6009): An invalid attribute type has encounter while cleanning the memory.", defData);
-    }
-    itemTypes_[i] = 'B';  // bogus
-    items_[i] = 0;
-  }
-
-  numItems_ = 0;
-}
-
-
-void defiAssertion::setConstraintMode() {
-  isAssertion_ = 0;
-}
-
-
-void defiAssertion::setAssertionMode() {
-  isAssertion_ = 1;
-}
-
-
-void defiAssertion::setWiredlogicMode() {
-  isWiredlogic_ = 1;
-}
-
-
-void defiAssertion::setWiredlogic(const char* name, double dist) {
-  int len = strlen(name) + 1;
-  if (isDelay_)
-    defiError(0, 6201, "ERROR (DEFPARS-6201): Unable to process the DEF file. Both WIREDLOGIC and DELAY statements are defined in constraint/assertion.\nUpdate the DEF file to define either a WIREDLOGIC or DELAY statement only.", defData);
-  isWiredlogic_ = 1;
-  if (netNameLength_ < len) {
-    free(netName_);
-    netName_ = (char*)malloc(len);
-    netNameLength_ = len;
-  }
-  strcpy(netName_, defData->DEFCASE(name));
-  fallMax_ = dist;
-}
-
-
-void defiAssertion::setDelay() {
-  if (isWiredlogic_)
-    defiError(0, 6201, "ERROR (DEFPARS-6201): Unable to process the DEF file. Both WIREDLOGIC and DELAY statements are defined in constraint/assertion.\nUpdate the DEF file to define either a WIREDLOGIC or DELAY statement only.", defData);
-  isDelay_ = 1;
-}
-
-
-void defiAssertion::setSum() {
-  if (isDiff_)
-     defiError(0, 6202, "ERROR (DEPPARS-6202): Unable to process the DEF file. Both SUM and DIFF statements are defined in constraint/assertion.\nUpdate the DEF file to define either a SUM or DIFF statement only.", defData);
-  isSum_ = 1;
-}
-
-
-void defiAssertion::unsetSum() {
-  isSum_ = 0;
-}
-
-
-void defiAssertion::setDiff() {
-  if (isSum_)
-     defiError(0, 6202, "ERROR (DEPPARS-6202): Unable to process the DEF file. Both SUM and DIFF statements are defined in constraint/assertion.\nUpdate the DEF file to define either a SUM or DIFF statement only.", defData);
-  isDiff_ = 1;
-}
-
-
-const char* defiAssertion::netName() const {
-  return netName_;
-}
-
-
-void defiAssertion::setNetName(const char* name) {
-  int len = strlen(name) + 1;
-  clear();
-  if (len > netNameLength_) {
-    free(netName_);
-    netName_ = (char*)malloc(len);
-    netNameLength_ = len;
-  }
-  strcpy(netName_, defData->DEFCASE(name));
-}
-
-
-
-int defiAssertion::isDelay() const {
-  return isDelay_ ? 1 : 0;
-}
-
-
-int defiAssertion::isAssertion() const {
-  return isAssertion_ ? 1 : 0;
-}
-
-
-int defiAssertion::isConstraint() const {
-  return isAssertion_ ? 0 : 1;
-}
-
-
-int defiAssertion::isSum() const {
-  return isSum_;
-}
-
-
-int defiAssertion::isDiff() const {
-  return isDiff_;
-}
-
-
-int defiAssertion::isWiredlogic() const {
-  return isWiredlogic_;
-}
-
-
-int defiAssertion::hasRiseMin() const {
-  return hasRiseMin_;
-}
-
-
-int defiAssertion::hasRiseMax() const {
-  return hasRiseMax_;
-}
-
-
-int defiAssertion::hasFallMin() const {
-  return hasFallMin_;
-}
-
-
-int defiAssertion::hasFallMax() const {
-  return hasFallMax_;
-}
-
-
-double defiAssertion::distance() const {
-  return fallMax_;  // distance is stored here
-}
-
-
-double defiAssertion::riseMin() const {
-  return riseMin_;
-}
-
-
-double defiAssertion::riseMax() const {
-  return riseMax_;
-}
-
-
-double defiAssertion::fallMin() const {
-  return fallMin_;
-}
-
-
-double defiAssertion::fallMax() const {
-  return fallMax_;
-}
-
-
-void defiAssertion::setRiseMin(double d) {
-  riseMin_ = d;
-  hasRiseMin_ = 1;
-}
-
-
-void defiAssertion::setRiseMax(double d) {
-  riseMax_ = d;
-  hasRiseMax_ = 1;
-}
-
-
-void defiAssertion::setFallMin(double d) {
-  fallMin_ = d;
-  hasFallMin_ = 1;
-}
-
-
-void defiAssertion::setFallMax(double d) {
-  fallMax_ = d;
-  hasFallMax_ = 1;
-}
-
-
-int defiAssertion::numItems() const {
-  return numItems_;
-}
-
-
-int defiAssertion::isPath(int index) const {
-  if (index >= 0 && index < numItems_) {
-    return (itemTypes_[index] == 'p') ? 1 : 0;
-  }
-  return 0;
-}
-
-
-int defiAssertion::isNet(int index) const {
-  if (index >= 0 && index < numItems_) {
-    return (itemTypes_[index] == 'n') ? 1 : 0;
-  }
-  return 0;
-}
-
-
-void defiAssertion::path(int index, char** fromInst, char** fromPin,
-	   char** toInst, char** toPin) const {
-  struct defiAssertPath* ap;
-
-  if (index >= 0 && index < numItems_ &&
-      itemTypes_[index] == 'p') {
-    ap = (struct defiAssertPath*)(items_[index]);
-    if (fromInst) *fromInst = ap->fromInst_;
-    if (fromPin) *fromPin = ap->fromPin_;
-    if (toInst) *toInst = ap->toInst_;
-    if (toPin) *toPin = ap->toPin_;
-  }
-}
-
-
-void defiAssertion::net(int index, char** netName) const {
-  if (index >= 0 && index < numItems_ &&
-      itemTypes_[index] == 'n') {
-    if (netName) *netName = (char*)(items_[index]);
-  }
-}
-
-
-void defiAssertion::bumpItems() {
-  int i;
-  char* newTypes;
-  int** newItems;
-  (numItemsAllocated_) *= 2;
-  newTypes = (char*)malloc(numItemsAllocated_ * sizeof(char));
-  newItems = (int**)malloc(numItemsAllocated_ * sizeof(int*));
-  for (i = 0; i < numItems_; i++) {
-    newItems[i] = items_[i];
-    newTypes[i] = itemTypes_[i];
-  }
-  free((char*)items_);
-  free((char*)itemTypes_);
-  items_ = newItems;
-  itemTypes_ = newTypes;
-}
-
-
-void defiAssertion::addNet(const char* name) {
-  int i;
-  char* s, *s1;
-
-  // set wiredlogic to false
-  isWiredlogic_ = 0;
-
-  // make our own copy
-  i = strlen(name) + 1;
-  if (name[i-2] == ',') {
-     s  = (char*)malloc(i-1);
-     s1 = (char*)malloc(i-1);
-     strncpy(s1, name, i-2);
-     s1[i-2] = '\0';
-     strcpy(s, defData->DEFCASE(s1));
-     free(s1);
-  } else {
-     s = (char*)malloc(i);
-     strcpy(s, defData->DEFCASE(name));
-  }
-
-  // make sure there is space in the array
-  if (numItems_ >= numItemsAllocated_)
-    bumpItems();
-
-  // place it
-  i = numItems_;
-  items_[i] = (int*)s;
-  itemTypes_[i] = 'n';
-  numItems_ = i + 1;
-  //strcpy(itemTypes_, "n");
-}
-
-
-void defiAssertion::addPath(const char* fromInst, const char* fromPin,
-               const char* toInst, const char* toPin) {
-  int i;
-  struct defiAssertPath* s;
-
-  // set wiredlogic to false
-  isWiredlogic_ = 0;
-
-  // make our own copy
-  s = (struct defiAssertPath*)malloc(sizeof(struct defiAssertPath));
-  i = strlen(fromInst) + 1;
-  s->fromInst_ = (char*)malloc(i);
-  strcpy(s->fromInst_, defData->DEFCASE(fromInst));
-  i = strlen(toInst) + 1;
-  s->toInst_ = (char*)malloc(i);
-  strcpy(s->toInst_, defData->DEFCASE(toInst));
-  i = strlen(fromPin) + 1;
-  s->fromPin_ = (char*)malloc(i);
-  strcpy(s->fromPin_, defData->DEFCASE(fromPin));
-  i = strlen(toPin) + 1;
-  s->toPin_ = (char*)malloc(i);
-  strcpy(s->toPin_, defData->DEFCASE(toPin));
-
-  // make sure there is space in the array
-  if (numItems_ >= numItemsAllocated_)
-    bumpItems();
-
-  // place it
-  i = numItems_;
-  items_[i] = (int*)s;
-  itemTypes_[i] = 'p';
-  numItems_ = i + 1;
-  //strcpy(itemTypes_, "p");
-}
-
-
-void defiAssertion::print(FILE* f) const {
-  fprintf(f, "Assertion %s\n", netName());
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.hpp
deleted file mode 100644
index 6a48d2b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiAssertion.hpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiAssertion_h
-#define defiAssertion_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Struct holds the data for one assertion/constraint.
-// An assertion or constraint is either a net/path rule or a
-// wired logic rule.
-//
-//  A net/path rule is an item or list of items plus specifications.
-//    The specifications are: rise/fall min/max.
-//    The items are a list of (one or more) net names or paths or a
-//    combination of both.
-//
-//  A wired logic rule is a netname and a distance.
-//
-//  We will NOT allow the mixing of wired logic rules and net/path delays
-//  in the same assertion/constraint.
-//
-//  We will allow the rule to be a sum of sums (which will be interpreted
-//  as just one list).
-//
-class defrData;
-
-class defiAssertion {
-public:
-  defiAssertion(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiAssertion();
-
-  void setConstraintMode();
-  void setAssertionMode();
-  void setSum();
-  void setDiff();
-  void setNetName(const char* name);
-  void setRiseMin(double num);
-  void setRiseMax(double num);
-  void setFallMin(double num);
-  void setFallMax(double num);
-  void setDelay();
-  void setWiredlogicMode();
-  void setWiredlogic(const char* net, double dist);
-  void addNet(const char* name);
-  void addPath(const char* fromInst, const char* fromPin,
-               const char* toInst, const char* toPin);
-  void bumpItems();
-  void unsetSum();
-
-  int isAssertion() const;  // Either isAssertion or isConstraint is true
-  int isConstraint() const;
-  int isWiredlogic() const; // Either isWiredlogic or isDelay is true
-  int isDelay() const;
-  int isSum() const;
-  int isDiff() const;
-  int hasRiseMin() const;
-  int hasRiseMax() const;
-  int hasFallMin() const;
-  int hasFallMax() const;
-  double riseMin() const;
-  double riseMax() const;
-  double fallMin() const;
-  double fallMax() const;
-  const char* netName() const; // Wired logic net name
-  double distance() const; // Wired logic distance
-  int numItems() const;  // number of paths or nets 
-  int isPath(int index) const;   // is item #index a path?
-  int isNet(int index) const;    // is item #index a net?
-  void path(int index, char** fromInst, char** fromPin,
-	   char** toInst, char** toPin) const; // Get path data for item #index
-  void net(int index, char** netName) const;   // Get net data for item #index
-
-  void clear();
-  void print(FILE* f) const;
-
-
-protected:
-  char isAssertion_;
-  char isSum_;
-  char isDiff_;
-  char hasRiseMin_;
-  char hasRiseMax_;
-  char hasFallMin_;
-  char hasFallMax_;
-  char isWiredlogic_;
-  char isDelay_;
-  char* netName_;     // wired logic net name
-  int netNameLength_;
-  double riseMin_;
-  double riseMax_;
-  double fallMin_;
-  double fallMax_;    // also used to store the wired logic dist
-  int numItems_;
-  int numItemsAllocated_;
-  char* itemTypes_;
-  int** items_;       // not really integers.
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.cpp
deleted file mode 100644
index e64849e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.cpp
+++ /dev/null
@@ -1,459 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiBlockage.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiBlockages
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-defiBlockage::defiBlockage(defrData *data) 
- : defData(data)
-{
-  Init();
-}
-
-
-void defiBlockage::Init() {
-  numPolys_ = 0;
-  clear();
-  layerName_ = 0;
-  componentName_ = 0;
-  layerNameLength_ = 0;
-  componentNameLength_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  rectsAllocated_ = 0;
-  polysAllocated_ = 0;
-  polygons_ = 0;
-}
-
-
-defiBlockage::~defiBlockage() {
-  Destroy();
-}
-
-
-void defiBlockage::clear() {
-  hasLayer_ = 0;
-  hasPlacement_ = 0;
-  hasComponent_ = 0;
-  hasSlots_ = 0;
-  hasFills_ = 0;
-  hasPushdown_ = 0;
-  hasExceptpgnet_ = 0;
-  hasSoft_ = 0;
-  maxDensity_ = -1;
-  minSpacing_ = -1;
-  width_ = -1;
-  numRectangles_ = 0;
-  mask_ = 0;
-}
-
-
-void defiBlockage::clearPoly() {
-  struct defiPoints* p;
-  int i;
-
-  for (i = 0; i < numPolys_; i++) {
-    p = polygons_[i];
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(polygons_[i]));
-  }
-  numPolys_ = 0;
-}
-
-void defiBlockage::Destroy() {
-  if (layerName_) free(layerName_);
-  if (componentName_) free(componentName_);
-  layerName_ = 0;
-  componentName_ = 0;
-  if (rectsAllocated_) {
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    rectsAllocated_ = 0;
-    xl_ = 0;
-    yl_ = 0;
-    xh_ = 0;
-    yh_ = 0;
-  }
-  clearPoly();
-  free((char*)(polygons_));
-  polygons_ = 0;
-  clear();
-}
-
-
-void defiBlockage::setLayer(const char* name) {
-  int len = strlen(name) + 1;
-  if (layerNameLength_ < len) {
-    if (layerName_) free(layerName_);
-    layerName_ = (char*)malloc(len);
-    layerNameLength_ = len;
-  }
-  strcpy(layerName_, defData->DEFCASE(name));
-  hasLayer_ = 1;
-}
-
-
-void defiBlockage::setPlacement() {
-
-  /* 10/29/2001 - Wanda da Rosa, new enhancement */
-  hasPlacement_ = 1;
-  return;
-}
-
-void defiBlockage::setComponent(const char* name) {
-  int len;
-
-  /* 10/29/2001 - Wanda da Rosa, component name is required */
-  len = strlen(name) + 1;
-  if (componentNameLength_ < len) {
-    if (componentName_) free(componentName_);
-    componentName_ = (char*)malloc(len);
-    componentNameLength_ = len;
-  }
-  strcpy(componentName_, defData->DEFCASE(name));
-  hasComponent_ = 1;
-}
-
-void defiBlockage::setSlots() {
-  hasSlots_ = 1;
-}
-
-void defiBlockage::setFills() {
-  hasFills_ = 1;
-}
-
-void defiBlockage::setPushdown() {
-  hasPushdown_ = 1;
-}
-
-// 5.7
-void defiBlockage::setExceptpgnet() {
-  hasExceptpgnet_ = 1;
-}
-
-// 5.7
-void defiBlockage::setSoft() {
-  hasSoft_ = 1;
-}
-
-// 5.7
-void defiBlockage::setPartial(double maxDensity) {
-  maxDensity_ = maxDensity;
-}
-
-void defiBlockage::setSpacing(int minSpacing) {
-  minSpacing_ = minSpacing;
-}
-
-void defiBlockage::setDesignRuleWidth(int width) {
-  width_ = width;
-}
-
-void defiBlockage::setMask(int colorMask) {
-  mask_ = colorMask;
-}
-
-void defiBlockage::addRect(int xl, int yl, int xh, int yh) {
-  if (numRectangles_ == rectsAllocated_) {
-    int i;
-    int max = rectsAllocated_ = (rectsAllocated_ == 0) ?
-          2 : rectsAllocated_ * 2;
-    int* newxl = (int*)malloc(sizeof(int)*max);
-    int* newyl = (int*)malloc(sizeof(int)*max);
-    int* newxh = (int*)malloc(sizeof(int)*max);
-    int* newyh = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRectangles_; i++) {
-      newxl[i] = xl_[i];
-      newyl[i] = yl_[i];
-      newxh[i] = xh_[i];
-      newyh[i] = yh_[i];
-    }
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    xl_ = newxl;
-    yl_ = newyl;
-    xh_ = newxh;
-    yh_ = newyh;
-  }
-  xl_[numRectangles_] = xl;
-  yl_[numRectangles_] = yl;
-  xh_[numRectangles_] = xh;
-  yh_[numRectangles_] = yh;
-  numRectangles_ += 1;
-}
-
-
-// 5.6
-void defiBlockage::addPolygon(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    for (i = 0; i < numPolys_; i++)
-      poly[i] = polygons_[i];
-    if (polygons_)
-      free((char*)(polygons_));
-    polygons_ = poly;
-  }
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_] = p;
-  numPolys_ += 1;
-}
-
-
-int defiBlockage::hasLayer() const {
-  return hasLayer_;
-}
-
-
-int defiBlockage::hasPlacement() const {
-  return hasPlacement_;
-}
-
-
-int defiBlockage::hasComponent() const {
-  return hasComponent_;
-}
-
-
-int defiBlockage::hasSlots() const {
-  return hasSlots_;
-}
-
-
-int defiBlockage::hasFills() const {
-  return hasFills_;
-}
-
-
-int defiBlockage::hasPushdown() const {
-  return hasPushdown_;
-}
-
-// 5.7
-int defiBlockage::hasExceptpgnet() const {
-  return hasExceptpgnet_;
-}
-
-// 5.7
-int defiBlockage::hasSoft() const {
-  return hasSoft_;
-}
-
-// 5.7
-int defiBlockage::hasPartial() const {
-  if (maxDensity_ == -1)
-    return 0;
-  return 1;
-}
-
-// 5.7
-double defiBlockage::placementMaxDensity() const {
-  return maxDensity_;
-}
-
-int defiBlockage::hasSpacing() const {
-  if (minSpacing_ == -1)
-    return 0;
-  return 1;
-}
-
-
-int defiBlockage::hasDesignRuleWidth() const {
-  if (width_ == -1)
-    return 0;
-  return 1;
-}
-
-int defiBlockage::hasMask() const {
-    return mask_;
-}
-
-int defiBlockage::minSpacing() const {
-  return minSpacing_;
-}
-
-
-int defiBlockage::designRuleWidth() const {
-  return width_;
-}
-
-int defiBlockage::mask() const {
-  return mask_;
-}
-
-const char* defiBlockage::layerName() const {
-  return layerName_;
-}
-
-
-const char* defiBlockage::layerComponentName() const {
-  return componentName_;
-}
-
-
-const char* defiBlockage::placementComponentName() const {
-  return componentName_;
-}
-
-
-int defiBlockage::numRectangles() const {
-  return numRectangles_;
-}
-
-
-int defiBlockage::xl(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for blockage xl", defData);
-    return 0;
-  }
-  return xl_[index];
-}
-
-
-int defiBlockage::yl(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for blockage yl", defData);
-    return 0;
-  }
-  return yl_[index];
-}
-
-
-int defiBlockage::xh(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for blockage xh", defData);
-    return 0;
-  }
-  return xh_[index];
-}
-
-
-int defiBlockage::yh(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for blockage yh", defData);
-    return 0;
-  }
-  return yh_[index];
-}
-
-
-// 5.6
-int defiBlockage::numPolygons() const {
-  return numPolys_;
-}
-
-
-// 5.6
-struct defiPoints defiBlockage::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-
-void defiBlockage::print(FILE* f) const {
-  int i, j;
-  struct defiPoints points;
-
-  if (hasLayer()) {
-    fprintf(f, "- LAYER %s", layerName());
-    if (hasComponent())
-      fprintf(f, " + COMPONENT %s", layerComponentName());
-    if (hasSlots())
-      fprintf(f, " + SLOTS");
-    if (hasFills())
-      fprintf(f, " + FILLS");
-    if (hasPushdown())
-      fprintf(f, " + PUSHDOWN");
-    if (hasExceptpgnet())
-      fprintf(f, " + EXCEPTPGNET");
-    fprintf(f, "\n");
-  }
-  if (hasPlacement()) {
-    fprintf(f, "- PLACEMENT");
-    if (hasComponent())
-      fprintf(f, " + COMPONENT %s", layerComponentName());
-    if (hasPushdown())
-      fprintf(f, " + PUSHDOWN");
-    if (hasSoft())
-      fprintf(f, " + SOFT");
-    if (hasPartial())
-      fprintf(f, " + PARTIAL %f", placementMaxDensity());
-    fprintf(f, "\n");
-  }
-
-  for (i = 0; i < numRectangles(); i++) {
-    fprintf(f, "   RECT %d %d %d %d\n", xl(i), yl(i), xh(i), yh(i));
-  }
-
-  for (i = 0; i < numPolygons(); i++) {
-    fprintf(f, "   POLYGON ");
-    points = getPolygon(i);
-    for (j = 0; j < points.numPoints; j++)
-      fprintf(f, "%d %d ", points.x[j], points.y[j]);
-    fprintf(f,"\n");
-  }
-  fprintf(f,"\n");
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.hpp
deleted file mode 100644
index 7659673..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiBlockage.hpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiBLOCKAGES_h
-#define defiBLOCKAGES_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-class defrData;
-
-class defiBlockage {
-public:
-  defiBlockage(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiBlockage();
-
-  void clear();
-  void clearPoly();
-
-  void setLayer(const char* name);
-  void setPlacement();
-  void setComponent(const char* name);
-  void setSlots();
-  void setFills();
-  void setPushdown();
-  void setExceptpgnet();                            // 5.7
-  void setSoft();                                   // 5.7
-  void setPartial(double maxDensity);               // 5.7
-  void setSpacing(int minSpacing);
-  void setDesignRuleWidth(int width);
-  void setMask(int maskColor);                      // 5.8
-  void addRect(int xl, int yl, int xh, int yh);
-  void addPolygon(defiGeometries* geom);
-
-  int hasLayer() const;
-  int hasPlacement() const;
-  int hasComponent() const;
-  int hasSlots() const;
-  int hasFills() const;
-  int hasPushdown() const;
-  int hasExceptpgnet() const;                       // 5.7
-  int hasSoft() const;                              // 5.7
-  int hasPartial() const;                           // 5.7
-  int hasSpacing() const;                           // 5.6
-  int hasDesignRuleWidth() const;                   // 5.6
-  int hasMask() const;                              // 5.8
-  int mask() const;                            // 5.8
-  int minSpacing() const;                           // 5.6
-  int designRuleWidth() const;                      // 5.6
-  double placementMaxDensity() const;               // 5.7
-  const char* layerName() const;
-  const char* layerComponentName() const;
-  const char* placementComponentName() const;
-
-  int numRectangles() const;
-  int xl(int index) const;
-  int yl(int index) const;
-  int xh(int index) const;
-  int yh(int index) const;
-
-  int numPolygons() const;                          // 5.6
-  struct defiPoints getPolygon(int index) const;    // 5.6
-
-  void print(FILE* f) const;
-
-protected:
-  int    hasLayer_;
-  char*  layerName_;
-  int    layerNameLength_;
-  int    hasPlacement_;
-  int    hasComponent_;
-  char*  componentName_;
-  int    componentNameLength_;
-  int    hasSlots_;
-  int    hasFills_;
-  int    hasPushdown_;                   // 5.7
-  int    hasExceptpgnet_ ;               // 5.7
-  int    hasSoft_;                       // 5.7
-  double maxDensity_;                    // 5.7
-  int    minSpacing_;
-  int    width_;
-  int    numRectangles_;
-  int    rectsAllocated_;
-  int    mask_;                          // 5.8
-  int*   xl_;
-  int*   yl_;
-  int*   xh_;
-  int*   yh_;
-  int    numPolys_;                      // 5.6
-  int    polysAllocated_;                // 5.6
-  struct defiPoints** polygons_;         // 5.6
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.cpp
deleted file mode 100644
index 2922175..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.cpp
+++ /dev/null
@@ -1,988 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "defiComponent.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/*********************************************************
-* class defiComponentMaskShiftLayer
-**********************************************************/
-defiComponentMaskShiftLayer::defiComponentMaskShiftLayer(defrData *data)
- : defData(data)
-{
-    Init();
-}
-
-defiComponentMaskShiftLayer::~defiComponentMaskShiftLayer() {
-    Destroy();
-}
-
-void defiComponentMaskShiftLayer::Init() {
-    layersAllocated_ = 0;
-    numLayers_ = 0;
-    layers_ = 0;
-
-    bumpLayers(16);
-}
-
-void defiComponentMaskShiftLayer::Destroy() {
-    if (numLayers_) {
-        for (int i = 0; i < numLayers_; i++) {
-            if (layers_[i]) {
-                free(layers_[i]);
-            }
-        }
-        free((char*)(layers_));
-    } else {
-        if (layersAllocated_) {
-            free((char*)(layers_));
-        }
-    }
-    layersAllocated_ = 0;
-    numLayers_ = 0;
-    layers_ = 0;
-}
-
-void defiComponentMaskShiftLayer::addMaskShiftLayer(const char* layer) {
-    int len = strlen(layer) + 1;
-    if (numLayers_ == layersAllocated_)
-        bumpLayers(numLayers_ * 2);
-    layers_[numLayers_] = (char*)malloc(len);
-    strcpy(layers_[numLayers_], defData->DEFCASE(layer));
-    (numLayers_)++;
-}
-
-void defiComponentMaskShiftLayer::bumpLayers(int size) {
-    int i;
-    char** newLayers = (char**)malloc(sizeof(char*)* size);
-    for (i = 0; i < numLayers_; i++) {
-        newLayers[i] = layers_[i];
-    }
-    if (layers_) {
-        free((char*)(layers_));
-    }
-    layers_ = newLayers;
-    layersAllocated_ = size;
-}
-
-void defiComponentMaskShiftLayer::clear() {
-    for (int i = 0; i < numLayers_; i++) {
-        free(layers_[i]);
-    }
-    numLayers_ = 0;
-}
-
-int defiComponentMaskShiftLayer::numMaskShiftLayers() const {
-    return numLayers_;
-}
-
-const char* defiComponentMaskShiftLayer::maskShiftLayer(int index) const {
-    if (index >= 0 && index < numLayers_) {
-        return layers_[index];
-    }
-
-    return 0;
-}
-
-
-/*********************************************************
-* class defiComponent
-**********************************************************/
-defiComponent::defiComponent(defrData *data) 
- : defData(data)
-{
-  Init();
-}
-
-
-void defiComponent::Init() {
-  id_ = 0;
-  name_ = 0;
-  regionName_ = 0;
-  foreignName_ = 0;
-  Fori_ = 0;
-  EEQ_ = 0;
-  generateName_ = 0;
-  macroName_ = 0;
-  generateNameSize_ = 0;
-  maskShiftSize_ = 0;
-  maskShift_ = 0;
-  macroNameSize_ = 0;
-  minLayerSize_ = 0;
-  maxLayerSize_ = 0;
-  minLayer_ = 0;
-  maxLayer_ = 0;
-  nets_ = 0;
-  source_ = 0;
-  numNets_ = 0;
-  bumpName(16);
-  bumpId(16);
-  bumpRegionName(16);
-  bumpEEQ(16);
-  bumpNets(16);
-  bumpForeignName(16);
-  bumpMinLayer(16);
-  bumpMaxLayer(16);
-  numProps_ = 0;
-  propsAllocated_ = 2;
-  names_ = (char**)malloc(sizeof(char*)* 2);
-  values_ = (char**)malloc(sizeof(char*)* 2);
-  dvalues_ = (double*)malloc(sizeof(double)* 2);
-  types_ = (char*)malloc(sizeof(char)* 2);
-  clear();
-
-  numRects_ = 0;
-  rectsAllocated_ = 1;
-  rectXl_ = (int*)malloc(sizeof(int)*1);
-  rectYl_ = (int*)malloc(sizeof(int)*1);
-  rectXh_ = (int*)malloc(sizeof(int)*1);
-  rectYh_ = (int*)malloc(sizeof(int)*1);
-}
-
-
-void defiComponent::Destroy() {
-  free(name_);
-  free(regionName_);
-  free(id_);
-  free(EEQ_);
-  free(minLayer_);
-  free(maxLayer_);
-  free((char*)(nets_));
-  netsAllocated_ = 0;      // avoid freeing again later
-  if (source_) free(source_);
-  if (foreignName_) free(foreignName_);
-  if (generateName_) free(generateName_);
-  if (macroName_) free(macroName_);
-  if (netsAllocated_) free((char*)(nets_));
-  free((char*)(maskShift_));
-  free((char*)(names_));
-  free((char*)(values_));
-  free((char*)(dvalues_));
-  free((char*)(types_));
-  free((char*)(rectXl_));
-  free((char*)(rectYl_));
-  free((char*)(rectXh_));
-  free((char*)(rectYh_));
-}
-
-
-defiComponent::~defiComponent() {
-  Destroy();
-}
-
-
-void defiComponent::IdAndName(const char* id, const char* name) {
-  int len;
-
-  clear();
-
-  if ((len = strlen(id)+1) > idSize_)
-    bumpId(len);
-  strcpy(id_, defData->DEFCASE(id));
-
-  if ((len = strlen(name)+1) > nameSize_)
-    bumpName(len);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-
-const char* defiComponent::source() const {
-  return source_;
-}
-
-
-int defiComponent::weight() const {
-  return weight_;
-}
-
-
-void defiComponent::setWeight(int w) {
-  weight_ = w;
-  hasWeight_ = 1;
-}
-
-int defiComponent::maskShift(int index) const {
-    if (index < 0 || index >= maskShiftSize_) {
-        defiError(1, 0, "bad index for component maskShift", defData);
-        return 0;
-    }
-
-    return maskShift_[index];
-}
-
-void defiComponent::setMaskShift(const char *shiftMask) {
-    int shiftMaskLength = strlen(shiftMask);
-
-    maskShift_ = (int*)malloc(sizeof(int)* shiftMaskLength);
-    maskShiftSize_ = shiftMaskLength;
-
-    for (int i = 0; i < shiftMaskLength; i++) {
-        int curShift = shiftMask[i] - '0';
-
-        // Strip possible error data.
-        if (curShift > 9 || curShift < 0) {
-            curShift = 0;
-        }
-
-        maskShift_[shiftMaskLength - i - 1] = curShift;
-    } 
-}
-
-void defiComponent::setGenerate(const char* newName, const char* macroName) {
-  int len = strlen(newName) + 1;
-
-  if (generateNameSize_ < len) {
-    if (generateName_) free(generateName_);
-    generateName_ = (char*)malloc(len);
-    generateNameSize_ = len;
-  }
-  strcpy(generateName_, defData->DEFCASE(newName));
-
-  len = strlen(macroName) + 1;
-  if (macroNameSize_ < len) {
-    if (macroName_) free(macroName_);
-    macroName_ = (char*)malloc(len);
-    macroNameSize_ = len;
-  }
-  strcpy(macroName_, defData->DEFCASE(macroName));
-
-  hasGenerate_ = 1;  // Ying Tan fix at 20010918
-}
-
-
-void defiComponent::setSource(const char* name) {
-  int len = strlen(name) + 1;
-  source_ = (char*)malloc(len);
-  strcpy(source_, defData->DEFCASE(name));
-}
-
-
-void defiComponent::setRegionName(const char* name) {
-  int len;
-
-  if ((len = strlen(name)+1) > regionNameSize_)
-    bumpRegionName(len);
-  strcpy(regionName_, defData->DEFCASE(name));
-  hasRegionName_ = 1;
-}
-
-
-void defiComponent::setEEQ(const char* name) {
-  int len;
-
-  if ((len = strlen(name)+1) > EEQSize_)
-    bumpEEQ(len);
-  strcpy(EEQ_, defData->DEFCASE(name));
-  hasEEQ_ = 1;
-}
-
-
-void defiComponent::setPlacementStatus(int n) {
-  status_= n;
-}
-
-
-void defiComponent::setPlacementLocation(int x, int y, int orient) {
-  x_ = x;
-  y_ = y;
-  orient_ = orient;
-}
-
-
-void defiComponent::setRegionBounds(int xl, int yl, int xh, int yh) {
-  int i;
-  i = numRects_;
-  if (i == rectsAllocated_) {
-    int max = rectsAllocated_ * 2;
-    int* nxl = (int*)malloc(sizeof(int)*max);
-    int* nyl = (int*)malloc(sizeof(int)*max);
-    int* nxh = (int*)malloc(sizeof(int)*max);
-    int* nyh = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRects_; i++) {
-      nxl[i] = rectXl_[i];
-      nyl[i] = rectYl_[i];
-      nxh[i] = rectXh_[i];
-      nyh[i] = rectYh_[i];
-    }
-    free((char*)(rectXl_));
-    free((char*)(rectYl_));
-    free((char*)(rectXh_));
-    free((char*)(rectYh_));
-    rectXl_ = nxl;
-    rectYl_ = nyl;
-    rectXh_ = nxh;
-    rectYh_ = nyh;
-    rectsAllocated_ = max;
-  }
-  rectXl_[i] = xl;
-  rectYl_[i] = yl;
-  rectXh_[i] = xh;
-  rectYh_[i] = yh;
-  numRects_ += 1;
-}
-
-
-// 5.6
-void defiComponent::setHalo(int left, int bottom, int right, int top) {
-  hasHalo_ = 1;
-  leftHalo_ = left; 
-  bottomHalo_ = bottom; 
-  rightHalo_ = right; 
-  topHalo_ = top; 
-}
-
-// 5.7
-void defiComponent::setHaloSoft() {
-  hasHaloSoft_ = 1;
-}
-
-// 5.7
-void defiComponent::setRouteHalo(int haloDist, const char* minLayer,
-                                 const char* maxLayer) {
-  int len;
-
-  haloDist_ = haloDist;
-  if ((len = strlen(minLayer)+1) > minLayerSize_)
-    bumpMinLayer(len);
-  strcpy(minLayer_, defData->DEFCASE(minLayer));
-  if ((len = strlen(maxLayer)+1) > maxLayerSize_)
-    bumpMaxLayer(len);
-  strcpy(maxLayer_, defData->DEFCASE(maxLayer));
-}
-
-void defiComponent::changeIdAndName(const char* id, const char* name) {
-  int len;
-
-  if ((len = strlen(id)+1) > idSize_)
-    bumpId(len);
-  strcpy(id_, defData->DEFCASE(id));
-
-  if ((len = strlen(name)+1) > nameSize_)
-    bumpName(len);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-
-const char* defiComponent::id() const {
-  return id_;
-}
-
-
-const char* defiComponent::name() const {
-  return name_;
-}
-
-
-int defiComponent::placementStatus() const {
-  return status_;
-}
-
-
-int defiComponent::placementX() const {
-  return x_;
-}
-
-
-int defiComponent::placementY() const {
-  return y_;
-}
-
-
-int defiComponent::placementOrient() const {
-  return orient_;
-}
-
-
-const char* defiComponent::placementOrientStr() const {
-  return (defiOrientStr(orient_));
-}
-
-
-const char* defiComponent::regionName() const {
-  return regionName_;
-}
-
-
-const char* defiComponent::EEQ() const {
-  return EEQ_;
-}
-
-
-const char* defiComponent::generateName() const {
-  return generateName_;
-}
-
-
-const char* defiComponent::macroName() const {
-  return macroName_;
-}
-
-
-void defiComponent::regionBounds(int* size,
-	  int** xl, int** yl, int** xh, int** yh) const {
-  *size = numRects_;
-  *xl = rectXl_;
-  *yl = rectYl_;
-  *xh = rectXh_;
-  *yh = rectYh_;
-}
-
-
-void defiComponent::bumpId(int size) {
-  if (id_) free(id_);
-  id_ = (char*)malloc(size);
-  idSize_ = size;
-  *(id_) = '\0';
-}
-
-
-void defiComponent::bumpName(int size) {
-  if (name_) free(name_);
-  name_ = (char*)malloc(size);
-  nameSize_ = size;
-  *(name_) = '\0';
-}
-
-
-void defiComponent::bumpRegionName(int size) {
-  if (regionName_) free(regionName_);
-  regionName_ = (char*)malloc(size);
-  regionNameSize_ = size;
-  *(regionName_) = '\0';
-}
-
-
-void defiComponent::bumpEEQ(int size) {
-  if (EEQ_) free(EEQ_);
-  EEQ_ = (char*)malloc(size);
-  EEQSize_ = size;
-  *(EEQ_) = '\0';
-}
-
-
-void defiComponent::bumpMinLayer(int size) {
-  if (minLayer_) free(minLayer_);
-  minLayer_ = (char*)malloc(size);
-  minLayerSize_ = size;
-  *(minLayer_) = '\0';
-}
-
-
-void defiComponent::bumpMaxLayer(int size) {
-  if (maxLayer_) free(maxLayer_);
-  maxLayer_ = (char*)malloc(size);
-  maxLayerSize_ = size;
-  *(maxLayer_) = '\0';
-}
-
-void defiComponent::clear() {
-  int i;
-
-  if (id_)
-     *(id_) = '\0';
-  if (name_)
-     *(name_) = '\0';
-  if (regionName_)
-     *(regionName_) = '\0';
-  if (foreignName_)
-     *(foreignName_) = '\0';
-  if (EEQ_)
-     *(EEQ_) = '\0';
-  if (minLayer_)
-     *(minLayer_) = '\0';
-  if (maxLayer_)
-     *(maxLayer_) = '\0';
-  Fori_ = 0;
-  status_ = 0;
-  hasRegionName_ = 0;
-  hasForeignName_ = 0;
-  hasFori_ = 0;
-  hasEEQ_ = 0;
-  hasWeight_ = 0;
-  hasGenerate_ = 0;
-  if (maskShiftSize_) {
-     free((int*)(maskShift_));
-  }
-  maskShift_ = 0;
-  maskShiftSize_ = 0;
-  weight_ = 0;
-  if (source_) free(source_);
-  for (i = 0; i < numNets_; i++) {
-    free(nets_[i]);
-  }
-  numNets_ = 0;
-  source_ = 0;
-  hasHalo_ = 0;
-  hasHaloSoft_ = 0;
-  haloDist_ = 0;
-  leftHalo_ = 0;
-  bottomHalo_ = 0;
-  rightHalo_ = 0;
-  topHalo_ = 0;
-  for (i = 0; i < numProps_; i++) {
-    free(names_[i]);
-    free(values_[i]);
-    dvalues_[i] = 0;
-  }
-  numProps_ = 0;
-  numRects_ = 0;
-}
-
-
-int defiComponent::isUnplaced() const {
-  return status_ == DEFI_COMPONENT_UNPLACED ? 1 : 0 ;
-}
-
-
-int defiComponent::isPlaced() const {
-  return status_ == DEFI_COMPONENT_PLACED ? 1 : 0 ;
-}
-
-
-int defiComponent::isFixed() const {
-  return status_ == DEFI_COMPONENT_FIXED ? 1 : 0 ;
-}
-
-
-int defiComponent::isCover() const {
-  return status_ == DEFI_COMPONENT_COVER ? 1 : 0 ;
-}
-
-
-void defiComponent::print(FILE* fout) const {
-  fprintf(fout, "Component id '%s' name '%s'",
-      id(),
-      name());
-  if (isPlaced()) {
-    fprintf(fout, " Placed at %d,%d orient %s",
-    placementX(),
-    placementY(),
-    placementOrientStr());
-  }
-  if (isFixed()) {
-    fprintf(fout, " Fixed at %d,%d orient %s",
-    placementX(),
-    placementY(),
-    placementOrientStr());
-  }
-  if (isCover()) {
-    fprintf(fout, " Cover at %d,%d orient %s",
-    placementX(),
-    placementY(),
-    placementOrientStr());
-  }
-  fprintf(fout, "\n");
-
-  if (hasGenerate()) {
-    fprintf(fout, "  generate %s %s\n", generateName(),
-    macroName());
-  }
-  if (hasWeight()) {
-    fprintf(fout, "  weight %d\n", weight());
-  }
-  if (maskShiftSize()) {
-      fprintf(fout, "  maskShift ");
-
-      for (int i = 0; i < maskShiftSize(); i++) {
-        fprintf(fout, " %d", maskShift(i));
-      }
-      fprintf(fout, "\n");
-  }
-  if (hasSource()) {
-    fprintf(fout, "  source '%s'\n", source());
-  }
-  if (hasEEQ()) {
-    fprintf(fout, "  EEQ '%s'\n", EEQ());
-  }
-
-  if (hasRegionName()) {
-    fprintf(fout, "  Region '%s'\n", regionName());
-  }
-  if (hasRegionBounds()) {
-    int size;
-    int *xl, *yl, *xh, *yh;
-    int j;
-    regionBounds(&size, &xl, &yl, &xh, &yh);
-    for (j = 0; j < size; j++)
-      fprintf(fout, "  Region bounds %d,%d %d,%d\n", xl[j], yl[j], xh[j], yh[j]);
-  }
-  if (hasNets()) {
-    int i;
-    fprintf(fout, " Net connections:\n");
-    for (i = 0; i < numNets(); i++) {
-      fprintf(fout, "  '%s'\n", net(i));
-    }
-  }
-}
-
-
-int defiComponent::hasRegionName() const {
-  return (int)(hasRegionName_);
-}
-
-
-int defiComponent::hasGenerate() const {
-  return (int)(hasGenerate_);
-}
-
-
-int defiComponent::hasWeight() const {
-  return (int)(hasWeight_);
-}
-
-int defiComponent::maskShiftSize() const {
-    return maskShiftSize_;
-}
-
-int defiComponent::hasSource() const {
-  return source_ ? 1 : 0;
-}
-
-
-int defiComponent::hasRegionBounds() const {
-  return numRects_ ? 1 : 0 ;
-}
-
-
-int defiComponent::hasEEQ() const {
-  return (int)(hasEEQ_);
-}
-
-
-int defiComponent::hasNets() const {
-  return numNets_ ? 1 : 0;
-}
-
-
-int defiComponent::numNets() const {
-  return numNets_;
-}
-
-
-// 5.6
-int defiComponent::hasHalo() const {
-  return hasHalo_;
-}
-
-
-// 5.7
-int defiComponent::hasHaloSoft() const {
-  return hasHaloSoft_;
-}
-
-
-// 5.7
-int defiComponent::hasRouteHalo() const {
-  return haloDist_;
-}
-
-// 5.7
-int defiComponent::haloDist() const {
-  return haloDist_;
-}
-
-// 5.7
-const char* defiComponent::minLayer() const {
-  return minLayer_;
-}
-
-// 5.7
-const char* defiComponent::maxLayer() const {
-  return maxLayer_;
-}
-
-void defiComponent::haloEdges(int* left, int* bottom, int* right, int* top) {
-  *left = leftHalo_;
-  *bottom = bottomHalo_;
-  *right = rightHalo_;
-  *top = topHalo_;
-}
-
-void defiComponent::reverseNetOrder() {
-  // Reverse the order of the items in the nets array.
-  int one = 0;
-  int two = numNets_ - 1;
-  char* t;
-  while (one < two) {
-    t = nets_[one];
-    nets_[one] = nets_[two];
-    nets_[two] = t;
-    one++;
-    two--;
-  }
-}
-
-
-char* defiComponent::propName(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return names_[index];
-}
-
-
-char* defiComponent::propValue(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return values_[index];
-}
-
-
-double defiComponent::propNumber(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return dvalues_[index];
-}
-
-
-char defiComponent::propType(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return types_[index];
-}
-
-
-int defiComponent::propIsNumber(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return dvalues_[index] ? 1 : 0;
-}
-
-int defiComponent::propIsString(int index) const {
-  if (index < 0 || index >= numProps_) {
-    defiError(1, 0, "bad index for component property", defData);
-    return 0;
-  }
-  return dvalues_[index] ? 0 : 1;
-}
-
-int defiComponent::numProps() const {
-  return numProps_;
-}
-
-
-void defiComponent::addProperty(const char* name, const char* value,
-                                const char type) {
-  int len = strlen(name) + 1;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = names_[i];
-      nv[i] = values_[i];
-      nd[i] = dvalues_[i];
-      nt[i] = types_[i];
-    }
-    free((char*)(names_));
-    free((char*)(values_));
-    free((char*)(dvalues_));
-    free((char*)(types_));
-    names_ = nn;
-    values_ = nv;
-    dvalues_ = nd;
-    types_ = nt;
-  }
-  names_[numProps_] = (char*)malloc(len);
-  strcpy(names_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  values_[numProps_] = (char*)malloc(len);
-  strcpy(values_[numProps_], defData->DEFCASE(value));
-  dvalues_[numProps_] = 0;
-  types_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiComponent::addNumProperty(const char* name, const double d,
-                                   const char* value, const char type) {
-  int len = strlen(name) + 1;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = names_[i];
-      nv[i] = values_[i];
-      nd[i] = dvalues_[i];
-      nt[i] = types_[i];
-    }
-    free((char*)(names_));
-    free((char*)(values_));
-    free((char*)(dvalues_));
-    free((char*)(types_));
-    names_ = nn;
-    values_ = nv;
-    dvalues_ = nd;
-    types_ = nt;
-  }
-  names_[numProps_] = (char*)malloc(len);
-  strcpy(names_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  values_[numProps_] = (char*)malloc(len);
-  strcpy(values_[numProps_], defData->DEFCASE(value));
-  dvalues_[numProps_] = d;
-  types_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiComponent::addNet(const char* net) {
-  int len = strlen(net) + 1;
-  if (numNets_ == netsAllocated_)
-    bumpNets(numNets_ * 2);
-  nets_[numNets_] = (char*)malloc(len);
-  strcpy(nets_[numNets_], defData->DEFCASE(net));
-  (numNets_)++;
-}
-
-
-void defiComponent::bumpNets(int size) {
-  int i;
-  char** newNets = (char**)malloc(sizeof(char*)* size);
-  for (i = 0; i < numNets_; i++) {
-    newNets[i] = nets_[i];
-  }
-  free((char*)(nets_));
-  nets_ = newNets;
-  netsAllocated_ = size;
-}
-
-
-const char* defiComponent::net(int index) const {
-  if (index >= 0 && index < numNets_) {
-    return nets_[index];
-  }
-  return 0;
-}
-
-
-void defiComponent::bumpForeignName(int size) {
-  if (foreignName_) free(foreignName_);
-  foreignName_ = (char*)malloc(sizeof(char) * size);
-  foreignNameSize_ = size;
-  *(foreignName_) = '\0';
-}
-
-
-void defiComponent::setForeignName(const char* name) {
-  int len;
-
-  if (hasForeignName())
-      defiError(1, 0,
-      "Multiple define of '+ FOREIGN' in COMPONENT is not supported.\n", defData);
-  if ((len = strlen(name)+1) > foreignNameSize_)
-    bumpForeignName(len);
-  strcpy(foreignName_, defData->DEFCASE(name));
-  hasForeignName_ = 1;
-}
-
-
-void defiComponent::setForeignLocation(int x, int y, int orient) {
-  Fx_ = x;
-  Fy_ = y;
-  Fori_ = orient;
-  hasFori_ = 1;
-}
-
-
-int defiComponent::hasForeignName() const {
-  return (int)(hasForeignName_);
-}
-
-
-const char* defiComponent::foreignName() const {
-  return foreignName_;
-}
-
-
-int defiComponent::foreignX() const {
-  return Fx_;
-}
-
-
-int defiComponent::foreignY() const {
-  return Fy_;
-}
-
-
-int defiComponent::hasFori() const {
-  return (int)(hasFori_);
-}
-
-const char* defiComponent::foreignOri() const {
-  switch (Fori_) {
-    case 0: return ("N");
-    case 1: return ("W");
-    case 2: return ("S");
-    case 3: return ("E");
-    case 4: return ("FN");
-    case 5: return ("FW");
-    case 6: return ("FS");
-    case 7: return ("FE");
-  }
-  return 0;
-}
-
-int defiComponent::foreignOrient() const {
-  return Fori_;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.hpp
deleted file mode 100644
index 67cd446..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiComponent.hpp
+++ /dev/null
@@ -1,249 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiComponent_h
-#define defiComponent_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-// Placement status for the component.
-// Default is 0
-#define DEFI_COMPONENT_UNPLACED 1
-#define DEFI_COMPONENT_PLACED 2
-#define DEFI_COMPONENT_FIXED 3
-#define DEFI_COMPONENT_COVER 4
-
-
-// Struct holds the data for componentMaskShiftLayers.
-class defiComponentMaskShiftLayer {
-public:
-                defiComponentMaskShiftLayer(defrData *data);
-                ~defiComponentMaskShiftLayer();
-
-    void         Init();
-    void         Destroy();
-    void         addMaskShiftLayer(const char* layer);
-    int          numMaskShiftLayers() const;
-    void         bumpLayers(int size);
-    void         clear();
-    const  char* maskShiftLayer(int index) const;
-
-protected:
-    int          layersAllocated_;  // allocated size of layers_
-    int          numLayers_;        // number of places used in layers_
-    char**       layers_;
-
-    defrData    *defData;
-};
-
-
-// Struct holds the data for one component.
-class defiComponent {
-public:
-  defiComponent(defrData *defData);
-  void Init();
-
-  void Destroy();
-  ~defiComponent();
-
-  void IdAndName(const char* id, const char* name);
-  void setGenerate(const char* genName, const char* macroName);
-  void setPlacementStatus(int n);
-  void setPlacementLocation(int x, int y, int orient);
-  void setRegionName(const char* name);
-  void setRegionBounds(int xl, int yl, int xh, int yh);
-  void setEEQ(const char* name);
-  void addNet(const char* netName);
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d,
-                      const char* value, const char type);
-  void reverseNetOrder();
-  void setWeight(int w);
-  void setMaskShift(const char* color);
-  void setSource(const char* name);
-  void setForeignName(const char* name);
-  void setFori(const char* name);
-  void setForeignLocation(int x, int y, int orient);
-  void setHalo(int left, int bottom, int right, int top);   // 5.6
-  void setHaloSoft();                                       // 5.7
-  void setRouteHalo(int haloDist, const char* minLayer, const char* maxLayer);
-                                                            // 5.7
-  void clear();
-
-  // For OA to modify the Id & Name
-  void changeIdAndName(const char* id, const char* name);
-
-  const char* id() const;
-  const char* name() const;
-  int placementStatus() const;
-  int isUnplaced() const;
-  int isPlaced() const;
-  int isFixed() const;
-  int isCover() const;
-  int placementX() const;
-  int placementY() const;
-  int placementOrient() const;
-  const char* placementOrientStr() const;
-  int hasRegionName() const;
-  int hasRegionBounds() const;
-  int hasEEQ() const;
-  int hasGenerate() const;
-  int hasSource() const;
-  int hasWeight() const;
-  int weight() const;
-  int maskShiftSize() const;
-  int maskShift(int index) const;
-  int hasNets() const;
-  int numNets() const;
-  const char* net(int index) const;
-  const char* regionName() const;
-  const char* source() const;
-  const char* EEQ() const;
-  const char* generateName() const;
-  const char* macroName() const;
-  int hasHalo() const;                     // 5.6
-  int hasHaloSoft() const;                 // 5.7
-  void haloEdges(int* left, int* bottom, int* right, int* top);  // 5.6 
-  int hasRouteHalo() const;                // 5.7
-  int haloDist() const;                    // 5.7
-  const char* minLayer() const;            // 5.7
-  const char* maxLayer() const;            // 5.7
-
-  // Returns arrays for the ll and ur of the rectangles in the region.
-  // The number of items in the arrays is given in size.
-  void regionBounds(int*size, int** xl, int** yl, int** xh, int** yh) const;
-
-  int hasForeignName() const;
-  const char* foreignName() const;
-  int foreignX() const;
-  int foreignY() const;
-  const char* foreignOri() const; // return the string value of the orient
-  int foreignOrient() const;      // return the enum value of the orient
-  int hasFori() const;
-
-  int    numProps() const;
-  char*  propName(int index) const;
-  char*  propValue(int index) const;
-  double propNumber(int index) const;
-  char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-
-  // Debug printing
-  void print(FILE* fout) const;
-
-  void bumpId(int size);
-  void bumpName(int size);
-  void bumpRegionName(int size);
-  void bumpEEQ(int size);
-  void bumpNets(int size);
-  void bumpForeignName(int size);
-  void bumpMinLayer(int size);
-  void bumpMaxLayer(int size);
-  void bumpFori(int size);
-
-protected:
-  char* id_;            // instance id
-  char* name_;          // name.
-  int nameSize_;        // allocated size of name.
-  int idSize_;          // allocated size of id.
-  int ForiSize_;        // allocate size of foreign ori
-  int status_;          // placement status
-  char hasRegionName_;  // the file supplied a region name for this comp
-  char hasEEQ_;         // the file supplied an eeq
-  char hasGenerate_;    // the file supplied an generate name and macro name
-  char hasWeight_;      // the file supplied a weight
-  char hasFori_;        // the file supplied a foreign orig name
-  int orient_;          // orientation
-  int x_, y_;           // placement loc
-
-  int numRects_;
-  int rectsAllocated_;
-  int* rectXl_;       // region points
-  int* rectYl_;
-  int* rectXh_;
-  int* rectYh_;
-
-  char* regionName_;    // name.
-  int regionNameSize_;  // allocated size of region name
-
-  char* EEQ_;
-  int EEQSize_;         // allocated size of eeq
-
-  int numNets_;         // number of net connections
-  int netsAllocated_;   // allocated size of nets array
-  char** nets_;         // net connections
-
-  int weight_;
-  int* maskShift_; 
-  int maskShiftSize_;
-  char* source_;
-  char hasForeignName_; // the file supplied a foreign name
-  char* foreignName_;   // name
-  int foreignNameSize_; // allocate size of foreign name
-  int Fx_, Fy_;         // foreign loc
-  int Fori_;            // foreign ori
-  int generateNameSize_;
-  char* generateName_;
-  int macroNameSize_;
-  char* macroName_;
-
-  int hasHalo_;
-  int hasHaloSoft_;           // 5.7
-  int leftHalo_;
-  int bottomHalo_;
-  int rightHalo_;
-  int topHalo_;
-  int haloDist_;              // 5.7
-  int minLayerSize_;          // 5.7
-  char* minLayer_;            // 5.7
-  int maxLayerSize_;          // 5.7
-  char* maxLayer_;            // 5.7
-
-  int numProps_;
-  int propsAllocated_;
-  char**  names_;
-  char**  values_;
-  double* dvalues_;
-  char*   types_;
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.cpp
deleted file mode 100644
index f229e78..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiDebug.hpp"
-
-
-#include "defrData.hpp"
-#include "defrSettings.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern defrContext defContext;
-    
-    /*******************
- *  Debug flags:
- *  0 -
- *  1 - malloc debug
- *  2 - print each history size bump up.
- *  3 - print each call to CatchAll
- *  4 -
- *  5 -
- *  6 -
- *  7 -
- *  8 -
- *  9 -
- * 10 -
- * 11 - lexer debug
- *
- ******************************/
-
-/* Set flag */
-void defiSetDebug(int, int) {
-}
-
-/* Read flag */
-int defiDebug(int) {
-    return 0;
-}
-
-void defiError(int check, int msgNum, const char* mess, defrData *defData) {
-  /* check is 1 if the caller function has checked totalMsgLimit, etc. */
-  if (!defData) {
-    defData = defContext.data;
-  }
-
-  return defData->defiError(check, msgNum, mess);
-}
-
-const char* upperCase(const char* str, defrData *defData) {
-  if (!defData) {
-    defData = defContext.data;
-  }
-
-   return defData->upperCase(str);
-}
-
-const char* DEFCASE(const char* ch, defrData *defData) {
-  if (!defData) {
-    defData = defContext.data;
-  }
-
-   return defData->DEFCASE(ch);
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.hpp
deleted file mode 100644
index 97e5789..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDebug.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiDebug_h
-#define defiDebug_h 
-
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-/* Set flag */
-extern void defiSetDebug (int num, int value) ;
-
-/* Read flag */
-extern int defiDebug (int num) ;
-
-/* Error loggin function */
-extern void defiError(int check, int msgNum, const char* message, defrData *defData = NULL);
-
-/* for auto upshifting names in case insensitive files */
-extern const char* upperCase(const char* c, defrData *defData = NULL);
-extern const char* DEFCASE(const char* ch, defrData *defData = NULL);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDefs.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDefs.hpp
deleted file mode 100644
index 17b7b89..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiDefs.hpp
+++ /dev/null
@@ -1,182 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-/* Definitions header file for the DEF Interface */
-
-#ifndef DEFI_DEFS_H
-#define DEFI_DEFS_H
-
-#include <stdio.h>
-#include <limits.h>
-
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/*=================== General Types and Definitions =================*/
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef NULL
-#define NULL (0)
-#endif
-
-typedef struct defpoint defPOINT;
-
-struct defpoint {
-    int x;
-    int y;
-    };
-
-typedef struct defrect defRECT;
-
-struct defrect {
-    defPOINT ll,ur;
-    };
-
-typedef struct deftoken defTOKEN;
-
-struct deftoken {
-    defTOKEN *next;
-    int what;
-    int data;
-    defPOINT pt;
-    };
-
-#define START_LIST 10001
-#define POINT_SPEC 10002
-#define VIA_SPEC   10003
-#define WIDTH_SPEC 10004
-#define LAYER_SPEC 10005
-#define SHAPE_SPEC 10006
-
-#ifndef	MIN
-#define MIN(x,y) ((x) < (y)? (x) : (y))
-#endif
-
-#ifndef	MIN
-#define MAX(x,y) ((x) > (y)? (x) : (y))
-#endif
-
-#define ROUND(x) ((x) >= 0 ? (int)((x)+0.5) : (int)((x)-0.5))
-
-//defTOKEN *TokenFromRect();
-
-/*=================== Enumerated Types ============================*/
-typedef int defiBoolean;
-
-/* Every type of object has a unique identifier, and each object
- * which is created knows its type, by storing the defiObjectType_e
- * as the first member in the structure.
- *
- */
-typedef enum
-{
-  /* decrease likelihood of accidentally correct values by starting
-     at an unusual number */
-  defiInvalidObject = 41713, 
-  defiUnknownObject /* void * */
-} defiObjectType_e;
-
-
-/* The memory policy controls how an object which refers to or is composed of
- * other objects manages those sub-objects, particularly when the parent
- * object is copied or deleted.  The policy is specified as an argument to the
- * constructor or initializer, and it is stored with the parent object.
- *
- * The memory policy is a generalization of the common distinction between
- * deep and shallow copies.  When a shallow copy of a parent object is made,
- * the copy maintains pointers to the original sub-objects, and the original
- * parent remains responsible for deleting those sub-objects.  When a deep
- * copy of a parent object is made, the copy maintains pointers to new copies
- * of each of the sub-objects, and the copy is responsible for deleting the
- * new sub-objects.
- *
- * The defiPrivateSubObjects policy corresponds to a deep copy, while the the
- * defiReferencedSubObjects policy corresponds to a shallow copy.  Usually an
- * initial parent object will be created using defiPrivateSubObjects.  When a
- * copy is made of that parent object, the copy may either maintain its own
- * private versions of each sub-object, or it may refer to the original
- * sub-objects.
- *
- * In certain cases, it is useful to create a deep copy of a parent object,
- * even though the new parent object shouldn't be responsible for the new
- * sub-objects.  In this case, the defiOrphanSubObjects and
- * defiAdoptedSubObjects policies may be used.  defiOrphanSubObjects is
- * specified while creating the deep copy, and then defiAdoptedSubObjects is
- * specified while creating another parent which will take on the
- * responsibility for the orphans.
- *
- * An object's memory policy affects only the sub-objects which it directly
- * controls.  Those sub-objects themselves may have the same memory policy as
- * their parents, or they may have a different memory policy.  When a copy is
- * made of a child sub-object, the memory policy of the child controls
- * whether deep or shallow copies are made of the grandchildren.
- */
-typedef enum
-{
-  /* decrease likelihood of accidentally correct values by starting
-     at an unusual number */
-  defiInvalidMemoryPolicy = 23950,
-  defiPrivateSubObjects,      // deep copy + delete
-  defiReferencedSubObjects,   // shallow copy, no delete
-  defiOrphanSubObjects,       // deep copy, no delete
-  defiAdoptedSubObjects       // shallow copy + delete
-} defiMemoryPolicy_e;
-
-/* An opaque pointer for passing user data through from one API
- * function to another.
- * A handle which a user can set to point to their own data
- * on a per-callback basis.  (See the comment in defwWriter.h)
- */
-#define defiUserData void *
-#define defiUserDataHandle void **
-
-/* On SunOs 4.1.3 with acc, this is in libansi.a, but isn't properly
- * declared anywhere in the header files supplied with the compiler.
- */
-#ifdef __SunOS_4_1_3
-extern int strcasecmp(const char*, const char*);
-#endif
-
-#ifdef WIN32
-#define strdup _strdup
-#endif 
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.cpp
deleted file mode 100644
index f1088a6..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiFPC.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiFPC
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiFPC::defiFPC(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiFPC::Init() {
-  name_ = 0;
-  nameLength_ = 0;
-  namesAllocated_ = 0;
-  namesUsed_ = 0;
-  names_ = 0;
-  rowOrComp_ = 0;
-  clear();
-}
-
-
-defiFPC::~defiFPC() {
-  Destroy();
-}
-
-
-void defiFPC::Destroy() {
-
-  clear();
-
-  if (name_) free(name_);
-  name_ = 0;
-  nameLength_ = 0;
-
-  free((char*)(names_));
-  free((char*)(rowOrComp_));
-  namesAllocated_ = 0;
-}
-
-
-void defiFPC::clear() {
-  int i;
-
-  direction_ = 0;
-  hasAlign_ = 0;
-  hasMin_ = 0;
-  hasMax_ = 0;
-  hasEqual_ = 0;
-  corner_ = 0;
-
-  for (i = 0; i < namesUsed_; i++) {
-    if (names_[i]) free (names_[i]) ;
-  }
-  namesUsed_ = 0;
-}
-
-
-void defiFPC::setName(const char* name, const char* direction) {
-  int len = strlen(name) + 1;
-
-  clear();
-
-  if (len > nameLength_) {
-    if (name_) free(name_);
-    nameLength_ = len;
-    name_ = (char*)malloc(len);
-  }
-  strcpy(name_, defData->DEFCASE(name));
-
-  if (*direction == 'H')
-    direction_ = 'H';
-  else if (*direction == 'V')
-    direction_ = 'V';
-  else
-    defiError(0, 6030, "ERROR (DEFPARS-6030): Invalid direction specified with FPC name. The valid direction is either 'H' or 'V'. Specify a valid value and then try again.", defData);
-
-}
-
-
-void defiFPC::print(FILE* f) const {
-  fprintf(f, "FPC '%s'\n", name_);
-}
-
-
-const char* defiFPC::name() const {
-  return name_;
-}
-
-
-int defiFPC::isVertical() const {
-  return direction_ == 'V' ? 1 : 0 ;
-}
-
-
-int defiFPC::isHorizontal() const {
-  return direction_ == 'H' ? 1 : 0 ;
-}
-
-
-int defiFPC::hasAlign() const {
-  return (int)(hasAlign_);
-}
-
-
-int defiFPC::hasMax() const {
-  return (int)(hasMax_);
-}
-
-
-int defiFPC::hasMin() const {
-  return (int)(hasMin_);
-}
-
-
-int defiFPC::hasEqual() const {
-  return (int)(hasEqual_);
-}
-
-
-double defiFPC::alignMin() const {
-  return minMaxEqual_;
-}
-
-
-double defiFPC::alignMax() const {
-  return minMaxEqual_;
-}
-
-
-double defiFPC::equal() const {
-  return minMaxEqual_;
-}
-
-
-int defiFPC::numParts() const {
-  return namesUsed_;
-}
-
-
-void defiFPC::setAlign() {
-  hasAlign_ = 0;
-}
-
-
-void defiFPC::setMin(double num) {
-  minMaxEqual_ = num;
-}
-
-
-void defiFPC::setMax(double num) {
-  minMaxEqual_ = num;
-}
-
-
-void defiFPC::setEqual(double num) {
-  minMaxEqual_ = num;
-}
-
-
-void defiFPC::setDoingBottomLeft() {
-  corner_ = 'B';
-}
-
-
-void defiFPC::setDoingTopRight() {
-  corner_ = 'T';
-}
-
-
-void defiFPC::getPart(int index, int* corner, int* typ, char** name) const {
-  if (index >= 0 && index <= namesUsed_) {
-    // 4 for bottom left  0 for topright
-    // 2 for row   0 for comps
-    if (corner) *corner = (int)((rowOrComp_[index] & 4) ? 'B' : 'T') ;
-    if (typ) *typ = (int)((rowOrComp_[index] & 2) ? 'R' : 'C') ;
-    if (name) *name = names_[index];
-  }
-}
-
-
-void defiFPC::addRow(const char* name) {
-  addItem('R', defData->DEFCASE(name));
-}
-
-
-void defiFPC::addComps(const char* name) {
-  addItem('C', defData->DEFCASE(name));
-}
-
-
-void defiFPC::addItem(char item, const char* name) {
-  int len = strlen(name) + 1;
-
-  if (namesUsed_ >= namesAllocated_) {
-    char* newR;
-    char** newN;
-    int i;
-    namesAllocated_ =
-	namesAllocated_ ? namesAllocated_ * 2 : 8 ;
-    newN = (char**) malloc(sizeof(char*) * namesAllocated_);
-    newR = (char*) malloc(sizeof(char) * namesAllocated_);
-    for (i = 0; i < namesUsed_; i++) {
-      newN[i] = names_[i];
-      newR[i] = rowOrComp_[i];
-    }
-    if (names_) free((char*)(names_));
-    if (rowOrComp_) free(rowOrComp_);
-    names_ = newN;
-    rowOrComp_ = newR;
-  }
-
-  names_[namesUsed_] = (char*)malloc(len);
-  strcpy(names_[namesUsed_], name);
-
-  // 4 for bottomleft
-  // 2 for row
-  rowOrComp_[namesUsed_] = 
-         (char)(((corner_ == 'B') ? 4 : 0) |
-	 (item == 'R' ? 2 : 0));
-
-  namesUsed_ += 1;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.hpp
deleted file mode 100644
index 712d863..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFPC.hpp
+++ /dev/null
@@ -1,107 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiFPC_h
-#define defiFPC_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiFPC {
-public:
-  defiFPC(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiFPC();
-
-  void clear();
-
-  void setName(const char* name, const char* direction);
-  void setAlign();
-  void setMax(double num);
-  void setMin(double num);
-  void setEqual(double num);
-  void setDoingBottomLeft();
-  void setDoingTopRight();
-  void addRow(const char* name);
-  void addComps(const char* name);
-  void addItem(char typ, const char* name);
-
-  const char* name() const;
-  int isVertical() const;
-  int isHorizontal() const;
-  int hasAlign() const;
-  int hasMax() const;
-  int hasMin() const;
-  int hasEqual() const;
-  double alignMax() const;
-  double alignMin() const;
-  double equal() const;
-
-  int numParts() const;
-
-  // Return the constraint number "index" where index is
-  //    from 0 to numParts()
-  // The returned corner is 'B' for bottom left  'T' for topright
-  // The returned typ is 'R' for rows   'C' for comps
-  // The returned char* points to name of the item.
-  void getPart(int index, int* corner, int* typ, char** name) const;
-
-  // debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameLength_;
-  char direction_; // H or V
-  char hasAlign_;
-  char hasMin_;
-  char hasMax_;
-  char hasEqual_;
-  char corner_;   // Bottomleft or Topright
-  double minMaxEqual_;
-  int namesAllocated_;  // allocated size of names_ and rowOrComp_
-  int namesUsed_;       // number of entries used in the arrays
-  char* rowOrComp_;
-  char** names_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.cpp
deleted file mode 100644
index ef7909b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.cpp
+++ /dev/null
@@ -1,428 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiFill.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiFill
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-defiFill::defiFill(defrData *data) 
-: defData(data) 
-{
-  Init();
-}
-
-
-void defiFill::Init() {
-  numPolys_ = 0;
-  numPts_ = 0;
-  clear();
-  layerNameLength_ = 0;
-  xl_ = (int*)malloc(sizeof(int)*1);
-  yl_ = (int*)malloc(sizeof(int)*1);
-  xh_ = (int*)malloc(sizeof(int)*1);
-  yh_ = (int*)malloc(sizeof(int)*1);
-  rectsAllocated_ = 1;      // At least 1 rectangle will define
-  polysAllocated_ = 0;
-  polygons_ = 0;
-  layerName_ = 0;
-  viaName_ = 0;
-  viaNameLength_ = 0;
-  viaPts_ = 0;
-  ptsAllocated_ = 0;
-  viaPts_ = 0;
-
-}
-
-defiFill::~defiFill() {
-  Destroy();
-}
-
-void defiFill::clear() {
-  hasLayer_ = 0;
-  layerOpc_ = 0;
-  numRectangles_ = 0;
-  hasVia_ = 0;
-  viaOpc_ = 0;
-  mask_ = 0;
-}
-
-void defiFill::clearPoly() {
-  struct defiPoints* p;
-  int i;
-
-  for (i = 0; i < numPolys_; i++) {
-    p = polygons_[i];
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(polygons_[i]));
-  }
-  numPolys_ = 0;
-}
-
-void defiFill::clearPts() {
-  struct defiPoints* p;
-  int i;
-
-  for (i = 0; i < numPts_; i++) {
-    p = viaPts_[i];
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(viaPts_[i]));
-  }
-  numPts_ = 0;
-}
-
-void defiFill::Destroy() {
-  if (layerName_) free(layerName_);
-  if (viaName_) free(viaName_);
-  free((char*)(xl_));
-  free((char*)(yl_));
-  free((char*)(xh_));
-  free((char*)(yh_));
-  rectsAllocated_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  clearPoly();
-  if (polygons_) free((char*)(polygons_));
-  polygons_ = 0;
-  clearPts();
-  if (viaPts_) free((char*)(viaPts_));
-  viaPts_ = 0;
-  clear();
-}
-
-
-void defiFill::setLayer(const char* name) {
-  int len = strlen(name) + 1;
-  if (layerNameLength_ < len) {
-    if (layerName_) free(layerName_);
-    layerName_ = (char*)malloc(len);
-    layerNameLength_ = len;
-  }
-  strcpy(layerName_, defData->DEFCASE(name));
-  hasLayer_ = 1;
-}
-
-// 5.7
-void defiFill::setLayerOpc() {
-  layerOpc_ = 1;
-}
-
-void defiFill::addRect(int xl, int yl, int xh, int yh) {
-  if (numRectangles_ == rectsAllocated_) {
-    int i;
-    int max = rectsAllocated_ = rectsAllocated_ * 2;
-    int* newxl = (int*)malloc(sizeof(int)*max);
-    int* newyl = (int*)malloc(sizeof(int)*max);
-    int* newxh = (int*)malloc(sizeof(int)*max);
-    int* newyh = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRectangles_; i++) {
-      newxl[i] = xl_[i];
-      newyl[i] = yl_[i];
-      newxh[i] = xh_[i];
-      newyh[i] = yh_[i];
-    }
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    xl_ = newxl;
-    yl_ = newyl;
-    xh_ = newxh;
-    yh_ = newyh;
-  }
-  xl_[numRectangles_] = xl;
-  yl_[numRectangles_] = yl;
-  xh_[numRectangles_] = xh;
-  yh_[numRectangles_] = yh;
-  numRectangles_ += 1;
-}
-
-// 5.6
-void defiFill::addPolygon(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    for (i = 0; i < numPolys_; i++)
-      poly[i] = polygons_[i];
-    if (polygons_)
-      free((char*)(polygons_));
-    polygons_ = poly;
-  }
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_] = p;
-  numPolys_ += 1;
-}
-
-int defiFill::hasLayer() const {
-  return hasLayer_;
-}
-
-const char* defiFill::layerName() const {
-  return layerName_;
-}
-
-// 5.7
-int defiFill::hasLayerOpc() const {
-  return layerOpc_;
-}
-
-int defiFill::numRectangles() const {
-  return numRectangles_;
-}
-
-
-int defiFill::xl(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for Fill xl", defData);
-    return 0;
-  }
-  return xl_[index];
-}
-
-
-int defiFill::yl(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for Fill yl", defData);
-    return 0;
-  }
-  return yl_[index];
-}
-
-
-int defiFill::xh(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for Fill xh", defData);
-    return 0;
-  }
-  return xh_[index];
-}
-
-
-int defiFill::yh(int index) const {
-  if (index < 0 || index >= numRectangles_) {
-    defiError(1, 0, "bad index for Fill yh", defData);
-    return 0;
-  }
-  return yh_[index];
-}
-
-// 5.6
-int defiFill::numPolygons() const {
-  return numPolys_;
-}
-
-
-// 5.6
-struct defiPoints defiFill::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-// 5.7
-void defiFill::setVia(const char* name) {
-  int len = strlen(name) + 1;
-  if (viaNameLength_ < len) {
-    if (viaName_) free(viaName_);
-    viaName_ = (char*)malloc(len);
-    viaNameLength_ = len;
-  }
-  strcpy(viaName_, defData->DEFCASE(name));
-  hasVia_ = 1;
-}
-
-// 5.7
-void defiFill::setViaOpc() {
-  viaOpc_ = 1;
-}
-
-// 5.8
-void defiFill::setMask(int colorMask) {
-    mask_ = colorMask;
-}
-
-
-// 5.7
-void defiFill::addPts(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  if (numPts_ == ptsAllocated_) {
-    struct defiPoints** pts;
-    ptsAllocated_ = (ptsAllocated_ == 0) ?
-          2 : ptsAllocated_ * 2;
-    pts= (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            ptsAllocated_);
-    for (i = 0; i < numPts_; i++)
-      pts[i] = viaPts_[i];
-    if (viaPts_)
-      free((char*)(viaPts_));
-    viaPts_ = pts;
-  }
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  viaPts_[numPts_] = p;
-  numPts_ += 1;
-}
-
-// 5.7
-int defiFill::hasVia() const {
-  return hasVia_;
-}
-
-// 5.7
-const char* defiFill::viaName() const {
-  return viaName_;
-}
-
-// 5.7
-int defiFill::hasViaOpc() const {
-  return viaOpc_;
-}
-
-// 5.7
-int defiFill::numViaPts() const {
-  return numPts_;
-}
-
-// 5.8
-int defiFill::layerMask() const {
-    return mask_;
-}
-
-// 5.8
-int defiFill::viaTopMask() const {
-    return mask_ / 100;
-}
-
-// 5.8
-int defiFill::viaCutMask() const {
-    return mask_ / 10 % 10;
-}
-
-// 5.8
-int defiFill::viaBottomMask() const {
-    return mask_ % 10;
-}
-
-// 5.7
-struct defiPoints defiFill::getViaPts(int index) const {
-  return *(viaPts_[index]);
-}
-
-void defiFill::print(FILE* f) const {
-  int i, j;
-  struct defiPoints points;
-
-  if (hasLayer())
-    fprintf(f, "- LAYER %s", layerName());
-
-  if (layerMask())
-      fprintf(f, " + Mask %d", layerMask());
-
-  if (hasLayerOpc())
-    fprintf(f, " + OPC");
-  fprintf(f, "\n");
-
-  for (i = 0; i < numRectangles(); i++) {
-    fprintf(f, "   RECT %d %d %d %d\n", xl(i),
-            yl(i), xh(i),
-            yh(i));
-  }
-
-  for (i = 0; i < numPolygons(); i++) {
-    fprintf(f, "   POLYGON ");
-    points = getPolygon(i);
-    for (j = 0; j < points.numPoints; j++)
-      fprintf(f, "%d %d ", points.x[j], points.y[j]);
-    fprintf(f, "\n");
-  }
-  fprintf(f,"\n");
-
-  if (hasVia())
-    fprintf(f, "- VIA %s", viaName());
-
-  if (mask_) {
-      fprintf(f, " + MASK %d%d%d", viaTopMask(),
-          viaCutMask(),
-          viaBottomMask());
-  }
-
-  if (hasViaOpc())
-    fprintf(f, " + OPC");
-  fprintf(f, "\n");
-
-  for (i = 0; i < numViaPts(); i++) {
-    fprintf(f, "   ");
-    points = getViaPts(i);
-    for (j = 0; j < points.numPoints; j++)
-      fprintf(f, "%d %d ", points.x[j], points.y[j]);
-    fprintf(f, "\n");
-  }
-  fprintf(f,"\n");
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.hpp
deleted file mode 100644
index 53c9a23..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiFill.hpp
+++ /dev/null
@@ -1,120 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiFILL_h
-#define defiFILL_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiFill {
-public:
-  defiFill(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiFill();
-
-  void clear();
-  void clearPoly();
-  void clearPts();
-
-  void setLayer(const char* name);
-  void setLayerOpc();                             // 5.7
-  void addRect(int xl, int yl, int xh, int yh);
-  void addPolygon(defiGeometries* geom);
-  void setVia(const char* name);                  // 5.7
-  void setViaOpc();                               // 5.7
-  void addPts(defiGeometries* geom);              // 5.7
-
-  int hasLayer() const;
-  const char* layerName() const;
-  int hasLayerOpc() const;                        // 5.7
-
-  void setMask(int colorMask);			  // 5.8
-  int layerMask() const;                          // 5.8
-  int viaTopMask() const;			  // 5.8
-  int viaCutMask() const;			  // 5.8
-  int viaBottomMask() const;                      // 5.8
-
-  int numRectangles() const;
-  int xl(int index) const;
-  int yl(int index) const;
-  int xh(int index) const;
-  int yh(int index) const;
-
-  int numPolygons() const;                        // 5.6
-  struct defiPoints getPolygon(int index) const;  // 5.6
-
-  int hasVia() const;                             // 5.7
-  const char* viaName() const;                    // 5.7
-  int hasViaOpc() const;                          // 5.7
-
-  int numViaPts() const;                          // 5.7
-  struct defiPoints getViaPts(int index) const;   // 5.7
-
-  void print(FILE* f) const;
-
-protected:
-  int   hasLayer_;
-  char* layerName_;
-  int   layerNameLength_;
-  int   layerOpc_;                  // 5.7
-  int   numRectangles_;
-  int   rectsAllocated_;
-  int*  xl_;
-  int*  yl_;
-  int*  xh_;
-  int*  yh_;
-  int   numPolys_;                  // 5.6
-  int   polysAllocated_;            // 5.6
-  struct defiPoints** polygons_;    // 5.6
-  int   hasVia_;                    // 5.7
-  char* viaName_;                   // 5.7
-  int   viaNameLength_;             // 5.7
-  int   viaOpc_;                    // 5.7
-  int   numPts_;                    // 5.7
-  int   ptsAllocated_;              // 5.7
-  int   mask_;                      // 5.8
-  struct defiPoints** viaPts_;      // 5.7
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.cpp
deleted file mode 100644
index 36e2590..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.cpp
+++ /dev/null
@@ -1,447 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiGroup.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiGroup
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiGroup::defiGroup(defrData *data) 
-: defData(data)
-{
-  Init();
-}
-
-
-void defiGroup::Init() {
-  name_ = 0;
-  nameLength_ = 0;
-  region_ = 0;
-  regionLength_ = 0;
-
-  numRects_ = 0;
-  rectsAllocated_ = 2;
-  xl_ = (int*)malloc(sizeof(int)*2);
-  yl_ = (int*)malloc(sizeof(int)*2);
-  xh_ = (int*)malloc(sizeof(int)*2);
-  yh_ = (int*)malloc(sizeof(int)*2);
-
-  numProps_ = 0; 
-  propsAllocated_ = 2;
-  propNames_   = (char**)malloc(sizeof(char*)*2);
-  propValues_  = (char**)malloc(sizeof(char*)*2);
-  propDValues_ = (double*)malloc(sizeof(double)*2);
-  propTypes_   = (char*)malloc(sizeof(char)*2);
-}
-
-
-defiGroup::~defiGroup() {
-  Destroy();
-}
-
-
-void defiGroup::Destroy() {
-
-  if (name_) free(name_);
-  if (region_) free(region_);
-  name_ = 0;
-  nameLength_ = 0;
-  region_ = 0;
-  regionLength_ = 0;
-
-  clear();
-  free((char*)(propNames_));
-  free((char*)(propValues_));
-  free((char*)(propDValues_));
-  free((char*)(propTypes_));
-  free((char*)(xl_));
-  free((char*)(yl_));
-  free((char*)(xh_));
-  free((char*)(yh_));
-}
-
-
-void defiGroup::clear() {
-  int i;
-  hasRegionName_ = 0;
-  hasPerim_ = 0;
-  hasMaxX_ = 0;
-  hasMaxY_ = 0;
-  for (i = 0; i < numProps_; i++) {
-    free(propNames_[i]);
-    free(propValues_[i]);
-    propDValues_[i] = 0;
-  }
-  numProps_ = 0;
-  numRects_ = 0;
-}
-
-
-void defiGroup::setup(const char* name) {
-  int len = strlen(name) + 1;
-  if (len > nameLength_) {
-    if (name_) free(name_);
-    nameLength_ = len;
-    name_ = (char*)malloc(len);
-  }
-  strcpy(name_, defData->DEFCASE(name));
-  clear();
-
-}
-
-
-void defiGroup::addRegionRect(int xl, int yl, int xh, int yh) {
-  int i;
-  if (numRects_ == rectsAllocated_) {
-    int max = numRects_ * 2;
-    int* nxl = (int*)malloc(sizeof(int)*max);
-    int* nyl = (int*)malloc(sizeof(int)*max);
-    int* nxh = (int*)malloc(sizeof(int)*max);
-    int* nyh = (int*)malloc(sizeof(int)*max);
-    max = numRects_;
-    for (i = 0; i < max; i++) {
-      nxl[i] = xl_[i];
-      nyl[i] = yl_[i];
-      nxh[i] = xh_[i];
-      nyh[i] = yh_[i];
-    }
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    xl_ = nxl;
-    yl_ = nyl;
-    xh_ = nxh;
-    yh_ = nyh;
-    rectsAllocated_ *= 2;
-  }
-
-  i = numRects_;
-  xl_[i] = xl;
-  yl_[i] = yl;
-  xh_[i] = xh;
-  yh_[i] = yh;
-  numRects_ += 1;
-}
-
-
-void defiGroup::regionRects(int* size, int** xl,
-   int**yl, int** xh, int** yh) const {
-  *size = numRects_;
-  *xl = xl_;
-  *yl = yl_;
-  *xh = xh_;
-  *yh = yh_;
-}
-
-
-void defiGroup::setRegionName(const char* region) {
-  int len = strlen(region) + 1;
-  if (len > regionLength_) {
-    if (region_) free(region_);
-    regionLength_ = len;
-    region_ = (char*)malloc(len);
-  }
-  strcpy(region_, defData->DEFCASE(region));
-  hasRegionName_ = 1;
-
-}
-
-
-void defiGroup::setMaxX(int x) {
-  hasMaxX_ = 1;
-  maxX_ = x;
-}
-
-
-void defiGroup::setMaxY(int y) {
-  hasMaxY_ = 1;
-  maxY_ = y;
-}
-
-
-void defiGroup::setPerim(int p) {
-  hasPerim_ = 1;
-  perim_ = p;
-}
-
-
-void defiGroup::addProperty(const char* name, const char* value,
-                            const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = 0;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiGroup::addNumProperty(const char* name, const double d,
-                               const char* value, const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = d;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-int defiGroup::numProps() const {
-  return numProps_;
-}
-
-
-const char* defiGroup::propName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propNames_[index];
-}
-
-
-const char* defiGroup::propValue(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propValues_[index];
-}
-
-
-double defiGroup::propNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propDValues_[index];
-}
-
-
-const char defiGroup::propType(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propTypes_[index];
-}
-
-
-int defiGroup::propIsNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 1 : 0;
-}
-
-
-int defiGroup::propIsString(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (LEFPARS-6050): The index number %d given for the GROUP PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-     defiError(0, 6050, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 0 : 1;
-}
-
-
-const char* defiGroup::regionName() const {
-  return region_;
-}
-
-
-const char* defiGroup::name() const {
-  return name_;
-}
-
-
-int defiGroup::perim() const {
-  return perim_;
-}
-
-
-int defiGroup::maxX() const {
-  return maxX_;
-}
-
-
-int defiGroup::maxY() const {
-  return maxY_;
-}
-
-
-int defiGroup::hasMaxX() const {
-  return hasMaxX_;
-}
-
-
-int defiGroup::hasMaxY() const {
-  return hasMaxY_;
-}
-
-
-int defiGroup::hasPerim() const {
-  return hasPerim_;
-}
-
-
-int defiGroup::hasRegionBox() const {
-  return numRects_ ? 1 : 0 ;
-}
-
-
-int defiGroup::hasRegionName() const {
-  return hasRegionName_;
-}
-
-
-void defiGroup::print(FILE* f) const {
-  int i;
-
-  fprintf(f, "Group '%s'\n", name());
-
-  if (hasRegionName()) {
-    fprintf(f, "  region name '%s'\n", regionName());
-  }
-
-  if (hasRegionBox()) {
-    int size = numRects_;
-    int* xl = xl_;
-    int* yl = yl_;
-    int* xh = xh_;
-    int* yh = yh_;
-    for (i = 0; i < size; i++)
-      fprintf(f, "  region box %d,%d %d,%d\n", xl[i], yl[i], xh[i], yh[i]);
-  }
-
-  if (hasMaxX()) {
-    fprintf(f, "  max x %d\n", maxX());
-  }
-
-  if (hasMaxY()) {
-    fprintf(f, "  max y %d\n", maxY());
-  }
-
-  if (hasPerim()) {
-    fprintf(f, "  perim %d\n", perim());
-  }
-
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.hpp
deleted file mode 100644
index 7c5da2c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiGroup.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiGroup_h
-#define defiGroup_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-// Struct holds the data for one property.
-
-class defiGroup {
-public:
-  defiGroup(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiGroup();
-
-  void clear();
-
-  void setup(const char* name);
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d,
-                      const char* value, const char type);
-  void addRegionRect(int xl, int yl, int xh, int yh);
-  void setRegionName(const char* name);
-  void setMaxX(int x);
-  void setMaxY(int y);
-  void setPerim(int p);
-
-  const char* name() const;
-  const char* regionName() const;
-  int hasRegionBox() const;
-  int hasRegionName() const;
-  int hasMaxX() const;
-  int hasMaxY() const;
-  int hasPerim() const;
-  void regionRects(int* size, int** xl, int**yl, int** xh, int** yh) const;
-  int maxX() const;
-  int maxY() const;
-  int perim() const;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-  // debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameLength_;
-  char* region_;
-  int regionLength_;
-
-  int rectsAllocated_;
-  int numRects_;
-  int* xl_;
-  int* yl_;
-  int* xh_;
-  int* yh_;
-
-  int maxX_;
-  int maxY_;
-  int perim_;
-  char hasRegionBox_;
-  char hasRegionName_;
-  char hasPerim_;
-  char hasMaxX_;
-  char hasMaxY_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  propNames_;
-  char**  propValues_;
-  double* propDValues_;
-  char*   propTypes_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.cpp
deleted file mode 100644
index fc3b03f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiIOTiming.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiIOTiming
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiIOTiming::defiIOTiming(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiIOTiming::Init() {
-  inst_ = 0;
-  instLength_ = 0;
-  pin_ = 0;
-  pinLength_ = 0;
-  from_ = 0;
-  fromLength_ = 0;
-  to_ = 0;
-  toLength_ = 0;
-  driveCell_ = 0;
-  driveCellLength_ = 0;
-  hasVariableRise_ = 0;
-  hasVariableFall_ = 0;
-  hasSlewRise_ = 0;
-  hasSlewFall_ = 0;
-  hasCapacitance_ = 0;
-  hasDriveCell_ = 0;
-  hasFrom_ = 0;
-  if (pin_) free(pin_);
-  pin_ = 0;
-  pinLength_ = 0;
-
-  hasTo_ = 0;
-  hasParallel_ = 0;
-  variableFallMin_ = 0.0;
-  variableRiseMin_ = 0.0;
-  variableFallMax_ = 0.0;
-  variableRiseMax_ = 0.0;
-  slewFallMin_ = 0.0;
-  slewRiseMin_ = 0.0;
-  slewFallMax_ = 0.0;
-  slewRiseMax_ = 0.0;
-  capacitance_ = 0.0;
-  parallel_ = 0.0;
-}
-
-
-defiIOTiming::~defiIOTiming() {
-  Destroy();
-}
-
-
-void defiIOTiming::Destroy() {
-
-  if (inst_) free(inst_);
-  inst_ = 0;
-  instLength_ = 0;
-
-  if (pin_) free(pin_);
-  pin_ = 0;
-  pinLength_ = 0;
-
-  if (from_) free(from_);
-  from_ = 0;
-  fromLength_ = 0;
-
-  if (to_) free(to_);
-  to_ = 0;
-  toLength_ = 0;
-
-  if (driveCell_) free(driveCell_);
-  driveCell_ = 0;
-  driveCellLength_ = 0;
-
-  clear();
-}
-
-
-void defiIOTiming::clear() {
-  hasVariableRise_ = 0;
-  hasVariableFall_ = 0;
-  hasSlewRise_ = 0;
-  hasSlewFall_ = 0;
-  hasCapacitance_ = 0;
-  hasDriveCell_ = 0;
-  hasFrom_ = 0;
-  hasTo_ = 0;
-  hasParallel_ = 0;
-  variableFallMin_ = 0.0;
-  variableRiseMin_ = 0.0;
-  variableFallMax_ = 0.0;
-  variableRiseMax_ = 0.0;
-  slewFallMin_ = 0.0;
-  slewRiseMin_ = 0.0;
-  slewFallMax_ = 0.0;
-  slewRiseMax_ = 0.0;
-  capacitance_ = 0.0;
-  parallel_ = 0.0;
-}
-
-
-void defiIOTiming::setName(const char* inst, const char* pin) {
-  int len;
-
-  clear();
-
-  len = strlen(inst) + 1;
-  if (len > instLength_) {
-    if (inst_) free(inst_);
-    instLength_ = len;
-    inst_ = (char*)malloc(len);
-  }
-  strcpy(inst_, defData->DEFCASE(inst));
-
-  len = strlen(pin) + 1;
-  if (len > pinLength_) {
-    if (pin_) free(pin_);
-    pinLength_ = len;
-    pin_ = (char*)malloc(len);
-  }
-  strcpy(pin_, defData->DEFCASE(pin));
-
-}
-
-
-void defiIOTiming::print(FILE* f) const {
-  fprintf(f, "IOTiming '%s' '%s'\n", inst_, pin_);
-
-  if (hasSlewRise())
-    fprintf(f, "  Slew rise  %5.2f %5.2f\n",
-       slewRiseMin(),
-       slewRiseMax());
-
-  if (hasSlewFall())
-    fprintf(f, "  Slew fall  %5.2f %5.2f\n",
-       slewFallMin(),
-       slewFallMax());
-
-  if (hasVariableRise())
-    fprintf(f, "  variable rise  %5.2f %5.2f\n",
-       variableRiseMin(),
-       variableRiseMax());
-
-  if (hasVariableFall())
-    fprintf(f, "  variable fall  %5.2f %5.2f\n",
-       variableFallMin(),
-       variableFallMax());
-
-  if (hasCapacitance())
-    fprintf(f, "  capacitance %5.2f\n",
-       capacitance());
-
-  if (hasDriveCell())
-    fprintf(f, "  drive cell '%s'\n",
-       driveCell());
-
-  if (hasFrom())
-    fprintf(f, "  from pin '%s'\n",
-       from());
-
-  if (hasTo())
-    fprintf(f, "  to pin '%s'\n",
-       to());
-
-  if (hasParallel())
-    fprintf(f, "  parallel %5.2f\n",
-       parallel());
-}
-
-
-
-void defiIOTiming::setVariable(const char* riseFall, double min, double max) {
-  if (*riseFall == 'R') {
-    hasVariableRise_ = 1;
-    variableRiseMin_ = min;
-    variableRiseMax_ = max;
-
-  } else if (*riseFall == 'F') {
-    hasVariableFall_ = 1;
-    variableFallMin_ = min;
-    variableFallMax_ = max;
-
-  } else {
-    defiError(0, 6060, "ERROR (DEFPARS-6060): Invalid value specified for IOTIMING rise/fall. The valid value for rise is 'R' and for fall is 'F'. Specify a valid value and then try again.", defData);
-  }
-}
-
-
-void defiIOTiming::setSlewRate(const char* riseFall, double min, double max) {
-  if (*riseFall == 'R') {
-    hasSlewRise_ = 1;
-    slewRiseMin_ = min;
-    slewRiseMax_ = max;
-
-  } else if (*riseFall == 'F') {
-    hasSlewFall_ = 1;
-    slewFallMin_ = min;
-    slewFallMax_ = max;
-
-  } else {
-    defiError(0, 6060, "ERROR (DEFPARS-6060): Invalid value specified for IOTIMING rise/fall. The valid value for rise is 'R' and for fall is 'F'. Specify a valid value and then try again.", defData);
-  }
-}
-
-
-void defiIOTiming::setCapacitance(double num) {
-  hasCapacitance_ = 1;
-  capacitance_ = num;
-}
-
-
-void defiIOTiming::setDriveCell(const char* name) {
-  int len = strlen(name) + 1;
-
-  if (driveCellLength_ < len) {
-    if (driveCell_) free(driveCell_);
-    driveCell_ = (char*) malloc(len);
-    driveCellLength_ = len;
-  }
-
-  strcpy(driveCell_, defData->DEFCASE(name));
-  hasDriveCell_ = 1;
-}
-
-
-void defiIOTiming::setFrom(const char* name) {
-  int len = strlen(name) + 1;
-
-  if (fromLength_ < len) {
-    if (from_) free(from_);
-    from_ = (char*) malloc(len);
-    fromLength_ = len;
-  }
-
-  strcpy(from_, defData->DEFCASE(name));
-  hasFrom_ = 1;
-}
-
-
-void defiIOTiming::setTo(const char* name) {
-  int len = strlen(name) + 1;
-
-  if (toLength_ < len) {
-    if (to_) free(to_);
-    to_ = (char*) malloc(len);
-    toLength_ = len;
-  }
-
-  strcpy(to_, defData->DEFCASE(name));
-  hasTo_ = 1;
-}
-
-
-void defiIOTiming::setParallel(double num) {
-  hasParallel_ = 1;
-  parallel_ = num;
-}
-
-
-int defiIOTiming::hasVariableRise() const {
-  return hasVariableRise_;
-}
-
-
-int defiIOTiming::hasVariableFall() const {
-  return hasVariableFall_;
-}
-
-
-int defiIOTiming::hasSlewRise() const {
-  return hasSlewRise_;
-}
-
-
-int defiIOTiming::hasSlewFall() const {
-  return hasSlewFall_;
-}
-
-
-int defiIOTiming::hasCapacitance() const {
-  return hasCapacitance_;
-}
-
-
-int defiIOTiming::hasDriveCell() const {
-  return hasDriveCell_;
-}
-
-
-int defiIOTiming::hasFrom() const {
-  return hasFrom_;
-}
-
-
-int defiIOTiming::hasTo() const {
-  return hasTo_;
-}
-
-
-int defiIOTiming::hasParallel() const {
-  return hasParallel_;
-}
-
-
-const char* defiIOTiming::inst() const {
-  return inst_;
-}
-
-
-const char* defiIOTiming::pin() const {
-  return pin_;
-}
-
-
-double defiIOTiming::variableFallMin() const {
-  return variableFallMin_;
-}
-
-
-double defiIOTiming::variableRiseMin() const {
-  return variableRiseMin_;
-}
-
-
-double defiIOTiming::variableFallMax() const {
-  return variableFallMax_;
-}
-
-
-double defiIOTiming::variableRiseMax() const {
-  return variableRiseMax_;
-}
-
-
-double defiIOTiming::slewFallMin() const {
-  return slewFallMin_;
-}
-
-
-double defiIOTiming::slewRiseMin() const {
-  return slewRiseMin_;
-}
-
-
-double defiIOTiming::slewFallMax() const {
-  return slewFallMax_;
-}
-
-
-double defiIOTiming::slewRiseMax() const {
-  return slewRiseMax_;
-}
-
-
-double defiIOTiming::capacitance() const {
-  return capacitance_;
-}
-
-
-const char* defiIOTiming::driveCell() const {
-  return driveCell_;
-}
-
-
-const char* defiIOTiming::from() const {
-  return from_;
-}
-
-
-const char* defiIOTiming::to() const {
-  return to_;
-}
-
-
-double defiIOTiming::parallel() const {
-  return parallel_;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.hpp
deleted file mode 100644
index 81ac6e2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiIOTiming.hpp
+++ /dev/null
@@ -1,128 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiIOTiming_h
-#define defiIOTiming_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiIOTiming {
-public:
-  defiIOTiming(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiIOTiming();
-
-  void clear();
-
-  void setName(const char* inst, const char* pin);
-  void setVariable(const char* riseFall, double min, double max);
-  void setSlewRate(const char* riseFall, double min, double max);
-  void setCapacitance(double num);
-  void setDriveCell(const char* name);
-  void setFrom(const char* name);
-  void setTo(const char* name);
-  void setParallel(double num);
-
-
-  int hasVariableRise() const;
-  int hasVariableFall() const;
-  int hasSlewRise() const;
-  int hasSlewFall() const;
-  int hasCapacitance() const;
-  int hasDriveCell() const;
-  int hasFrom() const;
-  int hasTo() const;
-  int hasParallel() const;
-
-  const char* inst() const;
-  const char* pin() const;
-  double variableFallMin() const;
-  double variableRiseMin() const;
-  double variableFallMax() const;
-  double variableRiseMax() const;
-  double slewFallMin() const;
-  double slewRiseMin() const;
-  double slewFallMax() const;
-  double slewRiseMax() const;
-  double capacitance() const;
-  const char* driveCell() const;
-  const char* from() const;
-  const char* to() const;
-  double parallel() const;
-
-  // debug print
-  void print(FILE* f) const;
-
-protected:
-  char* inst_;
-  int instLength_;
-  char* pin_;
-  int pinLength_;
-  char* from_;
-  int fromLength_;
-  char* to_;
-  int toLength_;
-  char* driveCell_;
-  char driveCellLength_;
-  char hasVariableRise_;
-  char hasVariableFall_;
-  char hasSlewRise_;
-  char hasSlewFall_;
-  char hasCapacitance_;
-  char hasDriveCell_;
-  char hasFrom_;
-  char hasTo_;
-  char hasParallel_;
-  double variableFallMin_;
-  double variableRiseMin_;
-  double variableFallMax_;
-  double variableRiseMax_;
-  double slewFallMin_;
-  double slewRiseMin_;
-  double slewFallMax_;
-  double slewRiseMax_;
-  double capacitance_;
-  double parallel_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiKRDefs.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiKRDefs.hpp
deleted file mode 100644
index 19a3712..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiKRDefs.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiKRDEFS_h
-#define defiKRDEFS_h
-
-#define BEGIN_LEFDEF_PARSER_NAMESPACE namespace LefDefParser {
-#define END_LEFDEF_PARSER_NAMESPACE }
-#define USE_LEFDEF_PARSER_NAMESPACE using namespace LefDefParser;
-
-#endif /* defiKRDEFS_h */
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.cpp
deleted file mode 100644
index 0e31b8f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "lex.h"
-#include "defiDebug.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-////////////////////////////////////////////////////
-//
-//    Handle points for a polygon
-//
-////////////////////////////////////////////////////
-defiGeometries::defiGeometries(defrData *data)
- : defData(data)
-{
-    pointsAllocated_ = 0;
-    numPoints_ = 0;
-}
-
-void defiGeometries::Init() {
-    Destroy();
-}
-
-void defiGeometries::Destroy() {
-  if (pointsAllocated_) {
-    free((char*)(x_));
-    free((char*)(y_));
-  }
-  pointsAllocated_ = 0;
-  numPoints_ = 0;
-}
-
-defiGeometries::~defiGeometries() {
-  Destroy();
-}
-
-void defiGeometries::Reset() {
-  numPoints_ = 0;
-}
-
-void defiGeometries::startList(int x, int y) {
-  if (pointsAllocated_ == 0) {
-    pointsAllocated_ = 16;
-    x_ = (int*)malloc(sizeof(int)*16);
-    y_ = (int*)malloc(sizeof(int)*16);
-    numPoints_ = 0;
-  } else   // reset the numPoints to 0
-    numPoints_ = 0;
-  addToList(x, y);
-}
-
-void defiGeometries::addToList(int x, int y) {
-  if (numPoints_ == pointsAllocated_) {
-    int i;
-    int* nx;
-    int* ny;
-    pointsAllocated_ *= 2;
-    nx = (int*)malloc(sizeof(int)*pointsAllocated_);
-    ny = (int*)malloc(sizeof(int)*pointsAllocated_);
-    for (i = 0; i < numPoints_; i++) {
-      nx[i] = x_[i];
-      ny[i] = y_[i];
-    }
-    free((char*)(x_));
-    free((char*)(y_));
-    x_ = nx;
-    y_ = ny;
-  }
-  x_[numPoints_] = x;
-  y_[numPoints_] = y;
-  numPoints_ += 1;
-}
-
-int defiGeometries::numPoints() const {
-  return numPoints_;
-}
-
-void defiGeometries::points(int index, int* x, int* y) const {
-  char msg[160];
-  if ((index < 0) || (index >= numPoints_)) {
-     sprintf (msg, "ERROR (LEFPARS-6070): The index number %d given for GEOMETRY POINTS is invalid.\nValid index is from 0 to %d", index, numPoints_);
-     defiError(0, 6070, msg, defData);
-     return;
-  }
-  *x = x_[index];
-  *y = y_[index];
-  return;
-}
-
-////////////////////////////////////////////////////
-//
-//    defiStyles
-//
-////////////////////////////////////////////////////
-
-defiStyles::defiStyles() {
-  Init();
-}
-
-void defiStyles::Init() {
-  styleNum_ = 0;
-  polygon_ = 0;
-}
-
-defiStyles::~defiStyles() {
-  Destroy();
-}
-
-void defiStyles::Destroy() {
- clear();
-}
-
-void defiStyles::clear() {
-  struct defiPoints* p;
-
-  p = polygon_;
-  if (p) {
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(polygon_));
-  }
-  styleNum_ = 0;
-  polygon_ = 0;
-}
-
-void defiStyles::setStyle(int styleNum) {
-  styleNum_ = styleNum;
-}
-
-void defiStyles::setPolygon(defiGeometries* geom) {
-  struct defiPoints* p;
-  int i, x, y;
-
-  if (polygon_ == 0) {
-    p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-    p->numPoints = geom->numPoints();
-    p->x = (int*)malloc(sizeof(int)*p->numPoints);
-    p->y = (int*)malloc(sizeof(int)*p->numPoints);
-    numPointAlloc_ = p->numPoints; // keep track the max number pts
-  } else if (numPointAlloc_ < geom->numPoints()) {
-    // the incoming polygon has more number then has been allocated,
-    // need to reallocate more memory
-    p = polygon_;
-    free((char*)(p->x));
-    free((char*)(p->y));
-    p->numPoints = geom->numPoints();
-    p->x = (int*)malloc(sizeof(int)*p->numPoints);
-    p->y = (int*)malloc(sizeof(int)*p->numPoints);
-    numPointAlloc_ = p->numPoints; // keep track the max number pts
-  } else {
-    p = polygon_;
-    p->numPoints = geom->numPoints();
-  }
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygon_ = p;
-}
-
-int defiStyles::style() const {
-  return styleNum_;
-}
-
-struct defiPoints defiStyles::getPolygon() const {
-  return *(polygon_);
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.hpp
deleted file mode 100644
index 4ffd7cf..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiMisc.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiMisc_h
-#define defiMisc_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-struct defiPoints {
-  int numPoints;
-  int* x;
-  int* y;
-};
-
-class defiGeometries {
-public:
-  defiGeometries(defrData *data);
-  void Init();
-  void Reset();
-
-  void Destroy();
-  ~defiGeometries();
-
-  void startList(int x, int y);
-  void addToList(int x, int y);
-
-  int  numPoints() const;
-  void points(int index, int* x, int* y) const;
-
-protected:
-  int numPoints_;
-  int pointsAllocated_;
-  int* x_;
-  int* y_;
-
-  defrData *defData;
-};
-
-class defiStyles {
-public:
-  defiStyles();
-  void Init();
-
-  void Destroy();
-  ~defiStyles();
-
-  void clear();
-
-  void setStyle(int styleNum);
-  void setPolygon(defiGeometries* geom);
-
-  int style() const;
-  struct defiPoints getPolygon() const;
-
-  protected:
-    int    styleNum_;
-    struct defiPoints* polygon_;
-    int    numPointAlloc_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.cpp
deleted file mode 100644
index 5c24f54..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.cpp
+++ /dev/null
@@ -1,3022 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: icftcm $
-//  $Revision: #4 $
-//  $Date: 2017/09/14 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "defiNet.hpp"
-#include "defiPath.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#define	maxLimit   65536
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiSubnet
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-defiSubnet::defiSubnet(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiSubnet::Init() {
-  name_ = 0;
-  bumpName(16);
-
-  instances_ = 0;
-  pins_ = 0;
-  musts_ = 0;
-  synthesized_ = 0;
-  numPins_ = 0;
-  bumpPins(16);
-
-  // WMD -- this will be removed by the next release
-  paths_ = 0;
-  numPaths_ = 0;
-  pathsAllocated_ = 0;
-
-  numWires_ = 0;
-  wiresAllocated_ = 0;
-  wires_ = 0;
-  nonDefaultRule_ = 0;
-
-  clear();
-}
-
-
-void defiSubnet::Destroy() {
-  clear();
-  free(name_);
-  free((char*)(instances_));
-  free((char*)(pins_));
-  free(musts_);
-  free(synthesized_);
-
-}
-
-
-defiSubnet::~defiSubnet() {
-  Destroy();
-}
-
-
-void defiSubnet::setName(const char* name) {
-  int len = strlen(name) + 1;
-  if (len > nameSize_) bumpName(len);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-
-void defiSubnet::setNonDefault(const char* name) {
-  int len = strlen(name) + 1;
-  nonDefaultRule_ = (char*)malloc(len);
-  strcpy(nonDefaultRule_, defData->DEFCASE(name));
-}
-
- 
-void defiSubnet::addMustPin(const char* instance, const char* pin, int syn) {
-  addPin(instance, pin, syn);
-  musts_[numPins_ - 1] = 1;
-}
-
-
-void defiSubnet::addPin(const char* instance, const char* pin, int syn) {
-  int len;
-
-  if (numPins_ == pinsAllocated_)
-    bumpPins(pinsAllocated_ * 2);
-
-  len = strlen(instance)+ 1;
-  instances_[numPins_] = (char*)malloc(len);
-  strcpy(instances_[numPins_], defData->DEFCASE(instance));
-
-  len = strlen(pin)+ 1;
-  pins_[numPins_] = (char*)malloc(len);
-  strcpy(pins_[numPins_], defData->DEFCASE(pin));
-
-  musts_[numPins_] = 0;
-  synthesized_[numPins_] = syn;
-
-  (numPins_)++;
-}
-
-// WMD -- this will be removed by the next release
-void defiSubnet::setType(const char* typ) {
-  if (*typ == 'F') {
-    isFixed_ = 1;
-  } else if (*typ == 'C') {
-    isCover_ = 1;
-  } else if (*typ == 'R') {
-    isRouted_ = 1;
-  } else {
-    // Silently do nothing with bad input.
-  }
- 
-}
- 
-// WMD -- this will be removed by the next release
-void defiSubnet::addPath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  int i;
-  size_t incNumber;
-
-  if (reset) {
-     for (i = 0; i < numPaths_; i++) {
-        delete paths_[i];
-     }  
-     numPaths_ = 0;
-  } 
-
-  if (numPaths_ >= pathsAllocated_) {
-    // 6/17/2003 - don't want to allocate too large memory just in case
-    // a net has many wires with only 1 or 2 paths
-    if (pathsAllocated_ <= maxLimit) {
-        incNumber = pathsAllocated_*2;
-        if (incNumber > maxLimit) {
-            incNumber = pathsAllocated_ + maxLimit;
-        }
-    } else {
-        incNumber = pathsAllocated_ + maxLimit;
-    }
-
-    switch (netOsnet) {
-      case 2: 
-         bumpPaths(
-            pathsAllocated_ ? incNumber : 1000);
-         break;
-      default:
-         bumpPaths(
-            pathsAllocated_ ? incNumber : 8);
-         break;
-     }
-  }
-  
-  paths_[numPaths_++] = new defiPath(p);
-  
-  if (numPaths_ == pathsAllocated_)
-    *needCbk = 1;   // pre-warn the parser it needs to realloc next time
-}
-
-
-void defiSubnet::addWire(const char* type) {
-  defiWire* wire;
-  if (numWires_ == wiresAllocated_) {
-    defiWire** array;
-    int i;
-    wiresAllocated_ = wiresAllocated_ ?
-                            wiresAllocated_ * 2 : 2 ;
-    array = (defiWire**)malloc(sizeof(defiWire*)*wiresAllocated_);
-    for (i = 0; i < numWires_; i++) {
-      array[i] = wires_[i];
-    }
-    if (wires_) 
-       free((char*)(wires_));
-    wires_ = array;
-  }
-  wire = wires_[numWires_] = new defiWire(defData);
-  numWires_ += 1;
-  wire->Init(type, NULL);
-}
-
-
-void defiSubnet::addWirePath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  if (numWires_ > 0)
-     wires_[numWires_-1]->addPath(p, reset, netOsnet,
-                                                        needCbk);
-  else
-     // Something screw up, can't be both be zero.
-     defiError(0, 6080, "ERROR (DEFPARS-6080): An internal error has occurred. The index number for the SUBNET wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", defData);
-}
-
-const char* defiSubnet::name() const {
-  return name_;
-}
-
-
-int defiSubnet::hasNonDefaultRule() const {
-  return nonDefaultRule_ ? 1 : 0;
-}
-
-
-const char* defiSubnet::nonDefaultRule() const {
-  return nonDefaultRule_;
-}
-
-
-int defiSubnet::numConnections() const {
-  return numPins_;
-}
-
-
-const char* defiSubnet::instance(int index) const {
-  if (index >= 0 && index < numPins_)
-    return instances_[index];
-  return 0;
-}
-
-
-const char* defiSubnet::pin(int index) const {
-  if (index >= 0 && index < numPins_)
-    return pins_[index];
-  return 0;
-}
-
-
-int defiSubnet::pinIsMustJoin(int index) const {
-  if (index >= 0 && index < numPins_)
-    return (int)(musts_[index]);
-  return 0;
-}
-
-
-int defiSubnet::pinIsSynthesized(int index) const {
-  if (index >= 0 && index < numPins_)
-    return (int)(synthesized_[index]);
-  return 0;
-}
-
-// WMD -- this will be removed by the next release
-int defiSubnet::isFixed() const {
-  return (int)(isFixed_);
-}
- 
- 
-// WMD -- this will be removed by the next release
-int defiSubnet::isRouted() const {
-  return (int)(isRouted_);
-}
- 
- 
-// WMD -- this will be removed by the next release
-int defiSubnet::isCover() const {
-  return (int)(isCover_);
-}
-
-
-void defiSubnet::bumpName(long long  size) {
-  if (name_) free(name_);
-  name_ = (char*)malloc(size);
-  nameSize_ = size;
-  name_[0] = '\0';
-}
-
-
-void defiSubnet::bumpPins(long long size) {
-  char** newInstances = (char**)malloc(sizeof(char*)*size);
-  char** newPins = (char**)malloc(sizeof(char*)*size);
-  char* newMusts = (char*)malloc(size);
-  char* newSyn = (char*)malloc(size);
-  long long i;
-
-  if (instances_) {
-    for (i = 0; i < pinsAllocated_; i++) {
-      newInstances[i] = instances_[i];
-      newPins[i] = pins_[i];
-      newMusts[i] = musts_[i];
-      newSyn[i] = synthesized_[i];
-    }
-    free((char*)(instances_));
-    free((char*)(pins_));
-    free(musts_);
-    free(synthesized_);
-  }
-
-  instances_ = newInstances;
-  pins_ = newPins;
-  musts_ = newMusts;
-  synthesized_ = newSyn;
-  pinsAllocated_ = size;
-}
-
-
-void defiSubnet::clear() {
-  int i;
-
-  // WMD -- this will be removed by the next release
-  isFixed_ = 0;
-  isRouted_ = 0;
-  isCover_ = 0;
-  name_[0] = '\0';
-
-  for (i = 0; i < numPins_; i++) {
-    free(instances_[i]);
-    free(pins_[i]);
-    instances_[i] = 0;
-    pins_[i] = 0;
-    musts_[i] = 0;
-    synthesized_[i] = 0;
-  }
-  numPins_ = 0;
-
-  // WMD -- this will be removed by the next release
-  if (paths_) {
-    for (i = 0; i < numPaths_; i++) {
-      delete paths_[i];
-    }
-    delete [] paths_;
-    paths_ = 0;
-    numPaths_ = 0;
-    pathsAllocated_ = 0;
-  }
-
-  if (nonDefaultRule_) {
-    free(nonDefaultRule_);
-    nonDefaultRule_ = 0;
-  }
-
-  if (numWires_) {
-    for (i = 0; i < numWires_; i++) {
-      delete wires_[i];
-      wires_[i] = 0;
-    }
-    free((char*)(wires_));
-    wires_ = 0;
-    numWires_ = 0;
-    wiresAllocated_ = 0;
-  }
-}
-
-
-void defiSubnet::print(FILE* f) const {
-  int i, j;
-  const defiPath* p;
-  const defiWire* w;
-
-  fprintf(f, " subnet '%s'", name_);
-  fprintf(f, "\n");
-
-  if (hasNonDefaultRule())
-    fprintf(f, "  nondefault rule %s\n",
-    nonDefaultRule());
-
-  if (numConnections()) {
-    fprintf(f, "  Pins:\n");
-    for (i = 0; i < numConnections(); i++) {
-    fprintf(f, "   '%s' '%s'%s%s\n", 
-      instance(i),
-      pin(i),
-      pinIsMustJoin(i) ? " MUSTJOIN" : "",
-      pinIsSynthesized(i) ? " SYNTHESIZED" : "");
-    }
-  }
-
-  if (numWires()) {
-    fprintf(f, "  Paths:\n");
-    for (i = 0; i < numWires(); i++) {
-      w = wire(i);
-      for (j = 0; j < w->numPaths(); j++) {
-         p = w->path(j);
-         p->print(f);
-      }
-    }
-  }
-}
-
-int defiSubnet::numWires() const {
-  return numWires_;
-}
- 
- 
-defiWire* defiSubnet::wire(int index) {
-  if (index >= 0 && index < numWires_)
-    return wires_[index];
-  return 0;
-}
-
-
-const defiWire* defiSubnet::wire(int index) const {
-    if (index >= 0 && index < numWires_)
-        return wires_[index];
-    return 0;
-}
-
-
-// WMD -- this will be removed after the next release
-defiPath* defiSubnet::path(int index) {
-  if (index >= 0 && index < numPaths_)
-    return paths_[index];
-  return 0;
-}
-
-// WMD -- this will be removed after the next release
-const defiPath* defiSubnet::path(int index) const {
-    if (index >= 0 && index < numPaths_)
-        return paths_[index];
-    return 0;
-}
- 
-// WMD -- this will be removed after the next release
-int defiSubnet::numPaths() const {
-  return numPaths_;
-}
- 
-// WMD -- this will be removed after the next release
-void defiSubnet::bumpPaths(long long size) {
-  long long i;
-  defiPath** newPaths = new defiPath*[size];
- 
-  for (i = 0; i < numPaths_; i++)
-    newPaths[i] = paths_[i];
- 
-  pathsAllocated_ = size;
-
-  delete [] paths_;
-  paths_ = newPaths;
-}
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiVpin
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-defiVpin::defiVpin(defrData *data)
- : defData(data)
-{
-}
-
-
-void defiVpin::Init(const char* name) {
-  int len = strlen(name) + 1;
-  name_ = (char*)malloc(len);
-  strcpy(name_, defData->DEFCASE(name));
-  orient_ = -1;
-  status_ = ' ';
-  layer_ = 0;
-}
-
-
-defiVpin::~defiVpin() {
-    Destroy();
-}
-
-
-void defiVpin::Destroy() {
-  free(name_);
-  if (layer_) free(layer_);
-}
-
-
-void defiVpin::setBounds(int xl, int yl, int xh, int yh) {
-  xl_ = xl;
-  yl_ = yl;
-  xh_ = xh;
-  yh_ = yh;
-}
-
-
-void defiVpin::setLayer(const char* lay) {
-  int len = strlen(lay)+1;
-  layer_ = (char*)malloc(len);
-  strcpy(layer_, lay);
-}
-
-
-void defiVpin::setOrient(int orient) {
-  orient_ = orient;
-}
-
-
-void defiVpin::setLoc(int x, int y) {
-  xLoc_ = x;
-  yLoc_ = y;
-}
-
-
-void defiVpin::setStatus(char st) {
-  status_ = st;
-}
-
-
-int defiVpin::xl() const  {
-  return xl_;
-}
-
-
-int defiVpin::yl() const  {
-  return yl_;
-}
-
-
-int defiVpin::xh() const  {
-  return xh_;
-}
-
-
-int defiVpin::yh() const  {
-  return yh_;
-}
-
-
-char defiVpin::status() const {
-  return status_;
-}
-
-
-int defiVpin::orient() const  {
-  return orient_;
-}
-
-
-const char* defiVpin::orientStr() const  {
-  return (defiOrientStr(orient_));
-}
-
-
-int defiVpin::xLoc() const {
-  return xLoc_;
-}
-
-
-int defiVpin::yLoc() const {
-  return yLoc_;
-}
-
-
-const char* defiVpin::name() const {
-  return name_;
-}
-
-
-const char* defiVpin::layer() const {
-  return layer_;
-}
-
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiShield
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-defiShield::defiShield(defrData *data)
- : defData(data)
-{
-}
-
-
-void defiShield::Init(const char* name) {
-  int len = strlen(name) + 1;
-  name_ = (char*)malloc(len);
-  strcpy(name_, defData->DEFCASE(name));
-  numPaths_ = 0;
-  pathsAllocated_ = 0;
-  paths_ = NULL;
-}
-
-
-void defiShield::Destroy() {
-  clear();
-}
-
-
-defiShield::~defiShield() {
-  Destroy();
-}
-
-
-void defiShield::addPath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  int i;
-  size_t incNumber;
-
-  if (reset) {
-     for (i = 0; i < numPaths_; i++) {
-        delete paths_[i];
-     }
-     numPaths_ = 0;
-  }
-  if (numPaths_ >= pathsAllocated_) {
-    // 6/17/2003 - don't want to allocate too large memory just in case
-    // a net has many wires with only 1 or 2 paths
-
-    if (pathsAllocated_ <= maxLimit) {
-        incNumber = pathsAllocated_*2;
-        if (incNumber > maxLimit) {
-            incNumber = pathsAllocated_ + maxLimit;
-        }
-    } else {
-        incNumber = pathsAllocated_ + maxLimit;
-    }
-
-    switch (netOsnet) {
-      case 2:
-        bumpPaths(
-            pathsAllocated_ ? incNumber : 1000);
-        break;
-      default:
-        bumpPaths(
-            pathsAllocated_ ? incNumber : 8);
-        break;
-    }
-  }
-  paths_[numPaths_++] = new defiPath(p);
-  if (numPaths_ == pathsAllocated_)
-    *needCbk = 1;   // pre-warn the parser it needs to realloc next time
-}
-
-
-void defiShield::clear() {
-  int       i;
-
-  if (name_) {
-    free(name_);
-    name_ = 0;
-  }
-
-  if (paths_) {
-    for (i = 0; i < numPaths_; i++) {
-      delete paths_[i];
-    }
-
-    delete [] paths_;
-
-    paths_ = 0;
-    numPaths_ = 0;
-    pathsAllocated_ = 0;
-  }
-}
-
-
-void defiShield::bumpPaths(long long size) {
-  long long i;
-
-  defiPath** newPaths = new defiPath*[size];
-
-  for (i = 0; i < numPaths_; i++)
-    newPaths[i] = paths_[i];
-
-  pathsAllocated_ = size;
-
-  delete [] paths_;
-  
-  paths_ = newPaths;
-}
-
-
-int defiShield::numPaths() const {
-  return numPaths_;
-}
-
-
-const char* defiShield::shieldName() const {
-  return name_;
-}
-
-defiPath* defiShield::path(int index) {
-  if (index >= 0 && index < numPaths_)
-    return paths_[index];
-  return 0;
-}
-
-const defiPath* defiShield::path(int index) const {
-    if (index >= 0 && index < numPaths_)
-        return paths_[index];
-    return 0;
-}
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiWire
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-defiWire::defiWire(defrData *data)
- : defData(data)
-{
-}
-
-
-void defiWire::Init(const char* type, const char* wireShieldName) {
-  int len = strlen(type) + 1;
-  type_ = (char*)malloc(len);
-  strcpy(type_, defData->DEFCASE(type));
-  if (wireShieldName) {
-    wireShieldName_ = (char*)malloc(strlen(wireShieldName)+1);
-    strcpy(wireShieldName_, wireShieldName);
-  } else
-    wireShieldName_ = 0; 
-  numPaths_ = 0;
-  pathsAllocated_ = 0;
-  paths_ = 0;
-}
-
-
-void defiWire::Destroy() {
-  clear();
-}
-
-
-defiWire::~defiWire() {
-  Destroy();
-}
-
-
-void defiWire::addPath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  int i;
-  size_t incNumber;
-
-  if (reset) {
-     for (i = 0; i < numPaths_; i++) {
-        delete paths_[i];
-     }
-     numPaths_ = 0;
-  }
-  if (numPaths_ >= pathsAllocated_) {
-    // 6/17/2003 - don't want to allocate too large memory just in case
-    // a net has many wires with only 1 or 2 paths
-
-    if (pathsAllocated_ <= maxLimit) {
-        incNumber = pathsAllocated_*2;
-        if (incNumber > maxLimit) {
-            incNumber = pathsAllocated_ + maxLimit;
-        }
-    } else {
-        incNumber = pathsAllocated_ + maxLimit;
-    }
-
-    switch (netOsnet) {
-      case 2:
-        bumpPaths(
-          pathsAllocated_  ? incNumber : 1000);
-        break;
-      default:
-        bumpPaths(
-          pathsAllocated_ ? incNumber : 8);
-        break;
-    }
-  }
-  
-  paths_[numPaths_++] = new defiPath(p);
-
-  if (numPaths_ == pathsAllocated_)
-    *needCbk = 1;   // pre-warn the parser it needs to realloc next time
-}
-
-
-void defiWire::clear() {
-  int       i;
-
-  if (type_) {
-    free(type_);
-    type_ = 0;
-  }
-
-  if (wireShieldName_) {
-      free(wireShieldName_);
-      wireShieldName_ = 0;
-  }
-
-  if (paths_) {
-    for (i = 0; i < numPaths_; i++) {
-      delete paths_[i];
-    }
-
-    delete [] paths_;
-    paths_ = 0;
-    numPaths_ = 0;
-    pathsAllocated_ = 0;
-  }
-}
-
-
-void defiWire::bumpPaths(long long size) {
-  long long i;
-  defiPath** newPaths =  new defiPath*[size]; 
-
-  for (i = 0; i < numPaths_; i++)
-    newPaths[i] = paths_[i];
-
-  pathsAllocated_ = size;
-  delete [] paths_;
-  paths_ = newPaths;
-}
-
-
-int defiWire::numPaths() const {
-  return numPaths_;
-}
-
-
-const char* defiWire::wireType() const {
-  return type_;
-}
-
-const char* defiWire::wireShieldNetName() const {
-  return wireShieldName_;
-}
-
-defiPath* defiWire::path(int index) {
-  if (index >= 0 && index < numPaths_)
-    return paths_[index];
-  return 0;
-}
-
-
-const defiPath* defiWire::path(int index) const {
-    if (index >= 0 && index < numPaths_)
-        return paths_[index];
-    return 0;
-}
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiNet
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-defiNet::defiNet(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiNet::Init() {
-  name_ = 0;
-  instances_ = 0;
-  numPins_ = 0;
-  numProps_ = 0;
-  propNames_ = 0;
-  subnets_ = 0;
-  source_ = 0;
-  pattern_ = 0;
-  style_ = 0;
-  shieldNet_ = 0;
-  original_ = 0;
-  use_ = 0;
-  nonDefaultRule_ = 0;
-  numWires_ = 0;
-  wiresAllocated_ = 0;
-  wires_= 0;
-
-  numWidths_ = 0;
-  widthsAllocated_ = 0;
-  wlayers_ = 0;
-  wdist_ = 0;
-
-  numSpacing_ = 0;
-  spacingAllocated_ = 0;
-  slayers_ = 0;
-  sdist_ = 0;
-  sleft_ = 0;
-  sright_ = 0;
-
-  vpins_ = 0;
-  numVpins_ = 0;
-  vpinsAllocated_ = 0;
-
-  shields_ = 0;
-  numShields_ = 0;
-  numNoShields_ = 0;
-  shieldsAllocated_ = 0;
-  numShieldNet_ = 0;
-  shieldNetsAllocated_ = 0;
-
-  bumpProps(2);
-  bumpName(16);
-  bumpPins(16);
-  bumpSubnets(2);
-
-  rectNames_ = 0;
-  rectRouteStatus_ = 0;
-  rectRouteStatusShieldNames_=0;
-  rectShapeTypes_ = 0;
-  rectMasks_ = 0;
-  polygonNames_ = 0;
-  polyRouteStatus_ = 0;
-  polyShapeTypes_ = 0;
-  polyRouteStatusShieldNames_ = 0;
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-  polygons_ = 0;
-  polyMasks_ = 0;
-
-  numSubnets_ = 0;
-  paths_ = 0;
-  numPaths_ = 0;
-
-  numPts_ = 0;
-  viaNames_ = 0;
-  viaPts_ = 0;
-  ptsAllocated_=0;
-  viaMasks_ = 0;
-  viaOrients_ = 0;
-  viaRouteStatus_ = 0;
-  viaShapeTypes_ = 0;
-  viaRouteStatusShieldNames_ = 0;
-
-  clear();
-}
-
-
-void defiNet::Destroy() {
-  clear();
-  free(name_);
-  free((char*)(instances_));
-  free((char*)(pins_));
-  free(musts_);
-  free(synthesized_);
-  free((char*)(propNames_));
-  free((char*)(propValues_));
-  free((char*)(propDValues_));
-  free((char*)(propTypes_));
-  free((char*)(subnets_));
-  if (source_) free(source_);
-  if (pattern_) free(pattern_);
-  if (shieldNet_) free(shieldNet_);
-  if (original_) free(original_);
-  if (use_) free(use_);
-  if (nonDefaultRule_) free(nonDefaultRule_);
-  if (wlayers_) free((char*)(wlayers_));
-  if (slayers_) free((char*)(slayers_));
-  if (sdist_) free((char*)(sdist_));
-  if (wdist_) free((char*)(wdist_));
-  if (sleft_) free((char*)(sleft_));
-  if (sright_) free((char*)(sright_));
-}
-
-
-defiNet::~defiNet() {
-  Destroy();
-}
-
-
-void defiNet::setName(const char* name) {
-  int len = strlen(name) + 1;
-  clear();
-  if (len > nameSize_) bumpName(len);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-
-void defiNet::addMustPin(const char* instance, const char* pin, int syn) {
-  clear();
-  addPin(instance, pin, syn);
-  musts_[numPins_ - 1] = 1;
-}
-
-
-void defiNet::addPin(const char* instance, const char* pin, int syn) {
-  int len;
-
-  if (numPins_ == pinsAllocated_)
-    bumpPins(pinsAllocated_ * 2);
-
-  len = strlen(instance)+ 1;
-  instances_[numPins_] = (char*)malloc(len);
-  strcpy(instances_[numPins_], defData->DEFCASE(instance));
-
-  len = strlen(pin)+ 1;
-  pins_[numPins_] = (char*)malloc(len);
-  strcpy(pins_[numPins_], defData->DEFCASE(pin));
-
-  musts_[numPins_] = 0;
-  synthesized_[numPins_] = syn;
-
-  (numPins_)++;
-}
-
-
-void defiNet::setWeight(int w) {
-  hasWeight_ = 1;
-  weight_ = w;
-}
-
-
-void defiNet::addProp(const char* name, const char* value, const char type) {
-  int len;
-
-  if (numProps_ == propsAllocated_)
-    bumpProps(propsAllocated_ * 2);
-
-  len = strlen(name)+ 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-
-  len = strlen(value)+ 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-
-  propDValues_[numProps_] = 0;
-  propTypes_[numProps_] = type;
-
-  (numProps_)++;
-}
-
-
-void defiNet::addNumProp(const char* name, const double d,
-                         const char* value, const char type) {
-  int len;
-
-  if (numProps_ == propsAllocated_)
-    bumpProps(propsAllocated_ * 2);
-
-  len = strlen(name)+ 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-
-  len = strlen(value)+ 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-
-  propDValues_[numProps_] = d;
-  propTypes_[numProps_] = type;
-
-  (numProps_)++;
-}
-
-
-void defiNet::addSubnet(defiSubnet* subnet) {
-
-  if (numSubnets_ >= subnetsAllocated_)
-    bumpSubnets(subnetsAllocated_ * 2);
-
-  subnets_[numSubnets_++] = subnet;
-}
-
-// WMD -- will be removed after the next release
-void defiNet::setType(const char* typ) {
-  if (*typ == 'F') {
-    isFixed_ = 1;
-  } else if (*typ == 'C') {
-    isCover_ = 1;
-  } else if (*typ == 'R') {
-    isRouted_ = 1;
-  } else {
-    // Silently do nothing with bad input.
-  }
-}
-
-void defiNet::addWire(const char* type, const char* wireShieldName) {
-  defiWire* wire;
-  if (numWires_ == wiresAllocated_) {
-    defiWire** array;
-    int i;
-    wiresAllocated_ = wiresAllocated_ ?
-                        wiresAllocated_ * 2 : 2 ;
-    array = (defiWire**)malloc(sizeof(defiWire*)*wiresAllocated_);
-    for (i = 0; i < numWires_; i++)
-      array[i] = wires_[i];
-    if (wires_) free((char*)(wires_));
-    wires_ = array;
-  }
-  wire = wires_[numWires_] = new defiWire(defData);
-  numWires_ += 1;
-  wire->Init(type, wireShieldName);
-}
-
-
-void defiNet::addWirePath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  if (numWires_ > 0)
-     wires_[numWires_-1]->addPath(p, reset, netOsnet,
-                                                        needCbk);
-  else
-     // Something screw up, can't be both be zero.
-     defiError(0, 6081, "ERROR (DEFPARS-6081): An internal error has occurred. The index number for the NET PATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", defData);
-}
-
-
-void defiNet::addShield(const char* name) {
-  defiShield* shield;
-  if (numShields_ == shieldsAllocated_) {
-    defiShield** array;
-    int i;
-    shieldsAllocated_ = shieldsAllocated_ ?
-                          shieldsAllocated_ * 2 : 2 ;
-    array = (defiShield**)malloc(sizeof(defiShield*)*shieldsAllocated_);
-    for (i = 0; i < numShields_; i++)
-      array[i] = shields_[i];
-    if (shields_) free((char*)(shields_));
-    shields_ = array;
-  }
-  shield = shields_[numShields_] = new defiShield(defData);
-  numShields_ += 1;
-  shield->Init(name);
-}
-
-
-void defiNet::addShieldPath(defiPath* p, int reset, int netOsnet, int *needCbk) {
-  // Since shield and noshield share the list shields_, the
-  // only way to tell whether the list is currently contained
-  // data for shields_ or noshields_ is from the variables
-  // numShields_ and numNoShields_.
-  // Since shield and noshield are mutual exclusive, only one
-  // numShields_ or numNoShields will be non-zero
-  // in this method.  Whichever is non-zero will be the current
-  // working list
-  if (numShields_ > 0)
-     shields_[numShields_-1]->addPath(p, reset,
-              netOsnet, needCbk);
-  else if (numNoShields_ > 0)
-     shields_[numNoShields_-1]->addPath(p, reset,
-              netOsnet, needCbk);
-  else
-     // Something screw up, can't be both be zero.
-     defiError(0, 6082, "ERROR (DEFPARS-6082): An internal error has occurred. The index number for the NET SHIELDPATH wires array is less then or equal to 0.\nContact Cadence Customer Support with this error information.", defData);
-}
-
-
-void defiNet::addNoShield(const char* name) {
-  defiShield* shield;
-  if (numNoShields_ == shieldsAllocated_) {
-    defiShield** array;
-    int i;
-    shieldsAllocated_ = shieldsAllocated_ ?
-                          shieldsAllocated_ * 2 : 2 ;
-    array = (defiShield**)malloc(sizeof(defiShield*)*shieldsAllocated_);
-    for (i = 0; i < numNoShields_; i++)
-      array[i] = shields_[i];
-    if (shields_) free((char*)(shields_));
-    shields_ = array;
-  }
-  shield = shields_[numNoShields_] =  new defiShield(defData);
-  numNoShields_ += 1;
-  shield->Init(name);
-}
-
-
-void defiNet::addShieldNet(const char* name) {
-  int len;
-
-  if (numShieldNet_ == shieldNetsAllocated_) {
-     if (shieldNetsAllocated_ == 0)
-        bumpShieldNets(2);
-     else
-        bumpShieldNets(shieldNetsAllocated_ * 2);
-
-  }
- 
-  len = strlen(name) + 1;
-  shieldNet_[numShieldNet_] = (char*)malloc(len);
-  strcpy(shieldNet_[numShieldNet_], defData->DEFCASE(name));
-  (numShieldNet_)++;
-}
-
-
-void defiNet::changeNetName(const char* name) {
-  int len = strlen(name) + 1;
-  if (len > nameSize_) bumpName(len);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-void defiNet::changeInstance(const char* instance, int index) {
-  int len;
-  char errMsg[128];
-
-  if ((index < 0) || (index > numPins_)) {
-     sprintf (errMsg, "ERROR (DEFPARS-6083): The index number %d specified for the NET INSTANCE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPins_);
-     defiError(0, 6083, errMsg, defData);
-  }
-
-  len = strlen(instance)+ 1;
-  if (instances_[index])
-    free((char*)(instances_[index]));
-  instances_[index] = (char*)malloc(len);
-  strcpy(instances_[index], defData->DEFCASE(instance));
-  return;
-}
-
-void defiNet::changePin(const char* pin, int index) {
-  int len;
-  char errMsg[128];
-
-  if ((index < 0) || (index > numPins_)) {
-     sprintf (errMsg, "ERROR (DEFPARS-6084): The index number %d specified for the NET PIN is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPins_);
-     defiError(0, 6084, errMsg, defData);
-  }
-
-  len = strlen(pin)+ 1;
-  if (pins_[index])
-    free((char*)(pins_[index]));
-  pins_[index] = (char*)malloc(len);
-  strcpy(pins_[index], defData->DEFCASE(pin));
-  return;
-}
-
-const char* defiNet::name() const {
-  return name_;
-}
-
-
-int defiNet::weight() const {
-  return weight_;
-}
-
-
-int defiNet::numProps() const {
-  return numProps_;
-}
-
-
-int defiNet::hasProps() const {
-  return numProps_ ? 1 : 0 ;
-}
-
-
-int defiNet::hasWeight() const {
-  return (int)(hasWeight_);
-}
-
-
-const char* defiNet::propName(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propNames_[index];
-  return 0;
-}
-
-
-const char* defiNet::propValue(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propValues_[index];
-  return 0;
-}
-
-
-double defiNet::propNumber(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propDValues_[index];
-  return 0;
-}
-
-
-const char defiNet::propType(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propTypes_[index];
-  return 0;
-}
-
-
-int defiNet::propIsNumber(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propDValues_[index] ? 1 : 0;
-  return 0; 
-}
-
-
-int defiNet::propIsString(int index) const {
-  if (index >= 0 &&  index < numProps_)
-    return propDValues_[index] ? 0 : 1;
-  return 0; 
-}
-
-
-int defiNet::numConnections() const {
-  return numPins_;
-}
-
-
-int defiNet::numShieldNets() const {
-  return numShieldNet_;
-}
-
-
-const char* defiNet::instance(int index) const {
-  if (index >= 0 &&  index < numPins_)
-    return instances_[index];
-  return 0;
-}
-
-
-const char* defiNet::pin(int index) const {
-  if (index >= 0 &&  index < numPins_)
-    return pins_[index];
-  return 0;
-}
-
-
-int defiNet::pinIsMustJoin(int index) const {
-  if (index >= 0 &&  index < numPins_)
-    return (int)(musts_[index]);
-  return 0;
-}
-
-
-int defiNet::pinIsSynthesized(int index) const {
-  if (index >= 0 &&  index < numPins_)
-    return (int)(synthesized_[index]);
-  return 0;
-}
-
-
-int defiNet::hasSubnets() const {
-  return numSubnets_ ? 1 : 0 ;
-}
-
-
-int defiNet::numSubnets() const {
-  return numSubnets_;
-}
-
-
-defiSubnet* defiNet::subnet(int index) {
-  if (index >= 0 &&  index < numSubnets_)
-    return subnets_[index];
-  return 0;
-}
-
-
-const defiSubnet* defiNet::subnet(int index) const {
-    if (index >= 0 &&  index < numSubnets_)
-        return subnets_[index];
-    return 0;
-}
-
-
-int defiNet::isFixed() const {
-  return (int)(isFixed_);
-}
- 
- 
-int defiNet::isRouted() const {
-  return (int)(isRouted_);
-}
- 
- 
-int defiNet::isCover() const {
-  return (int)(isCover_);
-}
- 
-
-// this method will only call if the callback defrSNetWireCbk is set
-// which will callback every wire.  Therefore, only one wire should be here
-void defiNet::freeWire() {
-  int i;
-
-  if (numWires_) {
-    for (i = 0; i < numWires_; i++) {
-      wires_[i]->Destroy();
-      delete wires_[i];
-      wires_[i] = 0;
-    }
-    free((char*)(wires_));
-    wires_ = 0;
-    numWires_ = 0;
-    wiresAllocated_ = 0;
-  }
-
-  clearRectPoly();
-  clearVia();
-}
-
-
-void defiNet::freeShield() {
-  int i;
-
-  if (numShields_) {
-    for (i = 0; i < numShields_; i++) {
-      shields_[i]->Destroy();
-      free((char*)(shields_[i]));
-      shields_[i] = 0;
-    }
-    numShields_ = 0;
-    shieldsAllocated_ = 0;
-  }
-}
-
-
-void defiNet::print(FILE* f) const {
-  int i, j, x, y, newLayer;
-  int numX, numY, stepX, stepY;
-  const defiPath* p;
-  const defiSubnet* s;
-  const defiVpin* vp;
-  const defiWire* w;
-  int path;
-
-  fprintf(f, "Net '%s'", name_);
-  fprintf(f, "\n");
-
-  if (hasWeight())
-    fprintf(f, "  weight=%d\n", weight());
-
-  if (hasFixedbump())
-    fprintf(f, "  fixedbump\n");
-
-  if (hasFrequency())
-    fprintf(f, "  frequency=%f\n", frequency());
-
-  if (hasCap())
-    fprintf(f, "  cap=%f\n", cap());
-
-  if (hasSource())
-    fprintf(f, "  source='%s'\n", source());
-
-  if (hasPattern())
-    fprintf(f, "  pattern='%s'\n", pattern());
-
-  if (hasOriginal())
-    fprintf(f, "  original='%s'\n", original());
-
-  if (hasUse())
-    fprintf(f, "  use='%s'\n", use());
-
-  if (hasNonDefaultRule())
-    fprintf(f, "  nonDefaultRule='%s'\n", nonDefaultRule());
-
-  if (hasXTalk())
-    fprintf(f, "  xtalk=%d\n", XTalk());
-
-  if (hasStyle())
-    fprintf(f, "  style='%d'\n", style());
-
-  if (hasProps()) {
-    fprintf(f, " Props:\n");
-    for (i = 0; i < numProps(); i++) {
-      fprintf(f, "  '%s' '%s'\n", propName(i),
-      propValue(i));
-    }
-  }
-
-  if (numConnections()) {
-    fprintf(f, " Pins:\n");
-    for (i = 0; i < numConnections(); i++) {
-    fprintf(f, "  '%s' '%s'%s%s\n", 
-      instance(i),
-      pin(i),
-      pinIsMustJoin(i) ? " MUSTJOIN" : "",
-      pinIsSynthesized(i) ? " SYNTHESIZED" : "");
-    }
-  }
- 
-  for (i = 0; i < numVpins_; i++) {
-    vp = vpin(i);
-    fprintf(f,
-    "  VPIN %s status '%c' layer %s %d,%d orient %s bounds %d,%d to %d,%d\n",
-    vp->name(),
-    vp->status(),
-    vp->layer() ? vp->layer() : "",
-    vp->xLoc(),
-    vp->yLoc(),
-    vp->orientStr(),
-    vp->xl(),
-    vp->yl(),
-    vp->xh(),
-    vp->yh());
-  }
-
-  for (i = 0; i < numWires_; i++) {
-    newLayer = 0;
-    w = wire(i);
-    fprintf(f, "+ %s ", w->wireType());
-    for (j = 0; j < w->numPaths(); j++) {
-      p = w->path(j);
-      p->initTraverse();
-      while ((path = (int)(p->next())) != DEFIPATH_DONE) {
-         switch (path) {
-           case DEFIPATH_LAYER:
-                if (newLayer == 0) {
-                    fprintf(f, "%s ", p->getLayer());
-                    newLayer = 1;
-                } else
-                    fprintf(f, "NEW %s ", p->getLayer());
-                break;
-           case DEFIPATH_VIA:
-                fprintf(f, "%s\n", p->getVia());
-                break;
-           case DEFIPATH_VIAROTATION:
-                fprintf(f, "%d\n", p->getViaRotation());
-                break;
-           case DEFIPATH_VIADATA:
-                p->getViaData(&numX, &numY, &stepX, &stepY);
-                fprintf(f, "%d %d %d %d\n", numX, numY, stepX, stepY);
-                break;
-           case DEFIPATH_WIDTH:
-                fprintf(f, "%d\n", p->getWidth());
-                break;
-           case DEFIPATH_POINT:
-                p->getPoint(&x, &y);
-                fprintf(f, "( %d %d )\n", x, y);
-                break;
-           case DEFIPATH_TAPER:
-                fprintf(f, "TAPER\n");
-                break;
-         }
-      }
-    }
-  }
-
-  if (hasSubnets()) {
-    fprintf(f, " Subnets:\n");
-    for (i = 0; i < numSubnets(); i++) {
-      s = subnet(i);
-      s->print(f);
-    }
-  }
-
-}
-
-
-void defiNet::bumpName(long long size) {
-  if (name_) free(name_);
-  name_ = (char*)malloc(size);
-  nameSize_ = size;
-  name_[0] = '\0';
-}
-
-
-void defiNet::bumpPins(long long size) {
-  char** newInstances = (char**)malloc(sizeof(char*)*size);
-  char** newPins = (char**)malloc(sizeof(char*)*size);
-  char* newMusts = (char*)malloc(size);
-  char* newSyn = (char*)malloc(size);
-  long long i;
-
-  if (instances_) {
-    for (i = 0; i < pinsAllocated_; i++) {
-      newInstances[i] = instances_[i];
-      newPins[i] = pins_[i];
-      newMusts[i] = musts_[i];
-      newSyn[i] = synthesized_[i];
-    }
-    free((char*)(instances_));
-    free((char*)(pins_));
-    free(musts_);
-    free(synthesized_);
-  }
-
-  instances_ = newInstances;
-  pins_ = newPins;
-  musts_ = newMusts;
-  synthesized_ = newSyn;
-  pinsAllocated_ = size;
-}
-
-
-void defiNet::bumpProps(long long size) {
-  char**  newNames = (char**)malloc(sizeof(char*)*size);
-  char**  newValues = (char**)malloc(sizeof(char*)*size);
-  double* newDValues = (double*)malloc(sizeof(double)*size);
-  char*   newTypes = (char*)malloc(sizeof(char)*size);
-  long long i;
-
-  if (propNames_) {
-    for (i = 0; i < numProps_; i++) {
-      newNames[i] = propNames_[i];
-      newValues[i] = propValues_[i];
-      newDValues[i] = propDValues_[i];
-      newTypes[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-  }
-
-  propNames_ = newNames;
-  propValues_ = newValues;
-  propDValues_ = newDValues;
-  propTypes_ = newTypes;
-  propsAllocated_ = size;
-}
-
-
-void defiNet::bumpSubnets(long long size) {
-  defiSubnet** newSubnets = (defiSubnet**)malloc(sizeof(defiSubnet*)*size);
-  int i;
-  if (subnets_) {
-    for (i = 0; i < numSubnets_; i++) {
-      newSubnets[i] = subnets_[i];
-    }
-    free((char*)(subnets_));
-  }
-
-  subnets_ = newSubnets;
-  subnetsAllocated_ = size;
-}
-
-
-void defiNet::clear() {
-  int i;
-
-  // WMD -- this will be removed by the next release
-  isFixed_ = 0;
-  isRouted_ = 0;
-  isCover_ = 0;
-
-  hasWeight_ = 0;
-  hasCap_ = 0;
-  hasFrequency_ = 0;
-  hasVoltage_ = 0;
-  xTalk_ = -1;
-
-  if (vpins_) {
-    for (i = 0; i < numVpins_; i++) {
-      delete vpins_[i];
-    }
-    free((char*)vpins_);
-    vpins_  = 0;
-    numVpins_ = 0;
-    vpinsAllocated_ = 0;
-  }
-
-  for (i = 0; i < numProps_; i++) {
-    free(propNames_[i]);
-    free(propValues_[i]);
-    propNames_[i] = 0;
-    propValues_[i] = 0;
-    propDValues_[i] = 0;
-  }
-  numProps_ = 0;
-
-  for (i = 0; i < numPins_; i++) {
-    free(instances_[i]);
-    free(pins_[i]);
-    instances_[i] = 0;
-    pins_[i] = 0;
-    musts_[i] = 0;
-    synthesized_[i] = 0;
-  }
-  numPins_ = 0;
-
-  for (i = 0; i < numSubnets_; i++) {
-    delete subnets_[i];
-    subnets_[i] = 0;
-  }
-  numSubnets_ = 0;
-
-  if (name_)
-     name_[0] = '\0';
-
-  // WMD -- this will be removed by the next release
-  if (paths_) {
-    for (i = 0; i < numPaths_; i++) {
-      delete paths_[i];
-    }
-
-    delete [] paths_;
-    paths_ = 0;
-    numPaths_ = 0;
-    pathsAllocated_ = 0;
-  }
-
-  // 5.4.1
-  fixedbump_ = 0;
-
-  if (source_) { free(source_); source_ = 0; }
-  if (pattern_) { free(pattern_); pattern_ = 0; }
-  if (original_) { free(original_); original_ = 0; }
-  if (use_) { free(use_); use_ = 0; }
-  if (nonDefaultRule_) { free(nonDefaultRule_);
-            nonDefaultRule_ = 0; }
-  style_ = 0;
- 
-  if (numWires_) {
-    for (i = 0; i < numWires_; i++) {
-      delete wires_[i];
-      wires_[i] = 0;
-    }
-    free((char*)(wires_));
-    wires_ = 0;
-    numWires_ = 0;
-    wiresAllocated_ = 0;
-  }
-
-  if (numShields_) {
-    for (i = 0; i < numShields_; i++) {
-      delete shields_[i];
-      shields_[i] = 0;
-    }
-    numShields_ = 0;
-    shieldsAllocated_ = 0;
-  }
-
-  if (numNoShields_) {
-    for (i = 0; i < numNoShields_; i++) {
-      delete shields_[i];
-      shields_[i] = 0;
-    }
-    numNoShields_ = 0;
-    shieldsAllocated_ = 0;
-  }
-  if (shields_)
-    free((char*)(shields_));
-
-  shields_ = 0;
-
-  if (numWidths_) {
-   for (i = 0; i < numWidths_; i++)
-     free(wlayers_[i]);
-  numWidths_ = 0;
-  }
-
-  if (numSpacing_) {
-   for (i = 0; i < numSpacing_; i++)
-     free(slayers_[i]);
-  numSpacing_ = 0;
-  }
-
-  if (numShieldNet_) {
-   for (i = 0; i < numShieldNet_; i++)
-     free(shieldNet_[i]);
-   numShieldNet_ = 0;
-  }
-
-  if (polygonNames_) {
-    struct defiPoints* p;
-    for (i = 0; i < numPolys_; i++) {
-      if (polygonNames_[i]){
-      free((char*)(polygonNames_[i]));
-      }
-      if (polyRouteStatus_[i]) {
-      free((char*)(polyRouteStatus_[i]));
-      }
-      if (polyShapeTypes_[i]) {
-      free((char*)(polyShapeTypes_[i]));
-      }
-      if (polyRouteStatusShieldNames_[i]) {
-          free((char*)(polyRouteStatusShieldNames_[i]));
-      }
-      p = polygons_[i];
-      free((char*)(p->x));
-      free((char*)(p->y));
-      free((char*)(polygons_[i]));
-    }
-    free((char*)(polygonNames_));
-    free((char*)(polygons_));
-    free((char*)(polyMasks_));
-    free((char*)(polyRouteStatus_));
-    free((char*)(polyShapeTypes_));
-    free((char*)(polyRouteStatusShieldNames_));
-    polygonNames_ = 0;
-    polygons_ = 0;
-    polyMasks_ = 0;
-    polyRouteStatus_ = 0;
-    polyShapeTypes_ = 0;
-    polyRouteStatusShieldNames_ = 0;
-  }
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-
-  if (rectNames_) {
-    for (i = 0; i < numRects_; i++) {
-      if (rectNames_[i]) { 
-      free ((char*)(rectNames_[i]));
-      }
-      if (rectRouteStatus_[i]) { 
-      free ((char*)(rectRouteStatus_[i]));
-      }
-      if (rectRouteStatusShieldNames_[i]) {
-          free ((char*)(rectRouteStatusShieldNames_[i]));
-      }
-      if (rectShapeTypes_[i]) { 
-      free ((char*)(rectShapeTypes_[i]));
-      }
-    }
-    free((char*)(rectNames_));
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    free((char*)(rectMasks_));
-    free((char*)(rectRouteStatus_));
-    free((char*)(rectRouteStatusShieldNames_));
-    free((char*)(rectShapeTypes_));
-  }
-  rectNames_ = 0;
-  rectRouteStatus_ = 0;
-  rectShapeTypes_ = 0;
-  rectRouteStatusShieldNames_ = 0;
-  numRects_ = 0;
-  rectsAllocated_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  rectMasks_ = 0;
-
-  if (viaNames_) {
-      struct defiPoints* p;
-
-      for (i = 0; i < numPts_; i++) {
-          p = viaPts_[i];
-          free((char*)(p->x));
-          free((char*)(p->y));
-          free((char*)(viaPts_[i]));
-      if (viaNames_[i]) {
-          free ((char*)(viaNames_[i]));
-      }
-      if (viaRouteStatus_[i]) {
-          free ((char*)(viaRouteStatus_[i]));
-      }
-      if (viaShapeTypes_[i]) {
-          free ((char*)(viaShapeTypes_[i]));
-      }
-          if (viaRouteStatusShieldNames_[i]) {
-              free ((char*)(viaRouteStatusShieldNames_[i]));
-          }
-      }
-      free((char*)(viaNames_));
-      free((char*)(viaPts_));
-      free((char*)(viaMasks_));
-      free((char*)(viaOrients_));
-      free((char*)(viaRouteStatus_));
-      free((char*)(viaShapeTypes_));
-      free((char*)(viaRouteStatusShieldNames_));
-      viaNames_ = 0;
-      viaPts_ = 0;
-      viaRouteStatus_ = 0;
-      viaShapeTypes_ = 0;
-      viaRouteStatusShieldNames_ = 0 ;
-  }
-  numPts_ = 0;
-  ptsAllocated_ = 0;
-  viaOrients_ = 0;
-  viaMasks_ = 0;
-}
-
-void defiNet::clearRectPolyNPath() {
-  int i;
-
-  if (paths_) {
-    for (i = 0; i < numPaths_; i++) {
-      delete paths_[i];
-    }
-    numPaths_ = 0;
-  }
-
-  clearRectPoly();
-
-}
-
-void defiNet::clearRectPoly() {
-  int i;
-
-  if (polygonNames_) {
-    struct defiPoints* p;
-    for (i = 0; i < numPolys_; i++) {
-      if (polygonNames_[i]){
-      free((char*)(polygonNames_[i]));
-      }
-      if (polyRouteStatus_[i]) {
-      free((char*)(polyRouteStatus_[i]));
-      }
-      if (polyShapeTypes_[i]) {
-      free((char*)(polyShapeTypes_[i]));
-      }
-      if (polyRouteStatusShieldNames_[i]) {
-          free((char*)(polyRouteStatusShieldNames_[i]));
-      }
-      p = polygons_[i];
-      free((char*)(p->x));
-      free((char*)(p->y));
-      free((char*)(polygons_[i]));
-    }
-    free((char*)(polyMasks_));
-    free((char*)(polygonNames_));
-    free((char*)(polygons_));
-    free((char*)(polyRouteStatus_));
-    free((char*)(polyShapeTypes_));
-    free((char*)(polyRouteStatusShieldNames_));
-  }
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-  polyMasks_ = 0;
-  polygonNames_ = 0;
-  polyRouteStatus_= 0;
-  polyShapeTypes_= 0;
-  polyRouteStatusShieldNames_ = 0;
-  polygons_ = 0;
-
-  if (rectNames_) {
-    for (i = 0; i < numRects_; i++) {
-      if (rectNames_[i]){
-      free((char*)(rectNames_[i]));
-      }
-      if (rectRouteStatus_[i]){
-      free((char*)(rectRouteStatus_[i]));
-      }
-      if (rectShapeTypes_[i]) {
-      free((char*)(rectShapeTypes_[i]));
-      }
-      if (rectRouteStatusShieldNames_[i]) {
-          free((char*)(rectRouteStatusShieldNames_[i]));
-      }
-    }
-    free((char*)(rectMasks_));
-    free((char*)(rectNames_));
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    free((char*)(rectShapeTypes_));
-    free((char*)(rectRouteStatus_));
-    free((char*)(rectRouteStatusShieldNames_));
-  }
-  rectNames_ = 0;
-  rectsAllocated_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  numRects_ = 0;
-  rectMasks_ = 0;
-  rectRouteStatus_ = 0;
-  rectShapeTypes_ = 0;
-  rectRouteStatusShieldNames_=0;
-}
-
-int defiNet::hasSource() const {
-   return source_ ? 1 : 0;
-}
-
-
-int defiNet::hasFixedbump() const {
-   return fixedbump_ ? 1 : 0;
-}
-
-
-int defiNet::hasFrequency() const {
-  return (int)(hasFrequency_);
-}
-
-
-int defiNet::hasPattern() const {
-   return pattern_ ? 1 : 0;
-}
-
-
-int defiNet::hasOriginal() const {
-   return original_ ? 1 : 0;
-}
-
-
-int defiNet::hasCap() const {
-  return (int)(hasCap_);
-}
-
-
-int defiNet::hasUse() const {
-   return use_ ? 1 : 0;
-}
-
-
-int defiNet::hasStyle() const {
-   return style_ ? 1 : 0;
-}
-
-
-int defiNet::hasXTalk() const {
-   return (xTalk_ != -1) ? 1 : 0;
-}
-
-
-int defiNet::hasNonDefaultRule() const {
-   return nonDefaultRule_ ? 1 : 0;
-}
-
-
-void defiNet::setSource(const char* typ) {
-  int len;
-  if (source_) free(source_);
-  len = strlen(typ) + 1;
-  source_ = (char*)malloc(len);
-  strcpy(source_, defData->DEFCASE(typ));
-}
-
-
-void defiNet::setFixedbump() {
-  fixedbump_ = 1;
-}
-
-
-void defiNet::setFrequency(double frequency) {
-  frequency_ = frequency;
-  hasFrequency_ = 1;
-}
-
-
-void defiNet::setOriginal(const char* typ) {
-  int len;
-  if (original_) free(original_);
-  len = strlen(typ) + 1;
-  original_ = (char*)malloc(len);
-  strcpy(original_, defData->DEFCASE(typ));
-}
-
-
-void defiNet::setPattern(const char* typ) {
-  int len;
-  if (pattern_) free(pattern_);
-  len = strlen(typ) + 1;
-  pattern_ = (char*)malloc(len);
-  strcpy(pattern_, defData->DEFCASE(typ));
-}
-
-
-void defiNet::setCap(double w) {
-  cap_ = w;
-  hasCap_ = 1;
-}
-
-
-void defiNet::setUse(const char* typ) {
-  int len;
-  if (use_) free(use_);
-  len = strlen(typ) + 1;
-  use_ = (char*)malloc(len);
-  strcpy(use_, defData->DEFCASE(typ));
-}
-
-
-void defiNet::setStyle(int style) {
-  style_ = style;
-}
-
-
-void defiNet::setNonDefaultRule(const char* typ) {
-  int len;
-  if (nonDefaultRule_) free(nonDefaultRule_);
-  len = strlen(typ) + 1;
-  nonDefaultRule_ = (char*)malloc(len);
-  strcpy(nonDefaultRule_, defData->DEFCASE(typ));
-}
-
-
-const char* defiNet::source() const {
-  return source_;
-}
-
-
-const char* defiNet::original() const {
-  return original_;
-}
-
-
-const char* defiNet::pattern() const {
-  return pattern_;
-}
-
-
-double defiNet::cap() const {
-  return (hasCap_ ? cap_ : 0.0);
-}
-
-
-double defiNet::frequency() const {
-  return (hasFrequency_ ? frequency_ : 0.0);
-}
-
-
-const char* defiNet::use() const {
-  return use_;
-}
-
-
-int defiNet::style() const {
-  return style_;
-}
-
-
-const char* defiNet::shieldNet(int index) const {
-  return shieldNet_[index];
-}
-
-
-const char* defiNet::nonDefaultRule() const {
-  return nonDefaultRule_;
-}
-
-// WMD -- this will be removed by the next release
-void defiNet::bumpPaths(long long size) {
-  long long i;
-
-  defiPath** newPaths = new defiPath*[size];
- 
-  for (i = 0; i < numPaths_; i++)
-    newPaths[i] = paths_[i];
- 
-  delete [] paths_;
-  pathsAllocated_ = size;
-  paths_ = newPaths;
-}
- 
-// WMD -- this will be removed by the next release
-int defiNet::numPaths() const {
-  return numPaths_;
-}
-
- 
-// WMD -- this will be removed by the next release
-defiPath* defiNet::path(int index) {
-  if (index >= 0 && index < numPaths_)
-    return paths_[index];
-  return 0;
-}
-
-
-const defiPath* defiNet::path(int index) const {
-    if (index >= 0 && index < numPaths_)
-        return paths_[index];
-    return 0;
-}
-
-
-int defiNet::numWires() const {
-  return numWires_;
-}
-
-
-defiWire* defiNet::wire(int index) {
-  if (index >= 0 && index < numWires_)
-    return wires_[index];
-  return 0;
-}
-
-
-const defiWire* defiNet::wire(int index) const {
-    if (index >= 0 && index < numWires_)
-        return wires_[index];
-    return 0;
-}
-
-
-void defiNet::bumpShieldNets(long long size) {
-  char** newShieldNets = (char**)malloc(sizeof(char*)*size);
-  long long i;
- 
-  if (shieldNet_) {
-    for (i = 0; i < shieldNetsAllocated_; i++) {
-      newShieldNets[i] = shieldNet_[i];
-    }
-    free((char*)(shieldNet_));
-  }
- 
-  shieldNet_ = newShieldNets;
-  shieldNetsAllocated_ = size;
-}
-
-
-int defiNet::numShields() const {
-  return numShields_;
-}
-
-
-defiShield* defiNet::shield(int index) {
-  if (index >= 0 && index < numShields_)
-    return shields_[index];
-  return 0;
-}
-
-
-const defiShield* defiNet::shield(int index) const {
-    if (index >= 0 && index < numShields_)
-        return shields_[index];
-    return 0;
-}
-
-int defiNet::numNoShields() const {
-  return numNoShields_;
-}
-
-
-defiShield* defiNet::noShield(int index) {
-  if (index >= 0 && index < numNoShields_)
-    return shields_[index];
-  return 0;
-}
-
-const defiShield* defiNet::noShield(int index) const {
-    if (index >= 0 && index < numNoShields_)
-        return shields_[index];
-    return 0;
-}
-
-int defiNet::hasVoltage() const {
-  return (int)(hasVoltage_);
-}
-
-
-double defiNet::voltage() const {
-  return voltage_;
-}
-
-
-int defiNet::numWidthRules() const {
-  return numWidths_;
-}
-
-
-int defiNet::numSpacingRules() const {
-  return numSpacing_;
-}
-
-
-int defiNet::hasWidthRules() const {
-  return numWidths_;
-}
-
-
-int defiNet::hasSpacingRules() const {
-  return numSpacing_;
-}
-
-
-void defiNet::setXTalk(int i) {
-  xTalk_ = i;
-}
-
-
-int defiNet::XTalk() const {
-  return xTalk_;
-}
-
-
-void defiNet::addVpin(const char* name) {
-  defiVpin* vp;
-  if (numVpins_ == vpinsAllocated_) {
-    defiVpin** array;
-    int i;
-    vpinsAllocated_ = vpinsAllocated_ ?
-          vpinsAllocated_ * 2 : 2 ;
-    array = (defiVpin**)malloc(sizeof(defiVpin*)*vpinsAllocated_);
-    for (i = 0; i < numVpins_; i++)
-      array[i] = vpins_[i];
-    if (vpins_) free((char*)(vpins_));
-    vpins_ = array;
-  }
-  vp = vpins_[numVpins_] =  new defiVpin(defData);
-  numVpins_ += 1;
-  vp->Init(name);
-}
-
-
-void defiNet::addVpinLayer(const char* name) {
-  defiVpin* vp = vpins_[numVpins_-1];
-  vp->setLayer(name);
-}
-
-
-void defiNet::addVpinLoc(const char* status, int x, int y, int orient) {
-  defiVpin* vp = vpins_[numVpins_-1];
-  vp->setStatus(*status);
-  vp->setLoc(x,y);
-  vp->setOrient(orient);
-}
-
-
-void defiNet::addVpinBounds(int xl, int yl, int xh, int yh) {
-  defiVpin* vp = vpins_[numVpins_-1];
-  vp->setBounds(xl, yl, xh, yh);
-}
-
-
-int defiNet::numVpins() const {
-  return numVpins_;
-}
-
-
-defiVpin* defiNet::vpin(int index) {
-  if (index < 0 || index >= numVpins_) return 0;
-  return vpins_[index];
-}
-
-
-const defiVpin* defiNet::vpin(int index) const {
-    if (index < 0 || index >= numVpins_) return 0;
-    return vpins_[index];
-}
-
-void defiNet::spacingRule(int index, char** layer, double* dist,
-     double* left, double* right) const {
-  if (index >= 0 && index < numSpacing_) {
-    if (layer) *layer = slayers_[index];
-    if (dist) *dist = sdist_[index];
-    if (left) *left = sleft_[index];
-    if (right) *right = sright_[index];
-  }
-}
-
-
-void defiNet::widthRule(int index, char** layer, double* dist) const {
-  if (index >= 0 && index < numWidths_) {
-    if (layer) *layer = wlayers_[index];
-    if (dist) *dist = wdist_[index];
-  }
-}
-
-
-void defiNet::setVoltage(double v) {
-  voltage_ = v;
-  hasVoltage_ = 1;
-}
-
-
-void defiNet::setWidth(const char* layer, double d) {
-  int len = strlen(layer) + 1;
-  char* l = (char*)malloc(len);
-  strcpy(l, defData->DEFCASE(layer));
-
-  if (numWidths_ >= widthsAllocated_) {
-    int i;
-    char** nl;
-    double* nd;
-    widthsAllocated_ = widthsAllocated_ ?
-       widthsAllocated_ * 2 : 4 ;
-    nl = (char**)malloc(sizeof(char*) * widthsAllocated_);
-    nd = (double*)malloc(sizeof(double) * widthsAllocated_);
-    for (i = 0; i < numWidths_; i++) {
-      nl[i] = wlayers_[i];
-      nd[i] = wdist_[i];
-    }
-    free((char*)(wlayers_));
-    free((char*)(wdist_));
-    wlayers_ = nl;
-    wdist_ = nd;
-  }
-
-  wlayers_[numWidths_] = l;
-  wdist_[numWidths_] = d;
-  (numWidths_)++;
-}
-
-
-void defiNet::setSpacing(const char* layer, double d) {
-  int len = strlen(layer) + 1;
-  char* l = (char*)malloc(len);
-  strcpy(l, defData->DEFCASE(layer));
-
-  if (numSpacing_ >= spacingAllocated_) {
-    int i;
-    char** nl;
-    double* nd;
-    double* n1;
-    double* n2;
-    spacingAllocated_ = spacingAllocated_ ?
-       spacingAllocated_ * 2 : 4 ;
-    nl = (char**)malloc(sizeof(char*) * spacingAllocated_);
-    nd = (double*)malloc(sizeof(double) * spacingAllocated_);
-    n1 = (double*)malloc(sizeof(double) * spacingAllocated_);
-    n2 = (double*)malloc(sizeof(double) * spacingAllocated_);
-    for (i = 0; i < numSpacing_; i++) {
-      nl[i] = slayers_[i];
-      nd[i] = sdist_[i];
-      n1[i] = sleft_[i];
-      n2[i] = sright_[i];
-    }
-    free((char*)(slayers_));
-    free((char*)(sdist_));
-    free((char*)(sleft_));
-    free((char*)(sright_));
-    slayers_ = nl;
-    sdist_ = nd;
-    sleft_ = n1;
-    sright_ = n2;
-  }
-
-  slayers_[numSpacing_] = l;
-  sdist_[numSpacing_] = d;
-  sleft_[numSpacing_] = d;
-  sright_[numSpacing_] = d;
-  (numSpacing_)++;
-}
-
-
-void defiNet::setRange(double left, double right) {
-  // This is always called right after setSpacing.
-  sleft_[numSpacing_-1] = left;
-  sright_[numSpacing_-1] = right;
-}
-
-// 5.6
-void defiNet::addPolygon(const char* layerName, defiGeometries* geom,
-                         int *needCbk, int colorMask,
-             const char* routeStatus,
-             const char* shapeType,
-                         const char* routeStatusShieldName) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  // This method will only call by specialnet, need to change if net also
-  // calls it.
-  *needCbk = 0;
-  if (numPolys_ == polysAllocated_) {
-    char** newn;
-    char** newRS;
-    char** newST;
-    char** newRSN;
-    int* maskn;
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          1000 : polysAllocated_ * 2;
-    newn = (char**)malloc(sizeof(char*) * polysAllocated_);
-    newRS = (char**)malloc(sizeof(char*) * polysAllocated_);
-    newST = (char**)malloc(sizeof(char*) * polysAllocated_);
-    newRSN = (char**)malloc(sizeof(char*) * polysAllocated_);
-    maskn = (int*)malloc(sizeof(int) * polysAllocated_);
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    for (i = 0; i < numPolys_; i++) {
-      newn[i] = polygonNames_[i];
-      poly[i] = polygons_[i];
-      maskn[i] = polyMasks_[i];
-      newRS[i] = polyRouteStatus_[i];
-      newST[i] = polyShapeTypes_[i];
-      newRSN[i] = polyRouteStatusShieldNames_[i];
-
-    }
-    if (polygons_)
-      free((char*)(polygons_));
-    if (polygonNames_)
-      free((char*)(polygonNames_));
-    if (polyMasks_)
-      free((char*)(polyMasks_));
-    if (polyRouteStatus_)
-      free((char*)(polyRouteStatus_));
-    if (polyShapeTypes_)
-      free((char*)(polyShapeTypes_));
-    if (polyRouteStatusShieldNames_)
-      free((char*)(polyRouteStatusShieldNames_));
-    polygonNames_ = newn;
-    polygons_ = poly;
-    polyMasks_ = maskn;
-    polyShapeTypes_ = newST;
-    polyRouteStatus_= newRS;
-    polyRouteStatusShieldNames_ = newRSN;
-  }
-  polygonNames_[numPolys_] = strdup(layerName);
-  polyRouteStatus_[numPolys_] = strdup(routeStatus);
-  polyShapeTypes_[numPolys_] = strdup(shapeType);
-  polyRouteStatusShieldNames_[numPolys_] = strdup(routeStatusShieldName);
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polyMasks_[numPolys_] = colorMask;
-  polygons_[numPolys_] = p;
-  numPolys_ += 1;
-  if (numPolys_ == 1000)  // Want to invoke the partial callback if set
-     *needCbk = 1;
-}
-
-
-// 5.6
-int defiNet::numPolygons() const {
-  return numPolys_;
-}
-
-
-// 5.6
-const char* defiNet::polygonName(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numPolys_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPolys_);
-     defiError(0, 6085, errMsg, defData);
-     return 0;
-  }
-  return polygonNames_[index];
-}
-
-const char* defiNet::polyRouteStatus(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numPolys_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPolys_);
-     defiError(0, 6085, errMsg, defData);
-     return 0;
-  }
-  return polyRouteStatus_[index];
-}
-
-const char* defiNet::polyRouteStatusShieldName(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPolys_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPolys_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return polyRouteStatusShieldNames_[index];
-}
-
-const char* defiNet::polyShapeType(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numPolys_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPolys_);
-     defiError(0, 6085, errMsg, defData);
-     return 0;
-  }
-  return polyShapeTypes_[index];
-}
-
-int defiNet::polyMask(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numPolys_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numPolys_);
-     defiError(0, 6085, errMsg, defData);
-     return 0;
-  }
-  return polyMasks_[index];
-}
-
-// 5.6
-struct defiPoints defiNet::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-// 5.6
-void defiNet::addRect(const char* layerName, int xl, int yl, int xh, int yh,
-                      int *needCbk, 
-              int colorMask,
-              const char* routeStatus,
-              const char* shapeType,
-                      const char* routeStatusName) {
-  // This method will only call by specialnet, need to change if net also
-  // calls it.
-  *needCbk = 0;
-  if (numRects_ == rectsAllocated_) {
-    int    i;
-    int    max;
-    char** newn;
-    int*   newxl;
-    int*   newyl;
-    int*   newxh;
-    int*   newyh;
-    int*   newMask;
-    char** newRS;
-    char** newST;
-    char** newRSN;
-
-    max = rectsAllocated_ = (rectsAllocated_ == 0) ? 1000 :
-              rectsAllocated_ * 2;
-    newn = (char**)malloc(sizeof(char*)*max);
-    newRS = (char**)malloc(sizeof(char*)*max);
-    newST = (char**)malloc(sizeof(char*)*max);
-    newRSN = (char**)malloc(sizeof(char*)*max);
-    newxl = (int*)malloc(sizeof(int)*max);
-    newyl = (int*)malloc(sizeof(int)*max);
-    newxh = (int*)malloc(sizeof(int)*max);
-    newyh = (int*)malloc(sizeof(int)*max);
-    newMask = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRects_; i++) {
-      newn[i] = rectNames_[i];
-      newxl[i] = xl_[i];
-      newyl[i] = yl_[i];
-      newxh[i] = xh_[i];
-      newyh[i] = yh_[i];
-      newMask[i] = rectMasks_[i];
-      newRS[i] = rectRouteStatus_[i];
-      newST[i] = rectShapeTypes_[i];
-      newRSN[i] = rectRouteStatusShieldNames_[i];
-    }
-    if (rectNames_)
-      free((char*)(rectNames_));
-    if (rectRouteStatus_)
-      free((char*)(rectRouteStatus_));
-    if (rectShapeTypes_)
-      free((char*)(rectShapeTypes_));
-    if (rectRouteStatusShieldNames_)
-      free((char*)(rectRouteStatusShieldNames_));
-    if (xl_) {
-      free((char*)(xl_));
-      free((char*)(yl_));
-      free((char*)(xh_));
-      free((char*)(yh_));
-      free((char*)(rectMasks_));
-    }
-    rectNames_ = newn;
-    xl_ = newxl;
-    yl_ = newyl;
-    xh_ = newxh;
-    yh_ = newyh;
-    rectMasks_ = newMask;
-    rectRouteStatus_ = newRS;
-    rectShapeTypes_ = newST;
-    rectRouteStatusShieldNames_ = newRSN;
-  }
-  rectNames_[numRects_] = strdup(layerName);
-  xl_[numRects_] = xl;
-  yl_[numRects_] = yl;
-  xh_[numRects_] = xh;
-  yh_[numRects_] = yh;
-  rectMasks_[numRects_] = colorMask;
-  rectRouteStatus_[numRects_] = strdup(routeStatus);
-  rectShapeTypes_[numRects_] = strdup(shapeType);
-  rectRouteStatusShieldNames_[numRects_] = strdup(routeStatusName);
-  numRects_ += 1;
-  if (numRects_ == 1000)  // Want to invoke the partial callback if set
-     *needCbk = 1;
-}
-
-// 5.6
-int defiNet::numRectangles() const {
-  return numRects_;
-}
-
-// 5.6
-const char* defiNet::rectName(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return rectNames_[index];
-}
-
-const char* defiNet::rectRouteStatus(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return rectRouteStatus_[index];
-}
-
-const char* defiNet::rectRouteStatusShieldName(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numRects_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numRects_);
-        defiError(0, 6086, errMsg, defData);
-        return 0;
-    }
-    return rectRouteStatusShieldNames_[index];
-}
-
-const char* defiNet::rectShapeType(int index) const {
-  char errMsg[128];
-  if (index < 0 || index > numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return rectShapeTypes_[index];
-}
-
-// 5.6
-int defiNet::xl(int index) const {
-  char errMsg[128];
-  if (index < 0 || index >= numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return xl_[index];
-}
-
-// 5.6
-int defiNet::yl(int index) const {
-  char errMsg[128];
-  if (index < 0 || index >= numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return yl_[index];
-}
-
-// 5.6
-int defiNet::xh(int index) const {
-  char errMsg[128];
-  if (index < 0 || index >= numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return xh_[index];
-}
-
-// 5.6
-int defiNet::yh(int index) const {
-  char errMsg[128];
-  if (index < 0 || index >= numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return yh_[index];
-}
-
-int defiNet::rectMask(int index) const {
-  char errMsg[128];
-  if (index < 0 || index >= numRects_) {
-     sprintf (errMsg, "ERROR (DEFPARS-6086): The index number %d specified for the NET RECTANGLE is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numRects_);
-     defiError(0, 6086, errMsg, defData);
-     return 0;
-  }
-  return rectMasks_[index];
-}
-
-
-void defiNet::addPts(const char* viaName, int o, defiGeometries* geom, 
-	             int *needCbk, int colorMask,
-		     const char* routeStatus,
-		     const char* shapeType,
-                     const char* routeStatusShieldName) {
-    struct defiPoints* p;
-    int x, y;
-    int i;
-
-    *needCbk = 0;
-    if (numPts_ == ptsAllocated_) {
-        struct defiPoints** pts;
-        char** newn;
-	char** newRS;
-	char** newST;
-        char** newRSN;
-        int*   orientn;
-	int*   maskn;
-
-        ptsAllocated_ = (ptsAllocated_ == 0) ?
-            1000 : ptsAllocated_ * 2;
-        newn = (char**)malloc(sizeof(char*) *ptsAllocated_);
-        newRS = (char**)malloc(sizeof(char*) *ptsAllocated_);
-        newST = (char**)malloc(sizeof(char*) *ptsAllocated_);
-        newRSN = (char**)malloc(sizeof(char*) *ptsAllocated_);
-        orientn = (int*)malloc(sizeof(int) *ptsAllocated_);
-        pts= (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            ptsAllocated_);
-	maskn = (int*)malloc(sizeof(int) *ptsAllocated_);
-        for (i = 0; i < numPts_; i++) {
-            pts[i] = viaPts_[i];
-            newn[i] = viaNames_[i];
-            newRS[i] = viaRouteStatus_[i];
-            newST[i] = viaShapeTypes_[i];
-            newRSN[i] = viaRouteStatusShieldNames_[i];
-            orientn[i] = viaOrients_[i];
-	    maskn[i] = viaMasks_[i];
-        }
-        if (viaPts_)
-            free((char*)(viaPts_));
-        if (viaNames_) 
-            free((char*)(viaNames_));
-        if (viaOrients_)
-            free((char*)(viaOrients_));
-        if (viaMasks_)
-	    free((char*)(viaMasks_));
-        if (viaRouteStatus_)
-	    free((char*)(viaRouteStatus_));
-        if (viaShapeTypes_)
-	    free((char*)(viaShapeTypes_));
-        if (viaRouteStatusShieldNames_)
-            free((char*)(viaRouteStatusShieldNames_));
-    
-        viaPts_ = pts;
-        viaNames_ = newn;
-        viaOrients_ = orientn;
-	viaMasks_ = maskn;
-	viaShapeTypes_= newST;
-	viaRouteStatus_ = newRS;
-        viaRouteStatusShieldNames_ = newRSN;
-    }
-    viaNames_[numPts_] = strdup(viaName);
-    viaShapeTypes_[numPts_] = strdup(shapeType);
-    viaRouteStatus_[numPts_] = strdup(routeStatus);
-    viaRouteStatusShieldNames_[numPts_] = strdup(routeStatusShieldName);
-    viaOrients_[numPts_] = o;
-    viaMasks_[numPts_] = colorMask;
-    p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-    p->numPoints = geom->numPoints();
-    p->x = (int*)malloc(sizeof(int)*p->numPoints);
-    p->y = (int*)malloc(sizeof(int)*p->numPoints);
-    for (i = 0; i < p->numPoints; i++) {
-        geom->points(i, &x, &y);
-        p->x[i] = x;
-        p->y[i] = y;
-    }
-    viaPts_[numPts_] = p;
-    numPts_ += 1;
-    if (numPts_ == 1000)  // Want to invoke the partial callback if set
-     *needCbk = 1;
-}
-
-int defiNet::numViaSpecs() const {
-    return numPts_;
-}
-
-const char* defiNet::viaName(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return viaNames_[index];
-}
-
-const char* defiNet::viaRouteStatus(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return viaRouteStatus_[index];
-}
-
-const char* defiNet::viaRouteStatusShieldName(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return viaRouteStatusShieldNames_[index];
-}
-
-const char* defiNet::viaShapeType(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return viaShapeTypes_[index];
-}
-
-const int defiNet::viaOrient(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return viaOrients_[index];
-}
-
-const char* defiNet::viaOrientStr(int index) const  {
-    char errMsg[128];
-
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-    return (defiOrientStr(viaOrients_[index]));
-}
-
-const int defiNet::topMaskNum(int index) const {
-   char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-
-    return viaMasks_[index] / 100;
-}
-
-const int defiNet::cutMaskNum(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-
-    return viaMasks_[index] / 10 % 10;
-}
-
-const int defiNet::bottomMaskNum(int index) const {
-    char errMsg[128];
-    if (index < 0 || index > numPts_) {
-        sprintf (errMsg, "ERROR (DEFPARS-6085): The index number %d specified for the NET POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-            index, numPts_);
-        defiError(0, 6085, errMsg, defData);
-        return 0;
-    }
-
-    return viaMasks_[index] % 10;
-}
-
-struct defiPoints defiNet::getViaPts(int index)const {
-    return *(viaPts_[index]);
-}
-
-void defiNet::clearVia() {
-    if (viaNames_) {
-        struct defiPoints* p;
-        for (int i = 0; i < numPts_; i++) {
-            if (viaNames_[i]) {
-		free((char*)(viaNames_[i]));
-	    }
-	    if (viaRouteStatus_[i]) {
-	      free ((char*)(viaRouteStatus_[i]));
-	    }
-	    if (viaShapeTypes_[i]) {
-	      free ((char*)(viaShapeTypes_[i]));
-	    }
-            if (viaRouteStatusShieldNames_[i]) {
-              free ((char*)(viaRouteStatusShieldNames_[i]));
-            }
-            p = viaPts_[i];
-            free((char*)(p->x));
-            free((char*)(p->y));
-            free((char*)(viaPts_[i]));
-        }
-	if (viaMasks_) {
-	    free((char*)(viaMasks_));
-	}
-	if (viaOrients_) {
-	    free((char*)(viaOrients_));
-	}
-	if (viaNames_) {
-	    free((char*)(viaNames_));
-	}
-	if (viaRouteStatus_) {
-	    free((char*)(viaRouteStatus_));
-	}
-	if (viaShapeTypes_) {
-	    free((char*)(viaShapeTypes_));
-	}
-	if (viaRouteStatusShieldNames_) {
-	    free((char*)(viaRouteStatusShieldNames_));
-	}
-	if (viaPts_) {
-	    free((char*)(viaPts_));
-	}
-    }
-
-    viaMasks_ = 0;
-    viaOrients_ = 0;
-    numPts_ = 0;
-    ptsAllocated_ = 0;
-    viaPts_ = 0;
-    viaRouteStatus_ = 0;
-    viaShapeTypes_ = 0;
-    viaRouteStatusShieldNames_ = 0;
-    viaNames_ = 0;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.hpp
deleted file mode 100644
index b9ad9e0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNet.hpp
+++ /dev/null
@@ -1,569 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: icftcm $
-//  $Revision: #2 $
-//  $Date: 2017/06/19 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiNet_h
-#define defiNet_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-#include "defiPath.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-/* Return codes for defiNet::viaOrient 
-    DEF_ORIENT_N  0
-    DEF_ORIENT_W  1
-    DEF_ORIENT_S  2
-    DEF_ORIENT_E  3
-    DEF_ORIENT_FN 4
-    DEF_ORIENT_FW 5
-    DEF_ORIENT_FS 6
-    DEF_ORIENT_FE 7
-*/
-
-class defiWire {
-public:
-  defiWire(defrData *data);
-  ~defiWire();
-
-  void Init(const char* type, const char* wireShieldName);
-  void Destroy();
-  void clear();
-  void addPath(defiPath *p, int reset, int netOsnet, int *needCbk);
-
-  const char* wireType() const;
-  const char* wireShieldNetName() const;
-  int         numPaths() const;
-
-  defiPath*   path(int index);
-  const defiPath*   path(int index) const;
-
-  void bumpPaths(long long size);
-
-protected:
-  char*      type_;
-  char*      wireShieldName_;    // It only set from specialnet SHIELD, 5.4
-  int        numPaths_;
-  long long  pathsAllocated_;
-  defiPath** paths_;
-
-  defrData  *defData;
-};
-
-
-
-class defiSubnet {
-public:
-  defiSubnet(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiSubnet();
-
-  void setName(const char* name);
-  void setNonDefault(const char* name);
-  void addPin(const char* instance, const char* pin, int syn);
-  void addMustPin(const char* instance, const char* pin, int syn);
-
-  // WMD -- the following will be removed by the next release
-  void setType(const char* typ);  // Either FIXED COVER ROUTED
-  void addPath(defiPath* p, int reset, int netOsnet, int *needCbk);
-
-  // NEW: a net can have more than 1 wire
-  void addWire(const char *typ); 
-  void addWirePath(defiPath *p, int reset, int netOsnet, int *needCbk);
-
-  // Debug printing
-  void print(FILE* f) const;
-
-  const char* name() const;
-  int numConnections() const;
-  const char* instance(int index) const;
-  const char* pin(int index) const;
-  int pinIsSynthesized(int index) const;
-  int pinIsMustJoin(int index) const;
-
-  // WMD -- the following will be removed by the next release
-  int isFixed() const;
-  int isRouted() const;
-  int isCover() const;
-
-  int hasNonDefaultRule() const;
-
-  // WMD -- the following will be removed by the next release
-  int numPaths() const;
-  defiPath* path(int index);
-  const defiPath* path(int index) const;
-
-  const char* nonDefaultRule() const;
-
-  int         numWires() const;
-  defiWire*   wire(int index);
-  const defiWire*   wire(int index) const;
-
-  void bumpName(long long size);
-  void bumpPins(long long  size);
-  void bumpPaths(long long  size);
-  void clear();
-
-protected:
-  char*         name_;            // name.
-  int           nameSize_;          // allocated size of name.
-  int           numPins_;           // number of pins used in array.
-  long long     pinsAllocated_;     // number of pins allocated in array.
-  char**        instances_;      // instance names for connections
-  char**        pins_;           // pin names for connections
-  char*         synthesized_;     // synthesized flags for pins
-  char*         musts_;           // must-join flags
-
-  // WMD -- the following will be removed by the next release
-  char       isFixed_;        // net type
-  char       isRouted_;
-  char       isCover_;
-  defiPath** paths_;          // paths for this subnet
-  int        numPaths_;       // number of paths used
-  long long  pathsAllocated_; // allocated size of paths array
-
-  int        numWires_;          // number of wires defined in the subnet
-  long long  wiresAllocated_;    // number of wires allocated in the subnet
-  defiWire** wires_;             // this replace the paths
-  char*      nonDefaultRule_;
-
-  defrData *defData;
-};
-
-
-
-class defiVpin {
-public:
-  defiVpin(defrData *data);
-  ~defiVpin();
-
-  void Init(const char* name);
-  void Destroy();
-  void setLayer(const char* name);
-  void setBounds(int xl, int yl, int xh, int yh);
-  void setOrient(int orient);
-  void setLoc(int x, int y);
-  void setStatus(char st);
-
-  int xl() const ;
-  int yl() const ;
-  int xh() const ;
-  int yh() const ;
-  char status() const;      /* P-placed, F-fixed, C-cover, ' ' - not set */
-  int orient() const ;
-  const char* orientStr() const ;
-  int xLoc() const;
-  int yLoc() const;
-  const char* name() const;
-  const char* layer() const;
-
-protected:
-  int xl_;
-  int yl_;
-  int xh_;
-  int yh_;
-  int orient_;  /* 0-7  -1 is no orient */
-  char status_; /* P-placed  F-fixed  C-cover  ' '- none */
-  int xLoc_;
-  int yLoc_;
-  char* name_;
-  char* layer_;
-
-  defrData *defData;
-};
-
-
-
-// Pre 5.4
-class defiShield {
-public:
-  defiShield(defrData *data);
-  ~defiShield();
-
-  void Init(const char* name);
-  void Destroy();
-  void clear();
-  void addPath(defiPath *p, int reset, int netOsnet, int *needCbk);
-
-  const char* shieldName() const;
-  int         numPaths() const;
-
-  defiPath*         path(int index);
-  const defiPath*   path(int index) const;
-
-  void bumpPaths(long long size);
-
-protected:
-  char*      name_;
-  int        numPaths_;
-  long long  pathsAllocated_;
-  defiPath** paths_;
-
-  defrData *defData;
-};
-
-
-
-
-// Struct holds the data for one component.
-class defiNet {
-public:
-  defiNet(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiNet();
-
-  // Routines used by YACC to set the fields in the net.
-  void setName(const char* name);
-  void addPin(const char* instance, const char* pin, int syn);
-  void addMustPin(const char* instance, const char* pin, int syn);
-  void setWeight(int w);
-
-  // WMD -- the following will be removed by the next release
-  void setType(const char* typ);  // Either FIXED COVER ROUTED
-
-  void addProp(const char* name, const char* value, const char type);
-  void addNumProp(const char* name, const double d,
-                  const char* value, const char type);
-  void addSubnet(defiSubnet* subnet);
-  // NEW: a net can have more than 1 wire
-  void addWire(const char *typ, const char* wireShieldName);
-  void addWirePath(defiPath* p, int reset, int netOsnet, int *needCbk);
-  void addShape(const char *shapeType);         // 5.8
-  void setSource(const char* typ);
-  void setFixedbump();                          // 5.4.1
-  void setFrequency(double frequency);          // 5.4.1
-  void setOriginal(const char* typ);
-  void setPattern(const char* typ);
-  void setCap(double w);
-  void setUse(const char* typ);
-  void setNonDefaultRule(const char* typ);
-  void setStyle(int style);
-  void addShield(const char* shieldNetName);    // pre 5.4
-  void addNoShield(const char* shieldNetName);  // pre 5.4
-  void addShieldNet(const char* shieldNetName);
-
-  void addShieldPath(defiPath* p, int reset, int netOsnet, int *needCbk);
-  void clear();
-  void setWidth(const char* layer, double dist);
-  void setSpacing(const char* layer, double dist);
-  void setVoltage(double num);
-  void setRange(double left, double right);
-  void setXTalk(int num);
-  void addVpin(const char* name);
-  void addVpinLayer(const char* name);
-  void addVpinLoc(const char* status, int x, int y, int orient);
-  void addVpinBounds(int xl, int yl, int xh, int yh);
-  // 5.6
-  void addPolygon(const char* layerName, defiGeometries* geom, int *needCbk,
-	          int mask, const char* routeStatus,
-		  const char* shapeType,
-                  const char* shieldNetName);
-  void addRect(const char* layerName, int xl, int yl, int xh, int yh,
-               int *needCbk, int mask, const char* routeStatus,
-	       const char* shapeType,
-               const char* shieldNetName); // 5.6
-  void addPts(const char* viaName, int o, defiGeometries* geom,
-	      int *needCbk, int mask, const char* routeStatus,
-	      const char* shapeType,
-              const char* shieldNetName);  //VIA 5.8
-
-  // For OA to modify the netName, id & pinName
-  void changeNetName(const char* name);
-  void changeInstance(const char* name, int index);
-  void changePin(const char* name, int index);
-
-  // Routines to return the value of net data.
-  const char*  name() const;
-  int          weight() const;
-  int          numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-  int          numConnections() const;
-  const char*  instance(int index) const;
-  const char*  pin(int index) const;
-  int          pinIsMustJoin(int index) const;
-  int          pinIsSynthesized(int index) const;
-  int          numSubnets() const;
-
-  defiSubnet*  subnet(int index);
-  const defiSubnet*  subnet(int index) const;
-
-  // WMD -- the following will be removed by the next release
-  int         isFixed() const;
-  int         isRouted() const;
-  int         isCover() const;
-
-  /* The following routines are for wiring */
-  int         numWires() const;
-
-  defiWire*   wire(int index);
-  const defiWire*   wire(int index) const;
-
-  /* Routines to get the information about Virtual Pins. */
-  int       numVpins() const;
-  
-  defiVpin* vpin(int index);
-  const defiVpin* vpin(int index) const;
-
-  int hasProps() const;
-  int hasWeight() const;
-  int hasSubnets() const;
-  int hasSource() const;
-  int hasFixedbump() const;                          // 5.4.1
-  int hasFrequency() const;                          // 5.4.1
-  int hasPattern() const;
-  int hasOriginal() const;
-  int hasCap() const;
-  int hasUse() const;
-  int hasStyle() const;
-  int hasNonDefaultRule() const;
-  int hasVoltage() const;
-  int hasSpacingRules() const;
-  int hasWidthRules() const;
-  int hasXTalk() const;
-
-  int numSpacingRules() const;
-  void spacingRule(int index, char** layer, double* dist, double* left,
-                   double* right) const;
-  int numWidthRules() const;
-  void widthRule(int index, char** layer, double* dist) const;
-  double voltage() const;
-
-  int            XTalk() const;
-  const char*    source() const;
-  double         frequency() const;
-  const char*    original() const;
-  const char*    pattern() const;
-  double         cap() const;
-  const char*    use() const;
-  int            style() const;
-  const char*    nonDefaultRule() const;
-
-  // WMD -- the following will be removed by the next release
-  int            numPaths() const;
-  
-  defiPath*            path(int index);
-  const defiPath*      path(int index) const;
-
-  int            numShields() const;          // pre 5.4
-
-  defiShield*    shield(int index);           // pre 5.4
-  const defiShield*    shield(int index) const ;           // pre 5.4
-
-  int            numShieldNets() const;
-  const char*    shieldNet(int index) const;
-  int            numNoShields() const;        // pre 5.4
-
-  defiShield*    noShield(int index);         // pre 5.4
-  const defiShield*    noShield(int index) const;         // pre 5.4
-
-  // 5.6
-  int            numPolygons() const;                 // 5.6
-  const  char*   polygonName(int index) const;        // 5.6
-  struct defiPoints getPolygon(int index) const;      // 5.6
-  int            polyMask(int index) const;
-  const char*    polyRouteStatus(int index) const;
-  const char*    polyRouteStatusShieldName(int index) const;
-  const char*    polyShapeType(int index) const;
-
-
-  int  numRectangles() const;                         // 5.6
-  const  char* rectName(int index) const;             // 5.6
-  int  xl(int index)const;                            // 5.6
-  int  yl(int index)const;                            // 5.6
-  int  xh(int index)const;                            // 5.6
-  int  yh(int index)const;                            // 5.6
-  int  rectMask(int index)const;
-  const char* rectRouteStatus(int index) const;
-  const char* rectRouteStatusShieldName(int index) const;
-  const char* rectShapeType(int index) const;
-  
-
-  // 5.8
-  int  numViaSpecs() const;
-  struct defiPoints getViaPts(int index) const;                       
-  const char* viaName(int index) const;
-  const int viaOrient(int index) const;
-  const char* viaOrientStr(int index) const;
-  const int topMaskNum(int index) const;
-  const int cutMaskNum(int index) const;
-  const int bottomMaskNum(int index) const;
-  const char* viaRouteStatus(int index) const;
-  const char* viaRouteStatusShieldName(int index) const;
-  const char* viaShapeType(int index) const;
-
-  // Debug printing
-  void print(FILE* f) const;
-
-
-  void bumpName(long long size);
-  void bumpPins(long long size);
-  void bumpProps(long long size);
-  void bumpSubnets(long long size);
-  void bumpPaths(long long  size);
-  void bumpShieldNets(long long size);
-
-  // The method freeWire() is added is user select to have a callback
-  // per wire within a net This is an internal method and is not public
-  void freeWire();
-  void freeShield();
-
-  // Clear the rectangles & polygons data if partial path callback is set
-  void clearRectPolyNPath();
-  void clearRectPoly();
-  void clearVia();
-
-protected:
-  char*     name_;          // name.
-  int       nameSize_;      // allocated size of name.
-  int       numPins_;       // number of pins used in array.
-  long long pinsAllocated_; // number of pins allocated in array.
-  char**    instances_;     // instance names for connections
-  char**    pins_;          // pin names for connections
-  char*     musts_;         // must-join flags for pins
-  char*     synthesized_;   // synthesized flags for pins
-  int       weight_;        // net weight
-  char      hasWeight_;     // flag for optional weight
-
-  // WMD -- the following will be removed by the nex release
-  char isFixed_;        // net type
-  char isRouted_;
-  char isCover_;
-
-  char hasCap_;         // file supplied a capacitance value
-  char hasFrequency_;   // file supplied a frequency value
-  char hasVoltage_;
-  int numProps_;        // num of props in array
-  char**  propNames_;   // Prop names
-  char**  propValues_;  // Prop values All in strings!
-  double* propDValues_; // Prop values in numbers!
-  char*   propTypes_;   // Prop types, 'I' - Integer, 'R' - Real, 'S' - String
-
-  long long    propsAllocated_;   // allocated size of props array
-  int          numSubnets_;       // num of subnets in array
-  defiSubnet** subnets_;          // Prop names
-  long long    subnetsAllocated_; // allocated size of props array
-  double       cap_;              // cap value
-  char*        source_;
-  int          fixedbump_;     // 5.4.1
-  double       frequency_;     // 5.4.1
-  char* pattern_;
-  char* original_;
-  char* use_;
-  char* nonDefaultRule_;
-  int   style_;
-
-  // WMD -- the following will be removed by the nex release
-  defiPath** paths_;          // paths for this subnet
-  int        numPaths_;       // number of paths used
-  long long  pathsAllocated_; // allocated size of paths array
-
-  double voltage_;
-
-  int         numWires_;         // number of wires defined in the net
-  long long   wiresAllocated_;   // allocated size of wire paths array
-  defiWire**  wires_;            // this replace the paths
-
-  long long   widthsAllocated_;
-  int         numWidths_;
-  char**      wlayers_;
-  double*     wdist_;
-
-  long long   spacingAllocated_;
-  int         numSpacing_;
-  char**      slayers_;
-  double*     sdist_;
-  double*     sleft_;
-  double*     sright_;
-  int         xTalk_;
-
-  int         numVpins_;
-  long long   vpinsAllocated_;
-  defiVpin**  vpins_;
-
-  int          numShields_;            // number of SHIELD paths used
-  long long    shieldsAllocated_;      // allocated size of SHIELD paths array
-  defiShield** shields_;               // SHIELD data 
-  int          numNoShields_;          // number of NOSHIELD paths used
-
-  int          numShieldNet_;          // number of SHIELDNETS used in array.
-  long long    shieldNetsAllocated_;   // number of SHIELDNETS allocated in array.
-  char**       shieldNet_;             // name of the SHIELDNET
-
-  int          numPolys_;              // 5.6
-  char**       polygonNames_;          // 5.6 layerName for POLYGON
-  long long    polysAllocated_;        // 5.6
-  struct defiPoints** polygons_;       // 5.6
-  int*         polyMasks_;
-  char** polyRouteStatus_;
-  char** polyShapeTypes_;
-  char** polyRouteStatusShieldNames_;
-
-  int        numRects_;                    // 5.6
-  long long  rectsAllocated_;              // 5.6
-  char**     rectNames_;                   // 5.6
-  int* xl_;
-  int* yl_;
-  int* xh_;
-  int* yh_;
-  int* rectMasks_;
-  char** rectRouteStatus_;
-  char** rectRouteStatusShieldNames_;
-  char** rectShapeTypes_;
-  
-
-  struct defiPoints** viaPts_;      // 5.8                  
-  char**              viaNames_;                   
-  int                 numPts_;                    
-  long long           ptsAllocated_;
-  int*                viaOrients_;
-  int*                viaMasks_;
-  char**              viaRouteStatus_;
-  char**              viaRouteStatusShieldNames_;
-  char**              viaShapeTypes_;
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.cpp
deleted file mode 100644
index e6738e0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.cpp
+++ /dev/null
@@ -1,707 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiNonDefault.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/////////////////////////////////////////
-/////////////////////////////////////////
-//
-//     defiNonDefault
-//
-/////////////////////////////////////////
-/////////////////////////////////////////
-
-defiNonDefault::defiNonDefault(defrData *data)
-: defData(data) { 
-  Init();
-}
-
-void defiNonDefault::Init() { 
-  name_ = 0;
-  hardSpacing_ = 0;
-  numLayers_ = 0;
-  width_ = 0;
-  hasDiagWidth_ = 0;
-  hasSpacing_ = 0;
-  hasWireExt_ = 0;
-  numVias_ = 0;
-  viasAllocated_ = 0;
-  viaNames_ = 0;
-  numViaRules_ = 0;
-  viaRulesAllocated_ = 0;
-  viaRuleNames_ = 0;
-  numMinCuts_ = 0;
-  minCutsAllocated_ = 0;
-  cutLayerName_ = 0;
-  numCuts_ = 0;
-  numProps_ = 0;
-  propsAllocated_ = 0;
-  names_ = 0;
-  values_ = 0;
-  dvalues_ = 0;
-  types_ = 0;
-  layersAllocated_ = 0;
-  layerName_ = 0;
-  width_ = 0;
-  hasDiagWidth_ = 0;
-  diagWidth_ = 0;
-  hasSpacing_ = 0;
-  spacing_ = 0;
-  hasWireExt_ = 0;
-  wireExt_ = 0;
-}
-
-defiNonDefault::~defiNonDefault() { 
-  Destroy();
-}
-
-void defiNonDefault::Destroy() {
-  clear();
-  if (propsAllocated_) {
-    free((char*)(names_));
-    free((char*)(values_));
-    free((char*)(dvalues_));
-    free((char*)(types_));
-  }
-  if (layersAllocated_) {
-    free((char*)(layerName_));
-    free((char*)(width_));
-    free((char*)(hasDiagWidth_));
-    free((char*)(diagWidth_));
-    free((char*)(hasSpacing_));
-    free((char*)(spacing_));
-    free((char*)(hasWireExt_));
-    free((char*)(wireExt_));
-  }
-  if (viasAllocated_)
-    free((char*)(viaNames_));
-  if (viaRulesAllocated_)
-    free((char*)(viaRuleNames_));
-  if (minCutsAllocated_) {
-    free((char*)(cutLayerName_));
-    free((char*)(numCuts_));
-  }
-}
-
-void defiNonDefault::clear() { 
-  int i;
-
-  if (name_)
-    free(name_);
-  hardSpacing_ = 0;
-  for (i = 0; i < numProps_; i++) {
-    free(names_[i]);
-    free(values_[i]);
-    dvalues_[i] = 0;
-  }
-  numProps_ = 0;
-  for (i = 0; i < numLayers_; i++)
-    free(layerName_[i]);
-  numLayers_ = 0;
-  for (i = 0; i < numVias_; i++)
-    free((char*)(viaNames_[i]));
-  numVias_ = 0;
-  for (i = 0; i < numViaRules_; i++)
-    free((char*)(viaRuleNames_[i]));
-  numViaRules_ = 0;
-  for (i = 0; i < numMinCuts_; i++)
-    free((char*)(cutLayerName_[i]));
-  numMinCuts_ = 0;
-}
-
-void defiNonDefault::setName(const char* name) { 
-  name_ = (char*)malloc(strlen(name)+1);
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-void defiNonDefault::setHardspacing() {
-  hardSpacing_ = 1;
-}
-
-void defiNonDefault::addLayer(const char* name) { 
-  int len = strlen(name) + 1;
-  if (numLayers_ == layersAllocated_) {
-    int i;
-    char**  newl;
-    double* neww;
-    double* newd;
-    double* news;
-    double* newe;
-    char*   newhd;
-    char*   newhs;
-    char*   newhe;
-
-    if (layersAllocated_ == 0)
-      layersAllocated_ = 2;
-    else
-      layersAllocated_ *= 2;
-    newl = (char**)malloc(sizeof(char*) * layersAllocated_);
-    newe = (double*)malloc(sizeof(double) * layersAllocated_);
-    neww = (double*)malloc(sizeof(double) * layersAllocated_);
-    newd = (double*)malloc(sizeof(double) * layersAllocated_);
-    news = (double*)malloc(sizeof(double) * layersAllocated_);
-    newhe = (char*)malloc(sizeof(char) * layersAllocated_);
-    newhd = (char*)malloc(sizeof(char) * layersAllocated_);
-    newhs = (char*)malloc(sizeof(char) * layersAllocated_);
-    for (i = 0; i < numLayers_; i++) {
-      newl[i]  = layerName_[i];
-      neww[i]  = width_[i];
-      newd[i]  = diagWidth_[i];
-      news[i]  = spacing_[i];
-      newe[i]  = wireExt_[i];
-      newhe[i]  = hasWireExt_[i];
-      newhd[i]  = hasDiagWidth_[i];
-      newhs[i]  = hasSpacing_[i];
-    }
-    if (layersAllocated_ > 2) {
-      free((char*)(layerName_));
-      free((char*)(width_));
-      free((char*)(diagWidth_));
-      free((char*)(spacing_));
-      free((char*)(wireExt_));
-      free((char*)(hasWireExt_));
-      free((char*)(hasDiagWidth_));
-      free((char*)(hasSpacing_));
-    }
-    layerName_ = newl;
-    width_ = neww;
-    diagWidth_ = newd;
-    spacing_ = news;
-    wireExt_ = newe;
-    hasDiagWidth_ = newhd;
-    hasSpacing_ = newhs;
-    hasWireExt_ = newhe;
-  }
-  layerName_[numLayers_] = (char*)malloc(len);
-  strcpy(layerName_[numLayers_], defData->DEFCASE(name));
-  width_[numLayers_] = 0.0;
-  diagWidth_[numLayers_] = 0.0;
-  spacing_[numLayers_] = 0.0;
-  wireExt_[numLayers_] = 0.0;
-  hasDiagWidth_[numLayers_] = '\0';
-  hasSpacing_[numLayers_] = '\0';
-  hasWireExt_[numLayers_] = '\0';
-  numLayers_ += 1;
-}
-
-void defiNonDefault::addWidth(double num) { 
-  width_[numLayers_-1] = num;
-}
-
-void defiNonDefault::addDiagWidth(double num) { 
-  diagWidth_[numLayers_-1] = num;
-  hasDiagWidth_[numLayers_-1] = 1;
-}
-
-void defiNonDefault::addSpacing(double num) { 
-  spacing_[numLayers_-1] = num;
-  hasSpacing_[numLayers_-1] = 1;
-}
-
-void defiNonDefault::addWireExt(double num) { 
-  wireExt_[numLayers_-1] = num;
-  hasWireExt_[numLayers_-1] = 1;
-}
-
-void defiNonDefault::addVia(const char* name) {
-  if (numVias_ == viasAllocated_) {
-    int i;
-    char** vn;
-
-    if (viasAllocated_ == 0)
-      viasAllocated_ = 2;
-    else
-      viasAllocated_ *= 2;
-    vn = (char**)malloc(sizeof(char*)* viasAllocated_);
-    for (i = 0; i < numVias_; i++) {
-      vn[i] = viaNames_[i];
-    }
-    free((char*)(viaNames_));
-    viaNames_ = vn;
-  } 
-  viaNames_[numVias_] = (char*)malloc(strlen(name)+1);
-  strcpy(viaNames_[numVias_], defData->DEFCASE(name));
-  numVias_ += 1;
-}
-
-void defiNonDefault::addViaRule(const char* name) {
-  if (numViaRules_ == viaRulesAllocated_) {
-    int i;
-    char** vn;
-
-    if (viaRulesAllocated_ == 0)
-      viaRulesAllocated_ = 2;
-    else
-      viaRulesAllocated_ *= 2;
-    vn = (char**)malloc(sizeof(char*)* viaRulesAllocated_);
-    for (i = 0; i < numViaRules_; i++) {
-      vn[i] = viaRuleNames_[i];
-    }
-    free((char*)(viaRuleNames_));
-    viaRuleNames_ = vn;
-  } 
-  viaRuleNames_[numViaRules_] = (char*)malloc(strlen(name)+1);
-  strcpy(viaRuleNames_[numViaRules_], defData->DEFCASE(name));
-  numViaRules_ += 1;
-}
-
-void defiNonDefault::addMinCuts(const char* name, int numCuts) {
-  if (numMinCuts_ == minCutsAllocated_) {
-    int i;
-    char** cln;
-    int*   nc;
-
-    if (minCutsAllocated_ == 0)
-      minCutsAllocated_ = 2;
-    else
-      minCutsAllocated_ *= 2;
-    cln = (char**)malloc(sizeof(char*)* minCutsAllocated_);
-    nc = (int*)malloc(sizeof(int)* minCutsAllocated_);
-    for (i = 0; i < numMinCuts_; i++) {
-      cln[i] = cutLayerName_[i];
-      nc[i]  = numCuts_[i];
-    }
-    if (minCutsAllocated_ > 2) {
-      free((char*)(cutLayerName_));
-      free((char*)(numCuts_));
-    }
-    cutLayerName_ = cln;
-    numCuts_ = nc;
-  } 
-  cutLayerName_[numMinCuts_] = (char*)malloc(strlen(name)+1);
-  strcpy(cutLayerName_[numMinCuts_], defData->DEFCASE(name));
-  numCuts_[numMinCuts_] = numCuts;
-  numMinCuts_ += 1;
-}
-
-const char* defiNonDefault::name() const {
-  return name_;
-}
-
-int defiNonDefault::hasHardspacing() const {
-  return hardSpacing_;
-}
-
-int defiNonDefault::numLayers() const { 
-  return numLayers_;
-}
-
-const char* defiNonDefault::layerName(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return layerName_[index];
-}
-
-// Will be obsoleted in 5.7
-double defiNonDefault::layerWidth(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return width_[index];
-}
-
-int defiNonDefault::layerWidthVal(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return (int)width_[index];
-}
-
-int defiNonDefault::hasLayerDiagWidth(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return hasDiagWidth_[index];
-}
-
-// Will be obsoleted in 5.7
-double defiNonDefault::layerDiagWidth(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return diagWidth_[index];
-}
-
-int defiNonDefault::layerDiagWidthVal(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return (int)diagWidth_[index];
-}
-
-int defiNonDefault::hasLayerWireExt(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return hasWireExt_[index];
-}
-
-int defiNonDefault::hasLayerSpacing(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return hasSpacing_[index];
-}
-
-// Will be obsoleted in 5.7
-double defiNonDefault::layerWireExt(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return wireExt_[index];
-}
-
-int defiNonDefault::layerWireExtVal(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return (int)wireExt_[index];
-}
-
-// Will be obsoleted in 5.7
-double defiNonDefault::layerSpacing(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return spacing_[index];
-}
-
-int defiNonDefault::layerSpacingVal(int index) const { 
-  char msg[160];
-  if (index < 0 || index >= numLayers_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return (int)spacing_[index];
-}
-
-int defiNonDefault::numVias() const { 
-  return numVias_;
-}
-
-const char* defiNonDefault::viaName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numVias_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return viaNames_[index];
-}
-
-int defiNonDefault::numViaRules() const { 
-  return numViaRules_;
-}
-
-const char* defiNonDefault::viaRuleName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numViaRules_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return viaRuleNames_[index];
-}
-
-int defiNonDefault::numMinCuts() const {
-  return numMinCuts_;
-}
-
-const char* defiNonDefault::cutLayerName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numMinCuts_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return cutLayerName_[index];
-}
-
-int defiNonDefault::numCuts(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numMinCuts_) {
-     sprintf (msg, "ERROR (DEFPARS-6090): The index number %d specified for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numLayers_);
-     defiError(0, 6090, msg, defData);
-     return 0;
-  }
-  return numCuts_[index];
-}
-
-void defiNonDefault::print(FILE* f) const { 
-  int   i;
-
-  fprintf(f, "nondefaultrule %s\n", name());
-  
-  fprintf(f, "%d layers   %d vias   %d viarules   %d mincuts\n",
-    numLayers(),
-    numVias(),
-    numViaRules(),
-    numMinCuts());
-
-  for (i = 0; i < numLayers(); i++) {
-    fprintf(f, "  Layer %s\n", layerName(i));
-    fprintf(f, "    WIDTH %g\n", layerWidth(i));
-    if (hasLayerDiagWidth(i))
-      fprintf(f, "    DIAGWIDTH %g\n", layerDiagWidth(i));
-    if (hasLayerSpacing(i))
-      fprintf(f, "    SPACING %g\n", layerSpacing(i));
-    if (hasLayerWireExt(i))
-      fprintf(f, "    WIREEXT %g\n",
-              layerWireExt(i));
-  }
-  for (i = 0; i < numVias(); i++) {
-    fprintf(f, "    VIA %s\n", viaName(i));
-  }
-  for (i = 0; i < numViaRules(); i++) {
-    fprintf(f, "    VIARULE %s\n", viaRuleName(i));
-  }
-  for (i = 0; i < numMinCuts(); i++) {
-    fprintf(f, "    MINCUTS %s %d\n", cutLayerName(i),
-            numCuts(i));
-  }
-}
-
-int defiNonDefault::numProps() const {
-  return numProps_;
-}
-
-void defiNonDefault::addProperty(const char* name, const char* value,
-                                 const char type) {
-  int len = strlen(name) + 1;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    int max;
-    int lim = numProps_;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    if (propsAllocated_ == 0) 
-      max = propsAllocated_ = 2;
-    else
-      max = propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*) * max);
-    nv = (char**)malloc(sizeof(char*) * max);
-    nd = (double*)malloc(sizeof(double) * max);
-    nt = (char*)malloc(sizeof(char) * max);
-    for (i = 0; i < lim; i++) {
-      nn[i] = names_[i];
-      nv[i] = values_[i];
-      nd[i] = dvalues_[i];
-      nt[i] = types_[i];
-    }
-    free((char*)(names_));
-    free((char*)(values_));
-    free((char*)(dvalues_));
-    free((char*)(types_));
-    names_   = nn;
-    values_  = nv;
-    dvalues_ = nd;
-    types_   = nt;
-  }
-  names_[numProps_] = (char*)malloc(sizeof(char)*len);
-  strcpy(names_[numProps_],name);
-  len = strlen(value) + 1;
-  values_[numProps_] = (char*)malloc(sizeof(char) * len);
-  strcpy(values_[numProps_],value);
-  dvalues_[numProps_] = 0;
-  types_[numProps_] = type;
-  numProps_ += 1;
-}
-
-void defiNonDefault::addNumProperty(const char* name, const double d,
-                                    const char* value, const char type) {
-  int len = strlen(name) + 1;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    int max;
-    int lim = numProps_;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    if (propsAllocated_ == 0) 
-      max = propsAllocated_ = 2;
-    else
-      max = propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*) * max);
-    nv = (char**)malloc(sizeof(char*) * max);
-    nd = (double*)malloc(sizeof(double) * max);
-    nt = (char*)malloc(sizeof(char) * max);
-    for (i = 0; i < lim; i++) {
-      nn[i] = names_[i];
-      nv[i] = values_[i];
-      nd[i] = dvalues_[i];
-      nt[i] = types_[i];
-    }
-    free((char*)(names_));
-    free((char*)(values_));
-    free((char*)(dvalues_));
-    free((char*)(types_));
-    names_   = nn;
-    values_  = nv;
-    dvalues_ = nd;
-    types_   = nt;
-  }
-  names_[numProps_] = (char*)malloc(sizeof(char) * len);
-  strcpy(names_[numProps_],name);
-  len = strlen(value) + 1;
-  values_[numProps_] = (char*)malloc(sizeof(char) * len);
-  strcpy(values_[numProps_],value);
-  dvalues_[numProps_] = d;
-  types_[numProps_] = type;
-  numProps_ += 1;
-}
-
-const char* defiNonDefault::propName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return names_[index];
-}
-
-const char* defiNonDefault::propValue(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return values_[index];
-}
-
-double defiNonDefault::propNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return dvalues_[index];
-}
-
-const char defiNonDefault::propType(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return types_[index];
-}
-
-int defiNonDefault::propIsNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return dvalues_[index] ? 1 : 0;
-}
-
-int defiNonDefault::propIsString(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6091): The index number %d specified for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again.",
-             index, numProps_);
-     defiError(0, 6091, msg, defData);
-     return 0;
-  }
-  return dvalues_[index] ? 0 : 1;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.hpp
deleted file mode 100644
index 520780c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiNonDefault.hpp
+++ /dev/null
@@ -1,141 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiNonDefault_h
-#define defiNonDefault_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defiNonDefault {
-public:
-  defiNonDefault(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiNonDefault();
-
-  void clear();
-  void setName(const char* name);
-  void setHardspacing();
-  void addLayer(const char* name);
-  void addWidth(double num);
-  void addDiagWidth(double num);
-  void addSpacing(double num);
-  void addWireExt(double num);
-  void addVia(const char* name);
-  void addViaRule(const char* name);
-  void addMinCuts(const char* name, int numCuts);
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d,
-                      const char* value, const char type);
-  void end();
-
-  const char* name() const;
-  int   hasHardspacing() const;
-
-  int         numProps() const;
-  const char* propName(int index) const;
-  const char* propValue(int index) const;
-  double      propNumber(int index) const;
-  const char  propType(int index) const;
-  int         propIsNumber(int index) const;
-  int         propIsString(int index) const;
-  
-  // A non default rule can have one or more layers.
-  // The layer information is kept in an array.
-  int         numLayers() const ;
-  const char* layerName(int index) const ;
-  double      layerWidth(int index) const ;       // Will be obsoleted in 5.7
-  int         layerWidthVal(int index) const ;
-  int         hasLayerDiagWidth(int index) const;
-  double      layerDiagWidth(int index) const;    // Will be obsoleted in 5.7
-  int         layerDiagWidthVal(int index) const;
-  int         hasLayerSpacing(int index) const ;
-  double      layerSpacing(int index) const ;     // Will be obsoleted in 5.7
-  int         layerSpacingVal(int index) const ;
-  int         hasLayerWireExt(int index) const ;
-  double      layerWireExt(int index) const ;     // Will be obsoleted in 5.7
-  int         layerWireExtVal(int index) const ;
-  int         numVias() const ;
-  const char* viaName(int index) const ;
-  int         numViaRules() const ;
-  const char* viaRuleName(int index) const ;
-  int         numMinCuts() const;
-  const char* cutLayerName(int index) const;
-  int         numCuts(int index) const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  char*   name_;
-  char    hardSpacing_;
-
-  // Layer information
-  int     numLayers_;
-  int     layersAllocated_;
-  char**  layerName_;
-  double* width_;
-  char*   hasDiagWidth_;
-  double* diagWidth_;
-  char*   hasSpacing_;
-  double* spacing_;
-  char*   hasWireExt_;
-  double* wireExt_;
-
-  int     numVias_;
-  int     viasAllocated_;
-  char**  viaNames_;
-  int     numViaRules_;
-  int     viaRulesAllocated_;
-  char**  viaRuleNames_;
-  int     numMinCuts_;
-  int     minCutsAllocated_;
-  char**  cutLayerName_;
-  int*    numCuts_;
-
-  int     numProps_;
-  int     propsAllocated_;
-  char**  names_;
-  char**  values_;
-  double* dvalues_;
-  char*   types_;
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.cpp
deleted file mode 100644
index ce1b1af..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.cpp
+++ /dev/null
@@ -1,551 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiPartition.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiPartition
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiPartition::defiPartition(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-
-void defiPartition::Init() {
-  name_ = 0;
-  nameLength_ = 0;
-  pin_ = 0;
-  pinLength_ = 0;
-  inst_ = 0;
-  instLength_ = 0;
-
-  pinsAllocated_ = 0;
-  numPins_ = 0;
-  pins_ = 0;
-
-  clear();
-}
-
-
-defiPartition::~defiPartition() {
-  Destroy();
-}
-
-
-void defiPartition::Destroy() {
-
-  if (name_) free(name_);
-  name_ = 0;
-  nameLength_ = 0;
-  if (pin_) free(pin_);
-  pin_ = 0;
-  pinLength_ = 0;
-  if (inst_) free(inst_);
-  inst_ = 0;
-  instLength_ = 0;
-
-  clear();
-
-  if (pins_) free((char*)(pins_));
-  pins_ = 0;
-  pinsAllocated_ = 0;
-}
-
-
-void defiPartition::clear() {
-  int i;
-
-  setup_ = ' ';
-  hold_ = ' ';
-  direction_ = ' ';
-  type_ = ' ';
-  if (name_) *(name_) = '\0';
-  if (pin_) *(pin_) = '\0';
-  if (inst_) *(inst_) = '\0';
-  hasMin_ = 0;
-  hasMax_ = 0;
-
-  if (numPins_) {
-    for (i = 0; i < numPins_; i++) {
-      free(pins_[i]);
-      pins_[i] = 0;
-    }
-    numPins_ = 0;
-  }
-  hasRiseMin_ = 0;
-  hasFallMin_ = 0;
-  hasRiseMax_ = 0;
-  hasFallMax_ = 0;
-  hasRiseMinRange_ = 0;
-  hasFallMinRange_ = 0;  
-  hasRiseMaxRange_ = 0;
-  hasFallMaxRange_ = 0;
-}
-
-
-void defiPartition::setName(const char* name) {
-  int len = strlen(name) + 1;
-
-  clear();
-
-  if (len > nameLength_) {
-    if (name_) free(name_);
-    nameLength_ = len;
-    name_ = (char*)malloc(len);
-  }
-  strcpy(name_, defData->DEFCASE(name));
-
-}
-
-
-void defiPartition::print(FILE* f) const {
-  int i;
-
-  fprintf(f, "Partition '%s' %c\n",
-       name(), direction());
-  fprintf(f, "  inst %s  pin %s  type %s\n",
-       instName(), pinName(),
-       itemType());
-
-  for (i = 0; i < numPins(); i++)
-    fprintf(f, "  %s\n", pin(i));
-
-  if (isSetupRise())
-    fprintf(f, "  SETUP RISE\n");
-
-  if (isSetupFall())
-    fprintf(f, "  SETUP FALL\n");
-
-  if (isHoldRise())
-    fprintf(f, "  HOLD RISE\n");
-
-  if (isHoldFall())
-    fprintf(f, "  HOLD FALL\n");
-
-  if (hasMin())
-    fprintf(f, "  MIN %g\n", partitionMin());
-
-  if (hasMax())
-    fprintf(f, "  MAX %g\n", partitionMax());
-
-  if (hasRiseMin())
-    fprintf(f, "  RISE MIN %g\n", riseMin());
-
-  if (hasFallMin())
-    fprintf(f, "  FALL MIN %g\n", fallMin());
-
-  if (hasRiseMax())
-    fprintf(f, "  RISE MAX %g\n", riseMax());
-
-  if (hasFallMax())
-    fprintf(f, "  FALL MAX %g\n", fallMax());
-
-  if (hasFallMinRange())
-    fprintf(f, "  FALL MIN %g %g\n", fallMinLeft(),
-                                  fallMinRight());
-
-  if (hasRiseMinRange())
-    fprintf(f, "  RISE MIN %g %g\n", riseMinLeft(),
-                                  riseMinRight());
-
-  if (hasFallMaxRange())
-    fprintf(f, "  FALL MAX %g %g\n", fallMaxLeft(),
-                                  fallMaxRight());
-
-  if (hasRiseMaxRange())
-    fprintf(f, "  RISE MAX %g %g\n", riseMaxLeft(),
-                                  riseMaxRight());
-}
-
-
-const char* defiPartition::name() const {
-  return name_;
-}
-
-
-void defiPartition::setFromIOPin(const char* pin) {
-  set('F', 'I', "", pin);
-}
-
-
-char defiPartition::direction() const {
-  return direction_;
-}
-
-
-const char* defiPartition::instName() const {
-  return inst_;
-}
-
-
-const char* defiPartition::pinName() const {
-  return pin_;
-}
-
-
-static char* ad(const char* in) {
-  return (char*)in;
-}
-
-
-const char* defiPartition::itemType() const {
-  char* c;
-  if (type_ == 'L') c = ad("CLOCK");
-  else if (type_ == 'I') c = ad("IO");
-  else if (type_ == 'C') c = ad("COMP");
-  else c = ad("BOGUS");
-  return c;
-}
-
-
-const char* defiPartition::pin(int index) const {
-  return pins_[index];
-}
-
-
-int defiPartition::numPins() const {
-  return numPins_;
-}
-
-
-int defiPartition::isSetupRise() const {
-  return setup_ == 'R' ? 1 : 0 ;
-}
-
-
-int defiPartition::isSetupFall() const {
-  return setup_ == 'F' ? 1 : 0 ;
-}
-
-
-int defiPartition::isHoldRise() const {
-  return hold_ == 'R' ? 1 : 0 ;
-}
-
-
-int defiPartition::isHoldFall() const {
-  return hold_ == 'F' ? 1 : 0 ;
-}
-
-
-void defiPartition::addTurnOff(const char* setup, const char* hold) {
-  if (*setup == ' ') {
-    setup_ = *setup;
-  } else if (*setup == 'R') {
-    setup_ = *setup;
-  } else if (*setup == 'F') {
-    setup_ = *setup;
-  } else {
-    defiError(0, 6100, "ERROR (DEFPARS-6100): The value spefified for PARTITION SETUP is invalid. The valid value for SETUP is 'R' or 'F'. Specify a valid value for SETUP and then try again.", defData);
-  }
-
-  if (*hold == ' ') {
-    hold_ = *hold;
-  } else if (*hold == 'R') {
-    hold_ = *hold;
-  } else if (*hold == 'F') {
-    hold_ = *hold;
-  } else {
-    defiError(0, 6101, "ERROR (DEFPARS-6101): The value spefified for PARTITION HOLD is invalid. The valid value for HOLD is 'R' or 'F'. Specify a valid value for HOLD and then try again.", defData);
-  }
-
-}
-
-
-void defiPartition::setFromClockPin(const char* inst, const char* pin) {
-  set('F', 'L', inst, pin);
-}
-
-
-void defiPartition::setToClockPin(const char* inst, const char* pin) {
-  set('T', 'L', inst, pin);
-}
-
-
-void defiPartition::set(char dir, char typ, const char* inst, const char* pin) {
-  int len = strlen(pin) + 1;
-  direction_ = dir;
-  type_ = typ;
-
-  if (pinLength_ <= len) {
-    if (pin_) free(pin_);
-    pin_ = (char*)malloc(len);
-    pinLength_ = len;
-  }
-
-  strcpy(pin_, defData->DEFCASE(pin));
-
-  len = strlen(inst) + 1;
-  if (instLength_ <= len) {
-    if (inst_) free(inst_);
-    inst_ = (char*)malloc(len);
-    instLength_ = len;
-  }
-
-  strcpy(inst_, defData->DEFCASE(inst));
-}
-
-
-void defiPartition::setMin(double min, double max) {
-  min_ = min;
-  max_ = max;
-  hasMin_ = 1;
-}
-
-
-void defiPartition::setFromCompPin(const char* inst, const char* pin) {
-  set('F', 'C', inst, pin);
-}
-
-
-void defiPartition::setMax(double min, double max) {
-  min_ = min;
-  max_ = max;
-  hasMax_ = 1;
-}
-
-
-void defiPartition::setToIOPin(const char* pin) {
-  set('T', 'I', "", pin);
-}
-
-
-void defiPartition::setToCompPin(const char* inst, const char* pin) {
-  set('T', 'C', inst, pin);
-}
-
-
-void defiPartition::addPin(const char* name) {
-  int len;
-  int i;
-  char** newp;
-
-  if (numPins_ >= pinsAllocated_) {
-    pinsAllocated_ = pinsAllocated_ ? 2 * pinsAllocated_ : 8;
-    newp = (char**) malloc(sizeof(char*) * pinsAllocated_);
-    for (i = 0; i < numPins_; i++)
-      newp[i] = pins_[i];
-    if (pins_) free((char*)(pins_));
-    pins_ = newp;
-  }
-
-  len = strlen(name) + 1;
-  pins_[numPins_] = (char*)malloc(len);
-  strcpy(pins_[numPins_], defData->DEFCASE(name));
-  numPins_ += 1;
-}
-
-
-int defiPartition::hasMin() const {
-  return(int)(hasMin_);
-}
-
-
-int defiPartition::hasMax() const {
-  return(int)(hasMax_);
-}
-
-
-double defiPartition::partitionMin() const {
-  return(min_);
-}
-
-
-double defiPartition::partitionMax() const {
-  return(max_);
-}
-
-int defiPartition::hasRiseMin() const {
-  return (int)(hasRiseMin_);
-}
-
-
-int defiPartition::hasFallMin() const {
-  return (int)(hasFallMin_);
-}
-
-
-int defiPartition::hasRiseMax() const {
-  return (int)(hasRiseMax_);
-}
-
-
-int defiPartition::hasFallMax() const {
-  return (int)(hasFallMax_);
-}
-
-
-int defiPartition::hasRiseMinRange() const {
-  return (int)(hasRiseMinRange_);
-}
-
-
-int defiPartition::hasFallMinRange() const {
-  return (int)(hasFallMinRange_);
-}
-
-
-int defiPartition::hasRiseMaxRange() const {
-  return (int)(hasRiseMaxRange_);
-}
-
-
-int defiPartition::hasFallMaxRange() const {
-  return (int)(hasFallMaxRange_);
-}
-
-
-double defiPartition::riseMin() const {
-  return riseMin_;
-}
-
-
-double defiPartition::fallMin() const {
-  return fallMin_;
-}
-
-
-double defiPartition::riseMax() const {
-  return riseMax_;
-}
-
-
-double defiPartition::fallMax() const {
-  return fallMax_;
-}
-
-
-double defiPartition::riseMinLeft() const {
-  return riseMinLeft_;
-}
-
-
-double defiPartition::fallMinLeft() const {
-  return fallMinLeft_;
-}
-
-
-double defiPartition::riseMaxLeft() const {
-  return riseMaxLeft_;
-}
-
-
-double defiPartition::fallMaxLeft() const {
-  return fallMaxLeft_;
-}
-
-
-double defiPartition::riseMinRight() const {
-  return riseMinRight_;
-}
-
-
-double defiPartition::fallMinRight() const {
-  return fallMinRight_;
-}
-
-
-double defiPartition::riseMaxRight() const {
-  return riseMaxRight_;
-}
-
-
-double defiPartition::fallMaxRight() const {
-  return fallMaxRight_;
-}
-
-
-void defiPartition::addRiseMin(double d) {
-  hasRiseMin_ = 1;
-  riseMin_ = d;
-}
-
-
-void defiPartition::addRiseMax(double d) {
-  hasRiseMax_ = 1;
-  riseMax_ = d;
-}
-
-
-void defiPartition::addFallMin(double d) {
-  hasFallMin_ = 1;
-  fallMin_ = d;
-}
-
-
-void defiPartition::addFallMax(double d) {
-  hasFallMax_ = 1;
-  fallMax_ = d;
-}
-
-
-void defiPartition::addRiseMinRange(double l, double h) {
-  hasRiseMinRange_ = 1;
-  riseMinLeft_ = l;
-  riseMinRight_ = h;
-}
-
-
-void defiPartition::addRiseMaxRange(double l, double h) {
-  hasRiseMaxRange_ = 1;
-  riseMaxLeft_ = l;
-  riseMaxRight_ = h;
-}
-
-
-void defiPartition::addFallMinRange(double l, double h) {
-  hasFallMinRange_ = 1;
-  fallMinLeft_ = l;
-  fallMinRight_ = h;
-}
-
-
-void defiPartition::addFallMaxRange(double l, double h) {
-  hasFallMaxRange_ = 1;
-  fallMaxLeft_ = l;
-  fallMaxRight_ = h;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.hpp
deleted file mode 100644
index cab976e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPartition.hpp
+++ /dev/null
@@ -1,163 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiPartition_h
-#define defiPartition_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiPartition {
-public:
-  defiPartition(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiPartition();
-
-  void clear();
-
-  void setName(const char* name);
-  void addTurnOff(const char* setup, const char* hold);
-  void setFromClockPin(const char* inst, const char* pin);
-  void setFromCompPin(const char* inst, const char* pin);
-  void setFromIOPin(const char* inst);
-  void setToClockPin(const char* inst, const char* pin);
-  void setToCompPin(const char* inst, const char* pin);
-  void set(char dir, char typ, const char* inst, const char* pin);
-  void setToIOPin(const char* inst);
-  void setMin(double min, double max);
-  void setMax(double min, double max);
-  void addPin(const char* name);
-  void addRiseMin(double d);
-  void addRiseMax(double d);
-  void addFallMin(double d);
-  void addFallMax(double d);
-  void addRiseMinRange(double l, double h);
-  void addRiseMaxRange(double l, double h);
-  void addFallMinRange(double l, double h);
-  void addFallMaxRange(double l, double h);
-
-  const char* name() const;
-  char direction() const;
-  const char* itemType() const;  // "CLOCK" or "IO" or "COMP"
-  const char* pinName() const;
-  const char* instName() const;
-
-  int numPins() const;
-  const char* pin(int index) const;
-
-  int isSetupRise() const;
-  int isSetupFall() const;
-  int isHoldRise() const;
-  int isHoldFall() const;
-  int hasMin() const;
-  int hasMax() const;
-  int hasRiseMin() const;
-  int hasFallMin() const;
-  int hasRiseMax() const;
-  int hasFallMax() const;
-  int hasRiseMinRange() const;
-  int hasFallMinRange() const;
-  int hasRiseMaxRange() const;
-  int hasFallMaxRange() const;
-
-  double partitionMin() const;
-  double partitionMax() const;
-
-  double riseMin() const;
-  double fallMin() const;
-  double riseMax() const;
-  double fallMax() const;
-
-  double riseMinLeft() const;
-  double fallMinLeft() const;
-  double riseMaxLeft() const;
-  double fallMaxLeft() const;
-  double riseMinRight() const;
-  double fallMinRight() const;
-  double riseMaxRight() const;
-  double fallMaxRight() const;
-
-  // debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameLength_;
-  char setup_;
-  char hold_;
-  char hasMin_;
-  char hasMax_;
-  char direction_;   // 'F' or 'T'
-  char type_;        // 'L'-clock   'I'-IO  'C'-comp
-  char* inst_;
-  int instLength_;
-  char* pin_;
-  int pinLength_;
-  double min_, max_;
-
-  int numPins_;
-  int pinsAllocated_;
-  char** pins_;
-
-  char hasRiseMin_;
-  char hasFallMin_;
-  char hasRiseMax_;
-  char hasFallMax_;
-  char hasRiseMinRange_;
-  char hasFallMinRange_;
-  char hasRiseMaxRange_;
-  char hasFallMaxRange_;
-  double riseMin_;
-  double fallMin_;
-  double riseMax_;
-  double fallMax_;
-  double riseMinLeft_;
-  double fallMinLeft_;
-  double riseMaxLeft_;
-  double fallMaxLeft_;
-  double riseMinRight_;
-  double fallMinRight_;
-  double riseMaxRight_;
-  double fallMaxRight_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.cpp
deleted file mode 100644
index 586c40e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "defiPath.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defiPath::defiPath(defrData *data)
-: defData(data),
-keys_(NULL),
-data_(NULL),
-pointer_(NULL),
-numUsed_(0),
-numAllocated_(0),
-numX_(0),      
-numY_(0),
-stepX_(0),
-stepY_(0),
-deltaX_(0),
-deltaY_(0),
-mask_(0)
-{}
-
-
-defiPath::defiPath(defiPath *defiPathRef) 
-{
-    *this = *defiPathRef;
-
-    defiPathRef->pointer_ = NULL;
-    defiPathRef->keys_ = NULL;
-    defiPathRef->data_ = NULL;    
-}
-
-
-defiPath::~defiPath() {
-  Destroy();
-}
-
-
-void defiPath::Init() {
-  // Should do nothing in constructor case. 
-  Destroy();
-
-  numUsed_ = 0;
-  numAllocated_ = 0;
-  pointer_ = new int;
-  *pointer_ = -1;
-
-  numX_ = 0;      
-  numY_ = 0;
-  stepX_ = 0;
-  stepY_ = 0;
-  deltaX_ = 0;
-  deltaY_ = 0;
-  mask_ = 0;
-
-  bumpSize(16);
-}
-
-
-void defiPath::clear() {
-  int i;
-
-  for (i = 0; i < numUsed_; i++) {
-    free(data_[i]);
-    data_[i] = NULL;
-  }
-
-  numUsed_ = 0;
-
-  delete pointer_;
-  pointer_ = NULL;
-}
-
-
-void defiPath::Destroy() {
-
-  if (keys_)
-     free((char*)(keys_));
-     keys_ = NULL;
-  if (data_) {
-     clear();
-     free((char*)(data_));
-     data_ = NULL;
-  }
-}
-
-
-void defiPath::reverseOrder() {
-  int one = 0;
-  int two = numUsed_ - 1;
-  int t;
-  void *tptr;
-  while (one < two) {
-    t = keys_[one];
-    keys_[one] = keys_[two];
-    keys_[two] = t;
-    tptr = data_[one];
-    data_[one] = data_[two];
-    data_[two] = tptr;
-    one++;
-    two--;
-  }
-}
-
-
-void defiPath::initTraverse() const {
-  *(pointer_) = -1;
-}
-
-
-void defiPath::initTraverseBackwards() const {
-  *(pointer_) = numUsed_;
-}
-
-
-int 
-defiPath::currentType() const
-{
-    if (*(pointer_) >= 0 && *(pointer_) < numUsed_) {
-        switch (keys_[*(pointer_)]) {
-            case 'L': return DEFIPATH_LAYER;
-            case 'V': return DEFIPATH_VIA;
-            case 'W': return DEFIPATH_WIDTH;
-            case 'P': return DEFIPATH_POINT;
-            case 'F': return DEFIPATH_FLUSHPOINT;
-            case 'T': return DEFIPATH_TAPER;
-            case 'R': return DEFIPATH_TAPERRULE;
-            case 'S': return DEFIPATH_SHAPE;
-            case 'Y': return DEFIPATH_STYLE;
-            case 'O': return DEFIPATH_VIAROTATION;
-            case 'E': return DEFIPATH_RECT;
-            case 'D': return DEFIPATH_VIADATA;
-            case 'U': return DEFIPATH_VIRTUALPOINT;
-            case 'M': return DEFIPATH_MASK;
-            case 'C': return DEFIPATH_VIAMASK;
-            default : return DEFIPATH_DONE;
-        } 
-    }
-
-    return DEFIPATH_DONE;
-}
-
-int defiPath::next() const 
-{
-    (*(pointer_))++;
-
-    return currentType();
-}
-
-
-int defiPath::prev()  const{
-  (*(pointer_))--;
-
-  return currentType();
-}
-
-int defiPath::getTaper() const {
-  if (keys_[*(pointer_)] != 'T') return 0;
-  return 1;
-}
-
-const char* defiPath::getTaperRule() const {
-  if (keys_[*(pointer_)] != 'R') return 0;
-  return (char*)(data_[*(pointer_)]);
-}
-
-const char* defiPath::getLayer() const {
-  if (keys_[*(pointer_)] != 'L') return 0;
-  return (char*)(data_[*(pointer_)]);
-}
-
-
-const char* defiPath::getVia() const {
-  if (keys_[*(pointer_)] != 'V') return 0;
-  return (char*)(data_[*(pointer_)]);
-}
-
-
-const char* defiPath::getShape() const {
-  if (keys_[*(pointer_)] != 'S') return 0;
-  return (char*)(data_[*(pointer_)]);
-}
-
-
-int defiPath::getStyle() const {
-  int *style;
-  if (keys_[*(pointer_)] != 'Y') return 0;
-  style = (int*)(data_[*(pointer_)]);
-  return *style;
-}
-
-
-int defiPath::getWidth() const {
-  int *wptr;
-  if (keys_[*(pointer_)] != 'W') return 0;
-  wptr = (int*)(data_[*(pointer_)]);
-  return *wptr;
-}
-
-int defiPath::getViaRotation() const {
-  int *wptr;
-  if (keys_[*(pointer_)] != 'O') return 0;
-  wptr = (int*)(data_[*(pointer_)]);
-  return *wptr;
-}
-
-int defiPath::getMask() const {
-    int *wptr;
-    if (keys_[*(pointer_)] != 'M') return 0;
-    wptr = (int*)(data_[*(pointer_)]);
-    return *wptr;
-}
-
-int defiPath::getViaBottomMask() const {
-    int *wptr;
-    if (keys_[*(pointer_)] != 'C') return 0;
-    wptr = (int*)(data_[*(pointer_)]);
-
-    int viaMask = *wptr;
-
-    return viaMask % 10;
-}
-
-int defiPath::getViaCutMask() const {
-    int *wptr;
-    if (keys_[*(pointer_)] != 'C') return 0;
-    wptr = (int*)(data_[*(pointer_)]);
-
-    int viaMask = *wptr;
-
-    return viaMask / 10 % 10;
-}
-
-int defiPath::getViaTopMask() const {
-    int *wptr;
-    if (keys_[*(pointer_)] != 'C') return 0;
-    wptr = (int*)(data_[*(pointer_)]);
-
-    int viaMask = *wptr;
-
-    return viaMask / 100;
-}
-
-const char* defiPath::getViaRotationStr() const {
-  int *wptr;
-  if (keys_[*(pointer_)] != 'O') return 0;
-  wptr = (int*)(data_[*(pointer_)]);
-  return defiOrientStr(*wptr);
-}
-
-void defiPath::getViaRect(int* deltaX1, int* deltaY1, int* deltaX2, int* deltaY2) const {
-    if (keys_[*(pointer_)] != 'E') return ;
-    *deltaX1 = ((struct defiViaRect*)(data_[*(pointer_)]))->deltaX1;
-    *deltaY1 = ((struct defiViaRect*)(data_[*(pointer_)]))->deltaY1;
-    *deltaX2 = ((struct defiViaRect*)(data_[*(pointer_)]))->deltaX2;
-    *deltaY2 = ((struct defiViaRect*)(data_[*(pointer_)]))->deltaY2;
-}
-
-void defiPath::getViaData(int* numX, int* numY, int* stepX, int* stepY) const {
-  if (keys_[*(pointer_)] != 'D') return ;
-  *numX = ((struct defiViaData*)(data_[*(pointer_)]))->numX;
-  *numY = ((struct defiViaData*)(data_[*(pointer_)]))->numY;
-  *stepX = ((struct defiViaData*)(data_[*(pointer_)]))->stepX;
-  *stepY = ((struct defiViaData*)(data_[*(pointer_)]))->stepY;
-}
-
-
-void defiPath::getFlushPoint(int* x, int* y, int* ext) const {
-  if (keys_[*(pointer_)] != 'F') return ;
-  *x = ((struct defiPnt*)(data_[*(pointer_)]))->x;
-  *y = ((struct defiPnt*)(data_[*(pointer_)]))->y;
-  *ext = ((struct defiPnt*)(data_[*(pointer_)]))->ext;
-}
-
-void defiPath::getVirtualPoint(int* x, int* y) const {
-    if (keys_[*(pointer_)] != 'U') return ;
-    *x = ((struct defiPnt*)(data_[*(pointer_)]))->x;
-    *y = ((struct defiPnt*)(data_[*(pointer_)]))->y;
-}
-
-void defiPath::getPoint(int* x, int* y) const {
-  if (keys_[*(pointer_)] != 'P') return ;
-  *x = ((struct defiPnt*)(data_[*(pointer_)]))->x;
-  *y = ((struct defiPnt*)(data_[*(pointer_)]))->y;
-}
-
-
-void defiPath::addWidth(int w) {
-  int * wValue;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  wValue = (int*)malloc(sizeof(int));
-  *wValue = w;
-  keys_[numUsed_] = 'W';
-  data_[numUsed_] = wValue;
-  (numUsed_)++;
-}
-
-
-void defiPath::addVia(const char* l) {
-  int len = strlen(l)+1;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'V';
-  data_[numUsed_] = malloc(len);
-  strcpy((char*)(data_[numUsed_]), defData->DEFCASE(l));
-  (numUsed_)++;
-}
-
-
-void defiPath::addViaRotation(int o) {
-  int * orient;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  orient = (int*)malloc(sizeof(int));
-  *orient = o;
-  keys_[numUsed_] = 'O';
-  data_[numUsed_] = orient;
-  (numUsed_)++;
-}
-
-
-void defiPath::addViaRect(int deltaX1, int deltaY1, int deltaX2, int deltaY2) {
-    if (numUsed_ == numAllocated_)
-        bumpSize(numAllocated_ * 2);
-    keys_[numUsed_] = 'E';  // RECT
-    data_[numUsed_] = malloc(sizeof(struct defiViaRect));
-    ((struct defiViaRect*)(data_[numUsed_]))->deltaX1 = deltaX1;
-    ((struct defiViaRect*)(data_[numUsed_]))->deltaY1 = deltaY1;
-    ((struct defiViaRect*)(data_[numUsed_]))->deltaX2 = deltaX2;
-    ((struct defiViaRect*)(data_[numUsed_]))->deltaY2 = deltaY2;
-    (numUsed_)++;
-}
-
-
-void defiPath::addViaData(int numX, int numY, int stepX, int stepY) {
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'D';
-  data_[numUsed_] = malloc(sizeof(struct defiViaData));
-  ((struct defiViaData*)(data_[numUsed_]))->numX = numX;
-  ((struct defiViaData*)(data_[numUsed_]))->numY = numY;
-  ((struct defiViaData*)(data_[numUsed_]))->stepX = stepX;
-  ((struct defiViaData*)(data_[numUsed_]))->stepY = stepY;
-  (numUsed_)++;
-}
-
-
-void defiPath::addLayer(const char* l) {
-  int len = strlen(l)+1;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'L' ;
-  data_[numUsed_] = malloc(len);
-  strcpy((char*)(data_[numUsed_]), defData->DEFCASE(l));
-  (numUsed_)++;
-}
-
-
-void defiPath::addTaperRule(const char* l) {
-  int len = strlen(l)+1;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'R' ;
-  data_[numUsed_] = malloc(len);
-  strcpy((char*)(data_[numUsed_]), defData->DEFCASE(l));
-  (numUsed_)++;
-}
-
-
-void defiPath::addPoint(int x, int y) {
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'P';
-  data_[numUsed_] = malloc(sizeof(struct defiPnt));
-  ((struct defiPnt*)(data_[numUsed_])) -> x = x;
-  ((struct defiPnt*)(data_[numUsed_])) -> y = y;
-  (numUsed_)++;
-}
-
-void defiPath::addMask(int colorMask) {
-    int* mask;
-    if (numUsed_ == numAllocated_)
-        bumpSize(numAllocated_ * 2);
-    mask = (int*)malloc(sizeof(int));
-    *mask = colorMask;
-    keys_[numUsed_] = 'M';  //Mask for points
-    data_[numUsed_] = mask;
-    (numUsed_)++;
-}
-
-void defiPath::addViaMask(int colorMask) {
-    int* mask;
-    if (numUsed_ == numAllocated_)
-        bumpSize(numAllocated_ * 2);
-    mask = (int*)malloc(sizeof(int));
-    *mask = colorMask;
-    keys_[numUsed_] = 'C';  //viaMask
-    data_[numUsed_] = mask;
-    (numUsed_)++;
-}
-
-void defiPath::addFlushPoint(int x, int y, int ext) {
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'F';
-  data_[numUsed_] = malloc(sizeof(struct defiPnt));
-  ((struct defiPnt*)(data_[numUsed_])) -> x = x;
-  ((struct defiPnt*)(data_[numUsed_])) -> y = y;
-  ((struct defiPnt*)(data_[numUsed_])) -> ext = ext;
-  (numUsed_)++;
-}
-
-void defiPath::addVirtualPoint(int x, int y) {
-    if (numUsed_ == numAllocated_)
-        bumpSize(numAllocated_ * 2);
-    keys_[numUsed_] = 'U';
-    data_[numUsed_] = malloc(sizeof(struct defiPnt));
-    ((struct defiPnt*)(data_[numUsed_])) -> x = x;
-    ((struct defiPnt*)(data_[numUsed_])) -> y = y;
-    (numUsed_)++;
-}
-
-void defiPath::setTaper() {
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'T';
-  data_[numUsed_] = 0;
-  (numUsed_)++;
-}
-
-
-void defiPath::addShape(const char* l) {
-  int len = strlen(l)+1;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  keys_[numUsed_] = 'S' ;
-  data_[numUsed_] = malloc(len);
-  strcpy((char*)(data_[numUsed_]), defData->DEFCASE(l));
-  (numUsed_)++;
-}
-
-void defiPath::addStyle(int s) {
-  int *style;
-  if (numUsed_ == numAllocated_)
-    bumpSize(numAllocated_ * 2);
-  style = (int*)malloc(sizeof(int));
-  *style = s;
-  keys_[numUsed_] = 'Y' ;
-  data_[numUsed_] = style;
-  (numUsed_)++;
-}
-
-
-void defiPath::print(FILE* fout) const {
-  int i;
-  int *wptr;
-  if (fout == 0) fout = stdout;
-  fprintf(fout, "Path:\n");
-  for (i = 0; i < numUsed_; i++) {
-    if (keys_[i] == 'L') {
-        fprintf(fout, " layer %s\n", (char*)(data_[i]));
-    } else if (keys_[i] == 'R') {
-        fprintf(fout, " taperrule %s\n", data_[i] ? (char*)(data_[i]) : "" );
-    } else if (keys_[i] == 'T') {
-        fprintf(fout, " taper %s\n", data_[i] ? (char*)(data_[i]) : "" );
-    } else if (keys_[i] == 'S') {
-        fprintf(fout, " shape %s\n", data_[i] ? (char*)(data_[i]) : "" );
-    } else if (keys_[i] == 'V') {
-        fprintf(fout, " via %s\n", data_[i] ? (char*)(data_[i]) : "" );
-    } else if (keys_[i] == 'O') {
-        fprintf(fout, " via rotation %s\n",
-                data_[i] ? (char*)(data_[i]) : "" );
-    } else if (keys_[i] == 'M') {
-        fprintf(fout, " mask %d\n", getMask() );
-    } else if (keys_[i] == 'E') {
-        fprintf(fout, " rect %d,%d,%d,%d\n",
-                ((struct defiViaRect*)(data_[i]))->deltaX1,
-                ((struct defiViaRect*)(data_[i]))->deltaY1,
-                ((struct defiViaRect*)(data_[i]))->deltaX2,
-                ((struct defiViaRect*)(data_[i]))->deltaY2);
-    } else if (keys_[i] == 'W') {
-        wptr = (int*)(data_[i]);
-        fprintf(fout, " width %d\n", *wptr);
-    } else if (keys_[i] == 'P') {
-        fprintf(fout, " point %d,%d\n",
-                ((struct defiPnt*)(data_[i]))->x,
-                ((struct defiPnt*)(data_[i]))->y);
-    } else if (keys_[i] == 'F') {
-        fprintf(fout, " flushpoint %d,%d,%d\n",
-                ((struct defiPnt*)(data_[i]))->x,
-                ((struct defiPnt*)(data_[i]))->y,
-                ((struct defiPnt*)(data_[i]))->ext);
-    } else if (keys_[i] == 'U') {
-        fprintf(fout, " virtualpoint %d,%d\n",
-            ((struct defiPnt*)(data_[i]))->x,
-            ((struct defiPnt*)(data_[i]))->y);
-    } else if (keys_[i] == 'D') {
-      fprintf(fout, " DO %d BY %d STEP %d %d\n",
-              ((struct defiViaData*)(data_[i]))->numX,
-              ((struct defiViaData*)(data_[i]))->numY,
-              ((struct defiViaData*)(data_[i]))->stepX,
-              ((struct defiViaData*)(data_[i]))->stepY);
-    } else {
-      fprintf(fout, " ERROR\n");
-    }
-  }
-}
-
-
-void defiPath::bumpSize(int size) {
-  int i;
-  int* newKeys = (int*)malloc(size * sizeof(int*));
-  void** newData = (void**)malloc(size * sizeof(void*));
-
-  for (i = 0; i < numUsed_; i++) {
-    newKeys[i] = keys_[i];
-    newData[i] = data_[i];
-  }
-
-  if (keys_) free((char*)(keys_));
-  if (data_) free((char*)(data_));
-
-  keys_ = newKeys;
-  data_ = newData;
-  numAllocated_ = size;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.hpp
deleted file mode 100644
index 73b4425..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPath.hpp
+++ /dev/null
@@ -1,170 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiPath_h
-#define defiPath_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// TX_DIR:TRANSLATION ON
-
-class defrData;
-
-struct defiPnt {
-  int x;
-  int y;
-  int ext;
-};
-
-// 5.4.1 1-D & 2-D Arrays of Vias in SPECIALNET Section
-struct defiViaData {
-  int numX;
-  int numY;
-  int stepX;
-  int stepY;
-};
-
-struct defiViaRect {
-  int deltaX1;
-  int deltaY1;
-  int deltaX2;
-  int deltaY2;
-};
-
-// value returned by the next() routine.
-enum defiPath_e {
-  DEFIPATH_DONE = 0,
-  DEFIPATH_LAYER,
-  DEFIPATH_VIA,
-  DEFIPATH_VIAROTATION,
-  DEFIPATH_WIDTH,
-  DEFIPATH_POINT,
-  DEFIPATH_FLUSHPOINT,
-  DEFIPATH_TAPER,
-  DEFIPATH_SHAPE,
-  DEFIPATH_STYLE,
-  DEFIPATH_TAPERRULE,
-  DEFIPATH_VIADATA,
-  DEFIPATH_RECT,
-  DEFIPATH_VIRTUALPOINT,
-  DEFIPATH_MASK,
-  DEFIPATH_VIAMASK
-  } ;
-
-
-class defiPath {
-public:
-  defiPath(defrData *data);
-  // This is 'data ownership transfer' constructor.
-  defiPath(defiPath *defiPathRef);
-
-  void Init();
-
-  void Destroy();
-  ~defiPath();
-
-  void clear();
-  void reverseOrder();
-
-  // To traverse the path and get the parts.
-  void initTraverse() const;   // Initialize the traverse.
-  void initTraverseBackwards() const;   // Initialize the traverse in reverse.
-  int next() const;            // Get the next element.
-  int prev() const;            // Get the next element in reverse.
-  const char* getLayer() const;// Get the layer.
-  const char* getTaperRule() const;// Get the rule.
-  const char* getVia() const;  // Get the via.
-  const char* getShape() const;// Get the shape.
-  int  getTaper() const;// Get the taper.
-  int  getStyle() const;// Get the style.
-  int  getViaRotation() const;  // Get the via rotation.
-  void getViaRect(int* deltaX1, int* deltaY1, int* deltaX2, int* deltaY2) const;
-  const char* getViaRotationStr() const;   // Return via rotation in string format
-  void getViaData(int* numX, int* numY, int* stepX, int* stepY) const;  // 5.4.1
-  int  getWidth() const;        // Get the width.
-  void getPoint(int* x, int* y) const;// Get the point.
-  void getFlushPoint(int* x, int* y, int* ext) const;// Get the point.
-  void getVirtualPoint(int* x, int* y) const;
-  int  getMask() const;
-  int  getViaTopMask() const;
-  int  getViaCutMask() const;
-  int  getViaBottomMask() const;
-  int  getRectMask() const;
-
-
-  // These routines are called by the parser to fill the path.
-  void addWidth(int w);
-  void addPoint(int x, int y);
-  void addFlushPoint(int x, int y, int ext);
-  void addVirtualPoint(int x, int y);
-  void addLayer(const char* layer);
-  void addVia(const char* name);
-  void addViaRotation(int orient);
-  void addViaRect(int deltaX1, int deltaY1, int deltaX2, int deltaY2);
-  void addMask(int colorMask);
-  void addViaMask(int colorMask);
-  void addViaData(int numX, int numY, int stepX, int stepY);   // 5.4.1
-  void setTaper();
-  void addTaperRule(const char* rule);
-  void addShape(const char* shape);
-  void addStyle(int style);
-
-  // debug printing
-  void print(FILE* fout) const;
-
-  void bumpSize(int size);
-
-protected:
-  int currentType() const;
-
-  int* keys_;           // type of item in path
-  void** data_;         // extra data
-  int numUsed_;         // number of items used in array
-  int numAllocated_;    // allocated size of keys and data
-  int* pointer_;        // traversal pointer, allocated because used
-                        // as iterator in const traversal functions.
-  int numX_;      
-  int numY_;
-  int stepX_;
-  int stepY_;
-  int deltaX_;
-  int deltaY_;
-  int mask_;
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.cpp
deleted file mode 100644
index 323e30f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.cpp
+++ /dev/null
@@ -1,2152 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "defiPinCap.hpp"
-#include "defiComponent.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-//
-//     defiPinCap
-//
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-
-
-void defiPinCap::setPin(int p) {
-  pin_ = p;
-}
-
-
-void defiPinCap::setCap(double d) {
-  cap_ = d;
-}
-
-
-int defiPinCap::pin() const {
-  return pin_;
-}
-
-
-double defiPinCap::cap() const {
-  return cap_;
-}
-
-
-void defiPinCap::print(FILE* f) const {
-  fprintf(f, "PinCap  %d %5.2f\n", pin_, cap_);
-}
-
-
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-//
-//     defiPinAntennaModel
-//
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-
-defiPinAntennaModel::defiPinAntennaModel(defrData *data)
- : oxide_(0),
-   defData(data)
-{
-  Init();
-}
-
-
-void defiPinAntennaModel::Init() {
-  numAPinGateArea_ = 0;                       // 5.4
-  APinGateAreaAllocated_ = 0;                 // 5.4
-  APinGateArea_ = 0;
-  APinGateAreaLayer_ = 0;
-  numAPinMaxAreaCar_ = 0;                     // 5.4
-  APinMaxAreaCarAllocated_ = 0;               // 5.4
-  APinMaxAreaCar_ = 0;
-  APinMaxAreaCarLayer_ = 0;
-  numAPinMaxSideAreaCar_ = 0;                 // 5.4
-  APinMaxSideAreaCarAllocated_ = 0;           // 5.4
-  APinMaxSideAreaCar_ = 0;
-  APinMaxSideAreaCarLayer_ = 0;
-  numAPinMaxCutCar_ = 0;                      // 5.4
-  APinMaxCutCarAllocated_ = 0;                // 5.4
-  APinMaxCutCar_ = 0;
-  APinMaxCutCarLayer_ = 0;
-}
-
-defiPinAntennaModel::~defiPinAntennaModel() {
-  Destroy();
-}
-
-
-void defiPinAntennaModel::clear() {
-  int i;
-
-  if (oxide_)
-    free((char*)(oxide_));
-  oxide_ = 0;
-
-  for (i = 0; i < numAPinGateArea_; i++) {
-    if (APinGateAreaLayer_[i])
-       free(APinGateAreaLayer_[i]);
-  }
-  numAPinGateArea_ = 0;
-
-  for (i = 0; i < numAPinMaxAreaCar_; i++) {
-    if (APinMaxAreaCarLayer_[i])
-       free(APinMaxAreaCarLayer_[i]);
-  }
-  numAPinMaxAreaCar_ = 0;
-
-  for (i = 0; i < numAPinMaxSideAreaCar_; i++) {
-    if (APinMaxSideAreaCarLayer_[i])
-       free(APinMaxSideAreaCarLayer_[i]);
-  }
-  numAPinMaxSideAreaCar_ = 0;
-
-  for (i = 0; i < numAPinMaxCutCar_; i++) {
-    if (APinMaxCutCarLayer_[i])
-       free(APinMaxCutCarLayer_[i]);
-  }
-  numAPinMaxCutCar_ = 0;
-}
-
-void defiPinAntennaModel::Destroy() {
-  clear();
-  if (APinGateArea_)
-     free((char*)(APinGateArea_));
-  if (APinGateAreaLayer_)
-     free((char*)(APinGateAreaLayer_));
-  if (APinMaxAreaCar_)
-     free((char*)(APinMaxAreaCar_));
-  if (APinMaxAreaCarLayer_)
-     free((char*)(APinMaxAreaCarLayer_));
-  if (APinMaxSideAreaCar_)
-     free((char*)(APinMaxSideAreaCar_));
-  if (APinMaxSideAreaCarLayer_)
-     free((char*)(APinMaxSideAreaCarLayer_));
-  if (APinMaxCutCar_)
-     free((char*)(APinMaxCutCar_));
-  if (APinMaxCutCarLayer_)
-     free((char*)(APinMaxCutCarLayer_));
-}
-
-// 5.5
-void defiPinAntennaModel::setAntennaModel(int aOxide) {
-  switch (aOxide) {
-     case 2:
-           oxide_ = strdup("OXIDE2");
-           break;
-     case 3:
-           oxide_ = strdup("OXIDE3");
-           break;
-     case 4:
-           oxide_ = strdup("OXIDE4");
-           break;
-     default:
-           oxide_ = strdup("OXIDE1");
-           break;
-  }
-}
-
-void defiPinAntennaModel::addAPinGateArea(int value, const char* layer) {
-  if (numAPinGateArea_ == APinGateAreaAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinGateArea_;
-     int* nd;
-     char**  nl;
-
-     if (APinGateAreaAllocated_ == 0)
-        max = APinGateAreaAllocated_ = 2;
-     else
-        max = APinGateAreaAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinGateArea_[i];
-        nl[i] = APinGateAreaLayer_[i];
-     }
-     free((char*)(APinGateArea_));
-     free((char*)(APinGateAreaLayer_));
-     APinGateArea_ = nd;
-     APinGateAreaLayer_ = nl;
-
-  }
-  APinGateArea_[numAPinGateArea_] = value;
-  if (layer) {
-    APinGateAreaLayer_[numAPinGateArea_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinGateAreaLayer_[numAPinGateArea_],
-       defData->DEFCASE(layer));
-  } else
-    APinGateAreaLayer_[numAPinGateArea_] = NULL;
-  numAPinGateArea_ += 1;
-}
-
-void defiPinAntennaModel::addAPinMaxAreaCar(int value, const char* layer) {
-  if (numAPinMaxAreaCar_ == APinMaxAreaCarAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinMaxAreaCar_;
-     int* nd;
-     char**  nl;
-
-     if (APinMaxAreaCarAllocated_ == 0)
-        max = APinMaxAreaCarAllocated_ = 2;
-     else
-        max = APinMaxAreaCarAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinMaxAreaCar_[i];
-        nl[i] = APinMaxAreaCarLayer_[i];
-     }
-     free((char*)(APinMaxAreaCar_));
-     free((char*)(APinMaxAreaCarLayer_));
-     APinMaxAreaCar_ = nd;
-     APinMaxAreaCarLayer_ = nl;
-
-  }
-  APinMaxAreaCar_[numAPinMaxAreaCar_] = value;
-  if (layer) {
-    APinMaxAreaCarLayer_[numAPinMaxAreaCar_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinMaxAreaCarLayer_[numAPinMaxAreaCar_],
-       defData->DEFCASE(layer));
-  } else
-    APinMaxAreaCarLayer_[numAPinMaxAreaCar_] = NULL;
-  numAPinMaxAreaCar_ += 1;
-}
-
-void defiPinAntennaModel::addAPinMaxSideAreaCar(int value, const char* layer) {
-  if (numAPinMaxSideAreaCar_ == APinMaxSideAreaCarAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinMaxSideAreaCar_;
-     int* nd;
-     char**  nl;
-
-     if (APinMaxSideAreaCarAllocated_ == 0)
-        max = APinMaxSideAreaCarAllocated_ = 2;
-     else
-        max = APinMaxSideAreaCarAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinMaxSideAreaCar_[i];
-        nl[i] = APinMaxSideAreaCarLayer_[i];
-     }
-     free((char*)(APinMaxSideAreaCar_));
-     free((char*)(APinMaxSideAreaCarLayer_));
-     APinMaxSideAreaCar_ = nd;
-     APinMaxSideAreaCarLayer_ = nl;
-
-  }
-  APinMaxSideAreaCar_[numAPinMaxSideAreaCar_] = value;
-  if (layer) {
-    APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_],
-       defData->DEFCASE(layer));
-  } else
-    APinMaxSideAreaCarLayer_[numAPinMaxSideAreaCar_] = NULL;
-  numAPinMaxSideAreaCar_ += 1;
-}
-
-void defiPinAntennaModel::addAPinMaxCutCar(int value, const char* layer) {
-  if (numAPinMaxCutCar_ == APinMaxCutCarAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinMaxCutCar_;
-     int* nd;
-     char**  nl;
-
-     if (APinMaxCutCarAllocated_ == 0)
-        max = APinMaxCutCarAllocated_ = 2;
-     else
-        max = APinMaxCutCarAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinMaxCutCar_[i];
-        nl[i] = APinMaxCutCarLayer_[i];
-     }
-     free((char*)(APinMaxCutCar_));
-     free((char*)(APinMaxCutCarLayer_));
-     APinMaxCutCar_ = nd;
-     APinMaxCutCarLayer_ = nl;
-
-  }
-  APinMaxCutCar_[numAPinMaxCutCar_] = value;
-  if (layer) {
-    APinMaxCutCarLayer_[numAPinMaxCutCar_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinMaxCutCarLayer_[numAPinMaxCutCar_],
-       defData->DEFCASE(layer));
-  } else
-    APinMaxCutCarLayer_[numAPinMaxCutCar_] = NULL;
-  numAPinMaxCutCar_ += 1;
-}
-
-// 5.5
-char* defiPinAntennaModel::antennaOxide() const {
-  return oxide_;
-}
-
-int defiPinAntennaModel::hasAPinGateArea() const {
-  return numAPinGateArea_ ? 1 : 0 ;
-}
-
-int defiPinAntennaModel::hasAPinMaxAreaCar() const {
-  return numAPinMaxAreaCar_ ? 1 : 0 ;
-}
-
-int defiPinAntennaModel::hasAPinMaxSideAreaCar() const {
-  return numAPinMaxSideAreaCar_ ? 1 : 0 ;
-}
-
-int defiPinAntennaModel::hasAPinMaxCutCar() const {
-  return numAPinMaxCutCar_ ? 1 : 0 ;
-}
-
-int defiPinAntennaModel::numAPinGateArea() const {
-  return numAPinGateArea_;
-}
-
-int defiPinAntennaModel::numAPinMaxAreaCar() const {
-  return numAPinMaxAreaCar_;
-}
-
-int defiPinAntennaModel::numAPinMaxSideAreaCar() const {
-  return numAPinMaxSideAreaCar_;
-}
-
-int defiPinAntennaModel::numAPinMaxCutCar() const {
-  return numAPinMaxCutCar_;
-}
-
-int defiPinAntennaModel::APinGateArea(int i) const {
-  return APinGateArea_[i];
-}
-
-int defiPinAntennaModel::hasAPinGateAreaLayer(int i) const {
-  return (APinGateAreaLayer_[i] && *(APinGateAreaLayer_[i])) ?
-          1 : 0;
-}
-
-const char* defiPinAntennaModel::APinGateAreaLayer(int i) const {
-  return APinGateAreaLayer_[i];
-}
-
-int defiPinAntennaModel::APinMaxAreaCar(int i) const {
-  return APinMaxAreaCar_[i];
-}
-
-int defiPinAntennaModel::hasAPinMaxAreaCarLayer(int i) const {
-  return (APinMaxAreaCarLayer_[i] && *(APinMaxAreaCarLayer_[i])) ?
-          1 : 0;
-}
-
-const char* defiPinAntennaModel::APinMaxAreaCarLayer(int i) const {
-  return APinMaxAreaCarLayer_[i];
-}
-
-int defiPinAntennaModel::APinMaxSideAreaCar(int i) const {
-  return APinMaxSideAreaCar_[i];
-}
-
-int defiPinAntennaModel::hasAPinMaxSideAreaCarLayer(int i) const {
-  return (APinMaxSideAreaCarLayer_[i] &&
-          *(APinMaxSideAreaCarLayer_[i])) ? 1 : 0;
-}
-
-const char* defiPinAntennaModel::APinMaxSideAreaCarLayer(int i) const {
-  return APinMaxSideAreaCarLayer_[i];
-}
-
-int defiPinAntennaModel::APinMaxCutCar(int i) const {
-  return APinMaxCutCar_[i];
-}
-
-int defiPinAntennaModel::hasAPinMaxCutCarLayer(int i) const {
-  return (APinMaxCutCarLayer_[i] &&
-          *(APinMaxCutCarLayer_[i])) ? 1 : 0;
-}
-
-const char* defiPinAntennaModel::APinMaxCutCarLayer(int i) const {
-  return APinMaxCutCarLayer_[i];
-}
-
-
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-//
-//     defiPinPort
-//
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-
-defiPinPort::defiPinPort(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-void defiPinPort::Init() {
-  layersAllocated_ = 0;
-  numLayers_ = 0;
-  layers_ = 0;
-  layerMinSpacing_ = 0;
-  layerMask_ = 0;
-  layerEffectiveWidth_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  polysAllocated_ = 0;
-  numPolys_ = 0;
-  polygonNames_ = 0;
-  polyMinSpacing_ = 0;
-  polyMask_ = 0;
-  polyEffectiveWidth_ = 0;
-  polygons_ = 0;
-  viasAllocated_ = 0;
-  numVias_ = 0;
-  viaNames_ = 0;
-  viaX_ = 0;
-  viaY_ = 0;
-  viaMask_ = 0;
-  placeType_ = 0;
-  x_ = 0;
-   y_ = 0;
-  orient_ = 0;
-}
-
-defiPinPort::~defiPinPort() {
-  clear();
-}
-
-void defiPinPort::clear() {
-  int i;
-
-  placeType_ = 0;
-  orient_ = 0;
-  x_ = 0;
-  y_ = 0;
-
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++)
-      if (layers_[i]) free(layers_[i]);
-    free((char*)(layers_));
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    free((char*)(layerMinSpacing_));
-    free((char*)(layerMask_));
-    free((char*)(layerEffectiveWidth_));
-  }
-  layers_ = 0;
-  layerMinSpacing_ = 0;
-  layerEffectiveWidth_ = 0;
-  layerMask_ = 0;
-  numLayers_ = 0;
-  layersAllocated_ = 0;
-  if (polygonNames_) {
-    struct defiPoints* p;
-    for (i = 0; i < numPolys_; i++) {
-      if (polygonNames_[i]) free((char*)(polygonNames_[i]));
-      p = polygons_[i];
-      free((char*)(p->x));
-      free((char*)(p->y));
-      free((char*)(polygons_[i]));
-    }
-    free((char*)(polygonNames_));
-    free((char*)(polygons_));
-    free((char*)(polyMinSpacing_));
-    free((char*)(polyMask_));
-    free((char*)(polyEffectiveWidth_));
-    polygonNames_ = 0;
-    polygons_ = 0;
-    polyMinSpacing_ = 0;
-    polyEffectiveWidth_ = 0;
-    polyMask_ = 0;
-  }
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-  if (viaNames_) {
-    for (i = 0; i < numVias_; i++)
-      if (viaNames_[i]) free(viaNames_[i]);
-    free((char*)(viaNames_));
-    free((char*)(viaX_));
-    free((char*)(viaY_));
-    free((char*)(viaMask_));
-  }
-  viaNames_ = 0;
-  numVias_ = 0;
-  viasAllocated_ = 0;
-  viaMask_ = 0;
-}
-
-void defiPinPort::addLayer(const char* layer) {
-  if (numLayers_ >= layersAllocated_) {
-    int i;
-    char** newl;
-    int *nxl, *nyl, *nxh, *nyh;
-    int *lms, *lew, *lm;
-
-    layersAllocated_ = layersAllocated_ ?
-                             layersAllocated_ * 2 : 8;
-    newl = (char**)malloc(layersAllocated_ * sizeof(char*));
-    nxl = (int*)malloc(layersAllocated_ * sizeof(int));
-    nyl = (int*)malloc(layersAllocated_ * sizeof(int));
-    nxh = (int*)malloc(layersAllocated_ * sizeof(int));
-    nyh = (int*)malloc(layersAllocated_ * sizeof(int));
-    lms = (int*)malloc(layersAllocated_ * sizeof(int));
-    lew = (int*)malloc(layersAllocated_ * sizeof(int));
-    lm = (int*)malloc(layersAllocated_ * sizeof(int));
-
-    for (i = 0; i < numLayers_; i++) {
-       newl[i] = layers_[i];
-       nxl[i] = xl_[i];
-       nyl[i] = yl_[i];
-       nxh[i] = xh_[i];
-       nyh[i] = yh_[i];
-       lms[i] = layerMinSpacing_[i];
-       lew[i] = layerEffectiveWidth_[i];
-       lm[i] = layerMask_[i];
-    }
-    if (numLayers_ > 0) {
-       free((char*)layers_);
-       free((char*)xl_);
-       free((char*)yl_);
-       free((char*)xh_);
-       free((char*)yh_);
-       free((char*)layerMinSpacing_);
-       free((char*)layerEffectiveWidth_);
-       free((char*)layerMask_);
-    }
-    layers_ = newl;
-    xl_ = nxl;
-    yl_ = nyl;
-    xh_ = nxh;
-    yh_ = nyh;
-    layerMinSpacing_ = lms;
-    layerEffectiveWidth_ = lew;
-    layerMask_ = lm;
-  }
-  layers_[numLayers_] = (char*)malloc(strlen(layer)+1);
-  strcpy(layers_[numLayers_], defData->DEFCASE(layer));
-  xl_[numLayers_] = 0;
-  yl_[numLayers_] = 0;
-  xh_[numLayers_] = 0;
-  yh_[numLayers_] = 0;
-  layerMinSpacing_[numLayers_] = -1;
-  layerEffectiveWidth_[numLayers_] = -1;
-  layerMask_[numLayers_] = 0;
-  numLayers_ += 1;
-}
-
-void defiPinPort::addLayerSpacing(int minSpacing) {
-  layerMinSpacing_[numLayers_-1] = minSpacing;
-}
-
-void defiPinPort::addLayerMask(int mask) {
-  layerMask_[numLayers_-1] = mask;
-}
-
-void defiPinPort::addLayerDesignRuleWidth(int effectiveWidth) {
-  layerEffectiveWidth_[numLayers_-1] = effectiveWidth;
-}
-
-void defiPinPort::addLayerPts(int xl, int yl, int xh, int yh) {
-  xl_[numLayers_-1] = xl;
-  yl_[numLayers_-1] = yl;
-  xh_[numLayers_-1] = xh;
-  yh_[numLayers_-1] = yh;
-}
-
-void defiPinPort::addPolygon(const char* layerName) {
-  int *pms, *pdw, *pm;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    char** newn;
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    newn = (char**)malloc(sizeof(char*) * polysAllocated_);
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    pms = (int*)malloc(polysAllocated_ * sizeof(int));
-    pdw = (int*)malloc(polysAllocated_ * sizeof(int));
-    pm = (int*)malloc(polysAllocated_ * sizeof(int));
-
-    for (i = 0; i < numPolys_; i++) {
-      newn[i] = polygonNames_[i];
-      poly[i] = polygons_[i];
-      pms[i]  = polyMinSpacing_[i];
-      pdw[i]  = polyEffectiveWidth_[i];
-      pm[i] = polyMask_[i];
-    }
-    if (numPolys_ > 0) {
-      free((char*)(polygons_));
-      free((char*)(polygonNames_));
-      free((char*)(polyMinSpacing_));
-      free((char*)(polyEffectiveWidth_));
-      free((char*)(polyMask_));
-    }
-    polygonNames_ = newn;
-    polygons_ = poly;
-    polyMinSpacing_ = pms;
-    polyEffectiveWidth_ = pdw;
-    polyMask_ = pm;
-  }
-  polygonNames_[numPolys_] = strdup(layerName);
-  polygons_[numPolys_] = 0;
-  polyMinSpacing_[numPolys_] = -1;
-  polyEffectiveWidth_[numPolys_] = -1;
-  polyMask_[numPolys_] = 0;
-  numPolys_ += 1;
-}
-
-void defiPinPort::addPolySpacing(int minSpacing) {
-  polyMinSpacing_[numPolys_-1] = minSpacing;
-}
-
-void defiPinPort::addPolyMask(int color) {
-    polyMask_[numPolys_-1] = color;
-}
-
-void defiPinPort::addPolyDesignRuleWidth(int effectiveWidth) {
-  polyEffectiveWidth_[numPolys_-1] = effectiveWidth;
-}
-
-void defiPinPort::addPolygonPts(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_-1] = p;
-}
-
-
-void defiPinPort::addVia(const char* viaName, int ptX, int ptY, int color) {
-  if (numVias_ >= viasAllocated_) {
-    int i;
-    char** newl;
-    int *nx, *ny, *nm;
-
-    viasAllocated_ = viasAllocated_ ?
-                           viasAllocated_ * 2 : 8;
-    newl = (char**)malloc(viasAllocated_ * sizeof(char*));
-    nx = (int*)malloc(viasAllocated_ * sizeof(int));
-    ny = (int*)malloc(viasAllocated_ * sizeof(int));
-    nm = (int*)malloc(viasAllocated_ * sizeof(int));
-    for (i = 0; i < numVias_; i++) {
-       newl[i] = viaNames_[i];
-       nx[i] = viaX_[i];
-       ny[i] = viaY_[i];
-       nm[i] = viaMask_[i];
-    }
-    if (numVias_ > 0) {
-       free((char*)viaNames_);
-       free((char*)viaX_);
-       free((char*)viaY_);
-       free((char*)viaMask_);
-    }
-    viaNames_ = newl;
-    viaX_ = nx;
-    viaY_ = ny;
-    viaMask_ = nm;
-  }
-  viaNames_[numVias_] = (char*)malloc(strlen(viaName)+1);
-  strcpy(viaNames_[numVias_], defData->DEFCASE(viaName));
-  viaX_[numVias_] = ptX;
-  viaY_[numVias_] = ptY;
-  viaMask_[numVias_] = color;
-  numVias_ += 1;
-}
-
-void defiPinPort::setPlacement(int typ, int x, int y, int orient) {
-  x_ = x;
-  y_ = y;
-  orient_ = orient;
-  placeType_ = typ;
-}
-
-int defiPinPort::numLayer() const {
-  return numLayers_;
-}
-
-const char* defiPinPort::layer(int index) const {
-  return layers_[index];
-}
-
-void defiPinPort::bounds(int index, int* xl, int* yl, int* xh, int* yh) const {
-  if (xl) *xl = xl_[index];
-  if (yl) *yl = yl_[index];
-  if (xh) *xh = xh_[index];
-  if (yh) *yh = yh_[index];
-}
-
-int defiPinPort::hasLayerSpacing(int index) const{
-  if (layerMinSpacing_[index] == -1)
-    return 0;
-  return 1;
-}
-
-int defiPinPort::hasLayerDesignRuleWidth(int index) const{
-  if (layerEffectiveWidth_[index] == -1)
-    return 0;
-  return 1;
-}
-
-int defiPinPort::layerSpacing(int index) const {
-  return layerMinSpacing_[index];
-}
-
-int defiPinPort::layerMask(int index) const {
-    return layerMask_[index];
-}
-
-int defiPinPort::layerDesignRuleWidth(int index) const {
-  return layerEffectiveWidth_[index];
-}
-
-int defiPinPort::numPolygons() const {
-  return numPolys_;
-}
-
-const char* defiPinPort::polygonName(int index) const {
-  if (index < 0 || index > numPolys_) {
-    defiError(1, 0, "index out of bounds", defData);
-    return 0;
-  }
-  return polygonNames_[index];
-}
-
-struct defiPoints defiPinPort::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-int defiPinPort::hasPolygonSpacing(int index) const{
-  if (polyMinSpacing_[index] == -1)
-    return 0;
-  return 1;
-}
-
-int defiPinPort::hasPolygonDesignRuleWidth(int index) const{
-  if (polyEffectiveWidth_[index] == -1)
-    return 0;
-  return 1;
-}
-
-int defiPinPort::polygonSpacing(int index) const {
-  return polyMinSpacing_[index];
-}
-
-int defiPinPort::polygonMask(int index) const {
-    return polyMask_[index];
-}
-
-int defiPinPort::polygonDesignRuleWidth(int index) const {
-  return polyEffectiveWidth_[index];
-}
-
-int defiPinPort::numVias() const {
-    return numVias_;
-}
-
-const char* defiPinPort::viaName(int index) const {
-  if (index < 0 || index > numVias_) {
-    defiError(1, 0, "index out of bounds", defData);
-    return 0;
-  }
-  return viaNames_[index];
-}
-
-int defiPinPort::viaPtX(int index) const {
-  return viaX_[index];
-}
-
-int defiPinPort::viaPtY(int index) const {
-  return viaY_[index];
-}
-
-int defiPinPort::viaBottomMask(int index) const {
-    return viaMask_[index] % 10;
-}
-
-int defiPinPort::viaTopMask(int index) const {
-    return viaMask_[index] / 100;
-}
-
-int defiPinPort::viaCutMask(int index) const {
-    return viaMask_[index] / 10 % 10;
-}
-
-int defiPinPort::hasPlacement() const {
-  return placeType_ == 0 ? 0 : 1 ;
-}
-
-int defiPinPort::isPlaced() const {
-  return placeType_ == DEFI_COMPONENT_PLACED ? 1 : 0 ;
-}
-
-int defiPinPort::isCover() const {
-  return placeType_ == DEFI_COMPONENT_COVER ? 1 : 0 ;
-}
-
-int defiPinPort::isFixed() const {
-  return placeType_ == DEFI_COMPONENT_FIXED ? 1 : 0 ;
-}
-
-int defiPinPort::placementX() const {
-  return x_;
-}
-
-int defiPinPort::placementY() const {
-  return y_;
-}
-
-int defiPinPort::orient() const {
-  return orient_;
-}
-
-const char* defiPinPort::orientStr() const {
-  return (defiOrientStr(orient_));
-}
-
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-//
-//     defiPin
-//
-///////////////////////////////////////////////
-///////////////////////////////////////////////
-
-defiPin::defiPin(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-
-void defiPin::Init() {
-  pinNameLength_ = 0;
-  pinName_ = 0;
-  netNameLength_ = 0;
-  netName_ = 0;
-  useLength_ = 0;
-  use_ = 0;
-  directionLength_ = 0;
-  direction_ = 0;
-  hasDirection_ = 0;
-  hasUse_ = 0;
-  placeType_ = 0;
-  orient_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  x_ = 0;
-  y_ = 0;
-  netExprLength_ = 0;                         // 5.6
-  netExpr_ = 0;                               // 5.6
-  hasNetExpr_ = 0;                            // 5.6
-  supplySensLength_ = 0;                      // 5.6
-  supplySens_ = 0;                            // 5.6
-  hasSupplySens_ = 0;                         // 5.6
-  groundSensLength_ = 0;                      // 5.6
-  groundSens_ = 0;                            // 5.6
-  hasGroundSens_ = 0;                         // 5.6
-  layers_ = 0;                                // 5.6
-  layersAllocated_ = 0;                       // 5.6
-  numLayers_ = 0;                             // 5.6
-  polygonNames_ = 0;                          // 5.6
-  numPolys_ = 0;                              // 5.6
-  polysAllocated_ = 0;                        // 5.6
-  polygons_ = 0;                              // 5.6
-  numAPinPartialMetalArea_ = 0;               // 5.4
-  APinPartialMetalAreaAllocated_ = 0;         // 5.4
-  APinPartialMetalArea_ = 0;
-  APinPartialMetalAreaLayer_ = 0;
-  numAPinPartialMetalSideArea_ = 0;           // 5.4
-  APinPartialMetalSideAreaAllocated_ = 0;     // 5.4
-  APinPartialMetalSideArea_ = 0;
-  APinPartialMetalSideAreaLayer_ = 0;
-  numAPinDiffArea_ = 0;                       // 5.4
-  APinDiffAreaAllocated_ = 0;                 // 5.4
-  APinDiffArea_ = 0;
-  APinDiffAreaLayer_ = 0;
-  numAPinPartialCutArea_ = 0;                 // 5.4
-  APinPartialCutAreaAllocated_ = 0;           // 5.4
-  APinPartialCutArea_ = 0;
-  APinPartialCutAreaLayer_ = 0;
-  antennaModel_ = 0;
-  viaNames_ = 0;                              // 5.7
-  viasAllocated_ = 0;                         // 5.7
-  numVias_ = 0;                               // 5.7
-  viaX_ = 0;                                  // 5.7
-  viaY_ = 0;                                  // 5.7
-  numPorts_ = 0;                              // 5.7
-  pinPort_ = 0;                               // 5.7
-  numAntennaModel_ = 0;
-  antennaModelAllocated_ = 0;
-}
-
-
-defiPin::~defiPin() {
-  Destroy();
-}
-
-
-void defiPin::clear() {
-  int i;
-
-  hasDirection_ = 0;
-  hasNetExpr_ = 0;
-  hasSupplySens_ = 0;
-  hasGroundSens_ = 0;
-  hasUse_ = 0;
-  hasSpecial_ = 0;
-  placeType_ = 0;
-  orient_ = 0;
-  x_ = 0;
-  y_ = 0;
-
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++)
-      if (layers_[i]) free(layers_[i]);
-    free((char*)(layers_));
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    free((char*)(layerMinSpacing_));
-    free((char*)(layerMask_));
-    free((char*)(layerEffectiveWidth_));
-  }
-  layers_ = 0;
-  layerMinSpacing_ = 0;
-  layerMask_ = 0;
-  layerEffectiveWidth_ = 0;
-  numLayers_ = 0;
-  layersAllocated_ = 0;
-  // 5.6
-  if (polygonNames_) {
-    struct defiPoints* p;
-    for (i = 0; i < numPolys_; i++) {
-      if (polygonNames_[i]) free((char*)(polygonNames_[i]));
-      p = polygons_[i];
-      free((char*)(p->x));
-      free((char*)(p->y));
-      free((char*)(polygons_[i])); 
-    }
-    free((char*)(polygonNames_));
-    free((char*)(polygons_)); 
-    free((char*)(polyMinSpacing_)); 
-    free((char*)(polyMask_));
-    free((char*)(polyEffectiveWidth_)); 
-    polygonNames_ = 0;
-    polygons_ = 0;
-    polyMinSpacing_ = 0;
-    polyMask_ = 0;
-    polyEffectiveWidth_ = 0;
-  }
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-  // 5.7
-  if (viaNames_) {
-    for (i = 0; i < numVias_; i++)
-      if (viaNames_[i]) free(viaNames_[i]);
-    free((char*)(viaNames_));
-    free((char*)(viaX_));
-    free((char*)(viaY_));
-    free((char*)(viaMask_));
-  }
-  viaNames_ = 0;
-  numVias_ = 0;
-  viaMask_ = 0;
-  viasAllocated_ = 0;
-  // 5.7
-  if (pinPort_) {
-    for (i = 0; i < numPorts_; i++) {
-      if (pinPort_[i]) {
-         pinPort_[i]->clear();
-         delete pinPort_[i];
-      }
-    }
-    free(pinPort_);
-  }
-  pinPort_ = 0;
-  numPorts_ = 0;
-  portsAllocated_ = 0;
-
-  for (i = 0; i < numAPinPartialMetalArea_; i++) {
-    if (APinPartialMetalAreaLayer_[i])
-       free(APinPartialMetalAreaLayer_[i]);
-  }
-  numAPinPartialMetalArea_ = 0;
-
-  for (i = 0; i < numAPinPartialMetalSideArea_; i++) {
-    if (APinPartialMetalSideAreaLayer_[i])
-       free(APinPartialMetalSideAreaLayer_[i]);
-  }
-  numAPinPartialMetalSideArea_ = 0;
-
-  for (i = 0; i < numAPinDiffArea_; i++) {
-    if (APinDiffAreaLayer_[i])
-       free(APinDiffAreaLayer_[i]);
-  }
-  numAPinDiffArea_ = 0;
-
-  for (i = 0; i < numAPinPartialCutArea_; i++) {
-    if (APinPartialCutAreaLayer_[i])
-       free(APinPartialCutAreaLayer_[i]);
-  }
-  numAPinPartialCutArea_ = 0;
-
-  for (i = 0; i < antennaModelAllocated_; i++) { // 5.5
-    delete antennaModel_[i];
-  }
-
-  numAntennaModel_ = 0;
-  antennaModelAllocated_ = 0;
-}
-
-
-void defiPin::Destroy() {
-  if (pinName_) free(pinName_);
-  if (netName_) free(netName_);
-  if (use_) free(use_);
-  if (direction_) free(direction_);
-  if (netExpr_) free(netExpr_);
-  if (supplySens_) free(supplySens_);
-  if (groundSens_) free(groundSens_);
-  pinName_ = 0;
-  netName_ = 0;
-  use_ = 0;
-  direction_ = 0;
-  netExpr_ = 0;
-  supplySens_ = 0;
-  groundSens_ = 0;
-  pinNameLength_ = 0;
-  netNameLength_ = 0;
-  useLength_ = 0;
-  directionLength_ = 0;
-  netExprLength_ = 0;
-  supplySensLength_ = 0;
-  groundSensLength_ = 0;
-  layersAllocated_ = 0;
-  clear();
-
-  // 5.4
-  if (APinPartialMetalArea_)
-     free((char*)(APinPartialMetalArea_));
-  if (APinPartialMetalAreaLayer_)
-     free((char*)(APinPartialMetalAreaLayer_));
-  if (APinPartialMetalSideArea_)
-     free((char*)(APinPartialMetalSideArea_));
-  if (APinPartialMetalSideAreaLayer_)
-     free((char*)(APinPartialMetalSideAreaLayer_));
-  if (APinDiffArea_)
-     free((char*)(APinDiffArea_));
-  if (APinDiffAreaLayer_)
-     free((char*)(APinDiffAreaLayer_));
-  if (APinPartialCutArea_)
-     free((char*)(APinPartialCutArea_));
-  if (APinPartialCutAreaLayer_)
-     free((char*)(APinPartialCutAreaLayer_));
-  if (antennaModel_)
-     free((char*)(antennaModel_));
-}
-
-
-void defiPin::Setup(const char* pinName, const char* netName) {
-  int len = strlen(pinName) + 1;
-  if (pinNameLength_ < len) {
-    if (pinName_) free(pinName_);
-    pinName_ = (char*)malloc(len);
-    pinNameLength_ = len;
-  }
-  strcpy(pinName_, defData->DEFCASE(pinName));
-
-  len = strlen(netName) + 1;
-  if (netNameLength_ < len) {
-    if (netName_) free(netName_);
-    netName_ = (char*)malloc(len);
-    netNameLength_ = len;
-  }
-  strcpy(netName_, defData->DEFCASE(netName));
-
-  clear();
-
-}
-
-
-void defiPin::setDirection(const char* dir) {
-  int len = strlen(dir) + 1;
-  if (directionLength_ < len) {
-    if (direction_) free(direction_);
-    direction_ = (char*)malloc(len);
-    directionLength_ = len;
-  }
-  strcpy(direction_, defData->DEFCASE(dir));
-  hasDirection_ = 1;
-}
-
-
-void defiPin::setNetExpr(const char* name) {
-  int len = strlen(name) + 1;
-  if (netExprLength_ < len) {
-    if (netExpr_) free(netExpr_);
-    netExpr_ = (char*)malloc(len);
-    netExprLength_ = len;
-  }
-  strcpy(netExpr_, defData->DEFCASE(name));
-  hasNetExpr_ = 1;
-}
-
-
-void defiPin::setSupplySens(const char* name) {
-  int len = strlen(name) + 1;
-  if (supplySensLength_ < len) {
-    if (supplySens_) free(supplySens_);
-    supplySens_ = (char*)malloc(len);
-    supplySensLength_ = len;
-  }
-  strcpy(supplySens_, defData->DEFCASE(name));
-  hasSupplySens_ = 1;
-}
-
-
-void defiPin::setGroundSens(const char* name) {
-  int len = strlen(name) + 1;
-  if (groundSensLength_ < len) {
-    if (groundSens_) free(groundSens_);
-    groundSens_ = (char*)malloc(len);
-    groundSensLength_ = len;
-  }
-  strcpy(groundSens_, defData->DEFCASE(name));
-  hasGroundSens_ = 1;
-}
-
-
-void defiPin::setUse(const char* use) {
-  int len = strlen(use) + 1;
-  if (useLength_ < len) {
-    if (use_) free(use_);
-    use_ = (char*)malloc(len);
-    useLength_ = len;
-  }
-  strcpy(use_, defData->DEFCASE(use));
-  hasUse_ = 1;
-}
-
-
-// 5.6, renamed from setLayer to addLayer for multiple layers allowed
-void defiPin::addLayer(const char* layer) {
-
-  if (numLayers_ >= layersAllocated_) {
-    int i;
-    char** newl;
-    int *nxl, *nyl, *nxh, *nyh;
-    int *lms, *lew, *lm;
-
-    layersAllocated_ = layersAllocated_ ?
-                             layersAllocated_ * 2 : 8;
-    newl = (char**)malloc(layersAllocated_ * sizeof(char*));
-    nxl = (int*)malloc(layersAllocated_ * sizeof(int));
-    nyl = (int*)malloc(layersAllocated_ * sizeof(int));
-    nxh = (int*)malloc(layersAllocated_ * sizeof(int));
-    nyh = (int*)malloc(layersAllocated_ * sizeof(int));
-    lms = (int*)malloc(layersAllocated_ * sizeof(int));
-    lew = (int*)malloc(layersAllocated_ * sizeof(int));
-    lm = (int*)malloc(layersAllocated_ * sizeof(int));
- 
-    for (i = 0; i < numLayers_; i++) {
-       newl[i] = layers_[i];
-       nxl[i] = xl_[i];
-       nyl[i] = yl_[i];
-       nxh[i] = xh_[i];
-       nyh[i] = yh_[i];
-       lms[i] = layerMinSpacing_[i];
-       lew[i] = layerEffectiveWidth_[i];
-       lm[i] = layerMask_[i];
-    }
-    if (numLayers_ > 0) {
-       free((char*)layers_);
-       free((char*)xl_);
-       free((char*)yl_);
-       free((char*)xh_);
-       free((char*)yh_);
-       free((char*)layerMinSpacing_);
-       free((char*)layerMask_);
-       free((char*)layerEffectiveWidth_);
-    }
-    layers_ = newl;
-    xl_ = nxl;
-    yl_ = nyl;
-    xh_ = nxh;
-    yh_ = nyh;
-    layerMinSpacing_ = lms;
-    layerEffectiveWidth_ = lew;
-    layerMask_ = lm;
-  }
-  layers_[numLayers_] = (char*)malloc(strlen(layer)+1);
-  strcpy(layers_[numLayers_], defData->DEFCASE(layer));
-  xl_[numLayers_] = 0;
-  yl_[numLayers_] = 0;
-  xh_[numLayers_] = 0;
-  yh_[numLayers_] = 0;
-  layerMinSpacing_[numLayers_] = -1;
-  layerMask_[numLayers_] = 0;
-  layerEffectiveWidth_[numLayers_] = -1;
-  numLayers_ += 1;
-}
-
-// 5.6
-void defiPin::addLayerPts(int xl, int yl, int xh, int yh) {
-  xl_[numLayers_-1] = xl;
-  yl_[numLayers_-1] = yl;
-  xh_[numLayers_-1] = xh;
-  yh_[numLayers_-1] = yh;
-}
-
-// 5.6
-void defiPin::addLayerSpacing(int minSpacing) {
-  layerMinSpacing_[numLayers_-1] = minSpacing;
-}
-
-void defiPin::addLayerMask(int mask) {
-    layerMask_[numLayers_-1] = mask;
-}
-
-// 5.6
-void defiPin::addLayerDesignRuleWidth(int effectiveWidth) {
-  layerEffectiveWidth_[numLayers_-1] = effectiveWidth;
-}
-
-
-void defiPin::setPlacement(int typ, int x, int y, int orient) {
-  x_ = x;
-  y_ = y;
-  orient_ = orient;
-  placeType_ = typ;
-}
-
-
-const char* defiPin::pinName() const {
-  return pinName_;
-}
-
-
-const char* defiPin::netName() const {
-  return netName_;
-}
-
-
-void defiPin::changePinName(const char* pinName) {
-  int len = strlen(pinName) + 1;
-  if (pinNameLength_ < len) {
-    if (pinName_) free(pinName_);
-    pinName_ = (char*)malloc(len);
-    pinNameLength_ = len;
-  }
-  strcpy(pinName_, defData->DEFCASE(pinName));
-}
-
-
-int defiPin::hasDirection() const {
-  return (int)(hasDirection_);
-}
-
-
-int defiPin::hasUse() const {
-  return (int)(hasUse_);
-}
-
-
-int defiPin::hasLayer() const {
-  if (numLayers_ || numPolys_)  // 5.6, either layer or polygon is
-    return 1;                               // non-zero
-  else
-    return 0;
-}
-
-
-int defiPin::hasPlacement() const {
-  return placeType_ == 0 ? 0 : 1 ;
-}
-
-
-int defiPin::isUnplaced() const {
-  return placeType_ == DEFI_COMPONENT_UNPLACED ? 1 : 0 ;
-}
-
-
-int defiPin::isPlaced() const {
-  return placeType_ == DEFI_COMPONENT_PLACED ? 1 : 0 ;
-}
-
-
-int defiPin::isCover() const {
-  return placeType_ == DEFI_COMPONENT_COVER ? 1 : 0 ;
-}
-
-
-int defiPin::isFixed() const {
-  return placeType_ == DEFI_COMPONENT_FIXED ? 1 : 0 ;
-}
-
-
-int defiPin::placementX() const {
-  return x_;
-}
-
-
-int defiPin::placementY() const {
-  return y_;
-}
-
-
-const char* defiPin::direction() const {
-  return direction_;
-}
-
-
-const char* defiPin::use() const {
-  return use_;
-}
-
-
-int defiPin::numLayer() const {
-  return numLayers_;
-}
-
-const char* defiPin::layer(int index) const {
-  return layers_[index];
-}
-
-
-void defiPin::bounds(int index, int* xl, int* yl, int* xh, int* yh) const {
-  if (xl) *xl = xl_[index];
-  if (yl) *yl = yl_[index];
-  if (xh) *xh = xh_[index];
-  if (yh) *yh = yh_[index];
-}
-
-// 5.6
-int defiPin::hasLayerSpacing(int index) const{
-  if (layerMinSpacing_[index] == -1)
-    return 0;
-  return 1;
-}
-
-// 5.6
-int defiPin::hasLayerDesignRuleWidth(int index) const{
-  if (layerEffectiveWidth_[index] == -1)
-    return 0;
-  return 1;
-}
-
-// 5.6
-int defiPin::layerSpacing(int index) const {
-  return layerMinSpacing_[index];
-}
-
-int defiPin::layerMask(int index) const {
-    return layerMask_[index];
-}
-
-// 5.6
-int defiPin::layerDesignRuleWidth(int index) const {
-  return layerEffectiveWidth_[index];
-}
-
-int defiPin::orient() const {
-  return orient_;
-}
-
-const char* defiPin::orientStr() const {
-  return (defiOrientStr(orient_));
-}
-
-
-void defiPin::setSpecial() {
-  hasSpecial_ = 1;
-}
-
-// 5.5
-void defiPin::addAntennaModel(int oxide) {
-  // For version 5.5 only OXIDE1, OXIDE2, OXIDE3, & OXIDE4
-  // are defined within a pin
-  defiPinAntennaModel* amo;
-  int i;
-
-  if (numAntennaModel_ == 0) {   // does not have antennaModel
-     if (!antennaModel_)         // only need to malloc if it is nill
-        antennaModel_ = (defiPinAntennaModel**)
-                 malloc(sizeof(defiPinAntennaModel*)*4);
-     antennaModelAllocated_ = 4;
-     for (i = 0; i < 4; i++) {
-         antennaModel_[i] =  new defiPinAntennaModel(defData);
-     }
-     numAntennaModel_++;
-     antennaModelAllocated_ = 4;
-     amo = antennaModel_[0];
-  } else {
-     amo = antennaModel_[numAntennaModel_];
-     numAntennaModel_++;
-  }
-  amo->Init();
-  amo->setAntennaModel(oxide);
-  return;
-}
-
-// 5.5
-int defiPin::numAntennaModel() const {
-  return numAntennaModel_;
-}
-
-// 5.5
-defiPinAntennaModel* defiPin::antennaModel(int index) const {
-  return antennaModel_[index];
-}
-
-void defiPin::addAPinPartialMetalArea(int value, const char* layer) {
-  if (numAPinPartialMetalArea_ == APinPartialMetalAreaAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinPartialMetalArea_;
-     int* nd;
-     char**  nl;
-
-     if (APinPartialMetalAreaAllocated_ == 0)
-        max = APinPartialMetalAreaAllocated_ = 2;
-     else
-        max = APinPartialMetalAreaAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinPartialMetalArea_[i];
-        nl[i] = APinPartialMetalAreaLayer_[i];
-     }
-     free((char*)(APinPartialMetalArea_));
-     free((char*)(APinPartialMetalAreaLayer_));
-     APinPartialMetalArea_ = nd;
-     APinPartialMetalAreaLayer_ = nl;
- 
-  }
-  APinPartialMetalArea_[numAPinPartialMetalArea_] = value;
-  if (layer) {
-    APinPartialMetalAreaLayer_[numAPinPartialMetalArea_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinPartialMetalAreaLayer_[numAPinPartialMetalArea_],
-       defData->DEFCASE(layer));
-  } else
-    APinPartialMetalAreaLayer_[numAPinPartialMetalArea_] = NULL;
-  numAPinPartialMetalArea_ += 1;
-}
-
-
-void defiPin::addAPinPartialMetalSideArea(int value, const char* layer) {
-  if (numAPinPartialMetalSideArea_ == APinPartialMetalSideAreaAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinPartialMetalSideArea_;
-     int* nd;
-     char**  nl;
-
-     if (APinPartialMetalSideAreaAllocated_ == 0)
-        max = APinPartialMetalSideAreaAllocated_ = 2;
-     else
-        max = APinPartialMetalSideAreaAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinPartialMetalSideArea_[i];
-        nl[i] = APinPartialMetalSideAreaLayer_[i];
-     }
-     free((char*)(APinPartialMetalSideArea_));
-     free((char*)(APinPartialMetalSideAreaLayer_));
-     APinPartialMetalSideArea_ = nd;
-     APinPartialMetalSideAreaLayer_ = nl;
-
-  }
-  APinPartialMetalSideArea_[numAPinPartialMetalSideArea_] = value;
-  if (layer) {
-    APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_],
-       defData->DEFCASE(layer));
-  } else
-    APinPartialMetalSideAreaLayer_[numAPinPartialMetalSideArea_] = NULL;
-  numAPinPartialMetalSideArea_ += 1;
-}
-
-
-void defiPin::addAPinGateArea(int value, const char* layer) {
-  if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-     addAntennaModel(1);
-  antennaModel_[numAntennaModel_-1]->addAPinGateArea(value, layer);
-}
-
-
-void defiPin::addAPinDiffArea(int value, const char* layer) {
-  if (numAPinDiffArea_ == APinDiffAreaAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinDiffArea_;
-     int* nd;
-     char**  nl;
-
-     if (APinDiffAreaAllocated_ == 0)
-        max = APinDiffAreaAllocated_ = 2;
-     else
-        max = APinDiffAreaAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinDiffArea_[i];
-        nl[i] = APinDiffAreaLayer_[i];
-     }
-     free((char*)(APinDiffArea_));
-     free((char*)(APinDiffAreaLayer_));
-     APinDiffArea_ = nd;
-     APinDiffAreaLayer_ = nl;
-
-  }
-  APinDiffArea_[numAPinDiffArea_] = value;
-  if (layer) {
-    APinDiffAreaLayer_[numAPinDiffArea_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinDiffAreaLayer_[numAPinDiffArea_],
-       defData->DEFCASE(layer));
-  } else
-    APinDiffAreaLayer_[numAPinDiffArea_] = NULL;
-  numAPinDiffArea_ += 1;
-}
-
-
-void defiPin::addAPinMaxAreaCar(int value, const char* layer) {
-  if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-     addAntennaModel(1);
-  antennaModel_[numAntennaModel_-1]->addAPinMaxAreaCar(value, layer);
-}
-
-
-void defiPin::addAPinMaxSideAreaCar(int value, const char* layer) {
-  if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-     addAntennaModel(1);
-  antennaModel_[numAntennaModel_-1]->addAPinMaxSideAreaCar(value, layer);
-}
-
-
-void defiPin::addAPinPartialCutArea(int value, const char* layer) {
-  if (numAPinPartialCutArea_ == APinPartialCutAreaAllocated_) {
-     int i;
-     int max;
-     int lim = numAPinPartialCutArea_;
-     int* nd;
-     char**  nl;
-
-     if (APinPartialCutAreaAllocated_ == 0)
-        max = APinPartialCutAreaAllocated_ = 2;
-     else
-        max = APinPartialCutAreaAllocated_ *= 2;
-     nd = (int*)malloc(sizeof(int)*max);
-     nl = (char**)malloc(sizeof(char*)*max);
-     for (i = 0; i < lim; i++) {
-        nd[i] = APinPartialCutArea_[i];
-        nl[i] = APinPartialCutAreaLayer_[i];
-     }
-     free((char*)(APinPartialCutArea_));
-     free((char*)(APinPartialCutAreaLayer_));
-     APinPartialCutArea_ = nd;
-     APinPartialCutAreaLayer_ = nl;
-
-  }
-  APinPartialCutArea_[numAPinPartialCutArea_] = value;
-  if (layer) {
-    APinPartialCutAreaLayer_[numAPinPartialCutArea_] =
-       (char*)malloc(strlen(layer)+1);
-    strcpy(APinPartialCutAreaLayer_[numAPinPartialCutArea_],
-       defData->DEFCASE(layer));
-  } else
-    APinPartialCutAreaLayer_[numAPinPartialCutArea_] = NULL;
-  numAPinPartialCutArea_ += 1;
-}
-
-
-void defiPin::addAPinMaxCutCar(int value, const char* layer) {
-  if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-     addAntennaModel(1);
-  antennaModel_[numAntennaModel_-1]->addAPinMaxCutCar(value, layer);
-}
-
-
-int defiPin::hasSpecial() const {
-  return (int)hasSpecial_;
-}
-
-
-int defiPin::hasAPinPartialMetalArea() const {
-  return numAPinPartialMetalArea_ ? 1 : 0 ;
-}
-
-
-int defiPin::hasAPinPartialMetalSideArea() const {
-  return numAPinPartialMetalSideArea_ ? 1 : 0 ;
-}
-
-
-int defiPin::hasAPinDiffArea() const {
-  return numAPinDiffArea_ ? 1 : 0 ;
-}
-
-
-int defiPin::hasAPinPartialCutArea() const {
-  return numAPinPartialCutArea_ ? 1 : 0 ;
-}
-
-
-int defiPin::numAPinPartialMetalArea() const {
-  return numAPinPartialMetalArea_;
-}
-
-
-int defiPin::numAPinPartialMetalSideArea() const {
-  return numAPinPartialMetalSideArea_;
-}
-
-
-int defiPin::numAPinDiffArea() const {
-  return numAPinDiffArea_;
-}
-
-
-int defiPin::numAPinPartialCutArea() const {
-  return numAPinPartialCutArea_;
-}
-
-
-int defiPin::APinPartialMetalArea(int i) const {
-  return APinPartialMetalArea_[i];
-}
-
-
-int defiPin::hasAPinPartialMetalAreaLayer(int i) const {
-  return (APinPartialMetalAreaLayer_[i] &&
-          *(APinPartialMetalAreaLayer_[i])) ? 1 : 0 ;
-}
-
-
-const char* defiPin::APinPartialMetalAreaLayer(int i) const {
-  return APinPartialMetalAreaLayer_[i];
-}
-
-
-int defiPin::APinPartialMetalSideArea(int i) const {
-  return APinPartialMetalSideArea_[i];
-}
-
-
-int defiPin::hasAPinPartialMetalSideAreaLayer(int i) const {
-  return (APinPartialMetalSideAreaLayer_[i] &&
-          *(APinPartialMetalSideAreaLayer_[i])) ? 1 : 0 ;
-}
-
-
-const char* defiPin::APinPartialMetalSideAreaLayer(int i) const {
-  return APinPartialMetalSideAreaLayer_[i];
-}
-
-
-int defiPin::APinDiffArea(int i) const {
-  return APinDiffArea_[i];
-}
-
-
-int defiPin::hasAPinDiffAreaLayer(int i) const {
-  return (APinDiffAreaLayer_[i] && *(APinDiffAreaLayer_[i])) ?
-          1 : 0 ;
-}
-
-
-const char* defiPin::APinDiffAreaLayer(int i) const {
-  return APinDiffAreaLayer_[i];
-}
-
-
-int defiPin::APinPartialCutArea(int i) const {
-  return APinPartialCutArea_[i];
-}
-
-
-int defiPin::hasAPinPartialCutAreaLayer(int i) const {
-  return (APinPartialCutAreaLayer_[i] &&
-          *(APinPartialCutAreaLayer_[i])) ? 1 : 0 ;
-}
-
-
-const char* defiPin::APinPartialCutAreaLayer(int i) const {
-  return APinPartialCutAreaLayer_[i];
-}
-
-
-// 5.6
-void defiPin::addPolygon(const char* layerName) {
-  int *pms, *pdw, *pm;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    char** newn;
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    newn = (char**)malloc(sizeof(char*) * polysAllocated_);
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    pms = (int*)malloc(polysAllocated_ * sizeof(int));
-    pdw = (int*)malloc(polysAllocated_ * sizeof(int));
-    pm = (int*)malloc(polysAllocated_ * sizeof(int));
-
-    for (i = 0; i < numPolys_; i++) {
-      newn[i] = polygonNames_[i];
-      poly[i] = polygons_[i];
-      pms[i]  = polyMinSpacing_[i];
-      pdw[i]  = polyEffectiveWidth_[i];
-      pm[i] = polyMask_[i];
-    }
-    if (numPolys_ > 0) {
-      free((char*)(polygons_));
-      free((char*)(polygonNames_));
-      free((char*)(polyMinSpacing_));
-      free((char*)(polyEffectiveWidth_));
-      free((char*)(polyMask_));
-    }
-    polygonNames_ = newn;
-    polygons_ = poly;
-    polyMinSpacing_ = pms;
-    polyEffectiveWidth_ = pdw;
-    polyMask_= pm;
-  }
-  polygonNames_[numPolys_] = strdup(layerName);
-  polygons_[numPolys_] = 0;
-  polyMinSpacing_[numPolys_] = -1;
-  polyEffectiveWidth_[numPolys_] = -1;
-  polyMask_[numPolys_] = 0;
-  numPolys_ += 1;
-}
-
-
-// 5.6
-void defiPin::addPolygonPts(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_-1] = p;
-}
-
-
-// 5.6
-void defiPin::addPolySpacing(int minSpacing) {
-  polyMinSpacing_[numPolys_-1] = minSpacing;
-}
-
-void defiPin::addPolyMask(int color) {
-    polyMask_[numPolys_-1] = color;
-}
-
-// 5.6
-void defiPin::addPolyDesignRuleWidth(int effectiveWidth) {
-  polyEffectiveWidth_[numPolys_-1] = effectiveWidth;
-}
-
-
-// 5.6
-int defiPin::numPolygons() const {
-  return numPolys_;
-}
-
-
-// 5.6
-const char* defiPin::polygonName(int index) const {
-  if (index < 0 || index > numPolys_) {
-    defiError(1, 0, "index out of bounds", defData);
-    return 0;
-  }
-  return polygonNames_[index];
-}
-
-// 5.6
-struct defiPoints defiPin::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-// 5.6
-int defiPin::hasPolygonSpacing(int index) const{
-  if (polyMinSpacing_[index] == -1)
-    return 0;
-  return 1;
-}
-
-// 5.6
-int defiPin::hasPolygonDesignRuleWidth(int index) const{
-  if (polyEffectiveWidth_[index] == -1)
-    return 0;
-  return 1;
-}
-
-// 5.6
-int defiPin::polygonSpacing(int index) const {
-  return polyMinSpacing_[index];
-}
-
-int defiPin::polygonMask(int index) const {
-    return polyMask_[index];
-}
-
-// 5.6
-int defiPin::polygonDesignRuleWidth(int index) const {
-  return polyEffectiveWidth_[index];
-}
-
-// 5.6
-int defiPin::hasNetExpr() const {
-  return (int)(hasNetExpr_);
-}
-
-// 5.6
-const char* defiPin::netExpr() const {
-  return netExpr_;
-}
-
-// 5.6
-int defiPin::hasSupplySensitivity() const {
-  return (int)(hasSupplySens_);
-}
-
-// 5.6
-const char* defiPin::supplySensitivity() const {
-  return supplySens_;
-}
-
-// 5.6
-int defiPin::hasGroundSensitivity() const {
-  return (int)(hasGroundSens_);
-}
-
-// 5.6
-const char* defiPin::groundSensitivity() const {
-  return groundSens_;
-}
-
-// 5.7
-void defiPin::addVia(const char* viaName, int ptX, int ptY, int color) {
-
-  if (numVias_ >= viasAllocated_) {
-    int i;
-    char** newl;
-    int *nx, *ny, *nm;
-
-    viasAllocated_ = viasAllocated_ ?
-                           viasAllocated_ * 2 : 8;
-    newl = (char**)malloc(viasAllocated_ * sizeof(char*));
-    nx = (int*)malloc(viasAllocated_ * sizeof(int));
-    ny = (int*)malloc(viasAllocated_ * sizeof(int));
-    nm = (int*)malloc(viasAllocated_ * sizeof(int));
- 
-    for (i = 0; i < numVias_; i++) {
-       newl[i] = viaNames_[i];
-       nx[i] = viaX_[i];
-       ny[i] = viaY_[i];
-       nm[i] = viaMask_[i];
-    }
-    if (numVias_ > 0) {
-       free((char*)viaNames_);
-       free((char*)viaX_);
-       free((char*)viaY_);
-       free((char*)viaMask_);
-    }
-    viaNames_ = newl;
-    viaX_ = nx;
-    viaY_ = ny;
-    viaMask_ = nm;
-  }
-  viaNames_[numVias_] = (char*)malloc(strlen(viaName)+1);
-  strcpy(viaNames_[numVias_], defData->DEFCASE(viaName));
-  viaX_[numVias_] = ptX;
-  viaY_[numVias_] = ptY;
-  viaMask_[numVias_] = color;
-  numVias_ += 1;
-}
-
-// 5.7
-int defiPin::numVias() const {
-    return numVias_;
-}
-
-// 5.7
-const char* defiPin::viaName(int index) const {
-  if (index < 0 || index > numVias_) {
-    defiError(1, 0, "index out of bounds", defData);
-    return 0;
-  }
-  return viaNames_[index];
-}
-
-// 5.7
-int defiPin::viaPtX(int index) const {
-  return viaX_[index];
-}
-
-// 5.7
-int defiPin::viaPtY(int index) const {
-  return viaY_[index];
-}
-
-int defiPin::viaTopMask(int index) const {
-    int cutMaskNum = viaMask_[index] / 10;
-
-    if (cutMaskNum) {
-        return cutMaskNum /= 10;
-    } else {
-        return 0;
-    }
-}
-
-int defiPin::viaCutMask(int index) const {
-    int cutMaskNum = viaMask_[index] / 10;
-
-    if (cutMaskNum) {
-        return cutMaskNum % 10;
-    } else {
-        return 0;
-    }
-}
-
-int defiPin::viaBottomMask(int index) const {
-    return viaMask_[index] % 10;
-}
-// 5.7
-void defiPin::addPort() {
-  defiPinPort** pp;
-  defiPinPort* pv;
-  int i;
-
-  if (numPorts_ >= portsAllocated_) {
-     if (portsAllocated_ == 0) {
-        pinPort_ = (defiPinPort**) malloc(sizeof(defiPinPort*)*4);
-        portsAllocated_ = 4;
-     } else {
-        portsAllocated_ = portsAllocated_ * 2;
-        pp = (defiPinPort**) malloc(sizeof(defiPinPort*) *
-             portsAllocated_);
-        for (i = 0; i < numPorts_; i++)
-           pp[i] = pinPort_[i];
-        free((char*)(pinPort_));
-        pinPort_ = pp;
-     }
-  }
-  pv = new defiPinPort(defData);
-  pv->Init();
-  pinPort_[numPorts_] = pv;
-  numPorts_ += 1;
-}
-
-// 5.7
-void defiPin::addPortLayer(const char* layer) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addLayer(layer);
-}
-
-// 5.7
-void defiPin::addPortLayerSpacing(int minSpacing) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addLayerSpacing(minSpacing);
-}
-
-void defiPin::addPortLayerMask(int color) {
-    int i = numPorts_ - 1;
-    pinPort_[i]->addLayerMask(color);
-}
-
-// 5.7
-void defiPin::addPortLayerDesignRuleWidth(int effectiveWidth) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addLayerDesignRuleWidth(effectiveWidth);
-}
-
-// 5.7
-void defiPin::addPortLayerPts(int xl, int yl, int xh, int yh) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addLayerPts(xl, yl, xh, yh);
-}
-
-// 5.7
-void defiPin::addPortPolygon(const char* layerName) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addPolygon(layerName);
-}
-
-// 5.7
-void defiPin::addPortPolySpacing(int minSpacing) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addPolySpacing(minSpacing);
-}
-
-void defiPin::addPortPolyMask(int color) {
-    int i = numPorts_ - 1;
-    pinPort_[i]->addPolyMask(color);
-}
-
-// 5.7
-void defiPin::addPortPolyDesignRuleWidth(int effectiveWidth) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addPolyDesignRuleWidth( effectiveWidth);
-}
-
-// 5.7
-void defiPin::addPortPolygonPts(defiGeometries* geom) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addPolygonPts(geom);
-}
-
-// 5.7
-void defiPin::addPortVia(const char* via, int viaX, int viaY, int color) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->addVia(via, viaX, viaY, color);
-}
-
-// 5.7
-void defiPin::setPortPlacement(int typ, int x, int y, int orient) {
-  int i = numPorts_ - 1;
-  pinPort_[i]->setPlacement(typ, x, y, orient);
-}
-
-// 5.7
-int defiPin::hasPort() const {
-  return numPorts_;
-}
-
-// 5.7
-int defiPin::numPorts() const {
-  return numPorts_;
-}
-
-// 5.7
-defiPinPort* defiPin::pinPort(int index) const {
-  if (index < 0 || index > numPorts_) {
-    defiError(1, 0, "index out of bounds", defData);
-    return 0;
-  }
-  return pinPort_[index];
-}
-
-void defiPin::print(FILE* f) const {
-  int xl, yl, xh,yh;
-  int i;
-
-  fprintf(f, "PINS '%s' on net '%s'\n", pinName(),
-      netName());
-  if (hasDirection())
-    fprintf(f, "+ DIRECTION '%s'\n", direction());
-  if (hasNetExpr())
-    fprintf(f, "+ NETEXPR '%s'\n", netExpr());
-  if (hasSupplySensitivity())
-    fprintf(f, "+ SUPPLYSENSITIVITY '%s'\n",
-               supplySensitivity());
-  if (hasGroundSensitivity())
-    fprintf(f, "+ GROUNDSENSITIVITY '%s'\n",
-               groundSensitivity());
-  if (hasUse())
-    fprintf(f, "+ USE '%s'\n", use());
-  if (hasLayer()) {
-    for (i = 0; i < numLayer(); i++) {
-       bounds(i, &xl, &yl, &xh, &yh);
-       fprintf(f, "+ LAYER '%s' %d %d %d %d\n",
-            layer(i), xl, yl, xh, yh);
-    }
-  }
-  for (i = 0; i < numPolygons(); i++) {
-    fprintf(f, "+ POLYGON %s", polygonName(i));
-    if (hasPolygonSpacing(i)) {
-      fprintf(f, " SPACING %d", polygonSpacing(i));
-    }
-    if (hasPolygonDesignRuleWidth(i)) {
-      fprintf(f, " DESIGNRULEWIDTH %d",
-              polygonDesignRuleWidth(i));
-    }
-    fprintf(f, "\n");
-  }
-  for (i = 0; i < numVias(); i++) {
-    fprintf(f, "+ VIA %s %d %d\n", viaName(i),
-            viaPtX(i), viaPtY(i));
-  }
-  if (hasPlacement())
-    fprintf(f, "  PLACED %s%s%d %d\n",
-    isFixed() ? " FIXED" : "",
-    isCover() ? " COVER" : "",
-    placementX(),
-    placementY());
-  if (hasSpecial())
-    fprintf(f, "+ SPECIAL\n");
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.hpp
deleted file mode 100644
index ae65a05..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinCap.hpp
+++ /dev/null
@@ -1,430 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiPinCap_h
-#define defiPinCap_h
-
-
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiPinCap {
-public:
-
-  void setPin(int p);
-  void setCap(double d);
-
-  int pin() const;
-  double cap() const;
-
-  void print(FILE* f) const;
-
-protected:
-  int pin_;        // pin num
-  double cap_;     // capacitance
-};
-
-
-// 5.5
-class defiPinAntennaModel {
-public:
-  defiPinAntennaModel(defrData *data);
-  void Init();
-
-  ~defiPinAntennaModel();
-  void clear();
-  void Destroy();
-
-  void setAntennaModel(int oxide);
-  void addAPinGateArea(int value, const char* layer);
-  void addAPinMaxAreaCar(int value, const char* layer);
-  void addAPinMaxSideAreaCar(int value, const char* layer);
-  void addAPinMaxCutCar(int value, const char* layer);
-
-  char* antennaOxide() const;
-
-  int hasAPinGateArea() const;               // ANTENNAPINGATEAREA
-  int numAPinGateArea() const;
-  int APinGateArea(int index) const;
-  int hasAPinGateAreaLayer(int index) const;
-  const char* APinGateAreaLayer(int index) const;
-
-  int hasAPinMaxAreaCar() const;             // ANTENNAPINMAXAREACAR
-  int numAPinMaxAreaCar() const;
-  int APinMaxAreaCar(int index) const;
-  int hasAPinMaxAreaCarLayer(int index) const;
-  const char* APinMaxAreaCarLayer(int index) const;
-
-  int hasAPinMaxSideAreaCar() const;         // ANTENNAPINMAXSIDEAREACAR
-  int numAPinMaxSideAreaCar() const;
-  int APinMaxSideAreaCar(int index) const;
-  int hasAPinMaxSideAreaCarLayer(int index) const;
-  const char* APinMaxSideAreaCarLayer(int index) const;
-
-  int hasAPinMaxCutCar() const;              // ANTENNAPINMAXCUTCAR
-  int numAPinMaxCutCar() const;
-  int APinMaxCutCar(int index) const;
-  int hasAPinMaxCutCarLayer(int index) const;
-  const char* APinMaxCutCarLayer(int index) const;
-
-protected:
-  char* oxide_;
-
-  int numAPinGateArea_;                  // 5.4
-  int APinGateAreaAllocated_;
-  int* APinGateArea_;                    // 5.4 AntennaPinGateArea
-  char** APinGateAreaLayer_;             // 5.4 Layer
-
-  int numAPinMaxAreaCar_;                // 5.4
-  int APinMaxAreaCarAllocated_;
-  int* APinMaxAreaCar_;                  // 5.4 AntennaPinMaxAreaCar
-  char** APinMaxAreaCarLayer_;           // 5.4 Layer
-
-  int numAPinMaxSideAreaCar_;            // 5.4
-  int APinMaxSideAreaCarAllocated_;
-  int* APinMaxSideAreaCar_;              // 5.4 AntennaPinMaxSideAreaCar
-  char** APinMaxSideAreaCarLayer_;       // 5.4 Layer
-
-  int numAPinMaxCutCar_;                 // 5.4
-  int APinMaxCutCarAllocated_;
-  int* APinMaxCutCar_;                   // 5.4 AntennaPinMaxCutCar
-  char** APinMaxCutCarLayer_;            // 5.4 Layer
-
-  defrData *defData;
-};
-
-class defiPinPort {                      // 5.7
-public:
-  defiPinPort(defrData *data);
-  void Init();
-
-  ~defiPinPort();
-
-  void clear();
-
-  void addLayer(const char* layer);
-  void addLayerSpacing(int minSpacing);
-  void addLayerMask(int mask);
-  void addLayerDesignRuleWidth(int effectiveWidth);
-  void addLayerPts(int xl, int yl, int xh, int yh);
-  void addPolygon(const char* layerName);
-  void addPolySpacing(int minSpacing);
-  void addPolyMask(int mask);
-  void addPolyDesignRuleWidth(int effectiveWidth);
-  void addPolygonPts(defiGeometries* geom);
-  void addVia(const char* via, int viaX, int viaY, int color = 0);
-  void setPlacement(int typ, int x, int y, int orient);
-
-  int   numLayer() const;
-  const char* layer(int index) const;
-  void  bounds(int index, int* xl, int* yl, int* xh, int* yh) const;
-  int   hasLayerSpacing(int index) const;
-  int   hasLayerDesignRuleWidth(int index) const;
-  int   layerSpacing(int index) const;
-  int   layerMask(int index) const;
-  int   layerDesignRuleWidth(int index) const;
-  int   numPolygons() const;
-  const char* polygonName(int index) const;
-  defiPoints getPolygon(int index) const;
-  int   hasPolygonSpacing(int index) const;
-  int   hasPolygonDesignRuleWidth(int index) const;
-  int   polygonSpacing(int index) const;
-  int   polygonDesignRuleWidth(int index) const;
-  int   polygonMask(int index) const;
-  int   numVias() const;
-  const char* viaName(int index) const;
-  int   viaPtX (int index) const;
-  int   viaPtY (int index) const;
-  int   viaTopMask (int index) const;
-  int   viaCutMask (int index) const;
-  int   viaBottomMask (int index) const;
-  int   hasPlacement() const;
-  int   isPlaced() const;
-  int   isCover() const;
-  int   isFixed() const;
-  int   placementX() const;
-  int   placementY() const;
-  int   orient() const;
-  const char* orientStr() const;
-
-protected:
-  int    layersAllocated_;
-  int    numLayers_;
-  char** layers_;
-  int    *layerMinSpacing_;
-  int    *layerEffectiveWidth_;
-  int    *xl_, *yl_, *xh_, *yh_;
-  int    *layerMask_;
-  int    polysAllocated_;
-  int    numPolys_;
-  char** polygonNames_;
-  int    *polyMinSpacing_;
-  int    *polyMask_;
-  int    *polyEffectiveWidth_;
-  defiPoints** polygons_;
-  int    viasAllocated_;
-  int    numVias_;
-  char** viaNames_;
-  int    *viaX_;
-  int    *viaY_;
-  int    *viaMask_;
-  char   placeType_;
-  int    x_, y_;
-  char   orient_;
-
-  defrData *defData;
-};
-
-class defiPin {
-public:
-  defiPin(defrData *data);
-  void Init();
-
-  ~defiPin();
-  void Destroy();
-
-  void Setup(const char* pinName, const char* netName);
-  void setDirection(const char* dir);
-  void setUse(const char* use);
-  // 5.6 setLayer is changed to addLayer due to multiple LAYER are allowed
-  // in 5.6
-  void addLayer(const char* layer);
-  void addLayerMask(int mask);                                    // 5.8
-  void addLayerSpacing(int minSpacing);                           // 5.6
-  void addLayerDesignRuleWidth(int effectiveWidth);               // 5.6
-  void addLayerPts(int xl, int yl, int xh, int yh);
-  void addPolygon(const char* layerName);                         // 5.6
-  void addPolyMask(int mask);                                     // 5.8
-  void addPolySpacing(int minSpacing);                            // 5.6
-  void addPolyDesignRuleWidth(int effectiveWidth);                // 5.6
-  void addPolygonPts(defiGeometries* geom);                       // 5.6
-  void setNetExpr(const char* netExpr);                           // 5.6
-  void setSupplySens(const char* pinName);                        // 5.6
-  void setGroundSens(const char* pinName);                        // 5.6
-  void setPlacement(int typ, int x, int y, int orient);
-  void setSpecial();
-  void addAntennaModel(int oxide);                                // 5.5
-  void addAPinPartialMetalArea(int value, const char* layer);
-  void addAPinPartialMetalSideArea(int value, const char* layer);
-  void addAPinGateArea(int value, const char* layer);
-  void addAPinDiffArea(int value, const char* layer);
-  void addAPinMaxAreaCar(int value, const char* layer);
-  void addAPinMaxSideAreaCar(int value, const char* layer);
-  void addAPinPartialCutArea(int value, const char* layer);
-  void addAPinMaxCutCar(int value, const char* layer);
-  void addVia(const char* via, int viaX, int viaY, int color = 0);               // 5.7
-  // 5.7 port statements, which may have LAYER, POLYGON, &| VIA
-  void addPort();                                                 // 5.7
-  void addPortLayer(const char* layer);                           // 5.7
-  void addPortLayerSpacing(int minSpacing);                       // 5.7
-  void addPortLayerDesignRuleWidth(int effectiveWidth);           // 5.7
-  void addPortLayerPts(int xl, int yl, int xh, int yh);           // 5.7
-  void addPortLayerMask(int color);                               // 5.8
-  void addPortPolygon(const char* layerName);                     // 5.7
-  void addPortPolySpacing(int minSpacing);                        // 5.7
-  void addPortPolyDesignRuleWidth(int effectiveWidth);            // 5.7
-  void addPortPolygonPts(defiGeometries* geom);                   // 5.7
-  void addPortPolyMask(int color);                                // 5.8
-  void addPortVia(const char* via, int viaX, int viaY, int color = 0);           // 5.7
-  void setPortPlacement(int typ, int x, int y, int orient);       // 5.7 - 5.8
-
-  void clear();
-
-  void changePinName(const char* pinName);       // For OA to modify the pinName
-
-  const char* pinName() const;
-  const char* netName() const;
-  // optional parts
-  int hasDirection() const;
-  int hasUse() const;
-  int hasLayer() const;
-  int hasPlacement() const;
-  int isUnplaced() const;
-  int isPlaced() const;
-  int isCover() const;
-  int isFixed() const;
-  int placementX() const;
-  int placementY() const;
-  const char* direction() const;
-  const char* use() const;
-  int numLayer() const;
-  const char* layer(int index) const;
-  void bounds(int index, int* xl, int* yl, int* xh, int* yh) const;
-  int layerMask(int index) const;                     // 5.8
-  int hasLayerSpacing(int index) const;               // 5.6
-  int hasLayerDesignRuleWidth(int index) const;       // 5.6
-  int layerSpacing(int index) const;                  // 5.6
-  int layerDesignRuleWidth(int index) const;          // 5.6
-  int  numPolygons() const;                           // 5.6
-  const  char* polygonName(int index) const;          // 5.6
-  defiPoints getPolygon(int index) const;      // 5.6
-  int polygonMask(int index) const;                      // 5.8
-  int hasPolygonSpacing(int index) const;             // 5.6
-  int hasPolygonDesignRuleWidth(int index) const;     // 5.6
-  int polygonSpacing(int index) const;                // 5.6
-  int polygonDesignRuleWidth(int index) const;        // 5.6
-  int  hasNetExpr() const;                            // 5.6
-  int  hasSupplySensitivity() const;                  // 5.6
-  int  hasGroundSensitivity() const;                  // 5.6
-  const char* netExpr() const;                        // 5.6
-  const char* supplySensitivity() const;              // 5.6
-  const char* groundSensitivity() const;              // 5.6
-  int orient() const;
-  const char* orientStr() const;
-  int hasSpecial() const;
-  int numVias() const;                                // 5.7
-  const char* viaName(int index) const;               // 5.7
-  int viaTopMask(int index) const;                    // 5.8
-  int viaCutMask(int index) const;                    // 5.8
-  int viaBottomMask(int index) const;                 // 5.8
-  int viaPtX (int index) const;                       // 5.7
-  int viaPtY (int index) const;                       // 5.7
-
-  // 5.4
-  int hasAPinPartialMetalArea() const;       // ANTENNAPINPARTIALMETALAREA
-  int numAPinPartialMetalArea() const;
-  int APinPartialMetalArea(int index) const;
-  int hasAPinPartialMetalAreaLayer(int index) const;
-  const char* APinPartialMetalAreaLayer(int index) const;
-
-  int hasAPinPartialMetalSideArea() const;   // ANTENNAPINPARTIALMETALSIDEAREA
-  int numAPinPartialMetalSideArea() const;
-  int APinPartialMetalSideArea(int index) const;
-  int hasAPinPartialMetalSideAreaLayer(int index) const;
-  const char* APinPartialMetalSideAreaLayer(int index) const;
-
-  int hasAPinDiffArea() const;               // ANTENNAPINDIFFAREA
-  int numAPinDiffArea() const;
-  int APinDiffArea(int index) const;
-  int hasAPinDiffAreaLayer(int index) const;
-  const char* APinDiffAreaLayer(int index) const;
-
-  int hasAPinPartialCutArea() const;         // ANTENNAPINPARTIALCUTAREA
-  int numAPinPartialCutArea() const;
-  int APinPartialCutArea(int index) const;
-  int hasAPinPartialCutAreaLayer(int index) const;
-  const char* APinPartialCutAreaLayer(int index) const;
-
-  // 5.5
-  int numAntennaModel() const;
-  defiPinAntennaModel* antennaModel(int index) const;
-
-  // 5.7
-  int  hasPort() const;
-  int  numPorts() const;
-  defiPinPort* pinPort(int index) const;
-  void print(FILE* f) const;
-
-protected:
-  int pinNameLength_;    // allocated size of pin name
-  char* pinName_;
-  int netNameLength_;    // allocated size of net name
-  char* netName_;
-  char hasDirection_;
-  char hasUse_;
-  char placeType_;
-  char orient_;          // orient 0-7
-  int useLength_;        // allocated size of length
-  char* use_;
-  int directionLength_;  // allocated size of direction
-  char* direction_;
-  char** layers_;                   // 5.6, changed to array
-  int *xl_, *yl_, *xh_, *yh_;       // 5.6, changed to arrays
-  int *layerMinSpacing_;            // 5.6, SPACING in LAYER
-  int *layerEffectiveWidth_;        // 5.6, DESIGNRULEWIDTH in LAYER
-  int layersAllocated_;             // 5.6
-  int numLayers_;                   // 5.6
-  int *layerMask_;                  // 5.8
-  char** polygonNames_;             // 5.6 layerName for POLYGON
-  int *polyMinSpacing_;             // 5.6, SPACING in POLYGON
-  int *polyEffectiveWidth_;         // 5.6, DESIGNRULEWIDTH in POLYGON
-  int *polyMask_;                   // 5.8
-  int numPolys_;                    // 5.6
-  int polysAllocated_;              // 5.6
-  defiPoints** polygons_;    // 5.6 
-  int x_, y_;            // placement
-  int hasSpecial_;
-  int numVias_;                     // 5.7
-  int viasAllocated_;               // 5.7
-  char** viaNames_;                 // 5.7
-  int *viaX_;                       // 5.7
-  int *viaY_;                       // 5.7
-  int *viaMask_;                    // 5.8
-  int numPorts_;                    // 5.7
-  int portsAllocated_;              // 5.7
-  defiPinPort ** pinPort_;          // 5.7
-
-  // 5.5 AntennaModel
-  int numAntennaModel_;
-  int antennaModelAllocated_;
-  defiPinAntennaModel** antennaModel_;
-
-  int numAPinPartialMetalArea_;          // 5.4
-  int APinPartialMetalAreaAllocated_;
-  int* APinPartialMetalArea_;            // 5.4 AntennaPinPartialMetalArea
-  char** APinPartialMetalAreaLayer_;     // 5.4 Layer
-
-  int numAPinPartialMetalSideArea_;      // 5.4
-  int APinPartialMetalSideAreaAllocated_;
-  int* APinPartialMetalSideArea_;        // 5.4 AntennaPinPartialMetalSideArea
-  char** APinPartialMetalSideAreaLayer_; // 5.4 Layer
-
-  int numAPinDiffArea_;                  // 5.4
-  int APinDiffAreaAllocated_;
-  int* APinDiffArea_;                    // 5.4 AntennaPinDiffArea
-  char** APinDiffAreaLayer_;             // 5.4 Layer
-
-  int numAPinPartialCutArea_;            // 5.4
-  int APinPartialCutAreaAllocated_;
-  int* APinPartialCutArea_;              // 5.4 AntennaPinPartialCutArea
-  char** APinPartialCutAreaLayer_;       // 5.4 Layer
-
-  int netExprLength_;                    // 5.6
-  char hasNetExpr_;                      // 5.6
-  char* netExpr_;                        // 5.6
-  int supplySensLength_;                 // 5.6
-  char hasSupplySens_;                   // 5.6
-  char* supplySens_;                     // 5.6
-  int groundSensLength_;                 // 5.6
-  char hasGroundSens_;                   // 5.6
-  char* groundSens_;                     // 5.6
-
-  defrData *defData;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.cpp
deleted file mode 100644
index 63b5fa0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiDebug.hpp"
-#include "defiPinProp.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//        defiPinProp
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-
-
-defiPinProp::defiPinProp(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-
-void defiPinProp::Init() {
-  instName_ = (char*)malloc(16);
-  pinName_ = (char*)malloc(16);
-  pinNameSize_ = 16;
-  instNameSize_ = 16;
-  isPin_ = 0;
-  numProps_ = 0;
-  propsAllocated_ = 2;
-  propNames_   = (char**)malloc(sizeof(char*)*2);
-  propValues_  = (char**)malloc(sizeof(char*)*2);
-  propDValues_ = (double*)malloc(sizeof(double)*2);
-  propTypes_   = (char*)malloc(sizeof(char)*2);
-}
-
-
-defiPinProp::~defiPinProp() {
-  Destroy();
-}
-
-
-void defiPinProp::Destroy() {
-  clear();
-  free(instName_);
-  free(pinName_);
-  free((char*)(propNames_));
-  free((char*)(propValues_));
-  free((char*)(propDValues_));
-  free((char*)(propTypes_));
-}
-
-
-void defiPinProp::clear() {
-  int i;
-  for (i = 0; i < numProps_; i++) {
-    free(propNames_[i]);
-    free(propValues_[i]);
-    propDValues_[i] = 0;
-  }
-  numProps_ = 0;
-  isPin_ = 0;
-}
-
-
-void defiPinProp::setName(const char* inst, const char* pin) {
-  int len = strlen(inst) + 1;
-
-  if ((strcmp(inst, "PIN") == 0) || (strcmp(inst,"pin") == 0)) {
-     isPin_ = 1;
-     instName_[0] = '\0'; /* make sure to clear any prev inst */
-  } else {
-     if (instNameSize_ < len) {
-       instNameSize_ = len;
-       free(instName_);
-       instName_ = (char*)malloc(len);
-     }
-     strcpy(instName_, defData->DEFCASE(inst));
-  }
-
-  len = strlen(pin) + 1;
-  if (pinNameSize_ < len) {
-    pinNameSize_ = len;
-    free(pinName_);
-    pinName_ = (char*)malloc(len);
-  }
-  strcpy(pinName_, defData->DEFCASE(pin));
-}
-
-
-int defiPinProp::isPin() const {
-  return isPin_ ? 1 : 0;
-}
-
-
-const char* defiPinProp::instName() const {
-  return instName_;
-}
-
-
-const char* defiPinProp::pinName() const {
-  return pinName_;
-}
-
-
-void defiPinProp::addProperty(const char* name, const char* value,
-                              const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_   = nn;
-    propValues_  = nv;
-    propDValues_ = nd;
-    propTypes_   = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = 0;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiPinProp::addNumProperty(const char* name, const double d,
-                                 const char* value, const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_   = nn;
-    propValues_  = nv;
-    propDValues_ = nd;
-    propTypes_   = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = d;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-int defiPinProp::numProps() const {
-  return numProps_;
-}
-
-
-const char* defiPinProp::propName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propNames_[index];
-}
-
-
-const char* defiPinProp::propValue(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propValues_[index];
-}
-
-
-double defiPinProp::propNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propDValues_[index];
-}
-
-
-const char defiPinProp::propType(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propTypes_[index];
-}
-
-
-int defiPinProp::propIsNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 1 : 0;
-}
-
-
-int defiPinProp::propIsString(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6120): The index number %d specified for the PIN PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6120, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 0 : 1;
-}
-
-
-void defiPinProp::print(FILE* f) const {
-  int i;
-
-  fprintf(f, "PinProp %s %s\n", instName(),
-     pinName());
-
-  for (i = 0; i < numProps(); i++) {
-    fprintf(f, "    %s %s\n", propName(i),
-                              propValue(i));
-  }
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.hpp
deleted file mode 100644
index 41bad74..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPinProp.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiPinProp_h
-#define defiPinProp_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiPinProp {
-public:
-  defiPinProp(defrData *data);
-  void Init();
-
-  ~defiPinProp();
-  void Destroy();
-
-  void clear();
-
-  void setName(const char* inst, const char* pin);
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d,
-                      const char* value, const char type);
-
-  int isPin() const;
-  const char* instName() const;
-  const char* pinName() const;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-  void print(FILE* f) const;
-
-protected:
-  char isPin_;
-  int instNameSize_;
-  char* instName_;
-  int pinNameSize_;
-  char* pinName_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  propNames_;
-  char**  propValues_;
-  double* propDValues_;
-  char*   propTypes_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.cpp
deleted file mode 100644
index 7430913..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiProp.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defiProp::defiProp(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-
-void defiProp::Init() {
-  stringLength_ = 16;
-  stringData_ = (char*)malloc(16);
-  nameSize_ = 16;
-  propName_ = (char*)malloc(16);
-  clear();
-}
-
-
-void defiProp::Destroy() {
-  free(stringData_);
-  free(propName_);
-}
-
-
-defiProp::~defiProp() {
-  Destroy();
-}
-
-
-void defiProp::setPropType(const char* typ, const char* string) {
-  int len;
-  propType_ = (char*)typ;
-  if ((len = strlen(string)+1) > nameSize_)
-    bumpName(len);
-  strcpy(propName_, defData->DEFCASE(string));
-}
-
-
-void defiProp::setRange(double left, double right) {
-  hasRange_ = 1;
-  left_ = left;
-  right_ = right;
-}
-
-
-void defiProp::setNumber(double d) {
-  hasNumber_ = 1;
-  d_ = d;
-}
-
-
-void defiProp::setPropInteger() {
-  dataType_ = 'I';
-}
-
-
-void defiProp::setPropReal() {
-  dataType_ = 'R';
-}
-
-
-void defiProp::setPropString() {
-  dataType_ = 'S';
-}
-
-
-void defiProp::setPropNameMapString(const char* string) {
-  int len;
-  dataType_ = 'N';
-  hasNameMapString_ = 1;
-  if ((len = strlen(string)+1) > stringLength_)
-    bumpSize(len);
-  strcpy(stringData_, defData->DEFCASE(string));
-}
-
-
-void defiProp::setPropQString(const char* string) {
-  int len;
-  dataType_ = 'Q';
-  if ((len = strlen(string)+1) > stringLength_)
-    bumpSize(len);
-  strcpy(stringData_, defData->DEFCASE(string));
-}
-
-
-const char* defiProp::string() const {
-  return stringData_;
-}
-
-
-const char* defiProp::propType() const {
-  return propType_;
-}
-
-
-int defiProp::hasNameMapString() const {
-  return (int)(hasNameMapString_);
-}
-
-
-int defiProp::hasNumber() const {
-  return (int)(hasNumber_);
-}
-
-
-int defiProp::hasRange() const {
-  return (int)(hasRange_);
-}
-
-
-double defiProp::number() const {
-  return d_;
-}
-
-
-double defiProp::left() const {
-  return left_;
-}
-
-
-double defiProp::right() const {
-  return right_;
-}
-
-
-void defiProp::bumpSize(int size) {
-  free(stringData_);
-  stringData_ = (char*)malloc(size);
-  stringLength_ = size;
-  *(stringData_) = '\0';
-}
-
-
-void defiProp::bumpName(int size) {
-  free(propName_);
-  propName_ = (char*)malloc(size);
-  nameSize_ = size;
-  *(propName_) = '\0';
-}
-
-
-
-void defiProp::clear() {
-  if (stringData_)
-     *(stringData_) = '\0';
-  if (propName_)
-     *(propName_) = '\0';
-  propType_ = 0;
-  hasRange_ = 0;
-  hasNumber_ = 0;
-  hasNameMapString_ = 0;
-  dataType_ = 'B'; /* bogus */
-  d_ = left_ = right_ = 0.0;
-}
-
-
-int defiProp::hasString() const {
-  return *(stringData_) ? 1 : 0 ;
-}
-
-
-const char* defiProp::propName() const {
-  return (propName_);
-}
-
-
-char defiProp::dataType() const {
-  return (dataType_);
-}
-
-
-void defiProp::print(FILE* f) const {
-  fprintf(f, "Prop type '%s'\n", propType());
-  if (hasString()) {
-    fprintf(f, "  string '%s'\n", string());
-  }
-  if (hasNumber()) {
-    fprintf(f, "  number %5.2f\n", number());
-  }
-  if (hasRange()) {
-    fprintf(f, "  range %5.2f - %5.2f\n",
-      left(), right());
-  }
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.hpp
deleted file mode 100644
index 83b4cd4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiProp.hpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiProp_h
-#define defiProp_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-// Struct holds the data for one property.
-class defiProp {
-public:
-  defiProp(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiProp();
-
-  void setPropType(const char* typ, const char* string);
-  void setRange(double left, double right);
-  void setNumber(double num);
-  void setPropInteger();
-  void setPropReal();
-  void setPropString();
-  void setPropQString(const char* string);
-  void setPropNameMapString(const char* string);
-  void clear();
-
-  const char* string() const;
-  const char* propType() const;
-  const char* propName() const;
-  char  dataType() const;
-       // either I:integer R:real S:string Q:quotedstring N:nameMapString
-  int hasNumber() const;
-  int hasRange() const;
-  int hasString() const;
-  int hasNameMapString() const;
-  double number() const;
-  double left() const;
-  double right() const;
-
-  void bumpSize(int size);
-  void bumpName(int size);
-
-  void print(FILE* f) const;
-
-protected:
-  char* propType_;      // "design" ...
-  char* propName_;      // name.
-  int nameSize_;        // allocated size of name.
-  char hasRange_;       // either 0:NO or 1:YES.
-  char hasNumber_;      // either 0:NO or 1:YES.
-  char hasNameMapString_;
-  char dataType_;       // either I:integer R:real S:string Q:quotedstring.
-                        //   N:nameMapString
-  char* stringData_;    // if it is a string the data is here.
-  int stringLength_;    // allocated size of stringData.
-  double left_, right_; // if it has a range the numbers are here.
-  double d_;            // if it is a real or int the number is here.
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.cpp
deleted file mode 100644
index 40a285c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiPropType.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-
-defiPropType::defiPropType() {
-  Init();
-}
-
-
-void defiPropType::Init() {
-  numProperties_ = 0;
-  propertiesAllocated_ = 0;
-  propNames_ = 0;
-  propTypes_ = 0;
-}
-
-
-void defiPropType::Clear() {
-  int i;
-
-  for (i = 0; i < numProperties_; i++) {
-    free(propNames_[i]);
-  }
-  numProperties_ = 0;
-  propertiesAllocated_ = 0;
-}
-
-
-void defiPropType::Destroy() {
-  Clear();
-  if (propNames_)
-     free(propNames_);
-  if (propTypes_)
-     free(propTypes_);
-}
-
-
-defiPropType::~defiPropType() {
-  Destroy();
-}
-
-
-void defiPropType::setPropType(const char* name, const char type) {
-  int len;
-
-  if (numProperties_ == propertiesAllocated_)
-    bumpProps();
-  len = strlen(name) + 1;
-  propNames_[numProperties_] = (char*)malloc(len);
-  strcpy(propNames_[numProperties_], name);
-  propTypes_[numProperties_] = type;
-  numProperties_ += 1;
-}
-
-
-void defiPropType::bumpProps() {
-  int lim = propertiesAllocated_;
-  int news ;
-  char** newpn;
-  char*   newt;
- 
-  news = lim ? lim + lim : 2;
- 
-  newpn = (char**)malloc(sizeof(char*)*news);
-  newt = (char*)malloc(sizeof(char)*news);
- 
-  lim = propertiesAllocated_ = news;
- 
-  if (lim > 2) {
-     int i;
-     for (i = 0; i < numProperties_; i++) {
-       newpn[i] = propNames_[i];
-       newt[i] = propTypes_[i];
-     }
-     free((char*)(propNames_));
-     free((char*)(propTypes_));
-  }
-  propNames_ = newpn;
-  propTypes_ = newt;
-}
-
-
-const char defiPropType::propType(char* name) const {
-  int i;
-
-  // Name is NULL, error
-  if (!name)
-     return('N');
-
-  for (i = 0; i < numProperties_; i++) {
-     if (strcmp(name, propNames_[i]) == 0)
-        return(propTypes_[i]);  // found the prop name
-  }
-  return('N'); // Can't found the name
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.hpp
deleted file mode 100644
index becd62e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiPropType.hpp
+++ /dev/null
@@ -1,66 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiPropType_h
-#define defiPropType_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Struct holds the data type for one property, if the property is
-// either REAL or INTEGER.
-class defiPropType {
-public:
-  defiPropType();
-  void Init();
-
-  void Destroy();
-  ~defiPropType();
-
-  void setPropType(const char* name, const char type);
-  void Clear();
-
-  const char propType(char* name) const;
-  void bumpProps();
-
-protected:
-  int    numProperties_;
-  int    propertiesAllocated_;
-  char** propNames_;      // name.
-  char*  propTypes_;      // 'R' == "REAL", 'I' == "INTEGER"
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.cpp
deleted file mode 100644
index 0fdda45..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.cpp
+++ /dev/null
@@ -1,409 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiRegion.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiRegion
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiRegion::defiRegion(defrData *data)
-: defData(data)
-{
-  Init();
-}
-
-
-void defiRegion::Init() {
-  name_ = 0;
-  nameLength_ = 0;
-  type_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  numProps_ = 0;
-  propsAllocated_ = 2;
-  propNames_ = (char**)malloc(sizeof(char*)*2);
-  propValues_ = (char**)malloc(sizeof(char*)*2);
-  propDValues_ = (double*)malloc(sizeof(double)*2);
-  propTypes_ = (char*)malloc(sizeof(char)*2);
-  clear();
-  numRectangles_ = 0;
-  rectanglesAllocated_ = 1;
-  xl_ = (int*)malloc(sizeof(int)*1);
-  yl_ = (int*)malloc(sizeof(int)*1);
-  xh_ = (int*)malloc(sizeof(int)*1);
-  yh_ = (int*)malloc(sizeof(int)*1);
-}
-
-
-defiRegion::~defiRegion() {
-  Destroy();
-}
-
-
-void defiRegion::clear() {
-  int i;
-  for (i = 0; i < numProps_; i++) {
-    free(propNames_[i]);
-    free(propValues_[i]);
-    propDValues_[i] = 0;
-  }
-  numProps_ = 0;
-  numRectangles_ = 0;
-  if (type_) free(type_);
-  type_ = 0;
-}
-
-
-void defiRegion::Destroy() {
-  if (name_) free(name_);
-  clear();
-  name_ = 0;
-  nameLength_ = 0;
-  free((char*)(xl_));
-  free((char*)(yl_));
-  free((char*)(xh_));
-  free((char*)(yh_));
-  free((char*)(propNames_));
-  free((char*)(propValues_));
-  free((char*)(propDValues_));
-  free((char*)(propTypes_));
-}
-
-
-void defiRegion::addRect(int xl, int yl, int xh, int yh) {
-  if (numRectangles_ == rectanglesAllocated_) {
-    int i;
-    int max = rectanglesAllocated_ = rectanglesAllocated_ * 2;
-    int* newxl = (int*)malloc(sizeof(int)*max);
-    int* newyl = (int*)malloc(sizeof(int)*max);
-    int* newxh = (int*)malloc(sizeof(int)*max);
-    int* newyh = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRectangles_; i++) {
-      newxl[i] = xl_[i];
-      newyl[i] = yl_[i];
-      newxh[i] = xh_[i];
-      newyh[i] = yh_[i];
-    }
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    xl_ = newxl;
-    yl_ = newyl;
-    xh_ = newxh;
-    yh_ = newyh;
-  }
-  xl_[numRectangles_] = xl;
-  yl_[numRectangles_] = yl;
-  xh_[numRectangles_] = xh;
-  yh_[numRectangles_] = yh;
-  numRectangles_ += 1;
-}
-
-
-void defiRegion::setup(const char* name) {
-  int len = strlen(name) + 1;
-
-  clear();
-
-  if (len > nameLength_) {
-    if (name_) free(name_);
-    nameLength_ = len;
-    name_ = (char*)malloc(len);
-  }
-
-  strcpy(name_, defData->DEFCASE(name));
-
-}
-
-void defiRegion::addProperty(const char* name, const char* value,
-                             const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = 0;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-void defiRegion::addNumProperty(const char* name, const double d,
-                                const char* value, const char type) {
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = d;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiRegion::setType(const char* type) {
-  int len;
-  if (type_) free(type_);
-  len = strlen(type) + 1;
-  type_ = (char*)malloc(len);
-  strcpy(type_, defData->DEFCASE(type));
-}
-
-
-int defiRegion::hasType() const {
-  return type_ ? 1 : 0;
-}
-
-
-const char* defiRegion::type() const {
-  return type_;
-}
-
-
-int defiRegion::numRectangles() const {
-  return numRectangles_;
-}
-
-
-int defiRegion::numProps() const {
-  return numProps_;
-}
-
-
-const char* defiRegion::propName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propNames_[index];
-}
-
-
-const char* defiRegion::propValue(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propValues_[index];
-}
-
-
-double defiRegion::propNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propDValues_[index];
-}
-
-
-const char defiRegion::propType(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propTypes_[index];
-}
-
-int defiRegion::propIsNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 1 : 0;
-}
-
-int defiRegion::propIsString(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6130): The index number %d specified for the REGION PROPERTY is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6130, msg, defData);
-     return 0;
-  }
-  return propDValues_[index] ? 0 : 1;
-}
-
-const char* defiRegion::name() const {
-  return name_;
-}
-
-
-int defiRegion::xl(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6131): The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6131, msg, defData);
-     return 0;
-  }
-  return xl_[index];
-}
-
-
-int defiRegion::yl(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6131): The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6131, msg, defData);
-     return 0;
-  }
-  return yl_[index];
-}
-
-
-int defiRegion::xh(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6131): The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6131, msg, defData);
-     return 0;
-  }
-  return xh_[index];
-}
-
-
-int defiRegion::yh(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6131): The index number %d specified for the REGION RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6131, msg, defData);
-     return 0;
-  }
-  return yh_[index];
-}
-
-
-void defiRegion::print(FILE* f) const {
-  int i;
-  fprintf(f, "Region '%s'", name());
-  for (i = 0; i < numRectangles(); i++) {
-    fprintf(f, " %d %d %d %d",
-      xl(i),
-      yl(i),
-      xh(i),
-      yh(i));
-  }
-  fprintf(f, "\n");
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.hpp
deleted file mode 100644
index 3fe2150..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRegion.hpp
+++ /dev/null
@@ -1,107 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiRegion_h
-#define defiRegion_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-// Struct holds the data for one property.
-class defiRegion {
-public:
-  defiRegion(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiRegion();
-
-  void clear();
-  void setup(const char* name);
-  void addRect(int xl, int yl, int xh, int yh);
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d,
-                      const char* value, const char type);
-  void setType(const char* type);         // 5.4.1
-
-  const char* name() const;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int propIsNumber(int index) const;
-  int propIsString(int index) const;
-
-  int hasType() const;                    // 5.4.1
-  const char* type() const;               // 5.4.1
-
-  int numRectangles() const;
-  int xl(int index) const;
-  int yl(int index) const;
-  int xh(int index) const;
-  int yh(int index) const;
-
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameLength_;
-
-  int numRectangles_;
-  int rectanglesAllocated_;
-  int* xl_;
-  int* yl_;
-  int* xh_;
-  int* yh_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  propNames_;
-  char**  propValues_;
-  double* propDValues_;
-  char*   propTypes_;
-
-  char* type_;
-
-  defrData *defData;
-};
-
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.cpp
deleted file mode 100644
index 85ee031..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.cpp
+++ /dev/null
@@ -1,626 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "defiRowTrack.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiRow
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiRow::defiRow(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiRow::Init() {
-  nameLength_ = 0;
-  name_ = 0;
-  macroLength_ = 0;
-  macro_ = 0;
-  orient_ = 0;
-  x_ = 0.0;
-  y_ = 0.0;
-  xStep_ = 0.0;
-  yStep_ = 0.0;
-  xNum_ = 0.0;
-  yNum_ = 0.0;
-  hasDo_ = 0;
-  hasDoStep_ = 0;
-  numProps_ = 0;
-  propsAllocated_ = 2;
-  propNames_ = (char**)malloc(sizeof(char*)*2);
-  propValues_ = (char**)malloc(sizeof(char*)*2);
-  propDValues_ = (double*)malloc(sizeof(double)*2);
-  propTypes_ = (char*)malloc(sizeof(char)*2);
-}
-
-
-defiRow::~defiRow() {
-  Destroy();
-}
-
-
-void defiRow::Destroy() {
-  clear();
-  if (name_) free(name_);
-  if (macro_) free(macro_);
-  free((char*)(propNames_));
-  free((char*)(propValues_));
-  free((char*)(propDValues_));
-  free((char*)(propTypes_));
-}
-
-
-void defiRow::clear() {
-  int i;
-  for (i = 0; i < numProps_; i++) {
-    free(propNames_[i]);
-    free(propValues_[i]);
-    propDValues_[i] = 0;
-  }
-  hasDo_ = 0;
-  hasDoStep_ = 0;
-  numProps_ = 0;
-}
-
-
-void defiRow::setup(const char* name, const char* macro, double x, double y,
-		 int orient) {
-  int len = strlen(name) + 1;
-
-  clear();
-
-  if (len > nameLength_) {
-    if (name_) free(name_);
-    nameLength_ = len;
-    name_ = (char*)malloc(len);
-  }
-  strcpy(name_, defData->DEFCASE(name));
-
-  len = strlen(macro) + 1;
-  if (len > macroLength_) {
-    if (macro_) free(macro_);
-    macroLength_ = len;
-    macro_ = (char*)malloc(len);
-  }
-  strcpy(macro_, defData->DEFCASE(macro));
-
-  x_ = x;
-  y_ = y;
-  xStep_ = 0.0;
-  yStep_ = 0.0;
-  xNum_ = 0.0;
-  yNum_ = 0.0;
-  orient_ = orient;
-
-}
-
-
-void defiRow::setDo(double x_num, double y_num,
-		    double x_step, double y_step) {
-  xStep_ = x_step;
-  yStep_ = y_step;
-  xNum_ = x_num;
-  yNum_ = y_num;
-  hasDo_ = 1;
-}
-
-
-void defiRow::setHasDoStep() {
-  hasDoStep_ = 1;
-}
-
-
-void defiRow::addProperty(const char* name, const char* value, const char type) 
-{
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char**  nn;
-    char**  nv;
-    double* nd;
-    char*   nt;
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = 0;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-void defiRow::addNumProperty(const char* name, const double d,
-                             const char* value, const char type) 
-{
-  int len;
-  if (numProps_ == propsAllocated_) {
-    int i;
-    char** nn;
-    char** nv;
-    double* nd;
-    char*  nt;
-    propsAllocated_ *= 2;
-    nn = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nv = (char**)malloc(sizeof(char*)*propsAllocated_);
-    nd = (double*)malloc(sizeof(double)*propsAllocated_);
-    nt = (char*)malloc(sizeof(char)*propsAllocated_);
-    for (i = 0; i < numProps_; i++) {
-      nn[i] = propNames_[i];
-      nv[i] = propValues_[i];
-      nd[i] = propDValues_[i];
-      nt[i] = propTypes_[i];
-    }
-    free((char*)(propNames_));
-    free((char*)(propValues_));
-    free((char*)(propDValues_));
-    free((char*)(propTypes_));
-    propNames_ = nn;
-    propValues_ = nv;
-    propDValues_ = nd;
-    propTypes_ = nt;
-  }
-  len = strlen(name) + 1;
-  propNames_[numProps_] = (char*)malloc(len);
-  strcpy(propNames_[numProps_], defData->DEFCASE(name));
-  len = strlen(value) + 1;
-  propValues_[numProps_] = (char*)malloc(len);
-  strcpy(propValues_[numProps_], defData->DEFCASE(value));
-  propDValues_[numProps_] = d;
-  propTypes_[numProps_] = type;
-  numProps_ += 1;
-}
-
-
-int defiRow::numProps() const {
-  return numProps_;
-}
-
-
-const char* defiRow::propName(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  }
-  return propNames_[index];
-}
-
-
-const char* defiRow::propValue(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  }
-  return propValues_[index];
-}
-
-double defiRow::propNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  }
-  return propDValues_[index];
-}
-
-const char defiRow::propType(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  }
-  return propTypes_[index];
-}
-
-int defiRow::propIsNumber(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  } 
-  return propDValues_[index] ? 1 : 0;
-}
-
-int defiRow::propIsString(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numProps_) {
-     sprintf (msg, "ERROR (DEFPARS-6140): The index number %d specified for the VIA LAYER RECTANGLE is invalide.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numProps_);
-     defiError(0, 6140, msg, defData);
-     return 0;
-  } 
-  return propDValues_[index] ? 0 : 1;
-}
-
-const char* defiRow::name() const {
-  return name_;
-}
-
-
-const char* defiRow::macro() const {
-  return macro_;
-}
-
-
-double defiRow::x() const {
-  return x_;
-}
-
-
-double defiRow::y() const {
-  return y_;
-}
-
-
-double defiRow::xNum() const {
-  return xNum_;
-}
-
-
-double defiRow::yNum() const {
-  return yNum_;
-}
-
-
-int defiRow::orient() const {
-  return orient_;
-}
-
-
-const char* defiRow::orientStr() const {
-  return (defiOrientStr(orient_));
-}
-
-
-int defiRow::hasDo() const {
-  return hasDo_;
-}
-
-
-int defiRow::hasDoStep() const {
-  return hasDoStep_;
-}
-
-
-double defiRow::xStep() const {
-  return xStep_;
-}
-
-
-double defiRow::yStep() const {
-  return yStep_;
-}
-
-
-void defiRow::print(FILE* f) const {
-  fprintf(f, "Row '%s' '%s' %g,%g  orient %s\n",
-      name(), macro(),
-      x(), y(), orientStr());
-  fprintf(f, "  DO X %g STEP %g\n", xNum(),
-      xStep());
-  fprintf(f, "  DO Y %g STEP %g\n", yNum(),
-      yStep());
-}
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiTrack
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiTrack::defiTrack(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiTrack::Init() {
-  macro_ = 0;
-  macroLength_ = 0;
-  x_ = 0.0;
-  xNum_ = 0.0;
-  xStep_ = 0.0;
-  layersLength_ = 0;
-  numLayers_ = 0;
-  layers_ = 0;
-  firstTrackMask_=0;
-  samemask_ = 0;
-}
-
-defiTrack::~defiTrack() {
-  Destroy();
-}
-
-
-void defiTrack::Destroy() {
-  int i;
-
-  if (macro_) free(macro_);
-
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++)
-      if (layers_[i]) free(layers_[i]);
-    free((char*)(layers_));
-  }
-}
-
-
-void defiTrack::setup(const char* macro) {
-  int i;
-  int len = strlen(macro) + 1;
-
-  if (len > macroLength_) {
-    if (macro_) free(macro_);
-    macroLength_ = len;
-    macro_ = (char*)malloc(len);
-  }
-  strcpy(macro_, defData->DEFCASE(macro));
-
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++)
-      if (layers_[i]) {
-        free(layers_[i]);
-        layers_[i] = 0;
-      }
-  }
-  numLayers_ = 0;
-  x_ = 0.0;
-  xStep_ = 0.0;
-  xNum_ = 0.0;
-
-  firstTrackMask_=0;
-  samemask_=0;
-}
-
-
-void defiTrack::setDo(double x, double x_num, double x_step) {
-  x_ = x;
-  xStep_ = x_step;
-  xNum_ = x_num;
-}
-
-
-void defiTrack::addLayer(const char* layer) {
-  char* l;
-  int len;
-
-  if (numLayers_ >= layersLength_) {
-    int i;
-    char** newl;
-    layersLength_ = layersLength_ ? 2 * layersLength_ : 8;
-    newl = (char**)malloc(layersLength_* sizeof(char*));
-    for (i = 0; i < numLayers_; i++)
-      newl[i] = layers_[i];
-    if (layers_) free((char*)(layers_));
-    layers_ = newl;
-  }
-
-  len = strlen(layer) + 1;
-  l = (char*)malloc(len);
-  strcpy(l, defData->DEFCASE(layer));
-  layers_[numLayers_++] = l;
-}
-
-void defiTrack::addMask(int colorMask, int sameMask) {
-   samemask_=sameMask;
-   firstTrackMask_= colorMask;
-}
-
-
-const char* defiTrack::macro() const {
-  return macro_;
-}
-
-
-double defiTrack::x() const {
-  return x_;
-}
-
-
-double defiTrack::xNum() const {
-  return xNum_;
-}
-
-
-double defiTrack::xStep() const {
-  return xStep_;
-}
-
-
-int defiTrack::numLayers() const {
-  return numLayers_;
-}
-
-
-const char* defiTrack::layer(int index) const {
-  if (index >= 0 && index < numLayers_) {
-    return layers_[index];
-  }
-
-  return 0;
-}
-
-int defiTrack::firstTrackMask() const {
-    return firstTrackMask_;
-}
-
-int defiTrack::sameMask() const {
-    return samemask_;
-}
-
-void defiTrack::print(FILE* f) const {
-  int i;
-
-  fprintf(f, "Track '%s'\n", macro());
-  fprintf(f, "  DO %g %g STEP %g\n",
-      x(),
-      xNum(),
-      xStep());
-  fprintf(f, "  %d layers ", numLayers());
-  for (i = 0; i < numLayers(); i++) {
-    fprintf(f, " '%s'", layer(i));
-  }
-  fprintf(f, "\n");
-}
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiGcellGrid
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiGcellGrid::defiGcellGrid(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiGcellGrid::Init() {
-  macro_ = 0;
-  macroLength_ = 0;
-  x_ = 0;
-  xNum_ = 0;
-  xStep_ = 0;
-}
-
-
-defiGcellGrid::~defiGcellGrid() {
-  Destroy();
-}
-
-
-void defiGcellGrid::Destroy() {
-  if (macro_) free(macro_);
-}
-
-
-void defiGcellGrid::setup(const char* macro, int x, int xNum, double xStep) {
-  int len = strlen(macro) + 1;
-  if (len > macroLength_) {
-    if (macro_) free(macro_);
-    macroLength_ = len;
-    macro_ = (char*)malloc(len);
-  }
-  strcpy(macro_, defData->DEFCASE(macro));
-
-  x_ = x;
-  xNum_ = xNum;
-  xStep_ = xStep;
-}
-
-
-int defiGcellGrid::x() const {
-  return x_;
-}
-
-
-int defiGcellGrid::xNum() const {
-  return xNum_;
-}
-
-
-double defiGcellGrid::xStep() const {
-  return xStep_;
-}
-
-
-const char* defiGcellGrid::macro() const {
-  return macro_;
-}
-
-
-void defiGcellGrid::print(FILE* f) const {
-  fprintf(f, "GcellGrid '%s'\n", macro());
-  fprintf(f, "  DO %d %d STEP %5.1f\n",
-      x(),
-      xNum(),
-      xStep());
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.hpp
deleted file mode 100644
index e05ebb0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiRowTrack.hpp
+++ /dev/null
@@ -1,184 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiRowTrack_h
-#define defiRowTrack_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiRow{
-public:
-
-  defiRow(defrData *data);
-  void Init();
-
-  ~defiRow();
-  void Destroy();
-  void clear();
-
-  void setup(const char* name, const char* macro,
-	     double x, double y, int orient);
-  void setDo(double x_num, double y_num,
-	     double x_step, double y_step);
-  void setHasDoStep();
-  void addProperty(const char* name, const char* value, const char type);
-  void addNumProperty(const char* name, const double d, 
-                      const char* value, const char type);
-
-  const char* name() const;
-  const char* macro() const;
-  double x() const;
-  double y() const;
-  int orient() const;
-  const char* orientStr() const;
-  int hasDo() const;               // 5.6, DO is optional
-  double xNum() const;
-  double yNum() const;
-  int hasDoStep() const;           // 5.6, STEP is optional in DO
-  double xStep() const;
-  double yStep() const;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int propIsNumber(int index) const;
-  int propIsString(int index) const;
-
-  void print(FILE* f) const;
-
-protected:
-  int nameLength_;
-  char* name_;
-  int macroLength_;
-  char* macro_;
-  double x_;
-  double y_;
-  double xNum_;
-  double yNum_;
-  int orient_;
-  double xStep_;
-  double yStep_;
-  int    hasDo_;
-  int    hasDoStep_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  propNames_;
-  char**  propValues_;
-  double* propDValues_;
-  char*   propTypes_;
-
-  defrData *defData;
-};
-
-
-
-class defiTrack{
-public:
-
-  defiTrack(defrData *data);
-  void Init();
-
-  ~defiTrack();
-  void Destroy();
-
-  void setup(const char* macro);
-  void setDo(double x, double x_num, double x_step);
-  void addLayer(const char* layer);
-  void addMask(int colorMask, int sameMask);
-
-  const char* macro() const;
-  double x() const;
-  double xNum() const;
-  double xStep() const;
-  int numLayers() const;
-  const char* layer(int index) const;
-  int firstTrackMask() const;
-  int sameMask() const;
-
-  void print(FILE* f) const;
-
-protected:
-  int macroLength_;  // allocated size of macro_;
-  char* macro_;
-  double x_;
-  double xNum_;
-  double xStep_;
-  int layersLength_;  // allocated size of layers_
-  int numLayers_;  // number of places used in layers_
-  char** layers_;
-  int firstTrackMask_;
-  int samemask_;
-
-  defrData *defData;
-};
-
-
-
-class defiGcellGrid {
-public:
-
-  defiGcellGrid(defrData *data);
-  void Init();
-
-  ~defiGcellGrid();
-  void Destroy();
-
-  void setup(const char* macro, int x, int xNum, double xStep);
-
-  const char* macro() const;
-  int x() const;
-  int xNum() const;
-  double xStep() const;
-
-  void print(FILE* f) const;
-
-protected:
-  int macroLength_;
-  char* macro_;
-  int x_;
-  int xNum_;
-  double xStep_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.cpp
deleted file mode 100644
index 2f089e7..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.cpp
+++ /dev/null
@@ -1,590 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiScanchain.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defiOrdered::defiOrdered(defrData *data)
-: defData(data)
-{}
-
-defiOrdered::~defiOrdered()
-{
-    Destroy();
-}
-
-void defiOrdered::clear() {
-  int i;
-  for (i = 0; i < num_; i++) {
-    free((char*)(inst_[i]));
-    if (in_[i]) free((char*)(in_[i]));
-    if (out_[i]) free((char*)(out_[i]));
-  }
-  num_ = 0;
-}
-
-
-void defiOrdered::Destroy() {
-  int i;
-  for (i = 0; i < num_; i++) {
-     free((char*)(inst_[i]));
-     free((char*)(in_[i]));
-     free((char*)(out_[i]));
-  }
-  free((char*)(inst_));
-  free((char*)(in_));
-  free((char*)(out_));
-  free((char*)(bits_));
-}
-
-
-void defiOrdered::Init() {
-  num_ = 0;
-  allocated_ = 32;
-  inst_ = (char**)malloc(sizeof(char*)*32);
-  in_   = (char**)malloc(sizeof(char*)*32);
-  out_  = (char**)malloc(sizeof(char*)*32);
-  bits_ = (int*)malloc(sizeof(int)*32);
-}
-
-
-void defiOrdered::bump() {
-  int max = allocated_ * 2;
-  int i;
-  char** nin = (char**)malloc(sizeof(char*)*max);
-  char** nout = (char**)malloc(sizeof(char*)*max);
-  char** ninst = (char**)malloc(sizeof(char*)*max);
-  int*   nbits = (int*)malloc(sizeof(int)*max);
-
-  for (i = 0; i < num_; i++) {
-    nin[i]  = in_[i];
-    nout[i]  = out_[i];
-    ninst[i] = inst_[i];
-    nbits[i] = bits_[i];
-  }
-  free((char*)(inst_));
-  free((char*)(in_));
-  free((char*)(out_));
-  free((char*)(bits_));
-  allocated_ = max;
-  inst_ = ninst;
-  in_ = nin;
-  out_ = nout;
-  bits_ = nbits;
-}
-
-
-void defiOrdered::addOrdered(const char* inst) {
-  if (num_ == allocated_) bump();
-  inst_[num_] = (char*)malloc(strlen(inst)+1);
-  strcpy(inst_[num_], defData->DEFCASE(inst));
-  in_[num_]   = 0;
-  out_[num_]  = 0;
-  bits_[num_] = -1;
-  num_ += 1;
-}
-
-
-void defiOrdered::addIn(const char* pin) {
-  in_[num_-1] = (char*)malloc(strlen(pin)+1);
-  strcpy(in_[num_-1], defData->DEFCASE(pin));
-}
-
-
-void defiOrdered::addOut(const char* pin) {
-  out_[num_-1] = (char*)malloc(strlen(pin)+1);
-  strcpy(out_[num_-1], defData->DEFCASE(pin));
-}
-
-
-void defiOrdered::setOrderedBits(int bits) {
-  bits_[num_-1] = bits;
-}
-
-
-int defiOrdered::num() const {
-  return num_;
-}
-
-
-char** defiOrdered::inst() const {
-  return inst_;
-}
-
-
-char** defiOrdered::in() const {
-  return in_;
-}
-
-
-char** defiOrdered::out() const {
-  return out_;
-}
-
-
-int* defiOrdered::bits() const {
-  return bits_;
-}
-
-
-defiScanchain::defiScanchain(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiScanchain::Init() {
-  name_ = (char*)malloc(32);
-  nameLength_ = 32;
-
-  numOrdered_ = 0;
-  numOrderedAllocated_ = 4;
-  ordered_ = (defiOrdered**)malloc(sizeof(defiOrdered*)*4);
-
-  numFloating_ = 0;
-  numFloatingAllocated_ = 4;
-  floatInst_ = (char**)malloc(sizeof(char*)*4);
-  floatIn_   = (char**)malloc(sizeof(char*)*4);
-  floatOut_  = (char**)malloc(sizeof(char*)*4);
-  floatBits_ = (int*)malloc(sizeof(int)*4);
-
-  stopInst_     = 0;
-  stopPin_      = 0;
-  startInst_    = 0;
-  startPin_     = 0;
-  hasStart_     = 0;
-  hasStop_      = 0;
-  commonInPin_  = 0;
-  commonOutPin_ = 0;
-  hasPartition_ = 0;
-  partName_     = 0;
-  maxBits_      = -1;
-}
-
-
-void defiScanchain::clear() {
-  int i;
-
-  for (i = 0; i < numOrdered_; i++) {
-    delete ordered_[i];
-    ordered_[i] = 0;
-  }
-
-  numOrdered_ = 0;
-
-  for (i = 0; i < numFloating_; i++) {
-    if (floatIn_[i]) free(floatIn_[i]);
-    if (floatOut_[i]) free(floatOut_[i]);
-    free(floatInst_[i]);
-    floatInst_[i] = 0;
-    floatBits_[i] = -1;
-  }
-  numFloating_ = 0;
-
-  if (stopInst_) free(stopInst_);
-  if (stopPin_) free(stopPin_);
-  if (startInst_) free(startInst_);
-  if (startPin_) free(startPin_);
-  if (commonInPin_) free(commonInPin_);
-  if (commonOutPin_) free(commonOutPin_);
-
-  stopInst_ = 0;
-  stopPin_ = 0;
-  startInst_ = 0;
-  startPin_ = 0;
-  hasStart_ = 0;
-  hasStop_ = 0;
-  commonInPin_ = 0;
-  commonOutPin_ = 0;
-  hasPartition_ = 0;
-  if (partName_)
-    free((char*)(partName_));
-  partName_ = 0;
-  maxBits_  = -1; 
-}
-
-
-void defiScanchain::Destroy() {
-  clear();
-  free(name_);
-  free((char*)(ordered_));
-  free((char*)(floatInst_));
-  free((char*)(floatIn_));
-  free((char*)(floatOut_));
-  free((char*)(floatBits_));
-}
-
-
-defiScanchain::~defiScanchain() {
-  Destroy();
-}
-
-
-void defiScanchain::setName(const char* name) {
-  int len = strlen(name) + 1;
-
-  clear();
-
-  if (len > nameLength_) {
-    free(name_);
-    name_ = (char*)malloc(len);
-    nameLength_ = len;
-  }
-  strcpy(name_, defData->DEFCASE(name));
-}
-
-
-const char* defiScanchain::name() const {
-  return name_;
-}
-
-
-void defiScanchain::addFloatingInst(const char* name) {
-
-  if (numFloating_ >= numFloatingAllocated_) {
-    int max = 2 * numFloatingAllocated_;
-    int i;
-    char** ninst = (char**)malloc(sizeof(char*)*max);
-    char** nin = (char**)malloc(sizeof(char*)*max);
-    char** nout = (char**)malloc(sizeof(char*)*max);
-    int*   nbits = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numFloating_; i++) {
-      ninst[i] = floatInst_[i];
-      nin[i] = floatIn_[i];
-      nout[i] = floatOut_[i];
-      nbits[i] = floatBits_[i];
-    }
-    free((char*)(floatInst_));
-    free((char*)(floatIn_));
-    free((char*)(floatOut_));
-    free((char*)(floatBits_));
-    floatInst_ = ninst;
-    floatOut_ = nout;
-    floatIn_ = nin;
-    floatBits_ = nbits;
-    numFloatingAllocated_ = max;
-  }
-
-  floatInst_[numFloating_] =
-     (char*)malloc(strlen(name) + 1);
-  strcpy(floatInst_[numFloating_], defData->DEFCASE(name));
-  floatIn_[numFloating_] = 0;
-  floatOut_[numFloating_] = 0;
-  floatBits_[numFloating_] = -1;
-  numFloating_ += 1;
-}
-
-
-void defiScanchain::addFloatingIn(const char* name) {
-  int len = strlen(name) + 1;
-  floatIn_[numFloating_-1] = (char*)malloc(len);
-  strcpy(floatIn_[numFloating_-1], defData->DEFCASE(name));
-}
-
-
-void defiScanchain::addFloatingOut(const char* name) {
-  int len = strlen(name) + 1;
-  floatOut_[numFloating_-1] = (char*)malloc(len);
-  strcpy(floatOut_[numFloating_-1], defData->DEFCASE(name));
-}
-
-
-void defiScanchain::setFloatingBits(int bits) {
-  floatBits_[numFloating_-1] = bits;
-}
-
-
-void defiScanchain::addOrderedIn(const char* name) {
-  defiOrdered* o = ordered_[numOrdered_-1];
-  o->addIn(name);
-}
-
-
-void defiScanchain::addOrderedOut(const char* name) {
-  defiOrdered* o = ordered_[numOrdered_-1];
-  o->addOut(name);
-}
-
-
-void defiScanchain::addOrderedInst(const char* name) {
-  defiOrdered* o = ordered_[numOrdered_-1];
-  o->addOrdered(name);
-}
-
-
-void defiScanchain::setOrderedBits(int bits) {
-  defiOrdered* o = ordered_[numOrdered_-1];
-  o->setOrderedBits(bits);
-}
-
-
-void defiScanchain::addOrderedList() {
-  defiOrdered* o;
-
-  if (numOrdered_ == numOrderedAllocated_) {
-    int max = 2 * numOrderedAllocated_;
-    int i;
-    defiOrdered** no = (defiOrdered**)malloc(sizeof(defiOrdered*)*max);
-    for (i = 0; i < numOrdered_; i++) {
-      no[i] = ordered_[i];
-    }
-    free((char*)(ordered_));
-    ordered_ = no;
-    numOrderedAllocated_ = max;
-  }
-
-  o = new defiOrdered(defData);
-  ordered_[numOrdered_] = o;
-  o->Init();
-  numOrdered_ += 1;
-}
-
-
-void defiScanchain::setStart(const char* inst, const char* pin) {
-   int len;
-   if (startInst_)
-      defiError(0, 6150, "ERROR (DEFPARS-6150): The START statement in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one START statement and then try again.", defData);
-   len = strlen(inst) + 1;
-   startInst_ = (char*)malloc(len);
-   strcpy(startInst_, defData->DEFCASE(inst));
-   len = strlen(pin) + 1;
-   startPin_ = (char*)malloc(len);
-   strcpy(startPin_, defData->DEFCASE(pin));
-   hasStart_ = 1;
-}
-
-
-void defiScanchain::setStop(const char* inst, const char* pin) {
-   int len;
-   if (stopInst_)
-      defiError(0, 6151, "ERROR (DEFPARS-6151): The STOP statment in the SCANCHAINS has defined more than one time in the SCANCHAINS statement.\nUpdate the DEF file to only one STOP statement and then try again.", defData);
-   len = strlen(inst) + 1;
-   stopInst_ = (char*)malloc(len);
-   strcpy(stopInst_, defData->DEFCASE(inst));
-   len = strlen(pin) + 1;
-   stopPin_ = (char*)malloc(len);
-   strcpy(stopPin_, defData->DEFCASE(pin));
-   hasStop_ = 1;
-}
-
-
-// 5.4.1
-void defiScanchain::setPartition(const char* partName, int maxBits) {
-  if (partName_)
-     free(partName_);
-  partName_ = (char*)malloc(strlen(partName) + 1);
-  strcpy(partName_, defData->DEFCASE(partName));
-  maxBits_ = maxBits;
-  hasPartition_ = 1;
-}
-
-
-int defiScanchain::hasStart() const {
-  return (int)(hasStart_);
-}
-
-
-int defiScanchain::hasStop() const {
-  return (int)(hasStop_);
-}
-
-
-int defiScanchain::hasFloating() const {
-  return numFloating_ ? 1 : 0 ;
-}
-
-
-int defiScanchain::hasOrdered() const {
-  return numOrdered_ ? 1 : 0 ;
-}
-
-
-// 5.4.1
-int defiScanchain::hasPartition() const {
-  return hasPartition_;
-}
-
-
-// 5.4.1
-int defiScanchain::hasPartitionMaxBits() const {
-  return (maxBits_ != -1) ? 1 : 0;
-}
-
-
-// 5.4.1
-const char* defiScanchain::partitionName() const {
-  return partName_;
-}
-
-
-// 5.4.1
-int defiScanchain::partitionMaxBits() const {
-  return maxBits_;
-}
-
-
-void defiScanchain::start(char** inst, char** pin) const {
-  if (inst) *inst = startInst_;
-  if (pin) *pin = startPin_;
-}
-
-
-void defiScanchain::stop(char** inst, char** pin) const {
-  if (inst) *inst = stopInst_;
-  if (pin) *pin = stopPin_;
-}
-
-
-int defiScanchain::numOrderedLists() const {
-  return numOrdered_;
-}
-
-
-void defiScanchain::ordered(int index, int* size, char*** inst,
-                        char*** inPin, char*** outPin, int** bits) const {
-  defiOrdered* o;
-  if (index >= 0 && index <= numOrdered_) {
-    o = ordered_[index];
-    *size   = o->num();
-    *inst   = o->inst();
-    *inPin  = o->in();
-    *outPin = o->out();
-    *bits   = o->bits();
-  } else {
-    *size = 10;
-    *inst = 0;
-  }
-}
-
-
-void defiScanchain::floating(int* size, char*** inst,
-                 char*** inPin, char*** outPin, int** bits) const {
-  *size   = numFloating_;
-  *inst   = floatInst_;
-  *inPin  = floatIn_;
-  *outPin = floatOut_;
-  *bits   = floatBits_;
-}
-
-
-void defiScanchain::setCommonOut(const char* pin) {
-  int len = strlen(pin) + 1;
-  commonOutPin_ = (char*)malloc(len);
-  strcpy(commonOutPin_, defData->DEFCASE(pin));
-}
-
-
-void defiScanchain::setCommonIn(const char* pin) {
-  int len = strlen(pin) + 1;
-  commonInPin_ = (char*)malloc(len);
-  strcpy(commonInPin_, defData->DEFCASE(pin));
-}
-
-
-int defiScanchain::hasCommonInPin() const {
-  return commonInPin_ ? 1 : 0;
-}
-
-
-int defiScanchain::hasCommonOutPin() const {
-  return commonOutPin_ ? 1 : 0;
-}
-
-
-const char* defiScanchain::commonInPin() const {
-  return commonInPin_;
-}
-
-
-const char* defiScanchain::commonOutPin() const {
-  return commonOutPin_;
-}
-
-
-void defiScanchain::print(FILE* f) const {
-  char* a;
-  char* b;
-
-  char** inst;
-  char** in;
-  char** out;
-  int*   bits;
-  int num;
-  int i;
-  int h;
-
-  fprintf(f, "Scan chain '%s'  %d things\n",
-      name(),
-      hasStart() +
-      hasStop() +
-      numFloating_ +
-      numOrderedLists());
-
-  if (hasStart()) {
-    start(&a, &b);
-    fprintf(f, "  start inst '%s' pin '%s'\n", a, b);
-  }
-
-  if (hasStop()) {
-    stop(&a, &b);
-    fprintf(f, "  stop inst '%s' pin '%s'\n", a, b);
-  }
-
-  floating(&num, &inst, &in, &out, &bits);
-  for (i = 0; i < num; i++) {
-    fprintf(f, "  floating '%s' IN=%s  OUT=%s BITS=%d\n", inst[i],
-       in[i]?in[i]:"NIL", out[i]?out[i]:"NIL", bits[i]?bits[i]:0);
-  }
-
-  for (i = 0; i < numOrderedLists(); i++) {
-    ordered(i, &num, &inst, &in, &out, &bits);
-    fprintf(f, "  %d ordered\n", i);
-    for (h = 0; h < num; h++) {
-      fprintf(f, "        '%s' IN=%s OUT=%s BITS=%d\n", inst[h],
-       in[h]?in[h]:"NIL", out[h]?out[h]:"NIL", bits[h]?bits[h]:0);
-    }
-  }
-
-  if (hasCommonInPin())
-    fprintf(f, "  common in pin %s\n", commonInPin());
-
-  if (hasCommonOutPin())
-    fprintf(f, "  common out pin %s\n", commonOutPin());
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.hpp
deleted file mode 100644
index e46e476..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiScanchain.hpp
+++ /dev/null
@@ -1,186 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiScanchain_h
-#define defiScanchain_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiOrdered {
-public:
-  defiOrdered(defrData *data);
-  ~defiOrdered();
-
-  void addOrdered(const char* inst);
-  void addIn(const char* pin);
-  void addOut(const char* pin);
-  void setOrderedBits(int bits);        // 5.4.1
-  void bump();
-  void Init();
-  void Destroy();
-  void clear();
-
-  int num() const;
-  char** inst() const;
-  char** in() const;
-  char** out() const;
-  int*   bits() const;                  // 5.4.1
-
-protected:
-  int num_;
-  int allocated_;
-  char** inst_;
-  char** in_;
-  char** out_;
-  int*   bits_;                       // 5.4.1
-    
-  defrData *defData;
-};
-
-
-// Struct holds the data for one Scan chain.
-//
-class defiScanchain {
-public:
-  defiScanchain(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiScanchain();
-
-  void setName(const char* name);
-  void clear();
-
-  void addOrderedList();
-  void addOrderedInst(const char* inst);
-  void addOrderedIn(const char* inPin);
-  void addOrderedOut(const char* outPin);
-  void setOrderedBits(int bits);      // 5.4.1
-
-  void addFloatingInst(const char* inst);
-  void addFloatingIn(const char* inPin);
-  void addFloatingOut(const char* outPin);
-  void setFloatingBits(int bits);     // 5.4.1
-
-  void setStart(const char* inst, const char* pin);
-  void setStop(const char* inst, const char* pin);
-  void setCommonIn(const char* pin);
-  void setCommonOut(const char* pin);
-  void setPartition(const char* partName, int maxBits);    // 5.4.1
-
-  const char* name() const;
-  int hasStart() const;
-  int hasStop() const;
-  int hasFloating() const;
-  int hasOrdered() const;
-  int hasCommonInPin() const;
-  int hasCommonOutPin() const;
-  int hasPartition() const;           // 5.4.1
-  int hasPartitionMaxBits() const;    // 5.4.1
-
-  // If the pin part of these routines were not supplied in the DEF
-  // then a NULL pointer will be returned.
-  void start(char** inst, char** pin) const;
-  void stop(char** inst, char** pin) const;
-
-  // There could be many ORDERED constructs in the DEF.  The data in
-  // each ORDERED construct is stored in its own array.  The numOrderedLists()
-  // routine tells how many lists there are.
-  int numOrderedLists() const;
-
-  // This routine will return an array of instances and
-  // an array of in and out pins.
-  // The number if things in the arrays is returned in size.
-  // The inPin and outPin entry is optional for each instance.
-  // If an entry is not given, then that char* is NULL.
-  // For example if the second instance has
-  // instnam= "FOO" and IN="A", but no OUT given, then inst[1] points
-  // to "FOO"  inPin[1] points to "A" and outPin[1] is a NULL pointer.
-  void ordered(int index, int* size, char*** inst, char*** inPin,
-                                      char*** outPin, int** bits) const;
-
-  // All of the floating constructs in the scan chain are
-  // stored in this one array.
-  // If the IN or OUT of an entry is not supplied then the array will have
-  // a NULL pointer in that place.
-  void floating(int* size, char*** inst, char*** inPin, char*** outPin,
-                                      int** bits) const;
-
-  const char* commonInPin() const;
-  const char* commonOutPin() const;
-
-  const char* partitionName() const;        // 5.4.1
-  int partitionMaxBits() const;             // 5.4.1
-
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  char hasStart_;
-  char hasStop_;
-  int nameLength_;
-
-  int numOrderedAllocated_;
-  int numOrdered_;
-  defiOrdered** ordered_; 
-
-  int numFloatingAllocated_;
-  int numFloating_;
-  char** floatInst_;    // Array of floating names
-  char** floatIn_;
-  char** floatOut_;
-  int*   floatBits_;    // 5.4.1
-
-  char* stopInst_;
-  char* stopPin_;
-
-  char* startInst_;
-  char* startPin_;
-
-  char* commonInPin_;
-  char* commonOutPin_;
-
-  char  hasPartition_;  // 5.4.1
-  char* partName_;      // 5.4.1
-  int   maxBits_;       // 5.4.1
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.cpp
deleted file mode 100644
index cdb4cd9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "defiSite.hpp"
-#include "defiDebug.hpp"
-#include "lex.h"
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//     defiSite
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiSite::defiSite(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-defiSite::~defiSite() {
-  Destroy();
-}
-
-
-void defiSite::Init() {
-  siteName_ = (char*)malloc(32);
-  nameSize_ = 32;
-  clear();
-}
-
-
-void defiSite::Destroy() {
-  free(siteName_);
-}
-
-
-void defiSite::clear() {
-  if (siteName_)
-     *siteName_ = '\0';
-  x_num_ = 0.0;
-  y_num_ = 0.0;
-  x_step_ = 0.0;
-  y_step_ = 0.0;
-  orient_ = 0;
-}
-
-
-void defiSite::setName(const char* name) {
-  int len = 1;
-  char* from = (char*)name;
-  clear();
-  while (*from++) len++;
-  if (nameSize_ < len) bumpName(len);
-  strcpy(siteName_, defData->DEFCASE(name));
-}
-
-
-void defiSite::setLocation(double xorg, double yorg) {
-  x_orig_ = xorg;
-  y_orig_ = yorg;
-}
-
-
-void defiSite::setOrient(int orient) {
-  orient_ = orient;
-}
-
-
-void defiSite::setDo(double x_num, double y_num, double x_step, double y_step) {
-  x_num_ = x_num;
-  y_num_ = y_num;
-  x_step_ = x_step;
-  y_step_ = y_step;
-}
-
-
-double defiSite::x_num() const {
-  return x_num_;
-}
-
-
-double defiSite::y_num() const {
-  return y_num_;
-}
-
-
-double defiSite::x_step() const {
-  return x_step_;
-}
-
-
-double defiSite::y_step() const {
-  return y_step_;
-}
-
-
-double defiSite::x_orig() const {
-  return x_orig_;
-}
-
-
-double defiSite::y_orig() const {
-  return y_orig_;
-}
-
-
-int defiSite::orient() const {
-  return orient_;
-}
-
-
-const char* defiSite::orientStr() const {
-  return (defiOrientStr(orient_));
-}
-
-
-const char* defiSite::name() const {
-  return siteName_;
-}
-
-
-void defiSite::bumpName(int size) {
-  free(siteName_);
-  siteName_ = (char*)malloc(size);
-  nameSize_ = size;
-  *siteName_ = '\0';
-}
-
-
-void defiSite::print(FILE* f) const {
-  fprintf(f, "Site '%p' %s\n", name(),
-     orientStr());
-  fprintf(f, "  DO X %g %g BY %g\n",
-     x_orig(),
-     x_num(),
-     x_step());
-  fprintf(f, "  DO Y %g %g BY %g\n",
-     y_orig(),
-     y_num(),
-     y_step());
-
-}
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//     defiBox
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-defiBox::defiBox() {
-  Init();
-}
-
-void defiBox::Init() {
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  points_ = 0;
-}
-
-defiBox::~defiBox() {
-  Destroy();
-}
-
-void defiBox::Destroy() {
-  struct defiPoints* p;
-
-  p = points_;
-  if (p) {
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(points_));
-  }
-}
-
-void defiBox::addPoint(defiGeometries* geom) {
-  struct defiPoints* p;
-  struct defiPoints* tp;
-  int x, y;
-  int i;
-
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-    // for backward compatibility assign the first 2 points to xl, yl, xh & yh
-    if (i == 0) {
-      xl_ = x;
-      yl_ = y;
-    } else if (i == 1) {
-      xh_ = x;
-      yh_ = y;
-    }
-  }
-  if (points_) {
-     tp = points_;
-     free((char*)(tp->x));
-     free((char*)(tp->y));
-     free((char*)(tp));
-  }
-  points_ = p;
-}
-
-int defiBox::xl() const {
-  return xl_;
-}
-
-
-int defiBox::yl() const {
-  return yl_;
-}
-
-
-int defiBox::xh() const {
-  return xh_;
-}
-
-
-int defiBox::yh() const {
-  return yh_;
-}
-
-
-struct defiPoints defiBox::getPoint() const {
-  return *(points_);
-}
-
-void defiBox::print(FILE* f) const {
-  fprintf(f, "Box %d,%d %d %d\n",
-    xl(),
-    yl(),
-    xh(),
-    yh());
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.hpp
deleted file mode 100644
index c31b15f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSite.hpp
+++ /dev/null
@@ -1,123 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiSite_h
-#define defiSite_h
-
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-/*
- * Struct holds the data for one site.
- * It is also used for a canplace and cannotoccupy.
- */
-class defiSite {
-public:
-  defiSite(defrData *data);
-  void Init();
-
-  ~defiSite();
-  void Destroy();
-
-  void clear();
-
-  void setName(const char* name);
-  void setLocation(double xorg, double yorg);
-  void setOrient(int orient);
-  void setDo(double x_num, double y_num, double x_step, double y_step);
-
-  double x_num() const;
-  double y_num() const;
-  double x_step() const;
-  double y_step() const;
-  double x_orig() const;
-  double y_orig() const;
-  int orient() const;
-  const char* orientStr() const;
-  const char* name() const;
-
-  void print(FILE* f) const;
-
-  void bumpName(int size);
-
-protected:
-  char* siteName_;     // Name of this.
-  int nameSize_;       // allocated size of siteName_
-  double x_orig_, y_orig_;  // Origin
-  double x_step_, y_step_;  // Array step size.
-  double x_num_, y_num_; 
-  int orient_;         // orientation
-
-  defrData *defData;
-};
-
-
-
-/* Struct holds the data for a Box */
-class defiBox {
-public:
-  // Use the default destructor and constructor.
-  // 5.6 changed to use it own constructor & destructor
-
-  defiBox();
-  void Init();
-  void Destroy();
-  ~defiBox();
-
-  // NOTE: 5.6
-  // The following methods are still here for backward compatibility
-  // For new reader they should use numPoints & getPoint to get the
-  // data.
-  int xl() const;
-  int yl() const;
-  int xh() const;
-  int yh() const;
-
-  void addPoint(defiGeometries* geom);
-  defiPoints getPoint() const;
-
-  void print(FILE* f) const;
-
-protected:
-  int xl_, yl_;
-  int xh_, yh_;
-  defiPoints* points_;    // 5.6
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.cpp
deleted file mode 100644
index c9ec635..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiSlot.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-//
-//    defiSlot
-//
-////////////////////////////////////////////////////
-////////////////////////////////////////////////////
-
-defiSlot::defiSlot(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiSlot::Init() {
-  numPolys_ = 0;
-  clear();
-  layerNameLength_ = 0;
-  xl_ = (int*)malloc(sizeof(int)*1);
-  yl_ = (int*)malloc(sizeof(int)*1);
-  xh_ = (int*)malloc(sizeof(int)*1);
-  yh_ = (int*)malloc(sizeof(int)*1);
-  rectsAllocated_ = 1;      // At least 1 rectangle will define
-  polysAllocated_ = 0;
-  polygons_ = 0;
-  layerName_ = 0;
-}
-
-defiSlot::~defiSlot() {
-  Destroy();
-}
-
-void defiSlot::clear() {
-  hasLayer_ = 0;
-  numRectangles_ = 0;
-}
-
-void defiSlot::clearPoly() {
-  struct defiPoints* p;
-  int i;
-
-  for (i = 0; i < numPolys_; i++) {
-    p = polygons_[i];
-    free((char*)(p->x));
-    free((char*)(p->y));
-    free((char*)(polygons_[i]));
-  }
-  numPolys_ = 0;
-}
-
-void defiSlot::Destroy() {
-  if (layerName_) free(layerName_);
-  free((char*)(xl_));
-  free((char*)(yl_));
-  free((char*)(xh_));
-  free((char*)(yh_));
-  rectsAllocated_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  clearPoly();
-  if (polygons_) free((char*)(polygons_));
-  polygons_ = 0;
-  clear();
-}
-
-
-void defiSlot::setLayer(const char* name) {
-  int len = strlen(name) + 1;
-  if (layerNameLength_ < len) {
-    if (layerName_) free(layerName_);
-    layerName_ = (char*)malloc(len);
-    layerNameLength_ = len;
-  }
-  strcpy(layerName_, defData->DEFCASE(name));
-  hasLayer_ = 1;
-}
-
-
-void defiSlot::addRect(int xl, int yl, int xh, int yh) {
-  if (numRectangles_ == rectsAllocated_) {
-    int i;
-    int max = rectsAllocated_ = rectsAllocated_ * 2;
-    int* newxl = (int*)malloc(sizeof(int)*max);
-    int* newyl = (int*)malloc(sizeof(int)*max);
-    int* newxh = (int*)malloc(sizeof(int)*max);
-    int* newyh = (int*)malloc(sizeof(int)*max);
-    for (i = 0; i < numRectangles_; i++) {
-      newxl[i] = xl_[i];
-      newyl[i] = yl_[i];
-      newxh[i] = xh_[i];
-      newyh[i] = yh_[i];
-    }
-    free((char*)(xl_));
-    free((char*)(yl_));
-    free((char*)(xh_));
-    free((char*)(yh_));
-    xl_ = newxl;
-    yl_ = newyl;
-    xh_ = newxh;
-    yh_ = newyh;
-  }
-  xl_[numRectangles_] = xl;
-  yl_[numRectangles_] = yl;
-  xh_[numRectangles_] = xh;
-  yh_[numRectangles_] = yh;
-  numRectangles_ += 1;
-}
-
-// 5.6
-void defiSlot::addPolygon(defiGeometries* geom) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    for (i = 0; i < numPolys_; i++)
-      poly[i] = polygons_[i];
-    if (polygons_)
-      free((char*)(polygons_));
-    polygons_ = poly;
-  }
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_] = p;
-  numPolys_ += 1;
-}
-
-int defiSlot::hasLayer() const {
-  return hasLayer_;
-}
-
-
-const char* defiSlot::layerName() const {
-  return layerName_;
-}
-
-
-int defiSlot::numRectangles() const {
-  return numRectangles_;
-}
-
-
-int defiSlot::xl(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6160): The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6160, msg, defData);
-     return 0;
-  }
-  return xl_[index];
-}
-
-
-int defiSlot::yl(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6160): The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6160, msg, defData);
-     return 0;
-  }
-  return yl_[index];
-}
-
-
-int defiSlot::xh(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6160): The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6160, msg, defData);
-     return 0;
-  }
-  return xh_[index];
-}
-
-
-int defiSlot::yh(int index) const {
-  char msg[160];
-  if (index < 0 || index >= numRectangles_) {
-     sprintf (msg, "ERROR (DEFPARS-6160): The index number %d specified for the SLOT RECTANGLE is invalid.\nValid index number is from 0 to %d. Specify a valid index number and then try again.",
-              index, numRectangles_);
-     defiError(0, 6160, msg, defData);
-     return 0;
-  }
-  return yh_[index];
-}
-
-// 5.6
-int defiSlot::numPolygons() const {
-  return numPolys_;
-}
-
-// 5.6
-struct defiPoints defiSlot::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-void defiSlot::print(FILE* f) const {
-  int i, j;
-  struct defiPoints points;
-
-  if (hasLayer())
-    fprintf(f, "- LAYER %s\n", layerName());
-
-  for (i = 0; i < numRectangles(); i++) {
-    fprintf(f, "   RECT %d %d %d %d\n", xl(i),
-            yl(i), xh(i),
-            yh(i));
-  }
-
-  for (i = 0; i < numPolygons(); i++) {
-    fprintf(f, "   POLYGON ");
-    points = getPolygon(i);
-    for (j = 0; j < points.numPoints; j++)
-      fprintf(f, "%d %d ", points.x[j], points.y[j]);
-    fprintf(f, "\n");
-  }
-  fprintf(f,"\n");
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.hpp
deleted file mode 100644
index 783ab0f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiSlot.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiSLOT_h
-#define defiSLOT_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-class defiSlot {
-public:
-  defiSlot(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiSlot();
-
-  void clear();
-  void clearPoly();
-
-  void setLayer(const char* name);
-  void addRect(int xl, int yl, int xh, int yh);
-  void addPolygon(defiGeometries* geom);
-
-  int hasLayer() const;
-  const char* layerName() const;
-
-  int numRectangles() const;
-  int xl(int index) const;
-  int yl(int index) const;
-  int xh(int index) const;
-  int yh(int index) const;
-
-  int numPolygons() const;                        // 5.6
-  defiPoints getPolygon(int index) const;  // 5.6
-
-  void print(FILE* f) const;
-
-protected:
-  int   hasLayer_;
-  char* layerName_;
-  int   layerNameLength_;
-  int   numRectangles_;
-  int   rectsAllocated_;
-  int*  xl_;
-  int*  yl_;
-  int*  xh_;
-  int*  yh_;
-  int   numPolys_;                  // 5.6
-  int   polysAllocated_;            // 5.6
-  defiPoints** polygons_;    // 5.6
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.cpp
deleted file mode 100644
index cc3ee82..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiTimingDisable.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiTimingDisable
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiTimingDisable::defiTimingDisable(defrData *data)
- : defData(data)
-{
-  Init();
-}
-
-
-void defiTimingDisable::Init() {
-  fromInst_ = 0;
-  fromInstLength_ = 0;
-  toInst_ = 0;
-  toInstLength_ = 0;
-  toPin_ = 0;
-  toPinLength_ = 0;
-  fromPin_ = 0;
-  fromPinLength_ = 0;
-}
-
-
-defiTimingDisable::~defiTimingDisable() {
-  Destroy();
-}
-
-
-void defiTimingDisable::Destroy() {
-
-  clear();
-
-  if (fromInst_) free(fromInst_);
-  fromInst_ = 0;
-  fromInstLength_ = 0;
-
-  if (toInst_) free(toInst_);
-  toInst_ = 0;
-  toInstLength_ = 0;
-
-  if (toPin_) free(toPin_);
-  toPin_ = 0;
-  toPinLength_ = 0;
-
-  if (fromPin_) free(fromPin_);
-  fromPin_ = 0;
-  fromPinLength_ = 0;
-
-}
-
-
-void defiTimingDisable::clear() {
-  hasFromTo_ = 0;
-  hasThru_ = 0;
-  hasMacro_ = 0;
-  hasReentrantPathsFlag_ = 0;
-}
-
-
-void defiTimingDisable::setReentrantPathsFlag() {
-  hasReentrantPathsFlag_ = 1;
-}
-
-
-void defiTimingDisable::setFromTo(const char* fromInst, const char* fromPin,
-	 const char* toInst, const char* toPin) {
-  int len;
-
-  clear();
-  hasFromTo_ = 1;
-
-  len = strlen(fromInst) + 1;
-  if (len > fromInstLength_) {
-    if (fromInst_) free(fromInst_);
-    fromInstLength_ = len;
-    fromInst_ = (char*)malloc(len);
-  }
-  strcpy(fromInst_,defData->DEFCASE(fromInst));
-
-  len = strlen(fromPin) + 1;
-  if (len > fromPinLength_) {
-    if (fromPin_) free(fromPin_);
-    fromPinLength_ = len;
-    fromPin_ = (char*)malloc(len);
-  }
-  strcpy(fromPin_,defData->DEFCASE(fromPin));
-
-  len = strlen(toInst) + 1;
-  if (len > toInstLength_) {
-    if (toInst_) free(toInst_);
-    toInstLength_ = len;
-    toInst_ = (char*)malloc(len);
-  }
-  strcpy(toInst_, toInst);
-
-  len = strlen(toPin) + 1;
-  if (len > toPinLength_) {
-    if (toPin_) free(toPin_);
-    toPinLength_ = len;
-    toPin_ = (char*)malloc(len);
-  }
-  strcpy(toPin_, toPin);
-
-}
-
-
-void defiTimingDisable::setThru(const char* fromInst, const char* fromPin) {
-  int len;
-
-  clear();
-  hasThru_ = 1;
-
-  len = strlen(fromInst) + 1;
-  if (len > fromInstLength_) {
-    if (fromInst_) free(fromInst_);
-    fromInstLength_ = len;
-    fromInst_ = (char*)malloc(len);
-  }
-  strcpy(fromInst_,defData->DEFCASE(fromInst));
-
-  len = strlen(fromPin) + 1;
-  if (len > fromPinLength_) {
-    if (fromPin_) free(fromPin_);
-    fromPinLength_ = len;
-    fromPin_ = (char*)malloc(len);
-  }
-  strcpy(fromPin_,defData->DEFCASE(fromPin));
-
-}
-
-
-void defiTimingDisable::setMacroFromTo(const char* fromPin, const char* toPin) {
-  int len;
-
-  clear();
-  hasFromTo_ = 1;
-
-  len = strlen(fromPin) + 1;
-  if (len > fromPinLength_) {
-    if (fromPin_) free(fromPin_);
-    fromPinLength_ = len;
-    fromPin_ = (char*)malloc(len);
-  }
-  strcpy(fromPin_,defData->DEFCASE(fromPin));
-
-  len = strlen(toPin) + 1;
-  if (len > toPinLength_) {
-    if (toPin_) free(toPin_);
-    toPinLength_ = len;
-    toPin_ = (char*)malloc(len);
-  }
-  strcpy(toPin_,defData->DEFCASE(toPin));
-
-}
-
-
-void defiTimingDisable::setMacroThru(const char* thru) {
-  int len;
-
-  clear();
-
-  hasThru_ = 1;
-
-  len = strlen(thru) + 1;
-  if (len > fromPinLength_) {
-    if (fromPin_) free(fromPin_);
-    fromPinLength_ = len;
-    fromPin_ = (char*)malloc(len);
-  }
-  strcpy(fromPin_,defData->DEFCASE(thru));
-
-}
-
-
-void defiTimingDisable::setMacro(const char* name) {
-  int len;
-
-  // hasThru_ or hasFromTo_ was already set.
-  // clear() was already called.
-  hasMacro_ = 1;
-
-  len = strlen(name) + 1;
-  if (len > fromInstLength_) {
-    if (fromInst_) free(fromInst_);
-    fromInstLength_ = len;
-    fromInst_ = (char*)malloc(len);
-  }
-  strcpy(fromInst_,defData->DEFCASE(name));
-}
-
-
-void defiTimingDisable::print(FILE* f) const {
-
-  if (hasMacroFromTo()) {
-    fprintf(f, "TimingDisable macro '%s' thru '%s'\n",
-	fromInst_, fromPin_);
-
-  } else if (hasMacroThru()) {
-    fprintf(f, "TimingDisable macro '%s' from '%s' to '%s'\n",
-	fromInst_, fromPin_, toPin_);
-
-  } else if (hasFromTo()) {
-    fprintf(f, "TimingDisable from '%s' '%s'  to '%s' '%s'\n",
-      fromInst_, fromPin_, toInst_, toPin_);
-
-  } else if (hasThru()) {
-    fprintf(f, "TimingDisable thru '%s' '%s'\n",
-      fromInst_, fromPin_);
-
-  } else {
-    defiError(0, 6170, "ERROR (DEFPARS-6170): The TimingDisable type is invalid. The valid types are FROMPIN, & THRUPIN. Specify the valid type and then try again.", defData);
-  }
-}
-
-
-int defiTimingDisable::hasReentrantPathsFlag() const {
-  return hasReentrantPathsFlag_;
-}
-
-
-int defiTimingDisable::hasMacroFromTo() const {
-  return (hasMacro_ && hasFromTo_) ? 1 : 0;
-}
-
-
-int defiTimingDisable::hasMacroThru() const {
-  return (hasMacro_ && hasThru_) ? 1 : 0;
-}
-
-
-int defiTimingDisable::hasThru() const {
-  return (hasMacro_ == 0 && hasThru_) ? 1 : 0;
-}
-
-
-int defiTimingDisable::hasFromTo() const {
-  return (hasMacro_ == 0 && hasFromTo_) ? 1 : 0;
-}
-
-
-const char* defiTimingDisable::toPin() const {
-  return toPin_;
-}
-
-
-const char* defiTimingDisable::fromPin() const {
-  return fromPin_;
-}
-
-
-const char* defiTimingDisable::toInst() const {
-  return toInst_;
-}
-
-
-const char* defiTimingDisable::fromInst() const {
-  return fromInst_;
-}
-
-
-const char* defiTimingDisable::macroName() const {
-  return fromInst_;
-}
-
-
-const char* defiTimingDisable::thruPin() const {
-  return fromPin_;
-}
-
-
-const char* defiTimingDisable::thruInst() const {
-  return fromInst_;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.hpp
deleted file mode 100644
index c3a1a57..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiTimingDisable.hpp
+++ /dev/null
@@ -1,101 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiTimingDisable_h
-#define defiTimingDisable_h
-
-#include <stdio.h>
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// A Timing disable can be a from-to  or a thru or a macro.
-//   A macro is either a fromto macro or a thru macro.
-class defrData;
-
-
-class defiTimingDisable {
-public:
-  defiTimingDisable(defrData *data);
-  void Init();
-
-  void Destroy();
-  ~defiTimingDisable();
-
-  void clear();
-
-  void setFromTo(const char* fromInst, const char* fromPin,
-		 const char* toInst, const char* toPin);
-  void setThru(const char* fromInst, const char* fromPin);
-  void setMacro(const char* name);
-  void setMacroThru(const char* thru);
-  void setMacroFromTo(const char* fromPin, const char* toPin);
-  void setReentrantPathsFlag();
-
-  int hasMacroThru() const;
-  int hasMacroFromTo() const;
-  int hasThru() const;
-  int hasFromTo() const;
-  int hasReentrantPathsFlag() const;
-
-  const char* fromPin() const;
-  const char* toPin() const;
-  const char* fromInst() const;
-  const char* toInst() const;
-  const char* macroName() const;
-  const char* thruPin() const;    // Also macro thru
-  const char* thruInst() const;
-
-  // debug print
-  void print(FILE* f) const;
-
-protected:
-  char* fromInst_;  // also macro name and thru inst
-  int fromInstLength_;
-  char* toInst_;
-  int toInstLength_;
-  char* fromPin_;  // also macro thru and thru pin
-  int fromPinLength_;
-  char* toPin_;
-  int toPinLength_;
-
-  int hasFromTo_;
-  int hasThru_;
-  int hasMacro_;
-  int hasReentrantPathsFlag_;
-
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUser.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUser.hpp
deleted file mode 100644
index 218635e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUser.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-/*
- * User header file for the DEF Interface.  This includes
- * all of the header files which are relevant to both the
- * reader and the writer.
- *
- * defrReader.h and defwWriter.h include this file, so that
- * an application only needs to include either defwReader.h
- * or defwWriter.h.
- */
-
-#ifndef DEFI_USER_H
-#define DEFI_USER_H
-
-/* General utilities. */
-/* #include "defiMalloc.hpp" */
-/* #include "defiUtils.hpp" */
-
-/*
- * API objects
- */
-#include "defiDebug.hpp"
-#include "defiProp.hpp"
-#include "defiSite.hpp"
-#include "defiComponent.hpp"
-#include "defiNet.hpp"
-#include "defiPath.hpp"
-#include "defiPinCap.hpp"
-#include "defiRowTrack.hpp"
-#include "defiVia.hpp"
-#include "defiRegion.hpp"
-#include "defiGroup.hpp"
-#include "defiAssertion.hpp"
-#include "defiScanchain.hpp"
-#include "defiIOTiming.hpp"
-#include "defiFPC.hpp"
-#include "defiTimingDisable.hpp"
-#include "defiPartition.hpp"
-#include "defiPinProp.hpp"
-#include "defiBlockage.hpp"
-#include "defiSlot.hpp"
-#include "defiFill.hpp"
-#include "defiNonDefault.hpp"
-#include "defiPropType.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/* NEW CALLBACK - If you are creating a new .cpp and .hpp file to
- * describe a new class of object in the parser, then add a reference
- * to the .hpp here.
- *
- *  You must also add an entry for the .h and the .hpp in the package_list
- * file of the ../../../release directory. */
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.cpp
deleted file mode 100644
index 1d5ef64..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#ifdef WIN32
-#   include <time.h>
-#else /* not WIN32 */
-#   include <sys/time.h>
-#endif
-#if ibmrs
-#include <time.h>
-#endif
-
-
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/* Not needed
-time_t defiCalcTime() {
-    * Calculate the number for the given date
-    * The date is 5/1/99
-
-    * Used to calculate the UTC for a time bomb date in libcai.a
-    * see caiInitWork() function
-    *
-    struct tm	ts;
-
-    ts.tm_sec = 0;
-    ts.tm_min = 0;
-    ts.tm_hour = 0;
-    ts.tm_mday = 1;
-    ts.tm_mon = 5;
-    ts.tm_year = 1999 - 1900;
-    ts.tm_wday = 0;
-    ts.tm_yday = 0;
-    ts.tm_isdst = 0;
-
-*
-    printf("May 1, 1999 in UTC is %d\n", mktime(&ts));
-    ts.tm_mday = 2;
-    printf("May 2, 1999 in UTC is %d\n", mktime(&ts));
-
-    printf("Right now is %d\n", time(0));
-*
-    return(mktime(&ts));
-}
-*/
-
-////////////////////////////////////////////////////
-//
-//    defiTimeBomb
-//
-////////////////////////////////////////////////////
-
-// Check the current date against the date given
-/*
-int defiValidTime() {
-    time_t	bombTime = defiCalcTime();
-    time_t	curTime;
-
-    curTime = time((time_t *)NULL);
-    if (curTime == -1 || curTime > bombTime)
-    {
-	(void)printf("The demonstration version of this code is no longer\n"
-		     "available.  Please contact your Lef/Def Parser\n"
-		     "software provider for up to date code.\n");
-	return(0);
-    }
-    return (1);
-}
-*/
-
-////////////////////////////////////////////////////
-//
-//    Convert the orient from integer to string
-//
-////////////////////////////////////////////////////
-const char* defiOrientStr(int orient) {
-  switch (orient) {
-      case 0: return ((char*)"N");
-      case 1: return ((char*)"W");
-      case 2: return ((char*)"S");
-      case 3: return ((char*)"E");
-      case 4: return ((char*)"FN");
-      case 5: return ((char*)"FW");
-      case 6: return ((char*)"FS");
-      case 7: return ((char*)"FE");
-  };
-  return ((char*)"");
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.hpp
deleted file mode 100644
index b99b858..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiUtil.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiUtil_h
-#define defiUtil_h
-
-#include "defiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/* Return codes Orient and Rotation */
-#define DEF_ORIENT_N  0
-#define DEF_ORIENT_W  1
-#define DEF_ORIENT_S  2
-#define DEF_ORIENT_E  3
-#define DEF_ORIENT_FN 4
-#define DEF_ORIENT_FW 5
-#define DEF_ORIENT_FS 6
-#define DEF_ORIENT_FE 7
-
-const char* defiOrientStr(int orient);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.cpp
deleted file mode 100644
index 06ecc16..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "defiVia.hpp"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-//
-//   defiVia
-//
-//////////////////////////////////////////////
-//////////////////////////////////////////////
-
-
-defiVia::defiVia(defrData *data) 
- : defData(data)
-{
-  Init();
-}
-
-
-void defiVia::Init() {
-  name_ = 0;
-  nameLength_ = 0;
-  pattern_ = 0;
-  patternLength_ = 0;
-  xl_ = 0;
-  yl_ = 0;
-  xh_ = 0;
-  yh_ = 0;
-  layersLength_ = 0;
-  layers_ = 0;
-  viaRule_ = 0;
-  viaRuleLength_ = 0;
-  xSize_ = 0;
-  ySize_ = 0;
-  botLayer_ = 0;
-  cutLayer_ = 0;
-  topLayer_ = 0;
-  botLayerLength_ = 0;
-  cutLayerLength_ = 0;
-  topLayerLength_ = 0;
-  xCutSpacing_ = 0;
-  yCutSpacing_ = 0;
-  xBotEnc_ = 0;
-  yBotEnc_ = 0;
-  xTopEnc_ = 0;
-  yTopEnc_ = 0;
-  cutPattern_ = 0;
-  cutPatternLength_ = 0;
-  numLayers_ = 0;
-  numPolys_ = 0;
-  polygons_ = 0;
-  polysAllocated_ = 0;
-  polygonNames_ = 0;
-  rectMask_ = 0;
-  polyMask_ = 0;
-  clear();
-}
-
-void defiVia::clear() {
-  int i;
-
-  hasPattern_ = 0;
-  hasViaRule_ = 0;
-  rows_ = 0;
-  cols_ = 0;
-  xOffset_ = 0;
-  yOffset_ = 0;
-  xBotOffset_ = 0;
-  yBotOffset_ = 0;
-  xTopOffset_ = 0;
-  yTopOffset_ = 0;
-  hasCutPattern_ = 0;
-  
-  if (polygonNames_) {
-    struct defiPoints* p;
-    for (i = 0; i < numPolys_; i++) {
-        free(polygonNames_[i]);
-
-        p = polygons_[i];
-        free(p->x);
-        free(p->y);
-        free(p);
-    }
-
-    free(polygonNames_);
-    free(polygons_);
-    free(polyMask_);
-
-    polygonNames_ = NULL;
-    polygons_ = NULL;
-    polyMask_ = NULL;
-  }
-
-  numPolys_ = 0;
-  polysAllocated_ = 0;
-}
-
-defiVia::~defiVia() {
-  Destroy();
-}
-
-
-void defiVia::Destroy() {
-  int i;
-
-  free(name_);
-  name_ = NULL;
-
-  free(pattern_);
-  pattern_ = NULL;
-
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++) {
-        free(layers_[i]);
-    }
-
-    free(layers_);
-    layers_ = NULL;
-
-    free(xl_);
-    xl_ = NULL;
-
-    free(yl_);
-    yl_ = NULL;
-
-    free(xh_);
-    xh_ = NULL;
-
-    free(yh_);
-    yh_ = NULL;
-
-    free(rectMask_);
-    rectMask_ = NULL;
-
-    free(polyMask_);
-    polyMask_ = NULL;
-  }
-
-  free(viaRule_);
-  viaRule_ = NULL;
-
-  free(botLayer_);
-  botLayer_ = NULL;
-
-  free(cutLayer_);
-  cutLayer_ = NULL;
-
-  free(topLayer_);
-  topLayer_ = NULL;
-
-  free(cutPattern_);
-  cutPattern_ = NULL;
-
-  clear();
-}
-
-
-void defiVia::setup(const char* name) {
-  int i;
-  int len = strlen(name) + 1;
-  if (len > nameLength_) {
-    nameLength_ = len;
-    name_ = (char*)realloc(name_, len);
-  }
-  strcpy(name_, defData->DEFCASE(name));
-  if (pattern_) *(pattern_) = 0;
-  if (layers_) {
-    for (i = 0; i < numLayers_; i++) {
-        free(layers_[i]);
-        layers_[i] = 0;
-    }
-  }
-
-  numLayers_ = 0;
-}
-
-
-void defiVia::addPattern(const char* pattern) {
-  int len = strlen(pattern) + 1;
-  if (len > patternLength_) {
-    patternLength_ = len;
-    pattern_ = (char*)realloc(pattern_, len);
-  }
-  strcpy(pattern_, defData->DEFCASE(pattern));
-  hasPattern_ = 1;
-}
-
-
-void defiVia::addLayer(const char* layer, int xl, int yl, int xh, int yh, int colorMask) {
-  char* l;
-  int len;
-
-  if (numLayers_ >= layersLength_) {
-    int i;
-    char** newl;
-    int* ints;
-    layersLength_ = layersLength_ ? 2 * layersLength_ : 8;
-
-    newl = (char**)malloc(layersLength_ * sizeof(char*));
-    for (i = 0; i < numLayers_; i++)
-      newl[i] = layers_[i];
-    if (layers_) free((char*)(layers_));
-    layers_ = newl;
-
-    ints = (int*)malloc(layersLength_ * sizeof(int));
-    for (i = 0; i < numLayers_; i++)
-      ints[i] = xl_[i];
-    if (xl_) free((char*)(xl_));
-    xl_ = ints;
-
-    ints = (int*)malloc(layersLength_ * sizeof(int));
-    for (i = 0; i < numLayers_; i++)
-      ints[i] = yl_[i];
-    if (yl_) free((char*)(yl_));
-    yl_ = ints;
-
-    ints = (int*)malloc(layersLength_ * sizeof(int));
-    for (i = 0; i < numLayers_; i++)
-      ints[i] = xh_[i];
-    if (xh_) free((char*)(xh_));
-    xh_ = ints;
-
-    ints = (int*)malloc(layersLength_ * sizeof(int));
-    for (i = 0; i < numLayers_; i++)
-      ints[i] = yh_[i];
-    if (yh_) free((char*)(yh_));
-    yh_ = ints;
-
-    ints = (int*)malloc(layersLength_ * sizeof(int));
-    for (i = 0; i < numLayers_; i++)
-        ints[i] = rectMask_[i];
-    if (rectMask_) free((char*)(rectMask_));
-    rectMask_ = ints;
-  }
-
-  len = strlen(layer) + 1;
-  l = (char*)malloc(len);
-  strcpy(l, defData->DEFCASE(layer));
-  layers_[numLayers_] = l;
-  xl_[numLayers_] = xl;
-  yl_[numLayers_] = yl;
-  xh_[numLayers_] = xh;
-  yh_[numLayers_] = yh;
-  rectMask_[numLayers_] = colorMask;
-  numLayers_++;
-}
-
-// 5.6
-void defiVia::addPolygon(const char* layer, defiGeometries* geom, int colorMask) {
-  struct defiPoints* p;
-  int x, y;
-  int i;
-
-  if (numPolys_ == polysAllocated_) {
-    char** newn;
-    int* masks;
-    struct defiPoints** poly;
-    polysAllocated_ = (polysAllocated_ == 0) ?
-          2 : polysAllocated_ * 2;
-    newn = (char**)malloc(sizeof(char*) * polysAllocated_);
-    poly = (struct defiPoints**)malloc(sizeof(struct defiPoints*) *
-            polysAllocated_);
-    masks = (int*)malloc(polysAllocated_ * sizeof(int));
-    for (i = 0; i < numPolys_; i++) {
-      newn[i] = polygonNames_[i];
-      poly[i] = polygons_[i];
-      masks[i] = polyMask_[i];
-    }
-    if (polygons_)
-      free((char*)(polygons_));
-    if (polygonNames_)
-      free((char*)(polygonNames_));
-    if (polyMask_) 
-      free((char*)(polyMask_));
-    polygonNames_ = newn;
-    polygons_ = poly;
-    polyMask_ = masks;
-  }
-  polygonNames_[numPolys_] = strdup(layer);
-  p = (struct defiPoints*)malloc(sizeof(struct defiPoints));
-  p->numPoints = geom->numPoints();
-  p->x = (int*)malloc(sizeof(int)*p->numPoints);
-  p->y = (int*)malloc(sizeof(int)*p->numPoints);
-  for (i = 0; i < p->numPoints; i++) {
-    geom->points(i, &x, &y);
-    p->x[i] = x;
-    p->y[i] = y;
-  }
-  polygons_[numPolys_] = p;
-  polyMask_[numPolys_] = colorMask;
-  numPolys_ += 1;
-}
-
-void defiVia::addViaRule(char* viaRuleName, int xSize, int ySize,
-                         char* botLayer, char* cutLayer, char* topLayer,
-                         int xSpacing, int ySpacing, int xBotEnc, int yBotEnc,
-                         int xTopEnc, int yTopEnc) {
-  int len;
-
-  len = strlen(viaRuleName) + 1;
-  if (len > viaRuleLength_) {
-    if (viaRule_)
-      free(viaRule_);
-    viaRule_ = (char*)malloc(strlen(viaRuleName)+1);
-  }
-  strcpy(viaRule_, defData->DEFCASE(viaRuleName));
-  xSize_ = xSize;
-  ySize_ = ySize;
-  len = strlen(botLayer) + 1;
-  if (len > botLayerLength_) {
-    if (botLayer_)
-      free(botLayer_);
-    botLayer_ = (char*)malloc(strlen(botLayer)+1);
-    botLayerLength_ = len;
-  }
-  strcpy(botLayer_, defData->DEFCASE(botLayer));
-  len = strlen(cutLayer) + 1;
-  if (len > cutLayerLength_) {
-    if (cutLayer_)
-      free(cutLayer_);
-    cutLayer_ = (char*)malloc(strlen(cutLayer)+1);
-    cutLayerLength_ = len;
-  }
-  strcpy(cutLayer_, defData->DEFCASE(cutLayer));
-  len = strlen(topLayer) + 1;
-  if (len > topLayerLength_) {
-    if (topLayer_)
-      free(topLayer_);
-    topLayer_ = (char*)malloc(strlen(topLayer)+1);
-    topLayerLength_ = len;
-  }
-  strcpy(topLayer_, defData->DEFCASE(topLayer));
-  xCutSpacing_ = xSpacing;
-  yCutSpacing_ = ySpacing;
-  xBotEnc_ = xBotEnc;
-  yBotEnc_ = yBotEnc;
-  xTopEnc_ = xTopEnc;
-  yTopEnc_ = yTopEnc;
-  hasViaRule_ = 1;
-}
-
-void defiVia::addRowCol(int numCutRows, int numCutCols) {
-  rows_ = numCutRows;
-  cols_ = numCutCols;
-}
-
-void defiVia::addOrigin(int xOffset, int yOffset) {
-  xOffset_ = xOffset;
-  yOffset_ = yOffset;
-}
-
-void defiVia::addOffset(int xBotOs, int yBotOs, int xTopOs, int yTopOs) {
-  xBotOffset_ = xBotOs;
-  yBotOffset_ = yBotOs;
-  xTopOffset_ = xTopOs;
-  yTopOffset_ = yTopOs;
-}
-
-void defiVia::addCutPattern(char* cutPattern) {
-  int len;
-
-  len = strlen(cutPattern) + 1;
-  if (len > cutPatternLength_) {
-    if (cutPattern_)
-      free(cutPattern_);
-    cutPattern_ = (char*)malloc(strlen(cutPattern)+1);
-    cutPatternLength_ = len;
-  }
-  strcpy(cutPattern_, defData->DEFCASE(cutPattern));
-  hasCutPattern_ = 1;
-}
-
-int defiVia::hasPattern() const {
-  return hasPattern_;
-}
-
-
-const char* defiVia::pattern() const {
-  return pattern_;
-}
-
-
-const char* defiVia::name() const {
-  return name_;
-}
-
-
-int defiVia::numLayers() const {
-  return numLayers_;
-}
-
-int defiVia::rectMask(int index) const {
-    if (index >= 0 && index < numLayers_) {
-        return rectMask_[index];
-    }
-
-    return 0;
-}
-
-int defiVia::polyMask(int index) const {
-    if (index >= 0 && index < numPolys_) {
-        return polyMask_[index];
-    }
-
-    return 0;
-}
-
-void defiVia::layer(int index, char** layer, int* xl, int* yl, 
-      int* xh, int* yh) const {
-  if (index >= 0 && index < numLayers_) {
-    if (layer) *layer = layers_[index];
-    if (xl) *xl = xl_[index];
-    if (yl) *yl = yl_[index];
-    if (xh) *xh = xh_[index];
-    if (yh) *yh = yh_[index];
-  }
-}
-
-// The following code is for 5.6
-
-int defiVia::numPolygons() const {
-  return numPolys_;
-}
-
-const char* defiVia::polygonName(int index) const {
-  char msg[160];
-  if (index < 0 || index > numPolys_) {
-     sprintf (msg, "ERROR (DEFPARS-6180): The index number %d specified for the VIA POLYGON is invalid.\nValid index is from 0 to %d. Specify a valid index number and then try again",
-              index, numPolys_);
-     defiError(0, 6180, msg, defData);
-     return 0;
-  }
-  return polygonNames_[index];
-}
-
-struct defiPoints defiVia::getPolygon(int index) const {
-  return *(polygons_[index]);
-}
-
-int defiVia::hasViaRule() const {
-  return hasViaRule_;
-}
-
-void defiVia::viaRule(char** viaRuleName, int* xSize, int* ySize,
-                      char** botLayer, char** cutLayer, char** topLayer,
-                      int* xCutSpacing, int* yCutSpacing, int* xBotEnc,
-                      int* yBotEnc, int* xTopEnc, int* yTopEnc) const {
-  *viaRuleName = viaRule_;
-  *xSize = xSize_;
-  *ySize = ySize_;
-  *botLayer = botLayer_;
-  *cutLayer = cutLayer_;
-  *topLayer = topLayer_;
-  *xCutSpacing = xCutSpacing_;
-  *yCutSpacing = yCutSpacing_;
-  *xBotEnc = xBotEnc_;
-  *yBotEnc = yBotEnc_;
-  *xTopEnc = xTopEnc_;
-  *yTopEnc = yTopEnc_;
-}
-
-int defiVia::hasRowCol() const {
-  if (rows_)
-    return rows_; 
-  else
-    return cols_; 
-}
-
-void defiVia::rowCol(int* numCutRows, int* numCutCols) const {
-  *numCutRows = rows_;
-  *numCutCols = cols_;
-}
-
-int defiVia::hasOrigin() const {
-  if (xOffset_)
-    return xOffset_;
-  else
-    return yOffset_;
-}
-
-void defiVia::origin(int* xOffset, int* yOffset) const {
-  *xOffset = xOffset_;
-  *yOffset = yOffset_;
-}
-
-int defiVia::hasOffset() const {
-  if (xBotOffset_)
-    return xBotOffset_;
-  else if (yBotOffset_)
-    return yBotOffset_;
-  else if (xTopOffset_)
-    return xTopOffset_;
-  else 
-    return yTopOffset_;
-}
-
-void defiVia::offset(int* xBotOffset, int* yBotOffset, int* xTopOffset,
-                     int* yTopOffset) const {
-  *xBotOffset = xBotOffset_;
-  *yBotOffset = yBotOffset_;
-  *xTopOffset = xTopOffset_;
-  *yTopOffset = yTopOffset_;
-}
-
-int defiVia::hasCutPattern() const {
-  return hasCutPattern_;
-}
-
-int defiVia::hasRectMask(int index) const {
-    if (index > 0 || index < numLayers_) {
-        return rectMask_[index];
-    }
-
-    return 0;
-}
-
-int defiVia::hasPolyMask(int index) const {
-    if (index > 0 || index < numPolys_) {
-        return polyMask_[index];
-    }
-    
-    return 0;
-}
-
-const char* defiVia::cutPattern() const {
-  return cutPattern_;
-}
-
-void defiVia::print(FILE* f) const {
-  int i;
-  int xl, yl, xh, yh;
-  char* c;
-  char* vrn;
-  char *bl, *cl, *tl;
-  int xs, ys, xcs, ycs, xbe, ybe, xte, yte;
-  int cr, cc, xo, yo, xbo, ybo, xto, yto;
-
-  fprintf(f, "via '%s'\n", name());
-
-  if (hasPattern())
-    fprintf(f, "  pattern '%s'\n", pattern());
-
-  for (i = 0; i < numLayers(); i++) {
-    layer(i, &c, &xl, &yl, &xh, &yh);
-    fprintf(f, "  layer '%s' %d,%d %d,%d\n", c, xl, yl, xh, yh);
-  }
-
-  if (hasViaRule()) {
-    viaRule(&vrn, &xs, &ys, &bl, &cl, &tl, &xcs, &ycs,
-                                 &xbe, &ybe, &xte, &yte);
-    fprintf(f, "  viarule '%s'\n", vrn);
-    fprintf(f, "    cutsize %d %d\n", xs, ys);
-    fprintf(f, "    layers %s %s %s\n", bl, cl, tl);
-    fprintf(f, "    cutspacing %d %d\n", xcs, ycs);
-    fprintf(f, "    enclosure %d %d %d %d\n", xbe, ybe, xte, yte);
-    if (hasRowCol()) {
-       rowCol(&cr, &cc);
-       fprintf(f, "    rowcol %d %d\n", cr, cc);
-    }
-    if (hasOrigin()) {
-       origin(&xo, &yo);
-       fprintf(f, "    origin %d %d\n", xo, yo);
-    }
-    if (hasOffset()) {
-       offset(&xbo, &ybo, &xto, &yto);
-       fprintf(f, "    offset %d %d %d %d\n", xbo, ybo, xto, yto);
-    }
-    if (hasCutPattern())
-       fprintf(f, "    pattern '%s'\n", cutPattern());
-  }
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.hpp
deleted file mode 100644
index 7ae57bc..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defiVia.hpp
+++ /dev/null
@@ -1,149 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defiVia_h
-#define defiVia_h
-
-#include "defiKRDefs.hpp"
-#include <stdio.h>
-#include "defiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrData;
-
-// Struct holds the data for one property.
-class defiVia {
-public:
-  defiVia(defrData *data);
-  void Init();
-
-  void clear();
-  void Destroy();
-  ~defiVia();
-
-  void setup(const char* name);
-  void addPattern(const char* patt);
-  void addLayer(const char* layer, int xl, int yl, int xh, int yh, int colorMask = 0);
-  // 5.6
-  void addPolygon(const char* layer, defiGeometries* geom, int colorMask = 0);
-  void addViaRule(char* viaRuleName, int xSize, int ySize, char* botLayer,
-                  char* cutLayer, char* topLayer, int xSpacing, int ySpacing,
-                  int xBotEnc, int yBotEnc, int xTopEnc, int yTopEnc);
-  void addRowCol(int numCutRows, int numCutCols);
-  void addOrigin(int xOffset, int yOffset);
-  void addOffset(int xBotOs, int yBotOs, int xTopOs, int yTopOs);
-  void addCutPattern(char* cutPattern);
-  
-  const char* name() const;
-  const char* pattern() const;
-  int hasPattern() const;
-  int numLayers() const;
-  void layer(int index, char** layer, int* xl, int* yl, int* xh, int* yh) const;
-  int numPolygons() const;                        // 5.6
-  const char* polygonName(int index) const;       // 5.6
-  defiPoints getPolygon(int index) const;  // 5.6
-  int hasViaRule() const;
-  void viaRule(char** viaRuleName, int* xSize, int* ySize, char** botLayer,
-               char** cutLayer, char** topLayer, int* xCutSpacing,
-               int* yCutSpacing, int* xBotEnc, int* yBotEnc, int* xTopEnc,
-               int* yTopEnc) const;
-  int hasRowCol() const;
-  void rowCol(int* numCutRows, int* numCutCols) const;
-  int hasOrigin() const;
-  void origin(int* xOffset, int* yOffset) const;
-  int hasOffset() const;
-  void offset(int* xBotOffset, int* yBotOffset, int* xTopOffset,
-              int* yTopOffset) const;
-  int hasCutPattern() const;
-  const char* cutPattern() const;
-  int hasRectMask(int index) const;
-  int rectMask(int index) const;
-  int hasPolyMask(int index) const;
-  int polyMask(int index) const;
-
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameLength_;
-  char* pattern_;
-  int patternLength_;
-  char** layers_;
-  int hasPattern_;
-  int* xl_;
-  int* yl_;
-  int* xh_;
-  int* yh_;
-  int layersLength_;
-  int numLayers_;
-  int numPolys_;            // 5.6
-  char** polygonNames_;     // 5.6 layerName for POLYGON
-  int polysAllocated_;      // 5.6
-  defiPoints** polygons_; // 5.6
-  char* viaRule_;           // 5.6
-  int   viaRuleLength_;     // 5.6
-  int   hasViaRule_;        // 5.6
-  int xSize_;               // 5.6
-  int ySize_;               // 5.6
-  char* botLayer_;          // 5.6
-  char* cutLayer_;          // 5.6
-  char* topLayer_;          // 5.6
-  int   botLayerLength_;    // 5.6
-  int   cutLayerLength_;    // 5.6
-  int   topLayerLength_;    // 5.6
-  int   xCutSpacing_;       // 5.6
-  int   yCutSpacing_;       // 5.6
-  int   xBotEnc_;           // 5.6
-  int   yBotEnc_;           // 5.6
-  int   xTopEnc_;           // 5.6
-  int   yTopEnc_;           // 5.6
-  int   rows_;              // 5.6
-  int   cols_;              // 5.6
-  int   xOffset_;           // 5.6
-  int   yOffset_;           // 5.6
-  int   xBotOffset_;        // 5.6
-  int   yBotOffset_;        // 5.6
-  int   xTopOffset_;        // 5.6
-  int   yTopOffset_;        // 5.6
-  char* cutPattern_;        // 5.6
-  int   cutPatternLength_;  // 5.6
-  int   hasCutPattern_;     // 5.6
-  int*  rectMask_;          // 5.8
-  int*  polyMask_;          // 5.8
-  
-  defrData *defData;
-};
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallBacks.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallBacks.hpp
deleted file mode 100644
index 355aa99..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallBacks.hpp
+++ /dev/null
@@ -1,159 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DEFRCALLBACKS_H
-#define DEFRCALLBACKS_H 1
-
-#include "defiKRDefs.hpp"
-
-#include "defrReader.hpp"
-
-#include "defrReader.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class defrCallbacks {
-public:
-    defrCallbacks();
-
-    void SetUnusedCallbacks(defrVoidCbkFnType f);
-
-    defrStringCbkFnType DesignCbk;
-    defrStringCbkFnType TechnologyCbk;
-    defrVoidCbkFnType DesignEndCbk;
-    defrPropCbkFnType PropCbk;
-    defrVoidCbkFnType PropDefEndCbk;
-    defrVoidCbkFnType PropDefStartCbk;
-    defrStringCbkFnType ArrayNameCbk;
-    defrStringCbkFnType FloorPlanNameCbk;
-    defrDoubleCbkFnType UnitsCbk;
-    defrStringCbkFnType DividerCbk;
-    defrStringCbkFnType BusBitCbk;
-    defrSiteCbkFnType SiteCbk;
-    defrSiteCbkFnType CanplaceCbk;
-    defrSiteCbkFnType CannotOccupyCbk;
-    defrIntegerCbkFnType ComponentStartCbk;
-    defrVoidCbkFnType ComponentEndCbk;
-    defrComponentCbkFnType ComponentCbk;
-    defrComponentMaskShiftLayerCbkFnType ComponentMaskShiftLayerCbk;
-    defrIntegerCbkFnType NetStartCbk;
-    defrVoidCbkFnType NetEndCbk;
-    defrNetCbkFnType NetCbk;
-    defrStringCbkFnType NetNameCbk;
-    defrStringCbkFnType NetSubnetNameCbk;
-    defrStringCbkFnType NetNonDefaultRuleCbk;
-    defrNetCbkFnType NetPartialPathCbk;
-    defrPathCbkFnType PathCbk;
-    defrDoubleCbkFnType VersionCbk;
-    defrStringCbkFnType VersionStrCbk;
-    defrStringCbkFnType PinExtCbk;
-    defrStringCbkFnType ComponentExtCbk;
-    defrStringCbkFnType ViaExtCbk;
-    defrStringCbkFnType NetConnectionExtCbk;
-    defrStringCbkFnType NetExtCbk;
-    defrStringCbkFnType GroupExtCbk;
-    defrStringCbkFnType ScanChainExtCbk;
-    defrStringCbkFnType IoTimingsExtCbk;
-    defrStringCbkFnType PartitionsExtCbk;
-    defrStringCbkFnType HistoryCbk;
-    defrBoxCbkFnType DieAreaCbk;
-    defrPinCapCbkFnType PinCapCbk;
-    defrPinCbkFnType PinCbk;
-    defrIntegerCbkFnType StartPinsCbk;
-    defrVoidCbkFnType PinEndCbk;
-    defrIntegerCbkFnType DefaultCapCbk;
-    defrRowCbkFnType RowCbk;
-    defrTrackCbkFnType TrackCbk;
-    defrGcellGridCbkFnType GcellGridCbk;
-    defrIntegerCbkFnType ViaStartCbk;
-    defrVoidCbkFnType ViaEndCbk;
-    defrViaCbkFnType ViaCbk;
-    defrIntegerCbkFnType RegionStartCbk;
-    defrVoidCbkFnType RegionEndCbk;
-    defrRegionCbkFnType RegionCbk;
-    defrIntegerCbkFnType SNetStartCbk;
-    defrVoidCbkFnType SNetEndCbk;
-    defrNetCbkFnType SNetCbk;
-    defrNetCbkFnType SNetPartialPathCbk;
-    defrNetCbkFnType SNetWireCbk;
-    defrIntegerCbkFnType GroupsStartCbk;
-    defrVoidCbkFnType GroupsEndCbk;
-    defrStringCbkFnType GroupNameCbk;
-    defrStringCbkFnType GroupMemberCbk;
-    defrGroupCbkFnType GroupCbk;
-    defrIntegerCbkFnType AssertionsStartCbk;
-    defrVoidCbkFnType AssertionsEndCbk;
-    defrAssertionCbkFnType AssertionCbk;
-    defrIntegerCbkFnType ConstraintsStartCbk;
-    defrVoidCbkFnType ConstraintsEndCbk;
-    defrAssertionCbkFnType ConstraintCbk;
-    defrIntegerCbkFnType ScanchainsStartCbk;
-    defrVoidCbkFnType ScanchainsEndCbk;
-    defrScanchainCbkFnType ScanchainCbk;
-    defrIntegerCbkFnType IOTimingsStartCbk;
-    defrVoidCbkFnType IOTimingsEndCbk;
-    defrIOTimingCbkFnType IOTimingCbk;
-    defrIntegerCbkFnType FPCStartCbk;
-    defrVoidCbkFnType FPCEndCbk;
-    defrFPCCbkFnType FPCCbk;
-    defrIntegerCbkFnType TimingDisablesStartCbk;
-    defrVoidCbkFnType TimingDisablesEndCbk;
-    defrTimingDisableCbkFnType TimingDisableCbk;
-    defrIntegerCbkFnType PartitionsStartCbk;
-    defrVoidCbkFnType PartitionsEndCbk;
-    defrPartitionCbkFnType PartitionCbk;
-    defrIntegerCbkFnType PinPropStartCbk;
-    defrVoidCbkFnType PinPropEndCbk;
-    defrPinPropCbkFnType PinPropCbk;
-    defrIntegerCbkFnType CaseSensitiveCbk;
-    defrIntegerCbkFnType BlockageStartCbk;
-    defrVoidCbkFnType BlockageEndCbk;
-    defrBlockageCbkFnType BlockageCbk;
-    defrIntegerCbkFnType SlotStartCbk;
-    defrVoidCbkFnType SlotEndCbk;
-    defrSlotCbkFnType SlotCbk;
-    defrIntegerCbkFnType FillStartCbk;
-    defrVoidCbkFnType FillEndCbk;
-    defrFillCbkFnType FillCbk;
-    defrIntegerCbkFnType NonDefaultStartCbk;
-    defrVoidCbkFnType NonDefaultEndCbk;
-    defrNonDefaultCbkFnType NonDefaultCbk;
-    defrIntegerCbkFnType StylesStartCbk;
-    defrVoidCbkFnType StylesEndCbk;
-    defrStylesCbkFnType StylesCbk;
-    defrStringCbkFnType ExtensionCbk;
-
-
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallbacks.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallbacks.cpp
deleted file mode 100644
index d630fba..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrCallbacks.cpp
+++ /dev/null
@@ -1,351 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #5 $
-//  $Date: 2013/03/13 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "defrCallBacks.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defrCallbacks::defrCallbacks()
-: DesignCbk(NULL),
-  TechnologyCbk(NULL),
-  DesignEndCbk(NULL),
-  PropCbk(NULL),
-  PropDefEndCbk(NULL),
-  PropDefStartCbk(NULL),
-  ArrayNameCbk(NULL),
-  FloorPlanNameCbk(NULL),
-  UnitsCbk(NULL),
-  DividerCbk(NULL),
-  BusBitCbk(NULL),
-  SiteCbk(NULL),
-  CanplaceCbk(NULL),
-  CannotOccupyCbk(NULL),
-  ComponentStartCbk(NULL),
-  ComponentEndCbk(NULL),
-  ComponentCbk(NULL),
-  NetStartCbk(NULL),
-  NetEndCbk(NULL),
-  NetCbk(NULL),
-  NetNameCbk(NULL),
-  NetSubnetNameCbk(NULL),
-  NetNonDefaultRuleCbk(NULL),
-  NetPartialPathCbk(NULL),
-  PathCbk(NULL),
-  VersionCbk(NULL),
-  VersionStrCbk(NULL),
-  PinExtCbk(NULL),
-  ComponentExtCbk(NULL),
-  ViaExtCbk(NULL),
-  NetConnectionExtCbk(NULL),
-  NetExtCbk(NULL),
-  GroupExtCbk(NULL),
-  ScanChainExtCbk(NULL),
-  IoTimingsExtCbk(NULL),
-  PartitionsExtCbk(NULL),
-  HistoryCbk(NULL),
-  DieAreaCbk(NULL),
-  PinCapCbk(NULL),
-  PinCbk(NULL),
-  StartPinsCbk(NULL),
-  PinEndCbk(NULL),
-  DefaultCapCbk(NULL),
-  RowCbk(NULL),
-  TrackCbk(NULL),
-  GcellGridCbk(NULL),
-  ViaStartCbk(NULL),
-  ViaEndCbk(NULL),
-  ViaCbk(NULL),
-  RegionStartCbk(NULL),
-  RegionEndCbk(NULL),
-  RegionCbk(NULL),
-  SNetStartCbk(NULL),
-  SNetEndCbk(NULL),
-  SNetCbk(NULL),
-  SNetPartialPathCbk(NULL),
-  SNetWireCbk(NULL),
-  GroupsStartCbk(NULL),
-  GroupsEndCbk(NULL),
-  GroupNameCbk(NULL),
-  GroupMemberCbk(NULL),
-  ComponentMaskShiftLayerCbk(NULL),
-  GroupCbk(NULL),
-  AssertionsStartCbk(NULL),
-  AssertionsEndCbk(NULL),
-  AssertionCbk(NULL),
-  ConstraintsStartCbk(NULL),
-  ConstraintsEndCbk(NULL),
-  ConstraintCbk(NULL),
-  ScanchainsStartCbk(NULL),
-  ScanchainsEndCbk(NULL),
-  ScanchainCbk(NULL),
-  IOTimingsStartCbk(NULL),
-  IOTimingsEndCbk(NULL),
-  IOTimingCbk(NULL),
-  FPCStartCbk(NULL),
-  FPCEndCbk(NULL),
-  FPCCbk(NULL),
-  TimingDisablesStartCbk(NULL),
-  TimingDisablesEndCbk(NULL),
-  TimingDisableCbk(NULL),
-  PartitionsStartCbk(NULL),
-  PartitionsEndCbk(NULL),
-  PartitionCbk(NULL),
-  PinPropStartCbk(NULL),
-  PinPropEndCbk(NULL),
-  PinPropCbk(NULL),
-  CaseSensitiveCbk(NULL),
-  BlockageStartCbk(NULL),
-  BlockageEndCbk(NULL),
-  BlockageCbk(NULL),
-  SlotStartCbk(NULL),
-  SlotEndCbk(NULL),
-  SlotCbk(NULL),
-  FillStartCbk(NULL),
-  FillEndCbk(NULL),
-  FillCbk(NULL),
-  NonDefaultStartCbk(NULL),
-  NonDefaultEndCbk(NULL),
-  NonDefaultCbk(NULL),
-  StylesStartCbk(NULL),
-  StylesEndCbk(NULL),
-  StylesCbk(NULL),
-  ExtensionCbk(NULL)
-{
-}
-
-
-void
-defrCallbacks::SetUnusedCallbacks(defrVoidCbkFnType f)
-{
-    if (!DesignCbk)
-        DesignCbk = (defrStringCbkFnType) f;
-    if (!TechnologyCbk)
-        TechnologyCbk = (defrStringCbkFnType) f;
-    if (!DesignEndCbk)
-        DesignEndCbk = (defrVoidCbkFnType) f;
-    if (!PropCbk)
-        PropCbk = (defrPropCbkFnType) f;
-    if (!PropDefEndCbk)
-        PropDefEndCbk = (defrVoidCbkFnType) f;
-    if (!PropDefStartCbk)
-        PropDefStartCbk = (defrVoidCbkFnType) f;
-    if (!ArrayNameCbk)
-        ArrayNameCbk = (defrStringCbkFnType) f;
-    if (!FloorPlanNameCbk)
-        FloorPlanNameCbk = (defrStringCbkFnType) f;
-    if (!UnitsCbk)
-        UnitsCbk = (defrDoubleCbkFnType) f;
-    if (!DividerCbk)
-        DividerCbk = (defrStringCbkFnType) f;
-    if (!BusBitCbk)
-        BusBitCbk = (defrStringCbkFnType) f;
-    if (!SiteCbk)
-        SiteCbk = (defrSiteCbkFnType) f;
-    if (!CanplaceCbk)
-        CanplaceCbk = (defrSiteCbkFnType) f;
-    if (!CannotOccupyCbk)
-        CannotOccupyCbk = (defrSiteCbkFnType) f;
-    if (!ComponentStartCbk)
-        ComponentStartCbk = (defrIntegerCbkFnType) f;
-    if (!ComponentEndCbk)
-        ComponentEndCbk = (defrVoidCbkFnType) f;
-    if (!ComponentCbk)
-        ComponentCbk = (defrComponentCbkFnType) f;
-    if (!NetStartCbk)
-        NetStartCbk = (defrIntegerCbkFnType) f;
-    if (!NetEndCbk)
-        NetEndCbk = (defrVoidCbkFnType) f;
-    if (!NetCbk)
-        NetCbk = (defrNetCbkFnType) f;
-    //  if (! defrNetPartialPathCbk) defrNetPartialPathCbk = (defrNetCbkFnType)f;
-    if (!PathCbk)
-        PathCbk = (defrPathCbkFnType) f;
-    if ((!VersionCbk) && (!VersionStrCbk)) {
-        // both version callbacks weren't set, if either one is set, it is ok
-        VersionCbk = (defrDoubleCbkFnType) f;
-        VersionStrCbk = (defrStringCbkFnType) f;
-    }
-    if (!PinExtCbk)
-        PinExtCbk = (defrStringCbkFnType) f;
-    if (!ComponentExtCbk)
-        ComponentExtCbk = (defrStringCbkFnType) f;
-    if (!ViaExtCbk)
-        ViaExtCbk = (defrStringCbkFnType) f;
-    if (!NetConnectionExtCbk)
-        NetConnectionExtCbk = (defrStringCbkFnType) f;
-    if (!NetExtCbk)
-        NetExtCbk = (defrStringCbkFnType) f;
-    if (!GroupExtCbk)
-        GroupExtCbk = (defrStringCbkFnType) f;
-    if (!ScanChainExtCbk)
-        ScanChainExtCbk = (defrStringCbkFnType) f;
-    if (!IoTimingsExtCbk)
-        IoTimingsExtCbk = (defrStringCbkFnType) f;
-    if (!PartitionsExtCbk)
-        PartitionsExtCbk = (defrStringCbkFnType) f;
-    if (!HistoryCbk)
-        HistoryCbk = (defrStringCbkFnType) f;
-    if (!DieAreaCbk)
-        DieAreaCbk = (defrBoxCbkFnType) f;
-    if (!PinCapCbk)
-        PinCapCbk = (defrPinCapCbkFnType) f;
-    if (!PinCbk)
-        PinCbk = (defrPinCbkFnType) f;
-    if (!StartPinsCbk)
-        StartPinsCbk = (defrIntegerCbkFnType) f;
-    if (!PinEndCbk)
-        PinEndCbk = (defrVoidCbkFnType) f;
-    if (!DefaultCapCbk)
-        DefaultCapCbk = (defrIntegerCbkFnType) f;
-    if (!RowCbk)
-        RowCbk = (defrRowCbkFnType) f;
-    if (!TrackCbk)
-        TrackCbk = (defrTrackCbkFnType) f;
-    if (!GcellGridCbk)
-        GcellGridCbk = (defrGcellGridCbkFnType) f;
-    if (!ViaStartCbk)
-        ViaStartCbk = (defrIntegerCbkFnType) f;
-    if (!ViaEndCbk)
-        ViaEndCbk = (defrVoidCbkFnType) f;
-    if (!ViaCbk)
-        ViaCbk = (defrViaCbkFnType) f;
-    if (!RegionStartCbk)
-        RegionStartCbk = (defrIntegerCbkFnType) f;
-    if (!RegionEndCbk)
-        RegionEndCbk = (defrVoidCbkFnType) f;
-    if (!RegionCbk)
-        RegionCbk = (defrRegionCbkFnType) f;
-    if (!SNetStartCbk)
-        SNetStartCbk = (defrIntegerCbkFnType) f;
-    if (!SNetEndCbk)
-        SNetEndCbk = (defrVoidCbkFnType) f;
-    if (!SNetCbk)
-        SNetCbk = (defrNetCbkFnType) f;
-    //  if(! defrSNetPartialPathCbk) defrSNetPartialPathCbk = (defrNetCbkFnType)f;
-    //  if(! defrSNetWireCbk) defrSNetWireCbk = (defrNetCbkFnType)f;
-    if (!GroupsStartCbk)
-        GroupsStartCbk = (defrIntegerCbkFnType) f;
-    if (!GroupsEndCbk)
-        GroupsEndCbk = (defrVoidCbkFnType) f;
-    if (!GroupNameCbk)
-        GroupNameCbk = (defrStringCbkFnType) f;
-    if (!GroupMemberCbk)
-        GroupMemberCbk = (defrStringCbkFnType) f;
-    if (!ComponentMaskShiftLayerCbk)
-        ComponentMaskShiftLayerCbk = (defrComponentMaskShiftLayerCbkFnType) f;
-    if (!GroupCbk)
-        GroupCbk = (defrGroupCbkFnType) f;
-    if (!AssertionsStartCbk)
-        AssertionsStartCbk = (defrIntegerCbkFnType) f;
-    if (!AssertionsEndCbk)
-        AssertionsEndCbk = (defrVoidCbkFnType) f;
-    if (!AssertionCbk)
-        AssertionCbk = (defrAssertionCbkFnType) f;
-    if (!ConstraintsStartCbk)
-        ConstraintsStartCbk = (defrIntegerCbkFnType) f;
-    if (!ConstraintsEndCbk)
-        ConstraintsEndCbk = (defrVoidCbkFnType) f;
-    if (!ConstraintCbk)
-        ConstraintCbk = (defrAssertionCbkFnType) f;
-    if (!ScanchainsStartCbk)
-        ScanchainsStartCbk = (defrIntegerCbkFnType) f;
-    if (!ScanchainsEndCbk)
-        ScanchainsEndCbk = (defrVoidCbkFnType) f;
-    if (!ScanchainCbk)
-        ScanchainCbk = (defrScanchainCbkFnType) f;
-    if (!IOTimingsStartCbk)
-        IOTimingsStartCbk = (defrIntegerCbkFnType) f;
-    if (!IOTimingsEndCbk)
-        IOTimingsEndCbk = (defrVoidCbkFnType) f;
-    if (!IOTimingCbk)
-        IOTimingCbk = (defrIOTimingCbkFnType) f;
-    if (!FPCStartCbk)
-        FPCStartCbk = (defrIntegerCbkFnType) f;
-    if (!FPCEndCbk)
-        FPCEndCbk = (defrVoidCbkFnType) f;
-    if (!FPCCbk)
-        FPCCbk = (defrFPCCbkFnType) f;
-    if (!TimingDisablesStartCbk)
-        TimingDisablesStartCbk = (defrIntegerCbkFnType) f;
-    if (!TimingDisablesEndCbk)
-        TimingDisablesEndCbk = (defrVoidCbkFnType) f;
-    if (!TimingDisableCbk)
-        TimingDisableCbk = (defrTimingDisableCbkFnType) f;
-    if (!PartitionsStartCbk)
-        PartitionsStartCbk = (defrIntegerCbkFnType) f;
-    if (!PartitionsEndCbk)
-        PartitionsEndCbk = (defrVoidCbkFnType) f;
-    if (!PartitionCbk)
-        PartitionCbk = (defrPartitionCbkFnType) f;
-    if (!PinPropStartCbk)
-        PinPropStartCbk = (defrIntegerCbkFnType) f;
-    if (!PinPropEndCbk)
-        PinPropEndCbk = (defrVoidCbkFnType) f;
-    if (!PinPropCbk)
-        PinPropCbk = (defrPinPropCbkFnType) f;
-    if (!CaseSensitiveCbk)
-        CaseSensitiveCbk = (defrIntegerCbkFnType) f;
-    if (!BlockageStartCbk)
-        BlockageStartCbk = (defrIntegerCbkFnType) f;
-    if (!BlockageEndCbk)
-        BlockageEndCbk = (defrVoidCbkFnType) f;
-    if (!BlockageCbk)
-        BlockageCbk = (defrBlockageCbkFnType) f;
-    if (!SlotStartCbk)
-        SlotStartCbk = (defrIntegerCbkFnType) f;
-    if (!SlotEndCbk)
-        SlotEndCbk = (defrVoidCbkFnType) f;
-    if (!SlotCbk)
-        SlotCbk = (defrSlotCbkFnType) f;
-    if (!FillStartCbk)
-        FillStartCbk = (defrIntegerCbkFnType) f;
-    if (!FillEndCbk)
-        FillEndCbk = (defrVoidCbkFnType) f;
-    if (!FillCbk)
-        FillCbk = (defrFillCbkFnType) f;
-    if (!NonDefaultStartCbk)
-        NonDefaultStartCbk = (defrIntegerCbkFnType) f;
-    if (!NonDefaultEndCbk)
-        NonDefaultEndCbk = (defrVoidCbkFnType) f;
-    if (!NonDefaultCbk)
-        NonDefaultCbk = (defrNonDefaultCbkFnType) f;
-    if (!StylesStartCbk)
-        StylesStartCbk = (defrIntegerCbkFnType) f;
-    if (!StylesEndCbk)
-        StylesEndCbk = (defrVoidCbkFnType) f;
-    if (!StylesCbk)
-        StylesCbk = (defrStylesCbkFnType) f;
-    if (!ExtensionCbk)
-        ExtensionCbk = (defrStringCbkFnType) f;
-
-    /* NEW CALLBACK - Each new callback must have an entry here. */
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.cpp
deleted file mode 100644
index 135245e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.cpp
+++ /dev/null
@@ -1,506 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #6 $
-//  $Date: 2013/08/09 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "defrData.hpp"
-#include "defrSettings.hpp"
-
-using namespace std;
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defrData::defrData(const defrCallbacks *pCallbacks,
-                   const defrSettings  *pSettings,
-                   defrSession         *pSession)
-: callbacks(pCallbacks),
-  settings(pSettings),
-  session(pSession),
-  Subnet(0),
-  aOxide(0),
-  assertionWarnings(0),
-  bit_is_keyword(0),
-  bitsNum(0),
-  blockageWarnings(0),
-  by_is_keyword(0),
-  caseSensitiveWarnings(0),
-  ch(NULL),
-  componentWarnings(0),
-  constraintWarnings(0),
-  cover_is_keyword(0),
-  defIgnoreVersion(0),
-  defInvalidChar(0),
-  defMsg(NULL),
-  defMsgCnt(5500),
-  defMsgPrinted(0),
-  defPrintTokens(0),
-  defPropDefType('\0'),
-  defRetVal(0),
-  def_warnings(0),
-  defaultCapWarnings(0),
-  defrLog(0),
-  do_is_keyword(0),
-  dumb_mode(0),
-  errors(0),
-  fillWarnings(0),
-  first_buffer(0),
-  fixed_is_keyword(0),
-  gcellGridWarnings(0),
-  hasBlkLayerComp(0),
-  hasBlkLayerSpac(0),
-  hasBlkLayerTypeComp(0),
-  hasBlkPlaceComp(0),
-  hasBlkPlaceTypeComp(0),
-  hasBusBit(0),
-  hasDes(0),
-  hasDivChar(0),
-  hasDoStep(0),
-  hasNameCase(0),
-  hasOpenedDefLogFile(0),
-  hasPort(0),
-  hasVer(0),
-  hasFatalError(0),
-  iOTimingWarnings(0),
-  input_level(-1),
-  last(NULL),
-  magic((char*)malloc(1)),
-  mask_is_keyword(0),
-  mustjoin_is_keyword(0),
-  names_case_sensitive(1),
-  needNPCbk(0),
-  needSNPCbk(0),
-  netOsnet(0),
-  netWarnings(0),
-  new_is_keyword(0),
-  next(NULL),
-  nlines(1),
-  nl_token(FALSE),
-  no_num(0),
-  nonDefaultWarnings(0),
-  nondef_is_keyword(0),
-  ntokens(0),
-  orient_is_keyword(0),
-  pinExtWarnings(0),
-  pinWarnings(0),
-  real_num(0),
-  rect_is_keyword(0),
-  regTypeDef(0),
-  regionWarnings(0),
-  ringPlace(0),
-  routed_is_keyword(0),
-  rowName(NULL),
-  rowWarnings(0),
-  sNetWarnings(0),
-  save_x(0.0),
-  save_y(0.0),
-  scanchainWarnings(0),
-  shield(FALSE),
-  shieldName(NULL),
-  shiftBuf(0),
-  shiftBufLength(0),
-  specialWire_mask(0),
-  step_is_keyword(0),
-  stylesWarnings(0),
-  trackWarnings(0),
-  unitsWarnings(0),
-  versionWarnings(0),
-  viaRule(0),
-  viaWarnings(0),
-  virtual_is_keyword(0),
-  deftokenLength(TOKEN_SIZE),
-  warningMsg(NULL),
-  specialWire_routeStatus((char*) "ROUTED"),
-  specialWire_routeStatusName((char *)""),
-  specialWire_shapeType((char*)""),
-  VersionNum(5.7),
-  xStep(0),
-  yStep(0),
-  lVal(0.0),
-  rVal(0.0),
-  // defrReader vars
-  PathObj(this),
-  Prop(this),
-  Site(this),
-  Component(this),
-  ComponentMaskShiftLayer(this),
-  Net(this),
-  PinCap(),
-  CannotOccupy(this),
-  Canplace(this),
-  DieArea(),
-  Pin(this),
-  Row(this),
-  Track(this),
-  GcellGrid(this),
-  Via(this),
-  Region(this),
-  Group(this),
-  Assertion(this),
-  Scanchain(this),
-  IOTiming(this),
-  FPC(this),
-  TimingDisable(this),
-  Partition(this),
-  PinProp(this),
-  Blockage(this),
-  Slot(this),
-  Fill(this),
-  NonDefault(this),
-  Styles(),
-  Geometries(this),
-  doneDesign(0),
-  NeedPathData(0),
-  deftoken((char*)malloc(TOKEN_SIZE)),
-  uc_token((char*)malloc(TOKEN_SIZE)),
-  pv_deftoken((char*)malloc(TOKEN_SIZE)),
-  File(0)
-{
-    magic[0] = '\0';
-    deftoken[0] = '\0';
-    History_text.push_back('\0');
-
-    memset(msgLimit, 0, DEF_MSGS * sizeof(int));
-    memset(buffer, 0, IN_BUF_SIZE * sizeof(char));
-    memset(ring, 0, RING_SIZE * sizeof(char*));
-    memset(ringSizes, 0, RING_SIZE * sizeof(int));
-    memset(lineBuffer, 0, MSG_SIZE * sizeof(char));
-
-    // initRingBuffer
-    int i;
-    ringPlace = 0;
-    for (i = 0; i < RING_SIZE; i++) {
-        ring[i] = (char*)malloc(TOKEN_SIZE);
-        ringSizes[i] = TOKEN_SIZE;
-    }
-
-    nlines = 1;
-    last = buffer-1;
-    next = buffer;
-    first_buffer = 1;
-
-    lVal = strtod("-2147483648", &ch);
-    rVal = strtod("2147483647", &ch);
-}
-
-
-defrData::~defrData()
-{
-    // lex_un_init.
-    /* Close the file */
-    if (defrLog) {
-        fclose(defrLog);
-        defrLog = 0;
-    }
-
-    free(deftoken);
-    free(uc_token);
-    free(pv_deftoken);
-    free(magic);
-
-    // freeRingBuffer.
-    int i;
-
-    ringPlace = 0;
-    for (i = 0; i < RING_SIZE; i++) {
-        free(ring[i]);
-    }
-}
-
-void 
-defrData::defiError(int check, int msgNum, const char* mess) 
-{
-  /* check is 1 if the caller function has checked totalMsgLimit, etc. */
-
-  if (!check) {
-     if ((settings->totalDefMsgLimit > 0) && (defMsgPrinted >= settings->totalDefMsgLimit))
-        return;
-     if (settings->MsgLimit[msgNum-5000] > 0) {
-        if (msgLimit[msgNum-5000] >= settings->MsgLimit[msgNum-5000])
-           return;    /*over the limit*/
-        msgLimit[msgNum-5000] = msgLimit[msgNum-5000] + 1;
-     }
-     defMsgPrinted++;
-  }
-
-
-  if (settings->ContextErrorLogFunction) {
-      (*(settings->ContextErrorLogFunction))(session->UserData, mess);
-  } else if (settings->ErrorLogFunction) {
-    (*(settings->ErrorLogFunction))(mess);
-  } else {
-    fprintf(stderr, mess);
-  }
-}
-
-const char* 
-defrData::upperCase(const char* str) 
-{
-    const static char defiShift [] = {
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-      ' ',  '!',  '"',  '#',  '$',  '%',  '&', '\'', 
-      '(',  ')',  '*',  '+',  ',',  '-',  '.',  '/', 
-      '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7', 
-      '8',  '9',  ':',  ';',  '<',  '=',  '>',  '?', 
-      '@',  'A',  'B',  'C',  'D',  'E',  'F',  'G', 
-      'H',  'I',  'J',  'K',  'L',  'M',  'N',  'O', 
-      'P',  'Q',  'R',  'S',  'T',  'U',  'V',  'W', 
-      'X',  'Y',  'Z',  '[', '\\',  ']',  '^',  '_', 
-      '`',  'A',  'B',  'C',  'D',  'E',  'F',  'G', 
-      'H',  'I',  'J',  'K',  'l',  'M',  'N',  'O', 
-      'P',  'Q',  'R',  'S',  'T',  'U',  'V',  'W', 
-      'X',  'Y',  'Z',  '{',  '|',  '}',  '~', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
-     '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
-    };
-
-  char* place = (char*)str;
-  char* to;
-  int len = strlen(str) + 1;
-
-  if (len > shiftBufLength) {
-    if (shiftBuf == 0) {
-      len = len < 64 ? 64 : len;
-      shiftBuf = (char*)malloc(len);
-      shiftBufLength = len;
-    } else {
-      free(shiftBuf);
-      shiftBuf = (char*)malloc(len);
-      shiftBufLength = len;
-    }
-  }
-
-  to = shiftBuf;
-  while (*place) {
-      int i = (int)*place;
-      place++;
-    *to++ = defiShift[i];
-  }
-  *to = '\0';
-
-  return shiftBuf;
-}
-
-int 
-defrData::validateMaskInput(int input, int warningIndex, int getWarningsIndex) 
-{
-    if (VersionNum < 5.8 && input > 0) {
-      if (warningIndex++ < getWarningsIndex) {
-          defMsg = (char*)malloc(1000);
-          sprintf (defMsg,
-             "The MASK statement is available in version 5.8 and later.\nHowever, your DEF file is defined with version %g", VersionNum);
-          defError(7415, defMsg);
-          free(defMsg);
-          if (checkErrors()) {
-              return 1;
-          }
-          return 0;
-        }
-    }   
-    
-    return 1; 
-}
-
-int 
-defrData::validateMaskShiftInput(const char* shiftMask, int warningIndex, int getWarningsIndex) 
-{
-    int shiftMaskLength = strlen(shiftMask);
-    int hasShiftData = 0;
-    int hasError = 0;
-
-    // Verification of the mask string
-    for (int i = 0; i < shiftMaskLength; i++) {
-        int curShift = shiftMask[i];
-        
-        if (curShift < '0' || curShift > '9') {
-            hasError = 1;
-        }
-
-        if (curShift > '0') {
-            hasShiftData = 1;
-        }
-    }
-
-    if (hasError) {
-        char *msg = (char*)malloc(1000);
-
-        sprintf(msg, 
-                "The MASKSHIFT value '%s' is not valid. The value should be a string consisting of decimal digits ('0' - '9').", 
-                shiftMask);
-        defError(7416, msg);
-        free(msg);
-
-        if (checkErrors()) {
-            return 1;
-        }
-
-        return 0;
-    }
-
-    if (VersionNum < 5.8 && hasShiftData) {
-        if (warningIndex++ < getWarningsIndex) {
-            char *msg = (char*)malloc(1000);
-
-            sprintf (msg, 
-                     "The MASKSHIFT statement can be used only in DEF version 5.8 and later. This DEF file version is '%g'.", 
-                     VersionNum);
-            defError(7417, msg);
-            free(msg);            
-            if (checkErrors()) {
-                return 1;
-            }
-        }
-          
-        return 0;
-    }   
-    
-    return 1; 
-}
-
-double
-defrData::convert_defname2num(char *versionName)
-{
-    char majorNm[80];
-    char minorNm[80];
-    char *subMinorNm = NULL;
-    char *versionNm = strdup(versionName);
-
-    double major = 0, minor = 0, subMinor = 0;
-    double version;
-
-    sscanf(versionNm, "%[^.].%s", majorNm, minorNm);
-    
-    char *p1 = strchr(minorNm, '.');
-    if (p1) {
-       subMinorNm = p1+1;
-       *p1 = '\0';
-    }
-    major = atof(majorNm);
-    minor = atof(minorNm);
-    if (subMinorNm)
-       subMinor = atof(subMinorNm);
-
-    version = major;
-
-    if (minor > 0)
-       version = major + minor/10;
-
-    if (subMinor > 0)
-       version = version + subMinor/1000;
-
-    free(versionNm);
-    return version;
-}
-
-int
-defrData::numIsInt (char* volt) {
-    if (strchr(volt, '.'))  // a floating point
-       return 0;
-    else
-       return 1;
-}
-
-int 
-defrData::defValidNum(int values) {
-    char *outMsg;
-    switch (values) {
-        case 100:
-        case 200:
-        case 1000:
-        case 2000:
-                return 1;
-        case 400:
-        case 800:
-        case 4000:
-        case 8000:
-        case 10000:
-        case 20000:
-             if (VersionNum < 5.6) {
-                if (callbacks->UnitsCbk) {
-                  if (unitsWarnings++ < settings->UnitsWarnings) {
-                    outMsg = (char*)malloc(1000);
-                    sprintf (outMsg,
-                    "An error has been found while processing the DEF file '%s'\nUnit %d is a 5.6 or later syntax. Define the DEF file as 5.6 and then try again.",
-                    session->FileName, values);
-                    defError(6501, outMsg);
-                    free(outMsg);
-                  }
-                }
-                
-                return 0;
-             } else {
-                return 1;
-             }
-    }
-    if (callbacks->UnitsCbk) {
-      if (unitsWarnings++ < settings->UnitsWarnings) {
-        outMsg = (char*)malloc(10000);
-        sprintf (outMsg,
-          "The value %d defined for DEF UNITS DISTANCE MICRON is invalid\n. The valid values are 100, 200, 400, 800, 1000, 2000, 4000, 8000, 10000, or 20000. Specify a valid value and then try again.", values);
-        defError(6502, outMsg);
-        free(outMsg);
-        if (checkErrors()) {
-            return 1;
-        }
-      }
-    }
-    return 0;
-}
-
-defrContext::defrContext(int ownConf)
-: callbacks(0),
-settings(0),
-session(0),
-data(0),
-ownConfig(ownConf),
-init_call_func(0)
-{
-}
-
-defrContext defContext;
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.hpp
deleted file mode 100644
index 1a7f5d1..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrData.hpp
+++ /dev/null
@@ -1,307 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #6 $
-//  $Date: 2013/08/09 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <cstring>
-#include <string>
-#include <map>
-#include <vector>
-
-#include "defrReader.hpp"
-#include "defrCallBacks.hpp"
-#include "defrSettings.hpp"
-
-#ifndef defrData_h
-#define defrData_h
-
-#define CURRENT_VERSION 5.8
-#define RING_SIZE 10
-#define IN_BUF_SIZE 16384
-#define TOKEN_SIZE 4096
-#define MSG_SIZE 100
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-struct defCompareStrings 
-{
-    bool operator()(const std::string &lhs, const std::string &rhs) const {
-        return std::strcmp(lhs.c_str(), rhs.c_str()) < 0;
-    }
-};
-
-typedef std::map<std::string, std::string, defCompareStrings> defAliasMap;
-typedef std::map<std::string, std::string, defCompareStrings> defDefineMap;
-
-typedef union {
-        double dval ;
-        int    integer ;
-        char * string ;
-        int    keyword ;  // really just a nop 
-        struct defpoint pt;
-        defTOKEN *tk;
-} YYSTYPE;
-
-#define YYSTYPE_IS_DECLARED
-
-class defrData {
-
-public:
-    defrData(const defrCallbacks *pCallbacks,
-             const defrSettings  *pSettings,
-             defrSession         *pSession);
-    ~defrData();
-
-    inline int          defGetKeyword(const char* name, int *result);
-    inline int          defGetAlias(const std::string &name, std::string &result);
-    inline int          defGetDefine(const std::string &name, std::string &result);
-    void                reload_buffer(); 
-    int                 GETC();
-
-    void                UNGETC(char ch);
-    char*               ringCopy(const char* string);
-    int                 DefGetTokenFromStack(char *s);
-    inline void         print_lines(long long lines);
-    const char *        lines2str(long long lines);
-    static inline void  IncCurPos(char **curPos, char **buffer, int *bufferSize);
-    int                 DefGetToken(char **buffer, int *bufferSize);
-    static void         uc_array(char *source, char *dest);
-    void                StoreAlias();
-    int                 defyylex(YYSTYPE *pYylval);
-    int                 sublex(YYSTYPE *pYylval);
-    int                 amper_lookup(YYSTYPE *pYylval, char *tkn);
-    void                defError(int msgNum, const char *s);
-    void                defyyerror(const char *s);
-    void                defInfo(int msgNum, const char *s);
-    void                defWarning(int msgNum, const char *s);
-
-    void                defiError(int check, int msgNum, const char* mess);
-    const char          *DEFCASE(const char* ch);
-    void                pathIsDone(int shield, int reset, int netOsnet, int *needCbk);
-    const char          *upperCase(const char* str);
-
-    inline int          checkErrors();
-    int                 validateMaskInput(int input, int warningIndex, int getWarningsIndex);
-    int                 validateMaskShiftInput(const char* shiftMask, int warningIndex, int getWarningsIndex);
-
-    static double       convert_defname2num(char *versionName);
-
-    static int          numIsInt (char* volt);
-    int                 defValidNum(int values);
-
-    inline static const char   *defkywd(int num);
-
-    FILE*  defrLog; 
-    char   defPropDefType; // save the current type of the property
-    char*  ch; 
-    char*  defMsg; 
-    char*  deftoken; 
-    char*  uc_token;
-    char*  last; 
-    char*  magic; 
-    char*  next; 
-    char*  pv_deftoken; 
-    char*  rowName; // to hold the rowName for message
-    char*  shieldName; // to hold the shieldNetName
-    char*  shiftBuf; 
-    char*  warningMsg; 
-    double save_x; 
-    double save_y; 
-    double lVal;
-    double rVal;
-    int  aOxide; // keep track for oxide
-    int  assertionWarnings; 
-    int  bit_is_keyword; 
-    int  bitsNum; // Scanchain Bits value
-    int  blockageWarnings; 
-    int  by_is_keyword; 
-    int  caseSensitiveWarnings; 
-    int  componentWarnings; 
-    int  constraintWarnings; 
-    int  cover_is_keyword; 
-    int  defIgnoreVersion; // ignore checking version number
-    int  defInvalidChar; 
-    int  defMsgCnt; 
-    int  defMsgPrinted; // number of msgs output so far
-    int  defPrintTokens; 
-    int  defRetVal; 
-    int  def_warnings; 
-    int  defaultCapWarnings; 
-    int  do_is_keyword; 
-    int  dumb_mode; 
-    int  errors; 
-    int  fillWarnings; 
-    int  first_buffer; 
-    int  fixed_is_keyword; 
-    int  gcellGridWarnings; 
-    int  hasBlkLayerComp; // only 1 BLOCKAGE/LAYER/COMP
-    int  hasBlkLayerSpac; // only 1 BLOCKAGE/LAYER/SPACING
-    int  hasBlkLayerTypeComp; // SLOTS or FILLS
-    int  hasBlkPlaceComp; // only 1 BLOCKAGE/PLACEMENT/COMP
-    int  hasBlkPlaceTypeComp; // SOFT or PARTIAL
-    int  hasBusBit; // keep track BUSBITCHARS is in the file
-    int  hasDes; // keep track DESIGN is in the file
-    int  hasDivChar; // keep track DIVIDERCHAR is in the file
-    int  hasDoStep; 
-    int  hasNameCase; // keep track NAMESCASESENSITIVE is in the file
-    int  hasOpenedDefLogFile; 
-    int  hasPort; // keep track is port defined in a Pin
-    int  hasVer; // keep track VERSION is in the file
-    int  hasFatalError; // don't report errors after the file end.
-    int  iOTimingWarnings; 
-    int  input_level; 
-    int  mask_is_keyword; 
-    int  mustjoin_is_keyword; 
-    int  names_case_sensitive; // always true in 5.6
-    int  needNPCbk; // if cbk for net path is needed
-    int  needSNPCbk; // if cbk for snet path is needed
-    int  netOsnet; // net = 1 & snet = 2
-    int  netWarnings; 
-    int  new_is_keyword; 
-    int  nl_token; 
-    int  no_num; 
-    int  nonDefaultWarnings; 
-    int  nondef_is_keyword; 
-    int  ntokens; 
-    int  orient_is_keyword; 
-    int  pinExtWarnings; 
-    int  pinWarnings; 
-    int  real_num; 
-    int  rect_is_keyword; 
-    int  regTypeDef; // keep track that region type is defined 
-    int  regionWarnings; 
-    int  ringPlace; 
-    int  routed_is_keyword; 
-    int  rowWarnings; 
-    int  sNetWarnings; 
-    int  scanchainWarnings; 
-    int  shield; // To identify if the path is shield for 5.3
-    int  shiftBufLength; 
-    int  specialWire_mask; 
-    int  step_is_keyword; 
-    int  stylesWarnings; 
-    int  trackWarnings; 
-    int  unitsWarnings; 
-    int  versionWarnings; 
-    int  viaRule; // keep track the viarule has called first
-    int  viaWarnings; 
-    int  virtual_is_keyword; 
-    int  deftokenLength;
-    long long nlines;
-
-    std::vector<char>  History_text; 
-    defAliasMap        def_alias_set; 
-    defDefineMap       def_defines_set;
-
-    char*  specialWire_routeStatus;
-    char*  specialWire_routeStatusName;
-    char*  specialWire_shapeType;
-    double VersionNum;
-    double xStep;
-    double yStep;
-        
-    //defrParser vars.
-    defiPath PathObj;
-    defiProp Prop;
-    defiSite Site;
-    defiComponent Component;
-    defiComponentMaskShiftLayer ComponentMaskShiftLayer;
-    defiNet Net;
-    defiPinCap PinCap;
-    defiSite CannotOccupy;
-    defiSite Canplace;
-    defiBox DieArea;
-    defiPin Pin;
-    defiRow Row;
-    defiTrack Track;
-    defiGcellGrid GcellGrid;
-    defiVia Via;
-    defiRegion Region;
-    defiGroup Group;
-    defiAssertion Assertion;
-    defiScanchain Scanchain;
-    defiIOTiming IOTiming;
-    defiFPC FPC;
-    defiTimingDisable TimingDisable;
-    defiPartition Partition;
-    defiPinProp PinProp;
-    defiBlockage Blockage;
-    defiSlot Slot;
-    defiFill Fill;
-    defiNonDefault NonDefault;
-    defiStyles Styles;
-    defiGeometries Geometries;
-    int doneDesign;      // keep track if the Design is done parsing
-    
-    // Flags to control what happens
-    int NeedPathData;
-
-    defiSubnet* Subnet;
-    int msgLimit[DEF_MSGS];
-    char buffer[IN_BUF_SIZE];
-    char* ring[RING_SIZE];
-    int ringSizes[RING_SIZE];
-    std::string stack[20];  /* the stack itself */
-
-    YYSTYPE yylval;
-    const defrCallbacks *callbacks;
-    const defrSettings  *settings;
-    defrSession         *session;
-    char                lineBuffer[MSG_SIZE];
-
-    FILE* File;
-};
-
-class defrContext {
-public:
-    defrContext(int ownConf = 0);
-
-    defrSettings          *settings;
-    defrCallbacks         *callbacks;
-    defrSession           *session;
-    defrData              *data;
-    int                   ownConfig;
-    const char            *init_call_func;
-};
-
-int 
-defrData::checkErrors()
-{
-    if (errors > 20) {
-        defError(6011, "Too many syntax errors have been reported."); 
-        errors = 0; 
-        return 1; 
-    }
-
-    return 0;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.cpp
deleted file mode 100644
index c525576..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.cpp
+++ /dev/null
@@ -1,2538 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: icftcm $
-//  $Revision: #2 $
-//  $Date: 2017/06/07 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "defrReader.hpp"
-#include "defiProp.hpp"
-#include "defiPropType.hpp"
-#include "defrCallBacks.hpp"
-#include "defiDebug.hpp"
-#include "defiMisc.hpp"
-#include "defrData.hpp"
-#include "defrSettings.hpp"
-
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiUtil.hpp"
-#include "defrCallBacks.hpp"
-
-#define NODEFMSG 4013     // (9012 + 1) - 5000, def msg starts at 5000
-
-# define DEF_INIT def_init(__FUNCTION__)
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern defrContext defContext;
-
-void
-def_init(const char  *func)
-{
-    // Need for debugging config re-owning;
-    if (defContext.ownConfig) {
-        return;
-    }
-
-
-    if (defContext.settings == NULL) {
-        defContext.settings = new defrSettings();
-        defContext.init_call_func = func;
-    }
-
-    if (defContext.callbacks == NULL) {
-        defContext.callbacks = new defrCallbacks();
-        defContext.init_call_func = func;
-    }
-
-    if (defContext.session == NULL) {
-        defContext.session = new defrSession();
-        defContext.init_call_func = func;
-    }
-}
-
-
-int
-defrCountUnused(defrCallbackType_e  e,
-                void                *v,
-                defiUserData        d)
-{
-    DEF_INIT;
-    int i;
-    if (defiDebug(23))
-        printf("Count %d, 0x%p, 0x%p\n", (int) e, v, d);
-    i = (int) e;
-    if (i <= 0 || i >= CBMAX) {
-        return 1;
-    }
-
-    defContext.settings->UnusedCallbacks[i] += 1;
-
-    return 0;
-}
-
-
-const char *
-typeToString(defrCallbackType_e num)
-{
-    switch ((int) num) {
-
-    case defrUnspecifiedCbkType:
-        return "Unspecified";
-    case defrDesignStartCbkType:
-        return "Design Start";
-    case defrTechNameCbkType:
-        return "Tech Name";
-    case defrPropCbkType:
-        return "Property";
-    case defrPropDefEndCbkType:
-        return "Property Definitions Section End";
-    case defrPropDefStartCbkType:
-        return "Property Definitions Section Start";
-    case defrFloorPlanNameCbkType:
-        return "FloorPlanName";
-    case defrArrayNameCbkType:
-        return "Array Name";
-    case defrUnitsCbkType:
-        return "Units";
-    case defrDividerCbkType:
-        return "Divider";
-    case defrBusBitCbkType:
-        return "BusBit Character";
-    case defrSiteCbkType:
-        return "Site";
-    case defrComponentMaskShiftLayerCbkType:
-        return "ComponentMaskShiftLayer";
-    case defrComponentStartCbkType:
-        return "Components Section Start";
-    case defrComponentCbkType:
-        return "Component";
-    case defrComponentEndCbkType:
-        return "Components Section End";
-    case defrNetStartCbkType:
-        return "Nets Section Start";
-    case defrNetCbkType:
-        return "Net";
-    case defrNetNameCbkType:
-        return "Net Name";
-    case defrNetNonDefaultRuleCbkType:
-        return "Net Nondefaultrule";
-    case defrNetSubnetNameCbkType:
-        return "Net Subnet Name";
-    case defrNetEndCbkType:
-        return "Nets Section End";
-    case defrPathCbkType:
-        return "Path";
-    case defrVersionCbkType:
-        return "Version";
-    case defrVersionStrCbkType:
-        return "Version";
-    case defrComponentExtCbkType:
-        return "Component User Extention";
-    case defrPinExtCbkType:
-        return "Pin User Extension";
-    case defrViaExtCbkType:
-        return "Via User Extension";
-    case defrNetConnectionExtCbkType:
-        return "NetConnection User Extention";
-    case defrNetExtCbkType:
-        return "Net User Extension";
-    case defrGroupExtCbkType:
-        return "Group User Extension";
-    case defrScanChainExtCbkType:
-        return "ScanChain User Extension";
-    case defrIoTimingsExtCbkType:
-        return "IoTimings User Extension";
-    case defrPartitionsExtCbkType:
-        return "Partitions User Extension";
-    case defrHistoryCbkType:
-        return "History";
-    case defrDieAreaCbkType:
-        return "DieArea";
-    case defrCanplaceCbkType:
-        return "Canplace";
-    case defrCannotOccupyCbkType:
-        return "CannotOccupy";
-    case defrPinCapCbkType:
-        return "PinCap";
-    case defrDefaultCapCbkType:
-        return "DefaultCap";
-    case defrStartPinsCbkType:
-        return "Start Pins Section";
-    case defrPinCbkType:
-        return "Pin";
-    case defrPinEndCbkType:
-        return "End Pins Section";
-    case defrRowCbkType:
-        return "Row";
-    case defrTrackCbkType:
-        return "Track";
-    case defrGcellGridCbkType:
-        return "GcellGrid";
-    case defrViaStartCbkType:
-        return "Start Vias Section";
-    case defrViaCbkType:
-        return "Via";
-    case defrViaEndCbkType:
-        return "End Vias Section";
-    case defrRegionStartCbkType:
-        return "Region Section Start";
-    case defrRegionCbkType:
-        return "Region";
-    case defrRegionEndCbkType:
-        return "Region Section End";
-    case defrSNetStartCbkType:
-        return "Special Net Section Start";
-    case defrSNetCbkType:
-        return "Special Net";
-    case defrSNetEndCbkType:
-        return "Special Net Section End";
-    case defrGroupsStartCbkType:
-        return "Groups Section Start";
-    case defrGroupNameCbkType:
-        return "Group Name";
-    case defrGroupMemberCbkType:
-        return "Group Member";
-    case defrGroupCbkType:
-        return "Group";
-    case defrGroupsEndCbkType:
-        return "Groups Section End";
-    case defrAssertionsStartCbkType:
-        return "Assertions Section Start";
-    case defrAssertionCbkType:
-        return "Assertion";
-    case defrAssertionsEndCbkType:
-        return "Assertions Section End";
-    case defrConstraintsStartCbkType:
-        return "Constraints Section Start";
-    case defrConstraintCbkType:
-        return "Constraint";
-    case defrConstraintsEndCbkType:
-        return "Constraints Section End";
-    case defrScanchainsStartCbkType:
-        return "Scanchains Section Start";
-    case defrScanchainCbkType:
-        return "Scanchain";
-    case defrScanchainsEndCbkType:
-        return "Scanchains Section End";
-    case defrIOTimingsStartCbkType:
-        return "IOTimings Section Start";
-    case defrIOTimingCbkType:
-        return "IOTiming";
-    case defrIOTimingsEndCbkType:
-        return "IOTimings Section End";
-    case defrFPCStartCbkType:
-        return "Floor Plan Constraints Section Start";
-    case defrFPCCbkType:
-        return "Floor Plan Constraint";
-    case defrFPCEndCbkType:
-        return "Floor Plan Constraints Section End";
-    case defrTimingDisablesStartCbkType:
-        return "TimingDisables Section Start";
-    case defrTimingDisableCbkType:
-        return "TimingDisable";
-    case defrTimingDisablesEndCbkType:
-        return "TimingDisables Section End";
-    case defrPartitionsStartCbkType:
-        return "Partitions Section Start";
-    case defrPartitionCbkType:
-        return "Partition";
-    case defrPartitionsEndCbkType:
-        return "Partitions Section End";
-    case defrPinPropStartCbkType:
-        return "PinProp Section Start";
-    case defrPinPropCbkType:
-        return "PinProp";
-    case defrPinPropEndCbkType:
-        return "PinProp Section End";
-    case defrCaseSensitiveCbkType:
-        return "CaseSensitive";
-    case defrBlockageStartCbkType:
-        return "Blockage Section Start";
-    case defrBlockageCbkType:
-        return "Blockage";
-    case defrBlockageEndCbkType:
-        return "Blockage Section End";
-    case defrSlotStartCbkType:
-        return "Slots Section Start";
-    case defrSlotCbkType:
-        return "Slots";
-    case defrSlotEndCbkType:
-        return "Slots Section End";
-    case defrFillStartCbkType:
-        return "Fills Section Start";
-    case defrFillCbkType:
-        return "Fills";
-    case defrFillEndCbkType:
-        return "Fills Section End";
-    case defrNonDefaultStartCbkType:
-        return "NonDefaultRule Section Start";
-    case defrNonDefaultCbkType:
-        return "NonDefault";
-    case defrNonDefaultEndCbkType:
-        return "NonDefaultRule Section End";
-    case defrStylesStartCbkType:
-        return "Styles Section Start";
-    case defrStylesCbkType:
-        return "Styles";
-    case defrStylesEndCbkType:
-        return "Styles Section End";
-    case defrExtensionCbkType:
-        return "Extension";
-
-        // NEW CALLBACK - If you created a new callback then add the
-        // type enums that you created here for debug printing.     
-
-    case defrDesignEndCbkType:
-        return "DesignEnd";
-    default:
-        break;
-    }
-    return "BOGUS";
-}
-
-int
-defrCatchAll(defrCallbackType_e typ, void*, defiUserData)
-{
-    DEF_INIT;
-
-    if ((int) typ >= 0 && (int) typ < CBMAX) {
-        defContext.settings->UnusedCallbacks[(int) typ] += 1;
-    } else {
-        defContext.settings->UnusedCallbacks[0] += 1;
-        return 1;
-    }
-
-    return 0;
-}
-
-// *****************************************************************
-// Wrapper functions.
-//
-// These functions provide access to the class member functions
-// for compatibility with previous parser kits. Returns non-zero
-// status if the initialization is failed. 
-// *****************************************************************
-int 
-defrInit()
-{
-    return defrInitSession(0);
-}
-
-int
-defrInitSession(int startSession)
-{
-    if (startSession) { 
-        if (defContext.init_call_func != NULL) {
-            fprintf(stderr, "ERROR: Attempt to call configuration function '%s' in DEF parser before defrInit() call in session-based mode.\n", defContext.init_call_func);
-            return 1;
-        }
-
-        delete defContext.settings;
-        defContext.settings = new defrSettings();
-
-        delete defContext.callbacks;
-        defContext.callbacks = new defrCallbacks();
-
-        delete defContext.session;
-        defContext.session = new defrSession();
-    } else {
-        if (defContext.callbacks == NULL) {
-            defContext.callbacks = new defrCallbacks();
-        }
-    
-        if (defContext.settings == NULL) {
-            defContext.settings = new defrSettings();
-        }
-
-        if (defContext.session == NULL) {
-            defContext.session = new defrSession();
-        } else {
-            memset(defContext.settings->UnusedCallbacks, 0, CBMAX * sizeof(int));
-        }
-    }
-
-    defContext.ownConfig = 0;
-    defContext.init_call_func = 0;
-
-    return 0;
-}
-
-// obsoleted now 
-int
-defrReset()
-{
-    return 0;
-}
-
-int 
-defrClear()
-{
-    delete defContext.callbacks;
-    defContext.callbacks = NULL;
-
-    delete defContext.settings;
-    defContext.settings = NULL;
-
-    delete defContext.session;
-    defContext.session = NULL;
-
-    delete defContext.data;
-    defContext.data = NULL;
-
-    defContext.init_call_func = NULL;
-    defContext.ownConfig = 0;
-
-    return 0;
-}
-
-
-void
-defrSetRegisterUnusedCallbacks()
-{
-    DEF_INIT;
-    defrSetUnusedCallbacks(defrCountUnused);
-}
-
-void
-defrSetUnusedCallbacks(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SetUnusedCallbacks(f);
-}
-
-void
-defrUnsetCallbacks()
-{
-    DEF_INIT;
-    delete defContext.callbacks;
-    defContext.callbacks = new defrCallbacks();
-}
-
-void
-defrPrintUnusedCallbacks(FILE *log)
-{
-    int i;
-    int first = 1;
-
-    for (i = 0; i < CBMAX; i++) {
-        if (defContext.settings->UnusedCallbacks[i]) {
-            if (first) {
-                fprintf(log,
-                        "WARNING (DEFPARS-5001): DEF statement found in the def file with no callback set.\n");
-                first = 0;
-            }
-            fprintf(log, "%5d %s\n", defContext.settings->UnusedCallbacks[i],
-                    typeToString((defrCallbackType_e) i));
-        }
-    }
-}
-
-// obsoleted
-int
-defrReleaseNResetMemory()
-{
-    return 0;
-}
-
-void
-defrUnsetArrayNameCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ArrayNameCbk = NULL;
-}
-
-void
-defrUnsetAssertionCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionCbk = NULL;
-}
-
-void
-defrUnsetAssertionsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionsStartCbk = NULL;
-}
-
-void
-defrUnsetAssertionsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionsEndCbk = NULL;
-}
-
-void
-defrUnsetBlockageCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageCbk = NULL;
-}
-
-void
-defrUnsetBlockageStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageStartCbk = NULL;
-}
-
-void
-defrUnsetBlockageEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageEndCbk = NULL;
-}
-
-void
-defrUnsetBusBitCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->BusBitCbk = NULL;
-}
-
-void
-defrUnsetCannotOccupyCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->CannotOccupyCbk = NULL;
-}
-
-void
-defrUnsetCanplaceCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->CanplaceCbk = NULL;
-}
-
-void
-defrUnsetCaseSensitiveCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->CaseSensitiveCbk = NULL;
-}
-
-void
-defrUnsetComponentCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentCbk = NULL;
-}
-
-void
-defrUnsetComponentExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentExtCbk = NULL;
-}
-
-void
-defrUnsetComponentStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentStartCbk = NULL;
-}
-
-void
-defrUnsetComponentEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentEndCbk = NULL;
-}
-
-void
-defrUnsetConstraintCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintCbk = NULL;
-}
-
-void
-defrUnsetConstraintsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintsStartCbk = NULL;
-}
-
-void
-defrUnsetConstraintsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintsEndCbk = NULL;
-}
-
-void
-defrUnsetDefaultCapCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->DefaultCapCbk = NULL;
-}
-
-void
-defrUnsetDesignCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->DesignCbk = NULL;
-}
-
-void
-defrUnsetDesignEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->DesignEndCbk = NULL;
-}
-
-void
-defrUnsetDieAreaCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->DieAreaCbk = NULL;
-}
-
-void
-defrUnsetDividerCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->DividerCbk = NULL;
-}
-
-void
-defrUnsetExtensionCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ExtensionCbk = NULL;
-}
-
-void
-defrUnsetFillCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FillCbk = NULL;
-}
-
-void
-defrUnsetFillStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FillStartCbk = NULL;
-}
-
-void
-defrUnsetFillEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FillEndCbk = NULL;
-}
-
-void
-defrUnsetFPCCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FPCCbk = NULL;
-}
-
-void
-defrUnsetFPCStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FPCStartCbk = NULL;
-}
-
-void
-defrUnsetFPCEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FPCEndCbk = NULL;
-}
-
-void
-defrUnsetFloorPlanNameCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->FloorPlanNameCbk = NULL;
-}
-
-void
-defrUnsetGcellGridCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GcellGridCbk = NULL;
-}
-
-void
-defrUnsetGroupCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupCbk = NULL;
-}
-
-void
-defrUnsetGroupExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupExtCbk = NULL;
-}
-
-void
-defrUnsetGroupMemberCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupMemberCbk = NULL;
-}
-
-void
-defrUnsetComponentMaskShiftLayerCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentMaskShiftLayerCbk = NULL;
-}
-
-void
-defrUnsetGroupNameCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupNameCbk = NULL;
-}
-
-void
-defrUnsetGroupsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupsStartCbk = NULL;
-}
-
-void
-defrUnsetGroupsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->GroupsEndCbk = NULL;
-}
-
-void
-defrUnsetHistoryCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->HistoryCbk = NULL;
-}
-
-void
-defrUnsetIOTimingCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingCbk = NULL;
-}
-
-void
-defrUnsetIOTimingsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingsStartCbk = NULL;
-}
-
-void
-defrUnsetIOTimingsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingsEndCbk = NULL;
-}
-
-void
-defrUnsetIOTimingsExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->IoTimingsExtCbk = NULL;
-}
-
-void
-defrUnsetNetCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetCbk = NULL;
-}
-
-void
-defrUnsetNetNameCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetNameCbk = NULL;
-}
-
-void
-defrUnsetNetNonDefaultRuleCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetNonDefaultRuleCbk = NULL;
-}
-
-void
-defrUnsetNetConnectionExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetConnectionExtCbk = NULL;
-}
-
-void
-defrUnsetNetExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetExtCbk = NULL;
-}
-
-void
-defrUnsetNetPartialPathCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetPartialPathCbk = NULL;
-}
-
-void
-defrUnsetNetSubnetNameCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetSubnetNameCbk = NULL;
-}
-
-void
-defrUnsetNetStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetStartCbk = NULL;
-}
-
-void
-defrUnsetNetEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NetEndCbk = NULL;
-}
-
-void
-defrUnsetNonDefaultCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultCbk = NULL;
-}
-
-void
-defrUnsetNonDefaultStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultStartCbk = NULL;
-}
-
-void
-defrUnsetNonDefaultEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultEndCbk = NULL;
-}
-
-void
-defrUnsetPartitionCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionCbk = NULL;
-}
-
-void
-defrUnsetPartitionsExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsExtCbk = NULL;
-}
-
-void
-defrUnsetPartitionsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsStartCbk = NULL;
-}
-
-void
-defrUnsetPartitionsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsEndCbk = NULL;
-}
-
-void
-defrUnsetPathCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PathCbk = NULL;
-}
-
-void
-defrUnsetPinCapCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinCapCbk = NULL;
-}
-
-void
-defrUnsetPinCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinCbk = NULL;
-}
-
-void
-defrUnsetPinEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinEndCbk = NULL;
-}
-
-void
-defrUnsetPinExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinExtCbk = NULL;
-}
-
-void
-defrUnsetPinPropCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropCbk = NULL;
-}
-
-void
-defrUnsetPinPropStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropStartCbk = NULL;
-}
-
-void
-defrUnsetPinPropEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropEndCbk = NULL;
-}
-
-void
-defrUnsetPropCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PropCbk = NULL;
-}
-
-void
-defrUnsetPropDefEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PropDefEndCbk = NULL;
-}
-
-void
-defrUnsetPropDefStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->PropDefStartCbk = NULL;
-}
-
-void
-defrUnsetRegionCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->RegionCbk = NULL;
-}
-
-void
-defrUnsetRegionStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->RegionStartCbk = NULL;
-}
-
-void
-defrUnsetRegionEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->RegionEndCbk = NULL;
-}
-
-void
-defrUnsetRowCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->RowCbk = NULL;
-}
-
-void
-defrUnsetScanChainExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ScanChainExtCbk = NULL;
-}
-
-void
-defrUnsetScanchainCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainCbk = NULL;
-}
-
-void
-defrUnsetScanchainsStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainsStartCbk = NULL;
-}
-
-void
-defrUnsetScanchainsEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainsEndCbk = NULL;
-}
-
-void
-defrUnsetSiteCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SiteCbk = NULL;
-}
-
-void
-defrUnsetSlotCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SlotCbk = NULL;
-}
-
-void
-defrUnsetSlotStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SlotStartCbk = NULL;
-}
-
-void
-defrUnsetSlotEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SlotEndCbk = NULL;
-}
-
-void
-defrUnsetSNetWireCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SNetWireCbk = NULL;
-}
-
-void
-defrUnsetSNetCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SNetCbk = NULL;
-}
-
-void
-defrUnsetSNetStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SNetStartCbk = NULL;
-}
-
-void
-defrUnsetSNetEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SNetEndCbk = NULL;
-}
-
-void
-defrUnsetSNetPartialPathCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->SNetPartialPathCbk = NULL;
-}
-
-void
-defrUnsetStartPinsCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->StartPinsCbk = NULL;
-}
-
-void
-defrUnsetStylesCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->StylesCbk = NULL;
-}
-
-void
-defrUnsetStylesStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->StylesStartCbk = NULL;
-}
-
-void
-defrUnsetStylesEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->StylesEndCbk = NULL;
-}
-
-void
-defrUnsetTechnologyCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->TechnologyCbk = NULL;
-}
-
-void
-defrUnsetTimingDisableCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisableCbk = NULL;
-}
-
-void
-defrUnsetTimingDisablesStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisablesStartCbk = NULL;
-}
-
-void
-defrUnsetTimingDisablesEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisablesEndCbk = NULL;
-}
-
-void
-defrUnsetTrackCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->TrackCbk = NULL;
-}
-
-void
-defrUnsetUnitsCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->UnitsCbk = NULL;
-}
-
-void
-defrUnsetVersionCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->VersionCbk = NULL;
-}
-
-void
-defrUnsetVersionStrCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->VersionStrCbk = NULL;
-}
-
-void
-defrUnsetViaCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ViaCbk = NULL;
-}
-
-void
-defrUnsetViaExtCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ViaExtCbk = NULL;
-}
-
-void
-defrUnsetViaStartCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ViaStartCbk = NULL;
-}
-
-
-void
-defrUnsetViaEndCbk()
-{
-    DEF_INIT;
-    defContext.callbacks->ViaEndCbk = NULL;
-}
-
-int *
-defUnusedCallbackCount()
-{
-    DEF_INIT;
-    return defContext.settings->UnusedCallbacks;
-}
-
-
-const char *
-defrFName()
-{
-    DEF_INIT;
-    return NULL;
-}
-
-void 
-defrClearSession()
-{
-    if (defContext.session) {
-        delete defContext.session;
-        defContext.session = new defrSession();
-    }
-}
-
-int
-defrRead(FILE           *f,
-         const char     *fName,
-         defiUserData   uData,
-         int            case_sensitive)
-{
-
-    int status;
-
-    delete defContext.data;
-
-    defrData *defData = new defrData(defContext.callbacks, 
-                                     defContext.settings, 
-                                     defContext.session);
-
-    defContext.data = defData;
-
-    // lex_init
-    struct stat statbuf;
-
-    /* 4/11/2003 - Remove file lefrRWarning.log from directory if it exist */
-    /* pcr 569729 */
-    if (stat("defRWarning.log", &statbuf) != -1) {
-        /* file exist, remove it */
-        if (!defContext.settings->LogFileAppend) {
-            remove("defRWarning.log");
-        }
-    }
-
-    // Propagate Settings parameter to Data.
-    if (defData->settings->reader_case_sensitive_set) {
-        defData->names_case_sensitive = defData->session->reader_case_sensitive;
-    } else if (defData->VersionNum > 5.5) {
-        defData->names_case_sensitive = true;
-    }
-
-    defData->session->FileName = (char*) fName;
-    defData->File = f;
-    defData->session->UserData = uData;
-    defData->session->reader_case_sensitive = case_sensitive;
-
-    // Create a path pointer that is all ready to go just in case
-    // we need it later.
-
-    defData->NeedPathData = (
-        ((defData->callbacks->NetCbk || defData->callbacks->SNetCbk) && defData->settings->AddPathToNet) || defData->callbacks->PathCbk) ? 1 : 0;
-    if (defData->NeedPathData) {
-        defData->PathObj.Init();
-    }
-
-    status = defyyparse(defData);
-
-    return status;
-}
-
-void
-defrSetUserData(defiUserData ud)
-{
-    DEF_INIT;
-    defContext.session->UserData = ud;
-}
-
-
-defiUserData
-defrGetUserData()
-{
-    return defContext.session->UserData;
-}
-
-
-void
-defrSetDesignCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->DesignCbk = f;
-}
-
-
-void
-defrSetTechnologyCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->TechnologyCbk = f;
-}
-
-
-void
-defrSetDesignEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->DesignEndCbk = f;
-}
-
-
-void
-defrSetPropCbk(defrPropCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PropCbk = f;
-}
-
-
-void
-defrSetPropDefEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PropDefEndCbk = f;
-}
-
-
-void
-defrSetPropDefStartCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PropDefStartCbk = f;
-}
-
-
-void
-defrSetArrayNameCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ArrayNameCbk = f;
-}
-
-
-void
-defrSetFloorPlanNameCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FloorPlanNameCbk = f;
-}
-
-
-void
-defrSetUnitsCbk(defrDoubleCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->UnitsCbk = f;
-}
-
-
-void
-defrSetVersionCbk(defrDoubleCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->VersionCbk = f;
-}
-
-
-void
-defrSetVersionStrCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->VersionStrCbk = f;
-}
-
-
-void
-defrSetDividerCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->DividerCbk = f;
-}
-
-
-void
-defrSetBusBitCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->BusBitCbk = f;
-}
-
-
-void
-defrSetSiteCbk(defrSiteCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SiteCbk = f;
-}
-
-
-void
-defrSetCanplaceCbk(defrSiteCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->CanplaceCbk = f;
-}
-
-
-void
-defrSetCannotOccupyCbk(defrSiteCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->CannotOccupyCbk = f;
-}
-
-
-void
-defrSetComponentStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentStartCbk = f;
-}
-
-
-void
-defrSetComponentEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentEndCbk = f;
-}
-
-void
-defrSetComponentCbk(defrComponentCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentCbk = f;
-}
-
-void
-defrSetNetStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetStartCbk = f;
-}
-
-void
-defrSetNetEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetEndCbk = f;
-}
-
-void
-defrSetNetCbk(defrNetCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetCbk = f;
-}
-
-void
-defrSetNetNameCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetNameCbk = f;
-}
-
-void
-defrSetNetSubnetNameCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetSubnetNameCbk = f;
-}
-
-void
-defrSetNetNonDefaultRuleCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetNonDefaultRuleCbk = f;
-}
-
-void
-defrSetNetPartialPathCbk(defrNetCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetPartialPathCbk = f;
-}
-
-void
-defrSetSNetStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SNetStartCbk = f;
-}
-
-void
-defrSetSNetEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SNetEndCbk = f;
-}
-
-void
-defrSetSNetCbk(defrNetCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SNetCbk = f;
-}
-
-void
-defrSetSNetPartialPathCbk(defrNetCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SNetPartialPathCbk = f;
-}
-
-void
-defrSetSNetWireCbk(defrNetCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SNetWireCbk = f;
-}
-
-void
-defrSetPathCbk(defrPathCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PathCbk = f;
-}
-
-void
-defrSetAddPathToNet()
-{
-    DEF_INIT;
-    defContext.settings->AddPathToNet = 1;
-}
-
-void
-defrSetAllowComponentNets()
-{
-    DEF_INIT;
-    defContext.settings->AllowComponentNets = 1;
-}
-
-int
-defrGetAllowComponentNets()
-{
-    DEF_INIT;
-    return defContext.settings->AllowComponentNets;
-}
-
-
-void
-defrSetComponentExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentExtCbk = f;
-}
-
-void
-defrSetPinExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinExtCbk = f;
-}
-
-void
-defrSetViaExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ViaExtCbk = f;
-}
-
-void
-defrSetNetConnectionExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetConnectionExtCbk = f;
-}
-
-void
-defrSetNetExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NetExtCbk = f;
-}
-
-void
-defrSetGroupExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupExtCbk = f;
-}
-
-void
-defrSetScanChainExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ScanChainExtCbk = f;
-}
-
-void
-defrSetIoTimingsExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->IoTimingsExtCbk = f;
-}
-
-void
-defrSetPartitionsExtCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsExtCbk = f;
-}
-
-void
-defrSetHistoryCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->HistoryCbk = f;
-}
-
-void
-defrSetDieAreaCbk(defrBoxCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->DieAreaCbk = f;
-}
-
-void
-defrSetPinCapCbk(defrPinCapCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinCapCbk = f;
-}
-
-void
-defrSetPinEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinEndCbk = f;
-}
-
-void
-defrSetStartPinsCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->StartPinsCbk = f;
-}
-
-void
-defrSetDefaultCapCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->DefaultCapCbk = f;
-}
-
-void
-defrSetPinCbk(defrPinCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinCbk = f;
-}
-
-void
-defrSetRowCbk(defrRowCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->RowCbk = f;
-}
-
-void
-defrSetTrackCbk(defrTrackCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->TrackCbk = f;
-}
-
-void
-defrSetGcellGridCbk(defrGcellGridCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GcellGridCbk = f;
-}
-
-void
-defrSetViaStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ViaStartCbk = f;
-}
-
-void
-defrSetViaEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ViaEndCbk = f;
-}
-
-void
-defrSetViaCbk(defrViaCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ViaCbk = f;
-}
-
-void
-defrSetRegionStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->RegionStartCbk = f;
-}
-
-void
-defrSetRegionEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->RegionEndCbk = f;
-}
-
-void
-defrSetRegionCbk(defrRegionCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->RegionCbk = f;
-}
-
-void
-defrSetGroupsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupsStartCbk = f;
-}
-
-void
-defrSetGroupsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupsEndCbk = f;
-}
-
-void
-defrSetGroupNameCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupNameCbk = f;
-}
-
-void
-defrSetGroupMemberCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupMemberCbk = f;
-}
-
-void
-defrSetComponentMaskShiftLayerCbk(defrComponentMaskShiftLayerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ComponentMaskShiftLayerCbk = f;
-}
-
-void
-defrSetGroupCbk(defrGroupCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->GroupCbk = f;
-}
-
-void
-defrSetAssertionsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionsStartCbk = f;
-}
-
-void
-defrSetAssertionsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionsEndCbk = f;
-}
-
-void
-defrSetAssertionCbk(defrAssertionCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->AssertionCbk = f;
-}
-
-void
-defrSetConstraintsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintsStartCbk = f;
-}
-
-void
-defrSetConstraintsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintsEndCbk = f;
-}
-
-void
-defrSetConstraintCbk(defrAssertionCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ConstraintCbk = f;
-}
-
-void
-defrSetScanchainsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainsStartCbk = f;
-}
-
-void
-defrSetScanchainsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainsEndCbk = f;
-}
-
-void
-defrSetScanchainCbk(defrScanchainCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ScanchainCbk = f;
-}
-
-void
-defrSetIOTimingsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingsStartCbk = f;
-}
-
-void
-defrSetIOTimingsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingsEndCbk = f;
-}
-
-void
-defrSetIOTimingCbk(defrIOTimingCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->IOTimingCbk = f;
-}
-
-void
-defrSetFPCStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FPCStartCbk = f;
-}
-
-void
-defrSetFPCEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FPCEndCbk = f;
-}
-
-void
-defrSetFPCCbk(defrFPCCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FPCCbk = f;
-}
-
-void
-defrSetTimingDisablesStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisablesStartCbk = f;
-}
-
-void
-defrSetTimingDisablesEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisablesEndCbk = f;
-}
-
-void
-defrSetTimingDisableCbk(defrTimingDisableCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->TimingDisableCbk = f;
-}
-
-void
-defrSetPartitionsStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsStartCbk = f;
-}
-
-void
-defrSetPartitionsEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionsEndCbk = f;
-}
-
-void
-defrSetPartitionCbk(defrPartitionCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PartitionCbk = f;
-}
-
-void
-defrSetPinPropStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropStartCbk = f;
-}
-
-void
-defrSetPinPropEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropEndCbk = f;
-}
-
-void
-defrSetPinPropCbk(defrPinPropCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->PinPropCbk = f;
-}
-
-void
-defrSetCaseSensitiveCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->CaseSensitiveCbk = f;
-}
-
-void
-defrSetBlockageStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageStartCbk = f;
-}
-
-void
-defrSetBlockageEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageEndCbk = f;
-}
-
-void
-defrSetBlockageCbk(defrBlockageCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->BlockageCbk = f;
-}
-
-void
-defrSetSlotStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SlotStartCbk = f;
-}
-
-void
-defrSetSlotEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SlotEndCbk = f;
-}
-
-void
-defrSetSlotCbk(defrSlotCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->SlotCbk = f;
-}
-
-void
-defrSetFillStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FillStartCbk = f;
-}
-
-void
-defrSetFillEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FillEndCbk = f;
-}
-
-void
-defrSetFillCbk(defrFillCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->FillCbk = f;
-}
-
-void
-defrSetNonDefaultStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultStartCbk = f;
-}
-
-void
-defrSetNonDefaultEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultEndCbk = f;
-}
-
-void
-defrSetNonDefaultCbk(defrNonDefaultCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->NonDefaultCbk = f;
-}
-
-void
-defrSetStylesStartCbk(defrIntegerCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->StylesStartCbk = f;
-}
-
-void
-defrSetStylesEndCbk(defrVoidCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->StylesEndCbk = f;
-}
-
-void
-defrSetStylesCbk(defrStylesCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->StylesCbk = f;
-}
-
-void
-defrSetExtensionCbk(defrStringCbkFnType f)
-{
-    DEF_INIT;
-    defContext.callbacks->ExtensionCbk = f;
-}
-
-// NEW CALLBACK - Put the set functions for the new callbacks here. 
-
-void
-defrSetAssertionWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->AssertionWarnings = warn;
-}
-
-
-void
-defrSetBlockageWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->BlockageWarnings = warn;
-}
-
-
-void
-defrSetCaseSensitiveWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->CaseSensitiveWarnings = warn;
-}
-
-
-void
-defrSetComponentWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->ComponentWarnings = warn;
-}
-
-
-void
-defrSetConstraintWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->ConstraintWarnings = warn;
-}
-
-
-void
-defrSetDefaultCapWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->DefaultCapWarnings = warn;
-}
-
-
-void
-defrSetGcellGridWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->GcellGridWarnings = warn;
-}
-
-
-void
-defrSetIOTimingWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->IOTimingWarnings = warn;
-}
-
-
-void
-defrSetNetWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->NetWarnings = warn;
-}
-
-
-void
-defrSetNonDefaultWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->NonDefaultWarnings = warn;
-}
-
-
-void
-defrSetPinExtWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->PinExtWarnings = warn;
-}
-
-
-void
-defrSetPinWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->PinWarnings = warn;
-}
-
-
-void
-defrSetRegionWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->RegionWarnings = warn;
-}
-
-
-void
-defrSetRowWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->RowWarnings = warn;
-}
-
-
-void
-defrSetScanchainWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->ScanchainWarnings = warn;
-}
-
-
-void
-defrSetSNetWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->SNetWarnings = warn;
-}
-
-
-void
-defrSetStylesWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->StylesWarnings = warn;
-}
-
-
-void
-defrSetTrackWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->TrackWarnings = warn;
-}
-
-
-void
-defrSetUnitsWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->UnitsWarnings = warn;
-}
-
-
-void
-defrSetVersionWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->VersionWarnings = warn;
-}
-
-
-void
-defrSetViaWarnings(int warn)
-{
-    DEF_INIT;
-    defContext.settings->ViaWarnings = warn;
-}
-
-
-void
-defrDisableParserMsgs(int   nMsg,
-                      int   *msgs)
-{
-    DEF_INIT;
-    int i, j;
-    int *tmp;
-
-    if (defContext.settings->nDDMsgs == 0) {
-        defContext.settings->nDDMsgs = nMsg;
-        defContext.settings->disableDMsgs = (int*) malloc(sizeof(int) * nMsg);
-        for (i = 0; i < nMsg; i++)
-            defContext.settings->disableDMsgs[i] = msgs[i];
-    } else {  // add the list to the existing list 
-        // 1st check if the msgId is already on the list before adding it on 
-        tmp = (int*) malloc(sizeof(int) * (nMsg + defContext.settings->nDDMsgs));
-        for (i = 0; i < defContext.settings->nDDMsgs; i++)  // copy the existing to the new list 
-            tmp[i] = defContext.settings->disableDMsgs[i];
-        free((int*) (defContext.settings->disableDMsgs));
-        defContext.settings->disableDMsgs = tmp;           // set disableDMsgs to the new list 
-        for (i = 0; i < nMsg; i++) { // merge the new list with the existing 
-            for (j = 0; j < defContext.settings->nDDMsgs; j++) {
-                if (defContext.settings->disableDMsgs[j] == msgs[i])
-                    break;             // msgId already on the list 
-            }
-            if (j == defContext.settings->nDDMsgs)           // msgId not on the list, add it on 
-                defContext.settings->disableDMsgs[defContext.settings->nDDMsgs++] = msgs[i];
-        }
-    }
-    return;
-}
-
-
-void
-defrEnableParserMsgs(int    nMsg,
-                     int    *msgs)
-{
-    DEF_INIT;
-    int i, j;
-
-    if (defContext.settings->nDDMsgs == 0)
-        return;                       // list is empty, nothing to remove 
-
-    for (i = 0; i < nMsg; i++) {     // loop through the given list 
-        for (j = 0; j < defContext.settings->nDDMsgs; j++) {
-            if (defContext.settings->disableDMsgs[j] == msgs[i]) {
-                defContext.settings->disableDMsgs[j] = -1;    // temp assign a -1 on that slot 
-                break;
-            }
-        }
-    }
-    // fill up the empty slot with the next non -1 msgId 
-    for (i = 0; i < defContext.settings->nDDMsgs; i++) {
-        if (defContext.settings->disableDMsgs[i] == -1) {
-            j = i + 1;
-            while (j < defContext.settings->nDDMsgs) {
-                if (defContext.settings->disableDMsgs[j] != -1)
-                    defContext.settings->disableDMsgs[i++] = defContext.settings->disableDMsgs[j++];
-            }
-            break;     // break out the for loop, the list should all moved 
-        }
-    }
-    // Count how many messageId left and change all -1 to 0 
-    for (j = i; j < defContext.settings->nDDMsgs; j++) {
-        defContext.settings->disableDMsgs[j] = 0;     // set to 0 
-    }
-    defContext.settings->nDDMsgs = i;
-    return;
-}
-
-
-void
-defrEnableAllMsgs()
-{
-    DEF_INIT;
-    defContext.settings->nDDMsgs = 0;
-    free((int*) (defContext.settings->disableDMsgs));
-}
-
-
-void
-defrSetTotalMsgLimit(int totNumMsgs)
-{
-    DEF_INIT;
-    defContext.settings->totalDefMsgLimit = totNumMsgs;
-}
-
-
-void
-defrSetLimitPerMsg(int  msgId,
-                   int  numMsg)
-{
-    DEF_INIT;
-    char msgStr[10];
-
-    if ((msgId <= 0) || ((msgId - 5000) >= NODEFMSG)) {   // Def starts at 5000
-        sprintf(msgStr, "%d", msgId);
-        return;
-    }
-    defContext.settings->MsgLimit[msgId - 5000] = numMsg;
-    return;
-}
-
-
-// *****************************************************************
-// Utility functions
-//
-// These are utility functions. Note: this part still contains some
-// global variables. Ideally they would be part of the main class.
-// *****************************************************************
-
-void
-defrSetMagicCommentFoundFunction(DEFI_MAGIC_COMMENT_FOUND_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->MagicCommentFoundFunction = f;
-}
-
-
-void
-defrSetMagicCommentString(char *s)
-{
-    DEF_INIT;
-
-    free(defContext.data->magic);
-    defContext.data->magic = strdup(s);
-}
-
-void
-defrSetLogFunction(DEFI_LOG_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->ErrorLogFunction = f;
-}
-
-void
-defrSetWarningLogFunction(DEFI_WARNING_LOG_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->WarningLogFunction = f;
-}
-
-void
-defrSetContextLogFunction(DEFI_CONTEXT_LOG_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->ContextErrorLogFunction = f;
-}
-
-void
-defrSetContextWarningLogFunction(DEFI_CONTEXT_WARNING_LOG_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->ContextWarningLogFunction = f;
-}
-
-
-void
-defrSetMallocFunction(DEFI_MALLOC_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->MallocFunction = f;
-}
-
-void
-defrSetReallocFunction(DEFI_REALLOC_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->ReallocFunction = f;
-}
-
-void
-defrSetFreeFunction(DEFI_FREE_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->FreeFunction = f;
-}
-
-void
-defrSetLineNumberFunction(DEFI_LINE_NUMBER_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->LineNumberFunction = f;
-}
-
-void
-defrSetLongLineNumberFunction(DEFI_LONG_LINE_NUMBER_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->LongLineNumberFunction = f;
-}
-
-
-void
-defrSetDeltaNumberLines(int numLines)
-{
-    DEF_INIT;
-    defContext.settings->defiDeltaNumberLines = numLines;
-}
-
-
-void
-defrSetCommentChar(char c)
-{
-    DEF_INIT;
-    defContext.settings->CommentChar = c;
-}
-
-void
-defrSetCaseSensitivity(int caseSense)
-{
-    DEF_INIT;
-
-    defContext.settings->reader_case_sensitive_set = 1;
-    defContext.session->reader_case_sensitive = caseSense;
-    if (defContext.data) {
-        defContext.data->names_case_sensitive = caseSense;
-    }
-}
-
-
-void
-defrAddAlias(const char     *key,
-             const char     *value,
-             int            marked)
-{
-    // Since the alias data is stored in the hash table, the hash table
-    // only takes the key and the data, the marked data will be stored
-    // at the end of the value data
-
-    defrData *defData = defContext.data ;
-
-    char    *k1;
-    char    *v1;
-    int     len = strlen(key) + 1;
-    k1 = (char*) malloc(len);
-    strcpy(k1, key);
-    len = strlen(value) + 1 + 1;   // 1 for the marked
-    v1 = (char*) malloc(len);
-    //strcpy(v1, value);
-    if (marked != 0)
-        marked = 1;                 // make sure only 1 digit
-    sprintf(v1, "%d%s", marked, value);
-
-    defData->def_alias_set[k1] = v1;
-}
-
-void
-defrSetOpenLogFileAppend()
-{
-    DEF_INIT;
-    defContext.settings->LogFileAppend = TRUE;
-}
-
-void
-defrUnsetOpenLogFileAppend()
-{
-    DEF_INIT;
-    defContext.settings->LogFileAppend = FALSE;
-}
-
-
-void
-defrSetReadFunction(DEFI_READ_FUNCTION f)
-{
-    DEF_INIT;
-    defContext.settings->ReadFunction = f;
-}
-
-void
-defrUnsetReadFunction()
-{
-    DEF_INIT;
-    defContext.settings->ReadFunction = 0;
-}
-
-void
-defrDisablePropStrProcess()
-{
-    DEF_INIT;
-    defContext.settings->DisPropStrProcess = 1;
-}
-
-void
-defrSetNLines(long long n)
-{
-    defrData *defData = defContext.data;
-
-    defData->nlines = n;
-}
-
-int defrLineNumber() 
-{    
-    // Compatibility feature: in old versions the translators,  
-    // the function can be called before defData initialization. 
-    if (defContext.data) {
-        return (int)defContext.data->nlines; 
-    }
-
-    return 0;
-}
-
-long long defrLongLineNumber() {
-    // Compatibility feature: in old versions the translators,  
-    // the function can be called before defData initialization. 
-    
-    if (defContext.data) {
-        return defContext.data->nlines; 
-    }
-
-    return (long  long) 0; 
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.hpp
deleted file mode 100644
index bf80b20..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrReader.hpp
+++ /dev/null
@@ -1,723 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DEFRREADER_H
-#define DEFRREADER_H
-
-#include <stdarg.h>
-
-#include "defiKRDefs.hpp"
-#include "defiDefs.hpp"
-#include "defiUser.hpp"
-
-#define DEF_MSGS 4013
-#define CBMAX 150    // Number of callbacks.
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// An enum describing all of the types of reader callbacks.
-typedef enum {
-  defrUnspecifiedCbkType = 0,
-  defrDesignStartCbkType,
-  defrTechNameCbkType,
-  defrPropCbkType,
-  defrPropDefEndCbkType,
-  defrPropDefStartCbkType,
-  defrFloorPlanNameCbkType,
-  defrArrayNameCbkType,
-  defrUnitsCbkType,
-  defrDividerCbkType,
-  defrBusBitCbkType,
-  defrSiteCbkType,
-  defrComponentStartCbkType,
-  defrComponentCbkType,
-  defrComponentEndCbkType,
-  defrNetStartCbkType,
-  defrNetCbkType,
-  defrNetNameCbkType,
-  defrNetNonDefaultRuleCbkType,
-  defrNetSubnetNameCbkType,
-  defrNetEndCbkType,
-  defrPathCbkType,
-  defrVersionCbkType,
-  defrVersionStrCbkType,
-  defrComponentExtCbkType,
-  defrPinExtCbkType,
-  defrViaExtCbkType,
-  defrNetConnectionExtCbkType,
-  defrNetExtCbkType,
-  defrGroupExtCbkType,
-  defrScanChainExtCbkType,
-  defrIoTimingsExtCbkType,
-  defrPartitionsExtCbkType,
-  defrHistoryCbkType,
-  defrDieAreaCbkType,
-  defrCanplaceCbkType,
-  defrCannotOccupyCbkType,
-  defrPinCapCbkType,
-  defrDefaultCapCbkType,
-  defrStartPinsCbkType,
-  defrPinCbkType,
-  defrPinEndCbkType,
-  defrRowCbkType,
-  defrTrackCbkType,
-  defrGcellGridCbkType,
-  defrViaStartCbkType,
-  defrViaCbkType,
-  defrViaEndCbkType,
-  defrRegionStartCbkType,
-  defrRegionCbkType,
-  defrRegionEndCbkType,
-  defrSNetStartCbkType,
-  defrSNetCbkType,
-  defrSNetPartialPathCbkType,
-  defrSNetWireCbkType,
-  defrSNetEndCbkType,
-  defrGroupsStartCbkType,
-  defrGroupNameCbkType,
-  defrGroupMemberCbkType,
-  defrGroupCbkType,
-  defrGroupsEndCbkType,
-  defrAssertionsStartCbkType,
-  defrAssertionCbkType,
-  defrAssertionsEndCbkType,
-  defrConstraintsStartCbkType,
-  defrConstraintCbkType,
-  defrConstraintsEndCbkType,
-  defrScanchainsStartCbkType,
-  defrScanchainCbkType,
-  defrScanchainsEndCbkType,
-  defrIOTimingsStartCbkType,
-  defrIOTimingCbkType,
-  defrIOTimingsEndCbkType,
-  defrFPCStartCbkType,
-  defrFPCCbkType,
-  defrFPCEndCbkType,
-  defrTimingDisablesStartCbkType,
-  defrTimingDisableCbkType,
-  defrTimingDisablesEndCbkType,
-  defrPartitionsStartCbkType,
-  defrPartitionCbkType,
-  defrPartitionsEndCbkType,
-  defrPinPropStartCbkType,
-  defrPinPropCbkType,
-  defrPinPropEndCbkType,
-  defrBlockageStartCbkType,
-  defrBlockageCbkType,
-  defrBlockageEndCbkType,
-  defrSlotStartCbkType,
-  defrSlotCbkType,
-  defrSlotEndCbkType,
-  defrFillStartCbkType,
-  defrFillCbkType,
-  defrFillEndCbkType,
-  defrCaseSensitiveCbkType,
-  defrNonDefaultStartCbkType,
-  defrNonDefaultCbkType,
-  defrNonDefaultEndCbkType,
-  defrStylesStartCbkType,
-  defrStylesCbkType,
-  defrStylesEndCbkType,
-  defrExtensionCbkType,
-
-  // NEW CALLBACK - If you are creating a new callback, you must add
-  // a unique item to this enum for each callback routine. When the
-  // callback is called in def.y you have to supply this enum item
-  // as an argument in the call.
-
-  defrComponentMaskShiftLayerCbkType,
-  defrDesignEndCbkType
-} defrCallbackType_e;
- 
- 
-// Declarations of function signatures for each type of callback.
-// These declarations are type-safe when compiling with ANSI C
-// or C++; you will only be able to register a function pointer
-// with the correct signature for a given type of callback.
-//
-// Each callback function is expected to return 0 if successful.
-// A non-zero return code will cause the reader to abort.
-//
-// The defrDesignStart and defrDesignEnd callback is only called once.
-// Other callbacks may be called multiple times, each time with a different
-// set of data.
-//
-// For each callback, the Def API will make the callback to the
-// function supplied by the client, which should either make a copy
-// of the Def object, or store the data in the client's own data structures.
-// The Def API will delete or reuse each object after making the callback,
-// so the client should not keep a pointer to it.
-//
-// All callbacks pass the user data pointer provided in defrRead()
-// or defrSetUserData() back to the client; this can be used by the
-// client to obtain access to the rest of the client's data structures.
-//
-// The user data pointer is obtained using defrGetUserData() immediately
-// prior to making each callback, so the client is free to change the
-// user data on the fly if necessary.
-//
-// Callbacks with the same signature are passed a callback type
-// parameter, which allows an application to write a single callback
-// function, register that function for multiple callbacks, then
-// switch based on the callback type to handle the appropriate type of
-// data.
- 
-
-// A declaration of the signature of all callbacks that return nothing.     
-typedef int (*defrVoidCbkFnType) (defrCallbackType_e, void* v, defiUserData);
-
-// A declaration of the signature of all callbacks that return a string.     
-typedef int (*defrStringCbkFnType) (defrCallbackType_e, const char *string, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a integer.     
-typedef int (*defrIntegerCbkFnType) (defrCallbackType_e, int number, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a double.     
-typedef int (*defrDoubleCbkFnType) (defrCallbackType_e, double number, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defiProp.     
-typedef int (*defrPropCbkFnType) (defrCallbackType_e, defiProp *prop, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defiSite.     
-typedef int (*defrSiteCbkFnType) (defrCallbackType_e, defiSite *site, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defComponent.     
-typedef int (*defrComponentCbkFnType) (defrCallbackType_e, defiComponent *comp, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defComponentMaskShiftLayer.     
-typedef int (*defrComponentMaskShiftLayerCbkFnType) (defrCallbackType_e, defiComponentMaskShiftLayer *comp, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defNet.     
-typedef int (*defrNetCbkFnType) (defrCallbackType_e, defiNet *net, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defPath.     
-typedef int (*defrPathCbkFnType) (defrCallbackType_e, defiPath *path, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defiBox.     
-typedef int (*defrBoxCbkFnType) (defrCallbackType_e, defiBox *box, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiPinCap.     
-typedef int (*defrPinCapCbkFnType) (defrCallbackType_e, defiPinCap *pincap, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiPin.     
-typedef int (*defrPinCbkFnType) (defrCallbackType_e, defiPin *pin, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiRow.     
-typedef int (*defrRowCbkFnType) (defrCallbackType_e, defiRow *row, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiTrack.     
-typedef int (*defrTrackCbkFnType) (defrCallbackType_e, defiTrack *track, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiGcellGrid.     
-typedef int (*defrGcellGridCbkFnType) (defrCallbackType_e, defiGcellGrid *grid, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiVia.     
-typedef int (*defrViaCbkFnType) (defrCallbackType_e, defiVia *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiRegion.     
-typedef int (*defrRegionCbkFnType) (defrCallbackType_e, defiRegion *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiGroup.     
-typedef int (*defrGroupCbkFnType) (defrCallbackType_e, defiGroup *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiAssertion. 
-typedef int (*defrAssertionCbkFnType) (defrCallbackType_e, defiAssertion *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiScanChain. 
-typedef int (*defrScanchainCbkFnType) (defrCallbackType_e, defiScanchain *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiIOTiming. 
-typedef int (*defrIOTimingCbkFnType) (defrCallbackType_e, defiIOTiming *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiFPC. 
-typedef int (*defrFPCCbkFnType) (defrCallbackType_e, defiFPC *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiTimingDisable. 
-typedef int (*defrTimingDisableCbkFnType) (defrCallbackType_e, defiTimingDisable *, defiUserData);
- 
-
-// A declaration of the signature of all callbacks that return a defiPartition. 
-typedef int (*defrPartitionCbkFnType) (defrCallbackType_e, defiPartition *, defiUserData);
- 
-// A declaration of the signature of all callbacks that return a defiPinProp. 
-typedef int (*defrPinPropCbkFnType) (defrCallbackType_e, defiPinProp *, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defiBlockage. 
-typedef int (*defrBlockageCbkFnType) (defrCallbackType_e, defiBlockage *, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defiSlot. 
-typedef int (*defrSlotCbkFnType) (defrCallbackType_e, defiSlot *, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defiFill. 
-typedef int (*defrFillCbkFnType) (defrCallbackType_e, defiFill *, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defiNonDefault.
-typedef int (*defrNonDefaultCbkFnType) (defrCallbackType_e, defiNonDefault *, defiUserData);
-
-// A declaration of the signature of all callbacks that return a defiStyles. 
-typedef int (*defrStylesCbkFnType) (defrCallbackType_e, defiStyles *, defiUserData);
-
-// NEW CALLBACK - Each callback must return user data, enum, and
-//   OUR-DATA item.  We must define a callback function type for
-//   each type of OUR-DATA.  Some routines return a string, some
-//   return an integer, and some return a pointer to a class.
-//   If you create a new class, then you must create a new function
-//   type here to return that class to the user. 
-
-// The reader initialization.  Must be called before defrRead().
-extern int defrInit ();
-extern int defrInitSession (int startSession = 1);
-
-// obsoleted now.
-extern int defrReset ();
-
-//Sets all parser memory into init state.
-extern int defrClear();
-
-// Change the comment character in the DEF file.  The default
-// is '#' 
-extern void defrSetCommentChar (char c);
-
-// Functions to call to set specific actions in the parser.
-extern void defrSetAddPathToNet ();
-extern void defrSetAllowComponentNets ();
-extern int defrGetAllowComponentNets ();
-extern void defrSetCaseSensitivity (int caseSense);
-
-// Functions to keep track of callbacks that the user did not
-// supply.  Normally all parts of the DEF file that the user
-// does not supply a callback for will be ignored.  These
-// routines tell the parser count the DEF constructs that are
-// present in the input file, but did not trigger a callback.
-// This should help you find any "important" DEF constructs that
-// you are ignoring.
-extern void defrSetRegisterUnusedCallbacks ();
-extern void defrPrintUnusedCallbacks (FILE* log);
-// Obsoleted now.
-extern int  defrReleaseNResetMemory ();
-
-// This function clear session data.
-extern void defrClearSession();
-
-// The main reader function.
-// The file should already be opened.  This requirement allows
-// the reader to be used with stdin or a pipe.  The file name
-// is only used for error messages.
-extern int defrRead (FILE *file,
-                    const char *fileName,
-                    defiUserData userData,
-                    int case_sensitive);
-
-// Set/get the client-provided user data.  defi doesn't look at
-// this data at all, it simply passes the opaque defiUserData pointer
-// back to the application with each callback.  The client can
-// change the data at any time, and it will take effect on the
-// next callback.  The defi reader and writer maintain separate
-// user data pointers.
-extern void defrSetUserData (defiUserData);
-extern defiUserData defrGetUserData ();
-
- 
-// Functions to call to register a callback function or get the function
-//pointer after it has been registered.
-//
-
-// Register one function for all callbacks with the same signature 
-extern void defrSetArrayNameCbk (defrStringCbkFnType);
-extern void defrSetAssertionCbk (defrAssertionCbkFnType);
-extern void defrSetAssertionsStartCbk (defrIntegerCbkFnType);
-extern void defrSetAssertionsEndCbk (defrVoidCbkFnType);
-extern void defrSetBlockageCbk (defrBlockageCbkFnType);
-extern void defrSetBlockageStartCbk (defrIntegerCbkFnType);
-extern void defrSetBlockageEndCbk (defrVoidCbkFnType);
-extern void defrSetBusBitCbk (defrStringCbkFnType);
-extern void defrSetCannotOccupyCbk (defrSiteCbkFnType);
-extern void defrSetCanplaceCbk (defrSiteCbkFnType);
-extern void defrSetCaseSensitiveCbk (defrIntegerCbkFnType);
-extern void defrSetComponentCbk (defrComponentCbkFnType);
-extern void defrSetComponentExtCbk (defrStringCbkFnType);
-extern void defrSetComponentStartCbk (defrIntegerCbkFnType);
-extern void defrSetComponentEndCbk (defrVoidCbkFnType);
-extern void defrSetConstraintCbk (defrAssertionCbkFnType);
-extern void defrSetConstraintsStartCbk (defrIntegerCbkFnType);
-extern void defrSetConstraintsEndCbk (defrVoidCbkFnType);
-extern void defrSetDefaultCapCbk (defrIntegerCbkFnType);
-extern void defrSetDesignCbk (defrStringCbkFnType);
-extern void defrSetDesignEndCbk (defrVoidCbkFnType);
-extern void defrSetDieAreaCbk (defrBoxCbkFnType);
-extern void defrSetDividerCbk (defrStringCbkFnType);
-extern void defrSetExtensionCbk (defrStringCbkFnType);
-extern void defrSetFillCbk (defrFillCbkFnType);
-extern void defrSetFillStartCbk (defrIntegerCbkFnType);
-extern void defrSetFillEndCbk (defrVoidCbkFnType);
-extern void defrSetFPCCbk (defrFPCCbkFnType);
-extern void defrSetFPCStartCbk (defrIntegerCbkFnType);
-extern void defrSetFPCEndCbk (defrVoidCbkFnType);
-extern void defrSetFloorPlanNameCbk (defrStringCbkFnType);
-extern void defrSetGcellGridCbk (defrGcellGridCbkFnType);
-extern void defrSetGroupNameCbk (defrStringCbkFnType);
-extern void defrSetGroupMemberCbk (defrStringCbkFnType);
-extern void defrSetComponentMaskShiftLayerCbk (defrComponentMaskShiftLayerCbkFnType);
-extern void defrSetGroupCbk (defrGroupCbkFnType);
-extern void defrSetGroupExtCbk (defrStringCbkFnType);
-extern void defrSetGroupsStartCbk (defrIntegerCbkFnType);
-extern void defrSetGroupsEndCbk (defrVoidCbkFnType);
-extern void defrSetHistoryCbk (defrStringCbkFnType);
-extern void defrSetIOTimingCbk (defrIOTimingCbkFnType);
-extern void defrSetIOTimingsStartCbk (defrIntegerCbkFnType);
-extern void defrSetIOTimingsEndCbk (defrVoidCbkFnType);
-extern void defrSetIoTimingsExtCbk (defrStringCbkFnType);
-extern void defrSetNetCbk (defrNetCbkFnType);
-extern void defrSetNetNameCbk (defrStringCbkFnType);
-extern void defrSetNetNonDefaultRuleCbk (defrStringCbkFnType);
-extern void defrSetNetConnectionExtCbk (defrStringCbkFnType);
-extern void defrSetNetExtCbk (defrStringCbkFnType);
-extern void defrSetNetPartialPathCbk (defrNetCbkFnType);
-extern void defrSetNetSubnetNameCbk (defrStringCbkFnType);
-extern void defrSetNetStartCbk (defrIntegerCbkFnType);
-extern void defrSetNetEndCbk (defrVoidCbkFnType);
-extern void defrSetNonDefaultCbk (defrNonDefaultCbkFnType);
-extern void defrSetNonDefaultStartCbk (defrIntegerCbkFnType);
-extern void defrSetNonDefaultEndCbk (defrVoidCbkFnType);
-extern void defrSetPartitionCbk (defrPartitionCbkFnType);
-extern void defrSetPartitionsExtCbk (defrStringCbkFnType);
-extern void defrSetPartitionsStartCbk (defrIntegerCbkFnType);
-extern void defrSetPartitionsEndCbk (defrVoidCbkFnType);
-extern void defrSetPathCbk (defrPathCbkFnType);
-extern void defrSetPinCapCbk (defrPinCapCbkFnType);
-extern void defrSetPinCbk (defrPinCbkFnType);
-extern void defrSetPinExtCbk (defrStringCbkFnType);
-extern void defrSetPinPropCbk (defrPinPropCbkFnType);
-extern void defrSetPinPropStartCbk (defrIntegerCbkFnType);
-extern void defrSetPinPropEndCbk (defrVoidCbkFnType);
-extern void defrSetPropCbk (defrPropCbkFnType);
-extern void defrSetPropDefEndCbk (defrVoidCbkFnType);
-extern void defrSetPropDefStartCbk (defrVoidCbkFnType);
-extern void defrSetRegionCbk (defrRegionCbkFnType);
-extern void defrSetRegionStartCbk (defrIntegerCbkFnType);
-extern void defrSetRegionEndCbk (defrVoidCbkFnType);
-extern void defrSetRowCbk (defrRowCbkFnType);
-extern void defrSetSNetCbk (defrNetCbkFnType);
-extern void defrSetSNetStartCbk (defrIntegerCbkFnType);
-extern void defrSetSNetEndCbk (defrVoidCbkFnType);
-extern void defrSetSNetPartialPathCbk (defrNetCbkFnType);
-extern void defrSetSNetWireCbk (defrNetCbkFnType);
-extern void defrSetScanChainExtCbk (defrStringCbkFnType);
-extern void defrSetScanchainCbk (defrScanchainCbkFnType);
-extern void defrSetScanchainsStartCbk (defrIntegerCbkFnType);
-extern void defrSetScanchainsEndCbk (defrVoidCbkFnType);
-extern void defrSetSiteCbk (defrSiteCbkFnType);
-extern void defrSetSlotCbk (defrSlotCbkFnType);
-extern void defrSetSlotStartCbk (defrIntegerCbkFnType);
-extern void defrSetSlotEndCbk (defrVoidCbkFnType);
-extern void defrSetStartPinsCbk (defrIntegerCbkFnType);
-extern void defrSetStylesCbk (defrStylesCbkFnType);
-extern void defrSetStylesStartCbk (defrIntegerCbkFnType);
-extern void defrSetStylesEndCbk (defrVoidCbkFnType);
-extern void defrSetPinEndCbk (defrVoidCbkFnType);
-extern void defrSetTechnologyCbk (defrStringCbkFnType);
-extern void defrSetTimingDisableCbk (defrTimingDisableCbkFnType);
-extern void defrSetTimingDisablesStartCbk (defrIntegerCbkFnType);
-extern void defrSetTimingDisablesEndCbk (defrVoidCbkFnType);
-extern void defrSetTrackCbk (defrTrackCbkFnType);
-extern void defrSetUnitsCbk (defrDoubleCbkFnType);
-extern void defrSetVersionCbk (defrDoubleCbkFnType);
-extern void defrSetVersionStrCbk (defrStringCbkFnType);
-extern void defrSetViaCbk (defrViaCbkFnType);
-extern void defrSetViaExtCbk (defrStringCbkFnType);
-extern void defrSetViaStartCbk (defrIntegerCbkFnType);
-extern void defrSetViaEndCbk (defrVoidCbkFnType);
-
-// NEW CALLBACK - For each new callback you create, you must
-// create a routine that allows the user to set it.  Add the
-// setting routines here. 
-
-//Set all of the callbacks that have not yet been set to the following
-//function.  This is especially useful if you want to check to see
-//if you forgot anything.
-extern void defrUnsetCallbacks ();
-
-// Functions to call to unregister a callback function.
-extern void defrUnsetArrayNameCbk ();
-extern void defrUnsetAssertionCbk ();
-extern void defrUnsetAssertionsStartCbk ();
-extern void defrUnsetAssertionsEndCbk ();
-extern void defrUnsetBlockageCbk ();
-extern void defrUnsetBlockageStartCbk ();
-extern void defrUnsetBlockageEndCbk ();
-extern void defrUnsetBusBitCbk ();
-extern void defrUnsetCannotOccupyCbk ();
-extern void defrUnsetCanplaceCbk ();
-extern void defrUnsetCaseSensitiveCbk ();
-extern void defrUnsetComponentCbk ();
-extern void defrUnsetComponentExtCbk ();
-extern void defrUnsetComponentStartCbk ();
-extern void defrUnsetComponentEndCbk ();
-extern void defrUnsetConstraintCbk ();
-extern void defrUnsetConstraintsStartCbk ();
-extern void defrUnsetConstraintsEndCbk ();
-extern void defrUnsetDefaultCapCbk ();
-extern void defrUnsetDesignCbk ();
-extern void defrUnsetDesignEndCbk ();
-extern void defrUnsetDieAreaCbk ();
-extern void defrUnsetDividerCbk ();
-extern void defrUnsetExtensionCbk ();
-extern void defrUnsetFillCbk ();
-extern void defrUnsetFillStartCbk ();
-extern void defrUnsetFillEndCbk ();
-extern void defrUnsetFPCCbk ();
-extern void defrUnsetFPCStartCbk ();
-extern void defrUnsetFPCEndCbk ();
-extern void defrUnsetFloorPlanNameCbk ();
-extern void defrUnsetGcellGridCbk ();
-extern void defrUnsetGroupCbk ();
-extern void defrUnsetGroupExtCbk ();
-extern void defrUnsetGroupMemberCbk ();
-extern void defrUnsetComponentMaskShiftLayerCbk ();
-extern void defrUnsetGroupNameCbk ();
-extern void defrUnsetGroupsStartCbk ();
-extern void defrUnsetGroupsEndCbk ();
-extern void defrUnsetHistoryCbk ();
-extern void defrUnsetIOTimingCbk ();
-extern void defrUnsetIOTimingsStartCbk ();
-extern void defrUnsetIOTimingsEndCbk ();
-extern void defrUnsetIOTimingsExtCbk ();
-extern void defrUnsetNetCbk ();
-extern void defrUnsetNetNameCbk ();
-extern void defrUnsetNetNonDefaultRuleCbk ();
-extern void defrUnsetNetConnectionExtCbk ();
-extern void defrUnsetNetExtCbk ();
-extern void defrUnsetNetPartialPathCbk ();
-extern void defrUnsetNetSubnetNameCbk ();
-extern void defrUnsetNetStartCbk ();
-extern void defrUnsetNetEndCbk ();
-extern void defrUnsetNonDefaultCbk ();
-extern void defrUnsetNonDefaultStartCbk ();
-extern void defrUnsetNonDefaultEndCbk ();
-extern void defrUnsetPartitionCbk ();
-extern void defrUnsetPartitionsExtCbk ();
-extern void defrUnsetPartitionsStartCbk ();
-extern void defrUnsetPartitionsEndCbk ();
-extern void defrUnsetPathCbk ();
-extern void defrUnsetPinCapCbk ();
-extern void defrUnsetPinCbk ();
-extern void defrUnsetPinEndCbk ();
-extern void defrUnsetPinExtCbk ();
-extern void defrUnsetPinPropCbk ();
-extern void defrUnsetPinPropStartCbk ();
-extern void defrUnsetPinPropEndCbk ();
-extern void defrUnsetPropCbk ();
-extern void defrUnsetPropDefEndCbk ();
-extern void defrUnsetPropDefStartCbk ();
-extern void defrUnsetRegionCbk ();
-extern void defrUnsetRegionStartCbk ();
-extern void defrUnsetRegionEndCbk ();
-extern void defrUnsetRowCbk ();
-extern void defrUnsetScanChainExtCbk ();
-extern void defrUnsetScanchainCbk ();
-extern void defrUnsetScanchainsStartCbk ();
-extern void defrUnsetScanchainsEndCbk ();
-extern void defrUnsetSiteCbk ();
-extern void defrUnsetSlotCbk ();
-extern void defrUnsetSlotStartCbk ();
-extern void defrUnsetSlotEndCbk ();
-extern void defrUnsetSNetWireCbk ();
-extern void defrUnsetSNetCbk ();
-extern void defrUnsetSNetStartCbk ();
-extern void defrUnsetSNetEndCbk ();
-extern void defrUnsetSNetPartialPathCbk ();
-extern void defrUnsetStartPinsCbk ();
-extern void defrUnsetStylesCbk ();
-extern void defrUnsetStylesStartCbk ();
-extern void defrUnsetStylesEndCbk ();
-extern void defrUnsetTechnologyCbk ();
-extern void defrUnsetTimingDisableCbk ();
-extern void defrUnsetTimingDisablesStartCbk ();
-extern void defrUnsetTimingDisablesEndCbk ();
-extern void defrUnsetTrackCbk ();
-extern void defrUnsetUnitsCbk ();
-extern void defrUnsetVersionCbk ();
-extern void defrUnsetVersionStrCbk ();
-extern void defrUnsetViaCbk ();
-extern void defrUnsetViaExtCbk ();
-extern void defrUnsetViaStartCbk ();
-extern void defrUnsetViaEndCbk ();
-
-// Routine to set all unused callbacks. This is useful for checking
-//to see if you missed something. 
-extern void defrSetUnusedCallbacks (defrVoidCbkFnType func);
-
-// Return the current line number in the input file. 
-extern int defrLineNumber ();
-extern long long defrLongLineNumber ();
-
-// Routine to set the message logging routine for errors 
-#ifndef DEFI_LOG_FUNCTION
-    typedef void (*DEFI_LOG_FUNCTION) (const char*);
-#endif
-extern void defrSetLogFunction(DEFI_LOG_FUNCTION);
-
-// Routine to set the message logging routine for warnings 
-#ifndef DEFI_WARNING_LOG_FUNCTION
-    typedef void (*DEFI_WARNING_LOG_FUNCTION) (const char*);
-#endif
-extern void defrSetWarningLogFunction(DEFI_WARNING_LOG_FUNCTION);
-
-// Routine to set the message logging routine for errors 
-// Used in re-enterable environment.
-#ifndef DEFI_LOG_FUNCTION
-    typedef void (*DEFI_CONTEXT_LOG_FUNCTION) (defiUserData userData, const char*);
-#endif
-extern void defrSetContextLogFunction(DEFI_CONTEXT_LOG_FUNCTION);
-
-// Routine to set the message logging routine for warnings 
-// Used in re-enterable environment.
-#ifndef DEFI_WARNING_LOG_FUNCTION
-    typedef void (*DEFI_CONTEXT_WARNING_LOG_FUNCTION) (defiUserData userData, const char*);
-#endif
-extern void defrSetContextWarningLogFunction(DEFI_CONTEXT_WARNING_LOG_FUNCTION);
-
-// Routine to set the user defined malloc routine 
-typedef void* (*DEFI_MALLOC_FUNCTION) (size_t);
-extern void defrSetMallocFunction(DEFI_MALLOC_FUNCTION);
-
-// Routine to set the user defined realloc routine 
-typedef void* (*DEFI_REALLOC_FUNCTION) (void*, size_t);
-extern void defrSetReallocFunction(DEFI_REALLOC_FUNCTION);
-
-// Routine to set the user defined free routine 
-typedef void (*DEFI_FREE_FUNCTION) (void *);
-extern void defrSetFreeFunction(DEFI_FREE_FUNCTION);
-
-// Routine to set the line number of the file that is parsing routine (takes int)
-typedef void (*DEFI_LINE_NUMBER_FUNCTION)  (int);
-extern void defrSetLineNumberFunction(DEFI_LINE_NUMBER_FUNCTION);
-
-// Routine to set the line number of the file that is parsing routine (takes long long)
-typedef void (*DEFI_LONG_LINE_NUMBER_FUNCTION)  (long long);
-extern void defrSetLongLineNumberFunction(DEFI_LONG_LINE_NUMBER_FUNCTION);
-
-// Routine to set the line number of the file that is parsing routine (takes int)
-// Used in re-enterable environment.
-typedef void (*DEFI_CONTEXT_LINE_NUMBER_FUNCTION)  (defiUserData userData, int);
-extern void defrSetContextLineNumberFunction(DEFI_CONTEXT_LINE_NUMBER_FUNCTION);
-
-// Routine to set the line number of the file that is parsing routine (takes long long
-// Used in re-enterable environment.
-typedef void (*DEFI_CONTEXT_LONG_LINE_NUMBER_FUNCTION)  (defiUserData userData, long long);
-extern void defrSetContextLongLineNumberFunction(DEFI_CONTEXT_LONG_LINE_NUMBER_FUNCTION);
-
-// Set the number of lines before calling the line function callback routine 
-// Default is 10000 
-extern void defrSetDeltaNumberLines  (int);
-
-// Routine to set the read function 
-typedef size_t (*DEFI_READ_FUNCTION)  (FILE*, char*, size_t);
-extern void defrSetReadFunction(DEFI_READ_FUNCTION);
-extern void defrUnsetReadFunction ();
-
-// Routine to set the defrWarning.log to open as append instead for write 
-// New in 5.7 
-extern void defrSetOpenLogFileAppend ();
-extern void defrUnsetOpenLogFileAppend ();
-
-// Routine to set the magic comment found routine 
-typedef void (*DEFI_MAGIC_COMMENT_FOUND_FUNCTION) ();
-extern void defrSetMagicCommentFoundFunction(DEFI_MAGIC_COMMENT_FOUND_FUNCTION);
-
-// Routine to set the magic comment string 
-extern void defrSetMagicCommentString(char *);
-
-// Routine to disable string property value process, default it will process 
-// the value string 
-extern void defrDisablePropStrProcess ();
-
-// Testing purposes only 
-extern void defrSetNLines(long long n);
-
-// Routine to set the max number of warnings for a perticular section 
-
-extern void defrSetAssertionWarnings(int warn);
-extern void defrSetBlockageWarnings(int warn);
-extern void defrSetCaseSensitiveWarnings(int warn);
-extern void defrSetComponentWarnings(int warn);
-extern void defrSetConstraintWarnings(int warn);
-extern void defrSetDefaultCapWarnings(int warn);
-extern void defrSetGcellGridWarnings(int warn);
-extern void defrSetIOTimingWarnings(int warn);
-extern void defrSetNetWarnings(int warn);
-extern void defrSetNonDefaultWarnings(int warn);
-extern void defrSetPinExtWarnings(int warn);
-extern void defrSetPinWarnings(int warn);
-extern void defrSetRegionWarnings(int warn);
-extern void defrSetRowWarnings(int warn);
-extern void defrSetScanchainWarnings(int warn);
-extern void defrSetSNetWarnings(int warn);
-extern void defrSetStylesWarnings(int warn);
-extern void defrSetTrackWarnings(int warn);
-extern void defrSetUnitsWarnings(int warn);
-extern void defrSetVersionWarnings(int warn);
-extern void defrSetViaWarnings(int warn);
-
-// Handling output messages 
-extern void defrDisableParserMsgs(int nMsg, int* msgs);
-extern void defrEnableParserMsgs(int nMsg, int* msgs);
-extern void defrEnableAllMsgs();
-extern void defrSetTotalMsgLimit(int totNumMsgs);
-extern void defrSetLimitPerMsg(int msgId, int numMsg);
-
-// Return codes for the user callbacks.
-//The user should return one of these values. 
-#define PARSE_OK 0      // continue parsing 
-#define STOP_PARSE 1    // stop parsing with no error message 
-#define PARSE_ERROR 2   // stop parsing, print an error message 
-
-// Add this alias to the list for the parser     
-extern void defrAddAlias (const char* key, 
-                          const char* value,
-                          int marked);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.cpp
deleted file mode 100644
index 656891b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #6 $
-//  $Date: 2013/08/09 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-#include "defrSettings.hpp"
-#include "def.tab.h"
-
-using namespace std;
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-defrSettings *defSettings = NULL;
-
-defrSettings::defrSettings()
-: defiDeltaNumberLines(10000),
-  AssertionWarnings(999),
-  BlockageWarnings(999),
-  CaseSensitiveWarnings(999),
-  ComponentWarnings(999),
-  ConstraintWarnings(999),
-  DefaultCapWarnings(999),
-  FillWarnings(999),
-  GcellGridWarnings(999),
-  IOTimingWarnings(999),
-  NetWarnings(999),
-  NonDefaultWarnings(999),
-  PinExtWarnings(999),
-  PinWarnings(999),
-  RegionWarnings(999),
-  RowWarnings(999),
-  TrackWarnings(999),
-  ScanchainWarnings(999),
-  SNetWarnings(999),
-  StylesWarnings(999),
-  UnitsWarnings(999),
-  VersionWarnings(999),
-  ViaWarnings(999),
-  nDDMsgs(0),
-  disableDMsgs(NULL),
-  reader_case_sensitive_set(0),
-  totalDefMsgLimit(0),
-  AddPathToNet(0),
-  AllowComponentNets(0),
-  CommentChar('#'),
-  DisPropStrProcess(0),
-  LogFileAppend(0),
-  ReadFunction(NULL),
-  ErrorLogFunction(NULL),
-  WarningLogFunction(NULL),
-  ContextErrorLogFunction(NULL),
-  ContextWarningLogFunction(NULL),
-  MagicCommentFoundFunction(NULL),
-  MallocFunction(NULL),
-  ReallocFunction(NULL),
-  FreeFunction(NULL),
-  LineNumberFunction(NULL),
-  LongLineNumberFunction(NULL),
-  ContextLineNumberFunction(NULL),
-  ContextLongLineNumberFunction(NULL)
-{
-    memset(MsgLimit, 0, DEF_MSGS * sizeof(int));
-    memset(UnusedCallbacks, 0, CBMAX * sizeof(int));
-
-    init_symbol_table();
-}
-
-
-void 
-defrSettings::init_symbol_table()
-{
-    Keyword_set["ALIGN"] = K_ALIGN;
-    Keyword_set["ANALOG"] = K_ANALOG;
-    Keyword_set["ANTENNAMODEL"] = K_ANTENNAMODEL;
-    Keyword_set["ANTENNAPINGATEAREA"] = K_ANTENNAPINGATEAREA;
-    Keyword_set["ANTENNAPINDIFFAREA"] = K_ANTENNAPINDIFFAREA;
-    Keyword_set["ANTENNAPINMAXAREACAR"] = K_ANTENNAPINMAXAREACAR;
-    Keyword_set["ANTENNAPINMAXCUTCAR"] = K_ANTENNAPINMAXCUTCAR;
-    Keyword_set["ANTENNAPINMAXSIDEAREACAR"] = K_ANTENNAPINMAXSIDEAREACAR;
-    Keyword_set["ANTENNAPINPARTIALCUTAREA"] = K_ANTENNAPINPARTIALCUTAREA;
-    Keyword_set["ANTENNAPINPARTIALMETALAREA"] = K_ANTENNAPINPARTIALMETALAREA;
-    Keyword_set["ANTENNAPINPARTIALMETALSIDEAREA"] = K_ANTENNAPINPARTIALMETALSIDEAREA;
-    Keyword_set["ARRAY"] = K_ARRAY;
-    Keyword_set["ASSERTIONS"] = K_ASSERTIONS;
-    Keyword_set["BALANCED"] = K_BALANCED;
-    Keyword_set["BEGINEXT"] = K_BEGINEXT;
-    Keyword_set["BLOCKAGES"] = K_BLOCKAGES;
-    Keyword_set["BLOCKAGEWIRE"] = K_BLOCKAGEWIRE;
-    Keyword_set["BLOCKRING"] = K_BLOCKRING;
-    Keyword_set["BLOCKWIRE"] = K_BLOCKWIRE;
-    Keyword_set["BOTTOMLEFT"] = K_BOTTOMLEFT;
-    Keyword_set["BUSBITCHARS"] = K_BUSBITCHARS;
-    Keyword_set["BY"] = K_BY;
-    Keyword_set["CANNOTOCCUPY"] = K_CANNOTOCCUPY;
-    Keyword_set["CANPLACE"] = K_CANPLACE;
-    Keyword_set["CAPACITANCE"] = K_CAPACITANCE;
-    Keyword_set["CLOCK"] = K_CLOCK;
-    Keyword_set["COMMONSCANPINS"] = K_COMMONSCANPINS;
-    Keyword_set["COMPONENT"] = K_COMPONENT;
-    Keyword_set["COMPONENTPIN"] = K_COMPONENTPIN;
-    Keyword_set["COMPONENTS"] = K_COMPS;
-    Keyword_set["COMPONENTMASKSHIFT"] = K_COMPSMASKSHIFT;
-    Keyword_set["CONSTRAINTS"] = K_CONSTRAINTS;
-    Keyword_set["COREWIRE"] = K_COREWIRE;
-    Keyword_set["COVER"] = K_COVER;
-    Keyword_set["CUTSIZE"] = K_CUTSIZE;
-    Keyword_set["CUTSPACING"] = K_CUTSPACING;
-    Keyword_set["DEFAULTCAP"] = K_DEFAULTCAP;
-    Keyword_set["DESIGN"] = K_DESIGN;
-    Keyword_set["DESIGNRULEWIDTH"] = K_DESIGNRULEWIDTH;
-    Keyword_set["DIAGWIDTH"] = K_DIAGWIDTH;
-    Keyword_set["DIEAREA"] = K_DIEAREA;
-    Keyword_set["DIFF"] = K_DIFF;
-    Keyword_set["DIRECTION"] = K_DIRECTION;
-    Keyword_set["DIST"] = K_DIST;
-    Keyword_set["DISTANCE"] = K_DISTANCE;
-    Keyword_set["DIVIDERCHAR"] = K_DIVIDERCHAR;
-    Keyword_set["DO"] = K_DO;
-    Keyword_set["DRCFILL"] = K_DRCFILL;
-    Keyword_set["DRIVECELL"] = K_DRIVECELL;
-    Keyword_set["E"] = K_E;
-    Keyword_set["EEQMASTER"] = K_EEQMASTER;
-    Keyword_set["ENCLOSURE"] = K_ENCLOSURE;
-    Keyword_set["END"] = K_END;
-    Keyword_set["ENDEXT"] = K_ENDEXT;
-    Keyword_set["EQUAL"] = K_EQUAL;
-    Keyword_set["EXCEPTPGNET"] = K_EXCEPTPGNET;
-    Keyword_set["ESTCAP"] = K_ESTCAP;
-    Keyword_set["FALL"] = K_FALL;
-    Keyword_set["FALLMAX"] = K_FALLMAX;
-    Keyword_set["FALLMIN"] = K_FALLMIN;
-    Keyword_set["FE"] = K_FE;
-    Keyword_set["FENCE"] = K_FENCE;
-    Keyword_set["FILLS"] = K_FILLS;
-    Keyword_set["FILLWIRE"] = K_FILLWIRE;
-    Keyword_set["FILLWIREOPC"] = K_FILLWIREOPC;
-    Keyword_set["FIXED"] = K_FIXED;
-    Keyword_set["FIXEDBUMP"] = K_FIXEDBUMP;
-    Keyword_set["FLOATING"] = K_FLOATING;
-    Keyword_set["FLOORPLANCONSTRAINTS"] = K_FPC;
-    Keyword_set["FN"] = K_FN;
-    Keyword_set["FOLLOWPIN"] = K_FOLLOWPIN;
-    Keyword_set["FOREIGN"] = K_FOREIGN;
-    Keyword_set["FREQUENCY"] = K_FREQUENCY;
-    Keyword_set["FROMCLOCKPIN"] = K_FROMCLOCKPIN;
-    Keyword_set["FROMCOMPPIN"] = K_FROMCOMPPIN;
-    Keyword_set["FROMIOPIN"] = K_FROMIOPIN;
-    Keyword_set["FROMPIN"] = K_FROMPIN;
-    Keyword_set["FS"] = K_FS;
-    Keyword_set["FW"] = K_FW;
-    Keyword_set["GCELLGRID"] = K_GCELLGRID;
-    Keyword_set["GENERATE"] = K_COMP_GEN;
-    Keyword_set["GUIDE"] = K_GUIDE;
-    Keyword_set["GROUND"] = K_GROUND;
-    Keyword_set["GROUNDSENSITIVITY"] = K_GROUNDSENSITIVITY;
-    Keyword_set["GROUP"] = K_GROUP;
-    Keyword_set["GROUPS"] = K_GROUPS;
-    Keyword_set["FLOORPLAN"] = K_FLOORPLAN;
-    Keyword_set["HALO"] = K_HALO;
-    Keyword_set["HARDSPACING"] = K_HARDSPACING;
-    Keyword_set["HISTORY"] = K_HISTORY;
-    Keyword_set["HOLDRISE"] = K_HOLDRISE;
-    Keyword_set["HOLDFALL"] = K_HOLDFALL;
-    Keyword_set["HORIZONTAL"] = K_HORIZONTAL;
-    Keyword_set["IN"] = K_IN;
-    Keyword_set["INTEGER"] = K_INTEGER;
-    Keyword_set["IOTIMINGS"] = K_IOTIMINGS;
-    Keyword_set["IOWIRE"] = K_IOWIRE;
-    Keyword_set["LAYER"] = K_LAYER;
-    Keyword_set["LAYERS"] = K_LAYERS;
-    Keyword_set["MASK"] = K_MASK;
-    Keyword_set["MASKSHIFT"] = K_MASKSHIFT;
-    Keyword_set["MAX"] = K_MAX;
-    Keyword_set["MAXBITS"] = K_MAXBITS;
-    Keyword_set["MAXDIST"] = K_MAXDIST;
-    Keyword_set["MAXHALFPERIMETER"] = K_MAXHALFPERIMETER;
-    Keyword_set["MAXX"] = K_MAXX;
-    Keyword_set["MAXY"] = K_MAXY;
-    Keyword_set["MICRONS"] = K_MICRONS;
-    Keyword_set["MIN"] = K_MIN;
-    Keyword_set["MINCUTS"] = K_MINCUTS;
-    Keyword_set["MINPINS"] = K_MINPINS;
-    Keyword_set["MUSTJOIN"] = K_MUSTJOIN;
-    Keyword_set["N"] = K_N;
-    Keyword_set["NAMESCASESENSITIVE"] = K_NAMESCASESENSITIVE;
-    Keyword_set["NAMEMAPSTRING"] = K_NAMEMAPSTRING;
-    Keyword_set["NET"] = K_NET;
-    Keyword_set["NETEXPR"] = K_NETEXPR;
-    Keyword_set["NETS"] = K_NETS;
-    Keyword_set["NETLIST"] = K_NETLIST;
-    Keyword_set["NEW"] = K_NEW;
-    Keyword_set["NONDEFAULTRULE"] = K_NONDEFAULTRULE;
-    Keyword_set["NONDEFAULTRULES"] = K_NONDEFAULTRULES;
-    Keyword_set["NOSHIELD"] = K_NOSHIELD;
-    Keyword_set["ON"] = K_ON;
-    Keyword_set["OFF"] = K_OFF;
-    Keyword_set["OFFSET"] = K_OFFSET;
-    Keyword_set["OPC"] = K_OPC;
-    Keyword_set["ORDERED"] = K_ORDERED;
-    Keyword_set["ORIGIN"] = K_ORIGIN;
-    Keyword_set["ORIGINAL"] = K_ORIGINAL;
-    Keyword_set["OUT"] = K_OUT;
-    Keyword_set["OXIDE1"] = K_OXIDE1;
-    Keyword_set["OXIDE2"] = K_OXIDE2;
-    Keyword_set["OXIDE3"] = K_OXIDE3;
-    Keyword_set["OXIDE4"] = K_OXIDE4;
-    Keyword_set["PADRING"] = K_PADRING;
-    Keyword_set["PARTIAL"] = K_PARTIAL;
-    Keyword_set["PARTITION"] = K_PARTITION;
-    Keyword_set["PARALLEL"] = K_PARALLEL;
-    Keyword_set["PARTITIONS"] = K_PARTITIONS;
-    Keyword_set["PATH"] = K_PATH;
-    Keyword_set["PATTERN"] = K_PATTERN;
-    Keyword_set["PATTERNNAME"] = K_PATTERNNAME;
-    Keyword_set["PIN"] = K_PIN;
-    Keyword_set["PINPROPERTIES"] = K_PINPROPERTIES;
-    Keyword_set["PINS"] = K_PINS;
-    Keyword_set["PLACED"] = K_PLACED;
-    Keyword_set["PLACEMENT"] = K_PLACEMENT;
-    Keyword_set["POLYGON"] = K_POLYGON;
-    Keyword_set["PORT"] = K_PORT;
-    Keyword_set["POWER"] = K_POWER;
-    Keyword_set["PROPERTY"] = K_PROPERTY;
-    Keyword_set["PROPERTYDEFINITIONS"] = K_PROPERTYDEFINITIONS;
-    Keyword_set["PUSHDOWN"] = K_PUSHDOWN;
-    Keyword_set["RANGE"] = K_RANGE;
-    Keyword_set["REAL"] = K_REAL;
-    Keyword_set["RECT"] = K_RECT;
-    Keyword_set["REENTRANTPATHS"] = K_REENTRANTPATHS;
-    Keyword_set["REGION"] = K_REGION;
-    Keyword_set["REGIONS"] = K_REGIONS;
-    Keyword_set["RESET"] = K_RESET;
-    Keyword_set["RING"] = K_RING;
-    Keyword_set["RISE"] = K_RISE;
-    Keyword_set["RISEMAX"] = K_RISEMAX;
-    Keyword_set["RISEMIN"] = K_RISEMIN;
-    Keyword_set["ROUTED"] = K_ROUTED;
-    Keyword_set["ROUTEHALO"] = K_ROUTEHALO;
-    Keyword_set["ROW"] = K_ROW;
-    Keyword_set["ROWCOL"] = K_ROWCOL;
-    Keyword_set["ROWS"] = K_ROWS;
-    Keyword_set["S"] = K_S;
-    Keyword_set["SAMEMASK"] = K_SAMEMASK;
-    Keyword_set["SCAN"] = K_SCAN;
-    Keyword_set["SCANCHAINS"] = K_SCANCHAINS;
-    Keyword_set["SETUPFALL"] = K_SETUPFALL;
-    Keyword_set["SETUPRISE"] = K_SETUPRISE;
-    Keyword_set["SHAPE"] = K_SHAPE;
-    Keyword_set["SHIELD"] = K_SHIELD;
-    Keyword_set["SHIELDNET"] = K_SHIELDNET;
-    Keyword_set["SIGNAL"] = K_SIGNAL;
-    Keyword_set["SITE"] = K_SITE;
-    Keyword_set["SLEWRATE"] = K_SLEWRATE;
-    Keyword_set["SLOTS"] = K_SLOTS;
-    Keyword_set["SOFT"] = K_SOFT;
-    Keyword_set["SOURCE"] = K_SOURCE;
-    Keyword_set["SPACING"] = K_SPACING;
-    Keyword_set["SPECIAL"] = K_SPECIAL;
-    Keyword_set["SPECIALNET"] = K_SNET;
-    Keyword_set["SPECIALNETS"] = K_SNETS;
-    Keyword_set["START"] = K_START;
-    Keyword_set["STEINER"] = K_STEINER;
-    Keyword_set["STEP"] = K_STEP;
-    Keyword_set["STOP"] = K_STOP;
-    Keyword_set["STRING"] = K_STRING;
-    Keyword_set["STRIPE"] = K_STRIPE;
-    Keyword_set["STYLE"] = K_STYLE;
-    Keyword_set["STYLES"] = K_STYLES;
-    Keyword_set["SUBNET"] = K_SUBNET;
-    Keyword_set["SUM"] = K_SUM;
-    Keyword_set["SUPPLYSENSITIVITY"] = K_SUPPLYSENSITIVITY;
-    Keyword_set["SYNTHESIZED"] = K_SYNTHESIZED;
-    Keyword_set["TAPER"] = K_TAPER;
-    Keyword_set["TAPERRULE"] = K_TAPERRULE;
-    Keyword_set["TECHNOLOGY"] = K_TECH;
-    Keyword_set["TEST"] = K_TEST;
-    Keyword_set["TIEOFF"] = K_TIEOFF;
-    Keyword_set["TIMING"] = K_TIMING;
-    Keyword_set["TIMINGDISABLES"] = K_TIMINGDISABLES;
-    Keyword_set["TOCLOCKPIN"] = K_TOCLOCKPIN;
-    Keyword_set["TOCOMPPIN"] = K_TOCOMPPIN;
-    Keyword_set["TOIOPIN"] = K_TOIOPIN;
-    Keyword_set["TOPIN"] = K_TOPIN;
-    Keyword_set["TOPRIGHT"] = K_TOPRIGHT;
-    Keyword_set["TRACKS"] = K_TRACKS;
-    Keyword_set["TRUNK"] = K_TRUNK;
-    Keyword_set["TURNOFF"] = K_TURNOFF;
-    Keyword_set["TYPE"] = K_TYPE;
-    Keyword_set["UNITS"] = K_UNITS;
-    Keyword_set["UNPLACED"] = K_UNPLACED;
-    Keyword_set["USE"] = K_USE;
-    Keyword_set["USER"] = K_USER;
-    Keyword_set["VARIABLE"] = K_VARIABLE;
-    Keyword_set["VERSION"] = K_VERSION;
-    Keyword_set["VERTICAL"] = K_VERTICAL;
-    Keyword_set["VIA"] = K_VIA;
-    Keyword_set["VIARULE"] = K_VIARULE;
-    Keyword_set["VIAS"] = K_VIAS;
-    Keyword_set["VIRTUAL"] = K_VIRTUAL;
-    Keyword_set["VOLTAGE"] = K_VOLTAGE;
-    Keyword_set["VPIN"] = K_VPIN;
-    Keyword_set["W"] = K_W;
-    Keyword_set["WEIGHT"] = K_WEIGHT;
-    Keyword_set["WIDTH"] = K_WIDTH;
-    Keyword_set["WIRECAP"] = K_WIRECAP;
-    Keyword_set["WIREEXT"] = K_WIREEXT;
-    Keyword_set["WIREDLOGIC"] = K_WIREDLOGIC;
-    Keyword_set["X"] = K_X;
-    Keyword_set["XTALK"] = K_XTALK;
-    Keyword_set["Y"] = K_Y;
-}
-
-defrSession::defrSession() 
-: reader_case_sensitive(0),
-  FileName(0),
-  UserData(NULL)
-{
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.hpp
deleted file mode 100644
index dca7831..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defrSettings.hpp
+++ /dev/null
@@ -1,142 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #6 $
-//  $Date: 2013/08/09 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef defrSettings_h
-#define defrSettings_h
-
-#include "defrReader.hpp"
-
-#include <cstring>
-#include <string>
-#include <map>
-
-#define DEF_DEBUG_IDS 100
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-struct defCompareCStrings 
-{
-    bool operator()(const char* lhs, const char* rhs) const {
-        return std::strcmp(lhs, rhs) < 0;
-    }
-};
-
-typedef std::map<const char*, int, defCompareCStrings>  defKeywordMap;
-
-class defrSettings {
-public:
-    defrSettings();
-
-    void init_symbol_table();
-
-    defKeywordMap Keyword_set; 
-
-    int defiDeltaNumberLines;
-
-    ////////////////////////////////////
-    //
-    //       Flags to control number of warnings to print out, max will be 999
-    //
-    ////////////////////////////////////
-
-    int AssertionWarnings;
-    int BlockageWarnings;
-    int CaseSensitiveWarnings;
-    int ComponentWarnings;
-    int ConstraintWarnings;
-    int DefaultCapWarnings;
-    int FillWarnings;
-    int GcellGridWarnings;
-    int IOTimingWarnings;
-    int LogFileAppend; 
-    int NetWarnings;
-    int NonDefaultWarnings;
-    int PinExtWarnings;
-    int PinWarnings;
-    int RegionWarnings;
-    int RowWarnings;
-    int TrackWarnings;
-    int ScanchainWarnings;
-    int SNetWarnings;
-    int StylesWarnings;
-    int UnitsWarnings;
-    int VersionWarnings;
-    int ViaWarnings;
-
-    int  nDDMsgs; 
-    int* disableDMsgs;
-    int  totalDefMsgLimit; // to save the user set total msg limit to output
-    int AddPathToNet;
-    int AllowComponentNets;
-    char CommentChar;
-    int DisPropStrProcess; 
-
-    int reader_case_sensitive_set;
-
-    DEFI_READ_FUNCTION ReadFunction;
-    DEFI_LOG_FUNCTION ErrorLogFunction;
-    DEFI_WARNING_LOG_FUNCTION WarningLogFunction;
-    DEFI_CONTEXT_LOG_FUNCTION ContextErrorLogFunction;
-    DEFI_CONTEXT_WARNING_LOG_FUNCTION ContextWarningLogFunction;
-    DEFI_MAGIC_COMMENT_FOUND_FUNCTION MagicCommentFoundFunction;
-    DEFI_MALLOC_FUNCTION MallocFunction;
-    DEFI_REALLOC_FUNCTION ReallocFunction;
-    DEFI_FREE_FUNCTION FreeFunction;
-    DEFI_LINE_NUMBER_FUNCTION LineNumberFunction;
-    DEFI_LONG_LINE_NUMBER_FUNCTION LongLineNumberFunction;
-    DEFI_CONTEXT_LINE_NUMBER_FUNCTION ContextLineNumberFunction;
-    DEFI_CONTEXT_LONG_LINE_NUMBER_FUNCTION ContextLongLineNumberFunction;
-
-    int UnusedCallbacks[CBMAX];
-    int MsgLimit[DEF_MSGS];
-};
-
-
-class defrSession {
-public:
-    defrSession();
-
-    char*           FileName;
-    int             reader_case_sensitive;
-    defiUserData    UserData;
-
-    defiPropType    CompProp;
-    defiPropType    CompPinProp;
-    defiPropType    DesignProp;
-    defiPropType    GroupProp;
-    defiPropType    NDefProp;
-    defiPropType    NetProp;
-    defiPropType    RegionProp;
-    defiPropType    RowProp;
-    defiPropType    SNetProp;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.cpp
deleted file mode 100644
index e6276b5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.cpp
+++ /dev/null
@@ -1,6918 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-
-// This file contains code for implementing the defwriter 5.3
-// It has all the functions user can call in their callbacks or
-// just their writer to write out the correct lef syntax.
-//
-// Author: Wanda da Rosa
-// Date:   Summer, 1998
-//
-// Revisions: 11/25/2002 - bug fix: submitted by Craig Files
-//                         (cfiles@ftc.agilent.com)
-//                         Changed all (!name && !*name) to
-//                         (!name || !*name)
-
-#include "defwWriter.hpp"
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include "defiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// States of the writer.
-#define DEFW_UNINIT            0
-#define DEFW_INIT              1
-#define DEFW_VERSION           2
-#define DEFW_CASESENSITIVE     3
-#define DEFW_DIVIDER           4
-#define DEFW_BUSBIT            5
-#define DEFW_DESIGN            6
-#define DEFW_TECHNOLOGY        7
-#define DEFW_ARRAY             8
-#define DEFW_FLOORPLAN         9
-#define DEFW_UNITS            10
-#define DEFW_HISTORY          11
-#define DEFW_PROP_START       12
-#define DEFW_PROP             13
-#define DEFW_PROP_END         14
-#define DEFW_DIE_AREA         15
-#define DEFW_ROW              16
-#define DEFW_TRACKS           17
-#define DEFW_GCELL_GRID       18
-#define DEFW_DEFAULTCAP_START 19
-#define DEFW_DEFAULTCAP       20
-#define DEFW_DEFAULTCAP_END   21
-#define DEFW_CANPLACE         22
-#define DEFW_CANNOTOCCUPY     23
-#define DEFW_VIA_START        24
-#define DEFW_VIA              25
-#define DEFW_VIAVIARULE       26
-#define DEFW_VIAONE_END       27
-#define DEFW_VIA_END          28
-#define DEFW_REGION_START     29
-#define DEFW_REGION           30
-#define DEFW_REGION_END       31
-#define DEFW_COMPONENT_MASKSHIFTLAYERS 32
-#define DEFW_COMPONENT_START  33
-#define DEFW_COMPONENT        34
-#define DEFW_COMPONENT_END    35
-#define DEFW_PIN_START        36
-#define DEFW_PIN              37
-#define DEFW_PIN_PORT         38
-#define DEFW_PIN_END          39
-#define DEFW_PINPROP_START    40
-#define DEFW_PINPROP          41
-#define DEFW_PINPROP_END      42
-#define DEFW_BLOCKAGE_START   43
-#define DEFW_BLOCKAGE_LAYER   44
-#define DEFW_BLOCKAGE_PLACE   45
-#define DEFW_BLOCKAGE_RECT    46
-#define DEFW_BLOCKAGE_POLYGON 47
-#define DEFW_BLOCKAGE_END     48
-#define DEFW_SNET_START       49
-#define DEFW_SNET             50
-#define DEFW_SNET_OPTIONS     51
-#define DEFW_SNET_ENDNET      52
-#define DEFW_SNET_END         53
-#define DEFW_PATH_START       54
-#define DEFW_PATH             55
-#define DEFW_SHIELD           56
-#define DEFW_NET_START        57
-#define DEFW_NET              58
-#define DEFW_NET_OPTIONS      59
-#define DEFW_NET_ENDNET       60
-#define DEFW_NET_END          61
-#define DEFW_SUBNET           62
-#define DEFW_NOSHIELD         63
-#define DEFW_IOTIMING_START   64
-#define DEFW_IOTIMING         65
-#define DEFW_IOTIMING_END     66
-#define DEFW_SCANCHAIN_START  67
-#define DEFW_SCANCHAIN        68
-#define DEFW_SCAN_FLOATING    69
-#define DEFW_SCAN_ORDERED     70
-#define DEFW_SCANCHAIN_END    71
-#define DEFW_FPC_START        72
-#define DEFW_FPC              73
-#define DEFW_FPC_OPER         74
-#define DEFW_FPC_OPER_SUM     75
-#define DEFW_FPC_END          76
-#define DEFW_GROUP_START      77
-#define DEFW_GROUP            78
-#define DEFW_GROUP_END        79
-#define DEFW_SLOT_START       80
-#define DEFW_SLOT_LAYER       81
-#define DEFW_SLOT_RECT        82
-#define DEFW_SLOT_END         83
-#define DEFW_FILL_START       84
-#define DEFW_FILL_LAYER       85
-#define DEFW_FILL_VIA         86
-#define DEFW_FILL_OPC         87
-#define DEFW_FILL_RECT        88
-#define DEFW_FILL_END         89
-#define DEFW_NDR_START        90
-#define DEFW_NDR              91
-#define DEFW_NDR_END          92
-#define DEFW_STYLES_START     93
-#define DEFW_STYLES           94
-#define DEFW_STYLES_END       95
-#define DEFW_BEGINEXT_START   96
-#define DEFW_BEGINEXT         97
-#define DEFW_BEGINEXT_END     98
-#define DEFW_FILL_LAYERMASK   99
-#define DEFW_FILL_VIAMASK    100
-#define DEFW_BLOCKAGE_MASK   101
-
-#define DEFW_END             102
-
-#define DEFW_DONE            999
-
-#define MAXSYN               103
-
-
-// *****************************************************************************
-//        Global Variables
-// *****************************************************************************
-FILE *defwFile = 0;   // File to write to.
-int defwLines = 0;    // number of lines written
-int defwState = DEFW_UNINIT;  // Current state of writer
-int defwFunc = DEFW_UNINIT;   // Current function of writer
-int defwDidNets = 0;  // required section
-int defwDidComponents = 0;  // required section
-int defwDidInit = 0;  // required section
-int defwCounter = 0;  // number of nets, components in section
-int defwLineItemCounter = 0; // number of items on current line
-int defwFPC = 0;  // Current number of items in constraints/operand/sum
-int defwHasInit = 0;    // for defwInit has called
-int defwHasInitCbk = 0; // for defwInitCbk has called
-int defwSpNetShield = 0; // for special net shieldNetName
-static double defVersionNum = 5.7;  // default to 5.7
-static int defwObsoleteNum = -1; // keep track the obsolete syntax for error
-static int defwViaHasVal = 0;    // keep track only ViaRule|Pattern
-static int defwBlockageHasSD = 0;// keep track only Spacing|Designrulewidth
-static int defwBlockageHasSF = 0;// keep track only SLOTS|FILLS
-static int defwBlockageHasSP = 0;// keep track only SOFT|PARTIAL
-
-char defwStateStr[MAXSYN] [80] = {
-    "UNINITIALIZE",         //  0
-    "INITIALIZE",           //  1
-    "VERSION",              //  2
-    "CASESENSITIVE",        //  3
-    "BUSBIT",               //  4
-    "DIVIDER",              //  5
-    "DESIGN",               //  6
-    "TECHNOLOGY",           //  7
-    "ARRAY",                //  8
-    "FLOORPLAN",            //  9
-    "UNITS",                // 10
-    "HISTORY",              // 11
-    "PROPERTYDEFINITIONS",  // 12
-    "PROPERTYDEFINITIONS",  // 13
-    "PROPERTYDEFINITIONS",  // 14
-    "DIEAREA",              // 15
-    "ROW",                  // 16
-    "TRACKS",               // 17
-    "GCELLGRID",            // 18
-    "DEFAULTCAP",           // 19
-    "DEFAULTCAP",           // 20
-    "DEFAULTCAP",           // 21
-    "CANPLACE",             // 22
-    "CANNOTOCCUPY",         // 23
-    "VIA",                  // 24
-    "VIA",                  // 25
-    "VIA",                  // 26
-    "VIA",                  // 27
-    "VIA",                  // 28
-    "REGION",               // 29
-    "REGION",               // 30
-    "REGION",               // 31
-    "COMPONENT",            // 32
-    "COMPONENT",            // 33
-    "COMPONENT",            // 34
-    "COMPONENT",            // 35
-    "PIN",                  // 36
-    "PIN",                  // 37
-    "PIN",                  // 38
-    "PIN",                  // 39
-    "PINPROPERTY",          // 40 
-    "PINPROPERTY",          // 41
-    "PINPROPERTY",          // 42
-    "SNET",                 // 43
-    "SNET",                 // 44
-    "SNET",                 // 45
-    "SNET",                 // 46
-    "SNET",                 // 47
-    "PATH",                 // 48
-    "PATH",                 // 49
-    "SHIELD",               // 50 
-    "NET",                  // 51
-    "NET",                  // 52
-    "NET",                  // 53
-    "NET",                  // 54
-    "NET",                  // 55
-    "SUBNET",               // 56
-    "NOSHIELD",             // 57
-    "IOTIMING",             // 58
-    "IOTIMING",             // 59
-    "IOTIMING",             // 60 
-    "SCANCHAIN",            // 61
-    "SCANCHAIN",            // 62
-    "SCAN FLOATING",        // 63
-    "SCAN ORDERED",         // 64
-    "SCANCHAIN",            // 65
-    "CONSTRAINTS",          // 66
-    "CONSTRAINTS",          // 67
-    "CONSTRAINTS",          // 68
-    "CONSTRAINTS",          // 69
-    "CONSTRAINTS",          // 70 
-    "GROUP",                // 71
-    "GROUP",                // 71
-    "GROUP",                // 72
-    "BLOCKAGE",             // 73
-    "BLOCKAGE LAYER",       // 74
-    "BLOCKAGE PLACEMENT",   // 75
-    "BLOCKAGE RECT",        // 76
-    "BLOCKAGE POLYGON",     // 77
-    "BLOCKAGE",             // 78
-    "SLOT",                 // 79
-    "SLOT",                 // 80
-    "SLOT",                 // 81
-    "SLOT",                 // 82
-    "FILL",                 // 83
-    "FILL",                 // 84
-    "FILL",                 // 85
-    "FILL",                 // 86
-    "FILL",                 // 87
-    "FILL",                 // 88
-    "NDR",                  // 89
-    "NDR",                  // 90
-    "NDR",                  // 91
-    "STYLES",               // 92
-    "STYLES",               // 93
-    "STYLES",               // 94
-    "BEGINEXT",             // 95
-    "BEGINEXT",             // 96
-    "BEGINEXT",             // 97
-    "DESIGN END",           // 98
-    "FILL_LAYERMASK",       // 99
-    "FILL_VIAMASK",         // 100 
-    "BLOCKAGE_MASK"         // 101
-
-};
-
-
-static int printPointsNum = 0;
-static void printPoints(FILE *file, double x, double y, 
-                        const char* prefix, const char* suffix)
-{
-    static double x_old = 0;
-    static double y_old = 0;
-
-    fprintf(file, "%s", prefix);
-
-    if (printPointsNum++ == 0) {
-        fprintf(file, "( %.11g %.11g )", x, y);
-    } else if (x_old == x) {
-        if (y_old == y) {
-            fprintf(file, "( * * )");
-        } else {
-            fprintf(file, "( * %.11g )", y);
-        }
-    } else if (y_old == y) {
-        fprintf(file, "( %.11g * )", x);
-    } else {
-        fprintf(file, "( %.11g %.11g )", x, y);
-    }
-
-    fprintf(file, "%s", suffix);
-
-    x_old = x;
-    y_old = y;
-}
-
-
-
-int
-defwNewLine()
-{
-    if (!defwFile)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, "\n");
-    return DEFW_OK;
-}
-
-
-// this function is required to be called first to initialize the required
-// sections.
-// Either this function or defwInitCbk can be called, cannot be both
-int
-defwInit(FILE       *f,
-         int        vers1,
-         int        vers2,
-         const char *caseSensitive,
-         const char *dividerChar,
-         const char *busBitChars,
-         const char *designName,
-         const char *technology,  // optional 
-         const char *array,       // optional 
-         const char *floorplan,   // optional 
-         double     units             // optional  (set to -1 to ignore) 
-         )
-{
-
-    //if (defwFile) return DEFW_BAD_ORDER;
-    defwFile = f;
-    if (defwHasInitCbk == 1) {  // defwInitCbk has already called, issue an error
-        fprintf(stderr,
-                "ERROR (DEFWRIT-9000): The DEF writer has detected that the function defwInitCbk has already been called and you are trying to call defwInit.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again.\n");
-        fprintf(stderr, "Writer Exit.\n");
-        exit(DEFW_BAD_ORDER);
-    }
-
-    defwState = DEFW_UNINIT;  // Current state of writer
-    defwFunc = DEFW_UNINIT;   // Current function of writer
-    defwDidNets = 0;  // required section
-    defwDidComponents = 0;  // required section
-    defwDidInit = 0;  // required section
-
-    if (vers1) {  // optional in 5.6 on
-        fprintf(defwFile, "VERSION %d.%d ;\n", vers1, vers2);
-        defwLines++;
-    }
-
-    if ((vers1 == 5) && (vers2 < 6)) {  // For version before 5.6
-        if (caseSensitive == 0 || *caseSensitive == 0)
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "NAMESCASESENSITIVE %s ;\n", caseSensitive);
-    }
-
-    if (dividerChar) {  // optional in 5.6 on
-        fprintf(defwFile, "DIVIDERCHAR \"%s\" ;\n", dividerChar);
-        defwLines++;
-    }
-
-    if (busBitChars) {  // optional in 5.6 on
-        fprintf(defwFile, "BUSBITCHARS \"%s\" ;\n", busBitChars);
-        defwLines++;
-    }
-
-    if (designName == 0 || *designName == 0)
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "DESIGN %s ;\n", designName);
-    defwLines++;
-
-    if (technology) {
-        fprintf(defwFile, "TECHNOLOGY %s ;\n", technology);
-        defwLines++;
-    }
-
-    if (array) {
-        fprintf(defwFile, "ARRAY %s ;\n", array);
-        defwLines++;
-    }
-
-    if (floorplan) {
-        fprintf(defwFile, "FLOORPLAN %s ;\n", floorplan);
-        defwLines++;
-    }
-
-    if (units != -1.0) {
-        int unitsVal = (int) units;
-        switch (unitsVal) {
-        case 100:
-        case 200:
-        case 1000:
-        case 2000:
-        case 4000:
-        case 8000:
-        case 10000:
-        case 16000:
-        case 20000:
-            fprintf(defwFile, "UNITS DISTANCE MICRONS %d ;\n", ROUND(units));
-            defwLines++;
-            break;
-        default:
-            return DEFW_BAD_DATA;
-        }
-    }
-
-    defwDidInit = 1;
-    defwState = DEFW_DESIGN;
-    defwHasInit = 1;
-    return DEFW_OK;
-}
-
-
-// this function is required to be called first to initialize the variables
-// Either this function or defwInit can be called, cannot be both
-int
-defwInitCbk(FILE *f)
-{
-
-    defwFile = f;
-    if (defwHasInit == 1) {  // defwInit has already called, issue an error
-        fprintf(stderr,
-                "ERROR (DEFWRIT-9001): The DEF writer has detected that the function defwInit has already been called and you are trying to call defwInitCbk.\nOnly defwInitCbk or defwInit can be called but not both.\nUpdate your program and then try again.\n");
-        fprintf(stderr, "Writer Exit.\n");
-        exit(DEFW_BAD_ORDER);
-    }
-
-    defwState = DEFW_UNINIT;  // Current state of writer
-    defwFunc = DEFW_UNINIT;   // Current function of writer
-    defwDidNets = 0;  // required section
-    defwDidComponents = 0;  // required section
-    defwDidInit = 0;  // required section
-
-    defwDidInit = 1;
-    defwState = DEFW_INIT;
-    defwHasInitCbk = 1;
-    return DEFW_OK;
-}
-
-int
-defwVersion(int vers1,
-            int vers2)
-{
-    defwFunc = DEFW_VERSION;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_INIT)  // version follows init 
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, "VERSION %d.%d ;\n", vers1, vers2);
-    if (vers2 >= 10)
-        defVersionNum = vers1 + (vers2 / 100.0);
-    else
-        defVersionNum = vers1 + (vers2 / 10.0);
-    defwLines++;
-
-    defwState = DEFW_VERSION;
-    return DEFW_OK;
-}
-
-int
-defwCaseSensitive(const char *caseSensitive)
-{
-    defwObsoleteNum = DEFW_CASESENSITIVE;
-    defwFunc = DEFW_CASESENSITIVE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum >= 5.6)
-        return DEFW_OBSOLETE;
-    // Check for repeated casesensitive
-    if (defwState == DEFW_CASESENSITIVE)
-        return DEFW_BAD_ORDER;
-    if (strcmp(caseSensitive, "ON") && strcmp(caseSensitive, "OFF"))
-        return DEFW_BAD_DATA;     // has to be either ON or OFF
-    fprintf(defwFile, "NAMESCASESENSITIVE %s ;\n", caseSensitive);
-    defwLines++;
-
-    defwState = DEFW_CASESENSITIVE;
-    return DEFW_OK;
-}
-
-int
-defwBusBitChars(const char *busBitChars)
-{
-    defwFunc = DEFW_BUSBIT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    // Check for repeated casesensitive
-    if (defwState == DEFW_BUSBIT)
-        return DEFW_BAD_ORDER;
-    if (busBitChars && busBitChars != 0 && *busBitChars != 0) {
-        fprintf(defwFile, "BUSBITCHARS \"%s\" ;\n", busBitChars);
-        defwLines++;
-    }
-
-    defwState = DEFW_BUSBIT;
-    return DEFW_OK;
-}
-
-int
-defwDividerChar(const char *dividerChar)
-{
-    defwFunc = DEFW_DIVIDER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    // Check for repeated busbit
-    if (defwState == DEFW_DIVIDER)
-        return DEFW_BAD_ORDER;
-    if (dividerChar && dividerChar != 0 && *dividerChar != 0) {
-        fprintf(defwFile, "DIVIDERCHAR \"%s\" ;\n", dividerChar);
-        defwLines++;
-    }
-
-    defwState = DEFW_DIVIDER;
-    return DEFW_OK;
-}
-
-int
-defwDesignName(const char *name)
-{
-    defwFunc = DEFW_DESIGN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    // Check for repeated design
-    if (defwState == DEFW_DESIGN)
-        return DEFW_BAD_ORDER;
-    if (name && name != 0 && *name != 0) {
-        fprintf(defwFile, "DESIGN %s ;\n", name);
-        defwLines++;
-    }
-
-    defwState = DEFW_DESIGN;
-    return DEFW_OK;
-}
-
-int
-defwTechnology(const char *technology)
-{
-    defwFunc = DEFW_TECHNOLOGY;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (technology && technology != 0 && *technology != 0) {
-        fprintf(defwFile, "TECHNOLOGY %s ;\n", technology);
-        defwLines++;
-    }
-
-    defwState = DEFW_TECHNOLOGY;
-    return DEFW_OK;
-}
-
-int
-defwArray(const char *array)
-{
-    defwFunc = DEFW_ARRAY;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_ARRAY)
-        return DEFW_BAD_ORDER;     // check for repeated array
-    if (array && array != 0 && *array != 0) {
-        fprintf(defwFile, "ARRAY %s ;\n", array);
-        defwLines++;
-    }
-
-    defwState = DEFW_ARRAY;
-    return DEFW_OK;
-}
-
-int
-defwFloorplan(const char *floorplan)
-{
-    defwFunc = DEFW_FLOORPLAN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_FLOORPLAN)
-        return DEFW_BAD_ORDER;     // Check for repeated floorplan
-    if (floorplan && floorplan != 0 && *floorplan != 0) {
-        fprintf(defwFile, "FLOORPLAN %s ;\n", floorplan);
-        defwLines++;
-    }
-
-    defwState = DEFW_FLOORPLAN;
-    return DEFW_OK;
-}
-
-int
-defwUnits(int units)
-{
-    defwFunc = DEFW_UNITS;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_UNITS)
-        return DEFW_BAD_ORDER;     // Check for repeated units
-    if (units != 0) {
-        switch (units) {
-        case 100:
-        case 200:
-        case 1000:
-        case 2000:
-        case 10000:
-        case 20000:
-            fprintf(defwFile, "UNITS DISTANCE MICRONS %d ;\n", units);
-            defwLines++;
-            break;
-        default:
-            return DEFW_BAD_DATA;
-        }
-    }
-
-    defwState = DEFW_UNITS;
-    return DEFW_OK;
-}
-
-int
-defwHistory(const char *string)
-{
-    char *c;
-    defwFunc = DEFW_HISTORY;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (string == 0 || *string == 0)
-        return DEFW_BAD_DATA;
-
-    for (c = (char*) string; *c; c++)
-        if (*c == '\n')
-            defwLines++;
-
-    fprintf(defwFile, "HISTORY %s ;\n", string);
-    defwLines++;
-
-    defwState = DEFW_HISTORY;
-    return DEFW_OK;
-}
-
-int
-defwStartPropDef()
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_PROP_START) && (defwState <= DEFW_PROP_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "PROPERTYDEFINITIONS\n");
-    defwLines++;
-
-    defwState = DEFW_PROP_START;
-    return DEFW_OK;
-}
-
-
-int
-defwIsPropObjType(const char *objType)
-{
-    if (strcmp(objType, "DESIGN") && strcmp(objType, "COMPONENT") &&
-        strcmp(objType, "NET") && strcmp(objType, "SPECIALNET") &&
-        strcmp(objType, "GROUP") && strcmp(objType, "ROW") &&
-        strcmp(objType, "COMPONENTPIN") && strcmp(objType, "REGION") &&
-        strcmp(objType, "NONDEFAULTRULE"))
-        return 0;
-    return 1;
-}
-
-int
-defwIntPropDef(const char   *objType,
-               const char   *propName,
-               double       leftRange,
-               double       rightRange,    // optional 
-               int          propValue                        // optional 
-               )
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PROP_START &&
-        defwState != DEFW_PROP)
-        return DEFW_BAD_ORDER;
-    if ((!objType || !*objType) || (!propName || !*propName)) // require
-        return DEFW_BAD_DATA;
-
-    if (!defwIsPropObjType(objType))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "   %s %s INTEGER ", objType, propName);
-    if (leftRange || rightRange)
-        fprintf(defwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-    if (propValue)
-        fprintf(defwFile, "%d ", propValue);
-
-    fprintf(defwFile, ";\n");
-
-    defwLines++;
-    defwState = DEFW_PROP;
-    return DEFW_OK;
-}
-
-
-int
-defwRealPropDef(const char  *objType,
-                const char  *propName,
-                double      leftRange,
-                double      rightRange,    // optional 
-                double      propValue                        // optional 
-                )
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PROP_START &&
-        defwState != DEFW_PROP)
-        return DEFW_BAD_ORDER;
-    if ((!objType || !*objType) || (!propName || !*propName)) // require
-        return DEFW_BAD_DATA;
-
-    if (!defwIsPropObjType(objType))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "   %s %s REAL ", objType, propName);
-    if (leftRange || rightRange)
-        fprintf(defwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-    if (propValue)
-        fprintf(defwFile, "%.11g ", propValue);
-
-    fprintf(defwFile, ";\n");
-
-    defwLines++;
-    defwState = DEFW_PROP;
-    return DEFW_OK;
-}
-
-
-int
-defwStringPropDef(const char    *objType,
-                  const char    *propName,
-                  double        leftRange,
-                  double        rightRange,    // optional 
-                  const char    *propValue                   // optional 
-                  )
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PROP_START &&
-        defwState != DEFW_PROP)
-        return DEFW_BAD_ORDER;
-    if ((!objType || !*objType) || (!propName || !*propName))
-        return DEFW_BAD_DATA;
-
-    if (!defwIsPropObjType(objType))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "   %s %s STRING ", objType, propName);
-    if (leftRange || rightRange)
-        fprintf(defwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-    if (propValue)
-        fprintf(defwFile, "\"%s\" ", propValue);  // string, set quotes
-
-    fprintf(defwFile, ";\n");
-
-    defwLines++;
-    defwState = DEFW_PROP;
-    return DEFW_OK;
-}
-
-
-int
-defwEndPropDef()
-{
-    defwFunc = DEFW_PROP_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PROP_START &&
-        defwState != DEFW_PROP)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "END PROPERTYDEFINITIONS\n\n");
-    defwLines++;
-
-    defwState = DEFW_PROP_END;
-    return DEFW_OK;
-}
-
-int
-defwIsPropState()
-{
-    if ((defwState != DEFW_ROW) && (defwState != DEFW_REGION) &&
-        (defwState != DEFW_COMPONENT) && (defwState != DEFW_PIN) &&
-        (defwState != DEFW_SNET) && (defwState != DEFW_NET) &&
-        (defwState != DEFW_GROUP) && (defwState != DEFW_PINPROP) &&
-        (defwState != DEFW_SNET_OPTIONS) && (defwState != DEFW_NET_OPTIONS) &&
-        (defwState != DEFW_NDR) && (defwState != DEFW_BEGINEXT))
-        return 0;
-    return 1;
-}
-
-int
-defwStringProperty(const char   *propName,
-                   const char   *propValue)
-{
-    if (!defwIsPropState())
-        return DEFW_BAD_ORDER;
-
-    // new line for the defwRow of the previous line
-    // do not end with newline, may have more than on properties
-    fprintf(defwFile, "\n      + PROPERTY %s \"%s\" ", propName, propValue);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwRealProperty(const char *propName,
-                 double     propValue)
-{
-    if (!defwIsPropState())
-        return DEFW_BAD_ORDER;
-
-    // new line for the defwRow of the previous line
-    // do not end with newline, may have more than on properties
-    fprintf(defwFile, "\n      + PROPERTY %s %.11g ", propName, propValue);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwIntProperty(const char  *propName,
-                int         propValue)
-{
-    if (!defwIsPropState())
-        return DEFW_BAD_ORDER;
-
-    // new line for the defwRow of the previous line
-    // do not end with newline, may have more than on properties
-    fprintf(defwFile, "\n      + PROPERTY %s %d ", propName, propValue);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwDieArea(int xl,
-            int yl,
-            int xh,
-            int yh)
-{
-    defwFunc = DEFW_DIE_AREA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_DIE_AREA)
-        return DEFW_BAD_ORDER;
-    if (xl > xh || yl > yh)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "DIEAREA ( %d %d ) ( %d %d ) ;\n", xl, yl, xh, yh);
-    defwLines++;
-
-    defwState = DEFW_DIE_AREA;
-    return DEFW_OK;
-}
-
-
-int
-defwDieAreaList(int num_points,
-                int *xl,
-                int *yl)
-{
-    int i;
-
-    defwFunc = DEFW_DIE_AREA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_DIE_AREA)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (num_points < 4)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "DIEAREA ");
-    for (i = 0; i < num_points; i++) {
-        if (i == 0)
-            fprintf(defwFile, "( %d %d ) ", *xl++, *yl++);
-        else {
-            if ((i % 5) == 0) {
-                fprintf(defwFile, "\n        ( %d %d ) ", *xl++, *yl++);
-                defwLines++;
-            } else
-                fprintf(defwFile, "( %d %d ) ", *xl++, *yl++);
-        }
-    }
-    fprintf(defwFile, ";\n");
-    defwLines++;
-
-    defwState = DEFW_DIE_AREA;
-    return DEFW_OK;
-}
-
-
-char *
-defwAddr(const char *x)
-{
-    return (char*) x;
-}
-
-
-char *
-defwOrient(int num)
-{
-    switch (num) {
-    case 0:
-        return defwAddr("N");
-    case 1:
-        return defwAddr("W");
-    case 2:
-        return defwAddr("S");
-    case 3:
-        return defwAddr("E");
-    case 4:
-        return defwAddr("FN");
-    case 5:
-        return defwAddr("FW");
-    case 6:
-        return defwAddr("FS");
-    case 7:
-        return defwAddr("FE");
-    };
-    return defwAddr("BOGUS ");
-}
-
-
-int
-defwRow(const char  *rowName,
-        const char  *rowType,
-        int         x_orig,
-        int         y_orig,
-        int         orient,
-        int         do_count,
-        int         do_increment,
-        int         do_x,
-        int         do_y)
-{
-    defwFunc = DEFW_ROW;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n");// add the ; and newline for the previous row.
-
-    // required
-    if ((rowName == 0) || (*rowName == 0) || (rowType == 0) || (*rowType == 0))
-        return DEFW_BAD_DATA;
-
-    // do not have ; because the row may have properties
-    // do not end with newline, if there is no property, ; need to be concat.
-    fprintf(defwFile, "ROW %s %s %d %d %s ", rowName, rowType, x_orig, y_orig,
-            defwOrient(orient));
-    if ((do_count != 0) || (do_increment != 0)) {
-        fprintf(defwFile, "DO %d BY %d ", do_count, do_increment);
-        if ((do_x != 0) || (do_y != 0))
-            fprintf(defwFile, "STEP %d %d ", do_x, do_y);
-    }
-    defwLines++;
-
-    defwState = DEFW_ROW;
-    return DEFW_OK;
-}
-
-
-int
-defwRowStr(const char   *rowName,
-           const char   *rowType,
-           int          x_orig,
-           int          y_orig,
-           const char   *orient,
-           int          do_count,
-           int          do_increment,
-           int          do_x,
-           int          do_y)
-{
-    defwFunc = DEFW_ROW;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n");// add the ; and newline for the previous row.
-
-    if ((!rowName || !*rowName) || (!rowType || !*rowType)) // required
-        return DEFW_BAD_DATA;
-
-    // do not have ; because the row may have properties
-    // do not end with newline, if there is no property, ; need to be concat.
-    fprintf(defwFile, "ROW %s %s %d %d %s ", rowName, rowType, x_orig, y_orig,
-            orient);
-    if ((do_count != 0) || (do_increment != 0)) {
-        fprintf(defwFile, "DO %d BY %d ", do_count, do_increment);
-        if ((do_x != 0) || (do_y != 0))
-            fprintf(defwFile, "STEP %d %d ", do_x, do_y);
-    }
-    defwLines++;
-
-    defwState = DEFW_ROW;
-    return DEFW_OK;
-}
-
-
-int
-defwTracks(const char   *master,
-           int          do_start,
-           int          do_cnt,
-           int          do_step,
-           int          num_layers,
-           const char   **layers,
-           int          mask,
-           int          sameMask)
-{
-    int i;
-
-    defwFunc = DEFW_TRACKS;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row
-
-    if (!master || !*master) // required
-        return DEFW_BAD_DATA;
-    if (strcmp(master, "X") && strcmp(master, "Y"))
-        return DEFW_BAD_DATA;
-
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        if (sameMask) {
-            fprintf(defwFile, "TRACKS %s %d DO %d STEP %d MASK %d SAMEMASK LAYER",
-                    master, do_start, do_cnt, do_step, mask);
-        } else {
-            fprintf(defwFile, "TRACKS %s %d DO %d STEP %d MASK %d LAYER",
-                    master, do_start, do_cnt, do_step, mask);
-        }
-    } else {
-        fprintf(defwFile, "TRACKS %s %d DO %d STEP %d LAYER",
-                master, do_start, do_cnt, do_step);
-    }
-
-    for (i = 0; i < num_layers; i++) {
-        fprintf(defwFile, " %s", layers[i]);
-    }
-    fprintf(defwFile, " ;\n");
-    defwLines++;
-
-    defwState = DEFW_TRACKS;
-    return DEFW_OK;
-}
-
-
-int
-defwGcellGrid(const char    *master,
-              int           do_start,
-              int           do_cnt,
-              int           do_step)
-{
-    defwFunc = DEFW_GCELL_GRID;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    if (!master || !*master) // required
-        return DEFW_BAD_DATA;
-    if (strcmp(master, "X") && strcmp(master, "Y"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "GCELLGRID %s %d DO %d STEP %d ;\n", master, do_start,
-            do_cnt, do_step);
-    defwLines++;
-
-    defwState = DEFW_GCELL_GRID;
-    return DEFW_OK;
-}
-
-
-int
-defwStartDefaultCap(int count)
-{
-    defwObsoleteNum = DEFW_DEFAULTCAP_START;
-    defwFunc = DEFW_DEFAULTCAP_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_DEFAULTCAP_START) &&
-        (defwState <= DEFW_DEFAULTCAP_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum >= 5.4)
-        return DEFW_OBSOLETE;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    fprintf(defwFile, "DEFAULTCAP %d\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_DEFAULTCAP_START;
-    return DEFW_OK;
-}
-
-
-int
-defwDefaultCap(int      pins,
-               double   cap)
-{
-    defwFunc = DEFW_DEFAULTCAP;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_DEFAULTCAP_START &&
-        defwState != DEFW_DEFAULTCAP)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "   MINPINS %d WIRECAP %f ;\n", pins, cap);
-    defwLines++;
-    defwCounter--;
-
-    defwState = DEFW_DEFAULTCAP;
-    return DEFW_OK;
-}
-
-
-int
-defwEndDefaultCap()
-{
-    defwFunc = DEFW_DEFAULTCAP_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_DEFAULTCAP_START &&
-        defwState != DEFW_DEFAULTCAP)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END DEFAULTCAP\n\n");
-    defwLines++;
-
-    defwState = DEFW_DEFAULTCAP_END;
-    return DEFW_OK;
-}
-
-
-int
-defwCanPlace(const char *master,
-             int        xOrig,
-             int        yOrig,
-             int        orient,
-             int        doCnt,
-             int        doInc,
-             int        xStep,
-             int        yStep)
-{
-    defwFunc = DEFW_CANPLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    if ((master == 0) || (*master == 0)) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "CANPLACE %s %d %d %s DO %d BY %d STEP %d %d ;\n",
-            master, xOrig, yOrig, defwOrient(orient),
-            doCnt, doInc, xStep, yStep);
-    defwLines++;
-
-    defwState = DEFW_CANPLACE;
-    return DEFW_OK;
-}
-
-
-int
-defwCanPlaceStr(const char  *master,
-                int         xOrig,
-                int         yOrig,
-                const char  *orient,
-                int         doCnt,
-                int         doInc,
-                int         xStep,
-                int         yStep)
-{
-    defwFunc = DEFW_CANPLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    if (!master || !*master) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "CANPLACE %s %d %d %s DO %d BY %d STEP %d %d ;\n",
-            master, xOrig, yOrig, orient,
-            doCnt, doInc, xStep, yStep);
-    defwLines++;
-
-    defwState = DEFW_CANPLACE;
-    return DEFW_OK;
-}
-
-
-int
-defwCannotOccupy(const char *master,
-                 int        xOrig,
-                 int        yOrig,
-                 int        orient,
-                 int        doCnt,
-                 int        doInc,
-                 int        xStep,
-                 int        yStep)
-{
-    defwFunc = DEFW_CANNOTOCCUPY;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if ((master == 0) || (*master == 0)) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "CANNOTOCCUPY %s %d %d %s DO %d BY %d STEP %d %d ;\n",
-            master, xOrig, yOrig, defwOrient(orient),
-            doCnt, doInc, xStep, yStep);
-    defwLines++;
-
-    defwState = DEFW_CANNOTOCCUPY;
-    return DEFW_OK;
-}
-
-
-int
-defwCannotOccupyStr(const char  *master,
-                    int         xOrig,
-                    int         yOrig,
-                    const char  *orient,
-                    int         doCnt,
-                    int         doInc,
-                    int         xStep,
-                    int         yStep)
-{
-    defwFunc = DEFW_CANNOTOCCUPY;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-
-    if (!master || !*master) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "CANNOTOCCUPY %s %d %d %s DO %d BY %d STEP %d %d ;\n",
-            master, xOrig, yOrig, orient,
-            doCnt, doInc, xStep, yStep);
-    defwLines++;
-
-    defwState = DEFW_CANNOTOCCUPY;
-    return DEFW_OK;
-}
-
-
-int
-defwStartVias(int count)
-{
-    defwFunc = DEFW_VIA_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_VIA_START) && (defwState <= DEFW_VIA_END))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    fprintf(defwFile, "VIAS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_VIA_START;
-    return DEFW_OK;
-}
-
-
-int
-defwViaName(const char *name)
-{
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA_START &&
-        defwState != DEFW_VIAONE_END)
-        return DEFW_BAD_ORDER;
-    defwCounter--;
-
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "   - %s", name);
-
-    defwState = DEFW_VIA;
-    defwViaHasVal = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwViaPattern(const char *pattern)
-{
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA)
-        return DEFW_BAD_ORDER;  // after defwViaName
-
-    if (defwViaHasVal)
-        return DEFW_ALREADY_DEFINED;  // either PatternName or
-    // ViaRule has defined
-    if (!pattern || !*pattern) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, " + PATTERNNAME %s", pattern);
-
-    defwState = DEFW_VIA;
-    defwViaHasVal = 1;
-    return DEFW_OK;
-}
-
-
-int
-defwViaRect(const char  *layerNames,
-            int         xl,
-            int         yl,
-            int         xh,
-            int         yh,
-            int         mask)
-{
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA)
-        return DEFW_BAD_ORDER;
-
-    if (!layerNames || !*layerNames) // required
-        return DEFW_BAD_DATA;
-    if (!mask) {
-        fprintf(defwFile, "\n      + RECT %s ( %d %d ) ( %d %d )", layerNames,
-                xl, yl, xh, yh);
-    } else {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n      + RECT %s + MASK %d ( %d %d ) ( %d %d )",
-                layerNames, mask, xl, yl, xh, yh);
-    }
-    defwLines++;
-
-
-    defwState = DEFW_VIA;
-    return DEFW_OK;
-}
-
-int
-defwViaPolygon(const char   *layerName,
-               int          num_polys,
-               double       *xl,
-               double       *yl,
-               int          mask)
-{
-    int i;
-
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA)
-        return DEFW_BAD_ORDER;
-
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-
-    if (!mask) {
-        fprintf(defwFile, "\n      + POLYGON %s ", layerName);
-    } else {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n      + POLYGON %s + MASK %d ", layerName, mask);
-    }
-
-    printPointsNum = 0;
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-        else {
-            printPoints(defwFile, *xl++, *yl++, "\n                ", " ");
-            defwLines++;
-        }
-    }
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwViaViarule(const char   *viaRuleName,
-               double       xCutSize,
-               double       yCutSize,
-               const char   *botMetalLayer,
-               const char   *cutLayer,
-               const char   *topMetalLayer,
-               double       xCutSpacing,
-               double       yCutSpacing,
-               double       xBotEnc,
-               double       yBotEnc,
-               double       xTopEnc,
-               double       yTopEnc)
-{
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA)
-        return DEFW_BAD_ORDER;
-    if (defwViaHasVal)
-        return DEFW_ALREADY_DEFINED;  // either PatternName or
-    // ViaRule has defined
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, " + VIARULE %s\n", viaRuleName);
-    fprintf(defwFile, "      + CUTSIZE %.11g %.11g\n", xCutSize, yCutSize);
-    fprintf(defwFile, "      + LAYERS %s %s %s\n", botMetalLayer,
-            cutLayer, topMetalLayer);
-    fprintf(defwFile, "      + CUTSPACING %.11g %.11g\n",
-            xCutSpacing, yCutSpacing);
-    fprintf(defwFile, "      + ENCLOSURE %.11g %.11g %.11g %.11g",
-            xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-    defwLines += 5;
-    defwState = DEFW_VIAVIARULE;
-    defwViaHasVal = 1;
-    return DEFW_OK;
-}
-
-int
-defwViaViaruleRowCol(int    numCutRows,
-                     int    numCutCols)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIAVIARULE)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ROWCOL %d %d", numCutRows, numCutCols);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwViaViaruleOrigin(int    xOffset,
-                     int    yOffset)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIAVIARULE)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ORIGIN %d %d", xOffset, yOffset);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwViaViaruleOffset(int    xBotOffset,
-                     int    yBotOffset,
-                     int    xTopOffset,
-                     int    yTopOffset)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIAVIARULE)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + OFFSET %d %d %d %d",
-            xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwViaViarulePattern(const char *cutPattern)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIAVIARULE)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + PATTERN %s", cutPattern);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwOneViaEnd()
-{
-    defwFunc = DEFW_VIA;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState != DEFW_VIA) && (defwState != DEFW_VIAVIARULE))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, " ;\n");
-    defwLines++;
-
-    defwState = DEFW_VIAONE_END;
-    return DEFW_OK;
-}
-
-
-int
-defwEndVias()
-{
-    defwFunc = DEFW_VIA_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_VIA_START &&
-        defwState != DEFW_VIAONE_END)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END VIAS\n\n");
-    defwLines++;
-
-    defwState = DEFW_VIA_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartRegions(int count)
-{
-    defwFunc = DEFW_REGION_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_REGION_START) && (defwState <= DEFW_REGION_END))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    fprintf(defwFile, "REGIONS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_REGION_START;
-    return DEFW_OK;
-}
-
-
-int
-defwRegionName(const char *name)
-{
-    defwFunc = DEFW_REGION;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_REGION_START &&
-        defwState != DEFW_REGION)
-        return DEFW_BAD_ORDER;
-    defwCounter--;
-
-    if (defwState == DEFW_REGION)
-        fprintf(defwFile, ";\n");  // add the ; and \n for the previous row.
-
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "   - %s ", name);
-    defwState = DEFW_REGION;
-    return DEFW_OK;
-}
-
-
-int
-defwRegionPoints(int    xl,
-                 int    yl,
-                 int    xh,
-                 int    yh)
-{
-    defwFunc = DEFW_REGION;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_REGION)
-        return DEFW_BAD_ORDER;  // after RegionName
-
-    fprintf(defwFile, "      ( %d %d ) ( %d %d ) ", xl, yl, xh, yh);
-
-    defwState = DEFW_REGION;
-    return DEFW_OK;
-}
-
-
-int
-defwRegionType(const char *type)
-{
-    defwFunc = DEFW_REGION;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_REGION)
-        return DEFW_BAD_ORDER;  // after RegionName
-
-    if (!type || !*type) // required
-        return DEFW_BAD_DATA;
-    if (strcmp(type, "FENCE") && strcmp(type, "GUIDE"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "         + TYPE %s ", type);
-
-    defwState = DEFW_REGION;
-    return DEFW_OK;
-}
-
-
-int
-defwEndRegions()
-{
-    defwFunc = DEFW_REGION_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_REGION_START &&
-        defwState != DEFW_REGION)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    if (defwState == DEFW_REGION)
-        fprintf(defwFile, ";\nEND REGIONS\n\n");  // ; for the previous statement
-    else
-        fprintf(defwFile, "END REGIONS\n\n");  // ; for the previous statement
-    defwLines++;
-
-    defwState = DEFW_REGION_END;
-    return DEFW_OK;
-}
-
-
-int
-defwComponentMaskShiftLayers(const char **layerNames,
-                             int        numLayerName)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_COMPONENT_MASKSHIFTLAYERS;
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if (defwState == DEFW_COMPONENT_MASKSHIFTLAYERS)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "COMPONENTMASKSHIFT ");
-
-    if (numLayerName) {
-        for (int i = 0; i < numLayerName; i++)
-            fprintf(defwFile, "%s ", layerNames[i]);
-    }
-
-    fprintf(defwFile, ";\n\n");
-
-    defwLines++;
-
-    defwState = DEFW_COMPONENT_MASKSHIFTLAYERS;
-    return DEFW_OK;
-}
-
-
-int
-defwStartComponents(int count)
-{
-    defwFunc = DEFW_COMPONENT_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_COMPONENT_START) && (defwState <= DEFW_COMPONENT_END))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    fprintf(defwFile, "COMPONENTS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_COMPONENT_START;
-    return DEFW_OK;
-}
-
-
-int
-defwComponent(const char    *instance,
-              const char    *master,
-              int           numNetName,
-              const char    **netNames,
-              const char    *eeq,
-              const char    *genName,
-              const char    *genParemeters,
-              const char    *source,
-              int           numForeign,
-              const char    **foreigns,
-              int           *foreignX,
-              int           *foreignY,
-              int           *foreignOrients,
-              const char    *status,
-              int           statusX,
-              int           statusY,
-              int           statusOrient,
-              double        weight,
-              const char    *region,
-              int           xl,
-              int           yl,
-              int           xh,
-              int           yh)
-{
-
-    int i;
-    int uplace = 0;
-
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_COMPONENT_START &&
-        defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    defwCounter--;
-
-    // required
-    if ((instance == 0) || (*instance == 0) || (master == 0) || (*master == 0))
-        return DEFW_BAD_DATA;
-
-    if (source && strcmp(source, "NETLIST") && strcmp(source, "DIST") &&
-        strcmp(source, "USER") && strcmp(source, "TIMING"))
-        return DEFW_BAD_DATA;
-
-    if (status) {
-        if (strcmp(status, "UNPLACED") == 0) {
-            uplace = 1;
-        } else if (strcmp(status, "COVER") && strcmp(status, "FIXED") &&
-                   strcmp(status, "PLACED"))
-            return DEFW_BAD_DATA;
-    }
-
-    // only either region or xl, yl, xh, yh
-    if (region && (xl || yl || xh || yh))
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_COMPONENT)
-        fprintf(defwFile, ";\n");       // newline for the previous component
-
-    fprintf(defwFile, "   - %s %s ", instance, master);
-    if (numNetName) {
-        for (i = 0; i < numNetName; i++)
-            fprintf(defwFile, "%s ", netNames[i]);
-    }
-    defwLines++;
-    // since the rest is optionals, new line is placed before the options
-    if (eeq) {
-        fprintf(defwFile, "\n      + EEQMASTER %s ", eeq);
-        defwLines++;
-    }
-    if (genName) {
-        fprintf(defwFile, "\n      + GENERATE %s ", genName);
-        if (genParemeters)
-            fprintf(defwFile, " %s ", genParemeters);
-        defwLines++;
-    }
-    if (source) {
-        fprintf(defwFile, "\n      + SOURCE %s ", source);
-        defwLines++;
-    }
-    if (numForeign) {
-        for (i = 0; i < numForeign; i++) {
-            fprintf(defwFile, "\n      + FOREIGN %s ( %d %d ) %s ", foreigns[i],
-                    foreignX[i], foreignY[i], defwOrient(foreignOrients[i]));
-            defwLines++;
-        }
-    }
-    if (status && (uplace == 0)) {
-        fprintf(defwFile, "\n      + %s ( %d %d ) %s ", status, statusX, statusY,
-                defwOrient(statusOrient));
-    } else if (uplace) {
-        fprintf(defwFile, "\n      + %s ", status);
-    }
-    defwLines++;
-    if (weight) {
-        fprintf(defwFile, "\n      + WEIGHT %.11g ", weight);
-        defwLines++;
-    }
-    if (region) {
-        fprintf(defwFile, "\n      + REGION %s ", region);
-        defwLines++;
-    } else if (xl || yl || xh || yh) {
-        fprintf(defwFile, "\n      + REGION ( %d %d ) ( %d %d ) ",
-                xl, yl, xh, yh);
-        defwLines++;
-    }
-
-    defwState = DEFW_COMPONENT;
-    return DEFW_OK;
-}
-
-
-int
-defwComponentStr(const char *instance,
-                 const char *master,
-                 int        numNetName,
-                 const char **netNames,
-                 const char *eeq,
-                 const char *genName,
-                 const char *genParemeters,
-                 const char *source,
-                 int        numForeign,
-                 const char **foreigns,
-                 int        *foreignX,
-                 int        *foreignY,
-                 const char **foreignOrients,
-                 const char *status,
-                 int        statusX,
-                 int        statusY,
-                 const char *statusOrient,
-                 double     weight,
-                 const char *region,
-                 int        xl,
-                 int        yl,
-                 int        xh,
-                 int        yh)
-{
-
-    int i;
-    int uplace = 0;
-
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_COMPONENT_START &&
-        defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    defwCounter--;
-
-    if ((!instance || !*instance) || (!master || !*master)) // required
-        return DEFW_BAD_DATA;
-
-    if (source && strcmp(source, "NETLIST") && strcmp(source, "DIST") &&
-        strcmp(source, "USER") && strcmp(source, "TIMING"))
-        return DEFW_BAD_DATA;
-
-    if (status) {
-        if (strcmp(status, "UNPLACED") == 0) {
-            uplace = 1;
-        } else if (strcmp(status, "COVER") && strcmp(status, "FIXED") &&
-                   strcmp(status, "PLACED"))
-            return DEFW_BAD_DATA;
-    }
-
-    // only either region or xl, yl, xh, yh
-    if (region && (xl || yl || xh || yh))
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_COMPONENT)
-        fprintf(defwFile, ";\n");       // newline for the previous component
-
-    fprintf(defwFile, "   - %s %s ", instance, master);
-    if (numNetName) {
-        for (i = 0; i < numNetName; i++)
-            fprintf(defwFile, "%s ", netNames[i]);
-    }
-    defwLines++;
-    // since the rest is optionals, new line is placed before the options
-    if (eeq) {
-        fprintf(defwFile, "\n      + EEQMASTER %s ", eeq);
-        defwLines++;
-    }
-    if (genName) {
-        fprintf(defwFile, "\n      + GENERATE %s ", genName);
-        if (genParemeters)
-            fprintf(defwFile, " %s ", genParemeters);
-        defwLines++;
-    }
-    if (source) {
-        fprintf(defwFile, "\n      + SOURCE %s ", source);
-        defwLines++;
-    }
-    if (numForeign) {
-        for (i = 0; i < numForeign; i++) {
-            fprintf(defwFile, "\n      + FOREIGN %s ( %d %d ) %s ", foreigns[i],
-                    foreignX[i], foreignY[i], foreignOrients[i]);
-            defwLines++;
-        }
-    }
-    if (status && (uplace == 0)) {
-        fprintf(defwFile, "\n      + %s ( %d %d ) %s ", status, statusX, statusY,
-                statusOrient);
-    } else if (uplace) {
-        fprintf(defwFile, "\n      + %s ", status);
-    }
-    defwLines++;
-    if (weight) {
-        fprintf(defwFile, "\n      + WEIGHT %.11g ", weight);
-        defwLines++;
-    }
-    if (region) {
-        fprintf(defwFile, "\n      + REGION %s ", region);
-        defwLines++;
-    } else if (xl || yl || xh || yh) {
-        fprintf(defwFile, "\n      + REGION ( %d %d ) ( %d %d ) ",
-                xl, yl, xh, yh);
-        defwLines++;
-    }
-
-    defwState = DEFW_COMPONENT;
-    return DEFW_OK;
-}
-
-int
-defwComponentMaskShift(int shiftLayerMasks)
-{
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    if (defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + MASKSHIFT %d ", shiftLayerMasks);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwComponentHalo(int   left,
-                  int   bottom,
-                  int   right,
-                  int   top)
-{
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + HALO %d %d %d %d ", left, bottom, right, top);
-    defwLines++;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwComponentHaloSoft(int   left,
-                      int   bottom,
-                      int   right,
-                      int   top)
-{
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-    if (defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + HALO SOFT %d %d %d %d ", left, bottom,
-            right, top);
-    defwLines++;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwComponentRouteHalo(int          haloDist,
-                       const char   *minLayer,
-                       const char   *maxLayer)
-{
-    defwFunc = DEFW_COMPONENT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-    if (defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ROUTEHALO %d %s %s ", haloDist, minLayer,
-            maxLayer);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwEndComponents()
-{
-    defwFunc = DEFW_COMPONENT_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_COMPONENT_START &&
-        defwState != DEFW_COMPONENT)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    defwDidComponents = 1;
-
-    if (defwState == DEFW_COMPONENT)
-        fprintf(defwFile, ";\nEND COMPONENTS\n\n");
-    else
-        fprintf(defwFile, "END COMPONENTS\n\n");
-    defwLines++;
-
-    defwState = DEFW_COMPONENT_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartPins(int count)
-{
-    defwFunc = DEFW_PIN_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidComponents)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_PIN_START) && (defwState <= DEFW_PIN_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "PINS %d", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_PIN_START;
-    return DEFW_OK;
-}
-
-
-int
-defwPin(const char  *name,
-        const char  *net,
-        int         special,       // optional 0-ignore 1-special 
-        const char  *direction,                            // optional 
-        const char  *use,                                  // optional 
-        const char  *status,
-        int         xo,
-        int         yo,
-        int         orient,   // optional 
-        const char  *layer,
-        int         xl,
-        int         yl,
-        int         xh,
-        int         yh // optional 
-        )
-{
-
-    defwFunc = DEFW_PIN;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN_START && defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-
-    defwCounter--;
-
-    fprintf(defwFile, " ;\n   - %s + NET %s", name, net);
-
-    if (special)
-        fprintf(defwFile, "\n      + SPECIAL");
-    if (direction) {
-        if (strcmp(direction, "INPUT") && strcmp(direction, "OUTPUT") &&
-            strcmp(direction, "INOUT") && strcmp(direction, "FEEDTHRU"))
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "\n      + DIRECTION %s", direction);
-    }
-    if (use) {
-        if (strcmp(use, "SIGNAL") && strcmp(use, "POWER") &&
-            strcmp(use, "GROUND") && strcmp(use, "CLOCK") &&
-            strcmp(use, "TIEOFF") && strcmp(use, "ANALOG") &&
-            strcmp(use, "SCAN") && strcmp(use, "RESET"))
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "\n      + USE %s", use);
-    }
-    if (status) {
-        if (strcmp(status, "FIXED") && strcmp(status, "PLACED") &&
-            strcmp(status, "COVER"))
-            return DEFW_BAD_DATA;
-
-        fprintf(defwFile, "\n      + %s ( %d %d ) %s", status, xo, yo,
-                defwOrient(orient));
-    }
-    // In 5.6, user should use defPinLayer to write out layer construct 
-    if (layer) {
-        fprintf(defwFile, "\n      + LAYER %s ( %d %d ) ( %d %d )",
-                layer, xl, yl, xh, yh);
-    }
-
-    defwLines++;
-
-    defwState = DEFW_PIN;
-    return DEFW_OK;
-}
-
-
-int
-defwPinStr(const char   *name,
-           const char   *net,
-           int          special,       // optional 0-ignore 1-special 
-           const char   *direction,                                    // optional 
-           const char   *use,                                          // optional 
-           const char   *status,
-           int          xo,
-           int          yo,
-           const char   *orient,   // optional 
-           const char   *layer,
-           int          xl,
-           int          yl,
-           int          xh,
-           int          yh // optional 
-           )
-{
-
-    defwFunc = DEFW_PIN;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN_START && defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-
-    defwCounter--;
-
-    fprintf(defwFile, " ;\n   - %s + NET %s", name, net);
-
-    if (special)
-        fprintf(defwFile, "\n      + SPECIAL");
-    if (direction) {
-        if (strcmp(direction, "INPUT") && strcmp(direction, "OUTPUT") &&
-            strcmp(direction, "INOUT") && strcmp(direction, "FEEDTHRU"))
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "\n      + DIRECTION %s", direction);
-    }
-    if (use) {
-        if (strcmp(use, "SIGNAL") && strcmp(use, "POWER") &&
-            strcmp(use, "GROUND") && strcmp(use, "CLOCK") &&
-            strcmp(use, "TIEOFF") && strcmp(use, "ANALOG") &&
-            strcmp(use, "SCAN") && strcmp(use, "RESET"))
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "\n      + USE %s", use);
-    }
-    if (status) {
-        if (strcmp(status, "FIXED") && strcmp(status, "PLACED") &&
-            strcmp(status, "COVER"))
-            return DEFW_BAD_DATA;
-
-        fprintf(defwFile, "\n      + %s ( %d %d ) %s", status, xo, yo,
-                orient);
-    }
-    // In 5.6, user should use defPinLayer to write out layer construct 
-    if (layer) {
-        fprintf(defwFile, "\n      + LAYER %s ( %d %d ) ( %d %d )",
-                layer, xl, yl, xh, yh);
-    }
-
-    defwLines++;
-
-    defwState = DEFW_PIN;
-    return DEFW_OK;
-}
-
-int
-defwPinLayer(const char *layerName,
-             int        spacing,
-             int        designRuleWidth,
-             int        xl,
-             int        yl,
-             int        xh,
-             int        yh,
-             int        mask)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (spacing && designRuleWidth)
-        return DEFW_BAD_DATA;  // only one, spacing
-    // or designRuleWidth can be defined, not both
-
-    fprintf(defwFile, "\n      + LAYER %s ", layerName);
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n        MASK %d", mask);
-    }
-
-    if (spacing)
-        fprintf(defwFile, "\n        SPACING %d", spacing);
-    else if (designRuleWidth)        // can be both 0
-        fprintf(defwFile, "\n        DESIGNRULEWIDTH  %d", designRuleWidth);
-    fprintf(defwFile, "\n        ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-
-    defwState = DEFW_PIN;
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwPinPolygon(const char   *layerName,
-               int          spacing,
-               int          designRuleWidth,
-               int          num_polys,
-               double       *xl,
-               double       *yl,
-               int          mask)
-{
-    int i;
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (spacing && designRuleWidth)
-        return DEFW_BAD_DATA; // only one, spacing
-    // or designRuleWidth can be defined, not both
-
-    fprintf(defwFile, "\n      + POLYGON %s ", layerName);
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n        MASK %d", mask);
-    }
-
-    if (spacing)
-        fprintf(defwFile, "\n        SPACING %d", spacing);
-    else if (designRuleWidth)        // can be both 0
-        fprintf(defwFile, "\n        DESIGNRULEWIDTH  %d", designRuleWidth);
-
-    printPointsNum = 0;
-
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) == 0)) {
-            printPoints(defwFile, *xl++, *yl++, "\n        ", " ");
-            defwLines++; 
-        } else
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-    }
-   
-    defwState = DEFW_PIN;
-    defwLines++;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwPinVia(const char   *viaName,
-           int          xl,
-           int          yl,
-           int          mask)
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n      + VIA %s MASK %d ( %d %d ) ", viaName, mask, xl, yl);
-    } else {
-        fprintf(defwFile, "\n      + VIA %s ( %d %d ) ", viaName, xl, yl);
-    }
-
-    defwLines++;
-    defwState = DEFW_PIN;
-    return DEFW_OK;
-}
-
-
-// 5.7
-int
-defwPinPort()
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + PORT");
-
-    defwLines++;
-    defwState = DEFW_PIN_PORT;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwPinPortLayer(const char *layerName,
-                 int        spacing,
-                 int        designRuleWidth,
-                 int        xl,
-                 int        yl,
-                 int        xh,
-                 int        yh,
-                 int        mask)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN && defwState != DEFW_PIN_PORT)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-    if (spacing && designRuleWidth)
-        return DEFW_BAD_DATA;  // only one, spacing
-    // or designRuleWidth can be defined, not both
-
-    fprintf(defwFile, "\n        + LAYER %s ", layerName);
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n          MASK %d", mask);
-    }
-
-    if (spacing)
-        fprintf(defwFile, "\n          SPACING %d", spacing);
-    else if (designRuleWidth)        // can be both 0
-        fprintf(defwFile, "\n          DESIGNRULEWIDTH  %d", designRuleWidth);
-
-    fprintf(defwFile, "\n        ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-
-    defwState = DEFW_PIN;
-    defwLines++;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwPinPortPolygon(const char   *layerName,
-                   int          spacing,
-                   int          designRuleWidth,
-                   int          num_polys,
-                   double       *xl,
-                   double       *yl,
-                   int          mask)
-{
-    int i;
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN && defwState != DEFW_PIN_PORT)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-    if (spacing && designRuleWidth)
-        return DEFW_BAD_DATA; // only one, spacing
-    // or designRuleWidth can be defined, not both
-
-    fprintf(defwFile, "\n        + POLYGON %s ", layerName);
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n          MASK %d", mask);
-    }
-
-    if (spacing)
-        fprintf(defwFile, "\n          SPACING %d", spacing);
-    else if (designRuleWidth)        // can be both 0
-        fprintf(defwFile, "\n          DESIGNRULEWIDTH  %d", designRuleWidth);
-
-    printPointsNum = 0;
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) == 0)) {
-            printPoints(defwFile, *xl++, *yl++, "\n          ", " ");
-            defwLines++; 
-        } else
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-    }
-
-    defwState = DEFW_PIN;
-    defwLines++;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwPinPortVia(const char   *viaName,
-               int          xl,
-               int          yl,
-               int          mask)
-{
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN && defwState != DEFW_PIN_PORT)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-
-    if (mask) {
-        if (defVersionNum < 5.8) {
-            return DEFW_WRONG_VERSION;
-        }
-
-        fprintf(defwFile, "\n        + VIA %s MASK %d ( %d %d ) ", viaName, mask, xl, yl);
-    } else {
-        fprintf(defwFile, "\n        + VIA %s ( %d %d ) ", viaName, xl, yl);
-    }
-
-    defwLines++;
-    defwState = DEFW_PIN;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwPinPortLocation(const char  *status,
-                    int         statusX,
-                    int         statusY,
-                    const char  *orient)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN && defwState != DEFW_PIN_PORT)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.7)
-        return DEFW_WRONG_VERSION;
-
-    if (strcmp(status, "FIXED") && strcmp(status, "PLACED") &&
-        strcmp(status, "COVER"))
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "\n        + %s ( %d %d ) %s ", status, statusX, statusY,
-            orient);
-    defwState = DEFW_PIN;
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwPinNetExpr(const char *pinExpr)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (pinExpr && pinExpr != 0 && *pinExpr != 0)
-        fprintf(defwFile, "\n      + NETEXPR \"%s\"", pinExpr);
-
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwPinSupplySensitivity(const char *pinName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (pinName && pinName != 0 && *pinName != 0)
-        fprintf(defwFile, "\n      + SUPPLYSENSITIVITY %s", pinName);
-
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwPinGroundSensitivity(const char *pinName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-    if (pinName && pinName != 0 && *pinName != 0)
-        fprintf(defwFile, "\n      + GROUNDSENSITIVITY %s", pinName);
-
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinPartialMetalArea(int           value,
-                                  const char    *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINPARTIALMETALAREA %d", value);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinPartialMetalSideArea(int           value,
-                                      const char    *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINPARTIALMETALSIDEAREA %d", value);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinPartialCutArea(int         value,
-                                const char  *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINPARTIALCUTAREA %d", value);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaModel(const char *oxide)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAMODEL %s", oxide);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinDiffArea(int           value,
-                          const char    *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINDIFFAREA %d", value);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinGateArea(int           value,
-                          const char    *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINGATEAREA %d", value);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinMaxAreaCar(int         value,
-                            const char  *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINMAXAREACAR %d", value);
-    if (!layerName)
-        return DEFW_BAD_DATA;  // layerName is required 
-
-    fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinMaxSideAreaCar(int         value,
-                                const char  *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINMAXSIDEAREACAR %d", value);
-    if (!layerName)
-        return DEFW_BAD_DATA;  // layerName is required 
-
-    fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwPinAntennaPinMaxCutCar(int          value,
-                           const char   *layerName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + ANTENNAPINMAXCUTCAR %d", value);
-    if (!layerName)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, " LAYER %s", layerName);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwEndPins()
-{
-    defwFunc = DEFW_PIN_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PIN_START && defwState != DEFW_PIN)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, " ;\nEND PINS\n\n");
-    defwLines++;
-
-    defwState = DEFW_PIN_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartPinProperties(int count)
-{
-    defwFunc = DEFW_PINPROP_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_PINPROP_START) && (defwState <= DEFW_PINPROP_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "PINPROPERTIES %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_PINPROP_START;
-    return DEFW_OK;
-}
-
-
-int
-defwPinProperty(const char  *name,
-                const char  *pinName)
-{
-
-    defwFunc = DEFW_PINPROP;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PINPROP_START &&
-        defwState != DEFW_PINPROP)
-        return DEFW_BAD_ORDER;
-
-    defwCounter--;
-    if ((!name || !*name) || (!pinName || !*pinName)) // required
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_PINPROP)
-        fprintf(defwFile, ";\n");
-
-    fprintf(defwFile, "   - %s %s ", name, pinName);
-    defwLines++;
-
-    defwState = DEFW_PINPROP;
-    return DEFW_OK;
-}
-
-
-int
-defwEndPinProperties()
-{
-    defwFunc = DEFW_PIN_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PINPROP_START &&
-        defwState != DEFW_PINPROP)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    if (defwState == DEFW_PINPROP_START)
-        fprintf(defwFile, "END PINPROPERTIES\n\n");
-    else
-        fprintf(defwFile, ";\nEND PINPROPERTIES\n\n");
-    defwLines++;
-
-    defwState = DEFW_PINPROP_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartSpecialNets(int count)
-{
-    defwFunc = DEFW_SNET_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_SNET_START) && (defwState <= DEFW_SNET_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "SPECIALNETS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_SNET_START;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetOptions()
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (defwState == DEFW_SNET) {
-        defwState = DEFW_SNET_OPTIONS;
-        return 1;
-    }
-    if (defwState == DEFW_SNET_OPTIONS)
-        return 1;
-    return 0;
-}
-
-
-int
-defwSpecialNet(const char *name)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SNET_START &&
-        defwState != DEFW_SNET_ENDNET)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_SNET;
-
-    fprintf(defwFile, "   - %s", name);
-    defwLineItemCounter = 0;
-    defwCounter--;
-
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetConnection(const char *inst,
-                         const char *pin,
-                         int        synthesized)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SNET)
-        return DEFW_BAD_ORDER;
-
-    if ((++defwLineItemCounter & 3) == 0) { // since a net can have more than
-        fprintf(defwFile, "\n     ");  // one inst pin connection, don't print
-        defwLines++;             // newline until the line is certain length
-    }
-    fprintf(defwFile, " ( %s %s ", inst, pin);
-    if (synthesized)
-        fprintf(defwFile, " + SYNTHESIZED ");
-    fprintf(defwFile, ") ");
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetFixedbump()
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + FIXEDBUMP");
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwSpecialNetVoltage(double d)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    int v = (int)(d * 1000);
-
-    fprintf(defwFile, "\n      + VOLTAGE %d", v);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetSpacing(const char    *layer,
-                      int           spacing,
-                      double        minwidth,
-                      double        maxwidth)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + SPACING %s %d", layer, spacing);
-    if (minwidth || maxwidth)
-        fprintf(defwFile, " RANGE %.11g %.11g", minwidth, maxwidth);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetWidth(const char  *layer,
-                    int         w)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + WIDTH %s %d", layer, w);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetSource(const char *name)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + SOURCE %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetOriginal(const char *name)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ORIGINAL %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPattern(const char *name)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + PATTERN %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetUse(const char *name)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(name, "SIGNAL") && strcmp(name, "POWER") &&
-        strcmp(name, "GROUND") && strcmp(name, "CLOCK") &&
-        strcmp(name, "TIEOFF") && strcmp(name, "ANALOG") &&
-        strcmp(name, "SCAN") && strcmp(name, "RESET"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + USE %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetWeight(double d)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + WEIGHT %.11g", d);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetEstCap(double d)
-{
-    defwFunc = DEFW_SNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ESTCAP %.11g", d);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwSpecialNetPathStart(const char *typ)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions() &&
-        (defwState != DEFW_SUBNET) && // path in subnet 
-        (defwState != DEFW_PATH))   // NEW in the path, path hasn't end yet 
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(typ, "NEW") && strcmp(typ, "FIXED") && strcmp(typ, "COVER") &&
-        strcmp(typ, "ROUTED") && strcmp(typ, "SHIELD"))
-        return DEFW_BAD_DATA;
-
-    defwSpNetShield = 0;
-
-    // The second time around for a path on this net, we
-    // must start it with a new instead of a fixed...
-    if (strcmp(typ, "NEW") == 0) {
-        if (defwState != DEFW_PATH)
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, " NEW");
-    } else if (strcmp(typ, "SHIELD") == 0) {
-        fprintf(defwFile, "\n      + %s", typ);
-        defwSpNetShield = 1;
-    } else
-        fprintf(defwFile, "\n      + %s", typ);
-
-    defwState = DEFW_PATH_START;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldNetName(const char *name)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH_START)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    if (defwSpNetShield)
-        fprintf(defwFile, " %s", name);
-    else
-        return DEFW_BAD_ORDER;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathWidth(int w)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %d", w);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathLayer(const char *name)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH_START)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    defwState = DEFW_PATH;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathStyle(int styleNum)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, "\n      + STYLE %d", styleNum);
-    defwState = DEFW_PATH;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathShape(const char *typ)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(typ, "RING") && strcmp(typ, "STRIPE") && strcmp(typ, "FOLLOWPIN") &&
-        strcmp(typ, "IOWIRE") && strcmp(typ, "COREWIRE") &&
-        strcmp(typ, "BLOCKWIRE") && strcmp(typ, "FILLWIRE") &&
-        strcmp(typ, "BLOCKAGEWIRE") && strcmp(typ, "PADRING") &&
-        strcmp(typ, "BLOCKRING") && strcmp(typ, "DRCFILL") &&
-        strcmp(typ, "FILLWIREOPC"))      // 5.7
-        return DEFW_BAD_DATA;
-
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, "\n      + SHAPE %s", typ);
-
-    defwState = DEFW_PATH;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-int
-defwSpecialNetPathMask(int colorMask)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_PATH;   // Current function of writer
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " MASK %d", colorMask);
-    return DEFW_OK;
-}
-
-int
-defwSpecialNetPathPoint(int     numPts,
-                        double  *pointx,
-                        double  *pointy)
-{
-    int i;
-
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    printPointsNum = 0;
-    for (i = 0; i < numPts; i++) {
-          if ((++defwLineItemCounter & 3) == 0) {
-              fprintf(defwFile, "\n     ");
-              defwLines++;
-          }
-
-          printPoints(defwFile, pointx[i], pointy[i], " ", "");
-      }
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathVia(const char *name)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathViaData(int   numX,
-                          int   numY,
-                          int   stepX,
-                          int   stepY)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " DO %d BY %d STEP %d %d", numX, numY, stepX, stepY);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathPointWithWireExt(int      numPts,
-                                   double   *pointx,
-                                   double   *pointy,
-                                   double   *optValue)
-{
-    int i;
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    for (i = 0; i < numPts; i++) {
-        if ((++defwLineItemCounter & 3) == 0) {
-            fprintf(defwFile, "\n        ");
-            defwLines++;
-        }
-        fprintf(defwFile, " ( %.11g %.11g ", pointx[i], pointy[i]);
-        if (optValue[i])
-            fprintf(defwFile, "%.11g ", optValue[i]);
-        fprintf(defwFile, ")");
-    }
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetPathEnd()
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_SNET_OPTIONS;
-    return DEFW_OK;
-}
-
-
-int 
-defwSpecialNetPolygon(const char* layerName,
-                     int num_polys, 
-                     double* xl, double* yl) {
-                              int i;
-
-                              defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-                              if (! defwSpecialNetOptions() &&
-                                  (defwState != DEFW_PATH))  // not inside a path
-                                  return DEFW_BAD_ORDER;
-
-                              if (defVersionNum < 5.6)
-                                  return DEFW_WRONG_VERSION;
-
-                              fprintf(defwFile, "\n      + POLYGON %s ", layerName);
-
-                              printPointsNum = 0;
-                              for (i = 0; i < num_polys; i++) {
-                                  if ((i == 0) || ((i % 5) != 0))
-                                      printPoints(defwFile, *xl++, *yl++, "", " ");
-                                  else {
-                                      printPoints(defwFile,  *xl++, *yl++, "\n                ", " ");
-                                      defwLines++; 
-                                  }
-                              }
-                              defwLines++; 
-                              return DEFW_OK;
-}
-
-
-int
-defwSpecialNetRect(const char   *layerName,
-                   int          xl,
-                   int          yl,
-                   int          xh,
-                   int          yh)
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwSpecialNetOptions() &&
-        (defwState != DEFW_PATH))  // not inside a path
-        return DEFW_BAD_ORDER;
-
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + RECT %s ( %d %d ) ( %d %d ) ", layerName,
-            xl, yl, xh, yh);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetVia(const char *layerName)
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwSpecialNetOptions() &&
-        (defwState != DEFW_PATH))  // not inside a path
-        return DEFW_BAD_ORDER;
-
-    if (defVersionNum < 5.8)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + VIA %s ", layerName);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetViaWithOrient(const char  *layerName,
-                            int         orient)
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwSpecialNetOptions() &&
-        (defwState != DEFW_PATH))  // not inside a path
-        return DEFW_BAD_ORDER;
-
-    if (defVersionNum < 5.8)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "\n      + VIA %s %s", layerName, defwOrient(orient));
-
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetViaPoints(int     num_points,
-                        double  *xl,
-                        double  *yl)
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwSpecialNetOptions() &&
-        (defwState != DEFW_PATH))  // not inside a path
-        return DEFW_BAD_ORDER;
-
-    if (defVersionNum < 5.8)
-        return DEFW_WRONG_VERSION;
-
-
-    printPointsNum = 0;
-    for (int i = 0; i < num_points; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-        else {
-            printPoints(defwFile, *xl++, *yl++, "\n             ", " ");
-            defwLines++;
-        }
-    }
-
-    defwLines++;
-    return DEFW_OK;
-
-}
-
-
-int
-defwSpecialNetShieldStart(const char *name)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    // The second time around for a shield on this net, we
-    // must start it with a new instead of the name ...
-    if (strcmp(name, "NEW") == 0) {
-        if (defwState != DEFW_SHIELD)
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, " NEW");
-    } else
-        fprintf(defwFile, "\n      + SHIELD %s", name);
-
-    defwState = DEFW_SHIELD;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldWidth(int w)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %d", w);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldLayer(const char *name)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldShape(const char *typ)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(typ, "RING") && strcmp(typ, "STRIPE") && strcmp(typ, "FOLLOWPIN") &&
-        strcmp(typ, "IOWIRE") && strcmp(typ, "COREWIRE") &&
-        strcmp(typ, "BLOCKWIRE") && strcmp(typ, "FILLWIRE") &&
-        strcmp(typ, "BLOCKAGEWIRE") && strcmp(typ, "DRCFILL"))
-        return DEFW_BAD_DATA;
-
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, "\n      + SHAPE %s", typ);
-
-    defwState = DEFW_SHIELD;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldPoint(int       numPts,
-                          double    *pointx,
-                          double    *pointy)
-{
-    int i;
-
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-
-    printPointsNum = 0;
-    for (i = 0; i < numPts; i++) {
-        if ((++defwLineItemCounter & 3) == 0) {
-            fprintf(defwFile, "\n     ");
-            defwLines++;
-        }
-     printPoints(defwFile, pointx[i], pointy[i], " ", "");
-    }
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldVia(const char *name)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetShieldViaData(int numX,
-                            int numY,
-                            int stepX,
-                            int stepY)
-{
-    defwFunc = DEFW_SHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " DO %d BY %d STEP %d %d", numX, numY, stepX, stepY);
-    return DEFW_OK;
-}
-
-int
-defwSpecialNetShieldEnd()
-{
-    defwFunc = DEFW_SNET_OPTIONS;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SHIELD)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_SNET_OPTIONS;
-    return DEFW_OK;
-}
-
-
-int
-defwSpecialNetEndOneNet()
-{
-    defwFunc = DEFW_SNET_ENDNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwSpecialNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, " ;\n");
-    defwLines++;
-    defwState = DEFW_SNET_ENDNET;
-
-    return DEFW_OK;
-}
-
-
-int
-defwEndSpecialNets()
-{
-    defwFunc = DEFW_SNET_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SNET_START && defwState != DEFW_SNET_OPTIONS &&
-        defwState != DEFW_SNET_ENDNET &&   // last state is special net
-        defwState != DEFW_SNET)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END SPECIALNETS\n\n");
-    defwLines++;
-
-    defwState = DEFW_SNET_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartNets(int count)
-{
-    defwFunc = DEFW_NET_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_NET_START) && (defwState <= DEFW_NET_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "NETS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_NET_START;
-    return DEFW_OK;
-}
-
-
-int
-defwNetOptions()
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (defwState == DEFW_NET) {
-        defwState = DEFW_NET_OPTIONS;
-        return 1;
-    }
-    if (defwState == DEFW_NET_OPTIONS)
-        return 1;
-    return 0;
-}
-
-
-int
-defwNet(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NET_START &&
-        defwState != DEFW_NET_ENDNET)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_NET;
-
-    fprintf(defwFile, "   - %s", name);
-    defwLineItemCounter = 0;
-    defwCounter--;
-
-    return DEFW_OK;
-}
-
-
-int
-defwNetConnection(const char    *inst,
-                  const char    *pin,
-                  int           synthesized)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NET)
-        return DEFW_BAD_ORDER;
-
-    if ((++defwLineItemCounter & 3) == 0) {  // since there is more than one
-        fprintf(defwFile, "\n"); // inst & pin connection, don't print newline
-        defwLines++;             // until the line is certain length long
-    }
-    fprintf(defwFile, " ( %s %s", inst, pin);
-    if (synthesized)
-        fprintf(defwFile, " + SYNTHESIZED ) ");
-    else
-        fprintf(defwFile, " ) ");
-    return DEFW_OK;
-}
-
-
-int
-defwNetMustjoinConnection(const char    *inst,
-                          const char    *pin)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NET_ENDNET)
-        return DEFW_BAD_ORDER;
-
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " - MUSTJOIN ( %s %s )", inst, pin);
-
-  defwState = DEFW_NET;
-  
-  defwCounter--;
-
-    return DEFW_OK;
-}
-
-
-int
-defwNetFixedbump()
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + FIXEDBUMP");
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetFrequency(double frequency)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + FREQUENCY %.11g", frequency);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetSource(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + SOURCE %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetXtalk(int xtalk)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + XTALK %d", xtalk);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetVpin(const char  *vpinName,
-            const char  *layerName,
-            int         layerXl,
-            int         layerYl,
-            int         layerXh,
-            int         layerYh,
-            const char  *status,
-            int         statusX,
-            int         statusY,
-            int         orient)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-    if ((vpinName == 0) || (*vpinName == 0)) // required
-        return DEFW_BAD_DATA;
-
-    if (status && strcmp(status, "PLACED") && strcmp(status, "FIXED") &&
-        strcmp(status, "COVER"))
-        return DEFW_BAD_DATA;
-    if (status && (orient == 1))  // require if status is set
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + VPIN %s", vpinName);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    fprintf(defwFile, " ( %d %d ) ( %d %d )\n", layerXl, layerYl, layerXh,
-            layerYh);
-    defwLines++;
-
-    if (status)
-        fprintf(defwFile, "         %s ( %d %d ) %s", status, statusX, statusY,
-                defwOrient(orient));
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetVpinStr(const char   *vpinName,
-               const char   *layerName,
-               int          layerXl,
-               int          layerYl,
-               int          layerXh,
-               int          layerYh,
-               const char   *status,
-               int          statusX,
-               int          statusY,
-               const char   *orient)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-    if (!vpinName || !*vpinName) // required
-        return DEFW_BAD_DATA;
-
-    if (status && strcmp(status, "PLACED") && strcmp(status, "FIXED") &&
-        strcmp(status, "COVER"))
-        return DEFW_BAD_DATA;
-    if (status && orient && *orient == '\0')  // require if status is set
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + VPIN %s", vpinName);
-    if (layerName)
-        fprintf(defwFile, " LAYER %s", layerName);
-    fprintf(defwFile, " ( %d %d ) ( %d %d )\n", layerXl, layerYl, layerXh,
-            layerYh);
-    defwLines++;
-
-    if (status)
-        fprintf(defwFile, "         %s ( %d %d ) %s", status, statusX, statusY,
-                orient);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetOriginal(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ORIGINAL %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetPattern(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + PATTERN %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetUse(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(name, "SIGNAL") && strcmp(name, "POWER") &&
-        strcmp(name, "GROUND") && strcmp(name, "CLOCK") &&
-        strcmp(name, "TIEOFF") && strcmp(name, "ANALOG") &&
-        strcmp(name, "SCAN") && strcmp(name, "RESET"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + USE %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetNondefaultRule(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState != DEFW_NET) && (defwState != DEFW_NET_OPTIONS) &&
-        (defwState != DEFW_SUBNET))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_SUBNET)
-        fprintf(defwFile, "\n         NONDEFAULTRULE %s", name);
-    else
-        fprintf(defwFile, "\n      + NONDEFAULTRULE %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetWeight(double d)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + WEIGHT %.11g", d);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetEstCap(double d)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + ESTCAP %.11g", d);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetShieldnet(const char *name)
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "\n      + SHIELDNET %s", name);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetNoshieldStart(const char *name)
-{
-    defwFunc = DEFW_NOSHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, "\n      + NOSHIELD %s", name);
-
-    defwState = DEFW_NOSHIELD;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwNetNoshieldPoint(int        numPts,
-                     const char **pointx,
-                     const char **pointy)
-{
-    int i;
-
-    defwFunc = DEFW_NOSHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NOSHIELD)
-        return DEFW_BAD_ORDER;
-    for (i = 0; i < numPts; i++) {
-        if ((++defwLineItemCounter & 3) == 0) {
-            fprintf(defwFile, "\n     ");
-            defwLines++;
-        }
-        fprintf(defwFile, " ( %s %s )", pointx[i], pointy[i]);
-    }
-    return DEFW_OK;
-}
-
-
-int
-defwNetNoshieldVia(const char *name)
-{
-    defwFunc = DEFW_NOSHIELD;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NOSHIELD)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    return DEFW_OK;
-}
-
-
-int
-defwNetNoshieldEnd()
-{
-    defwFunc = DEFW_NET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NOSHIELD)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_NET;
-    return DEFW_OK;
-}
-
-
-int
-defwNetSubnetStart(const char *name)
-{
-    defwFunc = DEFW_SUBNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + SUBNET %s", name);
-    defwLines++;
-    defwState = DEFW_SUBNET;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwNetSubnetPin(const char *compName,
-                 const char *pinName)
-{
-    defwFunc = DEFW_SUBNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SUBNET)
-        return DEFW_BAD_ORDER;
-    if ((!compName || !*compName) || (!pinName || !*pinName)) // required
-        return DEFW_BAD_DATA;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n        ");
-        defwLines++;
-    }
-    fprintf(defwFile, " ( %s %s )", compName, pinName);
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwNetSubnetEnd()
-{
-    defwFunc = DEFW_SUBNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState != DEFW_SUBNET) &&    // subnet does not have path 
-        (defwState != DEFW_NET_OPTIONS)) // subnet has path and path just ended 
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_NET_OPTIONS;
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathStart(const char *typ)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions() && (defwState != DEFW_SUBNET) && // path in subnet 
-        (defwState != DEFW_PATH))      // NEW in the path, path hasn't end yet 
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(typ, "NEW") && strcmp(typ, "FIXED") && strcmp(typ, "COVER") &&
-        strcmp(typ, "ROUTED") && strcmp(typ, "NOSHIELD"))
-        return DEFW_BAD_DATA;
-
-    // The second time around for a path on this net, we
-    // must start it with a new instead of a fixed...
-    if (strcmp(typ, "NEW") == 0) {
-        if (defwState != DEFW_PATH)
-            return DEFW_BAD_DATA;
-        fprintf(defwFile, "\n         NEW");
-    } else {
-        if (defwState == DEFW_SUBNET)
-            fprintf(defwFile, "\n      %s", typ);
-        else
-            fprintf(defwFile, "\n      + %s", typ);
-    }
-
-    defwState = DEFW_PATH_START;
-    defwLineItemCounter = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathWidth(int w)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n         ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %d", w);
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathLayer(const char *name,
-                 int        isTaper,
-                 const char *ruleName)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH_START)
-        return DEFW_BAD_ORDER;
-
-    // only one, either isTaper or ruleName can be set
-    if (isTaper && ruleName)
-        return DEFW_BAD_DATA;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n        ");
-        defwLines++;
-    }
-    fprintf(defwFile, " %s", name);
-    if (isTaper)
-        fprintf(defwFile, " TAPER");
-    else if (ruleName)
-        fprintf(defwFile, " TAPERRULE %s", ruleName);
-    defwState = DEFW_PATH;
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathStyle(int styleNum)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, " STYLE %d", styleNum);
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathPoint(int    numPts,
-                 double *pointx,
-                 double *pointy)
-{
-    int i;
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    printPointsNum = 0;
-    for (i = 0; i < numPts; i++) {
-        if ((++defwLineItemCounter & 3) == 0) {
-            fprintf(defwFile, "\n        ");
-            defwLines++;
-        }
-        printPoints(defwFile, pointx[i], pointy[i], " ", "");
-    }
-    return DEFW_OK;
-}
-
-int
-defwNetPathPointWithExt(int     numPts,
-                        double  *pointx,
-                        double  *pointy,
-                        double  *optValue)
-{
-    int i;
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    for (i = 0; i < numPts; i++) {
-        if ((++defwLineItemCounter & 3) == 0) {
-            fprintf(defwFile, "\n        ");
-            defwLines++;
-        }
-        fprintf(defwFile, " ( %.11g %.11g %.11g )", pointx[i], pointy[i], optValue[i]);
-    }
-    return DEFW_OK;
-}
-
-int
-defwNetPathVia(const char *name)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n        ");
-        defwLines++;
-    }
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, " %s", name);
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathViaWithOrient(const char *name,
-                         int        orient)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n        ");
-        defwLines++;
-    }
-
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-
-    if (orient == -1)
-        fprintf(defwFile, " %s", name);
-    else if (orient >= 0 && orient <= 7)
-        fprintf(defwFile, " %s %s", name, defwOrient(orient));
-    else
-        return DEFW_BAD_DATA;
-    return DEFW_OK;
-}
-
-
-int
-defwNetPathViaWithOrientStr(const char  *name,
-                            const char  *orient)
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n        ");
-        defwLines++;
-    }
-
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-
-    if (!orient || !*orient)
-        fprintf(defwFile, " %s", name);
-    else
-        fprintf(defwFile, " %s %s", name, orient);
-    return DEFW_OK;
-}
-
-int
-defwNetPathMask(int colorMask)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " MASK %d", colorMask);
-    return DEFW_OK;
-}
-
-int
-defwNetPathRect(int deltaX1,
-                int deltaY1,
-                int deltaX2,
-                int deltaY2)
-{
-    if (defVersionNum < 5.8)
-        return DEFW_WRONG_VERSION;
-
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-
-    fprintf(defwFile, " RECT ( %d %d %d %d )", deltaX1, deltaY1, deltaX2, deltaY2);
-
-    return DEFW_OK;
-}
-
-int
-defwNetPathVirtual(int  x,
-                   int  y)
-{
-    if (defVersionNum < 5.8)
-        return DEFW_WRONG_VERSION;
-
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    if ((++defwLineItemCounter & 3) == 0) {
-        fprintf(defwFile, "\n     ");
-        defwLines++;
-    }
-    fprintf(defwFile, " VIRTUAL ( %d %d )", x, y);
-    return DEFW_OK;
-}
-
-int
-defwNetPathEnd()
-{
-    defwFunc = DEFW_PATH;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_PATH)
-        return DEFW_BAD_ORDER;
-    defwState = DEFW_NET_OPTIONS;
-    return DEFW_OK;
-}
-
-
-int
-defwNetEndOneNet()
-{
-    defwFunc = DEFW_NET_ENDNET;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwNetOptions())
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, " ;\n");
-    defwLines++;
-    defwState = DEFW_NET_ENDNET;
-
-    return DEFW_OK;
-}
-
-
-int
-defwEndNets()
-{
-    defwFunc = DEFW_NET_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NET_START && defwState != DEFW_NET_OPTIONS &&
-        defwState != DEFW_NET &&
-        defwState != DEFW_NET_ENDNET) // last state is a net 
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END NETS\n\n");
-    defwLines++;
-
-    defwState = DEFW_NET_END;
-    defwDidNets = 1;
-    return DEFW_OK;
-}
-
-
-int
-defwStartIOTimings(int count)
-{
-    defwObsoleteNum = DEFW_IOTIMING_START;
-    defwFunc = DEFW_IOTIMING_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidNets)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_IOTIMING_START) &&
-        (defwState >= DEFW_IOTIMING_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum >= 5.4)
-        return DEFW_OBSOLETE;
-
-    fprintf(defwFile, "IOTIMINGS %d ;\n", count);
-    defwLines++;
-
-    defwCounter = count;
-    defwState = DEFW_IOTIMING_START;
-    return DEFW_OK;
-}
-
-
-int
-defwIOTiming(const char *instance,
-             const char *pin)
-{
-    defwFunc = DEFW_IOTIMING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING_START &&
-        defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_IOTIMING)
-        fprintf(defwFile, " ;\n");   // from previous statement
-    fprintf(defwFile, "   - ( %s %s )\n", instance, pin);
-    defwLines++;
-
-    defwCounter--;
-    defwState = DEFW_IOTIMING;
-    return DEFW_OK;
-}
-
-int
-defwIOTimingVariable(const char *riseFall,
-                     int        num1,
-                     int        num2)
-{
-    defwFunc = DEFW_IOTIMING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(riseFall, "RISE") &&
-        strcmp(riseFall, "FALL"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "      + %s VARIABLE %d %d\n", riseFall,
-            num1, num2);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-int
-defwIOTimingSlewrate(const char *riseFall,
-                     int        num1,
-                     int        num2)
-{
-    defwFunc = DEFW_IOTIMING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-
-    if (strcmp(riseFall, "RISE") &&
-        strcmp(riseFall, "FALL"))
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "      + %s SLEWRATE %d %d\n", riseFall,
-            num1, num2);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-int
-defwIOTimingDrivecell(const char    *name,
-                      const char    *fromPin,
-                      const char    *toPin,
-                      int           numDrivers)
-{
-    defwFunc = DEFW_IOTIMING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-    if (!name || !*name) // required
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "      + DRIVECELL %s ", name);
-    if (fromPin && (!toPin || !*toPin)) // if have fromPin, toPin is required
-        return DEFW_BAD_DATA;
-    if (fromPin)
-        fprintf(defwFile, "FROMPIN %s ", fromPin);
-    if (toPin)
-        fprintf(defwFile, "TOPIN %s ", toPin);
-    if (numDrivers)
-        fprintf(defwFile, "PARALLEL %d ", numDrivers);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-
-int
-defwIOTimingCapacitance(double num)
-{
-    defwFunc = DEFW_IOTIMING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "      + CAPACITANCE %.11g", num);
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-int
-defwEndIOTimings()
-{
-    defwFunc = DEFW_IOTIMING_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_IOTIMING_START && defwState != DEFW_IOTIMING)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    if (defwState == DEFW_IOTIMING)
-        fprintf(defwFile, " ;\n");   // from previous statement
-    fprintf(defwFile, "END IOTIMINGS\n\n");
-    defwLines++;
-
-    defwState = DEFW_IOTIMING_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartScanchains(int count)
-{
-    defwFunc = DEFW_SCANCHAIN_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidNets)
-        return DEFW_BAD_ORDER;
-    if ((defwState >= DEFW_SCANCHAIN_START) &&
-        (defwState <= DEFW_SCANCHAIN_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "SCANCHAINS %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwScanchain(const char *name)
-{
-    defwFunc = DEFW_SCANCHAIN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_SCANCHAIN || defwState == DEFW_SCAN_FLOATING ||
-        defwState == DEFW_SCAN_ORDERED) // put a ; for the previous scanchain
-        fprintf(defwFile, " ;\n");
-
-    fprintf(defwFile, "   - %s", name);
-    defwLines++;
-
-    defwCounter--;
-    defwState = DEFW_SCANCHAIN;
-    return DEFW_OK;
-}
-
-int
-defwScanchainCommonscanpins(const char  *inst1,
-                            const char  *pin1,
-                            const char  *inst2,
-                            const char  *pin2)
-{
-    defwFunc = DEFW_SCANCHAIN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!inst1) {     // if inst1 is null, nothing will be written
-        defwState = DEFW_SCANCHAIN;
-        return DEFW_OK;
-    }
-
-    if (inst1 && strcmp(inst1, "IN") && strcmp(inst1, "OUT")) // IN | OUT
-        return DEFW_BAD_DATA;
-
-    if (inst1 && !pin1)        // pin1 can't be NULL if inst1 is not
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + COMMONSCANPINS ( %s %s )", inst1, pin1);
-
-    if (inst2 && !pin2)        // pin2 can't be NULL if inst2 is not
-        return DEFW_BAD_DATA;
-
-    if (inst2 && strcmp(inst2, "IN") && strcmp(inst2, "OUT")) // IN | OUT
-        return DEFW_BAD_DATA;
-
-    if (inst2)
-        fprintf(defwFile, " ( %s %s )", inst2, pin2);
-
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN;
-    return DEFW_OK;
-}
-
-int
-defwScanchainPartition(const char   *name,
-                       int          maxBits)
-{
-    defwFunc = DEFW_SCANCHAIN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!name || !*name)        // require
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + PARTITION %s", name);
-    if (maxBits != -1)
-        fprintf(defwFile, " MAXBITS %d", maxBits);
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN;
-    return DEFW_OK;
-}
-
-int
-defwScanchainStart(const char   *inst,
-                   const char   *pin)
-{
-    defwFunc = DEFW_SCANCHAIN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!inst || !*inst)        // require
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + START %s", inst);
-    if (pin)
-        fprintf(defwFile, " %s", pin);
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN;
-    return DEFW_OK;
-}
-
-
-int
-defwScanchainStop(const char    *inst,
-                  const char    *pin)
-{
-    defwFunc = DEFW_SCANCHAIN;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!inst || !*inst)        // require
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "\n      + STOP %s", inst);
-    if (pin)
-        fprintf(defwFile, " %s", pin);
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN;
-    return DEFW_OK;
-}
-
-int
-defwScanchainFloating(const char    *name,
-                      const char    *inst1,
-                      const char    *pin1,
-                      const char    *inst2,
-                      const char    *pin2)
-{
-    defwFunc = DEFW_SCAN_FLOATING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!name || !*name)        // require
-        return DEFW_BAD_DATA;
-    if (inst1 && strcmp(inst1, "IN") && strcmp(inst1, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst2 && strcmp(inst2, "IN") && strcmp(inst2, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst1 && !pin1)
-        return DEFW_BAD_DATA;
-    if (inst2 && !pin2)
-        return DEFW_BAD_DATA;
-
-    if (defwState != DEFW_SCAN_FLOATING)
-        fprintf(defwFile, "\n      + FLOATING");
-    else
-        fprintf(defwFile, "\n         ");
-
-    fprintf(defwFile, " %s", name);
-    if (inst1)
-        fprintf(defwFile, " ( %s %s )", inst1, pin1);
-    if (inst2)
-        fprintf(defwFile, " ( %s %s )", inst2, pin2);
-
-    defwState = DEFW_SCAN_FLOATING;
-    defwLines++;
-
-    return DEFW_OK;
-}
-
-int
-defwScanchainFloatingBits(const char    *name,
-                          const char    *inst1,
-                          const char    *pin1,
-                          const char    *inst2,
-                          const char    *pin2,
-                          int           bits)
-{
-    defwFunc = DEFW_SCAN_FLOATING;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!name || !*name)        // require
-        return DEFW_BAD_DATA;
-    if (inst1 && strcmp(inst1, "IN") && strcmp(inst1, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst2 && strcmp(inst2, "IN") && strcmp(inst2, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst1 && !pin1)
-        return DEFW_BAD_DATA;
-    if (inst2 && !pin2)
-        return DEFW_BAD_DATA;
-
-    if (defwState != DEFW_SCAN_FLOATING)
-        fprintf(defwFile, "\n      + FLOATING");
-    else
-        fprintf(defwFile, "\n         ");
-
-    fprintf(defwFile, " %s", name);
-    if (inst1)
-        fprintf(defwFile, " ( %s %s )", inst1, pin1);
-    if (inst2)
-        fprintf(defwFile, " ( %s %s )", inst2, pin2);
-    if (bits != -1)
-        fprintf(defwFile, " ( BITS %d )", bits);
-
-    defwState = DEFW_SCAN_FLOATING;
-    defwLines++;
-
-    return DEFW_OK;
-}
-int
-defwScanchainOrdered(const char *name1,
-                     const char *inst1,
-                     const char *pin1,
-                     const char *inst2,
-                     const char *pin2,
-                     const char *name2,
-                     const char *inst3,
-                     const char *pin3,
-                     const char *inst4,
-                     const char *pin4)
-{
-    defwFunc = DEFW_SCAN_ORDERED;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!name1 || !*name1)        // require
-        return DEFW_BAD_DATA;
-    if (inst1 && strcmp(inst1, "IN") && strcmp(inst1, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst2 && strcmp(inst2, "IN") && strcmp(inst2, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst1 && !pin1)
-        return DEFW_BAD_DATA;
-    if (inst2 && !pin2)
-        return DEFW_BAD_DATA;
-    if (defwState != DEFW_SCAN_ORDERED) {  // 1st time require both name1 & name2
-        if (!name2 || !*name2)        // require
-            return DEFW_BAD_DATA;
-        if (inst3 && strcmp(inst3, "IN") && strcmp(inst3, "OUT"))
-            return DEFW_BAD_DATA;
-        if (inst4 && strcmp(inst4, "IN") && strcmp(inst4, "OUT"))
-            return DEFW_BAD_DATA;
-        if (inst3 && !pin3)
-            return DEFW_BAD_DATA;
-        if (inst4 && !pin4)
-            return DEFW_BAD_DATA;
-    }
-
-    if (defwState != DEFW_SCAN_ORDERED)
-        fprintf(defwFile, "\n      + ORDERED");
-    else
-        fprintf(defwFile, "\n         ");
-
-    fprintf(defwFile, " %s", name1);
-    if (inst1)
-        fprintf(defwFile, " ( %s %s )", inst1, pin1);
-    if (inst2)
-        fprintf(defwFile, " ( %s %s )", inst2, pin2);
-    defwLines++;
-
-    if (name2) {
-        fprintf(defwFile, "\n          %s", name2);
-        if (inst3)
-            fprintf(defwFile, " ( %s %s )", inst3, pin3);
-        if (inst4)
-            fprintf(defwFile, " ( %s %s )", inst4, pin4);
-        defwLines++;
-    }
-
-    defwState = DEFW_SCAN_ORDERED;
-
-    return DEFW_OK;
-}
-
-int
-defwScanchainOrderedBits(const char *name1,
-                         const char *inst1,
-                         const char *pin1,
-                         const char *inst2,
-                         const char *pin2,
-                         int        bits1,
-                         const char *name2,
-                         const char *inst3,
-                         const char *pin3,
-                         const char *inst4,
-                         const char *pin4,
-                         int        bits2)
-{
-    defwFunc = DEFW_SCAN_ORDERED;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCANCHAIN &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCAN_ORDERED)
-        return DEFW_BAD_ORDER;
-
-    if (!name1 || !*name1)        // require
-        return DEFW_BAD_DATA;
-    if (inst1 && strcmp(inst1, "IN") && strcmp(inst1, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst2 && strcmp(inst2, "IN") && strcmp(inst2, "OUT"))
-        return DEFW_BAD_DATA;
-    if (inst1 && !pin1)
-        return DEFW_BAD_DATA;
-    if (inst2 && !pin2)
-        return DEFW_BAD_DATA;
-    if (defwState != DEFW_SCAN_ORDERED) {  // 1st time require both name1 & name2
-        if (!name2 || !*name2)        // require
-            return DEFW_BAD_DATA;
-        if (inst3 && strcmp(inst3, "IN") && strcmp(inst3, "OUT"))
-            return DEFW_BAD_DATA;
-        if (inst4 && strcmp(inst4, "IN") && strcmp(inst4, "OUT"))
-            return DEFW_BAD_DATA;
-        if (inst3 && !pin3)
-            return DEFW_BAD_DATA;
-        if (inst4 && !pin4)
-            return DEFW_BAD_DATA;
-    }
-
-    if (defwState != DEFW_SCAN_ORDERED)
-        fprintf(defwFile, "\n      + ORDERED");
-    else
-        fprintf(defwFile, "\n         ");
-
-    fprintf(defwFile, " %s", name1);
-    if (inst1)
-        fprintf(defwFile, " ( %s %s )", inst1, pin1);
-    if (inst2)
-        fprintf(defwFile, " ( %s %s )", inst2, pin2);
-    if (bits1 != -1)
-        fprintf(defwFile, " ( BITS %d )", bits1);
-    defwLines++;
-
-    if (name2) {
-        fprintf(defwFile, "\n          %s", name2);
-        if (inst3)
-            fprintf(defwFile, " ( %s %s )", inst3, pin3);
-        if (inst4)
-            fprintf(defwFile, " ( %s %s )", inst4, pin4);
-        if (bits2 != -1)
-            fprintf(defwFile, " ( BITS %d )", bits2);
-        defwLines++;
-    }
-
-    defwState = DEFW_SCAN_ORDERED;
-
-    return DEFW_OK;
-}
-
-int
-defwEndScanchain()
-{
-    defwFunc = DEFW_SCANCHAIN_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SCANCHAIN_START && defwState != DEFW_SCAN_ORDERED &&
-        defwState != DEFW_SCAN_FLOATING && defwState != DEFW_SCANCHAIN)
-        return DEFW_BAD_ORDER;
-
-    if (defwState != DEFW_SCANCHAIN_START)  // from previous statement
-        fprintf(defwFile, " ;\n");
-
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END SCANCHAINS\n\n");
-    defwLines++;
-
-    defwState = DEFW_SCANCHAIN_END;
-    return DEFW_OK;
-}
-
-int
-defwStartConstraints(int count)
-{
-    defwObsoleteNum = DEFW_FPC_START;
-    defwFunc = DEFW_FPC_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_FPC_START) && (defwState <= DEFW_FPC_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum >= 5.4)
-        return DEFW_OBSOLETE;
-
-    fprintf(defwFile, "CONSTRAINTS %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_FPC_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperand()
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_START && defwState != DEFW_FPC)
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "   -");
-    defwCounter--;
-    defwFPC = 0;
-    defwState = DEFW_FPC_OPER;
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandNet(const char *netName)
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER && defwState != DEFW_FPC_OPER_SUM)
-        return DEFW_BAD_ORDER;          // net can be within SUM
-
-    if (!netName || !*netName)        // require
-        return DEFW_BAD_DATA;
-    if (defwFPC > 0)
-        fprintf(defwFile, " ,");
-    if (defwState == DEFW_FPC_OPER_SUM)
-        defwFPC++;
-    fprintf(defwFile, " NET %s", netName);
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandPath(const char    *comp1,
-                          const char    *fromPin,
-                          const char    *comp2,
-                          const char    *toPin)
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER && defwState != DEFW_FPC_OPER_SUM)
-        return DEFW_BAD_ORDER;          // path can be within SUM
-
-    if ((comp1 == 0) || (*comp1 == 0) || (fromPin == 0) || (*fromPin == 0) ||
-        (comp2 == 0) || (*comp2 == 0) || (toPin == 0) || (*toPin == 0)) // require
-        return DEFW_BAD_DATA;
-    if (defwFPC > 0)
-        fprintf(defwFile, " ,");
-    if (defwState == DEFW_FPC_OPER_SUM)
-        defwFPC++;
-    fprintf(defwFile, " PATH %s %s %s %s", comp1, fromPin, comp2, toPin);
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandSum()
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER && defwState != DEFW_FPC_OPER_SUM)
-        return DEFW_BAD_ORDER;          // sum can be within SUM
-
-    fprintf(defwFile, " SUM (");
-    defwState = DEFW_FPC_OPER_SUM;
-    defwFPC = 0;
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandSumEnd()
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER_SUM)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, " )");
-    defwState = DEFW_FPC_OPER;
-    defwFPC = 0;
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandTime(const char    *timeType,
-                          int           time)
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER)
-        return DEFW_BAD_ORDER;
-    if (timeType && strcmp(timeType, "RISEMAX") && strcmp(timeType, "FALLMAX") &&
-        strcmp(timeType, "RISEMIN") && strcmp(timeType, "FALLMIN"))
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, " + %s %d", timeType, time);
-    return DEFW_OK;
-}
-
-int
-defwConstraintOperandEnd()
-{
-    defwFunc = DEFW_FPC_OPER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_OPER)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, " ;\n");
-    defwState = DEFW_FPC;
-    return DEFW_OK;
-}
-
-int
-defwConstraintWiredlogic(const char *netName,
-                         int        distance)
-{
-    defwFunc = DEFW_FPC;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_START && defwState != DEFW_FPC)
-        return DEFW_BAD_ORDER;
-
-    if (!netName || !*netName)        // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "   - WIREDLOGIC %s MAXDIST %d ;\n", netName, distance);
-    defwCounter--;
-    defwState = DEFW_FPC;
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwEndConstraints()
-{
-    defwFunc = DEFW_FPC_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FPC_START && defwState != DEFW_FPC)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END CONSTRAINTS\n\n");
-    defwLines++;
-
-    defwState = DEFW_FPC_END;
-    return DEFW_OK;
-}
-
-int
-defwStartGroups(int count)
-{
-    defwFunc = DEFW_GROUP_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_GROUP_START) && (defwState <= DEFW_GROUP_END))
-        return DEFW_BAD_ORDER;
-
-    fprintf(defwFile, "GROUPS %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_GROUP_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwGroup(const char    *groupName,
-          int           numExpr,
-          const char    **groupExpr)
-{
-    int i;
-
-    defwFunc = DEFW_GROUP;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_GROUP_START && defwState != DEFW_GROUP)
-        return DEFW_BAD_ORDER;
-
-    if ((groupName == 0) || (*groupName == 0) || (groupExpr == 0) ||
-        (*groupExpr == 0))  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_GROUP)
-        fprintf(defwFile, " ;\n");          // add ; for the previous group
-    fprintf(defwFile, "   - %s", groupName);
-    if (numExpr) {
-        for (i = 0; i < numExpr; i++)
-            fprintf(defwFile, " %s", groupExpr[i]);
-    }
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_GROUP;
-    return DEFW_OK;
-}
-
-
-int
-defwGroupSoft(const char    *type1,
-              double        value1,
-              const char    *type2,
-              double        value2,
-              const char    *type3,
-              double        value3)
-{
-    defwFunc = DEFW_GROUP;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_GROUP)
-        return DEFW_BAD_ORDER;
-
-    if (type1 && strcmp(type1, "MAXHALFPERIMETER") && strcmp(type1, "MAXX") &&
-        strcmp(type1, "MAXY"))
-        return DEFW_BAD_DATA;
-    if (type2 && strcmp(type2, "MAXHALFPERIMETER") && strcmp(type2, "MAXX") &&
-        strcmp(type2, "MAXY"))
-        return DEFW_BAD_DATA;
-    if (type3 && strcmp(type3, "MAXHALFPERIMETER") && strcmp(type3, "MAXX") &&
-        strcmp(type3, "MAXY"))
-        return DEFW_BAD_DATA;
-    if (type1)
-        fprintf(defwFile, "\n     + SOFT %s %.11g", type1, value1);
-    if (type2)
-        fprintf(defwFile, " %s %.11g", type2, value2);
-    if (type3)
-        fprintf(defwFile, " %s %.11g", type3, value3);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwGroupRegion(int         xl,
-                int         yl,
-                int         xh,
-                int         yh,
-                const char  *regionName)
-{
-    defwFunc = DEFW_GROUP;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_GROUP)
-        return DEFW_BAD_ORDER;
-
-    if ((xl || yl || xh || yh) && (regionName))  // ether pts or regionName
-        return DEFW_BAD_DATA;
-
-    if (regionName)
-        fprintf(defwFile, "\n      + REGION %s", regionName);
-    else
-        fprintf(defwFile, "\n      + REGION ( %d %d ) ( %d %d )",
-                xl, yl, xh, yh);
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwEndGroups()
-{
-    defwFunc = DEFW_GROUP_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_GROUP_START && defwState != DEFW_GROUP)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    if (defwState != DEFW_GROUP_START)
-        fprintf(defwFile, " ;\n");
-
-    fprintf(defwFile, "END GROUPS\n\n");
-    defwLines++;
-
-    defwState = DEFW_GROUP_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartBlockages(int count)
-{
-    defwFunc = DEFW_BLOCKAGE_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_BLOCKAGE_START) && (defwState <= DEFW_BLOCKAGE_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "BLOCKAGES %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_BLOCKAGE_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayer(const char *layerName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_ORDER;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-
-    fprintf(defwFile, "   - LAYER %s", layerName);
-    fprintf(defwFile, "\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    defwBlockageHasSF = 0;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerSlots()
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwBlockageHasSF)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "      + SLOTS\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSF = 1;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerFills()
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwBlockageHasSF)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-
-    fprintf(defwFile, "     + FILLS\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSF = 1;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerComponent(const char *compName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if ((compName == 0) || (*compName == 0))  // require
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "     + COMPONENT %s\n", compName);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerPushdown()
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-
-    fprintf(defwFile, "     + PUSHDOWN\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwBlockagesLayerExceptpgnet()
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-
-    fprintf(defwFile, "     + EXCEPTPGNET\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerSpacing(int minSpacing)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-    if (defwBlockageHasSD)    // Either spacing or designrulewidth has defined
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + SPACING %d\n", minSpacing);
-    defwLines++;
-    defwBlockageHasSD = 1;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerDesignRuleWidth(int effectiveWidth)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-    if (defwBlockageHasSD)    // Either spacing or designrulewidth has defined
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + DESIGNRULEWIDTH %d\n", effectiveWidth);
-    defwLines++;
-    defwBlockageHasSD = 1;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesLayerMask(int colorMask)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_BLOCKAGE_MASK;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     + MASK %d", colorMask);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayer
-int
-defwBlockageLayer(const char    *layerName,
-                  const char    *compName)
-{      // optional(NULL) 
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define component or layer slots or fills
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_DATA;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s ", layerName);
-    if (compName && *compName != 0)  // optional
-        fprintf(defwFile, "+ COMPONENT %s ", compName);
-    fprintf(defwFile, "\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerSlots
-int
-defwBlockageLayerSlots(const char *layerName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define component or layer or layer fills
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_DATA;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s + SLOTS\n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerFills
-int
-defwBlockageLayerFills(const char *layerName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define component or layer or layer slots
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_DATA;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s + FILLS\n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerPushdown
-int
-defwBlockageLayerPushdown(const char *layerName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define component or layer or layer slots
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_DATA;
-
-    if ((layerName == 0) || (*layerName == 0))  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s + PUSHDOWN\n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerExceptpgnet
-int
-defwBlockageLayerExceptpgnet(const char *layerName)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define component or layer or layer slots
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_PLACE)
-                                             || (defwState == DEFW_BLOCKAGE_LAYER)))
-        return DEFW_BAD_DATA;
-
-    if ((layerName == 0) || (*layerName == 0))  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s + EXCEPTPGNET\n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    defwBlockageHasSD = 0;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerSpacing
-int
-defwBlockageSpacing(int minSpacing)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // Checked if defwBlockageDesignRuleWidth has already called
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_DATA;
-    if (defwBlockageHasSD)    // Either spacing or designrulewidth has defined
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + SPACING %d\n", minSpacing);
-    defwLines++;
-    defwBlockageHasSD = 1;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-//To be removed, replaced by defwBlockagesLayerDesignRuleWidth
-int
-defwBlockageDesignRuleWidth(int effectiveWidth)
-{
-    defwFunc = DEFW_BLOCKAGE_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // Checked if defwBlockageDesignRuleWidth has already called
-    if ((defwState != DEFW_BLOCKAGE_LAYER) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_DATA;
-    if (defwBlockageHasSD)    // Either spacing or designrulewidth has defined
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + DESIGNRULEWIDTH %d\n", effectiveWidth);
-    defwLines++;
-    defwBlockageHasSD = 1;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesPlacement()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-
-    fprintf(defwFile, "   - PLACEMENT\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    defwBlockageHasSP = 0;
-    return DEFW_OK;
-}
-
-
-int
-defwBlockagesPlacementComponent(const char *compName)
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_PLACE) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if ((compName == 0) || (*compName == 0))  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "     + COMPONENT %s\n", compName);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-
-int
-defwBlockagesPlacementPushdown()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_PLACE) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "     + PUSHDOWN\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwBlockagesPlacementSoft()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_PLACE) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwBlockageHasSP)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "     + SOFT\n");
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    defwBlockageHasSP = 1;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwBlockagesPlacementPartial(double maxDensity)
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-
-    if ((defwState != DEFW_BLOCKAGE_PLACE) && (defwState != DEFW_BLOCKAGE_RECT))
-        return DEFW_BAD_ORDER;
-
-    if (defwBlockageHasSP)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "     + PARTIAL %.11g\n", maxDensity);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    defwBlockageHasSP = 1;
-    return DEFW_OK;
-}
-
-int
-defwBlockagesRect(int   xl,
-                  int   yl,
-                  int   xh,
-                  int   yh)
-{
-    defwFunc = DEFW_BLOCKAGE_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_PLACE && defwState != DEFW_BLOCKAGE_LAYER &&
-        defwState != DEFW_BLOCKAGE_RECT)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     RECT ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_RECT;
-    return DEFW_OK;
-}
-
-
-int
-defwBlockagesPolygon(int    num_polys,
-                     int    *xl,
-                     int    *yl)
-{
-    int i;
-
-    defwFunc = DEFW_BLOCKAGE_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_LAYER && defwState != DEFW_BLOCKAGE_RECT)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     POLYGON ");
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            fprintf(defwFile, "( %d %d ) ", *xl++, *yl++);
-        else {
-            fprintf(defwFile, "\n             ( %d %d ) ", *xl++, *yl++);
-            defwLines++;
-        }
-    }
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_RECT;  // use rect flag.  It works the same for poly
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlcokagesPlacement
-// bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
-int
-defwBlockagePlacement()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - PLACEMENT\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlcokagesPlacementComponent
-int
-defwBlockagePlacementComponent(const char *compName)
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-
-    if ((compName == 0) || (*compName == 0))  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - PLACEMENT + COMPONENT %s\n", compName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlcokagesPlacementPushdown
-int
-defwBlockagePlacementPushdown()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - PLACEMENT + PUSHDOWN\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlcokagesPlacementSoft
-int
-defwBlockagePlacementSoft()
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - PLACEMENT + SOFT\n");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlcokagesPlacementPartial
-int
-defwBlockagePlacementPartial(double maxDensity)
-{
-    defwFunc = DEFW_BLOCKAGE_PLACE;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_START && ((defwState == DEFW_BLOCKAGE_LAYER)
-                                             || (defwState == DEFW_BLOCKAGE_PLACE)))
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - PLACEMENT + PARTIAL %.11g\n", maxDensity);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_PLACE;
-    return DEFW_OK;
-}
-
-// To be removed. Will replace by defwBlockagesLayerMask
-int
-defwBlockageMask(int colorMask)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_BLOCKAGE_MASK;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_PLACE && defwState != DEFW_BLOCKAGE_LAYER &&
-        defwState != DEFW_BLOCKAGE_RECT)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     + MASK %d", colorMask);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_LAYER;
-    return DEFW_OK;
-}
-
-// Tobe removed. Will be replaced by defwBlockagesRect.
-int
-defwBlockageRect(int    xl,
-                 int    yl,
-                 int    xh,
-                 int    yh)
-{
-    defwFunc = DEFW_BLOCKAGE_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_PLACE && defwState != DEFW_BLOCKAGE_LAYER &&
-        defwState != DEFW_BLOCKAGE_RECT && defwState != DEFW_BLOCKAGE_MASK)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     RECT ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_RECT;
-    return DEFW_OK;
-}
-
-// Tobe removed. Will be replaced by defwBlockagesPolygon.
-int
-defwBlockagePolygon(int num_polys,
-                    int *xl,
-                    int *yl)
-{
-    int i;
-
-    defwFunc = DEFW_BLOCKAGE_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_BLOCKAGE_LAYER && defwState != DEFW_BLOCKAGE_RECT
-        && defwState != DEFW_BLOCKAGE_MASK)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_BLOCKAGE_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     POLYGON ");
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            fprintf(defwFile, "( %d %d ) ", *xl++, *yl++);
-        else {
-            fprintf(defwFile, "\n             ( %d %d ) ", *xl++, *yl++);
-            defwLines++;
-        }
-    }
-    defwLines++;
-    defwState = DEFW_BLOCKAGE_RECT;  // use rect flag.  It works the same for poly
-    return DEFW_OK;
-}
-
-
-int
-defwEndBlockages()
-{
-    defwFunc = DEFW_BLOCKAGE_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_BLOCKAGE_RECT)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, " ;\n");
-
-    fprintf(defwFile, "END BLOCKAGES\n\n");
-    defwLines++;
-
-    defwState = DEFW_BLOCKAGE_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartSlots(int count)
-{
-    defwFunc = DEFW_SLOT_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_SLOT_START) && (defwState <= DEFW_SLOT_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "SLOTS %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_SLOT_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwSlotLayer(const char *layerName)
-{
-    defwFunc = DEFW_SLOT_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_SLOT_START && defwState == DEFW_SLOT_LAYER)
-        return DEFW_BAD_DATA;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_SLOT_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s \n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_SLOT_LAYER;
-    return DEFW_OK;
-}
-
-
-int
-defwSlotRect(int    xl,
-             int    yl,
-             int    xh,
-             int    yh)
-{
-    defwFunc = DEFW_SLOT_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_SLOT_LAYER && defwState != DEFW_SLOT_RECT)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_SLOT_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     RECT ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-    defwLines++;
-    defwState = DEFW_SLOT_RECT;
-    return DEFW_OK;
-}
-
-
-int
-defwSlotPolygon(int     num_polys,
-                double  *xl,
-                double  *yl)
-{
-    int i;
-
-    defwFunc = DEFW_SLOT_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_SLOT_LAYER && defwState != DEFW_SLOT_RECT)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_SLOT_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     POLYGON ");
-
-    printPointsNum = 0;
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-        else {
-            printPoints(defwFile, *xl++, *yl++, "\n             ", " ");
-            defwLines++;
-        }
-    }
-    defwLines++;
-    defwState = DEFW_SLOT_RECT;
-    return DEFW_OK;
-}
-
-
-int
-defwEndSlots()
-{
-    defwFunc = DEFW_SLOT_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_SLOT_RECT)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, " ;\n");
-
-    fprintf(defwFile, "END SLOTS\n\n");
-    defwLines++;
-
-    defwState = DEFW_SLOT_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartFills(int count)
-{
-    defwFunc = DEFW_FILL_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_FILL_START) && (defwState <= DEFW_FILL_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.4)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "FILLS %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_FILL_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwFillLayer(const char *layerName)
-{
-    defwFunc = DEFW_FILL_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_START && defwState == DEFW_FILL_LAYER)
-        return DEFW_BAD_DATA;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_FILL_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - LAYER %s \n", layerName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_FILL_LAYER;
-    return DEFW_OK;
-}
-
-int
-defwFillLayerMask(int colorMask)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_FILL_LAYERMASK;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_LAYER)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + MASK %d", colorMask);
-    defwLines++;
-    defwState = DEFW_FILL_LAYERMASK;
-    return DEFW_OK;
-}
-
-
-// 5.71
-int
-defwFillLayerOPC()
-{
-    defwFunc = DEFW_FILL_OPC;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_LAYER && defwState != DEFW_FILL_LAYERMASK)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + OPC");
-    defwLines++;
-    defwState = DEFW_FILL_OPC;
-    return DEFW_OK;
-}
-
-int
-defwFillRect(int    xl,
-             int    yl,
-             int    xh,
-             int    yh)
-{
-    defwFunc = DEFW_FILL_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_LAYER && defwState != DEFW_FILL_RECT &&
-        defwState != DEFW_FILL_OPC && defwState != DEFW_FILL_LAYERMASK)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_FILL_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     RECT ( %d %d ) ( %d %d )", xl, yl, xh, yh);
-    defwLines++;
-    defwState = DEFW_FILL_RECT;
-    return DEFW_OK;
-}
-
-
-int
-defwFillPolygon(int     num_polys,
-                double  *xl,
-                double  *yl)
-{
-    int i;
-
-    defwFunc = DEFW_FILL_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_LAYER && defwState != DEFW_FILL_RECT &&
-        defwState != DEFW_FILL_OPC && defwState != DEFW_FILL_LAYERMASK)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_FILL_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     POLYGON ");
-    printPointsNum = 0;
-    for (i = 0; i < num_polys; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-        else {
-            printPoints(defwFile, *xl++, *yl++,  "\n             ", " ");
-            defwLines++;
-        }
-    }
-    defwLines++;
-    defwState = DEFW_FILL_RECT;
-    return DEFW_OK;
-}
-
-// 5.7
-int
-defwFillVia(const char *viaName)
-{
-    defwFunc = DEFW_FILL_LAYER;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_START && defwState == DEFW_FILL_LAYER)
-        return DEFW_BAD_DATA;
-
-    if (!viaName || !*viaName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_FILL_RECT)
-        fprintf(defwFile, " ;\n");   // end the previous rectangle
-    fprintf(defwFile, "   - VIA %s \n", viaName);
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_FILL_VIA;
-    return DEFW_OK;
-}
-
-int
-defwFillViaMask(int maskColor)
-{
-    if (defVersionNum < 5.8) {
-        return DEFW_WRONG_VERSION;
-    }
-
-    defwFunc = DEFW_FILL_VIAMASK;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_VIA)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + MASK %d", maskColor);
-    defwLines++;
-    defwState = DEFW_FILL_VIAMASK;
-    return DEFW_OK;
-}
-
-
-// 5.71
-int
-defwFillViaOPC()
-{
-    defwFunc = DEFW_FILL_OPC;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_VIA && defwState != DEFW_FILL_VIAMASK)
-        return DEFW_BAD_DATA;
-
-    fprintf(defwFile, "     + OPC");
-    defwLines++;
-    defwState = DEFW_FILL_OPC;
-    return DEFW_OK;
-}
-
-
-int
-defwFillPoints(int      num_points,
-               double   *xl,
-               double   *yl)
-{
-    int i;
-
-    defwFunc = DEFW_FILL_RECT;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_FILL_VIA && defwState != DEFW_FILL_RECT &&
-        defwState != DEFW_FILL_OPC && defwState != DEFW_FILL_VIAMASK)
-        return DEFW_BAD_DATA;
-
-    if (defwState == DEFW_FILL_RECT)
-        fprintf(defwFile, "\n");   // set a newline for the previous rectangle
-
-    fprintf(defwFile, "     ");
-    printPointsNum = 0;
-
-    for (i = 0; i < num_points; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xl++, *yl++, "", " ");
-        else {
-            printPoints(defwFile, *xl++, *yl++, "\n             ", " ");
-            defwLines++;
-        }
-    }
-
-    defwLines++;
-    defwState = DEFW_FILL_RECT;
-    return DEFW_OK;
-}
-
-
-int
-defwEndFills()
-{
-    defwFunc = DEFW_FILL_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_FILL_RECT && defwState != DEFW_FILL_OPC)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, " ;\n");
-
-    fprintf(defwFile, "END FILLS\n\n");
-    defwLines++;
-
-    defwState = DEFW_FILL_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartNonDefaultRules(int count)
-{
-    defwFunc = DEFW_NDR_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_NDR_START) && (defwState <= DEFW_NDR_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "NONDEFAULTRULES %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_NDR_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwNonDefaultRule(const char   *ruleName,
-                   int          hardSpacing)
-{
-    defwFunc = DEFW_NDR;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_NDR_START && defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-
-    if (!ruleName || !*ruleName)  // require
-        return DEFW_BAD_DATA;
-    if (defwState == DEFW_NDR)
-        fprintf(defwFile, ";\n");
-    fprintf(defwFile, "   - %s", ruleName);
-    if (hardSpacing)
-        fprintf(defwFile, "\n      + HARDSPACING");
-    defwCounter--;
-    defwLines++;
-    defwState = DEFW_NDR;
-    return DEFW_OK;
-}
-
-
-int
-defwNonDefaultRuleLayer(const char  *layerName,
-                        int         width,
-                        int         diagWidth,
-                        int         spacing,
-                        int         wireExt)
-{
-    defwFunc = DEFW_NDR;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-
-    if (!layerName || !*layerName)  // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "\n      + LAYER %s ", layerName);
-    fprintf(defwFile, " WIDTH %d ", width);
-    if (diagWidth)
-        fprintf(defwFile, " DIAGWIDTH %d ", diagWidth);
-    if (spacing)
-        fprintf(defwFile, " SPACING %d ", spacing);
-    if (wireExt)
-        fprintf(defwFile, " WIREEXT %d ", wireExt);
-    defwLines++;
-    defwState = DEFW_NDR;
-    return DEFW_OK;
-}
-
-int
-defwNonDefaultRuleVia(const char *viaName)
-{
-    defwFunc = DEFW_NDR;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-
-    if (!viaName || !*viaName)  // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "\n      + VIA %s ", viaName);
-    defwLines++;
-    defwState = DEFW_NDR;
-    return DEFW_OK;
-}
-
-int
-defwNonDefaultRuleViaRule(const char *viaRuleName)
-{
-    defwFunc = DEFW_NDR;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-
-    if ((viaRuleName == 0) || (*viaRuleName == 0))  // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "\n      + VIARULE %s ", viaRuleName);
-    defwLines++;
-    defwState = DEFW_NDR;
-    return DEFW_OK;
-}
-
-int
-defwNonDefaultRuleMinCuts(const char    *cutLayerName,
-                          int           numCuts)
-{
-    defwFunc = DEFW_NDR;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-
-    if ((cutLayerName == 0) || (*cutLayerName == 0))  // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "\n      + MINCUTS %s %d ", cutLayerName, numCuts);
-    defwLines++;
-    defwState = DEFW_NDR;
-    return DEFW_OK;
-}
-
-int
-defwEndNonDefaultRules()
-{
-    defwFunc = DEFW_NDR_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_NDR)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, ";\nEND NONDEFAULTRULES\n\n");
-    defwLines++;
-
-    defwState = DEFW_NDR_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartStyles(int count)
-{
-    defwFunc = DEFW_STYLES_START;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if ((defwState >= DEFW_STYLES_START) && (defwState <= DEFW_STYLES_END))
-        return DEFW_BAD_ORDER;
-    if (defVersionNum < 5.6)
-        return DEFW_WRONG_VERSION;
-
-    fprintf(defwFile, "STYLES %d ;\n", count);
-    defwLines++;
-
-    defwState = DEFW_STYLES_START;
-    defwCounter = count;
-    return DEFW_OK;
-}
-
-int
-defwStyles(int      styleNums,
-           int      num_points,
-           double   *xp,
-           double   *yp)
-{
-    int i;
-
-    defwFunc = DEFW_STYLES;
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    // May be user already define layer
-    if (defwState != DEFW_STYLES_START && defwState != DEFW_STYLES)
-        return DEFW_BAD_ORDER;
-
-    if (styleNums < 0)  // require
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "   - STYLE %d ", styleNums);
-
-    printPointsNum = 0;
-    for (i = 0; i < num_points; i++) {
-        if ((i == 0) || ((i % 5) != 0))
-            printPoints(defwFile, *xp++, *yp++, "", " ");
-        else {
-            printPoints(defwFile, *xp++, *yp++, "\n       ", " ");
-            defwLines++;
-        }
-    }
-
-    defwCounter--;
-    defwLines++;
-    fprintf(defwFile, ";\n");
-    defwState = DEFW_STYLES;
-    return DEFW_OK;
-}
-
-int
-defwEndStyles()
-{
-    defwFunc = DEFW_STYLES_END;   // Current function of writer
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (defwState != DEFW_STYLES)
-        return DEFW_BAD_ORDER;
-    if (defwCounter > 0)
-        return DEFW_BAD_DATA;
-    else if (defwCounter < 0)
-        return DEFW_TOO_MANY_STMS;
-
-    fprintf(defwFile, "END STYLES\n\n");
-    defwLines++;
-
-    defwState = DEFW_STYLES_END;
-    return DEFW_OK;
-}
-
-
-int
-defwStartBeginext(const char *name)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState == DEFW_BEGINEXT_START ||
-        defwState == DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "BEGINEXT \"%s\"\n", name);
-
-    defwState = DEFW_BEGINEXT_START;
-    defwLines++;
-    return DEFW_OK;
-}
-
-int
-defwBeginextCreator(const char *creatorName)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_BEGINEXT_START &&
-        defwState != DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-    if (!creatorName || creatorName == 0 || *creatorName == 0)
-        return DEFW_BAD_DATA;
-    fprintf(defwFile, "   CREATOR \"%s\"\n", creatorName);
-
-    defwState = DEFW_BEGINEXT;
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwBeginextDate()
-{
-    time_t  todayTime;
-    char    *rettime;
-
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_BEGINEXT_START &&
-        defwState != DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-
-    todayTime = time(NULL);             // time in UTC 
-    rettime = ctime(&todayTime);        // convert to string
-    rettime[strlen(rettime) - 1] = '\0';  // replace \n with \0
-    fprintf(defwFile, "   DATE \"%s\"", rettime);
-
-    defwState = DEFW_BEGINEXT;
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwBeginextRevision(int    vers1,
-                     int    vers2)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_BEGINEXT_START &&
-        defwState != DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, "\n   REVISION %d.%d", vers1, vers2);
-
-    defwState = DEFW_BEGINEXT;
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwBeginextSyntax(const char   *title,
-                   const char   *string)
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_BEGINEXT_START &&
-        defwState != DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, "\n   - %s %s", title, string);
-
-    defwState = DEFW_BEGINEXT;
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwEndBeginext()
-{
-    if (!defwFile)
-        return DEFW_UNINITIALIZED;
-    if (!defwDidInit)
-        return DEFW_BAD_ORDER;
-    if (defwState != DEFW_BEGINEXT_START &&
-        defwState != DEFW_BEGINEXT)
-        return DEFW_BAD_ORDER;
-    fprintf(defwFile, ";\nENDEXT\n\n");
-
-    defwState = DEFW_BEGINEXT_END;
-    defwLines++;
-    return DEFW_OK;
-}
-
-
-int
-defwEnd()
-{
-    defwFunc = DEFW_END;   // Current function of writer
-    if (!defwFile)
-        return 1;
-
-    if (defwState == DEFW_ROW)
-        fprintf(defwFile, ";\n\n");  // add the ; and \n for the previous row.
-
-    fprintf(defwFile, "END DESIGN\n\n");
-    defwLines++;
-    //defwFile = 0;
-    defwState = DEFW_DONE;
-    return DEFW_OK;
-}
-
-
-int
-defwCurrentLineNumber()
-{
-    return defwLines;
-}
-
-
-void
-defwPrintError(int status)
-{
-    switch (status) {
-    case DEFW_OK:
-        fprintf(defwFile, "No Error.\n");
-        break;
-    case DEFW_UNINITIALIZED:
-        printf("Need to call defwInit first.\n");
-        break;
-    case DEFW_BAD_ORDER:
-        fprintf(defwFile, "%s - Incorrect order of data.\n",
-                defwStateStr[defwFunc]);
-        break;
-    case DEFW_BAD_DATA:
-        fprintf(defwFile, "%s - Invalid data.\n",
-                defwStateStr[defwFunc]);
-        break;
-    case DEFW_ALREADY_DEFINED:
-        fprintf(defwFile, "%s - Section is allowed to define only once.\n",
-                defwStateStr[defwFunc]);
-        break;
-    case DEFW_WRONG_VERSION:
-        fprintf(defwFile, "%s - Version number is set before 5.6, but 5.6 API is used.\n",
-                defwStateStr[defwFunc]);
-        break;
-    case DEFW_OBSOLETE:
-        fprintf(defwFile, "%s - is no longer valid in 5.6.\n",
-                defwStateStr[defwObsoleteNum]);
-        break;
-    }
-    return;
-}
-
-
-void
-defwAddComment(const char *comment)
-{
-    if (comment)
-        fprintf(defwFile, "# %s\n", comment);
-    return;
-}
-
-
-void
-defwAddIndent()
-{
-    fprintf(defwFile, "   ");
-    return;
-}
-
-
-//***************************
-//   Questions:
-// - Is only one row rule allowed
-// - Is only one tracks rule allowed
-// - In the die area is a zero area allowed? overlaps?
-// - What type of checking is needed for the rows and tracks do loop?
-// - Can you have a default prop with a number AND a range?
-// - What is the pin properties section mentioned in the 5.1 spec?
-// *****************************
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.hpp
deleted file mode 100644
index 13af43a..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriter.hpp
+++ /dev/null
@@ -1,1752 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DEFW_WRITER_H
-#define DEFW_WRITER_H
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "defiKRDefs.hpp"
-#include "defiDefs.hpp"
-#include "defiUser.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/* Return codes for writing functions: */
-#define DEFW_OK                0
-#define DEFW_UNINITIALIZED     1
-#define DEFW_BAD_ORDER         2
-#define DEFW_BAD_DATA          3
-#define DEFW_ALREADY_DEFINED   4
-#define DEFW_WRONG_VERSION     5
-#define DEFW_OBSOLETE          6
-#define DEFW_TOO_MANY_STMS     7  // the number defined at the beginning of the
-                                  // section is smaller than the actual number
-                                  // of statements defined in that section 
-
-/* orient
-   0 = N
-   1 = W
-   2 = S
-   3 = E
-   4 = FN
-   5 = FW
-   6 = FS
-   7 = FE
-*/
-
-/* This routine will write a new line */
-extern int defwNewLine();
-
-/* The DEF writer initialization.  Must be called first.
- * Either this routine or defwInitCbk should be call only.
- * Can't call both routines in one program.
- * This routine is for user who does not want to use the callback machanism.
- * Returns 0 if successful. */
-extern int defwInit ( FILE* f, int vers1, int version2,
-	      const char* caseSensitive,  /* NAMESCASESENSITIVE */
-	      const char* dividerChar,    /* DIVIDERCHAR */
-	      const char* busBitChars,    /* BUSBITCHARS */
-	      const char* designName,     /* DESIGN */
-	      const char* technology,     /* optional(NULL) - TECHNOLOGY */
-	      const char* array,          /* optional(NULL) - ARRAYNAME */
-	      const char* floorplan,      /* optional(NULL) - FLOORPLAN */
-	      double units );             /* optional  (set to -1 to ignore) */
-
-/* The DEF writer initialization.  Must be called first.
- * Either this routine or defwInit should be call only.
- * Can't call both routines in one program.
- * This routine is for user who choose to use the callback machanism.
- * If user uses the callback for the writer, they need to provide
- * callbacks for Version, NamesCaseSensitive, BusBitChars and DividerChar.
- * These sections are required by the def.  If any of these callbacks
- * are missing, defaults will be used.
- * Returns 0 if successful. */
-extern int defwInitCbk (FILE* f);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwVersion (int vers1, int vers2);
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwCaseSensitive ( const char* caseSensitive );
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwBusBitChars ( const char* busBitChars );
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwDividerChar ( const char* dividerChar );
-
-/* This routine must be called after the defwInit.
- * This routine is required.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwDesignName ( const char* name );
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwTechnology ( const char* technology );
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwArray ( const char* array );
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwFloorplan ( const char* floorplan );
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwUnits ( int units );
-
-/* This routine must be called after the defwInit.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called 0 to many times. */
-extern int defwHistory ( const char* string );
-
-/* This routine must be called after the history routines (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwStartPropDef ( void );
-
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds integer property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-extern int defwIntPropDef(
-               const char* objType,   // LIBRARY | LAYER | VIA | VIARULE |
-                                      // NONDEFAULTRULE | MACRO | PIN 
-               const char* propName,
-               double leftRange,      /* optional(0) - RANGE */
-               double rightRange,     /* optional(0) */
-               int    propValue);     /* optional(NULL) */
- 
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds real property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-extern int defwRealPropDef(
-               const char* objType,   // LIBRARY | LAYER | VIA | VIARULE |
-                                      // NONDEFAULTRULE | MACRO | PIN 
-               const char* propName,
-               double leftRange,      /* optional(0) - RANGE */
-               double rightRange,     /* optional(0) */
-               double propValue);     /* optional(NULL) */
- 
-/* This routine must be called after defwStartPropDef.
- * This routine can be called multiple times.
- * It adds string property definition to the statement.
- * Returns 0 if successfull.
- * The objType can be LIBRARY or VIA or MACRO or PIN. */
-extern int defwStringPropDef(
-               const char* objType,    // LIBRARY | LAYER | VIA | VIARULE |
-                                       // NONDEFAULTRULE | MACRO | PIN
-               const char* propName,
-               double leftRange,       /* optional(0) - RANGE */
-               double rightRange,      /* optional(0) */
-               const char* propValue); /* optional(NULL) */
-
-/* This routine must be called after all the properties have been
- * added to the file.
- * If you called defwPropertyDefinitions then this routine is NOT optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwEndPropDef ( void );
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds string property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-extern int defwStringProperty(const char* propName, const char* propValue);
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds real property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-extern int defwRealProperty(const char* propName, double propValue);
-
-/* This routine can be called after defwRow, defwRegion, defwComponent,
- * defwPin, defwSpecialNet, defwNet, and defwGroup
- * This routine is optional, it adds int property to the statement.
- * Returns 0 if successful.
- * This routine can be called 0 to many times */
-extern int defwIntProperty(const char* propName, int propValue);
-
-/* This routine must be called after the property definitions (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwDieArea ( int xl,            /* point1 - x */
-                         int yl,            /* point1 - y */
-                         int xh,            /* point2 - x */
-                         int yh );          /* point2 - y */
-
-/* This routine must be called after the property definitions (if any).
- * This routine is optional.
- * This routine is the same as defwDieArea, but accept more than 2 points
- * This is a 5.6 syntax
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwDieAreaList ( int num_points, /* number of points on list */
-                             int* xl,        /* all the x points */
-                             int* yh);       /* all the y points */
-
-/* This routine must be called after the Die Area (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The integer "orient" and operation of the do is explained in
- * the documentation.
- * In 5.6, the DO syntax is optional and the STEP syntax is optional in DO */
-extern int defwRow ( const char* rowName, const char* rowType,
-		     int x_orig, int y_orig, int orient,
-		     int do_count,            /* optional (0) */
-                     int do_increment,        /* optional (0) */
-                     int xstep,               /* optional (0) */
-                     int ystep);              /* optional (0) */
-
-/* This routine must be called after the Die Area (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * This routine is the same as defwRow, excpet orient is a char* */
-extern int defwRowStr ( const char* rowName, const char* rowType,
-		        int x_orig, int y_orig, const char* orient,
-		        int do_count,         /* optional (0) */
-                        int do_increment,     /* optional (0) */
-                        int xstep,            /* optional (0) */
-                        int ystep);           /* optional (0) */
-
-/* This routine must be called after the defwRow (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The operation of the do is explained in the documentation. */
-extern int defwTracks ( const char* master,   /* X | Y */
-                        int doStart,          /* start */
-	                int doCount,          /* numTracks */
-                        int doStep,           /* space */
-                        int numLayers,        /* number of layers */
-                        const char** layers,  /* list of layers */
-			int mask = 0,         /* optional */
-			int sameMask = 0);    /* optional */
-
-/* This routine must be called after the defwTracks (if any).
- * This routine is optional.
- * Returns 0 if successful.
- * The operation of the do is explained in the documentation. */
-extern int defwGcellGrid ( const char* master, /* X | Y */
-                           int doStart,        /* start */
-	                   int doCount,        /* numColumns | numRows */
-                           int doStep);        /* space */
-
-/* This routine must be called after the defwTracks (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the default capacitance section.   All of the
- * capacitances must follow.
- * The count is the number of defwDefaultCap calls to follow.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-extern int defwStartDefaultCap ( int count );
-
-/* This routine is called once for each default cap.  The calls must
- * be preceeded by a call to defwStartDefaultCap and must be
- * terminated by a call to defwEndDefaultCap.
- * Returns 0 if successful.
- * This api is obsolete in 5.4. */
-extern int defwDefaultCap ( int pins,           /* MINPINS */
-                            double cap);        /* WIRECAP */
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * Returns 0 if successful.
- * If the count in StartDefaultCap is not the same as the number of
- * calls to DefaultCap then DEFW_BAD_DATA will return returned.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-extern int defwEndDefaultCap ( void );
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwCanPlace(const char* master,     /* sitename */
-                        int xOrig,
-                        int yOrig,
-	                int orient,             /* 0 to 7 */
-                        int doCnt,              /* numX */
-                        int doInc,              /* numY */
-                        int xStep,              /* spaceX */
-                        int yStep);             /* spaceY */
-
-/* This routine must be called after the defwDefaultCap calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwCanPlace, except orient is a char* */
-extern int defwCanPlaceStr(const char* master,     /* sitename */
-                           int xOrig,
-                           int yOrig,
-	                   const char* orient,     /* 0 to 7 */
-                           int doCnt,              /* numX */
-                           int doInc,              /* numY */
-                           int xStep,              /* spaceX */
-                           int yStep);             /* spaceY */
-
-/* This routine must be called after the defwCanPlace calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwCannotOccupy(const char* master,  /* sitename */
-                            int xOrig,
-                            int yOrig,
-	                    int orient,          /* 0 to 7 */
-                            int doCnt,           /* numX */
-                            int doInc,           /* numY */
-                            int xStep,           /* spaceX */
-                            int yStep);          /* spaceY */
-
-/* This routine must be called after the defwCanPlace calls (if any).
- * The operation of the do is explained in the documentation.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwCannotOccupy, except orient is a char* */
-extern int defwCannotOccupyStr(const char* master,  /* sitename */
-                               int xOrig,
-                               int yOrig,
-	                       const char* orient,  /* 0 to 7 */
-                               int doCnt,           /* numX */
-                               int doInc,           /* numY */
-                               int xStep,           /* spaceX */
-                               int yStep);          /* spaceY */
-
-/* This routine must be called after defwCannotOccupy (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the via section.   All of the vias must follow.
- * The count is the number of defwVia calls to follow.
- * The routine can be called only once. */
-extern int defwStartVias( int count );
-
-/* These routines enter each via into the file.
- * These routines must be called after the defwStartVias call.
- * defwViaName should be called first, follow either by defwViaPattern or
- * defwViaLayer.  At the end of each via, defwOneViaEnd should be called
- * These routines are for [- viaName [+ PATTERNNAME patternName + RECT layerName
- * pt pt]...;]...
- * Returns 0 if successful.
- * The routines can be called many times. */
-extern int defwViaName(const char* name);
-
-extern int defwViaPattern(const char* patternName);
-
-/* This routine can be called multiple times. */
-/* mask is 5.8 syntax */
-extern int defwViaRect(const char* layerName,
-                   int xl,         /* xl from the RECT */
-                   int yl,         /* yl from the RECT */
-                   int xh,         /* xh from the RECT */
-                   int yh,         /* yh from the RECT */
-		   int mask = 0);  /* optional */
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-/* mask is 5.8 syntax */
-extern int defwViaPolygon(const char* layerName,
-                          int num_polys, 
-			  double* xl, 
-			  double* yl, 
-			  int mask = 0);
-
-/* These routine must be called after defwViaName.
- * Either this routine or defwViaPattern can be called after each
- * defwViaName is called.
- * This is a 5.6 syntax
- * Returns 0 if successful
- * The routine can be called only once per defwViaName called. */
-extern int defwViaViarule(const char* viaRuleName,
-                          double xCutSize, double yCutSize,
-                          const char* botMetalLayer, const char* cutLayer,
-                          const char* topMetalLayer,
-                          double xCutSpacing, double yCutSpacing,
-                          double xBotEnc, double yBotEnc,
-                          double xTopEnc, double yTopEnc);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwViaViaruleRowCol(int numCutRows, int numCutCols);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwViaViaruleOrigin(int xOffset, int yOffset);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwViaViaruleOffset(int xBotOffset, int yBotOffset,
-                                int xTopOffset, int yTopOffset);
-
-/* This routine can call only after defwViaViarule.
- * It can only be called once.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwViaViarulePattern(const char* cutPattern);
-
-extern int defwOneViaEnd();
-
-/* This routine must be called after the defwVia calls.
- * Returns 0 if successful.
- * If the count in StartVias is not the same as the number of
- * calls to Via or ViaPattern then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-extern int defwEndVias( void );
-
-/* This routine must be called after via section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the region section.   All of the regions must follow.
- * The count is the number of defwRegion calls to follow.
- * The routine can be called only once. */
-extern int defwStartRegions( int count );
-
-/* This routine enter each region into the file.
- * This routine must be called after the defwStartRegions call.
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwRegionName(const char* name);
-
-/* This routine enter the region point to the region name.
- * This routine must be called after the defwRegionName call.
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwRegionPoints(int xl, int yl, int xh, int yh);
-
-/* This routine enter the region type, FENCE | GUIDE.
- * This routine must be called after the defwRegionName call.
- * This is a 5.4.1 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwRegionType(const char* type);  /* FENCE | GUIDE */
-
-/* This routine must be called after the defwRegion calls.
- * Returns 0 if successful.
- * If the count in StartRegions is not the same as the number of
- * calls to Region or RegionPattern then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-extern int defwEndRegions( void );
-
-/* This is a 5.8 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwComponentMaskShiftLayers(const char** layerNames,
-	                                int          numLayerName);
-
-/* This routine must be called after the regions section (if any).
- * This section of routines is NOT optional.
- * Returns 0 if successful.
- * The routine starts the components section. All of the components
- * must follow.
- * The count is the number of defwComponent calls to follow.
- * The routine can be called only once. */
-extern int defwStartComponents( int count );
-
-/* This routine enter each component into the file.
- * This routine must be called after the defwStartComponents call.
- * The optional fields will be ignored if they are set to zero
- * (except for weight which must be set to -1.0).
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwComponent(const char* instance,  /* compName */
-              const char* master,           /* modelName */
-              int   numNetName,             // optional(0) - # netNames defined
-                                            
-              const char** netNames,        /* optional(NULL) - list */
-              const char* eeq,              /* optional(NULL) - EEQMASTER */
-              const char* genName,          /* optional(NULL) - GENERATE */
-              const char* genParemeters,    /* optional(NULL) - parameters */
-              const char* source,           // optional(NULL) - NETLIST | DIST |
-                                            // USER | TIMING 
-              int numForeign,               // optional(0) - # foreigns,
-                                            // foreignx, foreigny & orients
-              const char** foreigns,        /* optional(NULL) - list */
-              int* foreignX, int* foreignY, /* optional(0) - list foreign pts */
-              int* foreignOrients,          /* optional(-1) - 0 to 7 */
-              const char* status,           // optional(NULL) - FIXED | COVER |
-                                            //  PLACED | UNPLACED
-              int statusX, int statusY,     /* optional(0) - status pt */
-              int statusOrient,             /* optional(-1) - 0 to 7 */
-              double weight,                /* optional(0) */
-              const char* region,           // optional(NULL) - either xl, yl,
-                                            // xh, yh or region 
-              int xl, int yl,               /* optional(0) - region pt1 */
-              int xh, int yh);              /* optional(0) - region pt2 */
-
-
-/* This routine enter each component into the file.
- * This routine must be called after the defwStartComponents call.
- * The optional fields will be ignored if they are set to zero
- * (except for weight which must be set to -1.0).
- * Returns 0 if successful.
- * The routine can be called many times. 
- * This routine is the same as defwComponent, except orient is a char** */
-extern int defwComponentStr(const char* instance,  /* compName */
-              const char* master,           /* modelName */
-              int   numNetName,             // optional(0) - # netNames defined
-                                            //
-              const char** netNames,        /* optional(NULL) - list */
-              const char* eeq,              /* optional(NULL) - EEQMASTER */
-              const char* genName,          /* optional(NULL) - GENERATE */
-              const char* genParemeters,    /* optional(NULL) - parameters */
-              const char* source,           // optional(NULL) - NETLIST | DIST |
-                                            // USER | TIMING 
-              int numForeign,               // optional(0) - # foreigns,
-                                            // foreignx, foreigny & orients
-              const char** foreigns,        /* optional(NULL) - list */
-              int* foreignX, int* foreignY, /* optional(0) - list foreign pts */
-              const char** foreignOrients,  /* optional(NULL) */
-              const char* status,           // optional(NULL) - FIXED | COVER |
-                                            // PLACED | UNPLACED 
-              int statusX, int statusY,     /* optional(0) - status pt */
-              const char* statusOrient,     /* optional(NULL) */
-              double weight,                /* optional(0) */
-              const char* region,           // optional(NULL) - either xl, yl,
-                                            // xh, yh or region 
-              int xl, int yl,               /* optional(0) - region pt1 */
-              int xh, int yh);              /* optional(0) - region pt2 */
-
-/* This is a 5.8 syntax.
- * Returns 0 if successful.
- * The routine can be called only once. */
-extern int defwComponentMaskShift(int shiftLayerMasks);
-
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * Either this routine or defwComponentHaloSoft can be called, but not both
- * This routine is optional.
- * This is a 5.6 syntax.
- * Returns 0 if successful.  */
-extern int defwComponentHalo(int left, int bottom, int right, int top);
- 
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * This routine is just like defwComponentHalo, except it writes the option SOFT
- * Either this routine or defwComponentHalo can be called, but not both
- * This routine is optional.
- * This is a 5.7 syntax.
- * Returns 0 if successful.  */
-extern int defwComponentHaloSoft(int left, int bottom, int right, int top);
- 
-/* This routine must be called after either the defwComponent or
- * defwComponentStr.
- * This routine can only called once per component.
- * This routine is optional.
- * This is a 5.7 syntax.
- * Returns 0 if successful.  */
-extern int defwComponentRouteHalo(int haloDist, const char* minLayer,
-                                  const char* maxLayer);
- 
-/* This routine must be called after the defwComponent calls.
- * Returns 0 if successful.
- * If the count in StartComponents is not the same as the number of
- * calls to Component then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-extern int defwEndComponents( void );
-
-/* This routine must be called after the components section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the pins section. All of the pins must follow.
- * The count is the number of defwPin calls to follow.
- * The routine can be called only once. */
-extern int defwStartPins( int count );
-
-/* This routine enter each pin into the file.
- * This routine must be called after the defwStartPins call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times.
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-extern int defwPin(const char* name,     /* pinName */
-              const char* net,           /* netName */
-              int special,               /* 0 - ignore, 1 - special */
-              const char* direction,     // optional(NULL) - INPUT | OUTPUT |
-                                         // INOUT | FEEDTHRU 
-              const char* use,           // optional(NULL) - SIGNAL | POWER |
-                                         // GROUND | CLOCK | TIEOFF | ANALOG 
-              const char* status,        // optional(NULL) - FIXED | PLACED |
-                                         // COVER 
-              int statusX, int statusY,  /* optional(0) - status point */
-              int orient,                /* optional(-1) - status orient */
-              const char* layer,         /* optional(NULL) - layerName */
-              int xl, int yl,            /* optional(0) - layer point1 */
-              int xh, int yh);           /* optional(0) - layer point2 */
-
-/* This routine enter each pin into the file.
- * This routine must be called after the defwStartPins call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times.
- * This routine is the same as defwPin, except orient is a char*
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-extern int defwPinStr(const char* name,     /* pinName */
-              const char* net,           /* netName */
-              int special,               /* 0 - ignore, 1 - special */
-              const char* direction,     // optional(NULL) - INPUT | OUTPUT |
-                                         // INOUT | FEEDTHRU 
-              const char* use,           // optional(NULL) - SIGNAL | POWER |
-                                         // GROUND | CLOCK | TIEOFF | ANALOG 
-              const char* status,        // optional(NULL) - FIXED | PLACED |
-                                         // COVER
-              int statusX, int statusY,  /* optional(0) - status point */
-              const char* orient,        /* optional(NULL) */
-              const char* layer,         /* optional(NULL) - layerName */
-              int xl, int yl,            /* optional(0) - layer point1 */
-              int xh, int yh);           /* optional(0) - layer point2 */
-
-/* This routine should be called if the layer has either SPACING or
- * DESIGNRULEWIDTH.  If this routine is used and the pin has only one
- * layer, the layer in defwPin or defwPinStr has to be null, otherwise
- * the layer will be written out twice.
- * This routine must be called after defwPin or defwPinStr.
- * This is a 5.6 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * This routine can be called multiple times within a pin. */
-extern int defwPinLayer(const char* layerName,
-              int spacing,         /* optional(0) - SPACING & DESIGNRULEWIDTH */
-              int designRuleWidth, /* are mutually exclusive */
-              int xl, int yl,
-              int xh, int yh,
-              int mask = 0);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out layer with polygon.
- * This is a 5.6 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-extern int defwPinPolygon(const char* layerName,
-              int spacing,         /* optional(0) - SPACING & DESIGNRULEWIDTH */
-              int designRuleWidth, /* are mutually exclusive */
-              int num_polys, double* xl, double* yl,
-              int mask = 0);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out layer with via.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-extern int defwPinVia(const char* viaName, int xl, int yl, int mask = 0);
-
-/* This routine must be called after defwPin or defwPinStr.
- * This routine is to write out pin with port.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-extern int defwPinPort();
-
-/* This routine is called after defwPinPort. 
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * This routine can be called multiple times within a pin. */
-extern int defwPinPortLayer(const char* layerName,
-              int spacing,         /* optional(0) - SPACING & DESIGNRULEWIDTH */
-              int designRuleWidth, /* are mutually exclusive */
-              int xl, int yl,
-              int xh, int yh,
-              int mask = 0);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-extern int defwPinPortPolygon(const char* layerName,
-              int spacing,         /* optional(0) - SPACING & DESIGNRULEWIDTH */
-              int designRuleWidth, /* are mutually exclusive */
-              int num_polys, double* xl, double* yl,
-              int mask = 0);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called multiple times within a pin. */
-extern int defwPinPortVia(const char* viaName, int xl, int yl, int mask = 0);
-
-/* This routine must be called after defwPinPort.
- * This is a 5.7 syntax.
- * This routine is optional.
- * Returns 0 if successful.
- * The routine can be called many times.
- * NOTE: Use defwPinLayer to write out layer with SPACING or DESIGNRULEWIDTH */
-extern int defwPinPortLocation(
-              const char* status,        /* FIXED | PLACED | COVER */
-              int statusX, int statusY,  /* status point */
-              const char* orient);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-extern int defwPinNetExpr(const char* pinExpr);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-extern int defwPinSupplySensitivity(const char* pinName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.6 syntax.
- * The routine can be called only once per pin. */
-extern int defwPinGroundSensitivity(const char* pinName);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinPartialMetalArea(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinPartialMetalSideArea(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinPartialCutArea(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinDiffArea(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.5 syntax.
- * The oxide can be either OXIDE1, OXIDE2, OXIDE3, or OXIDE4.
- * Each oxide value can be called only once after defwPin. */
-extern int defwPinAntennaModel(const char* oxide);
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinGateArea(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinMaxAreaCar(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinMaxSideAreaCar(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after defwPin.
- * Returns 0 if successful.
- * This is a 5.4 syntax.
- * The routine can be called multiple times. */
-extern int defwPinAntennaPinMaxCutCar(int value,
-              const char* layerName);    /* optional(NULL) */
-
-/* This routine must be called after the defwPin calls.
- * Returns 0 if successful.
- * If the count in StartPins is not the same as the number of
- * calls to Pin then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-extern int defwEndPins( void );
-
-/* This routine must be called after the pin section (if any).
- * This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the pinproperties section. All of the pinproperties
- * must follow.
- * The count is the number of defwPinProp calls to follow.
- * The routine can be called only once. */
-extern int defwStartPinProperties( int count );
-
-/* This routine enter each pinproperty into the file.
- * This routine must be called after the defwStartPinProperties call.
- * The optional fields will be ignored if they are set to zero.
- * Returns 0 if successful.
- * The routine can be called many times. */
-extern int defwPinProperty(const char* name,     /* compName | PIN */
-              const char* pinName);              /* pinName */
-
-/* This routine must be called after the defwPinProperty calls.
- * Returns 0 if successful.
- * If the count in StartPins is not the same as the number of
- * calls to Pin then DEFW_BAD_DATA will return returned.
- * The routine can be called only once. */
-extern int defwEndPinProperties( void );
-
-/* Routines to enter a special net or nets into the file.
- * You must first call defwStartSpecialNets with the number of
- * nets. This section is required, even if you do not have any nets.
- * For each net you should call defwSpecialNet followed by
- * one or more defwSpecialNetConnection calls.
- * After the connections come the options.  Options are
- * NOT required.
- * Each net is completed by calling defwSpecialNetEndOneNet().
- * The nets section is finished by calling defwEndNets(). */
-extern int defwStartSpecialNets(int count);
-
-/* This routine must be called after the defwStartSpecialNets it is for
- * - netName */
-extern int defwSpecialNet(const char* name);   /* netName */
-
-/* This routine is for compNameRegExpr, pinName, and SYNTHESIZED */
-/* It can be called multiple times */
-extern int defwSpecialNetConnection(const char* inst,    /* compNameRegExpr */
-                   const char* pin,       /* pinName */
-                   int synthesized);     /* 0 - ignore, 1 - SYNTHESIZED  */
-
-/* This routine is for + FIXEDBUMP
- * This is a 5.4.1 syntax */
-extern int defwSpecialNetFixedbump();
-
-/* This routine is for + VOLTAGE volts */
-extern int defwSpecialNetVoltage(double v);
-
-/* This routine is for + SPACING layerName spacing [RANGE minwidth maxwidth */
-extern int defwSpecialNetSpacing(const char* layer,  /* layerName */
-                    int spacing,          /* spacing */
-                    double minwidth,      /* optional(0) - minwidth */
-                    double maxwidth);     /* optional(0) - maxwidth */
-
-/* This routine is for + WIDTH layerName width */
-extern int defwSpecialNetWidth(const char* layer, /* layerName */
-                    int width);                   /* width */
-
-/* This routine is for + SOURCE {NETLIST | DIST | USER | TIMING} */
-extern int defwSpecialNetSource(const char* name);
-
-/* This routine is for + ORIGINAL netName */
-extern int defwSpecialNetOriginal(const char* name);   /* netName */
-
-/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC | TRUNK} */
-extern int defwSpecialNetPattern(const char* name);
-
-/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF |
-   ANALOG | SCAN | RESET} */
-extern int defwSpecialNetUse(const char* name);
-
-/* This routine is for + WEIGHT weight */
-extern int defwSpecialNetWeight(double value);
-
-/* This routine is for + ESTCAP wireCapacitance */
-extern int defwSpecialNetEstCap(double value);
-
-/* Paths are a special type of option.  A path must begin
- * with a defwSpecialNetPathStart and end with a defwSpecialNetPathEnd().
- * The individual parts of the path can be entered in
- * any order. */
-extern int defwSpecialNetPathStart(const char* typ); // ROUTED | FIXED | COVER |
-                                                     // SHIELD | NEW 
-extern int defwSpecialNetShieldNetName(const char* name); /* shieldNetName */
-
-extern int defwSpecialNetPathLayer(const char* name); /* layerName */
-
-extern int defwSpecialNetPathWidth(int width);
-
-/* This routine is optional.
- * This is a 5.6 syntax. */
-extern int defwSpecialNetPathStyle(int styleNum);
-
-extern int defwSpecialNetPathShape(const char* shapeType); // RING | STRIPE |
-        // FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIRE 
-
-
-/* This routine is optional.
-   This is a 5.8 syntax.
- * Returns 0 if successful. */
-extern int defwSpecialNetPathMask(int colorMask);
-
-/* x and y location of the path */
-extern int defwSpecialNetPathPoint(int numPts,  /* number of connected points */
-                   double* pointx,     /* point x list */
-                   double* pointy);    /* point y list */
-extern int defwSpecialNetPathVia(const char* name);   /* viaName */
-
-/* This routine is called after defwSpecialNetPath
- * This is a 5.4.1 syntax */
-extern int defwSpecialNetPathViaData(int numX, int numY, int stepX, int stepY);
-
-/* x and y location of the path */
-extern int defwSpecialNetPathPointWithWireExt(
-                   int numPts,                /* number of connected points */
-                   double* pointx,       /* point x list */
-                   double* pointy,       /* point y list */
-                   double* optValue);       /* optional(NULL) value */
-
-extern int defwSpecialNetPathEnd();
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-extern int defwSpecialNetPolygon(const char* layerName,
-                                 int num_polys, double* xl, double* yl);
-
-/* This is a 5.6 syntax
- * This routine can be called multiple times. */
-extern int defwSpecialNetRect(const char* layerName,
-                              int xl, int yl, int xh, int yh);
-
-extern int defwSpecialNetVia(const char* layerName);
-
-extern int defwSpecialNetViaWithOrient(const char* layerName, int orient);
-
-extern int defwSpecialNetViaPoints(int num_points, double* xl, double* yl);
-
-/* This routine is called at the end of each net */
-extern int defwSpecialNetEndOneNet();
-
-/* 5.3 for special net */
-/* Shields are a special type of option.  A shield must begin
- * with a defwSpecialNetShieldStart and end with a defwSpecialNetShieldEnd().
- * The individual parts of the shield can be entered in
- * any order. */
-extern int defwSpecialNetShieldStart(const char* name);
-
-extern int defwSpecialNetShieldLayer(const char* name); /* layerName */
-extern int defwSpecialNetShieldWidth(int width);        /* width */
-extern int defwSpecialNetShieldShape(const char* shapeType); // RING | STRIPE |
-        // FOLLOWPIN | IOWIRE | COREWIRE | BLOCKWIRE | FILLWIRE | BLOCKAGEWIRE
- 
-/* x and y location of the path */
-extern int defwSpecialNetShieldPoint(int numPts, /* # of connected points */
-                   double* pointx,     /* point x list */
-                   double* pointy);    /* point y list */
-extern int defwSpecialNetShieldVia(const char* name);   /* viaName */
-
-/* A 5.4.1 syntax */
-extern int defwSpecialNetShieldViaData(int numX, int numY, int stepX, int stepY);
-extern int defwSpecialNetShieldEnd();
-/* end 5.3 */
- 
-/* This routine is called at the end of the special net section */
-extern int defwEndSpecialNets();
-
-/* Routines to enter a net or nets into the file.
- * You must first call defwNets with the number of nets.
- * This section is required, even if you do not have any nets.
- * For each net you should call defwNet followed by one or
- * more defwNetConnection calls.
- * After the connections come the options.  Options are
- * NOT required.
- * Each net is completed by calling defwNetEndOneNet().
- * The nets section is finished by calling defwEndNets(). */
-extern int defwStartNets(int count);
-
-/* This routine must be called after the defwStartNets, it is for - netName */
-extern int defwNet(const char* name);
-
-/* This routine is for { compName | PIN } pinName [+ SYNTHESIZED] */
-/* It can be called multiple times */
-extern int defwNetConnection(const char* inst,    /* compName */
-                   const char* pin,      /* pinName */
-                   int synthesized);    /* 0 - ignore, 1 - SYNTHESIZED */
-
-/* This routine is for MUSTJOIN, compName, pinName */
-extern int defwNetMustjoinConnection(const char* inst,  /* compName */
-                                     const char* pin);     /* pinName */
-
-/* This routine is for + VPIN vpinName [LAYER layerName pt pt
- * [{ PLACED | FIXED | COVER } pt orient] */
-extern int defwNetVpin(const char* vpinName,
-                 const char* layerName,     /* optional(NULL) */
-                 int layerXl, int layerYl,  /* layer point1 */
-                 int layerXh, int layerYh,  /* layer point2 */
-                 const char* status,        /* optional(NULL) */
-                 int statusX, int statusY,  /* optional(0) - status point */
-                 int orient);               /* optional(-1) */
-
-/* This routine is for + VPIN vpinName [LAYER layerName pt pt
- * [{ PLACED | FIXED | COVER } pt orient]
- * This routine is the same as defwNetVpin, except orient is a char* */
-extern int defwNetVpinStr(const char* vpinName,
-                 const char* layerName,     /* optional(NULL) */
-                 int layerXl, int layerYl,  /* layer point1 */
-                 int layerXh, int layerYh,  /* layer point2 */
-                 const char* status,        /* optional(NULL) */
-                 int statusX, int statusY,  /* optional(0) - status point */
-                 const char* orient);       /* optional(NULL) */
-
-/* This routine can be called either within net or subnet.
- * it is for NONDEFAULTRULE rulename */
-extern int defwNetNondefaultRule(const char* name);
-
-/* This routine is for + XTALK num */
-extern int defwNetXtalk(int xtalk);
-
-/* This routine is for + FIXEDBUMP
- * This is a 5.4.1 syntax */
-extern int defwNetFixedbump();
-
-/* This routine is for + FREQUENCY
- * This is a 5.4.1 syntax */
-extern int defwNetFrequency(double frequency);
-
-/* This routine is for + SOURCE {NETLIST | DIST | USER | TEST | TIMING} */
-extern int defwNetSource(const char* name);
-
-/* This routine is for + ORIGINAL netname */
-extern int defwNetOriginal(const char* name);
-
-/* This routine is for + USE {SIGNAL | POWER | GROUND | CLOCK | TIEOFF | 
- * ANALOG} */
-extern int defwNetUse(const char* name);
-
-/* This routine is for + PATTERN {STEINER | BALANCED | WIREDLOGIC} */
-extern int defwNetPattern(const char* name);
-
-/* This routine is for + ESTCAP wireCapacitance */
-extern int defwNetEstCap(double value);
-
-/* This routine is for + WEIGHT weight */
-extern int defwNetWeight(double value);
-
-/* 5.3 for net */
-/* This routine is for + SHIELDNET weight */
-extern int defwNetShieldnet(const char* name);
-
-/* Noshield are a special type of option.  A noshield must begin
- * with a defwNetNoshieldStart and end with a defwNetNoshieldEnd().
- * The individual parts of the noshield can be entered in
- * any order. */
-extern int defwNetNoshieldStart(const char* name);
-
-/* x and y location of the path */
-extern int defwNetNoshieldPoint(int numPts, /* number of connected points */
-                   const char** pointx,     /* point x list */
-                   const char** pointy);    /* point y list */
-extern int defwNetNoshieldVia(const char* name);   /* viaName */
-extern int defwNetNoshieldEnd();
-/* end 5.3 */
-
-/* Subnet are a special type of option. A subnet must begin
- * with a defwNetSubnetStart and end with a defwNetSubnetEnd().
- * Routines to call within the subnet are: defwNetSubnetPin,
- * defwNetNondefaultRule and defwNetPathStart... */
-extern int defwNetSubnetStart(const char* name);
-
-/* This routine is called after the defwNetSubnet, it is for
- * [({compName | PIN} pinName) | (VPIN vpinName)]... */
-extern int defwNetSubnetPin(const char* compName,  /* compName | PIN | VPIN */
-                 const char* pinName);    /* pinName | vpinName */
-
-extern int defwNetSubnetEnd();
-
-/* Paths are a special type of option.  A path must begin
- * with a defwNetPathStart and end with a defwPathEnd().
- * The individual parts of the path can be entered in
- * any order. */
-extern int defwNetPathStart(const char* typ); // ROUTED | FIXED | COVER |
-                                              // NOSHIELD | NEW 
-extern int defwNetPathWidth(int w);           /* width */
-extern int defwNetPathLayer(const char* name, /* layerName */
-                 int isTaper,                 /* 0 - ignore, 1 - TAPER */
-                 const char* rulename);       /* only one, isTaper or */
-                                              /*rulename can be assigned */
-/* This routine is optional.
- * This is a 5.6 syntax. */
-extern int defwNetPathStyle(int styleNum);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-extern int defwNetPathMask(int maskNum);
-
-extern int defwNetPathRect(int deltaX1, int deltaY1, int deltaX2, int deltaY2);
-
-extern int defwNetPathVirtual(int x, int y);
-
-/* x and y location of the path */
-extern int defwNetPathPoint(int numPts,       /* number of connected points */
-                   double* pointx,       /* point x list */
-                   double* pointy);      /* point y list */
-
-extern int defwNetPathPointWithExt(int numPts,
-				   double* pointx,
-				   double* pointy,
-				   double* optValue);
-
-extern int defwNetPathVia(const char* name);  /* viaName */
-
-extern int defwNetPathViaWithOrient(const char* name,
-                                    int orient);  /* optional(-1) */
-
-extern int defwNetPathViaWithOrientStr(const char* name,
-                                       const char* orient); /* optional(Null) */
-extern int defwNetPathEnd();
-
-/* This routine is called at the end of each net */
-extern int defwNetEndOneNet();
-
-/* This routine is called at the end of the net section */
-extern int defwEndNets();
-
-/* This section of routines is optional.
- * Returns 0 if successful.
- * The routine starts the I/O Timing section. All of the iotimings options
- * must follow.
- * The count is the number of defwIOTiming calls to follow.
- * The routine can be called only once.
- * This api is obsolete in 5.4. */
-extern int defwStartIOTimings(int count);
-
-/* This routine can be called after defwStaratIOTiming
- * It is for - - {(comp pin) | (PIN name)}
- * This api is obsolete in 5.4. */
-extern int defwIOTiming(const char* inst,      /* compName | PIN */
-                   const char* pin);           /* pinName */
-
-/* This routine is for + { RISE | FALL } VARIABLE min max
- * This api is obsolete in 5.4. */
-extern int defwIOTimingVariable(const char* riseFall,  /* RISE | FALL */
-                   int num1,                   /* min */
-                   int num2);                  /* max */
-
-/* This routine is for + { RISE | FALL } SLEWRATE min max
- * This api is obsolete in 5.4. */
-extern int defwIOTimingSlewrate(const char* riseFall,  /* RISE | FALL */
-                   int num1,                   /* min */
-                   int num2);                  /* max */
-
-/* This routine is for + DRIVECELL macroName [[FROMPIN pinName] TOPIN pinName]
- * [PARALLEL numDrivers]
- * This api is obsolete in 5.4. */
-extern int defwIOTimingDrivecell(const char* name,   /* macroName*/
-                   const char* fromPin,        /* optional(NULL) */
-                   const char* toPin,          /* optional(NULL) */
-                   int numDrivers);            /* optional(0) */
-
-/* This routine is for + CAPACITANCE capacitance
- * This api is obsolete in 5.4. */
-extern int defwIOTimingCapacitance(double num);
-
-/* This api is obsolete in 5.4. */
-extern int defwEndIOTimings();
-
-/* Routines to enter scan chains.  This section is optional
- * The section must start with a defwStartScanchains() call and
- * end with a defwEndScanchain() call.
- * Each scan chain begins with a defwScanchain() call.
- * The rest of the calls follow.  */
-extern int defwStartScanchains(int count);
-
-/* This routine can be called after defwStartScanchains
- * It is for - chainName */
-extern int defwScanchain(const char* name);
-
-/* This routine is for + COMMONSCANPINS [IN pin] [OUT pin] */
-extern int defwScanchainCommonscanpins(
-                  const char* inst1,      /* optional(NULL) - IN | OUT*/
-                  const char* pin1,       /* can't be null if inst1 is set */
-	          const char* inst2,      /* optional(NULL) - IN | OUT */
-                  const char* pin2);      /* can't be null if inst2 is set */
-
-
-/* This routine is for + PARTITION paratitionName [MAXBITS maxBits] */
-/* This is 5.4.1 syntax */
-extern int defwScanchainPartition(const char* name,
-                  int maxBits);           /* optional(-1) */
-
-/* This routine is for + START {fixedInComp | PIN } [outPin] */
-extern int defwScanchainStart(const char* inst,   /* fixedInComp | PIN */
-                  const char* pin);               /* outPin */
-
-/* This routine is for + STOP {fixedOutComp | PIN } [inPin] */
-extern int defwScanchainStop(const char* inst,    /* fixedOutComp | PIN */
-                  const char* pin);               /* inPin */
-
-/* This routine is for + FLOATING {floatingComp [IN pin] [OUT pin]}
- * This is a 5.4.1 syntax */
-extern int defwScanchainFloating(const char* name,   /* floatingComp */
-                  const char* inst1,      /* optional(NULL) - IN | OUT */
-                  const char* pin1,       /* can't be null if inst1 is set */
-	          const char* inst2,      /* optional(NULL) - IN | OUT */
-                  const char* pin2);      /* can't be null if inst2 is set */
-
-/* This routine is for + FLOATING {floatingComp [IN pin] [OUT pin]}
- * This is a 5.4.1 syntax.
- * This routine is the same as defwScanchainFloating.  But also added
- * the option BITS. */
-extern int defwScanchainFloatingBits(const char* name,   /* floatingComp */
-                  const char* inst1,      /* optional(NULL) - IN | OUT */
-                  const char* pin1,       /* can't be null if inst1 is set */
-	          const char* inst2,      /* optional(NULL) - IN | OUT */
-                  const char* pin2,       /* can't be null if inst2 is set */
-                  int   bits);            /* optional (-1) */
-
-/* This routine is for + ORDERED {fixedComp [IN pin] [OUT pin]
- * fixedComp [IN pin] [OUT pin].
- * When this routine is called for the 1st time within a scanchain, 
- * both name1 and name2 are required.  Only name1 is required is the
- * routine is called more than once. */
-extern int defwScanchainOrdered(const char* name1,
-                  const char* inst1,      /* optional(NULL) - IN | OUT */
-                  const char* pin1,       /* can't be null if inst1 is set */
-	          const char* inst2,      /* optional(NULL) - IN | OUT */
-                  const char* pin2,       /* can't be null if inst2 is set */
-                  const char* name2,
-                  const char* inst3,      /* optional(NULL) - IN | OUT */
-                  const char* pin3,       /* can't be null if inst3 is set */
-	          const char* inst4,      /* optional(NULL) - IN | OUT */
-                  const char* pin4);      /* can't be null if inst4 is set */
-
-/* This routine is for + ORDERED {fixedComp [IN pin] [OUT pin]
- * fixedComp [IN pin] [OUT pin].
- * When this routine is called for the 1st time within a scanchain, 
- * both name1 and name2 are required.  Only name1 is required is the
- * routine is called more than once.
- * This is a 5.4.1 syntax.
- * This routine is the same as defwScanchainOrdered.  But also added
- * the option BITS */
-extern int defwScanchainOrderedBits(const char* name1,
-                  const char* inst1,      /* optional(NULL) - IN | OUT */
-                  const char* pin1,       /* can't be null if inst1 is set */
-	          const char* inst2,      /* optional(NULL) - IN | OUT */
-                  const char* pin2,       /* can't be null if inst2 is set */
-                  int   bits1,            /* optional(-1) */
-                  const char* name2,
-                  const char* inst3,      /* optional(NULL) - IN | OUT */
-                  const char* pin3,       /* can't be null if inst3 is set */
-	          const char* inst4,      /* optional(NULL) - IN | OUT */
-                  const char* pin4,       /* can't be null if inst4 is set */
-                  int   bits2);           /* optional(-1) */
-
-extern int defwEndScanchain();
-
-/* Routines to enter constraints.  This section is optional
- * The section must start with a defwStartConstrains() call and
- * end with a defwEndConstraints() call.
- * Each contraint will call the defwConstraint...().
- * This api is obsolete in 5.4. */
-extern int defwStartConstraints (int count);  /* optional */
-
-/* The following routines are for - {operand [+ RISEMAX time] [+ FALLMAX time]
- * [+ RISEMIN time] [+ FALLMIN time] | WIREDLOGIC netName MAXDIST distance };}
- * operand - NET netName | PATH comp fromPin comp toPin | SUM (operand, ...)
- * The following apis are obsolete in 5.4. */ 
-extern int defwConstraintOperand();          /* begin an operand */
-extern int defwConstraintOperandNet(const char* netName);  /* NET */
-extern int defwConstraintOperandPath(const char* comp1,    /* PATH - comp|PIN */
-                  const char* fromPin,
-                  const char* comp2,
-                  const char* toPin);
-extern int defwConstraintOperandSum();        /* SUM */
-extern int defwConstraintOperandSumEnd();     /* mark the end of SUM */
-extern int defwConstraintOperandTime(const char* timeType, //  RISEMAX | FALLMAX | RISEMIN | FALLMIN
-                                     int time);
-extern int defwConstraintOperandEnd();        /* mark the end of operand */
-
-/* This routine is for - WIRELOGIC netName MAXDIST distance */
-extern int defwConstraintWiredlogic(const char* netName,
-                  int distance);
-
-extern int defwEndConstraints ();
-
-/* Routines to enter groups.  This section is optional
- * The section must start with a defwStartGroups() call and
- * end with a defwEndGroups() call.
- * Each group will call the defwGroup...(). */
-extern int defwStartGroups (int count);  /* optional */
-
-/* This routine is for - groupName compNameRegExpr ... */
-extern int defwGroup(const char* groupName,
-                   int numExpr,
-                   const char** groupExpr);
-
-/* This routine is for + SOFT [MAXHALFPERIMETER value] [MAXX value]
- * [MAXY value] */
-extern int defwGroupSoft(const char* type1, /* MAXHALFPERIMETER | MAXX | MAXY */
-                   double value1,
-                   const char* type2,
-                   double value2,
-                   const char* type3,
-                   double value3);
-
-/* This routine is for + REGION {pt pt | regionName} */
-extern int defwGroupRegion(int xl, int yl,   /* either the x & y or    */
-                   int xh, int yh,           /* regionName only, can't */
-                   const char* regionName);  /* be both */
-
-extern int defwEndGroups();
-
-/* Routines to enter Blockages.  This section is optional
- * The section must start with a defwStartBlockages() call and
- * end with a defwEndBlockages() call.
- * Each blockage will call the defwBlockages...().
- * This is a 5.4 syntax. */
-extern int defwStartBlockages(int count);   /* count = numBlockages */
-
-/* This routine is for - layerName
-* This routine is called per entry within a blockage for layer.
-* This is a 5.4 syntax. */
-extern int defwBlockagesLayer(const char* layerName);
-
-/* This routine is for - slots 
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-extern int defwBlockagesLayerSlots();
-
-/* This routine is for - fills
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-extern int defwBlockagesLayerFills();
-
-/* This routine is for - pushdown
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.4 syntax. */
-extern int defwBlockagesLayerPushdown();
-
-/* This routine is for - exceptpgnet
-* This routine is called per entry within a blockage layer, can't be more then one.
-* This is a 5.7 syntax. */
-extern int defwBlockagesLayerExceptpgnet();
-
-/* This routine is for - component
-* This routine called per entry within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-extern int defwBlockagesLayerComponent(const char* compName);
-
-/* This routine is for - spacing
-* Either this routine or defwBlockagesDesignRuleWidth is called per entry
-* within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-extern int defwBlockagesLayerSpacing(int minSpacing);
-
-/* This routine is for - designrulewidth
-* Either this routine or defwBlockagesSpacing is called per entry
-* within a blockage layer, can't be more than one.
-* This is a 5.6 syntax. */
-extern int defwBlockagesLayerDesignRuleWidth(int effectiveWidth);
-
-/* This routine is for - mask.
-* This routine called per entry within a blockage layer, can't be more than one.
-* This is a 5.8 syntax. */
-extern int defwBlockagesLayerMask(int maskColor);
-
-/* This routine is for - layerName & compName
- * Either this routine, defBlockageLayerSlots, defBlockageLayerFills,
- * or defwBlockagePlacement is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockageLayer(const char* layerName,
-                             const char* compName);   /* optional(NULL) */
-
-/* This routine is for - layerName & slots 
- * Either this routine, defBlockageLayer, defBlockageLayerFills,
- * defwBlockagePlacement, or defwBlockagePushdown is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockageLayerSlots(const char* layerName);
-
-/* This routine is for - layerName & fills
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockagePushdown is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockageLayerFills(const char* layerName);
-
-/* This routine is for - layerName & pushdown
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockageFills is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockageLayerPushdown(const char* layerName);
-
-/* This routine is for - exceptpgnet
- * Either this routine, defBlockageLayer, defBlockageLayerSlots,
- * defwBlockagePlacement, or defwBlockageFills is called per entry within
- * a blockage, can't be more then one.
- * This is a 5.7 syntax. */
-extern int defwBlockageLayerExceptpgnet(const char* layerName);
-
-/* This routine is for - spacing
- * Either this routine or defwBlockageDesignRuleWidth is called per entry
- * within a blockage, can't be more than one.
- * This is a 5.6 syntax. */
-extern int defwBlockageSpacing(int minSpacing);
-
-/* This routine is for - designrulewidth
- * Either this routine or defwBlockageSpacing is called per entry
- * within a blockage, can't be more than one.
- * This is a 5.6 syntax. */
-extern int defwBlockageDesignRuleWidth(int effectiveWidth);
-
-/* This routine is for - placement
- * This routine is called per entry within blockage for placement.
- * This is a 5.4 syntax.
- * 11/25/2002 - bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
- * this routine allows to call blockage without a component. */
-extern int defwBlockagesPlacement();
-
-/* This routine is for - component
-* This routine is called per entry within blockage placement, can't be more then one.
-* This is a 5.4 syntax. */
-extern int defwBlockagesPlacementComponent(const char* compName);
-
-/* This routine is for - Pushdown
-* This routine is called per entry within blockage placement, can't be more then one.
-* This is a 5.4 syntax. */
-extern int defwBlockagesPlacementPushdown();
-
-/* This routine is for - soft
-* Either this routine or defwBlockagesPlacementPartial
-* is called per entry within blockage placement, can't be more then one.
-* This is a 5.7 syntax. */
-extern int defwBlockagesPlacementSoft();
-
-/* This routine is for - Partial
-* Either this routine or defwBlockagesPlacementSoft
-* is called per entry within blockage placement, can't be more then one.
-* This is a 5.7 syntax. */
-extern int defwBlockagesPlacementPartial(double maxDensity);
-
-/* This routine is for rectangle.
-* This routine is optional and can be called multiple time. 
-* This is a 5.4 syntax. */
-extern int defwBlockagesRect(int xl, int yl, int xh, int yh);
-
-/* This routine is for polygon.
-* This routine is optional and can be called multiple time. 
-* This is a 5.6 syntax. */
-extern int defwBlockagesPolygon(int num_polys, int* xl, int* yl);
-
-/* This routine is for - placement
-* Either this routine or defBlockageLayer
-* is called per entry within blockage, can't be more then one.
-* This is a 5.4 syntax.
-* 11/25/2002 - bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
-* this routine allows to call blockage without a component. */
-extern int defwBlockagePlacement();
-
-/* This routine is for - placement & component
- * Either this routine or defwBlockagePlacementPushdown
- * is called per entry within blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockagePlacementComponent(const char* compName);
-
-/* This routine is for - placement & Pushdown
- * Either this routine or defwBlockagePlacementComponent
- * is called per entry within blockage, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwBlockagePlacementPushdown();
-
-/* This routine is for - placement & soft
- * Either this routine or defwBlockagePlacementPushdown
- * is called per entry within blockage, can't be more then one.
- * This is a 5.7 syntax. */
-extern int defwBlockagePlacementSoft();
-
-/* This routine is for - placement & Partial
- * Either this routine or defwBlockagePlacementComponent
- * is called per entry within blockage, can't be more then one.
- * This is a 5.7 syntax. */
-extern int defwBlockagePlacementPartial(double maxDensity);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-extern int defwBlockageMask(int maskColor);
-
-/* This routine is for rectangle.
- * This is a 5.4 syntax. */
-extern int defwBlockageRect(int xl, int yl, int xh, int yh);
-
-/* This routine is for polygon.
- * This routine is optinal and can be called multiple time. 
- * This is a 5.6 syntax. */
-extern int defwBlockagePolygon(int num_polys, int* xl, int* yl);
-
-/* This is a 5.4 syntax. */
-extern int defwEndBlockages();
-
-/* Routines to enter Slots.  This section is optional
- * The section must start with a defwStartSlots() call and
- * end with a defwEndSlots() call.
- * Each slots will call the defwSlots...().
- * This is a 5.4 syntax. */
-extern int defwStartSlots(int count);   /* count = numSlots */
-
-/* This routine is for - layerName & compName
- * Either this routine, defSlots, defSlotsLayerFills,
- * or defwSlotsPlacement is called per entry within
- * a slot, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwSlotLayer(const char* layerName);
-
-/* This routine is for rectangle
- * This is a 5.4 syntax. */
-extern int defwSlotRect(int xl, int yl, int xh, int yh);
-
-/* This routine is for rectangle
- * This is a 5.6 syntax and can be called multiple time. */
-extern int defwSlotPolygon(int num_polys, double* xl, double* yl);
-
-/* This is a 5.4 syntax. */
-extern int defwEndSlots();
-
-/* Routines to enter Fills.  This section is optional
- * The section must start with a defwStartFills() call and
- * end with a defwEndFills() call.
- * Each fills will call the defwFills...().
- * This is a 5.4 syntax. */
-extern int defwStartFills(int count);   /* count = numFills */
-
-/* This routine is for - layerName & compName
- * Either this routine, defFills, defFillsLayerFills,
- * or defwFillsPlacement is called per entry within
- * a fill, can't be more then one.
- * This is a 5.4 syntax. */
-extern int defwFillLayer(const char* layerName);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-extern int defwFillLayerMask(int maskColor);
-
-/* This routine has to be called after defwFillLayer
- * This routine is optional.
- * This is a 5.7 syntax. */
-extern int defwFillLayerOPC();
-
-/* This routine is for rectangle.
- * This is a 5.4 syntax. */
-extern int defwFillRect(int xl, int yl, int xh, int yh);
-
-/* This routine is for polygon.
- * This is a 5.6 syntax and can be called multiple time. */
-extern int defwFillPolygon(int num_polys, double* xl, double* yl);
-
-/* This routine is for via.
- * This routine is optional.
- * This is a 5.7 syntax and can be called multiple time. */
-extern int defwFillVia(const char* viaName);
-
-/* This routine is optional.
- * This is a 5.8 syntax. */
-extern int defwFillViaMask(int colorMask);
-
-/* This routine is for via OPC.
- * This routine can only be called after defwFillVia.
- * This routine is optional.
- * This is a 5.7 syntax and can be called multiple time. */
-extern int defwFillViaOPC();
-
-/* This routine is for via OPC.
- * This routine can only be called after defwFillVia.
- * This routine is required following defwFillVia.
- * This is a 5.7 syntax and can be called multiple time. */
-extern int defwFillPoints(int num_points, double* xl, double* yl);
-
-/* This is a 5.4 syntax. */
-extern int defwEndFills();
-
-/* Routines to enter NONDEFAULTRULES.  This section is required
- * The section must start with a defwStartNonDefaultRules() and
- * end with defwEndNonDefaultRules() call.
- * This is a 5.6 syntax. */
-extern int defwStartNonDefaultRules(int count);
-
-/* This routine is for Layer within the NONDEFAULTRULES
- * This routine can be called multiple times.  It is required.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwNonDefaultRule(const char* ruleName,
-                              int hardSpacing);   /* optional(0) */
-
-/* Routines to enter NONDEFAULTRULES.  This section is required
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwNonDefaultRuleLayer(const char* layerName,
-                                   int width,
-                                   int diagWidth,    /* optional(0) */
-                                   int spacing,      /* optional(0) */
-                                   int wireExt);     /* optional(0) */
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwNonDefaultRuleVia(const char* viaName);
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwNonDefaultRuleViaRule(const char* viaRuleName);
-
-/* Routines to enter NONDEFAULTRULES.  This section is optional.
- * This routine must be called after the defwNonDefaultRule. 
- * This routine can be called multiple times.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwNonDefaultRuleMinCuts(const char* cutLayerName, int numCutS);
-
-/* This is a 5.4 syntax. */
-extern int defwEndNonDefaultRules();
-
-/* Routines to enter STYLES.  This section is required
- * The section must start with a defwStartStyles() and
- * end with defwEndStyles() call.
- * This is a 5.6 syntax. */
-extern int defwStartStyles(int count);
-
-/* This routine is for Layer within the NONDEFAULTRULES
- * This routine can be called multiple times.  It is required.
- * This is a 5.6 syntax.
- * Returns 0 if successful. */
-extern int defwStyles(int styleNums, int num_points, double* xp, double* yp);
-
-/* This is a 5.4 syntax. */
-extern int defwEndStyles();
-
-/* This routine is called after defwInit.
- * This routine is optional and it can be called only once.
- * Returns 0 if successful. */
-extern int defwStartBeginext(const char* name);
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * Returns 0 if successful. */
-extern int defwBeginextCreator (const char* creatorName);
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * It gets the current system time and date.
- * Returns 0 if successful. */
-extern int defwBeginextDate ();
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called only once.
- * Returns 0 if successful. */
-extern int defwBeginextRevision (int vers1, int vers2);   /* vers1.vers2 */
-
-/* This routine is called after defwBeginext.
- * This routine is optional, it can be called many times.
- * It allows user to customize their own syntax.
- * Returns 0 if successful. */
-extern int defwBeginextSyntax (const char* title, const char* string);
-
-/* This routine is called after defwInit.
- * This routine is optional and it can be called only once.
- * Returns 0 if successful. */
-extern int defwEndBeginext();
-
-/* End the DEF file.
- * This routine IS NOT OPTIONAL.
- * The routine must be called LAST. */
-extern int defwEnd ( void );
-
-/* General routines that can be called anytime after the Init is called.
- */
-extern int defwCurrentLineNumber ( void );
-
-/*
- * extern void defwError ( const char *, ... );
- * extern void defwWarning ( const char *, ... );
- * extern void defwVError ( const char *, va_list );
- * extern void defwVWarning ( const char *, va_list );
- * extern int  defwGetCurrentLineNumber (void);
- * extern const char *defwGetCurrentFileName (void);
- */
- 
-/* This routine will print the error message. */
-extern void defwPrintError(int status);
-
-/* This routine will allow user to write their own comemnt.  It will
- * automactically add a # infront of the line.
- */
-extern void defwAddComment(const char* comment);
- 
-/* This routine will indent 3 blank spaces */
-extern void defwAddIndent();
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.cpp
deleted file mode 100644
index 41b7627..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.cpp
+++ /dev/null
@@ -1,613 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-
-// This file contains code for implementing the defwriter 5.3
-// It has functions to set the user callback functions.  If functions
-// are set, the defwriter will call the user callback functions when
-// it comes to the section.  If the section is required, but user
-// does not set any callback functions, a warning will be printed
-// both on stderr and on the output file if there is one.
-// Def writer provides default callback routines for some but not all
-// required sections.
-// Sections the writer provides default callbacks are:
-//    Version -- default to 5.3
-//    NamesCaseSensitive -- default to OFF
-//    BusBitChars -- default to "[]"
-//    DividerChar -- default to "/"; //
-// Author: Wanda da Rosa
-// Date:   05/14/99 
-//
-// Revisions:
-
-#include "defwWriterCalls.hpp"
-#include "defwWriter.hpp"
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "defiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#define MAXCBS    33
-
-#define defwVersionCbk 0
-#define defwCaseSensitiveCbk 1
-#define defwDividerCbk 2
-#define defwBusBitCbk 3
-#define defwDesignCbk 4
-#define defwTechCbk 5
-#define defwArrayCbk 6
-#define defwFloorPlanCbk 7 
-#define defwUnitsCbk 8
-#define defwHistoryCbk 9
-#define defwPropDefCbk 10
-#define defwDieAreaCbk 11
-#define defwRowCbk 12
-#define defwTrackCbk 13
-#define defwGcellGridCbk 14
-#define defwDefaultCapCbk 15
-#define defwCanplaceCbk 16
-#define defwCannotOccupyCbk 17
-#define defwViaCbk 18
-#define defwRegionCbk 19
-#define defwComponentCbk 20
-#define defwPinCbk 21
-#define defwPinPropCbk 22
-#define defwSNetCbk 23
-#define defwNetCbk 24
-#define defwIOTimingCbk 25
-#define defwScanchainCbk 26
-#define defwConstraintCbk 27
-#define defwAssertionCbk 28    /* pre 5.2 */
-#define defwGroupCbk 29
-#define defwBlockageCbk 30
-#define defwExtCbk 31
-#define defwDesignEndCbk 32
-
-/* NEW CALLBACK - then place it here. */
-
-int defWRetVal;
-extern int defwHasInit;
-extern int defwHasInitCbk;
-
-DEFI_LOG_FUNCTION defwErrorLogFunction;
-DEFI_WARNING_LOG_FUNCTION defwWarningLogFunction;
-
-#define WRITER_CALLBACK(func, type) \
-  if ((defWRetVal = (*func)(type, defwUserData)) == 0) { \
-  } else { \
-    return defWRetVal; \
-  }
-
-#define CHECK_DEF_STATUS(status) \
-  if (status) {              \
-     defwPrintError(status); \
-     return(status);         \
-  }
-
-////////////////////////////////////
-//
-//   Global variables
-//
-/////////////////////////////////////
-
-defiUserData defwUserData = 0;
-static char* defwFileName = 0;
-static int defwRegisterUnused = 0;
-
-extern FILE* defwFile;
-
-////////////////////////////////////
-//
-//       List of call back routines
-//  These are filled in by the user.  See the
-//   "set" routines at the end of the file
-//
-/////////////////////////////////////
-// The callback routines
-defwVoidCbkFnType defwCallbacksSeq[MAXCBS] = {0,  // defwVersionCbk
-                                              0,  // defwCaseSensitiveCbk
-                                              0,  // defwDividerCbk
-                                              0,  // defwBusBitCbk
-                                              0,  // defwDesignCbk
-                                              0,  // defwTechCbk
-                                              0,  // defwArrayCbk
-                                              0,  // defwFloorPlanCbk
-                                              0,  // defwUnitsCbk
-                                              0,  // defwHistoryCbk
-                                              0,  // defwPropDefCbk
-                                              0,  // defwDieAreaCbk
-                                              0,  // defwRowCbk
-                                              0,  // defwTrackCbk
-                                              0,  // defwGcellGridCbk
-                                              0,  // defwDefaultCapCbk
-                                              0,  // defwCanplaceCbk
-                                              0,  // defwCannotOccupyCbk
-                                              0,  // defwViaCbk
-                                              0,  // defwRegionCbk
-                                              0,  // defwComponentCbk
-                                              0,  // defwPinCbk
-                                              0,  // defwPinPropCbk
-                                              0,  // defwSNetCbk
-                                              0,  // defwNetCbk
-                                              0,  // defwIOTimingCbk
-                                              0,  // defwScanchainCbk
-                                              0,  // defwConstraintCbk
-                                              0,  // defwAssertionCbk pre 5.2
-                                              0,  // defwGroupCbk
-                                              0,  // defwBlockageCbk 5.4
-                                              0,  // defwExtCbk
-                                              0,  // defwDesignEndCbk
-                                                  // Add NEW CALLBACK here
-                                              };
-
-// the optional and required callbacks and
-// if default routines are available
-int defwCallbacksReq[MAXCBS][2] = {{0, 0},  // Version
-                                   {0, 0},  // CaseSensitive
-                                   {0, 0},  // Divider
-                                   {0, 0},  // BusBit
-                                   {1, 0},  // Design
-                                   {0, 0},  // Tech
-                                   {0, 0},  // Array
-                                   {0, 0},  // FloorPlan
-                                   {0, 0},  // Units
-                                   {0, 0},  // History
-                                   {0, 0},  // PropDef
-                                   {0, 0},  // DieArea
-                                   {0, 0},  // Row
-                                   {0, 0},  // Track
-                                   {0, 0},  // GcellGrid
-                                   {0, 0},  // DefaultCap
-                                   {0, 0},  // Canplace
-                                   {0, 0},  // CannotOccupy
-                                   {0, 0},  // Via
-                                   {0, 0},  // Region
-                                   {0, 0},  // Component
-                                   {0, 0},  // Pin
-                                   {0, 0},  // PinProp
-                                   {0, 0},  // SNet
-                                   {0, 0},  // Net
-                                   {0, 0},  // IOTiming
-                                   {0, 0},  // Scanchain
-                                   {0, 0},  // Constraint
-                                   {0, 0},  // Assertion pre 5.2
-                                   {0, 0},  // Group
-                                   {0, 0},  // Blockage
-                                   {0, 0},  // Ext
-                                   {1, 0},  // DesignEnd
-                                           // Add NEW CALLBACK here
-                               };
-
-// The section names
-char defwSectionNames[MAXCBS] [80] = {"Version",
-                                      "CaseSensitive",
-                                      "Divider", 
-                                      "BusBit", 
-                                      "Design", 
-                                      "Tech", 
-                                      "Array", 
-                                      "FloorPlan", 
-                                      "Units", 
-                                      "History", 
-                                      "PropertyDefinition", 
-                                      "DieArea", 
-                                      "Row", 
-                                      "Track", 
-                                      "GcellGrid", 
-                                      "DefaultCap", 
-                                      "Canplace", 
-                                      "CannotOccupy", 
-                                      "Via", 
-                                      "Region", 
-                                      "Component", 
-                                      "Pin", 
-                                      "PinProp", 
-                                      "SpecialNet", 
-                                      "Net", 
-                                      "IOTiming", 
-                                      "Scanchain", 
-                                      "Constraint", 
-                                      "Assertion",    // pre 5.2
-                                      "Group", 
-                                      "Blockage",
-                                      "Extension", 
-                                      "DesignEnd" 
-                                      // Add NEW CALLBACK here
-                                     };
-
-// the call back types from the defwCallbackType_e
-defwCallbackType_e defwCallbacksType[MAXCBS] = {defwVersionCbkType,
-                                                defwCaseSensitiveCbkType,
-                                                defwDividerCbkType,
-                                                defwBusBitCbkType,
-                                                defwDesignCbkType,
-                                                defwTechCbkType,
-                                                defwArrayCbkType,
-                                                defwFloorPlanCbkType,
-                                                defwUnitsCbkType,
-                                                defwHistoryCbkType,
-                                                defwPropDefCbkType,
-                                                defwDieAreaCbkType,
-                                                defwRowCbkType,
-                                                defwTrackCbkType,
-                                                defwGcellGridCbkType,
-                                                defwDefaultCapCbkType,
-                                                defwCanplaceCbkType,
-                                                defwCannotOccupyCbkType,
-                                                defwViaCbkType,
-                                                defwRegionCbkType,
-                                                defwComponentCbkType,
-                                                defwPinCbkType,
-                                                defwPinPropCbkType,
-                                                defwSNetCbkType,
-                                                defwNetCbkType,
-                                                defwIOTimingCbkType,
-                                                defwScanchainCbkType,
-                                                defwConstraintCbkType,
-                                                defwAssertionCbkType, // pre 5.2
-                                                defwGroupCbkType,
-                                                defwBlockageCbkType,  // 5.4
-                                                defwExtCbkType,
-                                                defwDesignEndCbkType
-                                                // Add NEW TYPES here
-                                               };
-
-
-////////////////////////////////////
-//
-//   Routines for the callbacks
-//
-/////////////////////////////////////
-const char* defwFName() {
-  return defwFileName;
-}
- 
-
-int defwWrite(FILE* f, const char* fName, defiUserData uData) {
-  int i;
-
-  if (defwHasInit == 0 && defwHasInitCbk == 0) {
-    fprintf(stderr, "ERROR DEFWRIT-9010): The function defwWrite is called before the function defwInitCbk.\nYou need to call defwInitCbk before calling any other functions.\nUpdate your program and then try again.");
-    return -1;
-  }
-
-  if (defwHasInit) {
-    fprintf(stderr, "ERROR DEFWRIT-9011): You program has called the function defwInit to initialize the writer.\nIf you want to use the callback option you need to use the function defwInitCbk.");
-  }
-
-  defwFileName = (char*)fName;
-  defwFile = f;
-  defwUserData = uData;
-
-  // Loop through the list of callbacks and call the user define
-  // callback routines if any are set
-
-  for (i = 0; i < MAXCBS; i++) {
-     if (defwCallbacksSeq[i] != 0) {   // user has set a callback function
-        WRITER_CALLBACK(defwCallbacksSeq[i], defwCallbacksType[i]);
-     } else if ((defwCallbacksReq[i][0]) && (defwCallbacksReq[i][1] == 0)) { 
-        // it is required but user hasn't set up callback and there isn't a
-        // default routine
-        fprintf(f,
-            "# WARNING: Callback for %s is required, but is not defined\n\n",
-            defwSectionNames[i]);
-        fprintf(stderr,
-            "WARNING: Callback for %s is required, but is not defined\n\n",
-            defwSectionNames[i]);
-     }
-  }
-  return 0;
-}
-
-
-void defwSetUnusedCallbacks(defwVoidCbkFnType func) {
-  // Set all of the callbacks that have not been set yet to
-  // the given function.
-  int i;
-
-  for (i = 0; i < MAXCBS; i++) {
-     if (defwCallbacksSeq[i] == 0)
-         defwCallbacksSeq[i] = (defwVoidCbkFnType)func;
-  }
-}
-
-
-/* These count up the number of times an unset callback is called... */
-static int defwUnusedCount[100];
-
-
-int defwCountFunc(defwCallbackType_e e, defiUserData d) {
-  int i = (int)e;
-  if (defiDebug(23)) printf("count %d 0x%x\n", (int)e, d);
-  if (i >= 0 && i < 100) {
-    defwUnusedCount[i] += 1;
-    return 0;
-  }
-  return 1;
-}
-
-
-void defwSetRegisterUnusedCallbacks() {
-  int i;
-  defwRegisterUnused = 1;
-  defwSetUnusedCallbacks(defwCountFunc);
-  for (i = 0; i < 100; i++)
-    defwUnusedCount[i] = 0;
-}
-
-
-void defwPrintUnusedCallbacks(FILE* f) {
-  int i;
-  int first = 1;
-
-  if (defwRegisterUnused == 0) {
-    fprintf(f,
-    "ERROR DEFWRIT-9012): You are calling the function defwPrintUnusedCallbacks but you did call the function defwSetRegisterUnusedCallbacks which is required before you can call defwPrintUnusedCallbacks.");
-    return;
-  }
-
-  for (i = 0; i < 100; i++) {
-    if (defwUnusedCount[i]) {
-      if (first)
-	fprintf(f,
-	"DEF items that were present but ignored because of no callback:\n");
-      first = 0;
-      switch ((defwCallbackType_e) i) {
-    case defwVersionCbkType: fprintf(f, "Version"); break;
-    case defwCaseSensitiveCbkType: fprintf(f, "CaseSensitive"); break;
-    case defwDividerCbkType: fprintf(f, "Divider"); break;
-    case defwBusBitCbkType: fprintf(f, "BusBit"); break;
-    case defwDesignCbkType: fprintf(f, "Design"); break;
-    case defwTechCbkType: fprintf(f, "Technology"); break;
-    case defwArrayCbkType: fprintf(f, "Array"); break;
-    case defwFloorPlanCbkType: fprintf(f, "FloorPlan"); break;
-    case defwUnitsCbkType: fprintf(f, "Units"); break;
-    case defwHistoryCbkType: fprintf(f, "History"); break;
-    case defwPropDefCbkType: fprintf(f, "PropertyDefinition"); break;
-    case defwDieAreaCbkType: fprintf(f, "DieArea"); break;
-    case defwRowCbkType: fprintf(f, "Row"); break;
-    case defwTrackCbkType: fprintf(f, "Track"); break;
-    case defwGcellGridCbkType: fprintf(f, "GcellGrid"); break;
-    case defwDefaultCapCbkType: fprintf(f, "DefaultCap"); break;
-    case defwCanplaceCbkType: fprintf(f, "Canplace"); break;
-    case defwCannotOccupyCbkType: fprintf(f, "CannotOccupy"); break;
-    case defwViaCbkType: fprintf(f, "Via"); break;
-    case defwRegionCbkType: fprintf(f, "Region"); break;
-    case defwComponentCbkType: fprintf(f, "Component"); break;
-    case defwPinCbkType: fprintf(f, "Pin"); break;
-    case defwPinPropCbkType: fprintf(f, "PinProperty"); break;
-    case defwSNetCbkType: fprintf(f, "SpecialNet"); break;
-    case defwNetCbkType: fprintf(f, "Net"); break;
-    case defwIOTimingCbkType: fprintf(f, "IOTiming"); break;
-    case defwScanchainCbkType: fprintf(f, "Scanchain"); break;
-    case defwConstraintCbkType: fprintf(f, "Constraint"); break;
-    case defwAssertionCbkType: fprintf(f, "Assertion"); break;
-    case defwGroupCbkType: fprintf(f, "Group"); break;
-    case defwBlockageCbkType: fprintf(f, "Blockages"); break;
-    case defwExtCbkType: fprintf(f, "Extension"); break;
-    case defwDesignEndCbkType: fprintf(f, "DesignEnd"); break;
-      /* NEW CALLBACK  add the print here */
-      default: fprintf(f, "BOGUS ENTRY"); break;
-      }
-      fprintf(f, " %d\n", defwUnusedCount[i]);
-    }
-  }
-}
-
-
-void defwSetUserData(defiUserData d) {
-  defwUserData = d;
-}
-
-
-defiUserData defwGetUserData() {
-  return defwUserData;
-}
-
-
-void defwSetArrayCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwArrayCbk] = f;
-}
-
-
-void defwSetAssertionCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwAssertionCbk] = f;
-}
-
-
-void defwSetBlockageCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwBlockageCbk] = f;
-}
-
-
-void defwSetBusBitCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwBusBitCbk] = f;
-}
-
-
-void defwSetCannotOccupyCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwCannotOccupyCbk] = f;
-}
-
-
-void defwSetCanplaceCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwCanplaceCbk] = f;
-}
-
-
-void defwSetCaseSensitiveCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwCaseSensitiveCbk] = f;
-}
-
-
-void defwSetComponentCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwComponentCbk] = f;
-}
-
-
-void defwSetConstraintCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwConstraintCbk] = f;
-}
-
-
-void defwSetDefaultCapCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwDefaultCapCbk] = f;
-}
-
-
-void defwSetDesignCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwDesignCbk] = f;
-}
-
-
-void defwSetDesignEndCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwDesignEndCbk] = f;
-}
-
-
-void defwSetDieAreaCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwDieAreaCbk] = f;
-}
-
-
-void defwSetDividerCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwDividerCbk] = f;
-}
-
-
-void defwSetExtCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwExtCbk] = f;
-}
-
-
-void defwSetFloorPlanCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwFloorPlanCbk] = f;
-}
-
-
-void defwSetGcellGridCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwGcellGridCbk] = f;
-}
-
-
-void defwSetGroupCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwGroupCbk] = f;
-}
-
-
-void defwSetHistoryCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwHistoryCbk] = f;
-}
-
-
-void defwSetIOTimingCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwIOTimingCbk] = f;
-}
-
-
-void defwSetNetCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwNetCbk] = f;
-}
-
-
-void defwSetPinCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwPinCbk] = f;
-}
-
-
-void defwSetPinPropCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwPinPropCbk] = f;
-}
-
-
-void defwSetPropDefCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwPropDefCbk] = f;
-}
-
-
-void defwSetRegionCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwRegionCbk] = f;
-}
-
-
-void defwSetRowCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwRowCbk] = f;
-}
-
-
-void defwSetSNetCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwSNetCbk] = f;
-}
-
-
-void defwSetScanchainCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwScanchainCbk] = f;
-}
-
-
-void defwSetTechnologyCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwTechCbk] = f;
-}
-
-
-void defwSetTrackCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwTrackCbk] = f;
-}
-
-
-void defwSetUnitsCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwUnitsCbk] = f;
-}
-
-
-void defwSetVersionCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwVersionCbk] = f;
-}
-
-
-void defwSetViaCbk(defwVoidCbkFnType f) {
-  defwCallbacksSeq[defwViaCbk] = f;
-}
-
-
-/* NEW CALLBACK - Each callback routine must have a routine that allows
- * the user to set it.  The set routines go here. */
-
-
-void defwSetLogFunction(DEFI_LOG_FUNCTION f) {
-  defwErrorLogFunction = f;
-}
-
-void defwSetWarningLogFunction(DEFI_WARNING_LOG_FUNCTION f) {
-  defwWarningLogFunction = f;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.hpp
deleted file mode 100644
index b80c45f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/defwWriterCalls.hpp
+++ /dev/null
@@ -1,220 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2013-2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DEFI_WRITER_H
-#define DEFI_WRITER_H
-
-#include <stdarg.h>
-#include <stdio.h>
- 
-#include "defiKRDefs.hpp"
-#include "defiDefs.hpp"
-#include "defiUser.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/*
- * The main writer function.
- * The file should already be opened.  This requirement allows
- * the writer to be used with stdin or a pipe.  The file name
- * is only used for error messages.  The includeSearchPath is
- * a colon-delimited list of directories in which to find
- * include files.
- */
-extern int defwWrite (  FILE *file,
-                        const char *fileName,
-                        defiUserData userData );
-
-/*
- * Set all of the callbacks that have not yet been set to a function
- * that will add up how many times a given def data type was ignored
- * (ie no callback was done).  The statistics can later be printed out.
- */
-extern void defwSetRegisterUnusedCallbacks (void);
-extern void defwPrintUnusedCallbacks (FILE* log);
-
-/*
- * Set/get the client-provided user data.  defi doesn't look at
- * this data at all, it simply passes the opaque defiUserData pointer
- * back to the application with each callback.  The client can
- * change the data at any time, and it will take effect on the
- * next callback.  The defi writer and writer maintain separate
- * user data pointers.
- */
-extern void defwSetUserData ( defiUserData );
-extern defiUserData defwGetUserData ( void );
- 
-/*
- * An enum describing all of the types of writer callbacks.
- */
-typedef enum {
-  defwUnspecifiedCbkType = 0,
-  defwVersionCbkType,
-  defwCaseSensitiveCbkType,
-  defwBusBitCbkType,
-  defwDividerCbkType,
-  defwDesignCbkType,
-  defwTechCbkType,
-  defwArrayCbkType,
-  defwFloorPlanCbkType,
-  defwUnitsCbkType,
-  defwHistoryCbkType,
-  defwPropDefCbkType,
-  defwDieAreaCbkType,
-  defwRowCbkType,
-  defwTrackCbkType,
-  defwGcellGridCbkType,
-  defwDefaultCapCbkType,
-  defwCanplaceCbkType,
-  defwCannotOccupyCbkType,
-  defwViaCbkType,
-  defwRegionCbkType,
-  defwComponentCbkType,
-  defwPinCbkType,
-  defwPinPropCbkType,
-  defwSNetCbkType,
-  defwNetCbkType,
-  defwIOTimingCbkType,
-  defwScanchainCbkType,
-  defwConstraintCbkType,
-  defwAssertionCbkType,    // pre 5.2
-  defwGroupCbkType,
-  defwBlockageCbkType,     // 5.4
-  defwExtCbkType,
-  defwDesignEndCbkType
-
-  /* NEW CALLBACKS - each callback has its own type.  For each callback
-   * that you add, you must add an item to this enum. */
-
-} defwCallbackType_e;
- 
- 
-/* Declarations of function signatures for each type of callback.
- * These declarations are type-safe when compiling with ANSI C
- * or C++; you will only be able to register a function pointer
- * with the correct signature for a given type of callback.
- *
- * Each callback function is expected to return 0 if successful.
- * A non-zero return code will cause the writer to abort.
- *
- * The defwDesignStart and defwDesignEnd callback is only called once.
- * Other callbacks may be called multiple times, each time with a different
- * set of data.
- *
- * For each callback, the Def API will make the callback to the
- * function supplied by the client, which should either make a copy
- * of the Def object, or store the data in the client's own data structures.
- * The Def API will delete or reuse each object after making the callback,
- * so the client should not keep a pointer to it.
- *
- * All callbacks pass the user data pointer provided in defwRead()
- * or defwSetUserData() back to the client; this can be used by the
- * client to obtain access to the rest of the client's data structures.
- *
- * The user data pointer is obtained using defwGetUserData() immediately
- * prior to making each callback, so the client is free to change the
- * user data on the fly if necessary.
- *
- * Callbacks with the same signature are passed a callback type
- * parameter, which allows an application to write a single callback
- * function, register that function for multiple callbacks, then
- * switch based on the callback type to handle the appropriate type of
- * data.
- */
- 
-
-/* A declaration of the signature of all callbacks that return nothing. */
-typedef int (*defwVoidCbkFnType) ( defwCallbackType_e, defiUserData );
-
-/* Functions to call to register a callback function.
- */
-extern void defwSetArrayCbk (defwVoidCbkFnType);
-extern void defwSetAssertionCbk (defwVoidCbkFnType);
-extern void defwSetBlockageCbk (defwVoidCbkFnType);
-extern void defwSetBusBitCbk (defwVoidCbkFnType);
-extern void defwSetCannotOccupyCbk (defwVoidCbkFnType);
-extern void defwSetCanplaceCbk (defwVoidCbkFnType);
-extern void defwSetCaseSensitiveCbk (defwVoidCbkFnType);
-extern void defwSetComponentCbk (defwVoidCbkFnType);
-extern void defwSetConstraintCbk (defwVoidCbkFnType);
-extern void defwSetDefaultCapCbk (defwVoidCbkFnType);
-extern void defwSetDesignCbk (defwVoidCbkFnType);
-extern void defwSetDesignEndCbk (defwVoidCbkFnType);
-extern void defwSetDieAreaCbk (defwVoidCbkFnType);
-extern void defwSetDividerCbk (defwVoidCbkFnType);
-extern void defwSetExtCbk (defwVoidCbkFnType);
-extern void defwSetFloorPlanCbk (defwVoidCbkFnType);
-extern void defwSetGcellGridCbk (defwVoidCbkFnType);
-extern void defwSetGroupCbk (defwVoidCbkFnType);
-extern void defwSetHistoryCbk (defwVoidCbkFnType);
-extern void defwSetIOTimingCbk (defwVoidCbkFnType);
-extern void defwSetNetCbk (defwVoidCbkFnType);
-extern void defwSetPinCbk (defwVoidCbkFnType);
-extern void defwSetPinPropCbk (defwVoidCbkFnType);
-extern void defwSetPropDefCbk (defwVoidCbkFnType);
-extern void defwSetRegionCbk (defwVoidCbkFnType);
-extern void defwSetRowCbk (defwVoidCbkFnType);
-extern void defwSetSNetCbk (defwVoidCbkFnType);
-extern void defwSetScanchainCbk (defwVoidCbkFnType);
-extern void defwSetTechnologyCbk (defwVoidCbkFnType);
-extern void defwSetTrackCbk (defwVoidCbkFnType);
-extern void defwSetUnitsCbk (defwVoidCbkFnType);
-extern void defwSetVersionCbk (defwVoidCbkFnType);
-extern void defwSetViaCbk (defwVoidCbkFnType);
-
-/* NEW CALLBACK - each callback must have a function to allow the user
- * to set it.  Add the function here. */
-
-
-/*
- * Set all of the callbacks that have not yet been set to the following
- * function.  This is especially useful if you want to check to see
- * if you forgot anything.
- */
-extern void defwSetUnusedCallbacks (defwVoidCbkFnType func);
-
-/* Routine to set the message logging routine for errors */
-#ifndef DEFI_LOG_FUNCTION
-    typedef void (*DEFI_LOG_FUNCTION) (const char*);
-#endif
-
-extern void defwSetLogFunction ( DEFI_LOG_FUNCTION );
-
-/* Routine to set the message logging routine for warnings */
-#ifndef DEFI_WARNING_LOG_FUNCTION
-    typedef void (*DEFI_WARNING_LOG_FUNCTION)(const char*);
-#endif
-
-extern void defwSetWarningLogFunction( DEFI_WARNING_LOG_FUNCTION );
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/lex.h b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/lex.h
deleted file mode 100644
index cb4820a..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/def/lex.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2014, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- * 
- *  $Author: dell $
- *  $Revision: #1 $
- *  $Date: 2017/06/06 $
- *  $State:  $
- ******************************************************************************/
-
-#include "defiKRDefs.hpp"
-#include "defrData.hpp"
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern void lex_init();
-extern void lex_un_init();
-extern int defyyparse(defrData *data);
-
-void AddStringDefine(char *token, char *string);
-void AddBooleanDefine(char *token, int val);
-void AddNumDefine(char *token, double val);
-
-int fake_ftell();
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.cpp
deleted file mode 100644
index 1beb088..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.cpp
+++ /dev/null
@@ -1,2253 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2014 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
- 
-// This program is the diffDef core program.  It has all the callback
-// routines and write it out to a temporary file.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "defrReader.hpp"
-
-
-char defaultName[64];
-char defaultOut[64];
-static int ignorePE = 0;
-static int ignoreRN = 0;
-static int ignoreVN = 0;
-static int netSeCmp = 0;
-
-// Global variables
-FILE* fout;
-void  *userData;
-int numObjs;
-int isSumSet;      // to keep track if within SUM
-int isProp = 0;    // for PROPDEF
-int begOperand;    // to keep track for constraint, to print - as the 1st char
-static double curVer = 5.7;
-
-// TX_DIR:TRANSLATION ON
-
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
-
-
-void checkType(defrCallbackType_e c) {
-  if (c >= 0 && c <= defrDesignEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-// 05/24/2001 - Wanda da Rosa.  PCR 373170
-// This function is added due to the rounding between machines are
-// different.  For a 5, solaries will round down while hppa will roundup.
-// This function will make sure it round up for all the machine
-double checkDouble(double num) {
-  long tempNum;
-  if ((num > 1000004) || (num < -1000004)) {
-     tempNum = (long)num;
-     if ((tempNum%5) == 0)
-        return num + 3;
-  }
-  return num;
-}
-
-int compMSL(defrCallbackType_e c, defiComponentMaskShiftLayer* co, defiUserData ud) {
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-
-    if (co->numMaskShiftLayers()) {
-	fprintf(fout, "\nCOMPONENTMASKSHIFT ");
-	
-	for (i = 0; i < co->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", co->maskShiftLayer(i));
-	}
-	fprintf(fout, ";\n");
-    }
-
-  return 0;
-}
-
-
-// Component
-int compf(defrCallbackType_e c, defiComponent* co, defiUserData ud) {
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-//  missing GENERATE, FOREIGN
-    fprintf(fout, "COMP %s %s", co->id(), co->name());
-    if (co->hasNets()) {
-        for (i = 0; i < co->numNets(); i++)
-             fprintf(fout, " %s", co->net(i));
-        fprintf(fout,"\n");
-    } else
-        fprintf(fout,"\n");
-    if (co->isFixed()) 
-        fprintf(fout, "COMP %s FIXED ( %d %d ) %s\n", co->id(),
-                co->placementX(), co->placementY(), co->placementOrientStr());
-    if (co->isCover()) 
-        fprintf(fout, "COMP %s COVER ( %d %d ) %s\n", co->id(),
-                co->placementX(), co->placementY(), co->placementOrientStr());
-    if (co->isPlaced()) 
-        fprintf(fout,"COMP %s PLACED ( %d %d ) %s\n", co->id(),
-                co->placementX(), co->placementY(), co->placementOrientStr());
-    if (co->isUnplaced()) 
-        fprintf(fout,"COMP %s UNPLACED\n", co->id());
-    if (co->hasSource())
-        fprintf(fout, "COMP %s SOURCE %s\n", co->id(), co->source());
-    if (co->hasGenerate())
-        fprintf(fout, "COMP %s GENERATE %s %s\n", co->id(),
-                co->generateName(), co->macroName());
-    if (co->hasHalo()) {
-        int left, bottom, right, top;
-        (void) co->haloEdges(&left, &bottom, &right, &top);
-        fprintf(fout, "COMP %s HALO", co->id());
-        if (co->hasHaloSoft())
-           fprintf(fout, " SOFT");
-        fprintf(fout, " %d %d %d %d\n", left, bottom, right, top);
-        
-    }
-    if (co->hasRouteHalo()) {
-        fprintf(fout, "COMP %s ROUTEHALO %d %s %s\n", co->id(),
-                co->haloDist(), co->minLayer(), co->maxLayer());
-    }
-    if (co->hasForeignName())
-        fprintf(fout, "COMP %s FOREIGN %s %d %d %s\n", co->id(),
-                co->foreignName(), co->foreignX(), co->foreignY(),
-                co->foreignOri());
-    if (co->hasWeight())
-        fprintf(fout, "COMP %s WEIGHT %d\n", co->id(), co->weight());
-    if (co->hasEEQ())
-        fprintf(fout, "COMP %s EEQMASTER %s\n", co->id(), co->EEQ());
-    if (co->hasRegionName())
-        fprintf(fout, "COMP %s REGION %s\n", co->id(), co->regionName());
-    if (co->hasRegionBounds()) {
-        int *xl, *yl, *xh, *yh;
-        int size;
-        co->regionBounds(&size, &xl, &yl, &xh, &yh);
-        for (i = 0; i < size; i++) { 
-            fprintf(fout, "COMP %s REGION ( %d %d ) ( %d %d )\n", co->id(),
-                    xl[i], yl[i], xh[i], yh[i]);
-        }
-    }
-    if (co->maskShiftSize()) {
-	fprintf(fout, "MASKSHIFT ");
-
-        for (int i = co->maskShiftSize()-1; i >= 0; i--) {
-            fprintf(fout, "%d", co->maskShift(i));
-        }
-        fprintf(fout, "\n");
-    }
-    if (co->numProps()) {
-        for (i = 0; i < co->numProps(); i++) {
-            fprintf(fout, "COMP %s PROP %s %s ", co->id(),
-                    co->propName(i),
-                    co->propValue(i));
-            switch (co->propType(i)) {
-               case 'R': fprintf(fout, "REAL ");
-                         break;
-               case 'I': fprintf(fout, "INT ");
-                         break;
-               case 'S': fprintf(fout, "STR ");
-                         break;
-               case 'Q': fprintf(fout, "QSTR ");
-                         break;
-               case 'N': fprintf(fout, "NUM ");
-                         break;
-            }
-            fprintf(fout, "\n");
-        }
-    }
-
-    --numObjs;
-  return 0;
-}
-
-// Net
-int netf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int         i, j, k, w, x, y, z, px, py, pz;
-  defiPath*   p;
-  defiSubnet* s;
-  int         path;
-  defiVpin   *vpin;
-  defiShield* noShield;
-  defiWire*   wire;
-  int         nline;
-  const char* layerName = "N/A";
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-  if (net->pinIsMustJoin(0))
-      fprintf(fout, "NET MUSTJOIN ");
-  else
-      fprintf(fout, "NET %s ", net->name());
- 
-  // compName & pinName
-  for (i = 0; i < net->numConnections(); i++) {
-      fprintf(fout, "\nNET %s ( %s %s ) ", net->name(), net->instance(i),
-              net->pin(i));
-  }
-
-  if (net->hasNonDefaultRule())
-      fprintf(fout, "\nNET %s NONDEFAULTRULE %s", net->name(),
-              net->nonDefaultRule());
- 
-  for (i = 0; i < net->numVpins(); i++) {
-      vpin = net->vpin(i);
-      fprintf(fout, "\nNET %s %s", net->name(), vpin->name());
-      if (vpin->layer())
-          fprintf(fout, " %s", vpin->layer());
-      fprintf(fout, " %d %d %d %d", vpin->xl(), vpin->yl(), vpin->xh(),
-              vpin->yh());
-      if (vpin->status() != ' ') {
-          switch (vpin->status()) {
-              case 'P':
-              case 'p':
-                   fprintf(fout, " PLACED"); 
-                   break;
-              case 'F':
-              case 'f':
-                   fprintf(fout, " FIXED"); 
-                   break;
-              case 'C':
-              case 'c':
-                   fprintf(fout, " COVER"); 
-                   break;
-          }
-          fprintf(fout, " %d %d", vpin->xLoc(), vpin->yLoc());
-          if (vpin->orient() != -1)
-              fprintf(fout, " %s", vpin->orientStr());
-      }
-  }
-
-  // regularWiring
-  if (net->numWires()) {
-    for (i = 0; i < net->numWires(); i++) {
-      wire = net->wire(i);
-      for (j = 0; j < wire->numPaths(); j++) {
-        p = wire->path(j);
-        p->initTraverse();
-        fprintf(fout, "\nNET %s %s", net->name(), wire->wireType());
-        nline = 0;
-        while ((path = (int)p->next()) != DEFIPATH_DONE) {
-          switch (path) {
-            case DEFIPATH_LAYER:
-                 if (!netSeCmp)
-                    fprintf(fout, " %s", p->getLayer());
-                 layerName = p->getLayer();
-                 px = py = pz = -99;     // reset the 1 set of point to 0
-                 break;
-	    case DEFIPATH_MASK:
-		 fprintf(fout, "MASK %d ", p->getMask());
-                 break;
-	    case DEFIPATH_VIAMASK:
-                     fprintf(fout, "MASK %d%d%d ", 
-                             p->getViaTopMask(), 
-                             p->getViaCutMask(),
-                             p->getViaBottomMask());
-                 break;
-            case DEFIPATH_VIA:
-                 if (!netSeCmp) {
-                    if (!ignoreVN)
-                       fprintf(fout, " %s", p->getVia());
-                 } else {
-                    if (nline) {
-                       if (!ignoreVN)
-                          fprintf(fout, "\nNET %s %s ( %d %d ) %s", net->name(),
-                               wire->wireType(), px, py, p->getVia());
-                       else
-                          fprintf(fout, "\nNET %s %s ( %d %d )", net->name(),
-                               wire->wireType(), px, py);
-                    } else {
-                       if (!ignoreVN)
-                          fprintf(fout, " ( %d %d ) %s", px, py, p->getVia());
-                       else
-                          fprintf(fout, " ( %d %d )", px, py);
-                    }
-                    px = py = pz = -99;     // reset the 1 set of point to 0
-                 }
-                 nline = 1;
-                 break;
-	    case DEFIPATH_RECT:
-		 p->getViaRect(&w, &x, &y, &z);
-                 fprintf(fout, "RECT ( %d %d %d %d ) ", w, x, y, z);
-                 break;
-	    case DEFIPATH_VIRTUALPOINT:
-	         p->getVirtualPoint(&x, &y);
-		 fprintf(fout, "VIRTUAL ( %d %d ) ", x, y);
-                 break;
-            case DEFIPATH_VIAROTATION:
-                 fprintf(fout, "%d ",p->getViaRotation());
-                 nline = 1;
-                 break;
-            case DEFIPATH_WIDTH:
-                 fprintf(fout, " %d ", p->getWidth());
-                 break;
-            case DEFIPATH_POINT:
-                 p->getPoint(&x, &y);
-                 if (!netSeCmp) {
-                    if (!nline) {
-                       fprintf(fout, " ( %d %d )", x, y);
-                       nline = 1; 
-                    } else {
-                       fprintf(fout, "\nNET %s %s %s ( %d %d )", net->name(),
-                               wire->wireType(), layerName, x, y);
-                    }
-                 } else {
-                    if ((px == -99) && (py == -99)) {
-                       px = x;
-                       py = y;
-                    } else {
-                       if (nline)
-                          fprintf(fout, "\nNET %s %s %s", net->name(),
-                                  wire->wireType(), layerName);
-                       if (px < x) {
-                          fprintf (fout, " ( %d %d ) ( %d %d )", px, py, x, y);
-                       } else if (px == x) {
-                          if (py < y) 
-                              fprintf (fout, " ( %d %d ) ( %d %d )",
-                                       px, py, x, y);
-                          else
-                              fprintf (fout, " ( %d %d ) ( %d %d )",
-                                       x, y, px, py);
-                       } else {  // px > x
-                          fprintf (fout, " ( %d %d ) ( %d %d )", x, y, px, py);
-                       }
-                       px = x;
-                       py = y;
-                       nline = 1; 
-                    }
-                 }
-                 break;
-            case DEFIPATH_FLUSHPOINT:
-                 p->getFlushPoint(&x, &y, &z);
-                 if (!netSeCmp) {
-                    if (!nline) {
-                       fprintf(fout, " ( %d %d %d )", x, y, z);
-                    } else {
-                       fprintf(fout, "\nNET %s %s %s ( %d %d %d )", net->name(),
-                               wire->wireType(), layerName, x, y, z);
-                    }
-                 } else {
-                    if ((px == -99) && (py == -99) && (pz == -99)) {
-                       px = x;
-                       py = y;
-                       pz = z;
-                    } else {
-                       if (nline)
-                          fprintf(fout, "\nNET %s %s %s", net->name(),
-                                  wire->wireType(), layerName);
-                       if (px < x) {
-                          if (pz != -99)
-                             fprintf (fout, " ( %d %d %d ) ( %d %d %d )",
-                                      px, py, pz, x, y, z);
-                          else
-                             fprintf (fout, " ( %d %d ) ( %d %d %d )",
-                                      px, py, x, y, z);
-                       } else if (px == x) {
-                          if (py < y)  {
-                             if (pz != -99)
-                                fprintf (fout, " ( %d %d %d ) ( %d %d %d )",
-                                         px, py, pz, x, y, z);
-                             else
-                                fprintf (fout, " ( %d %d ) ( %d %d %d )",
-                                         px, py, x, y, z);
-                          } else {
-                             if (pz != -99)
-                                fprintf (fout, " ( %d %d %d ) ( %d %d %d )",
-                                         x, y, z, px, py, pz);
-                             else
-                                fprintf (fout, " ( %d %d %d ) ( %d %d )",
-                                         x, y, z, px, py);
-                          }
-                       } else {  // px > x
-                          if (pz != -99)
-                             fprintf (fout, " ( %d %d %d ) ( %d %d %d )",
-                                      x, y, z, px, py, pz);
-                          else
-                             fprintf (fout, " ( %d %d %d ) ( %d %d )",
-                                      x, y, z, px, py);
-                       }
-                       px = x;
-                       py = y;
-                       pz = z;
-                       nline = 1; 
-                    }
-                 }
-                 break;
-            case DEFIPATH_TAPER:
-                 fprintf(fout, " TAPER");
-                 break;
-            case DEFIPATH_TAPERRULE:
-                 fprintf(fout, " TAPERRULE %s",p->getTaperRule());
-                 break;
-          }
-        }
-      }
-    }
-  }
-
-  // shieldnet
-  if (net->numShieldNets()) {
-     for (i = 0; i < net->numShieldNets(); i++)
-         fprintf(fout, "\nNET %s SHIELDNET %s ", net->name(),
-                 net->shieldNet(i));
-  }
-  if (net->numNoShields()) {
-     for (i = 0; i < net->numNoShields(); i++) {
-         noShield = net->noShield(i);
-         for (j = 0; j < noShield->numPaths(); j++) {
-            p = noShield->path(j);
-            p->initTraverse();
-            fprintf(fout, "\nNET %s NOSHIELD", net->name());
-            nline = 0;
-            while ((path = (int)p->next()) != DEFIPATH_DONE) {
-               switch (path) {
-                 case DEFIPATH_LAYER:
-                      fprintf(fout, " %s", p->getLayer());
-                      layerName = p->getLayer();
-                      break;
-				 case DEFIPATH_MASK:
-					  fprintf(fout, "MASK %d ", p->getMask());
-					  break;
-                 case DEFIPATH_VIAMASK:
-                      fprintf(fout, "MASK %d%d%d ", 
-                              p->getViaTopMask(), 
-                              p->getViaCutMask(),
-                              p->getViaBottomMask());
-                      break;
-                 case DEFIPATH_VIA:
-                      if (!ignoreVN)
-                         fprintf(fout, " %s", p->getVia());
-                      nline = 1;
-                      break;
-                 case DEFIPATH_VIAROTATION:
-                      fprintf(fout, " %d", p->getViaRotation());
-                      nline = 1;
-                      break;
-                 case DEFIPATH_WIDTH:
-                      fprintf(fout, " %d", p->getWidth());
-                      break;
-                 case DEFIPATH_POINT:
-                      p->getPoint(&x, &y);
-                      if (!nline) {
-                         fprintf(fout, " ( %d %d )", x, y);
-                         nline = 1;
-                      } else {
-                         fprintf(fout, "\nNET %s %s ( %d %d )",
-                                 net->name(), layerName, x, y);
-                         nline = 1;
-                      }
-                      break;
-                 case DEFIPATH_FLUSHPOINT:
-                      p->getFlushPoint(&x, &y, &z);
-                      if (!nline) {
-                         fprintf(fout, " ( %d %d )", x, y);
-                         nline = 1;
-                      } else {
-                         fprintf(fout, "\nNET %s %s ( %d %d )",
-                                 net->name(), layerName, x, y);
-                         nline = 1;
-                      }
-                 case DEFIPATH_TAPER:
-                      fprintf(fout, " TAPER");
-                      break;
-                 case DEFIPATH_TAPERRULE:
-                      fprintf(fout, " TAPERRULE %s",
-                              p->getTaperRule());
-                      break;
-               }
-            }
-         }
-     }
-  }
-
-  if (net->hasSubnets()) {
-    for (i = 0; i < net->numSubnets(); i++) {
-      s = net->subnet(i);
- 
-      if (s->numConnections()) {
-          for (j = 0; j < s->numConnections(); j++) {
-              if (s->pinIsMustJoin(0))
-                  fprintf(fout, "\nNET MUSTJOIN");
-              else
-                  fprintf(fout, "\nNET %s", s->name());
-              fprintf(fout, " ( %s %s )", s->instance(j), s->pin(j));
-          }
-      }
- 
-      for (j = 0; j < s->numWires(); j++) {
-        wire = s->wire(j);
-        if (s->numPaths()) {
-           for (k = 0; k < wire->numPaths(); k++) {
-             int elem;
-             p = wire->path(k);
-             p->initTraverse();
-             fprintf(fout, "\nNET %s %s", s->name(), wire->wireType()); 
-             nline = 0;
-             elem = p->next();
-             while (elem) { 
-                switch (elem) {
-                  case DEFIPATH_LAYER:
-                       fprintf(fout, " LAYER %s",  p->getLayer());
-                       layerName = p->getLayer();
-                       break;
-		  case DEFIPATH_MASK:
-		       fprintf(fout, "MASK %d ", p->getMask());
-		       break;
-                  case DEFIPATH_VIAMASK:
-                       fprintf(fout, "MASK %d%d%d ", 
-                               p->getViaTopMask(), 
-                               p->getViaCutMask(),
-                               p->getViaBottomMask());
-                       break;
-                  case DEFIPATH_VIA:
-                       if (!ignoreVN)
-                          fprintf(fout, " VIA %s", p->getVia());
-                       nline = 1;
-                       break;
-                  case DEFIPATH_VIAROTATION:
-                       fprintf(fout, " VIAROTATION %d", p->getViaRotation());
-                       nline = 1;
-                       break;
-                  case DEFIPATH_WIDTH:
-                       fprintf(fout, " WIDTH %d", p->getWidth());
-                       break;
-                  case DEFIPATH_POINT:
-                       p->getPoint(&x, &y);
-                       if (!nline) {
-                          fprintf(fout, " POINT %d %d", x, y);
-                          nline = 1;
-                       } else {
-                          fprintf(fout, "\nNET %s %s %s POINT %d %d",
-                                  s->name(), wire->wireType(), layerName, x, y);
-                          nline = 1;
-                       }
-                       break;
-                  //case DEFIPATH_FLUSHPOINT:
-                       //l = 0;
-                       //p->getFlushPoint(i1, i2, ext);
-                       //while (i1[l] && i2[l] && ext[l]) {
-                          //fprintf(fout, "NET %s FLUSHPOINT %d %d %d\n",
-                                  //s->name(), i1[l], i2[l], ext[l]);
-                          //l++;
-                       //}
-                       //break;
-                  case DEFIPATH_TAPERRULE:
-                       fprintf(fout, " TAPERRULE %s", p->getTaperRule());
-                       break;
-                  case DEFIPATH_SHAPE:
-                       fprintf(fout, " SHAPE %s", p->getShape());
-                       break;
-                  case DEFIPATH_STYLE:
-                       fprintf(fout, " STYLE %d", p->getStyle());
-                       break;
-               }
-               elem = p->next();
-            }
-          }
-        }
-      }
-    }
-  }
-
-  /* Put the following all in one line */
-  if (net->hasWeight() || net->hasCap() || net->hasSource() ||
-      net->hasPattern() || net->hasOriginal() || net->hasUse()) {
-      fprintf(fout, "\nNET %s ", net->name());
-
-     if (net->hasWeight())
-       fprintf(fout, "WEIGHT %d ", net->weight());
-     if (net->hasCap())
-       fprintf(fout, "ESTCAP %g ", checkDouble(net->cap()));
-     if (net->hasSource())
-       fprintf(fout, "SOURCE %s ", net->source());
-     if (net->hasFixedbump())
-       fprintf(fout, "FIXEDBUMP ");
-     if (net->hasFrequency())
-       fprintf(fout, "FREQUENCY %g ", net->frequency());
-     if (net->hasPattern())
-       fprintf(fout, "PATTERN %s ", net->pattern());
-     if (net->hasOriginal())
-       fprintf(fout, "ORIGINAL %s ", net->original());
-     if (net->hasUse())
-       fprintf(fout, "USE %s ", net->use());
-  }
-
-  fprintf (fout, "\n");
-  --numObjs;
-  return 0;
-}
-
-
-// Special Net
-int snetf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int        i, j, x, y, z;
-  char       *layerName;
-  double     dist, left, right;
-  defiPath   *p;
-  defiSubnet *s;
-  int        path;
-  defiShield* shield;
-  defiWire   *wire;
-  int        nline;
-  const char* sNLayerName = "N/A";
-  int        numX, numY, stepX, stepY;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrSNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-
-  // compName & pinName
-  if (net->numConnections() > 0) {
-     for (i = 0; i < net->numConnections(); i++)
-         fprintf (fout, "SNET %s ( %s %s )\n", net->name(), net->instance(i),
-                  net->pin(i));
-  }
-
-  if (net->numRectangles()) {  // 5.6
-
-     for (i = 0; i < net->numRectangles(); i++) {
-       if (curVer >= 5.8 ) {
-         fprintf (fout, "\nSNET %s ", net->name());
-	 if (strcmp(net->rectRouteStatus(i), "") != 0) {
-	   fprintf(fout, "%s ", net->rectRouteStatus(i));
-	   if (strcmp(net->rectRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "%s ", net->rectRouteStatusShieldName(i));
-	   }
-         }
-         if (strcmp(net->rectShapeType(i), "") != 0) {
-	   fprintf(fout, "SHAPE %s ", net->rectShapeType(i));
-         }
-       }
-       if (net->rectMask(i)) {
-	  fprintf(fout, "MASK %d RECT %s %d %d %d %d", 
-		  net->rectMask(i), net->rectName(i),
-		  net->xl(i), net->yl(i), net->xh(i),
-                  net->yh(i));
-       } else {
-	  fprintf(fout, "RECT %s %d %d %d %d", net->name(),
-               net->xl(i), net->yl(i), net->xh(i),
-               net->yh(i));
-       }
-     }
-  }
-
-  if (net->numPolygons()) {  
-    struct defiPoints points;
-
-    for (i = 0; i < net->numPolygons(); i++) {
-      fprintf (fout, "\nSNET %s ", net->name());
-      if (curVer >= 5.8 ) {
-	 if (strcmp(net->polyRouteStatus(i), "") != 0) {
-	   fprintf(fout, "%s ", net->polyRouteStatus(i));
-	   if (strcmp(net->polyRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "%s ", net->polyRouteStatusShieldName(i));
-	   }
-         }
-         if (strcmp(net->polyShapeType(i), "") != 0) {
-	   fprintf(fout, "SHAPE %s ", net->polyShapeType(i));
-         }
-      }
-      if (net->polyMask(i)) {
-	  fprintf(fout, "MASK %d POLYGON % s ", 
-		  net->polyMask(i),
-		  net->polygonName(i));
-      } else {
-	  fprintf(fout, "POLYGON %s", net->polygonName(i));
-      }
-
-      points = net->getPolygon(i);
-      for (j = 0; j < points.numPoints; j++)
-        fprintf(fout, " %d %d", points.x[j], points.y[j]);
-    }
-  }
-
-   if (curVer >= 5.8 && net->numViaSpecs()) {
-     for (i = 0; i < net->numViaSpecs(); i++) {
-       fprintf (fout, "\nSNET %s ", net->name());
-       if (strcmp(net->viaRouteStatus(i), "") != 0) {
-	fprintf(fout, "%s ", net->viaRouteStatus(i));
-	if (strcmp(net->viaRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "%s ", net->viaRouteStatusShieldName(i));
-	   }
-       }
-       if (strcmp(net->viaShapeType(i), "") != 0) {
-	fprintf(fout, "SHAPE %s ", net->viaShapeType(i));
-       }
-       if (net->topMaskNum(i) || net->cutMaskNum(i) || net->bottomMaskNum(i)) {
-	fprintf(fout, "MASK %d%d%d VIA %s ", net->topMaskNum(i), 
-                net->cutMaskNum(i),
-                net->bottomMaskNum(i),
-		net->viaName(i));
-       } else {
-	fprintf(fout, "\n  VIA %s ", net->viaName(i));
-       }
-       fprintf(fout, " %s", net->viaOrientStr(i));
-      
-       defiPoints points = net->getViaPts(i);
-
-       for (int j = 0; j < points.numPoints; j++) {
-          fprintf(fout, " %d %d", points.x[j], points.y[j]);
-       }
-       fprintf(fout, ";\n"); 
-     }
-  } 
-
-
-  // specialWiring
-  if (net->numWires()) {
-     for (i = 0; i < net->numWires(); i++) {
-        wire = net->wire(i);
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           fprintf(fout, "\nSNET %s %s", net->name(), wire->wireType());
-           nline = 0;
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     fprintf(fout, " %s", p->getLayer());
-                     sNLayerName = p->getLayer();
-                     break;
-		case DEFIPATH_MASK:
-		     fprintf(fout, "MASK %d ", p->getMask());
-		     break;
-                case DEFIPATH_VIAMASK:
-                     fprintf(fout, "MASK %d%d%d ", 
-                             p->getViaTopMask(), 
-                             p->getViaCutMask(),
-                             p->getViaBottomMask());
-                    break;
-                case DEFIPATH_VIA:
-                     if (!ignoreVN)
-                        fprintf(fout, " %s", p->getVia());
-                     nline = 1;
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, " %d", p->getViaRotation());
-                     nline = 1;
-                     break;
-                case DEFIPATH_VIADATA:
-                     p->getViaData(&numX, &numY, &stepX, &stepY);
-                     fprintf(fout, " DO %d BY %d STEP %d %d", numX, numY,
-                             stepX, stepY);
-                     nline = 1;
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, " %d", p->getWidth());
-                     break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     if (!nline) {
-                        fprintf(fout, " ( %d %d ) ", x, y);
-                        nline = 1;
-                     } else {
-                        fprintf(fout, "\nSNET %s %s %s ( %d %d )", net->name(),
-                                wire->wireType(), sNLayerName, x, y);
-                        nline = 1;
-                     }
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     nline = 1;
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, " TAPER");
-                     break;
-                case DEFIPATH_SHAPE:
-                     fprintf(fout, " + SHAPE %s", p->getShape());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, " + STYLE %d", p->getStyle());
-                     break;
-              }
-           }
-        }
-     }
-  }
-
-  if (net->hasSubnets()) {
-     for (i = 0; i < net->numSubnets(); i++) {
-       s = net->subnet(i);
-       if (s->numConnections()) {
-           if (s->pinIsMustJoin(0))
-               fprintf(fout, "\nSNET %s MUSTJOIN", net->name());
-           else
-               fprintf(fout, "\nSNET %s", net->name());
-           for (j = 0; j < s->numConnections(); j++) {
-               fprintf(fout, "( %s %s ) ", s->instance(j), s->pin(j));
-           }
-      }
- 
-      // regularWiring
-      if (s->numWires()) {
-         for (i = 0; i < s->numWires(); i++) {
-            wire = s->wire(i);
-            for (j = 0; j < wire->numPaths(); j++) {
-              p = wire->path(j);
-              p->initTraverse();
-              fprintf(fout, "\nSNET %s %s", net->name(), wire->wireType());
-              nline = 0;
-              while ((path = (int)p->next()) != DEFIPATH_DONE) {
-                switch (path) {
-                  case DEFIPATH_LAYER:
-                       fprintf(fout, " %s", p->getLayer());
-                       sNLayerName = p->getLayer();
-                       break;
-                  case DEFIPATH_VIA:
-                       if (!ignoreVN)
-                          fprintf(fout, " %s", p->getVia());
-                       break;
-		  case DEFIPATH_MASK:
-		       fprintf(fout, "MASK %d ", p->getMask());
-		       break;
-                  case DEFIPATH_VIAMASK:
-                       fprintf(fout, "MASK %d%d%d ", 
-                           p->getViaTopMask(), 
-                           p->getViaCutMask(),
-                           p->getViaBottomMask());
-                   break;
-
-                  case DEFIPATH_VIAROTATION:
-                       fprintf(fout, " %d", p->getViaRotation());
-                       break;
-                  case DEFIPATH_WIDTH:
-                       fprintf(fout, " %d", p->getWidth());
-                       break;
-                  case DEFIPATH_POINT:
-                       p->getPoint(&x, &y);
-                       if (!nline) {
-                          fprintf(fout, "( %d %d ) ", x, y);
-                          nline = 1;
-                       } else {
-                          fprintf(fout, "\nSNET %s %s %s ( %d %d ) ",
-                                  net->name(), wire->wireType(), sNLayerName,
-                                  x, y);
-                          nline = 1;
-                       }
-                       break;
-                  case DEFIPATH_TAPER:
-                       fprintf(fout, " TAPER");
-                       break;
-                }
-              }
-            }
-         }
-      }
-    }
-  }
- 
-  if (net->numProps()) {
-    for (i = 0; i < net->numProps(); i++) {
-        fprintf(fout, "\nSNET %s PROP %s %s ", net->name(),
-                net->propName(i), net->propValue(i));
-        switch (net->propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INT ");
-                     break;
-           case 'S': fprintf(fout, "STR ");
-                     break;
-           case 'Q': fprintf(fout, "QSTR ");
-                     break;
-           case 'N': fprintf(fout, "NUM ");
-                     break;
-        }
-    }
-  }
-
-  // SHIELD
-  // testing the SHIELD for 5.3
-  if (net->numShields()) {
-    for (i = 0; i < net->numShields(); i++) {
-       shield = net->shield(i);
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          fprintf(fout, "\nSNET %s SHIELD %s", net->name(),
-                  shield->shieldName());
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    fprintf(fout, " %s", p->getLayer());
-                    sNLayerName = p->getLayer();
-                    break;
-               case DEFIPATH_VIA:
-                    if (!ignoreVN)
-                       fprintf(fout, " %s", p->getVia());
-                    break;
-	       case DEFIPATH_MASK:
-		    fprintf(fout, "MASK %d ", p->getMask());
-		    break;
-               case DEFIPATH_VIAMASK:
-                   fprintf(fout, "MASK %d%d%d ", 
-                           p->getViaTopMask(), 
-                           p->getViaCutMask(),
-                           p->getViaBottomMask());
-                   break;
-               case DEFIPATH_VIAROTATION:
-                    fprintf(fout, " %d", p->getViaRotation());
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, " %d", p->getWidth());
-                    break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    if (!nline) {
-                       fprintf(fout, "( %d %d ) ", x, y);
-                       nline = 1;
-                    } else {
-                      fprintf(fout, "\nSNET %s SHIELD %s %s ( %d %d )",
-                              net->name(), shield->shieldName(), sNLayerName,
-                              x, y);
-                    }
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, " TAPER");
-                    break;
-             }
-          }
-       }
-    }
-  }
-
-  // layerName width
-  if (net->hasWidthRules()) {
-    fprintf(fout, "\nSNET %s", net->name());
-    for (i = 0; i < net->numWidthRules(); i++) {
-        net->widthRule(i, &layerName, &dist);
-        fprintf (fout, " WIDTH %s %g ", layerName, checkDouble(dist));
-    }
-  }
-
-  // layerName spacing
-  if (net->hasSpacingRules()) {
-    fprintf(fout, "\nSNET %s", net->name());
-    for (i = 0; i < net->numSpacingRules(); i++) {
-        net->spacingRule(i, &layerName, &dist, &left, &right);
-        if (left == right)
-            fprintf (fout, " SPACING %s %g ", layerName, checkDouble(dist));
-        else
-            fprintf (fout, " SPACING %s %g RANGE %g %g ",
-                     layerName, checkDouble(dist), checkDouble(left),
-                     checkDouble(right));
-    }
-  }
-
-  if (net->hasVoltage() || net->hasWeight() || net->hasCap() ||
-      net->hasSource() || net->hasPattern() || net->hasOriginal() ||
-      net->hasUse()) {
-    fprintf(fout, "\nSNET %s", net->name());
-    if (net->hasVoltage())
-      fprintf(fout, " VOLTAGE %g", checkDouble(net->voltage()));
-    if (net->hasWeight())
-      fprintf(fout, " WEIGHT %d", net->weight());
-    if (net->hasCap())
-      fprintf(fout, " ESTCAP %g", checkDouble(net->cap()));
-    if (net->hasSource())
-      fprintf(fout, " SOURCE %s", net->source());
-    if (net->hasPattern())
-      fprintf(fout, " PATTERN %s", net->pattern());
-    if (net->hasOriginal())
-      fprintf(fout, " ORIGINAL %s", net->original());
-    if (net->hasUse())
-      fprintf(fout, " USE %s", net->use());
-  }
-
-  fprintf(fout,"\n");
-  --numObjs;
-  return 0;
-}
-
-int ndr(defrCallbackType_e c, defiNonDefault* nd, defiUserData ud) {
-  // For nondefaultrule
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNonDefaultCbkType)
-      fprintf(fout, "BOGUS NONDEFAULTRULE TYPE  ");
-  fprintf(fout, "NDR %s", nd->name());
-  if (nd->hasHardspacing())
-     fprintf(fout, " HARDSPACING\n");
-  fprintf(fout, "\n");
-  for (i = 0; i < nd->numLayers(); i++) {
-    fprintf(fout, "NDR %s LAYER %s", nd->name(), nd->layerName(i));
-    fprintf(fout, " WIDTH %d", nd->layerWidthVal(i));
-    if (nd->hasLayerDiagWidth(i))
-      fprintf(fout, " DIAGWIDTH %d",
-              nd->layerDiagWidthVal(i));
-    if (nd->hasLayerSpacing(i))
-      fprintf(fout, " SPACING %d", nd->layerSpacingVal(i));
-    if (nd->hasLayerWireExt(i))
-      fprintf(fout, " WIREEXT %d", nd->layerWireExtVal(i));
-    fprintf(fout, "\n");
-  }
-  for (i = 0; i < nd->numVias(); i++)
-    fprintf(fout, "NDR %s VIA %s\n", nd->name(), nd->viaName(i));
-  for (i = 0; i < nd->numViaRules(); i++)
-    fprintf(fout, "NDR %s VIARULE %s\n", nd->name(), nd->viaRuleName(i));
-  for (i = 0; i < nd->numMinCuts(); i++)
-    fprintf(fout, "NDR %s MINCUTS %s %d\n", nd->name(), nd->cutLayerName(i),
-            nd->numCuts(i));
-  for (i = 0; i < nd->numProps(); i++)
-    fprintf(fout, "NDR %s PROPERTY %s %s\n", nd->name(), nd->propName(i),
-              nd->propValue(i));
-  --numObjs;
-  return 0;
-}
-
-// Technology
-int tname(defrCallbackType_e c, const char* string, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "TECHNOLOGY %s\n", string);
-  return 0;
-}
-
-// Design
-int dname(defrCallbackType_e c, const char* string, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DESIGN %s\n", string);
-
-  return 0;
-}
-
-
-char* address(const char* in) {
-  return ((char*)in);
-}
-
-// Assertion or Constraints
-void operand(defrCallbackType_e c, defiAssertion* a, int ind) {
-  int i, first = 1;
-  char* netName;
-  char* fromInst, * fromPin, * toInst, * toPin;
-
-  if (a->isSum()) {
-      // Sum in operand, recursively call operand
-      fprintf(fout, "ASSERTIONS/CONSTRAINTS SUM ( ");
-      a->unsetSum();
-      isSumSet = 1;
-      begOperand = 0;
-      operand (c, a, ind);
-      fprintf(fout, ") ");
-  } else {
-      // operand
-      if (ind >= a->numItems()) {
-          fprintf(fout, "ERROR: when writing out SUM in Constraints.\n");
-          return;
-       }
-      if (begOperand) {
-         fprintf(fout, "ASSRT/CONSTR ");
-         begOperand = 0;
-      }
-      for (i = ind; i < a->numItems(); i++) {
-          if (a->isNet(i)) {
-              a->net(i, &netName);
-              if (!first)
-                  fprintf(fout, ", "); // print , as separator
-              fprintf(fout, "NET %s ", netName); 
-          } else if (a->isPath(i)) {
-              a->path(i, &fromInst, &fromPin, &toInst,
-                                     &toPin);
-              if (!first)
-                  fprintf(fout, ", ");
-              fprintf(fout, "PATH %s %s %s %s ", fromInst, fromPin, toInst,
-                      toPin);
-          } else if (isSumSet) {
-              // SUM within SUM, reset the flag
-              a->setSum();
-              operand(c, a, i);
-          }
-          first = 0;
-      } 
-      
-  }
-}
-
-// Assertion or Constraints
-int constraint(defrCallbackType_e c, defiAssertion* a, defiUserData ud) {
-  // Handles both constraints and assertions
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (a->isWiredlogic())
-      // Wirelogic
-      fprintf(fout, "ASSRT/CONSTR WIREDLOGIC %s + MAXDIST %g\n",
-              a->netName(), checkDouble(a->fallMax()));
-  else {
-      // Call the operand function
-      isSumSet = 0;    // reset the global variable
-      begOperand = 1;
-      operand (c, a, 0);
-      // Get the Rise and Fall
-      if (a->hasRiseMax())
-          fprintf(fout, " RISEMAX %g ", checkDouble(a->riseMax()));
-      if (a->hasFallMax())
-          fprintf(fout, " FALLMAX %g ", checkDouble(a->fallMax()));
-      if (a->hasRiseMin())
-          fprintf(fout, " RISEMIN %g ", checkDouble(a->riseMin()));
-      if (a->hasFallMin())
-          fprintf(fout, " FALLMIN %g ", checkDouble(a->fallMin()));
-      fprintf(fout, "\n");
-  }
-  --numObjs;
-  return 0;
-}
-
-
-// Property definitions
-int prop(defrCallbackType_e c, defiProp* p, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (strcmp(p->propType(), "design") == 0)
-      fprintf(fout, "PROPDEF DESIGN %s ", p->propName());
-  else if (strcmp(p->propType(), "net") == 0)
-      fprintf(fout, "PROPDEF NET %s ", p->propName());
-  else if (strcmp(p->propType(), "component") == 0)
-      fprintf(fout, "PROPDEF COMP %s ", p->propName());
-  else if (strcmp(p->propType(), "specialnet") == 0)
-      fprintf(fout, "PROPDEF SNET %s ", p->propName());
-  else if (strcmp(p->propType(), "group") == 0)
-      fprintf(fout, "PROPDEF GROUP %s ", p->propName());
-  else if (strcmp(p->propType(), "row") == 0)
-      fprintf(fout, "PROPDEF ROW %s ", p->propName());
-  else if (strcmp(p->propType(), "componentpin") == 0)
-      fprintf(fout, "PROPDEF COMPPIN %s ", p->propName());
-  else if (strcmp(p->propType(), "region") == 0)
-      fprintf(fout, "PROPDEF REGION %s ", p->propName());
-  else if (strcmp(p->propType(), "nondefaultrule") == 0)
-      fprintf(fout, "PROPDEF NONDEFAULTRULE %s ", p->propName());
-  if (p->dataType() == 'I')
-      fprintf(fout, "INT ");
-  if (p->dataType() == 'R')
-      fprintf(fout, "REAL ");
-  if (p->dataType() == 'S')
-      fprintf(fout, "STR ");
-  if (p->dataType() == 'Q')
-      fprintf(fout, "STR ");
-  if (p->hasRange()) {
-      fprintf(fout, "RANGE %g %g ", checkDouble(p->left()),
-                    checkDouble(p->right()));
-  }
-  if (p->hasNumber())
-      fprintf(fout, "%g ", checkDouble(p->number()));
-  if (p->hasString())
-      fprintf(fout, "\"%s\" ", p->string());
-  fprintf(fout, "\n");
-
-  return 0;
-}
-
-
-// History
-int hist(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "HIST %s\n", h);
-  return 0;
-}
-
-
-// Busbitchars
-int bbn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "BUSBITCHARS \"%s\" \n", h);
-  return 0;
-}
-
-
-// Version
-int vers(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "VERSION %g\n", d);
-
-  curVer = d;
-  return 0;
-}
-
-
-// Units
-int units(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "UNITS DISTANCE MICRONS %g\n", checkDouble(d));
-  return 0;
-}
-
-
-// Casesensitive
-int casesens(defrCallbackType_e c, int d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (d == 1)
-     fprintf(fout, "NAMESCASESENSITIVE OFF\n", d);
-  else
-     fprintf(fout, "NAMESCASESENSITIVE ON\n", d);
-  return 0;
-}
-
-
-// Site, Canplace, Cannotoccupy, Diearea, Pin, Pincap, DefaultCap,
-// Row, Gcellgrid, Track, Via, Scanchain, IOtiming, Flooplan,
-// Region, Group, TiminDisable, Pin property
-int cls(defrCallbackType_e c, void* cl, defiUserData ud) {
-  defiSite* site;  // Site and Canplace and CannotOccupy
-  defiBox* box;  // DieArea and 
-  defiPinCap* pc;
-  defiPin* pin;
-  int i, j, k;
-  defiRow* row;
-  defiTrack* track;
-  defiGcellGrid* gcg;
-  defiVia* via;
-  defiRegion* re;
-  defiGroup* group;
-  defiComponentMaskShiftLayer* maskShiftLayer = NULL;
-  defiScanchain* sc;
-  defiIOTiming* iot;
-  defiFPC* fpc;
-  defiTimingDisable* td;
-  defiPartition* part;
-  defiPinProp* pprop;
-  defiBlockage* block;
-  defiSlot* slot;
-  defiFill* fill;
-  defiStyles* styles;
-  int xl, yl, xh, yh;
-  char *name, *a1, *b1;
-  char **inst, **inPin, **outPin;
-  int  *bits;
-  int  size;
-  int corner, typ;
-  const char *itemT;
-  char dir;
-  defiPinAntennaModel* aModel;
-  char *tmpPinName = NULL;
-  char *extraPinName = NULL;
-  char *pName = NULL;
-  char *tmpName = NULL;
-  struct defiPoints points;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  switch (c) {
-
-  case defrSiteCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "SITE %s %g %g %s ", site->name(),
-                 checkDouble(site->x_orig()), checkDouble(site->y_orig()),
-                 site->orientStr());
-         fprintf(fout, "DO %g BY %g STEP %g %g\n",
-                 checkDouble(site->x_num()), checkDouble(site->y_num()),
-                 checkDouble(site->x_step()), checkDouble(site->y_step()));
-         break;
-  case defrCanplaceCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "CANPLACE %s %g %g %s ", site->name(),
-                 checkDouble(site->x_orig()), checkDouble(site->y_orig()),
-                 site->orientStr());
-         fprintf(fout, "DO %g BY %g STEP %g %g\n",
-                 checkDouble(site->x_num()), checkDouble(site->y_num()),
-                 checkDouble(site->x_step()), checkDouble(site->y_step()));
-         break;
-  case defrCannotOccupyCbkType : 
-         site = (defiSite*)cl;
-         fprintf(fout, "CANNOTOCCUPY %s %g %g %s ",
-                 site->name(), checkDouble(site->x_orig()),
-                 checkDouble(site->y_orig()), site->orientStr());
-         fprintf(fout, "DO %g BY %g STEP %g %g\n",
-                 checkDouble(site->x_num()), checkDouble(site->y_num()),
-                 checkDouble(site->x_step()), checkDouble(site->y_step()));
-         break;
-  case defrDieAreaCbkType :
-         box = (defiBox*)cl;
-         fprintf(fout, "DIEAREA");
-         points = box->getPoint();
-         for (i = 0; i < points.numPoints; i++)
-           fprintf(fout, " %d %d", points.x[i], points.y[i]);
-         fprintf(fout, "\n");
-         break;
-  case defrPinCapCbkType :
-         pc = (defiPinCap*)cl;
-         fprintf(fout, "DEFCAP MINPINS %d WIRECAP %g\n", pc->pin(),
-                 checkDouble(pc->cap()));
-         --numObjs;
-         break;
-  case defrPinCbkType :
-         pin = (defiPin*)cl;
-         pName = strdup((char*)pin->pinName());   // get the pinName
-         // check if there has .extra<n> in the pName and ignorePE
-         // is set to 1 
-         if (ignorePE) {
-            // check if .extra is in the name, if it is, ignore it
-            if ((extraPinName = strstr(pName, ".extra")) == NULL)
-               tmpPinName = pName;
-            else {
-               // make sure name ends with .extraNNN
-               tmpName = extraPinName;
-               extraPinName = extraPinName + 6;
-               *tmpName = '\0';
-               tmpPinName = pName;
-               if (extraPinName != NULL) {
-                  while (*extraPinName != '\0' && *extraPinName != '\n') {
-                     if (isdigit(*extraPinName++))
-                        continue;
-                     else {   // Name does not end only .extraNNN
-                        tmpPinName = strdup(pin->pinName());
-                        break;
-                     }
-                  }
-               }
-            }
-         } else
-            tmpPinName = pName;
-         fprintf(fout, "PIN %s + NET %s ", tmpPinName,
-                 pin->netName());
-         if (pin->hasDirection())
-             fprintf(fout, "+ DIRECTION %s ", pin->direction());
-         if (pin->hasUse())
-             fprintf(fout, "+ USE %s ", pin->use());
-         if (pin->hasNetExpr())
-             fprintf(fout, "+ NETEXPR %s", pin->netExpr());
-         if (pin->hasSupplySensitivity())
-             fprintf(fout, "+ SUPPLYSENSITIVITY %s ", pin->supplySensitivity());
-         if (pin->hasGroundSensitivity())
-             fprintf(fout, "+ GROUNDSENSITIVITY %s ", pin->groundSensitivity());
-         if (pin->hasLayer()) {
-             for (i = 0; i < pin->numLayer(); i++) {
-                 fprintf(fout, "+ LAYER %s ", pin->layer(i));
-		 if (pin->layerMask(i)) 
-                    fprintf(fout, "MASK %d ",
-			    pin->layerMask(i));
-                 if (pin->hasLayerSpacing(i))
-                   fprintf(fout, "SPACING %d ",
-                           pin->layerSpacing(i));
-                 if (pin->hasLayerDesignRuleWidth(i))
-                   fprintf(fout, "DESIGNRULEWIDTH %d ",
-                           pin->layerDesignRuleWidth(i));
-                 pin->bounds(i, &xl, &yl, &xh, &yh);
-                 fprintf(fout, "( %d %d ) ( %d %d ) ", xl, yl, xh, yh);
-             }
-             for (i = 0; i < pin->numPolygons(); i++) {
-                 fprintf(fout, "+ POLYGON %s", pin->polygonName(i));
-		 if (pin->polygonMask(i))
-                  fprintf(fout, "MASK %d ",
-                          pin->polygonMask(i));
-                 if (pin->hasPolygonSpacing(i))
-                   fprintf(fout, "SPACING %d ",
-                           pin->polygonSpacing(i));
-                 if (pin->hasPolygonDesignRuleWidth(i))
-                   fprintf(fout, "DESIGNRULEWIDTH %d ",
-                           pin->polygonDesignRuleWidth(i));
-                 points = pin->getPolygon(i);
-                 for (k = 0; k < points.numPoints; k++)
-                    fprintf(fout, " %d %d", points.x[k], points.y[k]);
-             }
-             for (i = 0; i < pin->numVias(); i++) {
-		 if (pin->viaTopMask(i) || pin->viaCutMask(i) || pin->viaBottomMask(i)) {
-                     fprintf(fout, "\nVIA %s MASK %d%d%d %d %d ", 
-                         pin->viaName(i),
-                         pin->viaTopMask(i),
-                         pin->viaCutMask(i),
-                         pin->viaBottomMask(i),
-                         pin->viaPtX(i), 
-                         pin->viaPtY(i));
-                 } else {
-		    fprintf(fout, "\nVIA %s %d %d ", pin->viaName(i),
-                         pin->viaPtX(i), pin->viaPtY(i));
-		 }
-             }
-         }
-         if (pin->hasPlacement()) {
-             if (pin->isPlaced())
-                 fprintf(fout, " PLACED ");
-             if (pin->isCover())
-                 fprintf(fout, " COVER ");
-             if (pin->isFixed())
-                 fprintf(fout, " FIXED ");
-             fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                     pin->placementY(), pin->orientStr());
-         }
-         if (pin->hasSpecial())
-             fprintf(fout, " SPECIAL ");
-         fprintf(fout, "\n");
-
-         if (pin->hasPort()) {
-             struct defiPoints points;
-             defiPinPort* port;
-             for (j = 0; j < pin->numPorts(); j++) {
-                fprintf(fout, "PIN %s", tmpPinName);
-                port = pin->pinPort(j);
-                fprintf(fout, " + PORT");
-                for (i = 0; i < port->numLayer(); i++) {
-                   fprintf(fout, "+ LAYER %s", port->layer(i));
-		   if (port->layerMask(i))
-                       fprintf(fout, "MASK %d ",
-                               port->layerMask(i));
-                   if (port->hasLayerSpacing(i))
-                     fprintf(fout, " SPACING %d", port->layerSpacing(i));
-                   if (port->hasLayerDesignRuleWidth(i))
-                     fprintf(fout, " DESIGNRULEWIDTH %d",
-                            port->layerDesignRuleWidth(i));
-                   port->bounds(i, &xl, &yl, &xh, &yh);
-                   fprintf(fout, " %d %d %d %d", xl, yl, xh, yh);
-                }
-                for (i = 0; i < port->numPolygons(); i++) {
-                   fprintf(fout, " + POLYGON %s", port->polygonName(i));
-		   if (port->polygonMask(i))
-                     fprintf(fout, "MASK %d ",
-                             port->polygonMask(i));
-                   if (port->hasPolygonSpacing(i))
-                     fprintf(fout, " SPACING %d", port->polygonSpacing(i));
-                   if (port->hasPolygonDesignRuleWidth(i))
-                     fprintf(fout, " DESIGNRULEWIDTH %d",
-                            port->polygonDesignRuleWidth(i));
-                   points = port->getPolygon(i);
-                   for (k = 0; k < points.numPoints; k++)
-                     fprintf(fout, " %d %d", points.x[k], points.y[k]);
-                }
-                for (i = 0; i < port->numVias(); i++) {
-		   if (port->viaTopMask(i) || port->viaCutMask(i) 
-                        || port->viaBottomMask(i)) {
-                        fprintf(fout, "\n    VIA %s MASK %d%d%d ( %d %d ) ",
-                            port->viaName(i),
-                            port->viaTopMask(i),
-                            port->viaCutMask(i),
-                            port->viaBottomMask(i),
-                            port->viaPtX(i),
-                            port->viaPtY(i));
-                    } else {
-			fprintf(fout, " VIA %s ( %d %d ) ", port->viaName(i),
-                           port->viaPtX(i), port->viaPtY(i));
-		    }
-                }
-                if (port->hasPlacement()) {
-                   if (port->isPlaced()) {
-                      fprintf(fout, " + PLACED");
-                      fprintf(fout, " %d %d %d ", port->placementX(),
-                         port->placementY(), port->orient());
-                   }
-                   if (port->isCover()) {
-                      fprintf(fout, " + COVER");
-                      fprintf(fout, " %d %d %d ", port->placementX(),
-                         port->placementY(), port->orient());
-                   }
-                   if (port->isFixed()) {
-                      fprintf(fout, " + FIXED");
-                      fprintf(fout, " %d %d %d", port->placementX(),
-                         port->placementY(), port->orient());
-                   }
-                }
-                fprintf(fout,"\n");
-            }
-         }
-         if (pin->hasAPinPartialMetalArea()) {
-             fprintf(fout, "PIN %s + NET %s ", tmpPinName,
-                     pin->netName());
-             for (i = 0; i < pin->numAPinPartialMetalArea(); i++) {
-                 fprintf(fout, " ANTPINPARTIALMETALAREA %d ",
-                         pin->APinPartialMetalArea(i));
-                 if (*(pin->APinPartialMetalAreaLayer(i)))
-                    fprintf(fout, " %s ", pin->APinPartialMetalAreaLayer(i));
-             }
-             fprintf(fout, "\n");
-         }
-         if (pin->hasAPinPartialMetalSideArea()) {
-             fprintf(fout, "PIN %s + NET %s ", tmpPinName,
-                     pin->netName());
-             for (i = 0; i < pin->numAPinPartialMetalSideArea(); i++) {
-                fprintf(fout, "ANTPINPARTIALMETALSIDEAREA %d",
-                        pin->APinPartialMetalSideArea(i));
-                if (*(pin->APinPartialMetalSideAreaLayer(i)))
-                    fprintf(fout, " %s", pin->APinPartialMetalSideAreaLayer(i));
-             }
-             fprintf(fout, "\n");
-         }
-         if (pin->hasAPinPartialCutArea()) {
-             fprintf(fout, "PIN %s + NET %s ", tmpPinName,
-                     pin->netName());
-             for (i = 0; i < pin->numAPinPartialCutArea(); i++) {
-                fprintf(fout, "ANTPINPARTIALCUTAREA %d",
-                        pin->APinPartialCutArea(i));
-                if (*(pin->APinPartialCutAreaLayer(i)))
-                    fprintf(fout, " %s", pin->APinPartialCutAreaLayer(i));
-             }
-             fprintf(fout, "\n");
-         }
-         if (pin->hasAPinDiffArea()) {
-             fprintf(fout, "PIN %s + NET %s ", tmpPinName,
-                     pin->netName());
-             for (i = 0; i < pin->numAPinDiffArea(); i++) {
-                fprintf(fout, "ANTPINDIFFAREA %d", pin->APinDiffArea(i));
-                if (*(pin->APinDiffAreaLayer(i)))
-                    fprintf(fout, " %s", pin->APinDiffAreaLayer(i));
-             }
-             fprintf(fout, "\n");
-         }
-
-         for (j = 0; j < pin->numAntennaModel(); j++) {
-             aModel = pin->antennaModel(j);
-
-             if (aModel->hasAPinGateArea()) {
-                fprintf(fout, "PIN %s + NET %s %s ", tmpPinName,
-                        pin->netName(), aModel->antennaOxide());
-                for (i = 0; i < aModel->numAPinGateArea();
-                     i++) {
-                   fprintf(fout, "ANTPINGATEAREA %d", aModel->APinGateArea(i));
-                   if (*(aModel->APinGateAreaLayer(i)))
-                       fprintf(fout, " %s", aModel->APinGateAreaLayer(i));
-                }
-                fprintf(fout, "\n");
-             }
-             if (aModel->hasAPinMaxAreaCar()) {
-                fprintf(fout, "PIN %s + NET %s %s ", tmpPinName,
-                        pin->netName(), aModel->antennaOxide());
-                for (i = 0; i <
-                     aModel->numAPinMaxAreaCar(); i++) {
-                   fprintf(fout, "ANTPINMAXAREACAR %d",
-                           aModel->APinMaxAreaCar(i));
-                   if (*(aModel->APinMaxAreaCarLayer(i)))
-                       fprintf(fout, " %s", aModel->APinMaxAreaCarLayer(i));
-                }
-                fprintf(fout, "\n");
-             }
-             if (aModel->hasAPinMaxSideAreaCar()) {
-                fprintf(fout, "PIN %s + NET %s %s ", tmpPinName,
-                        pin->netName(), aModel->antennaOxide());
-                for (i = 0;
-                     i < aModel->numAPinMaxSideAreaCar();
-                     i++) {
-                   fprintf(fout, "ANTPINMAXSIDEAREACAR %d",
-                           aModel->APinMaxSideAreaCar(i));
-                   if (*(aModel->APinMaxSideAreaCarLayer(i)))
-                       fprintf(fout, " %s", aModel->APinMaxSideAreaCarLayer(i));
-                }
-                fprintf(fout, "\n");
-             }
-             if (aModel->hasAPinMaxCutCar()) {
-                fprintf(fout, "PIN %s + NET %s %s ", tmpPinName,
-                        pin->netName(), aModel->antennaOxide());
-                for (i = 0; i < aModel->numAPinMaxCutCar();
-                     i++) {
-                   fprintf(fout, "ANTPINMAXCUTCAR %d",
-                           aModel->APinMaxCutCar(i));
-                   if (*(aModel->APinMaxCutCarLayer(i)))
-                       fprintf(fout, " %s", aModel->APinMaxCutCarLayer(i));
-                }
-                fprintf(fout, "\n");
-             }
-         }
-         if (tmpPinName)
-             free(tmpPinName);
-         --numObjs;
-         break;
-  case defrDefaultCapCbkType :
-         i = (long)cl;
-         fprintf(fout, "DEFAULTCAP %d\n", i);
-         numObjs = i;
-         break;
-  case defrRowCbkType :
-         row = (defiRow*)cl;
-         if (ignoreRN)  // PCR 716759, if flag is set don't bother with name
-            fprintf(fout, "ROW %s %g %g %d",
-                    row->macro(), checkDouble(row->x()), checkDouble(row->y()),
-                    row->orient());
-         else
-            fprintf(fout, "ROW %s %s %g %g %d", row->name(),
-                    row->macro(), checkDouble(row->x()), checkDouble(row->y()),
-                    row->orient());
-         if (row->hasDo()) {
-            fprintf(fout, " DO %g BY %g",
-                    checkDouble(row->xNum()), checkDouble(row->yNum()));
-            if (row->hasDoStep()) 
-               fprintf(fout, " STEP %g %g\n",
-                       checkDouble(row->xStep()), checkDouble(row->yStep()));
-         }
-         fprintf(fout, "\n");
-         if (row->numProps() > 0) {
-            if (ignoreRN) {
-                for (i = 0; i < row->numProps(); i++)
-                    fprintf(fout, "ROW PROP %s %s\n",
-                            row->propName(i), row->propValue(i));
-            } else {
-                for (i = 0; i < row->numProps(); i++)
-                    fprintf(fout, "ROW %s PROP %s %s\n", row->name(),
-                            row->propName(i), row->propValue(i));
-            }
-         }
-         break;
-  case defrTrackCbkType :
-         track = (defiTrack*)cl;
-	 /*if (track->firstTrackMask()) {
-	    if (track->sameMask()) {
-		fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d SAMEMASK LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-	         track->firstTrackMask());
-	    } else {
-		fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-	         track->firstTrackMask());
-	    }
-	 } else {
-	    fprintf(fout, "TRACKS %s %g DO %g STEP %g LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep());
-	 } */
-         for (i = 0; i < track->numLayers(); i++) {
-	    if (track->firstTrackMask()) {
-		if (track->sameMask()) {
-		    fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d SAMEMASK LAYER %s\n",
-			    track->macro(), track->x(),
-			    track->xNum(), track->xStep(),
-			    track->firstTrackMask(), track->layer(i));
-		} else {
-		    fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d LAYER %s\n",
-			    track->macro(), track->x(),
-			    track->xNum(), track->xStep(),
-			    track->firstTrackMask(),
-			    track->layer(i));
-		} 
-	    } else {
-		    fprintf(fout, "TRACKS %s %g DO %g STEP %g LAYER %s\n",
-			    track->macro(), track->x(),
-			    track->xNum(), track->xStep(),
-			    track->layer(i));
-	    }
-         }
-         break;
-  case defrGcellGridCbkType :
-         gcg = (defiGcellGrid*)cl;
-         fprintf(fout, "GCELLGRID %s %d DO %d STEP %g\n",
-                 gcg->macro(), gcg->x(),
-                 gcg->xNum(),
-                 checkDouble(gcg->xStep()));
-         break;
-  case defrViaCbkType :
-         via = (defiVia*)cl;
-         fprintf(fout, "VIA %s ", via->name());
-         if (via->hasPattern())
-             fprintf(fout, " PATTERNNAME %s\n", via->pattern());
-         else
-             fprintf(fout, "\n");
-         for (i = 0; i < via->numLayers(); i++) {
-             via->layer(i, &name, &xl, &yl, &xh, &yh);
-	     int rectMask = via->rectMask(i);
-
-	     if (rectMask) {
-		fprintf(fout, "VIA %s RECT %s  MASK %d ( %d %d ) ( %d %d ) \n",
-                        via->name(), name, rectMask, xl, yl, xh, yh);
-	     } else {
-		fprintf(fout, "VIA %s RECT %s ( %d %d ) ( %d %d ) \n", via->name(),
-                     name, xl, yl, xh, yh);
-	     }
-         }
-	 // POLYGON
-         if (via->numPolygons()) {
-           struct defiPoints points;
-           for (i = 0; i < via->numPolygons(); i++) {
-	     int polyMask = via->polyMask(i);
-
-	     if (polyMask) {
-		fprintf(fout, "\n  POLYGON %s MASK %d ", 
-			via->polygonName(i), polyMask);
-	     } else {
-                fprintf(fout, "\n  POLYGON %s ", via->polygonName(i));
-	     }
-             points = via->getPolygon(i);
-             for (j = 0; j < points.numPoints; j++)
-               fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-           }
-           fprintf(fout, " \n");
-         }
-
-         if (via->hasViaRule()) {
-             char *vrn, *bl, *cl, *tl;
-             int xs, ys, xcs, ycs, xbe, ybe, xte, yte;
-             int cr, cc, xo, yo, xbo, ybo, xto, yto;
-             (void)via->viaRule(&vrn, &xs, &ys, &bl, &cl, &tl, &xcs,
-                                         &ycs, &xbe, &ybe, &xte, &yte);
-             fprintf(fout, "VIA %s VIARULE %s CUTSIZE %d %d LAYERS %s %s %s",
-                     via->name(), vrn, xs, ys, bl, cl, tl);
-             fprintf(fout, " CUTSPACING %d %d ENCLOSURE %d %d %d %d", xcs, ycs,
-                     xbe, ybe, xte, yte);
-             if (via->hasRowCol()) {
-                (void)via->rowCol(&cr, &cc);
-                fprintf(fout, " ROWCOL %d %d", cr, cc);
-             }
-             if (via->hasOrigin()) {
-                (void)via->origin(&xo, &yo);
-                fprintf(fout, " ORIGIN %d %d", xo, yo);
-             }
-             if (via->hasOffset()) {
-                (void)via->offset(&xbo, &ybo, &xto, &yto);
-                fprintf(fout, " OFFSET %d %d %d %d", xbo, ybo, xto, yto);
-             }
-             if (via->hasCutPattern())
-                fprintf(fout, " PATTERN %s", via->cutPattern());
-             fprintf(fout, "\n");
-         }
-         --numObjs;
-         break;
-  case defrRegionCbkType :
-         re = (defiRegion*)cl;
-         for (i = 0; i < re->numRectangles(); i++)
-             fprintf(fout, "REGION %s ( %d %d ) ( %d %d )\n",re->name(),
-                     re->xl(i), re->yl(i), re->xh(i), re->yh(i));
-         if (re->hasType())
-             fprintf(fout, "REGION %s TYPE %s\n",re->name(), re->type());
-         --numObjs;
-         break;
-  case defrGroupCbkType :
-         group = (defiGroup*)cl;
-         fprintf(fout, "GROUP %s ", group->name());
-         if (group->hasMaxX() | group->hasMaxY()
-             | group->hasPerim()) {
-             fprintf(fout, "SOFT ");
-             if (group->hasPerim()) 
-                 fprintf(fout, "MAXHALFPERIMETER %d ",
-                         group->perim());
-             if (group->hasMaxX())
-                 fprintf(fout, "MAXX %d ", group->maxX());
-             if (group->hasMaxY()) 
-                 fprintf(fout, "MAXY %d ", group->maxY());
-         } 
-         if (group->hasRegionName())
-             fprintf(fout, "REGION %s ", group->regionName());
-         if (group->hasRegionBox()) {
-             int *gxl, *gyl, *gxh, *gyh;
-             int size;
-             group->regionRects(&size, &gxl, &gyl, &gxh, &gyh);
-             for (i = 0; i < size; i++)
-                 fprintf(fout, "REGION (%d %d) (%d %d) ", gxl[i], gyl[i],
-                         gxh[i], gyh[i]);
-         }
-         fprintf(fout, "\n");
-         --numObjs;
-         break;
-  case defrComponentMaskShiftLayerCbkType :
-	 fprintf(fout, "COMPONENTMASKSHIFT ");
-        
-        for (i = 0; i < maskShiftLayer->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", maskShiftLayer->maskShiftLayer(i));
-        } 
-        fprintf(fout, ";\n");
-	 break;
-  case defrScanchainCbkType :
-         sc = (defiScanchain*)cl;
-         fprintf(fout, "SCANCHAINS %s", sc->name());
-         if (sc->hasStart()) {
-             sc->start(&a1, &b1);
-             fprintf(fout, " START %s %s", sc->name(), a1, b1);
-         }
-         if (sc->hasStop()) {
-             sc->stop(&a1, &b1);
-             fprintf(fout, " STOP %s %s", sc->name(), a1, b1);
-         }
-         if (sc->hasCommonInPin() ||
-             sc->hasCommonOutPin()) {
-             fprintf(fout, " COMMONSCANPINS ", sc->name());
-             if (sc->hasCommonInPin())
-                fprintf(fout, " ( IN %s )", sc->commonInPin());
-             if (sc->hasCommonOutPin())
-                fprintf(fout, " ( OUT %s )",sc->commonOutPin());
-         }
-         fprintf(fout, "\n");
-         if (sc->hasFloating()) {
-            sc->floating(&size, &inst, &inPin, &outPin, &bits);
-            for (i = 0; i < size; i++) {
-                fprintf(fout, "SCANCHAINS %s FLOATING %s", sc->name(), inst[i]);
-                if (inPin[i])
-                   fprintf(fout, " IN %s", inPin[i]);
-                if (outPin[i])
-                   fprintf(fout, " OUT %s", outPin[i]);
-                if (bits[i] != -1)
-                   fprintf(fout, " BITS %d", bits[i]);
-                fprintf(fout, "\n");
-            }
-         }
-
-         if (sc->hasOrdered()) {
-            for (i = 0; i < sc->numOrderedLists(); i++) {
-                sc->ordered(i, &size, &inst, &inPin, &outPin, &bits);
-                for (j = 0; j < size; j++) {
-                    fprintf(fout, "SCANCHAINS %s ORDERED %s", sc->name(),
-                            inst[j]); 
-                    if (inPin[j])
-                       fprintf(fout, " IN %s", inPin[j]);
-                    if (outPin[j])
-                       fprintf(fout, " OUT %s", outPin[j]);
-                    if (bits[j] != -1)
-                       fprintf(fout, " BITS %d", bits[j]);
-                    fprintf(fout, "\n");
-                }
-            }
-         }
-
-         if (sc->hasPartition()) {
-            fprintf(fout, "SCANCHAINS %s PARTITION %s", sc->name(),
-                    sc->partitionName());
-            if (sc->hasPartitionMaxBits())
-              fprintf(fout, " MAXBITS %d", sc->partitionMaxBits());
-         }
-         fprintf(fout, "\n");
-         --numObjs;
-         break;
-  case defrIOTimingCbkType :
-         iot = (defiIOTiming*)cl;
-         fprintf(fout, "IOTIMING ( %s %s )\n", iot->inst(), iot->pin());
-         if (iot->hasSlewRise())
-             fprintf(fout, "IOTIMING %s RISE SLEWRATE %g %g\n", iot->inst(),
-                     checkDouble(iot->slewRiseMin()),
-                     checkDouble(iot->slewRiseMax()));
-         if (iot->hasSlewFall())
-             fprintf(fout, "IOTIMING %s FALL SLEWRATE %g %g\n", iot->inst(),
-                     checkDouble(iot->slewFallMin()),
-                     checkDouble(iot->slewFallMax()));
-         if (iot->hasVariableRise())
-             fprintf(fout, "IOTIMING %s RISE VARIABLE %g %g\n", iot->inst(),
-                     checkDouble(iot->variableRiseMin()),
-                     checkDouble(iot->variableRiseMax()));
-         if (iot->hasVariableFall())
-             fprintf(fout, "IOTIMING %s FALL VARIABLE %g %g\n", iot->inst(),
-                     checkDouble(iot->variableFallMin()),
-                     checkDouble(iot->variableFallMax()));
-         if (iot->hasCapacitance())
-             fprintf(fout, "IOTIMING %s CAPACITANCE %g\n", iot->inst(),
-                     checkDouble(iot->capacitance()));
-         if (iot->hasDriveCell()) {
-             fprintf(fout, "IOTIMING %s DRIVECELL %s ", iot->inst(),
-                     iot->driveCell());
-             if (iot->hasFrom())
-                 fprintf(fout, " FROMPIN %s ",
-                         iot->from());
-             if (iot->hasTo())
-                 fprintf(fout, " TOPIN %s ",
-                         iot->to());
-             if (iot->hasParallel())
-                 fprintf(fout, "PARALLEL %g", checkDouble(iot->parallel()));
-             fprintf(fout, "\n");
-         }
-         --numObjs;
-         break;
-  case defrFPCCbkType :
-         fpc = (defiFPC*)cl;
-         fprintf(fout, "FLOORPLAN %s ", fpc->name());
-         if (fpc->isVertical())
-             fprintf(fout, "VERTICAL ");
-         if (fpc->isHorizontal())
-             fprintf(fout, "HORIZONTAL ");
-         if (fpc->hasAlign())
-             fprintf(fout, "ALIGN ");
-         if (fpc->hasMax())
-             fprintf(fout, "%g ", checkDouble(fpc->alignMax()));
-         if (fpc->hasMin())
-             fprintf(fout, "%g ", checkDouble(fpc->alignMin()));
-         if (fpc->hasEqual())
-             fprintf(fout, "%g ", checkDouble(fpc->equal()));
-         for (i = 0; i < fpc->numParts(); i++) {
-             fpc->getPart(i, &corner, &typ, &name);
-             if (corner == 'B')
-                 fprintf(fout, "BOTTOMLEFT ");
-             else
-                 fprintf(fout, "TOPRIGHT ");
-             if (typ == 'R')
-                 fprintf(fout, "ROWS %s ", name);
-             else
-                 fprintf(fout, "COMPS %s ", name);
-         }
-         fprintf(fout, "\n");
-         --numObjs;
-         break;
-  case defrTimingDisableCbkType :
-         td = (defiTimingDisable*)cl;
-         if (td->hasFromTo()) fprintf(fout, "TIMINGDISABLE FROMPIN %s %s ", td->fromInst(), td->fromPin(), td->toInst(), td->toPin()); if (td->hasThru())
-             fprintf(fout, " THRUPIN %s %s ", td->thruInst(), td->thruPin());
-         if (td->hasMacroFromTo())
-             fprintf(fout, " MACRO %s FROMPIN %s %s ", td->macroName(),
-                     td->fromPin(), td->toPin());
-         if (td->hasMacroThru())
-             fprintf(fout, " MACRO %s THRUPIN %s %s ", td->macroName(),
-                     td->fromPin());
-         fprintf(fout, "\n");
-         break;
-  case defrPartitionCbkType :
-         part = (defiPartition*)cl;
-         fprintf(fout, "PARTITION %s ", part->name());
-         if (part->isSetupRise() | part->isSetupFall() | part->isHoldRise() |
-             part->isHoldFall()) {
-             // has turnoff 
-             fprintf(fout, "TURNOFF "); 
-             if (part->isSetupRise())
-                 fprintf(fout, "SETUPRISE "); 
-             if (part->isSetupFall())
-                 fprintf(fout, "SETUPFALL "); 
-             if (part->isHoldRise())
-                 fprintf(fout, "HOLDRISE "); 
-             if (part->isHoldFall())
-                 fprintf(fout, "HOLDFALL "); 
-         }
-         itemT = part->itemType();
-         dir = part->direction();
-         if (strcmp(itemT, "CLOCK") == 0) {
-             if (dir == 'T')    // toclockpin
-                 fprintf(fout, " TOCLOCKPIN %s %s ", part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromclockpin
-                 fprintf(fout, " FROMCLOCKPIN %s %s ", part->instName(),
-                         part->pinName());
-             if (part->hasMin())
-                 fprintf(fout, "MIN %g %g ",
-                         checkDouble(part->partitionMin()),
-                         checkDouble(part->partitionMax()));
-             if (part->hasMax())
-                 fprintf(fout, "MAX %g %g ",
-                         checkDouble(part->partitionMin()),
-                         checkDouble(part->partitionMax()));
-             fprintf(fout, "PINS ");
-             for (i = 0; i < part->numPins(); i++)
-                  fprintf(fout, "%s ", part->pin(i));
-         } else if (strcmp(itemT, "IO") == 0) {
-             if (dir == 'T')    // toiopin
-                 fprintf(fout, " TOIOPIN %s %s ", part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromiopin
-                 fprintf(fout, " FROMIOPIN %s %s ", part->instName(),
-                         part->pinName());
-         } else if (strcmp(itemT, "COMP") == 0) {
-             if (dir == 'T')    // tocomppin
-                 fprintf(fout, " TOCOMPPIN %s %s ", part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromcomppin
-                 fprintf(fout, " FROMCOMPPIN %s %s ", part->instName(),
-                         part->pinName());
-         }
-         fprintf(fout, "\n");
-         --numObjs;
-         break;
-
-  case defrPinPropCbkType :
-         pprop = (defiPinProp*)cl;
-         if (pprop->isPin())
-            fprintf(fout, "PINPROP PIN %s ", pprop->pinName());
-         else 
-            fprintf(fout, "PINPROP %s %s ", pprop->instName(),
-                    pprop->pinName());
-         fprintf(fout, "\n");
-         if (pprop->numProps() > 0) {
-            for (i = 0; i < pprop->numProps(); i++) {
-                fprintf(fout, "PINPROP PIN %s PROP %s %s\n",
-                        pprop->pinName(), pprop->propName(i),
-                        pprop->propValue(i));
-            }
-         }
-         --numObjs;
-         break;
-
-  case defrBlockageCbkType :
-         block = (defiBlockage*)cl;
-         if (block->hasLayer()) {
-            fprintf(fout, "BLOCKAGE LAYER %s", block->layerName());
-            if (block->hasComponent())
-               fprintf(fout, " COMP %s", block->layerComponentName());
-            if (block->hasSlots())
-               fprintf(fout, " SLOTS");
-            if (block->hasFills())
-               fprintf(fout, " FILLS");
-            if (block->hasPushdown())
-               fprintf(fout, " PUSHDOWN");
-            if (block->hasExceptpgnet())
-               fprintf(fout, " EXCEPTPGNET");
-	    if (block->hasMask())
-	       fprintf(fout, " MASK %d", block->mask());
-            if (block->hasSpacing())
-               fprintf(fout, " SPACING %d",
-                       block->minSpacing());
-            if (block->hasDesignRuleWidth())
-               fprintf(fout, " DESIGNRULEWIDTH %d", block->designRuleWidth());
-            fprintf(fout, "\n");
-            for (i = 0; i < block->numRectangles(); i++) {
-               fprintf(fout, "BLOCKAGE LAYER %s RECT %d %d %d %d\n",
-                       block->layerName(), block->xl(i), block->yl(i),
-                       block->xh(i), block->yh(i));
-            }
-            for (i = 0; i < block->numPolygons(); i++) {
-               fprintf(fout, "BLOCKAGE LAYER %s POLYGON", block->layerName());
-               points = block->getPolygon(i);
-               for (j = 0; j < points.numPoints; j++)
-                  fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-               fprintf(fout, "\n");
-            }
-         }
-         else if (block->hasPlacement()) {
-            fprintf(fout, "BLOCKAGE PLACEMENT");
-            if (block->hasSoft())
-               fprintf(fout, " SOFT");
-            if (block->hasPartial())
-               fprintf(fout, " PARTIAL %g", block->placementMaxDensity());
-            if (block->hasComponent())
-               fprintf(fout, " COMP %s", block->layerComponentName());
-            if (block->hasPushdown())
-               fprintf(fout, " PUSHDOWN");
-            fprintf(fout, "\n");
-            for (i = 0; i < block->numRectangles(); i++) {
-               fprintf(fout, "BLOCKAGE PLACEMENT RECT %d %d %d %d\n",
-                       block->xl(i), block->yl(i),
-                       block->xh(i), block->yh(i));
-            }
-         }
-         --numObjs;
-         break;
-
-  case defrSlotCbkType :
-         slot = (defiSlot*)cl;
-         for (i = 0; i < slot->numRectangles(); i++) {
-            fprintf(fout, "SLOT LAYER %s", slot->layerName());
-            fprintf(fout, " RECT %d %d %d %d\n",
-                    slot->xl(i), slot->yl(i),
-                    slot->xh(i), slot->yh(i));
-         }
-         for (i = 0; i < slot->numPolygons(); i++) {
-            fprintf(fout, "SLOT LAYER %s POLYGON");
-            points = slot->getPolygon(i);
-            for (j = 0; j < points.numPoints; j++)
-              fprintf(fout, " %d %d", points.x[j], points.y[j]);
-            fprintf(fout, "\n");
-         }
-         --numObjs;
-         break;
-
-  case defrFillCbkType :
-         fill = (defiFill*)cl;
-         for (i = 0; i < fill->numRectangles(); i++) {
-            fprintf(fout, "FILL LAYER %s", fill->layerName());
-	    if (fill->layerMask()) {
-                fprintf(fout, " MASK %d", fill->layerMask());
-	    }
-            if (fill->hasLayerOpc())
-               fprintf(fout, " OPC");
-            fprintf(fout, " RECT %d %d %d %d\n",
-                    fill->xl(i), fill->yl(i),
-                    fill->xh(i), fill->yh(i));
-         }
-         for (i = 0; i < fill->numPolygons(); i++) {
-            fprintf(fout, "FILL LAYER %s POLYGON", fill->layerName());
-            points = fill->getPolygon(i);
-            for (j = 0; j < points.numPoints; j++)
-              fprintf(fout, " %d %d", points.x[j], points.y[j]);
-            fprintf(fout, "\n");
-         }
-         if (fill->hasVia()) {
-            fprintf(fout, "FILL VIA %s", fill->viaName());
-	    if (fill->viaTopMask() || fill->viaCutMask()
-                || fill->viaBottomMask()) {
-	       fprintf(fout, " MASK %d%d%d", 
-		       fill->viaTopMask(),
-                       fill->viaCutMask(),
-                       fill->viaBottomMask());
-	    }
-            if (fill->hasViaOpc())
-               fprintf(fout, " OPC\n");
-            for (i = 0; i < fill->numViaPts(); i++) {
-               points = fill->getViaPts(i);
-               for (j = 0; j < points.numPoints; j++)
-                 fprintf(fout, " %d %d", points.x[j], points.y[j]);
-            }
-            fprintf(fout, "\n");
-         }
-         --numObjs;
-         break;
-
-  case defrStylesCbkType :
-         struct defiPoints points;
-         styles = (defiStyles*)cl;
-         fprintf(fout, "STYLE %d", styles->style());
-         points = styles->getPolygon();
-         for (j = 0; j < points.numPoints; j++)
-            fprintf(fout, " %d %d", points.x[j], points.y[j]);
-         fprintf(fout, "\n");
-         --numObjs;
-         break;
-
-  default: fprintf(fout, "BOGUS callback to cls.\n"); return 1;
-  }
-  return 0;
-}
-
-
-int dn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DIVIDERCHAR \"%s\" \n",h);
-  return 0;
-}
-
-
-int ext(defrCallbackType_e t, const char* c, defiUserData ud) {
-  char* name;
-
-  checkType(t);
-  if (ud != userData) dataError();
-
-  switch (t) {
-  case defrNetExtCbkType : name = address("net"); break;
-  case defrComponentExtCbkType : name = address("component"); break;
-  case defrPinExtCbkType : name = address("pin"); break;
-  case defrViaExtCbkType : name = address("via"); break;
-  case defrNetConnectionExtCbkType : name = address("net connection"); break;
-  case defrGroupExtCbkType : name = address("group"); break;
-  case defrScanChainExtCbkType : name = address("scanchain"); break;
-  case defrIoTimingsExtCbkType : name = address("io timing"); break;
-  case defrPartitionsExtCbkType : name = address("partition"); break;
-  default: name = address("BOGUS"); return 1;
-  }
-  fprintf(fout, "EXTENSION %s %s\n", name, c);
-  return 0;
-}
-
-//========
-
-int diffDefReadFile(char* inFile, char* outFile, char* ignorePinExtra,
-                 char* ignoreRowName, char* ignoreViaName, char* netSegComp) {
-  FILE* f;
-  int   res;
-
-  userData = (void*)0x01020304;
-  defrInit();
-
-  defrSetDesignCbk(dname);
-  defrSetTechnologyCbk(tname);
-  defrSetPropCbk(prop);
-  defrSetNetCbk(netf);
-  defrSetSNetCbk(snetf);
-  defrSetComponentMaskShiftLayerCbk(compMSL);
-  defrSetComponentCbk(compf);
-  defrSetAddPathToNet();
-  defrSetHistoryCbk(hist);
-  defrSetConstraintCbk(constraint);
-  defrSetAssertionCbk(constraint);
-  defrSetDividerCbk(dn);
-  defrSetBusBitCbk(bbn);
-  defrSetNonDefaultCbk(ndr);
-
-  // All of the extensions point to the same function.
-  defrSetNetExtCbk(ext);
-  defrSetComponentExtCbk(ext);
-  defrSetPinExtCbk(ext);
-  defrSetViaExtCbk(ext);
-  defrSetNetConnectionExtCbk(ext);
-  defrSetGroupExtCbk(ext);
-  defrSetScanChainExtCbk(ext);
-  defrSetIoTimingsExtCbk(ext);
-  defrSetPartitionsExtCbk(ext);
-
-  defrSetUnitsCbk(units);
-  defrSetVersionCbk(vers);
-  defrSetCaseSensitiveCbk(casesens);
-
-  // The following calls are an example of using one function "cls"
-  // to be the callback for many DIFFERENT types of constructs.
-  // We have to cast the function type to meet the requirements
-  // of each different set function.
-  defrSetSiteCbk((defrSiteCbkFnType)cls);
-  defrSetCanplaceCbk((defrSiteCbkFnType)cls);
-  defrSetCannotOccupyCbk((defrSiteCbkFnType)cls);
-  defrSetDieAreaCbk((defrBoxCbkFnType)cls);
-  defrSetPinCapCbk((defrPinCapCbkFnType)cls);
-  defrSetPinCbk((defrPinCbkFnType)cls);
-  defrSetPinPropCbk((defrPinPropCbkFnType)cls);
-  defrSetDefaultCapCbk((defrIntegerCbkFnType)cls);
-  defrSetRowCbk((defrRowCbkFnType)cls);
-  defrSetTrackCbk((defrTrackCbkFnType)cls);
-  defrSetGcellGridCbk((defrGcellGridCbkFnType)cls);
-  defrSetViaCbk((defrViaCbkFnType)cls);
-  defrSetRegionCbk((defrRegionCbkFnType)cls);
-  defrSetGroupCbk((defrGroupCbkFnType)cls);
-  defrSetScanchainCbk((defrScanchainCbkFnType)cls);
-  defrSetIOTimingCbk((defrIOTimingCbkFnType)cls);
-  defrSetFPCCbk((defrFPCCbkFnType)cls);
-  defrSetTimingDisableCbk((defrTimingDisableCbkFnType)cls);
-  defrSetPartitionCbk((defrPartitionCbkFnType)cls);
-  defrSetBlockageCbk((defrBlockageCbkFnType)cls);
-  defrSetSlotCbk((defrSlotCbkFnType)cls);
-  defrSetFillCbk((defrFillCbkFnType)cls);
-
-  if (strcmp(ignorePinExtra, "0") != 0)
-     ignorePE = 1;
-
-  if (strcmp(ignoreRowName, "0") != 0)
-     ignoreRN = 1;
-
-  if (strcmp(ignoreViaName, "0") != 0)
-     ignoreVN = 1;
-
-  if (strcmp(netSegComp, "0") != 0)
-     netSeCmp = 1;
-
-  if ((f = fopen(inFile,"r")) == 0) {
-    fprintf(stderr,"Couldn't open input file '%s'\n", inFile);
-    return(2);
-  }
- 
-  if ((fout = fopen(outFile, "w")) == 0) {
-    fprintf(stderr, "Couldn't open output file '%s'\n", outFile);
-    fclose(f);
-    return(2);
-  }
-
-  res = defrRead(f, inFile, userData, 1);
-
-  fclose(f);
-  fclose(fout);
-
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.hpp
deleted file mode 100644
index e2305ed..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/diffDefRW.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DIFFDEFRW_H
-#define DIFFDEFRW_H
-
-#include <stdarg.h>
-#include <stdio.h>
-
-int diffDefReadFile(char* inFile, char* outFile, char* ignorePinExtra,
-                    char* ignoreRowName, char* ignoreViaName, char* netSegComp);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/differDef.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/differDef.cpp
deleted file mode 100644
index 5ed9c13..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defdiff/differDef.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
- 
- 
-// This program will diff two lef files or two def files and list the
-// different between the two files.  This problem is not intend to
-// diff a real design.  If user runs this program will a big design,
-// they may experience long execution time and may even ran out of
-// memory.
-//
-// This program is to give user a feel of whether they are using the
-// parser correctly.  After they read the lef/def file in, and
-// write them back out in lef/def format.
-//
-// This program support lef/def 5.6.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef ibmrs
-#   include <strings.h>
-#endif
-#ifndef WIN32
-#   include <unistd.h>
-extern char VersionIdent[];
-#else
-char* VersionIdent = "N/A";
-#endif /* not WIN32 */
-#include "defrReader.hpp"
-#include "diffDefRW.hpp"
-
-char * exeName;   // use to save the executable name
-
-// This program requires 3 input, the type of the file, lef or def
-// fileName1 and fileName2
-void diffUsage() {
-   printf("Usage: lefdefdiff -lef|-def fileName1 fileName2 [-o outputFileName]\n");
-}
-
-int main(int argc, char** argv) {
-  char *fileName1, *fileName2;   // For the filenames to compare
-  char *defOut1, *defOut2;       // For the tmp output files
-  
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-  exeName = argv[0];
-
-  if (argc != 9) {               // If pass in from lefdefdiff, argc is
-      diffUsage();               // always 9: defdiff file1 file2 out1 out2
-      return(1);                 // ignorePinExtra ignoreRowName ignoreViaName
-  }                              // newSegCmp
-
-  fileName1 = argv[1];
-  fileName2 = argv[2];
-
-  // Temporary output files, to whole the def file information as
-  // they are read in.  Later these files will be sorted for compare
-  defOut1 = argv[3];
-  defOut2 = argv[4];
-
-  // def files
-  printf("Reading file: %s\n", fileName1);
-  if (diffDefReadFile(fileName1, defOut1, argv[5], argv[6], argv[7], argv[8]) != 0)
-      return(1);
-  printf("Reading file: %s\n", fileName2);
-  if (diffDefReadFile(fileName2, defOut2, argv[5], argv[6], argv[7], argv[8]) != 0)
-      return(1); 
-
-  return (0);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defrw/defrw.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defrw/defrw.cpp
deleted file mode 100644
index ff08749..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defrw/defrw.cpp
+++ /dev/null
@@ -1,3395 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "defrReader.hpp"
-#include "defiAlias.hpp"
-
-char defaultName[64];
-char defaultOut[64];
-
-// Global variables
-FILE* fout;
-void* userData;
-int numObjs;
-int isSumSet;      // to keep track if within SUM
-int isProp = 0;    // for PROPERTYDEFINITIONS
-int begOperand;    // to keep track for constraint, to print - as the 1st char
-static double curVer = 0;
-static int setSNetWireCbk = 0;
-static int isSessionless = 0;
-static int ignoreRowNames = 0;
-static int ignoreViaNames = 0;
-static int testDebugPrint = 0;  // test for ccr1488696
-
-// TX_DIR:TRANSLATION ON
-
-void myLogFunction(const char* errMsg){
-   fprintf(fout, "ERROR: found error: %s\n", errMsg);
-}
-
-void myWarningLogFunction(const char* errMsg){
-   fprintf(fout, "WARNING: found error: %s\n", errMsg);
-}
-
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
-
-void checkType(defrCallbackType_e c) {
-  if (c >= 0 && c <= defrDesignEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-
-int done(defrCallbackType_e c, void*, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "END DESIGN\n");
-  return 0;
-}
-
-int endfunc(defrCallbackType_e c, void*, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  return 0;
-}
-
-
-char* orientStr(int orient) {
-  switch (orient) {
-      case 0: return ((char*)"N");
-      case 1: return ((char*)"W");
-      case 2: return ((char*)"S");
-      case 3: return ((char*)"E");
-      case 4: return ((char*)"FN");
-      case 5: return ((char*)"FW");
-      case 6: return ((char*)"FS");
-      case 7: return ((char*)"FE");
-  };
-  return ((char*)"BOGUS");
-}
-
-int compMSL(defrCallbackType_e c, defiComponentMaskShiftLayer* co, defiUserData ud) {
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-
-    if (co->numMaskShiftLayers()) {
-	fprintf(fout, "\nCOMPONENTMASKSHIFT ");
-	
-	for (i = 0; i < co->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", co->maskShiftLayer(i));
-	}
-	fprintf(fout, ";\n");
-    }
-
-  return 0;
-}
-
-int compf(defrCallbackType_e c, defiComponent* co, defiUserData ud) {
-  if (testDebugPrint) {
-      co->print(fout);
-  } else {
-      int i;
-
-      checkType(c);
-      if (ud != userData) dataError();
-    //  missing GENERATE, FOREIGN
-        fprintf(fout, "- %s %s ", co->id(),
-                co->name());
-    //    co->changeIdAndName("idName", "modelName");
-    //    fprintf(fout, "%s %s ", co->id(),
-    //            co->name());
-        if (co->hasNets()) {
-            for (i = 0; i < co->numNets(); i++)
-                 fprintf(fout, "%s ", co->net(i));
-        }
-        if (co->isFixed()) 
-            fprintf(fout, "+ FIXED %d %d %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    //orientStr(co->placementOrient()));
-                    co->placementOrientStr());
-        if (co->isCover()) 
-            fprintf(fout, "+ COVER %d %d %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    orientStr(co->placementOrient()));
-        if (co->isPlaced()) 
-            fprintf(fout,"+ PLACED %d %d %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    orientStr(co->placementOrient()));
-        if (co->isUnplaced()) {
-            fprintf(fout,"+ UNPLACED ");
-            if ((co->placementX() != -1) ||
-                (co->placementY() != -1))
-               fprintf(fout,"%d %d %s ",
-                       co->placementX(),
-                       co->placementY(),
-                       orientStr(co->placementOrient()));
-        }
-        if (co->hasSource())
-            fprintf(fout, "+ SOURCE %s ", co->source());
-        if (co->hasGenerate()) {
-            fprintf(fout, "+ GENERATE %s ", co->generateName());
-            if (co->macroName() &&
-                *(co->macroName()))
-               fprintf(fout, "%s ", co->macroName());
-        }
-        if (co->hasWeight())
-            fprintf(fout, "+ WEIGHT %d ", co->weight());
-        if (co->hasEEQ())
-            fprintf(fout, "+ EEQMASTER %s ", co->EEQ());
-        if (co->hasRegionName())
-            fprintf(fout, "+ REGION %s ", co->regionName());
-        if (co->hasRegionBounds()) {
-            int *xl, *yl, *xh, *yh;
-            int size;
-            co->regionBounds(&size, &xl, &yl, &xh, &yh);
-            for (i = 0; i < size; i++) { 
-                fprintf(fout, "+ REGION %d %d %d %d \n",
-                        xl[i], yl[i], xh[i], yh[i]);
-            }
-        }
-        if (co->maskShiftSize()) {
-            fprintf(fout, "+ MASKSHIFT ");
-
-            for (int i = co->maskShiftSize()-1; i >= 0; i--) {
-                fprintf(fout, "%d", co->maskShift(i));
-            }
-            fprintf(fout, "\n");
-        }
-        if (co->hasHalo()) {
-            int left, bottom, right, top;
-            (void) co->haloEdges(&left, &bottom, &right, &top);
-            fprintf(fout, "+ HALO ");
-            if (co->hasHaloSoft())
-               fprintf(fout, "SOFT ");
-            fprintf(fout, "%d %d %d %d\n", left, bottom, right, top);
-        }
-        if (co->hasRouteHalo()) {
-            fprintf(fout, "+ ROUTEHALO %d %s %s\n", co->haloDist(),
-                    co->minLayer(), co->maxLayer());
-        }
-        if (co->hasForeignName()) {
-            fprintf(fout, "+ FOREIGN %s %d %d %s %d ",
-                    co->foreignName(), co->foreignX(),
-                    co->foreignY(), co->foreignOri(),
-                    co->foreignOrient());
-        }
-        if (co->numProps()) {
-            for (i = 0; i < co->numProps(); i++) {
-                fprintf(fout, "+ PROPERTY %s %s ", co->propName(i),
-                        co->propValue(i));
-                switch (co->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-        }
-        fprintf(fout, ";\n");
-        --numObjs;
-        if (numObjs <= 0)
-            fprintf(fout, "END COMPONENTS\n");
-    }
-
-    return 0;
-}
-
-
-int netpath(defrCallbackType_e, defiNet*, defiUserData) {
-  fprintf(fout, "\n");
-
-  fprintf (fout, "Callback of partial path for net\n");
-
-  return 0;
-}
-
-
-int netNamef(defrCallbackType_e c, const char* netName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    fprintf(fout, "- %s ", netName);
-  return 0;
-}
-
-int subnetNamef(defrCallbackType_e c, const char* subnetName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    if (curVer >= 5.6)
-      fprintf(fout, "   + SUBNET CBK %s ", subnetName);
-  return 0;
-}
-
-int nondefRulef(defrCallbackType_e c, const char* ruleName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    if (curVer >= 5.6)
-      fprintf(fout, "   + NONDEFAULTRULE CBK %s ", ruleName);
-  return 0;
-}
-
-int netf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int        i, j, k, w, x, y, z, count, newLayer;
-  defiPath*  p;
-  defiSubnet *s;
-  int        path;
-  defiVpin   *vpin;
-  // defiShield *noShield;
-  defiWire   *wire;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-  if (net->pinIsMustJoin(0))
-      fprintf(fout, "- MUSTJOIN ");
-// 5/6/2004 - don't need since I have a callback for the name
-//  else
-//      fprintf(fout, "- %s ", net->name());
- 
-//  net->changeNetName("newNetName");
-//  fprintf(fout, "%s ", net->name());
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < net->numConnections(); i++) {
-      // set the limit of only 5 items per line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf(fout, "( %s %s ) ", net->instance(i),
-              net->pin(i));
-//      net->changeInstance("newInstance", i);
-//      net->changePin("newPin", i);
-//      fprintf(fout, "( %s %s ) ", net->instance(i),
-//              net->pin(i));
-      if (net->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  if (net->hasNonDefaultRule())
-      fprintf(fout, "+ NONDEFAULTRULE %s\n", net->nonDefaultRule());
-
-  for (i = 0; i < net->numVpins(); i++) {
-      vpin = net->vpin(i);
-      fprintf(fout, "  + %s", vpin->name());
-      if (vpin->layer()) 
-          fprintf(fout, " %s", vpin->layer());
-      fprintf(fout, " %d %d %d %d", vpin->xl(), vpin->yl(), vpin->xh(),
-              vpin->yh());
-      if (vpin->status() != ' ') {
-          fprintf(fout, " %c", vpin->status());
-          fprintf(fout, " %d %d", vpin->xLoc(), vpin->yLoc());
-          if (vpin->orient() != -1)
-              fprintf(fout, " %s", orientStr(vpin->orient()));
-      }
-      fprintf(fout, "\n");
-  }
-
-  // regularWiring
-  if (net->numWires()) {
-     for (i = 0; i < net->numWires(); i++) {
-        newLayer = 0;
-        wire = net->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        count = 0;
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              } 
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "NEW %s ", p->getLayer());
-                     break;
-		case DEFIPATH_MASK:
-		     fprintf(fout, "MASK %d ", p->getMask());
-                     break;
-                case DEFIPATH_VIAMASK:
-                     fprintf(fout, "MASK %d%d%d ", 
-                             p->getViaTopMask(), 
-                             p->getViaCutMask(),
-                             p->getViaBottomMask());
-                     break;
-                case DEFIPATH_VIA:
-                     fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, "%s ", 
-                             orientStr(p->getViaRotation()));
-                     break;
-		case DEFIPATH_RECT:
-		     p->getViaRect(&w, &x, &y, &z);
-                     fprintf(fout, "RECT ( %d %d %d %d ) ", w, x, y, z);
-                     break;
-		case DEFIPATH_VIRTUALPOINT:
-		     p->getVirtualPoint(&x, &y);
-		     fprintf(fout, "VIRTUAL ( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, "%d ", p->getWidth());
-                     break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     fprintf(fout, "( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, "TAPER ");
-                     break;
-                case DEFIPATH_TAPERRULE:
-                     fprintf(fout, "TAPERRULE %s ",p->getTaperRule());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, "STYLE %d ",p->getStyle());
-                     break;
-              }
-           }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-
-  // SHIELDNET
-  if (net->numShieldNets()) {
-     for (i = 0; i < net->numShieldNets(); i++) 
-         fprintf(fout, "\n  + SHIELDNET %s", net->shieldNet(i));
-  }
-/* obsolete in 5.4
-  if (net->numNoShields()) {
-     for (i = 0; i < net->numNoShields(); i++) { 
-         noShield = net->noShield(i); 
-         fprintf(fout, "\n  + NOSHIELD ");
-         newLayer = 0;
-         for (j = 0; j < noShield->numPaths(); j++) {
-            p = noShield->path(j);
-            p->initTraverse();
-            while ((path = (int)p->next()) != DEFIPATH_DONE) {
-               count++;
-               // Don't want the line to be too long
-               if (count >= 5) {
-                   fprintf(fout, "\n");
-                   count = 0;
-               }
-               switch (path) {
-                 case DEFIPATH_LAYER:
-                      if (newLayer == 0) {
-                          fprintf(fout, "%s ", p->getLayer());
-                          newLayer = 1;
-                      } else
-                          fprintf(fout, "NEW %s ", p->getLayer());
-                      break;
-                 case DEFIPATH_VIA:
-                      fprintf(fout, "%s ", p->getVia());
-                      break;
-                 case DEFIPATH_VIAROTATION:
-                      fprintf(fout, "%s ", 
-                             orientStr(p->getViaRotation()));
-                      break;
-                 case DEFIPATH_WIDTH:
-                      fprintf(fout, "%d ", p->getWidth());
-                      break;
-                 case DEFIPATH_POINT:
-                      p->getPoint(&x, &y);
-                      fprintf(fout, "( %d %d ) ", x, y);
-                      break;
-                 case DEFIPATH_FLUSHPOINT:
-                      p->getFlushPoint(&x, &y, &z);
-                      fprintf(fout, "( %d %d %d ) ", x, y, z);
-                      break;
-                 case DEFIPATH_TAPER:
-                      fprintf(fout, "TAPER ");
-                      break;
-                 case DEFIPATH_TAPERRULE:
-                      fprintf(fout, "TAPERRULE %s ",
-                              p->getTaperRule());
-                      break;
-               }
-            }
-         }
-     }
-  }
-*/
-
-  if (net->hasSubnets()) {
-     for (i = 0; i < net->numSubnets(); i++) {
-        s = net->subnet(i);
-        fprintf(fout, "\n");
- 
-        if (s->numConnections()) {
-           if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-           else
-              fprintf(fout, "  + SUBNET %s ", s->name());
-           for (j = 0; j < s->numConnections(); j++)
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-
-           // regularWiring
-           if (s->numWires()) {
-              for (k = 0; k < s->numWires(); k++) {
-                 newLayer = 0;
-                 wire = s->wire(k);
-                 fprintf(fout, "  %s ", wire->wireType());
-                 count = 0;
-                 for (j = 0; j < wire->numPaths(); j++) {
-                    p = wire->path(j);
-                    p->initTraverse();
-                    while ((path = (int)p->next()) != DEFIPATH_DONE) {
-                       count++;
-                       // Don't want the line to be too long
-                       if (count >= 5) {
-                           fprintf(fout, "\n");
-                           count = 0;
-                       } 
-                       switch (path) {
-                         case DEFIPATH_LAYER:
-                              if (newLayer == 0) {
-                                  fprintf(fout, "%s ", p->getLayer());
-                                  newLayer = 1;
-                              } else
-                                  fprintf(fout, "NEW %s ",
-                                          p->getLayer());
-                              break;
-                         case DEFIPATH_VIA:
-                              fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                              break;
-                         case DEFIPATH_VIAROTATION:
-                              fprintf(fout, "%s ",
-                                      p->getViaRotationStr());
-                              break;
-                         case DEFIPATH_WIDTH:
-                              fprintf(fout, "%d ", p->getWidth());
-                              break;
-                         case DEFIPATH_POINT:
-                              p->getPoint(&x, &y);
-                              fprintf(fout, "( %d %d ) ", x, y);
-                              break;
-                         case DEFIPATH_FLUSHPOINT:
-                              p->getFlushPoint(&x, &y, &z);
-                              fprintf(fout, "( %d %d %d ) ", x, y, z);
-                              break;
-                         case DEFIPATH_TAPER:
-                              fprintf(fout, "TAPER ");
-                              break;
-                         case DEFIPATH_TAPERRULE:
-                              fprintf(fout, "TAPERRULE  %s ",
-                                      p->getTaperRule());
-                              break;
-                         case DEFIPATH_STYLE:
-                              fprintf(fout, "STYLE  %d ",
-                                      p->getStyle());
-                              break;
-                       }
-                    }
-                 }
-              }
-           }
-         }
-      }
-   }
-
-  if (net->numProps()) {
-    for (i = 0; i < net->numProps(); i++) {
-        fprintf(fout, "  + PROPERTY %s ", net->propName(i));
-        switch (net->propType(i)) {
-           case 'R': fprintf(fout, "%g REAL ", net->propNumber(i));
-                     break;
-           case 'I': fprintf(fout, "%g INTEGER ", net->propNumber(i));
-                     break;
-           case 'S': fprintf(fout, "%s STRING ", net->propValue(i));
-                     break;
-           case 'Q': fprintf(fout, "%s QUOTESTRING ", net->propValue(i));
-                     break;
-           case 'N': fprintf(fout, "%g NUMBER ", net->propNumber(i));
-                     break;
-        }
-        fprintf(fout, "\n");
-    }
-  }
-
-  if (net->hasWeight())
-    fprintf(fout, "+ WEIGHT %d ", net->weight());
-  if (net->hasCap())
-    fprintf(fout, "+ ESTCAP %g ", net->cap());
-  if (net->hasSource())
-    fprintf(fout, "+ SOURCE %s ", net->source());
-  if (net->hasFixedbump())
-    fprintf(fout, "+ FIXEDBUMP ");
-  if (net->hasFrequency())
-    fprintf(fout, "+ FREQUENCY %g ", net->frequency());
-  if (net->hasPattern())
-    fprintf(fout, "+ PATTERN %s ", net->pattern());
-  if (net->hasOriginal())
-    fprintf(fout, "+ ORIGINAL %s ", net->original());
-  if (net->hasUse())
-    fprintf(fout, "+ USE %s ", net->use());
-
-  fprintf (fout, ";\n");
-  --numObjs;
-  if (numObjs <= 0)
-      fprintf(fout, "END NETS\n");
-  return 0;
-}
-
-
-int snetpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
-  int         i, j, x, y, z, count, newLayer;
-  char*       layerName;
-  double      dist, left, right;
-  defiPath*   p;
-  defiSubnet  *s;
-  int         path;
-  defiShield* shield;
-  defiWire*   wire;
-  int         numX, numY, stepX, stepY;
-
-  if (c != defrSNetPartialPathCbkType)
-      return 1;
-  if (ud != userData) dataError();
-
-  fprintf (fout, "SPECIALNET partial data\n");
-
-  fprintf(fout, "- %s ", ppath->name());
-
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < ppath->numConnections(); i++) {
-      // set the limit of only 5 items print out in one line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf (fout, "( %s %s ) ", ppath->instance(i),
-               ppath->pin(i));
-      if (ppath->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  // specialWiring
-  // POLYGON
-  if (ppath->numPolygons()) {
-     struct defiPoints points;
-    for (i = 0; i < ppath->numPolygons(); i++) {
-      fprintf(fout, "\n  + POLYGON %s ", ppath->polygonName(i));
-      points = ppath->getPolygon(i);
-      for (j = 0; j < points.numPoints; j++)
-        fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-    }
-  }
-  // RECT
-  if (ppath->numRectangles()) {
-     for (i = 0; i < ppath->numRectangles(); i++) {
-       fprintf(fout, "\n  + RECT %s %d %d %d %d", ppath->rectName(i),
-               ppath->xl(i), ppath->yl(i),
-               ppath->xh(i), ppath->yh(i));
-     }
-  }
-
-  // COVER, FIXED, ROUTED or SHIELD
-  if (ppath->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < ppath->numWires(); i++) {
-        newLayer = 0;
-        wire = ppath->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              }
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "NEW %s ", p->getLayer());
-                     break;
-                case DEFIPATH_VIA:
-                     fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, "%s ",
-                             orientStr(p->getViaRotation()));
-                     break;
-                case DEFIPATH_VIADATA:
-                     p->getViaData(&numX, &numY, &stepX, &stepY);
-                     fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                             stepX, stepY);
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, "%d ", p->getWidth());
-                     break;
-		case DEFIPATH_MASK:
-		     fprintf(fout, "MASK %d ", p->getMask());
-		     break;
-                case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                    break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     fprintf(fout, "( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, "TAPER ");
-                     break;
-                case DEFIPATH_SHAPE:
-                     fprintf(fout, "+ SHAPE %s ", p->getShape());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, "+ STYLE %d ", p->getStyle());
-                     break;
-              }
-           }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-
-  if (ppath->hasSubnets()) {
-    for (i = 0; i < ppath->numSubnets(); i++) {
-      s = ppath->subnet(i);
-      if (s->numConnections()) {
-          if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-          else
-              fprintf(fout, "- %s ", s->name());
-          for (j = 0; j < s->numConnections(); j++) {
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-        }
-      }
-
-      // regularWiring
-      if (s->numWires()) {
-         for (i = 0; i < s->numWires(); i++) {
-            wire = s->wire(i);
-            fprintf(fout, "  + %s ", wire->wireType());
-            for (j = 0; j < wire->numPaths(); j++) {
-              p = wire->path(j);
-              p->print(fout);
-            }
-         }
-      }
-    }
-  }
-
-  if (ppath->numProps()) {
-    for (i = 0; i < ppath->numProps(); i++) {
-        if (ppath->propIsString(i))
-           fprintf(fout, "  + PROPERTY %s %s ", ppath->propName(i),
-                   ppath->propValue(i));
-        if (ppath->propIsNumber(i))
-           fprintf(fout, "  + PROPERTY %s %g ", ppath->propName(i),
-                   ppath->propNumber(i));
-        switch (ppath->propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        }
-        fprintf(fout, "\n");
-    }
-  }
-
-  // SHIELD
-  count = 0;
-  // testing the SHIELD for 5.3, obsolete in 5.4
-  if (ppath->numShields()) {
-    for (i = 0; i < ppath->numShields(); i++) {
-       shield = ppath->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             }
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    if (newLayer)
-                       fprintf(fout, "%s ",
-                               orientStr(p->getViaRotation()));
-                    else
-                       fprintf(fout, "Str %s ",
-                               p->getViaRotationStr());
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-	       case DEFIPATH_MASK:
-		    fprintf(fout, "MASK %d ", p->getMask());
-		    break;
-               case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                    break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-             }
-          }
-       }
-    }
-  }
-
-  // layerName width
-  if (ppath->hasWidthRules()) {
-    for (i = 0; i < ppath->numWidthRules(); i++) {
-        ppath->widthRule(i, &layerName, &dist);
-        fprintf (fout, "\n  + WIDTH %s %g ", layerName, dist);
-    }
-  }
-
-  // layerName spacing
-  if (ppath->hasSpacingRules()) {
-    for (i = 0; i < ppath->numSpacingRules(); i++) {
-        ppath->spacingRule(i, &layerName, &dist, &left, &right);
-        if (left == right)
-            fprintf (fout, "\n  + SPACING %s %g ", layerName, dist);
-        else
-            fprintf (fout, "\n  + SPACING %s %g RANGE %g %g ",
-                     layerName, dist, left, right);
-    }
-  }
-
-  if (ppath->hasFixedbump())
-    fprintf(fout, "\n  + FIXEDBUMP ");
-  if (ppath->hasFrequency())
-    fprintf(fout, "\n  + FREQUENCY %g ", ppath->frequency());
-  if (ppath->hasVoltage())
-    fprintf(fout, "\n  + VOLTAGE %g ", ppath->voltage());
-  if (ppath->hasWeight())
-    fprintf(fout, "\n  + WEIGHT %d ", ppath->weight());
-  if (ppath->hasCap())
-    fprintf(fout, "\n  + ESTCAP %g ", ppath->cap());
-  if (ppath->hasSource())
-    fprintf(fout, "\n  + SOURCE %s ", ppath->source());
-  if (ppath->hasPattern())
-    fprintf(fout, "\n  + PATTERN %s ", ppath->pattern());
-  if (ppath->hasOriginal())
-    fprintf(fout, "\n  + ORIGINAL %s ", ppath->original());
-  if (ppath->hasUse())
-    fprintf(fout, "\n  + USE %s ", ppath->use());
-
-  fprintf(fout, "\n");
-
-  return 0;
-}
-
-
-int snetwire(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
-  int         i, j, x, y, z, count = 0, newLayer;
-  defiPath*   p;
-  int         path;
-  defiWire*   wire;
-  defiShield* shield;
-  int         numX, numY, stepX, stepY;
-
-  if (c != defrSNetWireCbkType)
-      return 1;
-  if (ud != userData) dataError();
-
-  fprintf (fout, "SPECIALNET wire data\n");
-
-  fprintf(fout, "- %s ", ppath->name());
-
-  // POLYGON
-  if (ppath->numPolygons()) {
-	struct defiPoints points;
-	for (i = 0; i < ppath->numPolygons(); i++) {
-	    fprintf(fout, "\n  + POLYGON %s ", ppath->polygonName(i));
-
-	    points = ppath->getPolygon(i);
-
-	    for (j = 0; j < points.numPoints; j++) {
-		fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-	    }
-	}
-  // RECT
-  } 
-  if (ppath->numRectangles()) {
-	for (i = 0; i < ppath->numRectangles(); i++) {
-	    fprintf(fout, "\n  + RECT %s %d %d %d %d", ppath->rectName(i),
-            ppath->xl(i), ppath->yl(i),
-            ppath->xh(i), ppath->yh(i));
-	}
-  }
-  // VIA
-  if (ppath->numViaSpecs()) {
-	for (i = 0; i < ppath->numViaSpecs(); i++) {
-	    fprintf(fout, "\n  + VIA %s ", ppath->viaName(i)),
-	    fprintf(fout, " %s", ppath->viaOrientStr(i));
-
-	    defiPoints points = ppath->getViaPts(i);
-
-	    for (int j = 0; j < points.numPoints; j++) {
-		fprintf(fout, " %d %d", points.x[j], points.y[j]);
-	    }
-	}
-  }
-
-  // specialWiring
-  if (ppath->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < ppath->numWires(); i++) {
-        newLayer = 0;
-        wire = ppath->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              }
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "NEW %s ", p->getLayer());
-                     break;
-                case DEFIPATH_VIA:
-                     fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, "%s ",
-                             orientStr(p->getViaRotation()));
-                     break;
-                case DEFIPATH_VIADATA:
-                     p->getViaData(&numX, &numY, &stepX, &stepY);
-                     fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                             stepX, stepY);
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, "%d ", p->getWidth());
-                     break;
-		case DEFIPATH_MASK:
-		     fprintf(fout, "MASK %d ", p->getMask());
-		     break;
-                case DEFIPATH_VIAMASK:
-                     fprintf(fout, "MASK %d%d%d ", 
-                             p->getViaTopMask(), 
-                             p->getViaCutMask(),
-                             p->getViaBottomMask());
-                    break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     fprintf(fout, "( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, "TAPER ");
-                     break;
-                case DEFIPATH_SHAPE:
-                     fprintf(fout, "+ SHAPE %s ", p->getShape());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, "+ STYLE %d ", p->getStyle());
-                     break;
-              }
-           }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  } else if (ppath->numShields()) {
-    for (i = 0; i < ppath->numShields(); i++) {
-       shield = ppath->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             } 
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    fprintf(fout, "%s ", 
-                            orientStr(p->getViaRotation()));
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-	       case DEFIPATH_MASK:
-		    fprintf(fout, "MASK %d ", p->getMask());
-		    break;
-               case DEFIPATH_VIAMASK:
-                   fprintf(fout, "MASK %d%d%d ", 
-                           p->getViaTopMask(), 
-                           p->getViaCutMask(),
-                           p->getViaBottomMask());
-                   break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-                    break;
-             }
-          }
-       }
-    } 
-  }
-
-  fprintf(fout, "\n");
-
-  return 0;
-}
-
-int snetf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int         i, j, x, y, z, count, newLayer;
-  char*       layerName;
-  double      dist, left, right;
-  defiPath*   p;
-  defiSubnet  *s;
-  int         path;
-  defiShield* shield;
-  defiWire*   wire;
-  int         numX, numY, stepX, stepY;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrSNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-
-// 5/6/2004 - don't need since I have a callback for the name
-//  fprintf(fout, "- %s ", net->name());
-
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < net->numConnections(); i++) {
-      // set the limit of only 5 items print out in one line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf (fout, "( %s %s ) ", net->instance(i),
-               net->pin(i));
-      if (net->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  // specialWiring
-  if (net->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < net->numWires(); i++) {
-        newLayer = 0;
-        wire = net->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-            p = wire->path(j);
-            p->initTraverse();
-            if (testDebugPrint) {
-                p->print(fout);
-            } else {
-                while ((path = (int)p->next()) != DEFIPATH_DONE) {
-                  count++;
-                  // Don't want the line to be too long
-                  if (count >= 5) {
-                      fprintf(fout, "\n");
-                      count = 0;
-                  }
-                  switch (path) {
-                    case DEFIPATH_LAYER:
-                         if (newLayer == 0) {
-                             fprintf(fout, "%s ", p->getLayer());
-                             newLayer = 1;
-                         } else
-                             fprintf(fout, "NEW %s ", p->getLayer());
-                         break;
-                    case DEFIPATH_VIA:
-                         fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                         break;
-                    case DEFIPATH_VIAROTATION:
-                         fprintf(fout, "%s ", 
-                                 orientStr(p->getViaRotation()));
-                         break;
-                    case DEFIPATH_VIADATA:
-                         p->getViaData(&numX, &numY, &stepX, &stepY);
-                         fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                                 stepX, stepY);
-                         break;
-                    case DEFIPATH_WIDTH:
-                         fprintf(fout, "%d ", p->getWidth());
-                         break;
-                    case DEFIPATH_MASK:
-                         fprintf(fout, "MASK %d ", p->getMask());
-                         break;
-                    case DEFIPATH_VIAMASK:
-                         fprintf(fout, "MASK %d%d%d ", 
-                                 p->getViaTopMask(), 
-                                 p->getViaCutMask(),
-                                 p->getViaBottomMask());
-                        break;
-                    case DEFIPATH_POINT:
-                         p->getPoint(&x, &y);
-                         fprintf(fout, "( %d %d ) ", x, y);
-                         break;
-                    case DEFIPATH_FLUSHPOINT:
-                         p->getFlushPoint(&x, &y, &z);
-                         fprintf(fout, "( %d %d %d ) ", x, y, z);
-                         break;
-                    case DEFIPATH_TAPER:
-                         fprintf(fout, "TAPER ");
-                         break;
-                    case DEFIPATH_SHAPE:
-                         fprintf(fout, "+ SHAPE %s ", p->getShape());
-                         break;
-                    case DEFIPATH_STYLE:
-                         fprintf(fout, "+ STYLE %d ", p->getStyle());
-                         break;
-                    }
-                }
-            }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-
-  // POLYGON
-  if (net->numPolygons()) {
-    struct defiPoints points;
-
-    for (i = 0; i < net->numPolygons(); i++) {
-      if (curVer >= 5.8 ) {
-	 if (strcmp(net->polyRouteStatus(i), "") != 0) {
-	   fprintf(fout, "\n  + %s ", net->polyRouteStatus(i));
-	   if (strcmp(net->polyRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "\n  + %s ", net->polyRouteStatusShieldName(i));
-	   }
-         }
-         if (strcmp(net->polyShapeType(i), "") != 0) {
-	   fprintf(fout, "\n  + SHAPE %s ", net->polyShapeType(i));
-         }
-      }
-      if (net->polyMask(i)) {
-	  fprintf(fout, "\n  + MASK %d + POLYGON % s ", net->polyMask(i),
-		  net->polygonName(i));
-      } else {
-          fprintf(fout, "\n  + POLYGON %s ", net->polygonName(i));
-      }
-      points = net->getPolygon(i);
-      for (j = 0; j < points.numPoints; j++)
-        fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-    }
-  }
-  // RECT
-  if (net->numRectangles()) {
-
-     for (i = 0; i < net->numRectangles(); i++) {
-       if (curVer >= 5.8 ) {
-	 if (strcmp(net->rectRouteStatus(i), "") != 0) {
-	   fprintf(fout, "\n  + %s ", net->rectRouteStatus(i));
-	   if (strcmp(net->rectRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "\n  + %s ", net->rectRouteStatusShieldName(i));
-	   }
-         }
-         if (strcmp(net->rectShapeType(i), "") != 0) {
-	   fprintf(fout, "\n  + SHAPE %s ", net->rectShapeType(i));
-         }
-       }
-       if (net->rectMask(i)) {
-	  fprintf(fout, "\n  + MASK %d + RECT %s %d %d %d %d", 
-		  net->rectMask(i), net->rectName(i),
-		  net->xl(i), net->yl(i), net->xh(i),
-                  net->yh(i));
-       } else {
-	    fprintf(fout, "\n  + RECT %s %d %d %d %d", 
-		    net->rectName(i),
-                    net->xl(i), 
-		    net->yl(i), 
-		    net->xh(i),
-                    net->yh(i));
-      }
-     }
-  }
-  // VIA
-  if (curVer >= 5.8 && net->numViaSpecs()) {
-     for (i = 0; i < net->numViaSpecs(); i++) {
-       if (strcmp(net->viaRouteStatus(i), "") != 0) {
-	fprintf(fout, "\n  + %s ", net->viaRouteStatus(i));
-	if (strcmp(net->viaRouteStatus(i), "SHIELD") == 0) {
-	      fprintf(fout, "\n  + %s ", net->viaRouteStatusShieldName(i));
-	   }
-       }
-       if (strcmp(net->viaShapeType(i), "") != 0) {
-	fprintf(fout, "\n  + SHAPE %s ", net->viaShapeType(i));
-       }
-       if (net->topMaskNum(i) || net->cutMaskNum(i) || net->bottomMaskNum(i)) {
-	fprintf(fout, "\n  + MASK %d%d%d + VIA %s ", net->topMaskNum(i), 
-                net->cutMaskNum(i),
-                net->bottomMaskNum(i),
-		net->viaName(i));
-       } else {
-	fprintf(fout, "\n  + VIA %s ", net->viaName(i));
-       }
-       fprintf(fout, " %s", net->viaOrientStr(i));
-      
-       defiPoints points = net->getViaPts(i);
-
-       for (int j = 0; j < points.numPoints; j++) {
-          fprintf(fout, " %d %d", points.x[j], points.y[j]);
-       }
-       fprintf(fout, ";\n"); 
-
-     }
-  }
-
-  if (net->hasSubnets()) {
-    for (i = 0; i < net->numSubnets(); i++) {
-      s = net->subnet(i);
-      if (s->numConnections()) {
-          if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-          else
-              fprintf(fout, "- %s ", s->name());
-          for (j = 0; j < s->numConnections(); j++) {
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-        }
-      }
- 
-      // regularWiring
-      if (s->numWires()) {
-         for (i = 0; i < s->numWires(); i++) {
-            wire = s->wire(i);
-            fprintf(fout, "  + %s ", wire->wireType());
-            for (j = 0; j < wire->numPaths(); j++) {
-              p = wire->path(j);
-              p->print(fout);
-            }
-         }
-      }
-    }
-  }
-
-  if (net->numProps()) {
-    for (i = 0; i < net->numProps(); i++) {
-        if (net->propIsString(i))
-           fprintf(fout, "  + PROPERTY %s %s ", net->propName(i),
-                   net->propValue(i));
-        if (net->propIsNumber(i))
-           fprintf(fout, "  + PROPERTY %s %g ", net->propName(i),
-                   net->propNumber(i));
-        switch (net->propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        }
-        fprintf(fout, "\n");
-    }
-  }
-
-  // SHIELD
-  count = 0;
-  // testing the SHIELD for 5.3, obsolete in 5.4
-  if (net->numShields()) {
-    for (i = 0; i < net->numShields(); i++) {
-       shield = net->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             } 
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    fprintf(fout, "%s ", 
-                            orientStr(p->getViaRotation()));
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-	       case DEFIPATH_MASK:
-		    fprintf(fout, "MASK %d ", p->getMask());
-		    break;
-               case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                   break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-                    break;
-             }
-          }
-       }
-    }
-  }
-
-  // layerName width
-  if (net->hasWidthRules()) {
-    for (i = 0; i < net->numWidthRules(); i++) {
-        net->widthRule(i, &layerName, &dist);
-        fprintf (fout, "\n  + WIDTH %s %g ", layerName, dist);
-    }
-  }
-
-  // layerName spacing
-  if (net->hasSpacingRules()) {
-    for (i = 0; i < net->numSpacingRules(); i++) {
-        net->spacingRule(i, &layerName, &dist, &left, &right);
-        if (left == right)
-            fprintf (fout, "\n  + SPACING %s %g ", layerName, dist);
-        else
-            fprintf (fout, "\n  + SPACING %s %g RANGE %g %g ",
-                     layerName, dist, left, right);
-    }
-  }
-
-  if (net->hasFixedbump())
-    fprintf(fout, "\n  + FIXEDBUMP ");
-  if (net->hasFrequency())
-    fprintf(fout, "\n  + FREQUENCY %g ", net->frequency());
-  if (net->hasVoltage())
-    fprintf(fout, "\n  + VOLTAGE %g ", net->voltage());
-  if (net->hasWeight())
-    fprintf(fout, "\n  + WEIGHT %d ", net->weight());
-  if (net->hasCap())
-    fprintf(fout, "\n  + ESTCAP %g ", net->cap());
-  if (net->hasSource())
-    fprintf(fout, "\n  + SOURCE %s ", net->source());
-  if (net->hasPattern())
-    fprintf(fout, "\n  + PATTERN %s ", net->pattern());
-  if (net->hasOriginal())
-    fprintf(fout, "\n  + ORIGINAL %s ", net->original());
-  if (net->hasUse())
-    fprintf(fout, "\n  + USE %s ", net->use());
-
-  fprintf (fout, ";\n");
-  --numObjs;
-  if (numObjs <= 0)
-      fprintf(fout, "END SPECIALNETS\n");
-  return 0;
-}
-
-
-int ndr(defrCallbackType_e c, defiNonDefault* nd, defiUserData ud) {
-  // For nondefaultrule
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNonDefaultCbkType)
-      fprintf(fout, "BOGUS NONDEFAULTRULE TYPE  ");
-  fprintf(fout, "- %s\n", nd->name());
-  if (nd->hasHardspacing())
-      fprintf(fout, "   + HARDSPACING\n");
-  for (i = 0; i < nd->numLayers(); i++) {
-    fprintf(fout, "   + LAYER %s", nd->layerName(i));
-    fprintf(fout, " WIDTH %d", nd->layerWidthVal(i));
-    if (nd->hasLayerDiagWidth(i)) 
-      fprintf(fout, " DIAGWIDTH %d",
-              nd->layerDiagWidthVal(i));
-    if (nd->hasLayerSpacing(i)) 
-      fprintf(fout, " SPACING %d", nd->layerSpacingVal(i));
-    if (nd->hasLayerWireExt(i)) 
-      fprintf(fout, " WIREEXT %d", nd->layerWireExtVal(i));
-    fprintf(fout, "\n");
-  }
-  for (i = 0; i < nd->numVias(); i++)
-    fprintf(fout, "   + VIA %s\n", nd->viaName(i));
-  for (i = 0; i < nd->numViaRules(); i++)
-    fprintf(fout, "   + VIARULE %s\n", ignoreViaNames ? "XXX" : nd->viaRuleName(i));
-  for (i = 0; i < nd->numMinCuts(); i++)
-    fprintf(fout, "   + MINCUTS %s %d\n", nd->cutLayerName(i),
-            nd->numCuts(i));
-  for (i = 0; i < nd->numProps(); i++) {
-    fprintf(fout, "   + PROPERTY %s %s ", nd->propName(i),
-            nd->propValue(i));
-    switch (nd->propType(i)) {
-      case 'R': fprintf(fout, "REAL\n");
-                break;
-      case 'I': fprintf(fout, "INTEGER\n");
-                break;
-      case 'S': fprintf(fout, "STRING\n");
-                break;
-      case 'Q': fprintf(fout, "QUOTESTRING\n");
-                break;
-      case 'N': fprintf(fout, "NUMBER\n");
-                break;
-    }
-  }
-  --numObjs;
-  if (numObjs <= 0)
-    fprintf(fout, "END NONDEFAULTRULES\n");
-  return 0;
-}
-
-int tname(defrCallbackType_e c, const char* string, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "TECHNOLOGY %s ;\n", string);
-  return 0;
-}
-
-int dname(defrCallbackType_e c, const char* string, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DESIGN %s ;\n", string);
-
-  return 0;
-}
-
-
-char* address(const char* in) {
-  return ((char*)in);
-}
-
-int cs(defrCallbackType_e c, int num, defiUserData ud) {
-  char* name;
-
-  checkType(c);
-
-  if (ud != userData) dataError();
-
-  switch (c) {
-  case defrComponentStartCbkType : name = address("COMPONENTS"); break;
-  case defrNetStartCbkType : name = address("NETS"); break;
-  case defrStartPinsCbkType : name = address("PINS"); break;
-  case defrViaStartCbkType : name = address("VIAS"); break;
-  case defrRegionStartCbkType : name = address("REGIONS"); break;
-  case defrSNetStartCbkType : name = address("SPECIALNETS"); break;
-  case defrGroupsStartCbkType : name = address("GROUPS"); break;
-  case defrScanchainsStartCbkType : name = address("SCANCHAINS"); break;
-  case defrIOTimingsStartCbkType : name = address("IOTIMINGS"); break;
-  case defrFPCStartCbkType : name = address("FLOORPLANCONSTRAINTS"); break;
-  case defrTimingDisablesStartCbkType : name = address("TIMING DISABLES"); break;
-  case defrPartitionsStartCbkType : name = address("PARTITIONS"); break;
-  case defrPinPropStartCbkType : name = address("PINPROPERTIES"); break;
-  case defrBlockageStartCbkType : name = address("BLOCKAGES"); break;
-  case defrSlotStartCbkType : name = address("SLOTS"); break;
-  case defrFillStartCbkType : name = address("FILLS"); break;
-  case defrNonDefaultStartCbkType : name = address("NONDEFAULTRULES"); break;
-  case defrStylesStartCbkType : name = address("STYLES"); break;
-  default : name = address("BOGUS"); return 1;
-  }
-  fprintf(fout, "\n%s %d ;\n", name, num);
-  numObjs = num;
-  return 0;
-}
-
-int constraintst(defrCallbackType_e c, int num, defiUserData ud) {
-  // Handles both constraints and assertions
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c == defrConstraintsStartCbkType)
-      fprintf(fout, "\nCONSTRAINTS %d ;\n\n", num);
-  else
-      fprintf(fout, "\nASSERTIONS %d ;\n\n", num);
-  numObjs = num;
-  return 0;
-}
-
-void operand(defrCallbackType_e c, defiAssertion* a, int ind) {
-  int i, first = 1;
-  char* netName;
-  char* fromInst, * fromPin, * toInst, * toPin;
-
-  if (a->isSum()) {
-      // Sum in operand, recursively call operand
-      fprintf(fout, "- SUM ( ");
-      a->unsetSum();
-      isSumSet = 1;
-      begOperand = 0;
-      operand (c, a, ind);
-      fprintf(fout, ") ");
-  } else {
-      // operand
-      if (ind >= a->numItems()) {
-          fprintf(fout, "ERROR: when writing out SUM in Constraints.\n");
-          return;
-       }
-      if (begOperand) {
-         fprintf(fout, "- ");
-         begOperand = 0;
-      }
-      for (i = ind; i < a->numItems(); i++) {
-          if (a->isNet(i)) {
-              a->net(i, &netName);
-              if (!first)
-                  fprintf(fout, ", "); // print , as separator
-              fprintf(fout, "NET %s ", netName); 
-          } else if (a->isPath(i)) {
-              a->path(i, &fromInst, &fromPin, &toInst,
-                                     &toPin);
-              if (!first)
-                  fprintf(fout, ", ");
-              fprintf(fout, "PATH %s %s %s %s ", fromInst, fromPin, toInst,
-                      toPin);
-          } else if (isSumSet) {
-              // SUM within SUM, reset the flag
-              a->setSum();
-              operand(c, a, i);
-          }
-          first = 0;
-      } 
-      
-  }
-}
-
-int constraint(defrCallbackType_e c, defiAssertion* a, defiUserData ud) {
-  // Handles both constraints and assertions
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (a->isWiredlogic())
-      // Wirelogic
-      fprintf(fout, "- WIREDLOGIC %s + MAXDIST %g ;\n",
-// Wiredlogic dist is also store in fallMax
-//              a->netName(), a->distance());
-              a->netName(), a->fallMax());
-  else {
-      // Call the operand function
-      isSumSet = 0;    // reset the global variable
-      begOperand = 1;
-      operand (c, a, 0);
-      // Get the Rise and Fall
-      if (a->hasRiseMax())
-          fprintf(fout, "+ RISEMAX %g ", a->riseMax());
-      if (a->hasFallMax())
-          fprintf(fout, "+ FALLMAX %g ", a->fallMax());
-      if (a->hasRiseMin())
-          fprintf(fout, "+ RISEMIN %g ", a->riseMin());
-      if (a->hasFallMin())
-          fprintf(fout, "+ FALLMIN %g ", a->fallMin());
-      fprintf(fout, ";\n");
-  }
-  --numObjs;
-  if (numObjs <= 0) {
-      if (c == defrConstraintCbkType)
-          fprintf(fout, "END CONSTRAINTS\n");
-      else 
-          fprintf(fout, "END ASSERTIONS\n");
-  }
-  return 0;
-}
-
-
-int propstart(defrCallbackType_e c, void*, defiUserData) {
-  checkType(c);
-  fprintf(fout, "\nPROPERTYDEFINITIONS\n");
-  isProp = 1;
-
-  return 0;
-}
-
-
-int prop(defrCallbackType_e c, defiProp* p, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (strcmp(p->propType(), "design") == 0)
-      fprintf(fout, "DESIGN %s ", p->propName());
-  else if (strcmp(p->propType(), "net") == 0)
-      fprintf(fout, "NET %s ", p->propName());
-  else if (strcmp(p->propType(), "component") == 0)
-      fprintf(fout, "COMPONENT %s ", p->propName());
-  else if (strcmp(p->propType(), "specialnet") == 0)
-      fprintf(fout, "SPECIALNET %s ", p->propName());
-  else if (strcmp(p->propType(), "group") == 0)
-      fprintf(fout, "GROUP %s ", p->propName());
-  else if (strcmp(p->propType(), "row") == 0)
-      fprintf(fout, "ROW %s ", p->propName());
-  else if (strcmp(p->propType(), "componentpin") == 0)
-      fprintf(fout, "COMPONENTPIN %s ", p->propName());
-  else if (strcmp(p->propType(), "region") == 0)
-      fprintf(fout, "REGION %s ", p->propName());
-  else if (strcmp(p->propType(), "nondefaultrule") == 0)
-      fprintf(fout, "NONDEFAULTRULE %s ", p->propName());
-  if (p->dataType() == 'I')
-      fprintf(fout, "INTEGER ");
-  if (p->dataType() == 'R')
-      fprintf(fout, "REAL ");
-  if (p->dataType() == 'S')
-      fprintf(fout, "STRING ");
-  if (p->dataType() == 'Q')
-      fprintf(fout, "STRING ");
-  if (p->hasRange()) {
-      fprintf(fout, "RANGE %g %g ", p->left(),
-              p->right());
-  }
-  if (p->hasNumber())
-      fprintf(fout, "%g ", p->number());
-  if (p->hasString())
-      fprintf(fout, "\"%s\" ", p->string());
-  fprintf(fout, ";\n");
-
-  return 0;
-}
-
-
-int propend(defrCallbackType_e c, void*, defiUserData) {
-  checkType(c);
-  if (isProp) {
-      fprintf(fout, "END PROPERTYDEFINITIONS\n\n");
-      isProp = 0;
-  }
-
-  return 0;
-}
-
-
-int hist(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  defrSetCaseSensitivity(0);
-  if (ud != userData) dataError();
-  fprintf(fout, "HISTORY %s ;\n", h);
-  defrSetCaseSensitivity(1);
-  return 0;
-}
-
-
-int an(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "ARRAY %s ;\n", h);
-  return 0;
-}
-
-
-int fn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "FLOORPLAN %s ;\n", h);
-  return 0;
-}
-
-
-int bbn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "BUSBITCHARS \"%s\" ;\n", h);
-  return 0;
-}
-
-
-int vers(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) 
-      dataError();
-  fprintf(fout, "VERSION %g ;\n", d);  
-  curVer = d;
-
-  fprintf(fout, "ALIAS alias1 aliasValue1 1 ;\n");
-  fprintf(fout, "ALIAS alias2 aliasValue2 0 ;\n");
-
-  return 0;
-}
-
-
-int versStr(defrCallbackType_e c, const char* versionName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "VERSION %s ;\n", versionName);
-  return 0;
-}
-
-
-int units(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "UNITS DISTANCE MICRONS %g ;\n", d);
-  return 0;
-}
-
-
-int casesens(defrCallbackType_e c, int d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (d == 1)
-     fprintf(fout, "NAMESCASESENSITIVE ON ;\n", d);
-  else
-     fprintf(fout, "NAMESCASESENSITIVE OFF ;\n", d);
-  return 0;
-}
-
-
-int cls(defrCallbackType_e c, void* cl, defiUserData ud) {
-  defiSite* site;  // Site and Canplace and CannotOccupy
-  defiBox* box;  // DieArea and 
-  defiPinCap* pc;
-  defiPin* pin;
-  int i, j, k;
-  defiRow* row;
-  defiTrack* track;
-  defiGcellGrid* gcg;
-  defiVia* via;
-  defiRegion* re;
-  defiGroup* group;
-  defiComponentMaskShiftLayer* maskShiftLayer = NULL;
-  defiScanchain* sc;
-  defiIOTiming* iot;
-  defiFPC* fpc;
-  defiTimingDisable* td;
-  defiPartition* part;
-  defiPinProp* pprop;
-  defiBlockage* block;
-  defiSlot* slots;
-  defiFill* fills;
-  defiStyles* styles;
-  int xl, yl, xh, yh;
-  char *name, *a1, *b1;
-  char **inst, **inPin, **outPin;
-  int  *bits;
-  int  size;
-  int corner, typ;
-  const char *itemT;
-  char dir;
-  defiPinAntennaModel* aModel;
-  struct defiPoints points;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  switch (c) {
-
-  case defrSiteCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "SITE %s %g %g %s ", site->name(),
-                 site->x_orig(), site->y_orig(),
-                 orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrCanplaceCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "CANPLACE %s %g %g %s ", site->name(),
-                 site->x_orig(), site->y_orig(),
-                 orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrCannotOccupyCbkType : 
-         site = (defiSite*)cl;
-         fprintf(fout, "CANNOTOCCUPY %s %g %g %s ",
-                 site->name(), site->x_orig(),
-                 site->y_orig(), orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrDieAreaCbkType :
-         box = (defiBox*)cl;
-         fprintf(fout, "DIEAREA %d %d %d %d ;\n",
-                 box->xl(), box->yl(), box->xh(),
-                 box->yh());
-         fprintf(fout, "DIEAREA ");
-         points = box->getPoint();
-         for (i = 0; i < points.numPoints; i++)
-           fprintf(fout, "%d %d ", points.x[i], points.y[i]);
-         fprintf(fout, ";\n");
-         break;
-  case defrPinCapCbkType :
-         pc = (defiPinCap*)cl;
-         if (testDebugPrint) {
-             pc->print(fout);
-         } else {
-             fprintf(fout, "MINPINS %d WIRECAP %g ;\n",
-                     pc->pin(), pc->cap());
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END DEFAULTCAP\n");
-         }
-         break;
-  case defrPinCbkType :
-         pin = (defiPin*)cl;
-         if (testDebugPrint) {
-             pin->print(fout);
-         } else {
-             fprintf(fout, "- %s + NET %s ", pin->pinName(),
-                     pin->netName());
-    //         pin->changePinName("pinName");
-    //         fprintf(fout, "%s ", pin->pinName());
-             if (pin->hasDirection())
-                 fprintf(fout, "+ DIRECTION %s ", pin->direction());
-             if (pin->hasUse())
-                 fprintf(fout, "+ USE %s ", pin->use());
-             if (pin->hasNetExpr())
-                 fprintf(fout, "+ NETEXPR \"%s\" ", pin->netExpr());
-             if (pin->hasSupplySensitivity())
-                 fprintf(fout, "+ SUPPLYSENSITIVITY %s ",
-                         pin->supplySensitivity());
-             if (pin->hasGroundSensitivity())
-                 fprintf(fout, "+ GROUNDSENSITIVITY %s ",
-                         pin->groundSensitivity());
-             if (pin->hasLayer()) {
-                 struct defiPoints points;
-                 for (i = 0; i < pin->numLayer(); i++) {
-                    fprintf(fout, "\n  + LAYER %s ", pin->layer(i));
-                    if (pin->layerMask(i)) 
-                        fprintf(fout, "MASK %d ",
-                        pin->layerMask(i));
-                    if (pin->hasLayerSpacing(i))
-                      fprintf(fout, "SPACING %d ",
-                             pin->layerSpacing(i));
-                    if (pin->hasLayerDesignRuleWidth(i))
-                      fprintf(fout, "DESIGNRULEWIDTH %d ",
-                             pin->layerDesignRuleWidth(i));
-                    pin->bounds(i, &xl, &yl, &xh, &yh);
-                    fprintf(fout, "%d %d %d %d ", xl, yl, xh, yh);
-                 }
-                 for (i = 0; i < pin->numPolygons(); i++) {
-                    fprintf(fout, "\n  + POLYGON %s ",
-                            pin->polygonName(i));
-                    if (pin->polygonMask(i))
-                      fprintf(fout, "MASK %d ",
-                              pin->polygonMask(i));
-                    if (pin->hasPolygonSpacing(i))
-                      fprintf(fout, "SPACING %d ",
-                             pin->polygonSpacing(i));
-                    if (pin->hasPolygonDesignRuleWidth(i))
-                      fprintf(fout, "DESIGNRULEWIDTH %d ",
-                             pin->polygonDesignRuleWidth(i));
-                    points = pin->getPolygon(i);
-                    for (j = 0; j < points.numPoints; j++)
-                      fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                 }
-                 for (i = 0; i < pin->numVias(); i++) {
-                     if (pin->viaTopMask(i) || pin->viaCutMask(i) || pin->viaBottomMask(i)) {
-                         fprintf(fout, "\n  + VIA %s MASK %d%d%d %d %d ", 
-                             pin->viaName(i),
-                             pin->viaTopMask(i),
-                             pin->viaCutMask(i),
-                             pin->viaBottomMask(i),
-                             pin->viaPtX(i), 
-                             pin->viaPtY(i));
-                     } else {
-                         fprintf(fout, "\n  + VIA %s %d %d ", pin->viaName(i),
-                                 pin->viaPtX(i), pin->viaPtY(i));
-                     }
-                 }
-             }
-             if (pin->hasPort()) {
-                 struct defiPoints points;
-                 defiPinPort* port;
-                 for (j = 0; j < pin->numPorts(); j++) {
-                    port = pin->pinPort(j);
-                    fprintf(fout, "\n  + PORT");
-                    for (i = 0; i < port->numLayer(); i++) {
-                       fprintf(fout, "\n     + LAYER %s ",
-                               port->layer(i));
-                       if (port->layerMask(i))
-                           fprintf(fout, "MASK %d ",
-                                   port->layerMask(i));
-                       if (port->hasLayerSpacing(i))
-                         fprintf(fout, "SPACING %d ",
-                                 port->layerSpacing(i));
-                       if (port->hasLayerDesignRuleWidth(i))
-                         fprintf(fout, "DESIGNRULEWIDTH %d ",
-                                 port->layerDesignRuleWidth(i));
-                       port->bounds(i, &xl, &yl, &xh, &yh);
-                       fprintf(fout, "%d %d %d %d ", xl, yl, xh, yh);
-                    }
-                    for (i = 0; i < port->numPolygons(); i++) {
-                       fprintf(fout, "\n     + POLYGON %s ",
-                               port->polygonName(i));
-                       if (port->polygonMask(i))
-                         fprintf(fout, "MASK %d ",
-                                 port->polygonMask(i));
-                       if (port->hasPolygonSpacing(i))
-                         fprintf(fout, "SPACING %d ",
-                                port->polygonSpacing(i));
-                       if (port->hasPolygonDesignRuleWidth(i))
-                         fprintf(fout, "DESIGNRULEWIDTH %d ",
-                                port->polygonDesignRuleWidth(i));
-                       points = port->getPolygon(i);
-                       for (k = 0; k < points.numPoints; k++)
-                         fprintf(fout, "( %d %d ) ", points.x[k], points.y[k]);
-                    }
-                    for (i = 0; i < port->numVias(); i++) {
-                        if (port->viaTopMask(i) || port->viaCutMask(i) 
-                            || port->viaBottomMask(i)) {
-                            fprintf(fout, "\n     + VIA %s MASK %d%d%d ( %d %d ) ",
-                                port->viaName(i),
-                                port->viaTopMask(i),
-                                port->viaCutMask(i),
-                                port->viaBottomMask(i),
-                                port->viaPtX(i),
-                                port->viaPtY(i));
-                        } else {
-                            fprintf(fout, "\n     + VIA %s ( %d %d ) ",
-                               port->viaName(i),
-                               port->viaPtX(i),
-                               port->viaPtY(i));
-                        }
-                    }
-                    if (port->hasPlacement()) {
-                       if (port->isPlaced()) {
-                          fprintf(fout, "\n     + PLACED ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                       if (port->isCover()) {
-                          fprintf(fout, "\n     + COVER ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                       if (port->isFixed()) {
-                          fprintf(fout, "\n     + FIXED ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                    }
-                }
-             }
-             if (pin->hasPlacement()) {
-                 if (pin->isPlaced()) {
-                     fprintf(fout, "+ PLACED ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                }
-                 if (pin->isCover()) {
-                     fprintf(fout, "+ COVER ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                 }
-                 if (pin->isFixed()) {
-                     fprintf(fout, "+ FIXED ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                 }
-                 if (pin->isUnplaced())
-                     fprintf(fout, "+ UNPLACED ");
-             }
-             if (pin->hasSpecial()) {
-                 fprintf(fout, "+ SPECIAL ");
-             }
-             if (pin->hasAPinPartialMetalArea()) {
-                 for (i = 0; i < pin->numAPinPartialMetalArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALMETALAREA %d",
-                            pin->APinPartialMetalArea(i));
-                    if (*(pin->APinPartialMetalAreaLayer(i)))
-                        fprintf(fout, " LAYER %s",
-                                pin->APinPartialMetalAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinPartialMetalSideArea()) {
-                 for (i = 0; i < pin->numAPinPartialMetalSideArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALMETALSIDEAREA %d",
-                            pin->APinPartialMetalSideArea(i));
-                    if (*(pin->APinPartialMetalSideAreaLayer(i)))
-                        fprintf(fout, " LAYER %s",
-                            pin->APinPartialMetalSideAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinDiffArea()) {
-                 for (i = 0; i < pin->numAPinDiffArea(); i++) {
-                    fprintf(fout, "ANTENNAPINDIFFAREA %d", pin->APinDiffArea(i));
-                    if (*(pin->APinDiffAreaLayer(i)))
-                        fprintf(fout, " LAYER %s", pin->APinDiffAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinPartialCutArea()) {
-                 for (i = 0; i < pin->numAPinPartialCutArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALCUTAREA %d",
-                            pin->APinPartialCutArea(i));
-                    if (*(pin->APinPartialCutAreaLayer(i)))
-                        fprintf(fout, " LAYER %s", pin->APinPartialCutAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-
-             for (j = 0; j < pin->numAntennaModel(); j++) {
-                aModel = pin->antennaModel(j);
- 
-                fprintf(fout, "ANTENNAMODEL %s\n",
-                        aModel->antennaOxide()); 
- 
-                if (aModel->hasAPinGateArea()) {
-                    for (i = 0; i < aModel->numAPinGateArea();
-                       i++) {
-                       fprintf(fout, "ANTENNAPINGATEAREA %d",
-                               aModel->APinGateArea(i));
-                       if (aModel->hasAPinGateAreaLayer(i))
-                           fprintf(fout, " LAYER %s", aModel->APinGateAreaLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxAreaCar()) {
-                    for (i = 0;
-                       i < aModel->numAPinMaxAreaCar(); i++) {
-                       fprintf(fout, "ANTENNAPINMAXAREACAR %d",
-                               aModel->APinMaxAreaCar(i));
-                       if (aModel->hasAPinMaxAreaCarLayer(i))
-                           fprintf(fout,
-                               " LAYER %s", aModel->APinMaxAreaCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxSideAreaCar()) {
-                    for (i = 0;
-                         i < aModel->numAPinMaxSideAreaCar(); 
-                         i++) {
-                       fprintf(fout, "ANTENNAPINMAXSIDEAREACAR %d",
-                               aModel->APinMaxSideAreaCar(i));
-                       if (aModel->hasAPinMaxSideAreaCarLayer(i))
-                           fprintf(fout,
-                               " LAYER %s", aModel->APinMaxSideAreaCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxCutCar()) {
-                    for (i = 0; i < aModel->numAPinMaxCutCar();
-                       i++) {
-                       fprintf(fout, "ANTENNAPINMAXCUTCAR %d",
-                           aModel->APinMaxCutCar(i));
-                       if (aModel->hasAPinMaxCutCarLayer(i))
-                           fprintf(fout, " LAYER %s",
-                           aModel->APinMaxCutCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-             }
-             fprintf(fout, ";\n");
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END PINS\n");
-         }
-         break;
-  case defrDefaultCapCbkType :
-         i = (long)cl;
-         fprintf(fout, "DEFAULTCAP %d\n", i);
-         numObjs = i;
-         break;
-  case defrRowCbkType :
-         row = (defiRow*)cl;
-         fprintf(fout, "ROW %s %s %g %g %s ", ignoreRowNames ? "XXX" : row->name(),
-                 row->macro(), row->x(), row->y(),
-                 orientStr(row->orient()));
-         if (row->hasDo()) {
-             fprintf(fout, "DO %g BY %g ",
-                     row->xNum(), row->yNum());
-             if (row->hasDoStep())
-                 fprintf(fout, "STEP %g %g ;\n",
-                         row->xStep(), row->yStep());
-             else
-                 fprintf(fout, ";\n");
-         } else
-            fprintf(fout, ";\n");
-         if (row->numProps() > 0) {
-            for (i = 0; i < row->numProps(); i++) {
-                fprintf(fout, "  + PROPERTY %s %s ",
-                        row->propName(i),
-                        row->propValue(i));
-                switch (row->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-            fprintf(fout, ";\n");
-         }
-         break;
-  case defrTrackCbkType :
-         track = (defiTrack*)cl;
-	 if (track->firstTrackMask()) {
-	    if (track->sameMask()) {
-		fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d SAMEMASK LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-	         track->firstTrackMask());
-	    } else {
-		fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-	         track->firstTrackMask());
-	    }
-	 } else {
-	    fprintf(fout, "TRACKS %s %g DO %g STEP %g LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep());
-	 }
-         for (i = 0; i < track->numLayers(); i++)
-            fprintf(fout, "%s ", track->layer(i));
-         fprintf(fout, ";\n"); 
-         break;
-  case defrGcellGridCbkType :
-         gcg = (defiGcellGrid*)cl;
-         fprintf(fout, "GCELLGRID %s %d DO %d STEP %g ;\n",
-                 gcg->macro(), gcg->x(),
-                 gcg->xNum(), gcg->xStep());
-         break;
-  case defrViaCbkType :
-         via = (defiVia*)cl;
-         if (testDebugPrint) {
-             via->print(fout);
-         } else {
-             fprintf(fout, "- %s ", via->name());
-             if (via->hasPattern())
-                 fprintf(fout, "+ PATTERNNAME %s ", via->pattern());
-             for (i = 0; i < via->numLayers(); i++) {
-                 via->layer(i, &name, &xl, &yl, &xh, &yh);
-                 int rectMask = via->rectMask(i);
-
-                 if (rectMask) {
-                     fprintf(fout, "+ RECT %s + MASK %d %d %d %d %d \n",
-                             name, rectMask, xl, yl, xh, yh);
-                 } else {
-                     fprintf(fout, "+ RECT %s %d %d %d %d \n",
-                             name, xl, yl, xh, yh);
-                 }
-             }
-             // POLYGON
-             if (via->numPolygons()) {
-                 struct defiPoints points;
-                 for (i = 0; i < via->numPolygons(); i++) {
-                     int polyMask = via->polyMask(i);
-
-                     if (polyMask) {
-                         fprintf(fout, "\n  + POLYGON %s + MASK %d ", 
-                                 via->polygonName(i), polyMask);
-                     } else {
-                         fprintf(fout, "\n  + POLYGON %s ", via->polygonName(i));
-                     }
-                     points = via->getPolygon(i);
-                     for (j = 0; j < points.numPoints; j++)
-                         fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                 }
-             }
-             fprintf(fout, " ;\n");
-             if (via->hasViaRule()) {
-                 char *vrn, *bl, *cl, *tl;
-                 int xs, ys, xcs, ycs, xbe, ybe, xte, yte;
-                 int cr, cc, xo, yo, xbo, ybo, xto, yto;
-                 (void)via->viaRule(&vrn, &xs, &ys, &bl, &cl, &tl, &xcs,
-                                             &ycs, &xbe, &ybe, &xte, &yte);
-                 fprintf(fout, "+ VIARULE '%s'\n", ignoreViaNames ? "XXX" : vrn);
-                 fprintf(fout, "  + CUTSIZE %d %d\n", xs, ys);
-                 fprintf(fout, "  + LAYERS %s %s %s\n", bl, cl, tl);
-                 fprintf(fout, "  + CUTSPACING %d %d\n", xcs, ycs);
-                 fprintf(fout, "  + ENCLOSURE %d %d %d %d\n", xbe, ybe, xte, yte);
-                 if (via->hasRowCol()) {
-                    (void)via->rowCol(&cr, &cc);
-                    fprintf(fout, "  + ROWCOL %d %d\n", cr, cc);
-                 }
-                 if (via->hasOrigin()) {
-                    (void)via->origin(&xo, &yo);
-                    fprintf(fout, "  + ORIGIN %d %d\n", xo, yo);
-                 }
-                 if (via->hasOffset()) {
-                    (void)via->offset(&xbo, &ybo, &xto, &yto);
-                    fprintf(fout, "  + OFFSET %d %d %d %d\n", xbo, ybo, xto, yto);
-                 }
-                 if (via->hasCutPattern())
-                    fprintf(fout, "  + PATTERN '%s'\n", via->cutPattern());
-             }
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END VIAS\n");
-         }
-         break;
-  case defrRegionCbkType :
-         re = (defiRegion*)cl;
-         fprintf(fout, "- %s ", re->name());
-         for (i = 0; i < re->numRectangles(); i++)
-             fprintf(fout, "%d %d %d %d \n", re->xl(i),
-                     re->yl(i), re->xh(i),
-                     re->yh(i));
-         if (re->hasType())
-             fprintf(fout, "+ TYPE %s\n", re->type());
-         if (re->numProps()) {
-             for (i = 0; i < re->numProps(); i++) {
-                 fprintf(fout, "+ PROPERTY %s %s ", re->propName(i),
-                         re->propValue(i));
-                 switch (re->propType(i)) {
-                    case 'R': fprintf(fout, "REAL ");
-                              break;
-                    case 'I': fprintf(fout, "INTEGER ");
-                              break;
-                    case 'S': fprintf(fout, "STRING ");
-                              break;
-                    case 'Q': fprintf(fout, "QUOTESTRING ");
-                              break;
-                    case 'N': fprintf(fout, "NUMBER ");
-                              break;
-                 }
-             }
-         }
-         fprintf(fout, ";\n"); 
-         --numObjs;
-         if (numObjs <= 0) {
-             fprintf(fout, "END REGIONS\n");
-         }
-         break;
-  case defrGroupNameCbkType :
-         if ((char*)cl) {
-             fprintf(fout, "- %s", (char*)cl);
-         }
-         break;
-  case defrGroupMemberCbkType :
-         if ((char*)cl) {
-             fprintf(fout, " %s", (char*)cl);
-         }
-         break;
-  case defrComponentMaskShiftLayerCbkType :
-	 fprintf(fout, "COMPONENTMASKSHIFT ");
-        
-        for (i = 0; i < maskShiftLayer->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", maskShiftLayer->maskShiftLayer(i));
-        } 
-        fprintf(fout, ";\n");
-	 break;
-  case defrGroupCbkType :
-         group = (defiGroup*)cl;
-         if (group->hasMaxX() | group->hasMaxY()
-             | group->hasPerim()) {
-             fprintf(fout, "\n  + SOFT ");
-             if (group->hasPerim()) 
-                 fprintf(fout, "MAXHALFPERIMETER %d ",
-                         group->perim());
-             if (group->hasMaxX())
-                 fprintf(fout, "MAXX %d ", group->maxX());
-             if (group->hasMaxY()) 
-                 fprintf(fout, "MAXY %d ", group->maxY());
-         } 
-         if (group->hasRegionName())
-             fprintf(fout, "\n  + REGION %s ", group->regionName());
-         if (group->hasRegionBox()) {
-             int *gxl, *gyl, *gxh, *gyh;
-             int size;
-             group->regionRects(&size, &gxl, &gyl, &gxh, &gyh);
-             for (i = 0; i < size; i++)
-                 fprintf(fout, "REGION %d %d %d %d ", gxl[i], gyl[i],
-                         gxh[i], gyh[i]);
-         }
-         if (group->numProps()) {
-             for (i = 0; i < group->numProps(); i++) {
-                 fprintf(fout, "\n  + PROPERTY %s %s ",
-                         group->propName(i),
-                         group->propValue(i));
-                 switch (group->propType(i)) {
-                    case 'R': fprintf(fout, "REAL ");
-                              break;
-                    case 'I': fprintf(fout, "INTEGER ");
-                              break;
-                    case 'S': fprintf(fout, "STRING ");
-                              break;
-                    case 'Q': fprintf(fout, "QUOTESTRING ");
-                              break;
-                    case 'N': fprintf(fout, "NUMBER ");
-                              break;
-                 }
-             }
-         }
-         fprintf(fout, " ;\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END GROUPS\n");
-         break;
-  case defrScanchainCbkType :
-         sc = (defiScanchain*)cl;
-         fprintf(fout, "- %s\n", sc->name());
-         if (sc->hasStart()) {
-             sc->start(&a1, &b1);
-             fprintf(fout, "  + START %s %s\n", a1, b1);
-         }
-         if (sc->hasStop()) {
-             sc->stop(&a1, &b1);
-             fprintf(fout, "  + STOP %s %s\n", a1, b1);
-         }
-         if (sc->hasCommonInPin() ||
-             sc->hasCommonOutPin()) {
-             fprintf(fout, "  + COMMONSCANPINS ");
-             if (sc->hasCommonInPin())
-                fprintf(fout, " ( IN %s ) ", sc->commonInPin());
-             if (sc->hasCommonOutPin())
-                fprintf(fout, " ( OUT %s ) ",sc->commonOutPin());
-             fprintf(fout, "\n");
-         }
-         if (sc->hasFloating()) {
-            sc->floating(&size, &inst, &inPin, &outPin, &bits);
-            if (size > 0)
-                fprintf(fout, "  + FLOATING\n");
-            for (i = 0; i < size; i++) {
-                fprintf(fout, "    %s ", inst[i]);
-                if (inPin[i])
-                   fprintf(fout, "( IN %s ) ", inPin[i]);
-                if (outPin[i])
-                   fprintf(fout, "( OUT %s ) ", outPin[i]);
-                if (bits[i] != -1)
-                   fprintf(fout, "( BITS %d ) ", bits[i]);
-                fprintf(fout, "\n");
-            }
-         }
-
-         if (sc->hasOrdered()) {
-            for (i = 0; i < sc->numOrderedLists(); i++) {
-                sc->ordered(i, &size, &inst, &inPin, &outPin,
-                                           &bits);
-                if (size > 0)
-                    fprintf(fout, "  + ORDERED\n");
-                for (j = 0; j < size; j++) {
-                    fprintf(fout, "    %s ", inst[j]); 
-                    if (inPin[j])
-                       fprintf(fout, "( IN %s ) ", inPin[j]);
-                    if (outPin[j])
-                       fprintf(fout, "( OUT %s ) ", outPin[j]);
-                    if (bits[j] != -1)
-                       fprintf(fout, "( BITS %d ) ", bits[j]);
-                    fprintf(fout, "\n");
-                }
-            }
-         }
-
-         if (sc->hasPartition()) {
-            fprintf(fout, "  + PARTITION %s ",
-                    sc->partitionName());
-            if (sc->hasPartitionMaxBits())
-              fprintf(fout, "MAXBITS %d ",
-                      sc->partitionMaxBits());
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END SCANCHAINS\n");
-         break;
-  case defrIOTimingCbkType :
-         iot = (defiIOTiming*)cl;
-         fprintf(fout, "- ( %s %s )\n", iot->inst(),
-                 iot->pin());
-         if (iot->hasSlewRise())
-             fprintf(fout, "  + RISE SLEWRATE %g %g\n",
-                     iot->slewRiseMin(),
-                     iot->slewRiseMax());
-         if (iot->hasSlewFall())
-             fprintf(fout, "  + FALL SLEWRATE %g %g\n",
-                     iot->slewFallMin(),
-                     iot->slewFallMax());
-         if (iot->hasVariableRise())
-             fprintf(fout, "  + RISE VARIABLE %g %g\n",
-                     iot->variableRiseMin(),
-                     iot->variableRiseMax());
-         if (iot->hasVariableFall())
-             fprintf(fout, "  + FALL VARIABLE %g %g\n",
-                     iot->variableFallMin(),
-                     iot->variableFallMax());
-         if (iot->hasCapacitance())
-             fprintf(fout, "  + CAPACITANCE %g\n",
-                     iot->capacitance());
-         if (iot->hasDriveCell()) {
-             fprintf(fout, "  + DRIVECELL %s ",
-                     iot->driveCell());
-             if (iot->hasFrom())
-                 fprintf(fout, "  FROMPIN %s ",
-                         iot->from());
-             if (iot->hasTo())
-                 fprintf(fout, "  TOPIN %s ",
-                         iot->to());
-             if (iot->hasParallel())
-                 fprintf(fout, "PARALLEL %g",
-                         iot->parallel());
-             fprintf(fout, "\n");
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END IOTIMINGS\n");
-         break;
-  case defrFPCCbkType :
-         fpc = (defiFPC*)cl;
-         fprintf(fout, "- %s ", fpc->name());
-         if (fpc->isVertical())
-             fprintf(fout, "VERTICAL ");
-         if (fpc->isHorizontal())
-             fprintf(fout, "HORIZONTAL ");
-         if (fpc->hasAlign())
-             fprintf(fout, "ALIGN ");
-         if (fpc->hasMax())
-             fprintf(fout, "%g ", fpc->alignMax());
-         if (fpc->hasMin())
-             fprintf(fout, "%g ", fpc->alignMin());
-         if (fpc->hasEqual())
-             fprintf(fout, "%g ", fpc->equal());
-         for (i = 0; i < fpc->numParts(); i++) {
-             fpc->getPart(i, &corner, &typ, &name);
-             if (corner == 'B')
-                 fprintf(fout, "BOTTOMLEFT ");
-             else
-                 fprintf(fout, "TOPRIGHT ");
-             if (typ == 'R')
-                 fprintf(fout, "ROWS %s ", name);
-             else
-                 fprintf(fout, "COMPS %s ", name);
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END FLOORPLANCONSTRAINTS\n");
-         break;
-  case defrTimingDisableCbkType :
-         td = (defiTimingDisable*)cl;
-         if (td->hasFromTo())
-             fprintf(fout, "- FROMPIN %s %s ",
-                     td->fromInst(),
-                     td->fromPin(),
-                     td->toInst(),
-                     td->toPin());
-         if (td->hasThru())
-             fprintf(fout, "- THRUPIN %s %s ",
-                     td->thruInst(),
-                     td->thruPin());
-         if (td->hasMacroFromTo())
-             fprintf(fout, "- MACRO %s FROMPIN %s %s ",
-                     td->macroName(),
-                     td->fromPin(),
-                     td->toPin());
-         if (td->hasMacroThru())
-             fprintf(fout, "- MACRO %s THRUPIN %s %s ",
-                     td->macroName(),
-                     td->fromPin());
-         fprintf(fout, ";\n");
-         break;
-  case defrPartitionCbkType :
-         part = (defiPartition*)cl;
-         fprintf(fout, "- %s ", part->name());
-         if (part->isSetupRise() |
-             part->isSetupFall() |
-             part->isHoldRise() |
-             part->isHoldFall()) {
-             // has turnoff 
-             fprintf(fout, "TURNOFF "); 
-             if (part->isSetupRise())
-                 fprintf(fout, "SETUPRISE "); 
-             if (part->isSetupFall())
-                 fprintf(fout, "SETUPFALL "); 
-             if (part->isHoldRise())
-                 fprintf(fout, "HOLDRISE "); 
-             if (part->isHoldFall())
-                 fprintf(fout, "HOLDFALL "); 
-         }
-         itemT = part->itemType();
-         dir = part->direction();
-         if (strcmp(itemT, "CLOCK") == 0) {
-             if (dir == 'T')    // toclockpin
-                 fprintf(fout, "+ TOCLOCKPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromclockpin
-                 fprintf(fout, "+ FROMCLOCKPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (part->hasMin())
-                 fprintf(fout, "MIN %g %g ",
-                         part->partitionMin(),
-                         part->partitionMax());
-             if (part->hasMax())
-                 fprintf(fout, "MAX %g %g ",
-                         part->partitionMin(),
-                         part->partitionMax());
-             fprintf(fout, "PINS ");
-             for (i = 0; i < part->numPins(); i++)
-                  fprintf(fout, "%s ", part->pin(i));
-         } else if (strcmp(itemT, "IO") == 0) {
-             if (dir == 'T')    // toiopin
-                 fprintf(fout, "+ TOIOPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromiopin
-                 fprintf(fout, "+ FROMIOPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-         } else if (strcmp(itemT, "COMP") == 0) {
-             if (dir == 'T')    // tocomppin
-                 fprintf(fout, "+ TOCOMPPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromcomppin
-                 fprintf(fout, "+ FROMCOMPPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END PARTITIONS\n");
-         break;
-
-  case defrPinPropCbkType :
-         pprop = (defiPinProp*)cl;
-         if (pprop->isPin())
-            fprintf(fout, "- PIN %s ", pprop->pinName());
-         else 
-            fprintf(fout, "- %s %s ",
-                    pprop->instName(),
-                    pprop->pinName());
-         fprintf(fout, ";\n");
-         if (pprop->numProps() > 0) {
-            for (i = 0; i < pprop->numProps(); i++) {
-                fprintf(fout, "  + PROPERTY %s %s ",
-                        pprop->propName(i),
-                        pprop->propValue(i));
-                switch (pprop->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-            fprintf(fout, ";\n");
-         }
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END PINPROPERTIES\n");
-         break;
-  case defrBlockageCbkType :
-         block = (defiBlockage*)cl;
-         if (testDebugPrint) {
-             block->print(fout);
-         } else {
-             if (block->hasLayer()) {
-                fprintf(fout, "- LAYER %s\n", block->layerName());
-                if (block->hasComponent())
-                   fprintf(fout, "   + COMPONENT %s\n",
-                           block->layerComponentName());
-                if (block->hasSlots())
-                   fprintf(fout, "   + SLOTS\n");
-                if (block->hasFills())
-                   fprintf(fout, "   + FILLS\n");
-                if (block->hasPushdown())
-                   fprintf(fout, "   + PUSHDOWN\n");
-                if (block->hasExceptpgnet())
-                   fprintf(fout, "   + EXCEPTPGNET\n");
-                if (block->hasMask())
-                   fprintf(fout, "   + MASK %d\n", block->mask());
-                if (block->hasSpacing())
-                   fprintf(fout, "   + SPACING %d\n",
-                           block->minSpacing());
-                if (block->hasDesignRuleWidth())
-                   fprintf(fout, "   + DESIGNRULEWIDTH %d\n",
-                           block->designRuleWidth());
-             }
-             else if (block->hasPlacement()) {
-                fprintf(fout, "- PLACEMENT\n");
-                if (block->hasSoft())
-                   fprintf(fout, "   + SOFT\n");
-                if (block->hasPartial())
-                   fprintf(fout, "   + PARTIAL %g\n",
-                           block->placementMaxDensity());
-                if (block->hasComponent())
-                   fprintf(fout, "   + COMPONENT %s\n",
-                           block->placementComponentName());
-                if (block->hasPushdown())
-                   fprintf(fout, "   + PUSHDOWN\n");
-             }
-
-             for (i = 0; i < block->numRectangles(); i++) {
-                fprintf(fout, "   RECT %d %d %d %d\n", 
-                        block->xl(i), block->yl(i),
-                        block->xh(i), block->yh(i));
-             } 
-
-             for (i = 0; i < block->numPolygons(); i++) {
-                fprintf(fout, "   POLYGON ");
-                points = block->getPolygon(i);
-                for (j = 0; j < points.numPoints; j++)
-                   fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                fprintf(fout, "\n");
-             }
-             fprintf(fout, ";\n");
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END BLOCKAGES\n");
-         }
-         break;
-  case defrSlotCbkType :
-         slots = (defiSlot*)cl;
-         if (slots->hasLayer())
-            fprintf(fout, "- LAYER %s\n", slots->layerName());
-
-         for (i = 0; i < slots->numRectangles(); i++) {
-            fprintf(fout, "   RECT %d %d %d %d\n", 
-                    slots->xl(i), slots->yl(i),
-                    slots->xh(i), slots->yh(i));
-         } 
-         for (i = 0; i < slots->numPolygons(); i++) {
-            fprintf(fout, "   POLYGON ");
-            points = slots->getPolygon(i);
-            for (j = 0; j < points.numPoints; j++)
-              fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-            fprintf(fout, ";\n");
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END SLOTS\n");
-         break;
-  case defrFillCbkType :
-         fills = (defiFill*)cl;
-         if (testDebugPrint) {
-              fills->print(fout);
-         } else {
-             if (fills->hasLayer()) {
-                fprintf(fout, "- LAYER %s", fills->layerName());
-                if (fills->layerMask()) {
-                    fprintf(fout, " + MASK %d", fills->layerMask());
-                }
-                if (fills->hasLayerOpc())
-                   fprintf(fout, " + OPC");
-                fprintf(fout, "\n");
-
-                for (i = 0; i < fills->numRectangles(); i++) {
-                   fprintf(fout, "   RECT %d %d %d %d\n", 
-                           fills->xl(i), fills->yl(i),
-                           fills->xh(i), fills->yh(i));
-                } 
-                for (i = 0; i < fills->numPolygons(); i++) {
-                   fprintf(fout, "   POLYGON "); 
-                   points = fills->getPolygon(i);
-                   for (j = 0; j < points.numPoints; j++)
-                     fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                   fprintf(fout, ";\n");
-                } 
-                fprintf(fout, ";\n");
-             }
-             --numObjs;
-             if (fills->hasVia()) {
-                fprintf(fout, "- VIA %s", fills->viaName());
-                if (fills->viaTopMask() || fills->viaCutMask()
-                    || fills->viaBottomMask()) {
-                    fprintf(fout, " + MASK %d%d%d", 
-                    fills->viaTopMask(),
-                           fills->viaCutMask(),
-                           fills->viaBottomMask());
-                }
-                if (fills->hasViaOpc())
-                   fprintf(fout, " + OPC");
-                fprintf(fout, "\n");
-
-                for (i = 0; i < fills->numViaPts(); i++) {
-                   points = fills->getViaPts(i);
-                   for (j = 0; j < points.numPoints; j++)
-                      fprintf(fout, " %d %d", points.x[j], points.y[j]);
-                   fprintf(fout, ";\n"); 
-                }
-                fprintf(fout, ";\n");
-             }
-             if (numObjs <= 0)
-                 fprintf(fout, "END FILLS\n");
-         }
-         break;
-  case defrStylesCbkType :
-         struct defiPoints points;
-         styles = (defiStyles*)cl;
-         fprintf(fout, "- STYLE %d ", styles->style());
-         points = styles->getPolygon();
-         for (j = 0; j < points.numPoints; j++)
-            fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END STYLES\n");
-         break;
-
-  default: fprintf(fout, "BOGUS callback to cls.\n"); return 1;
-  }
-  return 0;
-}
-
-
-int dn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DIVIDERCHAR \"%s\" ;\n",h);
-  return 0;
-}
-
-
-int ext(defrCallbackType_e t, const char* c, defiUserData ud) {
-  char* name;
-
-  checkType(t);
-  if (ud != userData) dataError();
-
-  switch (t) {
-  case defrNetExtCbkType : name = address("net"); break;
-  case defrComponentExtCbkType : name = address("component"); break;
-  case defrPinExtCbkType : name = address("pin"); break;
-  case defrViaExtCbkType : name = address("via"); break;
-  case defrNetConnectionExtCbkType : name = address("net connection"); break;
-  case defrGroupExtCbkType : name = address("group"); break;
-  case defrScanChainExtCbkType : name = address("scanchain"); break;
-  case defrIoTimingsExtCbkType : name = address("io timing"); break;
-  case defrPartitionsExtCbkType : name = address("partition"); break;
-  default: name = address("BOGUS"); return 1;
-  }
-  fprintf(fout, "  %s extension %s\n", name, c);
-  return 0;
-}
-
-int extension(defrCallbackType_e c, const char* extsn, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "BEGINEXT %s\n", extsn);
-  return 0;
-}
-
-void* mallocCB(size_t size) {
-  return malloc(size);
-}
-
-void* reallocCB(void* name, size_t size) {
-  return realloc(name, size);
-}
-
-void freeCB(void* name) {
-  free(name);
-  return;
-}
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-extern long long nlines;
-END_LEFDEF_PARSER_NAMESPACE
-static int ccr1131444 = 0;
-
-void lineNumberCB(long long lineNo) {
-
-    // The CCR 1131444 tests ability of the DEF parser to count 
-    // input line numbers out of 32-bit int range. On the first callback 
-    // call 10G lines will be added to line counter. It should be 
-    // reflected in output.
-    if (ccr1131444) {
-        lineNo += 10000000000LL;
-        defrSetNLines(lineNo);
-        ccr1131444 = 0;
-    }
-
-#ifdef _WIN32
-  fprintf(fout, "Parsed %I64d number of lines!!\n", lineNo);
-#else 
-  fprintf(fout, "Parsed %lld number of lines!!\n", lineNo);
-#endif
-}
-
-int unUsedCB(defrCallbackType_e, void*, defiUserData) {
-  fprintf(fout, "This callback is not used.\n");
-  return 0;
-}
-
-void printWarning(const char *str)
-{
-    fprintf(stderr, "%s\n", str);
-}
-
-int main(int argc, char** argv) {
-  int num = 99;
-  char* inFile[6];
-  char* outFile;
-  FILE* f;
-  int res;
-  int noCalls = 0;
-//  long start_mem;
-  int retStr = 0;
-  int numInFile = 0;
-  int fileCt = 0;
-  int test1 = 0;
-  int test2 = 0;
-  int noNetCb = 0;
-  int ccr749853 = 0;
-  int line_num_print_interval = 50;
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-//  start_mem = (long)sbrk(0);
-
-  strcpy(defaultName, "def.in");
-  strcpy(defaultOut, "list");
-  inFile[0] = defaultName;
-  outFile = defaultOut;
-  fout = stdout;
-  userData = (void*) 0x01020304;
-  argc--;
-  argv++;
-
-  if (argc == 0) {
-    fprintf(stderr, "Type 'defrw --help' for the help.\n");
-    return 2;
-  }
-
-  while (argc--) {
-    if (strcmp(*argv, "-d") == 0) {
-      argv++;
-      argc--;
-      sscanf(*argv, "%d", &num);
-      defiSetDebug(num, 1);
-    } else if (strcmp(*argv, "-nc") == 0) {
-      noCalls = 1;
-    } else if (strcmp(*argv, "-o") == 0) {
-      argv++;
-      argc--;
-      outFile = *argv;
-      if ((fout = fopen(outFile, "w")) == 0) {
-	        fprintf(stderr, "ERROR: could not open output file\n");
-	        return 2;
-        }
-    } else if (strcmp(*argv, "-verStr") == 0) {
-        /* New to set the version callback routine to return a string    */
-        /* instead of double.                                            */
-        retStr = 1;
-    } else if (strcmp(*argv, "-i") == 0) {
-        argv++;
-        argc--;
-        line_num_print_interval = atoi(*argv);
-    } else if (strcmp(*argv, "-test1") == 0) {
-      test1 = 1;
-    } else if (strcmp(*argv, "-test2") == 0) {
-      test2 = 1;
-    } else if (strcmp(*argv, "-noNet") == 0) {
-      noNetCb = 1;
-    } else if (strcmp(*argv, "-ccr749853") == 0) {
-      ccr749853 = 1;
-    } else if (strcmp(*argv, "-ccr1131444") == 0) {
-        ccr1131444 = 1;
-    } else if (strcmp(*argv, "-testDebugPrint") == 0) {
-        testDebugPrint = 1;
-    } else if (strcmp(*argv, "-sessionless") == 0) {
-        isSessionless = 1;
-    } else if (strcmp(*argv, "-ignoreRowNames") == 0) {
-        ignoreRowNames = 1;
-	} else if (strcmp(*argv, "-ignoreViaNames") == 0) {
-        ignoreViaNames = 1;
-	} else if (argv[0][0] != '-') {
-      if (numInFile >= 6) {
-        fprintf(stderr, "ERROR: too many input files, max = 6.\n");
-        return 2;
-      }
-      inFile[numInFile++] = *argv;
-    } else if ((strcmp(*argv, "-h") == 0) || (strcmp(*argv, "--help") == 0)) {
-      fprintf(stderr, "Usage: defrw (<option>|<file>)* \n");
-      fprintf(stderr, "Files:\n");
-      fprintf(stderr, "\tupto 6 DEF files many be supplied.\n");
-      fprintf(stderr, "\tif <defFileName> is set to 'STDIN' - takes data from stdin.\n");
-      fprintf(stderr, "Options:\n");
-      fprintf(stderr, "\t-i <num_lines> -- sets processing msg interval (default: 50 lines).\n");
-      fprintf(stderr, "\t-nc            -- no functional callbacks will be called.\n");
-      fprintf(stderr, "\t-o <out_file>  -- write output to the file.\n");
-      fprintf(stderr, "\t-ignoreRowNames   -- don't output row names.\n");
-      fprintf(stderr, "\t-ignoreViaNames   -- don't output via names.\n");
-      return 2;
-    } else if (strcmp(*argv, "-setSNetWireCbk") == 0) {
-      setSNetWireCbk = 1;
-    } else {
-      fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-      return 2;
-    }
-
-    argv++;
-  }
-
-  //defrSetLogFunction(myLogFunction);
-  //defrSetWarningLogFunction(myWarningLogFunction);
-
-  if (isSessionless) {
-      defrInitSession(0);
-	  defrSetLongLineNumberFunction(lineNumberCB);
-	  defrSetDeltaNumberLines(line_num_print_interval);
-  }
-
-  defrInitSession(isSessionless ? 0 : 1);
-
-  if (noCalls == 0) {
-
-    defrSetWarningLogFunction(printWarning);
-
-
-    defrSetUserData((void*)3);
-    defrSetDesignCbk(dname);
-    defrSetTechnologyCbk(tname);
-    defrSetExtensionCbk(extension);
-    defrSetDesignEndCbk(done);
-    defrSetPropDefStartCbk(propstart);
-    defrSetPropCbk(prop);
-    defrSetPropDefEndCbk(propend);
-    /* Test for CCR 766289*/
-    if (!noNetCb)
-      defrSetNetCbk(netf);
-    defrSetNetNameCbk(netNamef);
-    defrSetNetNonDefaultRuleCbk(nondefRulef);
-    defrSetNetSubnetNameCbk(subnetNamef);
-    defrSetNetPartialPathCbk(netpath);
-    defrSetSNetCbk(snetf);
-    defrSetSNetPartialPathCbk(snetpath);
-    if (setSNetWireCbk)
-      defrSetSNetWireCbk(snetwire);
-    defrSetComponentMaskShiftLayerCbk(compMSL);
-    defrSetComponentCbk(compf);
-    defrSetAddPathToNet();
-    defrSetHistoryCbk(hist);
-    defrSetConstraintCbk(constraint);
-    defrSetAssertionCbk(constraint);
-    defrSetArrayNameCbk(an);
-    defrSetFloorPlanNameCbk(fn);
-    defrSetDividerCbk(dn);
-    defrSetBusBitCbk(bbn);
-    defrSetNonDefaultCbk(ndr);
-
-    defrSetAssertionsStartCbk(constraintst);
-    defrSetConstraintsStartCbk(constraintst);
-    defrSetComponentStartCbk(cs);
-    defrSetPinPropStartCbk(cs);
-    defrSetNetStartCbk(cs);
-    defrSetStartPinsCbk(cs);
-    defrSetViaStartCbk(cs);
-    defrSetRegionStartCbk(cs);
-    defrSetSNetStartCbk(cs);
-    defrSetGroupsStartCbk(cs);
-    defrSetScanchainsStartCbk(cs);
-    defrSetIOTimingsStartCbk(cs);
-    defrSetFPCStartCbk(cs);
-    defrSetTimingDisablesStartCbk(cs);
-    defrSetPartitionsStartCbk(cs);
-    defrSetBlockageStartCbk(cs);
-    defrSetSlotStartCbk(cs);
-    defrSetFillStartCbk(cs);
-    defrSetNonDefaultStartCbk(cs);
-    defrSetStylesStartCbk(cs);
-
-    // All of the extensions point to the same function.
-    defrSetNetExtCbk(ext);
-    defrSetComponentExtCbk(ext);
-    defrSetPinExtCbk(ext);
-    defrSetViaExtCbk(ext);
-    defrSetNetConnectionExtCbk(ext);
-    defrSetGroupExtCbk(ext);
-    defrSetScanChainExtCbk(ext);
-    defrSetIoTimingsExtCbk(ext);
-    defrSetPartitionsExtCbk(ext);
-
-    defrSetUnitsCbk(units);
-    if (!retStr)
-       defrSetVersionCbk(vers);
-    else
-       defrSetVersionStrCbk(versStr);
-    defrSetCaseSensitiveCbk(casesens);
-
-    // The following calls are an example of using one function "cls"
-    // to be the callback for many DIFFERENT types of constructs.
-    // We have to cast the function type to meet the requirements
-    // of each different set function.
-    defrSetSiteCbk((defrSiteCbkFnType)cls);
-    defrSetCanplaceCbk((defrSiteCbkFnType)cls);
-    defrSetCannotOccupyCbk((defrSiteCbkFnType)cls);
-    defrSetDieAreaCbk((defrBoxCbkFnType)cls);
-    defrSetPinCapCbk((defrPinCapCbkFnType)cls);
-    defrSetPinCbk((defrPinCbkFnType)cls);
-    defrSetPinPropCbk((defrPinPropCbkFnType)cls);
-    defrSetDefaultCapCbk((defrIntegerCbkFnType)cls);
-    defrSetRowCbk((defrRowCbkFnType)cls);
-    defrSetTrackCbk((defrTrackCbkFnType)cls);
-    defrSetGcellGridCbk((defrGcellGridCbkFnType)cls);
-    defrSetViaCbk((defrViaCbkFnType)cls);
-    defrSetRegionCbk((defrRegionCbkFnType)cls);
-    defrSetGroupNameCbk((defrStringCbkFnType)cls);
-    defrSetGroupMemberCbk((defrStringCbkFnType)cls);
-    defrSetGroupCbk((defrGroupCbkFnType)cls);
-    defrSetScanchainCbk((defrScanchainCbkFnType)cls);
-    defrSetIOTimingCbk((defrIOTimingCbkFnType)cls);
-    defrSetFPCCbk((defrFPCCbkFnType)cls);
-    defrSetTimingDisableCbk((defrTimingDisableCbkFnType)cls);
-    defrSetPartitionCbk((defrPartitionCbkFnType)cls);
-    defrSetBlockageCbk((defrBlockageCbkFnType)cls);
-    defrSetSlotCbk((defrSlotCbkFnType)cls);
-    defrSetFillCbk((defrFillCbkFnType)cls);
-    defrSetStylesCbk((defrStylesCbkFnType)cls);
-
-    defrSetAssertionsEndCbk(endfunc);
-    defrSetComponentEndCbk(endfunc);
-    defrSetConstraintsEndCbk(endfunc);
-    defrSetNetEndCbk(endfunc);
-    defrSetFPCEndCbk(endfunc);
-    defrSetFPCEndCbk(endfunc);
-    defrSetGroupsEndCbk(endfunc);
-    defrSetIOTimingsEndCbk(endfunc);
-    defrSetNetEndCbk(endfunc);
-    defrSetPartitionsEndCbk(endfunc);
-    defrSetRegionEndCbk(endfunc);
-    defrSetSNetEndCbk(endfunc);
-    defrSetScanchainsEndCbk(endfunc);
-    defrSetPinEndCbk(endfunc);
-    defrSetTimingDisablesEndCbk(endfunc);
-    defrSetViaEndCbk(endfunc);
-    defrSetPinPropEndCbk(endfunc);
-    defrSetBlockageEndCbk(endfunc);
-    defrSetSlotEndCbk(endfunc);
-    defrSetFillEndCbk(endfunc);
-    defrSetNonDefaultEndCbk(endfunc);
-    defrSetStylesEndCbk(endfunc);
-
-    defrSetMallocFunction(mallocCB);
-    defrSetReallocFunction(reallocCB);
-    defrSetFreeFunction(freeCB);
-
-    //defrSetRegisterUnusedCallbacks();
-
-    // Testing to set the number of warnings
-    defrSetAssertionWarnings(3);
-    defrSetBlockageWarnings(3);
-    defrSetCaseSensitiveWarnings(3);
-    defrSetComponentWarnings(3);
-    defrSetConstraintWarnings(0);
-    defrSetDefaultCapWarnings(3);
-    defrSetGcellGridWarnings(3);
-    defrSetIOTimingWarnings(3);
-    defrSetNetWarnings(3);
-    defrSetNonDefaultWarnings(3);
-    defrSetPinExtWarnings(3);
-    defrSetPinWarnings(3);
-    defrSetRegionWarnings(3);
-    defrSetRowWarnings(3);
-    defrSetScanchainWarnings(3);
-    defrSetSNetWarnings(3);
-    defrSetStylesWarnings(3);
-    defrSetTrackWarnings(3);
-    defrSetUnitsWarnings(3);
-    defrSetVersionWarnings(3);
-    defrSetViaWarnings(3);
-  }
-
-  if (! isSessionless) {
-	  defrSetLongLineNumberFunction(lineNumberCB);
-	  defrSetDeltaNumberLines(line_num_print_interval);
-  }
-
-  (void) defrSetOpenLogFileAppend();
-
-  if (ccr749853) {
-    defrSetTotalMsgLimit (5);
-    defrSetLimitPerMsg (6008, 2);
-
-  } 
-
-  if (test1) {  // for special tests
-     for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if ((f = fopen(inFile[fileCt],"r")) == 0) {
-         fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-         return(2);
-       }
-       // Set case sensitive to 0 to start with, in History & PropertyDefinition
-       // reset it to 1.
-       res = defrRead(f, inFile[fileCt], userData, 1);
-
-       if (res)
-          fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-       (void)defrUnsetNonDefaultCbk(); 
-       (void)defrUnsetNonDefaultStartCbk(); 
-       (void)defrUnsetNonDefaultEndCbk(); 
-     }
-  }
-  else if (test2) {  // for special tests
-    // this test is design to test the 3 APIs, defrDisableParserMsgs,
-    // defrEnableParserMsgs & defrEnableAllMsgs
-    // It uses the file ccr523879.def.  This file will parser 3 times
-    // 1st it will have defrDisableParserMsgs set to both 7010 & 7016
-    // 2nd will enable 7016 by calling defrEnableParserMsgs
-    // 3rd enable all msgs by call defrEnableAllMsgs
-
-    int nMsgs = 2;
-    int dMsgs[2];
-
-    for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if (fileCt == 0) {
-          dMsgs[0] = 7010;
-          dMsgs[1] = 7016;
-          defrDisableParserMsgs (2, (int*)dMsgs);
-       } else if (fileCt == 1) {
-          dMsgs[0] = 7016;
-          defrEnableParserMsgs (1, (int*)dMsgs);
-       } else
-          defrEnableAllMsgs();
- 
-       if ((f = fopen(inFile[fileCt],"r")) == 0) {
-         fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-         return(2);
-       }
- 
-       res = defrRead(f, inFile[fileCt], userData, 1);
- 
-       if (res)
-          fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
- 
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-       (void)defrUnsetNonDefaultCbk();
-       (void)defrUnsetNonDefaultStartCbk();
-       (void)defrUnsetNonDefaultEndCbk();
-    }
-  } else {
-     for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if (strcmp(inFile[fileCt], "STDIN") == 0) {
-            f = stdin;
-       } else if ((f = fopen(inFile[fileCt],"r")) == 0) {
-             fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-             return(2);
-       }
-       // Set case sensitive to 0 to start with, in History & PropertyDefinition
-       // reset it to 1.
-
-       res = defrRead(f, inFile[fileCt], userData, 1);
-
-       if (res)
-           fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-       // Testing the aliases API.
-       defrAddAlias ("alias1", "aliasValue1", 1);
-
-       defiAlias_itr aliasStore;
-       const char    *alias1Value = NULL;
-
-       while (aliasStore.Next()) {
-           if (strcmp(aliasStore.Key(), "alias1") == 0) {
-                alias1Value = aliasStore.Data();
-           }
-       } 
-
-       if (!alias1Value || strcmp(alias1Value, "aliasValue1")) {
-             fprintf(stderr, "ERROR: Aliases don't work\n");
-       }
-
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-    }
-    (void)defrUnsetCallbacks();
-    (void)defrSetUnusedCallbacks(unUsedCB);
-  }
-
-  // Unset all the callbacks
-  defrUnsetArrayNameCbk ();
-  defrUnsetAssertionCbk ();
-  defrUnsetAssertionsStartCbk ();
-  defrUnsetAssertionsEndCbk ();
-  defrUnsetBlockageCbk ();
-  defrUnsetBlockageStartCbk ();
-  defrUnsetBlockageEndCbk ();
-  defrUnsetBusBitCbk ();
-  defrUnsetCannotOccupyCbk ();
-  defrUnsetCanplaceCbk ();
-  defrUnsetCaseSensitiveCbk ();
-  defrUnsetComponentCbk ();
-  defrUnsetComponentExtCbk ();
-  defrUnsetComponentStartCbk ();
-  defrUnsetComponentEndCbk ();
-  defrUnsetConstraintCbk ();
-  defrUnsetConstraintsStartCbk ();
-  defrUnsetConstraintsEndCbk ();
-  defrUnsetDefaultCapCbk ();
-  defrUnsetDesignCbk ();
-  defrUnsetDesignEndCbk ();
-  defrUnsetDieAreaCbk ();
-  defrUnsetDividerCbk ();
-  defrUnsetExtensionCbk ();
-  defrUnsetFillCbk ();
-  defrUnsetFillStartCbk ();
-  defrUnsetFillEndCbk ();
-  defrUnsetFPCCbk ();
-  defrUnsetFPCStartCbk ();
-  defrUnsetFPCEndCbk ();
-  defrUnsetFloorPlanNameCbk ();
-  defrUnsetGcellGridCbk ();
-  defrUnsetGroupCbk ();
-  defrUnsetGroupExtCbk ();
-  defrUnsetGroupMemberCbk ();
-  defrUnsetComponentMaskShiftLayerCbk ();
-  defrUnsetGroupNameCbk ();
-  defrUnsetGroupsStartCbk ();
-  defrUnsetGroupsEndCbk ();
-  defrUnsetHistoryCbk ();
-  defrUnsetIOTimingCbk ();
-  defrUnsetIOTimingsStartCbk ();
-  defrUnsetIOTimingsEndCbk ();
-  defrUnsetIOTimingsExtCbk ();
-  defrUnsetNetCbk ();
-  defrUnsetNetNameCbk ();
-  defrUnsetNetNonDefaultRuleCbk ();
-  defrUnsetNetConnectionExtCbk ();
-  defrUnsetNetExtCbk ();
-  defrUnsetNetPartialPathCbk ();
-  defrUnsetNetSubnetNameCbk ();
-  defrUnsetNetStartCbk ();
-  defrUnsetNetEndCbk ();
-  defrUnsetNonDefaultCbk ();
-  defrUnsetNonDefaultStartCbk ();
-  defrUnsetNonDefaultEndCbk ();
-  defrUnsetPartitionCbk ();
-  defrUnsetPartitionsExtCbk ();
-  defrUnsetPartitionsStartCbk ();
-  defrUnsetPartitionsEndCbk ();
-  defrUnsetPathCbk ();
-  defrUnsetPinCapCbk ();
-  defrUnsetPinCbk ();
-  defrUnsetPinEndCbk ();
-  defrUnsetPinExtCbk ();
-  defrUnsetPinPropCbk ();
-  defrUnsetPinPropStartCbk ();
-  defrUnsetPinPropEndCbk ();
-  defrUnsetPropCbk ();
-  defrUnsetPropDefEndCbk ();
-  defrUnsetPropDefStartCbk ();
-  defrUnsetRegionCbk ();
-  defrUnsetRegionStartCbk ();
-  defrUnsetRegionEndCbk ();
-  defrUnsetRowCbk ();
-  defrUnsetScanChainExtCbk ();
-  defrUnsetScanchainCbk ();
-  defrUnsetScanchainsStartCbk ();
-  defrUnsetScanchainsEndCbk ();
-  defrUnsetSiteCbk ();
-  defrUnsetSlotCbk ();
-  defrUnsetSlotStartCbk ();
-  defrUnsetSlotEndCbk ();
-  defrUnsetSNetWireCbk ();
-  defrUnsetSNetCbk ();
-  defrUnsetSNetStartCbk ();
-  defrUnsetSNetEndCbk ();
-  defrUnsetSNetPartialPathCbk ();
-  defrUnsetStartPinsCbk ();
-  defrUnsetStylesCbk ();
-  defrUnsetStylesStartCbk ();
-  defrUnsetStylesEndCbk ();
-  defrUnsetTechnologyCbk ();
-  defrUnsetTimingDisableCbk ();
-  defrUnsetTimingDisablesStartCbk ();
-  defrUnsetTimingDisablesEndCbk ();
-  defrUnsetTrackCbk ();
-  defrUnsetUnitsCbk ();
-  defrUnsetVersionCbk ();
-  defrUnsetVersionStrCbk ();
-  defrUnsetViaCbk ();
-  defrUnsetViaExtCbk ();
-  defrUnsetViaStartCbk ();
-  defrUnsetViaEndCbk ();
-
-  fclose(fout);
-
-  // Release allocated singleton data.
-  defrClear();
-
-  return res;
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwrite.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwrite.cpp
deleted file mode 100644
index d5e8872..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwrite.cpp
+++ /dev/null
@@ -1,2294 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "defwWriter.hpp"
- 
-char defaultOut[128];
- 
-// Global variables
-FILE* fout;
- 
-#define CHECK_STATUS(status) \
-  if (status) {              \
-     defwPrintError(status); \
-     return(status);         \
-  }
- 
-int main(int argc, char** argv) {
-  char* outfile;
-  int   status;    // return code, if none 0 means error
-  int   lineNumber = 0;
-
-  const char** layers;
-  const char** foreigns;
-  const char** shiftLayers;
-  int *foreignX, *foreignY, *foreignOrient;
-  const char** foreignOrientStr;
-  double *coorX, *coorY;
-  double *coorValue;
-  const char **groupExpr;
-  int *xPoints, *yPoints;
-  double *xP, *yP;
-  const char** coorXSN, **coorYSN;
-  bool groupInit = false;
- 
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-  // assign the default
-  strcpy(defaultOut, "def.in");
-  outfile = defaultOut;
-  fout = stdout;
- 
-  argc--;
-  argv++;
-  while (argc--) {
-     if (strcmp(*argv, "-o") == 0) {   // output filename
-        argv++;
-        argc--;
-        outfile = *argv;
-        if ((fout = fopen(outfile, "w")) == 0) {
-           fprintf(stderr, "ERROR: could not open output file\n");
-           return 2;
-        }
-     } else if (strncmp(*argv,  "-h", 2) == 0) {  // compare with -h[elp]
-        fprintf(stderr, "Usage: defwrite [-o <filename>] [-help]\n");
-        return 1;
-     } else if (strncmp(*argv,  "-g", 2) == 0) {  // test of group init function.
-            groupInit = 1;
-     } else {
-        fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-        return 2;
-     }
-     argv++;
-  }
-
-  if (!groupInit) {
-      status = defwInitCbk(fout);
-      CHECK_STATUS(status);
-      status = defwVersion (5, 8);
-      CHECK_STATUS(status);
-      status = defwDividerChar(":");
-      CHECK_STATUS(status);
-      status = defwBusBitChars("[]");
-      CHECK_STATUS(status);
-      status = defwDesignName("muk");
-      CHECK_STATUS(status);
-      status = defwTechnology("muk");
-      CHECK_STATUS(status);
-      status = defwArray("core_array");
-      CHECK_STATUS(status);
-      status = defwFloorplan("DEFAULT");
-      CHECK_STATUS(status);
-      status = defwUnits(100);
-      CHECK_STATUS(status);
-  } else {
-      // initalize
-      status = defwInit(fout, 5, 8, "ON", ":", "[]", "muk", "muk", "core_array",
-                        "DEFAULT", 100);
-      CHECK_STATUS(status);
-  }
-
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // history
-  status = defwHistory("Corrected STEP for ROW_9 and added ROW_10 of SITE CORE1 (def)");
-  CHECK_STATUS(status);
-  status = defwHistory("Removed NONDEFAULTRULE from the net XX100 (def)");
-  CHECK_STATUS(status);
-  status = defwHistory("Changed some cell orientations (def)");
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // FILLS (add another FILLS is here for CCR 746462
-  xP = (double*)malloc(sizeof(double)*7);
-  yP = (double*)malloc(sizeof(double)*7);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-  xP[6] = 8.1;
-  yP[6] = 8.1;
-  status = defwStartFills(5);
-  CHECK_STATUS(status);
-  status = defwFillLayer("MET1");
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(5, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillRect(2000, 2000, 2500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillRect(3000, 2000, 3500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillLayer("MET2");
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 4500, 1500, 6500);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 7000, 1500, 9000);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 9500, 1500, 11500);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillLayer("metal1");
-  CHECK_STATUS(status);
-  status = defwFillLayerMask(1);
-  CHECK_STATUS(status);
-  status = defwFillLayerOPC();
-  CHECK_STATUS(status);
-  status = defwFillRect(100, 200, 150, 400);
-  CHECK_STATUS(status);
-  status = defwFillRect(300, 200, 350, 400);
-  CHECK_STATUS(status);
-  status = defwFillVia("via28");
-  CHECK_STATUS(status);
-  status = defwFillViaMask(2);
-  CHECK_STATUS(status);
-  status = defwFillViaOPC();
-  CHECK_STATUS(status);
-  status = defwFillPoints(1, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillVia("via26");
-  CHECK_STATUS(status);
-  status = defwFillPoints(3, xP, yP);
-  CHECK_STATUS(status);
-  status = defwEndFills();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-
-  // PROPERTYDEFINITIONS
-  status = defwStartPropDef();
-  CHECK_STATUS(status);
-  defwAddComment("defwPropDef is broken into 3 routines, defwStringPropDef");
-  defwAddComment("defwIntPropDef, and defwRealPropDef");
-  status = defwStringPropDef("REGION", "scum", 0, 0, 0 );
-  CHECK_STATUS(status);
-  status = defwIntPropDef("REGION", "center", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("REGION", "area", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("GROUP", "ggrp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("GROUP", "site", 0, 25, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("GROUP", "maxarea", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("COMPONENT", "cc", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("COMPONENT", "index", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("COMPONENT", "size", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("NET", "alt", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("NET", "lastName", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NET", "length", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("SPECIALNET", "contype", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("SPECIALNET", "ind", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("SPECIALNET", "maxlength", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("DESIGN", "title", 0, 0, "Buffer");
-  CHECK_STATUS(status);
-  status = defwIntPropDef("DESIGN", "priority", 0, 0, 14);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("DESIGN", "howbig", 0, 0, 15.16);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("ROW", "firstName", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("ROW", "idx", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NET", "FREQUENCY", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("NONDEFAULTRULE", "ndprop1", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("NONDEFAULTRULE", "ndprop2", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NONDEFAULTRULE", "ndprop3", 0, 0, 0.009);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NONDEFAULTRULE", "ndprop4", .1, 1.0, 0);
-  CHECK_STATUS(status);
-  status = defwEndPropDef();
-  CHECK_STATUS(status);
-
-  // DIEAREA
-/*
-  status = defwDieArea(-190000, -120000, 190000, 70000);
-  CHECK_STATUS(status);
-*/
-  xPoints = (int*)malloc(sizeof(int)*6);
-  yPoints = (int*)malloc(sizeof(int)*6);
-  xPoints[0] = 2000;
-  yPoints[0] = 2000;
-  xPoints[1] = 3000;
-  yPoints[1] = 3000;
-  xPoints[2] = 4000;
-  yPoints[2] = 4000;
-  xPoints[3] = 5000;
-  yPoints[3] = 5000;
-  xPoints[4] = 6000;
-  yPoints[4] = 6000;
-  xPoints[5] = 7000;
-  yPoints[5] = 7000;
-  status = defwDieAreaList(6, xPoints, yPoints);
-  CHECK_STATUS(status);
-  free((char*)xPoints);
-  free((char*)yPoints);
-
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // ROW
-  status = defwRow("ROW_9", "CORE", -177320, -111250, 6, 911, 1, 360, 0);
-  CHECK_STATUS(status);
-  status = defwRealProperty("minlength", 50.5);
-  CHECK_STATUS(status);
-  status = defwStringProperty("firstName", "Only");
-  CHECK_STATUS(status);
-  status = defwIntProperty("idx", 1);
-  CHECK_STATUS(status);
-  status = defwRowStr("ROW_10", "CORE1", -19000, -11000, "FN", 1, 100, 0, 600);
-  CHECK_STATUS(status);
-  status = defwRowStr("ROW_11", "CORE1", -19000, -11000, "FN", 1, 100, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRow("ROW_12", "CORE1", -19000, -11000, 3, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwRowStr("ROW_13", "CORE1", -19000, -11000, "FN", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-
-  // TRACKS
-  layers = (const char**)malloc(sizeof(char*)*1);
-  layers[0] = strdup("M1");
-  status = defwTracks("X", 3000, 40, 120, 1, layers, 2, 1);
-  CHECK_STATUS(status);
-  free((char*)layers[0]);
-  layers[0] = strdup("M2");
-  status = defwTracks("Y", 5000, 10, 20, 1,layers);
-  CHECK_STATUS(status);
-  free((char*)layers[0]);
-  free((char*)layers);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  
-  // GCELLGRID
-  status = defwGcellGrid("X", 0, 100, 600);
-  CHECK_STATUS(status);
-  status = defwGcellGrid("Y", 10, 120, 400);
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // DEFAULTCAP
-  /* obsolete in 5.4
-  status = defwStartDefaultCap(4);
-  CHECK_STATUS(status);
-  status = defwDefaultCap(2, 3);
-  CHECK_STATUS(status);
-  status = defwDefaultCap(4, 6);
-  CHECK_STATUS(status);
-  status = defwDefaultCap(8, 9);
-  CHECK_STATUS(status);
-  status = defwDefaultCap(10, 12);
-  CHECK_STATUS(status);
-  status = defwEndDefaultCap();
-  CHECK_STATUS(status);
-  */
-
-  // CANPLACE
-  status = defwCanPlaceStr("dp", 45, 64, "N", 35, 1, 39, 1);
-  CHECK_STATUS(status);
-
-  status = defwCanPlace("dp", 45, 64, 1, 35, 1, 39, 1);
-  CHECK_STATUS(status);
-
-  // CANNOTOCCUPY
-  status = defwCannotOccupyStr("dp", 54, 44, "S", 55, 2, 45, 3);
-  CHECK_STATUS(status);
-
-  // VIAS
-  status = defwStartVias(7);
-  CHECK_STATUS(status);
-  status = defwViaName("VIA_ARRAY");
-  CHECK_STATUS(status);
-  status = defwViaPattern("P1-435-543-IJ1FS");
-  CHECK_STATUS(status);
-  status = defwViaRect("M1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("V1", -40, -40, 40, 40, 3);
-  CHECK_STATUS(status);
-  status = defwViaRect("M2", -50, -50, 50, 50);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-  status = defwViaName("VIA_ARRAY1");
-  CHECK_STATUS(status);
-  status = defwViaRect("M1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("V1", -40, -40, 40, 40, 2);
-  CHECK_STATUS(status);
-  status = defwViaRect("M2", -50, -50, 50, 50);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-  status = defwViaName("myUnshiftedVia");
-  CHECK_STATUS(status);
-  status = defwViaViarule("myViaRule", 20, 20, "metal1", "cut12", "metal2",
-                          5, 5, 0, 4, 0, 1);
-  CHECK_STATUS(status);
-  status = defwViaViaruleRowCol(2, 3);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-  status = defwViaName("via2");
-  CHECK_STATUS(status);
-  status = defwViaViarule("viaRule2", 5, 6, "botLayer2", "cutLayer2",
-                          "topLayer2", 6, 6, 1, 4, 1, 4);
-  CHECK_STATUS(status);
-  status = defwViaViaruleOrigin(10, -10);
-  CHECK_STATUS(status);
-  status = defwViaViaruleOffset(0, 0, 20, -20);
-  CHECK_STATUS(status);
-  status = defwViaViarulePattern("2_F0_2_F8_1_78");
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-
-  status = defwViaName("via3");
-  CHECK_STATUS(status);
-  status = defwViaPattern("P2-435-543-IJ1FS");
-  CHECK_STATUS(status);
-  status = defwViaRect("M2", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-
-  xP = (double*)malloc(sizeof(double)*6);
-  yP = (double*)malloc(sizeof(double)*6);
-  xP[0] = -2.1;
-  yP[0] = -1.0;
-  xP[1] = -2;
-  yP[1] = 1;
-  xP[2] = 2.1;
-  yP[2] = 1.0;
-  xP[3] = 2.0;
-  yP[3] = -1.0;
-  status = defwViaName("via4");
-  CHECK_STATUS(status);
-  status = defwViaPolygon("M3", 4, xP, yP, 2); 
-  CHECK_STATUS(status);
-  status = defwViaRect("M4", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  xP[0] = 100;
-  yP[0] = 100;
-  xP[1] = 200;
-  yP[1] = 200;
-  xP[2] = 300;
-  yP[2] = 300;
-  xP[3] = 400;
-  yP[3] = 400;
-  xP[4] = 500;
-  yP[4] = 500;
-  xP[5] = 600;
-  yP[5] = 600;
-  status = defwViaPolygon("M5", 6, xP, yP, 3); 
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-
-  xP[0] = 200;
-  yP[0] = 200;
-  xP[1] = 300;
-  yP[1] = 300;
-  xP[2] = 400;
-  yP[2] = 500;
-  xP[3] = 100;
-  yP[3] = 300;
-  xP[4] = 300;
-  yP[4] = 200;
-  status = defwViaName("via5");
-  CHECK_STATUS(status);
-  status = defwViaPolygon("M6", 5, xP, yP); 
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-  status = defwEndVias();
-  CHECK_STATUS(status);
-
-  // REGIONS
-  status = defwStartRegions(2);
-  CHECK_STATUS(status);
-  status = defwRegionName("region1");
-  CHECK_STATUS(status);
-  status = defwRegionPoints(-500, -500, 300, 100); 
-  CHECK_STATUS(status);
-  status = defwRegionPoints(500, 500, 1000, 1000); 
-  CHECK_STATUS(status);
-  status = defwRegionType("FENCE");
-  CHECK_STATUS(status);
-  status = defwStringProperty("scum", "on top");
-  CHECK_STATUS(status);
-  status = defwIntProperty("center", 250);
-  CHECK_STATUS(status);
-  status = defwIntProperty("area", 730000);
-  CHECK_STATUS(status);
-  status = defwRegionName("region2");
-  CHECK_STATUS(status);
-  status = defwRegionPoints(4000, 0, 5000, 1000);
-  CHECK_STATUS(status);
-  status = defwStringProperty("scum", "on bottom");
-  CHECK_STATUS(status);
-  status = defwEndRegions();
-  CHECK_STATUS(status);
-
-  // COMPONENTMASKSHIFTLAYER
-  shiftLayers = (const char**)malloc(sizeof(char*)*2);
-  shiftLayers[0] = strdup("M3");
-  shiftLayers[1] = strdup("M2");
-
-  status = defwComponentMaskShiftLayers(shiftLayers, 2);
-
-  free((char*)shiftLayers[0]);
-  free((char*)shiftLayers[1]);
-  free((char*)shiftLayers);
-
-  // COMPONENTS
-  foreigns = (const char**)malloc(sizeof(char*)*2);
-  foreignX = (int*)malloc(sizeof(int)*2);
-  foreignY = (int*)malloc(sizeof(int)*2);
-  foreignOrient = (int*)malloc(sizeof(int)*2);
-  foreignOrientStr = (const char**)malloc(sizeof(char*)*2);
-  status = defwStartComponents(11);
-  CHECK_STATUS(status);
-  status = defwComponent("Z38A01", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 18592, 5400, 6, 0,
-                         NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponentMaskShift(123);
-  CHECK_STATUS(status);
-  status = defwComponentHalo(100, 0, 50, 200);
-  CHECK_STATUS(status);
-  status = defwComponentStr("Z38A03", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 16576, 45600,
-                         "FS", 0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponentHalo(200, 2, 60, 300);
-  CHECK_STATUS(status);
-  status = defwComponent("Z38A05", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 51520, 9600, 6, 0,
-                         NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("|i0", "INV_B", 0, NULL, "INV", NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, NULL, 0, 0, -1, 0,
-                         "region1", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponentHaloSoft(100, 0, 50, 200);
-  CHECK_STATUS(status);
-  status = defwComponent("|i1", "INV_B", 0, NULL, "INV", NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "UNPLACED", 1000, 1000, 0,
-                         0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("cell1", "CHM6A", 0, NULL, NULL, "generator", NULL,
-                         "USER", 0, NULL, NULL, NULL, NULL, "FIXED", 0, 10, 0,
-                         100.4534535, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("cell2", "CHM6A", 0, NULL, NULL, NULL, NULL,
-                         "NETLIST", 0, NULL, NULL, NULL, NULL, "COVER", 120,
-                         10, 4, 2, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  foreigns[0] = strdup("gds2name");
-  foreignX[0] = -500;
-  foreignY[0] = -500;
-  foreignOrient[0] = 3;
-  status = defwComponent("cell3", "CHM6A", 0, NULL, NULL, NULL, NULL,
-                         "TIMING", 1, foreigns, foreignX, foreignY,
-                         foreignOrient, "PLACED", 240,
-                         10, 0, 0, "region1", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponentRouteHalo(100, "metal1", "metal3");
-  CHECK_STATUS(status);
-  free((char*)foreigns[0]);
-  foreigns[0] = strdup("gds3name");
-  foreignX[0] = -500;
-  foreignY[0] = -500;
-  foreignOrientStr[0] = strdup("FW");
-  foreigns[1] = strdup("gds4name");
-  foreignX[1] = -300;
-  foreignY[1] = -300;
-  foreignOrientStr[1] = strdup("FS");
-  status = defwComponentStr("cell4", "CHM3A", 0, NULL, "CHM6A", NULL, NULL,
-                         "DIST", 2, foreigns, foreignX, foreignY, 
-                         foreignOrientStr, "PLACED", 360,
-                         10, "W", 0, "region2", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponentHaloSoft(100, 0, 50, 200);
-  CHECK_STATUS(status);
-  status = defwStringProperty("cc", "This is the copy list");
-  CHECK_STATUS(status);
-  status = defwIntProperty("index", 9);
-  CHECK_STATUS(status);
-  status = defwRealProperty("size", 7.8);
-  CHECK_STATUS(status);
-  status = defwComponent("scancell1", "CHK3A", 0, NULL, NULL, NULL, NULL,
-                         NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 500,
-                         10, 7, 0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("scancell2", "CHK3A", 0, NULL, NULL, NULL, NULL,
-                         NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 700,
-                         10, 6, 0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwEndComponents();
-  CHECK_STATUS(status);
-  free((char*)foreigns[0]);
-  free((char*)foreigns[1]);
-  free((char*)foreigns);
-  free((char*)foreignX);
-  free((char*)foreignY);
-  free((char*)foreignOrient);
-  free((char*)foreignOrientStr[0]);
-  free((char*)foreignOrientStr[1]);
-  free((char*)foreignOrientStr);
-
-  xP = (double*)malloc(sizeof(double)*6);
-  yP = (double*)malloc(sizeof(double)*6);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-
-  // PINS
-  status = defwStartPins(11);
-  CHECK_STATUS(status);
-  status = defwPin("scanpin", "net1", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL,
-                   0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPinPolygon("metal1", 0, 1000, 6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwPinNetExpr("power1 VDD1");
-  CHECK_STATUS(status);
-  status = defwPin("pin0", "net1", 0, "INPUT", "SCAN", NULL, 0, 0, -1, NULL,
-                   0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPinStr("pin0.5", "net1", 0, "INPUT", "RESET", "FIXED", 0, 0, "S",
-                      NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPinPolygon("metal2", 0, 0, 4, xP, yP);
-  CHECK_STATUS(status);
-  status = defwPinLayer("metal3", 500, 0, -5000, -100, -4950, -90);
-  CHECK_STATUS(status);
-  status = defwPin("pin1", "net1", 1, NULL, "POWER", NULL, 0, 0, -1, "M1",
-                   -5000, -100, -4950, -90);
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalArea(4580, "M1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalArea(4580, "M11");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalArea(4580, "M12");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinGateArea(4580, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinDiffArea(4580, "M3");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinDiffArea(4580, "M31");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxAreaCar(5000, "L1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxSideAreaCar(5000, "M4");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialCutArea(4580, "M4");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxCutCar(5000, "L1");
-  CHECK_STATUS(status);
-  status = defwPin("pin2", "net2", 0, "INPUT", "SIGNAL", NULL, 0, 0, -1, "M1",
-                   -5000, 0, -4950, 10);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M1", 500, 0, -5000, 0, -4950, 10);
-  CHECK_STATUS(status);
-  status = defwPinPolygon("M2", 0, 0, 4, xP, yP);
-  CHECK_STATUS(status);
-  status = defwPinPolygon("M3", 0, 0, 3, xP, yP);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M4", 0, 500, 0, 100, -400, 100);
-  CHECK_STATUS(status);
-  status = defwPinSupplySensitivity("vddpin1");
-  CHECK_STATUS(status);
-  status = defwPinGroundSensitivity("gndpin1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalArea(5000, NULL);
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalSideArea(4580, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinGateArea(5000, NULL);
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialCutArea(5000, NULL);
-  CHECK_STATUS(status);
-  status = defwPin("INBUS[1]", "|INBUS[1]", 0, "INPUT", "SIGNAL", "FIXED",
-                   45, -2160, 0, "M2", 0, 0, 30, 135);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M2", 0, 0, 0, 0, 30, 135);
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalArea(1, "M1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialMetalSideArea(2, "M1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinDiffArea(4, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinPartialCutArea(5, "V1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaModel("OXIDE1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinGateArea(3, "M1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxAreaCar(6, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxSideAreaCar(7, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxCutCar(8, "V1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaModel("OXIDE2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinGateArea(30, "M1");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxAreaCar(60, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxSideAreaCar(70, "M2");
-  CHECK_STATUS(status);
-  status = defwPinAntennaPinMaxCutCar(80, "V1");
-  CHECK_STATUS(status);
-  status = defwPin("INBUS<0>", "|INBUS<0>", 0, "INPUT", "SIGNAL", "PLACED",
-                   -45, 2160, 1, "M2", 0, 0, 30, 134);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M2", 0, 1000, 0, 0, 30, 134);
-  CHECK_STATUS(status);
-  status = defwPin("OUTBUS<1>", "|OUTBUS<1>", 0, "OUTPUT", "SIGNAL", "COVER",
-                   2160, 645, 2, "M1", 0, 0, 30, 135);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M1", 0, 0, 0, 0, 30, 134);
-  CHECK_STATUS(status);
-  status = defwPinNetExpr("gnd1 GND");
-  CHECK_STATUS(status);
-  status = defwPin("VDD", "VDD", 1, "INOUT", "POWER", NULL, 0, 0, -1, NULL,
-                   0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPin("BUSA[0]", "BUSA[0]", 0, "INPUT", "SIGNAL", "PLACED",
-                   0, 2500, 1, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M1", 0, 0, -25, 0, 25, 50);
-  CHECK_STATUS(status);
-  status = defwPinLayer("M2", 0, 0, -10, 0, 10, 75);
-  CHECK_STATUS(status);
-  status = defwPinVia("via12", 0, 25);
-  CHECK_STATUS(status);
-  status = defwPin("VDD", "VDD", 1, "INOUT", "POWER", NULL,
-                   0, 0, -1, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPinPort();
-  CHECK_STATUS(status);
-  status = defwPinPortLayer("M2", 0, 0, -25, 0, 25, 50);
-  CHECK_STATUS(status);
-  status = defwPinPortLocation("PLACED", 0, 2500, "S");
-  CHECK_STATUS(status);
-  status = defwPinPort();
-  CHECK_STATUS(status);
-  status = defwPinPortLayer("M1", 0, 0, -25, 0, 25, 50);
-  CHECK_STATUS(status);
-  status = defwPinPortLocation("COVER", 0, 2500, "S");
-  CHECK_STATUS(status);
-  status = defwPinPort();
-  CHECK_STATUS(status);
-  status = defwPinPortLayer("M1", 0, 0, -25, 0, 25, 50, 2);
-  CHECK_STATUS(status);
-  status = defwPinPortLocation("FIXED", 0, 2500, "S");
-  CHECK_STATUS(status);
-  status = defwPinPortPolygon("M1", 0, 2, 6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwPinPortPolygon("M2", 5, 0, 6, xP, yP, 1);
-  CHECK_STATUS(status);
-  status = defwPinPortVia("M2", 5, 4, 112);
-  CHECK_STATUS(status);
-
-  status = defwEndPins();
-  CHECK_STATUS(status);
-
-  free((char*)xP);
-  free((char*)yP);
-
-  // PINPROPERTIES
-  status = defwStartPinProperties(2);
-  CHECK_STATUS(status);
-  status = defwPinProperty("cell1", "PB1");
-  CHECK_STATUS(status);
-  status = defwStringProperty("dpBit", "1");
-  CHECK_STATUS(status);
-  status = defwRealProperty("realProperty", 3.4);
-  CHECK_STATUS(status);
-  status = defwPinProperty("cell2", "vdd");
-  CHECK_STATUS(status);
-  status = defwIntProperty("dpIgnoreTerm", 2);
-  CHECK_STATUS(status);
-  status = defwEndPinProperties();
-  CHECK_STATUS(status);
-
-  // SPECIALNETS
-  status = defwStartSpecialNets(7);
-  CHECK_STATUS(status);
-  status = defwSpecialNet("net1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell1", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell2", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell3", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell4", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetWidth("M1", 200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetWidth("M2", 300);
-  CHECK_STATUS(status);
-  status = defwSpecialNetVoltage(3.2);
-  CHECK_STATUS(status);
-  status = defwSpecialNetSpacing("M1", 200, 190, 210);
-  CHECK_STATUS(status);
-  status = defwSpecialNetSource("TIMING");
-  CHECK_STATUS(status);
-  status = defwSpecialNetOriginal("VDD");
-  CHECK_STATUS(status);
-  status = defwSpecialNetUse("POWER");
-  CHECK_STATUS(status);
-  status = defwSpecialNetWeight(30);
-  CHECK_STATUS(status);
-  status = defwStringProperty("contype", "star");
-  CHECK_STATUS(status);
-  status = defwIntProperty("ind", 1);
-  CHECK_STATUS(status);
-  status = defwRealProperty("maxlength", 12.13);
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("VSS");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell1", "GND", 1);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell2", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell3", "GND", 1);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell4", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetUse("SCAN");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(250);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("IOWIRE");
-  CHECK_STATUS(status);
-  coorX = (double*)malloc(sizeof(double)*6);
-  coorY = (double*)malloc(sizeof(double)*6);
-  coorValue = (double*)malloc(sizeof(double)*6);
-  coorX[0] = 5.0;
-  coorY[0] = 15.0;
-  coorValue[0] = 0;
-  coorX[1] = 125.0;
-  coorY[1] = 15.0;
-  coorValue[1] = 235.0;
-  coorX[2] = 245.0;
-  coorY[2] = 15.0;
-  coorValue[2] = 255.0;
-  status = defwSpecialNetPathPointWithWireExt(3, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldStart("my_net");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldWidth(90);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldShape("STRIPE");
-  CHECK_STATUS(status);
-  coorX[0] = 14100.0;
-  coorY[0] = 342440.0;
-  coorX[1] = 13920.0;
-  coorY[1] = 342440.0;
-  status = defwSpecialNetShieldPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M2_TURN");
-  CHECK_STATUS(status);
-  coorX[0] = 14100.0;
-  coorY[0] = 263200.0;
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M1_M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldViaData(10, 20, 1000, 2000);
-  CHECK_STATUS(status);
-  coorX[0] = 2400.0;
-  coorY[0] = 263200.0;
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldStart("my_net1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldWidth(90);
-  CHECK_STATUS(status);
-  coorX[0] = 14100.0;
-  coorY[0] = 342440.0;
-  coorX[1] = 13920.0;
-  coorY[1] = 342440.0;
-  status = defwSpecialNetShieldPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M2_TURN");
-  CHECK_STATUS(status);
-  coorX[0] = 13920.0;
-  coorY[0] = 263200.0;
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M1_M2");
-  CHECK_STATUS(status);
-  coorX[0] = 2400.0;
-  coorY[0] = 263200.0;
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetPattern("STEINER");
-  CHECK_STATUS(status);
-  status = defwSpecialNetEstCap(100);
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("VDD");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("*", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("metal2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(100);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("RING");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStyle(1);
-  CHECK_STATUS(status);
-  coorX[0] = 0.0;
-  coorY[0] = 0.0;
-  coorX[1] = 100.0;
-  coorY[1] = 100.0;
-  coorX[2] = 200.0;
-  coorY[2] = 100.0;
-  status = defwSpecialNetPathPoint(3, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(270);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("PADRING");
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(270);
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("CLOCK");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("BLOCKRING");
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(270);
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("VCC");
-  CHECK_STATUS(status);
-/*
-  status = defwSpecialNetShieldNetName("ShieldName");
-*/
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("DRCFILL");
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(270);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("STRIPE");
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathMask(31);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathVia("VIAGEN21_2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathViaData(10, 20, 10000, 20000);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("n1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("PIN", "n1", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("driver1", "in", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("bumpa1", "bumppin", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetFixedbump();
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("FILLWIREOPC");
-  CHECK_STATUS(status);
-  coorX[0] = -45.0;
-  coorY[0] = 1350.0;
-  coorX[1] = 44865.0;
-  coorY[1] = 1350.0;
-  status = defwSpecialNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  free((char*)coorX);
-  free((char*)coorY);
-  free((char*)coorValue);
-
-  status = defwSpecialNet("VSS1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetUse("POWER");
-  CHECK_STATUS(status);
-  xP = (double*)malloc(sizeof(double)*6);
-  yP = (double*)malloc(sizeof(double)*6);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-  status = defwSpecialNetPolygon("metal1", 4, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPolygon("metal1", 6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSpecialNetRect("metal1", 0, 0, 100, 200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetRect("metal2", 1, 1, 100, 200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetVia("metal2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetViaPoints(4, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-  status = defwEndSpecialNets();
-  CHECK_STATUS(status);
-  
-  // NETS
-  status = defwStartNets(13);
-  CHECK_STATUS(status);
-  status = defwNet("net1");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-
-  status = defwNet("net2");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell1", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell2", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell3", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetEstCap(200);
-  CHECK_STATUS(status);
-  status = defwNetWeight(2);
-  CHECK_STATUS(status);
-  status = defwNetVpin("P1", NULL, 0, 0, 0, 0, "PLACED", 54, 64, 3);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-
-  status = defwNet("net3");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell4", "PA3", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell2", "P10", 0);
-  CHECK_STATUS(status);
-  status = defwNetXtalk(30);
-  CHECK_STATUS(status);
-  status = defwNetOriginal("extra_crispy");
-  CHECK_STATUS(status);
-  status = defwNetSource("USER");
-  CHECK_STATUS(status);
-  status = defwNetUse("SIGNAL");
-  CHECK_STATUS(status);
-  status = defwNetFrequency(100);
-  CHECK_STATUS(status);
-  status = defwIntProperty("alt", 37);
-  CHECK_STATUS(status);
-  status = defwStringProperty("lastName", "Unknown");
-  CHECK_STATUS(status);
-  status = defwRealProperty("length", 10.11);
-  CHECK_STATUS(status);
-  status = defwNetPattern("BALANCED");
-  CHECK_STATUS(status);
-  status = defwNetVpinStr("P2", "L1", 45, 54, 3, 46, "FIXED", 23, 12, "FN");
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  coorX = (double*)malloc(sizeof(double)*3);
-  coorY = (double*)malloc(sizeof(double)*3);
-  status = defwNet("my_net");
-  CHECK_STATUS(status);
-  status = defwNetConnection("I1", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("BUF", "Z", 0);
-  CHECK_STATUS(status);
-  status = defwNetNondefaultRule("RULE1");
-  CHECK_STATUS(status);
-  status = defwNetUse("RESET");
-  CHECK_STATUS(status);
-  status = defwNetShieldnet("VSS");
-  CHECK_STATUS(status);
-  status = defwNetShieldnet("VDD");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M2", 0, NULL); 
-  CHECK_STATUS(status);
-  status = defwNetPathStyle(2);
-  CHECK_STATUS(status);
-  coorX[0] = 14000.0;
-  coorY[0] = 341440.0;
-  coorX[1] = 9600.0;
-  coorY[1] = 341440.0;
-  coorX[2] = 9600.0;
-  coorY[2] = 282400.0;
-  status = defwNetPathPoint(3, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = 2400;
-  coorY[0] = 2400;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 1, NULL);
-  CHECK_STATUS(status);
-  status = defwNetPathStyle(4);
-  CHECK_STATUS(status);
-  coorX[0] = 2400.0;
-  coorY[0] = 282400.0;
-  coorX[1] = 240.0;
-  coorY[1] = 282400.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  free((char*)coorX);
-  free((char*)coorY);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetNoshieldStart("M2");
-  CHECK_STATUS(status);
-  coorXSN = (const char**)malloc(sizeof(char*)*2);
-  coorYSN = (const char**)malloc(sizeof(char*)*2);
-  coorXSN[0] = strdup("14100");
-  coorYSN[0] = strdup("341440");
-  coorXSN[1] = strdup("14000");
-  coorYSN[1] = strdup("341440");
-  status = defwNetNoshieldPoint(2, coorXSN, coorYSN);
-  CHECK_STATUS(status);
-  status = defwNetNoshieldVia("VIA4");
-  CHECK_STATUS(status);
-  status = defwNetNoshieldEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNet("|INBUS[1]");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i1", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNet("|INBUS<0>");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i0", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNet("|OUTBUS<1>");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i0", "Z", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNet("MUSTJOIN");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell4", "PA1", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNet("XX100");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB3_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       189560, 27300, 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB2_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       169400, 64500, 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB1_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       55160, 31500, 0);
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A05", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, "RULE1");
-  CHECK_STATUS(status);
-  free((char*)coorXSN[0]);
-  free((char*)coorYSN[0]);
-  free((char*)coorXSN[1]);
-  free((char*)coorYSN[1]);
-  free((char*)coorXSN);
-  free((char*)coorYSN);
-  coorX = (double*)malloc(sizeof(double)*5);
-  coorY = (double*)malloc(sizeof(double)*5);
-  coorValue = (double*)malloc(sizeof(double)*5);
-  coorX[0] = 54040.0;
-  coorY[0] = 30300.0;
-  coorX[1] = 54040.0;
-  coorY[1] = 30900.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = 54040.0;
-  coorY[0] = 30900.0;
-  coorX[1] = 56280.0;
-  coorY[1] = 30900.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathViaWithOrient("nd1VIA23", 6);
-  CHECK_STATUS(status);
-  coorX[0] = 56280.0;
-  coorY[0] = 31500.0;
-  coorX[1] = 55160.0;
-  coorY[1] = 31500.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A03", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 168280.0;
-  coorY[0] = 63300.0;
-  coorValue[0] = 7.0;
-  coorX[1] = 168280.0;
-  coorY[1] = 64500.0;
-  coorValue[1] = 0;
-  status = defwNetPathPointWithExt(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  coorX[0] = 169400.0;
-  coorY[0] = 64500.0;
-  coorValue[0] = 8.0;
-  status = defwNetPathPointWithExt(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathViaWithOrientStr("M2_M3", "SE");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A01", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 188400.0;
-  coorY[0] = 26100.0;
-  coorX[1] = 188400.0;
-  coorY[1] = 27300.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  coorX[0] = 189560.0;
-  coorY[0] = 27300.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB0_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetNondefaultRule("RULE1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 269400.0;
-  coorY[0] = 64500.0;
-  coorX[1] = 269400.0;
-  coorY[1] = 54900.0;
-  coorX[2] = 170520.0;
-  coorY[2] = 54900.0;
-  coorX[3] = 170520.0;
-  coorY[3] = 37500.0;
-  coorX[4] = 170520.0;
-  coorY[4] = 30300.0;
-  status = defwNetPathPoint(5, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = 171080.0;
-  coorY[0] = 30300.0;
-  coorX[1] = 17440.0;
-  coorY[1] = 0.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = 17440.0;
-  coorY[0] = 0.0;
-  coorValue[0] = 0;
-  coorX[1] = 17440.0;
-  coorY[1] = 26700.0;
-  coorValue[1] = 8.0;
-  status = defwNetPathPointWithExt(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = 177800.0;
-  coorY[0] = 26700.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = 177800.0;
-  coorY[0] = 26700.0;
-  coorValue[0] = 8.0;
-  coorX[1] = 177800.0;
-  coorY[1] = 30300.0;
-  coorValue[1] = 8.0;
-  status = defwNetPathPointWithExt(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = 189560.0;
-  coorY[0] = 30300.0;;
-  coorValue[0] = 8.0;
-  status = defwNetPathPointWithExt(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = 189560.0;
-  coorY[0] = 27300.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 1, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 55160.0;
-  coorY[0] = 31500.0;
-  coorValue[0] = 8.0;
-  coorX[1] = 55160.0;
-  coorY[1] = 34500.0;
-  coorValue[1] = 0.0;
-  status = defwNetPathPointWithExt(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = 149800.0;
-  coorY[0] = 34500.0;
-  coorValue[0] = 8.0;
-  status = defwNetPathPointWithExt(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = 149800.0;
-  coorY[0] = 35700.0;
-  coorX[1] = 149800.0;
-  coorY[1] = 35700.0;
-  status = defwNetPathPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = 149800.0;
-  coorY[0] = 37500.0;
-  coorValue[0] = 8.0;;
-  coorX[1] = 170520.0;
-  coorY[1] = 37500.0;
-  coorValue[1] = 0.0;
-  status = defwNetPathPointWithExt(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-
-  status = defwNet("SCAN");
-  CHECK_STATUS(status);
-  status = defwNetConnection("scancell1", "P10", 1);
-  CHECK_STATUS(status);
-  status = defwNetConnection("scancell2", "PA0", 1);
-  CHECK_STATUS(status);
-  status = defwNetSource("TEST");
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-
-  status = defwNet("testBug");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M2", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 100.0;
-  coorY[0] = 100.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  coorX[0] = 500.0;
-  coorY[0] = 100.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVirtual(700, 100);
-  CHECK_STATUS(status);
-  status = defwNetPathMask(2);
-  CHECK_STATUS(status);
-  status = defwNetPathRect(-300, 100, -100, 300);
-  CHECK_STATUS(status);
-  coorX[0] = 700.0;
-  coorY[0] = 700.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 1288210.0;
-  coorY[0] = 580930.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathMask(31);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = 1288210.0;
-  coorY[0] = 582820.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 1141350.0;
-  coorY[0] = 582820.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathMask(3);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = 1141350.0;
-  coorY[0] = 580930.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 1278410.0;
-  coorY[0] = 275170.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = 1141210.0;
-  coorY[0] = 271250.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = 1141210.0;
-  coorY[0] = 271460.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = 1142820.0;
-  coorY[0] = 271460.0;
-  status = defwNetPathPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("GETH3W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-  free((char*)coorX);
-  free((char*)coorY);
-  free((char*)coorValue);
-
-  status = defwNet("n1");
-  CHECK_STATUS(status);
-  status = defwNetConnection("PIN", "n1", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("driver1", "in", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("bumpa1", "bumppin", 0);
-  CHECK_STATUS(status);
-  status = defwNetFixedbump();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet(); 
-  CHECK_STATUS(status);
-
-  status = defwNetMustjoinConnection("PIN2", "n2");
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-
-  status = defwEndNets();
-  CHECK_STATUS(status);
-
-  // IOTIMINGS
-  /* obsolete in 5.4
-  status = defwStartIOTimings(3);
-  CHECK_STATUS(status);
-  status = defwIOTiming("PIN", "INBUS<0>");
-  CHECK_STATUS(status);
-  status = defwIOTimingVariable("RISE", 6100000, 7100000);
-  CHECK_STATUS(status);
-  status = defwIOTimingVariable("FALL", 3100000, 3100000);
-  CHECK_STATUS(status);
-  status = defwIOTimingSlewrate("RISE", 110, 110);
-  CHECK_STATUS(status);
-  status = defwIOTimingSlewrate("FALL", 290, 290);
-  CHECK_STATUS(status);
-  status = defwIOTimingCapacitance(0);
-  CHECK_STATUS(status);
-  status = defwIOTiming("PIN", "INBUS[1]");
-  CHECK_STATUS(status);
-  status = defwIOTimingDrivecell("INV", "A", "Z", 2);
-  CHECK_STATUS(status);
-  status = defwIOTimingSlewrate("RISE", 110, 110);
-  CHECK_STATUS(status);
-  status = defwIOTimingSlewrate("FALL", 290, 290);
-  CHECK_STATUS(status);
-  status = defwIOTimingCapacitance(0);
-  CHECK_STATUS(status);
-  status = defwIOTiming("PIN", "OUTPUS<1>");
-  CHECK_STATUS(status);
-  status = defwIOTimingCapacitance(120000);
-  CHECK_STATUS(status);
-  status = defwEndIOTimings();
-  CHECK_STATUS(status);
-  */
-
-  // SCANCHAIN
-  status = defwStartScanchains(4);
-  CHECK_STATUS(status);
-  status = defwScanchain("the_chain");
-  CHECK_STATUS(status);
-  status = defwScanchainCommonscanpins("IN", "PA1", "OUT", "PA2");
-  CHECK_STATUS(status);
-  status = defwScanchainStart("PIN", "scanpin");
-  CHECK_STATUS(status);
-  status = defwScanchainStop("cell4", "PA2");
-  CHECK_STATUS(status);
-  status = defwScanchainOrdered("cell2", "IN", "PA0", NULL, NULL,
-                                "cell1", "OUT", "P10", NULL, NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("scancell1", "IN", "PA0", NULL, NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("scancell2", "OUT", "P10", NULL, NULL);
-  CHECK_STATUS(status);
-  status = defwScanchain("chain1_clock1");
-  CHECK_STATUS(status);
-  status = defwScanchainPartition("clock1", -1);
-  CHECK_STATUS(status);
-  status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("block1/pgm_cgm_en_reg", "IN", "SD", "OUT", "QZ");
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("block1/start_reset_dd_reg", "IN", "SD", "OUT", "QZ");
-  CHECK_STATUS(status);
-  status = defwScanchainStop("block1/start_reset_d_reg", NULL);
-  CHECK_STATUS(status);
-  status = defwScanchain("chain2_clock2");
-  CHECK_STATUS(status);
-  status = defwScanchainPartition("clock2", 1000);
-  CHECK_STATUS(status);
-  status = defwScanchainStart("block1/current_state_reg_0_QZ", NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("block1/port2_phy_addr_reg_0_", "IN", "SD", "OUT", "QZ ");
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("block1/port2_phy_addr_reg_4_", "IN", "SD", "OUT", "QZ");
-  CHECK_STATUS(status);
-  status = defwScanchainFloatingBits("block1/port3_intfc", "IN", "SD", "OUT", "QZ", 4);
-  CHECK_STATUS(status);
-  status = defwScanchainOrderedBits("block1/mux1", "IN", "A", "OUT", "X", 0,
-                                    "block1/ff2", "IN", "SD", "OUT", "Q", -1);
-  CHECK_STATUS(status);
-  status = defwScanchain("chain4_clock3");
-  CHECK_STATUS(status);
-  status = defwScanchainPartition("clock3", -1);
-  CHECK_STATUS(status);
-  status = defwScanchainStart("block1/prescaler_IO/lfsr_reg1", NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloating("block1/dp1_timers", NULL, NULL, NULL, NULL);
-  CHECK_STATUS(status);
-  status = defwScanchainFloatingBits("block1/bus8", NULL, NULL, NULL, NULL, 8);
-  CHECK_STATUS(status);
-  status = defwScanchainOrderedBits("block1/dsl/ffl", "IN", "SD", "OUT", "Q",
-                               -1, "block1/dsl/mux1", "IN", "B", "OUT", "Y", 0);
-  CHECK_STATUS(status);
-  status = defwScanchainOrderedBits("block1/dsl/ff2", "IN", "SD", "OUT", "Q",
-                               -1, "block1/dsl/mux2", "IN", "B", "OUT", "Y", 0);
-  CHECK_STATUS(status);
-  status = defwScanchainStop("block1/start_reset_d_reg", NULL);
-  CHECK_STATUS(status);
-
-  status = defwEndScanchain();
-  CHECK_STATUS(status);
-
-  // CONSTRAINTS
-  /* obsolete in 5.4
-  status = defwStartConstraints(3);
-  CHECK_STATUS(status);
-  status = defwConstraintOperand();  // the following are operand
-  CHECK_STATUS(status);
-  status = defwConstraintOperandPath("cell1", "VDD", "cell2", "VDD");
-  CHECK_STATUS(status);
-  status = defwConstraintOperandTime("RISEMAX", 6000);
-  CHECK_STATUS(status);
-  status = defwConstraintOperandTime("FALLMIN", 9000);
-  CHECK_STATUS(status);
-  status = defwConstraintOperandEnd();
-  CHECK_STATUS(status);
-  status = defwConstraintOperand();
-  CHECK_STATUS(status);
-  status = defwConstraintOperandSum();
-  CHECK_STATUS(status);
-  status = defwConstraintOperandNet("net2");
-  CHECK_STATUS(status);
-  status = defwConstraintOperandNet("net3");
-  CHECK_STATUS(status);
-  status = defwConstraintOperandSumEnd();
-  CHECK_STATUS(status);
-  status = defwConstraintOperandTime("RISEMAX", 2000);
-  CHECK_STATUS(status);
-  status = defwConstraintOperandTime("FALLMIN", 5000);
-  CHECK_STATUS(status);
-  status = defwConstraintOperandEnd();
-  CHECK_STATUS(status);
-  status = defwConstraintWiredlogic("net1", 1000);
-  CHECK_STATUS(status);
-  status = defwEndConstraints();
-  CHECK_STATUS(status);
-  */
-
-  // GROUPS
-  groupExpr = (const char**)malloc(sizeof(char*)*2);
-  status = defwStartGroups(2);
-  CHECK_STATUS(status);
-  groupExpr[0] = strdup("cell2"); 
-  groupExpr[1] = strdup("cell3"); 
-  status = defwGroup("group1", 2, groupExpr);
-  CHECK_STATUS(status);
-  free((char*)groupExpr[0]);
-  free((char*)groupExpr[1]);
-  status = defwGroupRegion(0, 0, 0, 0, "region1");
-  CHECK_STATUS(status);
-  status = defwStringProperty("ggrp", "xx");
-  CHECK_STATUS(status);
-  status = defwIntProperty("side", 2);
-  CHECK_STATUS(status);
-  status = defwRealProperty("maxarea", 5.6);
-  CHECK_STATUS(status);
-  groupExpr[0] = strdup("cell1"); 
-  status = defwGroup("group2", 1, groupExpr);
-  CHECK_STATUS(status);
-  free((char*)groupExpr[0]);
-  status = defwGroupRegion(0, 10, 1000, 1010, NULL);
-  CHECK_STATUS(status);
-  status = defwStringProperty("ggrp", "after the fall");
-  CHECK_STATUS(status);
-  status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, 0, 0);
-  CHECK_STATUS(status);
-  status = defwEndGroups();
-  CHECK_STATUS(status);
-  free((char*)groupExpr);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // BLOCKAGES
-  int *xPB, *yPB;
-  xPB = (int*)malloc(sizeof(int)*7);
-  yPB = (int*)malloc(sizeof(int)*7);
-  xPB[0] = 2;
-  yPB[0] = 2;
-  xPB[1] = 3;
-  yPB[1] = 3;
-  xPB[2] = 4;
-  yPB[2] = 4;
-  xPB[3] = 5;
-  yPB[3] = 5;
-  xPB[4] = 6;
-  yPB[4] = 6;
-  xPB[5] = 7;
-  yPB[5] = 7;
-  xPB[6] = 8;
-  yPB[6] = 8;
-
-  status = defwStartBlockages(13);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m1");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerComponent("comp1");
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3456, 4535, 3000, 4000);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(4500, 6500, 5500, 6000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPolygon(7, xPB, yPB);
-  CHECK_STATUS(status);
-  status = defwBlockagesPolygon(6, xPB, yPB);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(5000, 6000, 4000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementComponent("m2");
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(4000, 6000, 8000, 4000);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(8000, 400, 600, 800);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m3");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerSpacing(1000);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m4");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerSpacing(100);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerExceptpgnet();
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerComponent("U2726");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerPushdown();
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerMask(3);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m4");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerComponent("U2726");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerPushdown();
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerDesignRuleWidth(1000);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m5");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerFills();
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("m6");
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerPushdown();
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPolygon(7, xPB, yPB);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementComponent("m7");
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementPushdown();
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(3000, 4000, 6000, 5000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementSoft();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementComponent("U2729");
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementPushdown();
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(4000, 6000, 8000, 4000);
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacement();
-  CHECK_STATUS(status);
-  status = defwBlockagesPlacementPartial(1.1);
-  CHECK_STATUS(status);
-  status = defwBlockagesRect(4000, 6000, 8000, 4000);
-  CHECK_STATUS(status);
-  status = defwBlockagesLayer("metal1");
-  CHECK_STATUS(status);
-  status =  defwBlockagesLayerExceptpgnet();
-  CHECK_STATUS(status);
-  status = defwBlockagesLayerSpacing(4);
-  CHECK_STATUS(status);
-  status = defwBlockagesPolygon(3, xPB, yPB);
-  CHECK_STATUS(status);
-  status = defwEndBlockages();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  free((char*)xPB);
-  free((char*)yPB);
-
-  // SLOTS
-  xP = (double*)malloc(sizeof(double)*7);
-  yP = (double*)malloc(sizeof(double)*7);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-  xP[6] = 8.1;
-  yP[6] = 8.1;
-  status = defwStartSlots(2);
-  CHECK_STATUS(status);
-  status = defwSlotLayer("MET1");
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(3, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotRect(2000, 2000, 2500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotRect(3000, 2000, 3500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotLayer("MET2");
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwEndSlots();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-
-  // FILLS
-  xP = (double*)malloc(sizeof(double)*7);
-  yP = (double*)malloc(sizeof(double)*7);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-  xP[6] = 8.1;
-  yP[6] = 8.1;
-  status = defwStartFills(5);
-  CHECK_STATUS(status);
-  status = defwFillLayer("MET1");
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(5, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillRect(2000, 2000, 2500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillRect(3000, 2000, 3500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillLayer("MET2");
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 4500, 1500, 6500);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 7000, 1500, 9000);
-  CHECK_STATUS(status);
-  status = defwFillRect(1000, 9500, 1500, 11500);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillPolygon(6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillLayer("metal1");
-  CHECK_STATUS(status);
-  status = defwFillLayerOPC();
-  CHECK_STATUS(status);
-  status = defwFillRect(100, 200, 150, 400);
-  CHECK_STATUS(status);
-  status = defwFillRect(300, 200, 350, 400);
-  CHECK_STATUS(status);
-  status = defwFillVia("via28");
-  CHECK_STATUS(status);
-  status = defwFillViaOPC();
-  CHECK_STATUS(status);
-  status = defwFillPoints(1, xP, yP);
-  CHECK_STATUS(status);
-  status = defwFillVia("via26");
-  CHECK_STATUS(status);
-  status = defwFillPoints(3, xP, yP);
-  CHECK_STATUS(status);
-  status = defwEndFills();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-
-  // SLOTS
-  xP = (double*)malloc(sizeof(double)*7);
-  yP = (double*)malloc(sizeof(double)*7);
-  xP[0] = 2.1;
-  yP[0] = 2.1;
-  xP[1] = 3.1;
-  yP[1] = 3.1;
-  xP[2] = 4.1;
-  yP[2] = 4.1;
-  xP[3] = 5.1;
-  yP[3] = 5.1;
-  xP[4] = 6.1;
-  yP[4] = 6.1;
-  xP[5] = 7.1;
-  yP[5] = 7.1;
-  xP[6] = 8.1;
-  yP[6] = 8.1;
-  status = defwStartSlots(2);
-  CHECK_STATUS(status);
-  status = defwSlotLayer("MET1");
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(5, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSlotRect(2000, 2000, 2500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSlotRect(3000, 2000, 3500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotLayer("MET2");
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 2000, 1500, 4000);
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 4500, 1500, 6500);
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 7000, 1500, 9000);
-  CHECK_STATUS(status);
-  status = defwSlotRect(1000, 9500, 1500, 11500);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(7, xP, yP);
-  CHECK_STATUS(status);
-  status = defwSlotPolygon(6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwEndSlots();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-
-  // NONDEFAULTRULES
-  status = defwStartNonDefaultRules(4);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRule("doubleSpaceRule", 1);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal1", 2, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal2", 2, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal3", 2, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRule("lowerResistance", 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal1", 6, 0, 0, 5);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal2", 5, 1, 6, 4);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal3", 5, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleMinCuts("cut12", 2);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleMinCuts("cut23", 2);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRule("myRule", 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal1", 2, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal2", 2, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal3", 2, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleViaRule("myvia12rule");
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleViaRule("myvia23rule");
-  CHECK_STATUS(status);
-  status = defwRealProperty("minlength", 50.5);
-  CHECK_STATUS(status);
-  status = defwStringProperty("firstName", "Only");
-  CHECK_STATUS(status);
-  status = defwIntProperty("idx", 1);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRule("myCustomRule", 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal1", 5, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal2", 5, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleLayer("metal3", 5, 0, 1, 0);
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleVia("myvia12_custom1");
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleVia("myvia12_custom2");
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleVia("myvia23_custom1");
-  CHECK_STATUS(status);
-  status = defwNonDefaultRuleVia("myvia23_custom2");
-  CHECK_STATUS(status);
-  status = defwEndNonDefaultRules();
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // STYLES
-  status = defwStartStyles(3);
-  CHECK_STATUS(status);
-  xP = (double*)malloc(sizeof(double)*6);
-  yP = (double*)malloc(sizeof(double)*6);
-  xP[0] = 30;
-  yP[0] = 10;
-  xP[1] = 10;
-  yP[1] = 30;
-  xP[2] = -10;
-  yP[2] = 30;
-  xP[3] = -30;
-  yP[3] = 10;
-  xP[4] = -30;
-  yP[4] = -10;
-  xP[5] = -10;
-  yP[5] = -30;
-  status = defwStyles(1, 6, xP, yP);
-  CHECK_STATUS(status);
-  status = defwStyles(2, 5, xP, yP);
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-  xP = (double*)malloc(sizeof(double)*8);
-  yP = (double*)malloc(sizeof(double)*8);
-  xP[0] = 30;
-  yP[0] = 10;
-  xP[1] = 10;
-  yP[1] = 30;
-  xP[2] = -10;
-  yP[2] = 30;
-  xP[3] = -30;
-  yP[3] = 10;
-  xP[4] = -30;
-  yP[4] = -10;
-  xP[5] = -10;
-  yP[5] = -30;
-  xP[6] = 10;
-  yP[6] = -30;
-  xP[7] = 30;
-  yP[7] = -10;
-  status = defwStyles(3, 8, xP, yP);
-  CHECK_STATUS(status);
-  status = defwEndStyles();
-  CHECK_STATUS(status);
-  free((char*)xP);
-  free((char*)yP);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-
-  // BEGINEXT
-  status = defwStartBeginext("tag");
-  CHECK_STATUS(status);
-   defwAddIndent();
-  status = defwBeginextCreator("CADENCE");
-  CHECK_STATUS(status);
-  // since the date is different each time,
-  // it will cause the quick test to fail
-  // status = defwBeginextDate();
-  // CHECK_STATUS(status);
-  status = defwBeginextRevision(5, 7);
-  CHECK_STATUS(status);
-  status = defwBeginextSyntax("OTTER", "furry");
-  CHECK_STATUS(status);
-  status = defwStringProperty("arrg", "later");
-  CHECK_STATUS(status);
-  status = defwBeginextSyntax("SEAL", "cousin to WALRUS");
-  CHECK_STATUS(status);
-  status = defwEndBeginext();
-  CHECK_STATUS(status);
-
-
-  status = defwEnd();
-  CHECK_STATUS(status);
-
-  lineNumber = defwCurrentLineNumber();
-  if (lineNumber == 0)
-     fprintf(stderr, "ERROR: nothing has been read.\n");
-
-  fclose(fout);
-
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwriteCbs.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwriteCbs.cpp
deleted file mode 100644
index d56d35d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defwrite/defwriteCbs.cpp
+++ /dev/null
@@ -1,1424 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "defwWriter.hpp"
-#include "defwWriterCalls.hpp"
-
-// Global variables
-char  defaultOut[128];
-FILE* fout;
-int   userData;
-
-#define CHECK_STATUS(status) \
-  if (status) {              \
-     defwPrintError(status); \
-     return(status);         \
-  }
-
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
-
-void checkType(defwCallbackType_e c) {
-  if (c >= 0 && c <= defwDesignEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-int versionCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwVersion(5, 6);
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int dividerCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwDividerChar("/");
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int busbitCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwBusBitChars("[]");
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int designCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwDesignName("muk");
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int technologyCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwTechnology("muk");
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int arrayCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwArray("core_array");
-  CHECK_STATUS(status);
-  return 0;
-
-}
- 
-int floorplanCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwFloorplan("DEFAULT");
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-int unitsCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwUnits(100);
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// history
-int historyCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwHistory("Corrected STEP for ROW_9 and added ROW_10 of SITE CORE1 (def)");
-  CHECK_STATUS(status);
-  status = defwHistory("Removed NONDEFAULTRULE from the net XX100 (def)");
-  CHECK_STATUS(status);
-  status = defwHistory("Changed some cell orientations (def)");
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// PROPERTYDEFINITIONS
-int propdefCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartPropDef();
-  CHECK_STATUS(status);
-  defwAddComment("defwPropDef is broken into 3 routines, defwStringPropDef");
-  defwAddComment("defwIntPropDef, and defwRealPropDef");
-  status = defwStringPropDef("REGION", "scum", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("REGION", "center", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("REGION", "area", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("GROUP", "ggrp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("GROUP", "site", 0, 25, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("GROUP", "maxarea", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("COMPONENT", "cc", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("COMPONENT", "index", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("COMPONENT", "size", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("NET", "alt", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("NET", "lastName", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NET", "length", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("SPECIALNET", "contype", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("SPECIALNET", "ind", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("SPECIALNET", "maxlength", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("DESIGN", "title", 0, 0, "Buffer");
-  CHECK_STATUS(status);
-  status = defwIntPropDef("DESIGN", "priority", 0, 0, 14);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("DESIGN", "howbig", 0, 0, 15.16);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("ROW", "minlength", 1.0, 100.0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("ROW", "firstName", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("ROW", "idx", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwIntPropDef("COMPONENTPIN", "dpIgnoreTerm", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("COMPONENTPIN", "dpBit", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("COMPONENTPIN", "realProperty", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("NET", "IGNOREOPTIMIZATION", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwStringPropDef("SPECIALNET", "IGNOREOPTIMIZATION", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("NET", "FREQUENCY", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwRealPropDef("SPECIALNET", "FREQUENCY", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = defwEndPropDef();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// DIEAREA
-int dieareaCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwDieArea(-190000, -120000, 190000, 70000);
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// ROW
-int rowCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwRow("ROW_9", "CORE", -177320, -111250, 5, 911, 1, 360, 0);
-  CHECK_STATUS(status);
-  status = defwRealProperty("minlength", 50.5);
-  CHECK_STATUS(status);
-  status = defwStringProperty("firstName", "Only");
-  CHECK_STATUS(status);
-  status = defwIntProperty("idx", 1);
-  CHECK_STATUS(status);
-  status = defwRow("ROW_10", "CORE1", -19000, -11000, 6, 1, 100, 0, 600);
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// TRACKS
-int trackCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-  const char** layers;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  layers = (const char**)malloc(sizeof(char*)*1);
-  layers[0] = strdup("M1");
-  status = defwTracks("X", 3000, 40, 120, 1, layers);
-  CHECK_STATUS(status);
-  free((char*)layers[0]);
-  layers[0] = strdup("M2");
-  status = defwTracks("Y", 5000, 10, 20, 1,layers);
-  CHECK_STATUS(status);
-  free((char*)layers[0]);
-  free((char*)layers);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// GCELLGRID
-int gcellgridCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwGcellGrid("X", 0, 100, 600);
-  CHECK_STATUS(status);
-  status = defwGcellGrid("Y", 10, 120, 400);
-  CHECK_STATUS(status);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// VIAS
-int viaCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartVias(2);
-  CHECK_STATUS(status);
-  status = defwViaName("VIA_ARRAY");
-  CHECK_STATUS(status);
-  status = defwViaRect("M1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("V1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("M2", -50, -50, 50, 50);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
-  CHECK_STATUS(status);
-  status = defwViaName("VIA_ARRAY1");
-  CHECK_STATUS(status);
-  status = defwViaRect("M1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("V1", -40, -40, 40, 40);
-  CHECK_STATUS(status);
-  status = defwViaRect("M2", -50, -50, 50, 50);
-  CHECK_STATUS(status);
-  status = defwOneViaEnd();
- 
-  status = defwEndVias();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// REGIONS
-int regionCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartRegions(2);
-  CHECK_STATUS(status);
-  status = defwRegionName("region1");
-  CHECK_STATUS(status);
-  status = defwRegionPoints(-500, -500, 300, 100);
-  CHECK_STATUS(status);
-  status = defwRegionPoints(500, 500, 1000, 1000);
-  CHECK_STATUS(status);
-  status = defwStringProperty("scum", "on top");
-  CHECK_STATUS(status);
-  status = defwIntProperty("center", 250);
-  CHECK_STATUS(status);
-  status = defwIntProperty("area", 730000);
-  CHECK_STATUS(status);
-  status = defwRegionName("region2");
-  CHECK_STATUS(status);
-  status = defwRegionPoints(4000, 0, 5000, 1000);
-  CHECK_STATUS(status);
-  status = defwStringProperty("scum", "on bottom");
-  CHECK_STATUS(status);
-  status = defwEndRegions();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// COMPONENTS
-int componentCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-  const char** foreigns;
-  int *foreignX, *foreignY, *foreignOrient;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  foreigns = (const char**)malloc(sizeof(char*)*1);
-  foreignX = (int*)malloc(sizeof(int)*1);
-  foreignY = (int*)malloc(sizeof(int)*1);
-  foreignOrient = (int*)malloc(sizeof(int)*1);
-  status = defwStartComponents(11);
-  CHECK_STATUS(status);
-  status = defwComponent("Z38A01", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 18592, 5400, 6, 0,
-                         NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("Z38A03", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 16576, 45600, 6,
-                         0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("Z38A05", "DFF3", 0, NULL, NULL, NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "PLACED", 51520, 9600, 6, 0,
-                         NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("|i0", "INV_B", 0, NULL, "INV", NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, NULL, 0, 0, -1, 0,
-                         "region1", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("|i1", "INV_B", 0, NULL, "INV", NULL, NULL, NULL,
-                         0, NULL, NULL, NULL, NULL, "UNPLACED", 1000, 1000, 0,
-                         0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("cell1", "CHM6A", 0, NULL, NULL, "generator", NULL,
-                         "USER", 0, NULL, NULL, NULL, NULL, "FIXED", 0, 10, 0,
-                         100, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("cell2", "CHM6A", 0, NULL, NULL, NULL, NULL,
-                         "NETLIST", 0, NULL, NULL, NULL, NULL, "COVER", 120,
-                         10, 4, 2, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  foreigns[0] = strdup("gds2name");
-  foreignX[0] = -500;
-  foreignY[0] = -500;
-  foreignOrient[0] = 3;
-  status = defwComponent("cell3", "CHM6A", 0, NULL, NULL, NULL, NULL,
-                         "TIMING", 1, foreigns, foreignX, foreignY,
-                         foreignOrient, "PLACED", 240,
-                         10, 0, 0, "region1", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("cell4", "CHM3A", 0, NULL, "CHM6A", NULL, NULL,
-                         "DIST", 0, NULL, NULL, NULL, NULL, "PLACED", 360,
-                         10, 1, 0, "region2", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwStringProperty("cc", "This is the copy list");
-  CHECK_STATUS(status);
-  status = defwIntProperty("index", 9);
-  CHECK_STATUS(status);
-  status = defwRealProperty("size", 7.8);
-  CHECK_STATUS(status);
-  status = defwComponent("scancell1", "CHK3A", 0, NULL, NULL, NULL, NULL,
-                         NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 500,
-                         10, 7, 0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwComponent("scancell2", "CHK3A", 0, NULL, NULL, NULL, NULL,
-                         NULL, 0, NULL, NULL, NULL, NULL, "PLACED", 700,
-                         10, 6, 0, NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwEndComponents();
-  CHECK_STATUS(status);
-  free((char*)foreigns[0]);
-  free((char*)foreigns);
-  free((char*)foreignX);
-  free((char*)foreignY);
-  free((char*)foreignOrient);
-  return 0;
-}
- 
-// PINS
-int pinCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartPins(6);
-  CHECK_STATUS(status);
-  status = defwPin("scanpin", "SCAN", 0, "INPUT", NULL, NULL, 0, 0, -1, NULL,
-                   0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = defwPin("pin1", "net1", 1, NULL, "POWER", NULL, 0, 0, -1, "M1",
-                   -5000, -100, -4950, -90);
-  CHECK_STATUS(status);
-  status = defwPin("pin2", "net2", 0, "INPUT", "SIGNAL", NULL, 0, 0, -1, "M1",
-                   -5000, 0, -4950, 10);
-  CHECK_STATUS(status);
-  status = defwPin("INBUS[1]", "|INBUS[1]", 0, "INPUT", "SIGNAL", "FIXED",
-                   45, -2160, 0, "M2", 0, 0, 30, 135);
-  CHECK_STATUS(status);
-  status = defwPin("INBUS<0>", "|INBUS<0>", 0, "INPUT", "SIGNAL", "PLACED",
-                   -45, 2160, 1, "M2", 0, 0, 30, 134);
-  CHECK_STATUS(status);
-  status = defwPin("OUTBUS<1>", "|OUTBUS<1>", 0, "OUTPUT", "SIGNAL", "COVER",
-                   2160, 645, 2, "M1", 0, 0, 30, 135);
-  CHECK_STATUS(status);
-  status = defwEndPins();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// PINPROPERTIES
-int pinpropCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartPinProperties(2);
-  CHECK_STATUS(status);
-  status = defwPinProperty("cell1", "PB1");
-  CHECK_STATUS(status);
-  status = defwStringProperty("dpBit", "1");
-  CHECK_STATUS(status);
-  status = defwRealProperty("realProperty", 3.4);
-  CHECK_STATUS(status);
-  status = defwPinProperty("cell2", "vdd");
-  CHECK_STATUS(status);
-  status = defwIntProperty("dpIgnoreTerm", 2);
-  CHECK_STATUS(status);
-  status = defwEndPinProperties();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// SPECIALNETS
-int snetCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-  const char **coorX, **coorY;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartSpecialNets(2);
-  CHECK_STATUS(status);
-  status = defwSpecialNet("net1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell1", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell2", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell3", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell4", "VDD", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetWidth("M1", 200);
-  CHECK_STATUS(status);
-  status = defwSpecialNetWidth("M2", 300);
-  CHECK_STATUS(status);
-  status = defwSpecialNetVoltage(3.2);
-  CHECK_STATUS(status);
-  status = defwSpecialNetSpacing("M1", 200, 190, 210);
-  CHECK_STATUS(status);
-  status = defwSpecialNetSource("TIMING");
-  CHECK_STATUS(status);
-  status = defwSpecialNetOriginal("VDD");
-  CHECK_STATUS(status);
-  status = defwSpecialNetUse("POWER");
-  CHECK_STATUS(status);
-  status = defwSpecialNetWeight(30);
-  CHECK_STATUS(status);
-  status = defwStringProperty("contype", "star");
-  CHECK_STATUS(status);
-  status = defwIntProperty("ind", 1);
-  CHECK_STATUS(status);
-  status = defwRealProperty("maxlength", 12.13);
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  status = defwSpecialNet("VSS");
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell1", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell2", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell3", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetConnection("cell4", "GND", 0);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathLayer("M1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathWidth(250);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathShape("IOWIRE");
-  CHECK_STATUS(status);
-  coorX = (const char**)malloc(sizeof(char*)*3);
-  coorY = (const char**)malloc(sizeof(char*)*3);
-  coorX[0] = strdup("5");
-  coorY[0] = strdup("15");
-  coorX[1] = strdup("125");
-  coorY[1] = strdup("*");
-  coorX[2] = strdup("245");
-  coorY[2] = strdup("*");
-  status = defwSpecialNetPathPoint(3, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetPathEnd();
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldStart("my_net");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldWidth(90);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("14100");
-  coorY[0] = strdup("342440");
-  coorX[1] = strdup("13920");
-  coorY[1] = strdup("*");
-  status = defwSpecialNetShieldPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M2_TURN");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("263200");
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M1_M2");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  coorX[0] = strdup("2400");
-  coorY[0] = strdup("*");
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldStart("my_net1");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldLayer("M2");
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldWidth(90);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  coorX[0] = strdup("14100");
-  coorY[0] = strdup("342440");
-  coorX[1] = strdup("13920");
-  coorY[1] = strdup("*");
-  status = defwSpecialNetShieldPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M2_TURN");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("263200");
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldVia("M1_M2");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  coorX[0] = strdup("2400");
-  coorY[0] = strdup("*");
-  status = defwSpecialNetShieldPoint(1, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwSpecialNetShieldEnd();
-  CHECK_STATUS(status);
-  status = defwSpecialNetPattern("STEINER");
-  CHECK_STATUS(status);
-  status = defwSpecialNetEstCap(100);
-  CHECK_STATUS(status);
-  status = defwSpecialNetEndOneNet();
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorX[2]);
-  free((char*)coorY[2]);
-  free((char*)coorX);
-  free((char*)coorY);
-  status = defwEndSpecialNets();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// NETS
-int netCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-  const char **coorX, **coorY;
-  const char **coorValue;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartNets(11);
-  CHECK_STATUS(status);
-  status = defwNet("net1");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "Q", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("net2");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell1", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell2", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell3", "PB1", 0);
-  CHECK_STATUS(status);
-  status = defwNetEstCap(200);
-  CHECK_STATUS(status);
-  status = defwNetWeight(2);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("net3");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell4", "PA3", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell2", "P10", 0);
-  CHECK_STATUS(status);
-  status = defwNetXtalk(30);
-  CHECK_STATUS(status);
-  status = defwNetOriginal("extra_crispy");
-  CHECK_STATUS(status);
-  status = defwNetSource("USER");
-  CHECK_STATUS(status);
-  status = defwNetUse("SIGNAL");
-  CHECK_STATUS(status);
-  status = defwIntProperty("alt", 37);
-  CHECK_STATUS(status);
-  status = defwStringProperty("lastName", "Unknown");
-  CHECK_STATUS(status);
-  status = defwRealProperty("length", 10.11);
-  CHECK_STATUS(status);
-  status = defwNetPattern("BALANCED");
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  coorX = (const char**)malloc(sizeof(char*)*5);
-  coorY = (const char**)malloc(sizeof(char*)*5);
-  coorValue = (const char**)malloc(sizeof(char*)*5);
-  status = defwNet("my_net");
-  CHECK_STATUS(status);
-  status = defwNetConnection("I1", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("BUF", "Z", 0);
-  CHECK_STATUS(status);
-  status = defwNetNondefaultRule("RULE1");
-  CHECK_STATUS(status);
-  status = defwNetShieldnet("VSS");
-  CHECK_STATUS(status);
-  status = defwNetShieldnet("VDD");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M2", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("14000");
-  coorY[0] = strdup("341440");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("9600");
-  coorY[1] = strdup("*");
-  coorValue[1] = NULL;
-  coorX[2] = strdup("*");
-  coorY[2] = strdup("282400");
-  coorValue[2] = NULL;
-  status = defwNetPathPoint(3, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("2400");
-  coorY[0] = strdup("*");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 1, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("2400");
-  coorY[0] = strdup("282400");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("240");
-  coorY[1] = strdup("*");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetNoshieldStart("M2");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("14100");
-  coorY[0] = strdup("341440");
-  coorX[1] = strdup("14000");
-  coorY[1] = strdup("*");
-  status = defwNetNoshieldPoint(2, coorX, coorY);
-  CHECK_STATUS(status);
-  status = defwNetNoshieldEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("|INBUS[1]");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i1", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("|INBUS<0>");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i0", "A", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("|OUTBUS<1>");
-  CHECK_STATUS(status);
-  status = defwNetConnection("|i0", "Z", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("MUSTJOIN");
-  CHECK_STATUS(status);
-  status = defwNetConnection("cell4", "PA1", 0);
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("XX100");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB3_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       189560, 27300, 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB2_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       169400, 64500, 0);
-  CHECK_STATUS(status);
-  status = defwNetVpin("V_SUB1_XX100", NULL, -333, -333, 333, 333, "PLACED",
-                       55160, 31500, 0);
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A05", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, "RULE1");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("54040");
-  coorY[0] = strdup("30300");
-  coorValue[0] = strdup("0");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("30900");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("0");
-  coorX[1] = strdup("56280");
-  coorY[1] = strdup("*");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("31500");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("55160");
-  coorY[1] = strdup("*");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A03", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("168280");
-  coorY[0] = strdup("63300");
-  coorValue[0] = strdup("7");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("64500");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("169400");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("8");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("Z38A01", "G");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("188400");
-  coorY[0] = strdup("26100");
-  coorValue[0] = strdup("0");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("27300");
-  coorValue[1] = strdup("0");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("189560");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("0");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  status = defwNetPathVia("M1_M2");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetEnd();
-  CHECK_STATUS(status);
-  status = defwNetSubnetStart("SUB0_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB1_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB2_XX100");
-  CHECK_STATUS(status);
-  status = defwNetSubnetPin("VPIN", "V_SUB3_XX100");
-  CHECK_STATUS(status);
-  status = defwNetNondefaultRule("RULE1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("269400");
-  coorY[0] = strdup("64500");
-  coorValue[0] = strdup("0");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("54900");
-  coorValue[1] = NULL;
-  coorX[2] = strdup("170520");
-  coorY[2] = strdup("*");
-  coorValue[2] = NULL;
-  coorX[3] = strdup("*");
-  coorY[3] = strdup("37500");
-  coorValue[3] = NULL;
-  coorX[4] = strdup("*");
-  coorY[4] = strdup("30300");
-  coorValue[4] = NULL;
-  status = defwNetPathPoint(5, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorX[2]);
-  free((char*)coorY[2]);
-  free((char*)coorX[3]);
-  free((char*)coorY[3]);
-  free((char*)coorX[4]);
-  free((char*)coorY[4]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("171080");
-  coorY[0] = strdup("*");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("17440");
-  coorY[1] = strdup("0");
-  coorValue[1] = strdup("0");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("*");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("26700");
-  coorValue[1] = strdup("8");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("177800");
-  coorY[0] = strdup("*");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("8");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("30300");
-  coorValue[1] = strdup("8");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("nd1VIA23");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("189560");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("8");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("nd1VIA12");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("27300");
-  coorValue[0] = strdup("0");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 1, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("55160");
-  coorY[0] = strdup("31500");
-  coorValue[0] = strdup("8");
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("34500");
-  coorValue[1] = strdup("0");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("149800");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("8");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("35700");
-  coorValue[0] = NULL;
-  coorX[1] = strdup("*");
-  coorY[1] = strdup("37500");
-  coorValue[1] = NULL;
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("*");
-  coorValue[0] = strdup("8");;
-  coorX[1] = strdup("170520");
-  coorY[1] = strdup("*");
-  coorValue[1] = strdup("0");
-  status = defwNetPathPoint(2, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  free((char*)coorValue[0]);
-  free((char*)coorX[1]);
-  free((char*)coorY[1]);
-  free((char*)coorValue[1]);
-  status = defwNetPathVia("M2_M3");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("SCAN");
-  CHECK_STATUS(status);
-  status = defwNetConnection("scancell1", "P10", 1);
-  CHECK_STATUS(status);
-  status = defwNetConnection("scancell2", "PA0", 1);
-  CHECK_STATUS(status);
-  status = defwNetSource("TEST");
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
- 
-  status = defwNet("testBug");
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A05", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A03", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetConnection("Z38A01", "G", 0);
-  CHECK_STATUS(status);
-  status = defwNetPathStart("ROUTED");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("1288210");
-  coorY[0] = strdup("580930");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("582820");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M3", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("1141350");
-  coorY[0] = strdup("582820");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("580930");
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("1278410");
-  coorY[0] = strdup("275170");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathStart("NEW");
-  CHECK_STATUS(status);
-  status = defwNetPathLayer("M1", 0, NULL);
-  CHECK_STATUS(status);
-  coorX[0] = strdup("1141210");
-  coorY[0] = strdup("271250");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH1W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("*");
-  coorY[0] = strdup("271460");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH2W1W1");
-  CHECK_STATUS(status);
-  coorX[0] = strdup("1142820");
-  coorY[0] = strdup("*");
-  coorValue[0] = NULL;
-  status = defwNetPathPoint(1, coorX, coorY, coorValue);
-  CHECK_STATUS(status);
-  free((char*)coorX[0]);
-  free((char*)coorY[0]);
-  status = defwNetPathVia("GETH3W1W1");
-  CHECK_STATUS(status);
-  status = defwNetPathEnd();
-  CHECK_STATUS(status);
-  status = defwNetEndOneNet();
-  CHECK_STATUS(status);
-  free((char*)coorX);
-  free((char*)coorY);
-  free((char*)coorValue);
-  status = defwEndNets();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// GROUPS
-int groupCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-  const char **groupExpr;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  groupExpr = (const char**)malloc(sizeof(char*)*2);
-  status = defwStartGroups(2);
-  CHECK_STATUS(status);
-  groupExpr[0] = strdup("cell2");
-  groupExpr[1] = strdup("cell3");
-  status = defwGroup("group1", 2, groupExpr);
-  CHECK_STATUS(status);
-  free((char*)groupExpr[0]);
-  free((char*)groupExpr[1]);
-  status = defwGroupRegion(0, 0, 0, 0, "region1");
-  CHECK_STATUS(status);
-  status = defwStringProperty("ggrp", "xx");
-  CHECK_STATUS(status);
-  status = defwIntProperty("side", 2);
-  CHECK_STATUS(status);
-  status = defwRealProperty("maxarea", 5.6);
-  CHECK_STATUS(status);
-  groupExpr[0] = strdup("cell1");
-  status = defwGroup("group2", 1, groupExpr);
-  CHECK_STATUS(status);
-  free((char*)groupExpr[0]);
-  status = defwGroupRegion(0, 10, 1000, 1010, NULL);
-  CHECK_STATUS(status);
-  status = defwStringProperty("ggrp", "after the fall");
-  CHECK_STATUS(status);
-  status = defwGroupSoft("MAXHALFPERIMETER", 4000, "MAXX", 10000, NULL, NULL);
-  CHECK_STATUS(status);
-  status = defwEndGroups();
-  CHECK_STATUS(status);
-  free((char*)groupExpr);
-  status = defwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-// BEGINEXT
-int extensionCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwStartBeginext("tag");
-  CHECK_STATUS(status);
-  status = defwBeginextCreator("CADENCE");
-  CHECK_STATUS(status);
-  status = defwBeginextDate();
-  CHECK_STATUS(status);
-  status = defwBeginextSyntax("OTTER", "furry");
-  CHECK_STATUS(status);
-  status = defwStringProperty("arrg", "later");
-  CHECK_STATUS(status);
-  status = defwBeginextSyntax("SEAL", "cousin to WALRUS");
-  CHECK_STATUS(status);
-  status = defwEndBeginext();
-  CHECK_STATUS(status);
-  return 0;
-}
- 
-static int designendCB(defwCallbackType_e c, defiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = defwEnd();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-main(int argc, char** argv) {
-  char* outfile;
-  int   status;    // return code, if none 0 means error
-  int   res;
-
-  // assign the default
-  strcpy(defaultOut, "def.in");
-  outfile  = defaultOut;
-  fout     = stdout;
-  userData = 0x01020304;
-
-  double* axis;
-  double* num1;
-  double* num2;
-  double* num3;
-
-  argc--;
-  argv++;
-  while (argc--) {
-     if (strcmp(*argv, "-o") == 0) {   // output filename
-        argv++;
-        argc--;
-        outfile = *argv;
-        if ((fout = fopen(outfile, "w")) == 0) {
-           fprintf(stderr, "ERROR: could not open output file\n");
-           return 2;
-        }
-     } else if (strncmp(*argv,  "-h", 2) == 0) {  // compare with -h[elp]
-        fprintf(stderr, "Usage: defwrite [-o <filename>] [-help]\n");
-        return 1;
-     } else {
-        fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-        return 2;
-     }
-     argv++;
-  }
-
-  // initalize
-  status = defwInitCbk(fout);
-  CHECK_STATUS(status);
-
-  // set the callback functions
-  defwSetArrayCbk (arrayCB);
-  defwSetBusBitCbk (busbitCB);
-  defwSetDividerCbk (dividerCB);
-  defwSetComponentCbk (componentCB);
-  defwSetDesignCbk (designCB);
-  defwSetDesignEndCbk ((defwVoidCbkFnType)designendCB);
-  defwSetDieAreaCbk (dieareaCB);
-  defwSetExtCbk (extensionCB);
-  defwSetFloorPlanCbk (floorplanCB);
-  defwSetGcellGridCbk (gcellgridCB);
-  defwSetGroupCbk (groupCB);
-  defwSetHistoryCbk (historyCB);
-  defwSetNetCbk (netCB);
-  defwSetPinCbk (pinCB);
-  defwSetPinPropCbk (pinpropCB);
-  defwSetPropDefCbk (propdefCB);
-  defwSetRegionCbk (regionCB);
-  defwSetRowCbk (rowCB);
-  defwSetSNetCbk (snetCB);
-  defwSetTechnologyCbk (technologyCB);
-  defwSetTrackCbk (trackCB);
-  defwSetUnitsCbk (unitsCB);
-  defwSetViaCbk (viaCB);
-
-  res = defwWrite(fout, outfile, (void*)userData);
-
-  fclose(fout);
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.cpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.cpp
deleted file mode 100644
index 3f87f9f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "zlib.h"
-#include "defzlib.hpp"
-#include "defrReader.hpp"
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/*
- * Private functions:
- */
-size_t defGZip_read(FILE* file, char* buf, size_t len) {
-  return (gzread((gzFile)file, buf, len));
-}
-
-/*
- * Public functions:
- */
-defGZFile 
-defGZipOpen(const char *gzipPath, const char* mode) {
-
-  if (!gzipPath)
-    return NULL;
-
-  defGZFile fptr  = gzopen(gzipPath, mode);
-
-  if (fptr) {
-    /* successfully open the gzip file */
-    /* set the read function to read from a compressed file */
-    defrSetReadFunction(defGZip_read);
-    return (defGZFile)fptr;
-  } else
-    return NULL;
-}
-
-int defGZipClose(defGZFile filePtr) {
-  defrUnsetReadFunction();
-  return (gzclose((gzFile)filePtr));
-}
-
-int defrReadGZip(defGZFile file, const char* gzipFile, defiUserData uData) {
-  return defrRead((FILE*)file, gzipFile, uData, 1);
-}
-
-void
-defrSetGZipReadFunction()
-{
-  defrSetReadFunction(defGZip_read);
-}
-
-defGZFile 
-defrGZipOpen(const char *gzipPath, const char* mode)
-{
-  if (!gzipPath)
-    return NULL;
-
-  return gzopen(gzipPath, mode);
-}
-
-int defrGZipClose(defGZFile filePtr) {
-  return (gzclose((gzFile)filePtr));
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.hpp b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.hpp
deleted file mode 100644
index 2416aa0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/defzlib/defzlib.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef LEFDEFZIP_H
-#define LEFDEFZIP_H
-
-#include "defiDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-typedef void* defGZFile;
-class defrContext;
-
-//
-// Name: defrSetReadGZipFunction
-// Description: Sets GZip read function for the parser
-// Returns: 0 if no errors
-//
-extern void defrSetGZipReadFunction();
-
-//
-// Name: defOpenGZip
-// Description: Open a gzip file
-// Returns: A file pointer
-//
-extern defGZFile defrGZipOpen(const char* gzipFile, const char* mode);
-
-// 
-// Name: defCloseGZip
-// Description: Close a gzip file
-// Returns: 0 if no errors
-//
-extern int defrGZipClose(defGZFile filePtr);
-
-//
-// Name: defrReadGZip
-// Description: Parse a def gzip file
-// Returns: 0 if no errors
-//
-extern int defrReadGZip(defGZFile file, const char* gzipFile, void* uData);
-
-//
-// FUNCTIONS TO BE OBSOLETED.
-// The API is kept only for compatibility reasons.
-//
-
-//
-// Name: defGZipOpen
-// Description: Open a gzip file
-// Returns: A file pointer
-//
-extern defGZFile defGZipOpen(const char* gzipFile, const char* mode);
-
-// 
-// Name: defGZipClose
-// Description: Close a gzip file
-// Returns: 0 if no errors
-//
-extern int defGZipClose(defGZFile filePtr);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapi.pdf b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapi.pdf
deleted file mode 100644
index ac9e909..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapi.pdf
+++ /dev/null
Binary files differ
diff --git a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapiWN.pdf b/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapiWN.pdf
deleted file mode 100644
index d9b20b3..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/def/5.8-p029/doc/defapiWN.pdf
+++ /dev/null
Binary files differ
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/.gitignore b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/.gitignore
deleted file mode 100644
index 110b907..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-bin/
-bin/lefdiff
-bin/lefrw
-bin/lefwrite
-lef/*.output
-lef/*.tab.h
-lef/*.tab.cpp
-lefdiff/lefdiff
-lefrw/lefrw
-lefwrite/lefwrite
-lefzlib/*.a
-include/*.h
-include/*.hpp
-lib/*.a
-*.a
-**/*.a
-
-Makefile
-CMakeCache.txt
-*.cmake
-CMakeFiles
-install_manifest.txt
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/CMakeLists.txt b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/CMakeLists.txt
deleted file mode 100644
index f55e794..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/CMakeLists.txt
+++ /dev/null
@@ -1,214 +0,0 @@
-# LEF PARSER CMAKE Compile Settings
-project(LEF_PARSER 
-  LANGUAGES CXX 
-)
-
-cmake_minimum_required(VERSION 2.6)
-
-set(LEFLIB_HOME ${CMAKE_CURRENT_SOURCE_DIR})
-message(STATUS "leflib_home: ${LEFLIB_HOME}")
-
-set(CMAKE_CXX_FLAGS_DEBUG "-g -ggdb")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3")
-
-# BISON and ZLIB is required to compile LEF/LEF Parsers.
-find_package(BISON)
-find_package(ZLIB)
-
-############################################################
-# Create a library for LEF
-############################################################
-set( LEFLIB_LEF_SRC
-  lef/crypt.cpp
-  lef/lefiArray.cpp
-  lef/lefiCrossTalk.cpp
-  lef/lefiDebug.cpp
-  lef/lefiEncryptInt.cpp
-  lef/lefiLayer.cpp
-  lef/lefiMacro.cpp
-  lef/lefiMisc.cpp
-  lef/lefiNonDefault.cpp
-  lef/lefiProp.cpp
-  lef/lefiPropType.cpp
-  lef/lefiTBExt.cpp
-  lef/lefiUnits.cpp
-  lef/lefiVia.cpp
-  lef/lefiViaRule.cpp
-  lef/lef_keywords.cpp
-  lef/lefrCallbacks.cpp
-  lef/lefrData.cpp
-  lef/lefrReader.cpp
-  lef/lefrSettings.cpp
-  lef/lef.tab.cpp
-  lef/lefwWriterCalls.cpp
-  lef/lefwWriter.cpp
-  )
-
-set( LEFLIB_LEFZLIB_SRC 
-  lefzlib/lefzlib.cpp
-  )
-
-set ( LEFLIB_CLEF_SRC 
-  clef/lefiEncryptExt.c
-  clef/lefiTBInt.c
-  clef/xlefiArray.cpp
-  clef/xlefiCrossTalk.cpp
-  clef/xlefiDebug.cpp
-  clef/xlefiEncryptInt.cpp
-  clef/xlefiLayer.cpp
-  clef/xlefiMacro.cpp
-  clef/xlefiMisc.cpp
-  clef/xlefiNonDefault.cpp
-  clef/xlefiProp.cpp
-  clef/xlefiPropType.cpp
-  clef/xlefiUnits.cpp
-  clef/xlefiUtil.cpp
-  clef/xlefiVia.cpp
-  clef/xlefiViaRule.cpp
-  clef/xlefrReader.cpp
-  clef/xlefwWriterCalls.cpp
-  clef/xlefwWriter.cpp
-)
-
-set (LEFLIB_CLEFZLIB_SRC
-  clefzlib/clefzlib.c
-  )
-
-set (LEFLIB_HEADERS
-  lef/lef.tab.h
-  lef/lex.h
-  lef/crypt.hpp
-  lef/lefiArray.hpp
-  lef/lefiCrossTalk.hpp
-  lef/lefiDebug.hpp
-  lef/lefiDefs.hpp
-  lef/lefiEncryptInt.hpp
-  lef/lefiKRDefs.hpp
-  lef/lefiLayer.hpp
-  lef/lefiMacro.hpp
-  lef/lefiMisc.hpp
-  lef/lefiNonDefault.hpp
-  lef/lefiProp.hpp
-  lef/lefiPropType.hpp
-  lef/lefiUnits.hpp
-  lef/lefiUser.hpp
-  lef/lefiUtil.hpp
-  lef/lefiVia.hpp
-  lef/lefiViaRule.hpp
-  lef/lefrCallBacks.hpp
-  lef/lefrData.hpp
-  lef/lefrReader.hpp
-  lef/lefrSettings.hpp
-  lef/lefwWriterCalls.hpp
-  lef/lefwWriter.hpp
-
-  lefzlib/lefzlib.hpp
-
-  clef/lefiArray.h
-  clef/lefiCrossTalk.h
-  clef/lefiDebug.h
-  clef/lefiEncryptInt.h
-  clef/lefiLayer.h
-  clef/lefiMacro.h
-  clef/lefiMisc.h
-  clef/lefiNonDefault.h
-  clef/lefiProp.h
-  clef/lefiPropType.h
-  clef/lefiTypedefs.h
-  clef/lefiUnits.h
-  clef/lefiUser.h
-  clef/lefiUtil.h
-  clef/lefiVia.h
-  clef/lefiViaRule.h
-  clef/lefMsgTable.h
-  clef/lefrReader.h
-  clef/lefwWriterCalls.h
-  clef/lefwWriter.h
-
-  clefzlib/lefzlib.h
-)
-
-
-# BISON dependencies
-add_custom_command( 
-  OUTPUT ${LEFLIB_HOME}/lef/lef.tab.cpp
-  COMMAND ${BISON_EXECUTABLE} -v -plefyy -d ${LEFLIB_HOME}/lef/lef.y 
-  COMMAND mv lef.tab.h ${LEFLIB_HOME}/lef/lef.tab.h
-  COMMAND mv lef.tab.c ${LEFLIB_HOME}/lef/lef.tab.cpp
-)
-add_custom_target(LefBisonTarget ALL DEPENDS lef/lef.tab.cpp)
-
-
-add_library( lef STATIC ${LEFLIB_LEF_SRC} )
-add_library( lefzlib STATIC ${LEFLIB_LEFZLIB_SRC} )
-
-add_library( clef STATIC ${LEFLIB_CLEF_SRC} )
-add_library( clefzlib STATIC ${LEFLIB_CLEFZLIB_SRC})
-
-
-set_target_properties( lef
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-)
-
-set_target_properties( lefzlib
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-)
-
-set_target_properties( clef
-  PROPERTIES
-  ARCHIVE_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-)
-
-set_target_properties( clefzlib 
-  PROPERTIES 
-  ARCHIVE_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  LIBRARY_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  RUNTIME_OUTPUT_DIRECTORY ${LEFLIB_HOME}/lib
-  LINKER_LANGUAGE CXX 
-)
-
-# include directory settings
-target_include_directories( lef
-  PUBLIC
-  lef/
-  )
-
-target_include_directories( lefzlib
-  PUBLIC
-  lef/
-  lefzlib/
-  )
-
-target_include_directories( clef 
-  PUBLIC
-  lef/
-  clef/
-  )
-
-target_include_directories( clefzlib
-  PUBLIC
-  lef/
-  lefzlib/
-  clef/
-  clefzlib/
-  )
-
-add_dependencies( clef lef )
-add_dependencies( lef LefBisonTarget )
-add_dependencies( lefzlib lef )
-add_dependencies( clefzlib clef )
-
-######################################################
-# install
-
-install(FILES ${LEFLIB_HEADERS} DESTINATION include)
-install(TARGETS lef lefzlib clef clefzlib DESTINATION lib)
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/LICENSE.TXT b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/LICENSE.TXT
deleted file mode 100644
index b7802a4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/LICENSE.TXT
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2012 - 2017, Cadence Design Systems
- 
-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
- 
-    http://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.
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef
deleted file mode 100644
index a5a2108..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef
+++ /dev/null
@@ -1,1962 +0,0 @@
-VERSION 5.8 ;
-NAMESCASESENSITIVE ON ;
-FIXEDMASK ;
-NOWIREEXTENSIONATPIN ON ;
-BUSBITCHARS "<>" ;
-DIVIDERCHAR ":" ;
-USEMINSPACING OBS OFF ;
-USEMINSPACING PIN ON ;
-CLEARANCEMEASURE EUCLIDEAN ;
-CLEARANCEMEASURE MAXXY ;
-
-&defines &VDD/GND_site = "VDDGND" ;
-&defines &VDD/GND_site = "VDDGND1" ;
-
-UNITS
-   TIME NANOSECONDS 100 ;
-   CAPACITANCE PICOFARADS 10 ;
-   RESISTANCE OHMS 10000 ;
-   POWER MILLIWATTS 10000 ;
-   CURRENT MILLIAMPS 10000 ;
-   VOLTAGE VOLTS 1000 ;
-   DATABASE MICRONS 20000 ;
-   FREQUENCY MEGAHERTZ 10 ;
-END UNITS
-
-MANUFACTURINGGRID 3.5 ;
-
-PROPERTYDEFINITIONS
-   LIBRARY NAME STRING "Cadence96" ;
-   LIBRARY intNum  INTEGER 20 ;
-   LIBRARY realNum REAL 21.22 ;
-   LIBRARY LEF57_MAXFLOATINGAREAGATE STRING "MAXFLOATINGAREA GATEISGROUND;" ;
-   LAYER lsp STRING ;
-   LAYER lip INTEGER ;
-   LAYER lrp REAL ;
-   LAYER LEF57_SPACING STRING ;
-   LAYER LEF57_SPACINGADJACENTCUTS STRING ;
-   LAYER LEF57_MAXFLOATINGAREA STRING ;
-   LAYER LEF57_ARRAYSPACING STRING ;
-   LAYER LEF57_SPACINGSAMENET STRING ;
-   LAYER LEF57_MINSTEP STRING ;
-   LAYER LEF57_ANTENNAGATEPLUSDIFF STRING ;
-   LAYER LEF57_ANTENNACUMROUTINGPLUSCUT STRING ;
-   LAYER LEF57_ANTENNAAREAMINUSDIFF STRING ;
-   LAYER LEF57_ANTENNAAREADIFFREDUCEPWL STRING ;
-   LAYER LEF57_ENCLOSURE STRING ;
-   VIA stringProperty STRING ;
-   VIA realProperty REAL ;
-   VIA COUNT INTEGER RANGE 1 100 ;
-   VIARULE vrsp STRING ;
-   VIARULE vrip INTEGER ;
-   VIARULE vrrp REAL ;
-   NONDEFAULTRULE ndrsp STRING ;
-   NONDEFAULTRULE ndrip INTEGER ;
-   NONDEFAULTRULE ndrrp REAL ;
-   MACRO stringProp STRING ;
-   MACRO integerProp INTEGER ;
-   MACRO WEIGHT REAL RANGE 1.0 100.0 ;
-   PIN TYPE STRING ;
-   PIN intProp INTEGER ;
-   PIN realProp REAL ;
-END PROPERTYDEFINITIONS
-
-LAYER POLYS
-   TYPE MASTERSLICE ;
-   PROPERTY lsp "top" lip 1 lrp 2.3 ;
-END POLYS
-
-LAYER POLYS01
-   TYPE MASTERSLICE ;
-END POLYS01
-
-LAYER CUT01
-   TYPE CUT ;
-   SPACING 0.35 ADJACENTCUTS 3 WITHIN 0.25 ;
-   DIAGPITCH 6.5 ;
-   OFFSET 0.5 .6 ;
-   PITCH 1.2 1.3 ;
-   PROPERTY lip 5 ;
-   PROPERTY LEF57_SPACING "SPACING 1.5 PARALLELOVERLAP ;" ;
-   PROPERTY LEF57_ARRAYSPACING "ARRAYSPACING  WIDTH 2.0 CUTSPACING 0.2 ARRAYCUTS 3 SPACING 1.0 ;" ;
-   PROPERTY LEF57_ENCLOSURE "ENCLOSURE ABOVE .01 .05 ;" ;
-   PROPERTY LEF57_ENCLOSURE "ENCLOSURE ABOVE .02 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 NOSHAREDEDGE ;" ;
-   PROPERTY LEF57_ENCLOSURE "ENCLOSURE BELOW .03 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 ;" ;
-   PROPERTY LEF57_ENCLOSURE "ENCLOSURE .05 .05 ;" ;
-   PROPERTY LEF57_ENCLOSURE "ENCLOSURE BELOW .08 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 NOSHAREDEDGE ;" ;
-END CUT01
-
-LAYER RX
-   TYPE ROUTING ;
-   MASK 2 ;
-   PITCH 1.8 ;
-   OFFSET 0.9 ;
-   WIDTH 1 ;
-   AREA 34.1 ;
-   MINIMUMCUT 2 WIDTH 2.5 ;
-   SPACING 0.6 ;
-   SPACING 0.18 LENGTHTHRESHOLD 0.9 ;
-   SPACING 0.4 RANGE 0.1 0.12 ;
-   SPACING 0.32 RANGE 1.01 2000.0 USELENGTHTHRESHOLD ;
-   SPACING 0.1 RANGE 0.1 0.1 INFLUENCE 2.01 RANGE 2.1 10000.0 ;
-   SPACING 0.44 RANGE 1.0 1.0 INFLUENCE 1.01 ;
-   SPACING 0.33 RANGE 1.01 20.0 INFLUENCE 1.01 ;
-   SPACING 0.7 RANGE 0.3 0.15 USELENGTHTHRESHOLD ;
-   SPACING 0.5 ;
-   SPACING 0.6 RANGE 4.5 6.12 RANGE 3.0 3.1 ;
-   SPACING 4.3 RANGE 0.1 0.1 INFLUENCE 3.81 RANGE 0.1 0.2 ;
-   SPACING 0.53 LENGTHTHRESHOLD 0.45 RANGE 0 0.1 ;
-   PROPERTY LEF57_SPACING "SPACING 2.2 ENDOFLINE 2.3 WITHIN 1.6 ;" ;
-   PROPERTY LEF57_ARRAYSPACING "ARRAYSPACING LONGARRAY CUTSPACING 0.2 ARRAYCUTS 3 SPACING 1.0 ARRAYCUTS 4 SPACING 1.5 ARRAYCUTS 5 SPACING 2.0 ;" ;
-   DIRECTION HORIZONTAL ;
-   WIREEXTENSION 0.75 ;
-   RESISTANCE RPERSQ 0.103 ;
-   CAPACITANCE CPERSQDIST 0.000156 ;
-   HEIGHT 9 ;
-   THICKNESS 1 ;
-   SHRINKAGE 0.1 ;
-   SLOTWIREWIDTH 5 ;
-   SLOTWIRELENGTH 4 ;
-   SLOTWIDTH 6 ;
-   SLOTLENGTH 5 ;
-   MAXADJACENTSLOTSPACING 45 ;
-   MAXCOAXIALSLOTSPACING 55 ;
-   SPLITWIREWIDTH 5 ;
-   MINIMUMDENSITY 4 ;
-   MAXIMUMDENSITY 10 ;
-#   DENSITYCHECKWINDOW 4 5 ;
-   DENSITYCHECKSTEP 2 ;
-   FILLACTIVESPACING 4 ;
-   CAPMULTIPLIER 1 ;
-   EDGECAPACITANCE 0.00005 ;
-   ANTENNAMODEL OXIDE1 ;
-   ANTENNAAREAFACTOR 1 ;
-   ANTENNAMODEL OXIDE2 ;
-   ANTENNAAREARATIO 4.6 ;
-   ANTENNAAREARATIO 7.6 ;
-   ANTENNADIFFAREARATIO 4.7 ;
-   ANTENNADIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNACUMAREARATIO 6.7 ;             # 5.7
-   ANTENNAAREAFACTOR 10 ;                # 5.7
-   ANTENNACUMROUTINGPLUSCUT ;            # 5.7
-   ANTENNAAREAMINUSDIFF 100.0 ;          # 5.7
-   ANTENNAGATEPLUSDIFF 2.0 ;             # 5.7
-   ANTENNACUMDIFFAREARATIO 1000 ;        # 5.7
-   ANTENNAAREADIFFREDUCEPWL ( ( 0.0 1.0 ) ( 0.09999 1.0 ) ( 0.1 0.2 ) ( 1.0 0.1 ) ( 1000.0 0.1 ) ) ;
-   ANTENNACUMDIFFAREARATIO 1000 ;        # 5.7
-   PROPERTY LEF57_ANTENNACUMROUTINGPLUSCUT "ANTENNACUMROUTINGPLUSCUT ;" ;
-   PROPERTY LEF57_ANTENNAAREAMINUSDIFF "ANTENNAAREAMINUSDIFF 100.0 ;" ;
-   PROPERTY LEF57_ANTENNAGATEPLUSDIFF "ANTENNAGATEPLUSDIFF 2.0 ;" ;
-   PROPERTY LEF57_ANTENNAAREADIFFREDUCEPWL "ANTENNAAREADIFFREDUCEPWL ( ( 0.0 1.0 ) ( 0.0999 1.0 ) ( 0.1 0.2 ) ( 1.0 0.1 ) ( 1000.0 0.1 ) ) ;" ;
-   ANTENNACUMDIFFAREARATIO 4.5 ;
-   ANTENNACUMDIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNAAREAFACTOR 6.5 ;
-   ANTENNAAREAFACTOR 6.5 DIFFUSEONLY ;
-   ANTENNASIDEAREARATIO 6.5 ;
-   ANTENNADIFFSIDEAREARATIO 6.5 ;
-   ANTENNADIFFSIDEAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNACUMSIDEAREARATIO 4.5 ;
-   ANTENNACUMSIDEAREARATIO 7.5 ;
-   ANTENNACUMDIFFSIDEAREARATIO 4.6 ; 
-   ANTENNACUMDIFFSIDEAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNASIDEAREAFACTOR 6.5 ;
-   ANTENNASIDEAREAFACTOR 7.5 DIFFUSEONLY ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNAMODEL OXIDE4 ;
-   PROPERTY lsp "rxlay" lip 3 lrp 1.2 ;
-   CURRENTDEN 1E3 ;
-#   CURRENTDEN ( 1E3 4E5 ) ;
-   ACCURRENTDENSITY PEAK
-      FREQUENCY 1E6 100E6 ;
-   TABLEENTRIES 0.5E-6 0.4E-6 ;
-   ACCURRENTDENSITY AVERAGE 5.5 ;
-   ACCURRENTDENSITY RMS
-      FREQUENCY 100E6 400E6 800E6 ;
-   WIDTH     0.4 0.8 10.0 50.0 100.0 ;
-   TABLEENTRIES
-      2.0E-6 1.9E-6 1.8E-6 1.7E-6 1.5E-6
-      1.4E-6 1.3E-6 1.2E-6 1.1E-6 1.0E-6
-      0.9E-6 0.8E-6 0.7E-6 0.6E-6 0.4E-6 ;
-   DCCURRENTDENSITY AVERAGE
-      WIDTH 20.0 50.0 ;
-   TABLEENTRIES 0.6E-6 0.5E-6 ;
-END RX
-
-LAYER CUT12
-TYPE CUT ;
-   DIAGPITCH 1.5 1.7 ;
-   DIAGWIDTH 1.6 ;
-   DIAGSPACING 0.5 ;
-   SPACING 0.7 LAYER RX ;
-   SPACING 0.22 ADJACENTCUTS 4 WITHIN 0.25 ;
-   SPACING 1.5 PARALLELOVERLAP ;                             # 5.7
-   SPACING 1.2 ADJACENTCUTS 2 WITHIN 1.5 EXCEPTSAMEPGNET ;   # 5.7
-   # 5.4
-   ANTENNAMODEL OXIDE1 ;
-   ANTENNAMODEL OXIDE2 ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNAMODEL OXIDE4 ;
-   ANTENNAAREAFACTOR 5.4 ;
-   ANTENNACUMROUTINGPLUSCUT ;            # 5.7
-   ANTENNAAREAMINUSDIFF 100.0 ;          # 5.7
-   ANTENNAGATEPLUSDIFF 2.0 ;             # 5.7
-   ANTENNADIFFAREARATIO 1000 ;           # 5.7
-   ANTENNACUMDIFFAREARATIO 5000 ;        # 5.7
-   ANTENNADIFFAREARATIO 6.5 ;
-   ANTENNAAREADIFFREDUCEPWL ( ( 0.0 1.0 ) ( 0.09999 1.0 ) ( 0.1 0.2 ) ( 1.0 0.1 ) ( 1000.0 0.1 ) ) ;                     # 5.7
-   ANTENNADIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNACUMDIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-   ANTENNACUMDIFFAREARATIO 5.6 ;
-   ANTENNAAREARATIO 5.6 ;
-   ANTENNACUMAREARATIO 6.7 ;
-   ACCURRENTDENSITY PEAK
-   FREQUENCY 1E6 100E6 ;
-   TABLEENTRIES 0.5E-6 0.4E-6 ;
-   ACCURRENTDENSITY AVERAGE 5.5 ;
-   ACCURRENTDENSITY RMS
-   FREQUENCY 100E6 400E6 800E6 ;
-   CUTAREA     0.4 0.8 10.0 50.0 100.0 ;
-   TABLEENTRIES
-      2.0E-6 1.9E-6 1.8E-6 1.7E-6 1.5E-6
-      1.4E-6 1.3E-6 1.2E-6 1.1E-6 1.0E-6
-      0.9E-6 0.8E-6 0.7E-6 0.6E-6 0.4E-6 ;
-   DCCURRENTDENSITY AVERAGE
-   CUTAREA 2.0 5.0 ; 
-   TABLEENTRIES 0.5E-6 0.4E-6 ;
-   DCCURRENTDENSITY AVERAGE 4.9 ;
-END CUT12
-
-LAYER PC
-   TYPE ROUTING ;
-   WIDTH 1 ;
-   WIREEXTENSION 0.4 ; #should be ignored
-   PITCH 3.8 3.5 ;
-   DIAGPITCH 1.4 ;
-   SPACING 0.6 ;
-   SPACING 1.2 ENDOFLINE 1.3 WITHIN 0.6 ;  # 5.7
-   SPACING 1.3 ENDOFLINE 1.4 WITHIN 0.7 PARALLELEDGE 1.1 WITHIN 0.5 TWOEDGES ;
-   SPACING 1.4 ENDOFLINE 1.5 WITHIN 0.8 PARALLELEDGE 1.2 WITHIN 0.6 ;  # 5.7
-   DIRECTION VERTICAL ;
-   RESISTANCE RPERSQ PWL ( ( 1 0.103 ) ( 10 4.7 ) ) ;
-   CAPACITANCE CPERSQDIST PWL ( ( 1 0.000156 ) ( 10 0.001 ) ) ;
-   ANTENNAAREARATIO 5.4 ;
-   ANTENNADIFFAREARATIO 6.5 ;
-   ANTENNACUMAREARATIO 7.5 ;
-   ANTENNACUMDIFFAREARATIO PWL ( ( 5.0 5.1 ) ( 6.0 6.1 ) ) ;
-   ANTENNAAREAFACTOR 4.5 ;
-   ANTENNASIDEAREARATIO 6.5 ;
-   ANTENNADIFFSIDEAREARATIO PWL ( ( 7.0 7.1 ) ( 7.2 7.3 ) ) ;  
-   ANTENNACUMSIDEAREARATIO 7.4 ;
-   ANTENNACUMDIFFSIDEAREARATIO PWL ( ( 8.0 8.1 ) ( 8.2 8.3 ) ( 8.4 8.5 )
-        ( 8.6 8.7 ) ) ;
-   ANTENNASIDEAREAFACTOR 9.0 DIFFUSEONLY ;
-
-   ACCURRENTDENSITY PEAK
-      FREQUENCY 1E6 100E6 ;
-      WIDTH 5.6 8.5 8.1 4.5 ;
-      TABLEENTRIES 0.5E-6 0.4E-6 ;
-   DCCURRENTDENSITY AVERAGE
-   WIDTH 20.0 50.0 100.0 ;
-   TABLEENTRIES 1.0E-6 0.7E-6 0.5E-6 ;
-END PC
-
-LAYER CA
-   TYPE CUT ;
-   DCCURRENTDENSITY AVERAGE
-   CUTAREA   2.0 5.0 10.0 ;
-   TABLEENTRIES 0.6E-6 0.5E-6 0.4E-6 ; 
-END CA
-
-LAYER M1
-   TYPE ROUTING ;
-   WIDTH 1 ;
-   WIREEXTENSION 7 ;
-   PITCH 1.8 ;
-   DIRECTION HORIZONTAL ;
-   RESISTANCE RPERSQ 0.103 ;
-   CAPACITANCE CPERSQDIST 0.000156 ;
-   ANTENNACUMAREARATIO 300 ;
-   ANTENNACUMDIFFAREARATIO 600 ;
-   ANTENNAGATEPLUSDIFF 2.0 ;             # 5.7
-   ANTENNADIFFAREARATIO 1000 ;           # 5.7
-   ANTENNACUMDIFFAREARATIO 5000 ;        # 5.7
-   SPACINGTABLE
-      PARALLELRUNLENGTH 0.00 0.50 3.00 5.00
-         WIDTH 0.00      0.15 0.15 0.15 0.15
-         WIDTH 0.25      0.15 0.20 0.20 0.20
-         WIDTH 1.50      0.15 0.50 0.50 0.50
-         WIDTH 3.00      0.15 0.50 1.00 1.00
-         WIDTH 5.00      0.15 0.50 1.00 2.00 ;
-   SPACINGTABLE
-      INFLUENCE
-         WIDTH 1.5 WITHIN 0.5 SPACING 0.5
-         WIDTH 3.0 WITHIN 1.0 SPACING 1.0
-         WIDTH 5.0 WITHIN 2.0 SPACING 2.0 ;
-   ACCURRENTDENSITY AVERAGE 5.5 ;
-   DCCURRENTDENSITY AVERAGE 4.9 ;
-END M1
-
-LAYER V1
-   TYPE CUT ;
-   SPACING 0.6 LAYER CA ;
-END V1
-
-LAYER M2
-   TYPE ROUTING ;
-   WIDTH 0.9 ;
-   WIREEXTENSION 8 ;
-   PITCH 1.8 ;
-   SPACING 0.9 ;
-   SPACING 0.28 ;
-   SPACING 0.24 LENGTHTHRESHOLD 1.0 ;
-   SPACING 0.32 RANGE 1.01 9.99 USELENGTHTHRESHOLD ;
-   SPACING 0.5 RANGE 10.0 1000.0 ;
-   SPACING 0.5 RANGE 10.0 1000.0 INFLUENCE 1.00 ;
-   SPACING 0.5 RANGE 10.0 1000.0 INFLUENCE 1.0 RANGE .28 1.0 ;
-   SPACING 0.5 RANGE 3.01 4.0 RANGE 4.01 5.0 ;
-   SPACING 0.4 RANGE 3.01 4.0 RANGE 5.01 1000.0 ;
-   SPACING 1.0 SAMENET PGONLY ;          # 5.7
-   SPACING 1.1 SAMENET ;                 # 5.7
-   PROPERTY LEF57_SPACING "SPACING 1.2 ENDOFLINE 1.3 WITHIN 0.6 PARALLELEDGE 2.1 WITHIN 1.5 TWOEDGES ;" ;
-   PROPERTY LEF57_SPACING "SPACING 1.5 ENDOFLINE 2.3 WITHIN 1.6 PARALLELEDGE 1.1 WITHIN 0.5 ;" ;
-   DIRECTION DIAG45 ;
-   RESISTANCE RPERSQ 0.0608 ;
-   CAPACITANCE CPERSQDIST 0.000184 ;
-   PROPERTY LEF57_MAXFLOATINGAREA "MAXFLOATINGAREA 1000 ;" ;
-   ANTENNAMODEL OXIDE1 ;
-   ANTENNACUMAREARATIO 5000 ;
-   ANTENNACUMDIFFAREARATIO 8000 ;
-   ANTENNAMODEL OXIDE2 ;
-   ANTENNACUMAREARATIO 500 ;
-   ANTENNACUMDIFFAREARATIO 800 ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNACUMAREARATIO 300 ;
-   ANTENNACUMDIFFAREARATIO 600 ;
-END M2
-
-LAYER V2
-   TYPE CUT ;
-END V2
-
-LAYER M3
-   TYPE ROUTING ;
-   WIDTH 0.9 ;
-   WIREEXTENSION 8 ;
-   PITCH 1.8 ;
-   SPACING 0.9 ;
-   DIRECTION HORIZONTAL ;
-   RESISTANCE RPERSQ 0.0608 ;
-   CAPACITANCE CPERSQDIST 0.000184 ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNACUMAREARATIO 5000 ;
-   ANTENNACUMDIFFAREARATIO 8000 ;
-   ANTENNAMODEL OXIDE4 ;
-   ANTENNACUMAREARATIO 500 ;
-   ANTENNACUMDIFFAREARATIO 800 ;
-   ANTENNAMODEL OXIDE1 ;
-   ANTENNACUMAREARATIO 300 ;
-   ANTENNACUMDIFFAREARATIO 600 ;
-   PROPERTY LEF57_MINSTEP "MINSTEP 1.0 MAXEDGES 2 ;" ;
-END M3
-
-LAYER M4
-   TYPE ROUTING ;
-   PITCH 5.4 ;
-   WIDTH 5.4 ;
-   DIRECTION VERTICAL ;
-   DIRECTION HORIZONTAL ;
-   # 2 via cuts required for m4 > 0.50 um when connecting from m3
-   MINIMUMCUT 2 WIDTH 0.50 ;
-   # 2 via cuts required for m4 > 0.70 um when connecting from m5
-   MINIMUMCUT 2 WIDTH 0.70 FROMBELOW ;
-   MINIMUMCUT 3 WIDTH 0.80 WITHIN 0.3 ;       # 5.7
-   MINIMUMCUT 2 WIDTH 1.00 FROMBELOW LENGTH 20.0 WITHIN 5.0 ;
-   # 4 via cuts are required for m4 > 1.0 um when connecting from m3 or m5
-   MINIMUMCUT 4 WIDTH 1.0 FROMABOVE ;
-   # 2 via cuts are required if m4 > 1.1 um wide and m4 > 20.0 um long,
-   # and the via cut is < 5.0 um away from the wide wire
-   MINIMUMCUT 2 WIDTH 1.1 LENGTH 20.0 WITHIN 5.0 ;
-   MINIMUMCUT 2 WIDTH 1.1 FROMABOVE LENGTH 20.0 WITHIN 5.0 ;
-   MINENCLOSEDAREA 0.30 ; # donut hole must be >= 0.30 um^2
-   MINENCLOSEDAREA 0.40 WIDTH 0.15 ; # hole area >= 0.40 um^2 when w<=0.15
-   MINENCLOSEDAREA 0.80 WIDTH 0.50 ; # hole area >= 0.80 um^2 when w<=0.55
-   MAXWIDTH 10.0 ;
-   MINWIDTH 0.15 ;
-   PROTRUSIONWIDTH 0.30 LENGTH 0.60 WIDTH 1.20 ;
-   MINSTEP .20 ;
-END M4
-
-LAYER M5
-   TYPE ROUTING ;
-   PITCH 5.4 ;
-   WIDTH 4.0 ;
-   DIRECTION DIAG135 ;
-   MINSTEP 0.05 ;
-   MINSTEP 0.04 ;
-   MINSTEP 0.05 LENGTHSUM 0.08 ;
-   MINSTEP 0.05 LENGTHSUM 0.16 ;
-   MINSTEP 0.05 INSIDECORNER ;
-   MINSTEP 0.05 INSIDECORNER LENGTHSUM 0.15 ;
-   MINSTEP 1.0 MAXEDGES 2 ;                 # 5.7
-   MINIMUMCUT 2 WIDTH 0.70 ;
-   MINIMUMCUT 4 WIDTH 1.0 FROMABOVE ;
-   MINIMUMCUT 2 WIDTH 1.1 LENGTH 20.0 WITHIN 5.0 ;
-   MINIMUMCUT 5 WIDTH 0.5  ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNACUMAREARATIO 5000 ;
-   ANTENNACUMDIFFAREARATIO 8000 ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNACUMAREARATIO 500 ;
-   ANTENNACUMDIFFAREARATIO 800 ;
-   ANTENNAMODEL OXIDE3 ;
-   ANTENNACUMAREARATIO 300 ;
-   ANTENNACUMDIFFAREARATIO 600 ;
-END M5
-
-LAYER implant1
-   TYPE IMPLANT ;
-   WIDTH 0.50 ;
-   SPACING 0.50 ;
-   PROPERTY lrp 5.4 ;
-END implant1
-        
-LAYER implant2
-   TYPE IMPLANT ;
-   WIDTH 0.50 ;
-   SPACING 0.50 ;
-   PROPERTY lsp "bottom" ;
-END implant2
-
-LAYER V3
-   TYPE CUT ;
-END V3
-
-LAYER MT
-   TYPE ROUTING ;
-   WIDTH 0.9 ;
-   PITCH 1.8 ;
-   SPACING 0.9 ;
-   DIRECTION VERTICAL ;
-   RESISTANCE RPERSQ 0.0608 ;
-   CAPACITANCE CPERSQDIST 0.000184 ;
-   MINSTEP 0.05 STEP ;
-   MINSTEP 0.05 STEP LENGTHSUM 0.08 ;
-   MINSTEP 0.04 STEP ;
-   DIAGMINEDGELENGTH .075 ;
-END MT
-
-layer OVERLAP
-   TYPE OVERLAP ;
-   PROPERTY lip 5 lsp "top" ;
-   PROPERTY lrp 5.5 lsp "bottom" ;
-END OVERLAP
-
-LAYER via12
-   TYPE CUT ;
-   WIDTH 0.20 ;            #cuts .20 x .20 squares
-   SPACING 0.15 CENTERTOCENTER ;  #via12 center-to-center spacing is 0.15
-   ENCLOSURE BELOW .03 .01 ;    #m1; 0.03 on two sides, 0.01 on other sides
-   ENCLOSURE ABOVE .05 .01 ;    #m2; 0.05 on two sides, 0.01 on other sides
-   ENCLOSURE ABOVE .04 .09 ;    #m3; 0.04 on two sides, 0.09 on other sides
-   PREFERENCLOSURE BELOW 0.06 0.01 ;
-   PREFERENCLOSURE ABOVE 0.08 0.2 ;
-   RESISTANCE 10.0 ;            #10.0 ohms per cut
-END via12
-
-LAYER metal1
-   TYPE ROUTING ;
-   WIDTH 0.9 ;
-   PITCH 1.8 ;
-   DIRECTION VERTICAL ;
-   MINSIZE 0.14 0.30 0.5 0.56 0.01 0.05  ;
-END metal1
-
-LAYER via23
-   TYPE CUT ;
-   WIDTH 0.20 ;            #cuts .20 x .20 squares
-   SPACING 0.15 ;          #via23 edge-to-edge spacing is 0.15
-   ENCLOSURE .05 .01 ;     #m2, m3:0.05 on two sides, 0.01 on other sides
-   ENCLOSURE .02 .02 WIDTH 1.0 ; #m2 needs 0.02 on all sides if m2 width
-                                 #>= 1.0
-                           #m3 needs 0.02 on all sides if m3 width >= 1.0
-   ENCLOSURE .05 .05 WIDTH 2.0 ; #m2 needs 0.05 on all sides if m2 width
-                            #>= 2.0
-                           #m3 needs 0.02 on all sides if m3 width >= 3.0
-   RESISTANCE 10.0 ;       #10.0 ohms per cut
-END via23
-
-LAYER via34
-   TYPE CUT ;
-   WIDTH 0.25 ;            #cuts .25 x .25 squares
-   SPACING 0.10 CENTERTOCENTER ;      # 5.7
-   ENCLOSURE .05 .01 ;     #m3, m4 must meet the enclosure rule
-   ENCLOSURE .05 0.0 LENGTH 0.7 ;     # 5.7
-   ENCLOSURE BELOW .07 .07 WIDTH 1.0 ; #m3 needs .07um on all sides if
-                                       #the m3 width is >= 1.0um
-   ENCLOSURE ABOVE .09 .09 WIDTH 1.0 ; #m4 needs .09um on all sides if
-                                       #the m4 width is >= 1.0um 
-   ENCLOSURE 0.03 0.03 WIDTH 1.0 EXCEPTEXTRACUT 0.2 ;   # 5.7
-   RESISTANCE 8.0 ;                    #8.0 ohms per cut
-END via34
-
-LAYER cut23                # 5.7
-   TYPE CUT ;
-   SPACING 0.20 SAMENET LAYER cut12 STACK ;
-   SPACING 0.30 CENTERTOCENTER SAMENET AREA 0.02 ;
-   SPACING 0.40 AREA 0.5 ;
-   SPACING 0.10 ;
-   SPACINGTABLE ORTHOGONAL
-      WITHIN 0.15 SPACING 0.11
-      WITHIN 0.13 SPACING 0.13
-      WITHIN 0.11 SPACING 0.15 ;
-   ARRAYSPACING LONGARRAY CUTSPACING 0.2
-      ARRAYCUTS 3 SPACING 1.0
-      ARRAYCUTS 4 SPACING 1.5
-      ARRAYCUTS 5 SPACING 2.0 ;
-END cut23
-
-LAYER cut24                # 5.7
-   TYPE ROUTING ;
-   WIDTH 1 ;
-   PITCH 1.8 ;
-   DIRECTION HORIZONTAL ;
-   SPACING 0.10 ;
-   SPACING 0.12 NOTCHLENGTH 0.15 ;
-   SPACING 0.14 ENDOFNOTCHWIDTH 0.15 NOTCHSPACING 0.16 NOTCHLENGTH 0.08 ;
-   ARRAYSPACING WIDTH 2.0 CUTSPACING 0.2 ARRAYCUTS 3 SPACING 1.0 ;
-END cut24
-
-LAYER cut25                # 5.7
-   TYPE ROUTING ;
-   WIDTH 1 ;
-   WIREEXTENSION 7 ;
-   PITCH 1.8 ;
-   DIRECTION HORIZONTAL ;
-   SPACINGTABLE
-      TWOWIDTHS
-         WIDTH 0.00          0.15 0.20 0.50 1.00
-         WIDTH 0.25 PRL 0.0  0.20 0.25 0.50 1.00
-         WIDTH 1.50 PRL 1.50 0.50 0.50 0.60 1.00
-         WIDTH 3.00 PRL 3.00 1.00 1.00 1.00 1.20 ;
-END cut25
-
-MAXVIASTACK 4 RANGE m1 m7 ;
-
-#layer VIRTUAL
-#   TYPE OVIRTUAL ;
-#END VIRTUAL
-
-VIA IN1X
-   TOPOFSTACKONLY 
-   FOREIGN IN1X ;
-   RESISTANCE 2 ;
-   LAYER RX ; RECT -0.7 -0.7 0.7 0.7 ; RECT 0.0 0 2.1 2.3 ; RECT 5.7 0 95.7 2.3 ; RECT 101.9 0 119.6 2.3 ;
-   LAYER CUT12 ;
-      RECT -0.25 -0.25 0.25 0.25 ;
-   LAYER PC ;
-      RECT -0.6 -0.6 0.6 0.6 ;
-   PROPERTY stringProperty "DEFAULT" realProperty 32.33 COUNT 34 ;
-END IN1X
-
-VIA M1_M2 DEFAULT
-   RESISTANCE 1.5 ;
-   LAYER M1 ;
-      RECT MASK 1 -0.6 -0.6 0.6 0.6 ;
-   LAYER V1 ;
-      RECT MASK 2 -0.45 -0.45 0.45 0.45 ;
-   LAYER M2 ;
-      RECT MASK 3 -0.45 -0.45 0.45 0.45 ;
-      RECT MASK 1 -0.9 -0.45 0.9 0.45 ;
-END M1_M2
-
-VIA M2_M3 DEFAULT
-   RESISTANCE 1.5 ;
-   LAYER M2 ;
-      RECT -0.45 -0.9 0.45 0.9 ;
-   LAYER V2 ;
-      RECT -0.45 -0.45 0.45 0.45 ;
-   LAYER M3 ;
-      RECT -0.45 -0.45 0.45 0.45 ;
-END M2_M3
-
-VIA M2_M3_PWR GENERATED
-   RESISTANCE 0.4 ;
-   LAYER M2 ;
-      RECT -1.35 -1.35 1.35 1.35 ;
-   LAYER V2 ;
-      RECT -1.35 -1.35 -0.45 1.35 ;
-      RECT 0.45 -1.35 1.35 -0.45 ;
-      RECT 0.45 0.45 1.35 1.35 ;
-   LAYER M3 ;
-      RECT -1.35 -1.35 1.35 1.35 ;
-END M2_M3_PWR
-
-VIA M3_MT DEFAULT
-   RESISTANCE 1.5 ;
-   LAYER M3 ;
-      RECT MASK 1 -0.9 -0.45 0.9 0.45 ;
-   LAYER V3 ;
-      RECT MASK 2 -0.45 -0.45 0.45 0.45 ;
-   LAYER MT ;
-      RECT MASK 3 -0.45 -0.45 0.45 0.45 ;
-END M3_MT
-
-VIA myBlockVia0
-   VIARULE viaName0 ;
-   CUTSIZE 0.1 0.1 ;
-   LAYERS metal1 via12 metal2 ;
-   CUTSPACING 0.1 0.1 ;
-   ENCLOSURE 0.05 0.01 0.01 0.05 ;
-   ROWCOL 5 14 ;
-   PATTERN 2_FF70_3_R4F ;
-END myBlockVia0
-
-VIA VIACENTER12
-   LAYER M1 ;
-      RECT -4.6 -2.2 4.6 2.2 ;
-   LAYER V1 ;
-      RECT -3.1 -0.8 -1.9 0.8 ;
-      RECT 1.9 -0.8 3.1 0.8 ;
-   LAYER M2 ;
-      RECT -4.4 -2.0 4.4 2.0 ;
-   RESISTANCE 0.24 ; 
-END VIACENTER12
-
-VIA M2_TURN 
-   LAYER M2 ;
-      RECT -0.45 -0.45 0.45 0.45 ;
-      RECT -4.4 -2.0 4.4 2.0 ;
-END M2_TURN
-
-VIA myVia23
-   LAYER metal2 ;
-      POLYGON MASK 1 -2.1 -1.0 -0.2 1.0 2.1 1.0 0.2 -1.0 ;
-      POLYGON MASK 2 -1.1 -2.0 -0.1 2.0 1.1 2.0 0.1 -2.0 ;
-      POLYGON MASK 3 -3.1 -2.0 -0.3 2.0 3.1 2.0 0.3 -2.0 ;
-      POLYGON MASK 1 -4.1 -2.0 -0.4 2.0 4.1 2.0 0.4 -2.0 ;
-   LAYER cut23 ;
-      RECT MASK 2 -0.4 -0.4 0.4 0.4 ;
-      POLYGON MASK 3 -2.1 -1.0 -0.2 1.0 2.1 1.0 0.2 -1.0 ;
-   LAYER metal3 ;
-      POLYGON MASK 1 -0.2 -1.0 -2.1 1.0 0.2 1.0 2.1 -1.0 ;
-   LAYER cut33 ;
-      RECT MASK 1 -0.4 -0.4 0.4 0.4 ;
-      POLYGON MASK 2 -2.1 -1.0 -0.2 1.0 2.1 1.0 0.2 -1.0 ;
-      POLYGON MASK 2 -1.1 -2.0 -0.1 2.0 1.1 2.0 0.1 -2.0 ;
-      RECT MASK 1 -0.5 -0.5 0.5 0.5 ;
-      RECT MASK 2 -0.3 -0.3 0.3 0.3 ;
-      POLYGON MASK 3 -3.1 -2.0 -0.3 2.0 3.1 2.0 0.3 -2.0 ;
-      POLYGON MASK 1 -4.1 -2.0 -0.4 2.0 4.1 2.0 0.4 -2.0 ;
-      RECT MASK 1 -0.2 -0.2 0.2 0.2 ;
-      RECT MASK 2 -0.1 -0.1 0.1 0.1 ;
-END myVia23
-
-VIA myBlockVia
-   VIARULE DEFAULT ;
-   CUTSIZE 0.1 0.1 ;
-   LAYERS metal1 via12 metal2 ;
-   CUTSPACING 0.1 0.1 ;
-   ENCLOSURE 0.05 0.01 0.01 0.05 ;
-   ORIGIN .1 .2 ;
-   OFFSET 5.1 4.1 3.1 2.1 ;
-   ROWCOL 1 2 ;
-END myBlockVia
-
-VIARULE VIALIST12
-   LAYER M1 ;
-      DIRECTION VERTICAL ;
-#      OVERHANG 4.5 ;
-      WIDTH 9.0 TO 9.6 ;
-#      METALOVERHANG 0.4 ;
-   LAYER M2 ;
-      DIRECTION HORIZONTAL ;
-      WIDTH 3.0 TO 3.0 ;
-#      METALOVERHANG 0.3 ;
-   VIA VIACENTER12 ;
-   PROPERTY vrsp "new" vrip 1 vrrp 4.5 ;
-END VIALIST12
-
-VIARULE VIALIST1
-   LAYER M1 ;
-      DIRECTION VERTICAL ;
-      WIDTH 9.0 TO 9.6 ;
-#      OVERHANG 4.5 ;
-#      METALOVERHANG 0.5 ;
-   LAYER M1 ;
-      DIRECTION HORIZONTAL ;
-      WIDTH 3.0 TO 3.0 ;
-#      OVERHANG 5.5 ;
-#      METALOVERHANG 0.6 ;
-#   VIA VIACENTER12 ;
-END VIALIST1
- 
-
-VIARULE VIAGEN12 GENERATE 
-   LAYER M1 ;
-      DIRECTION VERTICAL ;
-      WIDTH 0.1 TO 19 ;
-      OVERHANG 1.4 ;
-      METALOVERHANG 1.0 ;
-   LAYER M2 ;
-      DIRECTION HORIZONTAL ;
-      OVERHANG 1.5 ;
-      METALOVERHANG 1.0 ;
-      WIDTH 0.2 TO 1.9 ;
-   LAYER M3 ;
-      RECT -0.3 -0.3 0.3 0.3 ;
-      SPACING 5.6 BY 7.0 ;
-      RESISTANCE 0.5 ; 
-   PROPERTY vrsp "new" vrip 1 vrrp 5.5 ;
-END VIAGEN12
-
-VIARULE VIAGEN1 GENERATE 
-   LAYER M1 ;
-      DIRECTION HORIZONTAL ;
-      OVERHANG 1.4 ;
-      METALOVERHANG 1.1 ;
-      WIDTH 0.1 TO 1.9 ;
-   LAYER M2 ;
-      DIRECTION VERTICAL ;
-      OVERHANG 1.5 ;
-      METALOVERHANG 1.5 ;
-      WIDTH 0.2 TO 2.9 ;
-#   LAYER M3 ;
-#      RECT ( 1 1 ) ( 1 1 ) ;
-#      SPACING 0.3 BY 4.5 ;
-   PROPERTY vrsp "new" vrip 1 vrrp 5.5 ;
-END VIAGEN1
-
-VIARULE via10 GENERATE
-   LAYER M1 ;
-      DIRECTION HORIZONTAL ;
-      OVERHANG 1.1 ;
-      WIDTH 0.1 TO 1.9 ;
-   LAYER M2 ;
-      DIRECTION VERTICAL ;
-      OVERHANG 1.2 ;
-      WIDTH 0.2 TO 2.9 ;
-   LAYER M3 ;
-      RECT ( 1 1 ) ( 1 1 ) ;
-      SPACING 0.3 BY 4.5 ;
-   PROPERTY vrsp "new" vrip 1 vrrp 5.5 ;
-END via10
-
-VIARULE via11 GENERATE
-   LAYER M1 ;
-      DIRECTION HORIZONTAL ;
-      WIDTH 0.1 TO 1.9 ;
-   LAYER M2 ;
-      DIRECTION VERTICAL ;
-      WIDTH 0.2 TO 2.9 ;
-   LAYER M3 ;
-      RECT ( 1 1 ) ( 1 1 ) ;
-      SPACING 0.3 BY 4.5 ;
-   PROPERTY vrsp "new" vrip 1 vrrp 5.5 ;
-END via11
-
-VIARULE via12 GENERATE DEFAULT
-   LAYER m1 ;
-      ENCLOSURE 0.03 0.01 ;    # 2 sides need >= 0.03, 2 other sides >= 0.01
-   LAYER m2 ;
-      ENCLOSURE 0.05 0.01 ;    # 2 sides need >= 0.05, 2 other sides >= 0.01
-   LAYER cut12 ;
-      RECT -0.1 -0.1 0.1 0.1 ; # cut is .20 by .20
-      SPACING 0.40 BY 0.40 ;   # center-to-center spacing
-      RESISTANCE 20 ;          # ohms per cut
-END via12
-
-VIARULE via13 GENERATE
-   LAYER m1 ;
-      ENCLOSURE 0.05 0.005 ; # 2 sides need >= 0.05, 2 other sides >= 0.005
-      WIDTH 1.0 TO 100.0 ;   # for m1 between 1 to 100 um wide
-   LAYER m2 ;
-      ENCLOSURE 0.05 0.005 ; # 2 sides need >= 0.05, 2 other sides >= 0.005
-      WIDTH 1.0 TO 100.0 ;   # for m1 between 1 to 100 um wide
-   LAYER cut12 ;
-      RECT -0.07 -0.07 0.07 0.07 ; # cut is .14 by .14
-      SPACING 0.16 BY 0.16 ;
-END via13
-
-
-VIARULE via14
-   LAYER m1 ;
-      DIRECTION HORIZONTAL ;
-#      ENCLOSURE 0.05 0.005 ;  2 sides need >= 0.05, 2 other sides >= 0.005
-      WIDTH 1.0 TO 100.0 ;   # for m1 between 1 to 100 um wide
-   LAYER m2 ;
-#      ENCLOSURE 0.05 0.005 ;  2 sides need >= 0.05, 2 other sides >= 0.005
-      DIRECTION VERTICAL ;
-      WIDTH 1.0 TO 100.0 ;   # for m1 between 1 to 100 um wide
-   via name1 ;
-END via14
-
-VIARULE TURNM3 GENERATE
-   LAYER m3 ;
-      DIRECTION VERTICAL ;
-   LAYER m3 ;
-      DIRECTION HORIZONTAL ;
-END TURNM3
-
-VIARULE VIAGEN3T GENERATE
-   LAYER m3 ;
-      DIRECTION HORIZONTAL ;
-      OVERHANG 0.2 ;
-      METALOVERHANG 0.0 ;
-   LAYER v3 ;
-      RECT -0.45 -0.45 0.45 0.45 ;
-      SPACING 1.80 by 1.80 ;
-   LAYER mt ;
-      DIRECTION VERTICAL ;
-      OVERHANG 0.2 ;
-      METALOVERHANG 0.0 ;
-END VIAGEN3T
-
-NONDEFAULTRULE RULE1
-   LAYER RX
-      WIDTH 10.0 ;
-      SPACING 2.2 ;
-      WIREEXTENSION 6 ;
-      RESISTANCE RPERSQ 6.5 ;
-      CAPACITANCE CPERSQDIST 6.5 ;
-      EDGECAPACITANCE 6.5 ;
-   END RX
-   LAYER PC
-      WIDTH 10.0 ;
-      SPACING 2.2 ;
-      CAPACITANCE CPERSQDIST 6.5 ;
-   END PC
-
-   LAYER M1
-      WIDTH 10.0 ;
-      SPACING 2.2 ;
-      RESISTANCE RPERSQ 6.5 ;
-   END M1
-
-   LAYER fw
-      WIDTH 4.800 ;
-      SPACING 4.800 ;
-   END fw
-     
-   VIA nd1VIARX0
-      DEFAULT
-      TOPOFSTACKONLY
-      FOREIGN IN1X ;
-      RESISTANCE 0.2 ;
-      PROPERTY realProperty 2.3 ;
-      LAYER RX ;
-         RECT -3 -3 3 3 ;
-      LAYER CUT12 ;
-         RECT -1.0 -1.0 1.0 1.0 ;
-      LAYER PC ;
-         RECT -3 -3 3 3 ;
-   END nd1VIARX0
-
-   VIA nd1VIA01
-      FOREIGN IN1X 5.6 5.3 E ;
-      RESISTANCE 0.2 ;
-      LAYER PC ;
-         RECT -3 -3 3 3 ;
-         RECT -5 -5 5 5 ;
-      LAYER CA ;
-         RECT -1.0 -1.0 1.0 1.0 ;
-      LAYER M1 ;
-         RECT -3 -3 3 3 ;
-   END nd1VIA01
-
-   VIA nd1VIA12
-      RESISTANCE 0.2 ;
-      LAYER M1 ;
-         RECT -3 -3 3 3 ;
-      LAYER V1 ;
-         RECT -1.0 -1.0 1.0 1.0 ;
-      LAYER M2 ;
-         RECT -3 -3 3 3 ;
-   END nd1VIA12
-        
-   SPACING
-      SAMENET
-      CUT01 RX 0.1 STACK ;
-   END SPACING
-   PROPERTY ndrsp "single" ndrip 1 ndrrp 6.7 ;
-END RULE1
-
-NONDEFAULTRULE wide1_5x
-   LAYER metal1
-      WIDTH 1.5 ;    # metal1 has 1.5um width
-   END metal1
-   LAYER metal2
-      WIDTH 1.5 ;
-   END metal2
-   LAYER metal3
-      WIDTH 1.5 ;
-   END metal3
-END wide1_5x
-
-NONDEFAULTRULE wide3x
-   LAYER metal1
-      WIDTH 3.0 ;   # metal1 has 3.0um width
-   END metal1
-   LAYER metal2
-      WIDTH 3.0 ;
-   END metal2
-   LAYER metal3
-      WIDTH 3.0 ;
-   END metal3
-   #via12rule and via23rule are used implicitly
-   MINCUTS cut12 2 ; # at least two-cut vias for cut12 required
-   MINCUTS cut23 2 ;
-END wide3x
-
-NONDEFAULTRULE analog_rule
-   HARDSPACING ;     # don't let any other signal close to this one
-   LAYER metal1
-      WIDTH 1.5 ;   # metal1 has 1.5um width
-      SPACING 3.0 ; # extra spacing of 3.0um
-      DIAGWIDTH 5.5 ;
-   END metal1
-   LAYER metal2
-      WIDTH 1.5 ;
-      SPACING 3.0 ;
-   END metal2
-   LAYER metal3
-      WIDTH 1.5 ;
-      SPACING 3.0 ;
-   END metal3
-   #use pre-defined "analog vias"
-   #the DEFAULT VIARULEs will NOT be inherited
-   USEVIA via12_fixed_analog_via ;
-   USEVIA via23_fixed_analog_via ;
-   USEVIARULE viarule14_fixed_analog ;
-END analog_rule
-
-NONDEFAULTRULE clock1
-   LAYER metal1
-      WIDTH 1.5 ;    # metal1 has 1.5um width
-   END metal1
-   LAYER metal2
-     WIDTH 1.5 ;
-   END metal2
-   LAYER metal3
-     WIDTH 1.5 ;
-   END metal3
-END clock1
-NONDEFAULTRULE clock2
-   LAYER metal1
-      WIDTH 1.5 ;    # metal1 has 1.5um width
-   END metal1
-   LAYER metal2
-      WIDTH 1.5 ;
-   END metal2
-   LAYER metal3
-      WIDTH 1.5 ;
-   END metal3
-END
-NONDEFAULTRULE clock
-   LAYER metal1
-      WIDTH 1.5 ;    # metal1 has 1.5um width
-   END metal1
-   LAYER metal2
-      WIDTH 1.5 ;
-   END metal2
-   LAYER metal3
-      WIDTH 1.5 ;
-   END metal3
-END clock
-
-UNIVERSALNOISEMARGIN 0.1 20 ;
-EDGERATETHRESHOLD1 0.1 ;
-EDGERATETHRESHOLD2 0.9 ;
-EDGERATESCALEFACTOR 1.0 ;
-
-NOISETABLE 1 ;
-   EDGERATE 20 ;
-   OUTPUTRESISTANCE 3 ;
-   VICTIMLENGTH 25 ;
-   VICTIMNOISE 10 ;
-#   CORRECTIONFACTOR 3 ;
-#   OUTPUTRESISTANCE 5 ;
-END NOISETABLE
-
-#CORRECTIONTABLE 1 ;
-#   EDGERATE 20 ;
-#   OUTPUTRESISTANCE 3 ;
-#   VICTIMLENGTH 25 ;
-#   CORRECTIONFACTOR 10.5 ;
-#   OUTPUTRESISTANCE 5.4 ;
-#END CORRECTIONTABLE
-
-SPACING
-   SAMENET CUT01 CA 1.5 ;
-   SAMENET CA V1 1.5 STACK ;
-   SAMENET M1 M1 3.5 STACK ;
-   SAMENET V1 V2 1.5 STACK ;
-   SAMENET M2 M2 3.5 STACK ;
-   SAMENET V2 V3 1.5 STACK ;
-END SPACING
-
-MINFEATURE 0.1 0.1 ;
-
-DIELECTRIC 0.000345 ;
-
-IRDROP 
-   TABLE DRESHI
-      0.0001 -0.7 0.001 -0.8 0.01 -0.9 0.1 -1.0 ;
-   TABLE DRESLO
-      0.0001 -1.7 0.001 -1.6 0.01 -1.5 0.1 -1.3 ;
-   TABLE DNORESHI
-      0.0001 -0.6 0.001 -0.7 0.01 -0.9 0.1 -1.1 ;
-   TABLE DNORESLO
-      0.0001 -1.5 0.001 -1.5 0.01 -1.4 0.1 -1.4 ;
-END IRDROP
-
-SITE  COVER
-   CLASS PAD ;
-   SYMMETRY R90 ;
-   SIZE 10.000 BY 10.000 ;
-END  COVER
-
-SITE  IO
-   CLASS PAD ;
-   SIZE 80.000 BY 560.000 ;
-END  IO
-
-SITE  CORE
-   CLASS CORE ;
-   SIZE 0.700 BY 8.400 ;
-END  CORE
-
-SITE CORE1
-   CLASS CORE ;
-   SYMMETRY X ;
-   SIZE 67.2 BY 6 ;
-END CORE1
-
-SITE MRCORE
-#   CLASS VIRTUAL ;
-   CLASS CORE ;
-   SIZE 3.6 BY 28.8 ;
-   SYMMETRY  Y  ;
-END MRCORE
-
-SITE IOWIRED
-   CLASS PAD ;
-   SIZE 57.6 BY 432 ;
-END IOWIRED
-
-SITE IMAGE
-   CLASS CORE ;
-   ROWPATTERN Fsite1 N Lsite1 N Lsite1 FS ;
-   SIZE 1 BY 1 ;
-END IMAGE
-
-SITE Fsite
-   CLASS CORE ;
-   SIZE 4.0 BY 7.0 ;   # 4.0 um wide, 7.0 um high
-END Fsite
-
-SITE Lsite
-   CLASS CORE ;
-   SIZE 6.0 BY 7.0 ;   # 6.0 um wide, 7.0 um high
-END Lsite
-
-SITE mySite
-   CLASS CORE ;
-   ROWPATTERN Fsite N Lsite N Lsite FS ; # a pattern of F + L + flipped L
-   SIZE 16.0 BY 7.0 ;                    # width = width(F + L + L)
-END mySite
-
-ARRAY M7E4XXX
-   SITE CORE         -5021.450 -4998.000 N DO 14346 BY 595 STEP 0.700 16.800 ;
-   SITE CORE         -5021.450 -4989.600 FS DO 14346 BY 595 STEP 0.700 16.800 ;
-   SITE IO           6148.800 5800.000 E DO 1 BY 1 STEP 0.000 0.000 ;
-   SITE IO           6148.800 3240.000 E DO 1 BY 1 STEP 0.000 0.000 ;
-   SITE COVER        -7315.000 -7315.000 N DO 1 BY 1 STEP 0.000 0.000 ;
-   SITE COVER        7305.000 7305.000 N DO 1 BY 1 STEP 0.000 0.000 ;
-   CANPLACE COVER    -7315.000 -7315.000 N DO 1 BY 1 STEP 0.000 0.000 ;
-   CANPLACE COVER    -7250.000 -7250.000 N DO 5 BY 1 STEP 40.000 0.000 ;
-   CANPLACE COVER    -7250.000 -7250.000 N DO 5 BY 1 STEP 40.000 0.000 ;
-   CANNOTOCCUPY CORE -5021.450 -4989.600 FS DO 100 BY 595 STEP 0.700 16.800 ;
-   CANNOTOCCUPY CORE -5021.450 -4998.000 N DO 100 BY 595 STEP 0.700 16.800 ;
-   CANNOTOCCUPY CORE -5021.450 -4998.000 N DO 100 BY 595 STEP 0.700 16.800 ;
-   TRACKS X -6148.800 DO 17569 STEP 0.700 LAYER RX ;
-   TRACKS Y -6148.800 DO 20497 STEP 0.600 LAYER RX ;
-   TRACKS Y -6148.800 DO 20497 STEP 0.600 LAYER RX ;
-
-   FLOORPLAN 100%
-      CANPLACE COVER  -7315.000 -7315.000 N DO 1 BY 1 STEP 0.000 0.000 ;
-      CANPLACE COVER  -7250.000 -7250.000 N DO 5 BY 1 STEP 40.000 0.000 ;
-      CANPLACE CORE   -5021.450 -4998.000 N DO 14346 BY 595 STEP 0.700 16.800 ;
-      CANPLACE CORE   -5021.450 -4989.600 FS DO 14346 BY 595 STEP 0.700 16.800 ;
-      CANNOTOCCUPY CORE -5021.450 -4989.600 FS DO 100 BY 595 STEP 0.700 16.800 ;
-      CANNOTOCCUPY CORE -5021.450 -4998.000 N DO 100 BY 595 STEP 0.700 16.800 ;
-   END 100%
-   GCELLGRID X  -6157.200 DO 1467 STEP 8.400 ;
-   GCELLGRID Y  -6157.200 DO 1467 STEP 8.400 ;
-   GCELLGRID Y  -6157.200 DO 1467 STEP 8.400 ;
-END M7E4XXX
-
-MACRO CHK3A
-CLASS RING ;
-   FIXEDMASK ;
-   SOURCE USER ;
-   FOREIGN CHKS 0 0 FN ;
-   ORIGIN 0.9 0.9 ;
-   EEQ CHK1 ; 
-   LEQ CHK2 ; 
-   SIZE 10.8 BY 28.8 ;
-#  for testing the lefrWarning.log file
-#     SITE CORE ;
-   SYMMETRY X Y R90  ;
-   SITE CORE ;
-   POWER 1.0 ;
-   PROPERTY stringProp "first" integerProp 1 WEIGHT 30.31 ;
-
-   PIN GND
-      TAPERRULE RULE1 ;
-      FOREIGN GROUND ( 0 0 ) E ;
-      FOREIGN CHKS ( 5 4 ) N ;
-      FOREIGN VCC ( 6 5 ) FE ;
-      FOREIGN CHK1 ( 7 6 ) W ;
-      LEQ  A ;
-      DIRECTION INOUT ;
-      USE GROUND ;
-      SHAPE ABUTMENT ;
-      INPUTNOISEMARGIN  6.1 2.3 ;
-      OUTPUTNOISEMARGIN 5.0  4.6 ;
-      OUTPUTRESISTANCE 7.4 5.4 ;
-      POWER 2.0 ;
-      LEAKAGE 1.0 ;
-      CAPACITANCE 0.1 ;        
-      RESISTANCE 0.2 ;
-      PULLDOWNRES 0.5 ;
-      TIEOFFR 0.8 ; 
-      VHI 5 ;        
-      VLO 0 ;        
-      RISEVOLTAGETHRESHOLD 2.0 ;
-      FALLVOLTAGETHRESHOLD 2.0 ;
-      RISETHRESH 22 ;        
-      FALLTHRESH 100 ;        
-      RISESATCUR 4 ;        
-      FALLSATCUR .5 ;        
-      CURRENTSOURCE ACTIVE ;            
-#      ANTENNASIZE 0.6 LAYER RX ;
-#      NAMETALAREA 3 LAYER M1 ;
-#      ANTENNAMETALAREA 4 LAYER M2 ;
-#      ANTENNAMETALLENGTH 5 LAYER M1 ;
-#      ANTENNAMETALLENGTH 6 LAYER M2 ;
-      RISESLEWLIMIT 0.01 ;
-      FALLSLEWLIMIT 0.02 ;
-      MAXDELAY 21 ;                        
-      MAXLOAD 0.1 ;
-      PROPERTY TYPE "special" intProp 23 realProp 24.25 ;
-      IV_TABLES LOWT HIGHT ;
-
-      PORT
-         CLASS CORE ;
-         LAYER M1 SPACING 0.05 ;
-         WIDTH 1.0 ;
-         RECT -0.9 3 9.9 6 ;
-         VIA 100 300 IN1X ;
-      END
-      PORT                              # 5.7
-         CLASS BUMP ;                   # 5.7
-         LAYER M2 SPACING 0.06 ;        # 5.7
-      END                               # 5.7
-   END GND
-   PIN VDD
-      DIRECTION INOUT ;
-      FOREIGN GROUND  STRUCTURE ( 0 0 ) E ;
-      USE POWER ;
-      SHAPE ABUTMENT ;
-      PORT
-      END
-      PORT
-         CLASS NONE ;
-         LAYER M1 ;
-            RECT ITERATE -0.9 21 9.9 24 
-               DO 1 BY 2 STEP 1 1 ;
-            VIA ITERATE 100 300 nd1VIA12 
-               DO 1 BY 2 STEP 1 2 ;
-      END
-#      ANTENNAMETALAREA 3 LAYER M1 ;
-#      ANTENNAMETALAREA 4 LAYER M2 ;
-#      ANTENNAMETALLENGTH 5 LAYER M1 ;
-#      ANTENNAMETALLENGTH 6 LAYER M2 ;
-      # Test for combination of both 5.3 & 5.4, which is not allowed
-      # ANTENNAPARTIALMETALAREA 4 LAYER M1 ;
-      ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.0130 LAYER M2 ;
-      ANTENNAMODEL OXIDE3 ;
-      ANTENNAGATEAREA 162.4800 LAYER M2 ;
-      ANTENNADIFFAREA 5008.4600 LAYER M2 ;
-      ANTENNAPARTIALMETALAREA 10611.2002 LAYER M2 ;
-      ANTENNAPARTIALCUTAREA 185.7300 LAYER V2 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.2140 LAYER M3 ;
-      ANTENNADIFFAREA 5163.8799 LAYER M3 ;
-      ANTENNAPARTIALMETALAREA 2450.2600 LAYER M3 ;
-      LEAKAGE 1.0 ;
-      FALLVOLTAGETHRESHOLD 2.0 ;
-      RISEVOLTAGETHRESHOLD 2.0 ;
-      CURRENTSOURCE ACTIVE ;
-   END VDD
-   PIN PA3
-      DIRECTION INPUT ;
-      # 5.4
-      ANTENNAPARTIALMETALAREA 4 LAYER M1 ;
-      ANTENNAPARTIALMETALAREA 5 LAYER M2 ;
-      ANTENNAPARTIALMETALSIDEAREA 5 LAYER M2 ;
-      ANTENNAPARTIALMETALSIDEAREA 6 LAYER M2 ;
-      ANTENNAPARTIALMETALSIDEAREA 7 LAYER M2 ;
-      ANTENNAGATEAREA 1 LAYER M1 ;
-      ANTENNAGATEAREA 2 ;
-      ANTENNAGATEAREA 3 LAYER M3 ;
-      ANTENNADIFFAREA 1 LAYER M1 ;
-      ANTENNAMAXAREACAR 1 LAYER L1 ;
-      ANTENNAMAXAREACAR 2 LAYER L2 ;
-      ANTENNAMAXAREACAR 3 LAYER L3 ;
-      ANTENNAMAXAREACAR 4 LAYER L4 ;
-      ANTENNAMAXSIDEAREACAR 1 LAYER L1 ;
-      ANTENNAMAXSIDEAREACAR 2 LAYER L2 ;
-      ANTENNAPARTIALCUTAREA 1 ;
-      ANTENNAPARTIALCUTAREA 2 LAYER M2 ;
-      ANTENNAPARTIALCUTAREA 3 ;
-      ANTENNAPARTIALCUTAREA 4 LAYER M4 ;
-      ANTENNAMAXCUTCAR 1 LAYER L1 ;
-      ANTENNAMAXCUTCAR 2 LAYER L2 ;
-      ANTENNAMAXCUTCAR 3 LAYER L3 ;
-      # Test for combination of both 5.3 & 5.4, which is not allowed
-      # ANTENNAMETALLENGTH 5 LAYER M1 ;
-      PORT
-         LAYER M1 SPACING 0.02 ;
-            RECT 1.35 -0.45 2.25 0.45 ;
-            RECT -0.45 -0.45 0.45 0.45 ;
-      END
-      PORT
-         LAYER PC DESIGNRULEWIDTH 0.05 ;
-            RECT -0.45 12.15 0.45 13.05 ;
-      END
-      PORT
-        LAYER PC ;
-            RECT -0.45 24.75 0.45 25.65 ;
-      END
-      PORT
-      END
-   END PA3
-   PIN PA0
-      DIRECTION INPUT ;
-      MUSTJOIN PA3 ;
-      PORT
-         CLASS NONE ;
-         LAYER M1 ;
-            RECT 8.55 8.55 9.45 9.45 ;
-            RECT 6.75 6.75 7.65 7.65 ;
-            RECT 6.75 8.55 7.65 9.45 ;
-            RECT 6.75 10.35 7.65 11.25 ;
-      END
-      PORT
-         CLASS CORE ;
-         LAYER PC ;
-            RECT 8.55 24.75 9.45 25.65 ;
-      END
-      PORT
-         LAYER PC ;
-            RECT 6.75 1.35 7.65 2.25 ;
-      END
-      PORT
-         LAYER PC ;
-            RECT 6.75 24.75 7.65 25.65 ;
-      END
-      PORT
-         LAYER PC ;
-            RECT 4.95 1.35 5.85 2.25 ;
-      END
-   END PA0
-   PIN PA1
-      DIRECTION INPUT ;
-      PORT
-         LAYER M1 ;
-            RECT 8.55 -0.45 9.45 0.45 ;
-            RECT 6.75 -0.45 7.65 0.45 ;
-      END
-      PORT
-         LAYER M1 ;
-            RECT 8.55 12.15 9.45 13.05 ;
-            RECT 6.75 12.15 7.65 13.05 ;
-            RECT 4.95 12.15 5.85 13.05 ;
-      END
-      PORT
-         LAYER PC ;
-            RECT 4.95 24.75 5.85 25.65 ;
-      END
-      PORT
-         LAYER PC ;
-            RECT 3.15 24.75 4.05 25.65 ;
-      END
-   END PA1
-   PIN PA20
-      DIRECTION INPUT ;
-      PORT
-         LAYER M1 ;
-            POLYGON 15 35 15 60 65 60 65 35 15 35 ;
-      END
-      PORT
-         LAYER M1 ;
-            PATH 8.55 12.15 9.45 13.05 ;
-      END
-   END PA20
-   PIN PA21
-      DIRECTION OUTPUT TRISTATE ;
-      PORT
-         LAYER M1 ;
-            POLYGON ITERATE 20 35 20 60 70 60 70 35 DO 1 BY 2 STEP 5 5 ;
-      END
-      PORT
-         LAYER M1 ;
-            PATH ITERATE 5.55 12.15 10.45 13.05 DO 1 BY 2 STEP 2 2 ;
-      END
-   END PA21
-   OBS
-      LAYER M1 SPACING 5.6 ;
-         RECT 6.6 -0.6 9.6 0.6 ;
-         RECT 4.8 12 9.6 13.2 ;
-         RECT 3 13.8 7.8 16.8 ;
-         RECT 3 -0.6 6 0.6 ;
-         RECT 3 8.4 6 11.4 ;
-         RECT 3 8.4 4.2 16.8 ;
-         RECT -0.6 13.8 4.2 16.8 ;
-         RECT -0.6 -0.6 2.4 0.6 ;
-         RECT 6.6 6.6 9.6 11.4 ;
-         RECT 6.6 6.6 7.8 11.4 ;
-   END 
-   TIMING
-      FROMPIN PA21 ;
-      TOPIN PA20 ;
-      RISE INTRINSIC .39 .41 1.2 .25 .29 1.8 .67 .87 2.2
-         VARIABLE 0.12 0.13 ;
-      FALL INTRINSIC .24 .29 1.3 .26 .31 1.7 .6 .8 2.1
-         VARIABLE 0.11 0.14 ;
-      RISERS 83.178 90.109 ;
-      FALLRS 76.246 97.041 ;
-      RISECS 0.751 0.751 ;
-      FALLCS 0.751 0.751 ;
-      RISET0 0.65493 0.65493 ;
-      FALLT0 0.38 0.38 ;
-      RISESATT1 0 0 ;
-      FALLSATT1 0.15 0.15 ;
-      UNATENESS INVERT ;
-   END TIMING
-END CHK3A
-
-MACRO INV
-   CLASS CORE ;
-   SOURCE BLOCK ;
-   FOREIGN INVS ;
-   POWER 1.0 ;
-   SIZE 67.2 BY 24 ;
-   SYMMETRY X Y R90 ;
-   SITE CORE1 ;
-
-   PIN Z DIRECTION OUTPUT ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.1 ;
-      MAXDELAY 21 ;
-      POWER 0.1 ;
-      ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.0130 LAYER M2 ;
-      ANTENNAMODEL OXIDE2 ;
-      ANTENNAMODEL OXIDE3 ;
-      ANTENNAGATEAREA 162.4800 LAYER M2 ;
-      ANTENNADIFFAREA 5008.4600 LAYER M2 ;
-      ANTENNAPARTIALMETALAREA 10611.2002 LAYER M2 ;
-      ANTENNAPARTIALCUTAREA 185.7300 LAYER V2 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.2140 LAYER M3 ;
-      ANTENNADIFFAREA 5163.8799 LAYER M3 ;
-      ANTENNAPARTIALMETALAREA 2450.2600 LAYER M3 ;
-      PORT
-         LAYER M2 ;
-            PATH 30.8 9 42 9 ;
-      END
-   END Z
-
-   PIN A DIRECTION INPUT ;
-      USE ANALOG ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.08 ;
-      MAXDELAY 21 ;
-      PORT
-         LAYER M1 ;
-            PATH 25.2 15 ;
-      END
-   END A
-
-   PIN VDD DIRECTION INOUT ;
-      SHAPE ABUTMENT ;
-      POWER 0.1 ;
-      ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.0130 LAYER M2 ;
-      ANTENNAMODEL OXIDE3 ;
-      ANTENNAGATEAREA 162.4800 LAYER M2 ;
-      ANTENNADIFFAREA 5008.4600 LAYER M2 ;
-      ANTENNAPARTIALMETALAREA 10611.2002 LAYER M2 ;
-      ANTENNAPARTIALCUTAREA 185.7300 LAYER V2 ;
-      ANTENNAMODEL OXIDE1 ;
-      ANTENNAGATEAREA 297.2140 LAYER M3 ;
-      ANTENNADIFFAREA 5163.8799 LAYER M3 ;
-      ANTENNAPARTIALMETALAREA 2450.2600 LAYER M3 ;
-      ANTENNAMODEL OXIDE2 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 50.4 2.8 50.4 21.2 ;
-      END
-   END VDD
-
-   PIN VSS DIRECTION INOUT ;
-      SHAPE ABUTMENT ;
-      POWER 0.1 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 16.8 2.8 16.8 21.2 ;
-      END
-   END VSS
-
-   TIMING
-      FROMPIN A ;
-      TOPIN Z ;
-      RISE INTRINSIC .39 .41 1.2 .25 .29 1.8 .67 .87 2.2
-         VARIABLE 0.12 0.13 ;
-      FALL INTRINSIC .24 .29 1.3 .26 .31 1.7 .6 .8 2.1
-         VARIABLE 0.11 0.14 ;
-      RISERS 83.178 90.109 ;
-      FALLRS 76.246 97.041 ;
-      RISECS 0.751 0.751 ;
-      FALLCS 0.751 0.751 ;
-      RISET0 0.65493 0.65493 ;
-      FALLT0 0.38 0.38 ;
-      RISESATT1 0 0 ;
-      FALLSATT1 0.15 0.15 ;
-      UNATENESS INVERT ;
-   END TIMING
-
-   OBS
-      LAYER M1 DESIGNRULEWIDTH 4.5 ;
-         WIDTH 0.1 ;
-         RECT MASK 2 24.1 1.5 43.5 16.5 ;
-         RECT MASK 2 ITERATE 24.1 1.5 43.5 16.5
-            DO 2 BY 1 STEP 20.0 0 ;
-         PATH MASK 3 ITERATE 532.0 534 1999.2 534
-            DO 1 BY 2 STEP 0 1446 ;
-         VIA ITERATE MASK 123 470.4 475 VIABIGPOWER12
-            DO 2 BY 2 STEP 1590.4 1565 ;
-         PATH MASK 3 532.0 534 1999.2 534 ;
-         PATH MASK 3 532.0 1980 1999.2 1980 ;
-         VIA MASK 103 470.4 475 VIABIGPOWER12 ;
-         VIA MASK 132 2060.8 475 VIABIGPOWER12 ;
-         VIA MASK 112 470.4 2040 VIABIGPOWER12 ;
-         VIA MASK 123 2060.8 2040 VIABIGPOWER12 ;
-         RECT 44.1 1.5 63.5 16.5 ;
-   END
-
-   DENSITY
-      LAYER metal1 ;
-         RECT 0 0 100 100 45.5 ;  #rec from (0,0) to (100,100), density of 45.5%
-         RECT 100 0 200 100 42.2 ; 
-      LAYER metal2 ;
-         RECT 0 0 250 140 20.5 ; 
-         RECT 1 1 250 140 20.5 ; 
-         RECT 2 2 250 140 20.5 ; 
-      LAYER metal3 ;
-         RECT 10 10 40 40 4.5 ;
-   END
-END INV
-
-MACRO INV_B
-   EEQ INV ;
-   CLASS CORE SPACER ;
-   FOREIGN INVS ( 4 5 ) ;
-   FOREIGN INV1 ( 5 6 ) S ;
-   FOREIGN INV2 ( 6 7 ) N ;
-   FOREIGN INV3 ( 7 8 ) ;
-   POWER 1.0 ;
-   SIZE 67.2 BY 24 ;
-   SYMMETRY X Y R90 ;
-   SITE CORE1 ;
-   PIN Z DIRECTION OUTPUT ;
-      USE CLOCK ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.1 ;
-      MAXDELAY 21 ;
-      POWER 0.1 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 1 ;
-            PATH MASK 2 ( -0.6 -0.6 ) ( 0.6 -0.6 ) ( 0.7 -0.6 ) ;
-         LAYER M2 ;
-            WIDTH 1 ;
-            RECT MASK 1 ( -0.6 -0.6 ) ( 0.6 0.6 ) ;
-         LAYER M3 ;
-            WIDTH 1 ;
-            RECT MASK 2 ITERATE ( -0.6 -0.6 ) ( 0.6 0.6 )
-            DO 1 BY 2 STEP 2 1 ;
-         LAYER M4 ;
-            PATH MASK 1 30.8 9 42 9 ;
-	 VIA MASK 103 470.4 475 VIABIGPOWER12 ;
-         VIA MASK 130 2060.8 475 VIABIGPOWER12 ;
-         VIA MASK 113 470.4 2040 VIABIGPOWER12 ;
-         VIA MASK 121 2060.8 2040 VIABIGPOWER12 ;
-      END
-   END Z
-
-   PIN A DIRECTION FEEDTHRU ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.08 ;
-      MAXDELAY 21 ;
-      PORT
-         LAYER M1 ;
-            PATH 25.2 15 ;
-      END
-   END A
-
-   PIN VDD DIRECTION INOUT ;
-      SHAPE ABUTMENT ;
-      POWER 0.1 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 50.4 2.8 50.4 21.2 ;
-      END
-   END VDD
-
-   PIN VSS DIRECTION INOUT ;
-      SHAPE ABUTMENT ;
-      POWER 0.1 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 16.8 2.8 16.8 21.2 ;
-      END
-   END VSS
-
-   TIMING
-      FROMPIN A ;
-      TOPIN Z ;
-      RISE INTRINSIC .39 .41 1.2 .25 .29 1.8 .67 .87 2.2
-         VARIABLE 0.12 0.13 ;
-      FALL INTRINSIC .24 .29 1.3 .26 .31 1.7 .6 .8 2.1
-         VARIABLE 0.11 0.14 ;
-      RISERS 83.178 90.109 ;
-      FALLRS 76.246 97.041 ;
-      RISECS 0.751 0.751 ;
-      FALLCS 0.751 0.751 ;
-      RISET0 0.65493 0.65493 ;
-      FALLT0 0.38 0.38 ;
-      RISESATT1 0 0 ;
-      FALLSATT1 0.15 0.15 ;
-      UNATENESS INVERT ;
-   END TIMING
-
-   OBS
-      LAYER M1 ;
-         RECT 24.1 1.5 43.5 16.5 ;
-   END
-END INV_B
-
-MACRO DFF3
-   CLASS CORE ANTENNACELL ;
-   FOREIGN DFF3S ;
-   POWER 4.0 ;
-   SIZE 67.2 BY 210 ;
-   SYMMETRY X Y R90 ;
-   SITE CORE 34 54 FE DO 30 BY 3 STEP 1 1 ;
-   SITE CORE1 21 68 S DO 30 BY 3 STEP 2 2 ;
-
-   PIN Q DIRECTION OUTPUT ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.12 ;
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-      PORT
-         LAYER M2 ;
-            PATH 19.6 99 47.6 99 ;
-      END
-   END Q
-
-   PIN QN DIRECTION OUTPUT ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.11 ;
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-      PORT
-         LAYER M2 ;
-            PATH MASK 1 25.2 123 42 123 ;
-	    RECT MASK 2 24.1 1.5 43.5 208.5 ;
-      END
-   END QN
-
-   PIN D DIRECTION INPUT ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.13 ;
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-      PORT
-         LAYER M1 ;
-            PATH 30.8 51 ;
-      END
-   END D
-
-   PIN G DIRECTION INPUT ;
-      USE SIGNAL ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.11 ;
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-      PORT
-         LAYER M1 ;
-            PATH 25.2 3 ;
-      END
-   END G
-
-   PIN CD DIRECTION INPUT ;
-      USE CLOCK ;
-      RISETHRESH 22 ;
-      FALLTHRESH 100 ;
-      RISESATCUR 4 ;
-      FALLSATCUR .5 ;
-      VLO 0 ;
-      VHI 5 ;
-      CAPACITANCE 0.1 ;
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-      PORT
-         LAYER M1 ;
-            PATH 36.4 75 ;
-      END
-   END CD
-
-   PIN VDD DIRECTION INOUT ;
-      SHAPE RING ;
-      POWER 0.4 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 50.4 2.8 50.4 207.2 ;
-      END
-   END VDD
-
-   PIN VSS DIRECTION INOUT ;
-      SHAPE FEEDTHRU ;
-      POWER 0.4 ;
-      PORT
-         LAYER M1 ;
-            WIDTH 5.6 ;
-            PATH 16.8 2.8 16.8 207.2 ;
-      END
-   END VSS
-
-   TIMING
-      FROMPIN D ;
-      TOPIN Q ;
-      RISE INTRINSIC .51 .6 1.4 .37 .45 1.7 .6 .81 2.1
-         VARIABLE 0.06 0.1 ;
-      FALL INTRINSIC 1 1.2 1.4 1.77 1.85 1.8 .56 .81 2.4
-         VARIABLE 0.08 0.09 ;
-      RISERS 41.589 69.315 ;
-      FALLRS 55.452 62.383 ;
-      RISECS 0.113 0.113 ;
-      FallCS 0.113 0.113 ;
-      RISET0 0.023929 0.023929 ;
-      FALLT0 0.38 0.38 ;
-      RISESATT1 0 0 ;
-      FALLSATT1 0.15 0.15 ;
-      UNATENESS      NONINVERT ;
-   END TIMING
-
-   OBS
-      LAYER M1 DESIGNRULEWIDTH 0.15 ;
-         RECT 24.1 1.5 43.5 208.5 ;
-         PATH 8.4 3 8.4 123 ;
-         PATH 58.8 3 58.8 123 ;
-         PATH 64.4 3 64.4 123 ;
-   END
-
-   DENSITY
-      LAYER metal4 ;
-         RECT 24.1 1.5 43.5 208.5 5.5 ;
-   END
-END DFF3
-
-MACRO BUF1
-   CLASS ENDCAP BOTTOMLEFT ;
-   PIN IN
-      ANTENNAGATEAREA 1 ;
-      ANTENNAGATEAREA 3 ;
-      ANTENNADIFFAREA 0 ;
-      ANTENNAMODEL OXIDE2 ;
-      ANTENNAGATEAREA 2 ;
-      ANTENNAGATEAREA 4 ;
-      ANTENNADIFFAREA 0 ;
-   END IN
-   PIN IN2
-      ANTENNAGATEAREA 1 ;
-   END IN2
-   PIN IN3
-      SHAPE ABUTMENT ;
-   END IN3
-   PIN GND
-      USE GROUND ;
-      PORT
-         LAYER metal1 ;
-         POLYGON 0 0 0 1.0 1.0 0 2.0 2.0 2.0 0 ;
-         RECT 2.0 3.0 4.0 5.0 ;
-      END
-   END GND
-   OBS
-      LAYER metal2 EXCEPTPGNET ;             # 5.7
-      POLYGON 0 0 0 1.0 1.0 0 2.0 2.0 2.0 0 ;
-      RECT 2.0 3.0 4.0 5.0 ;
-   END
-END BUF1
-
-MACRO DFF4
-   CLASS COVER BUMP ;
-   FOREIGN DFF3S ;
-   POWER 4.0 ;
-END DFF4
-
-MACRO DFF5
-   CLASS COVER ;
-   FOREIGN DFF3S ;
-END DFF5
-
-MACRO mydriver
-   CLASS PAD AREAIO ;
-   FOREIGN DFF3S ;
-END mydriver
-
-MACRO myblackbox
-   CLASS BLOCK BLACKBOX ;
-   FOREIGN DFF3S ;
-END myblackbox
-
-MACRO FWHSQCN690V15
-   CLASS CORE ;
-   FOREIGN FWHSQCN690 0.00 0.00 ;
-   SIZE 15.36 BY 4.80 ;
-   SYMMETRY Y X ;
-   ORIGIN 0.0 0.0 ;
-   SITE CORE ;
-   PIN R DIRECTION INPUT ;
-      CAPACITANCE 0.004872 ;
-      USE SIGNAL ;
-      PORT
-         LAYER a1sig ;
-         RECT 11.43 0.80 11.71 1.20 ;
-         RECT 9.94 0.80 11.43 1.04 ;
-         LAYER a1sig ;
-         RECT 9.49 0.80 9.71 0.82 ;
-         RECT 9.71 0.80 9.93 1.04 ;
-         RECT 9.92 0.80 9.94 1.04 ;
-         RECT 9.00 2.06 9.72 2.08 ;
-         RECT 9.39 0.80 9.47 1.78 ;
-         RECT 9.46 0.80 9.48 1.78 ;
-         RECT 9.47 0.80 9.49 1.77 ;
-         RECT 9.48 0.81 9.72 2.07 ;
-         RECT 9.00 1.77 9.48 2.07 ;
-      END
-   END R
-   PIN SI DIRECTION INPUT ;
-      CAPACITANCE 0.002213 ;
-      USE SIGNAL ;
-      PORT
-         LAYER a1sig ;
-#         RECT 4.00 2.07 4.20 2.36 ;
-#         RECT 4.19 2.07 4.21 2.36 ;
-#         RECT 4.21 2.07 4.44 2.25 ;
-#         RECT 4.21 2.24 4.44 2.26 ;
-#         RECT 4.20 2.25 4.44 3.03 ;
-      END
-   END SI
-   PIN SM DIRECTION INPUT ;
-      CAPACITANCE 0.002307 ;
-      USE SIGNAL ;
-      PORT
-         LAYER a1sig ;
-         RECT 0.82 3.51 1.08 3.89 ;
-         LAYER a1sig ;
-         RECT 0.36 3.51 0.59 3.69 ;
-         RECT 0.36 3.68 0.59 3.70 ;
-         RECT 0.59 3.51 0.81 3.89 ;
-         RECT 0.59 3.51 0.81 3.89 ;
-         RECT 0.80 3.51 0.82 3.89 ;
-         RECT 0.36 3.69 0.60 3.99 ;
-         LAYER a1sig ;
-      END
-   END SM
-   PIN T DIRECTION INPUT ;
-      CAPACITANCE 0.002260 ;
-      USE SIGNAL ;
-      PORT
-         LAYER a1sig ;
-#        RECT 5.14 3.51 5.15 3.99 ;
-         LAYER a1sig ;
-         RECT 4.85 3.51 4.91 3.70 ;
-         RECT 4.91 3.51 5.13 3.99 ;
-         RECT 5.12 3.51 5.14 3.99 ;
-         RECT 4.20 3.69 4.92 3.99 ;
-      END
-   END T
-   OBS
-      LAYER a1sig SPACING 0 ;
-      RECT 0.11 0.74 0.81 3.47 ;
-      RECT 0.80 0.74 0.82 3.47 ;
-      RECT 0.82 0.74 2.54 4.06 ;
-      RECT 2.54 0.74 3.70 3.47 ;
-      RECT 3.70 0.74 3.98 4.06 ;
-      RECT 3.98 0.74 5.14 3.47 ;
-      RECT 5.14 0.74 8.78 4.06 ;
-      RECT 8.78 0.74 9.94 1.54 ;
-      RECT 8.78 1.53 9.94 1.55 ;
-      RECT 8.78 2.29 9.94 4.06 ;
-      RECT 9.94 0.74 14.06 4.06 ;
-      RECT 14.06 0.74 15.24 2.51 ;
-      RECT 15.23 0.74 15.25 2.51 ;
-      RECT 14.06 3.25 15.25 4.05 ;
-      RECT 14.06 4.04 15.25 4.06 ;
-   END
-END FWHSQCN690V15
-
-MACRO mysoft
-   CLASS BLOCK SOFT ;
-   FOREIGN DFF3S ;
-   OBS
-      LAYER a1sig DESIGNRULEWIDTH 0 ;
-      RECT 0.11 0.74 0.81 3.47 ;
-   END
-END mysoft
-
-MACRO mycorewelltap
-   CLASS CORE WELLTAP ;
-   FOREIGN DFF3S ;
-END mycorewelltap
-
-MACRO myTest
-   CLASS CORE ;
-   SIZE 10.0 BY 14.0 ; #uses two F and one L site, is F+L wide,and double height
-   SYMMETRY X ;        #can flip about X-axis
-   SITE Fsite 0 0 N ;  #the lower, left Fsite at 0,0
-   SITE Fsite 0 7.0 FS ;  #the flipped-south Fsite above the first Fsite at 0,7
-   SITE Lsite 4.0 0 N ;   #the Lsite to the right of the first Fsite at 4,0
-   SITE Lsite 0 0 S DO 2 BY 1 STEP 4 5 ;
-   SITE Fsite 4.0 0 E ;
-   SITE Fsite ;
-   SITE Lsite 0.3 0 S DO 2 BY 1 STEP 4 5 ;
-   SITE Fsite 0 0 N DO 2 BY 1 STEP 4.0 0 ;
-END myTest
-
-MACRO myMac
-   CLASS CORE ;
-   SIZE 10.0 BY 14.0 ;
-   SYMMETRY X ;
-   PIN In1
-      USE SIGNAL ;
-      SUPPLYSENSITIVITY vddpin1 ; #if in1 is 1'b1, use net connected to vddpin1
-                                 #note, no GROUNDSENSITIVITY is needed because
-                                 #only one ground pin exists, so 1'b0 implicitly
-                                 #means net from pin gndpin
-      CAPACITANCE 0.12 ;
-      MAXDELAY 20 ;
-   END In1
-   PIN vddpin1
-      USE SIGNAL ;
-      CAPACITANCE 0.11 ;
-      MAXDELAY 20 ;
-      NETEXPR "power1 VDD1" ;    #if power1 is defined in the netlist, use it to
-                                 #find the net connection, else use net VDD1
-      POWER 0.4 ;
-   END vddpin1
-   PIN vddpin2
-      USE SIGNAL ;
-      MAXDELAY 20 ;
-      NETEXPR "power2 VDD2" ;    #if power2 is defined in the netlist, use it to
-                                 #find the net connection, else use net VDD2
-      POWER 0.4 ;
-   END vddpin2
-   PIN gndpin
-      USE SIGNAL ;
-      NETEXPR "gnd1 GND" ;       #if gnd1 is defined in the netlist, use it to
-                                 #find the net connection, else use net GND
-      MAXDELAY 20 ;
-      POWER 0.4 ;
-   END gndpin
-   PIN In2
-      USE SIGNAL ;
-      GROUNDSENSITIVITY gndpin ;
-      POWER 0.6 ;
-   END In2
-END myMac
-
-ANTENNAINPUTGATEAREA 45 ;
-ANTENNAINOUTDIFFAREA 65 ;
-ANTENNAOUTPUTDIFFAREA 55 ;
-
-#INPUTPINANTENNASIZE 1 ;
-#OUTPUTPINANTENNASIZE -1 ;
-#INOUTPINANTENNASIZE -1 ;
-
-BEGINEXT "SIGNATURE"
-   CREATOR "CADENCE"
-   DATE "04/14/98"
-ENDEXT
-
-#END LIBRARY   This is optional in 5.6
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef.au b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef.au
deleted file mode 100644
index 0900761..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/TEST/complete.5.8.lef.au
+++ /dev/null
@@ -1,1574 +0,0 @@
-VERSION 5.8 ;
-FIXEDMASK ;
-BUSBITCHARS "<>" ;
-DIVIDER : ;
-USEMINSPACING OBS OFF ;
-CLEARANCEMEASURE EUCLIDEAN ;
-CLEARANCEMEASURE MAXXY ;
-UNITS
-  DATABASE MICRONS 20000 ;
-  CAPACITANCE PICOFARADS 10 ;
-  RESISTANCE OHMS 10000 ;
-  POWER MILLIWATTS 10000 ;
-  CURRENT MILLIAMPS 10000 ;
-  VOLTAGE VOLTS 1000 ;
-  FREQUENCY MEGAHERTZ 10 ;
-END UNITS
-MANUFACTURINGGRID 3.5 ;
-PROPERTYDEFINITIONS
- library NAME Cadence96
- library intNum INTEGER 20
- library realNum REAL 21.22
- library LEF57_MAXFLOATINGAREAGATE MAXFLOATINGAREA GATEISGROUND;
- layer lsp STRING
- layer lip INTEGER
- layer lrp REAL
- layer LEF57_SPACING STRING
- layer LEF57_SPACINGADJACENTCUTS STRING
- layer LEF57_MAXFLOATINGAREA STRING
- layer LEF57_ARRAYSPACING STRING
- layer LEF57_SPACINGSAMENET STRING
- layer LEF57_MINSTEP STRING
- layer LEF57_ANTENNAGATEPLUSDIFF STRING
- layer LEF57_ANTENNACUMROUTINGPLUSCUT STRING
- layer LEF57_ANTENNAAREAMINUSDIFF STRING
- layer LEF57_ANTENNAAREADIFFREDUCEPWL STRING
- layer LEF57_ENCLOSURE STRING
- via stringProperty STRING
- via realProperty REAL
- via COUNT INTEGER RANGE 1 100
-Parsed 50 number of lines!!
- viarule vrsp STRING
- viarule vrip INTEGER
- viarule vrrp REAL
- nondefaultrule ndrsp STRING
- nondefaultrule ndrip INTEGER
- nondefaultrule ndrrp REAL
- macro stringProp STRING
- macro integerProp INTEGER
- macro WEIGHT REAL RANGE 1 100
- pin TYPE STRING
- pin intProp INTEGER
- pin realProp REAL
-END PROPERTYDEFINITIONS
-LAYER POLYS
-  TYPE MASTERSLICE ;
-  PROPERTY lsp top STRING lip 1 INTEGER lrp 2.3 REAL ;
-END POLYS
-LAYER POLYS01
-  TYPE MASTERSLICE ;
-END POLYS01
-LAYER CUT01
-  TYPE CUT ;
-  PITCH 1.2 1.3 ;
-  OFFSET 0.5 0.6 ;
-  DIAGPITCH 6.5 ;
-  ARRAYSPACING WIDTH 2 CUTSPACING 0.2
-	ARRAYCUTS 3 SPACING 1 ;
-  SPACING 0.35 ADJACENTCUTS 3 WITHIN 0.25 ;
-  SPACING 1.5 PARALLELOVERLAP ;
-ENCLOSURE ABOVE 0.01 0.05 ;
-ENCLOSURE BELOW 0.03 0.05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 ;
-ENCLOSURE 0.05 0.05 ;
-  PROPERTY lip 5 INTEGER LEF57_SPACING SPACING 1.5 PARALLELOVERLAP ; STRING LEF57_ARRAYSPACING ARRAYSPACING  WIDTH 2.0 CUTSPACING 0.2 ARRAYCUTS 3 SPACING 1.0 ; STRING LEF57_ENCLOSURE ENCLOSURE ABOVE .01 .05 ; STRING LEF57_ENCLOSURE ENCLOSURE ABOVE .02 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 NOSHAREDEDGE ; STRING LEF57_ENCLOSURE ENCLOSURE BELOW .03 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 ; STRING LEF57_ENCLOSURE ENCLOSURE .05 .05 ; STRING LEF57_ENCLOSURE ENCLOSURE BELOW .08 .05 WIDTH 3.1 EXCEPTEXTRACUT 1.5 NOSHAREDEDGE ; STRING ;
-END CUT01
-Parsed 100 number of lines!!
-Parsed 150 number of lines!!
-LAYER RX
-  TYPE ROUTING ;
-  MASK 2 ;
-  PITCH 1.8 ;
-  OFFSET 0.9 ;
-  WIDTH 1 ;
-  AREA 34.1 ;
-  ARRAYSPACING LONGARRAY CUTSPACING 0.2
-	ARRAYCUTS 3 SPACING 1
-	ARRAYCUTS 4 SPACING 1.5
-	ARRAYCUTS 5 SPACING 2 ;
-  SPLITWIREWIDTH 5 ;
-  MINIMUMDENSITY 4 ;
-  MAXIMUMDENSITY 10 ;
-  DENSITYCHECKSTEP 2 ;
-  FILLACTIVESPACING 4 ;
-  MINIMUMCUT 2 WIDTH 2.5 ;
-  SPACING 0.6 ;
-  SPACING 0.18 LENGTHTHRESHOLD 0.9 ;
-  SPACING 0.4 RANGE 0.1 0.12 ;
-  SPACING 0.32 RANGE 1.01 2000 USELENGTHTHRESHOLD ;
-  SPACING 0.1 RANGE 0.1 0.1 INFLUENCE 2.01 RANGE 2.1 10000 ;
-  SPACING 0.44 RANGE 1 1 INFLUENCE 1.01 ;
-  SPACING 0.33 RANGE 1.01 20 INFLUENCE 1.01 ;
-  SPACING 0.7 RANGE 0.3 0.15 USELENGTHTHRESHOLD ;
-  SPACING 0.5 ;
-  SPACING 0.6 RANGE 4.5 6.12 RANGE 3 3.1 ;
-  SPACING 4.3 RANGE 0.1 0.1 INFLUENCE 3.81 RANGE 0.1 0.2 ;
-  SPACING 0.53 LENGTHTHRESHOLD 0.45 RANGE 0 0.1;
-  SPACING 2.2 ENDOFLINE 2.3 WITHIN 1.6 ;
-  DIRECTION HORIZONTAL ;
-  RESISTANCE RPERSQ 0.103 ;
-  CAPACITANCE CPERSQDIST 0.000156 ;
-  EDGECAPACITANCE 5e-05 ;
-  TYPE 9 ;
-  THICKNESS 1 ;
-  WIREEXTENSION 0.75 ;
-  SHRINKAGE 0.1 ;
-  CAPMULTIPLIER 1 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNAAREAFACTOR 1 ;
-  ANTENNAMODEL OXIDE2 ;
-  ANTENNAAREARATIO 7.6 ;
-  ANTENNADIFFAREARATIO 4.7 ;
-  ANTENNACUMAREARATIO 6.7 ;
-  ANTENNACUMDIFFAREARATIO 4.5
-  ANTENNACUMDIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-  ANTENNAAREAFACTOR 6.5   DIFFUSEONLY ;
-  ANTENNASIDEAREARATIO 6.5 ;
-  ANTENNADIFFSIDEAREARATIO 6.5
-  ANTENNACUMSIDEAREARATIO 7.5 ;
-  ANTENNACUMDIFFSIDEAREARATIO 4.6
-  ANTENNASIDEAREAFACTOR 7.5   DIFFUSEONLY ;
-  ANTENNACUMROUTINGPLUSCUT ;
-  ANTENNAGATEPLUSDIFF 2 ;
-  ANTENNAAREAMINUSDIFF 100 ;
-  ANTENNAAREADIFFREDUCEPWL ( ( 0 1 ) ( 0.09999 1 ) ( 0.1 0.2 ) ( 1 0.1 ) ( 1000 0.1 ) ) ;
-  ANTENNAMODEL OXIDE3 ;
-  ANTENNAMODEL OXIDE4 ;
-  ANTENNACUMROUTINGPLUSCUT ;
-  ANTENNAGATEPLUSDIFF 2 ;
-  ANTENNAAREAMINUSDIFF 100 ;
-  ANTENNAAREADIFFREDUCEPWL ( ( 0 1 ) ( 0.0999 1 ) ( 0.1 0.2 ) ( 1 0.1 ) ( 1000 0.1 ) ) ;
-  ACCURRENTDENSITY PEAK
-    FREQUENCY 1e+06 1e+08 ;
-    TABLEENTRIES
-     5e-07 4e-07 ;
-  ACCURRENTDENSITY AVERAGE 5.5 ;
-  ACCURRENTDENSITY RMS
-    FREQUENCY 1e+08 4e+08 8e+08 ;
-    WIDTH 0.4 0.8 10 50 100 ;
-    TABLEENTRIES
-     2e-06 1.9e-06 1.8e-06 1.7e-06 1.5e-06
-     1.4e-06 1.3e-06 1.2e-06 1.1e-06 1e-06
-     9e-07 8e-07 7e-07 6e-07 4e-07 ;
-  DCCURRENTDENSITY AVERAGE
-    WIDTH 20 50 ;
-    TABLEENTRIES 6e-07 5e-07 ;
-  PROPERTY LEF57_SPACING SPACING 2.2 ENDOFLINE 2.3 WITHIN 1.6 ; STRING LEF57_ARRAYSPACING ARRAYSPACING LONGARRAY CUTSPACING 0.2 ARRAYCUTS 3 SPACING 1.0 ARRAYCUTS 4 SPACING 1.5 ARRAYCUTS 5 SPACING 2.0 ; STRING LEF57_ANTENNACUMROUTINGPLUSCUT ANTENNACUMROUTINGPLUSCUT ; STRING LEF57_ANTENNAAREAMINUSDIFF ANTENNAAREAMINUSDIFF 100.0 ; STRING LEF57_ANTENNAGATEPLUSDIFF ANTENNAGATEPLUSDIFF 2.0 ; STRING LEF57_ANTENNAAREADIFFREDUCEPWL ANTENNAAREADIFFREDUCEPWL ( ( 0.0 1.0 ) ( 0.0999 1.0 ) ( 0.1 0.2 ) ( 1.0 0.1 ) ( 1000.0 0.1 ) ) ; STRING lsp rxlay STRING lip 3 INTEGER lrp 1.2 REAL ;
-END RX
-Parsed 200 number of lines!!
-LAYER CUT12
-  TYPE CUT ;
-  DIAGPITCH 1.5 1.7 ;
-  DIAGWIDTH 1.6 ;
-  DIAGSPACING 0.5 ;
-  SPACING 0.7 LAYER RX ;
-  SPACING 0.22 ADJACENTCUTS 4 WITHIN 0.25 ;
-  SPACING 1.5 PARALLELOVERLAP ;
-  SPACING 1.2 ADJACENTCUTS 2 WITHIN 1.5 EXCEPTSAMEPGNET ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNAMODEL OXIDE2 ;
-  ANTENNAMODEL OXIDE3 ;
-  ANTENNAMODEL OXIDE4 ;
-  ANTENNAAREARATIO 5.6 ;
-  ANTENNADIFFAREARATIO 6.5 ;
-  ANTENNACUMAREARATIO 6.7 ;
-  ANTENNACUMDIFFAREARATIO 5.6
-  ANTENNACUMDIFFAREARATIO PWL ( ( 5.4 5.4 ) ( 6.5 6.5 ) ( 7.5 7.5 ) ) ;
-  ANTENNAAREAFACTOR 5.4 ;
-  ANTENNACUMROUTINGPLUSCUT ;
-  ANTENNAGATEPLUSDIFF 2 ;
-  ANTENNAAREAMINUSDIFF 100 ;
-  ANTENNAAREADIFFREDUCEPWL ( ( 0 1 ) ( 0.09999 1 ) ( 0.1 0.2 ) ( 1 0.1 ) ( 1000 0.1 ) ) ;
-  ACCURRENTDENSITY PEAK
-    FREQUENCY 1e+06 1e+08 ;
-    TABLEENTRIES
-     5e-07 4e-07 ;
-  ACCURRENTDENSITY AVERAGE 5.5 ;
-  ACCURRENTDENSITY RMS
-    FREQUENCY 1e+08 4e+08 8e+08 ;
-    CUTAREA 0.4 0.8 10 50 100 ;
-    TABLEENTRIES
-     2e-06 1.9e-06 1.8e-06 1.7e-06 1.5e-06
-     1.4e-06 1.3e-06 1.2e-06 1.1e-06 1e-06
-     9e-07 8e-07 7e-07 6e-07 4e-07 ;
-  DCCURRENTDENSITY AVERAGE
-    CUTAREA 2 5 ;
-    TABLEENTRIES 5e-07 4e-07 ;
-  DCCURRENTDENSITY AVERAGE 4.9 ;
-END CUT12
-Parsed 250 number of lines!!
-LAYER PC
-  TYPE ROUTING ;
-  PITCH 3.8 3.5 ;
-  DIAGPITCH 1.4 ;
-  WIDTH 1 ;
-  SPACING 0.6 ;
-  SPACING 1.2 ENDOFLINE 1.3 WITHIN 0.6 ;
-  SPACING 1.3 ENDOFLINE 1.4 WITHIN 0.7 PARALLELEDGE 1.1 WITHIN 0.5 TWOEDGES ;
-  SPACING 1.4 ENDOFLINE 1.5 WITHIN 0.8 PARALLELEDGE 1.2 WITHIN 0.6 ;
-  DIRECTION VERTICAL ;
-  WIREEXTENSION 0.4 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNAAREARATIO 5.4 ;
-  ANTENNADIFFAREARATIO 6.5 ;
-  ANTENNACUMAREARATIO 7.5 ;
-  ANTENNACUMDIFFAREARATIO PWL ( ( 5 5.1 ) ( 6 6.1 ) ) ;
-  ANTENNAAREAFACTOR 4.5 ;
-  ANTENNASIDEAREARATIO 6.5 ;
-  ANTENNADIFFSIDEAREARATIO PWL ( ( 7 7.1 ) ( 7.2 7.3 ) ) ;
-  ANTENNACUMSIDEAREARATIO 7.4 ;
-  ANTENNACUMDIFFSIDEAREARATIO PWL ( ( 8 8.1 ) ( 8.2 8.3 ) ( 8.4 8.5 ) ( 8.6 8.7 ) ) ;
-  ANTENNASIDEAREAFACTOR 9   DIFFUSEONLY ;
-  ACCURRENTDENSITY PEAK
-    FREQUENCY 1e+06 1e+08 ;
-    WIDTH 5.6 8.5 8.1 4.5 ;
-    TABLEENTRIES
-     5e-07 4e-07 ;
-  DCCURRENTDENSITY AVERAGE
-    WIDTH 20 50 100 ;
-    TABLEENTRIES 1e-06 7e-07 5e-07 ;
-END PC
-LAYER CA
-  TYPE CUT ;
-  DCCURRENTDENSITY AVERAGE
-    CUTAREA 2 5 10 ;
-    TABLEENTRIES 6e-07 5e-07 4e-07 ;
-END CA
-LAYER M1
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 1 ;
-  DIRECTION HORIZONTAL ;
-  RESISTANCE RPERSQ 0.103 ;
-  CAPACITANCE CPERSQDIST 0.000156 ;
-  WIREEXTENSION 7 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNADIFFAREARATIO 1000 ;
-  ANTENNACUMAREARATIO 300 ;
-  ANTENNACUMDIFFAREARATIO 5000
-  ANTENNAGATEPLUSDIFF 2 ;
-  ACCURRENTDENSITY AVERAGE 5.5 ;
-  DCCURRENTDENSITY AVERAGE 4.9 ;
-   SPACINGTABLE
-      PARALLELRUNLENGTH 0 0.5 3 5
-          WIDTH 0 0.15 0.15 0.15 0.15
-          WIDTH 0.25 0.15 0.2 0.2 0.2
-          WIDTH 1.5 0.15 0.5 0.5 0.5
-          WIDTH 3 0.15 0.5 1 1
-          WIDTH 5 0.15 0.5 1 2 ;
-   SPACINGTABLE
-      INFLUENCE
-          WIDTH 1.5 WITHIN 0.5 SPACING 0.5
-          WIDTH 3 WITHIN 1 SPACING 1
-          WIDTH 5 WITHIN 2 SPACING 2 ;
-END M1
-Parsed 300 number of lines!!
-LAYER V1
-  TYPE CUT ;
-  SPACING 0.6 LAYER CA ;
-END V1
-LAYER M2
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 0.9 ;
-  SPACING 0.9 ;
-  SPACING 0.28 ;
-  SPACING 0.24 LENGTHTHRESHOLD 1 ;
-  SPACING 0.32 RANGE 1.01 9.99 USELENGTHTHRESHOLD ;
-  SPACING 0.5 RANGE 10 1000 ;
-  SPACING 0.5 RANGE 10 1000 INFLUENCE 1 ;
-  SPACING 0.5 RANGE 10 1000 INFLUENCE 1 RANGE 0.28 1 ;
-  SPACING 0.5 RANGE 3.01 4 RANGE 4.01 5 ;
-  SPACING 0.4 RANGE 3.01 4 RANGE 5.01 1000 ;
-  SPACING 1 SAMENET PGONLY ;
-  SPACING 1.1 SAMENET ;
-  SPACING 1.2 ENDOFLINE 1.3 WITHIN 0.6 PARALLELEDGE 2.1 WITHIN 1.5 TWOEDGES ;
-  SPACING 1.5 ENDOFLINE 2.3 WITHIN 1.6 PARALLELEDGE 1.1 WITHIN 0.5 ;
-  DIRECTION DIAG45 ;
-  RESISTANCE RPERSQ 0.0608 ;
-  CAPACITANCE CPERSQDIST 0.000184 ;
-  WIREEXTENSION 8 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNACUMAREARATIO 5000 ;
-  ANTENNACUMDIFFAREARATIO 8000
-  ANTENNAMODEL OXIDE2 ;
-  ANTENNACUMAREARATIO 500 ;
-  ANTENNACUMDIFFAREARATIO 800
-  ANTENNAMODEL OXIDE3 ;
-  ANTENNACUMAREARATIO 300 ;
-  ANTENNACUMDIFFAREARATIO 600
-  PROPERTY LEF57_SPACING SPACING 1.2 ENDOFLINE 1.3 WITHIN 0.6 PARALLELEDGE 2.1 WITHIN 1.5 TWOEDGES ; STRING LEF57_SPACING SPACING 1.5 ENDOFLINE 2.3 WITHIN 1.6 PARALLELEDGE 1.1 WITHIN 0.5 ; STRING LEF57_MAXFLOATINGAREA MAXFLOATINGAREA 1000 ; STRING ;
-END M2
-LAYER V2
-  TYPE CUT ;
-END V2
-Parsed 350 number of lines!!
-LAYER M3
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 0.9 ;
-  MINSTEP 1 MAXEDGES 2 ;
-  SPACING 0.9 ;
-  DIRECTION HORIZONTAL ;
-  RESISTANCE RPERSQ 0.0608 ;
-  CAPACITANCE CPERSQDIST 0.000184 ;
-  WIREEXTENSION 8 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNACUMAREARATIO 300 ;
-  ANTENNACUMDIFFAREARATIO 600
-  ANTENNAMODEL OXIDE2 ;
-  ANTENNAMODEL OXIDE3 ;
-  ANTENNACUMAREARATIO 5000 ;
-  ANTENNACUMDIFFAREARATIO 8000
-  ANTENNAMODEL OXIDE4 ;
-  ANTENNACUMAREARATIO 500 ;
-  ANTENNACUMDIFFAREARATIO 800
-  PROPERTY LEF57_MINSTEP MINSTEP 1.0 MAXEDGES 2 ; STRING ;
-END M3
-LAYER M4
-  TYPE ROUTING ;
-  PITCH 5.4 ;
-  WIDTH 5.4 ;
-  MINIMUMCUT 2 WIDTH 0.5 ;
-  MINIMUMCUT 2 WIDTH 0.7 FROMBELOW ;
-  MINIMUMCUT 3 WIDTH 0.8 WITHIN 0.3 ;
-  MINIMUMCUT 2 WIDTH 1 FROMBELOW LENGTH 20 WITHIN 5 ;
-  MINIMUMCUT 4 WIDTH 1 FROMABOVE ;
-  MINIMUMCUT 2 WIDTH 1.1 LENGTH 20 WITHIN 5 ;
-  MINIMUMCUT 2 WIDTH 1.1 FROMABOVE LENGTH 20 WITHIN 5 ;
-  MAXWIDTH 10 ;
-  MINWIDTH 0.15 ;
-  MINENCLOSEDAREA 0.3 ;
-  MINENCLOSEDAREA 0.4 MINENCLOSEDAREAWIDTH 0.15 ;
-  MINENCLOSEDAREA 0.8 MINENCLOSEDAREAWIDTH 0.5 ;
-  MINSTEP 0.2 ;
-  PROTRUSIONWIDTH 0.3 LENGTH 0.6 WIDTH 1.2 ;
-  DIRECTION HORIZONTAL ;
-END M4
-Parsed 400 number of lines!!
-LAYER M5
-  TYPE ROUTING ;
-  PITCH 5.4 ;
-  WIDTH 4 ;
-  MINIMUMCUT 2 WIDTH 0.7 ;
-  MINIMUMCUT 4 WIDTH 1 FROMABOVE ;
-  MINIMUMCUT 2 WIDTH 1.1 LENGTH 20 WITHIN 5 ;
-  MINIMUMCUT 5 WIDTH 0.5 ;
-  MINSTEP 0.05 ;
-  MINSTEP 0.04 ;
-  MINSTEP 0.05 LENGTHSUM 0.08 ;
-  MINSTEP 0.05 LENGTHSUM 0.16 ;
-  MINSTEP 0.05 INSIDECORNER ;
-  MINSTEP 0.05 INSIDECORNER LENGTHSUM 0.15 ;
-  MINSTEP 1 MAXEDGES 2 ;
-  DIRECTION DIAG135 ;
-  ANTENNAMODEL OXIDE1 ;
-  ANTENNAMODEL OXIDE2 ;
-  ANTENNAMODEL OXIDE3 ;
-  ANTENNACUMAREARATIO 300 ;
-  ANTENNACUMDIFFAREARATIO 600
-END M5
-LAYER implant1
-  TYPE IMPLANT ;
-  WIDTH 0.5 ;
-  SPACING 0.5 ;
-  PROPERTY lrp 5.4 REAL ;
-END implant1
-LAYER implant2
-  TYPE IMPLANT ;
-  WIDTH 0.5 ;
-  SPACING 0.5 ;
-  PROPERTY lsp bottom STRING ;
-END implant2
-LAYER V3
-  TYPE CUT ;
-END V3
-LAYER MT
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 0.9 ;
-  MINSTEP 0.05 STEP ;
-  MINSTEP 0.05 STEP LENGTHSUM 0.08 ;
-  MINSTEP 0.04 STEP ;
-  SPACING 0.9 ;
-  DIRECTION VERTICAL ;
-  RESISTANCE RPERSQ 0.0608 ;
-  CAPACITANCE CPERSQDIST 0.000184 ;
-  DIAGMINEDGELENGTH 0.075 ;
-END MT
-Parsed 450 number of lines!!
-LAYER OVERLAP
-  TYPE OVERLAP ;
-  PROPERTY lip 5 INTEGER lsp top STRING lrp 5.5 REAL lsp bottom STRING ;
-END OVERLAP
-LAYER via12
-  TYPE CUT ;
-  WIDTH 0.2 ;
-  SPACING 0.15 CENTERTOCENTER ;
-ENCLOSURE BELOW 0.03 0.01 ;
-ENCLOSURE ABOVE 0.05 0.01 ;
-ENCLOSURE ABOVE 0.04 0.09 ;
-PREFERENCLOSURE BELOW 0.06 0.01 ;
-PREFERENCLOSURE ABOVE 0.08 0.2 ;
-  RESISTANCE 10 ;
-END via12
-LAYER metal1
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 0.9 ;
-  DIRECTION VERTICAL ;
-  MINSIZE 0.14 0.3 0.5 0.56 0.01 0.05 ;
-END metal1
-LAYER via23
-  TYPE CUT ;
-  WIDTH 0.2 ;
-  SPACING 0.15 ;
-ENCLOSURE 0.05 0.01 ;
-ENCLOSURE 0.02 0.02 WIDTH 1 ;
-ENCLOSURE 0.05 0.05 WIDTH 2 ;
-  RESISTANCE 10 ;
-END via23
-Parsed 500 number of lines!!
-LAYER via34
-  TYPE CUT ;
-  WIDTH 0.25 ;
-  SPACING 0.1 CENTERTOCENTER ;
-ENCLOSURE 0.05 0.01 ;
-ENCLOSURE 0.05 0 LENGTH 0.7 ;
-ENCLOSURE BELOW 0.07 0.07 WIDTH 1 ;
-ENCLOSURE ABOVE 0.09 0.09 WIDTH 1 ;
-ENCLOSURE 0.03 0.03 WIDTH 1 EXCEPTEXTRACUT 0.2 ;
-  RESISTANCE 8 ;
-END via34
-LAYER cut23
-  TYPE CUT ;
-  ARRAYSPACING LONGARRAY CUTSPACING 0.2
-	ARRAYCUTS 3 SPACING 1
-	ARRAYCUTS 4 SPACING 1.5
-	ARRAYCUTS 5 SPACING 2 ;
-  SPACING 0.2 LAYER cut12 STACK SAMENET ;
-  SPACING 0.3 CENTERTOCENTER SAMENET AREA 0.02 ;
-  SPACING 0.4 AREA 0.5 ;
-  SPACING 0.1 ;
-SPACINGTABLE ORTHOGONAL
-   WITHIN 0.15 SPACING 0.11
-   WITHIN 0.13 SPACING 0.13
-   WITHIN 0.11 SPACING 0.15;
-END cut23
-LAYER cut24
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 1 ;
-  ARRAYSPACING WIDTH 2 CUTSPACING 0.2
-	ARRAYCUTS 3 SPACING 1 ;
-  SPACING 0.1 ;
-  SPACING 0.12 NOTCHLENGTH 0.15;
-  SPACING 0.14 ENDOFNOTCHWIDTH 0.15 NOTCHSPACING 0.16, NOTCHLENGTH 0.08;
-  DIRECTION HORIZONTAL ;
-END cut24
-LAYER cut25
-  TYPE ROUTING ;
-  PITCH 1.8 ;
-  WIDTH 1 ;
-  DIRECTION HORIZONTAL ;
-  WIREEXTENSION 7 ;
-   SPACINGTABLE
-      TWOWIDTHS
-          WIDTH 0 0.15 0.2 0.5 1 
-          WIDTH 0.25 PRL 0 0.2 0.25 0.5 1 
-          WIDTH 1.5 PRL 1.5 0.5 0.5 0.6 1 
-          WIDTH 3 PRL 3 1 1 1 1.2  ;
-END cut25
-MAXVIASTACK 4 RANGE m1 m7 ;
-Parsed 550 number of lines!!
-VIA IN1X 
-  PROPERTY stringProperty DEFAULT STRING realProperty 32.33 REAL COUNT 34 INTEGER ;
-  RESISTANCE 2 ;
-  LAYER RX
-    RECT ( -0.700000 -0.700000 ) ( 0.700000 0.700000 ) ;
-    RECT ( 0.000000 0.000000 ) ( 2.100000 2.300000 ) ;
-    RECT ( 5.700000 0.000000 ) ( 95.700000 2.300000 ) ;
-    RECT ( 101.900000 0.000000 ) ( 119.600000 2.300000 ) ;
-  LAYER CUT12
-    RECT ( -0.250000 -0.250000 ) ( 0.250000 0.250000 ) ;
-  LAYER PC
-    RECT ( -0.600000 -0.600000 ) ( 0.600000 0.600000 ) ;
-END IN1X
-VIA M1_M2 DEFAULT
-  RESISTANCE 1.5 ;
-  LAYER M1
-    RECT MASK 1 ( -0.600000 -0.600000 ) ( 0.600000 0.600000 ) ;
-  LAYER V1
-    RECT MASK 2 ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-  LAYER M2
-    RECT MASK 3 ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-    RECT MASK 1 ( -0.900000 -0.450000 ) ( 0.900000 0.450000 ) ;
-END M1_M2
-VIA M2_M3 DEFAULT
-  RESISTANCE 1.5 ;
-  LAYER M2
-    RECT ( -0.450000 -0.900000 ) ( 0.450000 0.900000 ) ;
-  LAYER V2
-    RECT ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-  LAYER M3
-    RECT ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-END M2_M3
-VIA M2_M3_PWR GENERATED
-  RESISTANCE 0.4 ;
-  LAYER M2
-    RECT ( -1.350000 -1.350000 ) ( 1.350000 1.350000 ) ;
-  LAYER V2
-    RECT ( -1.350000 -1.350000 ) ( -0.450000 1.350000 ) ;
-    RECT ( 0.450000 -1.350000 ) ( 1.350000 -0.450000 ) ;
-    RECT ( 0.450000 0.450000 ) ( 1.350000 1.350000 ) ;
-  LAYER M3
-    RECT ( -1.350000 -1.350000 ) ( 1.350000 1.350000 ) ;
-END M2_M3_PWR
-Parsed 600 number of lines!!
-VIA M3_MT DEFAULT
-  RESISTANCE 1.5 ;
-  LAYER M3
-    RECT MASK 1 ( -0.900000 -0.450000 ) ( 0.900000 0.450000 ) ;
-  LAYER V3
-    RECT MASK 2 ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-  LAYER MT
-    RECT MASK 3 ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-END M3_MT
-VIA myBlockVia0 
-  VIARULE viaName0 ;
-    CUTSIZE 0.1 0.1 ;
-    LAYERS metal1 via12 metal2 ;
-    CUTSPACING 0.1 0.1 ;
-    ENCLOSURE 0.05 0.01 0.01 0.05 ;
-    ROWCOL 5 14 ;
-    PATTERN 2_FF70_3_R4F ;
-END myBlockVia0
-VIA VIACENTER12 
-  RESISTANCE 0.24 ;
-  LAYER M1
-    RECT ( -4.600000 -2.200000 ) ( 4.600000 2.200000 ) ;
-  LAYER V1
-    RECT ( -3.100000 -0.800000 ) ( -1.900000 0.800000 ) ;
-    RECT ( 1.900000 -0.800000 ) ( 3.100000 0.800000 ) ;
-  LAYER M2
-    RECT ( -4.400000 -2.000000 ) ( 4.400000 2.000000 ) ;
-END VIACENTER12
-VIA M2_TURN 
-  LAYER M2
-    RECT ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-    RECT ( -4.400000 -2.000000 ) ( 4.400000 2.000000 ) ;
-END M2_TURN
-Parsed 650 number of lines!!
-VIA myVia23 
-  LAYER metal2
-    POLYGON MASK 1 -2.1 -1  -0.2 1  2.1 1  0.2 -1 ;
-    POLYGON MASK 2 -1.1 -2  -0.1 2  1.1 2  0.1 -2 ;
-    POLYGON MASK 3 -3.1 -2  -0.3 2  3.1 2  0.3 -2 ;
-    POLYGON MASK 1 -4.1 -2  -0.4 2  4.1 2  0.4 -2 ;
-  LAYER cut23
-    RECT MASK 2 ( -0.400000 -0.400000 ) ( 0.400000 0.400000 ) ;
-    POLYGON MASK 3 -2.1 -1  -0.2 1  2.1 1  0.2 -1 ;
-  LAYER metal3
-    POLYGON MASK 1 -0.2 -1  -2.1 1  0.2 1  2.1 -1 ;
-  LAYER cut33
-    RECT MASK 1 ( -0.400000 -0.400000 ) ( 0.400000 0.400000 ) ;
-    RECT MASK 1 ( -0.500000 -0.500000 ) ( 0.500000 0.500000 ) ;
-    RECT MASK 2 ( -0.300000 -0.300000 ) ( 0.300000 0.300000 ) ;
-    RECT MASK 1 ( -0.200000 -0.200000 ) ( 0.200000 0.200000 ) ;
-    RECT MASK 2 ( -0.100000 -0.100000 ) ( 0.100000 0.100000 ) ;
-    POLYGON MASK 2 -2.1 -1  -0.2 1  2.1 1  0.2 -1 ;
-    POLYGON MASK 2 -1.1 -2  -0.1 2  1.1 2  0.1 -2 ;
-    POLYGON MASK 3 -3.1 -2  -0.3 2  3.1 2  0.3 -2 ;
-    POLYGON MASK 1 -4.1 -2  -0.4 2  4.1 2  0.4 -2 ;
-END myVia23
-VIA myBlockVia 
-  VIARULE DEFAULT ;
-    CUTSIZE 0.1 0.1 ;
-    LAYERS metal1 via12 metal2 ;
-    CUTSPACING 0.1 0.1 ;
-    ENCLOSURE 0.05 0.01 0.01 0.05 ;
-    ROWCOL 1 2 ;
-    ORIGIN 0.1 0.2 ;
-    OFFSET 5.1 4.1 3.1 2.1 ;
-END myBlockVia
-VIARULE VIALIST12
-  LAYER M1 ;
-    DIRECTION VERTICAL ;
-    WIDTH 9 TO 9.6 ;
-  LAYER M2 ;
-    DIRECTION HORIZONTAL ;
-    WIDTH 3 TO 3 ;
-  VIA VIACENTER12 ;
-  PROPERTY vrsp new STRING vrip 1 INTEGER vrrp 4.5 REAL ;
-END VIALIST12
-VIARULE VIALIST1
-  LAYER M1 ;
-    DIRECTION VERTICAL ;
-    WIDTH 9 TO 9.6 ;
-  LAYER M1 ;
-    DIRECTION HORIZONTAL ;
-    WIDTH 3 TO 3 ;
-Should have via names in VIARULE.
-END VIALIST1
-Parsed 700 number of lines!!
-VIARULE VIAGEN12 GENERATE
-  LAYER M1 ;
-    ENCLOSURE 1.4 1.5 ;
-    WIDTH 0.1 TO 19 ;
-  LAYER M2 ;
-    ENCLOSURE 1.4 1.5 ;
-    WIDTH 0.2 TO 1.9 ;
-  LAYER M3 ;
-    RESISTANCE 0.5 ;
-    SPACING 5.6 BY 7 ;
-    RECT ( -0.300000 -0.300000 ) ( 0.300000 0.300000 ) ;
-  PROPERTY vrsp new STRING vrip 1 INTEGER vrrp 5.5 REAL ;
-END VIAGEN12
-VIARULE via10 GENERATE
-  LAYER M1 ;
-    ENCLOSURE 1.1 1.2 ;
-    WIDTH 0.1 TO 1.9 ;
-  LAYER M2 ;
-    ENCLOSURE 1.1 1.2 ;
-    WIDTH 0.2 TO 2.9 ;
-  LAYER M3 ;
-    SPACING 0.3 BY 4.5 ;
-    RECT ( 1.000000 1.000000 ) ( 1.000000 1.000000 ) ;
-  PROPERTY vrsp new STRING vrip 1 INTEGER vrrp 5.5 REAL ;
-END via10
-Parsed 750 number of lines!!
-VIARULE via11 GENERATE
-  LAYER M1 ;
-    WIDTH 0.1 TO 1.9 ;
-  LAYER M2 ;
-    WIDTH 0.2 TO 2.9 ;
-  LAYER M3 ;
-    SPACING 0.3 BY 4.5 ;
-    RECT ( 1.000000 1.000000 ) ( 1.000000 1.000000 ) ;
-  PROPERTY vrsp new STRING vrip 1 INTEGER vrrp 5.5 REAL ;
-END via11
-VIARULE via12 GENERATE DEFAULT
-  LAYER m1 ;
-    ENCLOSURE 0.03 0.01 ;
-  LAYER m2 ;
-    ENCLOSURE 0.05 0.01 ;
-  LAYER cut12 ;
-    RESISTANCE 20 ;
-    SPACING 0.4 BY 0.4 ;
-    RECT ( -0.100000 -0.100000 ) ( 0.100000 0.100000 ) ;
-END via12
-VIARULE via13 GENERATE
-  LAYER m1 ;
-    ENCLOSURE 0.05 0.005 ;
-    WIDTH 1 TO 100 ;
-  LAYER m2 ;
-    ENCLOSURE 0.05 0.005 ;
-    WIDTH 1 TO 100 ;
-  LAYER cut12 ;
-    SPACING 0.16 BY 0.16 ;
-    RECT ( -0.070000 -0.070000 ) ( 0.070000 0.070000 ) ;
-END via13
-VIARULE via14
-  LAYER m1 ;
-    DIRECTION HORIZONTAL ;
-    WIDTH 1 TO 100 ;
-  LAYER m2 ;
-    DIRECTION VERTICAL ;
-    WIDTH 1 TO 100 ;
-  VIA name1 ;
-END via14
-Parsed 800 number of lines!!
-VIARULE VIAGEN3T GENERATE
-  LAYER m3 ;
-    ENCLOSURE 0.2 0.2 ;
-  LAYER v3 ;
-    ENCLOSURE 0.2 0.2 ;
-    SPACING 1.8 BY 1.8 ;
-    RECT ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-  LAYER mt ;
-END VIAGEN3T
-Parsed 850 number of lines!!
-NONDEFAULTRULE RULE1
-  LAYER RX
-    WIDTH 10 ;
-    SPACING 2.2 ;
-    WIREEXTENSION 6 ;
-  END RX
-  LAYER PC
-    WIDTH 10 ;
-    SPACING 2.2 ;
-  END PC
-  LAYER M1
-    WIDTH 10 ;
-    SPACING 2.2 ;
-  END M1
-  LAYER fw
-    WIDTH 4.8 ;
-    SPACING 4.8 ;
-  END fw
-VIA nd1VIARX0 DEFAULT
-  PROPERTY realProperty 2.3 REAL ;
-  RESISTANCE 0.2 ;
-  LAYER RX
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-  LAYER CUT12
-    RECT ( -1.000000 -1.000000 ) ( 1.000000 1.000000 ) ;
-  LAYER PC
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-END nd1VIARX0
-VIA nd1VIA01 
-  RESISTANCE 0.2 ;
-  LAYER PC
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-    RECT ( -5.000000 -5.000000 ) ( 5.000000 5.000000 ) ;
-  LAYER CA
-    RECT ( -1.000000 -1.000000 ) ( 1.000000 1.000000 ) ;
-  LAYER M1
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-END nd1VIA01
-VIA nd1VIA12 
-  RESISTANCE 0.2 ;
-  LAYER M1
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-  LAYER V1
-    RECT ( -1.000000 -1.000000 ) ( 1.000000 1.000000 ) ;
-  LAYER M2
-    RECT ( -3.000000 -3.000000 ) ( 3.000000 3.000000 ) ;
-END nd1VIA12
-   PROPERTY ndrsp single STRING ndrip 1 INTEGER ndrrp 6.7 REAL ;
-END RULE1 ;
-NONDEFAULTRULE wide1_5x
-  LAYER metal1
-    WIDTH 1.5 ;
-  END metal1
-  LAYER metal2
-    WIDTH 1.5 ;
-  END metal2
-  LAYER metal3
-    WIDTH 1.5 ;
-  END metal3
-END wide1_5x ;
-Parsed 900 number of lines!!
-NONDEFAULTRULE wide3x
-  LAYER metal1
-    WIDTH 3 ;
-  END metal1
-  LAYER metal2
-    WIDTH 3 ;
-  END metal2
-  LAYER metal3
-    WIDTH 3 ;
-  END metal3
-   MINCUTS cut12 2 ;
-   MINCUTS cut23 2 ;
-END wide3x ;
-NONDEFAULTRULE analog_rule
-  HARDSPACING ;
-  LAYER metal1
-    WIDTH 1.5 ;
-    SPACING 3 ;
-    DIAGWIDTH 5.5 ;
-  END metal1
-  LAYER metal2
-    WIDTH 1.5 ;
-    SPACING 3 ;
-  END metal2
-  LAYER metal3
-    WIDTH 1.5 ;
-    SPACING 3 ;
-  END metal3
-    USEVIA via12_fixed_analog_via ;
-    USEVIA via23_fixed_analog_via ;
-    USEVIARULE viarule14_fixed_analog ;
-END analog_rule ;
-NONDEFAULTRULE clock1
-  LAYER metal1
-    WIDTH 1.5 ;
-  END metal1
-  LAYER metal2
-    WIDTH 1.5 ;
-  END metal2
-  LAYER metal3
-    WIDTH 1.5 ;
-  END metal3
-END clock1 ;
-Parsed 950 number of lines!!
-NONDEFAULTRULE clock2
-  LAYER metal1
-    WIDTH 1.5 ;
-  END metal1
-  LAYER metal2
-    WIDTH 1.5 ;
-  END metal2
-  LAYER metal3
-    WIDTH 1.5 ;
-  END metal3
-END clock2 ;
-NONDEFAULTRULE clock
-  LAYER metal1
-    WIDTH 1.5 ;
-  END metal1
-  LAYER metal2
-    WIDTH 1.5 ;
-  END metal2
-  LAYER metal3
-    WIDTH 1.5 ;
-  END metal3
-END clock ;
-Parsed 1000 number of lines!!
-SITE COVER
-  CLASS PAD ;
-  SYMMETRY R90 ;
-  SIZE 10 BY 10 ;
-END COVER
-SITE IO
-  CLASS PAD ;
-  SIZE 80 BY 560 ;
-END IO
-SITE CORE
-  CLASS CORE ;
-  SIZE 0.7 BY 8.4 ;
-END CORE
-SITE CORE1
-  CLASS CORE ;
-  SYMMETRY X ;
-  SIZE 67.2 BY 6 ;
-END CORE1
-SITE MRCORE
-  CLASS CORE ;
-  SYMMETRY Y ;
-  SIZE 3.6 BY 28.8 ;
-END MRCORE
-SITE IOWIRED
-  CLASS PAD ;
-  SIZE 57.6 BY 432 ;
-END IOWIRED
-Parsed 1050 number of lines!!
-SITE IMAGE
-  CLASS CORE ;
-  SIZE 1 BY 1 ;
-  ROWPATTERN   Fsite1 N   Lsite1 N   Lsite1 FS ;
-END IMAGE
-SITE Fsite
-  CLASS CORE ;
-  SIZE 4 BY 7 ;
-END Fsite
-SITE Lsite
-  CLASS CORE ;
-  SIZE 6 BY 7 ;
-END Lsite
-SITE mySite
-  CLASS CORE ;
-  SIZE 16 BY 7 ;
-  ROWPATTERN   Fsite N   Lsite N   Lsite FS ;
-END mySite
-ARRAY M7E4XXX
-   SITE CORE -5021.45 -4998 N DO 14346 BY 595 STEP 0.7 16.8 ;
-   SITE CORE -5021.45 -4989.6 FS DO 14346 BY 595 STEP 0.7 16.8 ;
-   SITE IO 6148.8 5800 E DO 1 BY 1 STEP 0 0 ;
-   SITE IO 6148.8 3240 E DO 1 BY 1 STEP 0 0 ;
-   SITE COVER -7315 -7315 N DO 1 BY 1 STEP 0 0 ;
-   SITE COVER 7305 7305 N DO 1 BY 1 STEP 0 0 ;
-   CANPLACE COVER -7315 -7315 N DO 1 BY 1 STEP 0 0 ;
-   CANPLACE COVER -7250 -7250 N DO 5 BY 1 STEP 40 0 ;
-   CANPLACE COVER -7250 -7250 N DO 5 BY 1 STEP 40 0 ;
-   CANNOTOCCUPY CORE -5021.45 -4989.6 FS DO 100 BY 595 STEP 0.7 16.8 ;
-   CANNOTOCCUPY CORE -5021.45 -4998 N DO 100 BY 595 STEP 0.7 16.8 ;
-   CANNOTOCCUPY CORE -5021.45 -4998 N DO 100 BY 595 STEP 0.7 16.8 ;
-  TRACKS X, -6148.8 DO 17569 STEP 0.7
-  LAYER RX ;
-  TRACKS Y, -6148.8 DO 20497 STEP 0.6
-  LAYER RX ;
-  TRACKS Y, -6148.8 DO 20497 STEP 0.6
-  LAYER RX ;
-  GCELLGRID X, -6157.2 DO 1467 STEP 8.4
-  GCELLGRID Y, -6157.2 DO 1467 STEP 8.4
-  GCELLGRID Y, -6157.2 DO 1467 STEP 8.4
-   FLOORPLAN 100%
-      CANPLACE COVER -7315 -7315 N DO 1 BY 1 STEP 0 0 ;
-      CANPLACE COVER -7250 -7250 N DO 5 BY 1 STEP 40 0 ;
-      CANPLACE CORE -5021.45 -4998 N DO 14346 BY 595 STEP 0.7 16.8 ;
-      CANPLACE CORE -5021.45 -4989.6 FS DO 14346 BY 595 STEP 0.7 16.8 ;
-      CANNOTOCCUPY CORE -5021.45 -4989.6 FS DO 100 BY 595 STEP 0.7 16.8 ;
-      CANNOTOCCUPY CORE -5021.45 -4998 N DO 100 BY 595 STEP 0.7 16.8 ;
-   END 100%
-
-END M7E4XXX
-
-MACRO CHK3A
-MACRO CLASS RING
-Parsed 1100 number of lines!!
-Parsed 1150 number of lines!!
-  PIN GND
-    DIRECTION INOUT ;
-    USE GROUND ;
-    SHAPE ABUTMENT ;
-    MAXLOAD 0.1 ;
-    RISESLEWLIMIT 0.01 ;
-    FALLSLEWLIMIT 0.02 ;
-    TAPERRULE RULE1 ;
-    PROPERTY TYPE special STRING intProp 23 INTEGER realProp 24.25 REAL ;
-    PORT
-CLASS CORE       LAYER M1 ;
-      SPACING 0.05 ;
-      WIDTH 1 ;
-      RECT ( -0.900000 3.000000 ) ( 9.900000 6.000000 ) ;
-      VIA ( 100 300 ) IN1X ;
-    END
-    PORT
-CLASS BUMP       LAYER M2 ;
-      SPACING 0.06 ;
-    END
-  END GND
-Parsed 1200 number of lines!!
-  PIN VDD
-    DIRECTION INOUT ;
-    USE POWER ;
-    SHAPE ABUTMENT ;
-    ANTENNAPARTIALMETALAREA 10611.2 LAYER M2 ;
-    ANTENNAPARTIALMETALAREA 2450.26 LAYER M3 ;
-    ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-    ANTENNAPARTIALCUTAREA 185.73 LAYER V2 ;
-    ANTENNADIFFAREA 5008.46 LAYER M2 ;
-    ANTENNADIFFAREA 5163.88 LAYER M3 ;
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 297.214 LAYER M3 ;
-    ANTENNAMODEL OXIDE2 ;
-    ANTENNAMODEL OXIDE3 ;
-    ANTENNAGATEAREA 162.48 LAYER M2 ;
-    PORT
-    END
-    PORT
-CLASS NONE       LAYER M1 ;
-      RECT ITERATE ( -0.900000 21.000000 ) ( 9.900000 24.000000 )
-      DO 1 BY 2 STEP 1 1 ;
-      VIA ITERATE ( 100 300 ) nd1VIA12
-      DO 1 BY 2 STEP 1 2 ;
-    END
-  END VDD
-  PIN PA3
-    DIRECTION INPUT ;
-    ANTENNAPARTIALMETALAREA 4 LAYER M1 ;
-    ANTENNAPARTIALMETALAREA 5 LAYER M2 ;
-    ANTENNAPARTIALMETALSIDEAREA 5 LAYER M2 ;
-    ANTENNAPARTIALMETALSIDEAREA 6 LAYER M2 ;
-    ANTENNAPARTIALMETALSIDEAREA 7 LAYER M2 ;
-    ANTENNAPARTIALCUTAREA 1 ;
-    ANTENNAPARTIALCUTAREA 2 LAYER M2 ;
-    ANTENNAPARTIALCUTAREA 3 ;
-    ANTENNAPARTIALCUTAREA 4 LAYER M4 ;
-    ANTENNADIFFAREA 1 LAYER M1 ;
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 1 LAYER M1 ;
-    ANTENNAGATEAREA 2 ;
-    ANTENNAGATEAREA 3 LAYER M3 ;
-    ANTENNAMAXAREACAR 1 LAYER L1 ;
-    ANTENNAMAXAREACAR 2 LAYER L2 ;
-    ANTENNAMAXAREACAR 3 LAYER L3 ;
-    ANTENNAMAXAREACAR 4 LAYER L4 ;
-    ANTENNAMAXSIDEAREACAR 1 LAYER L1 ;
-    ANTENNAMAXSIDEAREACAR 2 LAYER L2 ;
-    ANTENNAMAXCUTCAR 1 LAYER L1 ;
-    ANTENNAMAXCUTCAR 2 LAYER L2 ;
-    ANTENNAMAXCUTCAR 3 LAYER L3 ;
-    PORT
-      LAYER M1 ;
-      SPACING 0.02 ;
-      RECT ( 1.350000 -0.450000 ) ( 2.250000 0.450000 ) ;
-      RECT ( -0.450000 -0.450000 ) ( 0.450000 0.450000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      DESIGNRULEWIDTH 0.05 ;
-      RECT ( -0.450000 12.150000 ) ( 0.450000 13.050000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( -0.450000 24.750000 ) ( 0.450000 25.650000 ) ;
-    END
-    PORT
-    END
-  END PA3
-Parsed 1250 number of lines!!
-  PIN PA0
-    DIRECTION INPUT ;
-    MUSTJOIN PA3 ;
-    PORT
-CLASS NONE       LAYER M1 ;
-      RECT ( 8.550000 8.550000 ) ( 9.450000 9.450000 ) ;
-      RECT ( 6.750000 6.750000 ) ( 7.650000 7.650000 ) ;
-      RECT ( 6.750000 8.550000 ) ( 7.650000 9.450000 ) ;
-      RECT ( 6.750000 10.350000 ) ( 7.650000 11.250000 ) ;
-    END
-    PORT
-CLASS CORE       LAYER PC ;
-      RECT ( 8.550000 24.750000 ) ( 9.450000 25.650000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( 6.750000 1.350000 ) ( 7.650000 2.250000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( 6.750000 24.750000 ) ( 7.650000 25.650000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( 4.950000 1.350000 ) ( 5.850000 2.250000 ) ;
-    END
-  END PA0
-  PIN PA1
-    DIRECTION INPUT ;
-    PORT
-      LAYER M1 ;
-      RECT ( 8.550000 -0.450000 ) ( 9.450000 0.450000 ) ;
-      RECT ( 6.750000 -0.450000 ) ( 7.650000 0.450000 ) ;
-    END
-    PORT
-      LAYER M1 ;
-      RECT ( 8.550000 12.150000 ) ( 9.450000 13.050000 ) ;
-      RECT ( 6.750000 12.150000 ) ( 7.650000 13.050000 ) ;
-      RECT ( 4.950000 12.150000 ) ( 5.850000 13.050000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( 4.950000 24.750000 ) ( 5.850000 25.650000 ) ;
-    END
-    PORT
-      LAYER PC ;
-      RECT ( 3.150000 24.750000 ) ( 4.050000 25.650000 ) ;
-    END
-  END PA1
-Parsed 1300 number of lines!!
-  PIN PA20
-    DIRECTION INPUT ;
-    PORT
-      LAYER M1 ;
-      POLYGON       ( 15 35 )
-      ( 15 60 )
-      ( 65 60 )
-      ( 65 35 )
-      ( 15 35 ) ;
-    END
-    PORT
-      LAYER M1 ;
-      PATH       ( 8.55 12.15 )
-      ( 9.45 13.05 ) ;
-    END
-  END PA20
-  PIN PA21
-    DIRECTION OUTPUT TRISTATE ;
-    PORT
-      LAYER M1 ;
-      POLYGON ITERATE      ( 20 35 )
-      ( 20 60 )
-      ( 70 60 )
-      ( 70 35 )
-      DO 1 BY 2 STEP 5 5 ;
-    END
-    PORT
-      LAYER M1 ;
-      PATH ITERATED       ( 5.55 12.15 )
-      ( 10.45 13.05 )
-      DO 1 BY 2 STEP 2 2 ;
-    END
-  END PA21
-  OBS
-      LAYER M1 ;
-      SPACING 5.6 ;
-      RECT ( 6.600000 -0.600000 ) ( 9.600000 0.600000 ) ;
-      RECT ( 4.800000 12.000000 ) ( 9.600000 13.200000 ) ;
-      RECT ( 3.000000 13.800000 ) ( 7.800000 16.800000 ) ;
-      RECT ( 3.000000 -0.600000 ) ( 6.000000 0.600000 ) ;
-      RECT ( 3.000000 8.400000 ) ( 6.000000 11.400000 ) ;
-      RECT ( 3.000000 8.400000 ) ( 4.200000 16.800000 ) ;
-      RECT ( -0.600000 13.800000 ) ( 4.200000 16.800000 ) ;
-      RECT ( -0.600000 -0.600000 ) ( 2.400000 0.600000 ) ;
-      RECT ( 6.600000 6.600000 ) ( 9.600000 11.400000 ) ;
-      RECT ( 6.600000 6.600000 ) ( 7.800000 11.400000 ) ;
-  END
-Parsed 1350 number of lines!!
-  CLASS RING ;
-  FIXEDMASK ;
-  EEQ CHK1 ;
-  SYMMETRY X Y R90 ;
-  SITE CORE ;
-  SIZE 10.8 BY 28.8 ;
-  FOREIGN CHKS ( 0 0 ) FN ;
-  ORIGIN ( 0.9 0.9 ) ;
-  PROPERTY stringProp first STRING integerProp 1 INTEGER WEIGHT 30.31 REAL ;
-END CHK3A
-MACRO INV
-MACRO CLASS CORE
-  PIN Z
-    DIRECTION OUTPUT ;
-    USE SIGNAL ;
-    ANTENNAPARTIALMETALAREA 10611.2 LAYER M2 ;
-    ANTENNAPARTIALMETALAREA 2450.26 LAYER M3 ;
-    ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-    ANTENNAPARTIALCUTAREA 185.73 LAYER V2 ;
-    ANTENNADIFFAREA 5008.46 LAYER M2 ;
-    ANTENNADIFFAREA 5163.88 LAYER M3 ;
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 297.214 LAYER M3 ;
-    ANTENNAMODEL OXIDE2 ;
-    ANTENNAMODEL OXIDE3 ;
-    ANTENNAGATEAREA 162.48 LAYER M2 ;
-    PORT
-      LAYER M2 ;
-      PATH       ( 30.8 9 )
-      ( 42 9 ) ;
-    END
-  END Z
-Parsed 1400 number of lines!!
-  PIN A
-    DIRECTION INPUT ;
-    USE ANALOG ;
-    PORT
-      LAYER M1 ;
-      PATH       ( 25.2 15 ) ;
-    END
-  END A
-  PIN VDD
-    DIRECTION INOUT ;
-    SHAPE ABUTMENT ;
-    ANTENNAPARTIALMETALAREA 10611.2 LAYER M2 ;
-    ANTENNAPARTIALMETALAREA 2450.26 LAYER M3 ;
-    ANTENNAPARTIALCUTAREA 4.8216 LAYER V1 ;
-    ANTENNAPARTIALCUTAREA 185.73 LAYER V2 ;
-    ANTENNADIFFAREA 5008.46 LAYER M2 ;
-    ANTENNADIFFAREA 5163.88 LAYER M3 ;
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 297.214 LAYER M3 ;
-    ANTENNAMODEL OXIDE2 ;
-    ANTENNAMODEL OXIDE3 ;
-    ANTENNAGATEAREA 162.48 LAYER M2 ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 50.4 2.8 )
-      ( 50.4 21.2 ) ;
-    END
-  END VDD
-  PIN VSS
-    DIRECTION INOUT ;
-    SHAPE ABUTMENT ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 16.8 2.8 )
-      ( 16.8 21.2 ) ;
-    END
-  END VSS
-Parsed 1450 number of lines!!
-  OBS
-      LAYER M1 ;
-      DESIGNRULEWIDTH 4.5 ;
-      WIDTH 0.1 ;
-      RECT MASK 2 ( 24.100000 1.500000 ) ( 43.500000 16.500000 ) ;
-      RECT MASK 2 ITERATE ( 24.100000 1.500000 ) ( 43.500000 16.500000 )
-      DO 2 BY 1 STEP 20 0 ;
-      PATH MASK 3 ITERATED       ( 532 534 )
-      ( 1999.2 534 )
-      DO 1 BY 2 STEP 0 1446 ;
-      VIA ITERATE MASK 123 ( 470.4 475 ) VIABIGPOWER12
-      DO 2 BY 2 STEP 1590.4 1565 ;
-      PATH MASK 3       ( 532 534 )
-      ( 1999.2 534 ) ;
-      PATH MASK 3       ( 532 1980 )
-      ( 1999.2 1980 ) ;
-      VIA MASK 103 ( 470.4 475 ) VIABIGPOWER12 ;
-      VIA MASK 132 ( 2060.8 475 ) VIABIGPOWER12 ;
-      VIA MASK 112 ( 470.4 2040 ) VIABIGPOWER12 ;
-      VIA MASK 123 ( 2060.8 2040 ) VIABIGPOWER12 ;
-      RECT ( 44.100000 1.500000 ) ( 63.500000 16.500000 ) ;
-  END
-  DENSITY
-    LAYER metal1 ;
-      RECT 0 0 100 100 45.5 ;
-      RECT 100 0 200 100 42.2 ;
-    LAYER metal2 ;
-      RECT 0 0 250 140 20.5 ;
-      RECT 1 1 250 140 20.5 ;
-      RECT 2 2 250 140 20.5 ;
-    LAYER metal3 ;
-      RECT 10 10 40 40 4.5 ;
-  END
-  CLASS CORE ;
-  SYMMETRY X Y R90 ;
-  SITE CORE1 ;
-  SIZE 67.2 BY 24 ;
-  FOREIGN INVS ;
-END INV
-MACRO INV_B
-MACRO CLASS CORE SPACER
-Parsed 1500 number of lines!!
-  PIN Z
-    DIRECTION OUTPUT ;
-    USE CLOCK ;
-    PORT
-      LAYER M1 ;
-      WIDTH 1 ;
-      PATH MASK 2       ( -0.6 -0.6 )
-      ( 0.6 -0.6 )
-      ( 0.7 -0.6 ) ;
-      LAYER M2 ;
-      WIDTH 1 ;
-      RECT MASK 1 ( -0.600000 -0.600000 ) ( 0.600000 0.600000 ) ;
-      LAYER M3 ;
-      WIDTH 1 ;
-      RECT MASK 2 ITERATE ( -0.600000 -0.600000 ) ( 0.600000 0.600000 )
-      DO 1 BY 2 STEP 2 1 ;
-      LAYER M4 ;
-      PATH MASK 1       ( 30.8 9 )
-      ( 42 9 ) ;
-      VIA MASK 103 ( 470.4 475 ) VIABIGPOWER12 ;
-      VIA MASK 130 ( 2060.8 475 ) VIABIGPOWER12 ;
-      VIA MASK 113 ( 470.4 2040 ) VIABIGPOWER12 ;
-      VIA MASK 121 ( 2060.8 2040 ) VIABIGPOWER12 ;
-    END
-  END Z
-  PIN A
-    DIRECTION FEEDTHRU ;
-    USE SIGNAL ;
-    PORT
-      LAYER M1 ;
-      PATH       ( 25.2 15 ) ;
-    END
-  END A
-Parsed 1550 number of lines!!
-  PIN VDD
-    DIRECTION INOUT ;
-    SHAPE ABUTMENT ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 50.4 2.8 )
-      ( 50.4 21.2 ) ;
-    END
-  END VDD
-  PIN VSS
-    DIRECTION INOUT ;
-    SHAPE ABUTMENT ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 16.8 2.8 )
-      ( 16.8 21.2 ) ;
-    END
-  END VSS
-  OBS
-      LAYER M1 ;
-      RECT ( 24.100000 1.500000 ) ( 43.500000 16.500000 ) ;
-  END
-  CLASS CORE SPACER ;
-  EEQ INV ;
-  SYMMETRY X Y R90 ;
-  SITE CORE1 ;
-  SIZE 67.2 BY 24 ;
-  FOREIGN INVS ( 4 5 ) ;
-  FOREIGN INV1 ( 5 6 ) S ;
-  FOREIGN INV2 ( 6 7 ) N ;
-  FOREIGN INV3 ( 7 8 ) ;
-END INV_B
-MACRO DFF3
-MACRO CLASS CORE ANTENNACELL
-Parsed 1600 number of lines!!
-  PIN Q
-    DIRECTION OUTPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER M2 ;
-      PATH       ( 19.6 99 )
-      ( 47.6 99 ) ;
-    END
-  END Q
-  PIN QN
-    DIRECTION OUTPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER M2 ;
-      PATH MASK 1       ( 25.2 123 )
-      ( 42 123 ) ;
-      RECT MASK 2 ( 24.100000 1.500000 ) ( 43.500000 208.500000 ) ;
-    END
-  END QN
-Parsed 1650 number of lines!!
-  PIN D
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER M1 ;
-      PATH       ( 30.8 51 ) ;
-    END
-  END D
-  PIN G
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER M1 ;
-      PATH       ( 25.2 3 ) ;
-    END
-  END G
-  PIN CD
-    DIRECTION INPUT ;
-    USE CLOCK ;
-    PORT
-      LAYER M1 ;
-      PATH       ( 36.4 75 ) ;
-    END
-  END CD
-  PIN VDD
-    DIRECTION INOUT ;
-    SHAPE RING ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 50.4 2.8 )
-      ( 50.4 207.2 ) ;
-    END
-  END VDD
-Parsed 1700 number of lines!!
-  PIN VSS
-    DIRECTION INOUT ;
-    SHAPE FEEDTHRU ;
-    PORT
-      LAYER M1 ;
-      WIDTH 5.6 ;
-      PATH       ( 16.8 2.8 )
-      ( 16.8 207.2 ) ;
-    END
-  END VSS
-  OBS
-      LAYER M1 ;
-      DESIGNRULEWIDTH 0.15 ;
-      RECT ( 24.100000 1.500000 ) ( 43.500000 208.500000 ) ;
-      PATH       ( 8.4 3 )
-      ( 8.4 123 ) ;
-      PATH       ( 58.8 3 )
-      ( 58.8 123 ) ;
-      PATH       ( 64.4 3 )
-      ( 64.4 123 ) ;
-  END
-  DENSITY
-    LAYER metal4 ;
-      RECT 24.1 1.5 43.5 208.5 5.5 ;
-  END
-  CLASS CORE ANTENNACELL ;
-  SYMMETRY X Y R90 ;
-  SITE CORE 34 54 FE DO 30 BY 3 STEP 1 1 ;
-  SITE CORE1 21 68 S DO 30 BY 3 STEP 2 2 ;
-  SIZE 67.2 BY 210 ;
-  FOREIGN DFF3S ;
-END DFF3
-MACRO BUF1
-MACRO CLASS ENDCAP BOTTOMLEFT
-  PIN IN
-    ANTENNADIFFAREA 0 ;
-    ANTENNADIFFAREA 0 ;
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 1 ;
-    ANTENNAGATEAREA 3 ;
-    ANTENNAMODEL OXIDE2 ;
-    ANTENNAGATEAREA 2 ;
-    ANTENNAGATEAREA 4 ;
-  END IN
-Parsed 1750 number of lines!!
-  PIN IN2
-    ANTENNAMODEL OXIDE1 ;
-    ANTENNAGATEAREA 1 ;
-  END IN2
-  PIN IN3
-    SHAPE ABUTMENT ;
-  END IN3
-  PIN GND
-    USE GROUND ;
-    PORT
-      LAYER metal1 ;
-      POLYGON       ( 0 0 )
-      ( 0 1 )
-      ( 1 0 )
-      ( 2 2 )
-      ( 2 0 ) ;
-      RECT ( 2.000000 3.000000 ) ( 4.000000 5.000000 ) ;
-    END
-  END GND
-  OBS
-      LAYER metal2 ;
-      EXCEPTPGNET ;
-      POLYGON       ( 0 0 )
-      ( 0 1 )
-      ( 1 0 )
-      ( 2 2 )
-      ( 2 0 ) ;
-      RECT ( 2.000000 3.000000 ) ( 4.000000 5.000000 ) ;
-  END
-  CLASS ENDCAP BOTTOMLEFT ;
-END BUF1
-MACRO DFF4
-MACRO CLASS COVER BUMP
-  CLASS COVER BUMP ;
-  FOREIGN DFF3S ;
-END DFF4
-MACRO DFF5
-MACRO CLASS COVER
-  CLASS COVER ;
-  FOREIGN DFF3S ;
-END DFF5
-MACRO mydriver
-MACRO CLASS PAD AREAIO
-  CLASS PAD AREAIO ;
-  FOREIGN DFF3S ;
-END mydriver
-MACRO myblackbox
-MACRO CLASS BLOCK BLACKBOX
-  CLASS BLOCK BLACKBOX ;
-  FOREIGN DFF3S ;
-END myblackbox
-MACRO FWHSQCN690V15
-MACRO CLASS CORE
-Parsed 1800 number of lines!!
-  PIN R
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER a1sig ;
-      RECT ( 11.430000 0.800000 ) ( 11.710000 1.200000 ) ;
-      RECT ( 9.940000 0.800000 ) ( 11.430000 1.040000 ) ;
-      LAYER a1sig ;
-      RECT ( 9.490000 0.800000 ) ( 9.710000 0.820000 ) ;
-      RECT ( 9.710000 0.800000 ) ( 9.930000 1.040000 ) ;
-      RECT ( 9.920000 0.800000 ) ( 9.940000 1.040000 ) ;
-      RECT ( 9.000000 2.060000 ) ( 9.720000 2.080000 ) ;
-      RECT ( 9.390000 0.800000 ) ( 9.470000 1.780000 ) ;
-      RECT ( 9.460000 0.800000 ) ( 9.480000 1.780000 ) ;
-      RECT ( 9.470000 0.800000 ) ( 9.490000 1.770000 ) ;
-      RECT ( 9.480000 0.810000 ) ( 9.720000 2.070000 ) ;
-      RECT ( 9.000000 1.770000 ) ( 9.480000 2.070000 ) ;
-    END
-  END R
-  PIN SI
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER a1sig ;
-    END
-  END SI
-  PIN SM
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER a1sig ;
-      RECT ( 0.820000 3.510000 ) ( 1.080000 3.890000 ) ;
-      LAYER a1sig ;
-      RECT ( 0.360000 3.510000 ) ( 0.590000 3.690000 ) ;
-      RECT ( 0.360000 3.680000 ) ( 0.590000 3.700000 ) ;
-      RECT ( 0.590000 3.510000 ) ( 0.810000 3.890000 ) ;
-      RECT ( 0.590000 3.510000 ) ( 0.810000 3.890000 ) ;
-      RECT ( 0.800000 3.510000 ) ( 0.820000 3.890000 ) ;
-      RECT ( 0.360000 3.690000 ) ( 0.600000 3.990000 ) ;
-      LAYER a1sig ;
-    END
-  END SM
-Parsed 1850 number of lines!!
-  PIN T
-    DIRECTION INPUT ;
-    USE SIGNAL ;
-    PORT
-      LAYER a1sig ;
-      LAYER a1sig ;
-      RECT ( 4.850000 3.510000 ) ( 4.910000 3.700000 ) ;
-      RECT ( 4.910000 3.510000 ) ( 5.130000 3.990000 ) ;
-      RECT ( 5.120000 3.510000 ) ( 5.140000 3.990000 ) ;
-      RECT ( 4.200000 3.690000 ) ( 4.920000 3.990000 ) ;
-    END
-  END T
-  OBS
-      LAYER a1sig ;
-      SPACING 0 ;
-      RECT ( 0.110000 0.740000 ) ( 0.810000 3.470000 ) ;
-      RECT ( 0.800000 0.740000 ) ( 0.820000 3.470000 ) ;
-      RECT ( 0.820000 0.740000 ) ( 2.540000 4.060000 ) ;
-      RECT ( 2.540000 0.740000 ) ( 3.700000 3.470000 ) ;
-      RECT ( 3.700000 0.740000 ) ( 3.980000 4.060000 ) ;
-      RECT ( 3.980000 0.740000 ) ( 5.140000 3.470000 ) ;
-      RECT ( 5.140000 0.740000 ) ( 8.780000 4.060000 ) ;
-      RECT ( 8.780000 0.740000 ) ( 9.940000 1.540000 ) ;
-      RECT ( 8.780000 1.530000 ) ( 9.940000 1.550000 ) ;
-      RECT ( 8.780000 2.290000 ) ( 9.940000 4.060000 ) ;
-      RECT ( 9.940000 0.740000 ) ( 14.060000 4.060000 ) ;
-      RECT ( 14.060000 0.740000 ) ( 15.240000 2.510000 ) ;
-      RECT ( 15.230000 0.740000 ) ( 15.250000 2.510000 ) ;
-      RECT ( 14.060000 3.250000 ) ( 15.250000 4.050000 ) ;
-      RECT ( 14.060000 4.040000 ) ( 15.250000 4.060000 ) ;
-  END
-  CLASS CORE ;
-  SYMMETRY X Y ;
-  SITE CORE ;
-  SIZE 15.36 BY 4.8 ;
-  FOREIGN FWHSQCN690 ( 0 0 ) ;
-  ORIGIN ( 0 0 ) ;
-END FWHSQCN690V15
-MACRO mysoft
-MACRO CLASS BLOCK SOFT
-  OBS
-      LAYER a1sig ;
-      DESIGNRULEWIDTH 0 ;
-      RECT ( 0.110000 0.740000 ) ( 0.810000 3.470000 ) ;
-  END
-  CLASS BLOCK SOFT ;
-  FOREIGN DFF3S ;
-END mysoft
-MACRO mycorewelltap
-MACRO CLASS CORE WELLTAP
-  CLASS CORE WELLTAP ;
-  FOREIGN DFF3S ;
-END mycorewelltap
-MACRO myTest
-MACRO CLASS CORE
-Parsed 1900 number of lines!!
-  CLASS CORE ;
-  SYMMETRY X ;
-  SITE Fsite ;
-  SITE Fsite 0 0 N ;
-  SITE Fsite 0 7 FS ;
-  SITE Lsite 4 0 N ;
-  SITE Lsite 0 0 S DO 2 BY 1 STEP 4 5 ;
-  SITE Fsite 4 0 E ;
-  SITE Lsite 0.3 0 S DO 2 BY 1 STEP 4 5 ;
-  SITE Fsite 0 0 N DO 2 BY 1 STEP 4 0 ;
-  SIZE 10 BY 14 ;
-END myTest
-MACRO myMac
-MACRO CLASS CORE
-  PIN In1
-    USE SIGNAL ;
-    SUPPLYSENSITIVITY vddpin1 ;
-  END In1
-  PIN vddpin1
-    USE SIGNAL ;
-    NETEXPR "power1 VDD1" ;
-  END vddpin1
-  PIN vddpin2
-    USE SIGNAL ;
-    NETEXPR "power2 VDD2" ;
-  END vddpin2
-  PIN gndpin
-    USE SIGNAL ;
-    NETEXPR "gnd1 GND" ;
-  END gndpin
-  PIN In2
-    USE SIGNAL ;
-    GROUNDSENSITIVITY gndpin ;
-  END In2
-  CLASS CORE ;
-  SYMMETRY X ;
-  SIZE 10 BY 14 ;
-END myMac
-ANTENNAINPUTGATEAREA 45 ;
-Parsed 1950 number of lines!!
-ANTENNAINOUTDIFFAREA 65 ;
-ANTENNAOUTPUTDIFFAREA 55 ;
-BEGINEXT  "SIGNATURE"
-   CREATOR "CADENCE"
-   DATE "04/14/98"
-ENDEXT ;
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefMsgTable.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefMsgTable.h
deleted file mode 100644
index dd5efe7..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefMsgTable.h
+++ /dev/null
@@ -1,408 +0,0 @@
-
-/*
- * emsMkError:
-*/
-
-#include <stdio.h>
-#include "ems.h"
-
-#ifdef TSIZE
-#undef TSIZE
-#define TSIZE 2048
-#endif
-
-emsError_t LEFEmsMsgTable[] =
-{
-    {100    , EMS_NONE, "lefrRead called before lefrInit\n", -1, 0},
-    {101    , EMS_NONE, "lefrSetRegisterUnusedCallbacks was not called to setup this data.\n", -1, 0},
-    {201    , EMS_NONE, "LEF items that were present but ignored because of no callback:\n", -1, 0},
-    {203    , EMS_NONE, "Number has exceeded the limit for an integer. See file %s at line %d.\n", -1, 0},
-    {1000   , EMS_NONE, "Expecting '='", -1, 0},
-    {1001   , EMS_NONE, "End of file in &ALIAS", -1, 0},
-    {1002   , EMS_NONE, "Incomplete lef file", -1, 0},
-    {1003   , EMS_NONE, "tag is missing for BEGINEXT", -1, 0},
-    {1004   , EMS_NONE, "Tag for BEGINEXT is empty", -1, 0},
-    {1005   , EMS_NONE, "\" is missing in tag", -1, 0},
-    {1006   , EMS_NONE, "Ending \" is missing", -1, 0},
-    {1007   , EMS_NONE, "ENDEXT is missing", -1, 0},
-    {1008   , EMS_NONE, "Invalid characters found in \'%s\'.\nThese characters might have created by character types other than English.", -1, 0},
-    {1011   , EMS_NONE, "%s, see file %s at line %d.\nLast token was <%s\">; space is missing between the closing \" of the string and ;.\n", -1, 0},
-    {1020   , EMS_NONE, "Too many syntax errors.", -1, 0},
-    {1300   , EMS_NONE, "The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1301   , EMS_NONE, "The index number %d given for the layer MINSIZE is invalid.\nValid index is from 0 to %d\n", -1, 0},
-    {1302   , EMS_NONE, "The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1303   , EMS_NONE, "The index number %d given for the layer ARRAYCUTS is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1304   , EMS_NONE, "The index number %d given for the layer SPACING is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1305   , EMS_NONE, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", -1, 0},
-    {1306   , EMS_NONE, "Incorrect syntax defined for property LEF57_MAXFLOATINGAREA: %s.\nCorrect syntax is \"MAXFLOATINGAREA maxArea\"\n", -1, 0},
-    {1307   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1308   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nLONGARRAY is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1309   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nWIDTH is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1310   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING has defined more than once.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1311   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING which is required is either has not been defined or defined in a wrong location.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING array Spacing ...\n", -1, 0},
-    {1312   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nSPACING should be defined with ARRAYCUTS.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1313   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1314   , EMS_NONE, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nARRAYCUTS is required but has not been defined.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", -1, 0},
-    {1315   , EMS_NONE, "Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", -1, 0},
-    {1316   , EMS_NONE, "Incorrect syntax defined for property LEF57_ANTENNACUMROUTINGPLUSCUT: %s.\nCorrect syntax is \"ANTANNACUMROUTINGPLUSCUT\"\n", -1, 0},
-    {1317   , EMS_NONE, "Incorrect syntax defined for property LEF57_ANTENNAGATEPLUSDIFF: %s.\nCorrect syntax is \"ANTENNAGATEPLUSDIFF plusDiffFactor\"\n", -1, 0},
-    {1318   , EMS_NONE, "Incorrect syntax defined for property LEF57_ANTENNAAREAMINUSDIFF: %s.\nCorrect syntax is \"ANTENNAAREAMINUSDIFF minusDiffFactor\"\n", -1, 0},
-    {1319   , EMS_NONE, "Incorrect syntax defined for property LEF57_ANTENNAAREADIFFREDUCEPWL: %s.\nCorrect syntax is \"ANTENNAAREADIFFREDUCEPWL (( diffArea1 metalDiffFactor1 ) ( diffArea2 metalDiffFactor2 )...)\"\n", -1, 0},
-    {1320   , EMS_NONE, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"", -1, 0},
-    {1321   , EMS_NONE, "The property LEF57_SPACING with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file", -1, 0},
-    {1322   , EMS_NONE, "The property LEF57_SPACING with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.", -1, 0},
-    {1323   , EMS_NONE, "The property LEF57_MINSTEP with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.", -1, 0},
-    {1324   , EMS_NONE, "Incorrect syntax defined for the statement TWOWIDTHS.\nSpacing, which is required, is not defined.", -1, 0},
-    {1325   , EMS_NONE, "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type ROUTING.\nThe layer type is %s.\n", -1, 0},
-    {1326   , EMS_NONE, "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type CUT.\nThe layer type is %s.\n", -1, 0},
-    {1327   , EMS_NONE, "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type MASTERSLICE.\nThe layer type is %s.\n", -1, 0},
-    {1328   , EMS_NONE, "Property LEF58_TYPE has incorrect layer type %s.\nValue layer type are: POLYROUTING, MIMCAP, TSV, PASSIVATION, NWELL or PWELL.\n", -1, 0},
-    {1329   , EMS_NONE, "Incorrect syntax defined for property LEF58_TYPE: %s\nCorrect syntax is \"TYPE POLYROUTING | MINCAP | TSV | PASSIVATION | NWELL | PWELL ;\"\n", -1, 0},
-    {1330   , EMS_NONE, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", -1, 0},
-    {1331   , EMS_NONE, "The property LEF57_ENCLOSURE with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n", -1, 0},
-    {1350   , EMS_NONE, "The index number %d given for the macro PIN is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1351   , EMS_NONE, "There is an unexpected lef parser bug which cause it unable to retrieve ANTENNAMODEL data with the given index.", -1, 0},
-    {1352   , EMS_NONE, "The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", -1, 0},
-    {1360   , EMS_NONE, "The index number %d given for the geometry item is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1361   , EMS_NONE, "The index number %d given for the geometry RECTANGLE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1362   , EMS_NONE, "The index number %d given for the geometry RECTANGLE ITERATE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1363   , EMS_NONE, "The index number %d given for the geometry PATH is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1364   , EMS_NONE, "The index number %d given for the geometry PATH ITERATE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1365   , EMS_NONE, "The index number %d given for the geometry LAYER is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1366   , EMS_NONE, "The index number %d given for the geometry LAYER EXCEPT PG NET is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1367   , EMS_NONE, "The index number %d given for the geometry LAYER MINSPACING is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1368   , EMS_NONE, "The index number %d given for the geometry LAYER RULE WIDTH is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1369   , EMS_NONE, "The index number %d given for the geometry WIDTH is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1370   , EMS_NONE, "The index number %d given for the geometry POLYGON is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1371   , EMS_NONE, "The index number %d given for the geometry POLYGON ITERATE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1372   , EMS_NONE, "The index number %d given for the geometry CLASS is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1373   , EMS_NONE, "The index number %d given for the geometry VIA is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1374   , EMS_NONE, "The index number %d given for the geometry VIA ITERATE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1375   , EMS_NONE, "unknown geometry type.", -1, 0},
-    {1376   , EMS_NONE, "The index number %d given for the IRDROP is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1377   , EMS_NONE, "The index number %d given for the TRACK PATTERN  is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1400   , EMS_NONE, "Invalid nondefaultvia callback.", -1, 0},
-    {1401   , EMS_NONE, "Invalid nondefaultspacing callback.", -1, 0},
-    {1402   , EMS_NONE, "The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1403   , EMS_NONE, "The index number %d given for the NONDEFAULT VIA is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1404   , EMS_NONE, "The index number %d given for the NONDEFAULT SPACING is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1405   , EMS_NONE, "The index number %d given for the NONDEFAULT USE VIA is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1406   , EMS_NONE, "The index number %d given for the NONDEFAULT USE VIARULE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1407   , EMS_NONE, "The index number %d given for the NONDEFAULT CUT is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1408   , EMS_NONE, "The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1420   , EMS_NONE, "The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1421   , EMS_NONE, "The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d.", -1, 0},
-    {1422   , EMS_NONE, "The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d.", -1, 0},
-    {1430   , EMS_NONE, "too many via rule layers.", -1, 0},
-    {1431   , EMS_NONE, "The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d.", -1, 0},
-    {1501   , EMS_NONE, "Error found when processing LEF file '%s'\nUnit %d is a version 5.6 or later syntax\nYour lef file is defined with version %g.", -1, 0},
-    {1502   , EMS_NONE, "The value %d defined for LEF UNITS DATABASE MICRONS is invalid\n. Correct value is 100, 200, 1000, 2000, 10000, or 20000", -1, 0},
-    {1503   , EMS_NONE, "Lef parser 5.7 does not support lef file with version %s. Parser will stop processing.", -1, 0},
-    {1504   , EMS_NONE, "NAMESCASESENSITIVE statement is set with OFF.\nStarting version 5.6, NAMESCASENSITIVE is obsolete,\nif it is defined, it has to have the ON value.\nParser will stop processing.", -1, 0},
-    {1505   , EMS_NONE, "MANUFACTURINGGRID statement was defined before UNITS.\nRefer to the LEF Language Reference manual for the order of LEF statements.", -1, 0},
-    {1506   , EMS_NONE, "A MAXVIASTACK statement is defined before the LAYER statement.\nRefer to the LEF Language Reference manual for the order of LEF statements.", -1, 0},
-    {1507   , EMS_NONE, "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1508   , EMS_NONE, "TYPE statement is a required statement in a LAYER and it is not defined.", -1, 0},
-    {1509   , EMS_NONE, "PITCH statement is a required statement in a LAYER with TYPE ROUTING and it is not defined.", -1, 0},
-    {1510   , EMS_NONE, "WIDTH statement is a required statement in a LAYER with TYPE ROUTING and it is not defined.", -1, 0},
-    {1511   , EMS_NONE, "The DIRECTION statement which is required in a LAYER with TYPE ROUTING is not defined in LAYER %s.\nUpdate your lef file and add the DIRECTION statement for layer %s.", -1, 0},
-    {1512   , EMS_NONE, "It is incorrect to define a SPACING statement in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.", -1, 0},
-    {1513   , EMS_NONE, "DIRECTION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1514   , EMS_NONE, "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1515   , EMS_NONE, "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1516   , EMS_NONE, "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1517   , EMS_NONE, "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1518   , EMS_NONE, "HEIGHT statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1519   , EMS_NONE, "WIREEXTENSION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1520   , EMS_NONE, "THICKNESS statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1521   , EMS_NONE, "SHRINKAGE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1522   , EMS_NONE, "CAPMULTIPLIER statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1523   , EMS_NONE, "EDGECAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1524   , EMS_NONE, "ANTENNAAREAFACTOR statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1525   , EMS_NONE, "ANTENNALENGTHFACTOR statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1526   , EMS_NONE, "ANTENNALENGTHFACTOR statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNALENGTHFACTOR syntax, which is incorrect.", -1, 0},
-    {1527   , EMS_NONE, "ACCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.", -1, 0},
-    {1528   , EMS_NONE, "DCCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.", -1, 0},
-    {1529   , EMS_NONE, "CUTAREA statement can only be defined in LAYER with TYPE CUT. Parser will stop processing.", -1, 0},
-    {1530   , EMS_NONE, "WIDTH statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1531   , EMS_NONE, "ANTENNAAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1532   , EMS_NONE, "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAAREARATIO syntax, which is incorrect.", -1, 0},
-    {1533   , EMS_NONE, "ANTENNAAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1534   , EMS_NONE, "ANTENNADIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1535   , EMS_NONE, "ANTENNACUMAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1536   , EMS_NONE, "ANTENNACUMAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNACUMAREARATIO syntax, which is incorrect.", -1, 0},
-    {1537   , EMS_NONE, "ANTENNACUMAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1538   , EMS_NONE, "ANTENNACUMDIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1539   , EMS_NONE, "ANTENNACUMDIFFAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFAREARATIO syntax, which is incorrect.", -1, 0},
-    {1540   , EMS_NONE, "ANTENNACUMDIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1541   , EMS_NONE, "ANTENNAAREAFACTOR can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1542   , EMS_NONE, "ANTENNASIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1543   , EMS_NONE, "ANTENNASIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1544   , EMS_NONE, "ANTENNASIDEAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREARATIO syntax, which is incorrect.", -1, 0},
-    {1545   , EMS_NONE, "ANTENNADIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1546   , EMS_NONE, "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1547   , EMS_NONE, "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFSIDEAREARATIO syntax, which is incorrect.", -1, 0},
-    {1548   , EMS_NONE, "ANTENNACUMSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1549   , EMS_NONE, "ANTENNACUMSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1550   , EMS_NONE, "ANTENNACUMSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMSIDEAREARATIO syntax, which is incorrect.", -1, 0},
-    {1551   , EMS_NONE, "ANTENNACUMDIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1552   , EMS_NONE, "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1553   , EMS_NONE, "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFSIDEAREARATIO syntax, which is incorrect.", -1, 0},
-    {1554   , EMS_NONE, "ANTENNASIDEAREAFACTOR can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1555   , EMS_NONE, "ANTENNASIDEAREAFACTOR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1556   , EMS_NONE, "ANTENNASIDEAREAFACTOR statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREAFACTOR syntax, which is incorrect.", -1, 0},
-    {1557   , EMS_NONE, "ANTENNAMODEL can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1558   , EMS_NONE, "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1559   , EMS_NONE, "ANTENNAMODEL statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAMODEL syntax, which is incorrect.", -1, 0},
-    {1560   , EMS_NONE, "ANTENNACUMROUTINGPLUSCUT can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1561   , EMS_NONE, "ANTENNAGATEPLUSDIFF can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1562   , EMS_NONE, "ANTENNAAREAMINUSDIFF can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1563   , EMS_NONE, "ANTENNAAREADIFFREDUCEPWL can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.", -1, 0},
-    {1564   , EMS_NONE, "SLOTWIREWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1565   , EMS_NONE, "SLOTWIRELENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1566   , EMS_NONE, "SLOTWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1567   , EMS_NONE, "SLOTLENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1568   , EMS_NONE, "MAXADJACENTSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1569   , EMS_NONE, "MAXCOAXIALSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1570   , EMS_NONE, "MAXEDGESLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1571   , EMS_NONE, "SPLITWIREWIDTH statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g.", -1, 0},
-    {1572   , EMS_NONE, "MINIMUMDENSITY statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g.", -1, 0},
-    {1573   , EMS_NONE, "MAXIMUMDENSITY statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g.", -1, 0},
-    {1574   , EMS_NONE, "DENSITYCHECKWINDOW statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1575   , EMS_NONE, "DENSITYCHECKSTEP statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1576   , EMS_NONE, "FILLACTIVESPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1577   , EMS_NONE, "MAXWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing.", -1, 0},
-    {1578   , EMS_NONE, "MAXWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1579   , EMS_NONE, "MINWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing.", -1, 0},
-    {1580   , EMS_NONE, "MINWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1581   , EMS_NONE, "MINENCLOSEDAREA statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1582   , EMS_NONE, "PROTRUSION RULE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1583   , EMS_NONE, "SPACINGTABLE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1584   , EMS_NONE, "ENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1585   , EMS_NONE, "PREFERENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1586   , EMS_NONE, "RESISTANCE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1587   , EMS_NONE, "DIAGMINEDGELENGTH can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1588   , EMS_NONE, "DIAGMINEDGELENGTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1589   , EMS_NONE, "An INFLUENCE table statement was defined before the PARALLELRUNLENGTH table statement.\nINFLUENCE table statement should be defined following the PARALLELRUNLENGTH.\nChange the LEF file and rerunning the parser.", -1, 0},
-    {1590   , EMS_NONE, "There is multiple PARALLELRUNLENGTH table statements are defined within a layer.\nAccording to the LEF Reference Manual, only one PARALLELRUNLENGTH table statement is allowed per layer.", -1, 0},
-    {1591   , EMS_NONE, "The total number of lengths defined in the PARALLELRUNLENGTH statement is not equal to\nthe  total number of spacings defined in the WIDTH statement in the SPACINGTABLE.", -1, 0},
-    {1592   , EMS_NONE, "A PARALLELRUNLENGTH statement was already defined in the layer.\nIt is PARALLELRUNLENGTH or TOWWIDTHS is allowed per layer.", -1, 0},
-    {1593   , EMS_NONE, "A TWOWIDTHS table statement was already defined in the layer.\nOnly one TWOWIDTHS statement is allowed per layer.", -1, 0},
-    {1594   , EMS_NONE, "A INFLUENCE table statement was already defined in the layer.\nOnly one INFLUENCE statement is allowed per layer.", -1, 0},
-    {1595   , EMS_NONE, "An INFLUENCE table statement was already defined before the layer.\nINFLUENCE statement has to be defined after the PARALLELRUNLENGTH table statement in the layer.", -1, 0},
-    {1596   , EMS_NONE, "FROMABOVE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1597   , EMS_NONE, "FROMBELOW statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1598   , EMS_NONE, "LENGTH WITHIN statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1599   , EMS_NONE, "ANTENNAAREAFACTOR with DIFFUSEONLY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1600   , EMS_NONE, "CUTAREA statement can only be defined in LAYER with TYPE CUT.", -1, 0},
-    {1601   , EMS_NONE, "WIDTH can only be defined in LAYER with TYPE ROUTING.", -1, 0},
-    {1602   , EMS_NONE, "MAXVIASTACK statement has to be defined after the LAYER statement.", -1, 0},
-    {1603   , EMS_NONE, "A MAXVIASTACK was already defined.\nOnly one MAXVIASTACK is allowed per lef file.", -1, 0},
-    {1604   , EMS_NONE, "MAXVIASTACK statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1605   , EMS_NONE, "DEFAULT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1606   , EMS_NONE, "A LAYER statement is missing in the VIA %s.\nAt least one LAYER is required per VIA statement.", -1, 0},
-    {1607   , EMS_NONE, "END VIA name %s is different from the VIA name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1608   , EMS_NONE, "A VIARULE statement requires two layers.", -1, 0},
-    {1609   , EMS_NONE, "A DIRECTION statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer.", -1, 0},
-    {1610   , EMS_NONE, "An OVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG.", -1, 0},
-    {1611   , EMS_NONE, "An OVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.", -1, 0},
-    {1612   , EMS_NONE, "An METALOVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.", -1, 0},
-    {1613   , EMS_NONE, "An METALOVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG.", -1, 0},
-    {1614   , EMS_NONE, "An ENCLOSURE statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.", -1, 0},
-    {1615   , EMS_NONE, "END VIARULE name %s is different from the VIARULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1616   , EMS_NONE, "SAMENET statement is required inside SPACING for any lef file with version 5.4 and earlier, but is not defined in the parsed lef file.", -1, 0},
-    {1617   , EMS_NONE, "NONDEFAULTRULE statement requires at least one LAYER statement.", -1, 0},
-    {1618   , EMS_NONE, "NONDEFAULTRULE statement requires at least one VIA statement.", -1, 0},
-    {1619   , EMS_NONE, "END NONDEFAULTRULE name %s is different from the NONDEFAULTRULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1620   , EMS_NONE, "HARDSPACING statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1621   , EMS_NONE, "USEVIA statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1622   , EMS_NONE, "USEVIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1623   , EMS_NONE, "MINCUTS statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1624   , EMS_NONE, "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1625   , EMS_NONE, "A WIDTH statement is required in the LAYER statement in NONDEFAULTRULE.", -1, 0},
-    {1626   , EMS_NONE, "A SPACING statement is required in the LAYER statement in NONDEFAULTRULE for lef file with version 5.5 and earlier.\nYour lef file is defined with version %g. Update your lef to add a LAYER statement and try again.", -1, 0},
-    {1627   , EMS_NONE, "RESISTANCE RPERSQ statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1628   , EMS_NONE, "CAPACITANCE CPERSQDIST statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1629   , EMS_NONE, "EDGECAPACITANCE statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g.", -1, 0},
-    {1630   , EMS_NONE, "DIAGWIDTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1631   , EMS_NONE, "END SITE name %s is different from the SITE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1632   , EMS_NONE, "A CLASS statement is required in the SITE statement.", -1, 0},
-    {1633   , EMS_NONE, "A SIZE  statement is required in the SITE statement.", -1, 0},
-    {1634   , EMS_NONE, "END MACRO name %s is different from the MACRO name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1635   , EMS_NONE, "COVER BUMP statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1636   , EMS_NONE, "BLOCK BLACKBOX statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1637   , EMS_NONE, "BLOCK SOFT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1638   , EMS_NONE, "PAD AREAIO statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1639   , EMS_NONE, "SPACER statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1640   , EMS_NONE, "ANTENNACELL statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1641   , EMS_NONE, "WELLTAP statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1642   , EMS_NONE, "ORIGIN statement has been defined more than once in a MACRO statement.\nOnly one ORIGIN statement can be defined in a Macro.\nParser will stop processing.", -1, 0},
-    {1643   , EMS_NONE, "END PIN name %s is different from the PIN name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1644   , EMS_NONE, "ANTENNASIZE statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1645   , EMS_NONE, "ANTENNAMETALAREA statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1646   , EMS_NONE, "ANTENNAMETALLENGTH statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1647   , EMS_NONE, "ANTENNAPARTIALMETALAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1648   , EMS_NONE, "ANTENNAPARTIALMETALSIDEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1649   , EMS_NONE, "ANTENNAPARTIALCUTAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1650   , EMS_NONE, "ANTENNADIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1651   , EMS_NONE, "ANTENNAGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1652   , EMS_NONE, "ANTENNAMAXAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1653   , EMS_NONE, "ANTENNAMAXSIDEAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1654   , EMS_NONE, "ANTENNAMAXCUTCAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1655   , EMS_NONE, "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1656   , EMS_NONE, "NETEXPR statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1657   , EMS_NONE, "SUPPLYSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1658   , EMS_NONE, "GROUNDSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1659   , EMS_NONE, "THE SPACING statement has the value %g in MACRO OBS.\nValue has to be 0 or greater.", -1, 0},
-    {1660   , EMS_NONE, "THE DESIGNRULEWIDTH statement has the value %g in MACRO OBS.\nValue has to be 0 or greater.", -1, 0},
-    {1661   , EMS_NONE, "DENSITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1662   , EMS_NONE, "END ARRAY name %s is different from the ARRAY name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", -1, 0},
-    {1663   , EMS_NONE, "A CENTERTOCENTER statement was already defined in SPACING\nCENTERTOCENTER can only be defined once per LAYER CUT SPACING.", -1, 0},
-    {1664   , EMS_NONE, "CENTERTOCENTER statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1665   , EMS_NONE, "A SAMENET statement was already defined in SPACING\nSAMENET can only be defined once per LAYER CUT SPACING.", -1, 0},
-    {1666   , EMS_NONE, "A PARALLELOVERLAP statement was already defined in SPACING\nPARALLELOVERLAP can only be defined once per LAYER CUT SPACING.", -1, 0},
-    {1667   , EMS_NONE, "A SAMENET statement was already defined in SPACING\nEither SAMENET or LAYER can be defined, but not both.", -1, 0},
-    {1668   , EMS_NONE, "ADJACENTCUTS statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1669   , EMS_NONE, "A SAMENET statement was already defined in SPACING\nEither SAMENET or ADJACENTCUTS can be defined, but not both.", -1, 0},
-    {1670   , EMS_NONE, "A SAMENET statement was already defined in SPACING\nEither SAMENET or AREA can be defined, but not both.", -1, 0},
-    {1671   , EMS_NONE, "INPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INPUTPINANTENNASIZE syntax, which is incorrect.", -1, 0},
-    {1672   , EMS_NONE, "OUTPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new OUTPUTPINANTENNASIZE syntax, which is incorrect.", -1, 0},
-    {1673   , EMS_NONE, "INOUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INOUTPINANTENNASIZE syntax, which is incorrect.", -1, 0},
-    {1674   , EMS_NONE, "ANTENNAINPUTGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value.", -1, 0},
-    {1675   , EMS_NONE, "ANTENNAINPUTGATEAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINPUTGATEAREA syntax, which is incorrect.", -1, 0},
-    {1676   , EMS_NONE, "ANTENNAINOUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value.", -1, 0},
-    {1677   , EMS_NONE, "ANTENNAINOUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINOUTDIFFAREA syntax, which is incorrect.", -1, 0},
-    {1678   , EMS_NONE, "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value..", -1, 0},
-    {1679   , EMS_NONE, "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAOUTPUTDIFFAREA syntax, which is incorrect.", -1, 0},
-    {1680   , EMS_NONE, "PARALLELOVERLAP is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1681   , EMS_NONE, "ENDOFLINE is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1682   , EMS_NONE, "NOTCHLENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1683   , EMS_NONE, "EXCEPTSAMEPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1684   , EMS_NONE, "SAMENET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1685   , EMS_NONE, "ARRAYSPACING is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1686   , EMS_NONE, "ANTENNACUMROUTINGPLUSCUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1687   , EMS_NONE, "ANTENNAGATEPLUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1688   , EMS_NONE, "ANTENNAAREAMINUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1689   , EMS_NONE, "ANTENNAAREADIFFREDUCEPWL is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1690   , EMS_NONE, "EXCEPTEXTRACUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1691   , EMS_NONE, "LENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1693   , EMS_NONE, "AREA is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1694   , EMS_NONE, "SPACINGTABLE ORTHOGONAL is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1696   , EMS_NONE, "ENDOFNOTCHWIDTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1697   , EMS_NONE, "TWOWIDTHS is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1698   , EMS_NONE, "BUMP is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1699   , EMS_NONE, "EXCEPTPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1700   , EMS_NONE, "MINIMUMCUT WITHIN is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1701   , EMS_NONE, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.", -1, 0},
-    {1702   , EMS_NONE, "CURRENTDEN statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.", -1, 0},
-    {1703   , EMS_NONE, "ANTENNADIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1704   , EMS_NONE, "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFAREARATIO syntax, which is incorrect.", -1, 0},
-    {1705   , EMS_NONE, "VIARULE statement in a layer, requires a DIRECTION construct statement.", -1, 0},
-    {1706   , EMS_NONE, "An ENCLOSURE statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer.", -1, 0},
-    {1707   , EMS_NONE, "ENCLOSURE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1708   , EMS_NONE, "A VIARULE GENERATE requires three layers.", -1, 0},
-    {1709   , EMS_NONE, "VIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1710   , EMS_NONE, "MAXEDGES is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1711   , EMS_NONE, "NOSHAREDEDGE in LAYER ENCLOSURE is a version 5.8 or later syntax.\nYour lef file is defined with version %g.", -1, 0},
-    {1712   , EMS_NONE, "MINFEATURE statement was defined before UNITS.\nRefer the LEF Language Reference manual for the order of LEF statements.", -1, 0},
-    {2000   , EMS_NONE, "String has exceeded 4096 characters, extra characters are truncated.", -1, 0},
-    {2001   , EMS_NONE, "VERSION is a required statement on LEF file with version 5.5 and earlier.\nWithout VERSION defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to defined this statement.", -1, 0},
-    {2002   , EMS_NONE, "NAMESCASESENSITIVE is a required statement on LEF file with version 5.5 and earlier.\nWithout NAMESCASESENSITIVE defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement.", -1, 0},
-    {2003   , EMS_NONE, "BUSBITCHARS is a required statement on LEF file with version 5.5 and earlier.\nWithout BUSBITCHARS defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement.", -1, 0},
-    {2004   , EMS_NONE, "DIVIDERCHAR is a required statement on LEF file with version 5.5 and earlier.\nWithout DIVIDECHAR defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement.", -1, 0},
-    {2005   , EMS_NONE, "DIVIDERCHAR has an invalid null value. Value is set to default /", -1, 0},
-    {2006   , EMS_NONE, "BUSBITCHAR has an invalid null value. Value is set to default []", -1, 0},
-    {2007   , EMS_NONE, "NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2008   , EMS_NONE, "NOWIREEXTENSIONATPIN statement is obsolete in version 5.6 or later.\nThe NOWIREEXTENSIONATPIN statement will be ignored.", -1, 0},
-    {2009   , EMS_NONE, "USEMINSPACING PIN statement is obsolete in version 5.6 or later.\n The USEMINSPACING PIN statement will be ignored.", -1, 0},
-    {2010   , EMS_NONE, "It is incorrect to have both SPACING rules & SPACINGTABLE rules within a ROUTING layer.", -1, 0},
-    {2011   , EMS_NONE, "SLOTWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2012   , EMS_NONE, "SLOTWIRELENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2013   , EMS_NONE, "SLOTWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2014   , EMS_NONE, "SLOTLENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2015   , EMS_NONE, "MAXADJACENTSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2016   , EMS_NONE, "MAXCOAXIALSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2017   , EMS_NONE, "MAXEDGESLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2018   , EMS_NONE, "SPLITWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.", -1, 0},
-    {2019   , EMS_NONE, "TOPOFSTACKONLY statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2020   , EMS_NONE, "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2021   , EMS_NONE, "turn-via is obsolete in version 5.6 and later.\n The LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2022   , EMS_NONE, "DIRECTION statement in VIARULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2023   , EMS_NONE, "OVERHANG statement will be translated into similar ENCLOSURE rule", -1, 0},
-    {2024   , EMS_NONE, "METALOVERHANG statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2025   , EMS_NONE, "SAMENET statement in NONDEFAULTRULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2026   , EMS_NONE, "IRDROP statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2027   , EMS_NONE, "MINFEATURE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2028   , EMS_NONE, "DIELECTRIC statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2029   , EMS_NONE, "RESISTANCE RPERSQ statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2030   , EMS_NONE, "CAPACITANCE CPERSQDIST statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2031   , EMS_NONE, "EDGECAPACITANCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2032   , EMS_NONE, "A SITE statement is defined before SYMMETRY statement.\nTo avoid this warning in the future, define SITE after SYMMETRY.", -1, 0},
-    {2033   , EMS_NONE, "The statement COVER BUMP is a LEF version 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.", -1, 0},
-    {2034   , EMS_NONE, "The statement BLOCK BLACKBOX is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.", -1, 0},
-    {2035   , EMS_NONE, "The statement PAD AREAIO is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.", -1, 0},
-    {2036   , EMS_NONE, "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2037   , EMS_NONE, "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2038   , EMS_NONE, "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2039   , EMS_NONE, "A SITE statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define SITE after ORIGIN.", -1, 0},
-    {2040   , EMS_NONE, "A PIN statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define PIN after ORIGIN.", -1, 0},
-    {2041   , EMS_NONE, "A OBS statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define OBS after ORIGIN.", -1, 0},
-    {2042   , EMS_NONE, "LEQ statement in MACRO is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2043   , EMS_NONE, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2044   , EMS_NONE, "LEQ statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2045   , EMS_NONE, "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2046   , EMS_NONE, "MACRO LEAKAGE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2047   , EMS_NONE, "MACRO RISETHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2048   , EMS_NONE, "MACRO FALLTHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2049   , EMS_NONE, "MACRO RISESATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2050   , EMS_NONE, "MACRO FALLSATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2051   , EMS_NONE, "MACRO VLO statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2052   , EMS_NONE, "MACRO VHI statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2053   , EMS_NONE, "MACRO TIEOFFR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2054   , EMS_NONE, "MACRO OUTPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2055   , EMS_NONE, "MACRO OUTPUTRESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2056   , EMS_NONE, "MACRO INPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2057   , EMS_NONE, "MACRO CAPACITANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2058   , EMS_NONE, "MACRO RESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2059   , EMS_NONE, "MACRO PULLDOWNRES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2060   , EMS_NONE, "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2061   , EMS_NONE, "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2062   , EMS_NONE, "MACRO RISEVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2063   , EMS_NONE, "MACRO FALLVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2064   , EMS_NONE, "MACRO IV_TABLES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2065   , EMS_NONE, "Either PATH, RECT or POLYGON statement is a required in MACRO/PIN/PORT.", -1, 0},
-    {2066   , EMS_NONE, "MACRO TIMING statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2067   , EMS_NONE, "DEFINE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2068   , EMS_NONE, "DEFINES statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2069   , EMS_NONE, "DEFINEB statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.", -1, 0},
-    {2070   , EMS_NONE, "UNIVERSALNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2071   , EMS_NONE, "EDGERATETHRESHOLD1 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2072   , EMS_NONE, "EDGERATETHRESHOLD2 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2073   , EMS_NONE, "EDGERATESCALEFACTOR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2074   , EMS_NONE, "NOISETABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2075   , EMS_NONE, "CORRECTIONTABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.", -1, 0},
-    {2076   , EMS_NONE, "Either PATH, RECT or POLYGON statement is required in MACRO/OBS.", -1, 0},
-    {2077   , EMS_NONE, "A SPACING SAMENET section is defined but it is not legal in a LEF 5.7 version file.\nIt will be ignored which will probably cause real DRC violations to be ignored, and may\ncause false DRC violations to occur.\n\nTo avoid this warning, and correctly handle these DRC rules, you should modify your\nLEF to use the appropriate SAMENET keywords as described in the LEF/DEF 5.7\nmanual under the SPACING statements in the LAYER (Routing) and LAYER (Cut)\nsections listed in the LEF Table of Contents.", -1, 0},
-    {2078   , EMS_NONE, "It is illegal to have more than one SPACINGTABLE rules within a ROUTING layer", -1, 0},
-    {2079   , EMS_NONE, "CURRENTDEN statement is obsolete in version 5.2 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.2 or later.", -1, 0},
-    {2080   , EMS_NONE, "The number of cut values in multiple ARRAYSPACING ARRAYCUTS are not in increasing order.\nTo be consistent with the documentation, update the cut values to increasing order.", -1, 0},
-    {2502   , EMS_NONE, "Message %s has been suppressed from output", -1, 0},
-    {2503   , EMS_NONE, "Message %s has exceeded the message display limit of %d.", -1, 0},
-    {3000   , EMS_NONE, "There are still data after the END LIBRARY", -1, 0},
-    {4000   , EMS_NONE, "lefwInitCbk was already called, cannot call lefwInit again.\nWriter Exit.\n", -1, 0},
-    {4001   , EMS_NONE, "lefwInit was already called, cannot call lefwInitCbk again.\nWriter Exit.\n", -1, 0},
-    {4002   , EMS_NONE, "lefwInit was already called, cannot call lefwInitCbk again.\nWriter Exit.\n", -1, 0},
-    {4003   , EMS_NONE, "lefwLayerRoutingSpacingUseLengthThreshold cannot be called if\n\tlefwLayerRoutingSpacingRange has not been called.\n", -1, 0},
-    {4004   , EMS_NONE, "lefwLayerRoutingSpacingInfluence cannot be called if\n\tlefRange and rightRange in lefwLayerRoutingSpacing are both zero.\n", -1, 0},
-    {4005   , EMS_NONE, "lefwLayerRoutingSpacingInfluence cannot be called if\n\tlefRange and rightRange in lefwLayerRoutingSpacing are both zero.", -1, 0},
-    {4006   , EMS_NONE, "Need an output file if writing in encrypted format.\n", -1, 0},
-    {4100   , EMS_NONE, "lefwWrite called before lefwInitCbk.\n", -1, 0},
-    {4101   , EMS_NONE, "lefwSetRegisterUnusedCallbacks was not called to setup this data.\n", -1, 0},
-    {4500   , EMS_NONE, "Callback for %s is required, but is not defined.\n\n", -1, 0},
-    {4700   , EMS_NONE, "LEF items that were present but ignored because of no callbacks were set.\n", -1, 0},
-    {-1     , EMS_NONE, "", -1, 0}
-};
-
-/*
- * End machine generated table.
-*/
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiArray.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiArray.h
deleted file mode 100644
index f354d01..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiArray.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIARRAY_H
-#define CLEFIARRAY_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN int lefiArrayFloorPlan_numPatterns (const lefiArrayFloorPlan* obj);
-EXTERN const lefiSitePattern* lefiArrayFloorPlan_pattern (const lefiArrayFloorPlan* obj, int  index);
-EXTERN char* lefiArrayFloorPlan_typ (const lefiArrayFloorPlan* obj, int  index);
-EXTERN const char* lefiArrayFloorPlan_name (const lefiArrayFloorPlan* obj);
-
-EXTERN int lefiArray_numSitePattern (const lefiArray* obj);
-EXTERN int lefiArray_numCanPlace (const lefiArray* obj);
-EXTERN int lefiArray_numCannotOccupy (const lefiArray* obj);
-EXTERN int lefiArray_numTrack (const lefiArray* obj);
-EXTERN int lefiArray_numGcell (const lefiArray* obj);
-EXTERN int lefiArray_hasDefaultCap (const lefiArray* obj);
-
-EXTERN const char* lefiArray_name (const lefiArray* obj);
-EXTERN const lefiSitePattern* lefiArray_sitePattern (const lefiArray* obj, int  index);
-EXTERN const lefiSitePattern* lefiArray_canPlace (const lefiArray* obj, int  index);
-EXTERN const lefiSitePattern* lefiArray_cannotOccupy (const lefiArray* obj, int  index);
-EXTERN const lefiTrackPattern* lefiArray_track (const lefiArray* obj, int  index);
-EXTERN const lefiGcellPattern* lefiArray_gcell (const lefiArray* obj, int  index);
-
-EXTERN int lefiArray_tableSize (const lefiArray* obj);
-EXTERN int lefiArray_numDefaultCaps (const lefiArray* obj);
-EXTERN int lefiArray_defaultCapMinPins (const lefiArray* obj, int  index);
-EXTERN double lefiArray_defaultCap (const lefiArray* obj, int  index);
-
-EXTERN int lefiArray_numFloorPlans (const lefiArray* obj);
-EXTERN const char* lefiArray_floorPlanName (const lefiArray* obj, int  index);
-EXTERN int lefiArray_numSites (const lefiArray* obj, int  index);
-EXTERN const char* lefiArray_siteType (const lefiArray* obj, int  floorIndex, int  siteIndex);
-EXTERN const lefiSitePattern* lefiArray_site (const lefiArray* obj, int  floorIndex, int  siteIndex);
-
-  /* Debug print                                                              */
-EXTERN void lefiArray_print (const lefiArray* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiCrossTalk.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiCrossTalk.h
deleted file mode 100644
index e863dba..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiCrossTalk.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFICROSSTALK_H
-#define CLEFICROSSTALK_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Structure returned for the noise margin callback.                          */
-/* This lef construct has two floating point numbers.                         */
-
-EXTERN double lefiNoiseVictim_length (const lefiNoiseVictim* obj);
-EXTERN int lefiNoiseVictim_numNoises (const lefiNoiseVictim* obj);
-EXTERN double lefiNoiseVictim_noise (const lefiNoiseVictim* obj, int  index);
-
-EXTERN int lefiNoiseResistance_numNums (const lefiNoiseResistance* obj);
-EXTERN double lefiNoiseResistance_num (const lefiNoiseResistance* obj, int  index);
-
-EXTERN int lefiNoiseResistance_numVictims (const lefiNoiseResistance* obj);
-EXTERN const lefiNoiseVictim* lefiNoiseResistance_victim (const lefiNoiseResistance* obj, int  index);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiDebug.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiDebug.h
deleted file mode 100644
index fd77337..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiDebug.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIDEBUG_H
-#define CLEFIDEBUG_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Set flag                                                                   */
-EXTERN void lefiSetDebug (int  num, int  value);
-
-/* Read flag                                                                  */
-EXTERN int lefiDebug (int  num);
-
-/* Error reporting routine                                                    */
-EXTERN void lefiError (int  check, int  msgNum, const char*  msg);
-
-EXTERN const char* CASE (const char * x);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptExt.c b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptExt.c
deleted file mode 100755
index 3b0ade2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptExt.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.7, and is subject to the Cadence LEF/DEF
- * Open Source License Agreement.   Your  continued  use  of this file
- * constitutes your acceptance of the terms of the LEF/DEF Open Source
- * License and an agreement to abide by its  terms.   If you  don't  agree
- * with  this, you must remove this and any other files which are part of the
- * distribution and  destroy any  copies made.
- * 
- * For updates, support, or to become part of the LEF/DEF Community, check
- * www.openeda.org for details.
- */
-#include <stdlib.h>
-
-/*
- * Global variables
- */ int lefrReadEncrypted = 0;
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptInt.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptInt.h
deleted file mode 100644
index 3ac143b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiEncryptInt.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIENCRYPTINT_H
-#define CLEFIENCRYPTINT_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Unable the reader to read encrypted lef file.                              */
-/*  This function must be called before lefrRead().                           */
-/* /                                                                          */
-EXTERN void lefrEnableReadEncrypted ();
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiLayer.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiLayer.h
deleted file mode 100644
index 4f899ca..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiLayer.h
+++ /dev/null
@@ -1,437 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2015, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                       */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFILAYER_H
-#define CLEFILAYER_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-typedef enum lefiAntennaEnum {
-  lefiAntennaAR = 1,
-  lefiAntennaDAR = 2,
-  lefiAntennaCAR = 3,
-  lefiAntennaCDAR = 4,
-  lefiAntennaAF = 5,
-  lefiAntennaSAR = 6,
-  lefiAntennaDSAR = 7,
-  lefiAntennaCSAR = 8,
-  lefiAntennaCDSAR = 9,
-  lefiAntennaSAF = 10,
-  lefiAntennaO = 11,
-  lefiAntennaADR = 12
-} lefiAntennaEnum;
-
-EXTERN int lefiAntennaPWL_numPWL (const lefiAntennaPWL* obj);
-
-EXTERN char* lefiLayerDensity_type (const lefiLayerDensity* obj);
-EXTERN int lefiLayerDensity_hasOneEntry (const lefiLayerDensity* obj);
-EXTERN double lefiLayerDensity_oneEntry (const lefiLayerDensity* obj);
-EXTERN int lefiLayerDensity_numFrequency (const lefiLayerDensity* obj);
-EXTERN double lefiLayerDensity_frequency (const lefiLayerDensity* obj, int  index);
-EXTERN int lefiLayerDensity_numWidths (const lefiLayerDensity* obj);
-EXTERN double lefiLayerDensity_width (const lefiLayerDensity* obj, int  index);
-EXTERN int lefiLayerDensity_numTableEntries (const lefiLayerDensity* obj);
-EXTERN double lefiLayerDensity_tableEntry (const lefiLayerDensity* obj, int  index);
-EXTERN int lefiLayerDensity_numCutareas (const lefiLayerDensity* obj);
-EXTERN double lefiLayerDensity_cutArea (const lefiLayerDensity* obj, int  index);
-
-/* 5.5                                                                        */
-
-EXTERN int lefiParallel_numLength (const lefiParallel* obj);
-EXTERN int lefiParallel_numWidth (const lefiParallel* obj);
-EXTERN double lefiParallel_length (const lefiParallel* obj, int  iLength);
-EXTERN double lefiParallel_width (const lefiParallel* obj, int  iWidth);
-EXTERN double lefiParallel_widthSpacing (const lefiParallel* obj, int  iWidth, int  iWidthSpacing);
-
-/* 5.5                                                                        */
-
-EXTERN int lefiInfluence_numInfluenceEntry (const lefiInfluence* obj);
-EXTERN double lefiInfluence_width (const lefiInfluence* obj, int  index);
-EXTERN double lefiInfluence_distance (const lefiInfluence* obj, int  index);
-EXTERN double lefiInfluence_spacing (const lefiInfluence* obj, int  index);
-
-/* 5.7                                                                        */
-
-EXTERN int lefiTwoWidths_numWidth (const lefiTwoWidths* obj);
-EXTERN double lefiTwoWidths_width (const lefiTwoWidths* obj, int  iWidth);
-EXTERN int lefiTwoWidths_hasWidthPRL (const lefiTwoWidths* obj, int  iWidth);
-EXTERN double lefiTwoWidths_widthPRL (const lefiTwoWidths* obj, int  iWidth);
-EXTERN int lefiTwoWidths_numWidthSpacing (const lefiTwoWidths* obj, int  iWidth);
-EXTERN double lefiTwoWidths_widthSpacing (const lefiTwoWidths* obj, int  iWidth, int  iWidthSpacing);
-
-/* 5.5                                                                        */
-
-EXTERN int lefiSpacingTable_isInfluence (const lefiSpacingTable* obj);
-EXTERN const lefiInfluence* lefiSpacingTable_influence (const lefiSpacingTable* obj);
-EXTERN int lefiSpacingTable_isParallel (const lefiSpacingTable* obj);
-EXTERN const lefiParallel* lefiSpacingTable_parallel (const lefiSpacingTable* obj);
-EXTERN const lefiTwoWidths* lefiSpacingTable_twoWidths (const lefiSpacingTable* obj);
-
-/* 5.7                                                                        */
-
-EXTERN int lefiOrthogonal_numOrthogonal (const lefiOrthogonal* obj);
-EXTERN double lefiOrthogonal_cutWithin (const lefiOrthogonal* obj, int  index);
-EXTERN double lefiOrthogonal_orthoSpacing (const lefiOrthogonal* obj, int  index);
-
-/* 5.5                                                                        */
-
-EXTERN int lefiAntennaModel_hasAntennaAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaDiffAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaDiffAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumDiffAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumDiffAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaAreaFactor (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaAreaFactorDUO (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaDiffSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaDiffSideAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumDiffSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumDiffSideAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaSideAreaFactor (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaSideAreaFactorDUO (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaCumRoutingPlusCut (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaGatePlusDiff (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaAreaMinusDiff (const lefiAntennaModel* obj);
-EXTERN int lefiAntennaModel_hasAntennaAreaDiffReducePWL (const lefiAntennaModel* obj);
-
-EXTERN char* lefiAntennaModel_antennaOxide (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaAreaRatio (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaDiffAreaRatio (const lefiAntennaModel* obj);
-EXTERN const lefiAntennaPWL* lefiAntennaModel_antennaDiffAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaCumAreaRatio (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaCumDiffAreaRatio (const lefiAntennaModel* obj);
-EXTERN const lefiAntennaPWL* lefiAntennaModel_antennaCumDiffAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaAreaFactor (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaDiffSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN const lefiAntennaPWL* lefiAntennaModel_antennaDiffSideAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaCumSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaCumDiffSideAreaRatio (const lefiAntennaModel* obj);
-EXTERN const lefiAntennaPWL* lefiAntennaModel_antennaCumDiffSideAreaRatioPWL (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaSideAreaFactor (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaGatePlusDiff (const lefiAntennaModel* obj);
-EXTERN double lefiAntennaModel_antennaAreaMinusDiff (const lefiAntennaModel* obj);
-EXTERN const lefiAntennaPWL* lefiAntennaModel_antennaAreaDiffReducePWL (const lefiAntennaModel* obj);
-
-  /* 5.6 - minstep switch to multiple and added more options                  */
-
-  /* 5.5 SPACINGTABLE                                                         */
-
-  /* 5.6                                                                      */
-
-  /* 5.8                                                                      */
-  /* POLYROUTING, MIMCAP, TSV, PASSIVATION, NWELL                             */
-
-EXTERN int lefiLayer_hasType (const lefiLayer* obj);
-EXTERN int lefiLayer_hasLayerType (const lefiLayer* obj);
-                                     /*  ROUTING can be POLYROUTING or MIMCAP */
-                                     /*  CUT can be TSV or PASSIVATION        */
-                                     /*  MASTERSLICE can be NWELL             */
-EXTERN int lefiLayer_hasMask (const lefiLayer* obj);
-EXTERN int lefiLayer_hasPitch (const lefiLayer* obj);
-EXTERN int lefiLayer_hasXYPitch (const lefiLayer* obj);
-EXTERN int lefiLayer_hasOffset (const lefiLayer* obj);
-EXTERN int lefiLayer_hasXYOffset (const lefiLayer* obj);
-EXTERN int lefiLayer_hasWidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasArea (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDiagPitch (const lefiLayer* obj);
-EXTERN int lefiLayer_hasXYDiagPitch (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDiagWidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDiagSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSpacingNumber (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSpacingName (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingLayerStack (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingAdjacent (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingCenterToCenter (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingRange (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingRangeUseLengthThreshold (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingRangeInfluence (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingRangeInfluenceRange (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingRangeRange (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingLengthThreshold (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingLengthThresholdRange (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingParallelOverlap (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingArea (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingEndOfLine (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingParellelEdge (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingTwoEdges (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingAdjacentExcept (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingSamenet (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingSamenetPGonly (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingNotchLength (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingEndOfNotchWidth (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasDirection (const lefiLayer* obj);
-EXTERN int lefiLayer_hasResistance (const lefiLayer* obj);
-EXTERN int lefiLayer_hasResistanceArray (const lefiLayer* obj);
-EXTERN int lefiLayer_hasCapacitance (const lefiLayer* obj);
-EXTERN int lefiLayer_hasCapacitanceArray (const lefiLayer* obj);
-EXTERN int lefiLayer_hasHeight (const lefiLayer* obj);
-EXTERN int lefiLayer_hasThickness (const lefiLayer* obj);
-EXTERN int lefiLayer_hasWireExtension (const lefiLayer* obj);
-EXTERN int lefiLayer_hasShrinkage (const lefiLayer* obj);
-EXTERN int lefiLayer_hasCapMultiplier (const lefiLayer* obj);
-EXTERN int lefiLayer_hasEdgeCap (const lefiLayer* obj);
-EXTERN int lefiLayer_hasAntennaLength (const lefiLayer* obj);
-EXTERN int lefiLayer_hasAntennaArea (const lefiLayer* obj);
-EXTERN int lefiLayer_hasCurrentDensityPoint (const lefiLayer* obj);
-EXTERN int lefiLayer_hasCurrentDensityArray (const lefiLayer* obj);
-EXTERN int lefiLayer_hasAccurrentDensity (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDccurrentDensity (const lefiLayer* obj);
-
-EXTERN int lefiLayer_numProps (const lefiLayer* obj);
-EXTERN const char* lefiLayer_propName (const lefiLayer* obj, int  index);
-EXTERN const char* lefiLayer_propValue (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_propNumber (const lefiLayer* obj, int  index);
-EXTERN const char lefiLayer_propType (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_propIsNumber (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_propIsString (const lefiLayer* obj, int  index);
-
-EXTERN int lefiLayer_numSpacing (const lefiLayer* obj);
-
-EXTERN char* lefiLayer_name (const lefiLayer* obj);
-EXTERN const char* lefiLayer_type (const lefiLayer* obj);
-EXTERN const char* lefiLayer_layerType (const lefiLayer* obj);
-EXTERN double lefiLayer_pitch (const lefiLayer* obj);
-EXTERN int lefiLayer_mask (const lefiLayer* obj);
-EXTERN double lefiLayer_pitchX (const lefiLayer* obj);
-EXTERN double lefiLayer_pitchY (const lefiLayer* obj);
-EXTERN double lefiLayer_offset (const lefiLayer* obj);
-EXTERN double lefiLayer_offsetX (const lefiLayer* obj);
-EXTERN double lefiLayer_offsetY (const lefiLayer* obj);
-EXTERN double lefiLayer_width (const lefiLayer* obj);
-EXTERN double lefiLayer_area (const lefiLayer* obj);
-EXTERN double lefiLayer_diagPitch (const lefiLayer* obj);
-EXTERN double lefiLayer_diagPitchX (const lefiLayer* obj);
-EXTERN double lefiLayer_diagPitchY (const lefiLayer* obj);
-EXTERN double lefiLayer_diagWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_diagSpacing (const lefiLayer* obj);
-EXTERN double lefiLayer_spacing (const lefiLayer* obj, int  index);
-EXTERN char* lefiLayer_spacingName (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_spacingAdjacentCuts (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingAdjacentWithin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingArea (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeMin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeMax (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeInfluence (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeInfluenceMin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeInfluenceMax (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeRangeMin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingRangeRangeMax (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingLengthThreshold (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingLengthThresholdRangeMin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingLengthThresholdRangeMax (const lefiLayer* obj, int  index);
-
-  /* 5.7 Spacing endofline                                                    */
-EXTERN double lefiLayer_spacingEolWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingEolWithin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingParSpace (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingParWithin (const lefiLayer* obj, int  index);
-
-  /* 5.7 Spacing Notch                                                        */
-EXTERN double lefiLayer_spacingNotchLength (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingEndOfNotchWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingEndOfNotchSpacing (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_spacingEndOfNotchLength (const lefiLayer* obj, int  index);
-
-  /* 5.5 Minimum cut rules                                                    */
-EXTERN int lefiLayer_numMinimumcut (const lefiLayer* obj);
-EXTERN int lefiLayer_minimumcut (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minimumcutWidth (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinimumcutWithin (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minimumcutWithin (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinimumcutConnection (const lefiLayer* obj, int  index);
-EXTERN const char* lefiLayer_minimumcutConnection (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinimumcutNumCuts (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minimumcutLength (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minimumcutDistance (const lefiLayer* obj, int  index);
-
-EXTERN const char* lefiLayer_direction (const lefiLayer* obj);
-EXTERN double lefiLayer_resistance (const lefiLayer* obj);
-EXTERN double lefiLayer_capacitance (const lefiLayer* obj);
-EXTERN double lefiLayer_height (const lefiLayer* obj);
-EXTERN double lefiLayer_wireExtension (const lefiLayer* obj);
-EXTERN double lefiLayer_thickness (const lefiLayer* obj);
-EXTERN double lefiLayer_shrinkage (const lefiLayer* obj);
-EXTERN double lefiLayer_capMultiplier (const lefiLayer* obj);
-EXTERN double lefiLayer_edgeCap (const lefiLayer* obj);
-EXTERN double lefiLayer_antennaLength (const lefiLayer* obj);
-EXTERN double lefiLayer_antennaArea (const lefiLayer* obj);
-EXTERN double lefiLayer_currentDensityPoint (const lefiLayer* obj);
-EXTERN void lefiLayer_currentDensityArray (const lefiLayer* obj, int*  numPoints, double**  widths, double**  current);
-EXTERN void lefiLayer_capacitanceArray (const lefiLayer* obj, int*  numPoints, double**  widths, double**  resValues);
-EXTERN void lefiLayer_resistanceArray (const lefiLayer* obj, int*  numPoints, double**  widths, double**  capValues);
-
-EXTERN int lefiLayer_numAccurrentDensity (const lefiLayer* obj);
-EXTERN const lefiLayerDensity* lefiLayer_accurrent (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_numDccurrentDensity (const lefiLayer* obj);
-EXTERN const lefiLayerDensity* lefiLayer_dccurrent (const lefiLayer* obj, int  index);
-
-  /* 3/23/2000 - Wanda da Rosa.  The following are for 5.4 Antenna.           */
-  /*             Only 5.4 or 5.3 are allowed in a lef file, but not both      */
-
-  /* 5.5                                                                      */
-EXTERN int lefiLayer_numAntennaModel (const lefiLayer* obj);
-EXTERN const lefiAntennaModel* lefiLayer_antennaModel (const lefiLayer* obj, int  index);
-
-  /* The following is 8/21/01 5.4 enhancements                                */
-
-EXTERN int lefiLayer_hasSlotWireWidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSlotWireLength (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSlotWidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSlotLength (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMaxAdjacentSlotSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMaxCoaxialSlotSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMaxEdgeSlotSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasSplitWireWidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMinimumDensity (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMaximumDensity (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDensityCheckWindow (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDensityCheckStep (const lefiLayer* obj);
-EXTERN int lefiLayer_hasFillActiveSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMaxwidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMinwidth (const lefiLayer* obj);
-EXTERN int lefiLayer_hasMinstep (const lefiLayer* obj);
-EXTERN int lefiLayer_hasProtrusion (const lefiLayer* obj);
-
-EXTERN double lefiLayer_slotWireWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_slotWireLength (const lefiLayer* obj);
-EXTERN double lefiLayer_slotWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_slotLength (const lefiLayer* obj);
-EXTERN double lefiLayer_maxAdjacentSlotSpacing (const lefiLayer* obj);
-EXTERN double lefiLayer_maxCoaxialSlotSpacing (const lefiLayer* obj);
-EXTERN double lefiLayer_maxEdgeSlotSpacing (const lefiLayer* obj);
-EXTERN double lefiLayer_splitWireWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_minimumDensity (const lefiLayer* obj);
-EXTERN double lefiLayer_maximumDensity (const lefiLayer* obj);
-EXTERN double lefiLayer_densityCheckWindowLength (const lefiLayer* obj);
-EXTERN double lefiLayer_densityCheckWindowWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_densityCheckStep (const lefiLayer* obj);
-EXTERN double lefiLayer_fillActiveSpacing (const lefiLayer* obj);
-EXTERN double lefiLayer_maxwidth (const lefiLayer* obj);
-EXTERN double lefiLayer_minwidth (const lefiLayer* obj);
-EXTERN double lefiLayer_protrusionWidth1 (const lefiLayer* obj);
-EXTERN double lefiLayer_protrusionLength (const lefiLayer* obj);
-EXTERN double lefiLayer_protrusionWidth2 (const lefiLayer* obj);
-
-EXTERN int lefiLayer_numMinstep (const lefiLayer* obj);
-EXTERN double lefiLayer_minstep (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepType (const lefiLayer* obj, int  index);
-EXTERN char* lefiLayer_minstepType (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepLengthsum (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minstepLengthsum (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepMaxedges (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_minstepMaxedges (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepMinAdjLength (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minstepMinAdjLength (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepMinBetLength (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minstepMinBetLength (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinstepXSameCorners (const lefiLayer* obj, int  index);
-
-  /* 5.5 MINENCLOSEDAREA                                                      */
-EXTERN int lefiLayer_numMinenclosedarea (const lefiLayer* obj);
-EXTERN double lefiLayer_minenclosedarea (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasMinenclosedareaWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minenclosedareaWidth (const lefiLayer* obj, int  index);
-
-  /* 5.5 SPACINGTABLE FOR LAYER ROUTING                                       */
-
-  /* 5.6 ENCLOSURE, PREFERENCLOSURE, RESISTANCEPERCUT & DIAGMINEDGELENGTH     */
-EXTERN int lefiLayer_numEnclosure (const lefiLayer* obj);
-EXTERN int lefiLayer_hasEnclosureRule (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_enclosureOverhang1 (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_enclosureOverhang2 (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasEnclosureWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_enclosureMinWidth (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasEnclosureExceptExtraCut (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_enclosureExceptExtraCut (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasEnclosureMinLength (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_enclosureMinLength (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_numPreferEnclosure (const lefiLayer* obj);
-EXTERN int lefiLayer_hasPreferEnclosureRule (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_preferEnclosureOverhang1 (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_preferEnclosureOverhang2 (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasPreferEnclosureWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_preferEnclosureMinWidth (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasResistancePerCut (const lefiLayer* obj);
-EXTERN double lefiLayer_resistancePerCut (const lefiLayer* obj);
-EXTERN int lefiLayer_hasDiagMinEdgeLength (const lefiLayer* obj);
-EXTERN double lefiLayer_diagMinEdgeLength (const lefiLayer* obj);
-EXTERN int lefiLayer_numMinSize (const lefiLayer* obj);
-EXTERN double lefiLayer_minSizeWidth (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_minSizeLength (const lefiLayer* obj, int  index);
-
-  /* 5.7                                                                      */
-EXTERN int lefiLayer_hasMaxFloatingArea (const lefiLayer* obj);
-EXTERN double lefiLayer_maxFloatingArea (const lefiLayer* obj);
-EXTERN int lefiLayer_hasArraySpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_hasLongArray (const lefiLayer* obj);
-EXTERN int lefiLayer_hasViaWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_viaWidth (const lefiLayer* obj);
-EXTERN double lefiLayer_cutSpacing (const lefiLayer* obj);
-EXTERN int lefiLayer_numArrayCuts (const lefiLayer* obj);
-EXTERN int lefiLayer_arrayCuts (const lefiLayer* obj, int  index);
-EXTERN double lefiLayer_arraySpacing (const lefiLayer* obj, int  index);
-EXTERN int lefiLayer_hasSpacingTableOrtho (const lefiLayer* obj);
-EXTERN const lefiOrthogonal* lefiLayer_orthogonal (const lefiLayer* obj);
-
-EXTERN double lefiLayer_lef58WidthTableOrtho (const lefiLayer* obj, int  idx);
-EXTERN int lefiLayer_lef58WidthTableOrthoValues (const lefiLayer* obj);
-EXTERN double lefiLayer_lef58WidthTableWrongDir (const lefiLayer* obj, int  idx);
-EXTERN int lefiLayer_lef58WidthTableWrongDirValues (const lefiLayer* obj);
-
-EXTERN int lefiLayer_need58PropsProcessing (const lefiLayer* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiLayer_print (const lefiLayer* obj, FILE*  f);
-
-  /* 5.5                                                                      */
-
-                                      /* Q: quotedstring                      */
-
-  /* 3/23/2000 - Wanda da Rosa.  The following is for 5.4 ANTENNA.            */
-  /*             Either 5.4 or 5.3 are allowed, not both                      */
-
-  /* 5.5 AntennaModel                                                         */
-
-  /* 8/29/2001 - Wanda da Rosa.  The following is for 5.4 enhancements.       */
-
-  /* 5.5 SPACINGTABLE                                                         */
-
-  /* 5.6                                                                      */
-
-  /* 5.7                                                                      */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMacro.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMacro.h
deleted file mode 100644
index 3ad9477..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMacro.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIMACRO_H
-#define CLEFIMACRO_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN const lefiGeometries* lefiObstruction_geometries (const lefiObstruction* obj);
-
-EXTERN void lefiObstruction_print (const lefiObstruction* obj, FILE*  f);
-
-/* 5.5                                                                        */
-
-EXTERN int lefiPinAntennaModel_hasAntennaGateArea (const lefiPinAntennaModel* obj);
-EXTERN int lefiPinAntennaModel_hasAntennaMaxAreaCar (const lefiPinAntennaModel* obj);
-EXTERN int lefiPinAntennaModel_hasAntennaMaxSideAreaCar (const lefiPinAntennaModel* obj);
-EXTERN int lefiPinAntennaModel_hasAntennaMaxCutCar (const lefiPinAntennaModel* obj);
-
-EXTERN char* lefiPinAntennaModel_antennaOxide (const lefiPinAntennaModel* obj);
-
-EXTERN int lefiPinAntennaModel_numAntennaGateArea (const lefiPinAntennaModel* obj);
-EXTERN double lefiPinAntennaModel_antennaGateArea (const lefiPinAntennaModel* obj, int  index);
-EXTERN const char* lefiPinAntennaModel_antennaGateAreaLayer (const lefiPinAntennaModel* obj, int  index);
-
-EXTERN int lefiPinAntennaModel_numAntennaMaxAreaCar (const lefiPinAntennaModel* obj);
-EXTERN double lefiPinAntennaModel_antennaMaxAreaCar (const lefiPinAntennaModel* obj, int  index);
-EXTERN const char* lefiPinAntennaModel_antennaMaxAreaCarLayer (const lefiPinAntennaModel* obj, int  index);
-
-EXTERN int lefiPinAntennaModel_numAntennaMaxSideAreaCar (const lefiPinAntennaModel* obj);
-EXTERN double lefiPinAntennaModel_antennaMaxSideAreaCar (const lefiPinAntennaModel* obj, int  index);
-EXTERN const char* lefiPinAntennaModel_antennaMaxSideAreaCarLayer (const lefiPinAntennaModel* obj, int  index);
-
-EXTERN int lefiPinAntennaModel_numAntennaMaxCutCar (const lefiPinAntennaModel* obj);
-EXTERN double lefiPinAntennaModel_antennaMaxCutCar (const lefiPinAntennaModel* obj, int  index);
-EXTERN const char* lefiPinAntennaModel_antennaMaxCutCarLayer (const lefiPinAntennaModel* obj, int  index);
-
-EXTERN int lefiPinAntennaModel_hasReturn (const lefiPinAntennaModel* obj);
-
-EXTERN int lefiPin_hasForeign (const lefiPin* obj);
-EXTERN int lefiPin_hasForeignOrient (const lefiPin* obj, int  index);
-EXTERN int lefiPin_hasForeignPoint (const lefiPin* obj, int  index);
-EXTERN int lefiPin_hasLEQ (const lefiPin* obj);
-EXTERN int lefiPin_hasDirection (const lefiPin* obj);
-EXTERN int lefiPin_hasUse (const lefiPin* obj);
-EXTERN int lefiPin_hasShape (const lefiPin* obj);
-EXTERN int lefiPin_hasMustjoin (const lefiPin* obj);
-EXTERN int lefiPin_hasOutMargin (const lefiPin* obj);
-EXTERN int lefiPin_hasOutResistance (const lefiPin* obj);
-EXTERN int lefiPin_hasInMargin (const lefiPin* obj);
-EXTERN int lefiPin_hasPower (const lefiPin* obj);
-EXTERN int lefiPin_hasLeakage (const lefiPin* obj);
-EXTERN int lefiPin_hasMaxload (const lefiPin* obj);
-EXTERN int lefiPin_hasMaxdelay (const lefiPin* obj);
-EXTERN int lefiPin_hasCapacitance (const lefiPin* obj);
-EXTERN int lefiPin_hasResistance (const lefiPin* obj);
-EXTERN int lefiPin_hasPulldownres (const lefiPin* obj);
-EXTERN int lefiPin_hasTieoffr (const lefiPin* obj);
-EXTERN int lefiPin_hasVHI (const lefiPin* obj);
-EXTERN int lefiPin_hasVLO (const lefiPin* obj);
-EXTERN int lefiPin_hasRiseVoltage (const lefiPin* obj);
-EXTERN int lefiPin_hasFallVoltage (const lefiPin* obj);
-EXTERN int lefiPin_hasRiseThresh (const lefiPin* obj);
-EXTERN int lefiPin_hasFallThresh (const lefiPin* obj);
-EXTERN int lefiPin_hasRiseSatcur (const lefiPin* obj);
-EXTERN int lefiPin_hasFallSatcur (const lefiPin* obj);
-EXTERN int lefiPin_hasCurrentSource (const lefiPin* obj);
-EXTERN int lefiPin_hasTables (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaSize (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaMetalArea (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaMetalLength (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaPartialMetalArea (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaPartialMetalSideArea (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaPartialCutArea (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaDiffArea (const lefiPin* obj);
-EXTERN int lefiPin_hasAntennaModel (const lefiPin* obj);
-EXTERN int lefiPin_hasTaperRule (const lefiPin* obj);
-EXTERN int lefiPin_hasRiseSlewLimit (const lefiPin* obj);
-EXTERN int lefiPin_hasFallSlewLimit (const lefiPin* obj);
-EXTERN int lefiPin_hasNetExpr (const lefiPin* obj);
-EXTERN int lefiPin_hasSupplySensitivity (const lefiPin* obj);
-EXTERN int lefiPin_hasGroundSensitivity (const lefiPin* obj);
-
-EXTERN const char* lefiPin_name (const lefiPin* obj);
-
-EXTERN int lefiPin_numPorts (const lefiPin* obj);
-EXTERN const lefiGeometries* lefiPin_port (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numForeigns (const lefiPin* obj);
-EXTERN const char* lefiPin_foreignName (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_taperRule (const lefiPin* obj);
-EXTERN int lefiPin_foreignOrient (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_foreignOrientStr (const lefiPin* obj, int  index);
-EXTERN double lefiPin_foreignX (const lefiPin* obj, int  index);
-EXTERN double lefiPin_foreignY (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_LEQ (const lefiPin* obj);
-EXTERN const char* lefiPin_direction (const lefiPin* obj);
-EXTERN const char* lefiPin_use (const lefiPin* obj);
-EXTERN const char* lefiPin_shape (const lefiPin* obj);
-EXTERN const char* lefiPin_mustjoin (const lefiPin* obj);
-EXTERN double lefiPin_outMarginHigh (const lefiPin* obj);
-EXTERN double lefiPin_outMarginLow (const lefiPin* obj);
-EXTERN double lefiPin_outResistanceHigh (const lefiPin* obj);
-EXTERN double lefiPin_outResistanceLow (const lefiPin* obj);
-EXTERN double lefiPin_inMarginHigh (const lefiPin* obj);
-EXTERN double lefiPin_inMarginLow (const lefiPin* obj);
-EXTERN double lefiPin_power (const lefiPin* obj);
-EXTERN double lefiPin_leakage (const lefiPin* obj);
-EXTERN double lefiPin_maxload (const lefiPin* obj);
-EXTERN double lefiPin_maxdelay (const lefiPin* obj);
-EXTERN double lefiPin_capacitance (const lefiPin* obj);
-EXTERN double lefiPin_resistance (const lefiPin* obj);
-EXTERN double lefiPin_pulldownres (const lefiPin* obj);
-EXTERN double lefiPin_tieoffr (const lefiPin* obj);
-EXTERN double lefiPin_VHI (const lefiPin* obj);
-EXTERN double lefiPin_VLO (const lefiPin* obj);
-EXTERN double lefiPin_riseVoltage (const lefiPin* obj);
-EXTERN double lefiPin_fallVoltage (const lefiPin* obj);
-EXTERN double lefiPin_riseThresh (const lefiPin* obj);
-EXTERN double lefiPin_fallThresh (const lefiPin* obj);
-EXTERN double lefiPin_riseSatcur (const lefiPin* obj);
-EXTERN double lefiPin_fallSatcur (const lefiPin* obj);
-EXTERN double lefiPin_riseSlewLimit (const lefiPin* obj);
-EXTERN double lefiPin_fallSlewLimit (const lefiPin* obj);
-EXTERN const char* lefiPin_currentSource (const lefiPin* obj);
-EXTERN const char* lefiPin_tableHighName (const lefiPin* obj);
-EXTERN const char* lefiPin_tableLowName (const lefiPin* obj);
-
-EXTERN int lefiPin_numAntennaSize (const lefiPin* obj);
-EXTERN double lefiPin_antennaSize (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaSizeLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaMetalArea (const lefiPin* obj);
-EXTERN double lefiPin_antennaMetalArea (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaMetalAreaLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaMetalLength (const lefiPin* obj);
-EXTERN double lefiPin_antennaMetalLength (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaMetalLengthLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaPartialMetalArea (const lefiPin* obj);
-EXTERN double lefiPin_antennaPartialMetalArea (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaPartialMetalAreaLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaPartialMetalSideArea (const lefiPin* obj);
-EXTERN double lefiPin_antennaPartialMetalSideArea (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaPartialMetalSideAreaLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaPartialCutArea (const lefiPin* obj);
-EXTERN double lefiPin_antennaPartialCutArea (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaPartialCutAreaLayer (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numAntennaDiffArea (const lefiPin* obj);
-EXTERN double lefiPin_antennaDiffArea (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_antennaDiffAreaLayer (const lefiPin* obj, int  index);
-
-  /* 5.6                                                                      */
-EXTERN const char* lefiPin_netExpr (const lefiPin* obj);
-EXTERN const char* lefiPin_supplySensitivity (const lefiPin* obj);
-EXTERN const char* lefiPin_groundSensitivity (const lefiPin* obj);
-
-  /* 5.5                                                                      */
-EXTERN int lefiPin_numAntennaModel (const lefiPin* obj);
-EXTERN const lefiPinAntennaModel* lefiPin_antennaModel (const lefiPin* obj, int  index);
-
-EXTERN int lefiPin_numProperties (const lefiPin* obj);
-EXTERN const char* lefiPin_propName (const lefiPin* obj, int  index);
-EXTERN const char* lefiPin_propValue (const lefiPin* obj, int  index);
-EXTERN double lefiPin_propNum (const lefiPin* obj, int  index);
-EXTERN const char lefiPin_propType (const lefiPin* obj, int  index);
-EXTERN int lefiPin_propIsNumber (const lefiPin* obj, int  index);
-EXTERN int lefiPin_propIsString (const lefiPin* obj, int  index);
-
-EXTERN void lefiPin_print (const lefiPin* obj, FILE*  f);
-
-  /* 5.5 AntennaModel                                                         */
-
-/* 5.6                                                                        */
-
-EXTERN int lefiDensity_numLayer (const lefiDensity* obj);
-EXTERN char* lefiDensity_layerName (const lefiDensity* obj, int  index);
-EXTERN int lefiDensity_numRects (const lefiDensity* obj, int  index);
-EXTERN struct lefiGeomRect lefiDensity_getRect (const lefiDensity* obj, int  index, int  rectIndex);
-EXTERN double lefiDensity_densityValue (const lefiDensity* obj, int  index, int  rectIndex);
-
-EXTERN void lefiDensity_print (const lefiDensity* obj, FILE*  f);
-
-  /* orient=-1 means no orient was specified.                                 */
-
-EXTERN int lefiMacro_hasClass (const lefiMacro* obj);
-EXTERN int lefiMacro_hasGenerator (const lefiMacro* obj);
-EXTERN int lefiMacro_hasGenerate (const lefiMacro* obj);
-EXTERN int lefiMacro_hasPower (const lefiMacro* obj);
-EXTERN int lefiMacro_hasOrigin (const lefiMacro* obj);
-EXTERN int lefiMacro_hasEEQ (const lefiMacro* obj);
-EXTERN int lefiMacro_hasLEQ (const lefiMacro* obj);
-EXTERN int lefiMacro_hasSource (const lefiMacro* obj);
-EXTERN int lefiMacro_hasXSymmetry (const lefiMacro* obj);
-EXTERN int lefiMacro_hasYSymmetry (const lefiMacro* obj);
-EXTERN int lefiMacro_has90Symmetry (const lefiMacro* obj);
-EXTERN int lefiMacro_hasSiteName (const lefiMacro* obj);
-EXTERN int lefiMacro_hasSitePattern (const lefiMacro* obj);
-EXTERN int lefiMacro_hasSize (const lefiMacro* obj);
-EXTERN int lefiMacro_hasForeign (const lefiMacro* obj);
-EXTERN int lefiMacro_hasForeignOrigin (const lefiMacro* obj, int  index);
-EXTERN int lefiMacro_hasForeignOrient (const lefiMacro* obj, int  index);
-EXTERN int lefiMacro_hasForeignPoint (const lefiMacro* obj, int  index);
-EXTERN int lefiMacro_hasClockType (const lefiMacro* obj);
-EXTERN int lefiMacro_isBuffer (const lefiMacro* obj);
-EXTERN int lefiMacro_isInverter (const lefiMacro* obj);
-EXTERN int lefiMacro_isFixedMask (const lefiMacro* obj);
-
-EXTERN int lefiMacro_numSitePattern (const lefiMacro* obj);
-EXTERN int lefiMacro_numProperties (const lefiMacro* obj);
-EXTERN const char* lefiMacro_propName (const lefiMacro* obj, int  index);
-EXTERN const char* lefiMacro_propValue (const lefiMacro* obj, int  index);
-EXTERN double lefiMacro_propNum (const lefiMacro* obj, int  index);
-EXTERN const char lefiMacro_propType (const lefiMacro* obj, int  index);
-EXTERN int lefiMacro_propIsNumber (const lefiMacro* obj, int  index);
-EXTERN int lefiMacro_propIsString (const lefiMacro* obj, int  index);
-
-EXTERN const char* lefiMacro_name (const lefiMacro* obj);
-EXTERN const char* lefiMacro_macroClass (const lefiMacro* obj);
-EXTERN const char* lefiMacro_generator (const lefiMacro* obj);
-EXTERN const char* lefiMacro_EEQ (const lefiMacro* obj);
-EXTERN const char* lefiMacro_LEQ (const lefiMacro* obj);
-EXTERN const char* lefiMacro_source (const lefiMacro* obj);
-EXTERN const char* lefiMacro_clockType (const lefiMacro* obj);
-EXTERN double lefiMacro_originX (const lefiMacro* obj);
-EXTERN double lefiMacro_originY (const lefiMacro* obj);
-EXTERN double lefiMacro_power (const lefiMacro* obj);
-EXTERN void lefiMacro_generate (const lefiMacro* obj, char**  name1, char**  name2);
-EXTERN const lefiSitePattern* lefiMacro_sitePattern (const lefiMacro* obj, int  index);
-EXTERN const char* lefiMacro_siteName (const lefiMacro* obj);
-EXTERN double lefiMacro_sizeX (const lefiMacro* obj);
-EXTERN double lefiMacro_sizeY (const lefiMacro* obj);
-EXTERN int lefiMacro_numForeigns (const lefiMacro* obj);
-EXTERN int lefiMacro_foreignOrient (const lefiMacro* obj, int  index);
-EXTERN const char* lefiMacro_foreignOrientStr (const lefiMacro* obj, int  index);
-EXTERN double lefiMacro_foreignX (const lefiMacro* obj, int  index);
-EXTERN double lefiMacro_foreignY (const lefiMacro* obj, int  index);
-EXTERN const char* lefiMacro_foreignName (const lefiMacro* obj, int  index);
-
-  /* Debug print                                                              */
-EXTERN void lefiMacro_print (const lefiMacro* obj, FILE*  f);
-
-  /* addSDF2Pins & addSDF1Pin are for 5.1                                     */
-
-  /* The following are for 5.1                                                */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMisc.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMisc.h
deleted file mode 100644
index 80a3193..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiMisc.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2014, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                       */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIMISC_H
-#define CLEFIMISC_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* The different types of items in a geometry list.                           */
-
-enum lefiGeomEnum {
-  lefiGeomUnknown = 0,
-  lefiGeomLayerE = 1,
-  lefiGeomLayerExceptPgNetE = 2,
-  lefiGeomLayerMinSpacingE = 3,
-  lefiGeomLayerRuleWidthE = 4,
-  lefiGeomWidthE = 5,
-  lefiGeomPathE = 6,
-  lefiGeomPathIterE = 7,
-  lefiGeomRectE = 8,
-  lefiGeomRectIterE = 9,
-  lefiGeomPolygonE = 10,
-  lefiGeomPolygonIterE = 11,
-  lefiGeomViaE = 12,
-  lefiGeomViaIterE = 13,
-  lefiGeomClassE = 14,
-  lefiGeomEnd = 15
-};
-
-/*  pcr 481783 & 560504
-*/
-
-EXTERN int lefiGeometries_numItems (const lefiGeometries* obj);
-EXTERN enum lefiGeomEnum lefiGeometries_itemType (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomRect* lefiGeometries_getRect (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomRectIter* lefiGeometries_getRectIter (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomPath* lefiGeometries_getPath (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomPathIter* lefiGeometries_getPathIter (const lefiGeometries* obj, int  index);
-EXTERN int lefiGeometries_hasLayerExceptPgNet (const lefiGeometries* obj, int  index);
-EXTERN char* lefiGeometries_getLayer (const lefiGeometries* obj, int  index);
-EXTERN double lefiGeometries_getLayerMinSpacing (const lefiGeometries* obj, int  index);
-EXTERN double lefiGeometries_getLayerRuleWidth (const lefiGeometries* obj, int  index);
-EXTERN double lefiGeometries_getWidth (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomPolygon* lefiGeometries_getPolygon (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomPolygonIter* lefiGeometries_getPolygonIter (const lefiGeometries* obj, int  index);
-EXTERN char* lefiGeometries_getClass (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomVia* lefiGeometries_getVia (const lefiGeometries* obj, int  index);
-EXTERN struct lefiGeomViaIter* lefiGeometries_getViaIter (const lefiGeometries* obj, int  index);
-
-EXTERN void lefiGeometries_print (const lefiGeometries* obj, FILE*  f);
-
-EXTERN int lefiSpacing_hasStack (const lefiSpacing* obj);
-
-EXTERN const char* lefiSpacing_name1 (const lefiSpacing* obj);
-EXTERN const char* lefiSpacing_name2 (const lefiSpacing* obj);
-EXTERN double lefiSpacing_distance (const lefiSpacing* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiSpacing_print (const lefiSpacing* obj, FILE*  f);
-
-EXTERN const char* lefiIRDrop_name (const lefiIRDrop* obj);
-EXTERN double lefiIRDrop_value1 (const lefiIRDrop* obj, int  index);
-EXTERN double lefiIRDrop_value2 (const lefiIRDrop* obj, int  index);
-
-EXTERN int lefiIRDrop_numValues (const lefiIRDrop* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiIRDrop_print (const lefiIRDrop* obj, FILE*  f);
-
-EXTERN double lefiMinFeature_one (const lefiMinFeature* obj);
-EXTERN double lefiMinFeature_two (const lefiMinFeature* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiMinFeature_print (const lefiMinFeature* obj, FILE*  f);
-
-EXTERN const char* lefiSite_name (const lefiSite* obj);
-EXTERN int lefiSite_hasClass (const lefiSite* obj);
-EXTERN const char* lefiSite_siteClass (const lefiSite* obj);
-EXTERN double lefiSite_sizeX (const lefiSite* obj);
-EXTERN double lefiSite_sizeY (const lefiSite* obj);
-EXTERN int lefiSite_hasSize (const lefiSite* obj);
-EXTERN int lefiSite_hasXSymmetry (const lefiSite* obj);
-EXTERN int lefiSite_hasYSymmetry (const lefiSite* obj);
-EXTERN int lefiSite_has90Symmetry (const lefiSite* obj);
-EXTERN int lefiSite_hasRowPattern (const lefiSite* obj);
-EXTERN int lefiSite_numSites (const lefiSite* obj);
-EXTERN char* lefiSite_siteName (const lefiSite* obj, int  index);
-EXTERN int lefiSite_siteOrient (const lefiSite* obj, int  index);
-EXTERN char* lefiSite_siteOrientStr (const lefiSite* obj, int  index);
-
-  /* Debug print                                                              */
-EXTERN void lefiSite_print (const lefiSite* obj, FILE*  f);
-
-EXTERN const char* lefiSitePattern_name (const lefiSitePattern* obj);
-EXTERN int lefiSitePattern_orient (const lefiSitePattern* obj);
-EXTERN const char* lefiSitePattern_orientStr (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_x (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_y (const lefiSitePattern* obj);
-EXTERN int lefiSitePattern_hasStepPattern (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_xStart (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_yStart (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_xStep (const lefiSitePattern* obj);
-EXTERN double lefiSitePattern_yStep (const lefiSitePattern* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiSitePattern_print (const lefiSitePattern* obj, FILE*  f);
-
-EXTERN const char* lefiTrackPattern_name (const lefiTrackPattern* obj);
-EXTERN double lefiTrackPattern_start (const lefiTrackPattern* obj);
-EXTERN int lefiTrackPattern_numTracks (const lefiTrackPattern* obj);
-EXTERN double lefiTrackPattern_space (const lefiTrackPattern* obj);
-
-EXTERN int lefiTrackPattern_numLayers (const lefiTrackPattern* obj);
-EXTERN const char* lefiTrackPattern_layerName (const lefiTrackPattern* obj, int  index);
-
-  /* Debug print                                                              */
-EXTERN void lefiTrackPattern_print (const lefiTrackPattern* obj, FILE*  f);
-
-EXTERN const char* lefiGcellPattern_name (const lefiGcellPattern* obj);
-EXTERN double lefiGcellPattern_start (const lefiGcellPattern* obj);
-EXTERN int lefiGcellPattern_numCRs (const lefiGcellPattern* obj);
-EXTERN double lefiGcellPattern_space (const lefiGcellPattern* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiGcellPattern_print (const lefiGcellPattern* obj, FILE*  f);
-
-EXTERN const char* lefiUseMinSpacing_name (const lefiUseMinSpacing* obj);
-EXTERN int lefiUseMinSpacing_value (const lefiUseMinSpacing* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiUseMinSpacing_print (const lefiUseMinSpacing* obj, FILE*  f);
-
-/* 5.5 for Maximum Stacked-via rule                                           */
-
-EXTERN int lefiMaxStackVia_maxStackVia (const lefiMaxStackVia* obj);
-EXTERN int lefiMaxStackVia_hasMaxStackViaRange (const lefiMaxStackVia* obj);
-EXTERN const char* lefiMaxStackVia_maxStackViaBottomLayer (const lefiMaxStackVia* obj);
-EXTERN const char* lefiMaxStackVia_maxStackViaTopLayer (const lefiMaxStackVia* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiMaxStackVia_print (const lefiMaxStackVia* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiNonDefault.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiNonDefault.h
deleted file mode 100644
index 1321072..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiNonDefault.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFINONDEFAULT_H
-#define CLEFINONDEFAULT_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN const char* lefiNonDefault_name (const lefiNonDefault* obj);
-EXTERN int lefiNonDefault_hasHardspacing (const lefiNonDefault* obj);
-
-EXTERN int lefiNonDefault_numProps (const lefiNonDefault* obj);
-EXTERN const char* lefiNonDefault_propName (const lefiNonDefault* obj, int  index);
-EXTERN const char* lefiNonDefault_propValue (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_propNumber (const lefiNonDefault* obj, int  index);
-EXTERN const char lefiNonDefault_propType (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_propIsNumber (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_propIsString (const lefiNonDefault* obj, int  index);
-
-  /* A non default rule can have one or more layers.                          */
-  /* The layer information is kept in an array.                               */
-EXTERN int lefiNonDefault_numLayers (const lefiNonDefault* obj);
-EXTERN const char* lefiNonDefault_layerName (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerWidth (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerWidth (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerSpacing (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerSpacing (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerWireExtension (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerWireExtension (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerResistance (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerResistance (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerCapacitance (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerCapacitance (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerEdgeCap (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerEdgeCap (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_hasLayerDiagWidth (const lefiNonDefault* obj, int  index);
-EXTERN double lefiNonDefault_layerDiagWidth (const lefiNonDefault* obj, int  index);
-
-  /* A non default rule can have one or more vias.                            */
-  /* These routines return the via info.                                      */
-EXTERN int lefiNonDefault_numVias (const lefiNonDefault* obj);
-EXTERN const lefiVia* lefiNonDefault_viaRule (const lefiNonDefault* obj, int  index);
-
-  /* A non default rule can have one or more spacing rules.                   */
-  /* These routines return the that info.                                     */
-EXTERN int lefiNonDefault_numSpacingRules (const lefiNonDefault* obj);
-EXTERN const lefiSpacing* lefiNonDefault_spacingRule (const lefiNonDefault* obj, int  index);
-
-EXTERN int lefiNonDefault_numUseVia (const lefiNonDefault* obj);
-EXTERN const char* lefiNonDefault_viaName (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_numUseViaRule (const lefiNonDefault* obj);
-EXTERN const char* lefiNonDefault_viaRuleName (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_numMinCuts (const lefiNonDefault* obj);
-EXTERN const char* lefiNonDefault_cutLayerName (const lefiNonDefault* obj, int  index);
-EXTERN int lefiNonDefault_numCuts (const lefiNonDefault* obj, int  index);
-
-  /* Debug print                                                              */
-
-  /* Layer information                                                        */
-
-  /* 5.4                                                                      */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiProp.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiProp.h
deleted file mode 100644
index 3d05412..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiProp.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIPROP_H
-#define CLEFIPROP_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Struct holds the data for one property.                                    */
-
-EXTERN const char* lefiProp_string (const lefiProp* obj);
-EXTERN const char* lefiProp_propType (const lefiProp* obj);
-EXTERN const char* lefiProp_propName (const lefiProp* obj);
-EXTERN char lefiProp_dataType (const lefiProp* obj);
-      /* either I:integer R:real S:string Q:quotedstring                      */
-      /* N:property name is not defined in the property definition section    */
-EXTERN int lefiProp_hasNumber (const lefiProp* obj);
-EXTERN int lefiProp_hasRange (const lefiProp* obj);
-EXTERN int lefiProp_hasString (const lefiProp* obj);
-EXTERN int lefiProp_hasNameMapString (const lefiProp* obj);
-EXTERN double lefiProp_number (const lefiProp* obj);
-EXTERN double lefiProp_left (const lefiProp* obj);
-EXTERN double lefiProp_right (const lefiProp* obj);
-
-EXTERN void lefiProp_print (const lefiProp* obj, FILE*  f);
-
-            /* N:property name is not defined.                                */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiPropType.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiPropType.h
deleted file mode 100644
index b823661..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiPropType.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIPROPTYPE_H
-#define CLEFIPROPTYPE_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Struct holds the data type for one property, if the property is            */
-/* either REAL or INTEGER.                                                    */
-
-EXTERN const char lefiPropType_propType (const lefiPropType* obj, char*  name);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTBInt.c b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTBInt.c
deleted file mode 100755
index 4c3505b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTBInt.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.7, and is subject to the Cadence LEF/DEF
- * Open Source License Agreement.   Your  continued  use  of this file
- * constitutes your acceptance of the terms of the LEF/DEF Open Source
- * License and an agreement to abide by its  terms.   If you  don't  agree
- * with  this, you must remove this and any other files which are part of the
- * distribution and  destroy any  copies made.
- * 
- * For updates, support, or to become part of the LEF/DEF Community, check
- * www.openeda.org for details.
- */
-#include <string.h>
-
-/*
- * lefiTimeBomb
- *//* Internal time bomb.  Always return date current *//* Check the current
-    date against the date given */ int 
-lefiValidTime()
-{
-  return (1);
-}
-
-/*
- * Internal check, always return ok
- *//* Check the current date against the date given */ int 
-lefiValidUser()
-{
-  return (1);
-}
-
-/*
- * Internal, return Cadence Design Systems
- *//* Check the current date against the date given */ char *
-lefiUser()
-{
-  return ((char *) "Cadence Design Systems");
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTypedefs.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTypedefs.h
deleted file mode 100644
index 8bddc77..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiTypedefs.h
+++ /dev/null
@@ -1,183 +0,0 @@
- /* ***************************************************************************** */
- /* ***************************************************************************** */
- /* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT! */
- /* ***************************************************************************** */
- /* ***************************************************************************** */
- /* Copyright 2012, Cadence Design Systems */
- /*  */
- /* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source */
- /* Distribution,  Product Version 5.8.  */
- /*  */
- /* 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 */
- /*  */
- /*        http://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. */
- /*  */
- /*  */
- /* For updates, support, or to become part of the LEF/DEF Community, */
- /* check www.openeda.org for details. */
- /*  */
- /*  $Author: dell $ */
- /*  $Revision: #1 $ */
- /*  $Date: 2017/06/06 $ */
- /*  $State:  $   */
- /* ***************************************************************************** */
- /* ***************************************************************************** */
-
-#ifndef CLEFITYPEDEFS_H
-#define CLEFITYPEDEFS_H
-
-#ifndef EXTERN
-#define EXTERN extern
-#endif
-
-#define bool int
-#define lefiUserData void *
-#define lefiUserDataHandle void **
-
-/* Typedefs */
-typedef struct lefiPoints lefiNum;
-
-/* Pointers to C++ classes */
-typedef void *lefiArrayFloorPlan;
-typedef void *lefiLayer;
-typedef void *lefiNoiseEdge;
-typedef void *lefiAntennaModel;
-typedef void *lefiCorrectionEdge;
-typedef void *lefiTrackPattern;
-typedef void *lefiIRDrop;
-typedef void *lefiGeometries;
-typedef void *lefiSpacingTable;
-typedef void *lefiMinFeature;
-typedef void *lefiGcellPattern;
-typedef void *lefiTiming;
-typedef void *lefiNoiseTable;
-typedef void *lefiCorrectionVictim;
-typedef void *lefiPinAntennaModel;
-typedef void *lefiProp;
-typedef void *lefiUseMinSpacing;
-typedef void *lefiCorrectionResistance;
-typedef void *lefiAntennaPWL;
-typedef void *lefiArray;
-typedef void *lefiNonDefault;
-typedef void *lefiLayerDensity;
-typedef void *lefiSitePattern;
-typedef void *lefiMacro;
-typedef void *lefiCorrectionTable;
-typedef void *lefiOrthogonal;
-typedef void *lefiVia;
-typedef void *lefiSite;
-typedef void *lefiViaLayer;
-typedef void *lefiParallel;
-typedef void *lefiNoiseVictim;
-typedef void *lefiSpacing;
-typedef void *lefiViaRule;
-typedef void *lefiViaRuleLayer;
-typedef void *lefiTwoWidths;
-typedef void *lefiDensity;
-typedef void *lefiPin;
-typedef void *lefiMaxStackVia;
-typedef void *lefiInfluence;
-typedef void *lefiUnits;
-typedef void *lefiPropType;
-typedef void *lefiObstruction;
-typedef void *lefiNoiseResistance;
-
-/* Data structures definitions */
-struct lefiNoiseMargin {
-  double high;
-  double low;
-};
-
-struct lefiGeomRect {
-      double xl;
-      double yl;
-      double xh;
-      double yh;
-      int    colorMask;
-};
-
-struct lefiGeomRectIter {
-  double xl;
-  double yl;
-  double xh;
-  double yh;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-struct lefiGeomPath {
-  int     numPoints;
-  double* x;
-  double* y;
-  int     colorMask;
-};
-
-struct lefiGeomPathIter {
-  int     numPoints;
-  double* x;
-  double* y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-struct lefiGeomPolygon {
-  int     numPoints;
-  double* x;
-  double* y;
-  int     colorMask;
-};
-
-struct lefiGeomPolygonIter {
-  int numPoints;
-  double* x;
-  double* y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-struct lefiGeomVia {
-  char*  name;
-  double x;
-  double y;
-  int    topMaskNum;
-  int    cutMaskNum;
-  int    bottomMaskNum;
-};
-
-struct lefiGeomViaIter {
-  char*  name;
-  double x;
-  double y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    topMaskNum;
-  int    cutMaskNum;
-  int    bottomMaskNum;
-};
-
-struct lefiPoints {
-  double x;
-  double y;
-};
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUnits.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUnits.h
deleted file mode 100644
index bc9a496..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUnits.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIUNITS_H
-#define CLEFIUNITS_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN int lefiUnits_hasDatabase (const lefiUnits* obj);
-EXTERN int lefiUnits_hasCapacitance (const lefiUnits* obj);
-EXTERN int lefiUnits_hasResistance (const lefiUnits* obj);
-EXTERN int lefiUnits_hasTime (const lefiUnits* obj);
-EXTERN int lefiUnits_hasPower (const lefiUnits* obj);
-EXTERN int lefiUnits_hasCurrent (const lefiUnits* obj);
-EXTERN int lefiUnits_hasVoltage (const lefiUnits* obj);
-EXTERN int lefiUnits_hasFrequency (const lefiUnits* obj);
-
-EXTERN const char* lefiUnits_databaseName (const lefiUnits* obj);
-EXTERN double lefiUnits_databaseNumber (const lefiUnits* obj);
-EXTERN double lefiUnits_capacitance (const lefiUnits* obj);
-EXTERN double lefiUnits_resistance (const lefiUnits* obj);
-EXTERN double lefiUnits_time (const lefiUnits* obj);
-EXTERN double lefiUnits_power (const lefiUnits* obj);
-EXTERN double lefiUnits_current (const lefiUnits* obj);
-EXTERN double lefiUnits_voltage (const lefiUnits* obj);
-EXTERN double lefiUnits_frequency (const lefiUnits* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiUnits_print (const lefiUnits* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUser.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUser.h
deleted file mode 100644
index 2df091c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUser.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-/*  User header file for the LEF Interface.  This includes                    */
-/*  all of the header files which are relevant to both the                    */
-/*  reader and the writer.                                                    */
-/*                                                                            */
-/*  lefrReader.h and lefwWriter.h include this file, so that                  */
-/*  an application only needs to include either lefrReader.h(pp)              */
-/*  or lefwWriter.h(pp).                                                      */
-/*                                                                            */
-
-
-#ifndef CLEFIUSER_H
-#define CLEFIUSER_H
-
-#include "lefiArray.h"
-#include "lefiCrossTalk.h"
-#include "lefiDebug.h"
-#include "lefiEncryptInt.h"
-#include "lefiLayer.h"
-#include "lefiMacro.h"
-#include "lefiMisc.h"
-#include "lefiNonDefault.h"
-#include "lefiProp.h"
-#include "lefiPropType.h"
-#include "lefiUnits.h"
-#include "lefiUtil.h"
-#include "lefiVia.h"
-#include "lefiViaRule.h"
-
-
-/* NEW CALLBACK add the reference here                                        */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUtil.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUtil.h
deleted file mode 100644
index c95d8a1..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiUtil.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIUTIL_H
-#define CLEFIUTIL_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Structure to return Macro data to FE                                       */
-
-/*int lefiValidTime();                                                        */
-EXTERN int lefiValidUser ();
-
-EXTERN char* lefiUser ();
-
-EXTERN char* lefiOrientStr (int  orient);
-
-EXTERN double convert_name2num (const char * versionName);
-
-EXTERN bool  validateMaskNumber (int  num);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiVia.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiVia.h
deleted file mode 100644
index aa401e5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiVia.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIVIA_H
-#define CLEFIVIA_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN struct lefiGeomPolygon* lefiViaLayer_getPolygon (const lefiViaLayer* obj, int  index);
-
-  /* setName calls clear to init                                              */
-  /* deflt=0 no default specified                                             */
-  /* deflt=1 default specified in lef file                                    */
-
-  /* orient=-1 means no orient was specified.                                 */
-
-  /* make a new one                                                           */
-
-EXTERN int lefiVia_hasDefault (const lefiVia* obj);
-EXTERN int lefiVia_hasGenerated (const lefiVia* obj);
-EXTERN int lefiVia_hasForeign (const lefiVia* obj);
-EXTERN int lefiVia_hasForeignPnt (const lefiVia* obj);
-EXTERN int lefiVia_hasForeignOrient (const lefiVia* obj);
-EXTERN int lefiVia_hasProperties (const lefiVia* obj);
-EXTERN int lefiVia_hasResistance (const lefiVia* obj);
-EXTERN int lefiVia_hasTopOfStack (const lefiVia* obj);
-
-EXTERN int lefiVia_numLayers (const lefiVia* obj);
-EXTERN char* lefiVia_layerName (const lefiVia* obj, int  layerNum);
-EXTERN int lefiVia_numRects (const lefiVia* obj, int  layerNum);
-EXTERN double lefiVia_xl (const lefiVia* obj, int  layerNum, int  rectNum);
-EXTERN double lefiVia_yl (const lefiVia* obj, int  layerNum, int  rectNum);
-EXTERN double lefiVia_xh (const lefiVia* obj, int  layerNum, int  rectNum);
-EXTERN double lefiVia_yh (const lefiVia* obj, int  layerNum, int  rectNum);
-EXTERN int lefiVia_rectColorMask (const lefiVia* obj, int  layerNum, int  rectNum);
-EXTERN int lefiVia_polyColorMask (const lefiVia* obj, int  layerNum, int  polyNum);
-EXTERN int lefiVia_numPolygons (const lefiVia* obj, int  layerNum);
-EXTERN struct lefiGeomPolygon lefiVia_getPolygon (const lefiVia* obj, int  layerNum, int  polyNum);
-
-EXTERN char* lefiVia_name (const lefiVia* obj);
-EXTERN double lefiVia_resistance (const lefiVia* obj);
-
-  /* Given an index from 0 to numProperties()-1 return                        */
-  /* information about that property.                                         */
-EXTERN int lefiVia_numProperties (const lefiVia* obj);
-EXTERN char* lefiVia_propName (const lefiVia* obj, int  index);
-EXTERN char* lefiVia_propValue (const lefiVia* obj, int  index);
-EXTERN double lefiVia_propNumber (const lefiVia* obj, int  index);
-EXTERN char lefiVia_propType (const lefiVia* obj, int  index);
-EXTERN int lefiVia_propIsNumber (const lefiVia* obj, int  index);
-EXTERN int lefiVia_propIsString (const lefiVia* obj, int  index);
-EXTERN char* lefiVia_foreign (const lefiVia* obj);
-EXTERN double lefiVia_foreignX (const lefiVia* obj);
-EXTERN double lefiVia_foreignY (const lefiVia* obj);
-EXTERN int lefiVia_foreignOrient (const lefiVia* obj);
-EXTERN char* lefiVia_foreignOrientStr (const lefiVia* obj);
-
-  /* 5.6 VIARULE inside a VIA                                                 */
-EXTERN int lefiVia_hasViaRule (const lefiVia* obj);
-EXTERN const char* lefiVia_viaRuleName (const lefiVia* obj);
-EXTERN double lefiVia_xCutSize (const lefiVia* obj);
-EXTERN double lefiVia_yCutSize (const lefiVia* obj);
-EXTERN const char* lefiVia_botMetalLayer (const lefiVia* obj);
-EXTERN const char* lefiVia_cutLayer (const lefiVia* obj);
-EXTERN const char* lefiVia_topMetalLayer (const lefiVia* obj);
-EXTERN double lefiVia_xCutSpacing (const lefiVia* obj);
-EXTERN double lefiVia_yCutSpacing (const lefiVia* obj);
-EXTERN double lefiVia_xBotEnc (const lefiVia* obj);
-EXTERN double lefiVia_yBotEnc (const lefiVia* obj);
-EXTERN double lefiVia_xTopEnc (const lefiVia* obj);
-EXTERN double lefiVia_yTopEnc (const lefiVia* obj);
-EXTERN int lefiVia_hasRowCol (const lefiVia* obj);
-EXTERN int lefiVia_numCutRows (const lefiVia* obj);
-EXTERN int lefiVia_numCutCols (const lefiVia* obj);
-EXTERN int lefiVia_hasOrigin (const lefiVia* obj);
-EXTERN double lefiVia_xOffset (const lefiVia* obj);
-EXTERN double lefiVia_yOffset (const lefiVia* obj);
-EXTERN int lefiVia_hasOffset (const lefiVia* obj);
-EXTERN double lefiVia_xBotOffset (const lefiVia* obj);
-EXTERN double lefiVia_yBotOffset (const lefiVia* obj);
-EXTERN double lefiVia_xTopOffset (const lefiVia* obj);
-EXTERN double lefiVia_yTopOffset (const lefiVia* obj);
-EXTERN int lefiVia_hasCutPattern (const lefiVia* obj);
-EXTERN const char* lefiVia_cutPattern (const lefiVia* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiVia_print (const lefiVia* obj, FILE*  f);
-
-  /* The prop value is stored in the propValue_ or the propDValue_.           */
-  /* If it is a string it is in propValue_.  If it is a number,               */
-  /* then propValue_ is NULL and it is stored in propDValue_;                 */
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiViaRule.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiViaRule.h
deleted file mode 100644
index 47be0b5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefiViaRule.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFIVIARULE_H
-#define CLEFIVIARULE_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-EXTERN int lefiViaRuleLayer_hasDirection (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasEnclosure (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasWidth (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasResistance (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasOverhang (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasMetalOverhang (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasSpacing (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_hasRect (const lefiViaRuleLayer* obj);
-
-EXTERN char* lefiViaRuleLayer_name (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_isHorizontal (const lefiViaRuleLayer* obj);
-EXTERN int lefiViaRuleLayer_isVertical (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_enclosureOverhang1 (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_enclosureOverhang2 (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_widthMin (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_widthMax (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_overhang (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_metalOverhang (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_resistance (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_spacingStepX (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_spacingStepY (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_xl (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_yl (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_xh (const lefiViaRuleLayer* obj);
-EXTERN double lefiViaRuleLayer_yh (const lefiViaRuleLayer* obj);
-
-  /* Debug print                                                              */
-EXTERN void lefiViaRuleLayer_print (const lefiViaRuleLayer* obj, FILE*  f);
-
-  /* This should clear out all the old stuff.                                 */
-
-  /* Add one of possibly many via names                                       */
-
-  /* These routines set a part of the active layer.                           */
-
-  /* This routine sets and creates the active layer.                          */
-
-EXTERN int lefiViaRule_hasGenerate (const lefiViaRule* obj);
-EXTERN int lefiViaRule_hasDefault (const lefiViaRule* obj);
-EXTERN char* lefiViaRule_name (const lefiViaRule* obj);
-
-  /* There are 2 or 3 layers in a rule.                                       */
-  /* numLayers() tells how many.                                              */
-  /* If a third layer exists then it is the cut layer.                        */
-EXTERN int lefiViaRule_numLayers (const lefiViaRule* obj);
-EXTERN const lefiViaRuleLayer* lefiViaRule_layer (const lefiViaRule* obj, int  index);
-
-EXTERN int lefiViaRule_numVias (const lefiViaRule* obj);
-EXTERN char* lefiViaRule_viaName (const lefiViaRule* obj, int  index);
-
-EXTERN int lefiViaRule_numProps (const lefiViaRule* obj);
-EXTERN const char* lefiViaRule_propName (const lefiViaRule* obj, int  index);
-EXTERN const char* lefiViaRule_propValue (const lefiViaRule* obj, int  index);
-EXTERN double lefiViaRule_propNumber (const lefiViaRule* obj, int  index);
-EXTERN const char lefiViaRule_propType (const lefiViaRule* obj, int  index);
-EXTERN int lefiViaRule_propIsNumber (const lefiViaRule* obj, int  index);
-EXTERN int lefiViaRule_propIsString (const lefiViaRule* obj, int  index);
-
-  /* Debug print                                                              */
-EXTERN void lefiViaRule_print (const lefiViaRule* obj, FILE*  f);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefrReader.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefrReader.h
deleted file mode 100644
index 8c91714..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefrReader.h
+++ /dev/null
@@ -1,509 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2017, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                           */
-/*  $Revision: #1 $                                                           */
-/*  $Date: 2017/06/06 $                                                       */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFRREADER_H
-#define CLEFRREADER_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-#define MAX_LEF_MSGS 4701
-
-/* The reader initialization.  Must be called before lefrRead().              */
-EXTERN int lefrInit ();
-EXTERN int lefrInitSession (int  startSession);
-
-/* obsolted                                                                   */
-EXTERN int lefrReset ();
-
-/* Clears parser configuration and return it in inial state.                  */
-EXTERN int lefrClear ();
-
-/* obsoleted                                                                  */
-EXTERN int lefrReleaseNResetMemory ();
-
-/* Change the comment character in LEF.  The normal character is              */
-/* '#'.   You can change it to anything you want, but be careful.             */
-EXTERN void lefrSetCommentChar (char  c);
-
-/* Allow the parser to upshift all names if the LEF                           */
-/* file is case insensitive.  The default is no shift, so the user            */
-/* must do case insensitive matching.                                         */
-EXTERN void lefrSetShiftCase ();
-
-/* Allow the user to change the casesensitivity anytime during                */
-/* parsing.                                                                   */
-/* caseSen = 0, will turn off the casesensitivity                             */
-/* caseSen != 0, will turn on the casesensitivity                             */
-
-EXTERN void lefrSetCaseSensitivity (int  caseSense);
-
-/* The reader request the file name they are parsing                          */
-
-EXTERN const char * lefrFName ();
-
-/*  The main reader function.                                                 */
-/*  The file should already be opened.  This requirement allows               */
-/*  the reader to be used with stdin or a pipe.  The file name                */
-/*  is only used for error messages.  The includeSearchPath is                */
-/*  a colon-delimited list of directories in which to find                    */
-/*  include files.                                                            */
-
-EXTERN int lefrRead (FILE * file, const char * fileName, lefiUserData  userData);
-
-/*  Set all of the callbacks that have not yet been set to a function         */
-/*  that will add up how many times a given lef data type was ignored         */
-/*  (ie no callback was done).  The statistics can later be printed out.      */
-EXTERN void lefrSetRegisterUnusedCallbacks ();
-EXTERN void lefrPrintUnusedCallbacks (FILE*  f);
-
-/* Set/get the client-provided user data.  lefi doesn't look at               */
-/* this data at all, it simply passes the opaque lefiUserData pointer         */
-/* back to the application with each callback.  The client can                */
-/* change the data at any time, and it will take effect on the                */
-/* next callback.  The lefi reader and writer maintain separate               */
-/* user data pointers.                                                        */
-EXTERN void lefrSetUserData (lefiUserData p0);
-EXTERN lefiUserData lefrGetUserData ();
-
-/* An enum describing all of the types of reader callbacks.                   */
-typedef enum {
-  lefrUnspecifiedCbkType = 0,
-  lefrVersionCbkType = 1,
-  lefrVersionStrCbkType = 2,
-  lefrDividerCharCbkType = 3,
-  lefrBusBitCharsCbkType = 4,
-  lefrUnitsCbkType = 5,
-  lefrCaseSensitiveCbkType = 6,
-  lefrNoWireExtensionCbkType = 7,
-  lefrPropBeginCbkType = 8,
-  lefrPropCbkType = 9,
-  lefrPropEndCbkType = 10,
-  lefrLayerCbkType = 11,
-  lefrViaCbkType = 12,
-  lefrViaRuleCbkType = 13,
-  lefrSpacingCbkType = 14,
-  lefrIRDropCbkType = 15,
-  lefrDielectricCbkType = 16,
-  lefrMinFeatureCbkType = 17,
-  lefrNonDefaultCbkType = 18,
-  lefrSiteCbkType = 19,
-  lefrMacroBeginCbkType = 20,
-  lefrPinCbkType = 21,
-  lefrMacroCbkType = 22,
-  lefrObstructionCbkType = 23,
-  lefrArrayCbkType = 24,
-
-  /* NEW CALLBACKS - each callback has its own type.  For each callback       */
-  /* that you add, you must add an item to this enum.                         */
-
-  lefrSpacingBeginCbkType = 25,
-  lefrSpacingEndCbkType = 26,
-  lefrArrayBeginCbkType = 27,
-  lefrArrayEndCbkType = 28,
-  lefrIRDropBeginCbkType = 29,
-  lefrIRDropEndCbkType = 30,
-  lefrNoiseMarginCbkType = 31,
-  lefrEdgeRateThreshold1CbkType = 32,
-  lefrEdgeRateThreshold2CbkType = 33,
-  lefrEdgeRateScaleFactorCbkType = 34,
-  lefrNoiseTableCbkType = 35,
-  lefrCorrectionTableCbkType = 36,
-  lefrInputAntennaCbkType = 37,
-  lefrOutputAntennaCbkType = 38,
-  lefrInoutAntennaCbkType = 39,
-  lefrAntennaInputCbkType = 40,
-  lefrAntennaInoutCbkType = 41,
-  lefrAntennaOutputCbkType = 42,
-  lefrManufacturingCbkType = 43,
-  lefrUseMinSpacingCbkType = 44,
-  lefrClearanceMeasureCbkType = 45,
-  lefrTimingCbkType = 46,
-  lefrMacroClassTypeCbkType = 47,
-  lefrMacroOriginCbkType = 48,
-  lefrMacroSizeCbkType = 49,
-  lefrMacroFixedMaskCbkType = 50,
-  lefrMacroEndCbkType = 51,
-  lefrMaxStackViaCbkType = 52,
-  lefrExtensionCbkType = 53,
-  lefrDensityCbkType = 54,
-  lefrFixedMaskCbkType = 55,
-  lefrMacroSiteCbkType = 56,
-  lefrMacroForeignCbkType = 57,
-
-  lefrLibraryEndCbkType = 58
-} lefrCallbackType_e;
-
-/* Declarations of function signatures for each type of callback.             */
-/* These declarations are type-safe when compiling with ANSI C                */
-/* or C++; you will only be able to register a function pointer               */
-/* with the correct signature for a given type of callback.                   */
-/*                                                                            */
-/* Each callback function is expected to return 0 if successful.              */
-/* A non-zero return code will cause the reader to abort.                     */
-/*                                                                            */
-/* The lefrDesignStart and lefrDesignEnd callback is only called once.        */
-/* Other callbacks may be called multiple times, each time with a different   */
-/* set of data.                                                               */
-/*                                                                            */
-/* For each callback, the Def API will make the callback to the               */
-/* function supplied by the client, which should either make a copy           */
-/* of the Def object, or store the data in the client's own data structures.  */
-/* The Def API will delete or reuse each object after making the callback,    */
-/* so the client should not keep a pointer to it.                             */
-/*                                                                            */
-/* All callbacks pass the user data pointer provided in lefrRead()            */
-/* or lefrSetUserData() back to the client; this can be used by the           */
-/* client to obtain access to the rest of the client's data structures.       */
-/*                                                                            */
-/* The user data pointer is obtained using lefrGetUserData() immediately      */
-/* prior to making each callback, so the client is free to change the         */
-/* user data on the fly if necessary.                                         */
-/*                                                                            */
-/* Callbacks with the same signature are passed a callback type               */
-/* parameter, which allows an application to write a single callback          */
-/* function, register that function for multiple callbacks, then              */
-/* switch based on the callback type to handle the appropriate type of        */
-/* data.                                                                      */
-
-/* A declaration of the signature of all callbacks that return nothing.       */
-typedef int (*lefrVoidCbkFnType) (lefrCallbackType_e, void* num, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a string.      */
-typedef int (*lefrStringCbkFnType) (lefrCallbackType_e, const char *string, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a integer.     */
-typedef int (*lefrIntegerCbkFnType) (lefrCallbackType_e, int number, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a double.      */
-typedef int (*lefrDoubleCbkFnType) (lefrCallbackType_e, double number, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiUnits.   */
-typedef int (*lefrUnitsCbkFnType) (lefrCallbackType_e, lefiUnits* units, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiLayer.   */
-typedef int (*lefrLayerCbkFnType) (lefrCallbackType_e, lefiLayer* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiVia.     */
-typedef int (*lefrViaCbkFnType) (lefrCallbackType_e, lefiVia* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiViaRule. */
-typedef int (*lefrViaRuleCbkFnType) (lefrCallbackType_e, lefiViaRule* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiSpacing. */
-typedef int (*lefrSpacingCbkFnType) (lefrCallbackType_e, lefiSpacing* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiIRDrop.  */
-typedef int (*lefrIRDropCbkFnType) (lefrCallbackType_e, lefiIRDrop* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiMinFeatu */
-typedef int (*lefrMinFeatureCbkFnType) (lefrCallbackType_e, lefiMinFeature* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiNonDefau */
-typedef int (*lefrNonDefaultCbkFnType) (lefrCallbackType_e, lefiNonDefault* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiSite.    */
-typedef int (*lefrSiteCbkFnType) (lefrCallbackType_e, lefiSite* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiMacro.   */
-typedef int (*lefrMacroCbkFnType) (lefrCallbackType_e, lefiMacro* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiPin.     */
-typedef int (*lefrPinCbkFnType) (lefrCallbackType_e, lefiPin* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiObstruct */
-typedef int (*lefrObstructionCbkFnType) (lefrCallbackType_e, lefiObstruction* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiArray.   */
-typedef int (*lefrArrayCbkFnType) (lefrCallbackType_e, lefiArray* l, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiProp.    */
-typedef int (*lefrPropCbkFnType) (lefrCallbackType_e, lefiProp* p, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiNoiseMar */
-typedef int (*lefrNoiseMarginCbkFnType) (lefrCallbackType_e, struct lefiNoiseMargin* p, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiNoiseTab */
-typedef int (*lefrNoiseTableCbkFnType) (lefrCallbackType_e, lefiNoiseTable* p, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiCorrecti */
-typedef int (*lefrCorrectionTableCbkFnType) (lefrCallbackType_e, lefiCorrectionTable* p, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiTiming.  */
-typedef int (*lefrTimingCbkFnType) (lefrCallbackType_e, lefiTiming* p, lefiUserData);
-
-/* A declaration of the signature of all callbacks that return a lefiUseMinSp */
-typedef int (*lefrUseMinSpacingCbkFnType) (lefrCallbackType_e, lefiUseMinSpacing* l, lefiUserData);
-
-  /* NEW CALLBACK - If your callback returns a pointer to a new class then    */
-  /* you must add a type function here.                                       */
-
-/* A declaration of the signature of all callbacks that return a lefiMaxStack */
-typedef int (*lefrMaxStackViaCbkFnType) (lefrCallbackType_e, lefiMaxStackVia* l, lefiUserData);
-
-typedef int (*lefrMacroNumCbkFnType) (lefrCallbackType_e, lefiNum l, lefiUserData);
-
-/* 5.6                                                                        */
-/* A declaration of the signature of all callbacks that return a lefiDensity. */
-typedef int (*lefrDensityCbkFnType) (lefrCallbackType_e, lefiDensity* l, lefiUserData);
-
-/* Functions to call to register a callback function.                         */
-EXTERN void lefrSetUnitsCbk (lefrUnitsCbkFnType p0);
-EXTERN void lefrSetVersionCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetVersionStrCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetDividerCharCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetBusBitCharsCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetNoWireExtensionCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetCaseSensitiveCbk (lefrIntegerCbkFnType p0);
-EXTERN void lefrSetPropBeginCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetPropCbk (lefrPropCbkFnType p0);
-EXTERN void lefrSetPropEndCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetLayerCbk (lefrLayerCbkFnType p0);
-EXTERN void lefrSetViaCbk (lefrViaCbkFnType p0);
-EXTERN void lefrSetViaRuleCbk (lefrViaRuleCbkFnType p0);
-EXTERN void lefrSetSpacingCbk (lefrSpacingCbkFnType p0);
-EXTERN void lefrSetIRDropCbk (lefrIRDropCbkFnType p0);
-EXTERN void lefrSetDielectricCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetMinFeatureCbk (lefrMinFeatureCbkFnType p0);
-EXTERN void lefrSetNonDefaultCbk (lefrNonDefaultCbkFnType p0);
-EXTERN void lefrSetSiteCbk (lefrSiteCbkFnType p0);
-EXTERN void lefrSetMacroBeginCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetPinCbk (lefrPinCbkFnType p0);
-EXTERN void lefrSetObstructionCbk (lefrObstructionCbkFnType p0);
-EXTERN void lefrSetArrayCbk (lefrArrayCbkFnType p0);
-EXTERN void lefrSetMacroCbk (lefrMacroCbkFnType p0);
-EXTERN void lefrSetLibraryEndCbk (lefrVoidCbkFnType p0);
-
-/* NEW CALLBACK - each callback must have a function to allow the user        */
-/* to set it.  Add the function here.                                         */
-
-EXTERN void lefrSetTimingCbk (lefrTimingCbkFnType p0);
-EXTERN void lefrSetSpacingBeginCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetSpacingEndCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetArrayBeginCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetArrayEndCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetIRDropBeginCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetIRDropEndCbk (lefrVoidCbkFnType p0);
-EXTERN void lefrSetNoiseMarginCbk (lefrNoiseMarginCbkFnType p0);
-EXTERN void lefrSetEdgeRateThreshold1Cbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetEdgeRateThreshold2Cbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetEdgeRateScaleFactorCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetNoiseTableCbk (lefrNoiseTableCbkFnType p0);
-EXTERN void lefrSetCorrectionTableCbk (lefrCorrectionTableCbkFnType p0);
-EXTERN void lefrSetInputAntennaCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetOutputAntennaCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetInoutAntennaCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetAntennaInputCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetAntennaInoutCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetAntennaOutputCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetClearanceMeasureCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetManufacturingCbk (lefrDoubleCbkFnType p0);
-EXTERN void lefrSetUseMinSpacingCbk (lefrUseMinSpacingCbkFnType p0);
-EXTERN void lefrSetMacroClassTypeCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetMacroOriginCbk (lefrMacroNumCbkFnType p0);
-EXTERN void lefrSetMacroSizeCbk (lefrMacroNumCbkFnType p0);
-EXTERN void lefrSetMacroFixedMaskCbk (lefrIntegerCbkFnType p0);
-EXTERN void lefrSetMacroEndCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetMaxStackViaCbk (lefrMaxStackViaCbkFnType p0);
-EXTERN void lefrSetExtensionCbk (lefrStringCbkFnType p0);
-EXTERN void lefrSetDensityCbk (lefrDensityCbkFnType p0);
-EXTERN void lefrSetFixedMaskCbk (lefrIntegerCbkFnType p0);
-
-/* Set all of the callbacks that have not yet been set to the following       */
-/* function.  This is especially useful if you want to check to see           */
-/* if you forgot anything.                                                    */
-EXTERN void lefrSetUnusedCallbacks (lefrVoidCbkFnType  func);
-
-/* Reset all the callback functions to nil                                    */
-EXTERN void lefrUnsetCallbacks ();
-
-/* Functions to call to unregister a callback function.                       */
-EXTERN void lefrUnsetAntennaInputCbk ();
-EXTERN void lefrUnsetAntennaInoutCbk ();
-EXTERN void lefrUnsetAntennaOutputCbk ();
-EXTERN void lefrUnsetArrayBeginCbk ();
-EXTERN void lefrUnsetArrayCbk ();
-EXTERN void lefrUnsetArrayEndCbk ();
-EXTERN void lefrUnsetBusBitCharsCbk ();
-EXTERN void lefrUnsetCaseSensitiveCbk ();
-EXTERN void lefrUnsetClearanceMeasureCbk ();
-EXTERN void lefrUnsetCorrectionTableCbk ();
-EXTERN void lefrUnsetDensityCbk ();
-EXTERN void lefrUnsetDielectricCbk ();
-EXTERN void lefrUnsetDividerCharCbk ();
-EXTERN void lefrUnsetEdgeRateScaleFactorCbk ();
-EXTERN void lefrUnsetEdgeRateThreshold1Cbk ();
-EXTERN void lefrUnsetEdgeRateThreshold2Cbk ();
-EXTERN void lefrUnsetExtensionCbk ();
-EXTERN void lefrUnsetInoutAntennaCbk ();
-EXTERN void lefrUnsetInputAntennaCbk ();
-EXTERN void lefrUnsetIRDropBeginCbk ();
-EXTERN void lefrUnsetIRDropCbk ();
-EXTERN void lefrUnsetIRDropEndCbk ();
-EXTERN void lefrUnsetLayerCbk ();
-EXTERN void lefrUnsetLibraryEndCbk ();
-EXTERN void lefrUnsetMacroBeginCbk ();
-EXTERN void lefrUnsetMacroCbk ();
-EXTERN void lefrUnsetMacroClassTypeCbk ();
-EXTERN void lefrUnsetMacroEndCbk ();
-EXTERN void lefrUnsetMacroOriginCbk ();
-EXTERN void lefrUnsetMacroSizeCbk ();
-EXTERN void lefrUnsetManufacturingCbk ();
-EXTERN void lefrUnsetMaxStackViaCbk ();
-EXTERN void lefrUnsetMinFeatureCbk ();
-EXTERN void lefrUnsetNoiseMarginCbk ();
-EXTERN void lefrUnsetNoiseTableCbk ();
-EXTERN void lefrUnsetNonDefaultCbk ();
-EXTERN void lefrUnsetNoWireExtensionCbk ();
-EXTERN void lefrUnsetObstructionCbk ();
-EXTERN void lefrUnsetOutputAntennaCbk ();
-EXTERN void lefrUnsetPinCbk ();
-EXTERN void lefrUnsetPropBeginCbk ();
-EXTERN void lefrUnsetPropCbk ();
-EXTERN void lefrUnsetPropEndCbk ();
-EXTERN void lefrUnsetSiteCbk ();
-EXTERN void lefrUnsetSpacingBeginCbk ();
-EXTERN void lefrUnsetSpacingCbk ();
-EXTERN void lefrUnsetSpacingEndCbk ();
-EXTERN void lefrUnsetTimingCbk ();
-EXTERN void lefrUnsetUseMinSpacingCbk ();
-EXTERN void lefrUnsetUnitsCbk ();
-EXTERN void lefrUnsetVersionCbk ();
-EXTERN void lefrUnsetVersionStrCbk ();
-EXTERN void lefrUnsetViaCbk ();
-EXTERN void lefrUnsetViaRuleCbk ();
-
-/* Return the current line number in the parser.                              */
-EXTERN int lefrLineNumber ();
-
-/* Routine to set the message logging routine for errors                      */
-typedef void (*LEFI_LOG_FUNCTION) (const char*);
-EXTERN void lefrSetLogFunction (LEFI_LOG_FUNCTION p0);
-
-/* Routine to set the message logging routine for warnings                    */
-typedef void (*LEFI_WARNING_LOG_FUNCTION) (const char*);
-EXTERN void lefrSetWarningLogFunction (LEFI_WARNING_LOG_FUNCTION p0);
-
-/* Routine to set the user defined malloc routine                             */
-typedef void* (*LEFI_MALLOC_FUNCTION) (int);
-EXTERN void lefrSetMallocFunction (LEFI_MALLOC_FUNCTION p0);
-
-/* Routine to set the user defined realloc routine                            */
-typedef void* (*LEFI_REALLOC_FUNCTION) (void *, int);
-EXTERN void lefrSetReallocFunction (LEFI_REALLOC_FUNCTION p0);
-
-/* Routine to set the user defined free routine                               */
-typedef void (*LEFI_FREE_FUNCTION) (void *);
-EXTERN void lefrSetFreeFunction (LEFI_FREE_FUNCTION p0);
-
-/* Routine to set the line number callback routine                            */
-typedef void (*LEFI_LINE_NUMBER_FUNCTION) (int);
-EXTERN void lefrSetLineNumberFunction (LEFI_LINE_NUMBER_FUNCTION p0);
-
-/* Set the number of lines before calling the line function callback routine  */
-/* Default is 10000                                                           */
-EXTERN void lefrSetDeltaNumberLines (int p0);
-
-/* PCR 551229 - Set the parser to be more relax                               */
-/* This api is specific for PKS.                                              */
-/* When in relax mode, the parser will not require width, pitch, & direction  */
-/* in routing layers. Also vias in nondefault rules                           */
-EXTERN void lefrSetRelaxMode ();
-EXTERN void lefrUnsetRelaxMode ();
-
-/* PCR 565274 - LEF/DEF API should have the API call to overwrite default     */
-/*              version                                                       */
-EXTERN void lefrSetVersionValue (const  char*   version);
-
-/* Routine to set the read function                                           */
-typedef size_t (*LEFI_READ_FUNCTION) (FILE*, char*, size_t);
-EXTERN void lefrSetReadFunction (LEFI_READ_FUNCTION p0);
-EXTERN void lefrUnsetReadFunction ();
-
-/* Routine to set the lefrWarning.log to open as append instead for write     */
-/* New in 5.7                                                                 */
-EXTERN void lefrSetOpenLogFileAppend ();
-EXTERN void lefrUnsetOpenLogFileAppend ();
-
-/* Routine to disable string property value process, default it will process  */
-/* the value string                                                           */
-EXTERN void lefrDisablePropStrProcess ();
-
-/* Routine to set the max number of warnings for a perticular section         */
-
-EXTERN void lefrSetAntennaInoutWarnings (int  warn);
-EXTERN void lefrSetAntennaInputWarnings (int  warn);
-EXTERN void lefrSetAntennaOutputWarnings (int  warn);
-EXTERN void lefrSetArrayWarnings (int  warn);
-EXTERN void lefrSetCaseSensitiveWarnings (int  warn);
-EXTERN void lefrSetCorrectionTableWarnings (int  warn);
-EXTERN void lefrSetDielectricWarnings (int  warn);
-EXTERN void lefrSetEdgeRateThreshold1Warnings (int  warn);
-EXTERN void lefrSetEdgeRateThreshold2Warnings (int  warn);
-EXTERN void lefrSetEdgeRateScaleFactorWarnings (int  warn);
-EXTERN void lefrSetInoutAntennaWarnings (int  warn);
-EXTERN void lefrSetInputAntennaWarnings (int  warn);
-EXTERN void lefrSetIRDropWarnings (int  warn);
-EXTERN void lefrSetLayerWarnings (int  warn);
-EXTERN void lefrSetMacroWarnings (int  warn);
-EXTERN void lefrSetMaxStackViaWarnings (int  warn);
-EXTERN void lefrSetMinFeatureWarnings (int  warn);
-EXTERN void lefrSetNoiseMarginWarnings (int  warn);
-EXTERN void lefrSetNoiseTableWarnings (int  warn);
-EXTERN void lefrSetNonDefaultWarnings (int  warn);
-EXTERN void lefrSetNoWireExtensionWarnings (int  warn);
-EXTERN void lefrSetOutputAntennaWarnings (int  warn);
-EXTERN void lefrSetPinWarnings (int  warn);
-EXTERN void lefrSetSiteWarnings (int  warn);
-EXTERN void lefrSetSpacingWarnings (int  warn);
-EXTERN void lefrSetTimingWarnings (int  warn);
-EXTERN void lefrSetUnitsWarnings (int  warn);
-EXTERN void lefrSetUseMinSpacingWarnings (int  warn);
-EXTERN void lefrSetViaRuleWarnings (int  warn);
-EXTERN void lefrSetViaWarnings (int  warn);
-
-/* Handling output messages                                                   */
-EXTERN void lefrDisableParserMsgs (int  nMsg, int*  msgs);
-EXTERN void lefrEnableParserMsgs (int  nMsg, int*  msgs);
-EXTERN void lefrEnableAllMsgs ();
-EXTERN void lefrDisableAllMsgs ();
-EXTERN void lefrSetTotalMsgLimit (int  totNumMsgs);
-EXTERN void lefrSetLimitPerMsg (int  msgId, int  numMsg);
-
-/* Return codes for the user callbacks.                                       */
-/* The user should return one of these values.                                */
-#define PARSE_OK 0      
-#define STOP_PARSE 1    
-#define PARSE_ERROR 2   
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriter.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriter.h
deleted file mode 100644
index d3a4f9f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriter.h
+++ /dev/null
@@ -1,2128 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFWWRITER_H
-#define CLEFWWRITER_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/* Return codes for writing functions:                                        */
-#define LEFW_OK               0
-#define LEFW_UNINITIALIZED    1
-#define LEFW_BAD_ORDER        2
-#define LEFW_BAD_DATA         3
-#define LEFW_ALREADY_DEFINED  4
-#define LEFW_WRONG_VERSION    5
-#define LEFW_MIX_VERSION_DATA 6
-#define LEFW_OBSOLETE         7
-
-/* orient                                                                     */
-/*   0 = N                                                                    */
-/*   1 = W                                                                    */
-/*   2 = S                                                                    */
-/*   3 = E                                                                    */
-/*   4 = FN                                                                   */
-/*   5 = FW                                                                   */
-/*   6 = FS                                                                   */
-/*   7 = FE                                                                   */
-
-/* The LEF writer initialization.  Must be called first.                      */
-/* Either this routine or lefwInitCbk should be call only,                    */
-/* Can't call both routines.                                                  */
-/* This routine must be called only once.                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwInit (FILE*  f);
-
-/* The LEF writer initialization.  Must be called first.                      */
-/* Either this routine or lefwInit should be call only,                       */
-/* Can't call both routines.                                                  */
-/* This routine must be called only once.                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwInitCbk (FILE*  f);
-
-/* This routine will set the writer to write out an encrypted                 */
-/* lef file.                                                                  */
-/* This routine must be called only once and has to be called after           */
-/* lefwInit or lefwInitCbk                                                    */
-/* Need to call lefwCloseEncrypt to do some cleaning if this routine          */
-/* has called                                                                 */
-EXTERN int lefwEncrypt ();
-
-/* This routine needs to be called if lefwEncrypt has called.                 */
-/* It should be called before the fclose.                                     */
-/* It does some house cleaning.                                               */
-EXTERN int lefwCloseEncrypt ();
-
-/* This routine will write a blank line                                       */
-
-EXTERN int lefwNewLine ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwVersion (int  vers1, int  vers2);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-/* The caseSensitive can be ON or OFF.                                        */
-EXTERN int lefwCaseSensitive (const char*  caseSensitive);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-/* The noWireExtensionAtPin can be ON or OFF.                                 */
-EXTERN int lefwNoWireExtensionAtPin (const char*  noWireExt);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-/*     already have one                                                       */
-EXTERN int lefwMinfeature (double  minFeatureX, double  minFeatureY);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwDielectric (double  dielectric);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwBusBitChars (const char*  busBitChars);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwDividerChar (const char*  dividerChar);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwManufacturingGrid (double  grid);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.8 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwFixedMask ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called multiple times.                                 */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwUseMinSpacing (const char*  type, const char*  onOff);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwClearanceMeasure (const char*  type);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwAntennaInputGateArea (double  inputGateArea);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwAntennaInOutDiffArea (double  inOutDiffArea);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwAntennaOutputDiffArea (double  outputDiffArea);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-/* This section of routines is optional.                                      */
-/* The routine starts the units section. All of the units must follow.        */
-EXTERN int lefwStartUnits ();
-
-/* This routine is called once for each unit.  The call must                  */
-/* be preceeded by a call to lefwStartUnits and must be                       */
-/* terminated by a call to lefwEndUnits.                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwUnits (double  time, double  capacitance, double  resistance, double  power, double  current, double  voltage, double  database);
-
-/* This routine is called once for each unit.  It is separated from           */
-/* lefwUnits due to backwards compatible for pre 5.3.                         */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwUnitsFrequency (double  frequency);
-
-/* This routine must be called after the lefwUnits call (if any).             */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndUnits ();
-
-/* This routine is called after lefwInit.                                     */
-/* Either this routine or lefwStartLayerRouting must be called.               */
-/* Multiple sections of lefwStartLayer can be called.                         */
-/* This routine can be called only once per section.                          */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the layer section. All of the layers must follow.       */
-/* The type can be either CUT for Cut Layer, MASTERSLICE or OVERLAP for       */
-/* Masterslice or Overlay Layer.                                              */
-EXTERN int lefwStartLayer (const char*  layerName, const char*  type);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This section of routines is optional.                                      */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.8 syntax.                                                      */
-EXTERN int lefwLayerMask (int  maskColor);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This section of routines is optional.                                      */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.5 syntax.                                                      */
-/* This routine is called if the layer type is IMPLANT when                   */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerWidth (double  minWidth);
-
-/* The following APIs are for lefwrite 5.7 Layer, Spacing with type CUT       */
-/* Due to adding new constructs, it is impossible to use the previous         */
-/* APIs.                                                                      */
-/* The following APIs are obsoleted in 5.7:                                   */
-/*    lefwLayer                                                               */
-/*    lefwLayerStack                                                          */
-/*    lefwLayerSpacingAdjacent                                                */
-/*    lefwLayerSpacingCenterToCenter                                          */
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine starts the Layer Type Cut Spacing                             */
-/* Returns 0 if successful.                                                   */
-/* The routing lefwLayerCutSpacingEnd has to call at the end of each spacing. */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacing (double  spacing);
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingCenterToCenter ();
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingSameNet ();
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Either this routine, lefwLayerCutSpacingAdjacent,                          */
-/* lefwLayerCutSpacingParallel or lefwLayerCutSpacingArea is called per Spaci */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingLayer (const char*  name2, int  stack);
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Either this routine, lefwLayerCutSpacingLayer,                             */
-/* lefwLayerCutSpacingParallel or lefwLayerCutSpacingArea is called per Spaci */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingAdjacent (int  viaCuts, double  distance, int  stack);
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Either this routine, lefwLayerCutSpacingLayer,                             */
-/* lefwLayerCutSpacingAdjacent or lefwLayerCutSpacingArea is called per Spaci */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingParallel ();
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine is optional.                                                  */
-/* Either this routine, lefwLayerCutSpacingLayer, * lefwLayerCutSpacingAdjace */
-/* or lefwLayerCutSpacingParallel is called per Spacing.                      */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingArea (double  cutArea);
-
-/* This routine must be called after lefwLayerSpacing                         */
-/* This routine marks the end of a Layer Type CUT Spacing                     */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.7 syntax.                                                      */
-EXTERN int lefwLayerCutSpacingEnd ();
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called only once.                                      */
-/* This section of routines is optional.                                      */
-/* This is a 5.7 syntax                                                       */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerCutSpacingTableOrtho (int  numSpacing, double*  cutWithins, double*  orthoSpacings);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called only once.                                      */
-/* This section of routines is optional.                                      */
-/* This is a 5.7 syntax                                                       */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerArraySpacing (int  longArray, double  viaWidth, double  cutSpacing, int  numArrayCut, int*  arrayCuts, double*  arraySpacings);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called multiple times.                                 */
-/* This section of routines is optional.                                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerEnclosure (const char*  location, double  overhang1, double  overhang2, double  width);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called multiple times.                                 */
-/* This routine is similar as lefwLayerEnclosure, but allow user to add       */
-/* EXCEPTEXTRACUT option                                                      */
-/* This section of routines is optional.                                      */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerEnclosureWidth (const char*  location, double  overhang1, double  overhang2, double  width, double  cutWithin);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called multiple times.                                 */
-/* This routine is to write out minLength inside ENCLOSURE instead of WIDTH   */
-/* as in the routine lefwLayerEnclosure & lefwLayerEnclosureWidth.            */
-/* This section of routines is optional.                                      */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerEnclosureLength (const char*  location, double  overhang1, double  overhang2, double  minLength);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called multiple times.                                 */
-/* This section of routines is optional.                                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerPreferEnclosure (const char*  location, double  overhang1, double  overhang2, double  width);
-
-/* This routine must be called after lefwStartLayer.                          */
-/* This routine can be called only once per Layer.                            */
-/* This section of routines is optional.                                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is called if the layer type is CUT when                       */
-/* lefwStartLayer is called.                                                  */
-EXTERN int lefwLayerResistancePerCut (double  resistance);
-
-/* This routine must be called after the lefwStartLayer call (if any).        */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndLayer (const char*  layerName);
-
-/* This routine is called after lefwInit.                                     */
-/* Either this routine or lefwStartLayer must be called.                      */
-/* Multiple section of lefwStartLayer can be called.                          */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the layer routing section.                              */
-/* All of the layers must follow.                                             */
-EXTERN int lefwStartLayerRouting (const char*  layerName);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is required for LayerRouting.                                 */
-/* Returns 0 if successful.                                                   */
-                                                   /* DIAG45 | DIAG135        */
-EXTERN int lefwLayerRouting (const char*  direction, double  width);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* Either this routine or lefwLayerRoutingPitchXYDistance can be called       */
-/* but not both                                                               */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingPitch (double  pitch);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* Either this routine or lefwLayerRoutingPitch can be called but not both    */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingPitchXYDistance (double  xDistance, double  yDistance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* Either this routine or lefwLayerRoutingDiagPitchXYDistance can be called   */
-/* but not both                                                               */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingDiagPitch (double  distance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* Either this routine or lefwLayerRoutingDiagPitch can be called             */
-/* but not both                                                               */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingDiagPitchXYDistance (double  diag45Distance, double  diag135Distance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingDiagWidth (double  diagWidth);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingDiagSpacing (double  diagSpacing);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingDiagMinEdgeLength (double  diagLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Either this routine or lefwLayerRoutingOffsetXYDistance can be called      */
-/* but not both                                                               */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingOffset (double  offset);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Either this routine or lefwLayerRoutingOffset can be called but not both   */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingOffsetXYDistance (double  xDistance, double  yDistance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingArea (double  area);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinsize (int  numRect, double*  minWidth, double*  minLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinimumcut (double  numCuts, double  minWidth);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is similar as lefwLayerRoutingMinimumcut, but allow user      */
-/* to specify value for WITHIN                                                */
-/* This is a 5.7 syntax.                                                      */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinimumcutWithin (double  numCuts, double  minWidth, double  cutDistance);
-
-/* This routine must be called only once after lefwLayerRoutingMinimumcut.    */
-/* This routine is optional.                                                  */
-/* Direction can be either FROMABOVE or FROMBELOW                             */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinimumcutConnections (const char*  direction);
-
-/* This routine must be called only once after lefwLayerRoutingMinimumcut.    */
-/* This routine is optional.                                                  */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinimumcutLengthWithin (double  length, double  distance);
-
-/* This routine must be called multiple time after lefwStartLayerRouting.     */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacing (double  spacing);
-
-/* Either this routine, lefwLayerRoutingSpacingLengthThreshold or             */
-/* lefwLayerRoutingSpacingSameNet can be                                      */
-/* called only once after lefwLayerRoutingSpacing.                            */
-/* This routine is optional.                                                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingRange (double  minWidth, double  maxWidth);
-
-/* Either this routine or lefwLayerRoutingSpacingRangeInfluence or            */
-/* lefwLayerRoutingSpacingRangeRange can                                      */
-/* be called once after llefwLayerRoutingSpacingRange.                        */
-/* This routine is valid only if either or both leftRange and rightRange      */
-/* in lefwLayerRoutingSpacing are non zero                                    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingRangeUseLengthThreshold ();
-
-/* Either this routine or lefwLayerRoutingSpacingRangeUseLengthThreshold or   */
-/* lefwLayerRoutingSpacingRangeRange can be called once after                 */
-/* lefwLayerRoutingSpacingRange.                                              */
-/* subMinWidth & subMaxWidth are optional.                                    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingRangeInfluence (double  infValue, double  subMinWidth, double  subMaxWidth);
-
-/* Either this routine or lefwLayerRoutingSpacingRangeUseLengthThreshold or   */
-/* lefwLayerRoutingSpacingRangeInfluence can be called once after             */
-/* lefwLayerRoutingSpacingRange.                                              */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingRangeRange (double  minWidth, double  maxWidth);
-
-/* Either this routine, lefwLayerRoutingSpacingRange or                       */
-/* lefwLayerRoutingSpacingSameNet can be                                      */
-/* be called once after lefwLayerRoutingSpacing.                              */
-/* minWidth & maxWidth are optional.                                          */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingLengthThreshold (double  lengthValue, double  minWidth, double  maxWidth);
-
-/* Either this routine, lefwLayerRoutingSpacingRange or                       */
-/* lefwLayerRoutingSpacingRange can be                                        */
-/* be called once after lefwLayerRoutingSpacing.                              */
-/* This is a 5.7 routine.                                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingSameNet (int  PGOnly);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingEndOfLine (double  eolWidth, double  eolWithin);
-
-/* This routine must be called only once after lefwLayerRoutingSpacingEndOfLi */
-/* This routine is optional                                                   */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingEOLParallel (double  parSpace, double  parWithin, int  twoEdges);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingNotchLength (double  minNLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingEndOfNotchWidth (double  eonWidth, double  minNSpacing, double  minNLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingWireExtension (double  wireExtension);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingResistance (const char*  resistance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingCapacitance (const char*  capacitance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingHeight (double  height);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingThickness (double  thickness);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingShrinkage (double  shrinkage);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingCapMultiplier (double  capMultiplier);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingEdgeCap (double  edgeCap);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingAntennaArea (double  antennaArea);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional                                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingAntennaLength (double  antennaLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This is a 5.5 syntax.                                                      */
-/* width is the maximum width.                                                */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMaxwidth (double  width);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This is a 5.5 syntax.                                                      */
-/* width is the maximum width.                                                */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinwidth (double  width);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional.                                                  */
-/* This is a 5.5 syntax.                                                      */
-/* Area is the minimum area size limit for metal that encloses an empty area. */
-/* Width is optional, it says the rule only applies when a donut is careted   */
-/* from a wire of width <= width.  The parameter width is required for the    */
-/* routine lefwLayerRoutineMinenclosedarea.  If width is optional, a "0"      */
-/* value is assigned for that index slot of the array.                        */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinenclosedarea (int  numMinenclosed, double*  area, double*  width);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinstep (double  distance);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This routine is equivalent to lefwLayerRoutingMinstep, except it also      */
-/* takes the options for type & Lengthsum.                                    */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinstepWithOptions (double  distance, const char*  rule, double  maxLength);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This routine is equivalent to lefwLayerRoutingMinstep, except it also      */
-/* takes the option for MaxEdges.                                             */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingMinstepMaxEdges (double  distance, double  maxEdges);
-
-/* This routine must be called only once after lefwStartLayerRouting.         */
-/* This routine is optional and can be called once.                           */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingProtrusion (double  width1, double  length, double  width2);
-
-/* This routine must be called only after lefwStartLayerRouting.              */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.5 syntax.                                                      */
-/* numLength has the size of the array length.                                */
-/* length is an array of length values.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingStartSpacingtableParallel (int  numLength, double*  length);
-
-/* This routine must be called only after                                     */
-/* lefwLayerRoutingStartSpacingtableParallel.                                 */
-/* This routine is required after lefwLayerRoutingStartSpacingtableParallel.  */
-/* This routine can be called multiple times.                                 */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingtableParallelWidth (double  width, int  numSpacing, double*  spacing);
-
-/* This routine must be called only after lefwStartLayerRouting.              */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingStartSpacingtableInfluence ();
-
-/* This routine must be called only after                                     */
-/* lefwLayerRoutingStartSpacingtableInfluence.                                */
-/* This routine is required after lefwLayerRoutingStartSpacingtableInfluence. */
-/* This routine can be called multiple times.                                 */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingInfluenceWidth (double  width, double  distance, double  spacing);
-
-/* This routine must be called only after lefwStartLayerRouting.              */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingStartSpacingtableTwoWidths ();
-
-/* This routine must be called only after                                     */
-/* lefwLayerRoutingStartSpacingtableInfluence.                                */
-/* This routine is required after lefwLayerRoutingStartSpacingtableTwoWidths. */
-/* This routine can be called multiple times.                                 */
-/* This is a 5.7 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutingSpacingtableTwoWidthsWidth (double  width, double  runLength, int  numSpacing, double*  spacing);
-
-/* This routine can be called after lefwLayerRoutingStartSpacingtableParallel */
-/* or lefwLayerRoutingStartSpacingtableInfluence.                             */
-/* It can only be called once.                                                */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerRoutineEndSpacingtable ();
-
-/* This routine must be called after the lefwStartLayer call (if any).        */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndLayerRouting (const char*  layerName);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called multiple times.                 */
-/* if the value for the variable value is not 0, one of the following         */
-/* routines have to be called: lefwLayerACFrequency,                          */
-/* lefwLayerACWidth, lefwLayerACCutarea, or                                   */
-/* lefwLayerACTableEntries                                                    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerACCurrentDensity (const char*  type, double  value);
-
-/* This routine must be called after lefwLayerACCurrentDensity.               */
-/* This routine is required and can be called only once after each            */
-/* lefwLayerACCurrentDensity.                                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerACFrequency (int  numFrequency, double*  frequency);
-
-/* This routine must be called after lefwLayerACCurrentDensity.               */
-/* This routine is optional and can be called only once after each            */
-/* lefwLayerACCurrentDensity.                                                 */
-/* This routine can only be called in Layer Routing                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerACWidth (int  numWidths, double*  widths);
-
-/* This routine must be called after lefwLayerACCurrentDensity.               */
-/* This routine is optional and can be called only once after each            */
-/* lefwLayerACCurrentDensity.                                                 */
-/* This routine can only be called in Layer                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerACCutarea (int  numCutareas, double*  cutareas);
-
-/* This routine must be called after lefwLayerACCurrentDensity.               */
-/* This routine is required and can be called only once after each            */
-/* lefwLayerACCurrentDensity.                                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerACTableEntries (int  numEntries, double*  entries);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called multiple times.                 */
-/* if the value for the variable value is not 0, one of the following         */
-/* routines have to be called: lefwLayerDCWidth, lefwLayerDCCutarea, or       */
-/* lefwLayerDCTableEntries                                                    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerDCCurrentDensity (const char*  type, double  value);
-
-/* This routine must be called after lefwLayerDCCurrentDensity.               */
-/* This routine is optional and can be called only once after each            */
-/* lefwLayerDCCurrentDensity.                                                 */
-/* This routine can only be called in Layer Routing                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerDCWidth (int  numWidths, double*  widths);
-
-/* This routine must be called after lefwLayerDCCurrentDensity.               */
-/* This routine is optional and can be called only once after each            */
-/* lefwLayerDCCurrentDensity.                                                 */
-/* This routine can only be called in Layer                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerDCCutarea (int  numCutareas, double*  cutareas);
-
-/* This routine must be called after lefwLayerDCCurrentDensity.               */
-/* This routine is required and can be called only once after each            */
-/* lefwLayerDCCurrentDensity.                                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerDCTableEntries (int  numEntries, double*  entries);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional.  The oxide value, can be either OXIDE1, OXIDE2,  */
-/* OXIDE3, or OXIDE4.  Each can only be called once within a layer.           */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaModel (const char*  oxide);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaDiffAreaRatioPwl can be called, but */
-/* not both                                                                   */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaDiffAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaDiffAreaRatio can be called, but    */
-/* not both                                                                   */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaDiffAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaCumDiffAreaRatioPwl can be called,  */
-/* but not both                                                               */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumDiffAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaCumDiffAreaRatio can be called, but */
-/* not both                                                                   */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumDiffAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* The option DIFFUSEONLY is a 5.4 syntax.                                    */
-/* If DIFFUSEONLY, lefwLayerRoutingAntennaLength is not allowed.              */
-/* This function is similar to lefwLayerRoutingAntennaArea                    */
-/* diffUseOnly has to be DIFFUSEONLY.                                         */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaAreaFactor (double  value, const char*  diffUseOnly);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING.            */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaSideAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING.            */
-/* Either this routine or lefwLayerAntennaDiffSideAreaRatioPwl can be         */
-/* called, but not both                                                       */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaDiffSideAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaDiffSideAreaRatio can be called,    */
-/* but not both                                                               */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaDiffSideAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING.            */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumSideAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING.            */
-/* Either this routine or lefwLayerAntennaCumDiffSideAreaRatioPwl can be      */
-/* called, but not both                                                       */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumDiffSideAreaRatio (double  value);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* Either this routine or lefwLayerAntennaCumDiffSideAreaRatio can be called, */
-/* but not both                                                               */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or lefwLayerRoutingAntennaLength is allowed, not both. */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumDiffSideAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING.            */
-/* The option DIFFUSEONLY is a 5.4 syntax.                                    */
-/* diffUseOnly has to be DIFFUSEONLY.                                         */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaSideAreaFactor (double  value, const char*  diffUseOnly);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.7 routine.                                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaCumRoutingPlusCut ();
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.7 routine.                                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaGatePlusDiff (double  plusDiffFactor);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.7 routine.                                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaAreaMinusDiff (double  minusDiffFactor);
-
-/* This routine must be called after lefwStartLayerRouting or lefwStartLayer. */
-/* This routine is optional and can be called only once within a layer        */
-/* after each lefwLayerAntennaModel function.                                 */
-/* This routine is valid only if the layer type is either ROUTING or CUT.     */
-/* This is a 5.7 routine.                                                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwLayerAntennaAreaDiffReducePwl (int  numPwls, double*  diffAreas, double*  metalDiffFactors);
-
-/* This routine must be called only once after lefwStartLayer.                */
-/* The option MINIMUMDENSITY is a 5.4 syntax.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMinimumDensity (double  minDensity);
-
-/* This routine must be called only once after lefwStartLayer.                */
-/* The option MAXIMUMDENSITY is a 5.4 syntax.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMaximumDensity (double  maxDensity);
-
-/* This routine must be called only once after lefwStartLayer.                */
-/* The option DENSITYCHECKWINDOW is a 5.4 syntax.                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwDensityCheckWindow (double  checkWindowLength, double  checkWindowWidth);
-
-/* This routine must be called only once after lefwStartLayer.                */
-/* The option DENSITYCHECKSTEP is a 5.4 syntax.                               */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwDensityCheckStep (double  checkStepValue);
-
-/* This routine must be called only once after lefwStartLayer.                */
-/* The option FILLACTIVESPACING is a 5.4 syntax.                              */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwFillActiveSpacing (double  fillToActiveSpacing);
-
-/* This routine must be called only once after all the layers.                */
-/* This routine is optional.                                                  */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if succesful.                                                    */
-EXTERN int lefwMaxviastack (int  value, const char*  bottomLayer, const char*  topLayer);
-
-/* This routine is called after lefwInit.                                     */
-/* This section of routines is optional.                                      */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-/* The routine starts propertydefinitions section.                            */
-EXTERN int lefwStartPropDef ();
-
-/* This routine must be called after lefwStartPropDef.                        */
-/* This routine can be called multiple times.                                 */
-/* It adds integer property definition to the statement.                      */
-/* Returns 0 if successful.                                                   */
-/* The objType can be LIBRARY or VIA or MACRO or PIN.                         */
-                                      /* NONDEFAULTRULE | MACRO | PIN         */
-EXTERN int lefwIntPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, int     propValue);
-
-/* This routine must be called after lefwStartPropDef.                        */
-/* This routine can be called multiple times.                                 */
-/* It adds real property definition to the statement.                         */
-/* Returns 0 if successful.                                                   */
-/* The objType can be LIBRARY or VIA or MACRO or PIN.                         */
-                                      /* NONDEFAULTRULE | MACRO | PIN         */
-EXTERN int lefwRealPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, double  propValue);
-
-/* This routine must be called after lefwStartPropDef.                        */
-/* This routine can be called multiple times.                                 */
-/* It adds string property definition to the statement.                       */
-/* Returns 0 if successful.                                                   */
-/* The objType can be LIBRARY or VIA or MACRO or PIN.                         */
-                                       /*  NONDEFAULTRULE | MACRO | PIN       */
-EXTERN int lefwStringPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, const char*  propValue);
-
-/* This routine must be called after the lefwStartPropDef call (if any).      */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndPropDef ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called only once.                                     */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the via section. All of the vias must follow.           */
-EXTERN int lefwStartVia (const char*  viaName, const char*  isDefault);
-
-/* This routine is optional, it call only be called after lefwStartVia.       */
-/* It can only be called once.                                                */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaTopofstackonly ();
-
-/* This routine is optional, it call only be called after lefwStartVia.       */
-/* It can only be called once.                                                */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaForeign (const char*  foreignName, double  xl, double  yl, int  orient);
-
-/* This routine is optional, it call only be called after lefwStartVia.       */
-/* It can only be called once.                                                */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwViaForeign, except orient is a char*       */
-EXTERN int lefwViaForeignStr (const char*  foreignName, double  xl, double  yl, const char*  orient);
-
-/* This routine is optional, it call only be called after lefwStartVia.       */
-/* Either this routine or lefwViaViarule can be called within a via.          */
-/* It can only be called once in a via.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaResistance (double  resistance);
-
-/* This routine must be called after lefwStartVia.                            */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaLayer (const char*  layerName);
-
-/* This routine can call only after lefwViaLayer.                             */
-/* Either this routine or lefwViaLayerPolygon can be called within a layer    */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* mask is 5.8 syntax                                                         */
-EXTERN int lefwViaLayerRect (double  x1l, double  y1l, double  x2l, double  y2l, int  mask);
-
-/* This routine can call only after lefwViaLayer.                             */
-/* Either this routine or lefwViaLayerRect can be called within a layer       */
-/* It can be called multiple times.                                           */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* mask is 5.8 syntax                                                         */
-EXTERN int lefwViaLayerPolygon (int  num_polys, double*  xl, double*  yl, int  mask);
-
-/* This routine can call only after lefwStartVia.                             */
-/* Either this routine or lefwViaResistance can be called within a via.       */
-/* It can only be called once in a via.                                       */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaViarule (const char*  viaRuleName, double  xCutSize, double  yCutSize, const char*  botMetalLayer, const char*  cutLayer, const char*  topMetalLayer, double  xCutSpacing, double  yCutSpacing, double  xBotEnc, double  yBotEnc, double  xTopEnc, double  yTopEnc);
-
-/* This routine can call only after lefwViaViarule.                           */
-/* It can only be called once.                                                */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaViaruleRowCol (int  numCutRows, int  numCutCols);
-
-/* This routine can call only after lefwViaViarule.                           */
-/* It can only be called once.                                                */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaViaruleOrigin (double  xOffset, double  yOffset);
-
-/* This routine can call only after lefwViaViarule.                           */
-/* It can only be called once.                                                */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaViaruleOffset (double  xBotOffset, double  yBotOffset, double  xTopOffset, double  yTopOffset);
-
-/* This routine can call only after lefwViaViarule.                           */
-/* It can only be called once.                                                */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwViaViarulePattern (const char*  cutPattern);
-
-/* This routine is called after lefwVia.                                      */
-/* This routine is optional, it adds string property to the statement.        */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwStringProperty (const char*  propName, const char*  propValue);
-
-/* This routine is called after lefwVia.                                      */
-/* This routine is optional, it adds real property to the statement.          */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwRealProperty (const char*  propName, double  propValue);
-
-/* This routine is called after lefwVia.                                      */
-/* This routine is optional, it adds int property to the statement.           */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwIntProperty (const char*  propName, int  propValue);
-
-/* This routine must be called after the lefwStartVia call (if any).          */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndVia (const char*  viaName);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called as a set with lefwViaRuleLayer, lefwViaRuleVia */
-/* and lefwEndViaRule                                                         */
-/* multiple times.                                                            */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the via rule section. The via rule data and its propert */
-/* must follow                                                                */
-EXTERN int lefwStartViaRule (const char*  viaRuleName);
-
-/* This routine is called after lefwStartViaRule.                             */
-/* This routine has to be called 2 times exact.                               */
-/* Returns 0 if successful.                                                   */
-/* The direction1 or direction2 can be HORIZONTAL or VERTICAL.                */
-EXTERN int lefwViaRuleLayer (const char*  layerName, const char*  direction, double  minWidth, double  maxWidth, double  overhang, double  metalOverhang);
-
-/* This routine is called after lefwViaRuleLayer is called twice.             */
-/* This routine is required in a viarule and can be called more than once.    */
-/* Returns 0 if successful.                                                   */
-/* The direction1 or direction2 can be HORIZONTAL or VERTICAL.                */
-EXTERN int lefwViaRuleVia (const char*  viaName);
-
-/* This routine must be called after the lefwStartViaRule call (if any).      */
-/* The routine can be called only once per lefwStartViaRule.                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndViaRule (const char*  viaRuleName);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called as a set with lefwViaRuleGenLayer,             */
-/* lefwViaRuleGenLayer3, and lefwEndViaRuleGen multiple times.                */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the via rule section. The via rule data and its propert */
-/* must follow                                                                */
-EXTERN int lefwStartViaRuleGen (const char*  viaRuleName);
-
-/* This routine is called after lefwSartViaRuleGen.                           */
-/* This routine is optional                                                   */
-/* Returns 0 if successful                                                    */
-EXTERN int lefwViaRuleGenDefault ();
-
-/* This routine is called after lefwStartViaRuleGen.                          */
-/* This routine has to be called 2 times exact.                               */
-/* Returns 0 if successful.                                                   */
-/* Either this routine or lefwViaRuleGenLayerEnclosure, not both.             */
-/* The direction1 or direction2 can be HORIZONTAL or VERTICAL.                */
-EXTERN int lefwViaRuleGenLayer (const char*  layerName, const char*  direction, double  minWidth, double  maxWidth, double  overhang, double  metalOverhang);
-
-/* This routine is called after lefwStartViaRuleGen.                          */
-/* This routine has to be called 2 times exact.                               */
-/* This is 5.5 syntax                                                         */
-/* Returns 0 if successful.                                                   */
-/* Either this routine or lefwViaRuleGenLayer, not both.                      */
-EXTERN int lefwViaRuleGenLayerEnclosure (const char*  layerName, double  overhang1, double  overhang2, double  minWidth, double  maxWidth);
-
-/* This routine is called after lefwViaRuleLayerGen is called twice.          */
-/* This routine is optional in a viarule generate and can be called once.     */
-/* Returns 0 if successful.                                                   */
-/* The direction1 or direction2 can be HORIZONTAL or VERTICAL.                */
-EXTERN int lefwViaRuleGenLayer3 (const char*  layerName, double  xl, double  yl, double  xh, double  yh, double  xSpacing, double  ySpacing, double  resistance);
-
-/* This routine must be called after the lefwStartViaRuleGen call (if any).   */
-/* The routine can be called only once per lefwStartViaRuleGen.               */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndViaRuleGen (const char*  viaRuleName);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called only once.                                     */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the nonDefaultRule section. The nonDefaultRule layers   */
-/* must follow                                                                */
-EXTERN int lefwStartNonDefaultRule (const char*  ruleName);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called after lefwStartNonDefaultRule                  */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleLayer (const char*  routingLayerName, double  width, double  minSpacing, double  wireExtension, double  resistance, double  capacitance, double  edgeCap);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine must be called after lefwStartNonDefaultRule                  */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleHardspacing ();
-
-/* This routine is called after lefwStartNonDefaultRule.                      */
-/* This routine must be called only once for each via section.                */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the nondefaultrule via section.                         */
-/* Call the following via functions for the rest of NONDEFAULTRULE VIA:       */
-/*   lefwViaTopofstackonly                                                    */
-/*   lefwViaForeign                                                           */
-/*   lefwViaForeignStr                                                        */
-/*   lefwViaResistance                                                        */
-/*   lefwViaLayer                                                             */
-/*   lefwViaLayerRect                                                         */
-/*   lefwNonDefaultRuleEndVia                                                 */
-EXTERN int lefwNonDefaultRuleStartVia (const char*  viaName, const char*  isDefault);
-
-/* This routine must be called after the lefwNonDefaultRuleStartVia call.     */
-/* The routine can be called only once per via section.                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleEndVia (const char*  viaName);
-
-/* This routine is called after lefwStartNonDefaultRule.                      */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleUseVia (const char*  viaName);
-
-/* This routine is called after lefwStartNonDefaultRule.                      */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleUseViaRule (const char*  viaRuleName);
-
-/* This routine is called after lefwStartNonDefaultRule.                      */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwNonDefaultRuleMinCuts (const char*  layerName, int  numCuts);
-
-/* This routine must be called after the lefwStartNonDefaultRule call (if any */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndNonDefaultRule (const char*  ruleName);
-
-/* This routine is called after lefwInit.                                     */
-/* This section of routines is optional.                                      */
-/* This routine can be called only once.                                      */
-/* Returns 0 if successful.                                                   */
-/* It starts the spacing section.                                             */
-EXTERN int lefwStartSpacing ();
-
-/* This routine must be called after lefwStartSpacing.                        */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The stack has to be STACK.                                                 */
-EXTERN int lefwSpacing (const char*  layerName1, const char*  layerName2, double  minSpace, const char*  stack);
-
-/* This routine must be called after the lefwStartSpacing call (if any).      */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndSpacing ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwUniversalNoiseMargin (double  high, double  low);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEdgeRateThreshold1 (double  num);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEdgeRateThreshold2 (double  num);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEdgeRateScaleFactor (double  num);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This routine starts the noisetable section.                                */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwStartNoiseTable (int  num);
-
-/* This routine is called after lefwStartNoiseTable or lefwStartCorrectTable. */
-/* This routine is optional and it can be called multiple times               */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEdgeRate (double  num);
-
-/* This routine is called after lefwEdgeRate.                                 */
-/* This routine is optional and it can be called only once inside lefwEdgeRat */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwOutputResistance (int  numResists, double*  resistance);
-
-/* This routine is called after lefwOutputResistance.                         */
-/* This routine is optional and it can be called multiple times inside        */
-/* lefwOutputResistance                                                       */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwVictims (int  length, int  numNoises, double*  noises);
-
-/* This routine must be called after the lefwStartNoiseTable call (if any).   */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEndNoiseTable ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This routine starts the correctTable section.                              */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwStartCorrectTable (int  num);
-
-/* This routine must be called after the lefwStartCorrectTable call (if any). */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEndCorrectTable ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMinFeature (double  x, double  y);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-/* extern int lefwDielectric (float dielectric);                              */
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-/* This routine starts the irdrop section.                                    */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwStartIrdrop ();
-
-/* This routine is must be called after lefwStartIrdrop.                      */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The currentsNvolts is a list of current and volts.                         */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwIrdropTable (const char*  tableName, const char*  currentsNvolts);
-
-/* This routine must be called after the lefwStartIrdrop call (if any).       */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEndIrdrop ();
-
-/* This routine is must be called after lefwInit.                             */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The classType can be PAD or CORE.                                          */
-/* The symmetry can be a list of X or Y or R90.                               */
-EXTERN int lefwSite (const char*  siteName, const char*  classType, const char*  symmetry, double  width, double  height);
-
-/* This routine is must be called after lefwSite.                             */
-/* It can be called multiple times.                                           */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwSiteRowPattern (const char*  siteName, int  orient);
-
-/* This routine is must be called after lefwSite.                             */
-/* It can be called multiple times.                                           */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwSiteRowPattern, except orient is a char*   */
-EXTERN int lefwSiteRowPatternStr (const char*  siteName, const char * orient);
-
-/* This routine must be called after the lefwSite call (if any).              */
-/* The routine can be called only once after lefwSite.                        */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndSite (const char*  siteName);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called multiple times.              */
-/* Returns 0 if successful.                                                   */
-/* This routine starts the array section.                                     */
-EXTERN int lefwStartArray (const char*  arrayName);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArrayCanplace, lefwArrayCannotoccupy,             */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwArraySite (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArrayCanplace, lefwArrayCannotoccupy,             */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwArraySite, except orient is a char*        */
-EXTERN int lefwArraySiteStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCannotoccupy,                 */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwArrayCanplace (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCannotoccupy,                 */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwArrayCanplace, except orient is a char*    */
-EXTERN int lefwArrayCanplaceStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCanplace,                     */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwArrayCannotoccupy (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCanplace,                     */
-/* lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.  */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwArrayTracks, except orient is a char*      */
-EXTERN int lefwArrayCannotoccupyStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCanplace, lefwArrayCannotoccu */
-/* or lefwStartArrayFloorplan must be called at least once.                   */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwArrayTracks (const char*  xy, double  start, int  numTracks, double  space, const char*  layers);
-
-/* This routine is called after lefwStartArray.                               */
-/* Either this routine, lefwArraySite, lefwArrayCanplace, lefwArrayCannotoccu */
-/* or lefwArrayTracks must be called at least once.                           */
-/* It can be call multiple times.                                             */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the array floorplan section                             */
-EXTERN int lefwStartArrayFloorplan (const char*  name);
-
-/* This routine must be called after lefwStartArrayFloorplan.                 */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The site can be CANPLACE or CANNOTOCCUPY                                   */
-EXTERN int lefwArrayFloorplan (const char*  site, const char*  name, double  origX, double  origY, int  orient, int  numX, int  numY, double  spaceX, double  spaceY);
-
-/* This routine must be called after lefwStartArrayFloorplan.                 */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The site can be CANPLACE or CANNOTOCCUPY                                   */
-/* This routine is the same as lefwArrayFloorplan, except orient is a char*   */
-EXTERN int lefwArrayFloorplanStr (const char*  site, const char*  name, double  origX, double  origY, const char * orient, int  numX, int  numY, double  spaceX, double  spaceY);
-
-/* This routine must be called after the lefwStartArrayFloorplan call (if any */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndArrayFloorplan (const char*  name);
-
-/* This routine is called after lefwStartArray.                               */
-/* This routine is optional.                                                  */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The xy can be X or Y.                                                      */
-EXTERN int lefwArrayGcellgrid (const char*  xy, double  startXY, int  colRows, double  spaceXY);
-
-/* This routine is called after lefwStartArray.                               */
-/* This section of routines is optional and can be call only once.            */
-/* Returns 0 if successful.                                                   */
-/* The routine starts the array defaultcap section                            */
-EXTERN int lefwStartArrayDefaultCap (int  size);
-
-/* This routine must be called after lefwStartArrayDefaultCap.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwArrayDefaultCap (double  numPins, double  cap);
-
-/* This routine must be called after the lefwStartArrayDefaultCap call (if an */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndArrayDefaultCap ();
-
-/* This routine must be called after the lefwStartArray call (if any).        */
-/* The routine can be called only once per section.                           */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndArray (const char*  arrayName);
-
-/* This routine is must be called after lefwInit.                             */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-/* This routine starts the macro section.                                     */
-EXTERN int lefwStartMacro (const char*  macroName);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-/* The value1 can be COVER, RING, BLOCK, PAD, CORE, or ENCAP.                 */
-/* The value2 can be BUMP if value1 is COVER,                                 */
-/* or BLACKBOX, or SOFT if value1 is BLOCK,                                   */
-/* or INPUT, OUTPUT, INOUT, POWER, or SPACER if value1 is PAD,                */
-/* or FEEDTHRU, TIEHIGH, TIELOW, SPACER, ANTENNACELL, or WELLTAP              */
-/* if value1 is CORE,                                                         */
-/* or PRE, POST, TOPLEFT, TOPRIGHT, BOOTOMLEFT, or BOTTOMRIGHT if value1 is   */
-/* ENCAP.                                                                     */
-EXTERN int lefwMacroClass (const char*  value1, const char*  value2);
-
-/* This routine is must be called after lefwInit.                             */
-/* This routine can be called multiple times.                                 */
-/* Returns 0 if successful.                                                   */
-/* This is a 5.8 syntax.                                                      */
-EXTERN int lefwMacroFixedMask ();
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-/* The value1 can be USER, GENERATE, or BLOCK.                                */
-EXTERN int lefwMacroSource (const char*  value1);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called multiple times per macro sectio */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroForeign (const char*  name, double  xl, double  yl, int  orient);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called multiple times per macro sectio */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwMacroForeign, except orient is a char*     */
-EXTERN int lefwMacroForeignStr (const char*  name, double  xl, double  yl, const char * orient);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroOrigin (double  xl, double  yl);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroEEQ (const char*  macroName);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroLEQ (const char*  macroName);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine must be called only once per macro section.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroSize (double  width, double  height);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-/* The symmetry can be a list of X, Y, or R90                                 */
-EXTERN int lefwMacroSymmetry (const char*  symmetry);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine must be called only once per macro section.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroSite (const char*  siteName);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine must be called at least once per macro section.               */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroSitePattern (const char*  name, double  origX, double  origY, int  orient, int  numX, int  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine must be called at least once per macro section.               */
-/* Returns 0 if successful.                                                   */
-/* This routine is the same as lefwMacroSitePattern, except orient is a char* */
-EXTERN int lefwMacroSitePatternStr (const char*  name, double  origX, double  origY, const char * orient, int  numX, int  numY, double  spaceX, double  spaceY);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPower (double  power);
-
-/* This routine must be called after the lefwStartMacro call (if any).        */
-/* The routine can be called only once per macro section.                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndMacro (const char*  macroName);
-
-/* This routine is called after lefwStartMacro.                               */
-/* This routine is optional and can be called only once per macro section.    */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwStartMacroDensity (const char*  layerName);
-
-/* This routine is called after lefwStartMacroDensity.                        */
-/* This routine can be called multiple times.                                 */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroDensityLayerRect (double  x1, double  y1, double  x2, double  y2, double  densityValue);
-
-/* This routine must be called after the lefwStartMacroPin call (if any).     */
-/* The routine can be called only once per macro section.                     */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndMacroDensity ();
-
-/* This routine must be called after the lefwStartMacro call (if any).        */
-/* The routine can be called multiple time.                                   */
-/* Returns 0 if successful.                                                   */
-/* It starts the macro pin section within macro.                              */
-EXTERN int lefwStartMacroPin (const char*  pinName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinTaperRule (const char*  ruleName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinForeign (const char*  name, double  xl, double  yl, int  orient);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* Ths routine is the same as lefwMacroPinForeign, except orient is a char*   */
-EXTERN int lefwMacroPinForeignStr (const char*  name, double  xl, double  yl, const char*  orient);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinLEQ (const char*  pinName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* The direction can be INPUT, OUTPUT, OUTPUT TRISTATE, INOUT, or FEEDTHRU.   */
-EXTERN int lefwMacroPinDirection (const char*  direction);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* The use can be SIGNAL, ANALOG, POWER, GROUND, or CLOCK.                    */
-EXTERN int lefwMacroPinUse (const char*  use);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* The namce can be ABUTMENT, RING, or FEEDTHRU.                              */
-EXTERN int lefwMacroPinShape (const char*  name);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinMustjoin (const char*  name);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinNetExpr (const char*  name);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinSupplySensitivity (const char*  pinName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.6 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinGroundSensitivity (const char*  pinName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinOutputnoisemargin (int  high, int  low);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinOutputresistance (int  high, int  low);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinInputnoisemargin (int  high, int  low);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinPower (double  power);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinLeakage (double  leakage);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinCapacitance (double  capacitance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinResistance (double  resistance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinPulldownres (double  resistance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinTieoffr (double  resistance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinVHI (double  voltage);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinVLO (double  voltage);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinRisevoltagethreshold (double  voltage);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinFallvoltagethreshold (double  voltage);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinRisethresh (double  capacitance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinFallthresh (double  capacitance);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinRisesatcur (double  current);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinFallsatcur (double  current);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* The name can be ACTIVE or RESISTIVE.                                       */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinCurrentsource (const char*  name);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroPinIV_Tables (const char*  lowName, const char*  highName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* Either this routine or 5.4 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennasize (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* Either this routine or 5.4 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaMetalArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* Either this routine or 5.4 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaMetalLength (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaPartialMetalArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaPartialMetalSideArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaPartialCutArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaDiffArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* The oxide value, can be either OXIDE1, OXIDE2, OXIDE3, or OXIDE4.          */
-/* This routine is optional. Each oxide value can be called only once         */
-/* after the lefwStartMacroPin.                                               */
-/* This is a 5.5 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaModel (const char*  oxide);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called multiple times.                 */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaGateArea (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaMaxAreaCar (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaMaxSideAreaCar (double  value, const char*  layerName);
-
-/* This routine is called after lefwStartMacroPin.                            */
-/* This routine is optional and can be called only once.                      */
-/* This is a 5.4 syntax.                                                      */
-/* Either this routine or 5.3 Antenna syntax, cannot be both                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinAntennaMaxCutCar (double  value, const char*  layerName);
-
-/* This routine must be called after the lefwStartMacroPin call (if any).     */
-/* The routine can be called only once per macro section.                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndMacroPin (const char*  pinName);
-
-/* This routine must be called after the lefwStartMacroPin call (if any).     */
-/* The routine can be called multiple time.                                   */
-/* Returns 0 if successful.                                                   */
-/* It starts the macro pin port section within macro pin.                     */
-/* The classType can be NONE or CORE.                                         */
-EXTERN int lefwStartMacroPinPort (const char*  classType);
-
-/* This routine is called after lefwStartMacroPinPort.                        */
-/* Either this routine or lefwMacroPinPortDesignRuleWidth must be called,     */
-/* but can't be both.                                                         */
-/* Spacing is optional for minimum spacing.                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortLayer (const char*  layerName, double  spacing);
-
-/* This routine is called after lefwStartMacroPinPort.                        */
-/* Either this routine or lefwMacroPinPortLayer must be called, but can't     */
-/* be both.                                                                   */
-/* width is optional for DesignRuleWidth                                      */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortDesignRuleWidth (const char*  layerName, double  width);
-
-/* This routine is called after lefwMacroPinPortLayer.                        */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortLayerWidth (double  width);
-
-/* This routine is called after lefwStartMacroPinPortLayer.                   */
-/* Either this routine, lefwStartMacroPinPortLayerRect, or                    */
-/* lefwStartMacroPinPortLayerPolygon must be called.                          */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortLayerPath (int  num_paths, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int     mask);
-
-/* This routine is called after lefwStartMacroPinPortLayer.                   */
-/* Either this routine, lefwStartMacroPinPortLayerPath, or                    */
-/* lefwStartMacroPinPortLayerPolygon must be called.                          */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortLayerRect (double  xl1, double  yl1, double  xl2, double  yl2, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine is called after lefwStartMacroPinPortLayer.                   */
-/* Either this routine, lefwStartMacroPinPortLayerPath, or                    */
-/* lefwStartMacroPinPortLayerRect must be called.                             */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortLayerPolygon (int  num_polys, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine is called after lefwStartMacroPinPort.                        */
-/* Either this routine or lefwStartMacroPinPortLayer must be called.          */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroPinPortVia (double  xl, double  yl, const char*  viaName, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine must be called after the lefwStartMacroPinPort call (if any). */
-/* The routine can be called only once per macro section.                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndMacroPinPort ();
-
-/* This routine is called after the lefwStartMacro call (if any).             */
-/* The routine is optional and can be called multiple times.                  */
-/* Returns 0 if successful.                                                   */
-/* It starts the macro obs section within macro.                              */
-EXTERN int lefwStartMacroObs ();
-
-/* This routine is called after lefwStartMacroObs.                            */
-/* Either this routine, lefwMacroObsDesignRuleWidth, lefwMacroObsVia or       */
-/* lefwMacroExceptPGNet must be called.                                       */
-/* Spacing is optional for minimum spacing.                                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsLayer (const char*  layerName, double  spacing);
-
-/* This routine is called after lefwStartMacroObs.                            */
-/* Either this routine, lefwMacroObsLayer, lefwMacroObsVia or                 */
-/* lefwMacroExceptPGNet must be called.                                       */
-/* Spacing is optional for minimum spacing.                                   */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsDesignRuleWidth (const char*  layerName, double  width);
-
-/* This routine is called after lefwStartMacroObs.                            */
-/* Either this routine, lefwMacroObsLayer, lefwMacroObsVia or                 */
-/* lefwMacroObsDesignRuleWidth must be called.                                */
-/* Spacing is optional for minimum spacing.                                   */
-/* This is a 5.4 syntax.                                                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroExceptPGNet (const char*  layerName);
-
-/* This routine is called after lefwStartMacroObs.                            */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsLayerWidth (double  width);
-
-/* This routine is called after lefwStartMacroObsLayer.                       */
-/* Either this routine, lefwMacroObsLayerRect, or                             */
-/* lefwStartMacroObsLayerPolygon must be called.                              */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsLayerPath (int  num_paths, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine is called after lefwStartMacroObsLayer.                       */
-/* Either this routine, lefwMacroObsLayerPath, or                             */
-/* lefwStartMacroObsLayerPolygon must be called.                              */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsLayerRect (double  xl1, double  yl1, double  xl2, double  yl2, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine is called after lefwStartMacroObsLayer.                       */
-/* Either this routine, lefwMacroObsLayerPath, or                             */
-/* lefwStartMacroObsLayerPath must be called.                                 */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsLayerPolygon (int  num_polys, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine is called after lefwStartMacroObs.                            */
-/* Either this routine or lefwMacroObsLayer|lefwMacroObsDesignRuleWidth       */
-/* must be called.                                                            */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwMacroObsVia (double  xl, double  yl, const char*  viaName, int  numX, int  numY, double  spaceX, double  spaceY, int  mask);
-
-/* This routine must be called after the lefwStartMacroObs call (if any).     */
-/* The routine can be called only once per macro section.                     */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndMacroObs ();
-
-/* This routine is called after the lefwStartMacro call (if any).             */
-/* The routine is optional and can be called only once.                       */
-/* Returns 0 if successful.                                                   */
-/* It starts the macro timing section within macro.                           */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwStartMacroTiming ();
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This routine is for {FROMPIN pinName...; [TOPIN pinName...;] | FROMPIN     */
-/* pinName...;}                                                               */
-/* This routince can be called multiple times.                                */
-/* The num_frPinNames contains the number of object in the array fromPins.    */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingPin (const char*  fromPin, const char*  toPin);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The riseFall can be RISE or FALL.                                          */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingIntrinsic (const char*  riseFall, double  min, double  max, double  slewT1, double  slewT1Min, double  slewT1Max, double  slewT2, double  slewT2Min, double  slewT2Max, double  slewT3, double  varMin, double  varMax);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingRisers (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingFallrs (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingRisecs (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingFallcs (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingRisesatt1 (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingFallsatt1 (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingRiset0 (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingFallt0 (double  min, double  max);
-
-/* This routine must be called after the lefwStartMacroTiming.                */
-/* It can be called multiple times.                                           */
-/* Returns 0 if successful.                                                   */
-/* The unateness can be INVERT, NONINVERT or NONUNATE.                        */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwMacroTimingUnateness (const char*  unateness);
-
-/* This routine must be called after the lefwStartMacroTiming call (if any).  */
-/* The routine can be called only once.                                       */
-/* Returns 0 if successful.                                                   */
-/* This api is obsolete in 5.4.                                               */
-EXTERN int lefwEndMacroTiming ();
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-                                           /* OUTPUTPINANTENNASIZE |          */
-                                           /* INOUTPINANTENNASIZE             */
-EXTERN int lefwAntenna (const char*  type, double  value);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwStartBeginext (const char*  name);
-
-/* This routine is called after lefwBeginext.                                 */
-/* This routine is optional, it can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwBeginextCreator (const char*  creatorName);
-
-/* This routine is called after lefwBeginext.                                 */
-/* This routine is optional, it can be called only once.                      */
-/* It gets the current system time and date.                                  */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwBeginextDate ();
-
-/* This routine is called after lefwBeginext.                                 */
-/* This routine is optional, it can be called only once.                      */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwBeginextRevision (int  vers1, int  vers2);
-
-/* This routine is called after lefwBeginext.                                 */
-/* This routine is optional, it can be called many times.                     */
-/* It allows user to customize their own syntax.                              */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwBeginextSyntax (const char*  title, const char*  string);
-
-/* This routine is called after lefwInit.                                     */
-/* This routine is optional and it can be called only once.                   */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEndBeginext ();
-
-/* General routines that can be called anytime after the Init is called.      */
-EXTERN int lefwCurrentLineNumber ();
-
-/* This routine must call last, it ends the Lef library.                      */
-/* It must be called only once.                                               */
-/* Returns 0 if successful.                                                   */
-EXTERN int lefwEnd ();
-
-/* This routine will print the error message.                                 */
-EXTERN void lefwPrintError (int  status);
-
-/* This routine will allow user to write their own comemnt.  It will          */
-/* automactically add a # infront of the line.                                */
-EXTERN void lefwAddComment (const char*  comment);
-
-/* This routine will indent 3 blank spaces                                    */
-EXTERN void lefwAddIndent ();
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriterCalls.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriterCalls.h
deleted file mode 100644
index b6dc2d4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/lefwWriterCalls.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               */
-/* ************************************************************************** */
-/* ************************************************************************** */
-/* Copyright 2012 - 2013, Cadence Design Systems                              */
-/*                                                                            */
-/* This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             */
-/* Distribution,  Product Version 5.8.                                        */
-/*                                                                            */
-/* 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                                 */
-/*                                                                            */
-/*        http://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.                          */
-/*                                                                            */
-/* For updates, support, or to become part of the LEF/DEF Community,          */
-/* check www.openeda.org for details.                                         */
-/*                                                                            */
-/*  $Author: dell $                                                                  */
-/*  $Revision: #1 $                                                                */
-/*  $Date: 2017/06/06 $                                                                    */
-/*  $State:  $                                                                */
-/* ************************************************************************** */
-/* ************************************************************************** */
-
-
-#ifndef CLEFWWRITERCALLS_H
-#define CLEFWWRITERCALLS_H
-
-#include <stdio.h>
-#include "lefiTypedefs.h"
-
-/*
- * The main writer function.
- * The file should already be opened.  This requirement allows
- * the writer to be used with stdin or a pipe.  The file name
- * is only used for error messages.  The includeSearchPath is
- * a colon-delimited list of directories in which to find
- * include files.
- */
-EXTERN int lefwWrite (FILE * file, const char * fileName, lefiUserData  userData);
-
-/*
- * Set all of the callbacks that have not yet been set to a function
- * that will add up how many times a given lef data type was ignored
- * (ie no callback was done).  The statistics can later be printed out.
- */
-EXTERN void lefwSetRegisterUnusedCallbacks ();
-EXTERN void lefwPrintUnusedCallbacks (FILE*  f);
-
-/*
- * Set/get the client-provided user data.  lefi doesn't look at
- * this data at all, it simply passes the opaque lefiUserData pointer
- * back to the application with each callback.  The client can
- * change the data at any time, and it will take effect on the
- * next callback.  The lefi writer and writer maintain separate
- * user data pointers.
- */
-EXTERN void lefwSetUserData (lefiUserData  p0);
-EXTERN lefiUserData lefwGetUserData ();
-
-/*
- * An enum describing all of the types of writer callbacks.
- */
-typedef enum {
-  lefwUnspecifiedCbkType = 0,
-  lefwVersionCbkType = 1,
-  lefwCaseSensitiveCbkType = 2,
-  lefwNoWireExtensionCbkType = 3,
-  lefwBusBitCharsCbkType = 4,
-  lefwDividerCharCbkType = 5,
-  lefwManufacturingGridCbkType = 6,
-  lefwUseMinSpacingCbkType = 7,
-  lefwClearanceMeasureCbkType = 8,
-  lefwUnitsCbkType = 9,
-  lefwAntennaInputGateAreaCbkType = 10,
-  lefwAntennaInOutDiffAreaCbkType = 11,
-  lefwAntennaOutputDiffAreaCbkType = 12,
-  lefwPropDefCbkType = 13,
-  lefwLayerCbkType = 14,
-  lefwViaCbkType = 15,
-  lefwViaRuleCbkType = 16,
-  lefwNonDefaultCbkType = 17,
-  lefwCrossTalkCbkType = 18,
-  lefwNoiseTableCbkType = 19,
-  lefwCorrectionTableCbkType = 20,
-  lefwSpacingCbkType = 21,
-  lefwMinFeatureCbkType = 22,
-  lefwDielectricCbkType = 23,
-  lefwIRDropCbkType = 24,
-  lefwSiteCbkType = 25,
-  lefwArrayCbkType = 26,
-  lefwMacroCbkType = 27,
-  lefwAntennaCbkType = 28,
-  lefwExtCbkType = 29,
-  lefwEndLibCbkType = 30
-
-  /* NEW CALLBACKS - each callback has its own type.  For each callback
-   * that you add, you must add an item to this enum. */
-
-} lefwCallbackType_e;
-
-/* Declarations of function signatures for each type of callback.
- * These declarations are type-safe when compiling with ANSI C
- * or C++; you will only be able to register a function pointer
- * with the correct signature for a given type of callback.
- *
- * Each callback function is expected to return 0 if successful.
- * A non-zero return code will cause the writer to abort.
- *
- * The lefwDesignStart and lefwDesignEnd callback is only called once.
- * Other callbacks may be called multiple times, each time with a different
- * set of data.
- *
- * For each callback, the Lef API will make the callback to the
- * function supplied by the client, which should either make a copy
- * of the Lef object, or store the data in the client's own data structures.
- * The Lef API will delete or reuse each object after making the callback,
- * so the client should not keep a pointer to it.
- *
- * All callbacks pass the user data pointer provided in lefwRead()
- * or lefwSetUserData() back to the client; this can be used by the
- * client to obtain access to the rest of the client's data structures.
- *
- * The user data pointer is obtained using lefwGetUserData() immediately
- * prior to making each callback, so the client is free to change the
- * user data on the fly if necessary.
- *
- * Callbacks with the same signature are passed a callback type
- * parameter, which allows an application to write a single callback
- * function, register that function for multiple callbacks, then
- * switch based on the callback type to handle the appropriate type of
- * data.
- */
-
-/* A declaration of the signature of all callbacks that return nothing.       */
-typedef int (*lefwVoidCbkFnType) ( lefwCallbackType_e, lefiUserData );
-
- /* NEW CALLBACK - If your callback returns a pointer to a new class then
-  * you must add a type function here. */
-
-/* Functions to call to register a callback function.
- */
-EXTERN void lefwSetVersionCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetCaseSensitiveCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetNoWireExtensionCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetBusBitCharsCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetDividerCharCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetManufacturingGridCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetUseMinSpacingCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetClearanceMeasureCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetUnitsCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwAntennaInputGateAreaCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwAntennaInOutDiffAreaCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwAntennaOutputDiffAreaCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetPropDefCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetLayerCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetViaCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetViaRuleCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetNonDefaultCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetCrossTalkCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetNoiseTableCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetCorrectionTableCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetSpacingCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetMinFeatureCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetDielectricCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetIRDropCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetSiteCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetArrayCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetMacroCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetAntennaCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetExtCbk (lefwVoidCbkFnType p0);
-EXTERN void lefwSetEndLibCbk (lefwVoidCbkFnType p0);
-
-/* NEW CALLBACK - each callback must have a function to allow the user
- * to set it.  Add the function here. */
-
-/*
- * Set all of the callbacks that have not yet been set to the following
- * function.  This is especially useful if you want to check to see
- * if you forgot anything.
- */
-EXTERN void lefwSetUnusedCallbacks (lefwVoidCbkFnType  func);
-
-/* Routine to set the message logging routine for errors                      */
-typedef void (*LEFI_LOG_FUNCTION)(const char*);
-EXTERN void lefwSetLogFunction (LEFI_LOG_FUNCTION  p0);
-
-/* Routine to set the message logging routine for warnings                    */
-typedef void (*LEFI_WARNING_LOG_FUNCTION)(const char*);
-EXTERN void lefwSetWarningLogFunction (LEFI_WARNING_LOG_FUNCTION  p0);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiArray.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiArray.cpp
deleted file mode 100644
index 5f012ea..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiArray.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiArray.h"
-#include "lefiArray.hpp"
-
-// Wrappers definitions.
-int lefiArrayFloorPlan_numPatterns (const ::lefiArrayFloorPlan* obj) {
-    return ((LefDefParser::lefiArrayFloorPlan*)obj)->numPatterns();
-}
-
-const ::lefiSitePattern* lefiArrayFloorPlan_pattern (const ::lefiArrayFloorPlan* obj, int  index) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiArrayFloorPlan*)obj)->pattern(index);
-}
-
-char* lefiArrayFloorPlan_typ (const ::lefiArrayFloorPlan* obj, int  index) {
-    return ((LefDefParser::lefiArrayFloorPlan*)obj)->typ(index);
-}
-
-const char* lefiArrayFloorPlan_name (const ::lefiArrayFloorPlan* obj) {
-    return ((const LefDefParser::lefiArrayFloorPlan*)obj)->name();
-}
-
-int lefiArray_numSitePattern (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numSitePattern();
-}
-
-int lefiArray_numCanPlace (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numCanPlace();
-}
-
-int lefiArray_numCannotOccupy (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numCannotOccupy();
-}
-
-int lefiArray_numTrack (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numTrack();
-}
-
-int lefiArray_numGcell (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numGcell();
-}
-
-int lefiArray_hasDefaultCap (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->hasDefaultCap();
-}
-
-const char* lefiArray_name (const ::lefiArray* obj) {
-    return ((const LefDefParser::lefiArray*)obj)->name();
-}
-
-const ::lefiSitePattern* lefiArray_sitePattern (const ::lefiArray* obj, int  index) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiArray*)obj)->sitePattern(index);
-}
-
-const ::lefiSitePattern* lefiArray_canPlace (const ::lefiArray* obj, int  index) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiArray*)obj)->canPlace(index);
-}
-
-const ::lefiSitePattern* lefiArray_cannotOccupy (const ::lefiArray* obj, int  index) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiArray*)obj)->cannotOccupy(index);
-}
-
-const ::lefiTrackPattern* lefiArray_track (const ::lefiArray* obj, int  index) {
-    return (const ::lefiTrackPattern*) ((LefDefParser::lefiArray*)obj)->track(index);
-}
-
-const ::lefiGcellPattern* lefiArray_gcell (const ::lefiArray* obj, int  index) {
-    return (const ::lefiGcellPattern*) ((LefDefParser::lefiArray*)obj)->gcell(index);
-}
-
-int lefiArray_tableSize (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->tableSize();
-}
-
-int lefiArray_numDefaultCaps (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numDefaultCaps();
-}
-
-int lefiArray_defaultCapMinPins (const ::lefiArray* obj, int  index) {
-    return ((LefDefParser::lefiArray*)obj)->defaultCapMinPins(index);
-}
-
-double lefiArray_defaultCap (const ::lefiArray* obj, int  index) {
-    return ((LefDefParser::lefiArray*)obj)->defaultCap(index);
-}
-
-int lefiArray_numFloorPlans (const ::lefiArray* obj) {
-    return ((LefDefParser::lefiArray*)obj)->numFloorPlans();
-}
-
-const char* lefiArray_floorPlanName (const ::lefiArray* obj, int  index) {
-    return ((const LefDefParser::lefiArray*)obj)->floorPlanName(index);
-}
-
-int lefiArray_numSites (const ::lefiArray* obj, int  index) {
-    return ((LefDefParser::lefiArray*)obj)->numSites(index);
-}
-
-const char* lefiArray_siteType (const ::lefiArray* obj, int  floorIndex, int  siteIndex) {
-    return ((const LefDefParser::lefiArray*)obj)->siteType(floorIndex, siteIndex);
-}
-
-const ::lefiSitePattern* lefiArray_site (const ::lefiArray* obj, int  floorIndex, int  siteIndex) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiArray*)obj)->site(floorIndex, siteIndex);
-}
-
-void lefiArray_print (const ::lefiArray* obj, FILE*  f) {
-    ((LefDefParser::lefiArray*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiCrossTalk.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiCrossTalk.cpp
deleted file mode 100644
index e0f3bbe..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiCrossTalk.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiCrossTalk.h"
-#include "lefiCrossTalk.hpp"
-
-// Wrappers definitions.
-double lefiNoiseVictim_length (const ::lefiNoiseVictim* obj) {
-    return ((LefDefParser::lefiNoiseVictim*)obj)->length();
-}
-
-int lefiNoiseVictim_numNoises (const ::lefiNoiseVictim* obj) {
-    return ((LefDefParser::lefiNoiseVictim*)obj)->numNoises();
-}
-
-double lefiNoiseVictim_noise (const ::lefiNoiseVictim* obj, int  index) {
-    return ((LefDefParser::lefiNoiseVictim*)obj)->noise(index);
-}
-
-int lefiNoiseResistance_numNums (const ::lefiNoiseResistance* obj) {
-    return ((LefDefParser::lefiNoiseResistance*)obj)->numNums();
-}
-
-double lefiNoiseResistance_num (const ::lefiNoiseResistance* obj, int  index) {
-    return ((LefDefParser::lefiNoiseResistance*)obj)->num(index);
-}
-
-int lefiNoiseResistance_numVictims (const ::lefiNoiseResistance* obj) {
-    return ((LefDefParser::lefiNoiseResistance*)obj)->numVictims();
-}
-
-const ::lefiNoiseVictim* lefiNoiseResistance_victim (const ::lefiNoiseResistance* obj, int  index) {
-    return (const ::lefiNoiseVictim*) ((LefDefParser::lefiNoiseResistance*)obj)->victim(index);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiDebug.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiDebug.cpp
deleted file mode 100644
index 7db3d82..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiDebug.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiDebug.h"
-#include "lefiDebug.hpp"
-
-// Wrappers definitions.
-void lefiSetDebug (int  num, int  value) {
-    LefDefParser::lefiSetDebug(num, value);
-}
-
-int lefiDebug (int  num) {
-    return LefDefParser::lefiDebug(num);
-}
-
-void lefiError (int  check, int  msgNum, const char*  msg) {
-    LefDefParser::lefiError(check, msgNum, msg);
-}
-
-const char* CASE (const char * x) {
-    return LefDefParser::CASE(x);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiEncryptInt.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiEncryptInt.cpp
deleted file mode 100644
index 3cff9d0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiEncryptInt.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiEncryptInt.h"
-#include "lefiEncryptInt.hpp"
-
-// Wrappers definitions.
-void lefrEnableReadEncrypted () {
-    LefDefParser::lefrEnableReadEncrypted();
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiLayer.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiLayer.cpp
deleted file mode 100644
index d8e7eea..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiLayer.cpp
+++ /dev/null
@@ -1,1215 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State: xxx $
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiLayer.h"
-#include "lefiLayer.hpp"
-
-// Wrappers definitions.
-int lefiAntennaPWL_numPWL (const ::lefiAntennaPWL* obj) {
-    return ((LefDefParser::lefiAntennaPWL*)obj)->numPWL();
-}
-
-char* lefiLayerDensity_type (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->type();
-}
-
-int lefiLayerDensity_hasOneEntry (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->hasOneEntry();
-}
-
-double lefiLayerDensity_oneEntry (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->oneEntry();
-}
-
-int lefiLayerDensity_numFrequency (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->numFrequency();
-}
-
-double lefiLayerDensity_frequency (const ::lefiLayerDensity* obj, int  index) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->frequency(index);
-}
-
-int lefiLayerDensity_numWidths (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->numWidths();
-}
-
-double lefiLayerDensity_width (const ::lefiLayerDensity* obj, int  index) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->width(index);
-}
-
-int lefiLayerDensity_numTableEntries (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->numTableEntries();
-}
-
-double lefiLayerDensity_tableEntry (const ::lefiLayerDensity* obj, int  index) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->tableEntry(index);
-}
-
-int lefiLayerDensity_numCutareas (const ::lefiLayerDensity* obj) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->numCutareas();
-}
-
-double lefiLayerDensity_cutArea (const ::lefiLayerDensity* obj, int  index) {
-    return ((LefDefParser::lefiLayerDensity*)obj)->cutArea(index);
-}
-
-int lefiParallel_numLength (const ::lefiParallel* obj) {
-    return ((LefDefParser::lefiParallel*)obj)->numLength();
-}
-
-int lefiParallel_numWidth (const ::lefiParallel* obj) {
-    return ((LefDefParser::lefiParallel*)obj)->numWidth();
-}
-
-double lefiParallel_length (const ::lefiParallel* obj, int  iLength) {
-    return ((LefDefParser::lefiParallel*)obj)->length(iLength);
-}
-
-double lefiParallel_width (const ::lefiParallel* obj, int  iWidth) {
-    return ((LefDefParser::lefiParallel*)obj)->width(iWidth);
-}
-
-double lefiParallel_widthSpacing (const ::lefiParallel* obj, int  iWidth, int  iWidthSpacing) {
-    return ((LefDefParser::lefiParallel*)obj)->widthSpacing(iWidth, iWidthSpacing);
-}
-
-int lefiInfluence_numInfluenceEntry (const ::lefiInfluence* obj) {
-    return ((LefDefParser::lefiInfluence*)obj)->numInfluenceEntry();
-}
-
-double lefiInfluence_width (const ::lefiInfluence* obj, int  index) {
-    return ((LefDefParser::lefiInfluence*)obj)->width(index);
-}
-
-double lefiInfluence_distance (const ::lefiInfluence* obj, int  index) {
-    return ((LefDefParser::lefiInfluence*)obj)->distance(index);
-}
-
-double lefiInfluence_spacing (const ::lefiInfluence* obj, int  index) {
-    return ((LefDefParser::lefiInfluence*)obj)->spacing(index);
-}
-
-int lefiTwoWidths_numWidth (const ::lefiTwoWidths* obj) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->numWidth();
-}
-
-double lefiTwoWidths_width (const ::lefiTwoWidths* obj, int  iWidth) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->width(iWidth);
-}
-
-int lefiTwoWidths_hasWidthPRL (const ::lefiTwoWidths* obj, int  iWidth) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->hasWidthPRL(iWidth);
-}
-
-double lefiTwoWidths_widthPRL (const ::lefiTwoWidths* obj, int  iWidth) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->widthPRL(iWidth);
-}
-
-int lefiTwoWidths_numWidthSpacing (const ::lefiTwoWidths* obj, int  iWidth) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->numWidthSpacing(iWidth);
-}
-
-double lefiTwoWidths_widthSpacing (const ::lefiTwoWidths* obj, int  iWidth, int  iWidthSpacing) {
-    return ((LefDefParser::lefiTwoWidths*)obj)->widthSpacing(iWidth, iWidthSpacing);
-}
-
-int lefiSpacingTable_isInfluence (const ::lefiSpacingTable* obj) {
-    return ((LefDefParser::lefiSpacingTable*)obj)->isInfluence();
-}
-
-const ::lefiInfluence* lefiSpacingTable_influence (const ::lefiSpacingTable* obj) {
-    return (const ::lefiInfluence*) ((LefDefParser::lefiSpacingTable*)obj)->influence();
-}
-
-int lefiSpacingTable_isParallel (const ::lefiSpacingTable* obj) {
-    return ((LefDefParser::lefiSpacingTable*)obj)->isParallel();
-}
-
-const ::lefiParallel* lefiSpacingTable_parallel (const ::lefiSpacingTable* obj) {
-    return (const ::lefiParallel*) ((LefDefParser::lefiSpacingTable*)obj)->parallel();
-}
-
-const ::lefiTwoWidths* lefiSpacingTable_twoWidths (const ::lefiSpacingTable* obj) {
-    return (const ::lefiTwoWidths*) ((LefDefParser::lefiSpacingTable*)obj)->twoWidths();
-}
-
-int lefiOrthogonal_numOrthogonal (const ::lefiOrthogonal* obj) {
-    return ((LefDefParser::lefiOrthogonal*)obj)->numOrthogonal();
-}
-
-double lefiOrthogonal_cutWithin (const ::lefiOrthogonal* obj, int  index) {
-    return ((LefDefParser::lefiOrthogonal*)obj)->cutWithin(index);
-}
-
-double lefiOrthogonal_orthoSpacing (const ::lefiOrthogonal* obj, int  index) {
-    return ((LefDefParser::lefiOrthogonal*)obj)->orthoSpacing(index);
-}
-
-int lefiAntennaModel_hasAntennaAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaDiffAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaDiffAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaDiffAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaDiffAreaRatioPWL();
-}
-
-int lefiAntennaModel_hasAntennaCumAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaCumDiffAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumDiffAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaCumDiffAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumDiffAreaRatioPWL();
-}
-
-int lefiAntennaModel_hasAntennaAreaFactor (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaAreaFactor();
-}
-
-int lefiAntennaModel_hasAntennaAreaFactorDUO (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaAreaFactorDUO();
-}
-
-int lefiAntennaModel_hasAntennaSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaSideAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaDiffSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaDiffSideAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaDiffSideAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaDiffSideAreaRatioPWL();
-}
-
-int lefiAntennaModel_hasAntennaCumSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumSideAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaCumDiffSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumDiffSideAreaRatio();
-}
-
-int lefiAntennaModel_hasAntennaCumDiffSideAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumDiffSideAreaRatioPWL();
-}
-
-int lefiAntennaModel_hasAntennaSideAreaFactor (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaSideAreaFactor();
-}
-
-int lefiAntennaModel_hasAntennaSideAreaFactorDUO (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaSideAreaFactorDUO();
-}
-
-int lefiAntennaModel_hasAntennaCumRoutingPlusCut (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaCumRoutingPlusCut();
-}
-
-int lefiAntennaModel_hasAntennaGatePlusDiff (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaGatePlusDiff();
-}
-
-int lefiAntennaModel_hasAntennaAreaMinusDiff (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaAreaMinusDiff();
-}
-
-int lefiAntennaModel_hasAntennaAreaDiffReducePWL (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->hasAntennaAreaDiffReducePWL();
-}
-
-char* lefiAntennaModel_antennaOxide (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaOxide();
-}
-
-double lefiAntennaModel_antennaAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaAreaRatio();
-}
-
-double lefiAntennaModel_antennaDiffAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaDiffAreaRatio();
-}
-
-const ::lefiAntennaPWL* lefiAntennaModel_antennaDiffAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return (const ::lefiAntennaPWL*) ((LefDefParser::lefiAntennaModel*)obj)->antennaDiffAreaRatioPWL();
-}
-
-double lefiAntennaModel_antennaCumAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaCumAreaRatio();
-}
-
-double lefiAntennaModel_antennaCumDiffAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaCumDiffAreaRatio();
-}
-
-const ::lefiAntennaPWL* lefiAntennaModel_antennaCumDiffAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return (const ::lefiAntennaPWL*) ((LefDefParser::lefiAntennaModel*)obj)->antennaCumDiffAreaRatioPWL();
-}
-
-double lefiAntennaModel_antennaAreaFactor (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaAreaFactor();
-}
-
-double lefiAntennaModel_antennaSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaSideAreaRatio();
-}
-
-double lefiAntennaModel_antennaDiffSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaDiffSideAreaRatio();
-}
-
-const ::lefiAntennaPWL* lefiAntennaModel_antennaDiffSideAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return (const ::lefiAntennaPWL*) ((LefDefParser::lefiAntennaModel*)obj)->antennaDiffSideAreaRatioPWL();
-}
-
-double lefiAntennaModel_antennaCumSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaCumSideAreaRatio();
-}
-
-double lefiAntennaModel_antennaCumDiffSideAreaRatio (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaCumDiffSideAreaRatio();
-}
-
-const ::lefiAntennaPWL* lefiAntennaModel_antennaCumDiffSideAreaRatioPWL (const ::lefiAntennaModel* obj) {
-    return (const ::lefiAntennaPWL*) ((LefDefParser::lefiAntennaModel*)obj)->antennaCumDiffSideAreaRatioPWL();
-}
-
-double lefiAntennaModel_antennaSideAreaFactor (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaSideAreaFactor();
-}
-
-double lefiAntennaModel_antennaGatePlusDiff (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaGatePlusDiff();
-}
-
-double lefiAntennaModel_antennaAreaMinusDiff (const ::lefiAntennaModel* obj) {
-    return ((LefDefParser::lefiAntennaModel*)obj)->antennaAreaMinusDiff();
-}
-
-const ::lefiAntennaPWL* lefiAntennaModel_antennaAreaDiffReducePWL (const ::lefiAntennaModel* obj) {
-    return (const ::lefiAntennaPWL*) ((LefDefParser::lefiAntennaModel*)obj)->antennaAreaDiffReducePWL();
-}
-
-int lefiLayer_hasType (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasType();
-}
-
-int lefiLayer_hasLayerType (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasLayerType();
-}
-
-int lefiLayer_hasMask (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMask();
-}
-
-int lefiLayer_hasPitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasPitch();
-}
-
-int lefiLayer_hasXYPitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasXYPitch();
-}
-
-int lefiLayer_hasOffset (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasOffset();
-}
-
-int lefiLayer_hasXYOffset (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasXYOffset();
-}
-
-int lefiLayer_hasWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasWidth();
-}
-
-int lefiLayer_hasArea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasArea();
-}
-
-int lefiLayer_hasDiagPitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDiagPitch();
-}
-
-int lefiLayer_hasXYDiagPitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasXYDiagPitch();
-}
-
-int lefiLayer_hasDiagWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDiagWidth();
-}
-
-int lefiLayer_hasDiagSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDiagSpacing();
-}
-
-int lefiLayer_hasSpacingNumber (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingNumber();
-}
-
-int lefiLayer_hasSpacingName (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingName(index);
-}
-
-int lefiLayer_hasSpacingLayerStack (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingLayerStack(index);
-}
-
-int lefiLayer_hasSpacingAdjacent (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingAdjacent(index);
-}
-
-int lefiLayer_hasSpacingCenterToCenter (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingCenterToCenter(index);
-}
-
-int lefiLayer_hasSpacingRange (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingRange(index);
-}
-
-int lefiLayer_hasSpacingRangeUseLengthThreshold (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingRangeUseLengthThreshold(index);
-}
-
-int lefiLayer_hasSpacingRangeInfluence (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingRangeInfluence(index);
-}
-
-int lefiLayer_hasSpacingRangeInfluenceRange (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingRangeInfluenceRange(index);
-}
-
-int lefiLayer_hasSpacingRangeRange (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingRangeRange(index);
-}
-
-int lefiLayer_hasSpacingLengthThreshold (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingLengthThreshold(index);
-}
-
-int lefiLayer_hasSpacingLengthThresholdRange (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingLengthThresholdRange(index);
-}
-
-int lefiLayer_hasSpacingParallelOverlap (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingParallelOverlap(index);
-}
-
-int lefiLayer_hasSpacingArea (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingArea(index);
-}
-
-int lefiLayer_hasSpacingEndOfLine (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingEndOfLine(index);
-}
-
-int lefiLayer_hasSpacingParellelEdge (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingParellelEdge(index);
-}
-
-int lefiLayer_hasSpacingTwoEdges (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingTwoEdges(index);
-}
-
-int lefiLayer_hasSpacingAdjacentExcept (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingAdjacentExcept(index);
-}
-
-int lefiLayer_hasSpacingSamenet (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingSamenet(index);
-}
-
-int lefiLayer_hasSpacingSamenetPGonly (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingSamenetPGonly(index);
-}
-
-int lefiLayer_hasSpacingNotchLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingNotchLength(index);
-}
-
-int lefiLayer_hasSpacingEndOfNotchWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingEndOfNotchWidth(index);
-}
-
-int lefiLayer_hasDirection (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDirection();
-}
-
-int lefiLayer_hasResistance (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasResistance();
-}
-
-int lefiLayer_hasResistanceArray (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasResistanceArray();
-}
-
-int lefiLayer_hasCapacitance (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasCapacitance();
-}
-
-int lefiLayer_hasCapacitanceArray (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasCapacitanceArray();
-}
-
-int lefiLayer_hasHeight (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasHeight();
-}
-
-int lefiLayer_hasThickness (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasThickness();
-}
-
-int lefiLayer_hasWireExtension (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasWireExtension();
-}
-
-int lefiLayer_hasShrinkage (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasShrinkage();
-}
-
-int lefiLayer_hasCapMultiplier (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasCapMultiplier();
-}
-
-int lefiLayer_hasEdgeCap (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasEdgeCap();
-}
-
-int lefiLayer_hasAntennaLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasAntennaLength();
-}
-
-int lefiLayer_hasAntennaArea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasAntennaArea();
-}
-
-int lefiLayer_hasCurrentDensityPoint (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasCurrentDensityPoint();
-}
-
-int lefiLayer_hasCurrentDensityArray (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasCurrentDensityArray();
-}
-
-int lefiLayer_hasAccurrentDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasAccurrentDensity();
-}
-
-int lefiLayer_hasDccurrentDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDccurrentDensity();
-}
-
-int lefiLayer_numProps (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numProps();
-}
-
-const char* lefiLayer_propName (const ::lefiLayer* obj, int  index) {
-    return ((const LefDefParser::lefiLayer*)obj)->propName(index);
-}
-
-const char* lefiLayer_propValue (const ::lefiLayer* obj, int  index) {
-    return ((const LefDefParser::lefiLayer*)obj)->propValue(index);
-}
-
-double lefiLayer_propNumber (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->propNumber(index);
-}
-
-const char lefiLayer_propType (const ::lefiLayer* obj, int  index) {
-    return ((const LefDefParser::lefiLayer*)obj)->propType(index);
-}
-
-int lefiLayer_propIsNumber (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->propIsNumber(index);
-}
-
-int lefiLayer_propIsString (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->propIsString(index);
-}
-
-int lefiLayer_numSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numSpacing();
-}
-
-char* lefiLayer_name (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->name();
-}
-
-const char* lefiLayer_type (const ::lefiLayer* obj) {
-    return ((const LefDefParser::lefiLayer*)obj)->type();
-}
-
-const char* lefiLayer_layerType (const ::lefiLayer* obj) {
-    return ((const LefDefParser::lefiLayer*)obj)->layerType();
-}
-
-double lefiLayer_pitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->pitch();
-}
-
-int lefiLayer_mask (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->mask();
-}
-
-double lefiLayer_pitchX (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->pitchX();
-}
-
-double lefiLayer_pitchY (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->pitchY();
-}
-
-double lefiLayer_offset (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->offset();
-}
-
-double lefiLayer_offsetX (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->offsetX();
-}
-
-double lefiLayer_offsetY (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->offsetY();
-}
-
-double lefiLayer_width (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->width();
-}
-
-double lefiLayer_area (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->area();
-}
-
-double lefiLayer_diagPitch (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagPitch();
-}
-
-double lefiLayer_diagPitchX (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagPitchX();
-}
-
-double lefiLayer_diagPitchY (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagPitchY();
-}
-
-double lefiLayer_diagWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagWidth();
-}
-
-double lefiLayer_diagSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagSpacing();
-}
-
-double lefiLayer_spacing (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacing(index);
-}
-
-char* lefiLayer_spacingName (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingName(index);
-}
-
-int lefiLayer_spacingAdjacentCuts (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingAdjacentCuts(index);
-}
-
-double lefiLayer_spacingAdjacentWithin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingAdjacentWithin(index);
-}
-
-double lefiLayer_spacingArea (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingArea(index);
-}
-
-double lefiLayer_spacingRangeMin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeMin(index);
-}
-
-double lefiLayer_spacingRangeMax (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeMax(index);
-}
-
-double lefiLayer_spacingRangeInfluence (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeInfluence(index);
-}
-
-double lefiLayer_spacingRangeInfluenceMin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeInfluenceMin(index);
-}
-
-double lefiLayer_spacingRangeInfluenceMax (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeInfluenceMax(index);
-}
-
-double lefiLayer_spacingRangeRangeMin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeRangeMin(index);
-}
-
-double lefiLayer_spacingRangeRangeMax (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingRangeRangeMax(index);
-}
-
-double lefiLayer_spacingLengthThreshold (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingLengthThreshold(index);
-}
-
-double lefiLayer_spacingLengthThresholdRangeMin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingLengthThresholdRangeMin(index);
-}
-
-double lefiLayer_spacingLengthThresholdRangeMax (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingLengthThresholdRangeMax(index);
-}
-
-double lefiLayer_spacingEolWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingEolWidth(index);
-}
-
-double lefiLayer_spacingEolWithin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingEolWithin(index);
-}
-
-double lefiLayer_spacingParSpace (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingParSpace(index);
-}
-
-double lefiLayer_spacingParWithin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingParWithin(index);
-}
-
-double lefiLayer_spacingNotchLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingNotchLength(index);
-}
-
-double lefiLayer_spacingEndOfNotchWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingEndOfNotchWidth(index);
-}
-
-double lefiLayer_spacingEndOfNotchSpacing (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingEndOfNotchSpacing(index);
-}
-
-double lefiLayer_spacingEndOfNotchLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->spacingEndOfNotchLength(index);
-}
-
-int lefiLayer_numMinimumcut (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numMinimumcut();
-}
-
-int lefiLayer_minimumcut (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumcut(index);
-}
-
-double lefiLayer_minimumcutWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumcutWidth(index);
-}
-
-int lefiLayer_hasMinimumcutWithin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinimumcutWithin(index);
-}
-
-double lefiLayer_minimumcutWithin (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumcutWithin(index);
-}
-
-int lefiLayer_hasMinimumcutConnection (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinimumcutConnection(index);
-}
-
-const char* lefiLayer_minimumcutConnection (const ::lefiLayer* obj, int  index) {
-    return ((const LefDefParser::lefiLayer*)obj)->minimumcutConnection(index);
-}
-
-int lefiLayer_hasMinimumcutNumCuts (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinimumcutNumCuts(index);
-}
-
-double lefiLayer_minimumcutLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumcutLength(index);
-}
-
-double lefiLayer_minimumcutDistance (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumcutDistance(index);
-}
-
-const char* lefiLayer_direction (const ::lefiLayer* obj) {
-    return ((const LefDefParser::lefiLayer*)obj)->direction();
-}
-
-double lefiLayer_resistance (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->resistance();
-}
-
-double lefiLayer_capacitance (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->capacitance();
-}
-
-double lefiLayer_height (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->height();
-}
-
-double lefiLayer_wireExtension (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->wireExtension();
-}
-
-double lefiLayer_thickness (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->thickness();
-}
-
-double lefiLayer_shrinkage (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->shrinkage();
-}
-
-double lefiLayer_capMultiplier (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->capMultiplier();
-}
-
-double lefiLayer_edgeCap (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->edgeCap();
-}
-
-double lefiLayer_antennaLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->antennaLength();
-}
-
-double lefiLayer_antennaArea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->antennaArea();
-}
-
-double lefiLayer_currentDensityPoint (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->currentDensityPoint();
-}
-
-void lefiLayer_currentDensityArray (const ::lefiLayer* obj, int*  numPoints, double**  widths, double**  current) {
-    ((LefDefParser::lefiLayer*)obj)->currentDensityArray(numPoints, widths, current);
-}
-
-void lefiLayer_capacitanceArray (const ::lefiLayer* obj, int*  numPoints, double**  widths, double**  resValues) {
-    ((LefDefParser::lefiLayer*)obj)->capacitanceArray(numPoints, widths, resValues);
-}
-
-void lefiLayer_resistanceArray (const ::lefiLayer* obj, int*  numPoints, double**  widths, double**  capValues) {
-    ((LefDefParser::lefiLayer*)obj)->resistanceArray(numPoints, widths, capValues);
-}
-
-int lefiLayer_numAccurrentDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numAccurrentDensity();
-}
-
-const ::lefiLayerDensity* lefiLayer_accurrent (const ::lefiLayer* obj, int  index) {
-    return (const ::lefiLayerDensity*) ((LefDefParser::lefiLayer*)obj)->accurrent(index);
-}
-
-int lefiLayer_numDccurrentDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numDccurrentDensity();
-}
-
-const ::lefiLayerDensity* lefiLayer_dccurrent (const ::lefiLayer* obj, int  index) {
-    return (const ::lefiLayerDensity*) ((LefDefParser::lefiLayer*)obj)->dccurrent(index);
-}
-
-int lefiLayer_numAntennaModel (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numAntennaModel();
-}
-
-const ::lefiAntennaModel* lefiLayer_antennaModel (const ::lefiLayer* obj, int  index) {
-    return (const ::lefiAntennaModel*) ((LefDefParser::lefiLayer*)obj)->antennaModel(index);
-}
-
-int lefiLayer_hasSlotWireWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSlotWireWidth();
-}
-
-int lefiLayer_hasSlotWireLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSlotWireLength();
-}
-
-int lefiLayer_hasSlotWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSlotWidth();
-}
-
-int lefiLayer_hasSlotLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSlotLength();
-}
-
-int lefiLayer_hasMaxAdjacentSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaxAdjacentSlotSpacing();
-}
-
-int lefiLayer_hasMaxCoaxialSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaxCoaxialSlotSpacing();
-}
-
-int lefiLayer_hasMaxEdgeSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaxEdgeSlotSpacing();
-}
-
-int lefiLayer_hasSplitWireWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSplitWireWidth();
-}
-
-int lefiLayer_hasMinimumDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinimumDensity();
-}
-
-int lefiLayer_hasMaximumDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaximumDensity();
-}
-
-int lefiLayer_hasDensityCheckWindow (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDensityCheckWindow();
-}
-
-int lefiLayer_hasDensityCheckStep (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDensityCheckStep();
-}
-
-int lefiLayer_hasFillActiveSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasFillActiveSpacing();
-}
-
-int lefiLayer_hasMaxwidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaxwidth();
-}
-
-int lefiLayer_hasMinwidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinwidth();
-}
-
-int lefiLayer_hasMinstep (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstep();
-}
-
-int lefiLayer_hasProtrusion (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasProtrusion();
-}
-
-double lefiLayer_slotWireWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->slotWireWidth();
-}
-
-double lefiLayer_slotWireLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->slotWireLength();
-}
-
-double lefiLayer_slotWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->slotWidth();
-}
-
-double lefiLayer_slotLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->slotLength();
-}
-
-double lefiLayer_maxAdjacentSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maxAdjacentSlotSpacing();
-}
-
-double lefiLayer_maxCoaxialSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maxCoaxialSlotSpacing();
-}
-
-double lefiLayer_maxEdgeSlotSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maxEdgeSlotSpacing();
-}
-
-double lefiLayer_splitWireWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->splitWireWidth();
-}
-
-double lefiLayer_minimumDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->minimumDensity();
-}
-
-double lefiLayer_maximumDensity (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maximumDensity();
-}
-
-double lefiLayer_densityCheckWindowLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->densityCheckWindowLength();
-}
-
-double lefiLayer_densityCheckWindowWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->densityCheckWindowWidth();
-}
-
-double lefiLayer_densityCheckStep (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->densityCheckStep();
-}
-
-double lefiLayer_fillActiveSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->fillActiveSpacing();
-}
-
-double lefiLayer_maxwidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maxwidth();
-}
-
-double lefiLayer_minwidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->minwidth();
-}
-
-double lefiLayer_protrusionWidth1 (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->protrusionWidth1();
-}
-
-double lefiLayer_protrusionLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->protrusionLength();
-}
-
-double lefiLayer_protrusionWidth2 (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->protrusionWidth2();
-}
-
-int lefiLayer_numMinstep (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numMinstep();
-}
-
-double lefiLayer_minstep (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstep(index);
-}
-
-int lefiLayer_hasMinstepType (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepType(index);
-}
-
-char* lefiLayer_minstepType (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstepType(index);
-}
-
-int lefiLayer_hasMinstepLengthsum (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepLengthsum(index);
-}
-
-double lefiLayer_minstepLengthsum (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstepLengthsum(index);
-}
-
-int lefiLayer_hasMinstepMaxedges (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepMaxedges(index);
-}
-
-int lefiLayer_minstepMaxedges (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstepMaxedges(index);
-}
-
-int lefiLayer_hasMinstepMinAdjLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepMinAdjLength(index);
-}
-
-double lefiLayer_minstepMinAdjLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstepMinAdjLength(index);
-}
-
-int lefiLayer_hasMinstepMinBetLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepMinBetLength(index);
-}
-
-double lefiLayer_minstepMinBetLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minstepMinBetLength(index);
-}
-
-int lefiLayer_hasMinstepXSameCorners (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinstepXSameCorners(index);
-}
-
-int lefiLayer_numMinenclosedarea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numMinenclosedarea();
-}
-
-double lefiLayer_minenclosedarea (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minenclosedarea(index);
-}
-
-int lefiLayer_hasMinenclosedareaWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMinenclosedareaWidth(index);
-}
-
-double lefiLayer_minenclosedareaWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minenclosedareaWidth(index);
-}
-
-int lefiLayer_numEnclosure (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numEnclosure();
-}
-
-int lefiLayer_hasEnclosureRule (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasEnclosureRule(index);
-}
-
-double lefiLayer_enclosureOverhang1 (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->enclosureOverhang1(index);
-}
-
-double lefiLayer_enclosureOverhang2 (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->enclosureOverhang2(index);
-}
-
-int lefiLayer_hasEnclosureWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasEnclosureWidth(index);
-}
-
-double lefiLayer_enclosureMinWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->enclosureMinWidth(index);
-}
-
-int lefiLayer_hasEnclosureExceptExtraCut (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasEnclosureExceptExtraCut(index);
-}
-
-double lefiLayer_enclosureExceptExtraCut (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->enclosureExceptExtraCut(index);
-}
-
-int lefiLayer_hasEnclosureMinLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasEnclosureMinLength(index);
-}
-
-double lefiLayer_enclosureMinLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->enclosureMinLength(index);
-}
-
-int lefiLayer_numPreferEnclosure (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numPreferEnclosure();
-}
-
-int lefiLayer_hasPreferEnclosureRule (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasPreferEnclosureRule(index);
-}
-
-double lefiLayer_preferEnclosureOverhang1 (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->preferEnclosureOverhang1(index);
-}
-
-double lefiLayer_preferEnclosureOverhang2 (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->preferEnclosureOverhang2(index);
-}
-
-int lefiLayer_hasPreferEnclosureWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->hasPreferEnclosureWidth(index);
-}
-
-double lefiLayer_preferEnclosureMinWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->preferEnclosureMinWidth(index);
-}
-
-int lefiLayer_hasResistancePerCut (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasResistancePerCut();
-}
-
-double lefiLayer_resistancePerCut (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->resistancePerCut();
-}
-
-int lefiLayer_hasDiagMinEdgeLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasDiagMinEdgeLength();
-}
-
-double lefiLayer_diagMinEdgeLength (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->diagMinEdgeLength();
-}
-
-int lefiLayer_numMinSize (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numMinSize();
-}
-
-double lefiLayer_minSizeWidth (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minSizeWidth(index);
-}
-
-double lefiLayer_minSizeLength (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->minSizeLength(index);
-}
-
-int lefiLayer_hasMaxFloatingArea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasMaxFloatingArea();
-}
-
-double lefiLayer_maxFloatingArea (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->maxFloatingArea();
-}
-
-int lefiLayer_hasArraySpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasArraySpacing();
-}
-
-int lefiLayer_hasLongArray (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasLongArray();
-}
-
-int lefiLayer_hasViaWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasViaWidth();
-}
-
-double lefiLayer_viaWidth (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->viaWidth();
-}
-
-double lefiLayer_cutSpacing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->cutSpacing();
-}
-
-int lefiLayer_numArrayCuts (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->numArrayCuts();
-}
-
-int lefiLayer_arrayCuts (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->arrayCuts(index);
-}
-
-double lefiLayer_arraySpacing (const ::lefiLayer* obj, int  index) {
-    return ((LefDefParser::lefiLayer*)obj)->arraySpacing(index);
-}
-
-int lefiLayer_hasSpacingTableOrtho (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->hasSpacingTableOrtho();
-}
-
-const ::lefiOrthogonal* lefiLayer_orthogonal (const ::lefiLayer* obj) {
-    return (const ::lefiOrthogonal*) ((LefDefParser::lefiLayer*)obj)->orthogonal();
-}
-
-int lefiLayer_need58PropsProcessing (const ::lefiLayer* obj) {
-    return ((LefDefParser::lefiLayer*)obj)->need58PropsProcessing();
-}
-
-void lefiLayer_print (const ::lefiLayer* obj, FILE*  f) {
-    ((LefDefParser::lefiLayer*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMacro.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMacro.cpp
deleted file mode 100644
index 616803b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMacro.cpp
+++ /dev/null
@@ -1,829 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiMacro.h"
-#include "lefiMacro.hpp"
-
-// Wrappers definitions.
-const ::lefiGeometries* lefiObstruction_geometries (const ::lefiObstruction* obj) {
-    return (const ::lefiGeometries*) ((LefDefParser::lefiObstruction*)obj)->geometries();
-}
-
-void lefiObstruction_print (const ::lefiObstruction* obj, FILE*  f) {
-    ((LefDefParser::lefiObstruction*)obj)->print(f);
-}
-
-int lefiPinAntennaModel_hasAntennaGateArea (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->hasAntennaGateArea();
-}
-
-int lefiPinAntennaModel_hasAntennaMaxAreaCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->hasAntennaMaxAreaCar();
-}
-
-int lefiPinAntennaModel_hasAntennaMaxSideAreaCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->hasAntennaMaxSideAreaCar();
-}
-
-int lefiPinAntennaModel_hasAntennaMaxCutCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->hasAntennaMaxCutCar();
-}
-
-char* lefiPinAntennaModel_antennaOxide (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->antennaOxide();
-}
-
-int lefiPinAntennaModel_numAntennaGateArea (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->numAntennaGateArea();
-}
-
-double lefiPinAntennaModel_antennaGateArea (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->antennaGateArea(index);
-}
-
-const char* lefiPinAntennaModel_antennaGateAreaLayer (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::lefiPinAntennaModel*)obj)->antennaGateAreaLayer(index);
-}
-
-int lefiPinAntennaModel_numAntennaMaxAreaCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->numAntennaMaxAreaCar();
-}
-
-double lefiPinAntennaModel_antennaMaxAreaCar (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxAreaCar(index);
-}
-
-const char* lefiPinAntennaModel_antennaMaxAreaCarLayer (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxAreaCarLayer(index);
-}
-
-int lefiPinAntennaModel_numAntennaMaxSideAreaCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->numAntennaMaxSideAreaCar();
-}
-
-double lefiPinAntennaModel_antennaMaxSideAreaCar (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxSideAreaCar(index);
-}
-
-const char* lefiPinAntennaModel_antennaMaxSideAreaCarLayer (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxSideAreaCarLayer(index);
-}
-
-int lefiPinAntennaModel_numAntennaMaxCutCar (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->numAntennaMaxCutCar();
-}
-
-double lefiPinAntennaModel_antennaMaxCutCar (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxCutCar(index);
-}
-
-const char* lefiPinAntennaModel_antennaMaxCutCarLayer (const ::lefiPinAntennaModel* obj, int  index) {
-    return ((const LefDefParser::lefiPinAntennaModel*)obj)->antennaMaxCutCarLayer(index);
-}
-
-int lefiPinAntennaModel_hasReturn (const ::lefiPinAntennaModel* obj) {
-    return ((LefDefParser::lefiPinAntennaModel*)obj)->hasReturn();
-}
-
-int lefiPin_hasForeign (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasForeign();
-}
-
-int lefiPin_hasForeignOrient (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->hasForeignOrient(index);
-}
-
-int lefiPin_hasForeignPoint (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->hasForeignPoint(index);
-}
-
-int lefiPin_hasLEQ (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasLEQ();
-}
-
-int lefiPin_hasDirection (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasDirection();
-}
-
-int lefiPin_hasUse (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasUse();
-}
-
-int lefiPin_hasShape (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasShape();
-}
-
-int lefiPin_hasMustjoin (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasMustjoin();
-}
-
-int lefiPin_hasOutMargin (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasOutMargin();
-}
-
-int lefiPin_hasOutResistance (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasOutResistance();
-}
-
-int lefiPin_hasInMargin (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasInMargin();
-}
-
-int lefiPin_hasPower (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasPower();
-}
-
-int lefiPin_hasLeakage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasLeakage();
-}
-
-int lefiPin_hasMaxload (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasMaxload();
-}
-
-int lefiPin_hasMaxdelay (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasMaxdelay();
-}
-
-int lefiPin_hasCapacitance (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasCapacitance();
-}
-
-int lefiPin_hasResistance (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasResistance();
-}
-
-int lefiPin_hasPulldownres (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasPulldownres();
-}
-
-int lefiPin_hasTieoffr (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasTieoffr();
-}
-
-int lefiPin_hasVHI (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasVHI();
-}
-
-int lefiPin_hasVLO (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasVLO();
-}
-
-int lefiPin_hasRiseVoltage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasRiseVoltage();
-}
-
-int lefiPin_hasFallVoltage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasFallVoltage();
-}
-
-int lefiPin_hasRiseThresh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasRiseThresh();
-}
-
-int lefiPin_hasFallThresh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasFallThresh();
-}
-
-int lefiPin_hasRiseSatcur (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasRiseSatcur();
-}
-
-int lefiPin_hasFallSatcur (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasFallSatcur();
-}
-
-int lefiPin_hasCurrentSource (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasCurrentSource();
-}
-
-int lefiPin_hasTables (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasTables();
-}
-
-int lefiPin_hasAntennaSize (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaSize();
-}
-
-int lefiPin_hasAntennaMetalArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaMetalArea();
-}
-
-int lefiPin_hasAntennaMetalLength (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaMetalLength();
-}
-
-int lefiPin_hasAntennaPartialMetalArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaPartialMetalArea();
-}
-
-int lefiPin_hasAntennaPartialMetalSideArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaPartialMetalSideArea();
-}
-
-int lefiPin_hasAntennaPartialCutArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaPartialCutArea();
-}
-
-int lefiPin_hasAntennaDiffArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaDiffArea();
-}
-
-int lefiPin_hasAntennaModel (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasAntennaModel();
-}
-
-int lefiPin_hasTaperRule (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasTaperRule();
-}
-
-int lefiPin_hasRiseSlewLimit (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasRiseSlewLimit();
-}
-
-int lefiPin_hasFallSlewLimit (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasFallSlewLimit();
-}
-
-int lefiPin_hasNetExpr (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasNetExpr();
-}
-
-int lefiPin_hasSupplySensitivity (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasSupplySensitivity();
-}
-
-int lefiPin_hasGroundSensitivity (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->hasGroundSensitivity();
-}
-
-const char* lefiPin_name (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->name();
-}
-
-int lefiPin_numPorts (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numPorts();
-}
-
-const ::lefiGeometries* lefiPin_port (const ::lefiPin* obj, int  index) {
-    return (const ::lefiGeometries*) ((LefDefParser::lefiPin*)obj)->port(index);
-}
-
-int lefiPin_numForeigns (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numForeigns();
-}
-
-const char* lefiPin_foreignName (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->foreignName(index);
-}
-
-const char* lefiPin_taperRule (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->taperRule();
-}
-
-int lefiPin_foreignOrient (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->foreignOrient(index);
-}
-
-const char* lefiPin_foreignOrientStr (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->foreignOrientStr(index);
-}
-
-double lefiPin_foreignX (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->foreignX(index);
-}
-
-double lefiPin_foreignY (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->foreignY(index);
-}
-
-const char* lefiPin_LEQ (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->LEQ();
-}
-
-const char* lefiPin_direction (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->direction();
-}
-
-const char* lefiPin_use (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->use();
-}
-
-const char* lefiPin_shape (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->shape();
-}
-
-const char* lefiPin_mustjoin (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->mustjoin();
-}
-
-double lefiPin_outMarginHigh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->outMarginHigh();
-}
-
-double lefiPin_outMarginLow (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->outMarginLow();
-}
-
-double lefiPin_outResistanceHigh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->outResistanceHigh();
-}
-
-double lefiPin_outResistanceLow (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->outResistanceLow();
-}
-
-double lefiPin_inMarginHigh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->inMarginHigh();
-}
-
-double lefiPin_inMarginLow (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->inMarginLow();
-}
-
-double lefiPin_power (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->power();
-}
-
-double lefiPin_leakage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->leakage();
-}
-
-double lefiPin_maxload (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->maxload();
-}
-
-double lefiPin_maxdelay (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->maxdelay();
-}
-
-double lefiPin_capacitance (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->capacitance();
-}
-
-double lefiPin_resistance (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->resistance();
-}
-
-double lefiPin_pulldownres (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->pulldownres();
-}
-
-double lefiPin_tieoffr (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->tieoffr();
-}
-
-double lefiPin_VHI (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->VHI();
-}
-
-double lefiPin_VLO (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->VLO();
-}
-
-double lefiPin_riseVoltage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->riseVoltage();
-}
-
-double lefiPin_fallVoltage (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->fallVoltage();
-}
-
-double lefiPin_riseThresh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->riseThresh();
-}
-
-double lefiPin_fallThresh (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->fallThresh();
-}
-
-double lefiPin_riseSatcur (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->riseSatcur();
-}
-
-double lefiPin_fallSatcur (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->fallSatcur();
-}
-
-double lefiPin_riseSlewLimit (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->riseSlewLimit();
-}
-
-double lefiPin_fallSlewLimit (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->fallSlewLimit();
-}
-
-const char* lefiPin_currentSource (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->currentSource();
-}
-
-const char* lefiPin_tableHighName (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->tableHighName();
-}
-
-const char* lefiPin_tableLowName (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->tableLowName();
-}
-
-int lefiPin_numAntennaSize (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaSize();
-}
-
-double lefiPin_antennaSize (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaSize(index);
-}
-
-const char* lefiPin_antennaSizeLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaSizeLayer(index);
-}
-
-int lefiPin_numAntennaMetalArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaMetalArea();
-}
-
-double lefiPin_antennaMetalArea (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaMetalArea(index);
-}
-
-const char* lefiPin_antennaMetalAreaLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaMetalAreaLayer(index);
-}
-
-int lefiPin_numAntennaMetalLength (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaMetalLength();
-}
-
-double lefiPin_antennaMetalLength (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaMetalLength(index);
-}
-
-const char* lefiPin_antennaMetalLengthLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaMetalLengthLayer(index);
-}
-
-int lefiPin_numAntennaPartialMetalArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaPartialMetalArea();
-}
-
-double lefiPin_antennaPartialMetalArea (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaPartialMetalArea(index);
-}
-
-const char* lefiPin_antennaPartialMetalAreaLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaPartialMetalAreaLayer(index);
-}
-
-int lefiPin_numAntennaPartialMetalSideArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaPartialMetalSideArea();
-}
-
-double lefiPin_antennaPartialMetalSideArea (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaPartialMetalSideArea(index);
-}
-
-const char* lefiPin_antennaPartialMetalSideAreaLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaPartialMetalSideAreaLayer(index);
-}
-
-int lefiPin_numAntennaPartialCutArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaPartialCutArea();
-}
-
-double lefiPin_antennaPartialCutArea (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaPartialCutArea(index);
-}
-
-const char* lefiPin_antennaPartialCutAreaLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaPartialCutAreaLayer(index);
-}
-
-int lefiPin_numAntennaDiffArea (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaDiffArea();
-}
-
-double lefiPin_antennaDiffArea (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->antennaDiffArea(index);
-}
-
-const char* lefiPin_antennaDiffAreaLayer (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->antennaDiffAreaLayer(index);
-}
-
-const char* lefiPin_netExpr (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->netExpr();
-}
-
-const char* lefiPin_supplySensitivity (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->supplySensitivity();
-}
-
-const char* lefiPin_groundSensitivity (const ::lefiPin* obj) {
-    return ((const LefDefParser::lefiPin*)obj)->groundSensitivity();
-}
-
-int lefiPin_numAntennaModel (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numAntennaModel();
-}
-
-const ::lefiPinAntennaModel* lefiPin_antennaModel (const ::lefiPin* obj, int  index) {
-    return (const ::lefiPinAntennaModel*) ((LefDefParser::lefiPin*)obj)->antennaModel(index);
-}
-
-int lefiPin_numProperties (const ::lefiPin* obj) {
-    return ((LefDefParser::lefiPin*)obj)->numProperties();
-}
-
-const char* lefiPin_propName (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->propName(index);
-}
-
-const char* lefiPin_propValue (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->propValue(index);
-}
-
-double lefiPin_propNum (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->propNum(index);
-}
-
-const char lefiPin_propType (const ::lefiPin* obj, int  index) {
-    return ((const LefDefParser::lefiPin*)obj)->propType(index);
-}
-
-int lefiPin_propIsNumber (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->propIsNumber(index);
-}
-
-int lefiPin_propIsString (const ::lefiPin* obj, int  index) {
-    return ((LefDefParser::lefiPin*)obj)->propIsString(index);
-}
-
-void lefiPin_print (const ::lefiPin* obj, FILE*  f) {
-    ((LefDefParser::lefiPin*)obj)->print(f);
-}
-
-int lefiDensity_numLayer (const ::lefiDensity* obj) {
-    return ((LefDefParser::lefiDensity*)obj)->numLayer();
-}
-
-char* lefiDensity_layerName (const ::lefiDensity* obj, int  index) {
-    return ((LefDefParser::lefiDensity*)obj)->layerName(index);
-}
-
-int lefiDensity_numRects (const ::lefiDensity* obj, int  index) {
-    return ((LefDefParser::lefiDensity*)obj)->numRects(index);
-}
-
-::lefiGeomRect lefiDensity_getRect (const ::lefiDensity* obj, int  index, int  rectIndex) {
-    LefDefParser::lefiGeomRect tmp;
-    tmp = ((LefDefParser::lefiDensity*)obj)->getRect(index, rectIndex);
-    return *((::lefiGeomRect*)&tmp);
-}
-
-double lefiDensity_densityValue (const ::lefiDensity* obj, int  index, int  rectIndex) {
-    return ((LefDefParser::lefiDensity*)obj)->densityValue(index, rectIndex);
-}
-
-void lefiDensity_print (const ::lefiDensity* obj, FILE*  f) {
-    ((LefDefParser::lefiDensity*)obj)->print(f);
-}
-
-int lefiMacro_hasClass (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasClass();
-}
-
-int lefiMacro_hasGenerator (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasGenerator();
-}
-
-int lefiMacro_hasGenerate (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasGenerate();
-}
-
-int lefiMacro_hasPower (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasPower();
-}
-
-int lefiMacro_hasOrigin (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasOrigin();
-}
-
-int lefiMacro_hasEEQ (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasEEQ();
-}
-
-int lefiMacro_hasLEQ (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasLEQ();
-}
-
-int lefiMacro_hasSource (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasSource();
-}
-
-int lefiMacro_hasXSymmetry (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasXSymmetry();
-}
-
-int lefiMacro_hasYSymmetry (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasYSymmetry();
-}
-
-int lefiMacro_has90Symmetry (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->has90Symmetry();
-}
-
-int lefiMacro_hasSiteName (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasSiteName();
-}
-
-int lefiMacro_hasSitePattern (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasSitePattern();
-}
-
-int lefiMacro_hasSize (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasSize();
-}
-
-int lefiMacro_hasForeign (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasForeign();
-}
-
-int lefiMacro_hasForeignOrigin (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->hasForeignOrigin(index);
-}
-
-int lefiMacro_hasForeignOrient (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->hasForeignOrient(index);
-}
-
-int lefiMacro_hasForeignPoint (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->hasForeignPoint(index);
-}
-
-int lefiMacro_hasClockType (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->hasClockType();
-}
-
-int lefiMacro_isBuffer (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->isBuffer();
-}
-
-int lefiMacro_isInverter (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->isInverter();
-}
-
-int lefiMacro_isFixedMask (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->isFixedMask();
-}
-
-int lefiMacro_numSitePattern (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->numSitePattern();
-}
-
-int lefiMacro_numProperties (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->numProperties();
-}
-
-const char* lefiMacro_propName (const ::lefiMacro* obj, int  index) {
-    return ((const LefDefParser::lefiMacro*)obj)->propName(index);
-}
-
-const char* lefiMacro_propValue (const ::lefiMacro* obj, int  index) {
-    return ((const LefDefParser::lefiMacro*)obj)->propValue(index);
-}
-
-double lefiMacro_propNum (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->propNum(index);
-}
-
-const char lefiMacro_propType (const ::lefiMacro* obj, int  index) {
-    return ((const LefDefParser::lefiMacro*)obj)->propType(index);
-}
-
-int lefiMacro_propIsNumber (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->propIsNumber(index);
-}
-
-int lefiMacro_propIsString (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->propIsString(index);
-}
-
-const char* lefiMacro_name (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->name();
-}
-
-const char* lefiMacro_macroClass (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->macroClass();
-}
-
-const char* lefiMacro_generator (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->generator();
-}
-
-const char* lefiMacro_EEQ (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->EEQ();
-}
-
-const char* lefiMacro_LEQ (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->LEQ();
-}
-
-const char* lefiMacro_source (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->source();
-}
-
-const char* lefiMacro_clockType (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->clockType();
-}
-
-double lefiMacro_originX (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->originX();
-}
-
-double lefiMacro_originY (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->originY();
-}
-
-double lefiMacro_power (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->power();
-}
-
-void lefiMacro_generate (const ::lefiMacro* obj, char**  name1, char**  name2) {
-    ((LefDefParser::lefiMacro*)obj)->generate(name1, name2);
-}
-
-const ::lefiSitePattern* lefiMacro_sitePattern (const ::lefiMacro* obj, int  index) {
-    return (const ::lefiSitePattern*) ((LefDefParser::lefiMacro*)obj)->sitePattern(index);
-}
-
-const char* lefiMacro_siteName (const ::lefiMacro* obj) {
-    return ((const LefDefParser::lefiMacro*)obj)->siteName();
-}
-
-double lefiMacro_sizeX (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->sizeX();
-}
-
-double lefiMacro_sizeY (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->sizeY();
-}
-
-int lefiMacro_numForeigns (const ::lefiMacro* obj) {
-    return ((LefDefParser::lefiMacro*)obj)->numForeigns();
-}
-
-int lefiMacro_foreignOrient (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->foreignOrient(index);
-}
-
-const char* lefiMacro_foreignOrientStr (const ::lefiMacro* obj, int  index) {
-    return ((const LefDefParser::lefiMacro*)obj)->foreignOrientStr(index);
-}
-
-double lefiMacro_foreignX (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->foreignX(index);
-}
-
-double lefiMacro_foreignY (const ::lefiMacro* obj, int  index) {
-    return ((LefDefParser::lefiMacro*)obj)->foreignY(index);
-}
-
-const char* lefiMacro_foreignName (const ::lefiMacro* obj, int  index) {
-    return ((const LefDefParser::lefiMacro*)obj)->foreignName(index);
-}
-
-void lefiMacro_print (const ::lefiMacro* obj, FILE*  f) {
-    ((LefDefParser::lefiMacro*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMisc.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMisc.cpp
deleted file mode 100644
index 07f8a69..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiMisc.cpp
+++ /dev/null
@@ -1,343 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiMisc.h"
-#include "lefiMisc.hpp"
-
-// Wrappers definitions.
-int lefiGeometries_numItems (const ::lefiGeometries* obj) {
-    return ((LefDefParser::lefiGeometries*)obj)->numItems();
-}
-
-enum ::lefiGeomEnum lefiGeometries_itemType (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomEnum) ((LefDefParser::lefiGeometries*)obj)->itemType(index);
-}
-
-struct ::lefiGeomRect* lefiGeometries_getRect (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomRect*) ((LefDefParser::lefiGeometries*)obj)->getRect(index);
-}
-
-struct ::lefiGeomRectIter* lefiGeometries_getRectIter (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomRectIter*) ((LefDefParser::lefiGeometries*)obj)->getRectIter(index);
-}
-
-struct ::lefiGeomPath* lefiGeometries_getPath (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomPath*) ((LefDefParser::lefiGeometries*)obj)->getPath(index);
-}
-
-struct ::lefiGeomPathIter* lefiGeometries_getPathIter (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomPathIter*) ((LefDefParser::lefiGeometries*)obj)->getPathIter(index);
-}
-
-int lefiGeometries_hasLayerExceptPgNet (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->hasLayerExceptPgNet(index);
-}
-
-char* lefiGeometries_getLayer (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->getLayer(index);
-}
-
-double lefiGeometries_getLayerMinSpacing (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->getLayerMinSpacing(index);
-}
-
-double lefiGeometries_getLayerRuleWidth (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->getLayerRuleWidth(index);
-}
-
-double lefiGeometries_getWidth (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->getWidth(index);
-}
-
-struct ::lefiGeomPolygon* lefiGeometries_getPolygon (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomPolygon*) ((LefDefParser::lefiGeometries*)obj)->getPolygon(index);
-}
-
-struct ::lefiGeomPolygonIter* lefiGeometries_getPolygonIter (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomPolygonIter*) ((LefDefParser::lefiGeometries*)obj)->getPolygonIter(index);
-}
-
-char* lefiGeometries_getClass (const ::lefiGeometries* obj, int  index) {
-    return ((LefDefParser::lefiGeometries*)obj)->getClass(index);
-}
-
-struct ::lefiGeomVia* lefiGeometries_getVia (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomVia*) ((LefDefParser::lefiGeometries*)obj)->getVia(index);
-}
-
-struct ::lefiGeomViaIter* lefiGeometries_getViaIter (const ::lefiGeometries* obj, int  index) {
-    return (::lefiGeomViaIter*) ((LefDefParser::lefiGeometries*)obj)->getViaIter(index);
-}
-
-void lefiGeometries_print (const ::lefiGeometries* obj, FILE*  f) {
-    ((LefDefParser::lefiGeometries*)obj)->print(f);
-}
-
-int lefiSpacing_hasStack (const ::lefiSpacing* obj) {
-    return ((LefDefParser::lefiSpacing*)obj)->hasStack();
-}
-
-const char* lefiSpacing_name1 (const ::lefiSpacing* obj) {
-    return ((const LefDefParser::lefiSpacing*)obj)->name1();
-}
-
-const char* lefiSpacing_name2 (const ::lefiSpacing* obj) {
-    return ((const LefDefParser::lefiSpacing*)obj)->name2();
-}
-
-double lefiSpacing_distance (const ::lefiSpacing* obj) {
-    return ((LefDefParser::lefiSpacing*)obj)->distance();
-}
-
-void lefiSpacing_print (const ::lefiSpacing* obj, FILE*  f) {
-    ((LefDefParser::lefiSpacing*)obj)->print(f);
-}
-
-const char* lefiIRDrop_name (const ::lefiIRDrop* obj) {
-    return ((const LefDefParser::lefiIRDrop*)obj)->name();
-}
-
-double lefiIRDrop_value1 (const ::lefiIRDrop* obj, int  index) {
-    return ((LefDefParser::lefiIRDrop*)obj)->value1(index);
-}
-
-double lefiIRDrop_value2 (const ::lefiIRDrop* obj, int  index) {
-    return ((LefDefParser::lefiIRDrop*)obj)->value2(index);
-}
-
-int lefiIRDrop_numValues (const ::lefiIRDrop* obj) {
-    return ((LefDefParser::lefiIRDrop*)obj)->numValues();
-}
-
-void lefiIRDrop_print (const ::lefiIRDrop* obj, FILE*  f) {
-    ((LefDefParser::lefiIRDrop*)obj)->print(f);
-}
-
-double lefiMinFeature_one (const ::lefiMinFeature* obj) {
-    return ((LefDefParser::lefiMinFeature*)obj)->one();
-}
-
-double lefiMinFeature_two (const ::lefiMinFeature* obj) {
-    return ((LefDefParser::lefiMinFeature*)obj)->two();
-}
-
-void lefiMinFeature_print (const ::lefiMinFeature* obj, FILE*  f) {
-    ((LefDefParser::lefiMinFeature*)obj)->print(f);
-}
-
-const char* lefiSite_name (const ::lefiSite* obj) {
-    return ((const LefDefParser::lefiSite*)obj)->name();
-}
-
-int lefiSite_hasClass (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->hasClass();
-}
-
-const char* lefiSite_siteClass (const ::lefiSite* obj) {
-    return ((const LefDefParser::lefiSite*)obj)->siteClass();
-}
-
-double lefiSite_sizeX (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->sizeX();
-}
-
-double lefiSite_sizeY (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->sizeY();
-}
-
-int lefiSite_hasSize (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->hasSize();
-}
-
-int lefiSite_hasXSymmetry (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->hasXSymmetry();
-}
-
-int lefiSite_hasYSymmetry (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->hasYSymmetry();
-}
-
-int lefiSite_has90Symmetry (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->has90Symmetry();
-}
-
-int lefiSite_hasRowPattern (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->hasRowPattern();
-}
-
-int lefiSite_numSites (const ::lefiSite* obj) {
-    return ((LefDefParser::lefiSite*)obj)->numSites();
-}
-
-char* lefiSite_siteName (const ::lefiSite* obj, int  index) {
-    return ((LefDefParser::lefiSite*)obj)->siteName(index);
-}
-
-int lefiSite_siteOrient (const ::lefiSite* obj, int  index) {
-    return ((LefDefParser::lefiSite*)obj)->siteOrient(index);
-}
-
-char* lefiSite_siteOrientStr (const ::lefiSite* obj, int  index) {
-    return ((LefDefParser::lefiSite*)obj)->siteOrientStr(index);
-}
-
-void lefiSite_print (const ::lefiSite* obj, FILE*  f) {
-    ((LefDefParser::lefiSite*)obj)->print(f);
-}
-
-const char* lefiSitePattern_name (const ::lefiSitePattern* obj) {
-    return ((const LefDefParser::lefiSitePattern*)obj)->name();
-}
-
-int lefiSitePattern_orient (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->orient();
-}
-
-const char* lefiSitePattern_orientStr (const ::lefiSitePattern* obj) {
-    return ((const LefDefParser::lefiSitePattern*)obj)->orientStr();
-}
-
-double lefiSitePattern_x (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->x();
-}
-
-double lefiSitePattern_y (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->y();
-}
-
-int lefiSitePattern_hasStepPattern (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->hasStepPattern();
-}
-
-double lefiSitePattern_xStart (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->xStart();
-}
-
-double lefiSitePattern_yStart (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->yStart();
-}
-
-double lefiSitePattern_xStep (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->xStep();
-}
-
-double lefiSitePattern_yStep (const ::lefiSitePattern* obj) {
-    return ((LefDefParser::lefiSitePattern*)obj)->yStep();
-}
-
-void lefiSitePattern_print (const ::lefiSitePattern* obj, FILE*  f) {
-    ((LefDefParser::lefiSitePattern*)obj)->print(f);
-}
-
-const char* lefiTrackPattern_name (const ::lefiTrackPattern* obj) {
-    return ((const LefDefParser::lefiTrackPattern*)obj)->name();
-}
-
-double lefiTrackPattern_start (const ::lefiTrackPattern* obj) {
-    return ((LefDefParser::lefiTrackPattern*)obj)->start();
-}
-
-int lefiTrackPattern_numTracks (const ::lefiTrackPattern* obj) {
-    return ((LefDefParser::lefiTrackPattern*)obj)->numTracks();
-}
-
-double lefiTrackPattern_space (const ::lefiTrackPattern* obj) {
-    return ((LefDefParser::lefiTrackPattern*)obj)->space();
-}
-
-int lefiTrackPattern_numLayers (const ::lefiTrackPattern* obj) {
-    return ((LefDefParser::lefiTrackPattern*)obj)->numLayers();
-}
-
-const char* lefiTrackPattern_layerName (const ::lefiTrackPattern* obj, int  index) {
-    return ((const LefDefParser::lefiTrackPattern*)obj)->layerName(index);
-}
-
-void lefiTrackPattern_print (const ::lefiTrackPattern* obj, FILE*  f) {
-    ((LefDefParser::lefiTrackPattern*)obj)->print(f);
-}
-
-const char* lefiGcellPattern_name (const ::lefiGcellPattern* obj) {
-    return ((const LefDefParser::lefiGcellPattern*)obj)->name();
-}
-
-double lefiGcellPattern_start (const ::lefiGcellPattern* obj) {
-    return ((LefDefParser::lefiGcellPattern*)obj)->start();
-}
-
-int lefiGcellPattern_numCRs (const ::lefiGcellPattern* obj) {
-    return ((LefDefParser::lefiGcellPattern*)obj)->numCRs();
-}
-
-double lefiGcellPattern_space (const ::lefiGcellPattern* obj) {
-    return ((LefDefParser::lefiGcellPattern*)obj)->space();
-}
-
-void lefiGcellPattern_print (const ::lefiGcellPattern* obj, FILE*  f) {
-    ((LefDefParser::lefiGcellPattern*)obj)->print(f);
-}
-
-const char* lefiUseMinSpacing_name (const ::lefiUseMinSpacing* obj) {
-    return ((const LefDefParser::lefiUseMinSpacing*)obj)->name();
-}
-
-int lefiUseMinSpacing_value (const ::lefiUseMinSpacing* obj) {
-    return ((LefDefParser::lefiUseMinSpacing*)obj)->value();
-}
-
-void lefiUseMinSpacing_print (const ::lefiUseMinSpacing* obj, FILE*  f) {
-    ((LefDefParser::lefiUseMinSpacing*)obj)->print(f);
-}
-
-int lefiMaxStackVia_maxStackVia (const ::lefiMaxStackVia* obj) {
-    return ((LefDefParser::lefiMaxStackVia*)obj)->maxStackVia();
-}
-
-int lefiMaxStackVia_hasMaxStackViaRange (const ::lefiMaxStackVia* obj) {
-    return ((LefDefParser::lefiMaxStackVia*)obj)->hasMaxStackViaRange();
-}
-
-const char* lefiMaxStackVia_maxStackViaBottomLayer (const ::lefiMaxStackVia* obj) {
-    return ((const LefDefParser::lefiMaxStackVia*)obj)->maxStackViaBottomLayer();
-}
-
-const char* lefiMaxStackVia_maxStackViaTopLayer (const ::lefiMaxStackVia* obj) {
-    return ((const LefDefParser::lefiMaxStackVia*)obj)->maxStackViaTopLayer();
-}
-
-void lefiMaxStackVia_print (const ::lefiMaxStackVia* obj, FILE*  f) {
-    ((LefDefParser::lefiMaxStackVia*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiNonDefault.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiNonDefault.cpp
deleted file mode 100644
index 6a3ed30..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiNonDefault.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiNonDefault.h"
-#include "lefiNonDefault.hpp"
-
-// Wrappers definitions.
-const char* lefiNonDefault_name (const ::lefiNonDefault* obj) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->name();
-}
-
-int lefiNonDefault_hasHardspacing (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasHardspacing();
-}
-
-int lefiNonDefault_numProps (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numProps();
-}
-
-const char* lefiNonDefault_propName (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->propName(index);
-}
-
-const char* lefiNonDefault_propValue (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->propValue(index);
-}
-
-double lefiNonDefault_propNumber (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->propNumber(index);
-}
-
-const char lefiNonDefault_propType (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->propType(index);
-}
-
-int lefiNonDefault_propIsNumber (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->propIsNumber(index);
-}
-
-int lefiNonDefault_propIsString (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->propIsString(index);
-}
-
-int lefiNonDefault_numLayers (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numLayers();
-}
-
-const char* lefiNonDefault_layerName (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->layerName(index);
-}
-
-int lefiNonDefault_hasLayerWidth (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerWidth(index);
-}
-
-double lefiNonDefault_layerWidth (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerWidth(index);
-}
-
-int lefiNonDefault_hasLayerSpacing (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerSpacing(index);
-}
-
-double lefiNonDefault_layerSpacing (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerSpacing(index);
-}
-
-int lefiNonDefault_hasLayerWireExtension (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerWireExtension(index);
-}
-
-double lefiNonDefault_layerWireExtension (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerWireExtension(index);
-}
-
-int lefiNonDefault_hasLayerResistance (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerResistance(index);
-}
-
-double lefiNonDefault_layerResistance (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerResistance(index);
-}
-
-int lefiNonDefault_hasLayerCapacitance (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerCapacitance(index);
-}
-
-double lefiNonDefault_layerCapacitance (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerCapacitance(index);
-}
-
-int lefiNonDefault_hasLayerEdgeCap (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerEdgeCap(index);
-}
-
-double lefiNonDefault_layerEdgeCap (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerEdgeCap(index);
-}
-
-int lefiNonDefault_hasLayerDiagWidth (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->hasLayerDiagWidth(index);
-}
-
-double lefiNonDefault_layerDiagWidth (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->layerDiagWidth(index);
-}
-
-int lefiNonDefault_numVias (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numVias();
-}
-
-const ::lefiVia* lefiNonDefault_viaRule (const ::lefiNonDefault* obj, int  index) {
-    return (const ::lefiVia*) ((LefDefParser::lefiNonDefault*)obj)->viaRule(index);
-}
-
-int lefiNonDefault_numSpacingRules (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numSpacingRules();
-}
-
-const ::lefiSpacing* lefiNonDefault_spacingRule (const ::lefiNonDefault* obj, int  index) {
-    return (const ::lefiSpacing*) ((LefDefParser::lefiNonDefault*)obj)->spacingRule(index);
-}
-
-int lefiNonDefault_numUseVia (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numUseVia();
-}
-
-const char* lefiNonDefault_viaName (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->viaName(index);
-}
-
-int lefiNonDefault_numUseViaRule (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numUseViaRule();
-}
-
-const char* lefiNonDefault_viaRuleName (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->viaRuleName(index);
-}
-
-int lefiNonDefault_numMinCuts (const ::lefiNonDefault* obj) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numMinCuts();
-}
-
-const char* lefiNonDefault_cutLayerName (const ::lefiNonDefault* obj, int  index) {
-    return ((const LefDefParser::lefiNonDefault*)obj)->cutLayerName(index);
-}
-
-int lefiNonDefault_numCuts (const ::lefiNonDefault* obj, int  index) {
-    return ((LefDefParser::lefiNonDefault*)obj)->numCuts(index);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiProp.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiProp.cpp
deleted file mode 100644
index 1ae6ab7..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiProp.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiProp.h"
-#include "lefiProp.hpp"
-
-// Wrappers definitions.
-const char* lefiProp_string (const ::lefiProp* obj) {
-    return ((const LefDefParser::lefiProp*)obj)->string();
-}
-
-const char* lefiProp_propType (const ::lefiProp* obj) {
-    return ((const LefDefParser::lefiProp*)obj)->propType();
-}
-
-const char* lefiProp_propName (const ::lefiProp* obj) {
-    return ((const LefDefParser::lefiProp*)obj)->propName();
-}
-
-char lefiProp_dataType (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->dataType();
-}
-
-int lefiProp_hasNumber (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->hasNumber();
-}
-
-int lefiProp_hasRange (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->hasRange();
-}
-
-int lefiProp_hasString (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->hasString();
-}
-
-int lefiProp_hasNameMapString (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->hasNameMapString();
-}
-
-double lefiProp_number (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->number();
-}
-
-double lefiProp_left (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->left();
-}
-
-double lefiProp_right (const ::lefiProp* obj) {
-    return ((LefDefParser::lefiProp*)obj)->right();
-}
-
-void lefiProp_print (const ::lefiProp* obj, FILE*  f) {
-    ((LefDefParser::lefiProp*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiPropType.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiPropType.cpp
deleted file mode 100644
index fb1f79a..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiPropType.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiPropType.h"
-#include "lefiPropType.hpp"
-
-// Wrappers definitions.
-const char lefiPropType_propType (const ::lefiPropType* obj, char*  name) {
-    return ((const LefDefParser::lefiPropType*)obj)->propType(name);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUnits.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUnits.cpp
deleted file mode 100644
index d0d856b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUnits.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiUnits.h"
-#include "lefiUnits.hpp"
-
-// Wrappers definitions.
-int lefiUnits_hasDatabase (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasDatabase();
-}
-
-int lefiUnits_hasCapacitance (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasCapacitance();
-}
-
-int lefiUnits_hasResistance (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasResistance();
-}
-
-int lefiUnits_hasTime (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasTime();
-}
-
-int lefiUnits_hasPower (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasPower();
-}
-
-int lefiUnits_hasCurrent (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasCurrent();
-}
-
-int lefiUnits_hasVoltage (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasVoltage();
-}
-
-int lefiUnits_hasFrequency (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->hasFrequency();
-}
-
-const char* lefiUnits_databaseName (const ::lefiUnits* obj) {
-    return ((const LefDefParser::lefiUnits*)obj)->databaseName();
-}
-
-double lefiUnits_databaseNumber (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->databaseNumber();
-}
-
-double lefiUnits_capacitance (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->capacitance();
-}
-
-double lefiUnits_resistance (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->resistance();
-}
-
-double lefiUnits_time (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->time();
-}
-
-double lefiUnits_power (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->power();
-}
-
-double lefiUnits_current (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->current();
-}
-
-double lefiUnits_voltage (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->voltage();
-}
-
-double lefiUnits_frequency (const ::lefiUnits* obj) {
-    return ((LefDefParser::lefiUnits*)obj)->frequency();
-}
-
-void lefiUnits_print (const ::lefiUnits* obj, FILE*  f) {
-    ((LefDefParser::lefiUnits*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUtil.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUtil.cpp
deleted file mode 100644
index 68416f3..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiUtil.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiUtil.h"
-#include "lefiUtil.hpp"
-
-// Wrappers definitions.
-int lefiValidUser () {
-    return LefDefParser::lefiValidUser();
-}
-
-char* lefiUser () {
-    return LefDefParser::lefiUser();
-}
-
-char* lefiOrientStr (int  orient) {
-    return LefDefParser::lefiOrientStr(orient);
-}
-
-double convert_name2num (const char * versionName) {
-    return LefDefParser::convert_name2num(versionName);
-}
-
-bool  validateMaskNumber (int  num) {
-    return LefDefParser::validateMaskNumber(num);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiVia.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiVia.cpp
deleted file mode 100644
index 03a6c91..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiVia.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiVia.h"
-#include "lefiVia.hpp"
-
-// Wrappers definitions.
-struct ::lefiGeomPolygon* lefiViaLayer_getPolygon (const ::lefiViaLayer* obj, int  index) {
-    return (::lefiGeomPolygon*) ((LefDefParser::lefiViaLayer*)obj)->getPolygon(index);
-}
-
-int lefiVia_hasDefault (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasDefault();
-}
-
-int lefiVia_hasGenerated (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasGenerated();
-}
-
-int lefiVia_hasForeign (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasForeign();
-}
-
-int lefiVia_hasForeignPnt (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasForeignPnt();
-}
-
-int lefiVia_hasForeignOrient (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasForeignOrient();
-}
-
-int lefiVia_hasProperties (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasProperties();
-}
-
-int lefiVia_hasResistance (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasResistance();
-}
-
-int lefiVia_hasTopOfStack (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasTopOfStack();
-}
-
-int lefiVia_numLayers (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->numLayers();
-}
-
-char* lefiVia_layerName (const ::lefiVia* obj, int  layerNum) {
-    return ((LefDefParser::lefiVia*)obj)->layerName(layerNum);
-}
-
-int lefiVia_numRects (const ::lefiVia* obj, int  layerNum) {
-    return ((LefDefParser::lefiVia*)obj)->numRects(layerNum);
-}
-
-double lefiVia_xl (const ::lefiVia* obj, int  layerNum, int  rectNum) {
-    return ((LefDefParser::lefiVia*)obj)->xl(layerNum, rectNum);
-}
-
-double lefiVia_yl (const ::lefiVia* obj, int  layerNum, int  rectNum) {
-    return ((LefDefParser::lefiVia*)obj)->yl(layerNum, rectNum);
-}
-
-double lefiVia_xh (const ::lefiVia* obj, int  layerNum, int  rectNum) {
-    return ((LefDefParser::lefiVia*)obj)->xh(layerNum, rectNum);
-}
-
-double lefiVia_yh (const ::lefiVia* obj, int  layerNum, int  rectNum) {
-    return ((LefDefParser::lefiVia*)obj)->yh(layerNum, rectNum);
-}
-
-int lefiVia_rectColorMask (const ::lefiVia* obj, int  layerNum, int  rectNum) {
-    return ((LefDefParser::lefiVia*)obj)->rectColorMask(layerNum, rectNum);
-}
-
-int lefiVia_polyColorMask (const ::lefiVia* obj, int  layerNum, int  polyNum) {
-    return ((LefDefParser::lefiVia*)obj)->polyColorMask(layerNum, polyNum);
-}
-
-int lefiVia_numPolygons (const ::lefiVia* obj, int  layerNum) {
-    return ((LefDefParser::lefiVia*)obj)->numPolygons(layerNum);
-}
-
-::lefiGeomPolygon lefiVia_getPolygon (const ::lefiVia* obj, int  layerNum, int  polyNum) {
-    LefDefParser::lefiGeomPolygon tmp;
-    tmp = ((LefDefParser::lefiVia*)obj)->getPolygon(layerNum, polyNum);
-    return *((::lefiGeomPolygon*)&tmp);
-}
-
-char* lefiVia_name (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->name();
-}
-
-double lefiVia_resistance (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->resistance();
-}
-
-int lefiVia_numProperties (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->numProperties();
-}
-
-char* lefiVia_propName (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propName(index);
-}
-
-char* lefiVia_propValue (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propValue(index);
-}
-
-double lefiVia_propNumber (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propNumber(index);
-}
-
-char lefiVia_propType (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propType(index);
-}
-
-int lefiVia_propIsNumber (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propIsNumber(index);
-}
-
-int lefiVia_propIsString (const ::lefiVia* obj, int  index) {
-    return ((LefDefParser::lefiVia*)obj)->propIsString(index);
-}
-
-char* lefiVia_foreign (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->foreign();
-}
-
-double lefiVia_foreignX (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->foreignX();
-}
-
-double lefiVia_foreignY (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->foreignY();
-}
-
-int lefiVia_foreignOrient (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->foreignOrient();
-}
-
-char* lefiVia_foreignOrientStr (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->foreignOrientStr();
-}
-
-int lefiVia_hasViaRule (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasViaRule();
-}
-
-const char* lefiVia_viaRuleName (const ::lefiVia* obj) {
-    return ((const LefDefParser::lefiVia*)obj)->viaRuleName();
-}
-
-double lefiVia_xCutSize (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xCutSize();
-}
-
-double lefiVia_yCutSize (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yCutSize();
-}
-
-const char* lefiVia_botMetalLayer (const ::lefiVia* obj) {
-    return ((const LefDefParser::lefiVia*)obj)->botMetalLayer();
-}
-
-const char* lefiVia_cutLayer (const ::lefiVia* obj) {
-    return ((const LefDefParser::lefiVia*)obj)->cutLayer();
-}
-
-const char* lefiVia_topMetalLayer (const ::lefiVia* obj) {
-    return ((const LefDefParser::lefiVia*)obj)->topMetalLayer();
-}
-
-double lefiVia_xCutSpacing (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xCutSpacing();
-}
-
-double lefiVia_yCutSpacing (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yCutSpacing();
-}
-
-double lefiVia_xBotEnc (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xBotEnc();
-}
-
-double lefiVia_yBotEnc (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yBotEnc();
-}
-
-double lefiVia_xTopEnc (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xTopEnc();
-}
-
-double lefiVia_yTopEnc (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yTopEnc();
-}
-
-int lefiVia_hasRowCol (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasRowCol();
-}
-
-int lefiVia_numCutRows (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->numCutRows();
-}
-
-int lefiVia_numCutCols (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->numCutCols();
-}
-
-int lefiVia_hasOrigin (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasOrigin();
-}
-
-double lefiVia_xOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xOffset();
-}
-
-double lefiVia_yOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yOffset();
-}
-
-int lefiVia_hasOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasOffset();
-}
-
-double lefiVia_xBotOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xBotOffset();
-}
-
-double lefiVia_yBotOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yBotOffset();
-}
-
-double lefiVia_xTopOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->xTopOffset();
-}
-
-double lefiVia_yTopOffset (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->yTopOffset();
-}
-
-int lefiVia_hasCutPattern (const ::lefiVia* obj) {
-    return ((LefDefParser::lefiVia*)obj)->hasCutPattern();
-}
-
-const char* lefiVia_cutPattern (const ::lefiVia* obj) {
-    return ((const LefDefParser::lefiVia*)obj)->cutPattern();
-}
-
-void lefiVia_print (const ::lefiVia* obj, FILE*  f) {
-    ((LefDefParser::lefiVia*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiViaRule.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiViaRule.cpp
deleted file mode 100644
index d341263..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefiViaRule.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefiViaRule.h"
-#include "lefiViaRule.hpp"
-
-// Wrappers definitions.
-int lefiViaRuleLayer_hasDirection (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasDirection();
-}
-
-int lefiViaRuleLayer_hasEnclosure (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasEnclosure();
-}
-
-int lefiViaRuleLayer_hasWidth (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasWidth();
-}
-
-int lefiViaRuleLayer_hasResistance (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasResistance();
-}
-
-int lefiViaRuleLayer_hasOverhang (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasOverhang();
-}
-
-int lefiViaRuleLayer_hasMetalOverhang (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasMetalOverhang();
-}
-
-int lefiViaRuleLayer_hasSpacing (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasSpacing();
-}
-
-int lefiViaRuleLayer_hasRect (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->hasRect();
-}
-
-char* lefiViaRuleLayer_name (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->name();
-}
-
-int lefiViaRuleLayer_isHorizontal (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->isHorizontal();
-}
-
-int lefiViaRuleLayer_isVertical (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->isVertical();
-}
-
-double lefiViaRuleLayer_enclosureOverhang1 (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->enclosureOverhang1();
-}
-
-double lefiViaRuleLayer_enclosureOverhang2 (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->enclosureOverhang2();
-}
-
-double lefiViaRuleLayer_widthMin (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->widthMin();
-}
-
-double lefiViaRuleLayer_widthMax (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->widthMax();
-}
-
-double lefiViaRuleLayer_overhang (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->overhang();
-}
-
-double lefiViaRuleLayer_metalOverhang (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->metalOverhang();
-}
-
-double lefiViaRuleLayer_resistance (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->resistance();
-}
-
-double lefiViaRuleLayer_spacingStepX (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->spacingStepX();
-}
-
-double lefiViaRuleLayer_spacingStepY (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->spacingStepY();
-}
-
-double lefiViaRuleLayer_xl (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->xl();
-}
-
-double lefiViaRuleLayer_yl (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->yl();
-}
-
-double lefiViaRuleLayer_xh (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->xh();
-}
-
-double lefiViaRuleLayer_yh (const ::lefiViaRuleLayer* obj) {
-    return ((LefDefParser::lefiViaRuleLayer*)obj)->yh();
-}
-
-void lefiViaRuleLayer_print (const ::lefiViaRuleLayer* obj, FILE*  f) {
-    ((LefDefParser::lefiViaRuleLayer*)obj)->print(f);
-}
-
-int lefiViaRule_hasGenerate (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->hasGenerate();
-}
-
-int lefiViaRule_hasDefault (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->hasDefault();
-}
-
-char* lefiViaRule_name (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->name();
-}
-
-int lefiViaRule_numLayers (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->numLayers();
-}
-
-const ::lefiViaRuleLayer* lefiViaRule_layer (const ::lefiViaRule* obj, int  index) {
-    return (const ::lefiViaRuleLayer*) ((LefDefParser::lefiViaRule*)obj)->layer(index);
-}
-
-int lefiViaRule_numVias (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->numVias();
-}
-
-char* lefiViaRule_viaName (const ::lefiViaRule* obj, int  index) {
-    return ((LefDefParser::lefiViaRule*)obj)->viaName(index);
-}
-
-int lefiViaRule_numProps (const ::lefiViaRule* obj) {
-    return ((LefDefParser::lefiViaRule*)obj)->numProps();
-}
-
-const char* lefiViaRule_propName (const ::lefiViaRule* obj, int  index) {
-    return ((const LefDefParser::lefiViaRule*)obj)->propName(index);
-}
-
-const char* lefiViaRule_propValue (const ::lefiViaRule* obj, int  index) {
-    return ((const LefDefParser::lefiViaRule*)obj)->propValue(index);
-}
-
-double lefiViaRule_propNumber (const ::lefiViaRule* obj, int  index) {
-    return ((LefDefParser::lefiViaRule*)obj)->propNumber(index);
-}
-
-const char lefiViaRule_propType (const ::lefiViaRule* obj, int  index) {
-    return ((const LefDefParser::lefiViaRule*)obj)->propType(index);
-}
-
-int lefiViaRule_propIsNumber (const ::lefiViaRule* obj, int  index) {
-    return ((LefDefParser::lefiViaRule*)obj)->propIsNumber(index);
-}
-
-int lefiViaRule_propIsString (const ::lefiViaRule* obj, int  index) {
-    return ((LefDefParser::lefiViaRule*)obj)->propIsString(index);
-}
-
-void lefiViaRule_print (const ::lefiViaRule* obj, FILE*  f) {
-    ((LefDefParser::lefiViaRule*)obj)->print(f);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefrReader.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefrReader.cpp
deleted file mode 100644
index 13e2f65..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefrReader.cpp
+++ /dev/null
@@ -1,751 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State: xxx $
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefrReader.h"
-#include "lefrReader.hpp"
-
-// Wrappers definitions.
-int lefrInit () {
-    return LefDefParser::lefrInit();
-}
-
-int lefrInitSession (int  startSession) {
-    return LefDefParser::lefrInitSession(startSession);
-}
-
-int lefrReset () {
-    return LefDefParser::lefrReset();
-}
-
-int lefrClear () {
-    return LefDefParser::lefrClear();
-}
-
-int lefrReleaseNResetMemory () {
-    return LefDefParser::lefrReleaseNResetMemory();
-}
-
-void lefrSetCommentChar (char  c) {
-    LefDefParser::lefrSetCommentChar(c);
-}
-
-void lefrSetShiftCase () {
-    LefDefParser::lefrSetShiftCase();
-}
-
-void lefrSetCaseSensitivity (int  caseSense) {
-    LefDefParser::lefrSetCaseSensitivity(caseSense);
-}
-
-const char * lefrFName () {
-    return LefDefParser::lefrFName();
-}
-
-int lefrRead (FILE * file, const char * fileName, lefiUserData  userData) {
-    return LefDefParser::lefrRead(file, fileName, userData);
-}
-
-void lefrSetRegisterUnusedCallbacks () {
-    LefDefParser::lefrSetRegisterUnusedCallbacks();
-}
-
-void lefrPrintUnusedCallbacks (FILE*  f) {
-    LefDefParser::lefrPrintUnusedCallbacks(f);
-}
-
-void lefrSetUserData (lefiUserData p0) {
-    LefDefParser::lefrSetUserData(p0);
-}
-
-lefiUserData lefrGetUserData () {
-    return LefDefParser::lefrGetUserData();
-}
-
-void lefrSetUnitsCbk (::lefrUnitsCbkFnType p0) {
-    LefDefParser::lefrSetUnitsCbk((LefDefParser::lefrUnitsCbkFnType) p0);
-}
-
-void lefrSetVersionCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetVersionCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetVersionStrCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetVersionStrCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetDividerCharCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetDividerCharCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetBusBitCharsCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetBusBitCharsCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetNoWireExtensionCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetNoWireExtensionCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetCaseSensitiveCbk (::lefrIntegerCbkFnType p0) {
-    LefDefParser::lefrSetCaseSensitiveCbk((LefDefParser::lefrIntegerCbkFnType) p0);
-}
-
-void lefrSetPropBeginCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetPropBeginCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetPropCbk (::lefrPropCbkFnType p0) {
-    LefDefParser::lefrSetPropCbk((LefDefParser::lefrPropCbkFnType) p0);
-}
-
-void lefrSetPropEndCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetPropEndCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetLayerCbk (::lefrLayerCbkFnType p0) {
-    LefDefParser::lefrSetLayerCbk((LefDefParser::lefrLayerCbkFnType) p0);
-}
-
-void lefrSetViaCbk (::lefrViaCbkFnType p0) {
-    LefDefParser::lefrSetViaCbk((LefDefParser::lefrViaCbkFnType) p0);
-}
-
-void lefrSetViaRuleCbk (::lefrViaRuleCbkFnType p0) {
-    LefDefParser::lefrSetViaRuleCbk((LefDefParser::lefrViaRuleCbkFnType) p0);
-}
-
-void lefrSetSpacingCbk (::lefrSpacingCbkFnType p0) {
-    LefDefParser::lefrSetSpacingCbk((LefDefParser::lefrSpacingCbkFnType) p0);
-}
-
-void lefrSetIRDropCbk (::lefrIRDropCbkFnType p0) {
-    LefDefParser::lefrSetIRDropCbk((LefDefParser::lefrIRDropCbkFnType) p0);
-}
-
-void lefrSetDielectricCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetDielectricCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetMinFeatureCbk (::lefrMinFeatureCbkFnType p0) {
-    LefDefParser::lefrSetMinFeatureCbk((LefDefParser::lefrMinFeatureCbkFnType) p0);
-}
-
-void lefrSetNonDefaultCbk (::lefrNonDefaultCbkFnType p0) {
-    LefDefParser::lefrSetNonDefaultCbk((LefDefParser::lefrNonDefaultCbkFnType) p0);
-}
-
-void lefrSetSiteCbk (::lefrSiteCbkFnType p0) {
-    LefDefParser::lefrSetSiteCbk((LefDefParser::lefrSiteCbkFnType) p0);
-}
-
-void lefrSetMacroBeginCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetMacroBeginCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetPinCbk (::lefrPinCbkFnType p0) {
-    LefDefParser::lefrSetPinCbk((LefDefParser::lefrPinCbkFnType) p0);
-}
-
-void lefrSetObstructionCbk (::lefrObstructionCbkFnType p0) {
-    LefDefParser::lefrSetObstructionCbk((LefDefParser::lefrObstructionCbkFnType) p0);
-}
-
-void lefrSetArrayCbk (::lefrArrayCbkFnType p0) {
-    LefDefParser::lefrSetArrayCbk((LefDefParser::lefrArrayCbkFnType) p0);
-}
-
-void lefrSetMacroCbk (::lefrMacroCbkFnType p0) {
-    LefDefParser::lefrSetMacroCbk((LefDefParser::lefrMacroCbkFnType) p0);
-}
-
-void lefrSetLibraryEndCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetLibraryEndCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetTimingCbk (::lefrTimingCbkFnType p0) {
-    LefDefParser::lefrSetTimingCbk((LefDefParser::lefrTimingCbkFnType) p0);
-}
-
-void lefrSetSpacingBeginCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetSpacingBeginCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetSpacingEndCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetSpacingEndCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetArrayBeginCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetArrayBeginCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetArrayEndCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetArrayEndCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetIRDropBeginCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetIRDropBeginCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetIRDropEndCbk (::lefrVoidCbkFnType p0) {
-    LefDefParser::lefrSetIRDropEndCbk((LefDefParser::lefrVoidCbkFnType) p0);
-}
-
-void lefrSetNoiseMarginCbk (::lefrNoiseMarginCbkFnType p0) {
-    LefDefParser::lefrSetNoiseMarginCbk((LefDefParser::lefrNoiseMarginCbkFnType) p0);
-}
-
-void lefrSetEdgeRateThreshold1Cbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetEdgeRateThreshold1Cbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetEdgeRateThreshold2Cbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetEdgeRateThreshold2Cbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetEdgeRateScaleFactorCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetEdgeRateScaleFactorCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetNoiseTableCbk (::lefrNoiseTableCbkFnType p0) {
-    LefDefParser::lefrSetNoiseTableCbk((LefDefParser::lefrNoiseTableCbkFnType) p0);
-}
-
-void lefrSetCorrectionTableCbk (::lefrCorrectionTableCbkFnType p0) {
-    LefDefParser::lefrSetCorrectionTableCbk((LefDefParser::lefrCorrectionTableCbkFnType) p0);
-}
-
-void lefrSetInputAntennaCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetInputAntennaCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetOutputAntennaCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetOutputAntennaCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetInoutAntennaCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetInoutAntennaCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetAntennaInputCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetAntennaInputCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetAntennaInoutCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetAntennaInoutCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetAntennaOutputCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetAntennaOutputCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetClearanceMeasureCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetClearanceMeasureCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetManufacturingCbk (::lefrDoubleCbkFnType p0) {
-    LefDefParser::lefrSetManufacturingCbk((LefDefParser::lefrDoubleCbkFnType) p0);
-}
-
-void lefrSetUseMinSpacingCbk (::lefrUseMinSpacingCbkFnType p0) {
-    LefDefParser::lefrSetUseMinSpacingCbk((LefDefParser::lefrUseMinSpacingCbkFnType) p0);
-}
-
-void lefrSetMacroClassTypeCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetMacroClassTypeCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetMacroOriginCbk (::lefrMacroNumCbkFnType p0) {
-    LefDefParser::lefrSetMacroOriginCbk((LefDefParser::lefrMacroNumCbkFnType) p0);
-}
-
-void lefrSetMacroSizeCbk (::lefrMacroNumCbkFnType p0) {
-    LefDefParser::lefrSetMacroSizeCbk((LefDefParser::lefrMacroNumCbkFnType) p0);
-}
-
-void lefrSetMacroFixedMaskCbk (::lefrIntegerCbkFnType p0) {
-    LefDefParser::lefrSetMacroFixedMaskCbk((LefDefParser::lefrIntegerCbkFnType) p0);
-}
-
-void lefrSetMacroEndCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetMacroEndCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetMaxStackViaCbk (::lefrMaxStackViaCbkFnType p0) {
-    LefDefParser::lefrSetMaxStackViaCbk((LefDefParser::lefrMaxStackViaCbkFnType) p0);
-}
-
-void lefrSetExtensionCbk (::lefrStringCbkFnType p0) {
-    LefDefParser::lefrSetExtensionCbk((LefDefParser::lefrStringCbkFnType) p0);
-}
-
-void lefrSetDensityCbk (::lefrDensityCbkFnType p0) {
-    LefDefParser::lefrSetDensityCbk((LefDefParser::lefrDensityCbkFnType) p0);
-}
-
-void lefrSetFixedMaskCbk (::lefrIntegerCbkFnType p0) {
-    LefDefParser::lefrSetFixedMaskCbk((LefDefParser::lefrIntegerCbkFnType) p0);
-}
-
-void lefrSetUnusedCallbacks (::lefrVoidCbkFnType  func) {
-    LefDefParser::lefrSetUnusedCallbacks((LefDefParser::lefrVoidCbkFnType ) func);
-}
-
-void lefrUnsetCallbacks () {
-    LefDefParser::lefrUnsetCallbacks();
-}
-
-void lefrUnsetAntennaInputCbk () {
-    LefDefParser::lefrUnsetAntennaInputCbk();
-}
-
-void lefrUnsetAntennaInoutCbk () {
-    LefDefParser::lefrUnsetAntennaInoutCbk();
-}
-
-void lefrUnsetAntennaOutputCbk () {
-    LefDefParser::lefrUnsetAntennaOutputCbk();
-}
-
-void lefrUnsetArrayBeginCbk () {
-    LefDefParser::lefrUnsetArrayBeginCbk();
-}
-
-void lefrUnsetArrayCbk () {
-    LefDefParser::lefrUnsetArrayCbk();
-}
-
-void lefrUnsetArrayEndCbk () {
-    LefDefParser::lefrUnsetArrayEndCbk();
-}
-
-void lefrUnsetBusBitCharsCbk () {
-    LefDefParser::lefrUnsetBusBitCharsCbk();
-}
-
-void lefrUnsetCaseSensitiveCbk () {
-    LefDefParser::lefrUnsetCaseSensitiveCbk();
-}
-
-void lefrUnsetClearanceMeasureCbk () {
-    LefDefParser::lefrUnsetClearanceMeasureCbk();
-}
-
-void lefrUnsetCorrectionTableCbk () {
-    LefDefParser::lefrUnsetCorrectionTableCbk();
-}
-
-void lefrUnsetDensityCbk () {
-    LefDefParser::lefrUnsetDensityCbk();
-}
-
-void lefrUnsetDielectricCbk () {
-    LefDefParser::lefrUnsetDielectricCbk();
-}
-
-void lefrUnsetDividerCharCbk () {
-    LefDefParser::lefrUnsetDividerCharCbk();
-}
-
-void lefrUnsetEdgeRateScaleFactorCbk () {
-    LefDefParser::lefrUnsetEdgeRateScaleFactorCbk();
-}
-
-void lefrUnsetEdgeRateThreshold1Cbk () {
-    LefDefParser::lefrUnsetEdgeRateThreshold1Cbk();
-}
-
-void lefrUnsetEdgeRateThreshold2Cbk () {
-    LefDefParser::lefrUnsetEdgeRateThreshold2Cbk();
-}
-
-void lefrUnsetExtensionCbk () {
-    LefDefParser::lefrUnsetExtensionCbk();
-}
-
-void lefrUnsetInoutAntennaCbk () {
-    LefDefParser::lefrUnsetInoutAntennaCbk();
-}
-
-void lefrUnsetInputAntennaCbk () {
-    LefDefParser::lefrUnsetInputAntennaCbk();
-}
-
-void lefrUnsetIRDropBeginCbk () {
-    LefDefParser::lefrUnsetIRDropBeginCbk();
-}
-
-void lefrUnsetIRDropCbk () {
-    LefDefParser::lefrUnsetIRDropCbk();
-}
-
-void lefrUnsetIRDropEndCbk () {
-    LefDefParser::lefrUnsetIRDropEndCbk();
-}
-
-void lefrUnsetLayerCbk () {
-    LefDefParser::lefrUnsetLayerCbk();
-}
-
-void lefrUnsetLibraryEndCbk () {
-    LefDefParser::lefrUnsetLibraryEndCbk();
-}
-
-void lefrUnsetMacroBeginCbk () {
-    LefDefParser::lefrUnsetMacroBeginCbk();
-}
-
-void lefrUnsetMacroCbk () {
-    LefDefParser::lefrUnsetMacroCbk();
-}
-
-void lefrUnsetMacroClassTypeCbk () {
-    LefDefParser::lefrUnsetMacroClassTypeCbk();
-}
-
-void lefrUnsetMacroEndCbk () {
-    LefDefParser::lefrUnsetMacroEndCbk();
-}
-
-void lefrUnsetMacroOriginCbk () {
-    LefDefParser::lefrUnsetMacroOriginCbk();
-}
-
-void lefrUnsetMacroSizeCbk () {
-    LefDefParser::lefrUnsetMacroSizeCbk();
-}
-
-void lefrUnsetManufacturingCbk () {
-    LefDefParser::lefrUnsetManufacturingCbk();
-}
-
-void lefrUnsetMaxStackViaCbk () {
-    LefDefParser::lefrUnsetMaxStackViaCbk();
-}
-
-void lefrUnsetMinFeatureCbk () {
-    LefDefParser::lefrUnsetMinFeatureCbk();
-}
-
-void lefrUnsetNoiseMarginCbk () {
-    LefDefParser::lefrUnsetNoiseMarginCbk();
-}
-
-void lefrUnsetNoiseTableCbk () {
-    LefDefParser::lefrUnsetNoiseTableCbk();
-}
-
-void lefrUnsetNonDefaultCbk () {
-    LefDefParser::lefrUnsetNonDefaultCbk();
-}
-
-void lefrUnsetNoWireExtensionCbk () {
-    LefDefParser::lefrUnsetNoWireExtensionCbk();
-}
-
-void lefrUnsetObstructionCbk () {
-    LefDefParser::lefrUnsetObstructionCbk();
-}
-
-void lefrUnsetOutputAntennaCbk () {
-    LefDefParser::lefrUnsetOutputAntennaCbk();
-}
-
-void lefrUnsetPinCbk () {
-    LefDefParser::lefrUnsetPinCbk();
-}
-
-void lefrUnsetPropBeginCbk () {
-    LefDefParser::lefrUnsetPropBeginCbk();
-}
-
-void lefrUnsetPropCbk () {
-    LefDefParser::lefrUnsetPropCbk();
-}
-
-void lefrUnsetPropEndCbk () {
-    LefDefParser::lefrUnsetPropEndCbk();
-}
-
-void lefrUnsetSiteCbk () {
-    LefDefParser::lefrUnsetSiteCbk();
-}
-
-void lefrUnsetSpacingBeginCbk () {
-    LefDefParser::lefrUnsetSpacingBeginCbk();
-}
-
-void lefrUnsetSpacingCbk () {
-    LefDefParser::lefrUnsetSpacingCbk();
-}
-
-void lefrUnsetSpacingEndCbk () {
-    LefDefParser::lefrUnsetSpacingEndCbk();
-}
-
-void lefrUnsetTimingCbk () {
-    LefDefParser::lefrUnsetTimingCbk();
-}
-
-void lefrUnsetUseMinSpacingCbk () {
-    LefDefParser::lefrUnsetUseMinSpacingCbk();
-}
-
-void lefrUnsetUnitsCbk () {
-    LefDefParser::lefrUnsetUnitsCbk();
-}
-
-void lefrUnsetVersionCbk () {
-    LefDefParser::lefrUnsetVersionCbk();
-}
-
-void lefrUnsetVersionStrCbk () {
-    LefDefParser::lefrUnsetVersionStrCbk();
-}
-
-void lefrUnsetViaCbk () {
-    LefDefParser::lefrUnsetViaCbk();
-}
-
-void lefrUnsetViaRuleCbk () {
-    LefDefParser::lefrUnsetViaRuleCbk();
-}
-
-int lefrLineNumber () {
-    return LefDefParser::lefrLineNumber();
-}
-
-void lefrSetLogFunction (::LEFI_LOG_FUNCTION p0) {
-    LefDefParser::lefrSetLogFunction(p0);
-}
-
-void lefrSetWarningLogFunction (::LEFI_WARNING_LOG_FUNCTION p0) {
-    LefDefParser::lefrSetWarningLogFunction(p0);
-}
-
-void lefrSetMallocFunction (::LEFI_MALLOC_FUNCTION p0) {
-    LefDefParser::lefrSetMallocFunction(p0);
-}
-
-void lefrSetReallocFunction (::LEFI_REALLOC_FUNCTION p0) {
-    LefDefParser::lefrSetReallocFunction(p0);
-}
-
-void lefrSetFreeFunction (::LEFI_FREE_FUNCTION p0) {
-    LefDefParser::lefrSetFreeFunction(p0);
-}
-
-void lefrSetLineNumberFunction (::LEFI_LINE_NUMBER_FUNCTION p0) {
-    LefDefParser::lefrSetLineNumberFunction(p0);
-}
-
-void lefrSetDeltaNumberLines (int p0) {
-    LefDefParser::lefrSetDeltaNumberLines(p0);
-}
-
-void lefrSetRelaxMode () {
-    LefDefParser::lefrSetRelaxMode();
-}
-
-void lefrUnsetRelaxMode () {
-    LefDefParser::lefrUnsetRelaxMode();
-}
-
-void lefrSetVersionValue (const  char*   version) {
-    LefDefParser::lefrSetVersionValue(version);
-}
-
-void lefrSetReadFunction (::LEFI_READ_FUNCTION p0) {
-    LefDefParser::lefrSetReadFunction(p0);
-}
-
-void lefrUnsetReadFunction () {
-    LefDefParser::lefrUnsetReadFunction();
-}
-
-void lefrSetOpenLogFileAppend () {
-    LefDefParser::lefrSetOpenLogFileAppend();
-}
-
-void lefrUnsetOpenLogFileAppend () {
-    LefDefParser::lefrUnsetOpenLogFileAppend();
-}
-
-void lefrDisablePropStrProcess () {
-    LefDefParser::lefrDisablePropStrProcess();
-}
-
-void lefrSetAntennaInoutWarnings (int  warn) {
-    LefDefParser::lefrSetAntennaInoutWarnings(warn);
-}
-
-void lefrSetAntennaInputWarnings (int  warn) {
-    LefDefParser::lefrSetAntennaInputWarnings(warn);
-}
-
-void lefrSetAntennaOutputWarnings (int  warn) {
-    LefDefParser::lefrSetAntennaOutputWarnings(warn);
-}
-
-void lefrSetArrayWarnings (int  warn) {
-    LefDefParser::lefrSetArrayWarnings(warn);
-}
-
-void lefrSetCaseSensitiveWarnings (int  warn) {
-    LefDefParser::lefrSetCaseSensitiveWarnings(warn);
-}
-
-void lefrSetCorrectionTableWarnings (int  warn) {
-    LefDefParser::lefrSetCorrectionTableWarnings(warn);
-}
-
-void lefrSetDielectricWarnings (int  warn) {
-    LefDefParser::lefrSetDielectricWarnings(warn);
-}
-
-void lefrSetEdgeRateThreshold1Warnings (int  warn) {
-    LefDefParser::lefrSetEdgeRateThreshold1Warnings(warn);
-}
-
-void lefrSetEdgeRateThreshold2Warnings (int  warn) {
-    LefDefParser::lefrSetEdgeRateThreshold2Warnings(warn);
-}
-
-void lefrSetEdgeRateScaleFactorWarnings (int  warn) {
-    LefDefParser::lefrSetEdgeRateScaleFactorWarnings(warn);
-}
-
-void lefrSetInoutAntennaWarnings (int  warn) {
-    LefDefParser::lefrSetInoutAntennaWarnings(warn);
-}
-
-void lefrSetInputAntennaWarnings (int  warn) {
-    LefDefParser::lefrSetInputAntennaWarnings(warn);
-}
-
-void lefrSetIRDropWarnings (int  warn) {
-    LefDefParser::lefrSetIRDropWarnings(warn);
-}
-
-void lefrSetLayerWarnings (int  warn) {
-    LefDefParser::lefrSetLayerWarnings(warn);
-}
-
-void lefrSetMacroWarnings (int  warn) {
-    LefDefParser::lefrSetMacroWarnings(warn);
-}
-
-void lefrSetMaxStackViaWarnings (int  warn) {
-    LefDefParser::lefrSetMaxStackViaWarnings(warn);
-}
-
-void lefrSetMinFeatureWarnings (int  warn) {
-    LefDefParser::lefrSetMinFeatureWarnings(warn);
-}
-
-void lefrSetNoiseMarginWarnings (int  warn) {
-    LefDefParser::lefrSetNoiseMarginWarnings(warn);
-}
-
-void lefrSetNoiseTableWarnings (int  warn) {
-    LefDefParser::lefrSetNoiseTableWarnings(warn);
-}
-
-void lefrSetNonDefaultWarnings (int  warn) {
-    LefDefParser::lefrSetNonDefaultWarnings(warn);
-}
-
-void lefrSetNoWireExtensionWarnings (int  warn) {
-    LefDefParser::lefrSetNoWireExtensionWarnings(warn);
-}
-
-void lefrSetOutputAntennaWarnings (int  warn) {
-    LefDefParser::lefrSetOutputAntennaWarnings(warn);
-}
-
-void lefrSetPinWarnings (int  warn) {
-    LefDefParser::lefrSetPinWarnings(warn);
-}
-
-void lefrSetSiteWarnings (int  warn) {
-    LefDefParser::lefrSetSiteWarnings(warn);
-}
-
-void lefrSetSpacingWarnings (int  warn) {
-    LefDefParser::lefrSetSpacingWarnings(warn);
-}
-
-void lefrSetTimingWarnings (int  warn) {
-    LefDefParser::lefrSetTimingWarnings(warn);
-}
-
-void lefrSetUnitsWarnings (int  warn) {
-    LefDefParser::lefrSetUnitsWarnings(warn);
-}
-
-void lefrSetUseMinSpacingWarnings (int  warn) {
-    LefDefParser::lefrSetUseMinSpacingWarnings(warn);
-}
-
-void lefrSetViaRuleWarnings (int  warn) {
-    LefDefParser::lefrSetViaRuleWarnings(warn);
-}
-
-void lefrSetViaWarnings (int  warn) {
-    LefDefParser::lefrSetViaWarnings(warn);
-}
-
-void lefrDisableParserMsgs (int  nMsg, int*  msgs) {
-    LefDefParser::lefrDisableParserMsgs(nMsg, msgs);
-}
-
-void lefrEnableParserMsgs (int  nMsg, int*  msgs) {
-    LefDefParser::lefrEnableParserMsgs(nMsg, msgs);
-}
-
-void lefrEnableAllMsgs () {
-    LefDefParser::lefrEnableAllMsgs();
-}
-
-void lefrDisableAllMsgs () {
-    LefDefParser::lefrDisableAllMsgs();
-}
-
-void lefrSetTotalMsgLimit (int  totNumMsgs) {
-    LefDefParser::lefrSetTotalMsgLimit(totNumMsgs);
-}
-
-void lefrSetLimitPerMsg (int  msgId, int  numMsg) {
-    LefDefParser::lefrSetLimitPerMsg(msgId, numMsg);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriter.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriter.cpp
deleted file mode 100644
index cffd941..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriter.cpp
+++ /dev/null
@@ -1,1303 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefwWriter.h"
-#include "lefwWriter.hpp"
-
-// Wrappers definitions.
-int lefwInit (FILE*  f) {
-    return LefDefParser::lefwInit(f);
-}
-
-int lefwInitCbk (FILE*  f) {
-    return LefDefParser::lefwInitCbk(f);
-}
-
-int lefwEncrypt () {
-    return LefDefParser::lefwEncrypt();
-}
-
-int lefwCloseEncrypt () {
-    return LefDefParser::lefwCloseEncrypt();
-}
-
-int lefwNewLine () {
-    return LefDefParser::lefwNewLine();
-}
-
-int lefwVersion (int  vers1, int  vers2) {
-    return LefDefParser::lefwVersion(vers1, vers2);
-}
-
-int lefwCaseSensitive (const char*  caseSensitive) {
-    return LefDefParser::lefwCaseSensitive(caseSensitive);
-}
-
-int lefwNoWireExtensionAtPin (const char*  noWireExt) {
-    return LefDefParser::lefwNoWireExtensionAtPin(noWireExt);
-}
-
-int lefwMinfeature (double  minFeatureX, double  minFeatureY) {
-    return LefDefParser::lefwMinfeature(minFeatureX, minFeatureY);
-}
-
-int lefwDielectric (double  dielectric) {
-    return LefDefParser::lefwDielectric(dielectric);
-}
-
-int lefwBusBitChars (const char*  busBitChars) {
-    return LefDefParser::lefwBusBitChars(busBitChars);
-}
-
-int lefwDividerChar (const char*  dividerChar) {
-    return LefDefParser::lefwDividerChar(dividerChar);
-}
-
-int lefwManufacturingGrid (double  grid) {
-    return LefDefParser::lefwManufacturingGrid(grid);
-}
-
-int lefwFixedMask () {
-    return LefDefParser::lefwFixedMask();
-}
-
-int lefwUseMinSpacing (const char*  type, const char*  onOff) {
-    return LefDefParser::lefwUseMinSpacing(type, onOff);
-}
-
-int lefwClearanceMeasure (const char*  type) {
-    return LefDefParser::lefwClearanceMeasure(type);
-}
-
-int lefwAntennaInputGateArea (double  inputGateArea) {
-    return LefDefParser::lefwAntennaInputGateArea(inputGateArea);
-}
-
-int lefwAntennaInOutDiffArea (double  inOutDiffArea) {
-    return LefDefParser::lefwAntennaInOutDiffArea(inOutDiffArea);
-}
-
-int lefwAntennaOutputDiffArea (double  outputDiffArea) {
-    return LefDefParser::lefwAntennaOutputDiffArea(outputDiffArea);
-}
-
-int lefwStartUnits () {
-    return LefDefParser::lefwStartUnits();
-}
-
-int lefwUnits (double  time, double  capacitance, double  resistance, double  power, double  current, double  voltage, double  database) {
-    return LefDefParser::lefwUnits(time, capacitance, resistance, power, current, voltage, database);
-}
-
-int lefwUnitsFrequency (double  frequency) {
-    return LefDefParser::lefwUnitsFrequency(frequency);
-}
-
-int lefwEndUnits () {
-    return LefDefParser::lefwEndUnits();
-}
-
-int lefwStartLayer (const char*  layerName, const char*  type) {
-    return LefDefParser::lefwStartLayer(layerName, type);
-}
-
-int lefwLayerMask (int  maskColor) {
-    return LefDefParser::lefwLayerMask(maskColor);
-}
-
-int lefwLayerWidth (double  minWidth) {
-    return LefDefParser::lefwLayerWidth(minWidth);
-}
-
-int lefwLayerCutSpacing (double  spacing) {
-    return LefDefParser::lefwLayerCutSpacing(spacing);
-}
-
-int lefwLayerCutSpacingCenterToCenter () {
-    return LefDefParser::lefwLayerCutSpacingCenterToCenter();
-}
-
-int lefwLayerCutSpacingSameNet () {
-    return LefDefParser::lefwLayerCutSpacingSameNet();
-}
-
-int lefwLayerCutSpacingLayer (const char*  name2, int  stack) {
-    return LefDefParser::lefwLayerCutSpacingLayer(name2, stack);
-}
-
-int lefwLayerCutSpacingAdjacent (int  viaCuts, double  distance, int  stack) {
-    return LefDefParser::lefwLayerCutSpacingAdjacent(viaCuts, distance, stack);
-}
-
-int lefwLayerCutSpacingParallel () {
-    return LefDefParser::lefwLayerCutSpacingParallel();
-}
-
-int lefwLayerCutSpacingArea (double  cutArea) {
-    return LefDefParser::lefwLayerCutSpacingArea(cutArea);
-}
-
-int lefwLayerCutSpacingEnd () {
-    return LefDefParser::lefwLayerCutSpacingEnd();
-}
-
-int lefwLayerCutSpacingTableOrtho (int  numSpacing, double*  cutWithins, double*  orthoSpacings) {
-    return LefDefParser::lefwLayerCutSpacingTableOrtho(numSpacing, cutWithins, orthoSpacings);
-}
-
-int lefwLayerArraySpacing (int  longArray, double  viaWidth, double  cutSpacing, int  numArrayCut, int*  arrayCuts, double*  arraySpacings) {
-    return LefDefParser::lefwLayerArraySpacing(longArray, viaWidth, cutSpacing, numArrayCut, arrayCuts, arraySpacings);
-}
-
-int lefwLayerEnclosure (const char*  location, double  overhang1, double  overhang2, double  width) {
-    return LefDefParser::lefwLayerEnclosure(location, overhang1, overhang2, width);
-}
-
-int lefwLayerEnclosureWidth (const char*  location, double  overhang1, double  overhang2, double  width, double  cutWithin) {
-    return LefDefParser::lefwLayerEnclosureWidth(location, overhang1, overhang2, width, cutWithin);
-}
-
-int lefwLayerEnclosureLength (const char*  location, double  overhang1, double  overhang2, double  minLength) {
-    return LefDefParser::lefwLayerEnclosureLength(location, overhang1, overhang2, minLength);
-}
-
-int lefwLayerPreferEnclosure (const char*  location, double  overhang1, double  overhang2, double  width) {
-    return LefDefParser::lefwLayerPreferEnclosure(location, overhang1, overhang2, width);
-}
-
-int lefwLayerResistancePerCut (double  resistance) {
-    return LefDefParser::lefwLayerResistancePerCut(resistance);
-}
-
-int lefwEndLayer (const char*  layerName) {
-    return LefDefParser::lefwEndLayer(layerName);
-}
-
-int lefwStartLayerRouting (const char*  layerName) {
-    return LefDefParser::lefwStartLayerRouting(layerName);
-}
-
-int lefwLayerRouting (const char*  direction, double  width) {
-    return LefDefParser::lefwLayerRouting(direction, width);
-}
-
-int lefwLayerRoutingPitch (double  pitch) {
-    return LefDefParser::lefwLayerRoutingPitch(pitch);
-}
-
-int lefwLayerRoutingPitchXYDistance (double  xDistance, double  yDistance) {
-    return LefDefParser::lefwLayerRoutingPitchXYDistance(xDistance, yDistance);
-}
-
-int lefwLayerRoutingDiagPitch (double  distance) {
-    return LefDefParser::lefwLayerRoutingDiagPitch(distance);
-}
-
-int lefwLayerRoutingDiagPitchXYDistance (double  diag45Distance, double  diag135Distance) {
-    return LefDefParser::lefwLayerRoutingDiagPitchXYDistance(diag45Distance, diag135Distance);
-}
-
-int lefwLayerRoutingDiagWidth (double  diagWidth) {
-    return LefDefParser::lefwLayerRoutingDiagWidth(diagWidth);
-}
-
-int lefwLayerRoutingDiagSpacing (double  diagSpacing) {
-    return LefDefParser::lefwLayerRoutingDiagSpacing(diagSpacing);
-}
-
-int lefwLayerRoutingDiagMinEdgeLength (double  diagLength) {
-    return LefDefParser::lefwLayerRoutingDiagMinEdgeLength(diagLength);
-}
-
-int lefwLayerRoutingOffset (double  offset) {
-    return LefDefParser::lefwLayerRoutingOffset(offset);
-}
-
-int lefwLayerRoutingOffsetXYDistance (double  xDistance, double  yDistance) {
-    return LefDefParser::lefwLayerRoutingOffsetXYDistance(xDistance, yDistance);
-}
-
-int lefwLayerRoutingArea (double  area) {
-    return LefDefParser::lefwLayerRoutingArea(area);
-}
-
-int lefwLayerRoutingMinsize (int  numRect, double*  minWidth, double*  minLength) {
-    return LefDefParser::lefwLayerRoutingMinsize(numRect, minWidth, minLength);
-}
-
-int lefwLayerRoutingMinimumcut (double  numCuts, double  minWidth) {
-    return LefDefParser::lefwLayerRoutingMinimumcut(numCuts, minWidth);
-}
-
-int lefwLayerRoutingMinimumcutWithin (double  numCuts, double  minWidth, double  cutDistance) {
-    return LefDefParser::lefwLayerRoutingMinimumcutWithin(numCuts, minWidth, cutDistance);
-}
-
-int lefwLayerRoutingMinimumcutConnections (const char*  direction) {
-    return LefDefParser::lefwLayerRoutingMinimumcutConnections(direction);
-}
-
-int lefwLayerRoutingMinimumcutLengthWithin (double  length, double  distance) {
-    return LefDefParser::lefwLayerRoutingMinimumcutLengthWithin(length, distance);
-}
-
-int lefwLayerRoutingSpacing (double  spacing) {
-    return LefDefParser::lefwLayerRoutingSpacing(spacing);
-}
-
-int lefwLayerRoutingSpacingRange (double  minWidth, double  maxWidth) {
-    return LefDefParser::lefwLayerRoutingSpacingRange(minWidth, maxWidth);
-}
-
-int lefwLayerRoutingSpacingRangeUseLengthThreshold () {
-    return LefDefParser::lefwLayerRoutingSpacingRangeUseLengthThreshold();
-}
-
-int lefwLayerRoutingSpacingRangeInfluence (double  infValue, double  subMinWidth, double  subMaxWidth) {
-    return LefDefParser::lefwLayerRoutingSpacingRangeInfluence(infValue, subMinWidth, subMaxWidth);
-}
-
-int lefwLayerRoutingSpacingRangeRange (double  minWidth, double  maxWidth) {
-    return LefDefParser::lefwLayerRoutingSpacingRangeRange(minWidth, maxWidth);
-}
-
-int lefwLayerRoutingSpacingLengthThreshold (double  lengthValue, double  minWidth, double  maxWidth) {
-    return LefDefParser::lefwLayerRoutingSpacingLengthThreshold(lengthValue, minWidth, maxWidth);
-}
-
-int lefwLayerRoutingSpacingSameNet (int  PGOnly) {
-    return LefDefParser::lefwLayerRoutingSpacingSameNet(PGOnly);
-}
-
-int lefwLayerRoutingSpacingEndOfLine (double  eolWidth, double  eolWithin) {
-    return LefDefParser::lefwLayerRoutingSpacingEndOfLine(eolWidth, eolWithin);
-}
-
-int lefwLayerRoutingSpacingEOLParallel (double  parSpace, double  parWithin, int  twoEdges) {
-    return LefDefParser::lefwLayerRoutingSpacingEOLParallel(parSpace, parWithin, twoEdges);
-}
-
-int lefwLayerRoutingSpacingNotchLength (double  minNLength) {
-    return LefDefParser::lefwLayerRoutingSpacingNotchLength(minNLength);
-}
-
-int lefwLayerRoutingSpacingEndOfNotchWidth (double  eonWidth, double  minNSpacing, double  minNLength) {
-    return LefDefParser::lefwLayerRoutingSpacingEndOfNotchWidth(eonWidth, minNSpacing, minNLength);
-}
-
-int lefwLayerRoutingWireExtension (double  wireExtension) {
-    return LefDefParser::lefwLayerRoutingWireExtension(wireExtension);
-}
-
-int lefwLayerRoutingResistance (const char*  resistance) {
-    return LefDefParser::lefwLayerRoutingResistance(resistance);
-}
-
-int lefwLayerRoutingCapacitance (const char*  capacitance) {
-    return LefDefParser::lefwLayerRoutingCapacitance(capacitance);
-}
-
-int lefwLayerRoutingHeight (double  height) {
-    return LefDefParser::lefwLayerRoutingHeight(height);
-}
-
-int lefwLayerRoutingThickness (double  thickness) {
-    return LefDefParser::lefwLayerRoutingThickness(thickness);
-}
-
-int lefwLayerRoutingShrinkage (double  shrinkage) {
-    return LefDefParser::lefwLayerRoutingShrinkage(shrinkage);
-}
-
-int lefwLayerRoutingCapMultiplier (double  capMultiplier) {
-    return LefDefParser::lefwLayerRoutingCapMultiplier(capMultiplier);
-}
-
-int lefwLayerRoutingEdgeCap (double  edgeCap) {
-    return LefDefParser::lefwLayerRoutingEdgeCap(edgeCap);
-}
-
-int lefwLayerRoutingAntennaArea (double  antennaArea) {
-    return LefDefParser::lefwLayerRoutingAntennaArea(antennaArea);
-}
-
-int lefwLayerRoutingAntennaLength (double  antennaLength) {
-    return LefDefParser::lefwLayerRoutingAntennaLength(antennaLength);
-}
-
-int lefwLayerRoutingMaxwidth (double  width) {
-    return LefDefParser::lefwLayerRoutingMaxwidth(width);
-}
-
-int lefwLayerRoutingMinwidth (double  width) {
-    return LefDefParser::lefwLayerRoutingMinwidth(width);
-}
-
-int lefwLayerRoutingMinenclosedarea (int  numMinenclosed, double*  area, double*  width) {
-    return LefDefParser::lefwLayerRoutingMinenclosedarea(numMinenclosed, area, width);
-}
-
-int lefwLayerRoutingMinstep (double  distance) {
-    return LefDefParser::lefwLayerRoutingMinstep(distance);
-}
-
-int lefwLayerRoutingMinstepWithOptions (double  distance, const char*  rule, double  maxLength) {
-    return LefDefParser::lefwLayerRoutingMinstepWithOptions(distance, rule, maxLength);
-}
-
-int lefwLayerRoutingMinstepMaxEdges (double  distance, double  maxEdges) {
-    return LefDefParser::lefwLayerRoutingMinstepMaxEdges(distance, maxEdges);
-}
-
-int lefwLayerRoutingProtrusion (double  width1, double  length, double  width2) {
-    return LefDefParser::lefwLayerRoutingProtrusion(width1, length, width2);
-}
-
-int lefwLayerRoutingStartSpacingtableParallel (int  numLength, double*  length) {
-    return LefDefParser::lefwLayerRoutingStartSpacingtableParallel(numLength, length);
-}
-
-int lefwLayerRoutingSpacingtableParallelWidth (double  width, int  numSpacing, double*  spacing) {
-    return LefDefParser::lefwLayerRoutingSpacingtableParallelWidth(width, numSpacing, spacing);
-}
-
-int lefwLayerRoutingStartSpacingtableInfluence () {
-    return LefDefParser::lefwLayerRoutingStartSpacingtableInfluence();
-}
-
-int lefwLayerRoutingSpacingInfluenceWidth (double  width, double  distance, double  spacing) {
-    return LefDefParser::lefwLayerRoutingSpacingInfluenceWidth(width, distance, spacing);
-}
-
-int lefwLayerRoutingStartSpacingtableTwoWidths () {
-    return LefDefParser::lefwLayerRoutingStartSpacingtableTwoWidths();
-}
-
-int lefwLayerRoutingSpacingtableTwoWidthsWidth (double  width, double  runLength, int  numSpacing, double*  spacing) {
-    return LefDefParser::lefwLayerRoutingSpacingtableTwoWidthsWidth(width, runLength, numSpacing, spacing);
-}
-
-int lefwLayerRoutineEndSpacingtable () {
-    return LefDefParser::lefwLayerRoutineEndSpacingtable();
-}
-
-int lefwEndLayerRouting (const char*  layerName) {
-    return LefDefParser::lefwEndLayerRouting(layerName);
-}
-
-int lefwLayerACCurrentDensity (const char*  type, double  value) {
-    return LefDefParser::lefwLayerACCurrentDensity(type, value);
-}
-
-int lefwLayerACFrequency (int  numFrequency, double*  frequency) {
-    return LefDefParser::lefwLayerACFrequency(numFrequency, frequency);
-}
-
-int lefwLayerACWidth (int  numWidths, double*  widths) {
-    return LefDefParser::lefwLayerACWidth(numWidths, widths);
-}
-
-int lefwLayerACCutarea (int  numCutareas, double*  cutareas) {
-    return LefDefParser::lefwLayerACCutarea(numCutareas, cutareas);
-}
-
-int lefwLayerACTableEntries (int  numEntries, double*  entries) {
-    return LefDefParser::lefwLayerACTableEntries(numEntries, entries);
-}
-
-int lefwLayerDCCurrentDensity (const char*  type, double  value) {
-    return LefDefParser::lefwLayerDCCurrentDensity(type, value);
-}
-
-int lefwLayerDCWidth (int  numWidths, double*  widths) {
-    return LefDefParser::lefwLayerDCWidth(numWidths, widths);
-}
-
-int lefwLayerDCCutarea (int  numCutareas, double*  cutareas) {
-    return LefDefParser::lefwLayerDCCutarea(numCutareas, cutareas);
-}
-
-int lefwLayerDCTableEntries (int  numEntries, double*  entries) {
-    return LefDefParser::lefwLayerDCTableEntries(numEntries, entries);
-}
-
-int lefwLayerAntennaModel (const char*  oxide) {
-    return LefDefParser::lefwLayerAntennaModel(oxide);
-}
-
-int lefwLayerAntennaAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaAreaRatio(value);
-}
-
-int lefwLayerAntennaDiffAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaDiffAreaRatio(value);
-}
-
-int lefwLayerAntennaDiffAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios) {
-    return LefDefParser::lefwLayerAntennaDiffAreaRatioPwl(numPwls, diffusions, ratios);
-}
-
-int lefwLayerAntennaCumAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaCumAreaRatio(value);
-}
-
-int lefwLayerAntennaCumDiffAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaCumDiffAreaRatio(value);
-}
-
-int lefwLayerAntennaCumDiffAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios) {
-    return LefDefParser::lefwLayerAntennaCumDiffAreaRatioPwl(numPwls, diffusions, ratios);
-}
-
-int lefwLayerAntennaAreaFactor (double  value, const char*  diffUseOnly) {
-    return LefDefParser::lefwLayerAntennaAreaFactor(value, diffUseOnly);
-}
-
-int lefwLayerAntennaSideAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaSideAreaRatio(value);
-}
-
-int lefwLayerAntennaDiffSideAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaDiffSideAreaRatio(value);
-}
-
-int lefwLayerAntennaDiffSideAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios) {
-    return LefDefParser::lefwLayerAntennaDiffSideAreaRatioPwl(numPwls, diffusions, ratios);
-}
-
-int lefwLayerAntennaCumSideAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaCumSideAreaRatio(value);
-}
-
-int lefwLayerAntennaCumDiffSideAreaRatio (double  value) {
-    return LefDefParser::lefwLayerAntennaCumDiffSideAreaRatio(value);
-}
-
-int lefwLayerAntennaCumDiffSideAreaRatioPwl (int  numPwls, double*  diffusions, double*  ratios) {
-    return LefDefParser::lefwLayerAntennaCumDiffSideAreaRatioPwl(numPwls, diffusions, ratios);
-}
-
-int lefwLayerAntennaSideAreaFactor (double  value, const char*  diffUseOnly) {
-    return LefDefParser::lefwLayerAntennaSideAreaFactor(value, diffUseOnly);
-}
-
-int lefwLayerAntennaCumRoutingPlusCut () {
-    return LefDefParser::lefwLayerAntennaCumRoutingPlusCut();
-}
-
-int lefwLayerAntennaGatePlusDiff (double  plusDiffFactor) {
-    return LefDefParser::lefwLayerAntennaGatePlusDiff(plusDiffFactor);
-}
-
-int lefwLayerAntennaAreaMinusDiff (double  minusDiffFactor) {
-    return LefDefParser::lefwLayerAntennaAreaMinusDiff(minusDiffFactor);
-}
-
-int lefwLayerAntennaAreaDiffReducePwl (int  numPwls, double*  diffAreas, double*  metalDiffFactors) {
-    return LefDefParser::lefwLayerAntennaAreaDiffReducePwl(numPwls, diffAreas, metalDiffFactors);
-}
-
-int lefwMinimumDensity (double  minDensity) {
-    return LefDefParser::lefwMinimumDensity(minDensity);
-}
-
-int lefwMaximumDensity (double  maxDensity) {
-    return LefDefParser::lefwMaximumDensity(maxDensity);
-}
-
-int lefwDensityCheckWindow (double  checkWindowLength, double  checkWindowWidth) {
-    return LefDefParser::lefwDensityCheckWindow(checkWindowLength, checkWindowWidth);
-}
-
-int lefwDensityCheckStep (double  checkStepValue) {
-    return LefDefParser::lefwDensityCheckStep(checkStepValue);
-}
-
-int lefwFillActiveSpacing (double  fillToActiveSpacing) {
-    return LefDefParser::lefwFillActiveSpacing(fillToActiveSpacing);
-}
-
-int lefwMaxviastack (int  value, const char*  bottomLayer, const char*  topLayer) {
-    return LefDefParser::lefwMaxviastack(value, bottomLayer, topLayer);
-}
-
-int lefwStartPropDef () {
-    return LefDefParser::lefwStartPropDef();
-}
-
-int lefwIntPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, int     propValue) {
-    return LefDefParser::lefwIntPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int lefwRealPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, double  propValue) {
-    return LefDefParser::lefwRealPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int lefwStringPropDef (const char*  objType, const char*  propName, double  leftRange, double  rightRange, const char*  propValue) {
-    return LefDefParser::lefwStringPropDef(objType, propName, leftRange, rightRange, propValue);
-}
-
-int lefwEndPropDef () {
-    return LefDefParser::lefwEndPropDef();
-}
-
-int lefwStartVia (const char*  viaName, const char*  isDefault) {
-    return LefDefParser::lefwStartVia(viaName, isDefault);
-}
-
-int lefwViaTopofstackonly () {
-    return LefDefParser::lefwViaTopofstackonly();
-}
-
-int lefwViaForeign (const char*  foreignName, double  xl, double  yl, int  orient) {
-    return LefDefParser::lefwViaForeign(foreignName, xl, yl, orient);
-}
-
-int lefwViaForeignStr (const char*  foreignName, double  xl, double  yl, const char*  orient) {
-    return LefDefParser::lefwViaForeignStr(foreignName, xl, yl, orient);
-}
-
-int lefwViaResistance (double  resistance) {
-    return LefDefParser::lefwViaResistance(resistance);
-}
-
-int lefwViaLayer (const char*  layerName) {
-    return LefDefParser::lefwViaLayer(layerName);
-}
-
-int lefwViaLayerRect (double  x1l, double  y1l, double  x2l, double  y2l, int  mask) {
-    return LefDefParser::lefwViaLayerRect(x1l, y1l, x2l, y2l, mask);
-}
-
-int lefwViaLayerPolygon (int  num_polys, double*  xl, double*  yl, int  mask) {
-    return LefDefParser::lefwViaLayerPolygon(num_polys, xl, yl, mask);
-}
-
-int lefwViaViarule (const char*  viaRuleName, double  xCutSize, double  yCutSize, const char*  botMetalLayer, const char*  cutLayer, const char*  topMetalLayer, double  xCutSpacing, double  yCutSpacing, double  xBotEnc, double  yBotEnc, double  xTopEnc, double  yTopEnc) {
-    return LefDefParser::lefwViaViarule(viaRuleName, xCutSize, yCutSize, botMetalLayer, cutLayer, topMetalLayer, xCutSpacing, yCutSpacing, xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-}
-
-int lefwViaViaruleRowCol (int  numCutRows, int  numCutCols) {
-    return LefDefParser::lefwViaViaruleRowCol(numCutRows, numCutCols);
-}
-
-int lefwViaViaruleOrigin (double  xOffset, double  yOffset) {
-    return LefDefParser::lefwViaViaruleOrigin(xOffset, yOffset);
-}
-
-int lefwViaViaruleOffset (double  xBotOffset, double  yBotOffset, double  xTopOffset, double  yTopOffset) {
-    return LefDefParser::lefwViaViaruleOffset(xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-}
-
-int lefwViaViarulePattern (const char*  cutPattern) {
-    return LefDefParser::lefwViaViarulePattern(cutPattern);
-}
-
-int lefwStringProperty (const char*  propName, const char*  propValue) {
-    return LefDefParser::lefwStringProperty(propName, propValue);
-}
-
-int lefwRealProperty (const char*  propName, double  propValue) {
-    return LefDefParser::lefwRealProperty(propName, propValue);
-}
-
-int lefwIntProperty (const char*  propName, int  propValue) {
-    return LefDefParser::lefwIntProperty(propName, propValue);
-}
-
-int lefwEndVia (const char*  viaName) {
-    return LefDefParser::lefwEndVia(viaName);
-}
-
-int lefwStartViaRule (const char*  viaRuleName) {
-    return LefDefParser::lefwStartViaRule(viaRuleName);
-}
-
-int lefwViaRuleLayer (const char*  layerName, const char*  direction, double  minWidth, double  maxWidth, double  overhang, double  metalOverhang) {
-    return LefDefParser::lefwViaRuleLayer(layerName, direction, minWidth, maxWidth, overhang, metalOverhang);
-}
-
-int lefwViaRuleVia (const char*  viaName) {
-    return LefDefParser::lefwViaRuleVia(viaName);
-}
-
-int lefwEndViaRule (const char*  viaRuleName) {
-    return LefDefParser::lefwEndViaRule(viaRuleName);
-}
-
-int lefwStartViaRuleGen (const char*  viaRuleName) {
-    return LefDefParser::lefwStartViaRuleGen(viaRuleName);
-}
-
-int lefwViaRuleGenDefault () {
-    return LefDefParser::lefwViaRuleGenDefault();
-}
-
-int lefwViaRuleGenLayer (const char*  layerName, const char*  direction, double  minWidth, double  maxWidth, double  overhang, double  metalOverhang) {
-    return LefDefParser::lefwViaRuleGenLayer(layerName, direction, minWidth, maxWidth, overhang, metalOverhang);
-}
-
-int lefwViaRuleGenLayerEnclosure (const char*  layerName, double  overhang1, double  overhang2, double  minWidth, double  maxWidth) {
-    return LefDefParser::lefwViaRuleGenLayerEnclosure(layerName, overhang1, overhang2, minWidth, maxWidth);
-}
-
-int lefwViaRuleGenLayer3 (const char*  layerName, double  xl, double  yl, double  xh, double  yh, double  xSpacing, double  ySpacing, double  resistance) {
-    return LefDefParser::lefwViaRuleGenLayer3(layerName, xl, yl, xh, yh, xSpacing, ySpacing, resistance);
-}
-
-int lefwEndViaRuleGen (const char*  viaRuleName) {
-    return LefDefParser::lefwEndViaRuleGen(viaRuleName);
-}
-
-int lefwStartNonDefaultRule (const char*  ruleName) {
-    return LefDefParser::lefwStartNonDefaultRule(ruleName);
-}
-
-int lefwNonDefaultRuleLayer (const char*  routingLayerName, double  width, double  minSpacing, double  wireExtension, double  resistance, double  capacitance, double  edgeCap) {
-    return LefDefParser::lefwNonDefaultRuleLayer(routingLayerName, width, minSpacing, wireExtension, resistance, capacitance, edgeCap);
-}
-
-int lefwNonDefaultRuleHardspacing () {
-    return LefDefParser::lefwNonDefaultRuleHardspacing();
-}
-
-int lefwNonDefaultRuleStartVia (const char*  viaName, const char*  isDefault) {
-    return LefDefParser::lefwNonDefaultRuleStartVia(viaName, isDefault);
-}
-
-int lefwNonDefaultRuleEndVia (const char*  viaName) {
-    return LefDefParser::lefwNonDefaultRuleEndVia(viaName);
-}
-
-int lefwNonDefaultRuleUseVia (const char*  viaName) {
-    return LefDefParser::lefwNonDefaultRuleUseVia(viaName);
-}
-
-int lefwNonDefaultRuleUseViaRule (const char*  viaRuleName) {
-    return LefDefParser::lefwNonDefaultRuleUseViaRule(viaRuleName);
-}
-
-int lefwNonDefaultRuleMinCuts (const char*  layerName, int  numCuts) {
-    return LefDefParser::lefwNonDefaultRuleMinCuts(layerName, numCuts);
-}
-
-int lefwEndNonDefaultRule (const char*  ruleName) {
-    return LefDefParser::lefwEndNonDefaultRule(ruleName);
-}
-
-int lefwStartSpacing () {
-    return LefDefParser::lefwStartSpacing();
-}
-
-int lefwSpacing (const char*  layerName1, const char*  layerName2, double  minSpace, const char*  stack) {
-    return LefDefParser::lefwSpacing(layerName1, layerName2, minSpace, stack);
-}
-
-int lefwEndSpacing () {
-    return LefDefParser::lefwEndSpacing();
-}
-
-int lefwUniversalNoiseMargin (double  high, double  low) {
-    return LefDefParser::lefwUniversalNoiseMargin(high, low);
-}
-
-int lefwEdgeRateThreshold1 (double  num) {
-    return LefDefParser::lefwEdgeRateThreshold1(num);
-}
-
-int lefwEdgeRateThreshold2 (double  num) {
-    return LefDefParser::lefwEdgeRateThreshold2(num);
-}
-
-int lefwEdgeRateScaleFactor (double  num) {
-    return LefDefParser::lefwEdgeRateScaleFactor(num);
-}
-
-int lefwStartNoiseTable (int  num) {
-    return LefDefParser::lefwStartNoiseTable(num);
-}
-
-int lefwEdgeRate (double  num) {
-    return LefDefParser::lefwEdgeRate(num);
-}
-
-int lefwOutputResistance (int  numResists, double*  resistance) {
-    return LefDefParser::lefwOutputResistance(numResists, resistance);
-}
-
-int lefwVictims (int  length, int  numNoises, double*  noises) {
-    return LefDefParser::lefwVictims(length, numNoises, noises);
-}
-
-int lefwEndNoiseTable () {
-    return LefDefParser::lefwEndNoiseTable();
-}
-
-int lefwStartCorrectTable (int  num) {
-    return LefDefParser::lefwStartCorrectTable(num);
-}
-
-int lefwEndCorrectTable () {
-    return LefDefParser::lefwEndCorrectTable();
-}
-
-int lefwMinFeature (double  x, double  y) {
-    return LefDefParser::lefwMinFeature(x, y);
-}
-
-int lefwStartIrdrop () {
-    return LefDefParser::lefwStartIrdrop();
-}
-
-int lefwIrdropTable (const char*  tableName, const char*  currentsNvolts) {
-    return LefDefParser::lefwIrdropTable(tableName, currentsNvolts);
-}
-
-int lefwEndIrdrop () {
-    return LefDefParser::lefwEndIrdrop();
-}
-
-int lefwSite (const char*  siteName, const char*  classType, const char*  symmetry, double  width, double  height) {
-    return LefDefParser::lefwSite(siteName, classType, symmetry, width, height);
-}
-
-int lefwSiteRowPattern (const char*  siteName, int  orient) {
-    return LefDefParser::lefwSiteRowPattern(siteName, orient);
-}
-
-int lefwSiteRowPatternStr (const char*  siteName, const char * orient) {
-    return LefDefParser::lefwSiteRowPatternStr(siteName, orient);
-}
-
-int lefwEndSite (const char*  siteName) {
-    return LefDefParser::lefwEndSite(siteName);
-}
-
-int lefwStartArray (const char*  arrayName) {
-    return LefDefParser::lefwStartArray(arrayName);
-}
-
-int lefwArraySite (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArraySite(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArraySiteStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArraySiteStr(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayCanplace (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayCanplace(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayCanplaceStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayCanplaceStr(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayCannotoccupy (const char*  name, double  origX, double  origY, int  orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayCannotoccupy(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayCannotoccupyStr (const char*  name, double  origX, double  origY, const char * orient, double  numX, double  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayCannotoccupyStr(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayTracks (const char*  xy, double  start, int  numTracks, double  space, const char*  layers) {
-    return LefDefParser::lefwArrayTracks(xy, start, numTracks, space, layers);
-}
-
-int lefwStartArrayFloorplan (const char*  name) {
-    return LefDefParser::lefwStartArrayFloorplan(name);
-}
-
-int lefwArrayFloorplan (const char*  site, const char*  name, double  origX, double  origY, int  orient, int  numX, int  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayFloorplan(site, name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwArrayFloorplanStr (const char*  site, const char*  name, double  origX, double  origY, const char * orient, int  numX, int  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwArrayFloorplanStr(site, name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwEndArrayFloorplan (const char*  name) {
-    return LefDefParser::lefwEndArrayFloorplan(name);
-}
-
-int lefwArrayGcellgrid (const char*  xy, double  startXY, int  colRows, double  spaceXY) {
-    return LefDefParser::lefwArrayGcellgrid(xy, startXY, colRows, spaceXY);
-}
-
-int lefwStartArrayDefaultCap (int  size) {
-    return LefDefParser::lefwStartArrayDefaultCap(size);
-}
-
-int lefwArrayDefaultCap (double  numPins, double  cap) {
-    return LefDefParser::lefwArrayDefaultCap(numPins, cap);
-}
-
-int lefwEndArrayDefaultCap () {
-    return LefDefParser::lefwEndArrayDefaultCap();
-}
-
-int lefwEndArray (const char*  arrayName) {
-    return LefDefParser::lefwEndArray(arrayName);
-}
-
-int lefwStartMacro (const char*  macroName) {
-    return LefDefParser::lefwStartMacro(macroName);
-}
-
-int lefwMacroClass (const char*  value1, const char*  value2) {
-    return LefDefParser::lefwMacroClass(value1, value2);
-}
-
-int lefwMacroFixedMask () {
-    return LefDefParser::lefwMacroFixedMask();
-}
-
-int lefwMacroSource (const char*  value1) {
-    return LefDefParser::lefwMacroSource(value1);
-}
-
-int lefwMacroForeign (const char*  name, double  xl, double  yl, int  orient) {
-    return LefDefParser::lefwMacroForeign(name, xl, yl, orient);
-}
-
-int lefwMacroForeignStr (const char*  name, double  xl, double  yl, const char * orient) {
-    return LefDefParser::lefwMacroForeignStr(name, xl, yl, orient);
-}
-
-int lefwMacroOrigin (double  xl, double  yl) {
-    return LefDefParser::lefwMacroOrigin(xl, yl);
-}
-
-int lefwMacroEEQ (const char*  macroName) {
-    return LefDefParser::lefwMacroEEQ(macroName);
-}
-
-int lefwMacroLEQ (const char*  macroName) {
-    return LefDefParser::lefwMacroLEQ(macroName);
-}
-
-int lefwMacroSize (double  width, double  height) {
-    return LefDefParser::lefwMacroSize(width, height);
-}
-
-int lefwMacroSymmetry (const char*  symmetry) {
-    return LefDefParser::lefwMacroSymmetry(symmetry);
-}
-
-int lefwMacroSite (const char*  siteName) {
-    return LefDefParser::lefwMacroSite(siteName);
-}
-
-int lefwMacroSitePattern (const char*  name, double  origX, double  origY, int  orient, int  numX, int  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwMacroSitePattern(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwMacroSitePatternStr (const char*  name, double  origX, double  origY, const char * orient, int  numX, int  numY, double  spaceX, double  spaceY) {
-    return LefDefParser::lefwMacroSitePatternStr(name, origX, origY, orient, numX, numY, spaceX, spaceY);
-}
-
-int lefwMacroPower (double  power) {
-    return LefDefParser::lefwMacroPower(power);
-}
-
-int lefwEndMacro (const char*  macroName) {
-    return LefDefParser::lefwEndMacro(macroName);
-}
-
-int lefwStartMacroDensity (const char*  layerName) {
-    return LefDefParser::lefwStartMacroDensity(layerName);
-}
-
-int lefwMacroDensityLayerRect (double  x1, double  y1, double  x2, double  y2, double  densityValue) {
-    return LefDefParser::lefwMacroDensityLayerRect(x1, y1, x2, y2, densityValue);
-}
-
-int lefwEndMacroDensity () {
-    return LefDefParser::lefwEndMacroDensity();
-}
-
-int lefwStartMacroPin (const char*  pinName) {
-    return LefDefParser::lefwStartMacroPin(pinName);
-}
-
-int lefwMacroPinTaperRule (const char*  ruleName) {
-    return LefDefParser::lefwMacroPinTaperRule(ruleName);
-}
-
-int lefwMacroPinForeign (const char*  name, double  xl, double  yl, int  orient) {
-    return LefDefParser::lefwMacroPinForeign(name, xl, yl, orient);
-}
-
-int lefwMacroPinForeignStr (const char*  name, double  xl, double  yl, const char*  orient) {
-    return LefDefParser::lefwMacroPinForeignStr(name, xl, yl, orient);
-}
-
-int lefwMacroPinLEQ (const char*  pinName) {
-    return LefDefParser::lefwMacroPinLEQ(pinName);
-}
-
-int lefwMacroPinDirection (const char*  direction) {
-    return LefDefParser::lefwMacroPinDirection(direction);
-}
-
-int lefwMacroPinUse (const char*  use) {
-    return LefDefParser::lefwMacroPinUse(use);
-}
-
-int lefwMacroPinShape (const char*  name) {
-    return LefDefParser::lefwMacroPinShape(name);
-}
-
-int lefwMacroPinMustjoin (const char*  name) {
-    return LefDefParser::lefwMacroPinMustjoin(name);
-}
-
-int lefwMacroPinNetExpr (const char*  name) {
-    return LefDefParser::lefwMacroPinNetExpr(name);
-}
-
-int lefwMacroPinSupplySensitivity (const char*  pinName) {
-    return LefDefParser::lefwMacroPinSupplySensitivity(pinName);
-}
-
-int lefwMacroPinGroundSensitivity (const char*  pinName) {
-    return LefDefParser::lefwMacroPinGroundSensitivity(pinName);
-}
-
-int lefwMacroPinOutputnoisemargin (int  high, int  low) {
-    return LefDefParser::lefwMacroPinOutputnoisemargin(high, low);
-}
-
-int lefwMacroPinOutputresistance (int  high, int  low) {
-    return LefDefParser::lefwMacroPinOutputresistance(high, low);
-}
-
-int lefwMacroPinInputnoisemargin (int  high, int  low) {
-    return LefDefParser::lefwMacroPinInputnoisemargin(high, low);
-}
-
-int lefwMacroPinPower (double  power) {
-    return LefDefParser::lefwMacroPinPower(power);
-}
-
-int lefwMacroPinLeakage (double  leakage) {
-    return LefDefParser::lefwMacroPinLeakage(leakage);
-}
-
-int lefwMacroPinCapacitance (double  capacitance) {
-    return LefDefParser::lefwMacroPinCapacitance(capacitance);
-}
-
-int lefwMacroPinResistance (double  resistance) {
-    return LefDefParser::lefwMacroPinResistance(resistance);
-}
-
-int lefwMacroPinPulldownres (double  resistance) {
-    return LefDefParser::lefwMacroPinPulldownres(resistance);
-}
-
-int lefwMacroPinTieoffr (double  resistance) {
-    return LefDefParser::lefwMacroPinTieoffr(resistance);
-}
-
-int lefwMacroPinVHI (double  voltage) {
-    return LefDefParser::lefwMacroPinVHI(voltage);
-}
-
-int lefwMacroPinVLO (double  voltage) {
-    return LefDefParser::lefwMacroPinVLO(voltage);
-}
-
-int lefwMacroPinRisevoltagethreshold (double  voltage) {
-    return LefDefParser::lefwMacroPinRisevoltagethreshold(voltage);
-}
-
-int lefwMacroPinFallvoltagethreshold (double  voltage) {
-    return LefDefParser::lefwMacroPinFallvoltagethreshold(voltage);
-}
-
-int lefwMacroPinRisethresh (double  capacitance) {
-    return LefDefParser::lefwMacroPinRisethresh(capacitance);
-}
-
-int lefwMacroPinFallthresh (double  capacitance) {
-    return LefDefParser::lefwMacroPinFallthresh(capacitance);
-}
-
-int lefwMacroPinRisesatcur (double  current) {
-    return LefDefParser::lefwMacroPinRisesatcur(current);
-}
-
-int lefwMacroPinFallsatcur (double  current) {
-    return LefDefParser::lefwMacroPinFallsatcur(current);
-}
-
-int lefwMacroPinCurrentsource (const char*  name) {
-    return LefDefParser::lefwMacroPinCurrentsource(name);
-}
-
-int lefwMacroPinIV_Tables (const char*  lowName, const char*  highName) {
-    return LefDefParser::lefwMacroPinIV_Tables(lowName, highName);
-}
-
-int lefwMacroPinAntennasize (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennasize(value, layerName);
-}
-
-int lefwMacroPinAntennaMetalArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaMetalArea(value, layerName);
-}
-
-int lefwMacroPinAntennaMetalLength (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaMetalLength(value, layerName);
-}
-
-int lefwMacroPinAntennaPartialMetalArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaPartialMetalArea(value, layerName);
-}
-
-int lefwMacroPinAntennaPartialMetalSideArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaPartialMetalSideArea(value, layerName);
-}
-
-int lefwMacroPinAntennaPartialCutArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaPartialCutArea(value, layerName);
-}
-
-int lefwMacroPinAntennaDiffArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaDiffArea(value, layerName);
-}
-
-int lefwMacroPinAntennaModel (const char*  oxide) {
-    return LefDefParser::lefwMacroPinAntennaModel(oxide);
-}
-
-int lefwMacroPinAntennaGateArea (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaGateArea(value, layerName);
-}
-
-int lefwMacroPinAntennaMaxAreaCar (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaMaxAreaCar(value, layerName);
-}
-
-int lefwMacroPinAntennaMaxSideAreaCar (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaMaxSideAreaCar(value, layerName);
-}
-
-int lefwMacroPinAntennaMaxCutCar (double  value, const char*  layerName) {
-    return LefDefParser::lefwMacroPinAntennaMaxCutCar(value, layerName);
-}
-
-int lefwEndMacroPin (const char*  pinName) {
-    return LefDefParser::lefwEndMacroPin(pinName);
-}
-
-int lefwStartMacroPinPort (const char*  classType) {
-    return LefDefParser::lefwStartMacroPinPort(classType);
-}
-
-int lefwMacroPinPortLayer (const char*  layerName, double  spacing) {
-    return LefDefParser::lefwMacroPinPortLayer(layerName, spacing);
-}
-
-int lefwMacroPinPortDesignRuleWidth (const char*  layerName, double  width) {
-    return LefDefParser::lefwMacroPinPortDesignRuleWidth(layerName, width);
-}
-
-int lefwMacroPinPortLayerWidth (double  width) {
-    return LefDefParser::lefwMacroPinPortLayerWidth(width);
-}
-
-int lefwMacroPinPortLayerPath (int  num_paths, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int     mask) {
-    return LefDefParser::lefwMacroPinPortLayerPath(num_paths, xl, yl, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroPinPortLayerRect (double  xl1, double  yl1, double  xl2, double  yl2, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroPinPortLayerRect(xl1, yl1, xl2, yl2, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroPinPortLayerPolygon (int  num_polys, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroPinPortLayerPolygon(num_polys, xl, yl, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroPinPortVia (double  xl, double  yl, const char*  viaName, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroPinPortVia(xl, yl, viaName, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwEndMacroPinPort () {
-    return LefDefParser::lefwEndMacroPinPort();
-}
-
-int lefwStartMacroObs () {
-    return LefDefParser::lefwStartMacroObs();
-}
-
-int lefwMacroObsLayer (const char*  layerName, double  spacing) {
-    return LefDefParser::lefwMacroObsLayer(layerName, spacing);
-}
-
-int lefwMacroObsDesignRuleWidth (const char*  layerName, double  width) {
-    return LefDefParser::lefwMacroObsDesignRuleWidth(layerName, width);
-}
-
-int lefwMacroExceptPGNet (const char*  layerName) {
-    return LefDefParser::lefwMacroExceptPGNet(layerName);
-}
-
-int lefwMacroObsLayerWidth (double  width) {
-    return LefDefParser::lefwMacroObsLayerWidth(width);
-}
-
-int lefwMacroObsLayerPath (int  num_paths, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroObsLayerPath(num_paths, xl, yl, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroObsLayerRect (double  xl1, double  yl1, double  xl2, double  yl2, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroObsLayerRect(xl1, yl1, xl2, yl2, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroObsLayerPolygon (int  num_polys, double*  xl, double*  yl, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroObsLayerPolygon(num_polys, xl, yl, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwMacroObsVia (double  xl, double  yl, const char*  viaName, int  numX, int  numY, double  spaceX, double  spaceY, int  mask) {
-    return LefDefParser::lefwMacroObsVia(xl, yl, viaName, numX, numY, spaceX, spaceY, mask);
-}
-
-int lefwEndMacroObs () {
-    return LefDefParser::lefwEndMacroObs();
-}
-
-int lefwStartMacroTiming () {
-    return LefDefParser::lefwStartMacroTiming();
-}
-
-int lefwMacroTimingPin (const char*  fromPin, const char*  toPin) {
-    return LefDefParser::lefwMacroTimingPin(fromPin, toPin);
-}
-
-int lefwMacroTimingIntrinsic (const char*  riseFall, double  min, double  max, double  slewT1, double  slewT1Min, double  slewT1Max, double  slewT2, double  slewT2Min, double  slewT2Max, double  slewT3, double  varMin, double  varMax) {
-    return LefDefParser::lefwMacroTimingIntrinsic(riseFall, min, max, slewT1, slewT1Min, slewT1Max, slewT2, slewT2Min, slewT2Max, slewT3, varMin, varMax);
-}
-
-int lefwMacroTimingRisers (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingRisers(min, max);
-}
-
-int lefwMacroTimingFallrs (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingFallrs(min, max);
-}
-
-int lefwMacroTimingRisecs (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingRisecs(min, max);
-}
-
-int lefwMacroTimingFallcs (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingFallcs(min, max);
-}
-
-int lefwMacroTimingRisesatt1 (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingRisesatt1(min, max);
-}
-
-int lefwMacroTimingFallsatt1 (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingFallsatt1(min, max);
-}
-
-int lefwMacroTimingRiset0 (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingRiset0(min, max);
-}
-
-int lefwMacroTimingFallt0 (double  min, double  max) {
-    return LefDefParser::lefwMacroTimingFallt0(min, max);
-}
-
-int lefwMacroTimingUnateness (const char*  unateness) {
-    return LefDefParser::lefwMacroTimingUnateness(unateness);
-}
-
-int lefwEndMacroTiming () {
-    return LefDefParser::lefwEndMacroTiming();
-}
-
-int lefwAntenna (const char*  type, double  value) {
-    return LefDefParser::lefwAntenna(type, value);
-}
-
-int lefwStartBeginext (const char*  name) {
-    return LefDefParser::lefwStartBeginext(name);
-}
-
-int lefwBeginextCreator (const char*  creatorName) {
-    return LefDefParser::lefwBeginextCreator(creatorName);
-}
-
-int lefwBeginextDate () {
-    return LefDefParser::lefwBeginextDate();
-}
-
-int lefwBeginextRevision (int  vers1, int  vers2) {
-    return LefDefParser::lefwBeginextRevision(vers1, vers2);
-}
-
-int lefwBeginextSyntax (const char*  title, const char*  string) {
-    return LefDefParser::lefwBeginextSyntax(title, string);
-}
-
-int lefwEndBeginext () {
-    return LefDefParser::lefwEndBeginext();
-}
-
-int lefwCurrentLineNumber () {
-    return LefDefParser::lefwCurrentLineNumber();
-}
-
-int lefwEnd () {
-    return LefDefParser::lefwEnd();
-}
-
-void lefwPrintError (int  status) {
-    LefDefParser::lefwPrintError(status);
-}
-
-void lefwAddComment (const char*  comment) {
-    LefDefParser::lefwAddComment(comment);
-}
-
-void lefwAddIndent () {
-    LefDefParser::lefwAddIndent();
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriterCalls.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriterCalls.cpp
deleted file mode 100644
index f331f03..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clef/xlefwWriterCalls.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $  
-// *****************************************************************************
-// *****************************************************************************
-
-#define EXTERN extern "C"
-
-#include "lefwWriterCalls.h"
-#include "lefwWriterCalls.hpp"
-
-// Wrappers definitions.
-int lefwWrite (FILE * file, const char * fileName, lefiUserData  userData) {
-    return LefDefParser::lefwWrite(file, fileName, userData);
-}
-
-void lefwSetRegisterUnusedCallbacks () {
-    LefDefParser::lefwSetRegisterUnusedCallbacks();
-}
-
-void lefwPrintUnusedCallbacks (FILE*  f) {
-    LefDefParser::lefwPrintUnusedCallbacks(f);
-}
-
-void lefwSetUserData (lefiUserData  p0) {
-    LefDefParser::lefwSetUserData(p0);
-}
-
-lefiUserData lefwGetUserData () {
-    return LefDefParser::lefwGetUserData();
-}
-
-void lefwSetVersionCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetVersionCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetCaseSensitiveCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetCaseSensitiveCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetNoWireExtensionCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetNoWireExtensionCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetBusBitCharsCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetBusBitCharsCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetDividerCharCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetDividerCharCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetManufacturingGridCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetManufacturingGridCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetUseMinSpacingCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetUseMinSpacingCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetClearanceMeasureCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetClearanceMeasureCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetUnitsCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetUnitsCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwAntennaInputGateAreaCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwAntennaInputGateAreaCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwAntennaInOutDiffAreaCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwAntennaInOutDiffAreaCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwAntennaOutputDiffAreaCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwAntennaOutputDiffAreaCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetPropDefCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetPropDefCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetLayerCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetLayerCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetViaCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetViaCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetViaRuleCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetViaRuleCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetNonDefaultCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetNonDefaultCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetCrossTalkCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetCrossTalkCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetNoiseTableCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetNoiseTableCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetCorrectionTableCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetCorrectionTableCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetSpacingCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetSpacingCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetMinFeatureCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetMinFeatureCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetDielectricCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetDielectricCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetIRDropCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetIRDropCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetSiteCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetSiteCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetArrayCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetArrayCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetMacroCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetMacroCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetAntennaCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetAntennaCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetExtCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetExtCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetEndLibCbk (::lefwVoidCbkFnType p0) {
-    LefDefParser::lefwSetEndLibCbk((LefDefParser::lefwVoidCbkFnType) p0);
-}
-
-void lefwSetUnusedCallbacks (::lefwVoidCbkFnType  func) {
-    LefDefParser::lefwSetUnusedCallbacks((LefDefParser::lefwVoidCbkFnType ) func);
-}
-
-void lefwSetLogFunction (::LEFI_LOG_FUNCTION  p0) {
-    LefDefParser::lefwSetLogFunction(p0);
-}
-
-void lefwSetWarningLogFunction (::LEFI_WARNING_LOG_FUNCTION  p0) {
-    LefDefParser::lefwSetWarningLogFunction(p0);
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/clefzlib.c b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/clefzlib.c
deleted file mode 100644
index f431d0f..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/clefzlib.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2014, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- ******************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "zlib.h"
-#include "lefzlib.h"
-#include "lefrReader.h"
-
-/*
- * Private functions:
- */
-size_t lefGZip_read(FILE* file, char* buf, size_t len) {
-  return gzread((gzFile)file, buf, (unsigned int)len);
-}
-
-/*
- * Public functions:
- */
-lefGZFile 
-lefGZipOpen(const char *gzipPath, const char* mode) {
-  lefGZFile fptr;
-
-  if (!gzipPath)
-    return NULL;
-
-  fptr = gzopen(gzipPath, mode);
-
-  if (fptr) {
-    /* successfully open the gzip file */
-    /* set the read function to read from a compressed file */
-    lefrSetReadFunction(lefGZip_read);
-    return (lefGZFile)fptr;
-  } else
-    return NULL;
-}
-
-int lefGZipClose(lefGZFile filePtr) {
-  return (gzclose((gzFile)filePtr));
-}
-
-int lefrReadGZip(lefGZFile file, const char* gzipFile, lefiUserData uData) {
-  return lefrRead((FILE*)file, gzipFile, uData);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/lefzlib.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/lefzlib.h
deleted file mode 100644
index fa23238..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/clefzlib/lefzlib.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2012, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- ******************************************************************************/
-
-#ifndef CLEFZLIB_H
-#define CLEFZLIB_H
-
-typedef void* lefGZFile;
-
-/* 
- * Name: lefGZipOpen
- * Description: Open a gzip file
- * Returns: A file pointer
- */
-extern lefGZFile lefGZipOpen(const char* gzipFile, const char* mode);
-
-/* 
- * Name: lefGZipClose
- * Description: Close a gzip file
- * Returns: 0 if no errors
- */
-extern int lefGZipClose(lefGZFile filePtr);
-
-/*
- * Name: lefrReadGZip
- * Description: Parse a lef gzip file
- * Returns: 0 if no errors
- */
-extern int lefrReadGZip(lefGZFile file, const char* gzipFile, void* uData);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapi.pdf b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapi.pdf
deleted file mode 100644
index e5a600d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapi.pdf
+++ /dev/null
Binary files differ
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapiWN.pdf b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapiWN.pdf
deleted file mode 100644
index b882654..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/doc/lefapiWN.pdf
+++ /dev/null
Binary files differ
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.cpp
deleted file mode 100644
index 1269eaf..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #6 $
-//  $Date: 2015/01/20 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-/*
- * FILE: crypt.cpp
- *
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#ifdef WIN32
-#   include <io.h>
-#else // not WIN32 
-#   include <unistd.h>
-
-#endif // WIN32 
-
-
-FILE *
-encOpenFileForRead(char *filename)
-{
-    return fopen(filename, "r");
-}
-
-FILE *
-encOpenFileForWrite(char    *filename,
-                    int     encrypt_f)
-{
-    return fopen(filename, "w");
-}
-
-int
-encCloseFile(FILE *fp)
-{
-    return fclose(fp);
-}
-
-void
-encClearBuf(FILE *fp)
-{
-}
-
-void
-encReadingEncrypted()
-{
-}
-
-void
-encWritingEncrypted()
-{
-}
-
-int
-encIsEncrypted(unsigned char *buf)
-{
-    return false;
-}
-
-int
-encFgetc(FILE *fp)
-{
-    return fgetc(fp);
-}
-
-int
-encFputc(char   c,
-         FILE   *fp)
-{
-    return fputc(c, fp);
-}
-
-void
-encPrint(FILE   *fp,
-         char   *format,
-         ...)
-{
-    va_list ap;
-
-    va_start(ap, format);
-    vfprintf(fp, format, ap);
-    va_end(ap);
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.hpp
deleted file mode 100644
index 4c50d08..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/crypt.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef CRYPT_H
-#define CRYPT_H 1
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern FILE* encOpenFileForRead(char* filename);
-extern FILE* encOpenFileForWrite(char* filename, int encrypt_f);
-extern int encCloseFile(FILE* fp);
-extern void encClearBuf(FILE* fp);
-extern void encReadingEncrypted();
-extern void encWritingEncrypted();
-extern int encIsEncrypted(unsigned char* buf);
-extern int encFgetc(FILE* fp);
-extern int encFputc(char c, FILE* fp);
-extern void encPrint(FILE*fp, char* format,...);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.msg b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.msg
deleted file mode 100644
index 84724a9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.msg
+++ /dev/null
@@ -1,404 +0,0 @@
-# 100 -  lef reader, lefrReader.c
-# 1000 - lef parser, error, lex.cpph, lef.y (CALLBACK & CHKERR)
-# 1300 - from lefiError, lefiLayer.cpp
-# 1350 - from lefiError, lefiMacro.cpp
-# 1360 - from lefiError, lefiMisc.cpp
-# 1400 - from lefiError, lefiNonDefault.cpp
-# 1420 - from lefiError, lefiVia.cpp
-# 1430 - from lefiError, lefiViaRule.cpp
-# 1500 - lef parser, error, lef.y
-# 2000 - lef parser, warning, lex.cpph
-# 2500 - lef parser, warning, lef.y
-# 3000 - lef parser, info, lex.cpph
-# 4000 - lef writer, error, lefwWriter.cpp & lefwWriterCalls.cpp
-# 4500 - lef writer, warning, lefwWriter.cpp & lefwWriterCalls.cpp
-# 4700 - lef writer, info, lefwWriter.cpp & lefwWriterCalls.cpp
-# emsMkError LEF -b lefMsgTable -m lef.msg -e -n
-100  "lefrRead called before lefrInit\n"
-101  "lefrSetRegisterUnusedCallbacks was not called to setup this data.\n"
-201  "LEF items that were present but ignored because of no callback:\n"
-203  "Number has exceeded the limit for an integer. See file %s at line %d.\n"
-1000 "Expecting '='"
-1001 "End of file in &ALIAS"
-1002 "Incomplete lef file"
-1003 "tag is missing for BEGINEXT"
-1004 "Tag for BEGINEXT is empty"
-1005 "\" is missing in tag"
-1006 "Ending \" is missing"
-1007 "ENDEXT is missing"
-1008 "Invalid characters found in \'%s\'.\nThese characters might have created by character types other than English."
-1009 "Symbol ';' should be separated by space(s)."
-1011 "%s, see file %s at line %d.\nLast token was <%s\">; space is missing between the closing \" of the string and ;.\n"
-1020 "Too many syntax errors."
-1300 "The index number %d given for the layer property is invalid.\nValid index is from 0 to %d"
-1301 "The index number %d given for the layer MINSIZE is invalid.\nValid index is from 0 to %d\n"
-1302 "The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d"
-1303 "The index number %d given for the layer ARRAYCUTS is invalid.\nValid index is from 0 to %d"
-1304 "The index number %d given for the layer SPACING is invalid.\nValid index is from 0 to %d"
-1305 "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n"
-1306 "Incorrect syntax defined for property LEF57_MAXFLOATINGAREA: %s.\nCorrect syntax is \"MAXFLOATINGAREA maxArea\"\n"
-1307 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1308 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nLONGARRAY is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1309 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nWIDTH is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1310 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING has defined more than once.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1311 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING which is required is either has not been defined or defined in a wrong location.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING array Spacing ...\n"
-1312 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nSPACING should be defined with ARRAYCUTS.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1313 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1314 "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nARRAYCUTS is required but has not been defined.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n"
-1315 "Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n"
-1316 "Incorrect syntax defined for property LEF57_ANTENNACUMROUTINGPLUSCUT: %s.\nCorrect syntax is \"ANTANNACUMROUTINGPLUSCUT\"\n"
-1317 "Incorrect syntax defined for property LEF57_ANTENNAGATEPLUSDIFF: %s.\nCorrect syntax is \"ANTENNAGATEPLUSDIFF plusDiffFactor\"\n"
-1318 "Incorrect syntax defined for property LEF57_ANTENNAAREAMINUSDIFF: %s.\nCorrect syntax is \"ANTENNAAREAMINUSDIFF minusDiffFactor\"\n"
-1319 "Incorrect syntax defined for property LEF57_ANTENNAAREADIFFREDUCEPWL: %s.\nCorrect syntax is \"ANTENNAAREADIFFREDUCEPWL (( diffArea1 metalDiffFactor1 ) ( diffArea2 metalDiffFactor2 )...)\"\n"
-1320 "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\""
-1321 "The property LEF57_SPACING with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file"
-1322 "The property LEF57_SPACING with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file."
-1323 "The property LEF57_MINSTEP with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file."
-1324 "Incorrect syntax defined for the statement TWOWIDTHS.\nSpacing, which is required, is not defined."
-1325 "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type ROUTING.\nThe layer type is %s.\n"
-1326 "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type CUT.\nThe layer type is %s.\n"
-1327 "Property LEF58_TYPE was added in incorrect layer type.\nIt has the value %s which is for layer type MASTERSLICE.\nThe layer type is %s.\n"
-1328 "Property LEF58_TYPE has incorrect layer type %s.\nValue layer type are: POLYROUTING, MIMCAP, TSV, PASSIVATION, NWELL or PWELL.\n"
-1329 "Incorrect syntax defined for property LEF58_TYPE: %s\nCorrect syntax is \"TYPE POLYROUTING | MIMCAP | TSV | PASSIVATION | NWELL | PWELL ;\"\n"
-1330 "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n"
-1331 "The property LEF57_ENCLOSURE with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n"
-1350 "The index number %d given for the macro PIN is invalid.\nValid index is from 0 to %d"
-1351 "There is an unexpected lef parser bug which cause it unable to retrieve ANTENNAMODEL data with the given index."
-1352 "The index number %d given for the macro property is invalid.\nValid index is from 0 to %d"
-1360 "The index number %d given for the geometry item is invalid.\nValid index is from 0 to %d."
-1361 "The index number %d given for the geometry RECTANGLE is invalid.\nValid index is from 0 to %d."
-1362 "The index number %d given for the geometry RECTANGLE ITERATE is invalid.\nValid index is from 0 to %d."
-1363 "The index number %d given for the geometry PATH is invalid.\nValid index is from 0 to %d."
-1364 "The index number %d given for the geometry PATH ITERATE is invalid.\nValid index is from 0 to %d."
-1365 "The index number %d given for the geometry LAYER is invalid.\nValid index is from 0 to %d."
-1366 "The index number %d given for the geometry LAYER EXCEPT PG NET is invalid.\nValid index is from 0 to %d."
-1367 "The index number %d given for the geometry LAYER MINSPACING is invalid.\nValid index is from 0 to %d."
-1368 "The index number %d given for the geometry LAYER RULE WIDTH is invalid.\nValid index is from 0 to %d."
-1369 "The index number %d given for the geometry WIDTH is invalid.\nValid index is from 0 to %d."
-1370 "The index number %d given for the geometry POLYGON is invalid.\nValid index is from 0 to %d."
-1371 "The index number %d given for the geometry POLYGON ITERATE is invalid.\nValid index is from 0 to %d."
-1372 "The index number %d given for the geometry CLASS is invalid.\nValid index is from 0 to %d."
-1373 "The index number %d given for the geometry VIA is invalid.\nValid index is from 0 to %d."
-1374 "The index number %d given for the geometry VIA ITERATE is invalid.\nValid index is from 0 to %d."
-1375 "unknown geometry type."
-1376 "The index number %d given for the IRDROP is invalid.\nValid index is from 0 to %d."
-1377 "The index number %d given for the TRACK PATTERN  is invalid.\nValid index is from 0 to %d."
-1400 "Invalid nondefaultvia callback."
-1401 "Invalid nondefaultspacing callback."
-1402 "The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d."
-1403 "The index number %d given for the NONDEFAULT VIA is invalid.\nValid index is from 0 to %d."
-1404 "The index number %d given for the NONDEFAULT SPACING is invalid.\nValid index is from 0 to %d."
-1405 "The index number %d given for the NONDEFAULT USE VIA is invalid.\nValid index is from 0 to %d."
-1406 "The index number %d given for the NONDEFAULT USE VIARULE is invalid.\nValid index is from 0 to %d."
-1407 "The index number %d given for the NONDEFAULT CUT is invalid.\nValid index is from 0 to %d."
-1408 "The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d."
-1420 "The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d."
-1421 "The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d."
-1422 "The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d."
-1430 "too many via rule layers."
-1431 "The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d."
-1501 "Error found when processing LEF file '%s'\nUnit %d is a version 5.6 or later syntax\nYour lef file is defined with version %g."
-1502 "The value %d defined for LEF UNITS DATABASE MICRONS is invalid\n. Correct value is 100, 200, 1000, 2000, 10000, or 20000"
-1503 "Lef parser 5.7 does not support lef file with version %s. Parser will stop processing."
-1504 "NAMESCASESENSITIVE statement is set with OFF.\nStarting version 5.6, NAMESCASENSITIVE is obsolete,\nif it is defined, it has to have the ON value.\nParser will stop processing."
-1505 "MANUFACTURINGGRID statement was defined before UNITS.\nRefer to the LEF Language Reference manual for the order of LEF statements."
-1506 "A MAXVIASTACK statement is defined before the LAYER statement.\nRefer to the LEF Language Reference manual for the order of LEF statements."
-1507 "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1508 "TYPE statement is a required statement in a LAYER and it is not defined."
-1509 "PITCH statement is a required statement in a LAYER with TYPE ROUTING and it is not defined."
-1510 "WIDTH statement is a required statement in a LAYER with TYPE ROUTING and it is not defined."
-1511 "The DIRECTION statement which is required in a LAYER with TYPE ROUTING is not defined in LAYER %s.\nUpdate your lef file and add the DIRECTION statement for layer %s."
-1512 "It is incorrect to define a SPACING statement in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing."
-1513 "DIRECTION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1514 "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1515 "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1516 "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1517 "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1518 "HEIGHT statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1519 "WIREEXTENSION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1520 "THICKNESS statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1521 "SHRINKAGE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1522 "CAPMULTIPLIER statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1523 "EDGECAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1524 "ANTENNAAREAFACTOR statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1525 "ANTENNALENGTHFACTOR statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1526 "ANTENNALENGTHFACTOR statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNALENGTHFACTOR syntax, which is incorrect."
-1527 "ACCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing."
-1528 "DCCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing."
-1529 "CUTAREA statement can only be defined in LAYER with TYPE CUT. Parser will stop processing."
-1530 "WIDTH statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1531 "ANTENNAAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1532 "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAAREARATIO syntax, which is incorrect."
-1533 "ANTENNAAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1534 "ANTENNADIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1535 "ANTENNACUMAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1536 "ANTENNACUMAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNACUMAREARATIO syntax, which is incorrect."
-1537 "ANTENNACUMAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1538 "ANTENNACUMDIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1539 "ANTENNACUMDIFFAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFAREARATIO syntax, which is incorrect."
-1540 "ANTENNACUMDIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1541 "ANTENNAAREAFACTOR can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1542 "ANTENNASIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1543 "ANTENNASIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1544 "ANTENNASIDEAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREARATIO syntax, which is incorrect."
-1545 "ANTENNADIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1546 "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1547 "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFSIDEAREARATIO syntax, which is incorrect."
-1548 "ANTENNACUMSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1549 "ANTENNACUMSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1550 "ANTENNACUMSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMSIDEAREARATIO syntax, which is incorrect."
-1551 "ANTENNACUMDIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1552 "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1553 "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFSIDEAREARATIO syntax, which is incorrect."
-1554 "ANTENNASIDEAREAFACTOR can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1555 "ANTENNASIDEAREAFACTOR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1556 "ANTENNASIDEAREAFACTOR statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREAFACTOR syntax, which is incorrect."
-1557 "ANTENNAMODEL can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1558 "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1559 "ANTENNAMODEL statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAMODEL syntax, which is incorrect."
-1560 "ANTENNACUMROUTINGPLUSCUT can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1561 "ANTENNAGATEPLUSDIFF can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1562 "ANTENNAAREAMINUSDIFF can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1563 "ANTENNAAREADIFFREDUCEPWL can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing."
-1564 "SLOTWIREWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1565 "SLOTWIRELENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1566 "SLOTWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1567 "SLOTLENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1568 "MAXADJACENTSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1569 "MAXCOAXIALSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1570 "MAXEDGESLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1571 "SPLITWIREWIDTH statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g."
-1572 "MINIMUMDENSITY statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g."
-1573 "MAXIMUMDENSITY statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g."
-1574 "DENSITYCHECKWINDOW statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1575 "DENSITYCHECKSTEP statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1576 "FILLACTIVESPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1577 "MAXWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing."
-1578 "MAXWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1579 "MINWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing."
-1580 "MINWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1581 "MINENCLOSEDAREA statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1582 "PROTRUSION RULE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1583 "SPACINGTABLE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1584 "ENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1585 "PREFERENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1586 "RESISTANCE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1587 "DIAGMINEDGELENGTH can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1588 "DIAGMINEDGELENGTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1589 "An INFLUENCE table statement was defined before the PARALLELRUNLENGTH table statement.\nINFLUENCE table statement should be defined following the PARALLELRUNLENGTH.\nChange the LEF file and rerunning the parser."
-1590 "There is multiple PARALLELRUNLENGTH table statements are defined within a layer.\nAccording to the LEF Reference Manual, only one PARALLELRUNLENGTH table statement is allowed per layer."
-1591 "The total number of lengths defined in the PARALLELRUNLENGTH statement is not equal to\nthe  total number of spacings defined in the WIDTH statement in the SPACINGTABLE."
-1592 "A PARALLELRUNLENGTH statement was already defined in the layer.\nIt is PARALLELRUNLENGTH or TOWWIDTHS is allowed per layer."
-1593 "A TWOWIDTHS table statement was already defined in the layer.\nOnly one TWOWIDTHS statement is allowed per layer."
-1594 "A INFLUENCE table statement was already defined in the layer.\nOnly one INFLUENCE statement is allowed per layer."
-1595 "An INFLUENCE table statement was already defined before the layer.\nINFLUENCE statement has to be defined after the PARALLELRUNLENGTH table statement in the layer."
-1596 "FROMABOVE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1597 "FROMBELOW statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1598 "LENGTH WITHIN statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1599 "ANTENNAAREAFACTOR with DIFFUSEONLY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1600 "CUTAREA statement can only be defined in LAYER with TYPE CUT."
-1601 "WIDTH can only be defined in LAYER with TYPE ROUTING."
-1602 "MAXVIASTACK statement has to be defined after the LAYER statement."
-1603 "A MAXVIASTACK was already defined.\nOnly one MAXVIASTACK is allowed per lef file."
-1604 "MAXVIASTACK statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1605 "DEFAULT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1606 "A LAYER statement is missing in the VIA %s.\nAt least one LAYER is required per VIA statement."
-1607 "END VIA name %s is different from the VIA name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1608 "A VIARULE statement requires two layers."
-1609 "A DIRECTION statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer."
-1610 "An OVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG."
-1611 "An OVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE."
-1612 "An METALOVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE."
-1613 "An METALOVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG."
-1614 "An ENCLOSURE statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE."
-1615 "END VIARULE name %s is different from the VIARULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1616 "SAMENET statement is required inside SPACING for any lef file with version 5.4 and earlier, but is not defined in the parsed lef file."
-1617 "NONDEFAULTRULE statement requires at least one LAYER statement."
-1618 "NONDEFAULTRULE statement requires at least one VIA statement."
-1619 "END NONDEFAULTRULE name %s is different from the NONDEFAULTRULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1620 "HARDSPACING statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1621 "USEVIA statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1622 "USEVIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1623 "MINCUTS statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1624 "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1625 "A WIDTH statement is required in the LAYER statement in NONDEFAULTRULE."
-1626 "A SPACING statement is required in the LAYER statement in NONDEFAULTRULE for lef file with version 5.5 and earlier.\nYour lef file is defined with version %g. Update your lef to add a LAYER statement and try again."
-1627 "RESISTANCE RPERSQ statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1628 "CAPACITANCE CPERSQDIST statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1629 "EDGECAPACITANCE statement is a version 5.4 and later syntax.\n Your lef file is defined with version %g."
-1630 "DIAGWIDTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1631 "END SITE name %s is different from the SITE name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1632 "A CLASS statement is required in the SITE statement."
-1633 "A SIZE  statement is required in the SITE statement."
-1634 "END MACRO name %s is different from the MACRO name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1635 "COVER BUMP statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1636 "BLOCK BLACKBOX statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1637 "BLOCK SOFT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1638 "PAD AREAIO statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1639 "SPACER statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1640 "ANTENNACELL statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1641 "WELLTAP statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1642 "ORIGIN statement has been defined more than once in a MACRO statement.\nOnly one ORIGIN statement can be defined in a Macro.\nParser will stop processing."
-1643 "END PIN name %s is different from the PIN name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1644 "ANTENNASIZE statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g."
-1645 "ANTENNAMETALAREA statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g."
-1646 "ANTENNAMETALLENGTH statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g."
-1647 "ANTENNAPARTIALMETALAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1648 "ANTENNAPARTIALMETALSIDEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1649 "ANTENNAPARTIALCUTAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1650 "ANTENNADIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1651 "ANTENNAGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1652 "ANTENNAMAXAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1653 "ANTENNAMAXSIDEAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1654 "ANTENNAMAXCUTCAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1655 "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1656 "NETEXPR statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1657 "SUPPLYSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1658 "GROUNDSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1659 "THE SPACING statement has the value %g in MACRO OBS.\nValue has to be 0 or greater."
-1660 "THE DESIGNRULEWIDTH statement has the value %g in MACRO OBS.\nValue has to be 0 or greater."
-1661 "DENSITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1662 "END ARRAY name %s is different from the ARRAY name %s.\nCorrect the LEF file before rerunning it through the LEF parser."
-1663 "A CENTERTOCENTER statement was already defined in SPACING\nCENTERTOCENTER can only be defined once per LAYER CUT SPACING."
-1664 "CENTERTOCENTER statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1665 "A SAMENET statement was already defined in SPACING\nSAMENET can only be defined once per LAYER CUT SPACING."
-1666 "A PARALLELOVERLAP statement was already defined in SPACING\nPARALLELOVERLAP can only be defined once per LAYER CUT SPACING."
-1667 "A SAMENET statement was already defined in SPACING\nEither SAMENET or LAYER can be defined, but not both."
-1668 "ADJACENTCUTS statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1669 "A SAMENET statement was already defined in SPACING\nEither SAMENET or ADJACENTCUTS can be defined, but not both."
-1670 "A SAMENET statement was already defined in SPACING\nEither SAMENET or AREA can be defined, but not both."
-1671 "INPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INPUTPINANTENNASIZE syntax, which is incorrect."
-1672 "OUTPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new OUTPUTPINANTENNASIZE syntax, which is incorrect."
-1673 "INOUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INOUTPINANTENNASIZE syntax, which is incorrect."
-1674 "ANTENNAINPUTGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value."
-1675 "ANTENNAINPUTGATEAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINPUTGATEAREA syntax, which is incorrect."
-1676 "ANTENNAINOUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value."
-1677 "ANTENNAINOUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINOUTDIFFAREA syntax, which is incorrect."
-1678 "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number to 5.4 or later, or use the 5.3 syntax:\n{ INPUTINATENNASIZE | OUTPUTPINANTENNASIZE | INOUTPINANTENNASIZE } value.".
-1679 "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAOUTPUTDIFFAREA syntax, which is incorrect."
-1680 "PARALLELOVERLAP is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1681 "ENDOFLINE is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1682 "NOTCHLENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1683 "EXCEPTSAMEPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1684 "SAMENET is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1685 "ARRAYSPACING is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1686 "ANTENNACUMROUTINGPLUSCUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1687 "ANTENNAGATEPLUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1688 "ANTENNAAREAMINUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1689 "ANTENNAAREADIFFREDUCEPWL is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1690 "EXCEPTEXTRACUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1691 "LENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1693 "AREA is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1694 "SPACINGTABLE ORTHOGONAL is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1696 "ENDOFNOTCHWIDTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1697 "TWOWIDTHS is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1698 "BUMP is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1699 "EXCEPTPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1700 "MINIMUMCUT WITHIN is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1701 "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined."
-1702 "CURRENTDEN statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing."
-1703 "ANTENNADIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g."
-1704 "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier old syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFAREARATIO syntax, which is incorrect."
-1705 "VIARULE statement in a layer, requires a DIRECTION construct statement."
-1706 "An ENCLOSURE statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer."
-1707 "ENCLOSURE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g."
-1708 "A VIARULE GENERATE requires three layers."
-1709 "VIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g."
-1710 "MAXEDGES is a version 5.7 or later syntax.\nYour lef file is defined with version %g."
-1711 "NOSHAREDEDGE in LAYER ENCLOSURE is a version 5.8 or later syntax.\nYour lef file is defined with version %g."
-1712 "MINFEATURE statement was defined before UNITS.\nRefer the LEF Language Reference manual for the order of LEF statements."
-2000 "String has exceeded 1048576 characters, extra characters are truncated."
-2001 "No VERSION statement found, using the default value %2g."
-2002 "NAMESCASESENSITIVE is a required statement on LEF file with version 5.5 and earlier.\nWithout NAMESCASESENSITIVE defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement."
-2003 "BUSBITCHARS is a required statement on LEF file with version 5.5 and earlier.\nWithout BUSBITCHARS defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement."
-2004 "DIVIDERCHAR is a required statement on LEF file with version 5.5 and earlier.\nWithout DIVIDECHAR defined, the LEF file is technically incorrect.\nRefer to the LEF/DEF 5.5 or earlier Language Reference manual on how to define this statement."
-2005 "DIVIDERCHAR has an invalid null value. Value is set to default /"
-2006 "BUSBITCHAR has an invalid null value. Value is set to default []"
-2007 "NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2008 "NOWIREEXTENSIONATPIN statement is obsolete in version 5.6 or later.\nThe NOWIREEXTENSIONATPIN statement will be ignored."
-2009 "USEMINSPACING PIN statement is obsolete in version 5.6 or later.\n The USEMINSPACING PIN statement will be ignored."
-2010 "It is incorrect to have both SPACING rules & SPACINGTABLE rules within a ROUTING layer."
-2011 "SLOTWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2012 "SLOTWIRELENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2013 "SLOTWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2014 "SLOTLENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2015 "MAXADJACENTSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2016 "MAXCOAXIALSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2017 "MAXEDGESLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2018 "SPLITWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later."
-2019 "TOPOFSTACKONLY statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2020 "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2021 "turn-via is obsolete in version 5.6 and later.\n The LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2022 "DIRECTION statement in VIARULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2023 "OVERHANG statement will be translated into similar ENCLOSURE rule"
-2024 "METALOVERHANG statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2025 "SAMENET statement in NONDEFAULTRULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2026 "IRDROP statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2027 "MINFEATURE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2028 "DIELECTRIC statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2029 "RESISTANCE RPERSQ statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2030 "CAPACITANCE CPERSQDIST statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2031 "EDGECAPACITANCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2032 "A SITE statement is defined before SYMMETRY statement.\nTo avoid this warning in the future, define SITE after SYMMETRY."
-2033 "The statement COVER BUMP is a LEF version 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning."
-2034 "The statement BLOCK BLACKBOX is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning."
-2035 "The statement PAD AREAIO is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning."
-2036 "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2037 "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2038 "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2039 "A SITE statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define SITE after ORIGIN."
-2040 "A PIN statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define PIN after ORIGIN."
-2041 "A OBS statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define OBS after ORIGIN."
-2042 "LEQ statement in MACRO is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2043 "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2044 "LEQ statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2045 "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2046 "MACRO LEAKAGE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2047 "MACRO RISETHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2048 "MACRO FALLTHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2049 "MACRO RISESATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2050 "MACRO FALLSATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2051 "MACRO VLO statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2052 "MACRO VHI statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2053 "MACRO TIEOFFR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2054 "MACRO OUTPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2055 "MACRO OUTPUTRESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2056 "MACRO INPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2057 "MACRO CAPACITANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2058 "MACRO RESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2059 "MACRO PULLDOWNRES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2060 "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2061 "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2062 "MACRO RISEVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2063 "MACRO FALLVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2064 "MACRO IV_TABLES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2065 "Either PATH, RECT or POLYGON statement is a required in MACRO/PIN/PORT."
-2066 "MACRO TIMING statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2067 "DEFINE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2068 "DEFINES statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2069 "DEFINEB statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later."
-2070 "UNIVERSALNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2071 "EDGERATETHRESHOLD1 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2072 "EDGERATETHRESHOLD2 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2073 "EDGERATESCALEFACTOR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2074 "NOISETABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2075 "CORRECTIONTABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later."
-2076 "Either PATH, RECT or POLYGON statement is required in MACRO/OBS."
-2077 "A SPACING SAMENET section is defined but it is not legal in a LEF 5.7 version file.\nIt will be ignored which will probably cause real DRC violations to be ignored, and may\ncause false DRC violations to occur.\n\nTo avoid this warning, and correctly handle these DRC rules, you should modify your\nLEF to use the appropriate SAMENET keywords as described in the LEF/DEF 5.7\nmanual under the SPACING statements in the LAYER (Routing) and LAYER (Cut)\nsections listed in the LEF Table of Contents."
-2078 "It is illegal to have more than one SPACINGTABLE rules within a ROUTING layer"
-2079 "CURRENTDEN statement is obsolete in version 5.2 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.2 or later."
-2080 "The number of cut values in multiple ARRAYSPACING ARRAYCUTS are not in increasing order.\nTo be consistent with the documentation, update the cut values to increasing order."
-2502 "Message %s has been suppressed from output"
-2503 "Message %s has exceeded the message display limit of %d"
-3000 "There are still data after the END LIBRARY"
-4000 "lefwInitCbk was already called, cannot call lefwInit again.\nWriter Exit.\n"
-4001 "lefwInit was already called, cannot call lefwInitCbk again.\nWriter Exit.\n"
-4002 "lefwInit was already called, cannot call lefwInitCbk again.\nWriter Exit.\n"
-4003 "lefwLayerRoutingSpacingUseLengthThreshold cannot be called if\n\tlefwLayerRoutingSpacingRange has not been called.\n"
-4004 "lefwLayerRoutingSpacingInfluence cannot be called if\n\tlefRange and rightRange in lefwLayerRoutingSpacing are both zero.\n"
-4005 "lefwLayerRoutingSpacingInfluence cannot be called if\n\tlefRange and rightRange in lefwLayerRoutingSpacing are both zero."
-4006 "Need an output file if writing in encrypted format.\n"
-4100 "lefwWrite called before lefwInitCbk.\n"
-4101 "lefwSetRegisterUnusedCallbacks was not called to setup this data.\n"
-4500 "Callback for %s is required, but is not defined.\n\n"
-4700 "LEF items that were present but ignored because of no callbacks were set.\n"
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.y b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.y
deleted file mode 100644
index bfb65dc..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef.y
+++ /dev/null
@@ -1,7158 +0,0 @@
-// ************************************************************************** 
-// ************************************************************************** 
-// ATTENTION: THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT!               
-// ************************************************************************** 
-// ************************************************************************** 
-// Copyright 2012 - 2017, Cadence Design Systems                                     
-//                                                                            
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source             
-// Distribution,  Product Version 5.8.                                        
-//                                                                            
-// 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                                 
-//                                                                            
-//        http://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.                          
-//                                                                            
-// For updates, support, or to become part of the LEF/DEF Community,          
-// check www.openeda.org for details.             
-//
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $                            
-// ************************************************************************** 
-// ************************************************************************** 
-
-//  Error message number:
-//   100 -  lef reader, lefrReader.c
-//   1000 - lef parser, error, lex.cpph, lef.y (CALLBACK & CHKERR)
-//   1300 - from lefiError, lefiLayer.cpp
-//   1350 - from lefiError, lefiMacro.cpp
-//   1360 - from lefiError, lefiMisc.cpp
-//   1400 - from lefiError, lefiNonDefault.cpp
-//   1420 - from lefiError, lefiVia.cpp
-//   1430 - from lefiError, lefiViaRule.cpp
-//   1500 - lef parser, error, lef.y
-//   2000 - lef parser, warning, lex.cpph
-//   2500 - lef parser, warning, lef.y
-//   3000 - lef parser, info, lex.cpph
-//   4000 - lef writer, error, lefwWrtier.cpp & lefwWriterCalls.cpp
-//   4500 - lef writer, warning, lefwWrtier.cpp & lefwWriterCalls.cpp
-//   4700 - lef writer, info, lefwWrtier.cpp & lefwWriterCalls.cpp
-// 
-//   Highest message number = 4700
-
-%{
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "lex.h"
-#include "lefiDefs.hpp"
-#include "lefiUser.hpp"
-#include "lefiUtil.hpp"
-
-#include "lefrData.hpp"
-#include "lefrCallBacks.hpp"
-#include "lefrSettings.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#define LYPROP_ECAP "EDGE_CAPACITANCE"
-
-#define YYINITDEPTH 10000  // pcr 640902 - initialize the yystacksize to 300 
-                           // this may need to increase in a design gets 
-                           // larger and a polygon has around 300 sizes 
-                           // 11/21/2003 - incrreased to 500, design from 
-                           // Artisan is greater than 300, need to find a 
-                           // way to dynamically increase the size 
-                           // 2/10/2004 - increased to 1000 for pcr 686073 
-                           // 3/22/2004 - increased to 2000 for pcr 695879 
-                           // 9/29/2004 - double the size for pcr 746865 
-                           // tried to overwrite the yyoverflow definition 
-                           // it is impossible due to the union structure 
-                           // 10/03/2006 - increased to 10000 for pcr 913695 
-
-#define YYMAXDEPTH 300000  // 1/24/2008 - increased from 150000 
-                           // This value has to be greater than YYINITDEPTH 
-
-
-// Macro to describe how we handle a callback.
-// If the function was set then call it.
-// If the function returns non zero then there was an error
-// so call the error routine and exit.
-#define CALLBACK(func, typ, data) \
-    if (!lefData->lef_errors) { \
-      if (func) { \
-        if ((lefData->lefRetVal = (*func)(typ, data, lefSettings->UserData)) == 0) { \
-        } else { \
-          return lefData->lefRetVal; \
-        } \
-      } \
-    }
-
-#define CHKERR() \
-    if (lefData->lef_errors > 20) { \
-      lefError(1020, "Too many syntax errors."); \
-      lefData->lef_errors = 0; \
-      return 1; \
-    }
-
-// **********************************************************************
-// **********************************************************************
-
-#define C_EQ 0
-#define C_NE 1
-#define C_LT 2
-#define C_LE 3
-#define C_GT 4
-#define C_GE 5
-
-
-int comp_str(char *s1, int op, char *s2)
-{
-    int k = strcmp(s1, s2);
-    switch (op) {
-        case C_EQ: return k == 0;
-        case C_NE: return k != 0;
-        case C_GT: return k >  0;
-        case C_GE: return k >= 0;
-        case C_LT: return k <  0;
-        case C_LE: return k <= 0;
-        }
-    return 0;
-}
-int comp_num(double s1, int op, double s2)
-{
-    double k = s1 - s2;
-    switch (op) {
-        case C_EQ: return k == 0;
-        case C_NE: return k != 0;
-        case C_GT: return k >  0;
-        case C_GE: return k >= 0;
-        case C_LT: return k <  0;
-        case C_LE: return k <= 0;
-        }
-    return 0;
-}
-
-int validNum(int values) {
-    switch (values) {
-        case 100:
-        case 200:
-        case 1000:
-        case 2000:
-             return 1;
-        case 400:
-        case 800:
-        case 4000:
-        case 8000:
-        case 10000:
-        case 20000:
-             if (lefData->versionNum < 5.6) {
-                if (lefCallbacks->UnitsCbk) {
-                  if (lefData->unitsWarnings++ < lefSettings->UnitsWarnings) {
-                    lefData->outMsg = (char*)lefMalloc(10000);
-                    sprintf (lefData->outMsg,
-                       "Error found when processing LEF file '%s'\nUnit %d is a version 5.6 or later syntax\nYour lef file is defined with version %g.",
-                    lefData->lefrFileName, values, lefData->versionNum);
-                    lefError(1501, lefData->outMsg);
-                    lefFree(lefData->outMsg);
-                  }
-                }
-                return 0;
-             } else {
-                return 1;
-             }        
-    }
-    if (lefData->unitsWarnings++ < lefSettings->UnitsWarnings) {
-       lefData->outMsg = (char*)lefMalloc(10000);
-       sprintf (lefData->outMsg,
-          "The value %d defined for LEF UNITS DATABASE MICRONS is invalid\n. Correct value is 100, 200, 400, 800, 1000, 2000, 4000, 8000, 10000, or 20000", values);
-       lefError(1502, lefData->outMsg);
-       lefFree(lefData->outMsg);
-    }
-    CHKERR();
-    return 0;
-}
-
-int zeroOrGt(double values) {
-    if (values < 0)
-      return 0;
-    return 1;
-}
-
-%}
-
-%union {
-        double    dval ;
-        int       integer ;
-        char *    string ;
-        LefDefParser::lefPOINT  pt;
-}
-
-%token <string> K_HISTORY
-%token K_ABUT K_ABUTMENT K_ACTIVE K_ANALOG K_ARRAY K_AREA
-%token K_BLOCK K_BOTTOMLEFT K_BOTTOMRIGHT
-%token K_BY K_CAPACITANCE K_CAPMULTIPLIER K_CLASS K_CLOCK K_CLOCKTYPE
-%token K_COLUMNMAJOR K_DESIGNRULEWIDTH K_INFLUENCE
-%token K_CORE K_CORNER K_COVER K_CPERSQDIST K_CURRENT 
-%token K_CURRENTSOURCE K_CUT K_DEFAULT K_DATABASE K_DATA
-%token K_DIELECTRIC K_DIRECTION K_DO K_EDGECAPACITANCE
-%token K_EEQ K_END K_ENDCAP K_FALL K_FALLCS K_FALLT0 K_FALLSATT1
-%token K_FALLRS K_FALLSATCUR K_FALLTHRESH K_FEEDTHRU K_FIXED K_FOREIGN K_FROMPIN
-%token K_GENERATE K_GENERATOR K_GROUND K_HEIGHT K_HORIZONTAL K_INOUT K_INPUT
-%token K_INPUTNOISEMARGIN K_COMPONENTPIN
-%token K_INTRINSIC K_INVERT K_IRDROP K_ITERATE K_IV_TABLES K_LAYER K_LEAKAGE
-%token K_LEQ K_LIBRARY K_MACRO K_MATCH K_MAXDELAY K_MAXLOAD K_METALOVERHANG K_MILLIAMPS
-%token K_MILLIWATTS K_MINFEATURE K_MUSTJOIN K_NAMESCASESENSITIVE K_NANOSECONDS
-%token K_NETS K_NEW K_NONDEFAULTRULE
-%token K_NONINVERT K_NONUNATE K_OBS K_OHMS K_OFFSET K_ORIENTATION K_ORIGIN K_OUTPUT
-%token K_OUTPUTNOISEMARGIN
-%token K_OVERHANG K_OVERLAP K_OFF K_ON K_OVERLAPS K_PAD K_PATH K_PATTERN K_PICOFARADS
-%token K_PIN K_PITCH
-%token K_PLACED K_POLYGON K_PORT K_POST K_POWER K_PRE K_PULLDOWNRES K_RECT
-%token K_RESISTANCE K_RESISTIVE K_RING K_RISE K_RISECS K_RISERS K_RISESATCUR K_RISETHRESH
-%token K_RISESATT1 K_RISET0 K_RISEVOLTAGETHRESHOLD K_FALLVOLTAGETHRESHOLD
-%token K_ROUTING K_ROWMAJOR K_RPERSQ K_SAMENET K_SCANUSE K_SHAPE K_SHRINKAGE
-%token K_SIGNAL K_SITE K_SIZE K_SOURCE K_SPACER K_SPACING K_SPECIALNETS K_STACK
-%token K_START K_STEP K_STOP K_STRUCTURE K_SYMMETRY K_TABLE K_THICKNESS K_TIEHIGH
-%token K_TIELOW K_TIEOFFR K_TIME K_TIMING K_TO K_TOPIN K_TOPLEFT K_TOPRIGHT
-%token K_TOPOFSTACKONLY
-%token K_TRISTATE K_TYPE K_UNATENESS K_UNITS K_USE K_VARIABLE K_VERTICAL K_VHI
-%token K_VIA K_VIARULE K_VLO K_VOLTAGE K_VOLTS K_WIDTH K_X K_Y
-%token <string> T_STRING QSTRING
-%token <dval> NUMBER
-%token K_N K_S K_E K_W K_FN K_FS K_FE K_FW
-%token K_R0 K_R90 K_R180 K_R270 K_MX K_MY K_MXR90 K_MYR90
-%token K_USER K_MASTERSLICE
-%token K_ENDMACRO K_ENDMACROPIN K_ENDVIARULE K_ENDVIA K_ENDLAYER K_ENDSITE
-%token K_CANPLACE K_CANNOTOCCUPY K_TRACKS K_FLOORPLAN K_GCELLGRID K_DEFAULTCAP
-%token K_MINPINS K_WIRECAP
-%token K_STABLE K_SETUP K_HOLD
-%token K_DEFINE K_DEFINES K_DEFINEB K_IF K_THEN K_ELSE K_FALSE K_TRUE 
-%token K_EQ K_NE K_LE K_LT K_GE K_GT K_OR K_AND K_NOT
-%token K_DELAY K_TABLEDIMENSION K_TABLEAXIS K_TABLEENTRIES K_TRANSITIONTIME
-%token K_EXTENSION
-%token K_PROPDEF K_STRING K_INTEGER K_REAL K_RANGE K_PROPERTY
-%token K_VIRTUAL K_BUSBITCHARS K_VERSION
-%token K_BEGINEXT K_ENDEXT
-%token K_UNIVERSALNOISEMARGIN K_EDGERATETHRESHOLD1 K_CORRECTIONTABLE
-%token K_EDGERATESCALEFACTOR K_EDGERATETHRESHOLD2 K_VICTIMNOISE
-%token K_NOISETABLE K_EDGERATE K_OUTPUTRESISTANCE K_VICTIMLENGTH
-%token K_CORRECTIONFACTOR K_OUTPUTPINANTENNASIZE
-%token K_INPUTPINANTENNASIZE K_INOUTPINANTENNASIZE
-%token K_CURRENTDEN K_PWL K_ANTENNALENGTHFACTOR K_TAPERRULE
-%token K_DIVIDERCHAR K_ANTENNASIZE K_ANTENNAMETALLENGTH K_ANTENNAMETALAREA
-%token K_RISESLEWLIMIT K_FALLSLEWLIMIT K_FUNCTION K_BUFFER K_INVERTER
-%token K_NAMEMAPSTRING K_NOWIREEXTENSIONATPIN K_WIREEXTENSION
-%token K_MESSAGE K_CREATEFILE K_OPENFILE K_CLOSEFILE K_WARNING
-%token K_ERROR K_FATALERROR
-%token K_RECOVERY K_SKEW K_ANYEDGE K_POSEDGE K_NEGEDGE
-%token K_SDFCONDSTART K_SDFCONDEND K_SDFCOND
-%token K_MPWH K_MPWL K_PERIOD
-%token K_ACCURRENTDENSITY K_DCCURRENTDENSITY K_AVERAGE K_PEAK K_RMS K_FREQUENCY
-%token K_CUTAREA K_MEGAHERTZ K_USELENGTHTHRESHOLD K_LENGTHTHRESHOLD
-%token K_ANTENNAINPUTGATEAREA K_ANTENNAINOUTDIFFAREA K_ANTENNAOUTPUTDIFFAREA
-%token K_ANTENNAAREARATIO K_ANTENNADIFFAREARATIO K_ANTENNACUMAREARATIO
-%token K_ANTENNACUMDIFFAREARATIO K_ANTENNAAREAFACTOR K_ANTENNASIDEAREARATIO
-%token K_ANTENNADIFFSIDEAREARATIO K_ANTENNACUMSIDEAREARATIO
-%token K_ANTENNACUMDIFFSIDEAREARATIO K_ANTENNASIDEAREAFACTOR
-%token K_DIFFUSEONLY K_MANUFACTURINGGRID K_FIXEDMASK
-%token K_ANTENNACELL K_CLEARANCEMEASURE K_EUCLIDEAN K_MAXXY
-%token K_USEMINSPACING K_ROWMINSPACING K_ROWABUTSPACING K_FLIP K_NONE
-%token K_ANTENNAPARTIALMETALAREA K_ANTENNAPARTIALMETALSIDEAREA
-%token K_ANTENNAGATEAREA K_ANTENNADIFFAREA K_ANTENNAMAXAREACAR
-%token K_ANTENNAMAXSIDEAREACAR K_ANTENNAPARTIALCUTAREA K_ANTENNAMAXCUTCAR
-%token K_SLOTWIREWIDTH K_SLOTWIRELENGTH K_SLOTWIDTH K_SLOTLENGTH
-%token K_MAXADJACENTSLOTSPACING K_MAXCOAXIALSLOTSPACING K_MAXEDGESLOTSPACING
-%token K_SPLITWIREWIDTH K_MINIMUMDENSITY K_MAXIMUMDENSITY K_DENSITYCHECKWINDOW
-%token K_DENSITYCHECKSTEP K_FILLACTIVESPACING K_MINIMUMCUT K_ADJACENTCUTS
-%token K_ANTENNAMODEL K_BUMP K_ENCLOSURE K_FROMABOVE K_FROMBELOW
-%token K_IMPLANT K_LENGTH K_MAXVIASTACK K_AREAIO K_BLACKBOX
-%token K_MAXWIDTH K_MINENCLOSEDAREA K_MINSTEP K_ORIENT K_OXIDE1 K_OXIDE2
-%token K_OXIDE3 K_OXIDE4 K_PARALLELRUNLENGTH K_MINWIDTH
-%token K_PROTRUSIONWIDTH K_SPACINGTABLE K_WITHIN
-%token K_ABOVE K_BELOW K_CENTERTOCENTER K_CUTSIZE K_CUTSPACING K_DENSITY
-%token K_DIAG45 K_DIAG135 K_MASK
-%token K_DIAGMINEDGELENGTH K_DIAGSPACING K_DIAGPITCH K_DIAGWIDTH
-%token K_GENERATED K_GROUNDSENSITIVITY K_HARDSPACING K_INSIDECORNER
-%token K_LAYERS K_LENGTHSUM K_MICRONS K_MINCUTS
-%token K_MINSIZE K_NETEXPR K_OUTSIDECORNER
-%token K_PREFERENCLOSURE K_ROWCOL K_ROWPATTERN K_SOFT
-%token K_SUPPLYSENSITIVITY K_USEVIA
-%token K_USEVIARULE K_WELLTAP
-%token K_ARRAYCUTS K_ARRAYSPACING K_ANTENNAAREADIFFREDUCEPWL
-%token K_ANTENNAAREAMINUSDIFF
-%token K_ANTENNACUMROUTINGPLUSCUT K_ANTENNAGATEPLUSDIFF
-%token K_ENDOFLINE K_ENDOFNOTCHWIDTH K_EXCEPTEXTRACUT K_EXCEPTSAMEPGNET
-%token K_EXCEPTPGNET
-%token K_LONGARRAY K_MAXEDGES K_NOTCHLENGTH K_NOTCHSPACING K_ORTHOGONAL
-%token K_PARALLELEDGE K_PARALLELOVERLAP K_PGONLY K_PRL K_TWOEDGES K_TWOWIDTHS
-
-%type <string> start_macro end_macro
-%type <string> start_layer
-%type <string> macro_pin_use
-%type <string> macro_scan_use
-%type <string> pin_shape
-%type <string> pad_type core_type endcap_type class_type site_class
-%type <string> start_foreign spacing_type clearance_type
-%type <pt> pt 
-%type <pt> macro_origin
-%type <string> layer_option layer_options layer_type layer_direction
-%type <string> electrical_direction
-%type <integer> orientation maskColor
-%type <dval> expression
-%type <integer> b_expr
-%type <string>  s_expr
-%type <integer> relop spacing_value
-%type <string> opt_layer_name risefall unateness delay_or_transition
-%type <string> two_pin_trigger from_pin_trigger to_pin_trigger
-%type <string> one_pin_trigger req_layer_name 
-%type <string> layer_table_type layer_enclosure_type_opt layer_minstep_type
-%type <dval>   layer_sp_TwoWidthsPRL
-%type <dval> int_number
-
-%nonassoc IF
-%left K_AND
-%left K_OR
-%left K_LE K_EQ K_LT K_NE K_GE K_GT
-%nonassoc LNOT
-%left '-' '+'
-%left '*' '/'
-%nonassoc UMINUS
-
-%%
-
-lef_file: rules extension_opt  end_library
-      {
-        // 11/16/2001 - Wanda da Rosa - pcr 408334
-        // Return 1 if there are errors
-        if (lefData->lef_errors)
-           return 1;
-        if (!lefData->hasVer) {
-              char temp[300];
-              sprintf(temp, "No VERSION statement found, using the default value %2g.", lefData->versionNum);
-              lefWarning(2001, temp);            
-        }        
-        //only pre 5.6, 5.6 it is obsolete
-        if (!lefData->hasNameCase && lefData->versionNum < 5.6)
-           lefWarning(2002, "NAMESCASESENSITIVE is a required statement on LEF file with version 5.5 and earlier.\nWithout NAMESCASESENSITIVE defined, the LEF file is technically incorrect.\nRefer the LEF/DEF 5.5 or earlier Language Referece manual on how to define this statement.");
-        if (!lefData->hasBusBit && lefData->versionNum < 5.6)
-           lefWarning(2003, "BUSBITCHARS is a required statement on LEF file with version 5.5 and earlier.\nWithout BUSBITCHARS defined, the LEF file is technically incorrect.\nRefer the LEF/DEF 5.5 or earlier Language Referece manual on how to define this statement.");
-        if (!lefData->hasDivChar && lefData->versionNum < 5.6)
-           lefWarning(2004, "DIVIDERCHAR is a required statementon LEF file with version 5.5 and earlier.\nWithout DIVIDECHAR defined, the LEF file is technically incorrect.\nRefer the LEF/DEF 5.5 or earlier Language Referece manual on how to define this statement.");
-
-      }
-
-version: K_VERSION { lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING ';'
-      { 
-		 // More than 1 VERSION in lef file within the open file - It's wrong syntax, 
-		 // but copy old behavior - initialize lef reading.
-         if (lefData->hasVer)     
-         {
-			lefData->initRead();
-		 }
-
-         lefData->versionNum = convert_name2num($3);
-         if (lefData->versionNum > CURRENT_VERSION) {
-            char temp[120];
-            sprintf(temp,
-               "Lef parser %.1f does not support lef file with version %s. Parser will stop processing.", CURRENT_VERSION, $3);
-            lefError(1503, temp);
-            return 1;
-         }
-
-         if (lefCallbacks->VersionStrCbk) {
-            CALLBACK(lefCallbacks->VersionStrCbk, lefrVersionStrCbkType, $3);
-         } else {
-            if (lefCallbacks->VersionCbk)
-               CALLBACK(lefCallbacks->VersionCbk, lefrVersionCbkType, lefData->versionNum);
-         }
-         if (lefData->versionNum > 5.3 && lefData->versionNum < 5.4) {
-            lefData->ignoreVersion = 1;
-         }
-         lefData->use5_3 = lefData->use5_4 = 0;
-         lefData->lef_errors = 0;
-         lefData->hasVer = 1;
-         if (lefData->versionNum < 5.6) {
-            lefData->doneLib = 0;
-            lefData->namesCaseSensitive = lefSettings->CaseSensitive;
-         } else {
-            lefData->doneLib = 1;
-            lefData->namesCaseSensitive = 1;
-         }
-      }
-
-int_number : NUMBER 
-      {
-         // int_number represent 'integer-like' type. It can have fraction and exponent part 
-         // but the value shouldn't exceed the 64-bit integer limit. 
-         if (!(( yylval.dval >= lefData->leflVal) && ( yylval.dval <= lefData->lefrVal))) { // YES, it isn't really a number 
-            char *str = (char*) lefMalloc(strlen(lefData->current_token) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-203) Number has exceeded the limit for an integer. See file %s at line %d.\n",
-                    lefData->lefrFileName, lefData->lef_nlines);
-            fflush(stdout);
-            lefiError(0, 203, str);
-            free(str);
-            lefData->lef_errors++;
-        }
-
-        $$ = yylval.dval ;
-      }
-
-dividerchar: K_DIVIDERCHAR QSTRING ';'
-      {
-        if (lefCallbacks->DividerCharCbk) {
-          if (strcmp($2, "") != 0) {
-             CALLBACK(lefCallbacks->DividerCharCbk, lefrDividerCharCbkType, $2);
-          } else {
-             CALLBACK(lefCallbacks->DividerCharCbk, lefrDividerCharCbkType, "/");
-             lefWarning(2005, "DIVIDERCHAR has an invalid null value. Value is set to default /");
-          }
-        }
-        lefData->hasDivChar = 1;
-      }
-
-busbitchars: K_BUSBITCHARS QSTRING ';'
-      {
-        if (lefCallbacks->BusBitCharsCbk) {
-          if (strcmp($2, "") != 0) {
-             CALLBACK(lefCallbacks->BusBitCharsCbk, lefrBusBitCharsCbkType, $2); 
-          } else {
-             CALLBACK(lefCallbacks->BusBitCharsCbk, lefrBusBitCharsCbkType, "[]"); 
-             lefWarning(2006, "BUSBITCHAR has an invalid null value. Value is set to default []");
-          }
-        }
-        lefData->hasBusBit = 1;
-      }
-
-rules:
-        | rules rule
-        | error 
-            { }
-
-end_library:
-      {
-        if (lefData->versionNum >= 5.6) {
-           lefData->doneLib = 1;
-           lefData->ge56done = 1;
-        }
-      }
-      | K_END K_LIBRARY
-      {
-        lefData->doneLib = 1;
-        lefData->ge56done = 1;
-        if (lefCallbacks->LibraryEndCbk)
-          CALLBACK(lefCallbacks->LibraryEndCbk, lefrLibraryEndCbkType, 0);
-        // 11/16/2001 - Wanda da Rosa - pcr 408334
-        // Return 1 if there are errors
-      }
-
-rule:  version | busbitchars | case_sensitivity | units_section
-    | layer_rule | via | viarule | viarule_generate | dividerchar
-    | wireextension | msg_statement
-    | spacing_rule | dielectric | minfeature | irdrop | site | macro | array
-    | def_statement | nondefault_rule | prop_def_section
-    | universalnoisemargin | edgeratethreshold1
-    | edgeratescalefactor | edgeratethreshold2
-    | noisetable | correctiontable | input_antenna
-    | output_antenna | inout_antenna
-    | antenna_input | antenna_inout | antenna_output | manufacturing  | fixedmask 
-    | useminspacing | clearancemeasure | maxstack_via
-    | create_file_statement
-    ;
-
-case_sensitivity: K_NAMESCASESENSITIVE K_ON ';'
-          {
-            if (lefData->versionNum < 5.6) {
-              lefData->namesCaseSensitive = TRUE;
-              if (lefCallbacks->CaseSensitiveCbk)
-                CALLBACK(lefCallbacks->CaseSensitiveCbk, 
-                         lefrCaseSensitiveCbkType,
-                         lefData->namesCaseSensitive);
-              lefData->hasNameCase = 1;
-            } else
-              if (lefCallbacks->CaseSensitiveCbk) // write warning only if cbk is set 
-                 if (lefData->caseSensitiveWarnings++ < lefSettings->CaseSensitiveWarnings)
-                   lefWarning(2007, "NAMESCASESENSITIVE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-          }
-      | K_NAMESCASESENSITIVE K_OFF ';'
-          {
-            if (lefData->versionNum < 5.6) {
-              lefData->namesCaseSensitive = FALSE;
-              if (lefCallbacks->CaseSensitiveCbk)
-                CALLBACK(lefCallbacks->CaseSensitiveCbk, lefrCaseSensitiveCbkType,
-                               lefData->namesCaseSensitive);
-              lefData->hasNameCase = 1;
-            } else {
-              if (lefCallbacks->CaseSensitiveCbk) { // write error only if cbk is set 
-                if (lefData->caseSensitiveWarnings++ < lefSettings->CaseSensitiveWarnings) {
-                  lefError(1504, "NAMESCASESENSITIVE statement is set with OFF.\nStarting version 5.6, NAMESCASENSITIVE is obsolete,\nif it is defined, it has to have the ON value.\nParser will stop processing.");
-                  CHKERR();
-                }
-              }
-            }
-          }
-
-wireextension: K_NOWIREEXTENSIONATPIN K_ON ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->NoWireExtensionCbk)
-          CALLBACK(lefCallbacks->NoWireExtensionCbk, lefrNoWireExtensionCbkType, "ON");
-      } else
-        if (lefCallbacks->NoWireExtensionCbk) // write warning only if cbk is set 
-           if (lefData->noWireExtensionWarnings++ < lefSettings->NoWireExtensionWarnings)
-             lefWarning(2008, "NOWIREEXTENSIONATPIN statement is obsolete in version 5.6 or later.\nThe NOWIREEXTENSIONATPIN statement will be ignored.");
-    }
-  | K_NOWIREEXTENSIONATPIN K_OFF ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->NoWireExtensionCbk)
-          CALLBACK(lefCallbacks->NoWireExtensionCbk, lefrNoWireExtensionCbkType, "OFF");
-      } else
-        if (lefCallbacks->NoWireExtensionCbk) // write warning only if cbk is set 
-           if (lefData->noWireExtensionWarnings++ < lefSettings->NoWireExtensionWarnings)
-             lefWarning(2008, "NOWIREEXTENSIONATPIN statement is obsolete in version 5.6 or later.\nThe NOWIREEXTENSIONATPIN statement will be ignored.");
-    }
-
-fixedmask: K_FIXEDMASK ';'
-    { 
-       if (lefData->versionNum >= 5.8) {
-       
-          if (lefCallbacks->FixedMaskCbk) {
-            lefData->lefFixedMask = 1;
-            CALLBACK(lefCallbacks->FixedMaskCbk, lefrFixedMaskCbkType, lefData->lefFixedMask);
-          }
-          
-          lefData->hasFixedMask = 1;
-       }
-    }
-    
-manufacturing: K_MANUFACTURINGGRID int_number ';'
-    {
-      if (lefCallbacks->ManufacturingCbk)
-        CALLBACK(lefCallbacks->ManufacturingCbk, lefrManufacturingCbkType, $2);
-      lefData->hasManufactur = 1;
-    }
-
-useminspacing: K_USEMINSPACING spacing_type spacing_value ';'
-  {
-    if ((strcmp($2, "PIN") == 0) && (lefData->versionNum >= 5.6)) {
-      if (lefCallbacks->UseMinSpacingCbk) // write warning only if cbk is set 
-         if (lefData->useMinSpacingWarnings++ < lefSettings->UseMinSpacingWarnings)
-            lefWarning(2009, "USEMINSPACING PIN statement is obsolete in version 5.6 or later.\n The USEMINSPACING PIN statement will be ignored.");
-    } else {
-        if (lefCallbacks->UseMinSpacingCbk) {
-          lefData->lefrUseMinSpacing.set($2, $3);
-          CALLBACK(lefCallbacks->UseMinSpacingCbk, lefrUseMinSpacingCbkType,
-                   &lefData->lefrUseMinSpacing);
-      }
-    }
-  }
-
-clearancemeasure: K_CLEARANCEMEASURE clearance_type ';'
-    { CALLBACK(lefCallbacks->ClearanceMeasureCbk, lefrClearanceMeasureCbkType, $2); }
-
-clearance_type:
-  K_MAXXY   {$$ = (char*)"MAXXY";}
-  | K_EUCLIDEAN   {$$ = (char*)"EUCLIDEAN";}
-
-spacing_type:
-  K_OBS     {$$ = (char*)"OBS";}
-  | K_PIN   {$$ = (char*)"PIN";}
-
-spacing_value:
-  K_ON      {$$ = 1;}
-  | K_OFF   {$$ = 0;}
-
-units_section: start_units units_rules K_END K_UNITS
-    { 
-      if (lefCallbacks->UnitsCbk)
-        CALLBACK(lefCallbacks->UnitsCbk, lefrUnitsCbkType, &lefData->lefrUnits);
-    }
-
-start_units: K_UNITS
-    {
-      lefData->lefrUnits.clear();
-      if (lefData->hasManufactur) {
-        if (lefData->unitsWarnings++ < lefSettings->UnitsWarnings) {
-          lefError(1505, "MANUFACTURINGGRID statement was defined before UNITS.\nRefer the LEF Language Reference manual for the order of LEF statements.");
-          CHKERR();
-        }
-      }
-      if (lefData->hasMinfeature) {
-        if (lefData->unitsWarnings++ < lefSettings->UnitsWarnings) {
-          lefError(1712, "MINFEATURE statement was defined before UNITS.\nRefer the LEF Language Reference manual for the order of LEF statements.");
-          CHKERR();
-        }
-      }
-      if (lefData->versionNum < 5.6) {
-        if (lefData->hasSite) {//SITE is defined before UNIT and is illegal in pre 5.6
-          lefError(1713, "SITE statement was defined before UNITS.\nRefer the LEF Language Reference manual for the order of LEF statements.");
-          CHKERR();
-        }
-      }
-    }
-
-units_rules: 
-  | units_rules units_rule
-  ;
-
-units_rule: K_TIME K_NANOSECONDS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setTime($3); }
-  | K_CAPACITANCE K_PICOFARADS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setCapacitance($3); }
-  | K_RESISTANCE K_OHMS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setResistance($3); }
-  | K_POWER K_MILLIWATTS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setPower($3); }
-  | K_CURRENT K_MILLIAMPS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setCurrent($3); }
-  | K_VOLTAGE K_VOLTS int_number ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setVoltage($3); }
-  | K_DATABASE K_MICRONS int_number ';'
-    { 
-      if(validNum((int)$3)) {
-         if (lefCallbacks->UnitsCbk)
-            lefData->lefrUnits.setDatabase("MICRONS", $3);
-      }
-    }
-  | K_FREQUENCY K_MEGAHERTZ NUMBER ';'
-    { if (lefCallbacks->UnitsCbk) lefData->lefrUnits.setFrequency($3); }
-
-layer_rule: start_layer 
-    layer_options end_layer
-    { 
-      if (lefCallbacks->LayerCbk)
-        CALLBACK(lefCallbacks->LayerCbk, lefrLayerCbkType, &lefData->lefrLayer);
-    }
-
-start_layer: K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    { 
-      if (lefData->lefrHasMaxVS) {   // 5.5 
-        if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-          if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-            lefError(1506, "A MAXVIASTACK statement is defined before the LAYER statement.\nRefer to the LEF Language Reference manual for the order of LEF statements.");
-            CHKERR();
-          }
-        }
-      }
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setName($3);
-      lefData->useLenThr = 0;
-      lefData->layerCut = 0;
-      lefData->layerMastOver = 0;
-      lefData->layerRout = 0;
-      lefData->layerDir = 0;
-      lefData->lefrHasLayer = 1;
-      //strcpy(lefData->layerName, $3);
-      lefData->layerName = strdup($3);
-      lefData->hasType = 0;
-      lefData->hasMask = 0;
-      lefData->hasPitch = 0;
-      lefData->hasWidth = 0;
-      lefData->hasDirection = 0;
-      lefData->hasParallel = 0;
-      lefData->hasInfluence = 0;
-      lefData->hasTwoWidths = 0;
-      lefData->lefrHasSpacingTbl = 0;
-      lefData->lefrHasSpacing = 0;
-    }
-
-end_layer: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    { 
-      if (strcmp(lefData->layerName, $3) != 0) {
-        if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-          if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-             lefData->outMsg = (char*)lefMalloc(10000);
-             sprintf (lefData->outMsg,
-                "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->layerName);
-             lefError(1507, lefData->outMsg);
-             lefFree(lefData->outMsg);
-             lefFree(lefData->layerName);
-             CHKERR(); 
-          } else
-             lefFree(lefData->layerName);
-        } else
-          lefFree(lefData->layerName);
-      } else
-        lefFree(lefData->layerName);
-      if (!lefSettings->RelaxMode) {
-        if (lefData->hasType == 0) {
-          if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1508, "TYPE statement is a required statement in a LAYER and it is not defined.");
-               CHKERR(); 
-            }
-          }
-        }
-        if ((lefData->layerRout == 1) && (lefData->hasPitch == 0)) {
-          if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1509, "PITCH statement is a required statement in a LAYER with type ROUTING and it is not defined.");
-              CHKERR(); 
-            }
-          }
-        }
-        if ((lefData->layerRout == 1) && (lefData->hasWidth == 0)) {
-          if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1510, "WIDTH statement is a required statement in a LAYER with type ROUTING and it is not defined.");
-              CHKERR(); 
-            }
-          }
-        }
-        if ((lefData->layerRout == 1) && (lefData->hasDirection == 0)) {
-          if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg, "The DIRECTION statement which is required in a LAYER with TYPE ROUTING is not defined in LAYER %s.\nUpdate your lef file and add the DIRECTION statement for layer %s.", $3, $3);
-              lefError(1511, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR(); 
-            }
-          }
-        }
-      }
-    }
-
-layer_options:
-    { }
-  | layer_options layer_option    // Use left recursions 
-    { }
-
-layer_option:
-  K_ARRAYSPACING                   // 5.7 
-    {
-       // let setArraySpacingCutSpacing to set the data 
-    }
-    layer_arraySpacing_long
-    layer_arraySpacing_width
-    K_CUTSPACING int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.setArraySpacingCut($6);
-         lefData->arrayCutsVal = 0;
-      }
-    }
-    layer_arraySpacing_arraycuts ';'
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "ARRAYSPACING is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1685, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      }
-    }
-  | K_TYPE layer_type ';'
-    {
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.setType($2);
-      lefData->hasType = 1;
-    }
-  | K_MASK int_number ';'
-    {
-      if (lefData->versionNum < 5.8) {
-          if (lefData->layerWarnings++ < lefSettings->ViaWarnings) {
-              lefError(2081, "MASK information can only be defined with version 5.8");
-              CHKERR(); 
-          }           
-      } else {
-          if (lefCallbacks->LayerCbk) {
-            lefData->lefrLayer.setMask((int)$2);
-          }
-          
-          lefData->hasMask = 1;
-      }
-    }
-  | K_PITCH int_number ';'
-    { 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setPitch($2);
-      lefData->hasPitch = 1;  
-    }
-  | K_PITCH int_number int_number ';'
-    { 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setPitchXY($2, $3);
-      lefData->hasPitch = 1;  
-    }
-  | K_DIAGPITCH int_number ';'
-    { 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDiagPitch($2);
-    }
-  | K_DIAGPITCH int_number int_number ';'
-    { 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDiagPitchXY($2, $3);
-    }
-  | K_OFFSET int_number ';'
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setOffset($2);
-    }
-  | K_OFFSET int_number int_number ';'
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setOffsetXY($2, $3);
-    }
-  | K_DIAGWIDTH int_number ';'
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDiagWidth($2);
-    }
-  | K_DIAGSPACING int_number ';'
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDiagSpacing($2);
-    }
-  | K_WIDTH int_number ';'    // CUT & ROUTING
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setWidth($2);
-      lefData->hasWidth = 1;  
-    }
-  | K_AREA NUMBER ';'
-    {
-      // Issue an error is this is defined in masterslice
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1715, "It is incorrect to define an AREA statement in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.setArea($2);
-      }
-    }
-  | K_SPACING int_number
-    {
-      lefData->hasSpCenter = 0;       // reset to 0, only once per spacing is allowed 
-      lefData->hasSpSamenet = 0;
-      lefData->hasSpParallel = 0;
-      lefData->hasSpLayer = 0;
-      lefData->layerCutSpacing = $2;  // for error message purpose
-      // 11/22/99 - Wanda da Rosa, PCR 283762
-      //            Issue an error is this is defined in masterslice
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1512, "It is incorrect to define a SPACING statement in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      // 5.5 either SPACING or SPACINGTABLE, not both for routing layer only
-      if (lefData->layerRout) {
-        if (lefData->lefrHasSpacingTbl && lefData->versionNum < 5.7) {
-           if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-              if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                lefWarning(2010, "It is incorrect to have both SPACING rules & SPACINGTABLE rules within a ROUTING layer");
-              }
-           }
-        }
-        if (lefCallbacks->LayerCbk)
-           lefData->lefrLayer.setSpacingMin($2);
-        lefData->lefrHasSpacing = 1;
-      } else { 
-        if (lefCallbacks->LayerCbk)
-           lefData->lefrLayer.setSpacingMin($2);
-      }
-    }
-    layer_spacing_opts
-    layer_spacing_cut_routing ';' {}
-  | K_SPACINGTABLE K_ORTHOGONAL K_WITHIN int_number K_SPACING int_number   // 5.7 
-    {
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.setSpacingTableOrtho();
-      if (lefCallbacks->LayerCbk) // due to converting to C, else, convertor produce 
-         lefData->lefrLayer.addSpacingTableOrthoWithin($4, $6);//bad code
-    }
-    layer_spacingtable_opts ';'
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "SPACINGTABLE ORTHOGONAL is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1694, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      }
-    }
-  | K_DIRECTION layer_direction ';'
-    {
-      lefData->layerDir = 1;
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1513, "DIRECTION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDirection($2);
-      lefData->hasDirection = 1;  
-    }
-  | K_RESISTANCE K_RPERSQ int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1514, "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setResistance($3);
-    }
-  | K_RESISTANCE K_RPERSQ K_PWL '(' res_points ')' ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1515, "RESISTANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-    }
-  | K_CAPACITANCE K_CPERSQDIST int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1516, "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCapacitance($3);
-    }
-  | K_CAPACITANCE K_CPERSQDIST K_PWL '(' cap_points ')' ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1517, "CAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-    }
-  | K_HEIGHT int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1518, "HEIGHT statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setHeight($2);
-    }
-  | K_WIREEXTENSION int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1519, "WIREEXTENSION statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setWireExtension($2);
-    }
-  | K_THICKNESS int_number ';'
-    {
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1520, "THICKNESS statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setThickness($2);
-    }
-  | K_SHRINKAGE int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1521, "SHRINKAGE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setShrinkage($2);
-    }
-  | K_CAPMULTIPLIER int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1522, "CAPMULTIPLIER statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCapMultiplier($2);
-    }
-  | K_EDGECAPACITANCE int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1523, "EDGECAPACITANCE statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setEdgeCap($2);
-    }
-
-  | K_ANTENNALENGTHFACTOR int_number ';'
-    { // 5.3 syntax 
-      lefData->use5_3 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1525, "ANTENNALENGTHFACTOR statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      } else if (lefData->versionNum >= 5.4) {
-         if (lefData->use5_4) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                  lefData->outMsg = (char*)lefMalloc(10000);
-                  sprintf (lefData->outMsg,
-                    "ANTENNALENGTHFACTOR statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNALENGTHFACTOR syntax, which is incorrect.", lefData->versionNum);
-                  lefError(1526, lefData->outMsg);
-                  lefFree(lefData->outMsg);
-                  CHKERR();
-               }
-            }
-         }
-      }
-
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaLength($2);
-    }
-  | K_CURRENTDEN int_number ';'
-    {
-      if (lefData->versionNum < 5.2) {
-         if (!lefData->layerRout) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefError(1702, "CURRENTDEN statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-                 CHKERR();
-               }
-            }
-         }
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCurrentDensity($2);
-      } else {
-         if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-            lefWarning(2079, "CURRENTDEN statement is obsolete in version 5.2 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.2 or later.");
-            CHKERR();
-         }
-      }
-    }
-  | K_CURRENTDEN K_PWL '(' current_density_pwl_list ')' ';'
-    { 
-      if (lefData->versionNum < 5.2) {
-         if (!lefData->layerRout) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefError(1702, "CURRENTDEN statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-                 CHKERR();
-               }
-            }
-         }
-      } else {
-         if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-            lefWarning(2079, "CURRENTDEN statement is obsolete in version 5.2 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.2 or later.");
-            CHKERR();
-         }
-      }
-    }
-  | K_CURRENTDEN '(' int_number int_number ')' ';'
-    {
-      if (lefData->versionNum < 5.2) {
-         if (!lefData->layerRout) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefError(1702, "CURRENTDEN statement can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-                 CHKERR();
-               }
-            }
-         }
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCurrentPoint($3, $4);
-      } else {
-         if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-            lefWarning(2079, "CURRENTDEN statement is obsolete in version 5.2 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.2 or later.");
-            CHKERR();
-         }
-      }
-    }
-  | K_PROPERTY { lefData->lefDumbMode = 10000000;} layer_prop_list ';'
-    {
-      lefData->lefDumbMode = 0;
-    }
-  | K_ACCURRENTDENSITY layer_table_type
-    {
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1527, "ACCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addAccurrentDensity($2);      
-    }
-    layer_frequency {
-
-    }
-  | K_ACCURRENTDENSITY layer_table_type int_number ';'
-    {
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1527, "ACCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) {
-           lefData->lefrLayer.addAccurrentDensity($2);
-           lefData->lefrLayer.setAcOneEntry($3);
-      }
-    }
-  | K_DCCURRENTDENSITY K_AVERAGE int_number ';'
-    {
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1528, "DCCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addDccurrentDensity("AVERAGE");
-         lefData->lefrLayer.setDcOneEntry($3);
-      }
-    }
-  | K_DCCURRENTDENSITY K_AVERAGE K_CUTAREA NUMBER
-    {
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1528, "DCCURRENTDENSITY statement can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerCut) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1529, "CUTAREA statement can only be defined in LAYER with type CUT. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addDccurrentDensity("AVERAGE");
-         lefData->lefrLayer.addNumber($4);
-      }
-    }
-    number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addDcCutarea(); }
-    dc_layer_table {}
-  | K_DCCURRENTDENSITY K_AVERAGE K_WIDTH int_number
-    {
-      if (lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1528, "DCCURRENTDENSITY can't be defined in LAYER with TYPE MASTERSLICE or OVERLAP. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1530, "WIDTH statement can only be defined in LAYER with type ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addDccurrentDensity("AVERAGE");
-         lefData->lefrLayer.addNumber($4);
-      }
-    }
-    int_number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addDcWidth(); }
-    dc_layer_table {}
-
-// 3/23/2000 - 5.4 syntax.  Wanda da Rosa 
-  | K_ANTENNAAREARATIO int_number ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNAAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1531, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1704, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1533, "ANTENNAAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaAreaRatio($2);
-    }
-  | K_ANTENNADIFFAREARATIO
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNADIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1532, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNADIFFAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1704, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1534, "ANTENNADIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      lefData->antennaType = lefiAntennaDAR; 
-    }
-    layer_antenna_pwl ';' {}
-  | K_ANTENNACUMAREARATIO int_number ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNACUMAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1535, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNACUMAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1536, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1537, "ANTENNACUMAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaCumAreaRatio($2);
-    }
-  | K_ANTENNACUMDIFFAREARATIO
-    {  // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNACUMDIFFAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1538, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNACUMDIFFAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1539, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1540, "ANTENNACUMDIFFAREARATIO statement can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      lefData->antennaType = lefiAntennaCDAR;
-    }
-    layer_antenna_pwl ';' {} 
-  | K_ANTENNAAREAFACTOR int_number
-    { // both 5.3  & 5.4 syntax 
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1541, "ANTENNAAREAFACTOR can only be defined in LAYER with TYPE ROUTING or CUT. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      // this does not need to check, since syntax is in both 5.3 & 5.4 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaAreaFactor($2);
-      lefData->antennaType = lefiAntennaAF;
-    }
-    layer_antenna_duo ';' {}
-  | K_ANTENNASIDEAREARATIO int_number ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1542, "ANTENNASIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNASIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1543, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNASIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1544, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaSideAreaRatio($2);
-    }
-  | K_ANTENNADIFFSIDEAREARATIO
-    {  // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1545, "ANTENNADIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1546, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNADIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNADIFFSIDEAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1547, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      lefData->antennaType = lefiAntennaDSAR;
-    }
-    layer_antenna_pwl ';' {}
-  | K_ANTENNACUMSIDEAREARATIO int_number ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1548, "ANTENNACUMSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNACUMSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1549, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNACUMSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMSIDEAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1550, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaCumSideAreaRatio($2);
-    }
-  | K_ANTENNACUMDIFFSIDEAREARATIO
-    {  // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1551, "ANTENNACUMDIFFSIDEAREARATIO can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1552, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNACUMDIFFSIDEAREARATIO statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNACUMDIFFSIDEAREARATIO syntax, which is incorrect.", lefData->versionNum);
-               lefError(1553, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      lefData->antennaType = lefiAntennaCDSAR;
-    }
-    layer_antenna_pwl ';' {}
-  | K_ANTENNASIDEAREAFACTOR int_number
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && (lefData->layerCut || lefData->layerMastOver)) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1554, "ANTENNASIDEAREAFACTOR can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNASIDEAREAFACTOR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1555, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNASIDEAREAFACTOR statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNASIDEAREAFACTOR syntax, which is incorrect.", lefData->versionNum);
-               lefError(1556, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaSideAreaFactor($2);
-      lefData->antennaType = lefiAntennaSAF;
-    }
-    layer_antenna_duo ';' {}
-  | K_ANTENNAMODEL // 5.5 
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (!lefData->layerRout && !lefData->layerCut && lefData->layerMastOver) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1557, "ANTENNAMODEL can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1558, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->use5_3) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "ANTENNAMODEL statement is a version 5.4 or earlier syntax.\nYour lef file with version %g, has both old and new ANTENNAMODEL syntax, which is incorrect.", lefData->versionNum);
-               lefError(1559, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      lefData->antennaType = lefiAntennaO;
-    }
-    layer_oxide ';' {}
-  | K_ANTENNACUMROUTINGPLUSCUT ';'        // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "ANTENNACUMROUTINGPLUSCUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1686, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      } else {
-         if (!lefData->layerRout && !lefData->layerCut) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                  lefError(1560, "ANTENNACUMROUTINGPLUSCUT can only be defined in LAYER with type ROUTING or CUT. Parser will stop processing.");
-                  CHKERR();
-               }
-            }
-         }
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaCumRoutingPlusCut();
-      }
-    }
-  | K_ANTENNAGATEPLUSDIFF int_number ';'      // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "ANTENNAGATEPLUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1687, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      } else {
-         if (!lefData->layerRout && !lefData->layerCut) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                  lefError(1561, "ANTENNAGATEPLUSDIFF can only be defined in LAYER with type ROUTING or CUT. Parser will stop processing.");
-                  CHKERR();
-               }
-            }
-         }
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaGatePlusDiff($2);
-      }
-    }
-  | K_ANTENNAAREAMINUSDIFF int_number ';'     // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "ANTENNAAREAMINUSDIFF is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1688, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      } else {
-         if (!lefData->layerRout && !lefData->layerCut) {
-            if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                  lefError(1562, "ANTENNAAREAMINUSDIFF can only be defined in LAYER with type ROUTING or CUT. Parser will stop processing.");
-                  CHKERR();
-               }
-            }
-         }
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setAntennaAreaMinusDiff($2);
-      }
-    }
-  | K_ANTENNAAREADIFFREDUCEPWL '(' pt pt            // 5.7 
-    {
-      if (!lefData->layerRout && !lefData->layerCut) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1563, "ANTENNAAREADIFFREDUCEPWL can only be defined in LAYER with type ROUTING or CUT. Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) { // require min 2 points, set the 1st 2 
-         if (lefData->lefrAntennaPWLPtr) {
-            lefData->lefrAntennaPWLPtr->Destroy();
-            lefFree(lefData->lefrAntennaPWLPtr);
-         }
-
-         lefData->lefrAntennaPWLPtr = lefiAntennaPWL::create();
-         lefData->lefrAntennaPWLPtr->addAntennaPWL($3.x, $3.y);
-         lefData->lefrAntennaPWLPtr->addAntennaPWL($4.x, $4.y);
-      }
-    } 
-    layer_diffusion_ratios ')' ';'
-    {
-      if (lefCallbacks->LayerCbk) {
-        lefData->lefrLayer.setAntennaPWL(lefiAntennaADR, lefData->lefrAntennaPWLPtr);
-        lefData->lefrAntennaPWLPtr = NULL;
-      }
-    }
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "ANTENNAAREADIFFREDUCEPWL is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1689, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      }
-    }
-  | K_SLOTWIREWIDTH int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWireWidth($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2011, "SLOTWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SLOTWIREWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1564, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWireWidth($2);
-    }
-  | K_SLOTWIRELENGTH int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWireLength($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2012, "SLOTWIRELENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SLOTWIRELENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1565, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWireLength($2);
-    }
-  | K_SLOTWIDTH int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWidth($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2013, "SLOTWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SLOTWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1566, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotWidth($2);
-    }
-  | K_SLOTLENGTH int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotLength($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2014, "SLOTLENGTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SLOTLENGTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1567, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSlotLength($2);
-    }
-  | K_MAXADJACENTSLOTSPACING int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxAdjacentSlotSpacing($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2015, "MAXADJACENTSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MAXADJACENTSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1568, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxAdjacentSlotSpacing($2);
-    }
-  | K_MAXCOAXIALSLOTSPACING int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxCoaxialSlotSpacing($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-                lefWarning(2016, "MAXCOAXIALSLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MAXCOAXIALSLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1569, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxCoaxialSlotSpacing($2);
-    }
-  | K_MAXEDGESLOTSPACING int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxEdgeSlotSpacing($2);
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2017, "MAXEDGESLOTSPACING statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MAXEDGESLOTSPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1570, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else
-         if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxEdgeSlotSpacing($2);
-    }
-  | K_SPLITWIREWIDTH int_number ';'
-    { // 5.4 syntax 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum >= 5.7) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-               lefWarning(2018, "SPLITWIREWIDTH statement is obsolete in version 5.7 or later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.7 or later.");
-         }
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SPLITWIREWIDTH statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1571, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setSplitWireWidth($2);
-    }
-  | K_MINIMUMDENSITY int_number ';'
-    { // 5.4 syntax, pcr 394389 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MINIMUMDENSITY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1572, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMinimumDensity($2);
-    }
-  | K_MAXIMUMDENSITY int_number ';'
-    { // 5.4 syntax, pcr 394389 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MAXIMUMDENSITY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1573, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaximumDensity($2);
-    }
-  | K_DENSITYCHECKWINDOW int_number int_number ';'
-    { // 5.4 syntax, pcr 394389 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "DENSITYCHECKWINDOW statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1574, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDensityCheckWindow($2, $3);
-    }
-  | K_DENSITYCHECKSTEP int_number ';'
-    { // 5.4 syntax, pcr 394389 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "DENSITYCHECKSTEP statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1575, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setDensityCheckStep($2);
-    }
-  | K_FILLACTIVESPACING int_number ';'
-    { // 5.4 syntax, pcr 394389 
-      if (lefData->ignoreVersion) {
-         // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "FILLACTIVESPACING statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1576, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setFillActiveSpacing($2);
-    }
-  | K_MAXWIDTH int_number ';'              // 5.5 
-    {
-      // 5.5 MAXWIDTH, is for routing layer only
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefError(1577, "MAXWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MAXWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1578, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMaxwidth($2);
-    }
-  | K_MINWIDTH int_number ';'              // 5.5 
-    {
-      // 5.5 MINWIDTH, is for routing layer only
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1579, "MINWIDTH statement can only be defined in LAYER with TYPE ROUTING.  Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MINWIDTH statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1580, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setMinwidth($2);
-    }
-  | K_MINENCLOSEDAREA NUMBER           // 5.5 
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "MINENCLOSEDAREA statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1581, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addMinenclosedarea($2);
-    }
-    layer_minen_width ';' {}
-  | K_MINIMUMCUT int_number K_WIDTH int_number // 5.5 
-    { // pcr 409334 
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addMinimumcut((int)$2, $4); 
-      lefData->hasLayerMincut = 0;
-    }
-    layer_minimumcut_within
-    layer_minimumcut_from
-    layer_minimumcut_length ';'
-    {
-      if (!lefData->hasLayerMincut) {   // FROMABOVE nor FROMBELOW is set 
-         if (lefCallbacks->LayerCbk)
-             lefData->lefrLayer.addMinimumcutConnect((char*)"");
-      }
-    }
-  | K_MINSTEP int_number               // 5.5 
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addMinstep($2);
-    }
-    layer_minstep_options ';'      // 5.6 
-    {
-    }
-  | K_PROTRUSIONWIDTH int_number K_LENGTH int_number K_WIDTH int_number ';'  // 5.5 
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "PROTRUSION RULE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1582, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.setProtrusion($2, $4, $6);
-    }
-  | K_SPACINGTABLE                    // 5.5 
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "SPACINGTABLE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1583, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      // 5.5 either SPACING or SPACINGTABLE in a layer, not both
-      if (lefData->lefrHasSpacing && lefData->layerRout && lefData->versionNum < 5.7) {
-         if (lefCallbacks->LayerCbk)  // write warning only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefWarning(2010, "It is incorrect to have both SPACING rules & SPACINGTABLE rules within a ROUTING layer");
-            }
-      } 
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpacingTable();
-      lefData->lefrHasSpacingTbl = 1;
-    }
-    sp_options ';' {}
-  // 10/12/2003 - 5.6 syntax 
-  | K_ENCLOSURE layer_enclosure_type_opt int_number int_number
-    {
-      if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1584, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addEnclosure($2, $3, $4);
-    }
-    layer_enclosure_width_opt ';' {}
-  // 12/30/2003 - 5.6 syntax 
-  | K_PREFERENCLOSURE layer_enclosure_type_opt int_number int_number
-    {
-      if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "PREFERENCLOSURE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1585, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addPreferEnclosure($2, $3, $4);
-    }
-    layer_preferenclosure_width_opt ';' {}
-  | K_RESISTANCE int_number ';'
-    {
-      if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "RESISTANCE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1586, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else {
-         if (lefCallbacks->LayerCbk)
-            lefData->lefrLayer.setResPerCut($2);
-      }
-    }
-  | K_DIAGMINEDGELENGTH int_number ';'
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1587, "DIAGMINEDGELENGTH can only be defined in LAYER with TYPE ROUTING. Parser will stop processing.");
-              CHKERR();
-            }
-         }
-      } else if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "DIAGMINEDGELENGTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1588, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else {
-         if (lefCallbacks->LayerCbk)
-            lefData->lefrLayer.setDiagMinEdgeLength($2);
-      }
-    }
-  | K_MINSIZE
-    {
-      // Use the polygon code to retrieve the points for MINSIZE
-      lefData->lefrGeometriesPtr = (lefiGeometries*)lefMalloc(sizeof(lefiGeometries));
-      lefData->lefrGeometriesPtr->Init();
-      lefData->lefrDoGeometries = 1;
-    }
-    firstPt otherPts ';' 
-    {
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrGeometriesPtr->addPolygon();
-         lefData->lefrLayer.setMinSize(lefData->lefrGeometriesPtr);
-      }
-     lefData->lefrDoGeometries = 0;
-      lefData->lefrGeometriesPtr->Destroy();
-      lefFree(lefData->lefrGeometriesPtr);
-    }
-
-layer_arraySpacing_long:            // 5.7
-  // empty 
-  | K_LONGARRAY
-    {
-        if (lefCallbacks->LayerCbk)
-           lefData->lefrLayer.setArraySpacingLongArray();
-    }
-
-layer_arraySpacing_width:           // 5.7
-  // empty 
-  | K_WIDTH int_number
-    {
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.setArraySpacingWidth($2);
-    }
-
-layer_arraySpacing_arraycuts:       // 5.7
-  // empty 
-  | layer_arraySpacing_arraycut layer_arraySpacing_arraycuts
-
-layer_arraySpacing_arraycut:
-  K_ARRAYCUTS int_number K_SPACING int_number
-    {
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addArraySpacingArray((int)$2, $4);
-         if (lefData->arrayCutsVal > (int)$2) {
-            // Mulitiple ARRAYCUTS value needs to me in ascending order 
-            if (!lefData->arrayCutsWar) {
-               if (lefData->layerWarnings++ < lefSettings->LayerWarnings)
-                  lefWarning(2080, "The number of cut values in multiple ARRAYSPACING ARRAYCUTS are not in increasing order.\nTo be consistent with the documentation, update the cut values to increasing order.");
-               lefData->arrayCutsWar = 1;
-            }
-         }
-         lefData->arrayCutsVal = (int)$2;
-    }
-
-sp_options:
-  K_PARALLELRUNLENGTH int_number
-    { 
-      if (lefData->hasInfluence) {  // 5.5 - INFLUENCE table must follow a PARALLEL
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1589, "An INFLUENCE table statement was defined before the PARALLELRUNLENGTH table statement.\nINFLUENCE table statement should be defined following the PARALLELRUNLENGTH.\nChange the LEF file and rerun the parser.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefData->hasParallel) { // 5.5 - Only one PARALLEL table is allowed per layer
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1590, "There is multiple PARALLELRUNLENGTH table statements are defined within a layer.\nAccording to the LEF Reference Manual, only one PARALLELRUNLENGTH table statement is allowed per layer.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2);
-      lefData->hasParallel = 1;
-    }
-    int_number_list
-    {
-      lefData->spParallelLength = lefData->lefrLayer.getNumber();
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpParallelLength();
-    }
-    K_WIDTH int_number
-    { 
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addSpParallelWidth($7);
-      }
-    }
-    int_number_list
-    { 
-      if (lefData->lefrLayer.getNumber() != lefData->spParallelLength) {
-         if (lefCallbacks->LayerCbk) {
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1591, "The number of length in the PARALLELRUNLENGTH statement is not equal to\nthe total number of spacings defined in the WIDTH statement in the SPACINGTABLE.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpParallelWidthSpacing();
-    }
-    layer_sp_parallel_widths
-
-  | K_TWOWIDTHS K_WIDTH int_number layer_sp_TwoWidthsPRL int_number
-    {
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($5);
-    }
-    int_number_list
-    {
-      if (lefData->hasParallel) { // 5.7 - Either PARALLEL OR TWOWIDTHS per layer
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1592, "A PARALLELRUNLENGTH statement was already defined in the layer.\nIt is PARALLELRUNLENGTH or TWOWIDTHS is allowed per layer.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefData->hasTwoWidths) { // 5.7 - only 1 TWOWIDTHS per layer
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1593, "A TWOWIDTHS table statement was already defined in the layer.\nOnly one TWOWIDTHS statement is allowed per layer.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpTwoWidths($3, $4);
-      lefData->hasTwoWidths = 1;
-    }
-    layer_sp_TwoWidths
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "TWOWIDTHS is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1697, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } 
-    }
-  | K_INFLUENCE K_WIDTH int_number K_WITHIN int_number K_SPACING int_number
-    {
-      if (lefData->hasInfluence) {  // 5.5 - INFLUENCE table must follow a PARALLEL
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1594, "A INFLUENCE table statement was already defined in the layer.\nOnly one INFLUENCE statement is allowed per layer.");
-              CHKERR();
-            }
-         }
-      }
-      if (!lefData->hasParallel) {  // 5.5 - INFLUENCE must follow a PARALLEL
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1595, "An INFLUENCE table statement was already defined before the layer.\nINFLUENCE statement has to be defined after the PARALLELRUNLENGTH table statement in the layer.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.setInfluence();
-         lefData->lefrLayer.addSpInfluence($3, $5, $7);
-      }
-    }
-    layer_sp_influence_widths
-
-layer_spacingtable_opts:      // 5.7 
-  // empty 
-  | layer_spacingtable_opt layer_spacingtable_opts
-
-layer_spacingtable_opt:
-  K_WITHIN int_number K_SPACING int_number
-  {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addSpacingTableOrthoWithin($2, $4);
-  }
-
-layer_enclosure_type_opt: 
-    {$$ = (char*)"NULL";}   // empty 
-  | K_ABOVE  {$$ = (char*)"ABOVE";}
-  | K_BELOW  {$$ = (char*)"BELOW";}
-
-layer_enclosure_width_opt:  // empty 
-  | K_WIDTH int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addEnclosureWidth($2);
-      }
-    }
-  layer_enclosure_width_except_opt
-  | K_LENGTH int_number              // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "LENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1691, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      } else {
-         if (lefCallbacks->LayerCbk) {
-            lefData->lefrLayer.addEnclosureLength($2);
-         }
-      }
-    }
-    
-layer_enclosure_width_except_opt: // empty 
-  | K_EXCEPTEXTRACUT int_number       // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-         lefData->outMsg = (char*)lefMalloc(10000);
-         sprintf(lefData->outMsg,
-           "EXCEPTEXTRACUT is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-         lefError(1690, lefData->outMsg);
-         lefFree(lefData->outMsg);
-         CHKERR();
-      } else {
-         if (lefCallbacks->LayerCbk) {
-            lefData->lefrLayer.addEnclosureExceptEC($2);
-         }
-      }
-    }
-
-layer_preferenclosure_width_opt:  // empty 
-  | K_WIDTH int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addPreferEnclosureWidth($2);
-      }
-    }
-    
-layer_minimumcut_within: // empty 
-  | K_WITHIN int_number
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "MINIMUMCUT WITHIN is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1700, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-         if (lefCallbacks->LayerCbk) {
-            lefData->lefrLayer.addMinimumcutWithin($2);
-         }
-      }
-    }
-
-layer_minimumcut_from: // empty 
-  | K_FROMABOVE
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "FROMABOVE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1596, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      lefData->hasLayerMincut = 1;
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addMinimumcutConnect((char*)"FROMABOVE");
-
-    }
-  | K_FROMBELOW
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "FROMBELOW statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1597, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      }
-      lefData->hasLayerMincut = 1;
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addMinimumcutConnect((char*)"FROMBELOW");
-    }
-
-layer_minimumcut_length: // empty 
-  | K_LENGTH int_number K_WITHIN int_number
-    {   
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "LENGTH WITHIN statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1598, lefData->outMsg);
-               lefFree(lefData->outMsg);
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addMinimumcutLengDis($2, $4);
-    }
-
-layer_minstep_options: // empty 
-  | layer_minstep_options layer_minstep_option  // Use left recursions 
-
-layer_minstep_option:
-  layer_minstep_type
-  {
-    if (lefCallbacks->LayerCbk) lefData->lefrLayer.addMinstepType($1);
-  }
-  | K_LENGTHSUM int_number
-  {
-    if (lefCallbacks->LayerCbk) lefData->lefrLayer.addMinstepLengthsum($2);
-  }
-  | K_MAXEDGES int_number                  // 5.7 
-  {
-    if (lefData->versionNum < 5.7) {
-      lefData->outMsg = (char*)lefMalloc(10000);
-      sprintf(lefData->outMsg,
-        "MAXEDGES is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-      lefError(1710, lefData->outMsg);
-      lefFree(lefData->outMsg);
-      CHKERR();
-    } else
-       if (lefCallbacks->LayerCbk) lefData->lefrLayer.addMinstepMaxedges((int)$2);
-  }
-
-layer_minstep_type:
-  K_INSIDECORNER {$$ = (char*)"INSIDECORNER";}
-  | K_OUTSIDECORNER {$$ = (char*)"OUTSIDECORNER";}
-  | K_STEP {$$ = (char*)"STEP";}
-
-layer_antenna_pwl:
-  int_number
-      { if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setAntennaValue(lefData->antennaType, $1); }
-  | K_PWL '(' pt pt
-      { if (lefCallbacks->LayerCbk) { // require min 2 points, set the 1st 2 
-          if (lefData->lefrAntennaPWLPtr) {
-            lefData->lefrAntennaPWLPtr->Destroy();
-            lefFree(lefData->lefrAntennaPWLPtr);
-          }
-
-          lefData->lefrAntennaPWLPtr = lefiAntennaPWL::create();
-          lefData->lefrAntennaPWLPtr->addAntennaPWL($3.x, $3.y);
-          lefData->lefrAntennaPWLPtr->addAntennaPWL($4.x, $4.y);
-        }
-      }
-    layer_diffusion_ratios ')'
-      { 
-        if (lefCallbacks->LayerCbk) {
-          lefData->lefrLayer.setAntennaPWL(lefData->antennaType, lefData->lefrAntennaPWLPtr);
-          lefData->lefrAntennaPWLPtr = NULL;
-        }
-      }
-
-layer_diffusion_ratios: // empty 
-  | layer_diffusion_ratios layer_diffusion_ratio  // Use left recursions 
-  ;
-
-layer_diffusion_ratio:
-  pt
-  { if (lefCallbacks->LayerCbk)
-      lefData->lefrAntennaPWLPtr->addAntennaPWL($1.x, $1.y);
-  }
-
-layer_antenna_duo: // empty 
-  | K_DIFFUSEONLY
-      { 
-        lefData->use5_4 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        }
-        else if ((lefData->antennaType == lefiAntennaAF) && (lefData->versionNum <= 5.3)) {
-           if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-              if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                   "ANTENNAAREAFACTOR with DIFFUSEONLY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1599, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        } else if (lefData->use5_3) {
-           if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-              if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                   "ANTENNAAREAFACTOR with DIFFUSEONLY statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1599, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setAntennaDUO(lefData->antennaType);
-      }
-
-layer_table_type:
-  K_PEAK       {$$ = (char*)"PEAK";}
-  | K_AVERAGE  {$$ = (char*)"AVERAGE";}
-  | K_RMS      {$$ = (char*)"RMS";}
-
-layer_frequency:
-  K_FREQUENCY NUMBER
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2); }
-  number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addAcFrequency(); }
-  ac_layer_table_opt
-  K_TABLEENTRIES NUMBER
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($9); }
-    number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addAcTableEntry(); }
-
-ac_layer_table_opt:  // empty 
-  | K_CUTAREA NUMBER
-    {
-      if (!lefData->layerCut) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1600, "CUTAREA statement can only be defined in LAYER with TYPE CUT.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2);
-    }
-    number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addAcCutarea(); }
-  | K_WIDTH int_number
-    {
-      if (!lefData->layerRout) {
-         if (lefCallbacks->LayerCbk) { // write error only if cbk is set 
-            if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1601, "WIDTH can only be defined in LAYER with TYPE ROUTING.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2);
-    }
-    int_number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addAcWidth(); }
-
-dc_layer_table:
-  K_TABLEENTRIES int_number
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2); }
-    int_number_list ';'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addDcTableEntry(); }
-
-int_number_list:
-  | int_number_list int_number
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2); }
-
-number_list:
-  | number_list NUMBER
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($2); }
-
-layer_prop_list:
-  layer_prop
-  | layer_prop_list layer_prop
-  ;
-
-layer_prop:
-  T_STRING T_STRING
-    {
-      if (lefCallbacks->LayerCbk) {
-        char propTp;
-        propTp = lefSettings->lefProps.lefrLayerProp.propType($1);
-        lefData->lefrLayer.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->LayerCbk) {
-        char propTp;
-        propTp = lefSettings->lefProps.lefrLayerProp.propType($1);
-        lefData->lefrLayer.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING NUMBER
-    {
-      char temp[32];
-      sprintf(temp, "%.11g", $2);
-      if (lefCallbacks->LayerCbk) {
-        char propTp;
-        propTp = lefSettings->lefProps.lefrLayerProp.propType($1);
-        lefData->lefrLayer.addNumProp($1, $2, temp, propTp);
-      }
-    }
-
-current_density_pwl_list :
-  current_density_pwl
-    { }
-  | current_density_pwl_list current_density_pwl
-    { }
-
-current_density_pwl: '(' int_number int_number ')'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCurrentPoint($2, $3); }
-
-cap_points :
-  cap_point
-  | cap_points cap_point
-  ;
-
-cap_point: '(' int_number int_number ')'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.setCapacitancePoint($2, $3); }
-
-res_points :
-  res_point
-  | res_points res_point
-    { }
-
-res_point: '(' int_number int_number ')'
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.setResistancePoint($2, $3); }
-
-layer_type:
-  K_ROUTING       {$$ = (char*)"ROUTING"; lefData->layerRout = 1;}
-  | K_CUT         {$$ = (char*)"CUT"; lefData->layerCut = 1;}
-  | K_OVERLAP     {$$ = (char*)"OVERLAP"; lefData->layerMastOver = 1;}
-  | K_MASTERSLICE {$$ = (char*)"MASTERSLICE"; lefData->layerMastOver = 1;}
-  | K_VIRTUAL     {$$ = (char*)"VIRTUAL";}
-  | K_IMPLANT     {$$ = (char*)"IMPLANT";}
-
-layer_direction:
-  K_HORIZONTAL      {$$ = (char*)"HORIZONTAL";}
-  |  K_VERTICAL     {$$ = (char*)"VERTICAL";}
-  |  K_DIAG45       {$$ = (char*)"DIAG45";}
-  |  K_DIAG135      {$$ = (char*)"DIAG135";}
-
-layer_minen_width:
-  | K_WIDTH int_number
-    {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addMinenclosedareaWidth($2);
-    }
-
-layer_oxide:
-  K_OXIDE1
-    {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addAntennaModel(1);
-    }
-  | K_OXIDE2
-    {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addAntennaModel(2);
-    }
-  | K_OXIDE3
-    {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addAntennaModel(3);
-    }
-  | K_OXIDE4
-    {
-    if (lefCallbacks->LayerCbk)
-       lefData->lefrLayer.addAntennaModel(4);
-    }
-
-layer_sp_parallel_widths: // empty 
-    { }
-  | layer_sp_parallel_widths layer_sp_parallel_width  // Use left recursions 
-    { }
-
-layer_sp_parallel_width: K_WIDTH int_number
-    { 
-      if (lefCallbacks->LayerCbk) {
-         lefData->lefrLayer.addSpParallelWidth($2);
-      }
-    }
-    int_number_list
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpParallelWidthSpacing(); }
- 
-layer_sp_TwoWidths: // empty               // 5.7
-    { }
-  | layer_sp_TwoWidth layer_sp_TwoWidths
-    { }
-    
-layer_sp_TwoWidth: K_WIDTH int_number layer_sp_TwoWidthsPRL int_number
-    {
-       if (lefCallbacks->LayerCbk) lefData->lefrLayer.addNumber($4);
-    }
-    int_number_list 
-    {
-      if (lefCallbacks->LayerCbk)
-         lefData->lefrLayer.addSpTwoWidths($2, $3);
-    }
-
-layer_sp_TwoWidthsPRL:                       // 5.7
-    { 
-        $$ = -1; // cannot use 0, since PRL number can be 0 
-        lefData->lefrLayer.setSpTwoWidthsHasPRL(0);
-    }           
-  | K_PRL int_number
-    { 
-        $$ = $2; 
-        lefData->lefrLayer.setSpTwoWidthsHasPRL(1);
-    }
- 
-layer_sp_influence_widths: // empty 
-    { }
-  | layer_sp_influence_widths layer_sp_influence_width
-    { }
-
-layer_sp_influence_width: K_WIDTH int_number K_WITHIN int_number K_SPACING int_number
-    { if (lefCallbacks->LayerCbk) lefData->lefrLayer.addSpInfluence($2, $4, $6); }
-
-maxstack_via: K_MAXVIASTACK int_number ';'
-    {
-      if (!lefData->lefrHasLayer) {  // 5.5 
-        if (lefCallbacks->MaxStackViaCbk) { // write error only if cbk is set 
-           if (lefData->maxStackViaWarnings++ < lefSettings->MaxStackViaWarnings) {
-             lefError(1602, "MAXVIASTACK statement has to be defined after the LAYER statement.");
-             CHKERR();
-           }
-        }
-      } else if (lefData->lefrHasMaxVS) {
-        if (lefCallbacks->MaxStackViaCbk) { // write error only if cbk is set 
-           if (lefData->maxStackViaWarnings++ < lefSettings->MaxStackViaWarnings) {
-             lefError(1603, "A MAXVIASTACK was already defined.\nOnly one MAXVIASTACK is allowed per lef file.");
-             CHKERR();
-           }
-        }
-      } else {
-        if (lefCallbacks->MaxStackViaCbk) {
-           lefData->lefrMaxStackVia.setMaxStackVia((int)$2);
-           CALLBACK(lefCallbacks->MaxStackViaCbk, lefrMaxStackViaCbkType, &lefData->lefrMaxStackVia);
-        }
-      }
-      if (lefData->versionNum < 5.5) {
-        if (lefCallbacks->MaxStackViaCbk) { // write error only if cbk is set 
-           if (lefData->maxStackViaWarnings++ < lefSettings->MaxStackViaWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "MAXVIASTACK statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1604, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      lefData->lefrHasMaxVS = 1;
-    }
-  | K_MAXVIASTACK int_number K_RANGE {lefData->lefDumbMode = 2; lefData->lefNoNum= 2;}
-    T_STRING T_STRING ';'
-    {
-      if (!lefData->lefrHasLayer) {  // 5.5 
-        if (lefCallbacks->MaxStackViaCbk) { // write error only if cbk is set 
-           if (lefData->maxStackViaWarnings++ < lefSettings->MaxStackViaWarnings) {
-              lefError(1602, "MAXVIASTACK statement has to be defined after the LAYER statement.");
-              CHKERR();
-           }
-        }
-      } else if (lefData->lefrHasMaxVS) {
-        if (lefCallbacks->MaxStackViaCbk) { // write error only if cbk is set 
-           if (lefData->maxStackViaWarnings++ < lefSettings->MaxStackViaWarnings) {
-             lefError(1603, "A MAXVIASTACK was already defined.\nOnly one MAXVIASTACK is allowed per lef file.");
-             CHKERR();
-           }
-        }
-      } else {
-        if (lefCallbacks->MaxStackViaCbk) {
-           lefData->lefrMaxStackVia.setMaxStackVia((int)$2);
-           lefData->lefrMaxStackVia.setMaxStackViaRange($5, $6);
-           CALLBACK(lefCallbacks->MaxStackViaCbk, lefrMaxStackViaCbkType, &lefData->lefrMaxStackVia);
-        }
-      }
-      lefData->lefrHasMaxVS = 1;
-    }
-
-via: start_via  { lefData->hasViaRule_layer = 0; } via_option end_via
-    { 
-      if (lefCallbacks->ViaCbk) {
-        if (lefData->ndRule) 
-            lefData->nd->addViaRule(&lefData->lefrVia);
-         else 
-            CALLBACK(lefCallbacks->ViaCbk, lefrViaCbkType, &lefData->lefrVia);
-       }
-    }
-
-via_keyword : K_VIA                 //needed to have a VIA named via
-     { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; }
-
-start_via: via_keyword T_STRING 
-    {
-      // 0 is nodefault 
-      if (lefCallbacks->ViaCbk) lefData->lefrVia.setName($2, 0);
-      lefData->viaLayer = 0;
-      lefData->numVia++;
-      //strcpy(lefData->viaName, $2);
-      lefData->viaName = strdup($2);
-    }
-  | via_keyword T_STRING K_DEFAULT
-    {
-      // 1 is default 
-      if (lefCallbacks->ViaCbk) lefData->lefrVia.setName($2, 1);
-      lefData->viaLayer = 0;
-      //strcpy(lefData->viaName, $2);
-      lefData->viaName = strdup($2);
-    }
-  | via_keyword T_STRING K_GENERATED
-    {
-      // 2 is generated 
-      if (lefCallbacks->ViaCbk) lefData->lefrVia.setName($2, 2);
-      lefData->viaLayer = 0;
-      //strcpy(lefData->viaName, $2);
-      lefData->viaName = strdup($2);
-    }
-
-via_viarule: K_VIARULE {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-  K_CUTSIZE int_number int_number ';'
-  K_LAYERS {lefData->lefDumbMode = 3; lefData->lefNoNum = 1; } T_STRING T_STRING T_STRING ';'
-  K_CUTSPACING int_number int_number ';'
-  K_ENCLOSURE int_number int_number int_number int_number ';'
-    {
-       if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->ViaCbk) { // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "VIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1709, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-            }
-         }
-       }  else
-          if (lefCallbacks->ViaCbk) lefData->lefrVia.setViaRule($3, $6, $7, $11, $12, $13,
-                          $16, $17, $20, $21, $22, $23);
-       lefData->viaLayer++;
-       lefData->hasViaRule_layer = 1;
-    }
-  via_viarule_options
-  ;
-
-via_viarule_options: // empty 
-  | via_viarule_options via_viarule_option
-  ;
-
-via_viarule_option: K_ROWCOL int_number int_number ';'
-    {
-       if (lefCallbacks->ViaCbk) lefData->lefrVia.setRowCol((int)$2, (int)$3);
-    }
-  | K_ORIGIN int_number int_number ';'
-    {
-       if (lefCallbacks->ViaCbk) lefData->lefrVia.setOrigin($2, $3);
-    }
-  | K_OFFSET int_number int_number int_number int_number ';'
-    {
-       if (lefCallbacks->ViaCbk) lefData->lefrVia.setOffset($2, $3, $4, $5);
-    }
-  | K_PATTERN {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-       if (lefCallbacks->ViaCbk) lefData->lefrVia.setPattern($3);
-    }
-  ;
-
-via_option: via_viarule
-  | via_other_options
-
-via_other_options: via_other_option
-  via_more_options
-
-via_more_options: // empty 
-  | via_more_options via_other_option
-  ;
-
-via_other_option:
-  via_foreign 
-    { }
-  | via_layer_rule 
-    { }
-  | K_RESISTANCE int_number ';'
-    { if (lefCallbacks->ViaCbk) lefData->lefrVia.setResistance($2); }
-  | K_PROPERTY { lefData->lefDumbMode = 1000000; } via_prop_list ';'
-    { lefData->lefDumbMode = 0;
-    }
-  | K_TOPOFSTACKONLY
-    { 
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaCbk) lefData->lefrVia.setTopOfStack();
-      } else
-        if (lefCallbacks->ViaCbk)  // write warning only if cbk is set 
-           if (lefData->viaWarnings++ < lefSettings->ViaWarnings)
-              lefWarning(2019, "TOPOFSTACKONLY statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later");
-    }
-
-via_prop_list:
-  via_name_value_pair
-  | via_prop_list via_name_value_pair
-  ;
-
-via_name_value_pair:
-  T_STRING NUMBER
-    { 
-      char temp[32];
-      sprintf(temp, "%.11g", $2);
-      if (lefCallbacks->ViaCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaProp.propType($1);
-         lefData->lefrVia.addNumProp($1, $2, temp, propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->ViaCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaProp.propType($1);
-         lefData->lefrVia.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING T_STRING
-    {
-      if (lefCallbacks->ViaCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaProp.propType($1);
-         lefData->lefrVia.addProp($1, $2, propTp);
-      }
-    }
-
-via_foreign:
-  start_foreign ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaCbk) lefData->lefrVia.setForeign($1, 0, 0.0, 0.0, -1);
-      } else
-        if (lefCallbacks->ViaCbk)  // write warning only if cbk is set 
-           if (lefData->viaWarnings++ < lefSettings->ViaWarnings)
-             lefWarning(2020, "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign pt ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaCbk) lefData->lefrVia.setForeign($1, 1, $2.x, $2.y, -1);
-      } else
-        if (lefCallbacks->ViaCbk)  // write warning only if cbk is set 
-           if (lefData->viaWarnings++ < lefSettings->ViaWarnings)
-             lefWarning(2020, "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign pt orientation ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaCbk) lefData->lefrVia.setForeign($1, 1, $2.x, $2.y, $3);
-      } else
-        if (lefCallbacks->ViaCbk)  // write warning only if cbk is set 
-           if (lefData->viaWarnings++ < lefSettings->ViaWarnings)
-             lefWarning(2020, "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign orientation ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaCbk) lefData->lefrVia.setForeign($1, 0, 0.0, 0.0, $2);
-      } else
-        if (lefCallbacks->ViaCbk)  // write warning only if cbk is set 
-           if (lefData->viaWarnings++ < lefSettings->ViaWarnings)
-             lefWarning(2020, "FOREIGN statement in VIA is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-start_foreign:        K_FOREIGN {lefData->lefDumbMode = 1; lefData->lefNoNum= 1;} T_STRING
-    { $$ = $3; }
-
-orientation:
-  K_N         {$$ = 0;}
-  | K_W       {$$ = 1;}
-  | K_S       {$$ = 2;}
-  | K_E       {$$ = 3;}
-  | K_FN      {$$ = 4;}
-  | K_FW      {$$ = 5;}
-  | K_FS      {$$ = 6;}
-  | K_FE      {$$ = 7;}
-  | K_R0      {$$ = 0;}
-  | K_R90     {$$ = 1;}
-  | K_R180    {$$ = 2;}
-  | K_R270    {$$ = 3;}
-  | K_MY      {$$ = 4;}
-  | K_MYR90   {$$ = 5;}
-  | K_MX      {$$ = 6;}
-  | K_MXR90   {$$ = 7;}
-
-via_layer_rule: via_layer via_geometries
-    { }
-
-via_layer: K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefCallbacks->ViaCbk) lefData->lefrVia.addLayer($3);
-      lefData->viaLayer++;
-      lefData->hasViaRule_layer = 1;
-    }
-
-via_geometries:
-  // empty 
-  | via_geometries via_geometry 
-  ;
-
-via_geometry:
-  K_RECT maskColor pt pt ';'
-    { 
-      if (lefCallbacks->ViaCbk) {
-        if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-          if (lefData->viaWarnings++ < lefSettings->ViaWarnings) {
-              lefError(2081, "MASK information can only be defined with version 5.8");
-              CHKERR(); 
-            }           
-        } else {
-          lefData->lefrVia.addRectToLayer((int)$2, $3.x, $3.y, $4.x, $4.y);
-        }
-      }
-    }
-  | K_POLYGON maskColor                                              // 5.6
-    {
-      lefData->lefrGeometriesPtr = (lefiGeometries*)lefMalloc(sizeof(lefiGeometries));
-      lefData->lefrGeometriesPtr->Init();
-      lefData->lefrDoGeometries = 1;
-    }
-    firstPt nextPt nextPt otherPts ';'
-    { 
-      if (lefCallbacks->ViaCbk) {
-        if (lefData->versionNum < 5.8 && $2 > 0) {
-          if (lefData->viaWarnings++ < lefSettings->ViaWarnings) {
-              lefError(2083, "Color mask information can only be defined with version 5.8.");
-              CHKERR(); 
-            }           
-        } else {
-            lefData->lefrGeometriesPtr->addPolygon((int)$2);
-            lefData->lefrVia.addPolyToLayer((int)$2, lefData->lefrGeometriesPtr);   // 5.6
-        }
-      }
-      lefData->lefrGeometriesPtr->clearPolyItems(); // free items fields
-      lefFree((char*)(lefData->lefrGeometriesPtr)); // Don't need anymore, poly data has
-      lefData->lefrDoGeometries = 0;                // copied
-    }
-
-end_via: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING 
-    { 
-      // 10/17/2001 - Wanda da Rosa, PCR 404149
-      //              Error if no layer in via
-      if (!lefData->viaLayer) {
-         if (lefCallbacks->ViaCbk) {  // write error only if cbk is set 
-            if (lefData->viaWarnings++ < lefSettings->ViaWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "A LAYER statement is missing in the VIA %s.\nAt least one LAYERis required per VIA statement.", $3);
-              lefError(1606, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-            }
-         }
-      }
-      if (strcmp(lefData->viaName, $3) != 0) {
-         if (lefCallbacks->ViaCbk) { // write error only if cbk is set 
-            if (lefData->viaWarnings++ < lefSettings->ViaWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "END VIA name %s is different from the VIA name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->viaName);
-              lefError(1607, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->viaName);
-              CHKERR();
-            } else
-              lefFree(lefData->viaName);
-         } else
-            lefFree(lefData->viaName);
-      } else
-         lefFree(lefData->viaName);
-    }
-
-viarule_keyword : K_VIARULE { lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    { 
-      if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setName($3);
-      lefData->viaRuleLayer = 0;
-      //strcpy(lefData->viaRuleName, $3);
-      lefData->viaRuleName = strdup($3);
-      lefData->isGenerate = 0;
-    }
-
-viarule:
-  viarule_keyword viarule_layer_list via_names opt_viarule_props end_viarule
-    {
-      if (lefData->viaRuleLayer == 0 || lefData->viaRuleLayer > 2) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1608, "A VIARULE statement requires two layers.");
-              CHKERR();
-            }
-         }
-      }
-      if (lefCallbacks->ViaRuleCbk)
-        CALLBACK(lefCallbacks->ViaRuleCbk, lefrViaRuleCbkType, &lefData->lefrViaRule);
-      // 2/19/2004 - reset the ENCLOSURE overhang values which may be
-      // set by the old syntax OVERHANG -- Not necessary, but just incase
-      if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.clearLayerOverhang();
-    }
-
-viarule_generate:
-  viarule_keyword K_GENERATE viarule_generate_default
-    {
-      lefData->isGenerate = 1;
-    }
-  viarule_layer_list opt_viarule_props end_viarule
-    {
-      if (lefData->viaRuleLayer == 0) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1708, "A VIARULE GENERATE requires three layers.");
-              CHKERR();
-            }
-         }
-      } else if ((lefData->viaRuleLayer < 3) && (lefData->versionNum >= 5.6)) {
-         if (lefCallbacks->ViaRuleCbk)  // write warning only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings)
-              lefWarning(2021, "turn-via is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      } else {
-         if (lefCallbacks->ViaRuleCbk) {
-            lefData->lefrViaRule.setGenerate();
-            CALLBACK(lefCallbacks->ViaRuleCbk, lefrViaRuleCbkType, &lefData->lefrViaRule);
-         }
-      }
-      // 2/19/2004 - reset the ENCLOSURE overhang values which may be
-      // set by the old syntax OVERHANG
-      if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.clearLayerOverhang();
-    }
-
-viarule_generate_default:  // optional 
-  | K_DEFAULT   // 5.6 syntax
-    {
-      if (lefData->versionNum < 5.6) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "DEFAULT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1605, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-            }
-         }
-      } else
-        if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setDefault();
-    }
- 
-viarule_layer_list :
-  viarule_layer
-  | viarule_layer_list viarule_layer
-  ;
-
-opt_viarule_props:
-  // empty 
-  | viarule_props
-  ;
-
-viarule_props:
-  viarule_prop
-  | viarule_props viarule_prop
-  ;
-
-viarule_prop: K_PROPERTY { lefData->lefDumbMode = 10000000;} viarule_prop_list ';'
-    { lefData->lefDumbMode = 0;
-    }
-
-viarule_prop_list:
-  viarule_prop
-  | viarule_prop_list viarule_prop
-  ;
-
-viarule_prop:
-  T_STRING T_STRING
-    {
-      if (lefCallbacks->ViaRuleCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaRuleProp.propType($1);
-         lefData->lefrViaRule.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->ViaRuleCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaRuleProp.propType($1);
-         lefData->lefrViaRule.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING NUMBER
-    {
-      char temp[32];
-      sprintf(temp, "%.11g", $2);
-      if (lefCallbacks->ViaRuleCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrViaRuleProp.propType($1);
-         lefData->lefrViaRule.addNumProp($1, $2, temp, propTp);
-      }
-    }
-
-viarule_layer: viarule_layer_name viarule_layer_options
-    {
-      // 10/18/2001 - Wanda da Rosa PCR 404181
-      //              Make sure the 1st 2 layers in viarule has direction
-      // 04/28/2004 - PCR 704072 - DIRECTION in viarule generate is
-      //              obsolete in 5.6
-      if (lefData->versionNum >= 5.6) {
-         if (lefData->viaRuleLayer < 2 && !lefData->viaRuleHasDir && !lefData->viaRuleHasEnc &&
-             !lefData->isGenerate) {
-            if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-               if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-                  lefError(1705, "VIARULE statement in a layer, requires a DIRECTION construct statement.");
-                  CHKERR(); 
-               }
-            }
-         }
-      } else {
-         if (lefData->viaRuleLayer < 2 && !lefData->viaRuleHasDir && !lefData->viaRuleHasEnc &&
-             lefData->isGenerate) {
-            if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-               if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-                  lefError(1705, "VIARULE statement in a layer, requires a DIRECTION construct statement.");
-                  CHKERR(); 
-               }
-            }
-         }
-      }
-      lefData->viaRuleLayer++;
-    }
-  ;
-
-via_names:
-  // empty 
-  | via_names via_name
-  ;
-
-via_name: via_keyword T_STRING ';'
-    { if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.addViaName($2); }
-
-viarule_layer_name: K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    { if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setLayer($3);
-      lefData->viaRuleHasDir = 0;
-      lefData->viaRuleHasEnc = 0;
-    }
-
-viarule_layer_options:
-  // empty 
-  | viarule_layer_options viarule_layer_option
-  ;
-
-viarule_layer_option:
-  K_DIRECTION K_HORIZONTAL ';'
-    {
-      if (lefData->viaRuleHasEnc) {
-        if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1706, "An ENCLOSRE statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer.");
-              CHKERR();
-           }
-        }
-      } else {
-        if ((lefData->versionNum < 5.6) || (!lefData->isGenerate)) {
-          if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setHorizontal();
-        } else
-          if (lefCallbacks->ViaRuleCbk)  // write warning only if cbk is set 
-             if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings)
-               lefWarning(2022, "DIRECTION statement in VIARULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      }
-      lefData->viaRuleHasDir = 1;
-    }
-  | K_DIRECTION K_VERTICAL ';'
-    { 
-      if (lefData->viaRuleHasEnc) {
-        if (lefCallbacks->ViaRuleCbk) { // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1706, "An ENCLOSRE statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer.");
-              CHKERR();
-           }
-        }
-      } else {
-        if ((lefData->versionNum < 5.6) || (!lefData->isGenerate)) {
-          if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setVertical();
-        } else
-          if (lefCallbacks->ViaRuleCbk) // write warning only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings)
-              lefWarning(2022, "DIRECTION statement in VIARULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      }
-      lefData->viaRuleHasDir = 1;
-    }
-  | K_ENCLOSURE int_number int_number ';'    // 5.5 
-    {
-      if (lefData->versionNum < 5.5) {
-         if (lefCallbacks->ViaRuleCbk) { // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                "ENCLOSURE statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1707, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-         }
-      }
-      // 2/19/2004 - Enforced the rule that ENCLOSURE can only be defined
-      // in VIARULE GENERATE
-      if (!lefData->isGenerate) {
-         if (lefCallbacks->ViaRuleCbk) { // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1614, "An ENCLOSURE statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.");
-              CHKERR();
-           }
-         }
-      }
-      if (lefData->viaRuleHasDir) {
-         if (lefCallbacks->ViaRuleCbk) { // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefError(1609, "A DIRECTION statement was already defined in the layer.\nIt is DIRECTION or ENCLOSURE can be specified in a layer.");
-              CHKERR();
-           }
-         }
-      } else {
-         if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setEnclosure($2, $3);
-      }
-      lefData->viaRuleHasEnc = 1;
-    }
-  | K_WIDTH int_number K_TO int_number ';'
-    { if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setWidth($2,$4); }
-  | K_RECT pt pt ';'
-    { if (lefCallbacks->ViaRuleCbk)
-        lefData->lefrViaRule.setRect($2.x, $2.y, $3.x, $3.y); } 
-  | K_SPACING int_number K_BY int_number ';'
-    { if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setSpacing($2,$4); }
-  | K_RESISTANCE int_number ';'
-    { if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setResistance($2); }
-  | K_OVERHANG int_number ';'
-    {
-      if (!lefData->viaRuleHasDir) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-               lefError(1610, "An OVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG.");
-               CHKERR();
-            }
-         }
-      }
-      // 2/19/2004 - Enforced the rule that OVERHANG can only be defined
-      // in VIARULE GENERATE after 5.3
-      if ((lefData->versionNum > 5.3) && (!lefData->isGenerate)) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-               lefError(1611, "An OVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setOverhang($2);
-      } else {
-        if (lefCallbacks->ViaRuleCbk)  // write warning only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings)
-              lefWarning(2023, "OVERHANG statement will be translated into similar ENCLOSURE rule");
-        // In 5.6 & later, set it to either ENCLOSURE overhang1 or overhang2
-        if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setOverhangToEnclosure($2);
-      }
-    }
-  | K_METALOVERHANG int_number ';'
-    {
-      // 2/19/2004 - Enforced the rule that METALOVERHANG can only be defined
-      // in VIARULE GENERATE
-      if ((lefData->versionNum > 5.3) && (!lefData->isGenerate)) {
-         if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-            if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-               lefError(1612, "An METALOVERHANG statement is defined in a VIARULE statement only.\nOVERHANG statement can only be defined in VIARULE GENERATE.");
-               CHKERR();
-            }
-         }
-      }
-      if (lefData->versionNum < 5.6) {
-        if (!lefData->viaRuleHasDir) {
-           if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-             if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-                lefError(1613, "An METALOVERHANG statement is defined, but the required DIRECTION statement is not yet defined.\nUpdate the LEF file to define the DIRECTION statement before the OVERHANG.");
-                CHKERR();
-             } 
-           }
-        }
-        if (lefCallbacks->ViaRuleCbk) lefData->lefrViaRule.setMetalOverhang($2);
-      } else
-        if (lefCallbacks->ViaRuleCbk)  // write warning only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings)
-             lefWarning(2024, "METALOVERHANG statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-end_viarule: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;}  T_STRING 
-    {
-      if ((lefData->isGenerate) && (lefCallbacks->ViaRuleCbk) && lefData->lefrViaRule.numLayers() >= 3) {         
-        if (!lefData->lefrViaRule.layer(0)->hasRect() &&
-            !lefData->lefrViaRule.layer(1)->hasRect() &&
-            !lefData->lefrViaRule.layer(2)->hasRect()) {
-            lefData->outMsg = (char*)lefMalloc(10000);
-            sprintf (lefData->outMsg, 
-                     "VIARULE GENERATE '%s' cut layer definition should have RECT statement.\nCorrect the LEF file before rerunning it through the LEF parser.", 
-                      lefData->viaRuleName);
-            lefWarning(1714, lefData->outMsg); 
-            lefFree(lefData->outMsg);            
-            CHKERR();                
-        }
-      }
-
-      if (strcmp(lefData->viaRuleName, $3) != 0) {
-        if (lefCallbacks->ViaRuleCbk) {  // write error only if cbk is set 
-           if (lefData->viaRuleWarnings++ < lefSettings->ViaRuleWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "END VIARULE name %s is different from the VIARULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->viaRuleName);
-              lefError(1615, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->viaRuleName);
-              CHKERR();
-           } else
-              lefFree(lefData->viaRuleName);
-        } else
-           lefFree(lefData->viaRuleName);
-      } else
-        lefFree(lefData->viaRuleName);
-    }
-
-spacing_rule: start_spacing spacings end_spacing 
-    { }
-
-start_spacing: K_SPACING
-    {
-      lefData->hasSamenet = 0;
-      if ((lefData->versionNum < 5.6) || (!lefData->ndRule)) {
-        // if 5.6 and in nondefaultrule, it should not get in here, 
-        // it should go to the else statement to write out a warning 
-        // if 5.6, not in nondefaultrule, it will get in here 
-        // if 5.5 and earlier in nondefaultrule is ok to get in here 
-        if (lefData->versionNum >= 5.7) { // will get to this if statement if  
-                           // lefData->versionNum is 5.6 and higher but lefData->ndRule = 0 
-           if (lefData->spacingWarnings == 0) {  // only print once 
-              lefWarning(2077, "A SPACING SAMENET section is defined but it is not legal in a LEF 5.7 version file.\nIt will be ignored which will probably cause real DRC violations to be ignored, and may\ncause false DRC violations to occur.\n\nTo avoid this warning, and correctly handle these DRC rules, you should modify your\nLEF to use the appropriate SAMENET keywords as described in the LEF/DEF 5.7\nmanual under the SPACING statements in the LAYER (Routing) and LAYER (Cut)\nsections listed in the LEF Table of Contents.");
-              lefData->spacingWarnings++;
-           }
-        } else if (lefCallbacks->SpacingBeginCbk && !lefData->ndRule)
-          CALLBACK(lefCallbacks->SpacingBeginCbk, lefrSpacingBeginCbkType, 0);
-      } else
-        if (lefCallbacks->SpacingBeginCbk && !lefData->ndRule)  // write warning only if cbk is set 
-           if (lefData->spacingWarnings++ < lefSettings->SpacingWarnings)
-             lefWarning(2025, "SAMENET statement in NONDEFAULTRULE is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-end_spacing: K_END K_SPACING
-    {
-      if ((lefData->versionNum < 5.6) || (!lefData->ndRule)) {
-        if ((lefData->versionNum <= 5.4) && (!lefData->hasSamenet)) {
-           lefError(1616, "SAMENET statement is required inside SPACING for any lef file with version 5.4 and earlier, but is not defined in the parsed lef file.");
-           CHKERR();
-        } else if (lefData->versionNum < 5.7) { // obsolete in 5.7 and later 
-           if (lefCallbacks->SpacingEndCbk && !lefData->ndRule)
-             CALLBACK(lefCallbacks->SpacingEndCbk, lefrSpacingEndCbkType, 0);
-        }
-      }
-    }
-
-spacings:
-  // empty 
-  | spacings spacing
-  ;
-
-spacing:  samenet_keyword T_STRING T_STRING int_number ';'
-    {
-      if ((lefData->versionNum < 5.6) || (!lefData->ndRule)) {
-        if (lefData->versionNum < 5.7) {
-          if (lefCallbacks->SpacingCbk) {
-            lefData->lefrSpacing.set($2, $3, $4, 0);
-            if (lefData->ndRule)
-                lefData->nd->addSpacingRule(&lefData->lefrSpacing);
-            else 
-                CALLBACK(lefCallbacks->SpacingCbk, lefrSpacingCbkType, &lefData->lefrSpacing);            
-          }
-        }
-      }
-    }
-  | samenet_keyword T_STRING T_STRING int_number K_STACK ';'
-    {
-      if ((lefData->versionNum < 5.6) || (!lefData->ndRule)) {
-        if (lefData->versionNum < 5.7) {
-          if (lefCallbacks->SpacingCbk) {
-            lefData->lefrSpacing.set($2, $3, $4, 1);
-            if (lefData->ndRule)
-                lefData->nd->addSpacingRule(&lefData->lefrSpacing);
-            else 
-                CALLBACK(lefCallbacks->SpacingCbk, lefrSpacingCbkType, &lefData->lefrSpacing);    
-          }
-        }
-      }
-    }
-
-samenet_keyword: K_SAMENET
-    // must be followed by two names 
-    { lefData->lefDumbMode = 2; lefData->lefNoNum = 2; lefData->hasSamenet = 1; }
-     
-maskColor:
-    // empty 
-    { $$ = 0; }
-    | K_MASK int_number
-    { $$ = (int)$2; }
-            
-irdrop: start_irdrop ir_tables end_irdrop
-    { }
-
-start_irdrop: K_IRDROP
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->IRDropBeginCbk) 
-          CALLBACK(lefCallbacks->IRDropBeginCbk, lefrIRDropBeginCbkType, 0);
-      } else
-        if (lefCallbacks->IRDropBeginCbk) // write warning only if cbk is set 
-          if (lefData->iRDropWarnings++ < lefSettings->IRDropWarnings)
-            lefWarning(2026, "IRDROP statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-end_irdrop: K_END K_IRDROP
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->IRDropEndCbk)
-          CALLBACK(lefCallbacks->IRDropEndCbk, lefrIRDropEndCbkType, 0);
-      }
-    }
-      
-
-ir_tables:
-  // empty 
-  | ir_tables ir_table
-  ;
-
-ir_table: ir_tablename ir_table_values ';'
-    { 
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->IRDropCbk)
-          CALLBACK(lefCallbacks->IRDropCbk, lefrIRDropCbkType, &lefData->lefrIRDrop);
-      }
-    }
-
-ir_table_values:
-  // empty 
-  | ir_table_values ir_table_value 
-  ;
-
-ir_table_value: int_number int_number 
-  { if (lefCallbacks->IRDropCbk) lefData->lefrIRDrop.setValues($1, $2); }
-
-ir_tablename: K_TABLE T_STRING
-  { if (lefCallbacks->IRDropCbk) lefData->lefrIRDrop.setTableName($2); }
-
-minfeature: K_MINFEATURE int_number int_number ';'
-  {
-    lefData->hasMinfeature = 1;
-    if (lefData->versionNum < 5.4) {
-       if (lefCallbacks->MinFeatureCbk) {
-         lefData->lefrMinFeature.set($2, $3);
-         CALLBACK(lefCallbacks->MinFeatureCbk, lefrMinFeatureCbkType, &lefData->lefrMinFeature);
-       }
-    } else
-       if (lefCallbacks->MinFeatureCbk) // write warning only if cbk is set 
-          if (lefData->minFeatureWarnings++ < lefSettings->MinFeatureWarnings)
-            lefWarning(2027, "MINFEATURE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-  }
-
-dielectric: K_DIELECTRIC int_number ';'
-  {
-    if (lefData->versionNum < 5.4) {
-       if (lefCallbacks->DielectricCbk)
-         CALLBACK(lefCallbacks->DielectricCbk, lefrDielectricCbkType, $2);
-    } else
-       if (lefCallbacks->DielectricCbk) // write warning only if cbk is set 
-         if (lefData->dielectricWarnings++ < lefSettings->DielectricWarnings)
-           lefWarning(2028, "DIELECTRIC statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-  }
-
-nondefault_rule: K_NONDEFAULTRULE {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-  {
-    (void)lefSetNonDefault($3);
-    if (lefCallbacks->NonDefaultCbk) lefData->lefrNonDefault.setName($3);
-    lefData->ndLayer = 0;
-    lefData->ndRule = 1;
-    lefData->numVia = 0;
-    //strcpy(lefData->nonDefaultRuleName, $3);
-    lefData->nonDefaultRuleName = strdup($3);
-  }
-  nd_hardspacing
-  nd_rules {lefData->lefNdRule = 1;} end_nd_rule
-  {
-    // 10/18/2001 - Wanda da Rosa, PCR 404189
-    //              At least 1 layer is required
-    if ((!lefData->ndLayer) && (!lefSettings->RelaxMode)) {
-       if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-         if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-            lefError(1617, "NONDEFAULTRULE statement requires at least one LAYER statement.");
-            CHKERR();
-         }
-       }
-    }
-    if ((!lefData->numVia) && (!lefSettings->RelaxMode) && (lefData->versionNum < 5.6)) {
-       // VIA is no longer a required statement in 5.6
-       if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-         if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-            lefError(1618, "NONDEFAULTRULE statement requires at least one VIA statement.");
-            CHKERR();
-         }
-       }
-    }
-    if (lefCallbacks->NonDefaultCbk) {
-      lefData->lefrNonDefault.end();
-      CALLBACK(lefCallbacks->NonDefaultCbk, lefrNonDefaultCbkType, &lefData->lefrNonDefault);
-    }
-    lefData->ndRule = 0;
-    lefData->lefDumbMode = 0;
-    (void)lefUnsetNonDefault();
-  }
-
-end_nd_rule: K_END
-    {
-      if ((lefData->nonDefaultRuleName) && (*lefData->nonDefaultRuleName != '\0'))
-        lefFree(lefData->nonDefaultRuleName);
-    }
-  | K_END T_STRING
-    {
-      if (strcmp(lefData->nonDefaultRuleName, $2) != 0) {
-        if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-          if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-             lefData->outMsg = (char*)lefMalloc(10000);
-             sprintf (lefData->outMsg,
-                "END NONDEFAULTRULE name %s is different from the NONDEFAULTRULE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $2, lefData->nonDefaultRuleName);
-             lefError(1619, lefData->outMsg);
-             lefFree(lefData->nonDefaultRuleName);
-             lefFree(lefData->outMsg);
-             CHKERR();
-          } else
-             lefFree(lefData->nonDefaultRuleName);
-        } else
-           lefFree(lefData->nonDefaultRuleName);
-      } else
-        lefFree(lefData->nonDefaultRuleName);
-    }
-  ;
-
-nd_hardspacing:
-  // empty 
-  | K_HARDSPACING ';'   // HARDSPACING is optional in 5.6 
-    {
-       if (lefData->versionNum < 5.6) {
-          if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "HARDSPACING statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1620, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-          }
-       } else 
-          if (lefCallbacks->NonDefaultCbk)
-             lefData->lefrNonDefault.setHardspacing();
-    }
-  ;
-
-nd_rules: // empty 
-  | nd_rules nd_rule
-  ;
-
-nd_rule:
-  nd_layer
-  | via
-  | spacing_rule
-  | nd_prop
-  | usevia
-  | useviarule
-  | mincuts
-  ;
-
-usevia: K_USEVIA T_STRING ';'
-    {
-       if (lefData->versionNum < 5.6) {
-          if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-             lefData->outMsg = (char*)lefMalloc(10000);
-             sprintf (lefData->outMsg,
-               "USEVIA statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-             lefError(1621, lefData->outMsg);
-             lefFree(lefData->outMsg);
-             CHKERR();
-          }
-       } else {
-          if (lefCallbacks->NonDefaultCbk)
-             lefData->lefrNonDefault.addUseVia($2);
-       }
-    }
-
-useviarule:  K_USEVIARULE T_STRING ';'
-    {
-       if (lefData->versionNum < 5.6) {
-          if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-             if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-                lefData->outMsg = (char*)lefMalloc(10000);
-                sprintf (lefData->outMsg,
-                  "USEVIARULE statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                lefError(1622, lefData->outMsg);
-                lefFree(lefData->outMsg);
-                CHKERR();
-             }
-          }
-       } else {
-          if (lefCallbacks->NonDefaultCbk)
-             lefData->lefrNonDefault.addUseViaRule($2);
-       }
-    }
-
-mincuts: K_MINCUTS T_STRING int_number ';'
-    {
-       if (lefData->versionNum < 5.6) {
-          if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-             if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-                lefData->outMsg = (char*)lefMalloc(10000);
-                sprintf (lefData->outMsg,
-                  "MINCUTS statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                lefError(1623, lefData->outMsg);
-                lefFree(lefData->outMsg);
-                CHKERR();
-             }
-          }
-       } else {
-          if (lefCallbacks->NonDefaultCbk)
-             lefData->lefrNonDefault.addMinCuts($2, (int)$3);
-       }
-    }
-
-nd_prop: K_PROPERTY { lefData->lefDumbMode = 10000000;} nd_prop_list ';'
-    { lefData->lefDumbMode = 0;
-    }
-
-nd_prop_list:
-  nd_prop
-  | nd_prop_list nd_prop
-  ;
-
-nd_prop:
-  T_STRING T_STRING
-    {
-      if (lefCallbacks->NonDefaultCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrNondefProp.propType($1);
-         lefData->lefrNonDefault.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->NonDefaultCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrNondefProp.propType($1);
-         lefData->lefrNonDefault.addProp($1, $2, propTp);
-      }
-    }
-  | T_STRING NUMBER
-    {
-      if (lefCallbacks->NonDefaultCbk) {
-         char temp[32];
-         char propTp;
-         sprintf(temp, "%.11g", $2);
-         propTp = lefSettings->lefProps.lefrNondefProp.propType($1);
-         lefData->lefrNonDefault.addNumProp($1, $2, temp, propTp);
-      }
-    }
-
-nd_layer: K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-  {
-    if (lefCallbacks->NonDefaultCbk) lefData->lefrNonDefault.addLayer($3);
-    lefData->ndLayer++;
-    //strcpy(lefData->layerName, $3);
-    lefData->layerName = strdup($3);
-    lefData->ndLayerWidth = 0;
-    lefData->ndLayerSpace = 0;
-  }
-  K_WIDTH int_number ';'
-  { 
-    lefData->ndLayerWidth = 1;
-    if (lefCallbacks->NonDefaultCbk) lefData->lefrNonDefault.addWidth($6);
-  }
-  nd_layer_stmts K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-  {
-    if (strcmp(lefData->layerName, $12) != 0) {
-      if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-         if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-            lefData->outMsg = (char*)lefMalloc(10000);
-            sprintf (lefData->outMsg,
-               "END LAYER name %s is different from the LAYER name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->layerName);
-            lefError(1624, lefData->outMsg);
-            lefFree(lefData->outMsg);
-            lefFree(lefData->layerName);
-            CHKERR();
-         } else
-            lefFree(lefData->layerName);
-      } else
-         lefFree(lefData->layerName);
-    } else
-      lefFree(lefData->layerName);
-    if (!lefData->ndLayerWidth) {
-      if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-         if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-            lefError(1625, "A WIDTH statement is required in the LAYER statement in NONDEFULTRULE.");
-            CHKERR();
-         }
-      }
-    }
-    if (!lefData->ndLayerSpace && lefData->versionNum < 5.6) {   // 5.6, SPACING is optional
-      if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-         if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-            lefData->outMsg = (char*)lefMalloc(10000);
-            sprintf (lefData->outMsg,
-               "A SPACING statement is required in the LAYER statement in NONDEFAULTRULE for lef file with version 5.5 and earlier.\nYour lef file is defined with version %g. Update your lef to add a LAYER statement and try again.",
-                lefData->versionNum);
-            lefError(1626, lefData->outMsg);
-            lefFree(lefData->outMsg);
-            CHKERR();
-         }
-      }
-    }
-  }
-  ;
-
-nd_layer_stmts:
-  // empty 
-  | nd_layer_stmts nd_layer_stmt
-  ;
-
-nd_layer_stmt:
-  K_SPACING int_number ';'
-    {
-      lefData->ndLayerSpace = 1;
-      if (lefCallbacks->NonDefaultCbk) lefData->lefrNonDefault.addSpacing($2);
-    }
-  | K_WIREEXTENSION int_number ';'
-    { if (lefCallbacks->NonDefaultCbk)
-         lefData->lefrNonDefault.addWireExtension($2); }
-  | K_RESISTANCE K_RPERSQ int_number ';'
-    {
-      if (lefData->ignoreVersion) {
-         if (lefCallbacks->NonDefaultCbk)
-            lefData->lefrNonDefault.addResistance($3);
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "RESISTANCE RPERSQ statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1627, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->versionNum > 5.5) {  // obsolete in 5.6
-         if (lefCallbacks->NonDefaultCbk) // write warning only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings)
-              lefWarning(2029, "RESISTANCE RPERSQ statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      } else if (lefCallbacks->NonDefaultCbk)
-         lefData->lefrNonDefault.addResistance($3);
-    } 
- 
-  | K_CAPACITANCE K_CPERSQDIST int_number ';'
-    {
-      if (lefData->ignoreVersion) {
-         if (lefCallbacks->NonDefaultCbk)
-            lefData->lefrNonDefault.addCapacitance($3);
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "CAPACITANCE CPERSQDIST statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1628, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-            }
-         }
-      } else if (lefData->versionNum > 5.5) { // obsolete in 5.6
-         if (lefCallbacks->NonDefaultCbk) // write warning only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings)
-              lefWarning(2030, "CAPACITANCE CPERSQDIST statement is obsolete in version 5.6. and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      } else if (lefCallbacks->NonDefaultCbk)
-         lefData->lefrNonDefault.addCapacitance($3);
-    }
-  | K_EDGECAPACITANCE int_number ';'
-    {
-      if (lefData->ignoreVersion) {
-         if (lefCallbacks->NonDefaultCbk)
-            lefData->lefrNonDefault.addEdgeCap($2);
-      } else if (lefData->versionNum < 5.4) {
-         if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "EDGECAPACITANCE statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1629, lefData->outMsg);
-               lefFree(lefData->outMsg);
-              CHKERR();
-            }
-         }
-      } else if (lefData->versionNum > 5.5) {  // obsolete in 5.6
-         if (lefCallbacks->NonDefaultCbk) // write warning only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings)
-              lefWarning(2031, "EDGECAPACITANCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-      } else if (lefCallbacks->NonDefaultCbk)
-         lefData->lefrNonDefault.addEdgeCap($2);
-    }
-  | K_DIAGWIDTH int_number ';'
-    {
-      if (lefData->versionNum < 5.6) {  // 5.6 syntax
-         if (lefCallbacks->NonDefaultCbk) { // write error only if cbk is set 
-            if (lefData->nonDefaultWarnings++ < lefSettings->NonDefaultWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                 "DIAGWIDTH statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-               lefError(1630, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR(); 
-            }
-         }
-      } else {
-         if (lefCallbacks->NonDefaultCbk)
-            lefData->lefrNonDefault.addDiagWidth($2);
-      }
-    }
-
-site: start_site site_options end_site
-    { 
-      if (lefCallbacks->SiteCbk)
-        CALLBACK(lefCallbacks->SiteCbk, lefrSiteCbkType, &lefData->lefrSite);
-    }
-
-start_site: K_SITE {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING 
-    { 
-      if (lefCallbacks->SiteCbk) lefData->lefrSite.setName($3);
-      //strcpy(lefData->siteName, $3);
-      lefData->siteName = strdup($3);
-      lefData->hasSiteClass = 0;
-      lefData->hasSiteSize = 0;
-      lefData->hasSite = 1;
-    }
-
-end_site: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    {
-      if (strcmp(lefData->siteName, $3) != 0) {
-        if (lefCallbacks->SiteCbk) { // write error only if cbk is set 
-           if (lefData->siteWarnings++ < lefSettings->SiteWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "END SITE name %s is different from the SITE name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->siteName);
-              lefError(1631, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->siteName);
-              CHKERR();
-           } else
-              lefFree(lefData->siteName);
-        } else
-           lefFree(lefData->siteName);
-      } else {
-        lefFree(lefData->siteName);
-        if (lefCallbacks->SiteCbk) { // write error only if cbk is set 
-          if (lefData->hasSiteClass == 0) {
-             lefError(1632, "A CLASS statement is required in the SITE statement.");
-             CHKERR();
-          }
-          if (lefData->hasSiteSize == 0) {
-             lefError(1633, "A SIZE  statement is required in the SITE statement.");
-             CHKERR();
-          }
-        }
-      }
-    }
-
-site_options:
-  // empty 
-  | site_options site_option
-  ;
-
-site_option:
-  K_SIZE int_number K_BY int_number ';' 
-    {
-
-      if (lefCallbacks->SiteCbk) lefData->lefrSite.setSize($2,$4);
-      lefData->hasSiteSize = 1;
-    }
-  | site_symmetry_statement
-    { }
-  | site_class 
-    { 
-      if (lefCallbacks->SiteCbk) lefData->lefrSite.setClass($1);
-      lefData->hasSiteClass = 1;
-    }
-  | site_rowpattern_statement
-    { }
-
-site_class:
-  K_CLASS K_PAD ';' {$$ = (char*)"PAD"; }
-  | K_CLASS K_CORE ';'  {$$ = (char*)"CORE"; }
-  | K_CLASS K_VIRTUAL ';'  {$$ = (char*)"VIRTUAL"; }
-
-site_symmetry_statement: K_SYMMETRY site_symmetries ';'
-    { }
-
-site_symmetries:
-  // empty 
-  | site_symmetries site_symmetry
-  ;
-
-site_symmetry:
-  K_X 
-    { if (lefCallbacks->SiteCbk) lefData->lefrSite.setXSymmetry(); }
-  | K_Y 
-    { if (lefCallbacks->SiteCbk) lefData->lefrSite.setYSymmetry(); }
-  | K_R90
-    { if (lefCallbacks->SiteCbk) lefData->lefrSite.set90Symmetry(); }
-
-site_rowpattern_statement: K_ROWPATTERN {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;}
-    site_rowpatterns ';'
-    { }
-
-site_rowpatterns:
-  // empty 
-  | site_rowpatterns site_rowpattern
-  ;
-
-site_rowpattern: T_STRING orientation {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;}
-    { if (lefCallbacks->SiteCbk) lefData->lefrSite.addRowPattern($1, $2); }
-
-pt:
-  int_number int_number
-    { $$.x = $1; $$.y = $2; }
-  | '(' int_number int_number ')'
-    { $$.x = $2; $$.y = $3; }
-
-macro: start_macro macro_options
-    { 
-      if (lefCallbacks->MacroCbk)
-        CALLBACK(lefCallbacks->MacroCbk, lefrMacroCbkType, &lefData->lefrMacro);
-      lefData->lefrDoSite = 0;
-    }
-    end_macro
-
-start_macro: K_MACRO {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING 
-    {
-      lefData->siteDef = 0;
-      lefData->symDef = 0;
-      lefData->sizeDef = 0; 
-      lefData->pinDef = 0; 
-      lefData->obsDef = 0; 
-      lefData->origDef = 0;
-      lefData->lefrMacro.clear();      
-      if (lefCallbacks->MacroBeginCbk || lefCallbacks->MacroCbk) {
-        // some reader may not have MacroBeginCB, but has MacroCB set
-        lefData->lefrMacro.setName($3);
-        CALLBACK(lefCallbacks->MacroBeginCbk, lefrMacroBeginCbkType, $3);
-      }
-      //strcpy(lefData->macroName, $3);
-      lefData->macroName = strdup($3);
-    }
-
-end_macro: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    {
-      if (strcmp(lefData->macroName, $3) != 0) {
-        if (lefCallbacks->MacroEndCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "END MACRO name %s is different from the MACRO name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->macroName);
-              lefError(1634, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->macroName);
-              CHKERR();
-           } else
-              lefFree(lefData->macroName);
-        } else
-           lefFree(lefData->macroName);
-      } else
-        lefFree(lefData->macroName);
-      if (lefCallbacks->MacroEndCbk)
-        CALLBACK(lefCallbacks->MacroEndCbk, lefrMacroEndCbkType, $3);
-    }
-
-macro_options:
-  // empty 
-  | macro_options macro_option   // Use left recursions 
-  ;
-
-macro_option:
-  macro_class 
-  | macro_generator 
-  | macro_generate 
-  | macro_source
-  | macro_symmetry_statement 
-  | macro_fixedMask
-      { }
-  | macro_origin 
-      { }
-  | macro_power 
-      { }
-  | macro_foreign
-      { }
-  | macro_eeq 
-  | macro_leq 
-  | macro_size 
-      { }
-  | macro_site 
-      { }
-  | macro_pin 
-      { }
-  | K_FUNCTION K_BUFFER ';'
-      { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setBuffer(); }
-  | K_FUNCTION K_INVERTER ';'
-      { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setInverter(); }
-  | macro_obs 
-      { }
-  | macro_density 
-      { }
-  | macro_clocktype 
-      { }
-  | timing
-      { }
-  | K_PROPERTY {lefData->lefDumbMode = 1000000; } macro_prop_list  ';'
-      { lefData->lefDumbMode = 0;
-      }
-
-macro_prop_list:
-  macro_name_value_pair
-  | macro_prop_list macro_name_value_pair
-  ;
-
-macro_symmetry_statement: K_SYMMETRY macro_symmetries ';'
-    {
-      if (lefData->siteDef) { // SITE is defined before SYMMETRY 
-          // pcr 283846 suppress warning 
-          if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-               lefWarning(2032, "A SITE statement is defined before SYMMETRY statement.\nTo avoid this warning in the future, define SITE after SYMMETRY");
-      }
-      lefData->symDef = 1;
-    }
-
-macro_symmetries:
-  // empty 
-  | macro_symmetries macro_symmetry
-  ;
-
-macro_symmetry:
-  K_X 
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setXSymmetry(); }
-  | K_Y 
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setYSymmetry(); }
-  | K_R90
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.set90Symmetry(); }
-
-macro_name_value_pair:
-  T_STRING NUMBER
-    {
-      char temp[32];
-      sprintf(temp, "%.11g", $2);
-      if (lefCallbacks->MacroCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrMacroProp.propType($1);
-         lefData->lefrMacro.setNumProperty($1, $2, temp,  propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->MacroCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrMacroProp.propType($1);
-         lefData->lefrMacro.setProperty($1, $2, propTp);
-      }
-    }
-  | T_STRING T_STRING
-    {
-      if (lefCallbacks->MacroCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrMacroProp.propType($1);
-         lefData->lefrMacro.setProperty($1, $2, propTp);
-      }
-    }
-
-macro_class: K_CLASS class_type ';'
-    {
-       if (lefCallbacks->MacroCbk) lefData->lefrMacro.setClass($2);
-       if (lefCallbacks->MacroClassTypeCbk)
-          CALLBACK(lefCallbacks->MacroClassTypeCbk, lefrMacroClassTypeCbkType, $2);
-    }
-
-class_type:
-  K_COVER {$$ = (char*)"COVER"; }
-  | K_COVER K_BUMP
-    { $$ = (char*)"COVER BUMP";
-      if (lefData->versionNum < 5.5) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              if (lefSettings->RelaxMode)
-                 lefWarning(2033, "The statement COVER BUMP is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.");
-              else {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "COVER BUMP statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1635, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-      }
-    }
-  | K_RING    {$$ = (char*)"RING"; }
-  | K_BLOCK   {$$ = (char*)"BLOCK"; }
-  | K_BLOCK K_BLACKBOX 
-    { $$ = (char*)"BLOCK BLACKBOX";
-      if (lefData->versionNum < 5.5) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-             if (lefSettings->RelaxMode)
-                lefWarning(2034, "The statement BLOCK BLACKBOX is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.");
-              else {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "BLOCK BLACKBOX statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1636, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-      }
-    }
-  | K_BLOCK K_SOFT
-    {
-      if (lefData->ignoreVersion) {
-        $$ = (char*)"BLOCK SOFT";
-      } else if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "BLOCK SOFT statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1637, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      else
-        $$ = (char*)"BLOCK SOFT";
-    }
-  | K_NONE    {$$ = (char*)"NONE"; }
-  | K_BUMP                         // 5.7 
-      {
-        if (lefData->versionNum < 5.7) {
-          lefData->outMsg = (char*)lefMalloc(10000);
-          sprintf(lefData->outMsg,
-            "BUMP is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-          lefError(1698, lefData->outMsg);
-          lefFree(lefData->outMsg);
-          CHKERR();
-        }
-       
-        $$ = (char*)"BUMP";
-     }
-  | K_PAD     {$$ = (char*)"PAD"; } 
-  | K_VIRTUAL {$$ = (char*)"VIRTUAL"; }
-  | K_PAD  pad_type 
-      {  sprintf(lefData->temp_name, "PAD %s", $2);
-        $$ = lefData->temp_name; 
-        if (lefData->versionNum < 5.5) {
-           if (strcmp("AREAIO", $2) != 0) {
-             sprintf(lefData->temp_name, "PAD %s", $2);
-             $$ = lefData->temp_name; 
-           } else if (lefCallbacks->MacroCbk) { 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-               if (lefSettings->RelaxMode)
-                  lefWarning(2035, "The statement PAD AREAIO is a LEF verion 5.5 syntax.\nYour LEF file is version 5.4 or earlier which is incorrect but will be allowed\nbecause this application does not enforce strict version checking.\nOther tools that enforce strict checking will have a syntax error when reading this file.\nYou can change the VERSION statement in this LEF file to 5.5 or higher to stop this warning.");
-               else {
-                  lefData->outMsg = (char*)lefMalloc(10000);
-                  sprintf (lefData->outMsg,
-                     "PAD AREAIO statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                  lefError(1638, lefData->outMsg);
-                  lefFree(lefData->outMsg);
-                  CHKERR();
-               }
-            }
-          }
-        }
-      }
-  | K_CORE    {$$ = (char*)"CORE"; }
-  | K_CORNER 
-      {$$ = (char*)"CORNER";
-      // This token is NOT in the spec but has shown up in 
-      // some lef files.  This exception came from LEFOUT
-      // in 'frameworks'
-      }
-  | K_CORE core_type
-      {sprintf(lefData->temp_name, "CORE %s", $2);
-      $$ = lefData->temp_name;} 
-  | K_ENDCAP endcap_type
-      {sprintf(lefData->temp_name, "ENDCAP %s", $2);
-      $$ = lefData->temp_name;} 
-
-pad_type: 
-  K_INPUT         {$$ = (char*)"INPUT";}
-  | K_OUTPUT        {$$ = (char*)"OUTPUT";}
-  | K_INOUT         {$$ = (char*)"INOUT";}
-  | K_POWER         {$$ = (char*)"POWER";}
-  | K_SPACER        {$$ = (char*)"SPACER";}
-  | K_AREAIO    {$$ = (char*)"AREAIO";}
-
-core_type:
-  K_FEEDTHRU        {$$ = (char*)"FEEDTHRU";}
-  | K_TIEHIGH       {$$ = (char*)"TIEHIGH";}
-  | K_TIELOW        {$$ = (char*)"TIELOW";}
-  | K_SPACER
-    { 
-      $$ = (char*)"SPACER";
-
-      if (!lefData->ignoreVersion && lefData->versionNum < 5.4) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "SPACER statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1639, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-    }
-  | K_ANTENNACELL
-    { 
-      $$ = (char*)"ANTENNACELL";
-
-      if (!lefData->ignoreVersion && lefData->versionNum < 5.4) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNACELL statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1640, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-    }
-  | K_WELLTAP
-    { 
-      $$ = (char*)"WELLTAP";
-
-      if (!lefData->ignoreVersion && lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "WELLTAP statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1641, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-    }
-
-endcap_type:
-  K_PRE         {$$ = (char*)"PRE";}
-  | K_POST         {$$ = (char*)"POST";}
-  | K_TOPLEFT         {$$ = (char*)"TOPLEFT";}
-  | K_TOPRIGHT         {$$ = (char*)"TOPRIGHT";}
-  | K_BOTTOMLEFT         {$$ = (char*)"BOTTOMLEFT";}
-  | K_BOTTOMRIGHT        {$$ = (char*)"BOTTOMRIGHT";}
-
-macro_generator: K_GENERATOR T_STRING ';'
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setGenerator($2); }
-
-macro_generate: K_GENERATE T_STRING T_STRING ';'
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setGenerate($2, $3); }
-
-macro_source:
-  K_SOURCE K_USER ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) lefData->lefrMacro.setSource("USER");
-      } else
-        if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-             lefWarning(2036, "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | K_SOURCE K_GENERATE ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) lefData->lefrMacro.setSource("GENERATE");
-      } else
-        if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-             lefWarning(2037, "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | K_SOURCE K_BLOCK ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) lefData->lefrMacro.setSource("BLOCK");
-      } else
-        if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-             lefWarning(2037, "SOURCE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-macro_power: K_POWER int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->MacroCbk) lefData->lefrMacro.setPower($2);
-      } else
-        if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-             lefWarning(2038, "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-macro_origin: K_ORIGIN pt ';'
-    { 
-       if (lefData->origDef) { // Has multiple ORIGIN defined in a macro, stop parsing
-          if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                lefError(1642, "ORIGIN statement has defined more than once in a MACRO statement.\nOnly one ORIGIN statement can be defined in a Macro.\nParser will stop processing.");
-               CHKERR();
-             }
-          }
-       }
-       lefData->origDef = 1;
-       if (lefData->siteDef) { // SITE is defined before ORIGIN 
-          // pcr 283846 suppress warning 
-          if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-               lefWarning(2039, "A SITE statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define SITE after ORIGIN");
-       }
-       if (lefData->pinDef) { // PIN is defined before ORIGIN 
-          // pcr 283846 suppress warning 
-          if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-               lefWarning(2040, "A PIN statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define PIN after ORIGIN");
-       }
-       if (lefData->obsDef) { // OBS is defined before ORIGIN 
-          // pcr 283846 suppress warning 
-          if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-             if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-               lefWarning(2041, "A OBS statement is defined before ORIGIN statement.\nTo avoid this warning in the future, define OBS after ORIGIN");
-       }
-      
-       // Workaround for pcr 640902 
-       if (lefCallbacks->MacroCbk) lefData->lefrMacro.setOrigin($2.x, $2.y);
-       if (lefCallbacks->MacroOriginCbk) {
-          lefData->macroNum.x = $2.x; 
-          lefData->macroNum.y = $2.y; 
-          CALLBACK(lefCallbacks->MacroOriginCbk, lefrMacroOriginCbkType, lefData->macroNum);
-       }
-    }
-
-macro_foreign:
-  start_foreign ';'
-    { 
-      if (lefCallbacks->MacroCbk) {
-        lefData->lefrMacro.addForeign($1, 0, 0.0, 0.0, -1);
-      }
-      
-      if (lefCallbacks->MacroForeignCbk) {
-        lefiMacroForeign foreign($1, 0, 0.0, 0.0, 0, 0);
-        CALLBACK(lefCallbacks->MacroForeignCbk, lefrMacroForeignCbkType, &foreign);
-      }  
-    }
-  | start_foreign pt ';'
-    { 
-      if (lefCallbacks->MacroCbk) {
-        lefData->lefrMacro.addForeign($1, 1, $2.x, $2.y, -1);
-      }
-      
-      if (lefCallbacks->MacroForeignCbk) {
-        lefiMacroForeign foreign($1, 1, $2.x, $2.y, 0, 0);
-        CALLBACK(lefCallbacks->MacroForeignCbk, lefrMacroForeignCbkType, &foreign);
-      }  
-    }
-  | start_foreign pt orientation ';'
-    { 
-      if (lefCallbacks->MacroCbk) {
-        lefData->lefrMacro.addForeign($1, 1, $2.x, $2.y, $3);
-      }
-      
-      if (lefCallbacks->MacroForeignCbk) {
-        lefiMacroForeign foreign($1, 1, $2.x, $2.y, 1, $3);
-        CALLBACK(lefCallbacks->MacroForeignCbk, lefrMacroForeignCbkType, &foreign);
-      } 
-    }
-  | start_foreign orientation ';'
-    { 
-      if (lefCallbacks->MacroCbk) {
-        lefData->lefrMacro.addForeign($1, 0, 0.0, 0.0, $2);
-      }
-
-      if (lefCallbacks->MacroForeignCbk) {
-        lefiMacroForeign foreign($1, 0, 0.0, 0.0, 1, $2);
-        CALLBACK(lefCallbacks->MacroForeignCbk, lefrMacroForeignCbkType, &foreign);
-      } 
-    }
-
-macro_fixedMask:
-   K_FIXEDMASK ';' 
-   {   
-       if (lefCallbacks->MacroCbk && lefData->versionNum >= 5.8) {
-          lefData->lefrMacro.setFixedMask(1);
-       }
-       if (lefCallbacks->MacroFixedMaskCbk) {
-          CALLBACK(lefCallbacks->MacroFixedMaskCbk, lefrMacroFixedMaskCbkType, 1);
-       }        
-    }
-    
-macro_eeq: K_EEQ { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setEEQ($3); }
-
-macro_leq: K_LEQ { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->MacroCbk) lefData->lefrMacro.setLEQ($3);
-      } else
-        if (lefCallbacks->MacroCbk) // write warning only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings)
-             lefWarning(2042, "LEQ statement in MACRO is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-macro_site:
-  macro_site_word  T_STRING ';'
-    {
-      if (lefCallbacks->MacroCbk) {
-        lefData->lefrMacro.setSiteName($2);
-      }
-
-      if (lefCallbacks->MacroSiteCbk) {
-        lefiMacroSite site($2, 0);
-        CALLBACK(lefCallbacks->MacroSiteCbk, lefrMacroSiteCbkType, &site);
-      }
-    }
-  | macro_site_word sitePattern ';'
-    {
-      if (lefCallbacks->MacroCbk) {
-        // also set site name in the variable siteName_ in lefiMacro 
-        // this, if user wants to use method lefData->siteName will get the name also 
-        lefData->lefrMacro.setSitePattern(lefData->lefrSitePatternPtr);
-      }
-
-      if (lefCallbacks->MacroSiteCbk) {
-        lefiMacroSite site(0, lefData->lefrSitePatternPtr);
-        CALLBACK(lefCallbacks->MacroSiteCbk, lefrMacroSiteCbkType, &site);
-      }
-        
-      lefData->lefrSitePatternPtr = 0;
-    }
-
-macro_site_word: K_SITE
-    { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; lefData->siteDef = 1;
-        if (lefCallbacks->MacroCbk) lefData->lefrDoSite = 1; }
-
-site_word: K_SITE
-    { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; }
-
-macro_size: K_SIZE int_number K_BY int_number ';'
-    { 
-      if (lefData->siteDef) { // SITE is defined before SIZE 
-      }
-      lefData->sizeDef = 1;
-      if (lefCallbacks->MacroCbk) lefData->lefrMacro.setSize($2, $4);
-      if (lefCallbacks->MacroSizeCbk) {
-         lefData->macroNum.x = $2; 
-         lefData->macroNum.y = $4; 
-         CALLBACK(lefCallbacks->MacroSizeCbk, lefrMacroSizeCbkType, lefData->macroNum);
-      }
-    }
-
-// This is confusing, since FEF and LEF have opposite definitions of
-// ports and pins 
-
-macro_pin: start_macro_pin macro_pin_options end_macro_pin
-    { 
-      if (lefCallbacks->PinCbk)
-        CALLBACK(lefCallbacks->PinCbk, lefrPinCbkType, &lefData->lefrPin);
-      lefData->lefrPin.clear();
-    }
-
-start_macro_pin: K_PIN {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; lefData->pinDef = 1;} T_STRING 
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setName($3);
-      //strcpy(lefData->pinName, $3);
-      lefData->pinName = strdup($3);
-    }
-
-end_macro_pin: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    {
-      if (strcmp(lefData->pinName, $3) != 0) {
-        if (lefCallbacks->MacroCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "END PIN name %s is different from the PIN name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->pinName);
-              lefError(1643, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->pinName);
-              CHKERR();
-           } else
-              lefFree(lefData->pinName);
-        } else
-           lefFree(lefData->pinName);
-      } else
-        lefFree(lefData->pinName);
-    }
-
-macro_pin_options:
-  // empty 
-    { }
-  | macro_pin_options macro_pin_option 
-    { }
-
-macro_pin_option:
-  start_foreign ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 0, 0.0, 0.0, -1);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign pt ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 1, $2.x, $2.y, -1);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign pt orientation ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 1, $2.x, $2.y, $3);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign K_STRUCTURE ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 0, 0.0, 0.0, -1);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign K_STRUCTURE pt ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 1, $3.x, $3.y, -1);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | start_foreign K_STRUCTURE pt orientation ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.addForeign($1, 1, $3.x, $3.y, $4);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2043, "FOREIGN statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  | K_LEQ { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setLEQ($3);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2044, "LEQ statement in MACRO PIN is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-   }
-  | K_POWER int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setPower($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2045, "MACRO POWER statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | electrical_direction
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setDirection($1); }
-  | K_USE macro_pin_use ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setUse($2); }
-  | K_SCANUSE macro_scan_use ';'
-    { }
-  | K_LEAKAGE int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setLeakage($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2046, "MACRO LEAKAGE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, r emove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_RISETHRESH int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setRiseThresh($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2047, "MACRO RISETHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_FALLTHRESH int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setFallThresh($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2048, "MACRO FALLTHRESH statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_RISESATCUR int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setRiseSatcur($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2049, "MACRO RISESATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_FALLSATCUR int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setFallSatcur($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2050, "MACRO FALLSATCUR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_VLO int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setVLO($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2051, "MACRO VLO statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_VHI int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setVHI($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2052, "MACRO VHI statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_TIEOFFR int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setTieoffr($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2053, "MACRO TIEOFFR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_SHAPE pin_shape ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setShape($2); }
-  | K_MUSTJOIN {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setMustjoin($3); }
-  | K_OUTPUTNOISEMARGIN {lefData->lefDumbMode = 1;} int_number int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setOutMargin($3, $4);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2054, "MACRO OUTPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_OUTPUTRESISTANCE {lefData->lefDumbMode = 1;} int_number int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setOutResistance($3, $4);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2055, "MACRO OUTPUTRESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_INPUTNOISEMARGIN {lefData->lefDumbMode = 1;} int_number int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setInMargin($3, $4);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2056, "MACRO INPUTNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_CAPACITANCE int_number ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setCapacitance($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2057, "MACRO CAPACITANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_MAXDELAY int_number ';' 
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setMaxdelay($2); }
-  | K_MAXLOAD int_number ';' 
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setMaxload($2); }
-  | K_RESISTANCE int_number ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setResistance($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2058, "MACRO RESISTANCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_PULLDOWNRES int_number ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setPulldownres($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2059, "MACRO PULLDOWNRES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_CURRENTSOURCE K_ACTIVE ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setCurrentSource("ACTIVE");
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2060, "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_CURRENTSOURCE K_RESISTIVE ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setCurrentSource("RESISTIVE");
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2061, "MACRO CURRENTSOURCE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_RISEVOLTAGETHRESHOLD int_number ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setRiseVoltage($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2062, "MACRO RISEVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_FALLVOLTAGETHRESHOLD int_number ';' 
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setFallVoltage($2);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2063, "MACRO FALLVOLTAGETHRESHOLD statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_IV_TABLES T_STRING T_STRING ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setTables($2, $3);
-      } else
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2064, "MACRO IV_TABLES statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-  | K_TAPERRULE T_STRING ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setTaperRule($2); }
-  | K_PROPERTY {lefData->lefDumbMode = 1000000; } pin_prop_list ';'
-    { lefData->lefDumbMode = 0;
-    }
-  | start_macro_port macro_port_class_option geometries K_END
-    {
-      lefData->lefDumbMode = 0;
-      lefData->hasGeoLayer = 0;
-      if (lefCallbacks->PinCbk) {
-        lefData->lefrPin.addPort(lefData->lefrGeometriesPtr);
-        lefData->lefrGeometriesPtr = 0;
-        lefData->lefrDoGeometries = 0;
-      }
-      if ((lefData->needGeometry) && (lefData->needGeometry != 2))  // if the lefData->last LAYER in PORT
-        if (lefCallbacks->PinCbk) // write warning only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings)
-             lefWarning(2065, "Either PATH, RECT or POLYGON statement is a required in MACRO/PIN/PORT.");
-    }
-  | start_macro_port K_END
-    {
-      // Since in start_macro_port it has call the Init method, here
-      // we need to call the Destroy method.
-      // Still add a null pointer to set the number of port
-      if (lefCallbacks->PinCbk) {
-        lefData->lefrPin.addPort(lefData->lefrGeometriesPtr);
-        lefData->lefrGeometriesPtr = 0;
-        lefData->lefrDoGeometries = 0;
-      }
-      lefData->hasGeoLayer = 0;
-    }
-  | K_ANTENNASIZE int_number opt_layer_name ';'
-    {  // a pre 5.4 syntax 
-      lefData->use5_3 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum >= 5.4) {
-        if (lefData->use5_4) {
-           if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-             if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-                lefData->outMsg = (char*)lefMalloc(10000);
-                sprintf (lefData->outMsg,
-                   "ANTENNASIZE statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                lefError(1644, lefData->outMsg);
-                lefFree(lefData->outMsg);
-                CHKERR();
-             }
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaSize($2, $3);
-    }
-  | K_ANTENNAMETALAREA NUMBER opt_layer_name ';'
-    {  // a pre 5.4 syntax 
-      lefData->use5_3 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum >= 5.4) {
-        if (lefData->use5_4) {
-           if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-              if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAMETALAREA statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1645, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaMetalArea($2, $3);
-    }
-  | K_ANTENNAMETALLENGTH int_number opt_layer_name ';'
-    { // a pre 5.4 syntax  
-      lefData->use5_3 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum >= 5.4) {
-        if (lefData->use5_4) {
-           if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-              if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAMETALLENGTH statement is a version 5.3 and earlier syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-                 lefError(1646, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaMetalLength($2, $3);
-    }
-  | K_RISESLEWLIMIT int_number ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setRiseSlewLimit($2); }
-  | K_FALLSLEWLIMIT int_number ';'
-    { if (lefCallbacks->PinCbk) lefData->lefrPin.setFallSlewLimit($2); }
-  | K_ANTENNAPARTIALMETALAREA NUMBER opt_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALMETALAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1647, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALMETALAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1647, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaPartialMetalArea($2, $3);
-    }
-  | K_ANTENNAPARTIALMETALSIDEAREA NUMBER opt_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALMETALSIDEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1648, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALMETALSIDEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1648, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaPartialMetalSideArea($2, $3);
-    }
-  | K_ANTENNAPARTIALCUTAREA NUMBER opt_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALCUTAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1649, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAPARTIALCUTAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1649, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaPartialCutArea($2, $3);
-    }
-  | K_ANTENNADIFFAREA NUMBER opt_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNADIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1650, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNADIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1650, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaDiffArea($2, $3);
-    }
-  | K_ANTENNAGATEAREA NUMBER opt_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1651, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1651, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaGateArea($2, $3);
-    }
-  | K_ANTENNAMAXAREACAR NUMBER req_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1652, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1652, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaMaxAreaCar($2, $3);
-    }
-  | K_ANTENNAMAXSIDEAREACAR NUMBER req_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXSIDEAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1653, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXSIDEAREACAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1653, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaMaxSideAreaCar($2, $3);
-    }
-  | K_ANTENNAMAXCUTCAR NUMBER req_layer_name ';'
-    { // 5.4 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXCUTCAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1654, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMAXCUTCAR statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1654, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-      if (lefCallbacks->PinCbk) lefData->lefrPin.addAntennaMaxCutCar($2, $3);
-    }
-  | K_ANTENNAMODEL
-    { // 5.5 syntax 
-      lefData->use5_4 = 1;
-      if (lefData->ignoreVersion) {
-        // do nothing 
-      } else if (lefData->versionNum < 5.5) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1655, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else if (lefData->use5_3) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ANTENNAMODEL statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1655, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      }
-    }
-    pin_layer_oxide ';'
-  | K_NETEXPR {lefData->lefDumbMode = 2; lefData->lefNoNum = 2; } QSTRING ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "NETEXPR statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1656, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setNetExpr($3);
-    }
-  | K_SUPPLYSENSITIVITY {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "SUPPLYSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1657, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setSupplySensitivity($3);
-    }
-  | K_GROUNDSENSITIVITY {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->PinCbk) { // write error only if cbk is set 
-           if (lefData->pinWarnings++ < lefSettings->PinWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "GROUNDSENSITIVITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1658, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } else
-        if (lefCallbacks->PinCbk) lefData->lefrPin.setGroundSensitivity($3);
-    }
-
-pin_layer_oxide:
-  K_OXIDE1
-    {
-    if (lefCallbacks->PinCbk)
-       lefData->lefrPin.addAntennaModel(1);
-    }
-  | K_OXIDE2
-    {
-    if (lefCallbacks->PinCbk)
-       lefData->lefrPin.addAntennaModel(2);
-    }
-  | K_OXIDE3
-    {
-    if (lefCallbacks->PinCbk)
-       lefData->lefrPin.addAntennaModel(3);
-    }
-  | K_OXIDE4
-    {
-    if (lefCallbacks->PinCbk)
-       lefData->lefrPin.addAntennaModel(4);
-    }
-
-pin_prop_list:
-  pin_name_value_pair
-  | pin_prop_list pin_name_value_pair
-  ;
-
-pin_name_value_pair:
-  T_STRING NUMBER
-    { 
-      char temp[32];
-      sprintf(temp, "%.11g", $2);
-      if (lefCallbacks->PinCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrPinProp.propType($1);
-         lefData->lefrPin.setNumProperty($1, $2, temp, propTp);
-      }
-    }
-  | T_STRING QSTRING
-    {
-      if (lefCallbacks->PinCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrPinProp.propType($1);
-         lefData->lefrPin.setProperty($1, $2, propTp);
-      }
-    }
-  | T_STRING T_STRING
-    {
-      if (lefCallbacks->PinCbk) {
-         char propTp;
-         propTp = lefSettings->lefProps.lefrPinProp.propType($1);
-         lefData->lefrPin.setProperty($1, $2, propTp);
-      }
-    }
-
-electrical_direction:
-  K_DIRECTION K_INPUT ';'              {$$ = (char*)"INPUT";}
-  | K_DIRECTION K_OUTPUT ';'            {$$ = (char*)"OUTPUT";}
-  | K_DIRECTION K_OUTPUT K_TRISTATE ';' {$$ = (char*)"OUTPUT TRISTATE";}
-  | K_DIRECTION K_INOUT  ';'            {$$ = (char*)"INOUT";}
-  | K_DIRECTION K_FEEDTHRU ';'          {$$ = (char*)"FEEDTHRU";}
-
-start_macro_port: K_PORT
-    {
-      if (lefCallbacks->PinCbk) {
-        lefData->lefrDoGeometries = 1;
-        lefData->hasPRP = 0;
-        lefData->lefrGeometriesPtr = (lefiGeometries*)lefMalloc( sizeof(lefiGeometries));
-        lefData->lefrGeometriesPtr->Init();
-      }
-      lefData->needGeometry = 0;  // don't need rect/path/poly define yet
-      lefData->hasGeoLayer = 0;   // make sure LAYER is set before geometry
-    }
-
-macro_port_class_option: // empty 
-  | K_CLASS class_type ';'
-    { if (lefData->lefrDoGeometries)
-        lefData->lefrGeometriesPtr->addClass($2); }
-
-macro_pin_use:
-  K_SIGNAL      {$$ = (char*)"SIGNAL";}
-  | K_ANALOG    {$$ = (char*)"ANALOG";}
-  | K_POWER     {$$ = (char*)"POWER";}
-  | K_GROUND    {$$ = (char*)"GROUND";}
-  | K_CLOCK     {$$ = (char*)"CLOCK";}
-  | K_DATA      {$$ = (char*)"DATA";}
-
-macro_scan_use:
-  K_INPUT {$$ = (char*)"INPUT";}
-  | K_OUTPUT    {$$ = (char*)"OUTPUT";}
-  | K_START     {$$ = (char*)"START";}
-  | K_STOP      {$$ = (char*)"STOP";}
-
-pin_shape:
-  {$$ = (char*)""; }      // non-lefData->ring shape 
-  | K_ABUTMENT  {$$ = (char*)"ABUTMENT";}
-  | K_RING      {$$ = (char*)"RING";}
-  | K_FEEDTHRU  {$$ = (char*)"FEEDTHRU";}
-
-geometries: geometry geometry_options
-
-geometry:
-  K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    {
-      if ((lefData->needGeometry) && (lefData->needGeometry != 2)) // 1 LAYER follow after another
-        if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-          // geometries is called by MACRO/OBS & MACRO/PIN/PORT 
-          if (lefData->obsDef)
-             lefWarning(2076, "Either PATH, RECT or POLYGON statement is a required in MACRO/OBS.");
-          else
-             lefWarning(2065, "Either PATH, RECT or POLYGON statement is a required in MACRO/PIN/PORT.");
-        }
-      if (lefData->lefrDoGeometries)
-        lefData->lefrGeometriesPtr->addLayer($3);
-      lefData->needGeometry = 1;    // within LAYER it requires either path, rect, poly
-      lefData->hasGeoLayer = 1;
-    }
-  layer_exceptpgnet
-  layer_spacing ';'
-  | K_WIDTH int_number ';'
-    { 
-      if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else
-           lefData->lefrGeometriesPtr->addWidth($2); 
-      } 
-    }
-  | K_PATH maskColor firstPt otherPts ';'
-    { if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-                lefData->lefrGeometriesPtr->addPath((int)$2);
-           }
-        }
-      }
-      lefData->hasPRP = 1;
-      lefData->needGeometry = 2;
-    }
-  | K_PATH maskColor K_ITERATE firstPt otherPts stepPattern ';'
-    { if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-              lefData->lefrGeometriesPtr->addPathIter((int)$2);
-            }
-         }
-      } 
-      lefData->hasPRP = 1;
-      lefData->needGeometry = 2;
-    }
-  | K_RECT maskColor pt pt';'
-    { if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-              lefData->lefrGeometriesPtr->addRect((int)$2, $3.x, $3.y, $4.x, $4.y);
-           }
-        }
-      }
-      lefData->needGeometry = 2;
-    }
-  | K_RECT maskColor K_ITERATE pt pt stepPattern ';'
-    { if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-              lefData->lefrGeometriesPtr->addRectIter((int)$2, $4.x, $4.y, $5.x, $5.y);
-           }
-        }
-      }
-      lefData->needGeometry = 2;
-    }
-  | K_POLYGON maskColor firstPt nextPt nextPt otherPts ';'
-    {
-      if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-              lefData->lefrGeometriesPtr->addPolygon((int)$2);
-            }
-           }
-      }
-      lefData->hasPRP = 1;
-      lefData->needGeometry = 2;
-    }
-  | K_POLYGON maskColor K_ITERATE firstPt nextPt nextPt otherPts stepPattern ';'
-    { if (lefData->lefrDoGeometries) {
-        if (lefData->hasGeoLayer == 0) {   // LAYER statement is missing 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefError(1701, "A LAYER statement is missing in Geometry.\nLAYER is a required statement before any geometry can be defined.");
-              CHKERR();
-           }
-        } else {
-           if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-           } else {
-              lefData->lefrGeometriesPtr->addPolygonIter((int)$2);
-           }
-         }
-      }
-      lefData->hasPRP = 1;
-      lefData->needGeometry = 2;
-    }
-  | via_placement
-    { }
-
-geometry_options: // empty 
-  | geometry_options geometry
-
-layer_exceptpgnet: // empty 
-  | K_EXCEPTPGNET                   // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "EXCEPTPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1699, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-       if (lefData->lefrDoGeometries)
-        lefData->lefrGeometriesPtr->addLayerExceptPgNet();
-      }
-    }
-
-layer_spacing: // empty 
-  | K_SPACING int_number
-    { if (lefData->lefrDoGeometries) {
-        if (zeroOrGt($2))
-           lefData->lefrGeometriesPtr->addLayerMinSpacing($2);
-        else {
-           lefData->outMsg = (char*)lefMalloc(10000);
-           sprintf (lefData->outMsg,
-              "THE SPACING statement has the value %g in MACRO OBS.\nValue has to be 0 or greater.", $2);
-           lefError(1659, lefData->outMsg);
-           lefFree(lefData->outMsg);
-           CHKERR();
-        }
-      }
-    }
-  | K_DESIGNRULEWIDTH int_number
-    { if (lefData->lefrDoGeometries) {
-        if (zeroOrGt($2))
-           lefData->lefrGeometriesPtr->addLayerRuleWidth($2);
-        else {
-           lefData->outMsg = (char*)lefMalloc(10000);
-           sprintf (lefData->outMsg,
-              "THE DESIGNRULEWIDTH statement has the value %g in MACRO OBS.\nValue has to be 0 or greater.", $2);
-           lefError(1660, lefData->outMsg);
-           lefFree(lefData->outMsg);
-           CHKERR();
-        }
-      }
-    }
-
-firstPt: pt  
-    { if (lefData->lefrDoGeometries)
-        lefData->lefrGeometriesPtr->startList($1.x, $1.y); }
-
-nextPt:  pt
-    { if (lefData->lefrDoGeometries)
-        lefData->lefrGeometriesPtr->addToList($1.x, $1.y); }
-
-otherPts:
-  // empty 
-  | otherPts nextPt
-  ;
-
-via_placement:
-  K_VIA maskColor pt {lefData->lefDumbMode = 1;} T_STRING ';'
-    { 
-        if (lefData->lefrDoGeometries){
-            if (lefData->versionNum < 5.8 && (int)$2 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-            } else {
-                lefData->lefrGeometriesPtr->addVia((int)$2, $3.x, $3.y, $5);
-            }
-        }
-    }
-  | K_VIA K_ITERATE maskColor pt {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    stepPattern ';'
-    { 
-        if (lefData->lefrDoGeometries) {
-            if (lefData->versionNum < 5.8 && (int)$3 > 0) {
-              if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-                 lefError(2083, "Color mask information can only be defined with version 5.8.");
-                 CHKERR(); 
-              }           
-            } else {
-              lefData->lefrGeometriesPtr->addViaIter((int)$3, $4.x, $4.y, $6); 
-            }
-        }
-    }
-        
-stepPattern: K_DO int_number K_BY int_number K_STEP int_number int_number
-     { if (lefData->lefrDoGeometries)
-         lefData->lefrGeometriesPtr->addStepPattern($2, $4, $6, $7); }
-
-sitePattern: T_STRING int_number int_number orientation
-  K_DO int_number K_BY int_number K_STEP int_number int_number
-    {
-      if (lefData->lefrDoSite) {
-        lefData->lefrSitePatternPtr = (lefiSitePattern*)lefMalloc(
-                                   sizeof(lefiSitePattern));
-        lefData->lefrSitePatternPtr->Init();
-        lefData->lefrSitePatternPtr->set($1, $2, $3, $4, $6, $8,
-          $10, $11);
-        }
-    }
-  | T_STRING int_number int_number orientation
-    {
-      if (lefData->lefrDoSite) {
-        lefData->lefrSitePatternPtr = (lefiSitePattern*)lefMalloc(
-                                   sizeof(lefiSitePattern));
-        lefData->lefrSitePatternPtr->Init();
-        lefData->lefrSitePatternPtr->set($1, $2, $3, $4, -1, -1,
-          -1, -1);
-        }
-    }
-
-trackPattern:
-  K_X int_number K_DO int_number K_STEP int_number 
-    { 
-      if (lefData->lefrDoTrack) {
-        lefData->lefrTrackPatternPtr = (lefiTrackPattern*)lefMalloc(
-                                sizeof(lefiTrackPattern));
-        lefData->lefrTrackPatternPtr->Init();
-        lefData->lefrTrackPatternPtr->set("X", $2, (int)$4, $6);
-      }    
-    }
-    K_LAYER {lefData->lefDumbMode = 1000000000;} trackLayers
-    { lefData->lefDumbMode = 0;}
-  | K_Y int_number K_DO int_number K_STEP int_number
-    { 
-      if (lefData->lefrDoTrack) {
-        lefData->lefrTrackPatternPtr = (lefiTrackPattern*)lefMalloc(
-                                    sizeof(lefiTrackPattern));
-        lefData->lefrTrackPatternPtr->Init();
-        lefData->lefrTrackPatternPtr->set("Y", $2, (int)$4, $6);
-      }    
-    }
-    K_LAYER {lefData->lefDumbMode = 1000000000;} trackLayers
-    { lefData->lefDumbMode = 0;}
-  | K_X int_number K_DO int_number K_STEP int_number 
-    { 
-      if (lefData->lefrDoTrack) {
-        lefData->lefrTrackPatternPtr = (lefiTrackPattern*)lefMalloc(
-                                    sizeof(lefiTrackPattern));
-        lefData->lefrTrackPatternPtr->Init();
-        lefData->lefrTrackPatternPtr->set("X", $2, (int)$4, $6);
-      }    
-    }
-  | K_Y int_number K_DO int_number K_STEP int_number
-    { 
-      if (lefData->lefrDoTrack) {
-        lefData->lefrTrackPatternPtr = (lefiTrackPattern*)lefMalloc(
-                                    sizeof(lefiTrackPattern));
-        lefData->lefrTrackPatternPtr->Init();
-        lefData->lefrTrackPatternPtr->set("Y", $2, (int)$4, $6);
-      }    
-    }
-
-trackLayers:
-  // empty 
-  | trackLayers layer_name
-  ;
-
-layer_name: T_STRING
-    { if (lefData->lefrDoTrack) lefData->lefrTrackPatternPtr->addLayer($1); }
-
-gcellPattern: K_X int_number K_DO int_number K_STEP int_number
-    {
-      if (lefData->lefrDoGcell) {
-        lefData->lefrGcellPatternPtr = (lefiGcellPattern*)lefMalloc(
-                                    sizeof(lefiGcellPattern));
-        lefData->lefrGcellPatternPtr->Init();
-        lefData->lefrGcellPatternPtr->set("X", $2, (int)$4, $6);
-      }    
-    }
-  | K_Y int_number K_DO int_number K_STEP int_number
-    {
-      if (lefData->lefrDoGcell) {
-        lefData->lefrGcellPatternPtr = (lefiGcellPattern*)lefMalloc(
-                                    sizeof(lefiGcellPattern));
-        lefData->lefrGcellPatternPtr->Init();
-        lefData->lefrGcellPatternPtr->set("Y", $2, (int)$4, $6);
-      }    
-    }
-
-macro_obs: start_macro_obs geometries K_END
-    { 
-      if (lefCallbacks->ObstructionCbk) {
-        lefData->lefrObstruction.setGeometries(lefData->lefrGeometriesPtr);
-        lefData->lefrGeometriesPtr = 0;
-        lefData->lefrDoGeometries = 0;
-        CALLBACK(lefCallbacks->ObstructionCbk, lefrObstructionCbkType, &lefData->lefrObstruction);
-      }
-      lefData->lefDumbMode = 0;
-      lefData->hasGeoLayer = 0;       // reset 
-    }
-  | start_macro_obs K_END
-    {
-       // The pointer has malloced in start, need to free manually 
-       if (lefData->lefrGeometriesPtr) {
-          lefData->lefrGeometriesPtr->Destroy();
-          lefFree(lefData->lefrGeometriesPtr);
-          lefData->lefrGeometriesPtr = 0;
-          lefData->lefrDoGeometries = 0;
-       }
-       lefData->hasGeoLayer = 0;
-    }
-
-start_macro_obs: K_OBS
-    {
-      lefData->obsDef = 1;
-      if (lefCallbacks->ObstructionCbk) {
-        lefData->lefrDoGeometries = 1;
-        lefData->lefrGeometriesPtr = (lefiGeometries*)lefMalloc(
-            sizeof(lefiGeometries));
-        lefData->lefrGeometriesPtr->Init();
-        }
-      lefData->hasGeoLayer = 0;
-    }
-
-macro_density: K_DENSITY density_layer density_layers K_END
-    { 
-      if (lefData->versionNum < 5.6) {
-        if (lefCallbacks->DensityCbk) { // write error only if cbk is set 
-           if (lefData->macroWarnings++ < lefSettings->MacroWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "DENSITY statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1661, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-      } 
-      if (lefCallbacks->DensityCbk) {
-        CALLBACK(lefCallbacks->DensityCbk, lefrDensityCbkType, &lefData->lefrDensity);
-        lefData->lefrDensity.clear();
-      }
-      lefData->lefDumbMode = 0;
-    }
-
-density_layers: // empty 
-    | density_layers density_layer
-    ;
-
-density_layer: K_LAYER { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    {
-      if (lefCallbacks->DensityCbk)
-        lefData->lefrDensity.addLayer($3);
-    }
-    density_layer_rect density_layer_rects
-
-density_layer_rects: // empty 
-    | density_layer_rects density_layer_rect
-    ;
-
-density_layer_rect: K_RECT pt pt int_number ';'
-    {
-      if (lefCallbacks->DensityCbk)
-        lefData->lefrDensity.addRect($2.x, $2.y, $3.x, $3.y, $4); 
-    }
-
-macro_clocktype: K_CLOCKTYPE { lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING ';'
-    { if (lefCallbacks->MacroCbk) lefData->lefrMacro.setClockType($3); }
-
-timing: start_timing timing_options end_timing
-    { }
-
-start_timing: K_TIMING 
-    { }
-
-end_timing: K_END K_TIMING 
-  {
-    if (lefData->versionNum < 5.4) {
-      if (lefCallbacks->TimingCbk && lefData->lefrTiming.hasData())
-        CALLBACK(lefCallbacks->TimingCbk, lefrTimingCbkType, &lefData->lefrTiming);
-      lefData->lefrTiming.clear();
-    } else {
-      if (lefCallbacks->TimingCbk) // write warning only if cbk is set 
-        if (lefData->timingWarnings++ < lefSettings->TimingWarnings)
-          lefWarning(2066, "MACRO TIMING statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-      lefData->lefrTiming.clear();
-    }
-  }
-
-timing_options:
-  // empty 
-  | timing_options timing_option
-  ;
-
-timing_option:
-  K_FROMPIN 
-    {
-    if (lefData->versionNum < 5.4) {
-      if (lefCallbacks->TimingCbk && lefData->lefrTiming.hasData())
-        CALLBACK(lefCallbacks->TimingCbk, lefrTimingCbkType, &lefData->lefrTiming);
-    }
-    lefData->lefDumbMode = 1000000000;
-    lefData->lefrTiming.clear();
-    }
-    list_of_from_strings ';'
-    { lefData->lefDumbMode = 0;}
-  | K_TOPIN {lefData->lefDumbMode = 1000000000;} list_of_to_strings ';'
-    { lefData->lefDumbMode = 0;}
-  | risefall K_INTRINSIC int_number int_number
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addRiseFall($1,$3,$4); }
-    slew_spec K_VARIABLE int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addRiseFallVariable($8,$9); }
-  | risefall delay_or_transition K_UNATENESS unateness
-    K_TABLEDIMENSION int_number int_number int_number ';' 
-    { if (lefCallbacks->TimingCbk) {
-        if ($2[0] == 'D' || $2[0] == 'd') // delay 
-          lefData->lefrTiming.addDelay($1, $4, $6, $7, $8);
-        else
-          lefData->lefrTiming.addTransition($1, $4, $6, $7, $8);
-      }
-    }
-  | K_TABLEAXIS list_of_table_axis_dnumbers ';'
-    { }
-  | K_TABLEENTRIES list_of_table_entries ';'
-    { }
-  | K_RISERS int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setRiseRS($2,$3); }
-  | K_FALLRS int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setFallRS($2,$3); }
-  | K_RISECS int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setRiseCS($2,$3); }
-  | K_FALLCS int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setFallCS($2,$3); }
-  | K_RISESATT1 int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setRiseAtt1($2,$3); }
-  | K_FALLSATT1 int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setFallAtt1($2,$3); }
-  | K_RISET0 int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setRiseTo($2,$3); }
-  | K_FALLT0 int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setFallTo($2,$3); }
-  | K_UNATENESS unateness ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addUnateness($2); }
-  | K_STABLE K_SETUP int_number K_HOLD int_number risefall ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setStable($3,$5,$6); }
-  | two_pin_trigger from_pin_trigger to_pin_trigger K_TABLEDIMENSION int_number int_number int_number ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addSDF2Pins($1,$2,$3,$5,$6,$7); }
-  | one_pin_trigger K_TABLEDIMENSION int_number int_number int_number ';' 
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addSDF1Pin($1,$3,$4,$4); }
-  | K_SDFCONDSTART QSTRING ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setSDFcondStart($2); }
-  | K_SDFCONDEND QSTRING ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setSDFcondEnd($2); }
-  | K_SDFCOND QSTRING ';'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.setSDFcond($2); }
-  | K_EXTENSION ';'
-    { }
-
-one_pin_trigger:
-  K_MPWH
-    { $$ = (char*)"MPWH";}
-  | K_MPWL
-    { $$ = (char*)"MPWL";}
-  | K_PERIOD
-    { $$ = (char*)"PERIOD";}
-
-two_pin_trigger :
-  K_SETUP
-    { $$ = (char*)"SETUP";}
-  | K_HOLD
-    { $$ = (char*)"HOLD";}
-  | K_RECOVERY
-    { $$ = (char*)"RECOVERY";}
-  | K_SKEW
-    { $$ = (char*)"SKEW";}
-
-from_pin_trigger:
-  K_ANYEDGE
-    { $$ = (char*)"ANYEDGE";}
-  | K_POSEDGE
-    { $$ = (char*)"POSEDGE";}
-  | K_NEGEDGE 
-    { $$ = (char*)"NEGEDGE";}
-
-to_pin_trigger:
-  K_ANYEDGE
-    { $$ = (char*)"ANYEDGE";}
-  | K_POSEDGE
-    { $$ = (char*)"POSEDGE";}
-  | K_NEGEDGE 
-    { $$ = (char*)"NEGEDGE";}
-
-delay_or_transition :
-  K_DELAY
-    { $$ = (char*)"DELAY"; }
-  | K_TRANSITIONTIME
-    { $$ = (char*)"TRANSITION"; }
-
-list_of_table_entries:
-  table_entry
-    { }
-  | list_of_table_entries table_entry
-    { }
-
-table_entry: '(' int_number int_number int_number ')'
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addTableEntry($2,$3,$4); }
-
-list_of_table_axis_dnumbers:
-  int_number
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addTableAxisNumber($1); }
-  | list_of_table_axis_dnumbers int_number
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addTableAxisNumber($2); }
-
-slew_spec:
-  // empty 
-    { }
-  | int_number int_number int_number int_number 
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addRiseFallSlew($1,$2,$3,$4); }
-  |  int_number int_number int_number int_number int_number int_number int_number 
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addRiseFallSlew($1,$2,$3,$4);
-      if (lefCallbacks->TimingCbk) lefData->lefrTiming.addRiseFallSlew2($5,$6,$7); }
-
-risefall:
-  K_RISE
-    { $$ = (char*)"RISE"; }
-  | K_FALL 
-    { $$ = (char*)"FALL"; }
-
-unateness:
-  K_INVERT
-    { $$ = (char*)"INVERT"; }
-  | K_NONINVERT
-    { $$ = (char*)"NONINVERT"; }
-  | K_NONUNATE 
-    { $$ = (char*)"NONUNATE"; }
-
-list_of_from_strings:
-  T_STRING
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addFromPin($1); }
-  | list_of_from_strings T_STRING 
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addFromPin($2); }
-
-list_of_to_strings:
-  T_STRING
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addToPin($1); }
-  | list_of_to_strings T_STRING 
-    { if (lefCallbacks->TimingCbk) lefData->lefrTiming.addToPin($2); }
-
-array: start_array array_rules
-    {
-      if (lefCallbacks->ArrayCbk)
-        CALLBACK(lefCallbacks->ArrayCbk, lefrArrayCbkType, &lefData->lefrArray);
-      lefData->lefrArray.clear();
-      lefData->lefrSitePatternPtr = 0;
-      lefData->lefrDoSite = 0;
-   }
-    end_array
-
-start_array: K_ARRAY {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.setName($3);
-        CALLBACK(lefCallbacks->ArrayBeginCbk, lefrArrayBeginCbkType, $3);
-      }
-      //strcpy(lefData->arrayName, $3);
-      lefData->arrayName = strdup($3);
-    }
-
-end_array: K_END {lefData->lefDumbMode = 1; lefData->lefNoNum = 1;} T_STRING
-    {
-      if (lefCallbacks->ArrayCbk && lefCallbacks->ArrayEndCbk)
-        CALLBACK(lefCallbacks->ArrayEndCbk, lefrArrayEndCbkType, $3);
-      if (strcmp(lefData->arrayName, $3) != 0) {
-        if (lefCallbacks->ArrayCbk) { // write error only if cbk is set 
-           if (lefData->arrayWarnings++ < lefSettings->ArrayWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "END ARRAY name %s is different from the ARRAY name %s.\nCorrect the LEF file before rerunning it through the LEF parser.", $3, lefData->arrayName);
-              lefError(1662, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              lefFree(lefData->arrayName);
-              CHKERR();
-           } else
-              lefFree(lefData->arrayName);
-        } else
-           lefFree(lefData->arrayName);
-      } else
-        lefFree(lefData->arrayName);
-    }
-
-array_rules:
-  // empty 
-    { }
-  | array_rules array_rule
-    { }
-
-array_rule:
-  site_word { if (lefCallbacks->ArrayCbk) lefData->lefrDoSite = 1; lefData->lefDumbMode = 1; }
-    sitePattern  ';'
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.addSitePattern(lefData->lefrSitePatternPtr);
-      }
-    }
-  | K_CANPLACE {lefData->lefDumbMode = 1; if (lefCallbacks->ArrayCbk) lefData->lefrDoSite = 1; }
-    sitePattern ';'
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.addCanPlace(lefData->lefrSitePatternPtr);
-      }
-    }
-  | K_CANNOTOCCUPY {lefData->lefDumbMode = 1; if (lefCallbacks->ArrayCbk) lefData->lefrDoSite = 1; }
-    sitePattern ';'
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.addCannotOccupy(lefData->lefrSitePatternPtr);
-      }
-    }
-  | K_TRACKS { if (lefCallbacks->ArrayCbk) lefData->lefrDoTrack = 1; } trackPattern ';'
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.addTrack(lefData->lefrTrackPatternPtr);
-      }
-    }
-  | floorplan_start floorplan_list K_END T_STRING 
-    {
-    }
-  | K_GCELLGRID { if (lefCallbacks->ArrayCbk) lefData->lefrDoGcell = 1; } gcellPattern ';'
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.addGcell(lefData->lefrGcellPatternPtr);
-      }
-    }
-  | K_DEFAULTCAP int_number cap_list K_END K_DEFAULTCAP
-    {
-      if (lefCallbacks->ArrayCbk) {
-        lefData->lefrArray.setTableSize((int)$2);
-      }
-    }
-  | def_statement
-    { }
-
-floorplan_start: K_FLOORPLAN T_STRING
-    { if (lefCallbacks->ArrayCbk) lefData->lefrArray.addFloorPlan($2); }
-        
-floorplan_list:
-  // empty 
-    { }
-  | floorplan_list floorplan_element
-    { }
-
-floorplan_element:
-  K_CANPLACE { lefData->lefDumbMode = 1; if (lefCallbacks->ArrayCbk) lefData->lefrDoSite = 1; }
-    sitePattern ';'
-    {
-      if (lefCallbacks->ArrayCbk)
-        lefData->lefrArray.addSiteToFloorPlan("CANPLACE",
-        lefData->lefrSitePatternPtr);
-    }
-  | K_CANNOTOCCUPY { if (lefCallbacks->ArrayCbk) lefData->lefrDoSite = 1; lefData->lefDumbMode = 1; }
-    sitePattern ';'
-    {
-      if (lefCallbacks->ArrayCbk)
-        lefData->lefrArray.addSiteToFloorPlan("CANNOTOCCUPY",
-        lefData->lefrSitePatternPtr);
-     }
-
-cap_list:
-  // empty 
-    { }
-  | cap_list one_cap
-    { }
-
-one_cap: K_MINPINS int_number K_WIRECAP int_number ';'
-    { if (lefCallbacks->ArrayCbk) lefData->lefrArray.addDefaultCap((int)$2, $4); }
-
-msg_statement:
-  K_MESSAGE {lefData->lefDumbMode=1;lefData->lefNlToken=TRUE;} T_STRING '=' s_expr dtrm
-    {  }
-
-create_file_statement:
-  K_CREATEFILE {lefData->lefDumbMode=1;lefData->lefNlToken=TRUE;} T_STRING '=' s_expr dtrm
-    { }
-
-def_statement:
-  K_DEFINE {lefData->lefDumbMode=1;lefData->lefNlToken=TRUE;} T_STRING '=' expression dtrm
-    {
-      if (lefData->versionNum < 5.6)
-        lefAddNumDefine($3, $5);
-      else
-        if (lefCallbacks->ArrayCbk) // write warning only if cbk is set 
-           if (lefData->arrayWarnings++ < lefSettings->ArrayWarnings)
-             lefWarning(2067, "DEFINE statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  |  K_DEFINES {lefData->lefDumbMode=1;lefData->lefNlToken=TRUE;} T_STRING '=' s_expr dtrm
-    {
-      if (lefData->versionNum < 5.6)
-        lefAddStringDefine($3, $5);
-      else
-        if (lefCallbacks->ArrayCbk) // write warning only if cbk is set 
-           if (lefData->arrayWarnings++ < lefSettings->ArrayWarnings)
-             lefWarning(2068, "DEFINES statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-  |  K_DEFINEB {lefData->lefDumbMode=1;lefData->lefNlToken=TRUE;} T_STRING '=' b_expr dtrm
-    {
-      if (lefData->versionNum < 5.6)
-        lefAddBooleanDefine($3, $5);
-      else
-        if (lefCallbacks->ArrayCbk) // write warning only if cbk is set 
-           if (lefData->arrayWarnings++ < lefSettings->ArrayWarnings)
-             lefWarning(2069, "DEFINEB statement is obsolete in version 5.6 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.6 or later.");
-    }
-
-// terminator for &defines.  Can be semicolon or newline 
-dtrm:
-  |  ';' {lefData->lefNlToken = FALSE;}
-  |  '\n'        {lefData->lefNlToken = FALSE;}
-
-then:
-  K_THEN
-  | '\n' K_THEN
-  ;
-
-else:
-  K_ELSE
-  | '\n' K_ELSE
-  ;
-
-expression:
-  expression '+' expression     {$$ = $1 + $3; }
-  | expression '-' expression   {$$ = $1 - $3; }
-  | expression '*' expression   {$$ = $1 * $3; }
-  | expression '/' expression   {$$ = $1 / $3; }
-  | '-' expression %prec UMINUS {$$ = -$2;}
-  | '(' expression ')'          {$$ = $2;}
-  | K_IF b_expr then expression else expression %prec IF
-                {$$ = ($2 != 0) ? $4 : $6;}
-  | int_number                       {$$ = $1;}
-
-b_expr:
-  expression relop expression {$$ = comp_num($1,$2,$3);}
-  | expression K_AND expression {$$ = $1 != 0 && $3 != 0;}
-  | expression K_OR  expression {$$ = $1 != 0 || $3 != 0;}
-  | s_expr relop s_expr       {$$ = comp_str($1,$2,$3);}
-  | s_expr K_AND s_expr       {$$ = $1[0] != 0 && $3[0] != 0;}
-  | s_expr K_OR  s_expr       {$$ = $1[0] != 0 || $3[0] != 0;}
-  | b_expr K_EQ b_expr        {$$ = $1 == $3;}
-  | b_expr K_NE b_expr        {$$ = $1 != $3;}
-  | b_expr K_AND b_expr       {$$ = $1 && $3;}
-  | b_expr K_OR  b_expr       {$$ = $1 || $3;}
-  | K_NOT b_expr                    %prec LNOT {$$ = !$$;}
-  | '(' b_expr ')'            {$$ = $2;}
-  | K_IF b_expr then b_expr else b_expr %prec IF
-        {$$ = ($2 != 0) ? $4 : $6;}
-  | K_TRUE                    {$$ = 1;}
-  | K_FALSE                   {$$ = 0;}
-
-s_expr:
-  s_expr '+' s_expr
-    {
-      $$ = (char*)lefMalloc(strlen($1)+strlen($3)+1);
-      strcpy($$,$1);
-      strcat($$,$3);
-    }
-  | '(' s_expr ')'
-    { $$ = $2; }
-  | K_IF b_expr then s_expr else s_expr %prec IF
-    {
-      lefData->lefDefIf = TRUE;
-      if ($2 != 0) {
-        $$ = $4;        
-      } else {
-        $$ = $6;
-      }
-    }
-  | QSTRING
-    { $$ = $1; }
-
-relop:
-  K_LE {$$ = C_LE;}
-  | K_LT {$$ = C_LT;}
-  | K_GE {$$ = C_GE;}
-  | K_GT {$$ = C_GT;}
-  | K_EQ {$$ = C_EQ;}
-  | K_NE {$$ = C_NE;}
-  | '='  {$$ = C_EQ;}
-  | '<'  {$$ = C_LT;}
-  | '>'  {$$ = C_GT;}
-
-
-prop_def_section: K_PROPDEF
-    { 
-      if (lefCallbacks->PropBeginCbk)
-        CALLBACK(lefCallbacks->PropBeginCbk, lefrPropBeginCbkType, 0);
-    }
-    prop_stmts K_END K_PROPDEF
-    { 
-      if (lefCallbacks->PropEndCbk)
-        CALLBACK(lefCallbacks->PropEndCbk, lefrPropEndCbkType, 0);
-    }
-
-prop_stmts:
-  // empty 
-    { }
-  | prop_stmts prop_stmt
-    { }
-
-prop_stmt:
-  K_LIBRARY {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("library", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrLibProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_COMPONENTPIN {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("componentpin", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrCompProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_PIN {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("pin", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrPinProp.setPropType($3, lefData->lefPropDefType);
-      
-    }
-  | K_MACRO {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("macro", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrMacroProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_VIA {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("via", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrViaProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_VIARULE {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("viarule", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrViaRuleProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_LAYER {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("layer", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrLayerProp.setPropType($3, lefData->lefPropDefType);
-    }
-  | K_NONDEFAULTRULE {lefData->lefDumbMode = 1; lefData->lefrProp.clear(); }
-    T_STRING prop_define ';'
-    { 
-      if (lefCallbacks->PropCbk) {
-        lefData->lefrProp.setPropType("nondefaultrule", $3);
-        CALLBACK(lefCallbacks->PropCbk, lefrPropCbkType, &lefData->lefrProp);
-      }
-      lefSettings->lefProps.lefrNondefProp.setPropType($3, lefData->lefPropDefType);
-    }
-    
-prop_define:
-  K_INTEGER  opt_def_range opt_def_dvalue 
-    { 
-      if (lefCallbacks->PropCbk) lefData->lefrProp.setPropInteger();
-      lefData->lefPropDefType = 'I';
-    }
-  | K_REAL opt_def_range opt_def_value
-    { 
-      if (lefCallbacks->PropCbk) lefData->lefrProp.setPropReal();
-      lefData->lefPropDefType = 'R';
-    }
-  | K_STRING
-    {
-      if (lefCallbacks->PropCbk) lefData->lefrProp.setPropString();
-      lefData->lefPropDefType = 'S';
-    }
-  | K_STRING QSTRING
-    {
-      if (lefCallbacks->PropCbk) lefData->lefrProp.setPropQString($2);
-      lefData->lefPropDefType = 'Q';
-    }
-  | K_NAMEMAPSTRING T_STRING
-    {
-      if (lefCallbacks->PropCbk) lefData->lefrProp.setPropNameMapString($2);
-      lefData->lefPropDefType = 'S';
-    }
-
-opt_range_second:
-  // nothing 
-    { }
-  | K_USELENGTHTHRESHOLD
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingRangeUseLength();
-    }
-  | K_INFLUENCE int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-        lefData->lefrLayer.setSpacingRangeInfluence($2);
-        lefData->lefrLayer.setSpacingRangeInfluenceRange(-1, -1);
-      }
-    }
-  | K_INFLUENCE int_number K_RANGE int_number int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-        lefData->lefrLayer.setSpacingRangeInfluence($2);
-        lefData->lefrLayer.setSpacingRangeInfluenceRange($4, $5);
-      }
-    }
-  | K_RANGE int_number int_number
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingRangeRange($2, $3);
-    }
-
-opt_endofline:                                      // 5.7 
-  // nothing 
-    { }
-  | K_PARALLELEDGE int_number K_WITHIN int_number
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingParSW($2, $4);
-    }
-    opt_endofline_twoedges
-
-opt_endofline_twoedges:                             // 5.7 
-  // nothing 
-    { }
-  | K_TWOEDGES
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingParTwoEdges();
-    }
-
-opt_samenetPGonly:                                  // 5.7 
-  // nothing 
-    { }
-  | K_PGONLY
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingSamenetPGonly();
-    }
-
-opt_def_range:
-  // nothing 
-    { }
-  | K_RANGE int_number int_number
-    {  if (lefCallbacks->PropCbk) lefData->lefrProp.setRange($2, $3); }
-
-opt_def_value:
-  // empty 
-    { }
-  | NUMBER
-    { if (lefCallbacks->PropCbk) lefData->lefrProp.setNumber($1); }
-
-opt_def_dvalue:
-  // empty 
-    { }
-  | int_number
-    { if (lefCallbacks->PropCbk) lefData->lefrProp.setNumber($1); }
-
-layer_spacing_opts:
-  // empty 
-  | layer_spacing_opt layer_spacing_opts
-
-layer_spacing_opt: K_CENTERTOCENTER      // 5.7 
-    {
-      if (lefCallbacks->LayerCbk) {
-         if (lefData->hasSpCenter) {
-           if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1663, "A CENTERTOCENTER statement was already defined in SPACING\nCENTERTOCENTER can only be defined once per LAYER CUT SPACING.");
-              CHKERR();
-           }
-        }
-        lefData->hasSpCenter = 1;
-        if (lefData->versionNum < 5.6) {
-           if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "CENTERTOCENTER statement is a version 5.6 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1664, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setSpacingCenterToCenter();
-      }
-    }
-  | K_SAMENET             // 5.7 
-    {
-      if (lefCallbacks->LayerCbk) {
-        if (lefData->hasSpSamenet) {
-           if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefError(1665, "A SAMENET statement was already defined in SPACING\nSAMENET can only be defined once per LAYER CUT SPACING.");
-              CHKERR();
-           }
-        }
-        lefData->hasSpSamenet = 1;
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setSpacingSamenet();
-       }
-    }
-    opt_samenetPGonly
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "SAMENET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1684, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      }
-    }
-  | K_PARALLELOVERLAP    // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "PARALLELOVERLAP is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1680, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR(); 
-      } else {
-        if (lefCallbacks->LayerCbk) {
-          if (lefData->hasSpParallel) {
-             if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                lefError(1666, "A PARALLELOVERLAP statement was already defined in SPACING\nPARALLELOVERLAP can only be defined once per LAYER CUT SPACING.");
-                CHKERR();
-             }
-          }
-          lefData->hasSpParallel = 1;
-          if (lefCallbacks->LayerCbk)
-            lefData->lefrLayer.setSpacingParallelOverlap();
-        }
-      }
-    }
-
-layer_spacing_cut_routing:
-  // empty 
-  | K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    {
-      if (lefCallbacks->LayerCbk)
-{
-        if (lefData->versionNum < 5.7) {
-           if (lefData->hasSpSamenet) {    // 5.6 and earlier does not allow 
-              if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefError(1667, "A SAMENET statement was already defined in SPACING\nEither SAMENET or LAYER can be defined, but not both.");
-                 CHKERR();
-              }
-           }
-        }
-        lefData->lefrLayer.setSpacingName($3);
-      }
-    }
-    spacing_cut_layer_opt
-  | K_ADJACENTCUTS int_number K_WITHIN int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-        if (lefData->versionNum < 5.5) {
-           if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-              lefData->outMsg = (char*)lefMalloc(10000);
-              sprintf (lefData->outMsg,
-                 "ADJACENTCUTS statement is a version 5.5 and later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-              lefError(1668, lefData->outMsg);
-              lefFree(lefData->outMsg);
-              CHKERR();
-           }
-        }
-        if (lefData->versionNum < 5.7) {
-           if (lefData->hasSpSamenet) {    // 5.6 and earlier does not allow 
-              if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                 lefError(1669, "A SAMENET statement was already defined in SPACING\nEither SAMENET or ADJACENTCUTS can be defined, but not both.");
-                 CHKERR();
-              }
-           }
-        }
-        lefData->lefrLayer.setSpacingAdjacent((int)$2, $4);
-      }
-    }
-    opt_adjacentcuts_exceptsame
-  | K_AREA NUMBER        // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "AREA is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1693, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-        if (lefCallbacks->LayerCbk) {
-          if (lefData->versionNum < 5.7) {
-             if (lefData->hasSpSamenet) {    // 5.6 and earlier does not allow 
-                if (lefData->layerWarnings++ < lefSettings->LayerWarnings) {
-                   lefError(1670, "A SAMENET statement was already defined in SPACING\nEither SAMENET or AREA can be defined, but not both.");
-                   CHKERR();
-                }
-             }
-          }
-          lefData->lefrLayer.setSpacingArea($2);
-        }
-      }
-    }
-  | K_RANGE int_number int_number
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingRange($2, $3);
-    }
-    opt_range_second
-  | K_LENGTHTHRESHOLD int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-        lefData->lefrLayer.setSpacingLength($2);
-      }
-    }
-  | K_LENGTHTHRESHOLD int_number K_RANGE int_number int_number
-    {
-      if (lefCallbacks->LayerCbk) {
-        lefData->lefrLayer.setSpacingLength($2);
-        lefData->lefrLayer.setSpacingLengthRange($4, $5);
-      }
-    }
-  | K_ENDOFLINE int_number K_WITHIN int_number    // 5.7 
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingEol($2, $4);
-    }
-    opt_endofline
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "ENDOFLINE is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1681, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      }
-    }
-  | K_NOTCHLENGTH int_number      // 5.7 
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "NOTCHLENGTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1682, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setSpacingNotchLength($2);
-      }
-    }
-  | K_ENDOFNOTCHWIDTH int_number K_NOTCHSPACING int_number K_NOTCHLENGTH int_number //5.7
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "ENDOFNOTCHWIDTH is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1696, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setSpacingEndOfNotchWidth($2, $4, $6);
-      }
-    }
-
-spacing_cut_layer_opt:                      // 5.7 
-  // empty 
-    {}
-  | K_STACK
-    {
-      if (lefCallbacks->LayerCbk)
-        lefData->lefrLayer.setSpacingLayerStack();
-    }
-
-opt_adjacentcuts_exceptsame:                // 5.7 
-  // empty 
-    {}
-  | K_EXCEPTSAMEPGNET
-    {
-      if (lefData->versionNum < 5.7) {
-        lefData->outMsg = (char*)lefMalloc(10000);
-        sprintf(lefData->outMsg,
-          "EXCEPTSAMEPGNET is a version 5.7 or later syntax.\nYour lef file is defined with version %g.", lefData->versionNum);
-        lefError(1683, lefData->outMsg);
-        lefFree(lefData->outMsg);
-        CHKERR();
-      } else {
-        if (lefCallbacks->LayerCbk)
-          lefData->lefrLayer.setSpacingAdjacentExcept();
-      }
-    }
-
-opt_layer_name:
-  // empty 
-    { $$ = 0; }
-  | K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    { $$ = $3; }
-
-req_layer_name:
-  // pcr 355313 
-   K_LAYER {lefData->lefDumbMode = 1; lefData->lefNoNum = 1; } T_STRING
-    { $$ = $3; }
-
-// 9/11/2001 - Wanda da Rosa.  The following are obsolete in 5.4 
-universalnoisemargin: K_UNIVERSALNOISEMARGIN int_number int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->NoiseMarginCbk) {
-          lefData->lefrNoiseMargin.low = $2;
-          lefData->lefrNoiseMargin.high = $3;
-          CALLBACK(lefCallbacks->NoiseMarginCbk, lefrNoiseMarginCbkType, &lefData->lefrNoiseMargin);
-        }
-      } else
-        if (lefCallbacks->NoiseMarginCbk) // write warning only if cbk is set 
-          if (lefData->noiseMarginWarnings++ < lefSettings->NoiseMarginWarnings)
-            lefWarning(2070, "UNIVERSALNOISEMARGIN statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-edgeratethreshold1: K_EDGERATETHRESHOLD1 int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->EdgeRateThreshold1Cbk) {
-          CALLBACK(lefCallbacks->EdgeRateThreshold1Cbk,
-          lefrEdgeRateThreshold1CbkType, $2);
-        }
-      } else
-        if (lefCallbacks->EdgeRateThreshold1Cbk) // write warning only if cbk is set 
-          if (lefData->edgeRateThreshold1Warnings++ < lefSettings->EdgeRateThreshold1Warnings)
-            lefWarning(2071, "EDGERATETHRESHOLD1 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-edgeratethreshold2: K_EDGERATETHRESHOLD2 int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->EdgeRateThreshold2Cbk) {
-          CALLBACK(lefCallbacks->EdgeRateThreshold2Cbk,
-          lefrEdgeRateThreshold2CbkType, $2);
-        }
-      } else
-        if (lefCallbacks->EdgeRateThreshold2Cbk) // write warning only if cbk is set 
-          if (lefData->edgeRateThreshold2Warnings++ < lefSettings->EdgeRateThreshold2Warnings)
-            lefWarning(2072, "EDGERATETHRESHOLD2 statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-edgeratescalefactor: K_EDGERATESCALEFACTOR int_number ';'
-    {
-      if (lefData->versionNum < 5.4) {
-        if (lefCallbacks->EdgeRateScaleFactorCbk) {
-          CALLBACK(lefCallbacks->EdgeRateScaleFactorCbk,
-          lefrEdgeRateScaleFactorCbkType, $2);
-        }
-      } else
-        if (lefCallbacks->EdgeRateScaleFactorCbk) // write warning only if cbk is set 
-          if (lefData->edgeRateScaleFactorWarnings++ < lefSettings->EdgeRateScaleFactorWarnings)
-            lefWarning(2073, "EDGERATESCALEFACTOR statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-    }
-
-noisetable: K_NOISETABLE int_number
-    { if (lefCallbacks->NoiseTableCbk) lefData->lefrNoiseTable.setup((int)$2); }
-    ';' noise_table_list end_noisetable dtrm
-    { }
-
-end_noisetable:
-  K_END K_NOISETABLE
-  {
-    if (lefData->versionNum < 5.4) {
-      if (lefCallbacks->NoiseTableCbk)
-        CALLBACK(lefCallbacks->NoiseTableCbk, lefrNoiseTableCbkType, &lefData->lefrNoiseTable);
-    } else
-      if (lefCallbacks->NoiseTableCbk) // write warning only if cbk is set 
-        if (lefData->noiseTableWarnings++ < lefSettings->NoiseTableWarnings)
-          lefWarning(2074, "NOISETABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-  }
-
-
-noise_table_list :
-  noise_table_entry
-  | noise_table_list noise_table_entry
-  ;
-
-noise_table_entry:
-  K_EDGERATE int_number ';'
-    { if (lefCallbacks->NoiseTableCbk)
-         {
-            lefData->lefrNoiseTable.newEdge();
-            lefData->lefrNoiseTable.addEdge($2);
-         }
-    }
-  | output_resistance_entry
-    { }
-
-output_resistance_entry: K_OUTPUTRESISTANCE
-    { if (lefCallbacks->NoiseTableCbk) lefData->lefrNoiseTable.addResistance(); }
-    num_list ';' victim_list
-    ;
-
-num_list:
-  int_number
-    { if (lefCallbacks->NoiseTableCbk)
-    lefData->lefrNoiseTable.addResistanceNumber($1); }
-   | num_list int_number
-    { if (lefCallbacks->NoiseTableCbk)
-    lefData->lefrNoiseTable.addResistanceNumber($2); }
-
-victim_list:
-  victim
-  | victim_list victim
-  ;
-
-victim: K_VICTIMLENGTH int_number ';'
-        { if (lefCallbacks->NoiseTableCbk)
-        lefData->lefrNoiseTable.addVictimLength($2); }
-      K_VICTIMNOISE vnoiselist ';'
-        { }
-
-vnoiselist:
-  int_number
-    { if (lefCallbacks->NoiseTableCbk)
-    lefData->lefrNoiseTable.addVictimNoise($1); }
-  | vnoiselist int_number
-    { if (lefCallbacks->NoiseTableCbk)
-    lefData->lefrNoiseTable.addVictimNoise($2); }
-
-correctiontable: K_CORRECTIONTABLE int_number ';'
-    { if (lefCallbacks->CorrectionTableCbk)
-    lefData->lefrCorrectionTable.setup((int)$2); }
-    correction_table_list end_correctiontable dtrm
-    { }
-
-end_correctiontable:
-  K_END K_CORRECTIONTABLE
-  {
-    if (lefData->versionNum < 5.4) {
-      if (lefCallbacks->CorrectionTableCbk)
-        CALLBACK(lefCallbacks->CorrectionTableCbk, lefrCorrectionTableCbkType,
-               &lefData->lefrCorrectionTable);
-    } else
-      if (lefCallbacks->CorrectionTableCbk) // write warning only if cbk is set 
-        if (lefData->correctionTableWarnings++ < lefSettings->CorrectionTableWarnings)
-          lefWarning(2075, "CORRECTIONTABLE statement is obsolete in version 5.4 and later.\nThe LEF parser will ignore this statement.\nTo avoid this warning in the future, remove this statement from the LEF file with version 5.4 or later.");
-  }
-
-correction_table_list:
-  correction_table_item
-  | correction_table_list correction_table_item
-  ;
-
-correction_table_item:
-  K_EDGERATE int_number ';'
-    { if (lefCallbacks->CorrectionTableCbk)
-         {
-            lefData->lefrCorrectionTable.newEdge();
-            lefData->lefrCorrectionTable.addEdge($2);
-         }
-    }
-  | output_list
-    { }
-
-output_list: K_OUTPUTRESISTANCE
-  { if (lefCallbacks->CorrectionTableCbk)
-  lefData->lefrCorrectionTable.addResistance(); }
-  numo_list ';' corr_victim_list
-  { }
-
-numo_list:
-  int_number
-    { if (lefCallbacks->CorrectionTableCbk)
-    lefData->lefrCorrectionTable.addResistanceNumber($1); }
-  | numo_list int_number
-    { if (lefCallbacks->CorrectionTableCbk)
-    lefData->lefrCorrectionTable.addResistanceNumber($2); }
-
-corr_victim_list:
-   corr_victim
-   | corr_victim_list corr_victim
-   ;
-
-corr_victim:
-  K_VICTIMLENGTH int_number ';'
-     { if (lefCallbacks->CorrectionTableCbk)
-     lefData->lefrCorrectionTable.addVictimLength($2); }
-  K_CORRECTIONFACTOR corr_list ';'
-     { }
-
-corr_list:
-  int_number
-    { if (lefCallbacks->CorrectionTableCbk)
-        lefData->lefrCorrectionTable.addVictimCorrection($1); }
-  | corr_list int_number
-    { if (lefCallbacks->CorrectionTableCbk)
-        lefData->lefrCorrectionTable.addVictimCorrection($2); }
-
-// end of 5.4 obsolete syntax 
-
-input_antenna: K_INPUTPINANTENNASIZE int_number ';'
-    { // 5.3 syntax 
-        lefData->use5_3 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum > 5.3) {
-           // A 5.3 syntax in 5.4 
-           if (lefData->use5_4) {
-              if (lefCallbacks->InputAntennaCbk) { // write warning only if cbk is set 
-                if (lefData->inputAntennaWarnings++ < lefSettings->InputAntennaWarnings) {
-                   lefData->outMsg = (char*)lefMalloc(10000);
-                   sprintf (lefData->outMsg,
-                      "INPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INPUTPINANTENNASIZE syntax, which is incorrect.", lefData->versionNum);
-                   lefError(1671, lefData->outMsg);
-                   lefFree(lefData->outMsg);
-                   CHKERR();
-                }
-              }
-           }
-        }
-        if (lefCallbacks->InputAntennaCbk)
-          CALLBACK(lefCallbacks->InputAntennaCbk, lefrInputAntennaCbkType, $2);
-    }
-
-output_antenna: K_OUTPUTPINANTENNASIZE int_number ';'
-    { // 5.3 syntax 
-        lefData->use5_3 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum > 5.3) {
-           // A 5.3 syntax in 5.4 
-           if (lefData->use5_4) {
-              if (lefCallbacks->OutputAntennaCbk) { // write warning only if cbk is set 
-                if (lefData->outputAntennaWarnings++ < lefSettings->OutputAntennaWarnings) {
-                   lefData->outMsg = (char*)lefMalloc(10000);
-                   sprintf (lefData->outMsg,
-                      "OUTPUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new OUTPUTPINANTENNASIZE syntax, which is incorrect.", lefData->versionNum);
-                   lefError(1672, lefData->outMsg);
-                   lefFree(lefData->outMsg);
-                   CHKERR();
-                }
-              }
-           }
-        }
-        if (lefCallbacks->OutputAntennaCbk)
-          CALLBACK(lefCallbacks->OutputAntennaCbk, lefrOutputAntennaCbkType, $2);
-    }
-
-inout_antenna: K_INOUTPINANTENNASIZE int_number ';'
-    { // 5.3 syntax 
-        lefData->use5_3 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum > 5.3) {
-           // A 5.3 syntax in 5.4 
-           if (lefData->use5_4) {
-              if (lefCallbacks->InoutAntennaCbk) { // write warning only if cbk is set 
-                if (lefData->inoutAntennaWarnings++ < lefSettings->InoutAntennaWarnings) {
-                   lefData->outMsg = (char*)lefMalloc(10000);
-                   sprintf (lefData->outMsg,
-                      "INOUTPINANTENNASIZE statement is a version 5.3 or earlier syntax.\nYour lef file with version %g, has both old and new INOUTPINANTENNASIZE syntax, which is incorrect.", lefData->versionNum);
-                   lefError(1673, lefData->outMsg);
-                   lefFree(lefData->outMsg);
-                   CHKERR();
-                }
-              }
-           }
-        }
-        if (lefCallbacks->InoutAntennaCbk)
-          CALLBACK(lefCallbacks->InoutAntennaCbk, lefrInoutAntennaCbkType, $2);
-    }
-
-antenna_input: K_ANTENNAINPUTGATEAREA NUMBER ';'
-    { // 5.4 syntax 
-        // 11/12/2002 - this is obsolete in 5.5, suppose should be ingored 
-        // 12/16/2002 - talked to Dave Noice, leave them in here for debugging
-        lefData->use5_4 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum < 5.4) {
-           if (lefCallbacks->AntennaInputCbk) { // write warning only if cbk is set 
-             if (lefData->antennaInputWarnings++ < lefSettings->AntennaInputWarnings) {
-               lefData->outMsg = (char*)lefMalloc(10000);
-               sprintf (lefData->outMsg,
-                  "ANTENNAINPUTGATEAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number or use the 5.3 syntax.", lefData->versionNum);
-               lefError(1674, lefData->outMsg);
-               lefFree(lefData->outMsg);
-               CHKERR();
-             }
-           }
-        } else if (lefData->use5_3) {
-           if (lefCallbacks->AntennaInputCbk) { // write warning only if cbk is set 
-             if (lefData->antennaInputWarnings++ < lefSettings->AntennaInputWarnings) {
-                lefData->outMsg = (char*)lefMalloc(10000);
-                sprintf (lefData->outMsg,
-                   "ANTENNAINPUTGATEAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINPUTGATEAREA syntax, which is incorrect.", lefData->versionNum);
-                lefError(1675, lefData->outMsg);
-                lefFree(lefData->outMsg);
-               CHKERR();
-             }
-           }
-        }
-        if (lefCallbacks->AntennaInputCbk)
-          CALLBACK(lefCallbacks->AntennaInputCbk, lefrAntennaInputCbkType, $2);
-    }
-
-antenna_inout: K_ANTENNAINOUTDIFFAREA NUMBER ';'
-    { // 5.4 syntax 
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        // 12/16/2002 - talked to Dave Noice, leave them in here for debugging
-        lefData->use5_4 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum < 5.4) {
-           if (lefCallbacks->AntennaInoutCbk) { // write warning only if cbk is set 
-              if (lefData->antennaInoutWarnings++ < lefSettings->AntennaInoutWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAINOUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number or use the 5.3 syntax.", lefData->versionNum);
-                 lefError(1676, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        } else if (lefData->use5_3) {
-           if (lefCallbacks->AntennaInoutCbk) { // write warning only if cbk is set 
-              if (lefData->antennaInoutWarnings++ < lefSettings->AntennaInoutWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAINOUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAINOUTDIFFAREA syntax, which is incorrect.", lefData->versionNum);
-                 lefError(1677, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-        if (lefCallbacks->AntennaInoutCbk)
-          CALLBACK(lefCallbacks->AntennaInoutCbk, lefrAntennaInoutCbkType, $2);
-    }
-
-antenna_output: K_ANTENNAOUTPUTDIFFAREA NUMBER ';'
-    { // 5.4 syntax 
-        // 11/12/2002 - this is obsolete in 5.5, & will be ignored 
-        // 12/16/2002 - talked to Dave Noice, leave them in here for debugging
-        lefData->use5_4 = 1;
-        if (lefData->ignoreVersion) {
-           // do nothing 
-        } else if (lefData->versionNum < 5.4) {
-           if (lefCallbacks->AntennaOutputCbk) { // write warning only if cbk is set 
-              if (lefData->antennaOutputWarnings++ < lefSettings->AntennaOutputWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 and later syntax.\nYour lef file is defined with version %g.\nEither update your VERSION number or use the 5.3 syntax.", lefData->versionNum);
-                 lefError(1678, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        } else if (lefData->use5_3) {
-           if (lefCallbacks->AntennaOutputCbk) { // write warning only if cbk is set 
-              if (lefData->antennaOutputWarnings++ < lefSettings->AntennaOutputWarnings) {
-                 lefData->outMsg = (char*)lefMalloc(10000);
-                 sprintf (lefData->outMsg,
-                    "ANTENNAOUTPUTDIFFAREA statement is a version 5.4 or later syntax.\nYour lef file with version %g, has both old and new ANTENNAOUTPUTDIFFAREA syntax, which is incorrect.", lefData->versionNum);
-                 lefError(1679, lefData->outMsg);
-                 lefFree(lefData->outMsg);
-                 CHKERR();
-              }
-           }
-        }
-        if (lefCallbacks->AntennaOutputCbk)
-          CALLBACK(lefCallbacks->AntennaOutputCbk, lefrAntennaOutputCbkType, $2);
-    }
-
-extension_opt:  // empty 
-    | extension
-
-extension: K_BEGINEXT
-    { 
-        if (lefCallbacks->ExtensionCbk)
-          CALLBACK(lefCallbacks->ExtensionCbk, lefrExtensionCbkType, &lefData->Hist_text[0]);
-        if (lefData->versionNum >= 5.6)
-           lefData->ge56almostDone = 1;
-    }
-
-%%
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef_keywords.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef_keywords.cpp
deleted file mode 100644
index e990ecb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lef_keywords.cpp
+++ /dev/null
@@ -1,2108 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "lefiDefs.hpp"
-#include "lefiDebug.hpp"
-#include "lefrReader.hpp"
-#include "lefrData.hpp"
-#include "lefrCallBacks.hpp"
-#include "lefrSettings.hpp"
-#include "crypt.hpp"
-#include "lex.h"
-
-#ifdef WIN32
-#   include <direct.h>
-#else // not WIN32 
-#   include <unistd.h>
-#endif // WIN32
-
-#include "lefrData.hpp"
-
-using namespace std;
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#include "lef.tab.h"
-
-extern YYSTYPE lefyylval;
-
-
-inline string 
-strip_case(const char *str)
-{
-    string result(str);
-
-    if (lefData->namesCaseSensitive) {
-        return result;
-    };
-
-    for (string::iterator p = result.begin(); result.end() != p; ++p) {
-        *p = toupper(*p);
-    }
-
-    return result;
-}
-
-
-inline
-int lefGetKeyword(const char* name, int *result) 
-{ 
-    map<const char*, int, lefCompareCStrings>::iterator search = lefSettings->Keyword_set.find(name);
-    if ( search != lefSettings->Keyword_set.end()) {
-        *result = search->second;
-        return TRUE;
-    }
-
-    return FALSE;
-}
-
-
-inline int
-lefGetStringDefine(const char* name, const char** value)
-{
-    map<string, string, lefCompareStrings>::iterator search = lefData->defines_set.find(strip_case(name));
-
-    if ( search != lefData->defines_set.end()) {
-        *value = search->second.c_str();
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-inline int
-lefGetIntDefine(const char* name, int* value)
-{
-    map<string, int, lefCompareStrings>::iterator search = lefData->defineb_set.find(strip_case(name));
-
-    if ( search != lefData->defineb_set.end()) {
-        *value = search->second;
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-inline int
-lefGetDoubleDefine(const char* name, double* value)
-{
-    map<string, double, lefCompareStrings>::iterator search = lefData->define_set.find(strip_case(name));
-
-    if ( search != lefData->define_set.end()) {
-        *value = search->second;
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-inline int
-lefGetAlias(const char* name, const char** value)
-{
-    map<string, string, lefCompareStrings>::iterator search = lefData->alias_set.find(strip_case(name));
-
-    if ( search != lefData->alias_set.end()) {
-        *value = search->second.c_str();
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-#define yyparse    lefyyparse
-#define yylex    lefyylex
-#define yyerror    lefyyerror
-#define yylval    lefyylval
-#define yychar    lefyychar
-#define yydebug    lefyydebug
-#define yynerrs    lefyynerrs
-
-// lef.cpph starts here.
-
-// variable to count number of warnings 
-
-// 12/08/1999 -- Wanda da Rosa 
-// file pointer to the lefRWarning.log 
-
-extern char *lef_kywd(int num);
-
-// User defined if log file should be in append from the previous run 
-
-// User defined if property string value should be process 
-
-// Varible from lex.cpph to keep track of invalid nonEnglish character 
-// in lef file 
-
-void
-lefReloadBuffer()
-{
-    int nb;
-
-    nb = 0;
-
-    if (lefData->first_buffer) {
-        lefData->first_buffer = 0;
-        if (lefSettings->ReadFunction) {
-            if ((nb = (*lefSettings->ReadFunction)(lefData->lefrFile, lefData->current_buffer, 4)) != 4) {
-                lefData->next = NULL;
-                return;
-            }
-        } else {
-            if ((nb = fread(lefData->current_buffer, 1, 4, lefData->lefrFile)) != 4) {
-                lefData->next = NULL;
-                return;
-            }
-        }
-        lefData->encrypted = encIsEncrypted((unsigned char*) lefData->current_buffer);
-    }
-
-    if (lefData->encrypted) {
-        int i;
-        int c;
-
-        if (lefSettings->ReadEncrypted) {
-            // is encrypted file and user has set the enable flag to read one 
-            for (i = 0; i < IN_BUF_SIZE; i++) {
-                if ((c = encFgetc(lefData->lefrFile)) == EOF) {
-                    break;
-                }
-                lefData->current_buffer[i] = c;
-            }
-            nb = i;
-        } else {      // an encrypted file, but user does not allow to read one 
-            printf("File is an encrypted file, reader is not set to read one.\n");
-            return;
-        }
-    } else if (nb == 0) {
-        if (lefSettings->ReadFunction)
-            nb = (*lefSettings->ReadFunction)(lefData->lefrFile, lefData->current_buffer, IN_BUF_SIZE);
-        else
-            // This is a normal file so just read some bytes. 
-            nb = fread(lefData->current_buffer, 1, IN_BUF_SIZE, lefData->lefrFile);
-    }
-
-    if (nb <= 0) {
-        lefData->next = NULL;
-    } else {
-        lefData->next = lefData->current_buffer;
-        lefData->last = lefData->current_buffer + nb - 1;
-    }
-}
-
-int
-lefGetc()
-{
-    if (lefData->input_level >= 0) {        // Token has been getting from 
-        const char *ch, *s;
-        s = ch = lefData->current_stack[lefData->input_level];
-        lefData->current_stack[lefData->input_level] = ++s;
-        return *ch;
-    }
-
-    // Remove '\r' symbols from Windows streams.
-    for (;;) {
-        if (lefData->next > lefData->last)
-            lefReloadBuffer();
-        if (lefData->next == NULL)
-            return EOF;
-
-        int ch = *lefData->next++;
-
-        if (ch != '\r')
-            return ch;
-    }
-}
-
-void
-UNlefGetc(char ch)
-{
-    if ((lefData->next <= lefData->current_buffer) || (lefData->input_level > 0)) {
-        lefError(1111, "UNlefGetc: buffer access violation.");
-    } else {
-        *(--lefData->next) = ch;
-    }
-}
-
-
-// The following two variables are for communicating with the parser
-/* Return a copy of the string allocated from the lefData->ring buffer.
- * We will keep several strings in the buffer and just reuse them.
- * This could cause problems if we need to use more strings than we
- * have in the buffer.
- */
-static char *
-ringCopy(const char *string)
-{
-    int len = strlen(string) + 1;
-    if (++lefData->ringPlace >= RING_SIZE)
-        lefData->ringPlace = 0;
-    if (len > lefData->ringSizes[lefData->ringPlace]) {
-        lefData->ring[lefData->ringPlace] = (char*) lefRealloc(lefData->ring[lefData->ringPlace], len);
-        lefData->ringSizes[lefData->ringPlace] = len;
-    }
-    strcpy(lefData->ring[lefData->ringPlace], string);
-    return lefData->ring[lefData->ringPlace];
-}
-
-char *
-qStrCopy(char *string)
-{
-    int     len = strlen(string) + 3;
-    char    *retStr;
-
-    retStr = (char*) lefMalloc(len);
-    sprintf(retStr, "\"%s\"", string);
-    return retStr;
-}
-
-
-/* NOTE: we don't allocate these tables until they are used.  The reason
- * we don't allocate at the beginning of the program is that we don't know
- * at that point if we should be case sensitive or not. */
-
-void
-lefAddStringDefine(const char *token, const char *str)
-{    
-    string tmpStr((lefData->lefDefIf == TRUE) ? "" : "\"");
-
-    tmpStr += str;
-
-    lefData->defines_set[strip_case(token)] = tmpStr;
-    lefData->lefDefIf = FALSE;
-    lefData->inDefine = 0;
-}
-
-
-void
-lefAddBooleanDefine(const char  *token, int val)
-{
-    lefData->defineb_set[strip_case(token)] = val;
-}
-
-
-void
-lefAddNumDefine(const char  *token, double val)
-{
-    lefData->define_set[strip_case(token)] = val;
-}
-
-
-static int
-GetTokenFromStack(char *s)
-{
-    const char    *ch;                  // utility variable 
-    char          *prS = NULL;          // pointing to the previous char or s 
-    char          *save = s;            // for debug printing 
-
-    while (lefData->input_level >= 0) {
-        for (ch = lefData->current_stack[lefData->input_level]; *ch != 0; ch++)    // skip white space 
-            if (*ch != ' ' && *ch != '\t' && (lefData->lefNlToken || *ch != '\n'))
-                break;
-        // did we find anything?  If not, decrement level and try again 
-        if (*ch == 0)
-            lefData->input_level--;
-        else if (*ch == '\n') {
-            *s++ = *ch;
-            *s = 0;
-            if (lefData->lefDebug[11])
-                printf("Stack[%d] Newline token\n", lefData->input_level);
-            return TRUE;
-        } else {        // we found something 
-            for (; ; ch++) {
-                if (*ch == ' ' || *ch == '\t' || *ch == '\n' || *ch == 0) {
-                    /* 10/10/2000 - Wanda da Rosa, pcr 341032
-                    ** Take out the lefData->last '"', the 1st will be skip later
-                    */
-                    if (*prS == '"') {
-                        *prS = '\0';
-                    } else
-                        *s++ = '\0';
-                    lefData->current_stack[lefData->input_level] = ch;
-                    if (lefData->lefDebug[11])
-                        printf("Stack[%d]: <%s>, dm=%d\n",
-                               lefData->input_level, save, lefData->lefDumbMode);
-                    return TRUE;
-                }
-                /* 10/10/2000 - Wanda da Rosa, pcr 341032
-                ** Save the location of the previous s
-                */
-                prS = s;
-                *s++ = *ch;
-            }
-        }
-    }
-    return FALSE;        // if we get here, we ran out of input levels 
-}
-
-
-// Increment current position of buffer pointer. 
-// Double buffer size if curPos is out of boundary.
-static inline void  
-IncCurPos(char **curPos, char **buffer, int *bufferSize)
-{
-    (*curPos)++;
-    if (*curPos - *buffer < *bufferSize) {
-        return;
-    }
-
-    long offset = *curPos - *buffer;
-
-    *bufferSize *= 2;
-    *buffer = (char*) realloc(*buffer, *bufferSize);
-    *curPos = *buffer + offset;
-}
-
-
-inline static void 
-print_nlines(int lineNum)
-{
-    // call the callback line number function if it is set 
-    if (lefSettings->LineNumberFunction &&
-        (lineNum % lefSettings->DeltaNumberLines) == 0)
-        lefSettings->LineNumberFunction(lineNum);
-}
-
-
-static int
-GetToken(char **buffer, int *bufferSize)
-{
-    char *s = *buffer;
-    int ch;
-
-    lefData->lef_ntokens++;
-    lefData->lefInvalidChar = 0;
-
-    if (lefData->input_level >= 0) {            // if we are expanding an alias 
-        if (GetTokenFromStack(s))    // try to get a token from it 
-            return TRUE;                // if we get one, return it 
-    }                                 // but if not, continue 
-
-    // skip blanks and count lines 
-    while ((ch = lefGetc()) != EOF) {
-        // check if the file is encrypted and user allows to read 
-        if (lefData->encrypted && !lefSettings->ReadEncrypted)
-            ch = EOF;
-        if (ch == '\n') {
-            print_nlines(++lefData->lef_nlines);           
-        }
-        if (ch != ' ' && ch != '\t' && (lefData->lefNlToken || ch != '\n'))
-            break;
-    }
-
-    if (ch == EOF)
-        return FALSE;
-
-    if (ch == '\n') {
-        *s = ch;
-        IncCurPos(&s, buffer, bufferSize);
-
-        *s = '\0';
-        if (lefData->lefDebug[11])
-            printf("Newline token\n");
-        return TRUE;
-    }
-
-    // now get the token 
-    if (ch == '"') {
-        do {
-            /* 5/6/2008 - CCR 556818
-            ** Check if the ch is a valid ascii character 0 =< ch < 128
-            ** If not write out an error
-            */
-            /* 8/7/2008 - CCR 586175
-            ** Some files may not end with \n or \0 or EOF as the lefData->last character
-            ** The parser allows this char instead of error out
-            */
-            if ((ch < -1) || (ch > 127)) {
-                lefData->lefInvalidChar = 1;
-            }
-
-            /* 8/22/2000 - Wanda da Rosa, pcr 333334
-            ** save the previous char to allow backslash quote within quote
-            */
-            if (!lefSettings->DisPropStrProcess) {
-                // 3/4/2008 - CCR 523879 - convert \\ to \, \" to ", \x to x 
-                if (ch == '\\') {      // got a \, save the lefData->next char only 
-                    ch = lefGetc();
-
-                    if ((ch == '\n') || (ch == EOF)) {
-                        *s = '\0';
-                        lefError(6015, "Unexpected end of the LEF file.");
-                        lefData->hasFatalError = 1;
-                        return FALSE;
-                    }
-                }
-            }
-
-            // 5/5/2004 - pcr 704784
-            // If name, or quote string is longer than current buffer size 
-            // increase the buffer.                 
-            *s = ch;
-            IncCurPos(&s, buffer, bufferSize);
-
-            ch = lefGetc();
-
-            // 7/23/2003 - pcr 606558 - do not allow \n in a string instead 
-            // of ; 
-            if ((ch == '\n') ) {
-                print_nlines(++lefData->lef_nlines);
-                // 2/2/2007 - PCR 909714, allow string to go more than 1 line 
-                //            continue to parse 
-            }
-
-            if (ch == EOF) {
-                *s = '\0';
-                lefError(6015, "Unexpected end of the LEF file.");
-                lefData->hasFatalError = 1;
-                return FALSE;
-            }
-        } while (ch != '"');
-        *s = '\0';
-        /* 10/31/2006 - pcr 926068
-        ** When it reaches to here, chances are it reaches the end ".
-        ** Check if there is a space following the "
-        */
-        if (ch == '"') {
-            ch = lefGetc();
-            if (ch != ' ' && ch != EOF) {
-                UNlefGetc(ch);
-                lefData->spaceMissing = 1;
-                return FALSE;
-            }
-            UNlefGetc(ch);
-        }
-        return TRUE;
-    }
-
-    if (lefData->namesCaseSensitive) {
-        for (; ; ch = lefGetc()) {
-            /* 5/6/2008 - CCR 556818
-            ** Check if the ch is a valid ascii character 0 =< ch < 128
-            ** If not write out an error
-            */
-            if ((ch < -1) || (ch > 127)) {
-                lefData->lefInvalidChar = 1;
-            }
-
-            if (ch == ' ' || ch == '\t' || ch == '\n' || ch == EOF)
-                break;
-
-            *s = ch;
-            IncCurPos(&s, buffer, bufferSize);
-        }
-    } else if (lefSettings->ShiftCase) { // we are case insensitive, use a different loop 
-        for (; ; ch = lefGetc()) {
-            /* 5/6/2008 - CCR 556818
-            ** Check if the ch is a valid ascii character 0 =< ch < 128
-            ** If not write out an error
-            */
-            if ((ch < -1) || (ch > 127)) {
-                lefData->lefInvalidChar = 1;
-            }
-
-            if (ch == ' ' || ch == '\t' || ch == '\n' || ch == EOF)
-                break;
-                
-            *s = (ch >= 'a' && ch <= 'z')? (ch - 'a' + 'A') : ch;
-            IncCurPos(&s, buffer, bufferSize);
-        }
-    } else {
-        for (; ; ch = lefGetc()) {
-            /* 5/6/2008 - CCR 556818
-            ** Check if the ch is a valid ascii character 0 =< ch < 128
-            ** If not write out an error
-            */
-            if ((ch < -1) || (ch > 127)) {
-                lefData->lefInvalidChar = 1;
-            }
-
-            if (ch == ' ' || ch == '\t' || ch == '\n' || ch == EOF)
-                break;
-   
-            *s = ch;
-            IncCurPos(&s, buffer, bufferSize);
-        }
-    }
-
-    // If we got this far, the lefData->last char was whitespace 
-    *s = '\0';
-    if (ch != EOF)   // shouldn't ungetc an EOF 
-        UNlefGetc(ch);
-    return TRUE;
-}
-
-// creates an upper case copy of an array 
-void
-lefuc_array(char    *source,
-            char    *dest)
-{
-    for (; *source != 0; )
-        *dest++ = toupper(*source++);
-    *dest = 0;
-} 
-
-void lefError(int           msgNum,
-              const char    *s);
-
-void
-lefStoreAlias()
-{
-    string     so_far; // contains alias contents as we build it 
-
-    int tokenSize = 10240;
-    char *aname = (char*)malloc(tokenSize);
-
-    GetToken(&aname, &tokenSize);
-
-    char *line = (char*) malloc(tokenSize);
-
-    GetToken(&line, &tokenSize);     // should be "=" 
-    
-    char        *uc_line = (char*)malloc(tokenSize);
-
-    if (strcmp(line, "=") != 0)
-        lefError(1000, "Expecting '='");
-
-    /* now keep getting lines till we get one that contains &ENDALIAS */
-    for(char *p = NULL; p == NULL;){
-        int i;
-        char *s = line;
-        for(i=0;i<tokenSize-1;i++) {
-            int ch = lefGetc();
-            if (ch == EOF) {
-                lefError(1001, "End of file in &ALIAS");
-                return;
-            }
-
-            *s++ = ch;
-            
-            if (ch == '\n') {
-                print_nlines(++lefData->lef_nlines);             
-                break;
-            }
-        }
-
-        *s = '\0';
-        lefuc_array(line, uc_line);             // make upper case copy 
-        p = strstr(uc_line, "&ENDALIAS");       // look for END_ALIAS 
-        
-        if (p != NULL)                          // if we find it 
-            *(line + (p - uc_line)) = 0;         // remove it from the line 
-
-        so_far += line;
-    }
-
-    char *dup = (char*)malloc(strlen(so_far.c_str()) + 1);
-
-    strcpy(dup, so_far.c_str());
-    lefData->alias_set[strip_case(aname)] = dup;
-
-
-    free(aname);
-    free(line);
-    free(uc_line);
-}
-
-int lefamper_lookup(char *token); // forward reference to this routine 
-
-/* The main routine called by the YACC parser to get the lefData->next token.
- *    Returns 0 if no more tokens are available.
- *    Returns an integer for keywords (see the yacc_defines.h for values)
- *    Returns the character itself for punctuation
- *    Returns NUMBER for numeric looking tokens
- *    Returns T_STRING for anything else
- * If the global "lefData->lefDumbMode" is > 0, it reads the lefData->next token in "dumb mode".
- * In this case, it does not do keyword lookup, or attempt to read a token
- * as a number; if the token is not punctuation, it's a T_STRING.  Each token
- * read decrements lefData->lefDumbMode, so you can instruct the the lexer to read the
- * lefData->next N tokens in dumb mode by setting "lefData->lefDumbMode" to that value.
- *
- * Newlines are in general silently ignored.  If the global lefData->lefNlToken is
- * true, however, they are returned as the token K_NL.
- */
-extern int lefsublex();
-
-int
-yylex()
-{
-    int v = lefsublex();
-
-    if (lefData->lefDebug[13]) {
-        if (v == 0) {
-            printf("yylex NIL\n");
-        } else if (v < 256) {
-            printf("yylex char %c\n", v);
-        } else if (v == QSTRING) {
-            printf("yylex quoted string '%s'\n", yylval.string);
-        } else if (v == T_STRING) {
-            printf("yylex string '%s'\n", yylval.string);
-        } else if (v == NUMBER) {
-            printf("yylex number %f\n", yylval.dval);
-        } else {
-            printf("yylex keyword %s\n", lef_kywd(v));
-        }
-    }
-
-    // At 5.6, lefData->doneLib is always true, since "END LIBRARY" is optional 
-    if ((v == 0) && (!lefData->doneLib)) {
-        if (!lefData->spaceMissing) {
-            lefError(1002, "Incomplete lef file.");
-            lefData->hasFatalError = 1;
-        }
-
-        return (-1);
-    }
-
-    return v;
-}
-
-int
-lefsublex()
-{
-
-    char    fc;
-    double  numVal;
-    char    *outStr;
-
-    strcpy(lefData->pv_token, lefData->current_token);   // save the previous token 
-
-    /* First, we eat all the things the parser should be unaware of.
-     * This includes:
-     * a) Comments
-     * b) &alias definitions
-     * c) &alias expansions
-     */
-
-    for (; ; ) {
-        if (!GetToken(&lefData->current_token, &lefData->tokenSize))    // get a raw token 
-            return 0;
-
-        // Token size can change. Do preventive re-alloc. 
-        lefData->uc_token = (char*) realloc(lefData->uc_token, lefData->tokenSize);
-        lefData->pv_token = (char*) realloc(lefData->pv_token, lefData->tokenSize);
-
-        fc = lefData->current_token[0];
-
-        /* lefData->first, check for comments or &alias statements.  Comments we
-         * ignore, and &alias statements are eaten and recorded by the lexer.
-         */
-        if (fc == lefSettings->CommentChar) {
-            for (fc = lefGetc(); ; fc = lefGetc()) {// so skip to the end of line 
-                if (fc == EOF)
-                    return 0;
-                if (fc == '\n') {
-                    print_nlines(++lefData->lef_nlines);
-                    break;
-                }
-            }
-        } else if (fc == '&') {
-            // begins with &.  If &alias, read contents and 
-            // store them.  Otherwise it's a define, or a macro use. 
-            const char *cptr;
-            lefuc_array(lefData->current_token, lefData->uc_token);
-            if (strcmp(lefData->uc_token, "&ALIAS") == 0)
-                lefStoreAlias();    // read and store the alias 
-            else if (strncmp(lefData->uc_token, "&DEFINE", 7) == 0) {
-                lefData->inDefine = 1;       // it is a define statement 
-                break;
-            } else if (lefGetAlias(lefData->current_token, &cptr))
-                lefData->current_stack[++lefData->input_level] = cptr;
-            else if (lefGetStringDefine(lefData->current_token, &cptr) && !lefData->inDefine)
-                lefData->current_stack[++lefData->input_level] = cptr;
-            else
-                break;    // begins with &, but not an &alias defn. or use. 
-        } else
-            break;    // does not begin with CommentChar or '&' 
-    }
-
-    if (lefData->lefInvalidChar) {
-        outStr = (char*) lefMalloc(500 + strlen(lefData->current_token));
-        sprintf(outStr, "Invalid characters found in \'%s\'.\nThese characters might have created by character types other than English.",
-                lefData->current_token);
-        lefError(1008, outStr);
-        lefFree(outStr);
-        return 0;
-    }
-
-    if (lefData->ge56almostDone && (strcmp(lefData->current_token, "END") == 0)) {
-        // Library has BEGINEXT and also end with END LIBRARY 
-        // Use END LIBRARY to indicate the end of the library 
-        lefData->ge56almostDone = 0;
-    }
-
-    if ((lefData->doneLib && lefData->versionNum < 5.6) || // END LIBRARY is passed for pre 5.6 
-        (lefData->ge56almostDone && (strcmp(lefData->current_token, "END"))) || // after EXT, not 
-        // follow by END 
-        (lefData->ge56done)) {                     // END LIBRARY is passed for >= 5.6 
-        fc = EOF;
-        lefInfo(3000, "There are still data after the END LIBRARY");
-        return 0;
-    }
-
-    if (fc == '\"') {
-        yylval.string = ringCopy(&(lefData->current_token[1]));
-        return QSTRING;
-    }
-
-    // at this point we've read a token 
-    // printf("Token is %s\n", token); 
-    lefData->lefDumbMode--;
-    lefData->lefNoNum--;
-    if (isdigit(fc) || fc == '.' || (fc == '-' && lefData->current_token[1] != '\0')) {
-        char *ch;
-        numVal = yylval.dval = strtod(lefData->current_token, &ch);
-        if (lefData->lefNoNum < 0 && *ch == '\0') {    // did we use the whole string? 
-                return NUMBER;
-        } else {  // failed integer conversion, try floating point 
-                yylval.string = ringCopy(lefData->current_token);  // NO, it's a string 
-                return T_STRING;
-            }
-        }
-
-    // 5/17/2004 - Special checking for nondefaultrule 
-    if (lefData->lefNdRule && (strcmp(lefData->current_token, "END") != 0)) {
-        if (strcmp(lefData->current_token, lefData->ndName) == 0) {
-            yylval.string = ringCopy(lefData->current_token);  // a nd rule name 
-            return T_STRING;
-        } else {
-            // Can be NONDEFAULTRULE END without name, this case, string 
-            // should be a reserve word  or name is incorrect 
-            // lefData->first check if it is a reserve word 
-            lefData->lefDumbMode = -1;
-        }
-    }
-    // if we are dumb mode, all we return is punctuation and strings & numbers
-    // until we see the lefData->next '+' or ';' token 
-    if (lefData->lefDumbMode >= 0) {
-        if (lefData->current_token[1] == '\0' && (fc == '(' || fc == ')' || fc == '+' || fc == ';' || fc == '*')) {
-            if (fc == ';' || fc == '+')
-                lefData->lefDumbMode = 0;
-            return (int) fc;
-        }
-        if (lefData->lefNewIsKeyword && strcmp(lefData->current_token, "NEW") == 0) {
-            return K_NEW; // even in dumb mode, we must see the NEW token 
-        }
-        yylval.string = ringCopy(lefData->current_token);
-        // 5/17/2004 - Special checking for nondefaultrule 
-        if (lefData->lefNdRule) {
-            if (strcmp(lefData->current_token, lefData->ndName) == 0)
-                return T_STRING;
-            else {
-                // Can be NONDEFAULTRULE END without name, this case, string 
-                // should be a reserve word  or name is incorrect 
-                // lefData->first check if it is a reserve word 
-            }
-        }
-        return T_STRING;
-    }
-
-    // if we get here we are in smart mode.  Parse token 
-    if (isalpha(fc) || fc == '&' || fc == '_') {
-        int     result;
-        char    *ch, *uch;
-
-        for (ch = lefData->current_token, uch = lefData->uc_token; *ch != '\0'; ch++)
-            *uch++ = toupper(*ch);
-        *uch = '\0';
-
-        lefData->Hist_text.resize(0);
-
-        if (lefGetKeyword(lefData->uc_token, &result)) {
-            if (K_HISTORY == result) {  // history - get up to ';' 
-                int c;
-                int prev;
-                prev = ' ';
-                for (; ; ) {
-                    c = lefGetc();
-
-                    if (c == EOF) {
-                        lefError(6015, "Unexpected end of the LEF file.");
-                        lefData->hasFatalError = 1;
-                        break;
-                    }
-
-                    if (c == ';' &&
-                        (prev == ' ' || prev == '\t' || prev == '\n'))
-                        break;
-                    if (c == '\n') {
-                        // call the callback line number function if it is set 
-                        print_nlines(++lefData->lef_nlines);
-                    }
-                    prev = c;
-                    lefData->Hist_text.push_back(c);
-                }
-                lefData->Hist_text.push_back('\0');
-            } else if (K_BEGINEXT == result) { // extension, get up to end 
-                int cc;
-                int foundTag = 0;
-                int notEmpTag = 0;
-                int begQuote = 0;
-                // First make sure there is a name after BEGINEXT within quote 
-                // BEGINEXT "name" 
-                for (cc = lefGetc(); ; cc = lefGetc()) {
-                    if (cc == EOF)
-                        break;   // lef file may not have END LIB 
-                    if (cc == '\n') {
-                        if (!foundTag) {
-                            lefError(1003, "tag is missing for BEGINEXT");
-                            break;
-                        }
-                    } else {
-                        // Make sure the tag is quoted 
-                        lefData->Hist_text.push_back(cc);
-                        if (cc != ' ') {
-                            if (cc == '\"') {   // found a quote 
-                                if (!begQuote)
-                                    begQuote = 1;
-                                else if (notEmpTag) {
-                                    foundTag = 1;
-                                    break;      // Found the quoted tag 
-                                } else {
-                                    lefError(1004, "Tag for BEGINEXT is empty");
-                                    break;
-                                }
-                            } else if (!begQuote) {   // anything but a quote 
-                                lefError(1005, "\" is missing in tag");
-                                break;
-                            } else             // anything but a quote and there 
-                                notEmpTag = 1;   // is already a quote 
-                        }
-                    }
-                }
-                if (foundTag) {
-                    // We have handle with the tag, just read the rest until 
-                    // ENDEXT 
-                    begQuote = 0;
-                    for (cc = lefGetc(); ; cc = lefGetc()) {
-                        if (cc == EOF)
-                            break;   // lef file may not have END LIB 
-                        if (cc == '\n') {
-                            // call the callback line number function if it is set 
-                            print_nlines(++lefData->lef_nlines);
-                        } else if (cc == '\"') {
-                            if (!begQuote)
-                                begQuote = 1;
-                            else
-                                begQuote = 0;
-                        }
-                        lefData->Hist_text.push_back(cc);     
-                        int histTextSize = lefData->Hist_text.size();
-
-                        if (histTextSize >= 6 && memcmp(&lefData->Hist_text[histTextSize - 6 ], "ENDEXT", 6) == 0) { 
-                            if (begQuote)
-                                lefError(1006, "Ending \" is missing");
-                            break;
-                        } else if (histTextSize >= 11 && memcmp(&lefData->Hist_text[histTextSize - 11 ], "END LIBRARY", 11) == 0) {
-                            lefError(1007, "ENDEXT is missing");
-                            return 1;
-                        }
-                    }
-                }
-                lefData->Hist_text.push_back('\0');
-            }
-            return result;        // YES, return its value 
-        } else {  // we don't have a keyword.  
-            if (fc == '&')
-                return lefamper_lookup(lefData->current_token);
-            yylval.string = ringCopy(lefData->current_token);  // NO, it's a string 
-            return T_STRING;
-        }
-    } else {  // it should be a punctuation character 
-        if (lefData->current_token[1] != '\0') {
-            if (strcmp(lefData->current_token, ">=") == 0)
-                return K_GE;
-            if (strcmp(lefData->current_token, "<=") == 0)
-                return K_LE;
-            if (strcmp(lefData->current_token, "<>") == 0)
-                return K_NE;
-            if (lefData->current_token[0] == ';') { // we got ';TOKEN' which is not allowed by
-                //';' cannot be attached to other tokens.
-                lefError(1009, "Symbol ';' should be separated by space(s).");
-                return 0;
-                // strcpy(saved_token, &token[1]); // the standard syntax, but 
-                // stack[++lefData->input_level] = saved_token; // C3 and GE support. 
-            } else if (lefData->current_token[0] == '_') {// name starts with _, return as T_STRING 
-                yylval.string = ringCopy(lefData->current_token);
-                return T_STRING;
-            } else {
-                lefError(6016, "Odd punctuation found.");
-                lefData->hasFatalError = 1;
-                return 0;
-            }
-        } else if (strlen(lefData->current_token) > 2
-                   || strlen(lefData->current_token) == 0) {
-            lefError(6016, "Odd punctuation found.");
-            lefData->hasFatalError = 1;
-            return 0;
-        }
-        return (int) lefData->current_token[0];
-    }
-}
-
-/* We have found a token beginning with '&'.  If it has been previously
-   defined, substitute the definition.  Otherwise return it. */
-int
-lefamper_lookup(char *tkn)
-{
-    double        dptr;
-    int           result;
-    const char    *cptr;
-
-    // printf("Amper_lookup: %s\n", tkn); 
-
-    // &define returns a number 
-    if (lefGetDoubleDefine(tkn, &dptr)) {
-        yylval.dval = dptr;
-        return NUMBER;
-    }
-    // &defineb returns TRUE or FALSE, encoded as K_TRUE or K_FALSE 
-    if (lefGetIntDefine(tkn, &result))
-        return result;
-    // &defines returns a T_STRING 
-    if (lefGetStringDefine(tkn, &cptr)) {
-        if (lefGetKeyword(cptr, &result))
-            return result;
-        yylval.string = ringCopy(cptr);
-        return (cptr[0] == '\"' ? QSTRING : T_STRING);
-    }
-    // if none of the above, just return the token. 
-    yylval.string = ringCopy(tkn);
-    return T_STRING;
-}
-
-void
-lefError(int        msgNum,
-         const char *s)
-{
-    char        *str;
-    const char  *curToken = isgraph(lefData->current_token[0]) ? lefData->current_token
-                                                               : "<unprintable>";
-    const char  *pvToken = isgraph(lefData->pv_token[0]) ? lefData->pv_token
-                                                         : "<unprintable>";
-    int         len = strlen(curToken) - 1;
-    int         pvLen = strlen(pvToken) - 1;
-
-    if (lefData->hasFatalError) 
-        return;
-    if ((lefSettings->TotalMsgLimit > 0) && (lefData->lefErrMsgPrinted >= lefSettings->TotalMsgLimit))
-        return;
-    if (lefSettings->MsgLimit[msgNum] > 0) {
-        if (lefData->msgLimit[0][msgNum] >= lefSettings->MsgLimit[msgNum]) // over the limit 
-            return;
-        lefData->msgLimit[0][msgNum] = lefData->msgLimit[0][msgNum] + 1;
-    }
-
-    // PCR 690679, probably missing space before a ';' 
-    if (strcmp(s, "parse error") == 0) {
-        if ((len > 1) && (lefData->current_token[len] == ';')) {
-            str = (char*) lefMalloc(len + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s>, space is missing before <;>\n",
-                    msgNum, s, lefData->lefrFileName, lefData->lef_nlines, curToken);
-        } else if ((pvLen > 1) && (lefData->pv_token[pvLen] == ';')) {
-            str = (char*) lefMalloc(pvLen + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s>, space is missing before <;>\n",
-                    msgNum, s, lefData->lefrFileName, lefData->lef_nlines - 1, pvToken);
-        } else if ((lefData->current_token[0] == '"') && (lefData->spaceMissing)) {
-            // most likely space is missing after the end " 
-            str = (char*) lefMalloc(len + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s\">, space is missing between the closing \" of the string and ;.\n",
-                    1010, s, lefData->lefrFileName, lefData->lef_nlines, curToken);
-            lefData->spaceMissing = 0;
-        } else {
-            str = (char*) lefMalloc(len + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): Lef parser has encountered an error in file %s at line %d, on token %s.\nProblem can be syntax error on the lef file or an invalid parameter name.\nDouble check the syntax on the lef file with the LEFDEF Reference Manual.\n",
-                    msgNum, lefData->lefrFileName, lefData->lef_nlines, curToken);
-        }
-    } else if (strcmp(s, "syntax error") == 0) {  // linux machines 
-        if ((len > 1) && (lefData->current_token[len] == ';')) {
-            str = (char*) lefMalloc(len + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s>, space is missing before <;>\n",
-                    msgNum, s, lefData->lefrFileName, lefData->lef_nlines, curToken);
-        } else if ((pvLen > 1) && (lefData->pv_token[pvLen] == ';')) {
-            str = (char*) lefMalloc(pvLen + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s>, space is missing before <;>\n",
-                    msgNum, s, lefData->lefrFileName, lefData->lef_nlines - 1, pvToken);
-        } else if ((lefData->current_token[0] == '"') && (lefData->spaceMissing)) {
-            // most likely space is missing after the end " 
-            str = (char*) lefMalloc(len + strlen(s) + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): %s, see file %s at line %d\nLast token was <%s\">, space is missing between the closing \" of the string and ;.\n",
-                    1011, s, lefData->lefrFileName, lefData->lef_nlines, curToken);
-            lefData->spaceMissing = 0;
-        } else {
-            str = (char*) lefMalloc(len + strlen(lefData->lefrFileName) + 350);
-            sprintf(str, "ERROR (LEFPARS-%d): Lef parser has encountered an error in file %s at line %d, on token %s.\nProblem can be syntax error on the lef file or an invalid parameter name.\nDouble check the syntax on the lef file with the LEFDEF Reference Manual.\n",
-                    msgNum, lefData->lefrFileName, lefData->lef_nlines, curToken);
-        }
-    } else {
-        str = (char*) lefMalloc(len + strlen(s) + strlen(lefData->lefrFileName) + 350);
-        sprintf(str, "ERROR (LEFPARS-%d): %s Error in file %s at line %d, on token %s.\n",
-                msgNum, s, lefData->lefrFileName, lefData->lef_nlines, curToken);
-    }
-    fflush(stdout);
-    lefiError(1, msgNum, str);
-    free(str);
-    lefData->lefErrMsgPrinted++;
-    // Not really error, error numbers between 1300 & 1499, those errors 
-    // are not from lef.y or the parser 
-    if ((msgNum < 1300) || (msgNum > 1499))
-        lefData->lef_errors++;
-}
-
-// yyerror is called by bison.simple, 5 locations will call this function 
-void
-yyerror(const char *s)
-{
-
-    lefError(lefData->msgCnt++, s);
-}
-
-// All info starts with 3000 
-// All info within lefInfo starts with 3500 
-void
-lefInfo(int         msgNum,
-        const char  *s)
-{
-    int disableStatus = lefSettings->suppresMsg(msgNum);
-
-    if (disableStatus == 1) {
-        char msgStr[60];
-        sprintf(msgStr, "Message (LEFPARS-%d) has been suppressed from output.", msgNum);
-        lefWarning(2502, msgStr);
-        return;
-    } else if (disableStatus == 2) {
-        return;
-    }
-
-    if ((lefSettings->TotalMsgLimit > 0) && (lefData->lefInfoMsgPrinted >= lefSettings->TotalMsgLimit))
-        return;
-    if (lefSettings->MsgLimit[msgNum] > 0) {
-        if (lefData->msgLimit[0][msgNum] >= lefSettings->MsgLimit[msgNum]) { // over the limit 
-            char msgStr[100];
-            if (lefData->msgLimit[1][msgNum]) // already printed out warning 
-                return;
-            lefData->msgLimit[1][msgNum] = 1;
-            sprintf(msgStr,
-                    "Message (LEFPARS-%d) has exceeded the message display limit of %d",
-                    msgNum, lefSettings->MsgLimit[msgNum]);
-            lefWarning(2503, msgStr);
-            return;
-        }
-        lefData->msgLimit[0][msgNum] = lefData->msgLimit[0][msgNum] + 1;
-    }
-    lefData->lefInfoMsgPrinted++;
-
-    if (lefSettings->WarningLogFunction) {
-        char *str = (char*) lefMalloc(strlen(lefData->current_token) + strlen(s) + strlen(lefData->lefrFileName)
-                                      + 350);
-        sprintf(str, "INFO (LEFPARS-%d): %s See file %s at line %d.\n",
-                msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-        (*lefSettings->WarningLogFunction)(str);
-        free(str);
-    } else if (lefData->lefrLog) {
-        fprintf(lefData->lefrLog, "INFO (LEFPARS-%d): %s See file %s at line %d\n",
-                msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-    } else {
-        if (!lefData->hasOpenedLogFile) {
-            if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == 0) {
-                printf("WARNING (LEFPARS-3500): Unable to open the file lefRWarning.log in %s.\n",
-                       getcwd(NULL, 64));
-                printf("Info messages will not be printed.\n");
-            } else {
-                lefData->hasOpenedLogFile = 1;
-                fprintf(lefData->lefrLog, "Info from file: %s\n\n", lefData->lefrFileName);
-                fprintf(lefData->lefrLog, "INFO (LEFPARS-%d): %s See file %s at line %d\n",
-                        msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-            }
-        } else {
-            if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == 0) {
-                printf("WARNING (LEFPARS-3500): Unable to open the file lefRWarning.log in %s.\n",
-                       getcwd(NULL, 64));
-                printf("Info messages will not be printed.\n");
-            } else {
-                fprintf(lefData->lefrLog, "\nInfo from file: %s\n\n", lefData->lefrFileName);
-                fprintf(lefData->lefrLog, "INFO (LEFPARS-%d): %s See file %s at line %d\n",
-                        msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-            }
-        }
-    }
-}
-
-// All warning starts with 2000 
-// All warning within lefWarning starts with 2500 
-void
-lefWarning(int          msgNum,
-           const char   *s)
-{
-    if (lefSettings->dAllMsgs)   // all messages are suppressed 
-        return;
-
-    if ((msgNum != 2502) && (msgNum != 2503)) {
-        int disableStatus = lefSettings->suppresMsg(msgNum);
-
-        if (disableStatus == 1) {
-            char msgStr[60];
-            sprintf(msgStr, "Message (LEFPARS-%d) has been suppressed from output.", msgNum);
-            lefWarning(2502, msgStr);
-            return;
-        } else if (disableStatus == 2) {
-            return;
-        }        
-    }
-
-    if ((lefSettings->TotalMsgLimit > 0) && (lefData->lefWarnMsgPrinted >= lefSettings->TotalMsgLimit))
-        return;
-    if (lefSettings->MsgLimit[msgNum] > 0) {
-        if (lefData->msgLimit[0][msgNum] >= lefSettings->MsgLimit[msgNum]) { // over the limit 
-            char msgStr[100];
-            if (lefData->msgLimit[1][msgNum]) // already printed out warning 
-                return;
-            lefData->msgLimit[1][msgNum] = 1;
-            sprintf(msgStr,
-                    "Message (LEFPARS-%d) has exceeded the message display limit of %d",
-                    msgNum, lefSettings->MsgLimit[msgNum]);
-            lefWarning(2503, msgStr);
-            return;
-        }
-        lefData->msgLimit[0][msgNum] = lefData->msgLimit[0][msgNum] + 1;
-    }
-    lefData->lefWarnMsgPrinted++;
-
-    if (lefSettings->WarningLogFunction) {
-        char *str = (char*) lefMalloc(strlen(lefData->current_token) + strlen(s) + strlen(lefData->lefrFileName)
-                                      + 350);
-        sprintf(str, "WARNING (LEFPARS-%d): %s See file %s at line %d.\n",
-                msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-        (*lefSettings->WarningLogFunction)(str);
-        free(str);
-    } else if (lefData->lefrLog) {
-        fprintf(lefData->lefrLog, "WARNING (LEFPARS-%d): %s See file %s at line %d\n",
-                msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-    } else {
-        if (!lefData->hasOpenedLogFile) {
-            if ((lefData->lefrLog = fopen("lefRWarning.log", "w")) == 0) {
-                printf("WARNING (LEFPARS-2500): Unable to open the file lefRWarning.log in %s.\n",
-                       getcwd(NULL, 64));
-                printf("Warning messages will not be printed.\n");
-            } else {
-                lefData->hasOpenedLogFile = 1;
-                fprintf(lefData->lefrLog, "Warnings from file: %s\n\n", lefData->lefrFileName);
-                fprintf(lefData->lefrLog, "WARNING (LEFPARS-%d): %s See file %s at line %d\n",
-                        msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-            }
-        } else {
-            if ((lefData->lefrLog = fopen("lefRWarning.log", "a")) == 0) {
-                printf("WARNING (LEFPARS-2501): Unable to open the file lefRWarning.log in %s.\n",
-                       getcwd(NULL, 64));
-                printf("Warning messages will not be printed.\n");
-            } else {
-                fprintf(lefData->lefrLog, "\nWarnings from file: %s\n\n", lefData->lefrFileName);
-                fprintf(lefData->lefrLog, "WARNING (LEFPARS-%d): %s See file %s at line %d\n",
-                        msgNum, s, lefData->lefrFileName, lefData->lef_nlines);
-            }
-        }
-    }
-    lefData->lef_warnings++;
-}
-
-void *
-lefMalloc(size_t lef_size)
-{
-    void *mallocVar;
-
-    if (lefSettings->MallocFunction)
-        return (*lefSettings->MallocFunction)(lef_size);
-    else {
-        mallocVar = (void*) malloc(lef_size);
-        if (!mallocVar) {
-            fprintf(stderr, "ERROR (LEFPARS-1009): Not enough memory, stop parsing!\n");
-            exit(1);
-        }
-        return mallocVar;
-    }
-}
-
-void *
-lefRealloc(void *name,
-           size_t  lef_size)
-{
-    if (lefSettings->ReallocFunction)
-        return (*lefSettings->ReallocFunction)(name, lef_size);
-    else
-        return (void*) realloc(name, lef_size);
-}
-
-void
-lefFree(void *name)
-{
-    if (lefSettings->FreeFunction)
-        (*lefSettings->FreeFunction)(name);
-    else
-        free(name);
-}
-
-char *
-lefaddr(const char *in)
-{
-    return (char*) in;
-}
-
-void
-lefSetNonDefault(const char *nd_name)
-{
-    lefData->ndName = (char*)malloc(strlen(nd_name)+1);
-    strcpy(lefData->ndName, nd_name);
-}
-
-void
-lefUnsetNonDefault()
-{
-    lefData->lefNdRule = 0;
-    free(lefData->ndName);
-}
-
-char *
-lef_kywd(int num)
-{
-    char *a;
-    switch (num) {
-    case K_HISTORY:
-        a = lefaddr("HISTORY");
-        break;
-    case K_ABUT:
-        a = lefaddr("ABUT");
-        break;
-    case K_ABUTMENT:
-        a = lefaddr("ABUTMENT");
-        break;
-    case K_ACTIVE:
-        a = lefaddr("ACTIVE");
-        break;
-    case K_ANALOG:
-        a = lefaddr("ANALOG");
-        break;
-    case K_ANTENNAAREAFACTOR:
-        a = lefaddr("ANTENNAAREAFACTOR");
-        break;
-    case K_ANTENNALENGTHFACTOR:
-        a = lefaddr("ANTENNALENGTHFACTOR");
-        break;
-    case K_ARRAY:
-        a = lefaddr("ARRAY");
-        break;
-    case K_BLOCK:
-        a = lefaddr("BLOCK");
-        break;
-    case K_BOTTOMLEFT:
-        a = lefaddr("BOTTOMLEFT");
-        break;
-    case K_BOTTOMRIGHT:
-        a = lefaddr("BOTTOMRIGHT");
-        break;
-    case K_BUFFER:
-        a = lefaddr("BUFFER");
-        break;
-    case K_BY:
-        a = lefaddr("BY");
-        break;
-    case K_CAPACITANCE:
-        a = lefaddr("CAPACITANCE");
-        break;
-    case K_CAPMULTIPLIER:
-        a = lefaddr("CAPMULTIPLIER");
-        break;
-    case K_CLASS:
-        a = lefaddr("CLASS");
-        break;
-    case K_CLOCK:
-        a = lefaddr("CLOCK");
-        break;
-    case K_COLUMNMAJOR:
-        a = lefaddr("COLUMNMAJOR");
-        break;
-    case K_CORE:
-        a = lefaddr("CORE");
-        break;
-    case K_CORNER:
-        a = lefaddr("CORNER");
-        break;
-    case K_COVER:
-        a = lefaddr("COVER");
-        break;
-    case K_CPERSQDIST:
-        a = lefaddr("CPERSQDIST");
-        break;
-    case K_CURRENT:
-        a = lefaddr("CURRENT");
-        break;
-    case K_CURRENTDEN:
-        a = lefaddr("CURRENTDEN");
-        break;
-    case K_CURRENTSOURCE:
-        a = lefaddr("CURRENTSOURCE");
-        break;
-    case K_CUT:
-        a = lefaddr("CUT");
-        break;
-    case K_DEFAULT:
-        a = lefaddr("DEFAULT");
-        break;
-    case K_DATABASE:
-        a = lefaddr("DATABASE");
-        break;
-    case K_DIELECTRIC:
-        a = lefaddr("DIELECTRIC");
-        break;
-    case K_DIRECTION:
-        a = lefaddr("DIRECTION");
-        break;
-    case K_DO:
-        a = lefaddr("DO");
-        break;
-    case K_EDGECAPACITANCE:
-        a = lefaddr("EDGECAPACITANCE");
-        break;
-    case K_EEQ:
-        a = lefaddr("EEQ");
-        break;
-    case K_END:
-        a = lefaddr("END");
-        break;
-    case K_ENDCAP:
-        a = lefaddr("ENDCAP");
-        break;
-    case K_FALL:
-        a = lefaddr("FALL");
-        break;
-    case K_FALLCS:
-        a = lefaddr("FALLCS");
-        break;
-    case K_FALLT0:
-        a = lefaddr("FALLT0");
-        break;
-    case K_FALLSATT1:
-        a = lefaddr("FALLSATT1");
-        break;
-    case K_FALLRS:
-        a = lefaddr("FALLRS");
-        break;
-    case K_FALLSATCUR:
-        a = lefaddr("FALLSATCUR");
-        break;
-    case K_FALLTHRESH:
-        a = lefaddr("FALLTHRESH");
-        break;
-    case K_FEEDTHRU:
-        a = lefaddr("FEEDTHRU");
-        break;
-    case K_FIXED:
-        a = lefaddr("FIXED");
-        break;
-    case K_FOREIGN:
-        a = lefaddr("FOREIGN");
-        break;
-    case K_FROMPIN:
-        a = lefaddr("FROMPIN");
-        break;
-    case K_FUNCTION:
-        a = lefaddr("FUNCTION");
-        break;
-    case K_GENERATE:
-        a = lefaddr("GENERATE");
-        break;
-    case K_GENERATOR:
-        a = lefaddr("GENERATOR");
-        break;
-    case K_GROUND:
-        a = lefaddr("GROUND");
-        break;
-    case K_HEIGHT:
-        a = lefaddr("HEIGHT");
-        break;
-    case K_HORIZONTAL:
-        a = lefaddr("HORIZONTAL");
-        break;
-    case K_INOUT:
-        a = lefaddr("INOUT");
-        break;
-    case K_INPUT:
-        a = lefaddr("INPUT");
-        break;
-    case K_INPUTNOISEMARGIN:
-        a = lefaddr("INPUTNOISEMARGIN");
-        break;
-    case K_COMPONENTPIN:
-        a = lefaddr("COMPONENTPIN");
-        break;
-    case K_INTRINSIC:
-        a = lefaddr("INTRINSIC");
-        break;
-    case K_INVERT:
-        a = lefaddr("INVERT");
-        break;
-    case K_INVERTER:
-        a = lefaddr("INVERTER");
-        break;
-    case K_IRDROP:
-        a = lefaddr("IRDROP");
-        break;
-    case K_ITERATE:
-        a = lefaddr("ITERATE");
-        break;
-    case K_IV_TABLES:
-        a = lefaddr("IV_TABLES");
-        break;
-    case K_LAYER:
-        a = lefaddr("LAYER");
-        break;
-    case K_LEAKAGE:
-        a = lefaddr("LEAKAGE");
-        break;
-    case K_LEQ:
-        a = lefaddr("LEQ");
-        break;
-    case K_LIBRARY:
-        a = lefaddr("LIBRARY");
-        break;
-    case K_MACRO:
-        a = lefaddr("MACRO");
-        break;
-    case K_MATCH:
-        a = lefaddr("MATCH");
-        break;
-    case K_MAXDELAY:
-        a = lefaddr("MAXDELAY");
-        break;
-    case K_MAXLOAD:
-        a = lefaddr("MAXLOAD");
-        break;
-    case K_METALOVERHANG:
-        a = lefaddr("METALOVERHANG");
-        break;
-    case K_MILLIAMPS:
-        a = lefaddr("MILLIAMPS");
-        break;
-    case K_MILLIWATTS:
-        a = lefaddr("MILLIWATTS");
-        break;
-    case K_MINFEATURE:
-        a = lefaddr("MINFEATURE");
-        break;
-    case K_MUSTJOIN:
-        a = lefaddr("MUSTJOIN");
-        break;
-    case K_NAMEMAPSTRING:
-        a = lefaddr("NAMEMAPSTRING");
-        break;
-    case K_NAMESCASESENSITIVE:
-        a = lefaddr("NAMESCASESENSITIVE");
-        break;
-    case K_NANOSECONDS:
-        a = lefaddr("NANOSECONDS");
-        break;
-    case K_NETS:
-        a = lefaddr("NETS");
-        break;
-    case K_NEW:
-        a = lefaddr("NEW");
-        break;
-    case K_NONDEFAULTRULE:
-        a = lefaddr("NONDEFAULTRULE");
-        break;
-    case K_NONINVERT:
-        a = lefaddr("NONINVERT");
-        break;
-    case K_NONUNATE:
-        a = lefaddr("NONUNATE");
-        break;
-    case K_NOWIREEXTENSIONATPIN:
-        a = lefaddr("NOWIREEXTENSIONATPIN");
-        break;
-    case K_OBS:
-        a = lefaddr("OBS");
-        break;
-    case K_OHMS:
-        a = lefaddr("OHMS");
-        break;
-    case K_OFFSET:
-        a = lefaddr("OFFSET");
-        break;
-    case K_ORIENTATION:
-        a = lefaddr("ORIENTATION");
-        break;
-    case K_ORIGIN:
-        a = lefaddr("ORIGIN");
-        break;
-    case K_OUTPUT:
-        a = lefaddr("OUTPUT");
-        break;
-    case K_OUTPUTNOISEMARGIN:
-        a = lefaddr("OUTPUTNOISEMARGIN");
-        break;
-    case K_OUTPUTRESISTANCE:
-        a = lefaddr("OUTPUTRESISTANCE");
-        break;
-    case K_OVERHANG:
-        a = lefaddr("OVERHANG");
-        break;
-    case K_OVERLAP:
-        a = lefaddr("OVERLAP");
-        break;
-    case K_OFF:
-        a = lefaddr("OFF");
-        break;
-    case K_ON:
-        a = lefaddr("ON");
-        break;
-    case K_OVERLAPS:
-        a = lefaddr("OVERLAPS");
-        break;
-    case K_PAD:
-        a = lefaddr("PAD");
-        break;
-    case K_PATH:
-        a = lefaddr("PATH");
-        break;
-    case K_PATTERN:
-        a = lefaddr("PATTERN");
-        break;
-    case K_PICOFARADS:
-        a = lefaddr("PICOFARADS");
-        break;
-    case K_PIN:
-        a = lefaddr("PIN");
-        break;
-    case K_PITCH:
-        a = lefaddr("PITCH");
-        break;
-    case K_PLACED:
-        a = lefaddr("PLACED");
-        break;
-    case K_POLYGON:
-        a = lefaddr("POLYGON");
-        break;
-    case K_PORT:
-        a = lefaddr("PORT");
-        break;
-    case K_POST:
-        a = lefaddr("POST");
-        break;
-    case K_POWER:
-        a = lefaddr("POWER");
-        break;
-    case K_PRE:
-        a = lefaddr("PRE");
-        break;
-    case K_PULLDOWNRES:
-        a = lefaddr("PULLDOWNRES");
-        break;
-    case K_PWL:
-        a = lefaddr("PWL");
-        break;
-    case K_RECT:
-        a = lefaddr("RECT");
-        break;
-    case K_RESISTANCE:
-        a = lefaddr("RESISTANCE");
-        break;
-    case K_RESISTIVE:
-        a = lefaddr("RESISTIVE");
-        break;
-    case K_RING:
-        a = lefaddr("RING");
-        break;
-    case K_RISE:
-        a = lefaddr("RISE");
-        break;
-    case K_RISECS:
-        a = lefaddr("RISECS");
-        break;
-    case K_RISERS:
-        a = lefaddr("RISERS");
-        break;
-    case K_RISESATCUR:
-        a = lefaddr("RISESATCUR");
-        break;
-    case K_RISETHRESH:
-        a = lefaddr("RISETHRESH");
-        break;
-    case K_RISESATT1:
-        a = lefaddr("RISESATT1");
-        break;
-    case K_RISET0:
-        a = lefaddr("RISET0");
-        break;
-    case K_RISEVOLTAGETHRESHOLD:
-        a = lefaddr("RISEVOLTAGETHRESHOLD");
-        break;
-    case K_FALLVOLTAGETHRESHOLD:
-        a = lefaddr("FALLVOLTAGETHRESHOLD");
-        break;
-    case K_ROUTING:
-        a = lefaddr("ROUTING");
-        break;
-    case K_ROWMAJOR:
-        a = lefaddr("ROWMAJOR");
-        break;
-    case K_RPERSQ:
-        a = lefaddr("RPERSQ");
-        break;
-    case K_SAMENET:
-        a = lefaddr("SAMENET");
-        break;
-    case K_SCANUSE:
-        a = lefaddr("SCANUSE");
-        break;
-    case K_SHAPE:
-        a = lefaddr("SHAPE");
-        break;
-    case K_SHRINKAGE:
-        a = lefaddr("SHRINKAGE");
-        break;
-    case K_SIGNAL:
-        a = lefaddr("SIGNAL");
-        break;
-    case K_SITE:
-        a = lefaddr("SITE");
-        break;
-    case K_SIZE:
-        a = lefaddr("SIZE");
-        break;
-    case K_SOURCE:
-        a = lefaddr("SOURCE");
-        break;
-    case K_SPACER:
-        a = lefaddr("SPACER");
-        break;
-    case K_SPACING:
-        a = lefaddr("SPACING");
-        break;
-    case K_SPECIALNETS:
-        a = lefaddr("SPECIALNETS");
-        break;
-    case K_STACK:
-        a = lefaddr("STACK");
-        break;
-    case K_START:
-        a = lefaddr("START");
-        break;
-    case K_STEP:
-        a = lefaddr("STEP");
-        break;
-    case K_STOP:
-        a = lefaddr("STOP");
-        break;
-    case K_STRUCTURE:
-        a = lefaddr("STRUCTURE");
-        break;
-    case K_SYMMETRY:
-        a = lefaddr("SYMMETRY");
-        break;
-    case K_TABLE:
-        a = lefaddr("TABLE");
-        break;
-    case K_THICKNESS:
-        a = lefaddr("THICKNESS");
-        break;
-    case K_TIEHIGH:
-        a = lefaddr("TIEHIGH");
-        break;
-    case K_TIELOW:
-        a = lefaddr("TIELOW");
-        break;
-    case K_TIEOFFR:
-        a = lefaddr("TIEOFFR");
-        break;
-    case K_TIME:
-        a = lefaddr("TIME");
-        break;
-    case K_TIMING:
-        a = lefaddr("TIMING");
-        break;
-    case K_TO:
-        a = lefaddr("TO");
-        break;
-    case K_TOPIN:
-        a = lefaddr("TOPIN");
-        break;
-    case K_TOPLEFT:
-        a = lefaddr("TOPLEFT");
-        break;
-    case K_TOPRIGHT:
-        a = lefaddr("TOPRIGHT");
-        break;
-    case K_TOPOFSTACKONLY:
-        a = lefaddr("TOPOFSTACKONLY");
-        break;
-    case K_TRISTATE:
-        a = lefaddr("TRISTATE");
-        break;
-    case K_TYPE:
-        a = lefaddr("TYPE");
-        break;
-    case K_UNATENESS:
-        a = lefaddr("UNATENESS");
-        break;
-    case K_UNITS:
-        a = lefaddr("UNITS");
-        break;
-    case K_USE:
-        a = lefaddr("USE");
-        break;
-    case K_VARIABLE:
-        a = lefaddr("VARIABLE");
-        break;
-    case K_VERTICAL:
-        a = lefaddr("VERTICAL");
-        break;
-    case K_VHI:
-        a = lefaddr("VHI");
-        break;
-    case K_VIA:
-        a = lefaddr("VIA");
-        break;
-    case K_VIARULE:
-        a = lefaddr("VIARULE");
-        break;
-    case K_VLO:
-        a = lefaddr("VLO");
-        break;
-    case K_VOLTAGE:
-        a = lefaddr("VOLTAGE");
-        break;
-    case K_VOLTS:
-        a = lefaddr("VOLTS");
-        break;
-    case K_WIDTH:
-        a = lefaddr("WIDTH");
-        break;
-    case K_WIREEXTENSION:
-        a = lefaddr("WIREEXTENSION");
-        break;
-    case K_X:
-        a = lefaddr("X");
-        break;
-    case K_Y:
-        a = lefaddr("Y");
-        break;
-    case K_R90:
-        a = lefaddr("R90");
-        break;
-    case T_STRING:
-        a = lefaddr("T_STRING");
-        break;
-    case QSTRING:
-        a = lefaddr("QSTRING");
-        break;
-    case NUMBER:
-        a = lefaddr("NUMBER");
-        break;
-    case K_N:
-        a = lefaddr("N");
-        break;
-    case K_S:
-        a = lefaddr("S");
-        break;
-    case K_E:
-        a = lefaddr("E");
-        break;
-    case K_W:
-        a = lefaddr("W");
-        break;
-    case K_FN:
-        a = lefaddr("FN");
-        break;
-    case K_FS:
-        a = lefaddr("FS");
-        break;
-    case K_FE:
-        a = lefaddr("FE");
-        break;
-    case K_FW:
-        a = lefaddr("FW");
-        break;
-    case K_USER:
-        a = lefaddr("USER");
-        break;
-    case K_MASTERSLICE:
-        a = lefaddr("MASTERSLICE");
-        break;
-    case K_ENDMACRO:
-        a = lefaddr("ENDMACRO");
-        break;
-    case K_ENDMACROPIN:
-        a = lefaddr("ENDMACROPIN");
-        break;
-    case K_ENDVIARULE:
-        a = lefaddr("ENDVIARULE");
-        break;
-    case K_ENDVIA:
-        a = lefaddr("ENDVIA");
-        break;
-    case K_ENDLAYER:
-        a = lefaddr("ENDLAYER");
-        break;
-    case K_ENDSITE:
-        a = lefaddr("ENDSITE");
-        break;
-    case K_CANPLACE:
-        a = lefaddr("CANPLACE");
-        break;
-    case K_CANNOTOCCUPY:
-        a = lefaddr("CANNOTOCCUPY");
-        break;
-    case K_TRACKS:
-        a = lefaddr("TRACKS");
-        break;
-    case K_FLOORPLAN:
-        a = lefaddr("FLOORPLAN");
-        break;
-    case K_GCELLGRID:
-        a = lefaddr("GCELLGRID");
-        break;
-    case K_DEFAULTCAP:
-        a = lefaddr("DEFAULTCAP");
-        break;
-    case K_MINPINS:
-        a = lefaddr("MINPINS");
-        break;
-    case K_WIRECAP:
-        a = lefaddr("WIRECAP");
-        break;
-    case K_STABLE:
-        a = lefaddr("STABLE");
-        break;
-    case K_SETUP:
-        a = lefaddr("SETUP");
-        break;
-    case K_HOLD:
-        a = lefaddr("HOLD");
-        break;
-    case K_DEFINE:
-        a = lefaddr("DEFINE");
-        break;
-    case K_DEFINES:
-        a = lefaddr("DEFINES");
-        break;
-    case K_DEFINEB:
-        a = lefaddr("DEFINEB");
-        break;
-    case K_IF:
-        a = lefaddr("IF");
-        break;
-    case K_THEN:
-        a = lefaddr("THEN");
-        break;
-    case K_ELSE:
-        a = lefaddr("ELSE");
-        break;
-    case K_FALSE:
-        a = lefaddr("FALSE");
-        break;
-    case K_TRUE:
-        a = lefaddr("TRUE");
-        break;
-    case K_EQ:
-        a = lefaddr("EQ");
-        break;
-    case K_NE:
-        a = lefaddr("NE");
-        break;
-    case K_LE:
-        a = lefaddr("LE");
-        break;
-    case K_LT:
-        a = lefaddr("LT");
-        break;
-    case K_GE:
-        a = lefaddr("GE");
-        break;
-    case K_GT:
-        a = lefaddr("GT");
-        break;
-    case K_OR:
-        a = lefaddr("OR");
-        break;
-    case K_AND:
-        a = lefaddr("AND");
-        break;
-    case K_NOT:
-        a = lefaddr("NOT");
-        break;
-    case K_DELAY:
-        a = lefaddr("DELAY");
-        break;
-    case K_TABLEDIMENSION:
-        a = lefaddr("TABLEDIMENSION");
-        break;
-    case K_TABLEAXIS:
-        a = lefaddr("TABLEAXIS");
-        break;
-    case K_TABLEENTRIES:
-        a = lefaddr("TABLEENTRIES");
-        break;
-    case K_TRANSITIONTIME:
-        a = lefaddr("TRANSITIONTIME");
-        break;
-    case K_EXTENSION:
-        a = lefaddr("EXTENSION");
-        break;
-    case K_PROPDEF:
-        a = lefaddr("PROPDEF");
-        break;
-    case K_STRING:
-        a = lefaddr("STRING");
-        break;
-    case K_INTEGER:
-        a = lefaddr("INTEGER");
-        break;
-    case K_REAL:
-        a = lefaddr("REAL");
-        break;
-    case K_RANGE:
-        a = lefaddr("RANGE");
-        break;
-    case K_PROPERTY:
-        a = lefaddr("PROPERTY");
-        break;
-    case K_VIRTUAL:
-        a = lefaddr("VIRTUAL");
-        break;
-    case K_BUSBITCHARS:
-        a = lefaddr("BUSBITCHARS");
-        break;
-    case K_VERSION:
-        a = lefaddr("VERSION");
-        break;
-    case K_BEGINEXT:
-        a = lefaddr("BEGINEXT");
-        break;
-    case K_ENDEXT:
-        a = lefaddr("ENDEXT");
-        break;
-    case K_UNIVERSALNOISEMARGIN:
-        a = lefaddr("UNIVERSALNOISEMARGIN");
-        break;
-    case K_EDGERATETHRESHOLD1:
-        a = lefaddr("EDGERATETHRESHOLD1");
-        break;
-    case K_CORRECTIONTABLE:
-        a = lefaddr("CORRECTIONTABLE");
-        break;
-    case K_EDGERATESCALEFACTOR:
-        a = lefaddr("EDGERATESCALEFACTOR");
-        break;
-    case K_EDGERATETHRESHOLD2:
-        a = lefaddr("EDGERATETHRESHOLD2");
-        break;
-    case K_VICTIMNOISE:
-        a = lefaddr("VICTIMNOISE");
-        break;
-    case K_NOISETABLE:
-        a = lefaddr("NOISETABLE");
-        break;
-    case K_EDGERATE:
-        a = lefaddr("EDGERATE");
-        break;
-    case K_VICTIMLENGTH:
-        a = lefaddr("VICTIMLENGTH");
-        break;
-    case K_CORRECTIONFACTOR:
-        a = lefaddr("CORRECTIONFACTOR");
-        break;
-    case K_OUTPUTPINANTENNASIZE:
-        a = lefaddr("OUTPUTPINANTENNASIZE");
-        break;
-    case K_INPUTPINANTENNASIZE:
-        a = lefaddr("INPUTPINANTENNASIZE");
-        break;
-    case K_INOUTPINANTENNASIZE:
-        a = lefaddr("INOUTPINANTENNASIZE");
-        break;
-    case K_TAPERRULE:
-        a = lefaddr("TAPERRULE");
-        break;
-    case K_DIVIDERCHAR:
-        a = lefaddr("DIVIDERCHAR");
-        break;
-    case K_ANTENNASIZE:
-        a = lefaddr("ANTENNASIZE");
-        break;
-    case K_ANTENNAMETALAREA:
-        a = lefaddr("ANTENNAMETALAREA");
-        break;
-    case K_ANTENNAMETALLENGTH:
-        a = lefaddr("ANTENNAMETALLENGTH");
-        break;
-    case K_RISESLEWLIMIT:
-        a = lefaddr("RISESLEWLIMIT");
-        break;
-    case K_FALLSLEWLIMIT:
-        a = lefaddr("FALLSLEWLIMIT");
-        break;
-    case K_MESSAGE:
-        a = lefaddr("MESSAGE");
-        break;
-    case K_CREATEFILE:
-        a = lefaddr("CREATEFILE");
-        break;
-    case K_OPENFILE:
-        a = lefaddr("OPENFILE");
-        break;
-    case K_CLOSEFILE:
-        a = lefaddr("CLOSEFILE");
-        break;
-    case K_WARNING:
-        a = lefaddr("WARNING");
-        break;
-    case K_ERROR:
-        a = lefaddr("ERROR");
-        break;
-    case K_FATALERROR:
-        a = lefaddr("FATALERROR");
-        break;
-    case IF:
-        a = lefaddr("IF");
-        break;
-    case LNOT:
-        a = lefaddr("LNOT");
-        break;
-    case UMINUS:
-        a = lefaddr("UMINUS");
-        break;
-
-    default:
-        a = lefaddr("bogus");
-    }
-    return a;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.cpp
deleted file mode 100644
index 9316654..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.cpp
+++ /dev/null
@@ -1,675 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiArray.hpp"
-#include "lefiMisc.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-// *****************************************************************************
-// lefiArrayFloorPlan
-// *****************************************************************************
-
-void
-lefiArrayFloorPlan::Init(const char *name)
-{
-    int len = strlen(name) + 1;
-    name_ = (char*) lefMalloc(len);
-    strcpy(name_, CASE(name));
-    numPatterns_ = 0;
-    patternsAllocated_ = 2;
-    types_ = (char**) lefMalloc(sizeof(char*) * 2);
-    patterns_ = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) * 2);
-}
-
-void
-lefiArrayFloorPlan::Destroy()
-{
-    lefiSitePattern *s;
-    int             i;
-    for (i = 0; i < numPatterns_; i++) {
-        s = patterns_[i];
-        s->Destroy();
-        lefFree((char*) s);
-        lefFree((char*) (types_[i]));
-    }
-    lefFree((char*) (types_));
-    lefFree((char*) (patterns_));
-    lefFree(name_);
-}
-
-void
-lefiArrayFloorPlan::addSitePattern(const char       *typ,
-                                   lefiSitePattern  *s)
-{
-    int len = strlen(typ) + 1;
-    if (numPatterns_ == patternsAllocated_) {
-        int             i;
-        int             lim;
-        char            **nc;
-        lefiSitePattern **np;
-
-        if (patternsAllocated_ == 0)
-            lim = patternsAllocated_ = 2;
-        else
-            lim = patternsAllocated_ = patternsAllocated_ * 2;
-        nc = (char**) lefMalloc(sizeof(char*) * lim);
-        np = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) * lim);
-        lim /= 2;
-        for (i = 0; i < lim; i++) {
-            nc[i] = types_[i];
-            np[i] = patterns_[i];
-        }
-        lefFree((char*) (types_));
-        lefFree((char*) (patterns_));
-        types_ = nc;
-        patterns_ = np;
-    }
-    types_[numPatterns_] = (char*) lefMalloc(len);
-    strcpy(types_[numPatterns_], typ);
-    patterns_[numPatterns_] = s;
-    numPatterns_ += 1;
-}
-
-int
-lefiArrayFloorPlan::numPatterns() const
-{
-    return numPatterns_;
-}
-
-lefiSitePattern *
-lefiArrayFloorPlan::pattern(int index) const
-{
-    return patterns_[index];
-}
-
-char *
-lefiArrayFloorPlan::typ(int index) const
-{
-    return types_[index];
-}
-
-const char *
-lefiArrayFloorPlan::name() const
-{
-    return name_;
-}
-
-// *****************************************************************************
-// lefiArray
-// *****************************************************************************
-lefiArray::lefiArray()
-: nameSize_(0),
-  name_(NULL),
-  patternsAllocated_(0),
-  numPatterns_(0),
-  pattern_(NULL),
-  canAllocated_(0),
-  numCan_(0),
-  canPlace_(NULL),
-  cannotAllocated_(0),
-  numCannot_(0),
-  cannotOccupy_(NULL),
-  tracksAllocated_(0),
-  numTracks_(0),
-  track_(NULL),
-  gAllocated_(0),
-  numG_(0),
-  gcell_(NULL),
-  hasDefault_(0),
-  tableSize_(0),
-  numDefault_(0),
-  defaultAllocated_(0),
-  minPins_(NULL),
-  caps_(NULL),
-  numFloorPlans_(0),
-  floorPlansAllocated_(0),
-  floors_(0)
-{
-    Init();
-}
-
-void
-lefiArray::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-
-    numPatterns_ = 0;
-    patternsAllocated_ = 0;
-    bump((void***) (&(pattern_)), numPatterns_, &(patternsAllocated_));
-
-    numCan_ = 0;
-    canAllocated_ = 0;
-    bump((void***) (&(canPlace_)), numCan_, &(canAllocated_));
-
-    numCannot_ = 0;
-    cannotAllocated_ = 0;
-    bump((void***) (&(cannotOccupy_)), numCannot_, &(cannotAllocated_));
-
-    numTracks_ = 0;
-    tracksAllocated_ = 0;
-    bump((void***) (&(track_)), numTracks_, &(tracksAllocated_));
-
-    numG_ = 0;
-    gAllocated_ = 0;
-    bump((void***) (&(gcell_)), numG_, &(gAllocated_));
-
-    numDefault_ = 0;
-    defaultAllocated_ = 4;
-    minPins_ = (int*) lefMalloc(sizeof(int) * 4);
-    caps_ = (double*) lefMalloc(sizeof(double) * 4);
-
-    floorPlansAllocated_ = 0;
-    numFloorPlans_ = 0;
-    bump((void***) (&(floors_)), numFloorPlans_,
-         &(floorPlansAllocated_));
-}
-
-void
-lefiArray::Destroy()
-{
-    clear();
-
-    lefFree((char*) (name_));
-    lefFree((char*) (caps_));
-    lefFree((char*) (minPins_));
-    lefFree((char*) (floors_));
-    lefFree((char*) (track_));
-    lefFree((char*) (gcell_));
-    lefFree((char*) (cannotOccupy_));
-    lefFree((char*) (canPlace_));
-    lefFree((char*) (pattern_));
-}
-
-lefiArray::~lefiArray()
-{
-    Destroy();
-}
-
-void
-lefiArray::addSitePattern(lefiSitePattern *s)
-{
-    /*
-      if (numPatterns_ == patternsAllocated_)
-        bump((void***)(&(pattern_)), numPatterns_,
-        &(patternsAllocated_));
-    */
-    if (numPatterns_ == patternsAllocated_) {
-        lefiSitePattern **tpattern;
-        int             i;
-
-        if (patternsAllocated_ == 0)
-            patternsAllocated_ = 2;
-        else
-            patternsAllocated_ = patternsAllocated_ * 2;
-        tpattern = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) *
-                                                 patternsAllocated_);
-        for (i = 0; i < numPatterns_; i++) {
-            tpattern[i] = pattern_[i];
-        }
-        if (pattern_)
-            lefFree((char*) (pattern_));
-        pattern_ = tpattern;
-        /*
-            bump((void***)(&(pattern_)), numPatterns_,
-            &(patternsAllocated_));
-        */
-    }
-
-    pattern_[numPatterns_] = s;
-    numPatterns_ += 1;
-}
-
-void
-lefiArray::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiArray::setTableSize(int tsize)
-{
-    tableSize_ = tsize;
-    hasDefault_ = 1;
-}
-
-void
-lefiArray::addDefaultCap(int    minPins,
-                         double cap)
-{
-    if (numDefault_ == defaultAllocated_) {
-        int     i;
-        int     lim;
-        double  *nc;
-        int     *np;
-
-        if (defaultAllocated_ == 0)
-            lim = defaultAllocated_ = 2;
-        else
-            lim = defaultAllocated_ * 2;
-        defaultAllocated_ = lim;
-        nc = (double*) lefMalloc(sizeof(double) * lim);
-        np = (int*) lefMalloc(sizeof(int) * lim);
-        lim /= 2;
-        for (i = 0; i < lim; i++) {
-            nc[i] = caps_[i];
-            np[i] = minPins_[i];
-        }
-        lefFree((char*) (caps_));
-        lefFree((char*) (minPins_));
-        caps_ = nc;
-        minPins_ = np;
-    }
-    caps_[numDefault_] = cap;
-    minPins_[numDefault_] = minPins;
-    numDefault_ += 1;
-}
-
-void
-lefiArray::addCanPlace(lefiSitePattern *s)
-{
-    if (numCan_ == canAllocated_) {
-        lefiSitePattern **cplace;
-        int             i;
-
-        if (canAllocated_ == 0)
-            canAllocated_ = 2;
-        else
-            canAllocated_ = canAllocated_ * 2;
-        cplace = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) *
-                                               canAllocated_);
-        for (i = 0; i < numCan_; i++) {
-            cplace[i] = canPlace_[i];
-        }
-        if (canPlace_)
-            lefFree((char*) (canPlace_));
-        canPlace_ = cplace;
-    }
-    /*
-        bump((void***)(&(canPlace_)), numCan_, &(canAllocated_));
-    */
-    canPlace_[numCan_] = s;
-    numCan_ += 1;
-}
-
-void
-lefiArray::addCannotOccupy(lefiSitePattern *s)
-{
-    if (numCannot_ == cannotAllocated_) {
-        lefiSitePattern **cnplace;
-        int             i;
-
-        if (cannotAllocated_ == 0)
-            cannotAllocated_ = 2;
-        else
-            cannotAllocated_ = cannotAllocated_ * 2;
-        cnplace = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) *
-                                                cannotAllocated_);
-        for (i = 0; i < numCannot_; i++) {
-            cnplace[i] = cannotOccupy_[i];
-        }
-        if (cannotOccupy_)
-            lefFree((char*) (cannotOccupy_));
-        cannotOccupy_ = cnplace;
-    }
-    /*
-      if (numCannot_ == cannotAllocated_)
-        bump((void***)(&(cannotOccupy_)), numCannot_,
-        &(cannotAllocated_));
-    */
-    cannotOccupy_[numCannot_] = s;
-    numCannot_ += 1;
-}
-
-void
-lefiArray::addTrack(lefiTrackPattern *t)
-{
-    if (numTracks_ == tracksAllocated_) {
-        lefiTrackPattern    **tracks;
-        int                 i;
-
-        if (tracksAllocated_ == 0)
-            tracksAllocated_ = 2;
-        else
-            tracksAllocated_ = tracksAllocated_ * 2;
-        tracks = (lefiTrackPattern**) lefMalloc(sizeof(lefiTrackPattern*) *
-                                                tracksAllocated_);
-        for (i = 0; i < numTracks_; i++) {
-            tracks[i] = track_[i];
-        }
-        if (track_)
-            lefFree((char*) (track_));
-        track_ = tracks;
-    }
-    /*
-      if (numTracks_ == tracksAllocated_)
-        bump((void***)(&(track_)), numTracks_, &(tracksAllocated_));
-    */
-    track_[numTracks_] = t;
-    numTracks_ += 1;
-}
-
-void
-lefiArray::addGcell(lefiGcellPattern *g)
-{
-    if (numG_ == gAllocated_) {
-        lefiGcellPattern    **cells;
-        int                 i;
-
-        if (gAllocated_ == 0)
-            gAllocated_ = 2;
-        else
-            gAllocated_ = gAllocated_ * 2;
-        cells = (lefiGcellPattern**) lefMalloc(sizeof(lefiGcellPattern*) *
-                                               gAllocated_);
-        for (i = 0; i < numG_; i++) {
-            cells[i] = gcell_[i];
-        }
-        if (gcell_)
-            lefFree((char*) (gcell_));
-        gcell_ = cells;
-    }
-    /*
-      if (numG_ == gAllocated_)
-        bump((void***)(&(gcell_)), numG_, &(gAllocated_));
-    */
-    gcell_[numG_] = g;
-    numG_ += 1;
-}
-
-void
-lefiArray::addFloorPlan(const char *name)
-{
-    lefiArrayFloorPlan *f;
-    if (numFloorPlans_ == floorPlansAllocated_) {
-        int                 i;
-        lefiArrayFloorPlan  **tf;
-
-        if (floorPlansAllocated_ == 0)
-            floorPlansAllocated_ = 2;
-        else
-            floorPlansAllocated_ = floorPlansAllocated_ * 2;
-        tf = (lefiArrayFloorPlan**) lefMalloc(sizeof(lefiArrayFloorPlan*) *
-                                              floorPlansAllocated_);
-        for (i = 0; i < numFloorPlans_; i++) {
-            tf[i] = floors_[i];
-        }
-        if (floors_)
-            lefFree((char*) (floors_));
-        floors_ = tf;
-    }
-    /*
-      if (numFloorPlans_ == floorPlansAllocated_) {
-        bump((void***)(&(floors_)), numFloorPlans_,
-        &(floorPlansAllocated_));
-      }
-    */
-    f = (lefiArrayFloorPlan*) lefMalloc(sizeof(lefiArrayFloorPlan));
-    f->Init(name);
-    floors_[numFloorPlans_] = f;
-    numFloorPlans_ += 1;
-}
-
-void
-lefiArray::addSiteToFloorPlan(const char        *typ,
-                              lefiSitePattern   *s)
-{
-    lefiArrayFloorPlan *f = floors_[numFloorPlans_ - 1];
-    f->addSitePattern(typ, s);
-}
-
-void
-lefiArray::bump(void    ***arr,
-                int     used,
-                int     *allocated)
-{
-    int     size = *allocated * 2;
-    int     i;
-    void    **newa;
-    if (size == 0)
-        size = 2;
-    newa = (void**) lefMalloc(sizeof(void*) * size);
-
-    for (i = 0; i < used; i++) {
-        newa[i] = (*arr)[i];
-    }
-
-    if (*arr)
-        lefFree((char*) (*arr));
-    *allocated = size;
-    *arr = newa;
-}
-
-void
-lefiArray::clear()
-{
-    int                 i;
-    lefiSitePattern     *p;
-    lefiGcellPattern    *g;
-    lefiTrackPattern    *t;
-    lefiArrayFloorPlan  *f;
-
-    for (i = 0; i < numPatterns_; i++) {
-        p = pattern_[i];
-        p->Destroy();
-        lefFree((char*) p);
-    }
-    numPatterns_ = 0;
-
-    for (i = 0; i < numCan_; i++) {
-        p = canPlace_[i];
-        p->Destroy();
-        lefFree((char*) p);
-    }
-    numCan_ = 0;
-
-    for (i = 0; i < numCannot_; i++) {
-        p = cannotOccupy_[i];
-        p->Destroy();
-        lefFree((char*) p);
-    }
-    numCannot_ = 0;
-
-    for (i = 0; i < numTracks_; i++) {
-        t = track_[i];
-        t->Destroy();
-        lefFree((char*) t);
-    }
-    numTracks_ = 0;
-
-    for (i = 0; i < numG_; i++) {
-        g = gcell_[i];
-        g->Destroy();
-        lefFree((char*) g);
-    }
-    numG_ = 0;
-
-    hasDefault_ = 0;
-    tableSize_ = 0;
-    numDefault_ = 0;
-
-    for (i = 0; i < numFloorPlans_; i++) {
-        f = floors_[i];
-        f->Destroy();
-        lefFree((char*) f);
-    }
-    numFloorPlans_ = 0;
-
-}
-
-int
-lefiArray::numSitePattern() const
-{
-    return numPatterns_;
-}
-
-int
-lefiArray::numCanPlace() const
-{
-    return numCan_;
-}
-
-int
-lefiArray::numCannotOccupy() const
-{
-    return numCannot_;
-}
-
-int
-lefiArray::numTrack() const
-{
-    return numTracks_;
-}
-
-int
-lefiArray::numGcell() const
-{
-    return numG_;
-}
-
-int
-lefiArray::hasDefaultCap() const
-{
-    return hasDefault_;
-}
-
-const char *
-lefiArray::name() const
-{
-    return name_;
-}
-
-lefiSitePattern *
-lefiArray::sitePattern(int index) const
-{
-    return pattern_[index];
-}
-
-lefiSitePattern *
-lefiArray::canPlace(int index) const
-{
-    return canPlace_[index];
-}
-
-lefiSitePattern *
-lefiArray::cannotOccupy(int index) const
-{
-    return cannotOccupy_[index];
-}
-
-lefiTrackPattern *
-lefiArray::track(int index) const
-{
-    return track_[index];
-}
-
-lefiGcellPattern *
-lefiArray::gcell(int index) const
-{
-    return gcell_[index];
-}
-
-int
-lefiArray::tableSize() const
-{
-    return tableSize_;
-}
-
-int
-lefiArray::numDefaultCaps() const
-{
-    return numDefault_;
-}
-
-int
-lefiArray::defaultCapMinPins(int index) const
-{
-    return minPins_[index];
-}
-
-double
-lefiArray::defaultCap(int index) const
-{
-    return caps_[index];
-}
-
-int
-lefiArray::numFloorPlans() const
-{
-    return numFloorPlans_;
-}
-
-const char *
-lefiArray::floorPlanName(int index) const
-{
-    const lefiArrayFloorPlan *f = floors_[index];
-    return f->name();
-}
-
-int
-lefiArray::numSites(int index) const
-{
-    const lefiArrayFloorPlan *f = floors_[index];
-    return f->numPatterns();
-}
-
-const char *
-lefiArray::siteType(int index,
-                    int j) const
-{
-    const lefiArrayFloorPlan *f = floors_[index];
-    return f->typ(j);
-}
-
-lefiSitePattern *
-lefiArray::site(int index,
-                int j) const
-{
-    const lefiArrayFloorPlan *f = floors_[index];
-    return f->pattern(j);
-}
-
-void
-lefiArray::print(FILE *f) const
-{
-    fprintf(f, "ARRAY %s\n", name());
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.hpp
deleted file mode 100644
index 8244053..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiArray.hpp
+++ /dev/null
@@ -1,147 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiArray_h
-#define lefiArray_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-#include "lefiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiArrayFloorPlan {
-public:
-  void Init(const char* name);
-  void Destroy();
-  void addSitePattern(const char* typ, lefiSitePattern* s);
-
-  int numPatterns() const;
-  lefiSitePattern* pattern(int index) const;
-  char* typ(int index) const;
-  const char* name() const;
-
-protected:
-  int numPatterns_;
-  int patternsAllocated_;
-  lefiSitePattern** patterns_;
-  char** types_;
-  char* name_;
-};
-
-class lefiArray {
-public:
-  lefiArray();
-  void Init();
-
-  void Destroy();
-  ~lefiArray();
-
-  void setName(const char* name);
-  void addSitePattern(lefiSitePattern* s);
-  void setTableSize(int tsize);
-  void addDefaultCap(int minPins, double cap);
-  void addCanPlace(lefiSitePattern* s);
-  void addCannotOccupy(lefiSitePattern* s);
-  void addTrack(lefiTrackPattern* t);
-  void addGcell(lefiGcellPattern* g);
-  void addFloorPlan(const char* name);
-  void addSiteToFloorPlan(const char* typ, lefiSitePattern* p);
-  void clear();
-  void bump(void*** arr, int used, int* allocated);
-
-  int numSitePattern() const;
-  int numCanPlace() const;
-  int numCannotOccupy() const;
-  int numTrack() const;
-  int numGcell() const;
-  int hasDefaultCap() const;
-
-  const char* name() const;
-  lefiSitePattern* sitePattern(int index) const;
-  lefiSitePattern* canPlace(int index) const;
-  lefiSitePattern* cannotOccupy(int index) const;
-  lefiTrackPattern* track(int index) const;
-  lefiGcellPattern* gcell(int index) const;
-
-  int tableSize() const;
-  int numDefaultCaps() const;
-  int defaultCapMinPins(int index) const;
-  double defaultCap(int index) const;
-
-  int numFloorPlans() const;
-  const char* floorPlanName(int index) const;
-  int numSites(int index) const;
-  const char* siteType(int floorIndex, int siteIndex) const;
-  lefiSitePattern* site(int floorIndex, int siteIndex) const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int nameSize_;
-  char* name_;
-
-  int patternsAllocated_;
-  int numPatterns_;
-  lefiSitePattern** pattern_;
-
-  int canAllocated_;
-  int numCan_;
-  lefiSitePattern** canPlace_;
-
-  int cannotAllocated_;
-  int numCannot_;
-  lefiSitePattern** cannotOccupy_;
-
-  int tracksAllocated_;
-  int numTracks_;
-  lefiTrackPattern** track_;
-
-  int gAllocated_;
-  int numG_;
-  lefiGcellPattern** gcell_;
-
-  int hasDefault_;
-  int tableSize_;
-  int numDefault_;
-  int defaultAllocated_;
-  int* minPins_;
-  double* caps_;
-
-  int numFloorPlans_;
-  int floorPlansAllocated_;
-  lefiArrayFloorPlan** floors_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.cpp
deleted file mode 100644
index c380641..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.cpp
+++ /dev/null
@@ -1,994 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiCrossTalk.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiNoiseVictim
-// *****************************************************************************
-
-lefiNoiseVictim::lefiNoiseVictim(double d)
-: length_(0.0),
-  numNoises_(0),
-  noisesAllocated_(0),
-  noises_(NULL)
-{
-    Init(d);
-}
-
-void
-lefiNoiseVictim::Init(double d)
-{
-    length_ = d;
-
-    numNoises_ = 0;
-    noisesAllocated_ = 2;
-    noises_ = (double*) lefMalloc(sizeof(double) * 2);
-}
-
-void
-lefiNoiseVictim::clear()
-{
-    numNoises_ = 0;
-}
-
-void
-lefiNoiseVictim::Destroy()
-{
-    clear();
-    lefFree((char*) (noises_));
-}
-
-lefiNoiseVictim::~lefiNoiseVictim()
-{
-    Destroy();
-}
-
-void
-lefiNoiseVictim::addVictimNoise(double d)
-{
-    if (numNoises_ == noisesAllocated_) {
-        int     max;
-        double  *ne;
-        int     i;
-
-        if (noisesAllocated_ == 0) {
-            max = noisesAllocated_ = 2;
-            numNoises_ = 0;
-        } else
-            max = noisesAllocated_ = numNoises_ * 2;
-        ne = (double*) lefMalloc(sizeof(double) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = noises_[i];
-        lefFree((char*) (noises_));
-        noises_ = ne;
-    }
-    noises_[numNoises_] = d;
-    numNoises_ += 1;
-}
-
-int
-lefiNoiseVictim::numNoises() const
-{
-    return numNoises_;
-}
-
-double
-lefiNoiseVictim::noise(int index) const
-{
-    return noises_[index];
-}
-
-double
-lefiNoiseVictim::length() const
-{
-    return length_;
-}
-
-// *****************************************************************************
-// lefiNoiseResistance
-// *****************************************************************************
-
-lefiNoiseResistance::lefiNoiseResistance()
-: numNums_(0),
-  numsAllocated_(0),
-  nums_(NULL),
-  numVictims_(0),
-  victimsAllocated_(0),
-  victims_(NULL)
-{
-    Init();
-}
-
-void
-lefiNoiseResistance::Init()
-{
-    numNums_ = 0;
-    numsAllocated_ = 1;
-    nums_ = (double*) lefMalloc(sizeof(double) * 1);
-
-    numVictims_ = 0;
-    victimsAllocated_ = 2;
-    victims_ = (lefiNoiseVictim**) lefMalloc(sizeof(
-                                             lefiNoiseVictim*) * 2);
-}
-
-void
-lefiNoiseResistance::clear()
-{
-    int             i;
-    lefiNoiseVictim *r;
-    int             max = numVictims_;
-
-    for (i = 0; i < max; i++) {
-        r = victims_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-    numVictims_ = 0;
-    numNums_ = 0;
-}
-
-void
-lefiNoiseResistance::Destroy()
-{
-    clear();
-    lefFree((char*) (nums_));
-    lefFree((char*) (victims_));
-}
-
-lefiNoiseResistance::~lefiNoiseResistance()
-{
-    Destroy();
-}
-
-void
-lefiNoiseResistance::addResistanceNumber(double d)
-{
-    if (numNums_ == numsAllocated_) {
-        int     max;
-        double  *ne;
-        int     i;
-
-        if (numsAllocated_ == 0) {
-            max = numsAllocated_ = 2;
-            numNums_ = 0;
-        } else
-            max = numsAllocated_ = numNums_ * 2;
-        ne = (double*) lefMalloc(sizeof(double) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = nums_[i];
-        lefFree((char*) (nums_));
-        nums_ = ne;
-    }
-    nums_[numNums_] = d;
-    numNums_ += 1;
-}
-
-void
-lefiNoiseResistance::addVictimNoise(double d)
-{
-    lefiNoiseVictim *r = victims_[numVictims_ - 1];
-    r->addVictimNoise(d);
-}
-
-void
-lefiNoiseResistance::addVictimLength(double d)
-{
-    lefiNoiseVictim *r;
-    if (numVictims_ == victimsAllocated_) {
-        int             max;
-        lefiNoiseVictim **ne;
-        int             i;
-
-        if (victimsAllocated_ == 0) {
-            max = victimsAllocated_ = 2;
-            numVictims_ = 0;
-        } else
-            max = victimsAllocated_ = numVictims_ * 2;
-
-        ne = (lefiNoiseVictim**) lefMalloc(sizeof(lefiNoiseVictim*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = victims_[i];
-        lefFree((char*) (victims_));
-        victims_ = ne;
-    }
-    r = (lefiNoiseVictim*) lefMalloc(sizeof(lefiNoiseVictim));
-    r->Init(d);
-    victims_[numVictims_] = r;
-    numVictims_ += 1;
-}
-
-int
-lefiNoiseResistance::numVictims() const
-{
-    return numVictims_;
-}
-
-lefiNoiseVictim *
-lefiNoiseResistance::victim(int index) const
-{
-    return victims_[index];
-}
-
-int
-lefiNoiseResistance::numNums() const
-{
-    return numNums_;
-}
-
-double
-lefiNoiseResistance::num(int index) const
-{
-    return nums_[index];
-}
-
-// *****************************************************************************
-// lefiNoiseEdge
-// *****************************************************************************
-
-lefiNoiseEdge::lefiNoiseEdge()
-{
-    Init();
-}
-
-void
-lefiNoiseEdge::Init()
-{
-    edge_ = 0;
-
-    numResistances_ = 0;
-    resistancesAllocated_ = 2;
-    resistances_ = (lefiNoiseResistance**) lefMalloc(sizeof(
-                                                     lefiNoiseResistance*) * 2);
-}
-
-void
-lefiNoiseEdge::clear()
-{
-    int                 i;
-    lefiNoiseResistance *r;
-    int                 maxr = numResistances_;
-
-    for (i = 0; i < maxr; i++) {
-        r = resistances_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-
-    edge_ = 0;
-    numResistances_ = 0;
-}
-
-void
-lefiNoiseEdge::Destroy()
-{
-    clear();
-    lefFree((char*) (resistances_));
-}
-
-lefiNoiseEdge::~lefiNoiseEdge()
-{
-    Destroy();
-}
-
-void
-lefiNoiseEdge::addEdge(double d)
-{
-    edge_ = d;
-}
-
-void
-lefiNoiseEdge::addResistanceNumber(double d)
-{
-    lefiNoiseResistance *r = resistances_[numResistances_ - 1];
-    r->addResistanceNumber(d);
-}
-
-
-void
-lefiNoiseEdge::addResistance()
-{
-    lefiNoiseResistance *r;
-    if (numResistances_ == resistancesAllocated_) {
-        int                 max;
-        lefiNoiseResistance **ne;
-        int                 i;
-
-        if (resistancesAllocated_ == 0) {
-            max = resistancesAllocated_ = 2;
-            numResistances_ = 0;
-        } else
-            max = resistancesAllocated_ = numResistances_ * 2;
-        ne = (lefiNoiseResistance**) lefMalloc(sizeof(lefiNoiseResistance*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = resistances_[i];
-        lefFree((char*) (resistances_));
-        resistances_ = ne;
-    }
-    r = (lefiNoiseResistance*) lefMalloc(sizeof(lefiNoiseResistance));
-    r->Init();
-    resistances_[numResistances_] = r;
-    numResistances_ += 1;
-}
-
-void
-lefiNoiseEdge::addVictimNoise(double d)
-{
-    lefiNoiseResistance *r = resistances_[numResistances_ - 1];
-    r->addVictimNoise(d);
-}
-
-void
-lefiNoiseEdge::addVictimLength(double d)
-{
-    lefiNoiseResistance *r = resistances_[numResistances_ - 1];
-    r->addVictimLength(d);
-}
-
-int
-lefiNoiseEdge::numResistances()
-{
-    return numResistances_;
-}
-
-lefiNoiseResistance *
-lefiNoiseEdge::resistance(int index)
-{
-    return resistances_[index];
-}
-
-double
-lefiNoiseEdge::edge()
-{
-    return edge_;
-}
-
-// *****************************************************************************
-// lefiNoiseTable
-// *****************************************************************************
-
-lefiNoiseTable::lefiNoiseTable()
-{
-    Init();
-}
-
-void
-lefiNoiseTable::Init()
-{
-    numEdges_ = 0;
-    edgesAllocated_ = 2;
-    edges_ = (lefiNoiseEdge**) lefMalloc(sizeof(lefiNoiseEdge*) * 2);
-}
-
-void
-lefiNoiseTable::clear()
-{
-    int             i;
-    lefiNoiseEdge   *r;
-    int             max = numEdges_;
-
-    for (i = 0; i < max; i++) {
-        r = edges_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-    numEdges_ = 0;
-}
-
-void
-lefiNoiseTable::Destroy()
-{
-    clear();
-    lefFree((char*) (edges_));
-}
-
-lefiNoiseTable::~lefiNoiseTable()
-{
-    Destroy();
-}
-
-void
-lefiNoiseTable::setup(int i)
-{
-    num_ = i;
-    clear();
-}
-
-void
-lefiNoiseTable::newEdge()
-{
-    lefiNoiseEdge *r;
-    if (numEdges_ == edgesAllocated_) {
-        int             max;
-        lefiNoiseEdge   **ne;
-        int             i;
-
-        if (edgesAllocated_ == 0) {
-            max = edgesAllocated_ = 2;
-            numEdges_ = 0;
-        } else
-            max = edgesAllocated_ = numEdges_ * 2;
-        ne = (lefiNoiseEdge**) lefMalloc(sizeof(lefiNoiseEdge*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = edges_[i];
-        lefFree((char*) (edges_));
-        edges_ = ne;
-    }
-    r = (lefiNoiseEdge*) lefMalloc(sizeof(lefiNoiseEdge));
-    r->Init();
-    edges_[numEdges_] = r;
-    numEdges_ += 1;
-}
-
-void
-lefiNoiseTable::addEdge(double d)
-{
-    lefiNoiseEdge *r = edges_[numEdges_ - 1];
-    r->addEdge(d);
-}
-
-void
-lefiNoiseTable::addResistance()
-{
-    lefiNoiseEdge *r = edges_[numEdges_ - 1];
-    r->addResistance();
-}
-
-void
-lefiNoiseTable::addResistanceNumber(double d)
-{
-    lefiNoiseEdge *r = edges_[numEdges_ - 1];
-    r->addResistanceNumber(d);
-}
-
-void
-lefiNoiseTable::addVictimLength(double d)
-{
-    lefiNoiseEdge *r = edges_[numEdges_ - 1];
-    r->addVictimLength(d);
-}
-
-void
-lefiNoiseTable::addVictimNoise(double d)
-{
-    lefiNoiseEdge *r = edges_[numEdges_ - 1];
-    r->addVictimNoise(d);
-}
-
-int
-lefiNoiseTable::num()
-{
-    return num_;
-}
-
-int
-lefiNoiseTable::numEdges()
-{
-    return numEdges_;
-}
-
-lefiNoiseEdge *
-lefiNoiseTable::edge(int index)
-{
-    return edges_[index];
-}
-
-// *****************************************************************************
-// lefiCorrectionVictim
-// *****************************************************************************
-
-lefiCorrectionVictim::lefiCorrectionVictim(double d)
-{
-    Init(d);
-}
-
-void
-lefiCorrectionVictim::Init(double d)
-{
-    length_ = d;
-
-    numCorrections_ = 0;
-    correctionsAllocated_ = 2;
-    corrections_ = (double*) lefMalloc(sizeof(double) * 2);
-}
-
-void
-lefiCorrectionVictim::clear()
-{
-    numCorrections_ = 0;
-}
-
-void
-lefiCorrectionVictim::Destroy()
-{
-    clear();
-    lefFree((char*) (corrections_));
-}
-
-lefiCorrectionVictim::~lefiCorrectionVictim()
-{
-    Destroy();
-}
-
-void
-lefiCorrectionVictim::addVictimCorrection(double d)
-{
-    if (numCorrections_ == correctionsAllocated_) {
-        int     max;
-        double  *ne;
-        int     i;
-
-        if (correctionsAllocated_ == 0) {
-            max = correctionsAllocated_ = 2;
-            numCorrections_ = 0;
-        } else
-            max = correctionsAllocated_ = numCorrections_ * 2;
-        ne = (double*) lefMalloc(sizeof(double) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = corrections_[i];
-        lefFree((char*) (corrections_));
-        corrections_ = ne;
-    }
-    corrections_[numCorrections_] = d;
-    numCorrections_ += 1;
-}
-
-int
-lefiCorrectionVictim::numCorrections()
-{
-    return numCorrections_;
-}
-
-double
-lefiCorrectionVictim::correction(int index)
-{
-    return corrections_[index];
-}
-
-double
-lefiCorrectionVictim::length()
-{
-    return length_;
-}
-
-// *****************************************************************************
-// lefiCorrectionResistance
-// *****************************************************************************
-
-lefiCorrectionResistance::lefiCorrectionResistance()
-{
-    Init();
-}
-
-void
-lefiCorrectionResistance::Init()
-{
-    numNums_ = 0;
-    numsAllocated_ = 1;
-    nums_ = (double*) lefMalloc(sizeof(double) * 1);
-
-    numVictims_ = 0;
-    victimsAllocated_ = 2;
-    victims_ = (lefiCorrectionVictim**) lefMalloc(sizeof(
-                                                  lefiCorrectionVictim*) * 2);
-}
-
-void
-lefiCorrectionResistance::clear()
-{
-    int                     i;
-    lefiCorrectionVictim    *r;
-    int                     max = numVictims_;
-
-    for (i = 0; i < max; i++) {
-        r = victims_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-    numVictims_ = 0;
-    numNums_ = 0;
-}
-
-void
-lefiCorrectionResistance::Destroy()
-{
-    clear();
-    lefFree((char*) (nums_));
-    lefFree((char*) (victims_));
-}
-
-lefiCorrectionResistance::~lefiCorrectionResistance()
-{
-    Destroy();
-}
-
-void
-lefiCorrectionResistance::addResistanceNumber(double d)
-{
-    if (numNums_ == numsAllocated_) {
-        int     max;
-        double  *ne;
-        int     i;
-
-        if (numsAllocated_) {
-            max = numsAllocated_ = 2;
-            numNums_ = 0;
-        } else
-            max = numsAllocated_ = numNums_ * 2;
-        ne = (double*) lefMalloc(sizeof(double) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = nums_[i];
-        lefFree((char*) (nums_));
-        nums_ = ne;
-    }
-    nums_[numNums_] = d;
-    numNums_ += 1;
-}
-
-void
-lefiCorrectionResistance::addVictimCorrection(double d)
-{
-    lefiCorrectionVictim *r = victims_[numVictims_ - 1];
-    r->addVictimCorrection(d);
-}
-
-void
-lefiCorrectionResistance::addVictimLength(double d)
-{
-    lefiCorrectionVictim *r;
-    if (numVictims_ == victimsAllocated_) {
-        int                     max;
-        lefiCorrectionVictim    **ne;
-        int                     i;
-
-        if (victimsAllocated_ == 0) {
-            max = victimsAllocated_ = 2;
-            numVictims_ = 0;
-        } else
-            max = victimsAllocated_ = numVictims_ * 2;
-        ne = (lefiCorrectionVictim**) lefMalloc(sizeof(lefiCorrectionVictim*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = victims_[i];
-        lefFree((char*) (victims_));
-        victims_ = ne;
-    }
-    r = (lefiCorrectionVictim*) lefMalloc(sizeof(lefiCorrectionVictim));
-    r->Init(d);
-    victims_[numVictims_] = r;
-    numVictims_ += 1;
-}
-
-int
-lefiCorrectionResistance::numVictims()
-{
-    return numVictims_;
-}
-
-lefiCorrectionVictim *
-lefiCorrectionResistance::victim(int index)
-{
-    return victims_[index];
-}
-
-int
-lefiCorrectionResistance::numNums()
-{
-    return numNums_;
-}
-
-double
-lefiCorrectionResistance::num(int index)
-{
-    return nums_[index];
-}
-
-// *****************************************************************************
-// lefiCorrectionEdge
-// *****************************************************************************
-
-
-lefiCorrectionEdge::lefiCorrectionEdge()
-{
-    Init();
-}
-
-
-void
-lefiCorrectionEdge::Init()
-{
-    edge_ = 0;
-
-    numResistances_ = 0;
-    resistancesAllocated_ = 2;
-    resistances_ = (lefiCorrectionResistance**) lefMalloc(sizeof(
-                                                          lefiCorrectionResistance*) * 2);
-}
-
-
-void
-lefiCorrectionEdge::clear()
-{
-    int                         i;
-    lefiCorrectionResistance    *r;
-    int                         maxr = numResistances_;
-
-    for (i = 0; i < maxr; i++) {
-        r = resistances_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-
-    edge_ = 0;
-    numResistances_ = 0;
-}
-
-
-void
-lefiCorrectionEdge::Destroy()
-{
-    clear();
-    lefFree((char*) (resistances_));
-}
-
-
-lefiCorrectionEdge::~lefiCorrectionEdge()
-{
-    Destroy();
-}
-
-
-void
-lefiCorrectionEdge::addEdge(double d)
-{
-    edge_ = d;
-}
-
-
-void
-lefiCorrectionEdge::addResistanceNumber(double d)
-{
-    lefiCorrectionResistance *r = resistances_[numResistances_ - 1];
-    r->addResistanceNumber(d);
-}
-
-
-void
-lefiCorrectionEdge::addResistance()
-{
-    lefiCorrectionResistance *r;
-    if (numResistances_ == resistancesAllocated_) {
-        int                         max;
-        lefiCorrectionResistance    **ne;
-        int                         i;
-
-        if (resistancesAllocated_ == 0) {
-            max = resistancesAllocated_ = 2;
-            numResistances_ = 0;
-        } else
-            max = resistancesAllocated_ = numResistances_ * 2;
-        ne = (lefiCorrectionResistance**) lefMalloc
-            (sizeof(lefiCorrectionResistance*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = resistances_[i];
-        lefFree((char*) (resistances_));
-        resistances_ = ne;
-    }
-    r = (lefiCorrectionResistance*) lefMalloc(sizeof(lefiCorrectionResistance));
-    r->Init();
-    resistances_[numResistances_] = r;
-    numResistances_ += 1;
-}
-
-
-void
-lefiCorrectionEdge::addVictimCorrection(double d)
-{
-    lefiCorrectionResistance *r = resistances_[numResistances_ - 1];
-    r->addVictimCorrection(d);
-}
-
-
-void
-lefiCorrectionEdge::addVictimLength(double d)
-{
-    lefiCorrectionResistance *r = resistances_[numResistances_ - 1];
-    r->addVictimLength(d);
-}
-
-
-int
-lefiCorrectionEdge::numResistances()
-{
-    return numResistances_;
-}
-
-
-lefiCorrectionResistance *
-lefiCorrectionEdge::resistance(int index)
-{
-    return resistances_[index];
-}
-
-
-double
-lefiCorrectionEdge::edge()
-{
-    return edge_;
-}
-
-
-// *****************************************************************************
-// lefiCorrectionTable
-// *****************************************************************************
-
-lefiCorrectionTable::lefiCorrectionTable()
-{
-    Init();
-}
-
-void
-lefiCorrectionTable::Init()
-{
-    numEdges_ = 0;
-    edgesAllocated_ = 2;
-    edges_ = (lefiCorrectionEdge**) lefMalloc(sizeof(lefiCorrectionEdge*) * 2);
-}
-
-void
-lefiCorrectionTable::clear()
-{
-    int                 i;
-    lefiCorrectionEdge  *r;
-    int                 max = numEdges_;
-
-    for (i = 0; i < max; i++) {
-        r = edges_[i];
-        r->Destroy();
-        lefFree((char*) r);
-    }
-    numEdges_ = 0;
-}
-
-void
-lefiCorrectionTable::Destroy()
-{
-    clear();
-    lefFree((char*) (edges_));
-}
-
-lefiCorrectionTable::~lefiCorrectionTable()
-{
-    Destroy();
-}
-
-void
-lefiCorrectionTable::setup(int i)
-{
-    num_ = i;
-    clear();
-}
-
-void
-lefiCorrectionTable::newEdge()
-{
-    lefiCorrectionEdge *r;
-    if (numEdges_ == edgesAllocated_) {
-        int                 max;
-        lefiCorrectionEdge  **ne;
-        int                 i;
-
-        if (edgesAllocated_ == 0) {
-            max = edgesAllocated_ = 2;
-            numEdges_ = 0;
-        } else
-            max = edgesAllocated_ = numEdges_ * 2;
-        ne = (lefiCorrectionEdge**) lefMalloc(sizeof(lefiCorrectionEdge*) * max);
-        max /= 2;
-        for (i = 0; i < max; i++)
-            ne[i] = edges_[i];
-        lefFree((char*) (edges_));
-        edges_ = ne;
-    }
-    r = (lefiCorrectionEdge*) lefMalloc(sizeof(lefiCorrectionEdge));
-    r->Init();
-    edges_[numEdges_] = r;
-    numEdges_ += 1;
-}
-
-void
-lefiCorrectionTable::addEdge(double d)
-{
-    lefiCorrectionEdge *r = edges_[numEdges_ - 1];
-    r->addEdge(d);
-}
-
-void
-lefiCorrectionTable::addResistanceNumber(double d)
-{
-    lefiCorrectionEdge *r = edges_[numEdges_ - 1];
-    r->addResistanceNumber(d);
-}
-
-void
-lefiCorrectionTable::addResistance()
-{
-    lefiCorrectionEdge *r = edges_[numEdges_ - 1];
-    r->addResistance();
-}
-
-void
-lefiCorrectionTable::addVictimLength(double d)
-{
-    lefiCorrectionEdge *r = edges_[numEdges_ - 1];
-    r->addVictimLength(d);
-}
-
-void
-lefiCorrectionTable::addVictimCorrection(double d)
-{
-    lefiCorrectionEdge *r = edges_[numEdges_ - 1];
-    r->addVictimCorrection(d);
-}
-
-int
-lefiCorrectionTable::num()
-{
-    return num_;
-}
-
-int
-lefiCorrectionTable::numEdges()
-{
-    return numEdges_;
-}
-
-lefiCorrectionEdge *
-lefiCorrectionTable::edge(int index)
-{
-    return edges_[index];
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.hpp
deleted file mode 100644
index 8af1e7c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiCrossTalk.hpp
+++ /dev/null
@@ -1,273 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiCrossTalk_h
-#define lefiCrossTalk_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Structure returned for the noise margin callback.
-// This lef construct has two floating point numbers. 
-struct lefiNoiseMargin {
-  double high;
-  double low;
-};
-
-class lefiNoiseVictim {
-public:
-  lefiNoiseVictim(double d);
-  void Init(double d);
-
-  void Destroy();
-  ~lefiNoiseVictim();
-
-  void clear();
-
-  void addVictimNoise(double d);
-
-  double length() const;
-  int numNoises() const;
-  double noise(int index) const;
-
-protected:
-  double length_;
-
-  int numNoises_;
-  int noisesAllocated_;
-  double* noises_;
-};
-
-class lefiNoiseResistance {
-public:
-  lefiNoiseResistance();
-  void Init();
-
-  void Destroy();
-  ~lefiNoiseResistance();
-
-  void clear();
-
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimNoise(double d);
-
-  int numNums() const;
-  double num(int index) const;
-
-  int numVictims() const;
-  lefiNoiseVictim* victim(int index) const;
-
-protected:
-  int numNums_;
-  int numsAllocated_;
-  double* nums_;
-
-  int numVictims_;
-  int victimsAllocated_;
-  lefiNoiseVictim** victims_;
-};
-
-class lefiNoiseEdge {
-public:
-  lefiNoiseEdge();
-  void Init();
-
-  void Destroy();
-  ~lefiNoiseEdge();
-
-  void clear();
-
-  void addEdge(double d);
-  void addResistance();
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimNoise(double d);
-
-  double edge();
-  int numResistances();
-  lefiNoiseResistance* resistance(int index);
-
-protected:
-  double edge_;
-
-  int numResistances_;
-  int resistancesAllocated_;
-  lefiNoiseResistance** resistances_;
-};
-
-class lefiNoiseTable {
-public:
-  lefiNoiseTable();
-  void Init();
-
-  void Destroy();
-  ~lefiNoiseTable();
-
-  void setup(int i);
-  void newEdge();
-  void addEdge(double d);
-  void addResistance();
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimNoise(double d);
-
-  void clear();
-
-  int num();
-  int numEdges();
-  lefiNoiseEdge* edge(int index);
-
-protected:
-  int num_;
-
-  int numEdges_;
-  int edgesAllocated_;
-  lefiNoiseEdge** edges_;
-};
-
-class lefiCorrectionVictim {
-public:
-  lefiCorrectionVictim(double d);
-  void Init(double d);
-
-  void Destroy();
-  ~lefiCorrectionVictim();
-
-  void clear();
-
-  void addVictimCorrection(double d);
-
-  double length();
-  int numCorrections();
-  double correction(int index);
-
-protected:
-  double length_;
-
-  int numCorrections_;
-  int correctionsAllocated_;
-  double* corrections_;
-};
-
-class lefiCorrectionResistance {
-public:
-  lefiCorrectionResistance();
-  void Init();
-
-  void Destroy();
-  ~lefiCorrectionResistance();
-
-  void clear();
-
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimCorrection(double d);
-
-  int numNums();
-  double num(int index);
-
-  int numVictims();
-  lefiCorrectionVictim* victim(int index);
-
-protected:
-  int numNums_;
-  int numsAllocated_;
-  double* nums_;
-
-  int numVictims_;
-  int victimsAllocated_;
-  lefiCorrectionVictim** victims_;
-};
-
-class lefiCorrectionEdge {
-public:
-  lefiCorrectionEdge();
-  void Init();
- 
-  void Destroy();
-  ~lefiCorrectionEdge();
- 
-  void clear();
- 
-  void addEdge(double d);
-  void addResistance();
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimCorrection(double d);
- 
-  double edge();
-  int numResistances();
-  lefiCorrectionResistance* resistance(int index);
- 
-protected:
-  double edge_;
- 
-  int numResistances_;
-  int resistancesAllocated_;
-  lefiCorrectionResistance** resistances_;
-};
-
-class lefiCorrectionTable {
-public:
-  lefiCorrectionTable();
-  void Init();
-
-  void Destroy();
-  ~lefiCorrectionTable();
-
-  void setup(int i);
-  void newEdge();
-  void addEdge(double d);
-  void addResistance();
-  void addResistanceNumber(double d);
-  void addVictimLength(double d);
-  void addVictimCorrection(double d);
-
-  void clear();
-
-  int num();
-  int numEdges();
-  lefiCorrectionEdge* edge(int index);
-
-protected:
-  int num_;
-
-  int numEdges_;
-  int edgesAllocated_;
-  lefiCorrectionEdge** edges_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.cpp
deleted file mode 100644
index 867f5c2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "lefiDebug.hpp"
-#include "lefrReader.hpp"
-#include "lex.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "lefrData.hpp"
-#include "lefrSettings.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// ******************
-//   Debug flags:
-//   0 -
-//   1 - malloc debug
-//   2 - print each history size bump up.
-//   3 -
-//   4 -
-//   5 -
-//   6 -
-//   7 -
-//   8 -
-//   9 -
-//  10 -
-//  11 - lexer debug
-//  12 -
-//  13 - print each lex token as read in.
-//
-// ******************************
-
-// Set flag 
-void
-lefiSetDebug(int    num,
-             int    value)
-{
-    lefData->lefDebug[num] = value;
-}
-// Read flag 
-int
-lefiDebug(int num)
-{
-    return lefData->lefDebug[num];
-}
-
-void
-lefiError(int           check,
-          int           msgNum,
-          const char    *str)
-{
-
-    // check is 1 if the caller function has checked TotalMsgLimit, etc. 
-
-    if (!check) {
-        if ((lefSettings->TotalMsgLimit > 0) && (lefData->lefErrMsgPrinted >= lefSettings->TotalMsgLimit))
-            return;
-        if (lefSettings->MsgLimit[msgNum] > 0) {
-            if (lefData->msgLimit[0][msgNum] >= lefSettings->MsgLimit[msgNum]) //over the limit
-                return;
-            lefData->msgLimit[0][msgNum] = lefData->msgLimit[0][msgNum] + 1;
-        }
-        lefData->lefErrMsgPrinted++;
-    }
-
-    if (lefSettings->ErrorLogFunction)
-        (*lefSettings->ErrorLogFunction)(str);
-    else
-        fprintf(stderr, str);
-}
-
-static char lefiShift [] = {
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    ' ',
-    '!',
-    '"',
-    '#',
-    '$',
-    '%',
-    '&',
-    '\'',
-    '(',
-    ')',
-    '*',
-    '+',
-    ',',
-    '-',
-    '.',
-    '/',
-    '0',
-    '1',
-    '2',
-    '3',
-    '4',
-    '5',
-    '6',
-    '7',
-    '8',
-    '9',
-    ':',
-    ';',
-    '<',
-    '=',
-    '>',
-    '?',
-    '@',
-    'A',
-    'B',
-    'C',
-    'D',
-    'E',
-    'F',
-    'G',
-    'H',
-    'I',
-    'J',
-    'K',
-    'L',
-    'M',
-    'N',
-    'O',
-    'P',
-    'Q',
-    'R',
-    'S',
-    'T',
-    'U',
-    'V',
-    'W',
-    'X',
-    'Y',
-    'Z',
-    '[',
-    '\\',
-    ']',
-    '^',
-    '_',
-    '`',
-    'A',
-    'B',
-    'C',
-    'D',
-    'E',
-    'F',
-    'G',
-    'H',
-    'I',
-    'J',
-    'K',
-    'l',
-    'M',
-    'N',
-    'O',
-    'P',
-    'Q',
-    'R',
-    'S',
-    'T',
-    'U',
-    'V',
-    'W',
-    'X',
-    'Y',
-    'Z',
-    '{',
-    '|',
-    '}',
-    '~',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0',
-    '\0'
-};
-
-const char *
-lefUpperCase(const char *str)
-{
-    char    *place = (char*) str;
-    char    *to;
-    int     len = strlen(str) + 1;
-
-    if (len > lefData->shiftBufLength) {
-        if (lefData->shiftBuf == 0) {
-            len = len < 64 ? 64 : len;
-            lefData->shiftBuf = (char*) lefMalloc(len);
-            lefData->shiftBufLength = len;
-        } else {
-            lefFree(lefData->shiftBuf);
-            lefData->shiftBuf = (char*) malloc(len);
-            lefData->shiftBufLength = len;
-        }
-    }
-
-    to = lefData->shiftBuf;
-    while (*place) {
-        int i = (int) *place;
-        place++;
-        *to++ = lefiShift[i];
-    }
-    *to = '\0';
-
-    return lefData->shiftBuf;
-}
-
-// for auto upshifting names in case insensitive files 
-extern const char *lefUpperCase(const char *c);
-
-// Function is done from #define CASE, compatibility only
-const char *
-CASE(const char *x)
-{
-    return !lefData->namesCaseSensitive && lefSettings->ShiftCase ? lefUpperCase(x) : x;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.hpp
deleted file mode 100644
index ef02ec9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDebug.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiDebug_h
-#define lefiDebug_h 1
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Set flag 
-extern void lefiSetDebug (int num, int value) ;
-
-// Read flag 
-extern int lefiDebug (int num) ;
-
-// Error reporting routine 
-extern void lefiError (int check, int msgNum, const char* msg);
-
-extern const char* CASE(const char *x); 
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDefs.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDefs.hpp
deleted file mode 100644
index 745e72e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiDefs.hpp
+++ /dev/null
@@ -1,184 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-// Definitions header file for the DEF Interface 
-
-#ifndef LEFI_DEFS_H
-#define LEFI_DEFS_H
-
-#include <stdio.h>
-#include <limits.h>
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-//=================== General Types and Definitions =================
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef NULL
-#define NULL (0)
-#endif
-
-typedef struct point lefPOINT;
-
-struct point {
-    double x;
-    double y;
-    };
-
-typedef struct rect lefRECT;
-
-struct rect {
-    lefPOINT ll,ur;
-    };
-
-typedef struct token lefTOKEN;
-
-struct token {
-    lefTOKEN *next;
-    int what;
-    int data;
-    lefPOINT pt;
-    };
-
-#define START_LIST 10001
-#define POINT_SPEC 10002
-#define VIA_SPEC   10003
-#define WIDTH_SPEC 10004
-#define LAYER_SPEC 10005
-#define SHAPE_SPEC 10006
-
-#ifndef MAXINT
-#define MAXINT 0x7FFFFFFF
-#endif
-#ifndef MININT
-#define MININT 0x80000000
-#endif
-
-#ifndef    MIN
-#define MIN(x,y) ((x) < (y)? (x) : (y))
-#endif
-
-#ifndef    MIN
-#define MAX(x,y) ((x) > (y)? (x) : (y))
-#endif
-
-#define ROUND(x) ((x) >= 0 ? (int)((x)+0.5) : (int)((x)-0.5))
-
-//TOKEN *TokenFromRect();
-
-//=================== Enumerated Types ============================
-typedef int lefiBoolean;
-
-// Every type of object has a unique identifier, and each object
-//  which is created knows its type, by storing the lefiObjectType_e
-//  as the first member in the structure.
-
-typedef enum
-{
-  // decrease likelihood of accidentally correct values by starting
-  // at an unusual number 
-  lefiInvalidObject = 41713, 
-  lefiUnknownObject // void * 
-} lefiObjectType_e;
-
-// The memory policy controls how an object which refers to or is composed of
-//  other objects manages those sub-objects, particularly when the parent
-//  object is copied or deleted.  The policy is specified as an argument to the
-//  constructor or initializer, and it is stored with the parent object.
-// 
-//  The memory policy is a generalization of the common distinction between
-//  deep and shallow copies.  When a shallow copy of a parent object is made,
-//  the copy maintains pointers to the original sub-objects, and the original
-//  parent remains responsible for deleting those sub-objects.  When a deep
-//  copy of a parent object is made, the copy maintains pointers to new copies
-//  of each of the sub-objects, and the copy is responsible for deleting the
-//  new sub-objects.
-// 
-//  The lefiPrivateSubObjects policy corresponds to a deep copy, while the the
-//  lefiReferencedSubObjects policy corresponds to a shallow copy.  Usually an
-//  initial parent object will be created using lefiPrivateSubObjects.  When a
-//  copy is made of that parent object, the copy may either maintain its own
-//  private versions of each sub-object, or it may refer to the original
-//  sub-objects.
-// 
-//  In certain cases, it is useful to create a deep copy of a parent object,
-//  even though the new parent object shouldn't be responsible for the new
-//  sub-objects.  In this case, the lefiOrphanSubObjects and
-//  lefiAdoptedSubObjects policies may be used.  lefiOrphanSubObjects is
-//  specified while creating the deep copy, and then lefiAdoptedSubObjects is
-//  specified while creating another parent which will take on the
-//  responsibility for the orphans.
-// 
-//  An object's memory policy affects only the sub-objects which it directly
-//  controls.  Those sub-objects themselves may have the same memory policy as
-//  their parents, or they may have a different memory policy.  When a copy is
-//  made of a child sub-object, the memory policy of the child controls
-//  whether deep or shallow copies are made of the grandchildren.
-// 
-typedef enum
-{
-  // decrease likelihood of accidentally correct values by starting
-  // at an unusual number 
-  lefiInvalidMemoryPolicy = 23950,
-  lefiPrivateSubObjects,      // deep copy + delete
-  lefiReferencedSubObjects,   // shallow copy, no delete
-  lefiOrphanSubObjects,       // deep copy, no delete
-  lefiAdoptedSubObjects       // shallow copy + delete
-} lefiMemoryPolicy_e;
-
-// An opaque pointer for passing user data through from one API
-//  function to another.
-//  A handle which a user can set to point to their own data
-//  on a per-callback basis.  (See the comment in lefwWriter.h)
-
-#define lefiUserData void *
-#define lefiUserDataHandle void **
-
-#ifdef __SunOS_4_1_3
-extern int strcasecmp(const char*, const char*);
-#endif
-
-#ifdef WIN32
-#define strdup _strdup
-#endif 
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.cpp
deleted file mode 100644
index eb59ab2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-
-#include "lefiEncryptInt.hpp"
-
-#include "lefrSettings.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// Global variables
-// *****************************************************************************
-
-void
-lefrEnableReadEncrypted()
-{
-    lefSettings->ReadEncrypted = 1;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.hpp
deleted file mode 100644
index 46268a2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiEncryptInt.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DEFI_ENCRYPTINT_H
-#define DEFI_ENCRYPTINT_H
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Unable the reader to read encrypted lef file.
-//  This function must be called before lefrRead().
-// /
-extern void lefrEnableReadEncrypted();
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiKRDefs.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiKRDefs.hpp
deleted file mode 100644
index 757b15b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiKRDefs.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiKRDEFS_h
-#define lefiKRDEFS_h
-
-#define BEGIN_LEFDEF_PARSER_NAMESPACE namespace LefDefParser {
-#define END_LEFDEF_PARSER_NAMESPACE }
-#define USE_LEFDEF_PARSER_NAMESPACE using namespace LefDefParser;
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.cpp
deleted file mode 100644
index e40e146..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.cpp
+++ /dev/null
@@ -1,6812 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiLayer.hpp"
-#include "lefiDebug.hpp"
-#include "lefrSettings.hpp"
-#include "lefrCallBacks.hpp"
-#include <set>
-
-#include "lefrData.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiAntennaPWL
-// *****************************************************************************
-
-lefiAntennaPWL::lefiAntennaPWL()
-: d_(0),
-  r_(0)
-{
-    Init();
-}
-
-lefiAntennaPWL*
-lefiAntennaPWL::create()
-{
-    lefiAntennaPWL* pAntenna = (lefiAntennaPWL*)lefMalloc(sizeof(lefiAntennaPWL));
-    pAntenna->d_ = 0;
-    pAntenna->r_ = 0;
-    pAntenna->Init();
-
-    return pAntenna;
-}
-
-void
-lefiAntennaPWL::Init()
-{
-    if (d_) {
-        lefFree(d_);
-    }
-
-    if (r_) {
-        lefFree(r_);
-    }
-
-    numAlloc_ = 2;
-    d_ = (double*) lefMalloc(sizeof(double) * 2);
-    r_ = (double*) lefMalloc(sizeof(double) * 2);
-    clear();
-}
-
-lefiAntennaPWL::~lefiAntennaPWL()
-{
-    Destroy();
-}
-
-void
-lefiAntennaPWL::Destroy()
-{
-    if (d_)
-        lefFree((char*) (d_));
-    if (r_)
-        lefFree((char*) (r_));
-}
-
-// Clear will reset the numPWL_ to zero but keep array allocated
-void
-lefiAntennaPWL::clear()
-{
-    numPWL_ = 0;
-}
-
-void
-lefiAntennaPWL::addAntennaPWL(double    d,
-                              double    r)
-{
-    if (numPWL_ == numAlloc_) {
-        int     i, len;
-        double  *nd;
-        double  *nr;
-
-        if (numAlloc_ == 0)
-            len = numAlloc_ = 2;
-        else
-            len = numAlloc_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * len);
-        nr = (double*) lefMalloc(sizeof(double) * len);
-
-        for (i = 0; i < numPWL_; i++) {
-            nd[i] = d_[i];
-            nr[i] = r_[i];
-        }
-        lefFree((char*) (d_));
-        lefFree((char*) (r_));
-        d_ = nd;
-        r_ = nr;
-    }
-    d_[numPWL_] = d;
-    r_[numPWL_] = r;
-    numPWL_ += 1;
-}
-
-int
-lefiAntennaPWL::numPWL() const
-{
-    return numPWL_;
-}
-
-double
-lefiAntennaPWL::PWLdiffusion(int index)
-{
-    if (index < 0 || index >= numPWL_)
-        return 0;
-    return d_[index];
-}
-
-double
-lefiAntennaPWL::PWLratio(int index)
-{
-    if (index < 0 || index >= numPWL_)
-        return 0;
-    return r_[index];
-}
-
-// *****************************************************************************
-// lefiLayerDensity
-// *****************************************************************************
-lefiLayerDensity::lefiLayerDensity()
-{
-}
-
-void
-lefiLayerDensity::Init(const char *type)
-{
-    int len = strlen(type) + 1;
-    type_ = (char*) lefMalloc(len);
-    strcpy(type_, CASE(type));
-    oneEntry_ = 0;
-    numFrequency_ = 0;
-    frequency_ = 0;
-    numWidths_ = 0;
-    widths_ = 0;
-    numTableEntries_ = 0;
-    tableEntries_ = 0;
-    numCutareas_ = 0;
-    cutareas_ = 0;
-}
-
-void
-lefiLayerDensity::Destroy()
-{
-    if (type_)
-        lefFree((char*) (type_));
-    if (frequency_)
-        lefFree((char*) (frequency_));
-    if (widths_)
-        lefFree((char*) (widths_));
-    if (tableEntries_)
-        lefFree((char*) (tableEntries_));
-    if (cutareas_)
-        lefFree((char*) (cutareas_));
-}
-
-lefiLayerDensity::~lefiLayerDensity()
-{
-    Destroy();
-}
-
-void
-lefiLayerDensity::setOneEntry(double entry)
-{
-    oneEntry_ = entry;
-}
-
-void
-lefiLayerDensity::addFrequency(int      num,
-                               double   *frequency)
-{
-    numFrequency_ = num;
-    frequency_ = frequency;
-}
-
-void
-lefiLayerDensity::addWidth(int      num,
-                           double   *width)
-{
-    numWidths_ = num;
-    widths_ = width;
-}
-
-void
-lefiLayerDensity::addTableEntry(int     num,
-                                double  *entry)
-{
-    numTableEntries_ = num;
-    tableEntries_ = entry;
-}
-
-void
-lefiLayerDensity::addCutarea(int    num,
-                             double *cutarea)
-{
-    numCutareas_ = num;
-    cutareas_ = cutarea;
-}
-
-int
-lefiLayerDensity::hasOneEntry() const
-{
-    return oneEntry_ ? 1 : 0;
-}
-
-char *
-lefiLayerDensity::type() const
-{
-    return type_;
-}
-
-double
-lefiLayerDensity::oneEntry() const
-{
-    return oneEntry_;
-}
-
-int
-lefiLayerDensity::numFrequency() const
-{
-    return numFrequency_;
-}
-
-double
-lefiLayerDensity::frequency(int index) const
-{
-    return frequency_[index];
-}
-
-int
-lefiLayerDensity::numWidths() const
-{
-    return numWidths_;
-}
-
-double
-lefiLayerDensity::width(int index) const
-{
-    return widths_[index];
-}
-
-int
-lefiLayerDensity::numTableEntries() const
-{
-    return numTableEntries_;
-}
-
-double
-lefiLayerDensity::tableEntry(int index) const
-{
-    return tableEntries_[index];
-}
-
-int
-lefiLayerDensity::numCutareas() const
-{
-    return numCutareas_;
-}
-
-double
-lefiLayerDensity::cutArea(int index) const
-{
-    return cutareas_[index];
-}
-
-// *****************************************************************************
-// lefiParallel
-// *****************************************************************************
-
-lefiParallel::lefiParallel()
-{
-    Init();
-}
-
-void
-lefiParallel::Init()
-{
-    numLength_ = 0;
-    numWidth_ = 0;
-    numWidthAllocated_ = 0;
-}
-
-void
-lefiParallel::Destroy()
-{
-
-    if (numLength_)
-        lefFree((char*) (length_));
-    if (numWidth_) {
-        lefFree((char*) (width_));
-        lefFree((char*) (widthSpacing_));
-    }
-    Init();
-}
-
-lefiParallel::~lefiParallel()
-{
-    Destroy();
-}
-
-void
-lefiParallel::addParallelLength(int     numLength,
-                                double  *lengths)
-{
-    numLength_ = numLength;
-    length_ = lengths;
-}
-
-void
-lefiParallel::addParallelWidth(double width)
-{
-    if (numWidth_ == numWidthAllocated_) {
-        int     i, numLength;
-        double  *nw;
-        double  *nws;
-
-        numWidthAllocated_ = numWidthAllocated_ ?
-            numWidthAllocated_ * 2 : 2;
-        nw = (double*) lefMalloc(sizeof(double) * numWidthAllocated_);
-        numLength = numLength_;
-        if (numLength > 0)
-            nws = (double*) lefMalloc(sizeof(double) * (numWidthAllocated_ *
-                                                        numLength_));
-        else {
-            // still want to move anything already there 
-            nws = (double*) lefMalloc(sizeof(double) * numWidthAllocated_);
-            numLength = 1;
-        }
-
-        for (i = 0; i < numWidth_; i++)
-            nw[i] = width_[i];
-        for (i = 0; i < (numWidth_ * numLength); i++)
-            nws[i] = widthSpacing_[i];
-        if (numWidth_) {
-            lefFree((char*) (width_));
-            lefFree((char*) (widthSpacing_));
-        }
-        width_ = nw;
-        widthSpacing_ = nws;
-    }
-    width_[numWidth_] = width;
-    numWidth_ += 1;
-}
-
-void
-lefiParallel::addParallelWidthSpacing(int       numSpacing,
-                                      double    *spacings)
-{
-    int i;
-    for (i = 0; i < numSpacing; i++)
-        widthSpacing_[(numWidth_ - 1) * numLength_ + i] =
-            spacings[i];
-}
-
-int
-lefiParallel::numLength() const
-{
-    return numLength_;
-}
-
-int
-lefiParallel::numWidth() const
-{
-    return numWidth_;
-}
-
-double
-lefiParallel::length(int index) const
-{
-    return length_[index];
-}
-
-double
-lefiParallel::width(int index) const
-{
-    return width_[index];
-}
-
-double
-lefiParallel::widthSpacing(int  iWidth,
-                           int  iWidthSpacing) const
-{
-    return widthSpacing_[iWidth * numLength_ + iWidthSpacing];
-}
-
-// *****************************************************************************
-// lefiInfluence
-// *****************************************************************************
-
-lefiInfluence::lefiInfluence()
-{
-    Init();
-}
-
-void
-lefiInfluence::Init()
-{
-    numAllocated_ = 0;
-    numWidth_ = 0;
-    numDistance_ = 0;
-    numSpacing_ = 0;
-}
-
-void
-lefiInfluence::Destroy()
-{
-    if (numWidth_) {
-        lefFree((char*) (width_));
-        lefFree((char*) (distance_));
-        lefFree((char*) (spacing_));
-    }
-    Init();
-}
-
-lefiInfluence::~lefiInfluence()
-{
-    Destroy();
-}
-
-void
-lefiInfluence::addInfluence(double  width,
-                            double  distance,
-                            double  spacing)
-{
-    int     i;
-    double  *nw;
-    double  *nd;
-    double  *ns;
-
-    if (numWidth_ == numAllocated_) {
-        numAllocated_ = numAllocated_ ?
-            numAllocated_ * 2 : 2;
-        nw = (double*) lefMalloc(sizeof(double) * numAllocated_);
-        nd = (double*) lefMalloc(sizeof(double) * numAllocated_);
-        ns = (double*) lefMalloc(sizeof(double) * numAllocated_);
-
-        for (i = 0; i < numWidth_; i++) {
-            nw[i] = width_[i];
-            nd[i] = distance_[i];
-            ns[i] = spacing_[i];
-        }
-        if (numWidth_ > 0) {
-            lefFree((char*) (width_));
-            lefFree((char*) (distance_));
-            lefFree((char*) (spacing_));
-        }
-        width_ = nw;
-        distance_ = nd;
-        spacing_ = ns;
-    }
-    width_[numWidth_] = width;
-    distance_[numWidth_] = distance;
-    spacing_[numWidth_] = spacing;
-    numWidth_ += 1;
-}
-
-int
-lefiInfluence::numInfluenceEntry() const
-{
-    return numWidth_;
-}
-
-double
-lefiInfluence::width(int index) const
-{
-    return width_[index];
-}
-
-double
-lefiInfluence::distance(int index) const
-{
-    return distance_[index];
-}
-
-double
-lefiInfluence::spacing(int index) const
-{
-    return spacing_[index];
-}
-
-// *****************************************************************************
-// lefiTwoWidths
-// *****************************************************************************
-
-lefiTwoWidths::lefiTwoWidths()
-{
-    Init();
-}
-
-void
-lefiTwoWidths::Init()
-{
-    numWidth_ = 0;
-    numWidthAllocated_ = 0;
-}
-
-void
-lefiTwoWidths::Destroy()
-{
-
-    if (numWidth_) {
-        lefFree((char*) (width_));
-        lefFree((char*) (prl_));
-        lefFree((char*) (widthSpacing_));
-        lefFree((char*) (numWidthSpacing_));
-        lefFree((char*) (atNsp_));
-        lefFree((char*) (hasPRL_));
-    }
-    Init();
-}
-
-lefiTwoWidths::~lefiTwoWidths()
-{
-    Destroy();
-}
-
-void
-lefiTwoWidths::addTwoWidths(double  width,
-                            double  prl,
-                            int     numSpacing,
-                            double  *spacings,
-                            int     hasPRL)
-{
-    int i;
-
-    if (numWidth_ == numWidthAllocated_) {
-        double  *nw;
-        double  *np;
-        int     *nnws;
-        double  *nws;
-        int     *nat;
-        int     *nHasPrl;
-
-        numWidthAllocated_ = numWidthAllocated_ ?
-            numWidthAllocated_ * 2 : 2;
-        nw = (double*) lefMalloc(sizeof(double) * numWidthAllocated_);
-        np = (double*) lefMalloc(sizeof(double) * numWidthAllocated_);
-        nnws = (int*) lefMalloc(sizeof(int) * numWidthAllocated_);
-        nat = (int*) lefMalloc(sizeof(int) * numWidthAllocated_);
-        nHasPrl = (int*) lefMalloc(sizeof(int) * numWidthAllocated_);
-
-        for (i = 0; i < numWidth_; i++) {
-            nw[i] = width_[i];
-            np[i] = prl_[i];
-            nnws[i] = numWidthSpacing_[i];
-            nat[i] = atNsp_[i];
-            nHasPrl[i] = hasPRL_[i];
-        }
-        // The lefData->last value in atNsp_ is the lefData->last total number of spacing
-        if (numWidth_ > 0) {
-            nws = (double*) lefMalloc(sizeof(double) * (atNsp_[numWidth_ - 1]
-                                                        + numSpacing));
-            for (i = 0; i < atNsp_[numWidth_ - 1]; i++) {
-                nws[i] = widthSpacing_[i];
-            }
-        } else
-            nws = (double*) lefMalloc(sizeof(double) * numSpacing);
-
-        if (numWidth_) {
-            lefFree((char*) (width_));
-            lefFree((char*) (prl_));
-            lefFree((char*) (numWidthSpacing_));
-            lefFree((char*) (widthSpacing_));
-            lefFree((char*) (atNsp_));
-            lefFree((char*) (hasPRL_));
-        }
-        width_ = nw;
-        prl_ = np;
-        numWidthSpacing_ = nnws;
-        widthSpacing_ = nws;
-        atNsp_ = nat;
-        hasPRL_ = nHasPrl;
-    } else {  // need to allocate memory for widthSpacing_
-        double *nws;
-        nws = (double*) lefMalloc(sizeof(double) * (atNsp_[numWidth_ - 1]
-                                                    + numSpacing));
-        for (i = 0; i < atNsp_[numWidth_ - 1]; i++) {
-            nws[i] = widthSpacing_[i];
-        }
-        lefFree((char*) (widthSpacing_));
-        widthSpacing_ = nws;
-    }
-    width_[numWidth_] = width;
-    prl_[numWidth_] = prl;
-    hasPRL_[numWidth_] = hasPRL;
-    numWidthSpacing_[numWidth_] = numSpacing;
-    if (numWidth_ == 0) {
-        for (i = 0; i < numSpacing; i++)
-            widthSpacing_[i] = spacings[i];
-        atNsp_[0] = numSpacing;
-    } else {
-        for (i = 0; i < numSpacing; i++)
-            widthSpacing_[atNsp_[numWidth_ - 1] + i] = spacings[i];
-        atNsp_[numWidth_] = atNsp_[numWidth_ - 1] + numSpacing;
-    }
-    numWidth_ += 1;
-}
-
-int
-lefiTwoWidths::numWidth() const
-{
-    return numWidth_;
-}
-
-double
-lefiTwoWidths::width(int index) const
-{
-    return width_[index];
-}
-
-int
-lefiTwoWidths::hasWidthPRL(int index) const
-{
-    if (hasPRL_[index])
-        return 1;
-    return 0;
-}
-
-double
-lefiTwoWidths::widthPRL(int index) const
-{
-    return prl_[index];
-}
-
-int
-lefiTwoWidths::numWidthSpacing(int index) const
-{
-    return numWidthSpacing_[index];
-}
-
-double
-lefiTwoWidths::widthSpacing(int iWidth,
-                            int iWidthSpacing) const
-{
-    if (iWidth == 0)
-        return widthSpacing_[iWidthSpacing];
-    return widthSpacing_[atNsp_[iWidth - 1] + iWidthSpacing];
-}
-
-// *****************************************************************************
-// lefiSpacingTable
-// *****************************************************************************
-
-lefiSpacingTable::lefiSpacingTable()
-{
-    Init();
-}
-
-void
-lefiSpacingTable::Init()
-{
-    hasInfluence_ = 0;
-    parallel_ = 0;
-    influence_ = 0;
-    twoWidths_ = 0;             // 5.7
-}
-
-void
-lefiSpacingTable::Destroy()
-{
-    if ((hasInfluence_) && (influence_))
-        influence_->Destroy();
-    else if (parallel_) {
-        parallel_->Destroy();
-        lefFree((char*) parallel_);
-    }
-    if (influence_)
-        lefFree((char*) influence_);
-    if (twoWidths_) {
-        twoWidths_->Destroy();
-        lefFree((char*) twoWidths_);
-    }
-    Init();
-}
-
-lefiSpacingTable::~lefiSpacingTable()
-{
-    Destroy();
-}
-
-void
-lefiSpacingTable::addParallelLength(int     numLength,
-                                    double  *lengths)
-{
-    lefiParallel *parallel;
-
-    if (parallel_ == 0) {
-        parallel = (lefiParallel*) lefMalloc(sizeof(lefiParallel));
-        parallel->Init();
-        parallel_ = parallel;
-    } else
-        parallel = parallel_;
-    parallel->addParallelLength(numLength, lengths);
-}
-
-void
-lefiSpacingTable::addParallelWidth(double width)
-{
-    lefiParallel *parallel;
-
-    parallel = parallel_;
-    parallel->addParallelWidth(width);
-}
-
-void
-lefiSpacingTable::addParallelWidthSpacing(int       numSpacing,
-                                          double    *spacings)
-{
-    lefiParallel *parallel;
-
-    parallel = parallel_;
-    parallel->addParallelWidthSpacing(numSpacing, spacings);
-}
-
-void
-lefiSpacingTable::setInfluence()
-{
-    lefiInfluence *influence;
-
-    influence = (lefiInfluence*) lefMalloc(sizeof(lefiInfluence));
-    influence->Init();
-    influence_ = influence;
-    hasInfluence_ = 1;
-}
-
-void
-lefiSpacingTable::addInfluence(double   width,
-                               double   distance,
-                               double   spacing)
-{
-    lefiInfluence *influence;
-
-    influence = influence_;
-    influence->addInfluence(width, distance, spacing);
-}
-
-int
-lefiSpacingTable::isInfluence() const
-{
-    return hasInfluence_ ? 1 : 0;
-}
-
-int
-lefiSpacingTable::isParallel() const
-{
-    return parallel_ ? 1 : 0;
-}
-
-lefiInfluence *
-lefiSpacingTable::influence() const
-{
-    return influence_;
-}
-
-lefiParallel *
-lefiSpacingTable::parallel() const
-{
-    return parallel_;
-}
-
-lefiTwoWidths *
-lefiSpacingTable::twoWidths() const
-{
-    return twoWidths_;
-}
-
-// 5.7
-void
-lefiSpacingTable::addTwoWidths(double   width,
-                               double   runLength,
-                               int      numSpacing,
-                               double   *spacings,
-                               int      hasPRL)
-{
-    lefiTwoWidths *twoWidths;
-
-    if (twoWidths_ == 0) {
-        twoWidths = (lefiTwoWidths*) lefMalloc(sizeof(lefiTwoWidths));
-        twoWidths->Init();
-        twoWidths_ = twoWidths;
-    } else
-        twoWidths = twoWidths_;
-    twoWidths->addTwoWidths(width, runLength, numSpacing,
-                            spacings, hasPRL);
-}
-
-// *****************************************************************************
-// lefiOrthogonal
-// *****************************************************************************
-
-lefiOrthogonal::lefiOrthogonal()
-{
-    Init();
-}
-
-void
-lefiOrthogonal::Init()
-{
-    numAllocated_ = 0;
-    numCutOrtho_ = 0;
-    cutWithin_ = 0;
-    ortho_ = 0;
-}
-
-lefiOrthogonal::~lefiOrthogonal()
-{
-    Destroy();
-}
-
-void
-lefiOrthogonal::Destroy()
-{
-    if (cutWithin_)
-        lefFree((char*) (cutWithin_));
-    if (ortho_)
-        lefFree((char*) (ortho_));
-    numAllocated_ = 0;
-    numCutOrtho_ = 0;
-}
-
-void
-lefiOrthogonal::addOrthogonal(double    cutWithin,
-                              double    ortho)
-{
-    int     i, len;
-    double  *cw;
-    double  *ot;
-
-    if (numAllocated_ == numCutOrtho_) {
-        if (numAllocated_ == 0)
-            len = numAllocated_ = 2;
-        else
-            len = numAllocated_ *= 2;
-        cw = (double*) lefMalloc(sizeof(double) * len);
-        ot = (double*) lefMalloc(sizeof(double) * len);
-
-        for (i = 0; i < numCutOrtho_; i++) {
-            cw[i] = cutWithin_[i];
-            ot[i] = ortho_[i];
-        }
-        if (cutWithin_)
-            lefFree((char*) (cutWithin_));
-        if (ortho_)
-            lefFree((char*) (ortho_));
-        cutWithin_ = cw;
-        ortho_ = ot;
-    }
-    cutWithin_[numCutOrtho_] = cutWithin;
-    ortho_[numCutOrtho_] = ortho;
-    numCutOrtho_ += 1;
-}
-
-int
-lefiOrthogonal::numOrthogonal() const
-{
-    return numCutOrtho_;
-}
-
-double
-lefiOrthogonal::cutWithin(int index) const
-{
-    if (index < 0 || index >= numCutOrtho_)
-        return 0;
-    return cutWithin_[index];
-}
-
-double
-lefiOrthogonal::orthoSpacing(int index) const
-{
-    if (index < 0 || index >= numCutOrtho_)
-        return 0;
-    return ortho_[index];
-}
-
-// *****************************************************************************
-// lefiAntennaModel
-// *****************************************************************************
-
-lefiAntennaModel::lefiAntennaModel()
-{
-    Init();
-}
-
-void
-lefiAntennaModel::Init()
-{
-    hasAntennaAreaRatio_ = 0;
-    hasAntennaDiffAreaRatio_ = 0;
-    hasAntennaDiffAreaRatioPWL_ = 0;
-    hasAntennaCumAreaRatio_ = 0;
-    hasAntennaCumDiffAreaRatio_ = 0;
-    hasAntennaCumDiffAreaRatioPWL_ = 0;
-    hasAntennaAreaFactor_ = 0;
-    hasAntennaAreaFactorDUO_ = 0;
-    hasAntennaSideAreaRatio_ = 0;
-    hasAntennaDiffSideAreaRatio_ = 0;
-    hasAntennaDiffSideAreaRatioPWL_ = 0;
-    hasAntennaCumSideAreaRatio_ = 0;
-    hasAntennaCumDiffSideAreaRatio_ = 0;
-    hasAntennaCumDiffSideAreaRatioPWL_ = 0;
-    hasAntennaSideAreaFactor_ = 0;
-    hasAntennaSideAreaFactorDUO_ = 0;
-    hasAntennaCumRoutingPlusCut_ = 0;     // 5.7
-    hasAntennaGatePlusDiff_ = 0;          // 5.7
-    hasAntennaAreaMinusDiff_ = 0;         // 5.7
-    antennaDiffAreaRatioPWL_ = 0;
-    antennaCumDiffAreaRatioPWL_ = 0;
-    antennaDiffSideAreaRatioPWL_ = 0;
-    antennaCumDiffSideAreaRatioPWL_ = 0;
-    antennaAreaDiffReducePWL_ = 0;         // 5.7
-    oxide_ = 0;
-}
-
-void
-lefiAntennaModel::Destroy()
-{
-    if (oxide_) {
-        lefFree((char*) (oxide_));
-    }
-
-    if (antennaDiffAreaRatioPWL_) {
-        antennaDiffAreaRatioPWL_->Destroy();
-        lefFree((char*) (antennaDiffAreaRatioPWL_));
-        antennaDiffAreaRatioPWL_ = 0;
-    }
-    
-    if (antennaCumDiffAreaRatioPWL_) {
-        antennaCumDiffAreaRatioPWL_->Destroy();
-        lefFree((char*) (antennaCumDiffAreaRatioPWL_));
-        antennaCumDiffAreaRatioPWL_ = 0;
-    }
-    
-    if (antennaDiffSideAreaRatioPWL_) {
-        antennaDiffSideAreaRatioPWL_->Destroy();
-        lefFree((char*) (antennaDiffSideAreaRatioPWL_));
-        antennaDiffSideAreaRatioPWL_ = 0;
-    }
-    
-    if (antennaCumDiffSideAreaRatioPWL_) {
-        antennaCumDiffSideAreaRatioPWL_->Destroy();
-        lefFree((char*) (antennaCumDiffSideAreaRatioPWL_));
-        antennaCumDiffSideAreaRatioPWL_ = 0;
-    }
-    
-    if (antennaAreaDiffReducePWL_) {    // 5.7
-        antennaAreaDiffReducePWL_->Destroy();
-        lefFree((char*) (antennaAreaDiffReducePWL_));
-        antennaAreaDiffReducePWL_ = 0;
-    }
-
-    Init();
-}
-
-lefiAntennaModel::~lefiAntennaModel()
-{
-    Destroy();
-}
-
-// 5.5
-void
-lefiAntennaModel::setAntennaModel(int aOxide)
-{
-    if (oxide_)
-        lefFree((char*) (oxide_));
-    switch (aOxide) {
-    case 2:
-        oxide_ = strdup("OXIDE2");
-        break;
-    case 3:
-        oxide_ = strdup("OXIDE3");
-        break;
-    case 4:
-        oxide_ = strdup("OXIDE4");
-        break;
-    default:
-        oxide_ = strdup("OXIDE1");
-        break;
-    }
-}
-
-// 3/23/2000 -- Wanda da Rosa.  The following are for 5.4 syntax
-void
-lefiAntennaModel::setAntennaAreaRatio(double value)
-{
-    antennaAreaRatio_ = value;
-    hasAntennaAreaRatio_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaCumAreaRatio(double value)
-{
-    antennaCumAreaRatio_ = value;
-    hasAntennaCumAreaRatio_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaAreaFactor(double value)
-{
-    antennaAreaFactor_ = value;
-    hasAntennaAreaFactor_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaSideAreaRatio(double value)
-{
-    antennaSideAreaRatio_ = value;
-    hasAntennaSideAreaRatio_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaCumSideAreaRatio(double value)
-{
-    antennaCumSideAreaRatio_ = value;
-    hasAntennaCumSideAreaRatio_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaSideAreaFactor(double value)
-{
-    antennaSideAreaFactor_ = value;
-    hasAntennaSideAreaFactor_ = 1;
-}
-
-void
-lefiAntennaModel::setAntennaValue(lefiAntennaEnum   antennaType,
-                                  double            value)
-{
-    switch (antennaType) {
-    case lefiAntennaDAR:
-        antennaDiffAreaRatio_ = value;
-        hasAntennaDiffAreaRatio_ = 1;
-        break;
-    case lefiAntennaCDAR:
-        antennaCumDiffAreaRatio_ = value;
-        hasAntennaCumDiffAreaRatio_ = 1;
-        break;
-    case lefiAntennaDSAR:
-        antennaDiffSideAreaRatio_ = value;
-        hasAntennaDiffSideAreaRatio_ = 1;
-        break;
-    case lefiAntennaCDSAR:
-        antennaCumDiffSideAreaRatio_ = value;
-        hasAntennaCumDiffSideAreaRatio_ = 1;
-        break;
-    default:
-        break;
-    }
-}
-
-void
-lefiAntennaModel::setAntennaDUO(lefiAntennaEnum antennaType)
-{
-    switch (antennaType) {
-    case lefiAntennaAF:
-        hasAntennaAreaFactorDUO_ = 1;
-        break;
-    case lefiAntennaSAF:
-        hasAntennaSideAreaFactorDUO_ = 1;
-        break;
-    default:
-        break;
-    }
-}
-
-// This function 'consumes' data of pwl pointer and send it to the new owner. 
-// After calling the function 'pwl' should be set to NULL or assigned a new 
-// value. 
-void
-lefiAntennaModel::setAntennaPWL(lefiAntennaEnum antennaType,
-                                lefiAntennaPWL  *pwl)
-{
-    switch (antennaType) {
-    case lefiAntennaDAR:
-        if (antennaDiffAreaRatioPWL_) {
-            antennaDiffAreaRatioPWL_->Destroy();
-            lefFree(antennaDiffAreaRatioPWL_);
-        }
-
-        antennaDiffAreaRatioPWL_ = pwl;
-        break;
-
-    case lefiAntennaCDAR:
-        if (antennaCumDiffAreaRatioPWL_) {
-            antennaCumDiffAreaRatioPWL_->Destroy();
-            lefFree(antennaCumDiffAreaRatioPWL_);
-        }
-
-        antennaCumDiffAreaRatioPWL_ = pwl;
-        break;
-
-    case lefiAntennaDSAR:
-        if (antennaDiffSideAreaRatioPWL_) {
-            antennaDiffSideAreaRatioPWL_->Destroy();
-            lefFree(antennaDiffSideAreaRatioPWL_);
-        }
-
-        antennaDiffSideAreaRatioPWL_ = pwl;
-        break;
-
-    case lefiAntennaCDSAR:
-        if (antennaCumDiffSideAreaRatioPWL_) {
-            antennaCumDiffSideAreaRatioPWL_->Destroy();
-            lefFree(antennaCumDiffSideAreaRatioPWL_);
-        }
-
-        antennaCumDiffSideAreaRatioPWL_ = pwl;
-        break;
-
-    case lefiAntennaADR:
-        if (antennaAreaDiffReducePWL_) {
-            antennaAreaDiffReducePWL_->Destroy();
-            lefFree(antennaAreaDiffReducePWL_);
-        }
-
-        antennaAreaDiffReducePWL_ = pwl;
-        break;
-
-    default:
-        pwl->Destroy();
-        lefFree(pwl);
-        break;
-    }
-}
-
-// 5.7
-void
-lefiAntennaModel::setAntennaCumRoutingPlusCut()
-{
-    hasAntennaCumRoutingPlusCut_ = 1;
-}
-
-// 5.7
-void
-lefiAntennaModel::setAntennaGatePlusDiff(double value)
-{
-    antennaGatePlusDiff_ = value;
-    hasAntennaGatePlusDiff_ = 1;
-}
-
-// 5.7
-void
-lefiAntennaModel::setAntennaAreaMinusDiff(double value)
-{
-    antennaAreaMinusDiff_ = value;
-    hasAntennaAreaMinusDiff_ = 1;
-}
-
-int
-lefiAntennaModel::hasAntennaAreaRatio() const
-{
-    return hasAntennaAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaDiffAreaRatio() const
-{
-    return hasAntennaDiffAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaCumAreaRatio() const
-{
-    return hasAntennaCumAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaCumDiffAreaRatio() const
-{
-    return hasAntennaCumDiffAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaAreaFactor() const
-{
-    return hasAntennaAreaFactor_;
-}
-
-int
-lefiAntennaModel::hasAntennaSideAreaRatio() const
-{
-    return hasAntennaSideAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaDiffSideAreaRatio() const
-{
-    return hasAntennaDiffSideAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaCumSideAreaRatio() const
-{
-    return hasAntennaCumSideAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaCumDiffSideAreaRatio() const
-{
-    return hasAntennaCumDiffSideAreaRatio_;
-}
-
-int
-lefiAntennaModel::hasAntennaSideAreaFactor() const
-{
-    return hasAntennaSideAreaFactor_;
-}
-
-int
-lefiAntennaModel::hasAntennaDiffAreaRatioPWL() const
-{
-    return antennaDiffAreaRatioPWL_ ? 1 : 0;
-}
-
-int
-lefiAntennaModel::hasAntennaCumDiffAreaRatioPWL() const
-{
-    return antennaCumDiffAreaRatioPWL_ ? 1 : 0;
-}
-
-int
-lefiAntennaModel::hasAntennaDiffSideAreaRatioPWL() const
-{
-    return antennaDiffSideAreaRatioPWL_ ? 1 : 0;
-}
-
-int
-lefiAntennaModel::hasAntennaCumDiffSideAreaRatioPWL() const
-{
-    return antennaCumDiffSideAreaRatioPWL_ ? 1 : 0;
-}
-
-int
-lefiAntennaModel::hasAntennaAreaFactorDUO() const
-{
-    return hasAntennaAreaFactorDUO_;
-}
-
-int
-lefiAntennaModel::hasAntennaSideAreaFactorDUO() const
-{
-    return hasAntennaSideAreaFactorDUO_;
-}
-
-// 5.7
-int
-lefiAntennaModel::hasAntennaCumRoutingPlusCut() const
-{
-    return hasAntennaCumRoutingPlusCut_;
-}
-
-// 5.7
-int
-lefiAntennaModel::hasAntennaGatePlusDiff() const
-{
-    return hasAntennaGatePlusDiff_;
-}
-
-// 5.7
-int
-lefiAntennaModel::hasAntennaAreaMinusDiff() const
-{
-    return hasAntennaAreaMinusDiff_;
-}
-
-// 5.7
-int
-lefiAntennaModel::hasAntennaAreaDiffReducePWL() const
-{
-    return antennaAreaDiffReducePWL_ ? 1 : 0;
-}
-
-// 5.5
-char *
-lefiAntennaModel::antennaOxide() const
-{
-    return oxide_;
-}
-
-double
-lefiAntennaModel::antennaAreaRatio() const
-{
-    return antennaAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaDiffAreaRatio() const
-{
-    return antennaDiffAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaCumAreaRatio() const
-{
-    return antennaCumAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaCumDiffAreaRatio() const
-{
-    return antennaCumDiffAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaAreaFactor() const
-{
-    return antennaAreaFactor_;
-}
-
-double
-lefiAntennaModel::antennaSideAreaRatio() const
-{
-    return antennaSideAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaDiffSideAreaRatio() const
-{
-    return antennaDiffSideAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaCumSideAreaRatio() const
-{
-    return antennaCumSideAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaCumDiffSideAreaRatio() const
-{
-    return antennaCumDiffSideAreaRatio_;
-}
-
-double
-lefiAntennaModel::antennaSideAreaFactor() const
-{
-    return antennaSideAreaFactor_;
-}
-
-lefiAntennaPWL *
-lefiAntennaModel::antennaDiffAreaRatioPWL() const
-{
-    return antennaDiffAreaRatioPWL_;
-}
-
-lefiAntennaPWL *
-lefiAntennaModel::antennaCumDiffAreaRatioPWL() const
-{
-    return antennaCumDiffAreaRatioPWL_;
-}
-
-lefiAntennaPWL *
-lefiAntennaModel::antennaDiffSideAreaRatioPWL() const
-{
-    return antennaDiffSideAreaRatioPWL_;
-}
-
-lefiAntennaPWL *
-lefiAntennaModel::antennaCumDiffSideAreaRatioPWL() const
-{
-    return antennaCumDiffSideAreaRatioPWL_;
-}
-
-// 5.7
-double
-lefiAntennaModel::antennaGatePlusDiff() const
-{
-    return antennaGatePlusDiff_;
-}
-
-// 5.7
-double
-lefiAntennaModel::antennaAreaMinusDiff() const
-{
-    return antennaAreaMinusDiff_;
-}
-
-// 5.7
-lefiAntennaPWL *
-lefiAntennaModel::antennaAreaDiffReducePWL() const
-{
-    return antennaAreaDiffReducePWL_;
-}
-
-// *****************************************************************************
-// lefiLayer
-// *****************************************************************************
-lefiLayer::lefiLayer()
-: name_(NULL),
-  nameSize_(0),
-  type_(NULL),
-  typeSize_(0),
-  layerType_(NULL),
-  hasPitch_(0),
-  hasMask_(0),
-  hasOffset_(0),
-  hasWidth_(0),
-  hasArea_(0),
-  hasSpacing_(0),
-  hasDiagPitch_(0),
-  hasDiagWidth_(0),
-  hasDiagSpacing_(0),
-  hasSpacingName_(NULL),
-  hasSpacingLayerStack_(NULL),
-  hasSpacingAdjacent_(NULL),
-  hasSpacingRange_(NULL),
-  hasSpacingUseLengthThreshold_(NULL),
-  hasSpacingLengthThreshold_(NULL),
-  hasSpacingCenterToCenter_(NULL),
-  hasSpacingParallelOverlap_(NULL),
-  hasSpacingCutArea_(NULL),
-  hasSpacingEndOfLine_(NULL),
-  hasSpacingParellelEdge_(NULL),
-  hasSpacingTwoEdges_(NULL),
-  hasSpacingAdjacentExcept_(NULL),
-  hasSpacingSamenet_(NULL),
-  hasSpacingSamenetPGonly_(NULL),
-  hasArraySpacing_(0),
-  hasDirection_(0),
-  hasResistance_(0),
-  hasCapacitance_(0),
-  hasHeight_(0),
-  hasWireExtension_(0),
-  hasThickness_(0),
-  hasShrinkage_(0),
-  hasCapMultiplier_(0),
-  hasEdgeCap_(0),
-  hasAntennaArea_(0),
-  hasAntennaLength_(0),
-  hasCurrentDensityPoint_(0),
-  currentDensity_(0.0),
-  pitchX_(0.0),
-  pitchY_(0.0),
-  offsetX_(0.0),
-  offsetY_(0.0),
-  diagPitchX_(0.0),
-  diagPitchY_(0.0),
-  diagWidth_(0.0),
-  diagSpacing_(0.0),
-  width_(0.0),
-  area_(0.0),
-  wireExtension_(0.0),
-  numSpacings_(0),
-  spacingsAllocated_(0),
-  maskNumber_(0),
-  spacing_(NULL),
-  spacingAdjacentCuts_(NULL),
-  spacingAdjacentWithin_(NULL),
-  spacingCutArea_(NULL),
-  rangeMin_(NULL),
-  rangeMax_(NULL),
-  rangeInfluence_(NULL),
-  rangeInfluenceRangeMin_(NULL),
-  rangeInfluenceRangeMax_(NULL),
-  rangeRangeMin_(NULL),
-  rangeRangeMax_(NULL),
-  lengthThreshold_(NULL),
-  lengthThresholdRangeMin_(NULL),
-  lengthThresholdRangeMax_(NULL),
-  numMinimumcut_(0),
-  minimumcutAllocated_(0),
-  minimumcut_(NULL),
-  minimumcutWidth_(NULL),
-  hasMinimumcutWithin_(NULL),
-  minimumcutWithin_(NULL),
-  hasMinimumcutConnection_(NULL),
-  hasMinimumcutNumCuts_(NULL),
-  minimumcutLength_(NULL),
-  minimumcutDistance_(NULL),
-  maxwidth_(0.0),
-  minwidth_(0.0),
-  numMinenclosedarea_(0),
-  minenclosedareaAllocated_(0),
-  minenclosedarea_(NULL),
-  minenclosedareaWidth_(NULL),
-  protrusionWidth1_(0.0),
-  protrusionLength_(0.0),
-  protrusionWidth2_(0.0),
-  numMinstep_(0),
-  numMinstepAlloc_(0),
-  minstep_(NULL),
-  minstepLengthsum_(NULL),
-  minstepMaxEdges_(NULL),
-  minstepMinAdjLength_(NULL),
-  minstepMinBetLength_(NULL),
-  minstepXSameCorners_(NULL),
-  direction_(NULL),
-  resistance_(0.0),
-  capacitance_(0.0),
-  height_(0.0),
-  thickness_(0.0),
-  shrinkage_(0.0),
-  capMultiplier_(0.0),
-  edgeCap_(0.0),
-  antennaArea_(0.0),
-  antennaLength_(0.0),
-  numCurrentPoints_(0),
-  currentPointsAllocated_(0),
-  currentWidths_(NULL),
-  current_(NULL),
-  numCapacitancePoints_(0),
-  capacitancePointsAllocated_(0),
-  capacitanceWidths_(NULL),
-  capacitances_(NULL),
-  numResistancePoints_(0),
-  resistancePointsAllocated_(0),
-  resistanceWidths_(NULL),
-  resistances_(NULL),
-  numProps_(0),
-  propsAllocated_(0),
-  dvalues_(NULL),
-  types_(NULL),
-  numAccurrents_(0),
-  accurrentAllocated_(0),
-  accurrents_(NULL),
-  numDccurrents_(0),
-  dccurrentAllocated_(0),
-  dccurrents_(NULL),
-  numNums_(0),
-  numAllocated_(0),
-  nums_(NULL),
-  hasAntennaAreaRatio_(0),
-  hasAntennaDiffAreaRatio_(0),
-  hasAntennaDiffAreaRatioPWL_(0),
-  hasAntennaCumAreaRatio_(0),
-  hasAntennaCumDiffAreaRatio_(0),
-  hasAntennaCumDiffAreaRatioPWL_(0),
-  hasAntennaAreaFactor_(0),
-  hasAntennaAreaFactorDUO_(0),
-  hasAntennaSideAreaRatio_(0),
-  hasAntennaDiffSideAreaRatio_(0),
-  hasAntennaDiffSideAreaRatioPWL_(0),
-  hasAntennaCumSideAreaRatio_(0),
-  hasAntennaCumDiffSideAreaRatio_(0),
-  hasAntennaCumDiffSideAreaRatioPWL_(0),
-  hasAntennaSideAreaFactor_(0),
-  hasAntennaSideAreaFactorDUO_(0),
-  currentAntennaModel_(0),
-  numAntennaModel_(0),
-  antennaModelAllocated_(0),
-  antennaModel_(NULL),
-  hasSlotWireWidth_(0),
-  hasSlotWireLength_(0),
-  hasSlotWidth_(0),
-  hasSlotLength_(0),
-  hasMaxAdjacentSlotSpacing_(0),
-  hasMaxCoaxialSlotSpacing_(0),
-  hasMaxEdgeSlotSpacing_(0),
-  hasSplitWireWidth_(0),
-  hasMinimumDensity_(0),
-  hasMaximumDensity_(0),
-  hasDensityCheckWindow_(0),
-  hasDensityCheckStep_(0),
-  hasFillActiveSpacing_(0),
-  hasTwoWidthPRL_(0),
-  slotWireWidth_(0.0),
-  slotWireLength_(0.0),
-  slotWidth_(0.0),
-  slotLength_(0.0),
-  maxAdjacentSlotSpacing_(0.0),
-  maxCoaxialSlotSpacing_(0.0),
-  maxEdgeSlotSpacing_(0.0),
-  splitWireWidth_(0.0),
-  minimumDensity_(0.0),
-  maximumDensity_(0.0),
-  densityCheckWindowLength_(0.0),
-  densityCheckWindowWidth_(0.0),
-  densityCheckStep_(0.0),
-  fillActiveSpacing_(0.0),
-  numSpacingTable_(0),
-  spacingTableAllocated_(0),
-  spacingTable_(NULL),
-  numEnclosure_(0),
-  enclosureAllocated_(0),
-  overhang1_(NULL),
-  overhang2_(NULL),
-  encminWidth_(NULL),
-  cutWithin_(NULL),
-  minLength_(NULL),
-  numPreferEnclosure_(0),
-  preferEnclosureAllocated_(0),
-  preferOverhang1_(NULL),
-  preferOverhang2_(NULL),
-  preferMinWidth_(NULL),
-  resPerCut_(0.0),
-  diagMinEdgeLength_(0.0),
-  numMinSize_(0),
-  minSizeWidth_(NULL),
-  minSizeLength_(NULL),
-  eolWidth_(NULL),
-  eolWithin_(NULL),
-  parSpace_(NULL),
-  parWithin_(NULL),
-  maxArea_(0.0),
-  hasLongArray_(0),
-  viaWidth_(0.0),
-  cutSpacing_(0.0),
-  numArrayCuts_(0),
-  arrayCutsAllocated_(0),
-  arrayCuts_(NULL),
-  arraySpacings_(NULL),
-  hasSpacingTableOrtho_(0),
-  spacingTableOrtho_(NULL),
-  notchLength_(NULL),
-  endOfNotchWidth_(NULL),
-  minNotchSpacing_(NULL),
-  eonotchLength_(NULL)
-{
-    Init();
-}
-
-void
-lefiLayer::Init()
-{
-    name_ = (char*) lefMalloc(16);
-    nameSize_ = 16;
-    type_ = (char*) lefMalloc(16);
-    typeSize_ = 16;
-    layerType_ = 0;
-    numSpacings_ = 0;
-    spacingsAllocated_ = 0;
-    numMinimumcut_ = 0;
-    minimumcutAllocated_ = 0;
-    numMinenclosedarea_ = 0;
-    minenclosedareaAllocated_ = 0;
-    numCurrentPoints_ = 0;
-    currentPointsAllocated_ = 2;
-    currentWidths_ = (double*) lefMalloc(sizeof(double) * 2);
-    current_ = (double*) lefMalloc(sizeof(double) * 2);
-    numResistancePoints_ = 0;
-    resistancePointsAllocated_ = 2;
-    resistanceWidths_ = (double*) lefMalloc(sizeof(double) * 2);
-    resistances_ = (double*) lefMalloc(sizeof(double) * 2);
-    numCapacitancePoints_ = 0;
-    capacitancePointsAllocated_ = 2;
-    capacitanceWidths_ = (double*) lefMalloc(sizeof(double) * 2);
-    capacitances_ = (double*) lefMalloc(sizeof(double) * 2);
-    numProps_ = 0;
-    propsAllocated_ = 1;
-    names_ = (char**) lefMalloc(sizeof(char*));
-    values_ = (char**) lefMalloc(sizeof(char*));
-    dvalues_ = (double*) lefMalloc(sizeof(double));
-    types_ = (char*) lefMalloc(sizeof(char));
-    numAccurrents_ = 0;
-    accurrentAllocated_ = 0;
-    numDccurrents_ = 0;
-    dccurrentAllocated_ = 0;
-    numNums_ = 0;
-    numAllocated_ = 0;
-    hasTwoWidthPRL_ = 0;
-    numSpacingTable_ = 0;
-    spacingTableAllocated_ = 0;
-    numEnclosure_ = 0;
-    enclosureAllocated_ = 0;
-    numPreferEnclosure_ = 0;
-    preferEnclosureAllocated_ = 0;
-    numMinSize_ = 0;
-    numMinstepAlloc_ = 0;
-    numArrayCuts_ = 0;
-    arrayCutsAllocated_ = 0;
-    cutSpacing_ = 0;        // Initialize ARRAYSPACING
-    currentAntennaModel_ = 0;
-    numAntennaModel_ = 0;
-    antennaModelAllocated_ = 0;
-    antennaModel_ = 0;
-    hasSpacingTableOrtho_ = 0;
-    spacing_ = 0;
-    spacingName_ = 0;
-    spacingAdjacentCuts_ = 0;
-    spacingAdjacentWithin_ = 0;
-    hasSpacingName_ = 0;
-    hasSpacingLayerStack_ = 0;
-    hasSpacingAdjacent_ = 0;
-    hasSpacingCenterToCenter_ = 0;
-    hasSpacingParallelOverlap_ = 0;
-    hasSpacingEndOfLine_ = 0;
-    eolWidth_ = 0;
-    eolWithin_ = 0;
-    hasSpacingParellelEdge_ = 0;
-    parSpace_ = 0;
-    parWithin_ = 0;
-    hasSpacingTwoEdges_ = 0;
-    hasSpacingAdjacentExcept_ = 0;
-    hasSpacingSamenet_ = 0;
-    hasSpacingSamenetPGonly_ = 0;
-    hasSpacingCutArea_ = 0;
-    spacingCutArea_ = 0;
-    notchLength_ = 0;
-    endOfNotchWidth_ = 0;
-    minNotchSpacing_ = 0;
-    eonotchLength_ = 0;
-    rangeMin_ = 0;
-    rangeMax_ = 0;
-    rangeInfluence_ = 0;
-    rangeInfluenceRangeMin_ = 0;
-    rangeInfluenceRangeMax_ = 0;
-    rangeRangeMin_ = 0;
-    rangeRangeMax_ = 0;
-    lengthThreshold_ = 0;
-    lengthThresholdRangeMin_ = 0;
-    lengthThresholdRangeMax_ = 0;
-    hasSpacingRange_ = 0;
-    hasSpacingUseLengthThreshold_ = 0;
-    hasSpacingLengthThreshold_ = 0;
-    clear();
-}
-
-void
-lefiLayer::Destroy()
-{
-
-    clear();
-    lefFree(name_);
-    nameSize_ = 0;
-    lefFree(type_);
-    typeSize_ = 0;
-    if (spacing_)
-        lefFree((char*) (spacing_));
-    spacing_ = 0;
-    if (spacingTable_)
-        lefFree((char*) spacingTable_);
-    spacingTable_ = 0;
-    if (spacingName_)
-        lefFree((char*) (spacingName_));
-    spacingName_ = 0;
-    if (spacingAdjacentCuts_)
-        lefFree((char*) (spacingAdjacentCuts_));
-    spacingAdjacentCuts_ = 0;
-    if (spacingAdjacentWithin_)
-        lefFree((char*) (spacingAdjacentWithin_));
-    spacingAdjacentWithin_ = 0;
-    if (hasSpacingName_)
-        lefFree((char*) (hasSpacingName_));
-    hasSpacingName_ = 0;
-    if (hasSpacingLayerStack_)
-        lefFree((char*) (hasSpacingLayerStack_));
-    hasSpacingLayerStack_ = 0;
-    if (hasSpacingAdjacent_)
-        lefFree((char*) (hasSpacingAdjacent_));
-    hasSpacingAdjacent_ = 0;
-    if (hasSpacingCenterToCenter_)
-        lefFree((char*) (hasSpacingCenterToCenter_));
-    hasSpacingCenterToCenter_ = 0;
-    if (hasSpacingParallelOverlap_)
-        lefFree((char*) (hasSpacingParallelOverlap_));
-    hasSpacingParallelOverlap_ = 0;
-    if (hasSpacingEndOfLine_)
-        lefFree((char*) (hasSpacingEndOfLine_));
-    hasSpacingEndOfLine_ = 0;
-    if (eolWidth_)
-        lefFree((char*) (eolWidth_));
-    eolWidth_ = 0;
-    if (eolWithin_)
-        lefFree((char*) (eolWithin_));
-    eolWithin_ = 0;
-    if (hasSpacingParellelEdge_)
-        lefFree((char*) (hasSpacingParellelEdge_));
-    hasSpacingParellelEdge_ = 0;
-    if (parSpace_)
-        lefFree((char*) (parSpace_));
-    parSpace_ = 0;
-    if (parWithin_)
-        lefFree((char*) (parWithin_));
-    parWithin_ = 0;
-    if (hasSpacingTwoEdges_)
-        lefFree((char*) (hasSpacingTwoEdges_));
-    hasSpacingTwoEdges_ = 0;
-    if (hasSpacingAdjacentExcept_)
-        lefFree((char*) (hasSpacingAdjacentExcept_));
-    hasSpacingAdjacentExcept_ = 0;
-    if (hasSpacingSamenet_)
-        lefFree((char*) (hasSpacingSamenet_));
-    hasSpacingSamenet_ = 0;
-    if (hasSpacingSamenetPGonly_)
-        lefFree((char*) (hasSpacingSamenetPGonly_));
-    hasSpacingSamenetPGonly_ = 0;
-    if (hasSpacingCutArea_)
-        lefFree((char*) (hasSpacingCutArea_));
-    hasSpacingCutArea_ = 0;
-    if (spacingCutArea_)
-        lefFree((char*) (spacingCutArea_));
-    spacingCutArea_ = 0;
-    if (notchLength_)
-        lefFree((char*) (notchLength_));
-    notchLength_ = 0;
-    if (endOfNotchWidth_)
-        lefFree((char*) (endOfNotchWidth_));
-    endOfNotchWidth_ = 0;
-    if (minNotchSpacing_)
-        lefFree((char*) (minNotchSpacing_));
-    minNotchSpacing_ = 0;
-    if (eonotchLength_)
-        lefFree((char*) (eonotchLength_));
-    eonotchLength_ = 0;
-    if (rangeMin_)
-        lefFree((char*) (rangeMin_));
-    rangeMin_ = 0;
-    if (rangeMax_)
-        lefFree((char*) (rangeMax_));
-    rangeMax_ = 0;
-    if (rangeInfluence_)
-        lefFree((char*) (rangeInfluence_));
-    rangeInfluence_ = 0;
-    if (rangeInfluenceRangeMin_)
-        lefFree((char*) (rangeInfluenceRangeMin_));
-    rangeInfluenceRangeMin_ = 0;
-    if (rangeInfluenceRangeMax_)
-        lefFree((char*) (rangeInfluenceRangeMax_));
-    rangeInfluenceRangeMax_ = 0;
-    if (rangeRangeMin_)
-        lefFree((char*) (rangeRangeMin_));
-    rangeRangeMin_ = 0;
-    if (rangeRangeMax_)
-        lefFree((char*) (rangeRangeMax_));
-    rangeRangeMax_ = 0;
-    if (lengthThreshold_)
-        lefFree((char*) (lengthThreshold_));
-    lengthThreshold_ = 0;
-    if (lengthThresholdRangeMin_)
-        lefFree((char*) (lengthThresholdRangeMin_));
-    lengthThresholdRangeMin_ = 0;
-    if (lengthThresholdRangeMax_)
-        lefFree((char*) (lengthThresholdRangeMax_));
-    lengthThresholdRangeMax_ = 0;
-    if (hasSpacingRange_)
-        lefFree((char*) (hasSpacingRange_));
-    hasSpacingRange_ = 0;
-    if (hasSpacingUseLengthThreshold_)
-        lefFree((char*) (hasSpacingUseLengthThreshold_));
-    hasSpacingUseLengthThreshold_ = 0;
-    if (hasSpacingLengthThreshold_)
-        lefFree((char*) (hasSpacingLengthThreshold_));
-    hasSpacingLengthThreshold_ = 0;
-    lefFree((char*) (currentWidths_));
-    lefFree((char*) (current_));
-    lefFree((char*) (resistanceWidths_));
-    lefFree((char*) (resistances_));
-    lefFree((char*) (capacitanceWidths_));
-    lefFree((char*) (capacitances_));
-    lefFree((char*) (names_));
-    lefFree((char*) (values_));
-    lefFree((char*) (dvalues_));
-    lefFree((char*) (types_));
-    currentPointsAllocated_ = 0;
-    resistancePointsAllocated_ = 0;
-    capacitancePointsAllocated_ = 0;
-    propsAllocated_ = 0;
-}
-
-lefiLayer::~lefiLayer()
-{
-    Destroy();
-}
-
-void
-lefiLayer::clear()
-{
-    int                 i;
-    lefiLayerDensity    *p;
-    lefiSpacingTable    *sp;
-    lefiAntennaModel    *aO;         // 5.5
-
-    if (name_)
-        *(name_) = 0;
-    if (type_)
-        *(type_) = 0;
-    if (layerType_) {
-        lefFree(layerType_);
-        layerType_ = 0;
-    }
-    hasMask_ = 0;
-    hasPitch_ = 0;
-    hasOffset_ = 0;
-    hasWidth_ = 0;
-    hasArea_ = 0;
-    hasDiagPitch_ = 0;
-    hasDiagWidth_ = 0;
-    hasDiagSpacing_ = 0;
-    hasWireExtension_ = 0;
-    hasSpacing_ = 0;
-    hasDirection_ = 0;
-    hasResistance_ = 0;
-    hasCapacitance_ = 0;
-    hasHeight_ = 0;
-    hasThickness_ = 0;
-    hasShrinkage_ = 0;
-    hasCapMultiplier_ = 0;
-    hasEdgeCap_ = 0;
-    hasAntennaArea_ = 0;
-    hasAntennaLength_ = 0;
-    hasCurrentDensityPoint_ = 0;
-    for (i = 0; i < numSpacings_; i++)
-        if (spacingName_[i])
-            lefFree(spacingName_[i]);
-    for (i = 0; i < numProps_; i++) {
-        if (names_[i])
-            lefFree(names_[i]);
-        if (values_[i])
-            lefFree(values_[i]);
-        dvalues_[i] = 0;
-    }
-    numProps_ = 0;
-    numSpacings_ = 0;
-    numCurrentPoints_ = 0;
-    if (numAccurrents_) {
-        for (i = 0; i < numAccurrents_; i++) {
-            p = accurrents_[i];
-            p->Destroy();
-            lefFree((char*) p);
-        }
-        numAccurrents_ = 0;
-        accurrentAllocated_ = 0;
-        lefFree((char*) (accurrents_));
-        accurrents_ = 0;
-    }
-    if (numDccurrents_) {
-        for (i = 0; i < numDccurrents_; i++) {
-            p = dccurrents_[i];
-            p->Destroy();
-            lefFree((char*) p);
-        }
-        numDccurrents_ = 0;
-        dccurrentAllocated_ = 0;
-        lefFree((char*) (dccurrents_));
-        dccurrents_ = 0;
-    }
-    // 8/29/2001 - Wanda da Rosa.  The following are 5.4 enhancements
-    hasSlotWireWidth_ = 0;
-    hasSlotWireLength_ = 0;
-    hasSlotWidth_ = 0;
-    hasSlotLength_ = 0;
-    hasMaxAdjacentSlotSpacing_ = 0;
-    hasMaxCoaxialSlotSpacing_ = 0;
-    hasMaxEdgeSlotSpacing_ = 0;
-    hasSplitWireWidth_ = 0;
-    hasMinimumDensity_ = 0;
-    hasMaximumDensity_ = 0;
-    hasDensityCheckWindow_ = 0;
-    hasDensityCheckStep_ = 0;
-    hasTwoWidthPRL_ = 0;
-    hasFillActiveSpacing_ = 0;
-    // 5.5
-    if (numMinimumcut_ > 0) {
-        // Has allocated memories
-        lefFree((char*) (minimumcut_));
-        lefFree((char*) (minimumcutWidth_));
-        lefFree((char*) (hasMinimumcutWithin_));
-        lefFree((char*) (minimumcutWithin_));
-        lefFree((char*) (hasMinimumcutConnection_));
-        lefFree((char*) (hasMinimumcutNumCuts_));
-        lefFree((char*) (minimumcutLength_));
-        lefFree((char*) (minimumcutDistance_));
-        for (i = 0; i < numMinimumcut_; i++) {
-            if (minimumcutConnection_[i])
-                lefFree((char*) (minimumcutConnection_[i]));
-        }
-        lefFree((char*) (minimumcutConnection_));
-        numMinimumcut_ = 0;
-        minimumcutAllocated_ = 0;
-    }
-    maxwidth_ = -1;
-    minwidth_ = -1;
-    if (numMinenclosedarea_ > 0) {
-        lefFree((char*) (minenclosedarea_));
-        lefFree((char*) (minenclosedareaWidth_));
-        numMinenclosedarea_ = 0;
-        minenclosedareaAllocated_ = 0;
-    }
-    if (numMinstepAlloc_ > 0) {
-        for (i = 0; i < numMinstep_; i++) { // 5.6
-            lefFree((char*) (minstepType_[i]));
-        }
-        lefFree((char*) (minstep_));
-        lefFree((char*) (minstepType_));
-        lefFree((char*) (minstepLengthsum_));
-        lefFree((char*) (minstepMaxEdges_));
-        lefFree((char*) (minstepMinAdjLength_));
-        lefFree((char*) (minstepMinBetLength_));
-        lefFree((char*) (minstepXSameCorners_));
-    }
-    numMinstepAlloc_ = 0;
-    numMinstep_ = 0;
-    protrusionWidth1_ = -1;
-    protrusionLength_ = -1;
-    protrusionWidth2_ = -1;
-    if (numSpacingTable_) {
-        for (i = 0; i < numSpacingTable_; i++) {
-            sp = spacingTable_[i];
-            sp->Destroy();
-            lefFree((char*) sp);
-        }
-    }
-    numSpacingTable_ = 0;
-    spacingTableAllocated_ = 0;
-
-    for (i = 0; i < numAntennaModel_; i++) {  // 5.5
-        aO = antennaModel_[i];
-        aO->Destroy();
-    }
-    for (i = 0; i < antennaModelAllocated_; i++) { // 5.5
-        lefFree((char*) antennaModel_[i]);
-    }
-
-    if (antennaModel_)                        // 5.5
-        lefFree((char*) (antennaModel_));
-    antennaModel_ = 0;
-    currentAntennaModel_ = 0;
-    numAntennaModel_ = 0;
-    antennaModelAllocated_ = 0;
-
-    if (nums_)
-        lefFree((char*) (nums_));
-
-    // 5.6
-    if (numEnclosure_) {
-        for (i = 0; i < numEnclosure_; i++) {
-            if (enclosureRules_[i])
-                lefFree((char*) (enclosureRules_[i]));
-        }
-        lefFree((char*) (enclosureRules_));
-        lefFree((char*) (overhang1_));
-        lefFree((char*) (overhang2_));
-        lefFree((char*) (encminWidth_));
-        lefFree((char*) (cutWithin_));
-        lefFree((char*) (minLength_));
-        numEnclosure_ = 0;
-        enclosureAllocated_ = 0;
-    }
-    if (numPreferEnclosure_) {
-        for (i = 0; i < numPreferEnclosure_; i++) {
-            if (preferEnclosureRules_[i])
-                lefFree((char*) (preferEnclosureRules_[i]));
-        }
-        lefFree((char*) (preferEnclosureRules_));
-        lefFree((char*) (preferOverhang1_));
-        lefFree((char*) (preferOverhang2_));
-        lefFree((char*) (preferMinWidth_));
-        numPreferEnclosure_ = 0;
-        preferEnclosureAllocated_ = 0;
-    }
-    resPerCut_ = 0;
-    diagMinEdgeLength_ = 0;
-    if (numMinSize_) {
-        lefFree((char*) (minSizeWidth_));
-        lefFree((char*) (minSizeLength_));
-        numMinSize_ = 0;
-    }
-    maxArea_ = 0;
-    hasLongArray_ = 0;
-    viaWidth_ = 0;
-    cutSpacing_ = 0;
-    if (numArrayCuts_) {
-        lefFree((char*) (arrayCuts_));
-        lefFree((char*) (arraySpacings_));
-    }
-    arrayCuts_ = 0;
-    arraySpacings_ = 0;
-    arrayCutsAllocated_ = 0;
-    numArrayCuts_ = 0;
-
-    // 5.7
-    if (hasSpacingTableOrtho_) {
-        spacingTableOrtho_->Destroy();
-        lefFree((char*) (spacingTableOrtho_));
-    }
-    hasSpacingTableOrtho_ = 0;
-}
-
-
-void
-lefiLayer::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    clear();
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiLayer::setType(const char *typ)
-{
-    int len = strlen(typ) + 1;
-    if (len > typeSize_) {
-        lefFree(type_);
-        type_ = (char*) lefMalloc(len);
-        typeSize_ = len;
-    }
-    strcpy(type_, CASE(typ));
-}
-
-// 5.8
-void
-lefiLayer::setLayerType(const char *layerType)
-{
-    if (layerType_)
-        lefFree(layerType_);
-    layerType_ = strdup(layerType);
-}
-
-void
-lefiLayer::setPitch(double num)
-{
-    hasPitch_ = 1;
-    pitchX_ = num;
-    pitchY_ = -1;
-}
-
-// 5.6
-void
-lefiLayer::setPitchXY(double    xdist,
-                      double    ydist)
-{
-    hasPitch_ = 2;             // 2 means it has X & Y values
-    pitchX_ = xdist;
-    pitchY_ = ydist;
-}
-
-void
-lefiLayer::setMask(int num)
-{
-    hasMask_ = 1;
-    maskNumber_ = num;
-}
-
-void
-lefiLayer::setOffset(double num)
-{
-    hasOffset_ = 1;
-    offsetX_ = num;
-    offsetY_ = -1;
-}
-
-// 5.6
-void
-lefiLayer::setOffsetXY(double   xdist,
-                       double   ydist)
-{
-    hasOffset_ = 2;             // 2 means it has X & Y values
-    offsetX_ = xdist;
-    offsetY_ = ydist;
-}
-
-void
-lefiLayer::setWidth(double num)
-{
-    hasWidth_ = 1;
-    width_ = num;
-}
-
-void
-lefiLayer::setArea(double num)
-{
-    hasArea_ = 1;
-    area_ = num;
-}
-
-// 5.6
-void
-lefiLayer::setDiagPitch(double dist)
-{
-    hasDiagPitch_ = 1;
-    diagPitchX_ = dist;
-    diagPitchY_ = -1;
-}
-
-// 5.6
-void
-lefiLayer::setDiagPitchXY(double    xdist,
-                          double    ydist)
-{
-    hasDiagPitch_ = 2;
-    diagPitchX_ = xdist;
-    diagPitchY_ = ydist;
-}
-
-// 5.6
-void
-lefiLayer::setDiagWidth(double width)
-{
-    hasDiagWidth_ = 1;
-    diagWidth_ = width;
-}
-
-// 5.6
-void
-lefiLayer::setDiagSpacing(double spacing)
-{
-    hasDiagSpacing_ = 1;
-    diagSpacing_ = spacing;
-}
-
-void
-lefiLayer::setWireExtension(double num)
-{
-    hasWireExtension_ = 1;
-    wireExtension_ = num;
-}
-
-// 5.5
-void
-lefiLayer::setMaxwidth(double width)
-{
-    maxwidth_ = width;
-}
-
-// 5.5
-void
-lefiLayer::setMinwidth(double width)
-{
-    minwidth_ = width;
-}
-
-// 5.5
-void
-lefiLayer::addMinenclosedarea(double area)
-{
-    if (numMinenclosedarea_ == minenclosedareaAllocated_) {
-        double  *na;
-        double  *nw;
-        int     i, lim;
-
-        if (minenclosedareaAllocated_ == 0) {
-            lim = minenclosedareaAllocated_ = 2;
-            na = (double*) lefMalloc(sizeof(double) * lim);
-            nw = (double*) lefMalloc(sizeof(double) * lim);
-        } else {
-            lim = minenclosedareaAllocated_ * 2;
-            minenclosedareaAllocated_ = lim;
-            na = (double*) lefMalloc(sizeof(double) * lim);
-            nw = (double*) lefMalloc(sizeof(double) * lim);
-            lim /= 2;
-            for (i = 0; i < lim; i++) {
-                na[i] = minenclosedarea_[i];
-                nw[i] = minenclosedareaWidth_[i];
-            }
-            lefFree((char*) (minenclosedarea_));
-            lefFree((char*) (minenclosedareaWidth_));
-        }
-        minenclosedarea_ = na;
-        minenclosedareaWidth_ = nw;
-    }
-    minenclosedarea_[numMinenclosedarea_] = area;
-    minenclosedareaWidth_[numMinenclosedarea_] = -1;
-    numMinenclosedarea_ += 1;
-}
-
-// 5.5
-void
-lefiLayer::addMinenclosedareaWidth(double width)
-{
-    minenclosedareaWidth_[numMinenclosedarea_ - 1] = width;
-}
-
-// 5.5
-void
-lefiLayer::addMinimumcut(int    mincut,
-                         double width)
-{
-    if (numMinimumcut_ == minimumcutAllocated_) {
-        int     *nc;
-        double  *nw;
-        int     *hcd;
-        double  *ncd;
-        int     *hm;
-        char    **nud;
-        int     *hc;
-        double  *nl;
-        double  *nd;
-        int     i, lim;
-
-        if (minimumcutAllocated_ == 0) {
-            lim = minimumcutAllocated_ = 2;
-            nc = (int*) lefMalloc(sizeof(int) * lim);
-            nw = (double*) lefMalloc(sizeof(double) * lim);
-            hcd = (int*) lefMalloc(sizeof(int) * lim);
-            ncd = (double*) lefMalloc(sizeof(double) * lim);
-            hm = (int*) lefMalloc(sizeof(int) * lim);
-            nud = (char**) lefMalloc(sizeof(char*) * lim);
-            hc = (int*) lefMalloc(sizeof(int) * lim);
-            nl = (double*) lefMalloc(sizeof(double) * lim);
-            nd = (double*) lefMalloc(sizeof(double) * lim);
-        } else {
-            lim = minimumcutAllocated_ * 2;
-            minimumcutAllocated_ = lim;
-            nc = (int*) lefMalloc(sizeof(int) * lim);
-            nw = (double*) lefMalloc(sizeof(double) * lim);
-            hcd = (int*) lefMalloc(sizeof(int) * lim);
-            ncd = (double*) lefMalloc(sizeof(double) * lim);
-            hm = (int*) lefMalloc(sizeof(int) * lim);
-            nud = (char**) lefMalloc(sizeof(char*) * lim);
-            hc = (int*) lefMalloc(sizeof(int) * lim);
-            nl = (double*) lefMalloc(sizeof(double) * lim);
-            nd = (double*) lefMalloc(sizeof(double) * lim);
-            lim /= 2;
-            for (i = 0; i < lim; i++) {
-                nc[i] = minimumcut_[i];
-                nw[i] = minimumcutWidth_[i];
-                hcd[i] = hasMinimumcutWithin_[i];
-                ncd[i] = minimumcutWithin_[i];
-                hm[i] = hasMinimumcutConnection_[i];
-                nud[i] = minimumcutConnection_[i];
-                hc[i] = hasMinimumcutNumCuts_[i];
-                nl[i] = minimumcutLength_[i];
-                nd[i] = minimumcutDistance_[i];
-            }
-            lefFree((char*) (minimumcut_));
-            lefFree((char*) (minimumcutWidth_));
-            lefFree((char*) (hasMinimumcutWithin_));
-            lefFree((char*) (minimumcutWithin_));
-            lefFree((char*) (hasMinimumcutConnection_));
-            lefFree((char*) (minimumcutConnection_));
-            lefFree((char*) (hasMinimumcutNumCuts_));
-            lefFree((char*) (minimumcutLength_));
-            lefFree((char*) (minimumcutDistance_));
-        }
-        minimumcut_ = nc;
-        minimumcutWidth_ = nw;
-        hasMinimumcutWithin_ = hcd;
-        minimumcutWithin_ = ncd;
-        hasMinimumcutConnection_ = hm;
-        minimumcutConnection_ = nud;
-        hasMinimumcutNumCuts_ = hc;
-        minimumcutLength_ = nl;
-        minimumcutDistance_ = nd;
-    }
-    minimumcut_[numMinimumcut_] = mincut;
-    minimumcutWidth_[numMinimumcut_] = width;
-    hasMinimumcutWithin_[numMinimumcut_] = 0;
-    minimumcutWithin_[numMinimumcut_] = 0;
-    hasMinimumcutConnection_[numMinimumcut_] = 0;
-    minimumcutConnection_[numMinimumcut_] = 0;
-    hasMinimumcutNumCuts_[numMinimumcut_] = 0;
-    minimumcutLength_[numMinimumcut_] = 0;
-    minimumcutDistance_[numMinimumcut_] = 0;
-    numMinimumcut_ += 1;
-}
-
-// 5.7
-void
-lefiLayer::addMinimumcutWithin(double cutDistance)
-{
-    hasMinimumcutWithin_[numMinimumcut_ - 1] = 1;
-    minimumcutWithin_[numMinimumcut_ - 1] = cutDistance;
-}
-
-// 5.5
-void
-lefiLayer::addMinimumcutConnect(const char *connectType)
-{
-    if (connectType && (strcmp(connectType, "") != 0)) {
-        hasMinimumcutConnection_[numMinimumcut_ - 1] = 1;
-        minimumcutConnection_[numMinimumcut_ - 1] =
-            strdup(connectType);
-    }
-}
-
-// 5.5
-void
-lefiLayer::addMinimumcutLengDis(double  length,
-                                double  width)
-{
-    hasMinimumcutNumCuts_[numMinimumcut_ - 1] = 1;
-    minimumcutLength_[numMinimumcut_ - 1] = length;
-    minimumcutDistance_[numMinimumcut_ - 1] = width;
-}
-
-// 5.5, 5.6 switched to multiple
-void
-lefiLayer::addMinstep(double distance)
-{
-    double  *ms;
-    char    **mt;
-    double  *ml;
-    int     *me;
-    double  *ma;
-    double  *mb;
-    int     *mx;
-    int     i;
-
-    if (numMinstep_ == numMinstepAlloc_) {
-        int len;
-        if (numMinstepAlloc_ == 0) {
-            len = numMinstepAlloc_ = 2;
-            ms = (double*) lefMalloc(sizeof(double) * len);
-            mt = (char**) lefMalloc(sizeof(char*) * len);
-            ml = (double*) lefMalloc(sizeof(double) * len);
-            me = (int*) lefMalloc(sizeof(int) * len);
-            ma = (double*) lefMalloc(sizeof(double) * len);
-            mb = (double*) lefMalloc(sizeof(double) * len);
-            mx = (int*) lefMalloc(sizeof(int) * len);
-        } else {
-            len = numMinstepAlloc_ *= 2;
-            ms = (double*) lefMalloc(sizeof(double) * len);
-            mt = (char**) lefMalloc(sizeof(char*) * len);
-            ml = (double*) lefMalloc(sizeof(double) * len);
-            me = (int*) lefMalloc(sizeof(int) * len);
-            ma = (double*) lefMalloc(sizeof(double) * len);
-            mb = (double*) lefMalloc(sizeof(double) * len);
-            mx = (int*) lefMalloc(sizeof(int) * len);
-
-            for (i = 0; i < numMinstep_; i++) {
-                ms[i] = minstep_[i];
-                mt[i] = minstepType_[i];
-                ml[i] = minstepLengthsum_[i];
-                me[i] = minstepMaxEdges_[i];
-                ma[i] = minstepMinAdjLength_[i];
-                mb[i] = minstepMinBetLength_[i];
-                mx[i] = minstepXSameCorners_[i];
-            }
-            lefFree((char*) (minstep_));
-            lefFree((char*) (minstepType_));
-            lefFree((char*) (minstepLengthsum_));
-            lefFree((char*) (minstepMaxEdges_));
-            lefFree((char*) (minstepMinAdjLength_));
-            lefFree((char*) (minstepMinBetLength_));
-            lefFree((char*) (minstepXSameCorners_));
-        }
-        minstep_ = ms;
-        minstepType_ = mt;
-        minstepLengthsum_ = ml;
-        minstepMaxEdges_ = me;
-        minstepMinAdjLength_ = ma;
-        minstepMinBetLength_ = mb;
-        minstepXSameCorners_ = mx;
-    }
-    minstep_[numMinstep_] = distance;
-    minstepType_[numMinstep_] = 0;
-    minstepLengthsum_[numMinstep_] = -1;
-    minstepMaxEdges_[numMinstep_] = -1;
-    minstepMinAdjLength_[numMinstep_] = -1;
-    minstepMinBetLength_[numMinstep_] = -1;
-    minstepXSameCorners_[numMinstep_] = -1;
-    numMinstep_ += 1;
-}
-
-// 5.6
-void
-lefiLayer::addMinstepType(char *type)
-{
-    minstepType_[numMinstep_ - 1] = strdup(type);
-}
-
-// 5.6
-void
-lefiLayer::addMinstepLengthsum(double maxLength)
-{
-    minstepLengthsum_[numMinstep_ - 1] = maxLength;
-}
-
-// 5.7
-void
-lefiLayer::addMinstepMaxedges(int maxEdges)
-{
-    minstepMaxEdges_[numMinstep_ - 1] = maxEdges;
-}
-
-// 5.7
-void
-lefiLayer::addMinstepMinAdjLength(double adjLength)
-{
-    minstepMinAdjLength_[numMinstep_ - 1] = adjLength;
-}
-
-// 5.7
-void
-lefiLayer::addMinstepMinBetLength(double betLength)
-{
-    minstepMinBetLength_[numMinstep_ - 1] = betLength;
-}
-
-// 5.7
-void
-lefiLayer::addMinstepXSameCorners()
-{
-    minstepXSameCorners_[numMinstep_ - 1] = 1;
-}
-
-// 5.5
-void
-lefiLayer::setProtrusion(double width1,
-                         double length,
-                         double width2)
-{
-    protrusionWidth1_ = width1;
-    protrusionLength_ = length;
-    protrusionWidth2_ = width2;
-}
-
-// wmd -- pcr 282799, need to make left_, right_ as arrays
-// when bumping to new list, need to copy also hasUseLengthThreshold_
-// and lengthThreshold_
-void
-lefiLayer::setSpacingMin(double dist)
-{
-    if (numSpacings_ == spacingsAllocated_) {
-        double  *nd;
-        char    **nn;             // Also set up the spacing name
-        int     *nsn;           // hasSpacingName_
-        int     *nss;           // hasSpacingLayerStack_
-        int     *nsa;           // hasSpacingAdjacent_
-        int     *nr;            // hasSpacingRange_
-        int     *nac;           // adjacentCuts_
-        int     *ncc;           // hasCenterToCenter_
-        int     *hpo;           // hasSpacingParallelOverlap_
-        int     *heol;          // hasSpacingEndOfLine_
-        double  *nwd, *nwn;     // eolWidth_, eolWithin_
-        double  *ntl;           // notchLength_
-        double  *eon;           // endOfNotchWidth_
-        double  *nts;           // minNotchSpacing_
-        double  *eonl;          // eonotchLength_
-        int     *hpe;           // hasSpacingParellelEdge_
-        double  *nps, *npw;     // parSpace_, parWithin_
-        int     *hte;           // hasSpacingTwoEdges_
-        int     *hae;           // hasSpacingAdjacentExcept_
-        int     *hsn;           // hasSpacingSamenet_
-        int     *hsno;          // hasSpacingSamenetPGonly_
-        int     *hca;           // hasSpacingCutArea_
-        double  *nca;           // spacingCutArea_
-        double  *naw;           // adjacentWithin_
-        double  *nrmin, *nrmax; // rangeMin_, rangeMax_
-        double  *nri, *nrimin, *nrimax; // rangeInfluence_, rangeInfluenceRangeMin_,
-        // rangeInfluenceRangeMax_
-        double  *nrrmin, *nrrmax;       // rangeRangeMin_, rangeRangeMax_
-        int     *ht;            // hasSpacingUseLengthThreshold_
-        int     *nl;            // hasSpacingLengthThreshold_
-        double  *nt, *ntmin, *ntmax; // lengthThreshold_, lengthThresholdMin_
-        // lengthThresholdMax_
-
-        int     i, lim;
-        if (spacingsAllocated_ == 0) {
-            lim = spacingsAllocated_ = 2;
-            nd = (double*) lefMalloc(sizeof(double) * lim);
-            nn = (char**) lefMalloc(sizeof(char*) * lim);
-            nac = (int*) lefMalloc(sizeof(int) * lim);
-            naw = (double*) lefMalloc(sizeof(double) * lim);
-            nsn = (int*) lefMalloc(sizeof(int) * lim);
-            nss = (int*) lefMalloc(sizeof(int) * lim);
-            nsa = (int*) lefMalloc(sizeof(int) * lim);
-            ncc = (int*) lefMalloc(sizeof(int) * lim);
-            hpo = (int*) lefMalloc(sizeof(int) * lim);
-            heol = (int*) lefMalloc(sizeof(int) * lim);
-            nwd = (double*) lefMalloc(sizeof(double) * lim);
-            nwn = (double*) lefMalloc(sizeof(double) * lim);
-            ntl = (double*) lefMalloc(sizeof(double) * lim);
-            eon = (double*) lefMalloc(sizeof(double) * lim);
-            nts = (double*) lefMalloc(sizeof(double) * lim);
-            eonl = (double*) lefMalloc(sizeof(double) * lim);
-            hpe = (int*) lefMalloc(sizeof(int) * lim);
-            nps = (double*) lefMalloc(sizeof(double) * lim);
-            npw = (double*) lefMalloc(sizeof(double) * lim);
-            hte = (int*) lefMalloc(sizeof(int) * lim);
-            hae = (int*) lefMalloc(sizeof(int) * lim);
-            hsn = (int*) lefMalloc(sizeof(int) * lim);
-            hsno = (int*) lefMalloc(sizeof(int) * lim);
-            hca = (int*) lefMalloc(sizeof(int) * lim);
-            nca = (double*) lefMalloc(sizeof(double) * lim);
-            nr = (int*) lefMalloc(sizeof(int) * lim);
-            nrmin = (double*) lefMalloc(sizeof(double) * lim);
-            nrmax = (double*) lefMalloc(sizeof(double) * lim);
-            nri = (double*) lefMalloc(sizeof(double) * lim);
-            nrimin = (double*) lefMalloc(sizeof(double) * lim);
-            nrimax = (double*) lefMalloc(sizeof(double) * lim);
-            nrrmin = (double*) lefMalloc(sizeof(double) * lim);
-            nrrmax = (double*) lefMalloc(sizeof(double) * lim);
-            ht = (int*) lefMalloc(sizeof(int) * lim);
-            nl = (int*) lefMalloc(sizeof(int) * lim);
-            nt = (double*) lefMalloc(sizeof(double) * lim);
-            ntmin = (double*) lefMalloc(sizeof(double) * lim);
-            ntmax = (double*) lefMalloc(sizeof(double) * lim);
-        } else {
-            lim = spacingsAllocated_ * 2;
-            spacingsAllocated_ = lim;
-            nd = (double*) lefMalloc(sizeof(double) * lim);
-            nn = (char**) lefMalloc(sizeof(char*) * lim);
-            nac = (int*) lefMalloc(sizeof(int) * lim);
-            naw = (double*) lefMalloc(sizeof(double) * lim);
-            nsn = (int*) lefMalloc(sizeof(int) * lim);
-            nss = (int*) lefMalloc(sizeof(int) * lim);
-            nsa = (int*) lefMalloc(sizeof(int) * lim);
-            ncc = (int*) lefMalloc(sizeof(int) * lim);
-            hpo = (int*) lefMalloc(sizeof(int) * lim);
-            heol = (int*) lefMalloc(sizeof(int) * lim);
-            nwd = (double*) lefMalloc(sizeof(double) * lim);
-            nwn = (double*) lefMalloc(sizeof(double) * lim);
-            ntl = (double*) lefMalloc(sizeof(double) * lim);
-            eon = (double*) lefMalloc(sizeof(double) * lim);
-            nts = (double*) lefMalloc(sizeof(double) * lim);
-            eonl = (double*) lefMalloc(sizeof(double) * lim);
-            hpe = (int*) lefMalloc(sizeof(int) * lim);
-            nps = (double*) lefMalloc(sizeof(double) * lim);
-            npw = (double*) lefMalloc(sizeof(double) * lim);
-            hte = (int*) lefMalloc(sizeof(int) * lim);
-            hae = (int*) lefMalloc(sizeof(int) * lim);
-            hsn = (int*) lefMalloc(sizeof(int) * lim);
-            hsno = (int*) lefMalloc(sizeof(int) * lim);
-            hca = (int*) lefMalloc(sizeof(int) * lim);
-            nca = (double*) lefMalloc(sizeof(double) * lim);
-            nr = (int*) lefMalloc(sizeof(int) * lim);
-            nrmin = (double*) lefMalloc(sizeof(double) * lim);
-            nrmax = (double*) lefMalloc(sizeof(double) * lim);
-            nri = (double*) lefMalloc(sizeof(double) * lim);
-            nrimin = (double*) lefMalloc(sizeof(double) * lim);
-            nrimax = (double*) lefMalloc(sizeof(double) * lim);
-            nrrmin = (double*) lefMalloc(sizeof(double) * lim);
-            nrrmax = (double*) lefMalloc(sizeof(double) * lim);
-            ht = (int*) lefMalloc(sizeof(int) * lim);
-            nl = (int*) lefMalloc(sizeof(int) * lim);
-            nt = (double*) lefMalloc(sizeof(double) * lim);
-            ntmin = (double*) lefMalloc(sizeof(double) * lim);
-            ntmax = (double*) lefMalloc(sizeof(double) * lim);
-            lim /= 2;
-            for (i = 0; i < lim; i++) {
-                nd[i] = spacing_[i];
-                if (spacingName_[i])  // is null if is not CUT layer
-                    nn[i] = spacingName_[i];
-                else
-                    nn[i] = 0;
-                nac[i] = spacingAdjacentCuts_[i];
-                naw[i] = spacingAdjacentWithin_[i];
-                nsn[i] = hasSpacingName_[i];
-                nss[i] = hasSpacingLayerStack_[i];
-                nsa[i] = hasSpacingAdjacent_[i];
-                ncc[i] = hasSpacingCenterToCenter_[i];
-                hpo[i] = hasSpacingParallelOverlap_[i];
-                nwd[i] = eolWidth_[i];
-                nwn[i] = eolWithin_[i];
-                ntl[i] = notchLength_[i];
-                eon[i] = endOfNotchWidth_[i];
-                nts[i] = minNotchSpacing_[i];
-                eonl[i] = eonotchLength_[i];
-                heol[i] = hasSpacingEndOfLine_[i];
-                hpe[i] = hasSpacingParellelEdge_[i];
-                nps[i] = parSpace_[i];
-                npw[i] = parWithin_[i];
-                hte[i] = hasSpacingTwoEdges_[i];
-                hae[i] = hasSpacingAdjacentExcept_[i];
-                hsn[i] = hasSpacingSamenet_[i];
-                hsno[i] = hasSpacingSamenetPGonly_[i];
-                hca[i] = hasSpacingCutArea_[i];
-                nca[i] = spacingCutArea_[i];
-                nr[i] = hasSpacingRange_[i];
-                nrmin[i] = rangeMin_[i];
-                nrmax[i] = rangeMax_[i];
-                nri[i] = rangeInfluence_[i];
-                nrimin[i] = rangeInfluenceRangeMin_[i];
-                nrimax[i] = rangeInfluenceRangeMax_[i];
-                nrrmin[i] = rangeRangeMin_[i];
-                nrrmax[i] = rangeRangeMax_[i];
-                ht[i] = hasSpacingUseLengthThreshold_[i];
-                nl[i] = hasSpacingLengthThreshold_[i];
-                nt[i] = lengthThreshold_[i];
-                ntmin[i] = lengthThresholdRangeMin_[i];
-                ntmax[i] = lengthThresholdRangeMax_[i];
-            }
-            lefFree((char*) (spacing_));
-            lefFree((char*) (spacingName_));
-            lefFree((char*) (spacingAdjacentCuts_));
-            lefFree((char*) (spacingAdjacentWithin_));
-            lefFree((char*) (hasSpacingName_));
-            lefFree((char*) (hasSpacingLayerStack_));
-            lefFree((char*) (hasSpacingAdjacent_));
-            lefFree((char*) (hasSpacingRange_));
-            lefFree((char*) (hasSpacingCenterToCenter_));
-            lefFree((char*) (hasSpacingParallelOverlap_));
-            lefFree((char*) (hasSpacingEndOfLine_));
-            lefFree((char*) (eolWidth_));
-            lefFree((char*) (eolWithin_));
-            lefFree((char*) (notchLength_));
-            lefFree((char*) (endOfNotchWidth_));
-            lefFree((char*) (minNotchSpacing_));
-            lefFree((char*) (eonotchLength_));
-            lefFree((char*) (hasSpacingParellelEdge_));
-            lefFree((char*) (hasSpacingAdjacentExcept_));
-            lefFree((char*) (parSpace_));
-            lefFree((char*) (parWithin_));
-            lefFree((char*) (hasSpacingTwoEdges_));
-            lefFree((char*) (hasSpacingSamenet_));
-            lefFree((char*) (hasSpacingSamenetPGonly_));
-            lefFree((char*) (hasSpacingCutArea_));
-            lefFree((char*) (spacingCutArea_));
-            lefFree((char*) (rangeMin_));
-            lefFree((char*) (rangeMax_));
-            lefFree((char*) (rangeInfluence_));
-            lefFree((char*) (rangeInfluenceRangeMin_));
-            lefFree((char*) (rangeInfluenceRangeMax_));
-            lefFree((char*) (rangeRangeMin_));
-            lefFree((char*) (rangeRangeMax_));
-            lefFree((char*) (hasSpacingUseLengthThreshold_));
-            lefFree((char*) (hasSpacingLengthThreshold_));
-            lefFree((char*) (lengthThreshold_));
-            lefFree((char*) (lengthThresholdRangeMin_));
-            lefFree((char*) (lengthThresholdRangeMax_));
-        }
-        spacing_ = nd;
-        spacingName_ = nn;
-        spacingAdjacentCuts_ = nac;
-        spacingAdjacentWithin_ = naw;
-        hasSpacingName_ = nsn;
-        hasSpacingLayerStack_ = nss;
-        hasSpacingAdjacent_ = nsa;
-        hasSpacingRange_ = nr;
-        hasSpacingCenterToCenter_ = ncc;
-        hasSpacingParallelOverlap_ = hpo;
-        hasSpacingEndOfLine_ = heol;
-        eolWidth_ = nwd;
-        eolWithin_ = nwn;
-        notchLength_ = ntl;
-        endOfNotchWidth_ = eon;
-        minNotchSpacing_ = nts;
-        eonotchLength_ = eonl;
-        hasSpacingParellelEdge_ = hpe;
-        parSpace_ = nps;
-        parWithin_ = npw;
-        hasSpacingTwoEdges_ = hte;
-        hasSpacingAdjacentExcept_ = hae;
-        hasSpacingSamenet_ = hsn;
-        hasSpacingSamenetPGonly_ = hsno;
-        hasSpacingCutArea_ = hca;
-        spacingCutArea_ = nca;
-        rangeMin_ = nrmin;
-        rangeMax_ = nrmax;
-        rangeInfluence_ = nri;
-        rangeInfluenceRangeMin_ = nrimin;
-        rangeInfluenceRangeMax_ = nrimax;
-        rangeRangeMin_ = nrrmin;
-        rangeRangeMax_ = nrrmax;
-        hasSpacingUseLengthThreshold_ = ht;
-        hasSpacingLengthThreshold_ = nl;
-        lengthThreshold_ = nt;
-        lengthThresholdRangeMin_ = ntmin;
-        lengthThresholdRangeMax_ = ntmax;
-    }
-    hasSpacing_ = 1;
-    spacing_[numSpacings_] = dist;
-    spacingName_[numSpacings_] = 0;
-    hasSpacingName_[numSpacings_] = 0;
-    hasSpacingLayerStack_[numSpacings_] = 0;
-    spacingAdjacentCuts_[numSpacings_] = 0;
-    spacingAdjacentWithin_[numSpacings_] = 0;
-    hasSpacingAdjacent_[numSpacings_] = 0;
-    hasSpacingRange_[numSpacings_] = 0;
-    hasSpacingCenterToCenter_[numSpacings_] = 0;
-    hasSpacingParallelOverlap_[numSpacings_] = 0;
-    hasSpacingEndOfLine_[numSpacings_] = 0;
-    hasSpacingAdjacentExcept_[numSpacings_] = 0;
-    eolWidth_[numSpacings_] = 0;
-    eolWithin_[numSpacings_] = 0;
-    notchLength_[numSpacings_] = -1;
-    endOfNotchWidth_[numSpacings_] = 0;
-    minNotchSpacing_[numSpacings_] = 0;
-    eonotchLength_[numSpacings_] = 0;
-    hasSpacingParellelEdge_[numSpacings_] = 0;
-    parSpace_[numSpacings_] = 0;
-    parWithin_[numSpacings_] = 0;
-    hasSpacingTwoEdges_[numSpacings_] = 0;
-    hasSpacingSamenet_[numSpacings_] = 0;
-    hasSpacingSamenetPGonly_[numSpacings_] = 0;
-    hasSpacingCutArea_[numSpacings_] = 0;
-    spacingCutArea_[numSpacings_] = 0;
-    rangeMin_[numSpacings_] = -1;
-    rangeMax_[numSpacings_] = -1;
-    rangeInfluence_[numSpacings_] = 0;
-    rangeInfluenceRangeMin_[numSpacings_] = -1;
-    rangeInfluenceRangeMax_[numSpacings_] = -1;
-    rangeRangeMin_[numSpacings_] = -1;
-    rangeRangeMax_[numSpacings_] = -1;
-    hasSpacingUseLengthThreshold_[numSpacings_] = 0;
-    hasSpacingLengthThreshold_[numSpacings_] = 0;
-    lengthThreshold_[numSpacings_] = 0;
-    lengthThresholdRangeMin_[numSpacings_] = -1;
-    lengthThresholdRangeMax_[numSpacings_] = -1;
-    numSpacings_ += 1;
-}
-
-void
-lefiLayer::setSpacingRange(double   left,
-                           double   right)
-{
-    rangeMin_[numSpacings_ - 1] = left;
-    rangeMax_[numSpacings_ - 1] = right;
-    hasSpacingRange_[numSpacings_ - 1] = 1;
-    rangeInfluence_[numSpacings_ - 1] = -1;
-}
-
-void
-lefiLayer::setSpacingName(const char *spacingName)
-{
-    if (spacingName) {
-        int len = strlen(spacingName) + 1;
-        spacingName_[numSpacings_ - 1] = (char*) lefMalloc(len);
-        strcpy(spacingName_[numSpacings_ - 1], CASE(spacingName));
-        hasSpacingName_[numSpacings_ - 1] = 1;
-    }
-}
-
-void
-lefiLayer::setSpacingLayerStack()
-{
-    hasSpacingLayerStack_[numSpacings_ - 1] = 1;
-}
-
-void
-lefiLayer::setSpacingAdjacent(int       numCuts,
-                              double    distance)
-{
-    spacingAdjacentCuts_[numSpacings_ - 1] = numCuts;
-    spacingAdjacentWithin_[numSpacings_ - 1] = distance;
-    hasSpacingAdjacent_[numSpacings_ - 1] = 1;
-}
-
-void
-lefiLayer::setSpacingRangeUseLength()
-{
-    hasSpacingUseLengthThreshold_[numSpacings_ - 1] = 1;
-}
-
-void
-lefiLayer::setSpacingRangeInfluence(double infLength)
-{
-    rangeInfluence_[numSpacings_ - 1] = infLength;
-}
-
-void
-lefiLayer::setSpacingRangeInfluenceRange(double min,
-                                         double max)
-{
-    rangeInfluenceRangeMin_[numSpacings_ - 1] = min;
-    rangeInfluenceRangeMax_[numSpacings_ - 1] = max;
-}
-
-void
-lefiLayer::setSpacingRangeRange(double  min,
-                                double  max)
-{
-    rangeRangeMin_[numSpacings_ - 1] = min;
-    rangeRangeMax_[numSpacings_ - 1] = max;
-}
-
-void
-lefiLayer::setSpacingLength(double num)
-{
-    lengthThreshold_[numSpacings_ - 1] = num;
-    hasSpacingLengthThreshold_[numSpacings_ - 1] = 1;
-}
-
-void
-lefiLayer::setSpacingLengthRange(double min,
-                                 double max)
-{
-    lengthThresholdRangeMin_[numSpacings_ - 1] = min;
-    lengthThresholdRangeMax_[numSpacings_ - 1] = max;
-}
-
-void
-lefiLayer::setSpacingCenterToCenter()
-{
-    hasSpacingCenterToCenter_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingParallelOverlap()
-{
-    hasSpacingParallelOverlap_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingArea(double cutArea)
-{
-    spacingCutArea_[numSpacings_ - 1] = cutArea;
-    hasSpacingCutArea_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingEol(double width,
-                         double within)
-{
-    hasSpacingEndOfLine_[numSpacings_ - 1] = 1;
-    eolWidth_[numSpacings_ - 1] = width;
-    eolWithin_[numSpacings_ - 1] = within;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingParSW(double   space,
-                           double   within)
-{
-    hasSpacingParellelEdge_[numSpacings_ - 1] = 1;
-    parSpace_[numSpacings_ - 1] = space;
-    parWithin_[numSpacings_ - 1] = within;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingParTwoEdges()
-{
-    hasSpacingTwoEdges_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingAdjacentExcept()
-{
-    hasSpacingAdjacentExcept_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingSamenet()
-{
-    hasSpacingSamenet_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingSamenetPGonly()
-{
-    hasSpacingSamenetPGonly_[numSpacings_ - 1] = 1;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingNotchLength(double notchLength)
-{
-    notchLength_[numSpacings_ - 1] = notchLength;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingEndOfNotchWidth(double eonWidth,
-                                     double mnSpacing,
-                                     double eonLength)
-{
-    endOfNotchWidth_[numSpacings_ - 1] = eonWidth;
-    minNotchSpacing_[numSpacings_ - 1] = mnSpacing;
-    eonotchLength_[numSpacings_ - 1] = eonLength;
-}
-
-// 5.7
-void
-lefiLayer::setSpacingTableOrtho()
-{
-
-    spacingTableOrtho_ = (lefiOrthogonal*) lefMalloc(sizeof(lefiOrthogonal));
-    spacingTableOrtho_->Init();
-}
-
-// 5.7
-void
-lefiLayer::addSpacingTableOrthoWithin(double    cutWithin,
-                                      double    orthoSp)
-{
-    spacingTableOrtho_->addOrthogonal(cutWithin, orthoSp);
-    hasSpacingTableOrtho_ = 1;
-}
-
-// 5.7
-void
-lefiLayer::setMaxFloatingArea(double num)
-{
-    maxArea_ = num;
-}
-
-// 5.7
-void
-lefiLayer::setArraySpacingLongArray()
-{
-    hasLongArray_ = 1;
-}
-
-// 5.7
-void
-lefiLayer::setArraySpacingWidth(double viaWidth)
-{
-    viaWidth_ = viaWidth;
-}
-
-// 5.7
-void
-lefiLayer::setArraySpacingCut(double cutSpacing)
-{
-    cutSpacing_ = cutSpacing;
-}
-
-// 5.7
-void
-lefiLayer::addArraySpacingArray(int     arrayCut,
-                                double  arraySpacing)
-{
-    int     i, len;
-    int     *ac;
-    double  *as;
-
-    if (numArrayCuts_ == arrayCutsAllocated_) {
-        if (arrayCutsAllocated_ == 0)
-            len = arrayCutsAllocated_ = 2;
-        else
-            len = arrayCutsAllocated_ *= 2;
-        ac = (int*) lefMalloc(sizeof(int) * len);
-        as = (double*) lefMalloc(sizeof(double) * len);
-
-        if (numArrayCuts_ > 0) {
-            for (i = 0; i < numArrayCuts_; i++) {
-                ac[i] = arrayCuts_[i];
-                as[i] = arraySpacings_[i];
-            }
-            lefFree((char*) (arrayCuts_));
-            lefFree((char*) (arraySpacings_));
-        }
-        arrayCuts_ = ac;
-        arraySpacings_ = as;
-    }
-    arrayCuts_[numArrayCuts_] = arrayCut;
-    arraySpacings_[numArrayCuts_] = arraySpacing;
-    numArrayCuts_ += 1;
-}
-
-void
-lefiLayer::setDirection(const char *dir)
-{
-    direction_ = (char*) dir;
-    hasDirection_ = 1;
-}
-
-void
-lefiLayer::setResistance(double num)
-{
-    hasResistance_ = 1;
-    resistance_ = num;
-}
-
-void
-lefiLayer::setCapacitance(double num)
-{
-    hasCapacitance_ = 1;
-    capacitance_ = num;
-}
-
-void
-lefiLayer::setHeight(double num)
-{
-    hasHeight_ = 1;
-    height_ = num;
-}
-
-void
-lefiLayer::setThickness(double num)
-{
-    hasThickness_ = 1;
-    thickness_ = num;
-}
-
-void
-lefiLayer::setShrinkage(double num)
-{
-    hasShrinkage_ = 1;
-    shrinkage_ = num;
-}
-
-void
-lefiLayer::setCapMultiplier(double num)
-{
-    hasCapMultiplier_ = 1;
-    capMultiplier_ = num;
-}
-
-void
-lefiLayer::setEdgeCap(double num)
-{
-    hasEdgeCap_ = 1;
-    edgeCap_ = num;
-}
-
-void
-lefiLayer::setAntennaLength(double num)
-{
-    hasAntennaLength_ = 1;
-    antennaLength_ = num;
-}
-
-void
-lefiLayer::setAntennaArea(double num)
-{
-    hasAntennaArea_ = 1;
-    antennaArea_ = num;
-}
-
-void
-lefiLayer::setCurrentDensity(double num)
-{
-    hasCurrentDensityPoint_ = 1;
-    currentDensity_ = num;
-}
-
-void
-lefiLayer::setCurrentPoint(double   width,
-                           double   current)
-{
-    if (numCurrentPoints_ == currentPointsAllocated_) {
-        int     max = numCurrentPoints_;
-        int     len;
-        int     i;
-        double  *nc;
-        double  *nw;
-
-        if (currentPointsAllocated_ == 0)
-            len = currentPointsAllocated_ = 2;
-        else
-            len = currentPointsAllocated_ *= 2;
-        nc = (double*) lefMalloc(sizeof(double) * len);
-        nw = (double*) lefMalloc(sizeof(double) * len);
-
-        for (i = 0; i < max; i++) {
-            nc[i] = current_[i];
-            nw[i] = currentWidths_[i];
-        }
-        lefFree((char*) (current_));
-        lefFree((char*) (currentWidths_));
-        current_ = nc;
-        currentWidths_ = nw;
-    }
-    current_[numCurrentPoints_] = current;
-    currentWidths_[numCurrentPoints_] = width;
-    numCurrentPoints_ += 1;
-}
-
-void
-lefiLayer::setResistancePoint(double    width,
-                              double    resistance)
-{
-    if (numResistancePoints_ == resistancePointsAllocated_) {
-        int     max = numResistancePoints_;
-        int     len;
-        int     i;
-        double  *nc;
-        double  *nw;
-
-        if (resistancePointsAllocated_ == 0)
-            len = resistancePointsAllocated_ = 2;
-        else
-            len = resistancePointsAllocated_ *= 2;
-        nc = (double*) lefMalloc(sizeof(double) * len);
-        nw = (double*) lefMalloc(sizeof(double) * len);
-        for (i = 0; i < max; i++) {
-            nc[i] = resistances_[i];
-            nw[i] = resistanceWidths_[i];
-        }
-        lefFree((char*) (resistances_));
-        lefFree((char*) (resistanceWidths_));
-        resistances_ = nc;
-        resistanceWidths_ = nw;
-    }
-    resistances_[numResistancePoints_] = resistance;
-    resistanceWidths_[numResistancePoints_] = width;
-    numResistancePoints_ += 1;
-}
-
-void
-lefiLayer::setCapacitancePoint(double   width,
-                               double   capacitance)
-{
-    if (numCapacitancePoints_ == capacitancePointsAllocated_) {
-        int     max = numCapacitancePoints_;
-        int     len;
-        int     i;
-        double  *nc;
-        double  *nw;
-
-        if (capacitancePointsAllocated_ == 0)
-            len = capacitancePointsAllocated_ = 2;
-        else
-            len = capacitancePointsAllocated_ *= 2;
-        nc = (double*) lefMalloc(sizeof(double) * len);
-        nw = (double*) lefMalloc(sizeof(double) * len);
-        for (i = 0; i < max; i++) {
-            nc[i] = capacitances_[i];
-            nw[i] = capacitanceWidths_[i];
-        }
-        lefFree((char*) (capacitances_));
-        lefFree((char*) (capacitanceWidths_));
-        capacitances_ = nc;
-        capacitanceWidths_ = nw;
-    }
-    capacitances_[numCapacitancePoints_] = capacitance;
-    capacitanceWidths_[numCapacitancePoints_] = width;
-    numCapacitancePoints_ += 1;
-}
-
-int
-lefiLayer::hasType() const
-{
-    return (type_[0] != '\0') ? 1 : 0;
-}
-
-// 5.8
-int
-lefiLayer::hasLayerType() const
-{
-    if (layerType_)
-        return 1;
-    return 0;
-}
-
-int
-lefiLayer::hasPitch() const
-{
-    if (hasPitch_ == 1)
-        return 1;
-    else
-        return 0;
-}
-
-int
-lefiLayer::hasMask() const
-{
-    if (hasMask_) {
-        return 1;
-    }
-
-    return 0;
-}
-// 5.6
-int
-lefiLayer::hasXYPitch() const
-{
-    if (hasPitch_ == 2)
-        return 1;
-    else
-        return 0;
-}
-
-int
-lefiLayer::hasOffset() const
-{
-    if (hasOffset_ == 1)
-        return 1;
-    else
-        return 0;
-}
-
-// 5.6
-int
-lefiLayer::hasXYOffset() const
-{
-    if (hasOffset_ == 2)
-        return 1;
-    else
-        return 0;
-}
-
-int
-lefiLayer::hasWidth() const
-{
-    return hasWidth_;
-}
-
-int
-lefiLayer::hasArea() const
-{
-    return hasArea_;
-}
-
-// 5.6
-int
-lefiLayer::hasDiagPitch() const
-{
-    if (hasDiagPitch_ == 1)
-        return 1;
-    else
-        return 0;
-}
-
-// 5.6
-int
-lefiLayer::hasXYDiagPitch() const
-{
-    if (hasDiagPitch_ == 2)
-        return 1;
-    else
-        return 0;
-}
-
-// 5.6
-int
-lefiLayer::hasDiagWidth() const
-{
-    return hasDiagWidth_;
-}
-
-// 5.6
-int
-lefiLayer::hasDiagSpacing() const
-{
-    return hasDiagSpacing_;
-}
-
-int
-lefiLayer::hasWireExtension() const
-{
-    return hasWireExtension_;
-}
-
-int
-lefiLayer::hasSpacingNumber() const
-{
-    return ((hasSpacing_ != 0) && (numSpacings_ > 0)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingName(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingName_[index] != 0)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingLayerStack(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingLayerStack_[index] != 0)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingAdjacent(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingAdjacent_[index] != 0)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingRange(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingRange_[index] != 0)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingRangeUseLengthThreshold(int index) const
-{
-    return (hasSpacingUseLengthThreshold_[index]);
-}
-
-int
-lefiLayer::hasSpacingRangeInfluence(int index) const
-{
-    return ((hasSpacing_ != 0) && (hasSpacingRange_[index] != 0) &&
-            (rangeInfluence_[index]) != -1) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingRangeInfluenceRange(int index) const
-{
-    return ((hasSpacing_ != 0) && (hasSpacingRange_[index] != 0) &&
-            (rangeInfluenceRangeMin_[index] != -1) &&
-            (rangeInfluenceRangeMax_[index] != -1)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingRangeRange(int index) const
-{
-    return ((hasSpacing_ != 0) && (hasSpacingRange_[index] != 0) &&
-            (rangeRangeMin_[index] != -1) &&
-            (rangeRangeMax_[index] != -1)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingLengthThreshold(int index) const
-{
-    return (hasSpacingLengthThreshold_[index]) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingLengthThresholdRange(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingLengthThreshold_[index] != 0) &&
-            (lengthThresholdRangeMin_[index] != -1) &&
-            (lengthThresholdRangeMax_[index] != -1)) ? 1 : 0;
-}
-
-int
-lefiLayer::hasSpacingCenterToCenter(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingCenterToCenter_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingParallelOverlap(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingParallelOverlap_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingArea(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingCutArea_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingEndOfLine(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingEndOfLine_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingParellelEdge(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingParellelEdge_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingTwoEdges(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingTwoEdges_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingAdjacentExcept(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingAdjacentExcept_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingSamenet(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingSamenet_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingSamenetPGonly(int index) const
-{
-    return ((hasSpacing_ != 0) &&
-            (hasSpacingSamenetPGonly_[index] != 0)) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingNotchLength(int index) const
-{
-    return (notchLength_[index] >= 0) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingEndOfNotchWidth(int index) const
-{
-    return (endOfNotchWidth_[index] != 0) ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasSpacingTableOrtho() const
-{
-    return hasSpacingTableOrtho_ ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasMaxFloatingArea() const
-{
-    return maxArea_ ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasArraySpacing() const
-{
-    return cutSpacing_ ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasLongArray() const
-{
-    return hasLongArray_ ? 1 : 0;
-}
-
-// 5.7
-int
-lefiLayer::hasViaWidth() const
-{
-    return viaWidth_ ? 1 : 0;
-}
-
-int
-lefiLayer::hasDirection() const
-{
-    return hasDirection_;
-}
-
-int
-lefiLayer::hasResistance() const
-{
-    return hasResistance_;
-}
-
-int
-lefiLayer::hasCapacitance() const
-{
-    return hasCapacitance_;
-}
-
-int
-lefiLayer::hasHeight() const
-{
-    return hasHeight_;
-}
-
-int
-lefiLayer::hasThickness() const
-{
-    return hasThickness_;
-}
-
-int
-lefiLayer::hasShrinkage() const
-{
-    return hasShrinkage_;
-}
-
-int
-lefiLayer::hasCapMultiplier() const
-{
-    return hasCapMultiplier_;
-}
-
-int
-lefiLayer::hasEdgeCap() const
-{
-    return hasEdgeCap_;
-}
-
-int
-lefiLayer::hasAntennaArea() const
-{
-    return hasAntennaArea_;
-}
-
-int
-lefiLayer::hasAntennaLength() const
-{
-    return hasAntennaLength_;
-}
-
-int
-lefiLayer::hasCurrentDensityPoint() const
-{
-    return hasCurrentDensityPoint_;
-}
-
-int
-lefiLayer::hasCurrentDensityArray() const
-{
-    return numCurrentPoints_ ? 1 : 0;
-}
-
-int
-lefiLayer::hasResistanceArray() const
-{
-    return numResistancePoints_ ? 1 : 0;
-}
-
-int
-lefiLayer::hasCapacitanceArray() const
-{
-    return numCapacitancePoints_ ? 1 : 0;
-}
-
-void
-lefiLayer::currentDensityArray(int      *numPoints,
-                               double   **widths,
-                               double   **current) const
-{
-    *numPoints = numCurrentPoints_;
-    *widths = currentWidths_;
-    *current = current_;
-}
-
-void
-lefiLayer::resistanceArray(int      *numPoints,
-                           double   **widths,
-                           double   **res) const
-{
-    *numPoints = numResistancePoints_;
-    *widths = resistanceWidths_;
-    *res = resistances_;
-}
-
-void
-lefiLayer::capacitanceArray(int     *numPoints,
-                            double  **widths,
-                            double  **cap) const
-{
-    *numPoints = numCapacitancePoints_;
-    *widths = capacitanceWidths_;
-    *cap = capacitances_;
-}
-
-int
-lefiLayer::numSpacing() const
-{
-    return numSpacings_;
-}
-
-char *
-lefiLayer::name() const
-{
-    return name_;
-}
-
-const char *
-lefiLayer::type() const
-{
-    return type_;
-}
-
-// 5.8
-const char *
-lefiLayer::layerType() const
-{
-    return layerType_;
-}
-
-double
-lefiLayer::pitch() const
-{
-    return pitchX_;
-}
-
-// 5.6
-double
-lefiLayer::pitchX() const
-{
-    return pitchX_;
-}
-
-// 5.6
-double
-lefiLayer::pitchY() const
-{
-    return pitchY_;
-}
-
-double
-lefiLayer::offset() const
-{
-    return offsetX_;
-}
-
-// 5.6
-double
-lefiLayer::offsetX() const
-{
-    return offsetX_;
-}
-
-// 5.6
-double
-lefiLayer::offsetY() const
-{
-    return offsetY_;
-}
-
-double
-lefiLayer::width() const
-{
-    return width_;
-}
-
-double
-lefiLayer::area() const
-{
-    return area_;
-}
-
-// 5.6
-double
-lefiLayer::diagPitch() const
-{
-    return diagPitchX_;
-}
-
-// 5.6
-double
-lefiLayer::diagPitchX() const
-{
-    return diagPitchX_;
-}
-
-// 5.6
-double
-lefiLayer::diagPitchY() const
-{
-    return diagPitchY_;
-}
-
-// 5.6
-double
-lefiLayer::diagWidth() const
-{
-    return diagWidth_;
-}
-
-// 5.6
-double
-lefiLayer::diagSpacing() const
-{
-    return diagSpacing_;
-}
-
-double
-lefiLayer::wireExtension() const
-{
-    return wireExtension_;
-}
-
-double
-lefiLayer::spacing(int index) const
-{
-    return spacing_[index];
-}
-
-char *
-lefiLayer::spacingName(int index) const
-{
-    return spacingName_[index];
-}
-
-int
-lefiLayer::spacingAdjacentCuts(int index) const
-{
-    return spacingAdjacentCuts_[index];
-}
-
-double
-lefiLayer::spacingAdjacentWithin(int index) const
-{
-    return spacingAdjacentWithin_[index];
-}
-
-double
-lefiLayer::spacingArea(int index) const
-{
-    return spacingCutArea_[index];
-}
-
-double
-lefiLayer::spacingRangeMin(int index) const
-{
-    return rangeMin_[index];
-}
-
-double
-lefiLayer::spacingRangeMax(int index) const
-{
-    return rangeMax_[index];
-}
-
-double
-lefiLayer::spacingRangeInfluence(int index) const
-{
-    return rangeInfluence_[index];
-}
-
-double
-lefiLayer::spacingRangeInfluenceMin(int index) const
-{
-    return rangeInfluenceRangeMin_[index];
-}
-
-double
-lefiLayer::spacingRangeInfluenceMax(int index) const
-{
-    return rangeInfluenceRangeMax_[index];
-}
-
-double
-lefiLayer::spacingRangeRangeMin(int index) const
-{
-    return rangeRangeMin_[index];
-}
-
-double
-lefiLayer::spacingRangeRangeMax(int index) const
-{
-    return rangeRangeMax_[index];
-}
-
-double
-lefiLayer::spacingLengthThreshold(int index) const
-{
-    return lengthThreshold_[index];
-}
-
-double
-lefiLayer::spacingLengthThresholdRangeMin(int index) const
-{
-    return lengthThresholdRangeMin_[index];
-}
-
-double
-lefiLayer::spacingLengthThresholdRangeMax(int index) const
-{
-    return lengthThresholdRangeMax_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingEolWidth(int index) const
-{
-    return eolWidth_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingEolWithin(int index) const
-{
-    return eolWithin_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingParSpace(int index) const
-{
-    return parSpace_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingParWithin(int index) const
-{
-    return parWithin_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingNotchLength(int index) const
-{
-    return notchLength_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingEndOfNotchWidth(int index) const
-{
-    return endOfNotchWidth_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingEndOfNotchSpacing(int index) const
-{
-    return minNotchSpacing_[index];
-}
-
-// 5.7
-double
-lefiLayer::spacingEndOfNotchLength(int index) const
-{
-    return eonotchLength_[index];
-}
-
-const char *
-lefiLayer::direction() const
-{
-    return direction_;
-}
-
-double
-lefiLayer::currentDensityPoint() const
-{
-    return currentDensity_;
-}
-
-double
-lefiLayer::resistance() const
-{
-    return resistance_;
-}
-
-double
-lefiLayer::capacitance() const
-{
-    return capacitance_;
-}
-
-double
-lefiLayer::height() const
-{
-    return height_;
-}
-
-double
-lefiLayer::thickness() const
-{
-    return thickness_;
-}
-
-double
-lefiLayer::shrinkage() const
-{
-    return shrinkage_;
-}
-
-double
-lefiLayer::capMultiplier() const
-{
-    return capMultiplier_;
-}
-
-double
-lefiLayer::edgeCap() const
-{
-    return edgeCap_;
-}
-
-double
-lefiLayer::antennaLength() const
-{
-    return antennaLength_;
-}
-
-double
-lefiLayer::antennaArea() const
-{
-    return antennaArea_;
-}
-
-// 5.5
-int
-lefiLayer::numMinimumcut() const
-{
-    return numMinimumcut_;
-}
-
-// 5.5
-int
-lefiLayer::minimumcut(int index) const
-{
-    return minimumcut_[index];
-}
-
-// 5.5
-double
-lefiLayer::minimumcutWidth(int index) const
-{
-    return minimumcutWidth_[index];
-}
-
-// 5.7
-int
-lefiLayer::hasMinimumcutWithin(int index) const
-{
-    return hasMinimumcutWithin_[index];
-}
-
-// 5.7
-double
-lefiLayer::minimumcutWithin(int index) const
-{
-    return minimumcutWithin_[index];
-}
-
-// 5.5
-int
-lefiLayer::hasMinimumcutConnection(int index) const
-{
-    return hasMinimumcutConnection_[index];
-}
-
-// 5.5
-const char *
-lefiLayer::minimumcutConnection(int index) const
-{
-    return minimumcutConnection_[index];
-}
-
-// 5.5
-int
-lefiLayer::hasMinimumcutNumCuts(int index) const
-{
-    return hasMinimumcutNumCuts_[index];
-}
-
-// 5.5
-double
-lefiLayer::minimumcutLength(int index) const
-{
-    return minimumcutLength_[index];
-}
-
-// 5.5
-double
-lefiLayer::minimumcutDistance(int index) const
-{
-    return minimumcutDistance_[index];
-}
-
-// 5.5
-int
-lefiLayer::hasMaxwidth() const
-{
-    return maxwidth_ == -1 ? 0 : 1;
-}
-
-// 5.5
-double
-lefiLayer::maxwidth() const
-{
-    return maxwidth_;
-}
-
-// 5.5
-int
-lefiLayer::hasMinwidth() const
-{
-    return minwidth_ == -1 ? 0 : 1;
-}
-
-// 5.5
-double
-lefiLayer::minwidth() const
-{
-    return minwidth_;
-}
-
-// 5.8
-int
-lefiLayer::mask() const
-{
-    return maskNumber_;
-}
-
-// 5.5
-int
-lefiLayer::numMinenclosedarea() const
-{
-    return numMinenclosedarea_;
-}
-
-// 5.5
-int
-lefiLayer::hasMinenclosedareaWidth(int index) const
-{
-    return minenclosedareaWidth_[index] == -1 ? 0 : 1;
-}
-
-// 5.5
-double
-lefiLayer::minenclosedarea(int index) const
-{
-    return minenclosedarea_[index];
-}
-
-// 5.5
-double
-lefiLayer::minenclosedareaWidth(int index) const
-{
-    return minenclosedareaWidth_[index];
-}
-
-// 5.5 & 5.6
-int
-lefiLayer::hasMinstep() const
-{
-    return numMinstep_? 1 : 0;
-}
-
-// 5.5
-int
-lefiLayer::hasProtrusion() const
-{
-    return protrusionWidth1_ == -1 ? 0 : 1;
-}
-
-// 5.5
-double
-lefiLayer::protrusionWidth1() const
-{
-    return protrusionWidth1_;
-}
-
-// 5.5
-double
-lefiLayer::protrusionLength() const
-{
-    return protrusionLength_;
-}
-
-// 5.5
-double
-lefiLayer::protrusionWidth2() const
-{
-    return protrusionWidth2_;
-}
-
-void
-lefiLayer::print(FILE *f) const
-{
-    int     i, max;
-    double  *j;
-    double  *k;
-    fprintf(f, "Layer %s:\n", name());
-    if (hasType())
-        fprintf(f, "  type %s\n", type());
-    if (hasMask())
-        fprintf(f, "  mask %d\n", mask());
-    if (hasPitch())
-        fprintf(f, "  pitch %g\n", pitch());
-    if (hasWireExtension())
-        fprintf(f, "  wireextension %g\n", wireExtension());
-    if (hasWidth())
-        fprintf(f, "  width %g\n", width());
-    if (hasArea())
-        fprintf(f, "  area %g\n", area());
-    if (hasSpacingNumber()) {
-        for (i = 0; i < numSpacing(); i++) {
-            fprintf(f, "  spacing %g\n", spacing(i));
-            if (hasSpacingRange(i)) {
-                fprintf(f, "  range %g %g\n",
-                        spacingRangeMin(i),
-                        spacingRangeMax(i));
-                if (hasSpacingRangeUseLengthThreshold(i))
-                    fprintf(f, "    uselengththreshold\n");
-                else if (hasSpacingRangeInfluence(i)) {
-                    fprintf(f, "    influence %g\n",
-                            spacingRangeInfluence(i));
-                    if (hasSpacingRangeInfluenceRange(i))
-                        fprintf(f, "      Range %g %g\n",
-                                spacingRangeInfluenceMin(i),
-                                spacingRangeInfluenceMax(i));
-                } else if (hasSpacingRangeRange(i))
-                    fprintf(f, "    range %g %g\n",
-                            spacingRangeRangeMin(i),
-                            spacingRangeRangeMax(i));
-            } else if (hasSpacingLengthThreshold(i)) {
-                fprintf(f, "  lengththreshold %g\n",
-                        spacingLengthThreshold(i));
-                if (hasSpacingLengthThresholdRange(i))
-                    fprintf(f, "  range %g %g\n",
-                            spacingLengthThresholdRangeMin(i),
-                            spacingLengthThresholdRangeMax(i));
-            }
-        }
-    }
-    if (hasDirection())
-        fprintf(f, "  direction %s\n", direction());
-
-    if (hasResistance())
-        fprintf(f, "  resistance %g\n", resistance());
-    if (hasResistanceArray()) {
-        resistanceArray(&max, &j, &k);
-        fprintf(f, "  resistance PWL");
-        for (i = 0; i < max; i++)
-            fprintf(f, " %g %g", j[i], k[i]);
-        fprintf(f, "\n");
-    }
-    if (hasCapacitance())
-        fprintf(f, "  capacitance %g\n", capacitance());
-    if (hasCapacitanceArray()) {
-        capacitanceArray(&max, &j, &k);
-        fprintf(f, "  capacitance PWL");
-        for (i = 0; i < max; i++)
-            fprintf(f, " %g %g", j[i], k[i]);
-        fprintf(f, "\n");
-    }
-
-    if (hasHeight())
-        fprintf(f, "  height %g\n", height());
-    if (hasThickness())
-        fprintf(f, "  thickness %g\n", thickness());
-    if (hasShrinkage())
-        fprintf(f, "  shrinkage %g\n", shrinkage());
-    if (hasCapMultiplier())
-        fprintf(f, "  cap muptiplier %g\n", capMultiplier());
-    if (hasEdgeCap())
-        fprintf(f, "  edge cap %g\n", edgeCap());
-
-    if (hasCurrentDensityPoint())
-        fprintf(f, "  currentden %g\n", currentDensityPoint());
-    if (hasCurrentDensityArray()) {
-        currentDensityArray(&max, &j, &k);
-        fprintf(f, "  currentden PWL");
-        for (i = 0; i < max; i++)
-            fprintf(f, " %g %g", j[i], k[i]);
-        fprintf(f, "\n");
-    }
-}
-
-void
-lefiLayer::addProp(const char   *name,
-                   const char   *value,
-                   const char   type)
-{
-    int len = strlen(name) + 1;
-    // char*  tvalue;
-    // int    vlen, i;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numProps_;
-        char    **nn;
-        char    **nv;
-        double  *nd;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            max = propsAllocated_ = 2;
-        else
-            max = propsAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nd[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nd;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = 0;
-    //if (type == 'N') {
-    // it is a number, don't know if it is an integer or real
-    // Look for . in the value
-    //tvalue = (char*)value;
-    //vlen = strlen(value);
-    //for (i = 0; i < vlen; i++) { 
-    //if (*tvalue == '.') {
-    //types_[numProps_] = 'R';
-    //break;
-    //}
-    //++tvalue;
-    //types_[numProps_] = type;
-    //}
-    //} else
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-void
-lefiLayer::addNumProp(const char    *name,
-                      const double  d,
-                      const char    *value,
-                      const char    type)
-{
-    int len = strlen(name) + 1;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numProps_;
-        char    **nn;
-        char    **nv;
-        double  *nd;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            max = propsAllocated_ = 2;
-        else
-            max = propsAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nd[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nd;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = d;
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-int
-lefiLayer::numProps() const
-{
-    return numProps_;
-}
-
-const char *
-lefiLayer::propName(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return names_[i];
-}
-
-const char *
-lefiLayer::propValue(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return values_[i];
-}
-
-double
-lefiLayer::propNumber(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return dvalues_[i];
-}
-
-const char
-lefiLayer::propType(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return types_[i];
-}
-
-int
-lefiLayer::propIsNumber(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return dvalues_[i] ? 1 : 0;
-}
-
-int
-lefiLayer::propIsString(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1300): The index number %d given for the layer property is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1300, msg);
-        return 0;
-    }
-    return dvalues_[i] ? 0 : 1;
-}
-
-void
-lefiLayer::addAccurrentDensity(const char *type)
-{
-    lefiLayerDensity *density;
-    if (numAccurrents_ == accurrentAllocated_) {
-        lefiLayerDensity    **array;
-        int                 i;
-        accurrentAllocated_ = accurrentAllocated_ ?
-            accurrentAllocated_ * 2 : 2;
-        array = (lefiLayerDensity**) lefMalloc(sizeof(lefiLayerDensity*)
-                                               * accurrentAllocated_);
-        for (i = 0; i < numAccurrents_; i++)
-            array[i] = accurrents_[i];
-        if (accurrents_)
-            lefFree((char*) (accurrents_));
-        accurrents_ = array;
-    }
-    density = accurrents_[numAccurrents_] =
-        (lefiLayerDensity*) lefMalloc(sizeof(lefiLayerDensity));
-    numAccurrents_ += 1;
-    density->Init(type);
-}
-
-void
-lefiLayer::setAcOneEntry(double num)
-{
-    lefiLayerDensity *density;
-    density = accurrents_[numAccurrents_ - 1];
-    density->setOneEntry(num);
-}
-
-void
-lefiLayer::addAcFrequency()
-{
-    lefiLayerDensity *density;
-    density = accurrents_[numAccurrents_ - 1];
-    density->addFrequency(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addAcCutarea()
-{
-    lefiLayerDensity *density;
-    density = accurrents_[numAccurrents_ - 1];
-    density->addCutarea(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addAcTableEntry()
-{
-    lefiLayerDensity *density;
-    density = accurrents_[numAccurrents_ - 1];
-    density->addTableEntry(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addAcWidth()
-{
-    lefiLayerDensity *density;
-    density = accurrents_[numAccurrents_ - 1];
-    density->addWidth(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::setDcOneEntry(double num)
-{
-    lefiLayerDensity *density;
-    density = dccurrents_[numDccurrents_ - 1];
-    density->setOneEntry(num);
-}
-
-void
-lefiLayer::addDccurrentDensity(const char *type)
-{
-    lefiLayerDensity *density;
-    if (numDccurrents_ == dccurrentAllocated_) {
-        lefiLayerDensity    **array;
-        int                 i;
-        dccurrentAllocated_ = dccurrentAllocated_ ?
-            dccurrentAllocated_ * 2 : 2;
-        array = (lefiLayerDensity**) lefMalloc(sizeof(lefiLayerDensity*)
-                                               * dccurrentAllocated_);
-        for (i = 0; i < numDccurrents_; i++)
-            array[i] = dccurrents_[i];
-        if (dccurrents_)
-            lefFree((char*) (dccurrents_));
-        dccurrents_ = array;
-    }
-    density = dccurrents_[numDccurrents_] =
-        (lefiLayerDensity*) lefMalloc(sizeof(lefiLayerDensity));
-    numDccurrents_ += 1;
-    density->Init(type);
-}
-
-void
-lefiLayer::addDcCutarea()
-{
-    lefiLayerDensity *density;
-    density = dccurrents_[numDccurrents_ - 1];
-    density->addCutarea(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addDcTableEntry()
-{
-    lefiLayerDensity *density;
-    density = dccurrents_[numDccurrents_ - 1];
-    density->addTableEntry(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addDcWidth()
-{
-    lefiLayerDensity *density;
-    density = dccurrents_[numDccurrents_ - 1];
-    density->addWidth(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addNumber(double num)
-{
-    if (numNums_ == numAllocated_) {
-        double  *array;
-        int     i;
-        numAllocated_ = numAllocated_ ?
-            numAllocated_ * 2 : 2;
-        array = (double*) lefMalloc(sizeof(double) * numAllocated_);
-        for (i = 0; i < numNums_; i++)
-            array[i] = nums_[i];
-        if (nums_)
-            lefFree((char*) (nums_));
-        nums_ = array;
-    }
-    nums_[numNums_++] = num;
-}
-
-int
-lefiLayer::getNumber()
-{
-    return numNums_ - 1;
-}
-
-int
-lefiLayer::hasAccurrentDensity() const
-{
-    return numAccurrents_ ? 1 : 0;
-}
-
-int
-lefiLayer::hasDccurrentDensity() const
-{
-    return numDccurrents_ ? 1 : 0;
-}
-
-int
-lefiLayer::numAccurrentDensity() const
-{
-    return (numAccurrents_);
-}
-
-int
-lefiLayer::numDccurrentDensity() const
-{
-    return (numDccurrents_);
-}
-
-lefiLayerDensity *
-lefiLayer::accurrent(int index) const
-{
-    if (index >= numAccurrents_)
-        return 0;
-    return (accurrents_[index]);
-}
-
-lefiLayerDensity *
-lefiLayer::dccurrent(int index) const
-{
-    if (index >= numDccurrents_)
-        return 0;
-    return (dccurrents_[index]);
-}
-
-// 5.5
-void
-lefiLayer::addAntennaModel(int aOxide)
-{
-     // For version 5.5 only OXIDE1, OXIDE2, OXIDE3, & OXIDE4
-    // are defined within a macro pin
-    lefiAntennaModel *amo;
-    int                 i;
-
-    if (numAntennaModel_ == 0) {   // does not have antennaModel
-        antennaModel_ = (lefiAntennaModel**)
-            lefMalloc(sizeof(lefiAntennaModel*) * 4);
-        antennaModelAllocated_ = 4;
-        for (i = 0; i < 4; i++) {
-            antennaModel_[i] = (lefiAntennaModel*)
-                lefMalloc(sizeof(lefiAntennaModel));
-            antennaModel_[i]->Init();
-            // just initialize it first
-        }
-        antennaModelAllocated_ = 4;
-        amo = antennaModel_[0];
-                }
-
-    // First can go any oxide, so fill pref oxides models.
-    for (int idx = 0; idx < aOxide - 1; idx++) {
-        amo = antennaModel_[idx];
-        if (!amo->antennaOxide()) {
-            amo->setAntennaModel(idx + 1);   
-                }
-                }
-
-    amo = antennaModel_[aOxide - 1];
-    // Oxide has not defined yet
-    if (amo->antennaOxide()) {
-        amo->Destroy();
-                }
-
-    if (aOxide > numAntennaModel_) {
-        numAntennaModel_ = aOxide;
-            }
-
-            amo->Init();
-    amo->setAntennaModel(aOxide);
-
-    currentAntennaModel_ = amo;
-    
-    return;
-}
-
-// 5.5
-int
-lefiLayer::numAntennaModel() const
-{
-    return numAntennaModel_;
-}
-
-// 5.5
-lefiAntennaModel *
-lefiLayer::antennaModel(int index) const
-{
-    return antennaModel_[index];
-}
-
-// 3/23/2000 -- Wanda da Rosa.  The following are for 5.4 syntax
-void
-lefiLayer::setAntennaAreaRatio(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaAreaRatio(value);
-}
-
-void
-lefiLayer::setAntennaCumAreaRatio(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaCumAreaRatio(value);
-}
-
-void
-lefiLayer::setAntennaAreaFactor(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaAreaFactor(value);
-}
-
-void
-lefiLayer::setAntennaSideAreaRatio(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaSideAreaRatio(value);
-}
-
-void
-lefiLayer::setAntennaCumSideAreaRatio(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaCumSideAreaRatio(value);
-}
-
-void
-lefiLayer::setAntennaSideAreaFactor(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-   currentAntennaModel_->setAntennaSideAreaFactor(value);
-}
-
-void
-lefiLayer::setAntennaValue(lefiAntennaEnum  antennaType,
-                           double           value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaValue(antennaType, value);
-}
-
-void
-lefiLayer::setAntennaDUO(lefiAntennaEnum antennaType)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaDUO(antennaType);
-}
-
-void
-lefiLayer::setAntennaPWL(lefiAntennaEnum    antennaType,
-                         lefiAntennaPWL     *pwl)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaPWL(antennaType, pwl);
-}
-
-// 5.7
-void
-lefiLayer::setAntennaCumRoutingPlusCut()
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaCumRoutingPlusCut();
-}
-
-// 5.7
-void
-lefiLayer::setAntennaGatePlusDiff(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaGatePlusDiff(value);
-}
-
-// 5.7
-void
-lefiLayer::setAntennaAreaMinusDiff(double value)
-{
-    if (numAntennaModel_ == 0)   // haven't created any antannaModel yet
-        addAntennaModel(1);
-    currentAntennaModel_->setAntennaAreaMinusDiff(value);
-}
-
-// 8/29/2001 -- Wanda da Rosa.  The following are for 5.4 enhancements
-
-void
-lefiLayer::setSlotWireWidth(double num)
-{
-    hasSlotWireWidth_ = 1;
-    slotWireWidth_ = num;
-}
-
-void
-lefiLayer::setSlotWireLength(double num)
-{
-    hasSlotWireLength_ = 1;
-    slotWireLength_ = num;
-}
-
-void
-lefiLayer::setSlotWidth(double num)
-{
-    hasSlotWidth_ = 1;
-    slotWidth_ = num;
-}
-
-void
-lefiLayer::setSlotLength(double num)
-{
-    hasSlotLength_ = 1;
-    slotLength_ = num;
-}
-
-void
-lefiLayer::setMaxAdjacentSlotSpacing(double num)
-{
-    hasMaxAdjacentSlotSpacing_ = 1;
-    maxAdjacentSlotSpacing_ = num;
-}
-
-void
-lefiLayer::setMaxCoaxialSlotSpacing(double num)
-{
-    hasMaxCoaxialSlotSpacing_ = 1;
-    maxCoaxialSlotSpacing_ = num;
-}
-
-void
-lefiLayer::setMaxEdgeSlotSpacing(double num)
-{
-    hasMaxEdgeSlotSpacing_ = 1;
-    maxEdgeSlotSpacing_ = num;
-}
-
-void
-lefiLayer::setSplitWireWidth(double num)
-{
-    hasSplitWireWidth_ = 1;
-    splitWireWidth_ = num;
-}
-
-void
-lefiLayer::setMinimumDensity(double num)
-{
-    hasMinimumDensity_ = 1;
-    minimumDensity_ = num;
-}
-
-void
-lefiLayer::setMaximumDensity(double num)
-{
-    hasMaximumDensity_ = 1;
-    maximumDensity_ = num;
-}
-
-void
-lefiLayer::setDensityCheckWindow(double length,
-                                 double width)
-{
-    hasDensityCheckWindow_ = 1;
-    densityCheckWindowLength_ = length;
-    densityCheckWindowWidth_ = width;
-}
-
-void
-lefiLayer::setDensityCheckStep(double num)
-{
-    hasDensityCheckStep_ = 1;
-    densityCheckStep_ = num;
-}
-
-void
-lefiLayer::setFillActiveSpacing(double num)
-{
-    hasFillActiveSpacing_ = 1;
-    fillActiveSpacing_ = num;
-}
-
-int
-lefiLayer::hasSlotWireWidth() const
-{
-    return hasSlotWireWidth_;
-}
-
-int
-lefiLayer::hasSlotWireLength() const
-{
-    return hasSlotWireLength_;
-}
-
-int
-lefiLayer::hasSlotWidth() const
-{
-    return hasSlotWidth_;
-}
-
-int
-lefiLayer::hasSlotLength() const
-{
-    return hasSlotLength_;
-}
-
-int
-lefiLayer::hasMaxAdjacentSlotSpacing() const
-{
-    return hasMaxAdjacentSlotSpacing_;
-}
-
-int
-lefiLayer::hasMaxCoaxialSlotSpacing() const
-{
-    return hasMaxCoaxialSlotSpacing_;
-}
-
-int
-lefiLayer::hasMaxEdgeSlotSpacing() const
-{
-    return hasMaxEdgeSlotSpacing_;
-}
-
-int
-lefiLayer::hasSplitWireWidth() const
-{
-    return hasSplitWireWidth_;
-}
-
-int
-lefiLayer::hasMinimumDensity() const
-{
-    return hasMinimumDensity_;
-}
-
-int
-lefiLayer::hasMaximumDensity() const
-{
-    return hasMaximumDensity_;
-}
-
-int
-lefiLayer::hasDensityCheckWindow() const
-{
-    return hasDensityCheckWindow_;
-}
-
-int
-lefiLayer::hasDensityCheckStep() const
-{
-    return hasDensityCheckStep_;
-}
-
-int
-lefiLayer::hasFillActiveSpacing() const
-{
-    return hasFillActiveSpacing_;
-}
-
-double
-lefiLayer::slotWireWidth() const
-{
-    return slotWireWidth_;
-}
-
-double
-lefiLayer::slotWireLength() const
-{
-    return slotWireLength_;
-}
-
-double
-lefiLayer::slotWidth() const
-{
-    return slotWidth_;
-}
-
-double
-lefiLayer::slotLength() const
-{
-    return slotLength_;
-}
-
-double
-lefiLayer::maxAdjacentSlotSpacing() const
-{
-    return maxAdjacentSlotSpacing_;
-}
-
-double
-lefiLayer::maxCoaxialSlotSpacing() const
-{
-    return maxCoaxialSlotSpacing_;
-}
-
-double
-lefiLayer::maxEdgeSlotSpacing() const
-{
-    return maxEdgeSlotSpacing_;
-}
-
-double
-lefiLayer::splitWireWidth() const
-{
-    return splitWireWidth_;
-}
-
-double
-lefiLayer::minimumDensity() const
-{
-    return minimumDensity_;
-}
-
-double
-lefiLayer::maximumDensity() const
-{
-    return maximumDensity_;
-}
-
-double
-lefiLayer::densityCheckWindowLength() const
-{
-    return densityCheckWindowLength_;
-}
-
-double
-lefiLayer::densityCheckWindowWidth() const
-{
-    return densityCheckWindowWidth_;
-}
-
-double
-lefiLayer::densityCheckStep() const
-{
-    return densityCheckStep_;
-}
-
-double
-lefiLayer::fillActiveSpacing() const
-{
-    return fillActiveSpacing_;
-}
-
-// 5.5 SPACINGTABLE
-
-void
-lefiLayer::addSpacingTable()
-{
-    lefiSpacingTable *sp;
-    if (numSpacingTable_ == spacingTableAllocated_) {
-        lefiSpacingTable    **array;
-        int                 i;
-        spacingTableAllocated_ = spacingTableAllocated_ ?
-            spacingTableAllocated_ * 2 : 2;
-        array = (lefiSpacingTable**) lefMalloc(sizeof(lefiSpacingTable*)
-                                               * spacingTableAllocated_);
-        for (i = 0; i < numSpacingTable_; i++)
-            array[i] = spacingTable_[i];
-        if (spacingTable_)
-            lefFree((char*) (spacingTable_));
-        spacingTable_ = array;
-    }
-    sp = spacingTable_[numSpacingTable_] =
-        (lefiSpacingTable*) lefMalloc(sizeof(lefiSpacingTable));
-    numSpacingTable_ += 1;
-    sp->Init();
-}
-
-void
-lefiLayer::addSpParallelLength()
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    sp->addParallelLength(numNums_, nums_);
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addSpParallelWidth(double width)
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    sp->addParallelWidth(width);
-}
-
-void
-lefiLayer::addSpParallelWidthSpacing()
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    sp->addParallelWidthSpacing(numNums_, nums_);
-    // Since inside addParallelWidthSpacing copy the nums_, we can free it
-    // here
-    lefFree((char*) (nums_));
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-}
-
-void
-lefiLayer::addSpTwoWidths(double    width,
-                          double    runLength)
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    /* This will never happen since in lef.y, the grammer requires a number for
-       spacing
-      if (numNums_ == 0) {
-         * spacing is required in TWOWIDTHS *
-         lefiError("ERROR (LEFPARS-1324): Incorrect syntax defined for the statement TWOWIDTHS.\nspacing, which is required is not defined.");
-         return;
-      }
-    */
-    sp->addTwoWidths(width, runLength, numNums_,
-                     nums_, hasTwoWidthPRL_);
-    // Since inside addTwoWidthsSpacing copy the nums_, we can free it
-    // here
-    lefFree((char*) (nums_));
-    numNums_ = 0;
-    numAllocated_ = 0;
-    nums_ = 0;
-    hasTwoWidthPRL_ = 0;
-}
-
-void
-lefiLayer::setInfluence()
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    sp->setInfluence();
-}
-
-void
-lefiLayer::addSpInfluence(double    width,
-                          double    distance,
-                          double    spacing)
-{
-    lefiSpacingTable *sp;
-    sp = spacingTable_[numSpacingTable_ - 1];
-    sp->addInfluence(width, distance, spacing);
-}
-
-int
-lefiLayer::numSpacingTable()
-{
-    return numSpacingTable_;
-}
-
-void
-lefiLayer::setSpTwoWidthsHasPRL(int hasPRL)
-{
-    hasTwoWidthPRL_ = hasPRL;
-}
-
-lefiSpacingTable *
-lefiLayer::spacingTable(int index)
-{
-    return spacingTable_[index];
-}
-
-// 5.6 ENCLOSURE PREFERENCLOSURE & RESISTANCEPERCUT
-
-void
-lefiLayer::addEnclosure(char    *enclRule,
-                        double  overhang1,
-                        double  overhang2)
-{
-    if (numEnclosure_ == enclosureAllocated_) {
-        int     i, len;
-        char    **er;
-        double  *o1;
-        double  *o2;
-        double  *mw;
-        double  *ct;
-        double  *ml;
-
-        if (enclosureAllocated_ == 0)
-            len = enclosureAllocated_ = 2;
-        else
-            len = enclosureAllocated_ *= 2;
-        er = (char**) lefMalloc(sizeof(char*) * len);
-        o1 = (double*) lefMalloc(sizeof(double) * len);
-        o2 = (double*) lefMalloc(sizeof(double) * len);
-        mw = (double*) lefMalloc(sizeof(double) * len);
-        ct = (double*) lefMalloc(sizeof(double) * len);
-        ml = (double*) lefMalloc(sizeof(double) * len);
-
-        if (numEnclosure_ > 0) {
-            for (i = 0; i < numEnclosure_; i++) {
-                er[i] = enclosureRules_[i];
-                o1[i] = overhang1_[i];
-                o2[i] = overhang2_[i];
-                mw[i] = encminWidth_[i];
-                ct[i] = cutWithin_[i];
-                ml[i] = minLength_[i];
-            }
-            lefFree((char*) (enclosureRules_));
-            lefFree((char*) (overhang1_));
-            lefFree((char*) (overhang2_));
-            lefFree((char*) (encminWidth_));
-            lefFree((char*) (cutWithin_));
-            lefFree((char*) (minLength_));
-        }
-        enclosureRules_ = er;
-        overhang1_ = o1;
-        overhang2_ = o2;
-        encminWidth_ = mw;
-        cutWithin_ = ct;
-        minLength_ = ml;
-    }
-    if (enclRule) {
-        if (strcmp(enclRule, "NULL") == 0)
-            enclosureRules_[numEnclosure_] = NULL;
-        else
-            enclosureRules_[numEnclosure_] = strdup(enclRule);
-    } else
-        enclosureRules_[numEnclosure_] = NULL;
-    overhang1_[numEnclosure_] = overhang1;
-    overhang2_[numEnclosure_] = overhang2;
-    encminWidth_[numEnclosure_] = 0;
-    cutWithin_[numEnclosure_] = 0;
-    minLength_[numEnclosure_] = 0;
-    numEnclosure_ += 1;
-}
-
-void
-lefiLayer::addEnclosureWidth(double minWidth)
-{
-    encminWidth_[numEnclosure_ - 1] = minWidth;
-}
-
-void
-lefiLayer::addEnclosureExceptEC(double cutWithin)
-{
-    cutWithin_[numEnclosure_ - 1] = cutWithin;
-}
-
-void
-lefiLayer::addEnclosureLength(double minLength)
-{
-    minLength_[numEnclosure_ - 1] = minLength;
-}
-
-int
-lefiLayer::numEnclosure() const
-{
-    return numEnclosure_;
-}
-
-int
-lefiLayer::hasEnclosureRule(int index) const
-{
-    return enclosureRules_[index] ? 1 : 0;
-}
-
-char *
-lefiLayer::enclosureRule(int index)
-{
-    return enclosureRules_[index];
-}
-
-double
-lefiLayer::enclosureOverhang1(int index) const
-{
-    return overhang1_[index];
-}
-
-double
-lefiLayer::enclosureOverhang2(int index) const
-{
-    return overhang2_[index];
-}
-
-int
-lefiLayer::hasEnclosureWidth(int index) const
-{
-    return encminWidth_[index] ? 1 : 0;
-}
-
-double
-lefiLayer::enclosureMinWidth(int index) const
-{
-    return encminWidth_[index];
-}
-
-int
-lefiLayer::hasEnclosureExceptExtraCut(int index) const
-{
-    return cutWithin_[index] ? 1 : 0;
-}
-
-double
-lefiLayer::enclosureExceptExtraCut(int index) const
-{
-    return cutWithin_[index];
-}
-
-int
-lefiLayer::hasEnclosureMinLength(int index) const
-{
-    return minLength_[index] ? 1 : 0;
-}
-
-double
-lefiLayer::enclosureMinLength(int index) const
-{
-    return minLength_[index];
-}
-
-void
-lefiLayer::addPreferEnclosure(char      *enclRule,
-                              double    overhang1,
-                              double    overhang2)
-{
-    if (numPreferEnclosure_ == preferEnclosureAllocated_) {
-        int     i, len;
-        char    **er;
-        double  *o1;
-        double  *o2;
-        double  *mw;
-
-        if (preferEnclosureAllocated_ == 0)
-            len = preferEnclosureAllocated_ = 2;
-        else
-            len = preferEnclosureAllocated_ *= 2;
-        er = (char**) lefMalloc(sizeof(char*) * len);
-        o1 = (double*) lefMalloc(sizeof(double) * len);
-        o2 = (double*) lefMalloc(sizeof(double) * len);
-        mw = (double*) lefMalloc(sizeof(double) * len);
-
-        if (numPreferEnclosure_ > 0) {
-            for (i = 0; i < numPreferEnclosure_; i++) {
-                er[i] = preferEnclosureRules_[i];
-                o1[i] = preferOverhang1_[i];
-                o2[i] = preferOverhang1_[i];
-                mw[i] = preferMinWidth_[i];
-            }
-            lefFree((char*) (preferEnclosureRules_));
-            lefFree((char*) (preferOverhang1_));
-            lefFree((char*) (preferOverhang2_));
-            lefFree((char*) (preferMinWidth_));
-        }
-        preferEnclosureRules_ = er;
-        preferOverhang1_ = o1;
-        preferOverhang2_ = o2;
-        preferMinWidth_ = mw;
-    }
-    if (strcmp(enclRule, "NULL") == 0)
-        preferEnclosureRules_[numPreferEnclosure_] = NULL;
-    else
-        preferEnclosureRules_[numPreferEnclosure_] = strdup(enclRule);
-    preferOverhang1_[numPreferEnclosure_] = overhang1;
-    preferOverhang2_[numPreferEnclosure_] = overhang2;
-    preferMinWidth_[numPreferEnclosure_] = 0;
-    numPreferEnclosure_ += 1;
-}
-
-void
-lefiLayer::addPreferEnclosureWidth(double minWidth)
-{
-    preferMinWidth_[numPreferEnclosure_ - 1] = minWidth;
-}
-
-int
-lefiLayer::numPreferEnclosure() const
-{
-    return numPreferEnclosure_;
-}
-
-int
-lefiLayer::hasPreferEnclosureRule(int index) const
-{
-    return preferEnclosureRules_[index] ? 1 : 0;
-}
-
-char *
-lefiLayer::preferEnclosureRule(int index)
-{
-    return preferEnclosureRules_[index];
-}
-
-double
-lefiLayer::preferEnclosureOverhang1(int index) const
-{
-    return preferOverhang1_[index];
-}
-
-double
-lefiLayer::preferEnclosureOverhang2(int index) const
-{
-    return preferOverhang2_[index];
-}
-
-int
-lefiLayer::hasPreferEnclosureWidth(int index) const
-{
-    return preferMinWidth_[index] ? 1 : 0;
-}
-
-double
-lefiLayer::preferEnclosureMinWidth(int index) const
-{
-    return preferMinWidth_[index];
-}
-
-void
-lefiLayer::setResPerCut(double value)
-{
-    resPerCut_ = value;
-}
-
-int
-lefiLayer::hasResistancePerCut() const
-{
-    return resPerCut_ ? 1 : 0;
-}
-
-double
-lefiLayer::resistancePerCut() const
-{
-    return resPerCut_;
-}
-
-void
-lefiLayer::setDiagMinEdgeLength(double value)
-{
-    diagMinEdgeLength_ = value;
-}
-
-int
-lefiLayer::hasDiagMinEdgeLength() const
-{
-    return diagMinEdgeLength_ ? 1 : 0;
-}
-
-double
-lefiLayer::diagMinEdgeLength() const
-{
-    return diagMinEdgeLength_;
-}
-
-void
-lefiLayer::setMinSize(lefiGeometries *geom)
-{
-    struct lefiGeomPolygon  tempPoly;
-    int                     i;
-
-    tempPoly = *(geom->getPolygon(0));
-    numMinSize_ = tempPoly.numPoints;
-    if (numMinSize_ > 0) {
-        minSizeWidth_ = (double*) lefMalloc(sizeof(double) * numMinSize_);
-        minSizeLength_ = (double*) lefMalloc(sizeof(double) * numMinSize_);
-        for (i = 0; i < numMinSize_; i++) {
-            minSizeWidth_[i] = tempPoly.x[i];
-            minSizeLength_[i] = tempPoly.y[i];
-        }
-    } else {
-        minSizeWidth_ = 0;
-        minSizeLength_ = 0;
-    }
-}
-
-int
-lefiLayer::numMinSize() const
-{
-    return numMinSize_;
-}
-
-double
-lefiLayer::minSizeWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinSize_) {
-        sprintf(msg, "ERROR (LEFPARS-1301): The index number %d given for the layer MINSIZE is invalid.\nValid index is from 0 to %d\n", index, numMinSize_);
-        lefiError(0, 1301, msg);
-        return 0;
-    }
-    return minSizeWidth_[index];
-}
-
-double
-lefiLayer::minSizeLength(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinSize_) {
-        sprintf(msg, "ERROR (LEFPARS-1301): The index number %d given for the layer MINSIZE is invalid.\nValid index is from 0 to %d\n", index, numMinSize_);
-        lefiError(0, 1301, msg);
-        return 0;
-    }
-    return minSizeLength_[index];
-}
-
-// 5.6 CHANGES ON MINSTEP
-int
-lefiLayer::numMinstep() const
-{
-    return numMinstep_;
-}
-
-double
-lefiLayer::minstep(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstep_[index];
-}
-
-int
-lefiLayer::hasMinstepType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepType_[index] ? 1 : 0;
-}
-
-char *
-lefiLayer::minstepType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepType_[index];
-}
-
-int
-lefiLayer::hasMinstepLengthsum(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepLengthsum_[index] == -1 ? 0 : 1;
-}
-
-double
-lefiLayer::minstepLengthsum(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepLengthsum_[index];
-}
-
-// 5.7
-int
-lefiLayer::hasMinstepMaxedges(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMaxEdges_[index] == -1 ? 0 : 1;
-}
-
-// 5.7
-int
-lefiLayer::minstepMaxedges(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMaxEdges_[index];
-}
-
-// 5.7
-int
-lefiLayer::hasMinstepMinAdjLength(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMinAdjLength_[index] == -1 ? 0 : 1;
-}
-
-// 5.7
-double
-lefiLayer::minstepMinAdjLength(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMinAdjLength_[index];
-}
-
-// 5.7
-int
-lefiLayer::hasMinstepMinBetLength(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMinBetLength_[index] == -1 ? 0 : 1;
-}
-
-// 5.7
-double
-lefiLayer::minstepMinBetLength(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepMinBetLength_[index];
-}
-
-// 5.7
-int
-lefiLayer::hasMinstepXSameCorners(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numMinstep_) {
-        sprintf(msg, "ERROR (LEFPARS-1302): The index number %d given for the layer MINSTEP is invalid.\nValid index is from 0 to %d", index, numMinstep_);
-        lefiError(0, 1302, msg);
-        return 0;
-    }
-    return minstepXSameCorners_[index] == -1 ? 0 : 1;
-}
-
-// 5.7
-lefiOrthogonal *
-lefiLayer::orthogonal() const
-{
-    return spacingTableOrtho_;
-}
-
-// 5.7
-double
-lefiLayer::maxFloatingArea() const
-{
-    return maxArea_;
-}
-
-// 5.7
-double
-lefiLayer::viaWidth() const
-{
-    return viaWidth_;
-}
-
-// 5.7
-double
-lefiLayer::cutSpacing() const
-{
-    return cutSpacing_;
-}
-
-// 5.7
-int
-lefiLayer::numArrayCuts() const
-{
-    return numArrayCuts_;
-}
-
-// 5.7
-int
-lefiLayer::arrayCuts(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numArrayCuts_) {
-        sprintf(msg, "ERROR (LEFPARS-1303): The index number %d given for the layer ARRAYCUTS is invalid.\nValid index is from 0 to %d", index, numArrayCuts_);
-        lefiError(0, 1303, msg);
-        return 0;
-    }
-    return arrayCuts_[index];
-}
-
-// 5.7
-double
-lefiLayer::arraySpacing(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numArrayCuts_) {
-        sprintf(msg, "ERROR (LEFPARS-1304): The index number %d given for the layer SPACING is invalid.\nValid index is from 0 to %d", index, numArrayCuts_);
-        lefiError(0, 1304, msg);
-        return 0;
-    }
-    return arraySpacings_[index];
-}
-
-// PRIVATE 5.7
-// SPACING cutSpacing
-//     [CENTERTOCENTER]
-//     [SAMENET]
-//     [ LAYER secondLayerName [STACK]
-//     | ADJACENTCUTS {2|3|4} WITHIN cutWithin [EXCEPTSAMEPGNET]
-//     | PARALLELOVERLAP
-//     | AREA cutArea ] ;
-// SPACING routing ENDOFLINE eolWidth WITHIN eolWithin
-//     [PARALLELEDGE parSpace WITHIN parWithin [TWOEDGES]];
-void
-lefiLayer::parseSpacing(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    double  spValue = 0, width = 0, within = 0, pValue = 0, pWithin = 0;
-    double  cutArea = 0;
-    char    msg[1024];
-    int     numCuts = 0, twoEdges = 0;
-
-    // Pre-parse the string before breaking it up and store it in
-    // the layer class.
-    // If the string is
-    // SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWithin
-    //    [PARALLELEDGE parSpace WITHIN parWithin [TWOEDGES]]
-    //    [ENCLOSECUT [BELOW | ABOVE] encloseDist CUTSPACING cutToMetalSpace]
-    // Keep the property as it, and don't break it and save in layer class
-
-    value = strtok(wrkingStr, " ");
-    while (value) {
-        if (strcmp(value, "SPACING") != 0) {
-            free(wrkingStr);
-            return;
-        }
-
-        value = strtok(NULL, " ");
-        spValue = atof(value);
-
-        value = strtok(NULL, " ");
-        if ((strcmp(value, "CENTERTOCENTER") == 0) ||
-            (strcmp(value, "SAMENET") == 0) ||
-            (strcmp(value, "LAYER") == 0) ||
-            (strcmp(value, "ADJACENTCUTS") == 0) ||
-            (strcmp(value, "PARALLELOVERLAP") == 0) ||
-            (strcmp(value, "AREA") == 0)) {
-
-            if (strcmp(type(), "CUT") != 0) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1321): The property LEF57_SPACING with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                            values_[index], type());
-                            lefiError(msg);
-                */
-                sprintf(msg, "The property LEF57_SPACING with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                        values_[index], type());
-                lefError(1321, msg);
-                free(wrkingStr);
-                return;
-            }
-            setSpacingMin(spValue);
-            if (strcmp(value, "CENTERTOCENTER") == 0) {
-                // SPACING minSpacing CENTERTOCENTER ;
-                setSpacingCenterToCenter();
-                value = strtok(NULL, " ");
-                if (*value == ';') {
-                    value = strtok(NULL, " ");
-                    continue;  // Look for a new statement
-                }
-            }
-            if (strcmp(value, "SAMENET") == 0) {
-                // SPACING minSpacing SAMENET ;
-                setSpacingSamenet();
-                value = strtok(NULL, " ");
-                if (*value == ';') {
-                    value = strtok(NULL, " ");
-                    continue;  // Look for a new statement
-                }
-            }
-            if (strcmp(value, "LAYER") == 0) {
-                value = strtok(NULL, " ");
-                if (value && *value != '\n') {
-                    setSpacingName(value);
-                    value = strtok(NULL, " ");
-                    if (strcmp(value, "STACK") == 0) {
-                        setSpacingLayerStack();
-                        value = strtok(NULL, " ");
-                        if (*value != ';') {
-                            /*
-                                                 sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                                 values_[index]);
-                                                 lefiError(msg);
-                            */
-                            sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                    values_[index]);
-                            lefError(1320, msg);
-                            free(wrkingStr);
-                            return;
-                        }
-                    } else if (*value != ';') {
-                        /*
-                                          sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                          values_[index]);
-                                          lefiError(msg);
-                        */
-                        sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                values_[index]);
-                        lefError(1320, msg);
-                        free(wrkingStr);
-                        return;
-                    } else {
-                        value = strtok(NULL, " ");
-                        continue;
-                    }
-                }
-            } else if (strcmp(value, "ADJACENTCUTS") == 0) {
-                value = strtok(NULL, " ");
-                numCuts = atoi(value);
-                if ((numCuts < 2) || (numCuts > 4)) {
-                    /*
-                                   sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                   values_[index]);
-                                   lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                            values_[index]);
-                    lefError(1320, msg);
-                    free(wrkingStr);
-                    return;
-                }
-                value = strtok(NULL, " ");
-                if (strcmp(value, "WITHIN") == 0) {
-                    value = strtok(NULL, " ");
-                    within = atof(value);
-                    setSpacingAdjacent(numCuts, within);
-                    value = strtok(NULL, " ");
-                    if (strcmp(value, "EXCEPTSAMEPGNET") == 0) {
-                        setSpacingAdjacentExcept();
-                        value = strtok(NULL, " ");
-                        if (*value != ';') {
-                            /*
-                                                 sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                                 values_[index]);
-                                                 lefiError(msg);
-                            */
-                            sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                    values_[index]);
-                            lefError(1320, msg);
-                            free(wrkingStr);
-                            return;
-                        }
-                    } else if (*value != ';') {
-                        /*
-                                          sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                          values_[index]);
-                                          lefiError(msg);
-                        */
-                        sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                values_[index]);
-                        lefError(1320, msg);
-                        free(wrkingStr);
-                        return;
-                    } else {
-                        value = strtok(NULL, " ");
-                    }
-                } else {
-                    /*
-                                   sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                   values_[index]);
-                                   lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                            values_[index]);
-                    lefError(1320, msg);
-                    free(wrkingStr);
-                    return;
-                }
-            } else if (strcmp(value, "PARALLELOVERLAP") == 0) {
-                // SPACING minSpacing PARALLELOVERLAP ;
-                setSpacingParallelOverlap();
-                value = strtok(NULL, " ");
-                if (*value != ';') {
-                    /*
-                                   sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                   values_[index]);
-                                   lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                            values_[index]);
-                    lefError(1320, msg);
-                    free(wrkingStr);
-                    return;
-                } else {
-                    value = strtok(NULL, " ");
-                }
-            } else if (strcmp(value, "AREA") == 0) {
-                value = strtok(NULL, " ");
-                cutArea = atof(value);
-                setSpacingArea(cutArea);
-                value = strtok(NULL, " ");
-                if (*value != ';') {
-                    /*
-                                   sprintf(msg, "ERROR (LEFPARS-1320): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                                   values_[index]);
-                                   lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING cutSpacing [CENTERTOCENTER][SAMENET]\n\t[LAYER secondLayerName[STACK]\n\t| ADJACENTCUTS {2 | 3 | 4} WITHIN cutWithin [EXCEPTSAMEPGNET]\n\t| PARALLELOVERLAP\n\t| AREA cutArea ;\"",
-                            values_[index]);
-                    lefError(1320, msg);
-                    free(wrkingStr);
-                    return;
-                } else {
-                    value = strtok(NULL, " ");
-                }
-            }
-        } else if (strcmp(value, "SAMEMETAL") == 0) {
-            // SPACING cutSpacing SAMEMETAL just exit
-            free(wrkingStr);
-            return;
-
-        } else if (strcmp(value, "ENDOFLINE") == 0) {
-            // SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWithin
-            //    [PARALLELEGE parSpace WITHIN parWithin [TWOEDGES]]
-            // Parse the string lefData->first, if it has the syntax of
-            // SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWithin
-            // [PARALLELEDGE parSpace WITHIN parWithin [TWOEDGES]]
-            // than store the data, otherwise, skip to ;
-
-            if (strcmp(type(), "ROUTING") != 0) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1322): The property LEF57_SPACING with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                            values_[index], type());
-                            lefiError(msg);
-                */
-                sprintf(msg, "The property LEF57_SPACING with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                        values_[index], type());
-                lefError(1322, msg);
-                free(wrkingStr);
-                return;
-            }
-
-            twoEdges = 0;
-
-            value = strtok(NULL, " ");
-            width = atof(value);
-            value = strtok(NULL, " ");
-            if (strcmp(value, "WITHIN") == 0) {
-                value = strtok(NULL, " ");
-                within = atof(value);
-                // * setSpacingMin(spValue);
-                // * setSpacingEol(width, within);
-                // Check if option [PARALLELEDGE parSpace WITHIN parWithin] is set
-                value = strtok(NULL, " ");
-                if (value && *value != '\n') {
-                    if (strcmp(value, "PARALLELEDGE") == 0) {
-                        value = strtok(NULL, " ");
-                        pValue = atof(value);
-                        value = strtok(NULL, " ");
-                        if (strcmp(value, "WITHIN") == 0) {
-                            value = strtok(NULL, " ");
-                            pWithin = atof(value);
-                            // * setSpacingParSW(pValue, pWithin);
-                            // Check if TWOEDGES is set
-                            value = strtok(NULL, " ");
-                            if (value && *value != '\n') {
-                                if (strcmp(value, "TWOEDGES") == 0) {
-                                    // * setSpacingParTwoEdges();
-                                    twoEdges = 1;
-                                    value = strtok(NULL, " ");
-                                    if (*value == ';') {
-                                        // Save the value to lefiLayer class
-                                        setSpacingMin(spValue);
-                                        setSpacingEol(width, within);
-                                        setSpacingParSW(pValue, pWithin);
-                                        if (twoEdges)
-                                            setSpacingParTwoEdges();
-                                        value = strtok(NULL, " ");
-                                        continue;                // with the while loop 
-                                    } else {
-                                        // More rules, skip to ;
-                                        while ((value) && (*value != ';') &&
-                                               (*value != '\n'))
-                                            value = strtok(NULL, " ");
-                                        if ((value) && (*value == ';')) {
-                                            value = strtok(NULL, " ");
-                                            continue;
-                                        }
-                                    }
-                                } else if (*value == ';') {
-                                    setSpacingMin(spValue);
-                                    setSpacingEol(width, within);
-                                    setSpacingParSW(pValue, pWithin);
-                                    value = strtok(NULL, " ");      // done with this 
-                                    continue;       // statement with the while loop 
-                                } else {
-                                    // More rules, skip to ;
-                                    while ((value) && (*value != ';') &&
-                                           (*value != '\n'))
-                                        value = strtok(NULL, " ");
-                                    if ((value) && (*value == ';')) {
-                                        value = strtok(NULL, " ");
-                                        continue;
-                                    }
-                                }
-                            } else {
-                                /*
-                                                        sprintf(msg, "ERROR (LEFPARS-1305): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                                                        lefiError(msg);
-                                */
-                                sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                                lefError(1305, msg);
-                                free(wrkingStr);
-                                return;
-                            }
-                        } else {
-                            /*
-                                                 sprintf(msg, "ERROR (LEFPARS-1305): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                                                 lefiError(msg);
-                            */
-                            sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                            lefError(1305, msg);
-                            free(wrkingStr);
-                            return;
-                        }
-                    } else if (*value == ';') {
-                        // Save the data in lefiLayer lefData->first
-                        setSpacingMin(spValue);
-                        setSpacingEol(width, within);
-                        value = strtok(NULL, " ");      // done with this 
-                        continue;
-                    } else {
-                        while ((value) && (*value != ';') && (*value != '\n'))
-                            value = strtok(NULL, " ");
-                        if ((value) && (*value == ';')) {
-                            value = strtok(NULL, " ");
-                            continue;
-                        }
-                    }
-                }
-            } else {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1305): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                            lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                lefError(1305, msg);
-                free(wrkingStr);
-                return;
-            }
-        } else {
-            /*
-                     sprintf(msg, "ERROR (LEFPARS-1305): Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-                     lefiError(msg);
-            */
-            sprintf(msg, "Incorrect syntax defined for property LEF57_SPACING: %s.\nCorrect syntax is either \"SPACING minSpacing [CENTERTOCENTER]\"\n\"[LAYER secondLayerName | ADJACENTCUTS {2|3|4} WITHIN cutWithin | PARALLELOVERLAP | AREA cutArea]\" or\n\"SPACING eolSpace ENDOFLINE eolWidth WITHIN eolWITHIN [PARALLELEDGE parSpace WITHIN parWithin [TOWEDGES]]\"\n", values_[index]);
-            lefError(1305, msg);
-            free(wrkingStr);
-            return;
-        }
-    }
-
-    // None of the above statement
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-/* NOT an OA data model
-void lefiLayer::parseMaxFloating(int index) {
-   char   *wrkingStr = strdup(values_[index]);
-   char   *value;
-   double maxArea;
-   char   msg[1024];
-
-   value = strtok(wrkingStr, " ");
-   if (strcmp(value, "MAXFLOATINGAREA") != 0) {
-      sprintf(msg, "ERROR (LEFPARS-1306): Incorrect syntax defined for property LEF57_MAXFLOATINGAREA: %s.\nCorrect syntax is \"MAXFLOATINGAREA maxArea\"\n", values_[index]);
-      lefiError(0, 1306, msg);
-      free(wrkingStr);
-      return;
-   }
-
-   value = strtok(NULL, " ");
-   maxArea = atof(value);
-   setMaxFloatingArea(maxArea);
-
-   free(wrkingStr);
-   return;
-}
-*/
-
-// PRIVATE 5.7
-void
-lefiLayer::parseArraySpacing(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    double  viaWidth = 0, cutSpacing = 0, arraySpacing;
-    int     arrayCuts;
-    int     hasLongArray = 0, hasArrayCut = 0;
-    char    msg[1024];
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ARRAYSPACING") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1307): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-        lefError(1307, msg);
-        free(wrkingStr);
-        return;
-    }
-    value = strtok(NULL, " ");
-
-    while (strcmp(value, ";") != 0) {
-        if (strcmp(value, "LONGARRAY") == 0) {
-            if (cutSpacing != 0) { // make sure syntax has correct order 
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1308): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nLONGARRAY is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nLONGARRAY is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefError(1308, msg);
-                free(wrkingStr);
-                return;
-            }
-            hasLongArray = 1;
-            value = strtok(NULL, " ");
-        } else if (strcmp(value, "WIDTH") == 0) {
-            if (cutSpacing != 0) { // make sure syntax has correct order 
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1309): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nWIDTH is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nWIDTH is defined after CUTSPACING.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefError(1309, msg);
-                free(wrkingStr);
-                return;
-            }
-            value = strtok(NULL, " ");
-            viaWidth = atof(value);
-            value = strtok(NULL, " ");
-        } else if (strcmp(value, "CUTSPACING") == 0) {
-            if (cutSpacing != 0) { // make sure syntax has correct order 
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1310): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING has defined more than once.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING has defined more than once.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefError(1310, msg);
-                free(wrkingStr);
-                return;
-            }
-            value = strtok(NULL, " ");
-            cutSpacing = atof(value);
-            /*
-                     setArraySpacing(hasLongArray, viaWidth, cutSpacing);
-            */
-            if (hasLongArray)
-                setArraySpacingLongArray();
-            setArraySpacingWidth(viaWidth);
-            setArraySpacingCut(cutSpacing);
-            value = strtok(NULL, " ");
-        } else if (strcmp(value, "ARRAYCUTS") == 0) {
-            if (cutSpacing == 0) { // make sure cutSpacing is already set 
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1311): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING which is required is either has not been defined or defined in a wrong location.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCUTSPACING which is required is either has not been defined or defined in a wrong location.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefError(1311, msg);
-                free(wrkingStr);
-                return;
-            }
-            value = strtok(NULL, " ");
-            arrayCuts = atoi(value);
-            value = strtok(NULL, " ");
-            if (strcmp(value, "SPACING") != 0) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1312): Incorrect syntax defined for  property LEF57_ARRAYSPACING: %s.\nSPACING should be defined with ARRAYCUTS.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                            lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for  property LEF57_ARRAYSPACING: %s.\nSPACING should be defined with ARRAYCUTS.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-                lefError(1312, msg);
-                free(wrkingStr);
-                return;
-            }
-            value = strtok(NULL, " ");
-            arraySpacing = atof(value);
-            /*
-                     addArrayCuts(arrayCuts, arraySpacing);
-            */
-            addArraySpacingArray(arrayCuts, arraySpacing);
-            value = strtok(NULL, " ");
-            hasArrayCut = 1;
-        } else {  // Doesn't match any of the format
-            /*
-            sprintf(msg, "ERROR (LEFPARS-1313): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-            lefiError(msg);
-            */
-            sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-            lefError(1313, msg);
-            free(wrkingStr);
-            return;
-
-        }
-    }
-
-    if (hasArrayCut == 0) {  // ARRAYCUTS is required
-        /*
-        sprintf(msg, "ERROR (LEFPARS-1314): Incorrect syntax defined for property LEF57_ARRAYSPACING: %s\nARRAYCUTS is required but has not been defined.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ARRAYSPACING: %s\nARRAYCUTS is required but has not been defined.\nCorrect syntax is ARRAYSPACING [LONGARRAY] [WIDTH viaWidth] CUTSPACING cutSpacing\n\tARRAYCUTS arrayCuts SPACING arraySpacing ...\n", values_[index]);
-        lefError(1314, msg);
-    }
-
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-// MINSTEP minStepLength
-// [MAXEDGES maxEdges] ; 
-// Save the value lefData->first to make sure the syntax that is supported by the parser
-void
-lefiLayer::parseMinstep(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    double  minStepLength = 0, minAdjLength = 0, minBetLength = 0;
-    int     maxEdges = 0, xSameCorners = 0, done = 0;
-    char    msg[1024];
-
-    if (strcmp(type(), "ROUTING") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1323): The property LEF57_MINSTEP with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-              values_[index], type());
-              lefiError(msg);
-        */
-        sprintf(msg, "The property LEF57_MINSTEP with value %s is for TYPE ROUTING only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                values_[index], type());
-        lefError(1323, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "MINSTEP") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-        lefError(1315, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(NULL, " ");
-    minStepLength = atof(value);
-    //addMinstep(minStepLength);
-    value = strtok(NULL, " ");
-    while (done == 0) {
-        if (value && *value != '\n') {
-            if (strcmp(value, "MAXEDGES") == 0) {
-                // MAXEDGES maxEdges
-                if (maxEdges) { // MAXEDGES has already defined
-                    /*
-                    sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefError(1315, msg);
-                    free(wrkingStr);   // done parsing
-                    return;
-                }
-                value = strtok(NULL, " ");
-                maxEdges = atoi(value);
-                //addMinstepMaxedges(maxEdges);
-                value = strtok(NULL, " ");
-            } else if (strcmp(value, "MINADJACENTLENGTH") == 0) {
-                if (minBetLength) {
-                    // MINBETWEENLENGTH has defined, it is either MINADJACENTLENGTH
-                    // or MINBETWEENLENGTH but not both
-                    /*
-                    sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefiError(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefError(1315, msg);
-                    free(wrkingStr);   // done parsing
-                    return;
-                }
-                value = strtok(NULL, " ");
-                minAdjLength = atof(value);
-                //addMinstepMinAdjLength(minAdjLength);
-                value = strtok(NULL, " ");
-            } else if (strcmp(value, "MINBETWEENLENGTH") == 0) {
-                if (minAdjLength) {
-                    // minadjACENTLENGTH has defined, it is either MINBETWEENLENGTH
-                    // or minADJACENTLENGTH but not both
-                    /*
-                    sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefierror(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefError(1315, msg);
-                    free(wrkingStr);   // done parsing
-                    return;
-                }
-                value = strtok(NULL, " ");
-                minBetLength = atof(value);
-                //addMinstepMinBetLength(minBetLength);
-                value = strtok(NULL, " ");
-            } else if (strcmp(value, "EXCEPTSAMECORNERS") == 0) {
-                if (minBetLength) {
-                    xSameCorners = 1;
-                    //addMinstepXSameCorners();
-                    value = strtok(NULL, " ");
-                } else {
-                    /*
-                                   sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                                   lefierror(msg);
-                    */
-                    sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                    lefError(1315, msg);
-                    free(wrkingStr);   // done parsing
-                    return;
-                }
-            } else if (strcmp(value, ";") != 0) {
-                // an invalid value
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                lefierror(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_MINSTEP: %s.\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-                lefError(1315, msg);
-                free(wrkingStr);   // done parsing
-                return;
-            } else
-                done = 1;
-        } else {
-            // done parsing without ;
-            /*
-            sprintf(msg, "eRROR (LEFPARS-1315): Incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-            lefierror(msg);
-            */
-            sprintf(msg, "incorrect syntax defined for property LEF57_MINSTEP: %s\nCorrect syntax is \"MINSTEP minStepLength [MAXEDGES maxEdges] [MINADJACENTLENGTH minAdjLength | MINBETWEENLENGTH minBetweenLength [EXCEPTSAMECORNERS]] ;\"\n", values_[index]);
-            lefError(1315, msg);
-            free(wrkingStr);   // done parsing
-            return;
-        }
-    }
-
-    if (minStepLength)
-        addMinstep(minStepLength);
-    if (maxEdges)
-        addMinstepMaxedges(maxEdges);
-    if (minAdjLength)
-        addMinstepMinAdjLength(minAdjLength);
-    if (minBetLength)
-        addMinstepMinBetLength(minBetLength);
-    if (xSameCorners)
-        addMinstepXSameCorners();
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-void
-lefiLayer::parseAntennaCumRouting(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    char    msg[1024];
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ANTENNACUMROUTINGPLUSCUT") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1316): Incorrect syntax defined for property LEF57_ANTENNACUMROUTINGPLUSCUT: %s.\nCorrect syntax is \"ANTANNACUMROUTINGPLUSCUT\"\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ANTENNACUMROUTINGPLUSCUT: %s.\nCorrect syntax is \"ANTANNACUMROUTINGPLUSCUT\"\n", values_[index]);
-        lefError(1316, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    setAntennaCumRoutingPlusCut();
-
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-void
-lefiLayer::parseAntennaGatePlus(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    double  pDiffFactor;
-    char    msg[1024];
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ANTENNAGATEPLUSDIFF") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1317): Incorrect syntax defined for property LEF57_ANTENNAGATEPLUSDIFF: %s.\nCorrect syntax is \"ANTENNAGATEPLUSDIFF plusDiffFactor\"\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ANTENNAGATEPLUSDIFF: %s.\nCorrect syntax is \"ANTENNAGATEPLUSDIFF plusDiffFactor\"\n", values_[index]);
-        lefError(1317, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(NULL, " ");
-    pDiffFactor = atof(value);
-    setAntennaGatePlusDiff(pDiffFactor);
-
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-void
-lefiLayer::parseAntennaAreaMinus(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    double  mDiffFactor;
-    char    msg[1024];
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ANTENNAAREAMINUSDIFF") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1318): Incorrect syntax defined for property LEF57_ANTENNAAREAMINUSDIFF: %s.\nCorrect syntax is \"ANTENNAAREAMINUSDIFF minusDiffFactor\"\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ANTENNAAREAMINUSDIFF: %s.\nCorrect syntax is \"ANTENNAAREAMINUSDIFF minusDiffFactor\"\n", values_[index]);
-        lefError(1318, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(NULL, " ");
-    mDiffFactor = atof(value);
-    setAntennaAreaMinusDiff(mDiffFactor);
-
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-void
-lefiLayer::parseAntennaAreaDiff(int index)
-{
-    char            *wrkingStr = strdup(values_[index]);
-    char            *value;
-    double          diffA, diffF;
-    lefiAntennaPWL  *pwlPtr;
-    int             done = 0;
-    char            msg[1024];
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ANTENNAAREADIFFREDUCEPWL") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1319): Incorrect syntax defined for property LEF57_ANTENNAAREADIFFREDUCEPWL: %s.\nCorrect syntax is \"ANTENNAAREADIFFREDUCEPWL (( diffArea1 metalDiffFactor1 ) ( diffArea2 metalDiffFactor2 )...)\"\n", values_[index]);
-              lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ANTENNAAREADIFFREDUCEPWL: %s.\nCorrect syntax is \"ANTENNAAREADIFFREDUCEPWL (( diffArea1 metalDiffFactor1 ) ( diffArea2 metalDiffFactor2 )...)\"\n", values_[index]);
-        lefError(1319, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(NULL, " ");
-    if (strcmp(value, "(") == 0) { // beginning of ( ( d1 r1 ) ( d2 r2 ) ... )
-        pwlPtr = lefiAntennaPWL::create();
-        while (done == 0) {
-            value = strtok(NULL, " ");
-            if (strcmp(value, "(") == 0) {
-                value = strtok(NULL, " ");
-                diffA = atof(value);
-                value = strtok(NULL, " ");
-                diffF = atof(value);
-                pwlPtr->addAntennaPWL(diffA, diffF);
-                value = strtok(NULL, " ");
-                if (strcmp(value, ")") != 0) {
-                    break;
-                }
-            } else if (strcmp(value, ")") == 0)
-                done = 1;
-        }
-        if (done) {
-            setAntennaPWL(lefiAntennaADR, pwlPtr);
-        } else {
-            pwlPtr->Destroy();
-            lefFree(pwlPtr);
-        }
-    }
-
-    free(wrkingStr);
-    return;
-}
-
-// PRIVATE 5.7
-// [ENCLOSURE [ABOVE | BELOW] overhang1 overhang2
-//     [WIDTH minWidth [EXCEPTEXTRACUT cutWithin]
-//     |LENGTH minLength] ;
-void
-lefiLayer::parseLayerEnclosure(int index)
-{
-    char    *wrkingStr = strdup(values_[index]);
-    char    *value;
-    char    msg[1024];
-    int     overh = 0, width = 0, except = 0, length = 0;
-    char    *enclRule = 0;
-    double  overhang1 = 0, overhang2 = 0, minWidth = 0, cutWithin = 0, minLength = 0;
-
-    if (strcmp(type(), "CUT") != 0) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1331): The property LEF57_ENCLOSURE with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-              values_[index], type());
-              lefiError(msg);
-        */
-        sprintf(msg, "The property LEF57_ENCLOSURE with value %s is for TYPE CUT only.\nThe current layer has the TYPE %s.\nUpdate the property of your lef file with the correct syntax or remove this property from your lef file.\n",
-                values_[index], type());
-        lefError(1331, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(wrkingStr, " ");
-    if (strcmp(value, "ENCLOSURE") != 0) {   // Unknown value
-        /*
-        sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-        lefiError(msg);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-        lefError(1330, msg);
-        free(wrkingStr);
-        return;
-    }
-
-    value = strtok(NULL, " ");
-
-    while (strcmp(value, ";") != 0) {
-        if (strcmp(value, "CUTCLASS") == 0) {
-            // This is 58 syntax but is not in OA data model.  Skip the parsing
-            free(wrkingStr);
-            return;
-        } else if ((strcmp(value, "ABOVE") == 0) || (strcmp(value, "BELOW") == 0)) {
-            // Parse the rest of the property value lefData->first and if it has the syntax
-            // ENCLOSURE [ABOVE | BELOW] overhang1 overhang2
-            //   [WIDTH minWidth [EXCEPTEXTRACUT cutWithin]
-            //   |LENGTH minLength]
-            if (overh) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                            lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                lefError(1330, msg);
-                free(wrkingStr);
-                if (enclRule)
-                    free(enclRule);
-                return;
-            }
-            enclRule = strdup(value);
-            value = strtok(NULL, " ");
-        } else if (strcmp(value, "WIDTH") == 0) {
-            if ((!overh)) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                            lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                lefError(1330, msg);
-                free(wrkingStr);
-                if (enclRule)
-                    free(enclRule);
-                return;
-            }
-            minWidth = strtod(strtok(NULL, " "), 0);
-            value = strtok(NULL, " ");
-            width = 1;
-            if (strcmp(value, "EXCEPTEXTRACUT") == 0) {  // continue with WIDTH
-                except = 1;
-                value = strtok(NULL, " ");
-                cutWithin = strtod(value, 0);
-                value = strtok(NULL, " ");
-                if (strcmp(value, "NOSHAREDEDGE") == 0) {
-                    // 5.8 syntax but not in OA data model
-                    free(wrkingStr);
-                    if (enclRule)
-                        free(enclRule);
-                    return;
-                }
-            }
-        } else if (strcmp(value, "LENGTH") == 0) {
-            if (width || (!overh)) {
-                /*
-                            sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                            lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                lefError(1330, msg);
-                free(wrkingStr);
-                if (enclRule)
-                    free(enclRule);
-                return;
-            }
-            minLength = strtod(strtok(NULL, " "), 0);
-            value = strtok(NULL, " ");
-            length = 1;
-        } else {
-            if (overh == 1) { // Already has overhang value
-                /*
-                sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                lefiError(msg);
-                */
-                sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-                lefError(1330, msg);
-                free(wrkingStr);
-                if (enclRule)
-                    free(enclRule);
-                return;
-            }
-            overhang1 = strtod(value, 0);
-            overhang2 = strtod(strtok(NULL, " "), 0);
-            overh = 1;      // set the flag on
-            value = strtok(NULL, " ");
-        }
-    }
-    if (!overh) {
-        /*
-              sprintf(msg, "ERROR (LEFPARS-1330): Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-        */
-        sprintf(msg, "Incorrect syntax defined for property LEF57_ENCLOSURE: %s\nCorrect syntax is \"ENCLOSURE [ABOVE|BELOW] overhang1 overhang2\n\t[WIDTH minWidth [EXCEPTEXTRACUT cutWithin]\n\t|LENGTH minLength] ;\"\n", values_[index]);
-        lefError(1330, msg);
-    } else {
-        addEnclosure(enclRule, overhang1, overhang2);
-
-        if (width) {
-            addEnclosureWidth(minWidth);
-            if (except)
-                addEnclosureExceptEC(cutWithin);
-        }
-        if (length)
-            addEnclosureLength(minLength);
-    }
-    if (enclRule)
-        free(enclRule);
-
-    free(wrkingStr);
-    return;
-}
-
-// 5.7
-// This API will is created just for OA to call in 5.6 only.
-// This API will be obsoleted in 5.7.
-// It will look for all the properties in "this" that are type 'S' and
-// property name starts with "LEF57_...
-void
-lefiLayer::parse65nmRules()
-{
-    int i;
-
-    if (lefData->versionNum < 5.6)
-        return;
-
-    for (i = 0; i < numProps_; i++) {
-        if ((strlen(names_[i]) > 6) && (types_[i] == 'S')) {
-            if (strncmp(names_[i], "LEF57_", 6) == 0) {
-                if (strcmp(names_[i], "LEF57_SPACING") == 0) {
-                    parseSpacing(i);
-                } else /* Not an OA data model
-           if (strcmp(names_[i], "LEF57_MAXFLOATINGAREA") == 0) {
-              parseMaxFloating(i);
-           } else
-*/
-                if (strcmp(names_[i], "LEF57_ARRAYSPACING") == 0) {
-                    parseArraySpacing(i);
-                } else if (strcmp(names_[i], "LEF57_MINSTEP") == 0) {
-                    parseMinstep(i);
-                } else if (strcmp(names_[i], "LEF57_ANTENNACUMROUTINGPLUSCUT") == 0) {
-                    parseAntennaCumRouting(i);
-                } else if (strcmp(names_[i], "LEF57_ANTENNAGATEPLUSDIFF") == 0) {
-                    parseAntennaGatePlus(i);
-                } else if (strcmp(names_[i], "LEF57_ANTENNAAREAMINUSDIFF") == 0) {
-                    parseAntennaAreaMinus(i);
-                } else if (strcmp(names_[i], "LEF57_ANTENNAAREADIFFREDUCEPWL") == 0) {
-                    parseAntennaAreaDiff(i);
-                } else if (strcmp(names_[i], "LEF57_ENCLOSURE") == 0) {
-                    parseLayerEnclosure(i);
-                }
-            }
-        }
-    }
-}
-
-// PRIVATE 5.8
-// This function will parse LEF58_TYPE property value. It also checks
-// if lef58 type is compatible with LAYER TYPE value.
-void
-lefiLayer::parseLayerType(int index)
-{
-    std::string propValue(values_[index]);
-    int         tokenStart = 0;
-    std::string firstToken = lefrSettings::getToken(propValue, tokenStart);
-
-    // Wrong LEF58_TYPE syntax.
-    if (firstToken != "TYPE") { 
-        std::string msg = "Incorrect LEF58_TYPE property value syntax: '" + 
-                           propValue + 
-                           "'. Correct syntax: 'TYPE <type> ;'.\n";
-
-        lefError(1329, msg.c_str());
-        return;
-    }
-
-    std::string type(type_);
-    std::string lef58Type(lefrSettings::getToken(propValue, tokenStart));
-    std::string typesPair(lef58Type + " " + type);
-
-    if (lefSettings->Lef58TypePairs.find(typesPair) != lefSettings->Lef58TypePairs.end()) {
-        // In parser LayerType == lef58 type. 
-        setLayerType(lef58Type.c_str());
-        return;
-    }
-
-    std::string layerLef58Types = lefSettings->getLayerLef58Types(this->type_);
-
-    // Wrong/incompatible lef58 type.
-    if (layerLef58Types.empty()) {
-        std::string msg = "Layers with TYPE " + 
-                           type  + " cannot have LEF58_TYPE property.\n";
-
-        lefError(1328, msg.c_str());        
-    } else {
-        std::string msg = "Property LEF58_TYPE has incorrect TYPE value: '" +
-                          lef58Type + "'. For TYPE " +
-                          type + " layers valid values are: " +
-                          layerLef58Types + ".\n";
-
-        lefError(1327, msg.c_str());  
-    } 
-}
-
-// 5.8
-// This API will is created just for OA to call in 5.7 only.
-// This API will be obsoleted once 5.8 APIs are available and OA moves
-// to using them.
-// It will look for the properties in "this" that are type 'S' and
-// property name is "LEF58_TYPE"
-void
-lefiLayer::parseLEF58Layer()
-{
-    int i;
-
-    if (lefData->versionNum < 5.7)
-        return;
-
-    for (i = 0; i < numProps_; i++) {
-        if (strlen(names_[i]) == 10) {
-            if (strcmp(names_[i], "LEF58_TYPE") == 0)
-                parseLayerType(i);
-        }
-    }
-}
-
-int
-lefiLayer::need58PropsProcessing() const
-{
-    return lefData->versionNum >= 5.7;
-}
-
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.hpp
deleted file mode 100644
index deb234e..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiLayer.hpp
+++ /dev/null
@@ -1,1064 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiLayer_h
-#define lefiLayer_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-#include "lefiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-typedef enum lefiAntennaEnum {
-  lefiAntennaAR,
-  lefiAntennaDAR,
-  lefiAntennaCAR,
-  lefiAntennaCDAR,
-  lefiAntennaAF,
-  lefiAntennaSAR,
-  lefiAntennaDSAR,
-  lefiAntennaCSAR,
-  lefiAntennaCDSAR,
-  lefiAntennaSAF,
-  lefiAntennaO,
-  lefiAntennaADR
-} lefiAntennaEnum;
-
-class lefiAntennaPWL {
-public:
-  lefiAntennaPWL();
-  ~lefiAntennaPWL();
-
-  static lefiAntennaPWL* create();
-  void Init();
-  void clear();
-  void Destroy();
-
-  void addAntennaPWL(double d, double r);
-
-  int  numPWL() const;
-  double PWLdiffusion(int index); 
-  double PWLratio(int index); 
-
-protected:
-  int numAlloc_;
-  int numPWL_;
-  double* d_;
-  double* r_;
-};
-
-class lefiLayerDensity {
-public:
-  lefiLayerDensity();
-  ~lefiLayerDensity();
-
-  void Init(const char* type);
-  void Destroy();
-  void clear();
-
-  void setOneEntry(double entry);
-  void addFrequency(int num, double* frequency);
-  void addWidth(int num, double* width);
-  void addTableEntry(int num, double* entry);
-  void addCutarea(int num, double* cutarea);
-
-  char* type() const;
-  int hasOneEntry() const;
-  double oneEntry() const;
-  int numFrequency() const;
-  double frequency(int index) const;
-  int numWidths() const;
-  double width(int index) const;
-  int numTableEntries() const;
-  double tableEntry(int index) const;
-  int numCutareas() const;
-  double cutArea(int index) const;
-
-protected:
-  char* type_;
-  double oneEntry_;
-  int numFrequency_;
-  double* frequency_;
-  int numWidths_;
-  double* widths_;
-  int numTableEntries_;
-  double* tableEntries_;
-  int numCutareas_;
-  double* cutareas_;
-};
-
-// 5.5
-class lefiParallel {
-public:
-  lefiParallel();
-  ~lefiParallel();
-
-  void Init();
-  void clear();
-  void Destroy();
-
-  void addParallelLength(int numLength, double* lengths);
-  void addParallelWidth(double width);
-  void addParallelWidthSpacing(int numSpacing, double* spacings);
-
-  int  numLength() const;
-  int  numWidth() const;
-  double length(int iLength) const;
-  double width(int iWidth) const;
-  double widthSpacing(int iWidth, int iWidthSpacing) const;
-
-protected:
-  int numLength_;
-  int numWidth_;
-  int numWidthAllocated_;
-  double* length_;
-  double* width_;
-  double* widthSpacing_;
-};
-
-// 5.5
-class lefiInfluence {
-public:
-  lefiInfluence();
-  ~lefiInfluence();
-
-  void Init();
-  void clear();
-  void Destroy();
-
-  void addInfluence(double width, double distance, double spacing);
-
-  int  numInfluenceEntry() const;
-  double width(int index) const;
-  double distance(int index) const;
-  double spacing(int index) const;
-
-protected:
-  int numAllocated_;
-  int numWidth_;
-  int numDistance_;
-  int numSpacing_;
-  double* width_;
-  double* distance_;
-  double* spacing_;
-};
-
-// 5.7
-class lefiTwoWidths {
-public:
-  lefiTwoWidths();
-  ~lefiTwoWidths();
-
-  void Init();
-  void clear();
-  void Destroy();
-
-  void addTwoWidths(double width, double runLength, int numSpacing,
-                    double* spacings, int hasPRL = 0);
-
-  int    numWidth() const;
-  double width(int iWidth) const;
-  int    hasWidthPRL(int iWidth) const;
-  double widthPRL(int iWidth) const;
-  int    numWidthSpacing(int iWidth) const;
-  double widthSpacing(int iWidth, int iWidthSpacing) const;
-
-protected:
-  int numWidth_;
-  int numWidthAllocated_;
-  double* width_;
-  double* prl_;
-  int*    hasPRL_;
-  int*    numWidthSpacing_;   // each slot contains number of spacing of slot
-  double* widthSpacing_;
-  int*    atNsp_;             // accumulate total number of spacing
-};
-
-// 5.5
-class lefiSpacingTable {
-public:
-  lefiSpacingTable();
-  ~lefiSpacingTable();
-
-  void Init();
-  void clear();
-  void Destroy();
-
-  void addParallelLength(int numLength, double* lengths);
-  void addParallelWidth(double width);
-  void addParallelWidthSpacing(int numSpacing, double* spacing);
-  void setInfluence();
-  void addInfluence(double width, double distance, double spacing);
-  void addTwoWidths(double width, double runLength, int numSpacing,
-                    double* spacing, int hasPRL = 0);          // 5.7
-  
-  int isInfluence() const;
-  lefiInfluence* influence() const;
-  int isParallel() const;
-  lefiParallel*  parallel() const;
-  lefiTwoWidths* twoWidths() const;           // 5.7
-
-protected:
-  int hasInfluence_;
-  lefiInfluence*   influence_;
-  lefiParallel*    parallel_;
-  lefiTwoWidths*   twoWidths_;               // 5.7
-};
-
-// 5.7
-class lefiOrthogonal {
-public:
-  lefiOrthogonal();
-  ~lefiOrthogonal();
-
-  void Init();
-  void Destroy();
-
-  void addOrthogonal(double cutWithin, double ortho);
-
-  int  numOrthogonal() const;
-  double cutWithin(int index) const;
-  double orthoSpacing(int index) const;
-
-protected:
-  int numAllocated_;
-  int numCutOrtho_;
-  double* cutWithin_;
-  double* ortho_;
-};
-
-// 5.5
-class lefiAntennaModel {
-public:
-  lefiAntennaModel();
-  ~lefiAntennaModel();
-
-  void Init();
-  void Destroy();
-
-  void setAntennaModel(int oxide);
-  void setAntennaAreaRatio(double value);
-  void setAntennaCumAreaRatio(double value);
-  void setAntennaAreaFactor(double value);
-  void setAntennaSideAreaRatio(double value);
-  void setAntennaCumSideAreaRatio(double value);
-  void setAntennaSideAreaFactor(double value);
-  void setAntennaValue(lefiAntennaEnum antennaType, double value);
-  void setAntennaDUO(lefiAntennaEnum antennaType);
-  void setAntennaPWL(lefiAntennaEnum antennaType, lefiAntennaPWL* pwl);
-  void setAntennaCumRoutingPlusCut();             // 5.7
-  void setAntennaGatePlusDiff(double value);      // 5.7
-  void setAntennaAreaMinusDiff(double value);     // 5.7
-
-  int hasAntennaAreaRatio() const;
-  int hasAntennaDiffAreaRatio() const;
-  int hasAntennaDiffAreaRatioPWL() const;
-  int hasAntennaCumAreaRatio() const;
-  int hasAntennaCumDiffAreaRatio() const;
-  int hasAntennaCumDiffAreaRatioPWL() const;
-  int hasAntennaAreaFactor() const;
-  int hasAntennaAreaFactorDUO() const;
-  int hasAntennaSideAreaRatio() const;
-  int hasAntennaDiffSideAreaRatio() const;
-  int hasAntennaDiffSideAreaRatioPWL() const;
-  int hasAntennaCumSideAreaRatio() const;
-  int hasAntennaCumDiffSideAreaRatio() const;
-  int hasAntennaCumDiffSideAreaRatioPWL() const;
-  int hasAntennaSideAreaFactor() const;
-  int hasAntennaSideAreaFactorDUO() const;
-  int hasAntennaCumRoutingPlusCut() const;        // 5.7
-  int hasAntennaGatePlusDiff() const;             // 5.7
-  int hasAntennaAreaMinusDiff() const;            // 5.7
-  int hasAntennaAreaDiffReducePWL() const;        // 5.7
-
-  char*  antennaOxide() const;
-  double antennaAreaRatio() const;
-  double antennaDiffAreaRatio() const;
-  lefiAntennaPWL* antennaDiffAreaRatioPWL() const;
-  double antennaCumAreaRatio() const;
-  double antennaCumDiffAreaRatio() const;
-  lefiAntennaPWL* antennaCumDiffAreaRatioPWL() const;
-  double antennaAreaFactor() const;
-  double antennaSideAreaRatio() const;
-  double antennaDiffSideAreaRatio() const;
-  lefiAntennaPWL* antennaDiffSideAreaRatioPWL() const;
-  double antennaCumSideAreaRatio() const;
-  double antennaCumDiffSideAreaRatio() const;
-  lefiAntennaPWL* antennaCumDiffSideAreaRatioPWL() const;
-  double antennaSideAreaFactor() const;
-  double antennaGatePlusDiff() const;                  // 5.7
-  double antennaAreaMinusDiff() const;                 // 5.7
-  lefiAntennaPWL* antennaAreaDiffReducePWL() const;    // 5.7
-
-protected:
-  int hasAntennaAreaRatio_;
-  int hasAntennaDiffAreaRatio_;
-  int hasAntennaDiffAreaRatioPWL_;
-  int hasAntennaCumAreaRatio_;
-  int hasAntennaCumDiffAreaRatio_;
-  int hasAntennaCumDiffAreaRatioPWL_;
-  int hasAntennaAreaFactor_;
-  int hasAntennaAreaFactorDUO_;
-  int hasAntennaSideAreaRatio_;
-  int hasAntennaDiffSideAreaRatio_;
-  int hasAntennaDiffSideAreaRatioPWL_;
-  int hasAntennaCumSideAreaRatio_;
-  int hasAntennaCumDiffSideAreaRatio_;
-  int hasAntennaCumDiffSideAreaRatioPWL_;
-  int hasAntennaSideAreaFactor_;
-  int hasAntennaSideAreaFactorDUO_;
-  int hasAntennaCumRoutingPlusCut_;        // 5.7
-  int hasAntennaGatePlusDiff_;             // 5.7
-  int hasAntennaAreaMinusDiff_;            // 5.7
-
-  char*  oxide_;
-  double antennaAreaRatio_;
-  double antennaDiffAreaRatio_;
-  lefiAntennaPWL* antennaDiffAreaRatioPWL_;
-  double antennaCumAreaRatio_;
-  double antennaCumDiffAreaRatio_;
-  lefiAntennaPWL* antennaCumDiffAreaRatioPWL_;
-  double antennaAreaFactor_;
-  double antennaSideAreaRatio_;
-  double antennaDiffSideAreaRatio_;
-  lefiAntennaPWL* antennaDiffSideAreaRatioPWL_;
-  double antennaCumSideAreaRatio_;
-  double antennaCumDiffSideAreaRatio_;
-  lefiAntennaPWL* antennaCumDiffSideAreaRatioPWL_;
-  double antennaSideAreaFactor_;
-  double antennaGatePlusDiff_;                  // 5.7
-  double antennaAreaMinusDiff_;                 // 5.7
-  lefiAntennaPWL* antennaAreaDiffReducePWL_;    // 5.7
-};
-
-class lefiLayer {
-public:
-  lefiLayer();
-  void Init();
-
-  void Destroy();
-  ~lefiLayer();
-
-  void clear();
-  void setName(const char* name); // calls clear to init
-  void setType(const char* typ);
-  void setPitch(double num);
-  void setMask(int num);                           // 5.8
-  void setPitchXY(double xdist, double ydist);     // 5.6
-  void setOffset(double num);
-  void setOffsetXY(double xdist, double ydist);    // 5.6
-  void setWidth(double num);
-  void setArea(double num);
-  void setDiagPitch(double dist);                  // 5.6
-  void setDiagPitchXY(double xdist, double ydist); // 5.6
-  void setDiagWidth(double width);                 // 5.6
-  void setDiagSpacing(double spacing);             // 5.6
-  void setSpacingMin(double dist);
-  void setSpacingName(const char* spacingName);    // for CUT layer
-  void setSpacingLayerStack();                     // 5.7 for CUT layer
-  void setSpacingAdjacent(int numCuts, double distance);  // 5.5for CUT layer
-  void setSpacingRange(double left, double right);
-  void setSpacingRangeUseLength();
-  void setSpacingRangeInfluence(double infLength);
-  void setSpacingRangeInfluenceRange(double min, double max);
-  void setSpacingRangeRange(double min, double max);
-  void setSpacingLength(double num);
-  void setSpacingLengthRange(double min, double max);
-  void setSpacingCenterToCenter();
-  void setSpacingParallelOverlap();                            // 5.7
-  void setSpacingArea(double cutArea);                         // 5.7
-  void setSpacingEol(double width, double within);             // 5.7
-  void setSpacingParSW(double space, double within);           // 5.7
-  void setSpacingParTwoEdges();                                // 5.7
-  void setSpacingAdjacentExcept();                             // 5.7
-  void setSpacingSamenet();                                    // 5.7
-  void setSpacingSamenetPGonly();                              // 5.7
-  void setSpacingTableOrtho();                                 // 5.7
-  void addSpacingTableOrthoWithin(double cutWithin, double ortho);  // 5.7
-  void setMaxFloatingArea(double num);                         // 5.7
-  void setArraySpacingLongArray();                             // 5.7
-  void setArraySpacingWidth(double viaWidth);                  // 5.7
-  void setArraySpacingCut(double cutSpacing);                  // 5.7
-  void addArraySpacingArray(int aCuts, double aSpacing);       // 5.7
-  void setSpacingNotchLength(double minNotchLength);           // 5.7
-  void setSpacingEndOfNotchWidth (double endOfNotchWidth,
-           double minNotchSpacing, double minNotchLength);     // 5.7
-  void setDirection(const char* dir);
-  void setResistance(double num);
-  void setCapacitance(double num);
-  void setHeight(double num);
-  void setWireExtension(double num);
-  void setThickness(double num);
-  void setShrinkage(double num);
-  void setCapMultiplier(double num);
-  void setEdgeCap(double num);
-  void setAntennaArea(double num);
-  void setAntennaLength(double num);
-  void setCurrentDensity(double num);
-  void setCurrentPoint(double width, double current);
-  void setResistancePoint(double width, double res);
-  void setCapacitancePoint(double width, double cap);
-  void addProp(const char* name, const char* value, const char type);
-  void addNumProp(const char* name, const double d,
-                  const char* value, const char type);
-  void addAccurrentDensity(const char* type);
-  void setAcOneEntry(double num);
-  void addAcFrequency();
-  void addAcCutarea();
-  void addAcTableEntry();
-  void addAcWidth();
-  void addDccurrentDensity(const char* type);
-  void setDcOneEntry(double num);
-  void addDcTableEntry();
-  void addDcWidth();
-  void addDcCutarea();
-  void addNumber(double num);
-  void setMaxwidth(double width);                                   // 5.5
-  void setMinwidth(double width);                                   // 5.5
-  void addMinenclosedarea(double area);                             // 5.5
-  void addMinenclosedareaWidth(double width);                       // 5.5
-  void addMinimumcut(int cuts, double width);                       // 5.5
-  void addMinimumcutWithin(double cutDistance);                     // 5.7
-  void addMinimumcutConnect(const char* direction);                 // 5.5
-  void addMinimumcutLengDis(double length, double distance);        // 5.5
-  void addParellelLength(double length);                            // 5.5
-  void addParellelSpacing(double width, double spacing);            // 5.5
-  void addParellelWidth(double width);                              // 5.5
-  void setProtrusion(double width, double length, double width2);   // 5.5
-
-  // 5.6 - minstep switch to multiple and added more options
-  void addMinstep(double distance);                                 // 5.5
-  void addMinstepType(char* type);                                  // 5.6
-  void addMinstepLengthsum(double maxLength);                       // 5.6
-  void addMinstepMaxedges(int maxEdges);                            // 5.7
-  void addMinstepMinAdjLength(double minAdjLength);                 // 5.7
-  void addMinstepMinBetLength(double minBetLength);                 // 5.7
-  void addMinstepXSameCorners();                                    // 5.7
-
-  int  getNumber();     // this is for the parser internal use only
-
-  // 5.5 SPACINGTABLE
-  void addSpacingTable();
-  void addSpParallelLength();
-  void addSpParallelWidth(double width);
-  void addSpParallelWidthSpacing();
-  void setInfluence();
-  void setSpTwoWidthsHasPRL(int hasPRL);
-  void addSpInfluence(double width, double distance, double spacing);
-  void addSpTwoWidths(double width, double runLength);              // 5.7
-  
-
-  // 5.6
-  void addEnclosure(char* enclRule, double overhang1, double overhang2);
-  void addEnclosureWidth(double minWidth); 
-  void addEnclosureExceptEC(double cutWithin);       // 5.7
-  void addEnclosureLength(double minLength);         // 5.7
-  void addEnclosureExtraCut();                       // 5.7+
-  void addPreferEnclosure(char* enclRule, double overhang1, double overhang2);
-  void addPreferEnclosureWidth(double minWidth); 
-  void setResPerCut(double value);
-  void setDiagMinEdgeLength(double value);
-  void setMinSize(lefiGeometries* geom);
-
-  // 5.8
-  // POLYROUTING, MIMCAP, TSV, PASSIVATION, NWELL
-  void setLayerType(const char* lType) ; 
-
-  int hasType() const ;
-  int hasLayerType() const ;         // 5.8 - Some layers can be another types
-                                     //  ROUTING can be POLYROUTING or MIMCAP
-                                     //  CUT can be TSV or PASSIVATION
-                                     //  MASTERSLICE can be NWELL
-  int hasMask() const ;              // 5.8
-  int hasPitch() const ;
-  int hasXYPitch() const ;           // 5.6
-  int hasOffset() const ;
-  int hasXYOffset() const ;          // 5.6
-  int hasWidth() const ;
-  int hasArea() const ;
-  int hasDiagPitch() const;          // 5.6
-  int hasXYDiagPitch() const;        // 5.6
-  int hasDiagWidth() const;          // 5.6
-  int hasDiagSpacing() const;        // 5.6 
-  int hasSpacingNumber() const ;
-  int hasSpacingName(int index) const ;
-  int hasSpacingLayerStack(int index) const ;            // 5.7
-  int hasSpacingAdjacent(int index) const ;
-  int hasSpacingCenterToCenter(int index) const ;
-  int hasSpacingRange(int index) const ;
-  int hasSpacingRangeUseLengthThreshold(int index) const;
-  int hasSpacingRangeInfluence(int index) const;
-  int hasSpacingRangeInfluenceRange(int index) const;
-  int hasSpacingRangeRange(int index) const;
-  int hasSpacingLengthThreshold(int index) const;
-  int hasSpacingLengthThresholdRange(int index) const;
-  int hasSpacingParallelOverlap(int index) const;        // 5.7
-  int hasSpacingArea(int index) const;                   // 5.7
-  int hasSpacingEndOfLine(int index) const;              // 5.7
-  int hasSpacingParellelEdge(int index) const;           // 5.7
-  int hasSpacingTwoEdges(int index) const;               // 5.7
-  int hasSpacingAdjacentExcept(int index) const;         // 5.7
-  int hasSpacingSamenet(int index) const;                // 5.7
-  int hasSpacingSamenetPGonly(int index) const;          // 5.7
-  int hasSpacingNotchLength(int index) const;            // 5.7
-  int hasSpacingEndOfNotchWidth(int index) const;        // 5.7
-  int hasDirection() const ;
-  int hasResistance() const ;
-  int hasResistanceArray() const ;
-  int hasCapacitance() const ;
-  int hasCapacitanceArray() const ;
-  int hasHeight() const ;
-  int hasThickness() const ;
-  int hasWireExtension() const ;
-  int hasShrinkage() const ;
-  int hasCapMultiplier() const ;
-  int hasEdgeCap() const ;
-  int hasAntennaLength() const ;
-  int hasAntennaArea() const ;
-  int hasCurrentDensityPoint() const ;
-  int hasCurrentDensityArray() const ;
-  int hasAccurrentDensity() const;
-  int hasDccurrentDensity() const;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-  int numSpacing() const;
-
-  char* name() const ;
-  const char* type() const ;
-  const char* layerType() const ;           // 5.8
-  double pitch() const ;
-  int    mask() const;                      // 5.8
-  double pitchX() const ;                   // 5.6
-  double pitchY() const ;                   // 5.6
-  double offset() const ;
-  double offsetX() const ;                  // 5.6
-  double offsetY() const ;                  // 5.6
-  double width() const ;
-  double area() const ;
-  double diagPitch() const ;                // 5.6
-  double diagPitchX() const ;               // 5.6
-  double diagPitchY() const ;               // 5.6
-  double diagWidth() const ;                // 5.6 
-  double diagSpacing() const ;              // 5.6 
-  double spacing(int index) const ;
-  char*  spacingName(int index) const ;     // for CUT layer
-  int    spacingAdjacentCuts(int index) const ;   // 5.5 - for CUT layer
-  double spacingAdjacentWithin(int index) const ; // 5.5 - for CUT layer
-  double spacingArea(int index) const;            // 5.7 - for CUT layer
-  double spacingRangeMin(int index) const ;
-  double spacingRangeMax(int index) const ;
-  double spacingRangeInfluence(int index) const ;
-  double spacingRangeInfluenceMin(int index) const ;
-  double spacingRangeInfluenceMax(int index) const ;
-  double spacingRangeRangeMin(int index) const ;
-  double spacingRangeRangeMax(int index) const ;
-  double spacingLengthThreshold(int index) const;
-  double spacingLengthThresholdRangeMin(int index) const;
-  double spacingLengthThresholdRangeMax(int index) const;
-
-  // 5.7 Spacing endofline
-  double spacingEolWidth(int index) const;
-  double spacingEolWithin(int index) const;
-  double spacingParSpace(int index) const;
-  double spacingParWithin(int index) const;
-
-  // 5.7 Spacing Notch
-  double spacingNotchLength(int index) const;
-  double spacingEndOfNotchWidth(int index) const;
-  double spacingEndOfNotchSpacing(int index) const;
-  double spacingEndOfNotchLength(int index) const;
-
-  // 5.5 Minimum cut rules
-  int    numMinimumcut() const;
-  int    minimumcut(int index) const;
-  double minimumcutWidth(int index) const;
-  int    hasMinimumcutWithin(int index) const;          // 5.7
-  double minimumcutWithin(int index) const;             // 5.7
-  int    hasMinimumcutConnection(int index) const;      // FROMABOVE|FROMBELOW
-  const  char* minimumcutConnection(int index) const;   // FROMABOVE|FROMBELOW
-  int    hasMinimumcutNumCuts(int index) const;
-  double minimumcutLength(int index) const;
-  double minimumcutDistance(int index) const;
-
-  const char* direction() const ;
-  double resistance() const ;
-  double capacitance() const ;
-  double height() const ;
-  double wireExtension() const ;
-  double thickness() const ;
-  double shrinkage() const ;
-  double capMultiplier() const ;
-  double edgeCap() const ;
-  double antennaLength() const ;
-  double antennaArea() const ;
-  double currentDensityPoint() const ;
-  void currentDensityArray(int* numPoints,
-       double** widths, double** current) const ;
-  void capacitanceArray(int* numPoints,
-       double** widths, double** resValues) const ;
-  void resistanceArray(int* numPoints,
-       double** widths, double** capValues) const ;
-
-  int numAccurrentDensity() const;
-  lefiLayerDensity* accurrent(int index) const;
-  int numDccurrentDensity() const;
-  lefiLayerDensity* dccurrent(int index) const;
-
-  // 3/23/2000 - Wanda da Rosa.  The following are for 5.4 Antenna.
-  //             Only 5.4 or 5.3 are allowed in a lef file, but not both
-  void setAntennaAreaRatio(double value);
-  void setAntennaCumAreaRatio(double value);
-  void setAntennaAreaFactor(double value);
-  void setAntennaSideAreaRatio(double value);
-  void setAntennaCumSideAreaRatio(double value);
-  void setAntennaSideAreaFactor(double value);
-  void setAntennaValue(lefiAntennaEnum antennaType, double value);
-  void setAntennaDUO(lefiAntennaEnum antennaType);
-  void setAntennaPWL(lefiAntennaEnum antennaType, lefiAntennaPWL* pwl);
-  void setAntennaCumRoutingPlusCut();             // 5.7
-  void setAntennaGatePlusDiff(double value);      // 5.7
-  void setAntennaAreaMinusDiff(double value);     // 5.7
-  void addAntennaModel (int aOxide);  // 5.5
-
-  // 5.5
-  int numAntennaModel() const;
-  lefiAntennaModel* antennaModel(int index) const;
-
-  // The following is 8/21/01 5.4 enhancements 
-  void setSlotWireWidth(double num);
-  void setSlotWireLength(double num);
-  void setSlotWidth(double num);
-  void setSlotLength(double num);
-  void setMaxAdjacentSlotSpacing(double num);
-  void setMaxCoaxialSlotSpacing(double num);
-  void setMaxEdgeSlotSpacing(double num);
-  void setSplitWireWidth(double num);
-  void setMinimumDensity(double num);
-  void setMaximumDensity(double num);
-  void setDensityCheckWindow(double length, double width);
-  void setDensityCheckStep(double num);
-  void setFillActiveSpacing(double num);
-
-  int hasSlotWireWidth() const;
-  int hasSlotWireLength() const;
-  int hasSlotWidth() const;
-  int hasSlotLength() const;
-  int hasMaxAdjacentSlotSpacing() const;
-  int hasMaxCoaxialSlotSpacing() const;
-  int hasMaxEdgeSlotSpacing() const;
-  int hasSplitWireWidth() const;
-  int hasMinimumDensity() const;
-  int hasMaximumDensity() const;
-  int hasDensityCheckWindow() const;
-  int hasDensityCheckStep() const;
-  int hasFillActiveSpacing() const;
-  int hasMaxwidth() const;                     // 5.5
-  int hasMinwidth() const;                     // 5.5
-  int hasMinstep() const;                      // 5.5
-  int hasProtrusion() const;                   // 5.5
-
-  double slotWireWidth() const;
-  double slotWireLength() const;
-  double slotWidth() const;
-  double slotLength() const;
-  double maxAdjacentSlotSpacing() const;
-  double maxCoaxialSlotSpacing() const;
-  double maxEdgeSlotSpacing() const;
-  double splitWireWidth() const;
-  double minimumDensity() const;
-  double maximumDensity() const;
-  double densityCheckWindowLength() const;
-  double densityCheckWindowWidth() const;
-  double densityCheckStep() const;
-  double fillActiveSpacing() const;
-  double maxwidth() const;                     // 5.5
-  double minwidth() const;                     // 5.5
-  double protrusionWidth1() const;             // 5.5
-  double protrusionLength() const;             // 5.5
-  double protrusionWidth2() const;             // 5.5
-
-  int    numMinstep() const;                   // 5.6
-  double minstep(int index) const;             // 5.5, 5.6 switch to multiple
-  int    hasMinstepType(int index) const;      // 5.6
-  char*  minstepType(int index) const;         // 5.6
-  int    hasMinstepLengthsum(int index) const; // 5.6
-  double minstepLengthsum(int index) const;    // 5.6
-  int    hasMinstepMaxedges(int index) const;  // 5.7
-  int    minstepMaxedges(int index) const;     // 5.7
-  int    hasMinstepMinAdjLength(int index) const;  // 5.7
-  double minstepMinAdjLength(int index) const;     // 5.7
-  int    hasMinstepMinBetLength(int index) const;  // 5.7
-  double minstepMinBetLength(int index) const;     // 5.7
-  int    hasMinstepXSameCorners(int index) const;  // 5.7
-
-  // 5.5 MINENCLOSEDAREA
-  int    numMinenclosedarea() const;
-  double minenclosedarea(int index) const;
-  int    hasMinenclosedareaWidth(int index) const;
-  double minenclosedareaWidth(int index) const;
-
-  // 5.5 SPACINGTABLE FOR LAYER ROUTING
-  int               numSpacingTable();
-  lefiSpacingTable* spacingTable(int index);
-
-  // 5.6 ENCLOSURE, PREFERENCLOSURE, RESISTANCEPERCUT & DIAGMINEDGELENGTH
-  int    numEnclosure() const;
-  int    hasEnclosureRule(int index) const;
-  char*  enclosureRule(int index) ;
-  double enclosureOverhang1(int index) const;
-  double enclosureOverhang2(int index) const;
-  int    hasEnclosureWidth(int index) const;
-  double enclosureMinWidth(int index) const;
-  int    hasEnclosureExceptExtraCut(int index) const;    // 5.7
-  double enclosureExceptExtraCut(int index) const;       // 5.7
-  int    hasEnclosureMinLength(int index) const;         // 5.7
-  double enclosureMinLength(int index) const;            // 5.7
-  int    numPreferEnclosure() const;
-  int    hasPreferEnclosureRule(int index) const;
-  char*  preferEnclosureRule(int index) ;
-  double preferEnclosureOverhang1(int index) const;
-  double preferEnclosureOverhang2(int index) const;
-  int    hasPreferEnclosureWidth(int index) const;
-  double preferEnclosureMinWidth(int index) const;
-  int    hasResistancePerCut() const;
-  double resistancePerCut() const;
-  int    hasDiagMinEdgeLength() const;
-  double diagMinEdgeLength() const;
-  int    numMinSize() const;
-  double minSizeWidth(int index) const;
-  double minSizeLength(int index) const;
-
-  // 5.7
-  int    hasMaxFloatingArea() const; 
-  double maxFloatingArea() const;
-  int    hasArraySpacing() const;
-  int    hasLongArray() const;
-  int    hasViaWidth() const;
-  double viaWidth() const;
-  double cutSpacing() const;
-  int    numArrayCuts() const;
-  int    arrayCuts(int index) const;
-  double arraySpacing(int index) const;
-  int    hasSpacingTableOrtho() const; // SPACINGTABLE ORTHOGONAL FOR LAYER CUT
-  lefiOrthogonal *orthogonal() const;
-
-  void parse65nmRules();                  // 5.7
-  void parseLEF58Layer();                 // 5.8
-  int  need58PropsProcessing() const;     // 5.8
-
-  // Debug print
-  void print(FILE* f) const;
-
-private:
-  void parseSpacing(int index);
-  void parseMaxFloating(int index);
-  void parseArraySpacing(int index);
-  void parseMinstep(int index);
-  void parseAntennaCumRouting(int index);
-  void parseAntennaGatePlus(int index);
-  void parseAntennaAreaMinus(int index);
-  void parseAntennaAreaDiff(int index);
-
-  void parseLayerType(int index);         // 5.8
-  void parseLayerEnclosure(int index);    // 5.8
-  void parseLayerWidthTable(int indxe);   // 5.8
-
-protected:
-  char* name_;
-  int nameSize_;
-  char* type_;
-  int typeSize_;
-  char* layerType_;   // 5.8 - POLYROUTING, MIMCAP, TSV, PASSIVATION, NWELL
-
-  int hasPitch_;
-  int hasMask_;                       // 5.8 native
-  int hasOffset_;
-  int hasWidth_;            
-  int hasArea_;
-  int hasSpacing_;
-  int hasDiagPitch_;                  // 5.6
-  int hasDiagWidth_;                  // 5.6
-  int hasDiagSpacing_;                // 5.6
-  int* hasSpacingName_;               // 5.5
-  int* hasSpacingLayerStack_;         // 5.7
-  int* hasSpacingAdjacent_;           // 5.5
-  int* hasSpacingRange_;              // pcr 409334
-  int* hasSpacingUseLengthThreshold_; // pcr 282799, due to mult. spacing allow
-  int* hasSpacingLengthThreshold_;    // pcr 409334
-  int* hasSpacingCenterToCenter_;     // 5.6
-  int* hasSpacingParallelOverlap_;    // 5.7
-  int* hasSpacingCutArea_;            // 5.7
-  int* hasSpacingEndOfLine_;          // 5.7
-  int* hasSpacingParellelEdge_;       // 5.7
-  int* hasSpacingTwoEdges_;           // 5.7
-  int* hasSpacingAdjacentExcept_;     // 5.7
-  int* hasSpacingSamenet_;            // 5.7
-  int* hasSpacingSamenetPGonly_;      // 5.7
-  int hasArraySpacing_;               // 5.7
-  int hasDirection_;
-  int hasResistance_;
-  int hasCapacitance_;
-  int hasHeight_;
-  int hasWireExtension_;
-  int hasThickness_;
-  int hasShrinkage_;
-  int hasCapMultiplier_;
-  int hasEdgeCap_;
-  int hasAntennaArea_;
-  int hasAntennaLength_;
-  int hasCurrentDensityPoint_;
-
-  double currentDensity_;
-  double pitchX_;                     // 5.6
-  double pitchY_;                     // 5.6
-  double offsetX_;                    // 5.6
-  double offsetY_;                    // 5.6
-  double diagPitchX_;                 // 5.6
-  double diagPitchY_;                 // 5.6
-  double diagWidth_;                  // 5.6
-  double diagSpacing_;                // 5.6
-  double width_;
-  double area_;
-  double wireExtension_;
-  int numSpacings_;
-  int spacingsAllocated_;
-  int maskNumber_;                     // 5.8
-  double* spacing_;          // for Cut & routing Layer, spacing is multiple
-  char**  spacingName_;
-  int*    spacingAdjacentCuts_;    // 5.5
-  double* spacingAdjacentWithin_;  // 5.5
-  double* spacingCutArea_;         // 5.7
-  double* rangeMin_;         // pcr 282799 & 408930, due to mult spacing allow
-  double* rangeMax_;         // pcr 282799 & 408930, due to mult spacing allow
-  double* rangeInfluence_;   // pcr 282799 & 408930, due to mult spacing allow
-  double* rangeInfluenceRangeMin_;          // pcr 388183 & 408930
-  double* rangeInfluenceRangeMax_;          // pcr 388183 & 408930
-  double* rangeRangeMin_;                   // pcr 408930
-  double* rangeRangeMax_;                   // pcr 408930
-  double* lengthThreshold_;                 // pcr 408930
-  double* lengthThresholdRangeMin_;         // pcr 408930
-  double* lengthThresholdRangeMax_;         // pcr 408930
-
-  // 5.5
-  int     numMinimumcut_;
-  int     minimumcutAllocated_;
-  int*    minimumcut_;                       // pcr 409334
-  double* minimumcutWidth_;                  // pcr 409334
-  int*    hasMinimumcutWithin_;              // 5.7
-  double* minimumcutWithin_;                 // 5.7
-  int*    hasMinimumcutConnection_;
-  char**  minimumcutConnection_;
-  int*    hasMinimumcutNumCuts_;
-  double* minimumcutLength_;
-  double* minimumcutDistance_;
-
-  double  maxwidth_;                          // 5.5
-  double  minwidth_;                          // 5.5
-  int     numMinenclosedarea_;                // 5.5
-  int     minenclosedareaAllocated_;          // 5.5
-  double* minenclosedarea_;                   // 5.5
-  double* minenclosedareaWidth_;              // 5.5
-  double  protrusionWidth1_;                  // 5.5
-  double  protrusionLength_;                  // 5.5
-  double  protrusionWidth2_;                  // 5.5
-
-  int     numMinstep_;                        // 5.6
-  int     numMinstepAlloc_;                   // 5.6
-  double* minstep_;                           // 5.6, switch to multiple
-  char**  minstepType_;                       // INSIDECORNER|OUTSIDECORNER|STEP
-  double* minstepLengthsum_; 
-  int*    minstepMaxEdges_;                   // 5.7
-  double* minstepMinAdjLength_;               // 5.7
-  double* minstepMinBetLength_;               // 5.7
-  int*    minstepXSameCorners_;               // 5.7
-
-  char*  direction_;
-  double resistance_;
-  double capacitance_;
-  double height_;
-  double thickness_;
-  double shrinkage_;
-  double capMultiplier_;
-  double edgeCap_;
-  double antennaArea_;
-  double antennaLength_;
-
-  int numCurrentPoints_;
-  int currentPointsAllocated_;
-  double* currentWidths_;
-  double* current_;
-
-  int numCapacitancePoints_;
-  int capacitancePointsAllocated_;
-  double* capacitanceWidths_;
-  double* capacitances_;
-
-  int numResistancePoints_;
-  int resistancePointsAllocated_;
-  double* resistanceWidths_;
-  double* resistances_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  names_;
-  char**  values_;
-  double* dvalues_;
-  char*   types_;                     // I: integer, R: real, S:string
-                                      // Q: quotedstring
-  int numAccurrents_;                 // number of ACCURRENTDENSITY
-  int accurrentAllocated_;
-  lefiLayerDensity** accurrents_;
-  int numDccurrents_;                 // number of DCCURRENTDENSITY
-  int dccurrentAllocated_;
-  lefiLayerDensity** dccurrents_;
-  int numNums_;
-  int numAllocated_;
-  double* nums_;
-
-  // 3/23/2000 - Wanda da Rosa.  The following is for 5.4 ANTENNA.
-  //             Either 5.4 or 5.3 are allowed, not both
-  int hasAntennaAreaRatio_;
-  int hasAntennaDiffAreaRatio_;
-  int hasAntennaDiffAreaRatioPWL_;
-  int hasAntennaCumAreaRatio_;
-  int hasAntennaCumDiffAreaRatio_;
-  int hasAntennaCumDiffAreaRatioPWL_;
-  int hasAntennaAreaFactor_;
-  int hasAntennaAreaFactorDUO_;
-  int hasAntennaSideAreaRatio_;
-  int hasAntennaDiffSideAreaRatio_;
-  int hasAntennaDiffSideAreaRatioPWL_;
-  int hasAntennaCumSideAreaRatio_;
-  int hasAntennaCumDiffSideAreaRatio_;
-  int hasAntennaCumDiffSideAreaRatioPWL_;
-  int hasAntennaSideAreaFactor_;
-  int hasAntennaSideAreaFactorDUO_;
-
-  // 5.5 AntennaModel
-  lefiAntennaModel* currentAntennaModel_;
-  int numAntennaModel_;
-  int antennaModelAllocated_;
-  lefiAntennaModel** antennaModel_;
-
-  // 8/29/2001 - Wanda da Rosa.  The following is for 5.4 enhancements.
-  int hasSlotWireWidth_;
-  int hasSlotWireLength_;
-  int hasSlotWidth_;
-  int hasSlotLength_;
-  int hasMaxAdjacentSlotSpacing_;
-  int hasMaxCoaxialSlotSpacing_;
-  int hasMaxEdgeSlotSpacing_;
-  int hasSplitWireWidth_;
-  int hasMinimumDensity_;
-  int hasMaximumDensity_;
-  int hasDensityCheckWindow_;
-  int hasDensityCheckStep_;
-  int hasFillActiveSpacing_;
-  int hasTwoWidthPRL_;
-
-  double slotWireWidth_; 
-  double slotWireLength_; 
-  double slotWidth_; 
-  double slotLength_; 
-  double maxAdjacentSlotSpacing_; 
-  double maxCoaxialSlotSpacing_; 
-  double maxEdgeSlotSpacing_; 
-  double splitWireWidth_; 
-  double minimumDensity_; 
-  double maximumDensity_; 
-  double densityCheckWindowLength_; 
-  double densityCheckWindowWidth_; 
-  double densityCheckStep_; 
-  double fillActiveSpacing_; 
-
-  // 5.5 SPACINGTABLE
-  int numSpacingTable_;
-  int spacingTableAllocated_;
-  lefiSpacingTable** spacingTable_;
-
-  // 5.6
-  int numEnclosure_;
-  int enclosureAllocated_;
-  char** enclosureRules_;
-  double* overhang1_;
-  double* overhang2_;
-  double* encminWidth_;
-  double* cutWithin_;
-  double* minLength_;
-  int numPreferEnclosure_;
-  int preferEnclosureAllocated_;
-  char** preferEnclosureRules_;
-  double* preferOverhang1_;
-  double* preferOverhang2_;
-  double* preferMinWidth_;
-  double  resPerCut_;
-  double  diagMinEdgeLength_;
-  int numMinSize_;
-  double* minSizeWidth_;
-  double* minSizeLength_;
-
-  // 5.7
-  double* eolWidth_;
-  double* eolWithin_;
-  double* parSpace_;
-  double* parWithin_;
-  double  maxArea_;
-  int     hasLongArray_;
-  double  viaWidth_;
-  double  cutSpacing_;
-  int     numArrayCuts_;
-  int     arrayCutsAllocated_;
-  int*    arrayCuts_;
-  double* arraySpacings_;
-  int     hasSpacingTableOrtho_;
-  lefiOrthogonal* spacingTableOrtho_;
-  double* notchLength_;
-  double* endOfNotchWidth_;
-  double* minNotchSpacing_;
-  double* eonotchLength_;
-
-  int     lef58WidthTableOrthoValues_;
-  int     lef58WidthTableWrongDirValues_;
-  double* lef58WidthTableOrtho_;
-  double* lef58WidthTableWrongDir_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.cpp
deleted file mode 100644
index 7ad1b61..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.cpp
+++ /dev/null
@@ -1,4789 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "lefiMacro.hpp"
-#include "lefiMisc.hpp"
-#include "lefiDebug.hpp"
-#include "lefiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiObstruction
-// *****************************************************************************
-
-lefiObstruction::lefiObstruction()
-: geometries_(NULL)
-{
-    Init();
-}
-
-void
-lefiObstruction::Init()
-{
-    geometries_ = 0;
-}
-
-lefiObstruction::~lefiObstruction()
-{
-    Destroy();
-}
-
-void
-lefiObstruction::Destroy()
-{
-    clear();
-}
-
-void
-lefiObstruction::clear()
-{
-    if (geometries_) {
-        geometries_->Destroy();
-        lefFree((char*) (geometries_));
-    }
-    geometries_ = 0;
-}
-
-void
-lefiObstruction::setGeometries(lefiGeometries *g)
-{
-    clear();
-    geometries_ = g;
-}
-
-lefiGeometries *
-lefiObstruction::geometries() const
-{
-    return geometries_;
-}
-
-void
-lefiObstruction::print(FILE *f) const
-{
-    lefiGeometries *g;
-
-    fprintf(f, "  Obstruction\n");
-
-    g = geometries_;
-    g->print(f);
-
-}
-
-// *****************************************************************************
-// lefiDensity
-// *****************************************************************************
-
-lefiDensity::lefiDensity()
-: numLayers_(0),
-  layersAllocated_(0),
-  layerName_(NULL),
-  numRects_(NULL),
-  rectsAllocated_(NULL),
-  rects_(NULL),
-  densityValue_(NULL)
-{
-    Init();
-}
-
-void
-lefiDensity::Init()
-{
-    numLayers_ = 0;
-    layersAllocated_ = 0;
-}
-
-lefiDensity::~lefiDensity()
-{
-    Destroy();
-}
-
-void
-lefiDensity::Destroy()
-{
-    clear();
-}
-
-void
-lefiDensity::clear()
-{
-    for (int i = 0; i < numLayers_; i++) {
-        lefFree(layerName_[i]);
-        lefFree((char*) rects_[i]);
-        lefFree((char*) densityValue_[i]);
-        numRects_[i] = 0;
-        rectsAllocated_[i] = 0;
-    }
-    lefFree(layerName_);
-    lefFree((char*) (rects_));
-    lefFree((char*) (densityValue_));
-    lefFree((char*) (numRects_));
-    lefFree((char*) (rectsAllocated_));
-    layerName_ = 0;
-    numLayers_ = 0;
-    layersAllocated_ = 0;
-    numRects_ = 0;
-    rects_ = 0;
-    densityValue_ = 0;
-    rectsAllocated_ = 0;
-}
-
-void
-lefiDensity::addLayer(const char *name)
-{
-    if (numLayers_ == layersAllocated_) {
-        int             i;
-        char            **ln;                   // layerName
-        int             *nr;                   // number of rect within the layer
-        int             *ra;                   // number of rect allocated within the layer
-        lefiGeomRect    **rs;    // rect value
-        double          **dv;           // density value
-
-        layersAllocated_ = (layersAllocated_ == 0) ?
-            2 : layersAllocated_ * 2;
-        ln = (char**) lefMalloc(sizeof(char*) * layersAllocated_);
-        nr = (int*) lefMalloc(sizeof(int) * layersAllocated_);
-        ra = (int*) lefMalloc(sizeof(int) * layersAllocated_);
-        rs = (lefiGeomRect**) lefMalloc(sizeof(lefiGeomRect*)
-                                        * layersAllocated_);
-        dv = (double**) lefMalloc(sizeof(double*) * layersAllocated_);
-        for (i = 0; i < numLayers_; i++) {
-            ln[i] = layerName_[i];
-            nr[i] = numRects_[i];
-            ra[i] = rectsAllocated_[i];
-            rs[i] = rects_[i];
-            dv[i] = densityValue_[i];
-        }
-
-        lefFree((char*) (layerName_));
-        lefFree((char*) (rects_));
-        lefFree((char*) (densityValue_));
-        lefFree((char*) (numRects_));
-        lefFree((char*) (rectsAllocated_));
-
-        layerName_ = ln;
-        numRects_ = nr;
-        rectsAllocated_ = ra;
-        rects_ = rs;
-        densityValue_ = dv;
-    }
-    layerName_[numLayers_] = strdup(name);
-    numRects_[numLayers_] = 0;
-    rectsAllocated_[numLayers_] = 0;
-    rects_[numLayers_] = 0;
-    densityValue_[numLayers_] = 0;
-    numLayers_ += 1;
-}
-
-void
-lefiDensity::addRect(double x1,
-                     double y1,
-                     double x2,
-                     double y2,
-                     double value)
-{
-    if (numRects_[numLayers_ - 1] ==
-        rectsAllocated_[numLayers_ - 1]) {
-
-        lefiGeomRect    *rs, *ors;
-        double          *dv, *odv;
-        int             i;
-
-        rectsAllocated_[numLayers_ - 1] =
-            (rectsAllocated_[numLayers_ - 1] == 0) ?
-            2 : rectsAllocated_[numLayers_ - 1] * 2;
-
-        rs = (lefiGeomRect*) lefMalloc(sizeof(lefiGeomRect) *
-                                       rectsAllocated_[numLayers_ - 1]);
-        dv = (double*) lefMalloc(sizeof(double) *
-                                 rectsAllocated_[numLayers_ - 1]);
-
-        if (numRects_[numLayers_ - 1] > 0) {
-            ors = rects_[numLayers_ - 1];
-            odv = densityValue_[numLayers_ - 1];
-            for (i = 0; i < numRects_[numLayers_ - 1]; i++) {
-                rs[i] = ors[i];    // assign data from old rect & density value to
-                dv[i] = odv[i];    // new, larger array
-            }
-
-            lefFree((char*) rects_[numLayers_ - 1]);
-            lefFree((char*) densityValue_[numLayers_ - 1]);
-        }
-
-        rects_[numLayers_ - 1] = rs;
-        densityValue_[numLayers_ - 1] = dv;
-    }
-
-    lefiGeomRect p;
-
-    p.xl = x1;
-    p.yl = y1;
-    p.xh = x2;
-    p.yh = y2;
-    p.colorMask = 0;
-
-    rects_[numLayers_ - 1][numRects_[numLayers_ - 1]] = p;
-    densityValue_[numLayers_ - 1][numRects_[numLayers_ - 1]] = value;
-    numRects_[numLayers_ - 1] += 1;
-}
-
-int
-lefiDensity::numLayer() const
-{
-    return numLayers_;
-}
-
-char *
-lefiDensity::layerName(int index) const
-{
-    return layerName_[index];
-}
-
-int
-lefiDensity::numRects(int index) const
-{
-    return numRects_[index];
-}
-
-lefiGeomRect
-lefiDensity::getRect(int    index,
-                     int    rectIndex) const
-{
-    lefiGeomRect *rs;
-
-    rs = rects_[index];
-    return rs[rectIndex];
-}
-
-double
-lefiDensity::densityValue(int   index,
-                          int   rectIndex) const
-{
-    double *dv;
-
-    dv = densityValue_[index];
-    return dv[rectIndex];
-}
-
-void
-lefiDensity::print(FILE *f) const
-{
-    int i, j;
-
-    // 11/8/2004 - Added feed back from users
-    fprintf(f, "  DENSITY\n");
-    for (i = 0; i < numLayers_; i++) {
-        fprintf(f, "    LAYER %s\n", layerName_[i]);
-        for (j = 0; j < numRects_[i]; j++) {
-            fprintf(f, "      RECT %g %g %g %g ", rects_[i][j].xl,
-                    rects_[i][j].yl, rects_[i][j].xh,
-                    rects_[i][j].yh);
-            fprintf(f, "%g\n", densityValue_[i][j]);
-        }
-    }
-}
-
-// *****************************************************************************
-// lefiPinAntennaModel
-// *****************************************************************************
-
-lefiPinAntennaModel::lefiPinAntennaModel()
-: oxide_(NULL),
-  hasReturn_(0),
-  numAntennaGateArea_(0),
-  antennaGateAreaAllocated_(0),
-  antennaGateArea_(NULL),
-  antennaGateAreaLayer_(NULL),
-  numAntennaMaxAreaCar_(0),
-  antennaMaxAreaCarAllocated_(0),
-  antennaMaxAreaCar_(NULL),
-  antennaMaxAreaCarLayer_(NULL),
-  numAntennaMaxSideAreaCar_(0),
-  antennaMaxSideAreaCarAllocated_(0),
-  antennaMaxSideAreaCar_(NULL),
-  antennaMaxSideAreaCarLayer_(NULL),
-  numAntennaMaxCutCar_(0),
-  antennaMaxCutCarAllocated_(0),
-  antennaMaxCutCar_(NULL),
-  antennaMaxCutCarLayer_(NULL)
-{
-    Init();
-}
-
-void
-lefiPinAntennaModel::Init()
-{
-    numAntennaGateArea_ = 0;
-    antennaGateAreaAllocated_ = 1;
-    antennaGateArea_ = (double*) lefMalloc(sizeof(double));
-    antennaGateAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaMaxAreaCar_ = 0;
-    antennaMaxAreaCarAllocated_ = 1;
-    antennaMaxAreaCar_ = (double*) lefMalloc(sizeof(double));
-    antennaMaxAreaCarLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaMaxSideAreaCar_ = 0;
-    antennaMaxSideAreaCarAllocated_ = 1;
-    antennaMaxSideAreaCar_ = (double*) lefMalloc(sizeof(double));
-    antennaMaxSideAreaCarLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaMaxCutCar_ = 0;
-    antennaMaxCutCarAllocated_ = 1;
-    antennaMaxCutCar_ = (double*) lefMalloc(sizeof(double));
-    antennaMaxCutCarLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    oxide_ = 0;
-    hasReturn_ = 0;
-
-}
-
-lefiPinAntennaModel::~lefiPinAntennaModel()
-{
-    Destroy();
-}
-
-void
-lefiPinAntennaModel::Destroy()
-{
-    clear();
-}
-
-void
-lefiPinAntennaModel::clear()
-{
-    int i;
-
-    if (oxide_)
-        lefFree((char*) (oxide_));
-    else       // did not declare
-        return;
-    oxide_ = 0;
-    hasReturn_ = 0;
-
-    for (i = 0; i < numAntennaGateArea_; i++) {
-        if (antennaGateAreaLayer_[i])
-            lefFree(antennaGateAreaLayer_[i]);
-    }
-    numAntennaGateArea_ = 0;
-
-    for (i = 0; i < numAntennaMaxAreaCar_; i++) {
-        if (antennaMaxAreaCarLayer_[i])
-            lefFree(antennaMaxAreaCarLayer_[i]);
-    }
-    numAntennaMaxAreaCar_ = 0;
-
-    for (i = 0; i < numAntennaMaxSideAreaCar_; i++) {
-        if (antennaMaxSideAreaCarLayer_[i])
-            lefFree(antennaMaxSideAreaCarLayer_[i]);
-    }
-    numAntennaMaxSideAreaCar_ = 0;
-
-    for (i = 0; i < numAntennaMaxCutCar_; i++) {
-        if (antennaMaxCutCarLayer_[i])
-            lefFree(antennaMaxCutCarLayer_[i]);
-    }
-    numAntennaMaxCutCar_ = 0;
-    lefFree((char*) (antennaGateArea_));
-    lefFree((char*) (antennaGateAreaLayer_));
-    lefFree((char*) (antennaMaxAreaCar_));
-    lefFree((char*) (antennaMaxAreaCarLayer_));
-    lefFree((char*) (antennaMaxSideAreaCar_));
-    lefFree((char*) (antennaMaxSideAreaCarLayer_));
-    lefFree((char*) (antennaMaxCutCar_));
-    lefFree((char*) (antennaMaxCutCarLayer_));
-
-}
-
-// 5.5
-void
-lefiPinAntennaModel::setAntennaModel(int aOxide)
-{
-    switch (aOxide) {
-    case 1:
-        oxide_ = strdup("OXIDE1");
-        break;
-    case 2:
-        oxide_ = strdup("OXIDE2");
-        break;
-    case 3:
-        oxide_ = strdup("OXIDE3");
-        break;
-    case 4:
-        oxide_ = strdup("OXIDE4");
-        break;
-    default:
-        oxide_ = NULL;
-        break;
-    }
-}
-
-void
-lefiPinAntennaModel::addAntennaGateArea(double      val,
-                                        const char  *layer)
-{
-    int len;
-    if (numAntennaGateArea_ == antennaGateAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaGateArea_;
-        double  *nd;
-        char    **nl;
-
-
-        if (antennaGateAreaAllocated_ == 0)
-            max = antennaGateAreaAllocated_ = 2;
-        else
-            max = antennaGateAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaGateAreaLayer_[i];
-            nd[i] = antennaGateArea_[i];
-        }
-        lefFree((char*) (antennaGateAreaLayer_));
-        lefFree((char*) (antennaGateArea_));
-        antennaGateAreaLayer_ = nl;
-        antennaGateArea_ = nd;
-    }
-    antennaGateArea_[numAntennaGateArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaGateAreaLayer_[numAntennaGateArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaGateAreaLayer_[numAntennaGateArea_],
-               layer);
-    } else
-        antennaGateAreaLayer_[numAntennaGateArea_] = NULL;
-    numAntennaGateArea_ += 1;
-}
-
-void
-lefiPinAntennaModel::addAntennaMaxAreaCar(double        val,
-                                          const char    *layer)
-{
-    int len;
-    if (numAntennaMaxAreaCar_ == antennaMaxAreaCarAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaMaxAreaCar_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaMaxAreaCarAllocated_ == 0)
-            max = antennaMaxAreaCarAllocated_ = 2;
-        else
-            max = antennaMaxAreaCarAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaMaxAreaCarLayer_[i];
-            nd[i] = antennaMaxAreaCar_[i];
-        }
-        lefFree((char*) (antennaMaxAreaCarLayer_));
-        lefFree((char*) (antennaMaxAreaCar_));
-        antennaMaxAreaCarLayer_ = nl;
-        antennaMaxAreaCar_ = nd;
-    }
-    antennaMaxAreaCar_[numAntennaMaxAreaCar_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_],
-               layer);
-    } else
-        antennaMaxAreaCarLayer_[numAntennaMaxAreaCar_] = NULL;
-    numAntennaMaxAreaCar_ += 1;
-}
-
-void
-lefiPinAntennaModel::addAntennaMaxSideAreaCar(double        val,
-                                              const char    *layer)
-{
-    int len;
-    if (numAntennaMaxSideAreaCar_ == antennaMaxSideAreaCarAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaMaxSideAreaCar_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaMaxSideAreaCarAllocated_ == 0)
-            max = antennaMaxSideAreaCarAllocated_ = 2;
-        else
-            max = antennaMaxSideAreaCarAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaMaxSideAreaCarLayer_[i];
-            nd[i] = antennaMaxSideAreaCar_[i];
-        }
-        lefFree((char*) (antennaMaxSideAreaCarLayer_));
-        lefFree((char*) (antennaMaxSideAreaCar_));
-        antennaMaxSideAreaCarLayer_ = nl;
-        antennaMaxSideAreaCar_ = nd;
-    }
-    antennaMaxSideAreaCar_[numAntennaMaxSideAreaCar_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_],
-               layer);
-    } else
-        antennaMaxSideAreaCarLayer_[numAntennaMaxSideAreaCar_] = NULL;
-    numAntennaMaxSideAreaCar_ += 1;
-}
-
-void
-lefiPinAntennaModel::addAntennaMaxCutCar(double     val,
-                                         const char *layer)
-{
-    int len;
-    if (numAntennaMaxCutCar_ == antennaMaxCutCarAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaMaxCutCar_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaMaxCutCarAllocated_ == 0)
-            max = antennaMaxCutCarAllocated_ = 2;
-        else
-            max = antennaMaxCutCarAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaMaxCutCarLayer_[i];
-            nd[i] = antennaMaxCutCar_[i];
-        }
-        lefFree((char*) (antennaMaxCutCarLayer_));
-        lefFree((char*) (antennaMaxCutCar_));
-        antennaMaxCutCarLayer_ = nl;
-        antennaMaxCutCar_ = nd;
-    }
-    antennaMaxCutCar_[numAntennaMaxCutCar_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaMaxCutCarLayer_[numAntennaMaxCutCar_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaMaxCutCarLayer_[numAntennaMaxCutCar_],
-               layer);
-    } else
-        antennaMaxCutCarLayer_[numAntennaMaxCutCar_] = NULL;
-    numAntennaMaxCutCar_ += 1;
-}
-
-void
-lefiPinAntennaModel::setAntennaReturnFlag(int flag)
-{
-    hasReturn_ = flag;
-    return;
-}
-
-int
-lefiPinAntennaModel::hasAntennaGateArea() const
-{
-    return numAntennaGateArea_ ? 1 : 0;
-}
-
-int
-lefiPinAntennaModel::hasAntennaMaxAreaCar() const
-{
-    return numAntennaMaxAreaCar_ ? 1 : 0;
-}
-
-int
-lefiPinAntennaModel::hasAntennaMaxSideAreaCar() const
-{
-    return numAntennaMaxSideAreaCar_ ? 1 : 0;
-}
-
-int
-lefiPinAntennaModel::hasAntennaMaxCutCar() const
-{
-    return numAntennaMaxCutCar_ ? 1 : 0;
-}
-
-// 5.5
-char *
-lefiPinAntennaModel::antennaOxide() const
-{
-    return oxide_;
-}
-
-const char *
-lefiPinAntennaModel::antennaGateAreaLayer(int i) const
-{
-    return antennaGateAreaLayer_[i];
-}
-
-const char *
-lefiPinAntennaModel::antennaMaxAreaCarLayer(int i) const
-{
-    return antennaMaxAreaCarLayer_[i];
-}
-
-const char *
-lefiPinAntennaModel::antennaMaxSideAreaCarLayer(int i) const
-{
-    return antennaMaxSideAreaCarLayer_[i];
-}
-
-const char *
-lefiPinAntennaModel::antennaMaxCutCarLayer(int i) const
-{
-    return antennaMaxCutCarLayer_[i];
-}
-
-int
-lefiPinAntennaModel::numAntennaGateArea() const
-{
-    return numAntennaGateArea_;
-}
-
-int
-lefiPinAntennaModel::numAntennaMaxAreaCar() const
-{
-    return numAntennaMaxAreaCar_;
-}
-
-int
-lefiPinAntennaModel::numAntennaMaxSideAreaCar() const
-{
-    return numAntennaMaxSideAreaCar_;
-}
-
-int
-lefiPinAntennaModel::numAntennaMaxCutCar() const
-{
-    return numAntennaMaxCutCar_;
-}
-
-double
-lefiPinAntennaModel::antennaGateArea(int i) const
-{
-    return antennaGateArea_[i];
-}
-
-double
-lefiPinAntennaModel::antennaMaxAreaCar(int i) const
-{
-    return antennaMaxAreaCar_[i];
-}
-
-double
-lefiPinAntennaModel::antennaMaxSideAreaCar(int i) const
-{
-    return antennaMaxSideAreaCar_[i];
-}
-
-double
-lefiPinAntennaModel::antennaMaxCutCar(int i) const
-{
-    return antennaMaxCutCar_[i];
-}
-
-int
-lefiPinAntennaModel::hasReturn() const
-{
-    return hasReturn_;
-}
-
-// *****************************************************************************
-// lefiPin
-// *****************************************************************************
-
-lefiPin::lefiPin()
-: nameSize_(0),
-  name_(NULL),
-  hasLEQ_(0),
-  hasDirection_(0),
-  hasUse_(0),
-  hasShape_(0),
-  hasMustjoin_(0),
-  hasOutMargin_(0),
-  hasOutResistance_(0),
-  hasInMargin_(0),
-  hasPower_(0),
-  hasLeakage_(0),
-  hasMaxload_(0),
-  hasMaxdelay_(0),
-  hasCapacitance_(0),
-  hasResistance_(0),
-  hasPulldownres_(0),
-  hasTieoffr_(0),
-  hasVHI_(0),
-  hasVLO_(0),
-  hasRiseVoltage_(0),
-  hasFallVoltage_(0),
-  hasRiseThresh_(0),
-  hasFallThresh_(0),
-  hasRiseSatcur_(0),
-  hasFallSatcur_(0),
-  hasCurrentSource_(0),
-  hasTables_(0),
-  hasAntennasize_(0),
-  hasRiseSlewLimit_(0),
-  hasFallSlewLimit_(0),
-  numForeigns_(0),
-  foreignAllocated_(0),
-  hasForeignOrient_(NULL),
-  hasForeignPoint_(NULL),
-  foreignOrient_(NULL),
-  foreignX_(NULL),
-  foreignY_(NULL),
-  foreign_(NULL),
-  LEQSize_(0),
-  LEQ_(NULL),
-  mustjoinSize_(0),
-  mustjoin_(NULL),
-  outMarginH_(0.0),
-  outMarginL_(0.0),
-  outResistanceH_(0.0),
-  outResistanceL_(0.0),
-  inMarginH_(0.0),
-  inMarginL_(0.0),
-  power_(0.0),
-  leakage_(0.0),
-  maxload_(0.0),
-  maxdelay_(0.0),
-  capacitance_(0.0),
-  resistance_(0.0),
-  pulldownres_(0.0),
-  tieoffr_(0.0),
-  VHI_(0.0),
-  VLO_(0.0),
-  riseVoltage_(0.0),
-  fallVoltage_(0.0),
-  riseThresh_(0.0),
-  fallThresh_(0.0),
-  riseSatcur_(0.0),
-  fallSatcur_(0.0),
-  lowTableSize_(0),
-  lowTable_(NULL),
-  highTableSize_(0),
-  highTable_(NULL),
-  riseSlewLimit_(0.0),
-  fallSlewLimit_(0.0),
-  numAntennaModel_(0),
-  antennaModelAllocated_(0),
-  curAntennaModelIndex_(0),
-  antennaModel_(NULL),
-  numAntennaSize_(0),
-  antennaSizeAllocated_(0),
-  antennaSize_(NULL),
-  antennaSizeLayer_(NULL),
-  numAntennaMetalArea_(0),
-  antennaMetalAreaAllocated_(0),
-  antennaMetalArea_(NULL),
-  antennaMetalAreaLayer_(NULL),
-  numAntennaMetalLength_(0),
-  antennaMetalLengthAllocated_(0),
-  antennaMetalLength_(NULL),
-  antennaMetalLengthLayer_(NULL),
-  numAntennaPartialMetalArea_(0),
-  antennaPartialMetalAreaAllocated_(0),
-  antennaPartialMetalArea_(NULL),
-  antennaPartialMetalAreaLayer_(NULL),
-  numAntennaPartialMetalSideArea_(0),
-  antennaPartialMetalSideAreaAllocated_(0),
-  antennaPartialMetalSideArea_(NULL),
-  antennaPartialMetalSideAreaLayer_(NULL),
-  numAntennaPartialCutArea_(0),
-  antennaPartialCutAreaAllocated_(0),
-  antennaPartialCutArea_(NULL),
-  antennaPartialCutAreaLayer_(NULL),
-  numAntennaDiffArea_(0),
-  antennaDiffAreaAllocated_(0),
-  antennaDiffArea_(NULL),
-  antennaDiffAreaLayer_(NULL),
-  taperRule_(NULL),
-  netEpxr_(NULL),
-  ssPinName_(NULL),
-  gsPinName_(NULL),
-  numProperties_(0),
-  propertiesAllocated_(0),
-  propNames_(NULL),
-  propValues_(NULL),
-  propNums_(NULL),
-  propTypes_(NULL),
-  numPorts_(0),
-  portsAllocated_(0),
-  ports_(NULL)
-{
-    Init();
-}
-
-void
-lefiPin::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    portsAllocated_ = 2;
-    ports_ = (lefiGeometries**) lefMalloc(sizeof(lefiGeometries*) * 2);
-    numPorts_ = 0;
-    numProperties_ = 0;
-    propertiesAllocated_ = 0;
-    propNames_ = 0;
-    propValues_ = 0;
-    propTypes_ = 0;
-    foreign_ = 0;
-    LEQ_ = 0;
-    mustjoin_ = 0;
-    lowTable_ = 0;
-    highTable_ = 0;
-    taperRule_ = 0;
-    antennaModel_ = 0;
-    numAntennaModel_ = 0;
-    netEpxr_ = 0;
-    ssPinName_ = 0;
-    gsPinName_ = 0;
-
-    bump(&(LEQ_), 16, &(LEQSize_));
-    bump(&(mustjoin_), 16, &(mustjoinSize_));
-    bump(&(lowTable_), 16, &(lowTableSize_));
-    bump(&(highTable_), 16, &(highTableSize_));
-
-    numAntennaSize_ = 0;
-    antennaSizeAllocated_ = 1;
-    antennaSize_ = (double*) lefMalloc(sizeof(double));
-    antennaSizeLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaMetalArea_ = 0;
-    antennaMetalAreaAllocated_ = 1;
-    antennaMetalArea_ = (double*) lefMalloc(sizeof(double));
-    antennaMetalAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaMetalLength_ = 0;
-    antennaMetalLengthAllocated_ = 1;
-    antennaMetalLength_ = (double*) lefMalloc(sizeof(double));
-    antennaMetalLengthLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaPartialMetalArea_ = 0;
-    antennaPartialMetalAreaAllocated_ = 1;
-    antennaPartialMetalArea_ = (double*) lefMalloc(sizeof(double));
-    antennaPartialMetalAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaPartialMetalSideArea_ = 0;
-    antennaPartialMetalSideAreaAllocated_ = 1;
-    antennaPartialMetalSideArea_ = (double*) lefMalloc(sizeof(double));
-    antennaPartialMetalSideAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaPartialCutArea_ = 0;
-    antennaPartialCutAreaAllocated_ = 1;
-    antennaPartialCutArea_ = (double*) lefMalloc(sizeof(double));
-    antennaPartialCutAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-
-    numAntennaDiffArea_ = 0;
-    antennaDiffAreaAllocated_ = 1;
-    antennaDiffArea_ = (double*) lefMalloc(sizeof(double));
-    antennaDiffAreaLayer_ = (char**) lefMalloc(sizeof(char*));
-}
-
-lefiPin::~lefiPin()
-{
-    Destroy();
-}
-
-void
-lefiPin::Destroy()
-{
-
-    clear();
-    lefFree(name_);
-    lefFree((char*) (ports_));
-    lefFree(LEQ_);
-    lefFree(mustjoin_);
-    lefFree(lowTable_);
-    lefFree(highTable_);
-    if (propNames_)
-        lefFree((char*) (propNames_));
-    propNames_ = 0;
-    if (propValues_)
-        lefFree((char*) (propValues_));
-    propValues_ = 0;
-    if (propNums_)
-        lefFree((char*) (propNums_));
-    propNums_ = 0;
-    if (propTypes_)
-        lefFree((char*) (propTypes_));
-    propTypes_ = 0;
-    lefFree((char*) (antennaSize_));
-    lefFree((char*) (antennaSizeLayer_));
-    lefFree((char*) (antennaMetalArea_));
-    lefFree((char*) (antennaMetalAreaLayer_));
-    lefFree((char*) (antennaMetalLength_));
-    lefFree((char*) (antennaMetalLengthLayer_));
-    lefFree((char*) (antennaPartialMetalArea_));
-    lefFree((char*) (antennaPartialMetalAreaLayer_));
-    lefFree((char*) (antennaPartialMetalSideArea_));
-    lefFree((char*) (antennaPartialMetalSideAreaLayer_));
-    lefFree((char*) (antennaPartialCutArea_));
-    lefFree((char*) (antennaPartialCutAreaLayer_));
-    lefFree((char*) (antennaDiffArea_));
-    lefFree((char*) (antennaDiffAreaLayer_));
-    if (foreignAllocated_) {
-        lefFree((char*) (hasForeignOrient_));
-        lefFree((char*) (hasForeignPoint_));
-        lefFree((char*) (foreignOrient_));
-        lefFree((char*) (foreignX_));
-        lefFree((char*) (foreignY_));
-        lefFree((char*) (foreign_));
-        foreignAllocated_ = 0;
-    }
-}
-
-void
-lefiPin::clear()
-{
-    int                 i;
-    lefiGeometries      *g;
-    lefiPinAntennaModel *aModel;
-
-    for (i = 0; i < numPorts_; i++) {
-        g = ports_[i];
-        g->Destroy();
-        lefFree((char*) g);
-    }
-    numPorts_ = 0;
-    portsAllocated_ = 0;
-
-    hasLEQ_ = 0;
-    hasDirection_ = 0;
-    hasUse_ = 0;
-    hasShape_ = 0;
-    hasMustjoin_ = 0;
-    hasOutMargin_ = 0;
-    hasOutResistance_ = 0;
-    hasInMargin_ = 0;
-    hasPower_ = 0;
-    hasLeakage_ = 0;
-    hasMaxload_ = 0;
-    hasMaxdelay_ = 0;
-    hasCapacitance_ = 0;
-    hasResistance_ = 0;
-    hasPulldownres_ = 0;
-    hasTieoffr_ = 0;
-    hasVHI_ = 0;
-    hasVLO_ = 0;
-    hasRiseVoltage_ = 0;
-    hasFallVoltage_ = 0;
-    hasRiseThresh_ = 0;
-    hasFallThresh_ = 0;
-    hasRiseSatcur_ = 0;
-    hasFallSatcur_ = 0;
-    hasCurrentSource_ = 0;
-    hasRiseSlewLimit_ = 0;
-    hasFallSlewLimit_ = 0;
-    hasTables_ = 0;
-    strcpy(use_, "SIGNAL");
-
-    for (i = 0; i < numForeigns_; i++) {
-        hasForeignOrient_[i] = 0;
-        hasForeignPoint_[i] = 0;
-        foreignOrient_[i] = -1;
-        lefFree((char*) (foreign_[i]));
-    }
-    numForeigns_ = 0;
-
-    for (i = 0; i < numAntennaSize_; i++) {
-        if (antennaSizeLayer_[i])
-            lefFree(antennaSizeLayer_[i]);
-    }
-    numAntennaSize_ = 0;
-
-    for (i = 0; i < numAntennaMetalLength_; i++) {
-        if (antennaMetalLengthLayer_[i])
-            lefFree(antennaMetalLengthLayer_[i]);
-    }
-    numAntennaMetalLength_ = 0;
-
-    for (i = 0; i < numAntennaMetalArea_; i++) {
-        if (antennaMetalAreaLayer_[i])
-            lefFree(antennaMetalAreaLayer_[i]);
-    }
-    numAntennaMetalArea_ = 0;
-
-    for (i = 0; i < numAntennaPartialMetalArea_; i++) {
-        if (antennaPartialMetalAreaLayer_[i])
-            lefFree(antennaPartialMetalAreaLayer_[i]);
-    }
-    numAntennaPartialMetalArea_ = 0;
-
-    for (i = 0; i < numAntennaPartialMetalSideArea_; i++) {
-        if (antennaPartialMetalSideAreaLayer_[i])
-            lefFree(antennaPartialMetalSideAreaLayer_[i]);
-    }
-    numAntennaPartialMetalSideArea_ = 0;
-
-    for (i = 0; i < numAntennaPartialCutArea_; i++) {
-        if (antennaPartialCutAreaLayer_[i])
-            lefFree(antennaPartialCutAreaLayer_[i]);
-    }
-    numAntennaPartialCutArea_ = 0;
-
-    for (i = 0; i < numAntennaDiffArea_; i++) {
-        if (antennaDiffAreaLayer_[i])
-            lefFree(antennaDiffAreaLayer_[i]);
-    }
-    numAntennaDiffArea_ = 0;
-
-    if (numAntennaModel_ > 0) {
-        for (i = 0; i < 4; i++) {        // 5.5
-            aModel = antennaModel_[i];
-            aModel->Destroy();
-        }
-    }
-    for (i = 0; i < antennaModelAllocated_; i++) {  // 5.5
-        lefFree((char*) antennaModel_[i]);
-    }
-    if (antennaModel_)                              // 5.5
-        lefFree((char*) antennaModel_);
-    antennaModel_ = 0;             // 5.5
-    numAntennaModel_ = 0;          // 5.5
-    curAntennaModelIndex_ = 0;     // 5.5
-    antennaModelAllocated_ = 0;    // 5.5
-
-    for (i = 0; i < numProperties_; i++) {
-        lefFree(propNames_[i]);
-        lefFree(propValues_[i]);
-    }
-    numProperties_ = 0;
-    propertiesAllocated_ = 0;
-    if (taperRule_) {
-        lefFree(taperRule_);
-        taperRule_ = 0;
-    }
-    if (netEpxr_) {
-        lefFree(netEpxr_);
-        netEpxr_ = 0;
-    }
-    if (ssPinName_) {
-        lefFree(ssPinName_);
-        ssPinName_ = 0;
-    }
-    if (gsPinName_) {
-        lefFree(gsPinName_);
-        gsPinName_ = 0;
-    }
-}
-
-void
-lefiPin::bump(char  **array,
-              int   len,
-              int   *size)
-{
-    if (*array)
-        lefFree(*array);
-    if (len > 0)
-        *array = (char*) lefMalloc(len);
-    else
-        *array = 0;
-    *size = len;
-}
-
-
-void
-lefiPin::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    clear();
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiPin::addPort(lefiGeometries *g)
-{
-    if (numPorts_ == portsAllocated_) {
-        int             i;
-        lefiGeometries  **ng;
-        if (portsAllocated_ == 0)
-            portsAllocated_ = 2;
-        else
-            portsAllocated_ *= 2;
-        ng = (lefiGeometries**) lefMalloc(sizeof(lefiGeometries*) * portsAllocated_);
-        for (i = 0; i < numPorts_; i++)
-            ng[i] = ports_[i];
-        lefFree((char*) (ports_));
-        ports_ = ng;
-    }
-    ports_[numPorts_++] = g;
-}
-
-void
-lefiPin::addForeign(const char  *name,
-                    int         hasPnt,
-                    double      x,
-                    double      y,
-                    int         orient)
-{
-    int     i;
-    int     *hfo;
-    int     *hfp;
-    int     *fo;
-    double  *fx;
-    double  *fy;
-    char    **f;
-
-    if (foreignAllocated_ == numForeigns_) {
-        if (foreignAllocated_ == 0)
-            foreignAllocated_ = 16; // since it involves char*, it will
-            // costly in the number is too small
-        else
-            foreignAllocated_ *= 2;
-        hfo = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        hfp = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        fo = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        fx = (double*) lefMalloc(sizeof(double) * foreignAllocated_);
-        fy = (double*) lefMalloc(sizeof(double) * foreignAllocated_);
-        f = (char**) lefMalloc(sizeof(char*) * foreignAllocated_);
-        if (numForeigns_ != 0) {
-            for (i = 0; i < numForeigns_; i++) {
-                hfo[i] = hasForeignOrient_[i];
-                hfp[i] = hasForeignPoint_[i];
-                fo[i] = foreignOrient_[i];
-                fx[i] = foreignX_[i];
-                fy[i] = foreignY_[i];
-                f[i] = foreign_[i];
-            }
-            lefFree((char*) (hasForeignOrient_));
-            lefFree((char*) (hasForeignPoint_));
-            lefFree((char*) (foreignOrient_));
-            lefFree((char*) (foreignX_));
-            lefFree((char*) (foreignY_));
-            lefFree((char*) (foreign_));
-        }
-        hasForeignOrient_ = hfo;
-        hasForeignPoint_ = hfp;
-        foreignOrient_ = fo;
-        foreignX_ = fx;
-        foreignY_ = fy;
-        foreign_ = f;
-    }
-
-
-    // orient=-1 means no orient was specified.
-    if (orient != -1)
-        hasForeignOrient_[numForeigns_] = 1;
-    else
-        hasForeignOrient_[numForeigns_] = -1;
-
-    hasForeignPoint_[numForeigns_] = hasPnt;
-    foreignOrient_[numForeigns_] = orient;
-    foreignX_[numForeigns_] = x;
-    foreignY_[numForeigns_] = y;
-    foreign_[numForeigns_] = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(foreign_[numForeigns_], CASE(name));
-    numForeigns_ += 1;
-}
-
-void
-lefiPin::setLEQ(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > LEQSize_)
-        bump(&(LEQ_), len, &(LEQSize_));
-    strcpy(LEQ_, CASE(name));
-    hasLEQ_ = 1;
-}
-
-void
-lefiPin::setDirection(const char *name)
-{
-    strcpy(direction_, CASE(name));
-    hasDirection_ = 1;
-}
-
-void
-lefiPin::setUse(const char *name)
-{
-    strcpy(use_, CASE(name));
-    hasUse_ = 1;
-}
-
-void
-lefiPin::setShape(const char *name)
-{
-    strcpy(shape_, CASE(name));
-    hasShape_ = 1;
-}
-
-void
-lefiPin::setMustjoin(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > mustjoinSize_)
-        bump(&(mustjoin_), len, &(mustjoinSize_));
-    strcpy(mustjoin_, CASE(name));
-    hasMustjoin_ = 1;
-}
-
-void
-lefiPin::setOutMargin(double    high,
-                      double    low)
-{
-    outMarginH_ = high;
-    outMarginL_ = low;
-    hasOutMargin_ = 1;
-}
-
-void
-lefiPin::setOutResistance(double    high,
-                          double    low)
-{
-    outResistanceH_ = high;
-    outResistanceL_ = low;
-    hasOutResistance_ = 1;
-}
-
-void
-lefiPin::setInMargin(double high,
-                     double low)
-{
-    inMarginH_ = high;
-    inMarginL_ = low;
-    hasInMargin_ = 1;
-}
-
-void
-lefiPin::setPower(double power)
-{
-    power_ = power;
-    hasPower_ = 1;
-}
-
-void
-lefiPin::setLeakage(double current)
-{
-    leakage_ = current;
-    hasLeakage_ = 1;
-}
-
-void
-lefiPin::setMaxload(double capacitance)
-{
-    maxload_ = capacitance;
-    hasMaxload_ = 1;
-}
-
-void
-lefiPin::setMaxdelay(double dtime)
-{
-    maxdelay_ = dtime;
-    hasMaxdelay_ = 1;
-}
-
-void
-lefiPin::setCapacitance(double capacitance)
-{
-    capacitance_ = capacitance;
-    hasCapacitance_ = 1;
-}
-
-void
-lefiPin::setResistance(double resistance)
-{
-    resistance_ = resistance;
-    hasResistance_ = 1;
-}
-
-void
-lefiPin::setPulldownres(double resistance)
-{
-    pulldownres_ = resistance;
-    hasPulldownres_ = 1;
-}
-
-void
-lefiPin::setTieoffr(double resistance)
-{
-    tieoffr_ = resistance;
-    hasTieoffr_ = 1;
-}
-
-void
-lefiPin::setVHI(double voltage)
-{
-    VHI_ = voltage;
-    hasVHI_ = 1;
-}
-
-void
-lefiPin::setVLO(double voltage)
-{
-    VLO_ = voltage;
-    hasVLO_ = 1;
-}
-
-void
-lefiPin::setRiseVoltage(double voltage)
-{
-    riseVoltage_ = voltage;
-    hasRiseVoltage_ = 1;
-}
-
-void
-lefiPin::setFallVoltage(double voltage)
-{
-    fallVoltage_ = voltage;
-    hasFallVoltage_ = 1;
-}
-
-void
-lefiPin::setFallSlewLimit(double num)
-{
-    fallSlewLimit_ = num;
-    hasFallSlewLimit_ = 1;
-}
-
-void
-lefiPin::setRiseSlewLimit(double num)
-{
-    riseSlewLimit_ = num;
-    hasRiseSlewLimit_ = 1;
-}
-
-void
-lefiPin::setRiseThresh(double capacitance)
-{
-    riseThresh_ = capacitance;
-    hasRiseThresh_ = 1;
-}
-
-void
-lefiPin::setTaperRule(const char *name)
-{
-    int len = strlen(name) + 1;
-    taperRule_ = (char*) lefMalloc(len);
-    strcpy(taperRule_, name);
-}
-
-void
-lefiPin::setNetExpr(const char *name)
-{
-    netEpxr_ = strdup(name);
-}
-
-void
-lefiPin::setSupplySensitivity(const char *pinName)
-{
-    ssPinName_ = strdup(pinName);
-}
-
-void
-lefiPin::setGroundSensitivity(const char *pinName)
-{
-    gsPinName_ = strdup(pinName);
-}
-
-void
-lefiPin::setFallThresh(double capacitance)
-{
-    fallThresh_ = capacitance;
-    hasFallThresh_ = 1;
-}
-
-void
-lefiPin::setRiseSatcur(double current)
-{
-    riseSatcur_ = current;
-    hasRiseSatcur_ = 1;
-}
-
-void
-lefiPin::setFallSatcur(double current)
-{
-    fallSatcur_ = current;
-    hasFallSatcur_ = 1;
-}
-
-void
-lefiPin::setCurrentSource(const char *name)
-{
-    strcpy(currentSource_, CASE(name));
-    hasCurrentSource_ = 1;
-}
-
-void
-lefiPin::setTables(const char   *highName,
-                   const char   *lowName)
-{
-    int len = strlen(highName) + 1;
-    if (len > highTableSize_)
-        bump(&(highTable_), len, &(highTableSize_));
-    strcpy(highTable_, CASE(highName));
-    len = strlen(lowName) + 1;
-    if (len > lowTableSize_)
-        bump(&(lowTable_), len, &(lowTableSize_));
-    strcpy(lowTable_, CASE(lowName));
-    hasTables_ = 1;
-}
-
-void
-lefiPin::setProperty(const char *name,
-                     const char *value,
-                     const char type)
-{
-    int len;
-    if (numProperties_ == propertiesAllocated_)
-        bumpProps();
-    len = strlen(name) + 1;
-    propNames_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propNames_[numProperties_], CASE(name));
-    len = strlen(value) + 1;
-    propValues_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propValues_[numProperties_], CASE(value));
-    propNums_[numProperties_] = 0;
-    propTypes_[numProperties_] = type;
-    numProperties_ += 1;
-}
-
-void
-lefiPin::setNumProperty(const char  *name,
-                        double      d,
-                        const char  *value,
-                        const char  type)
-{
-    int len;
-
-    if (numProperties_ == propertiesAllocated_)
-        bumpProps();
-    len = strlen(name) + 1;
-    propNames_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propNames_[numProperties_], CASE(name));
-    len = strlen(value) + 1;
-    propValues_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propValues_[numProperties_], CASE(value));
-    propNums_[numProperties_] = d;
-    propTypes_[numProperties_] = type;
-    numProperties_ += 1;
-}
-
-void
-lefiPin::bumpProps()
-{
-    int     lim = propertiesAllocated_;
-    int     news;
-    char    **newpn;
-    char    **newpv;
-    double  *newd;
-    char    *newt;
-
-    news = lim ? lim + lim : 2;
-
-    newpn = (char**) lefMalloc(sizeof(char*) * news);
-    newpv = (char**) lefMalloc(sizeof(char*) * news);
-    newd = (double*) lefMalloc(sizeof(double) * news);
-    newt = (char*) lefMalloc(sizeof(char) * news);
-
-    lim = propertiesAllocated_ = news;
-
-    if (lim > 2) {
-        int i;
-        for (i = 0; i < numProperties_; i++) {
-            newpn[i] = propNames_[i];
-            newpv[i] = propValues_[i];
-            newd[i] = propNums_[i];
-            newt[i] = propTypes_[i];
-        }
-    }
-    if (propNames_)
-        lefFree((char*) (propNames_));
-    if (propValues_)
-        lefFree((char*) (propValues_));
-    if (propNums_)
-        lefFree((char*) (propNums_));
-    if (propTypes_)
-        lefFree((char*) (propTypes_));
-    propNames_ = newpn;
-    propValues_ = newpv;
-    propNums_ = newd;
-    propTypes_ = newt;
-}
-
-
-int
-lefiPin::hasForeign() const
-{
-    return (numForeigns_) ? 1 : 0;
-}
-
-int
-lefiPin::hasForeignOrient(int index) const
-{
-    return (hasForeignOrient_[index] == -1) ? 0 : 1;
-}
-
-int
-lefiPin::hasForeignPoint(int index) const
-{
-    return hasForeignPoint_[index];
-}
-
-int
-lefiPin::hasLEQ() const
-{
-    return hasLEQ_;
-}
-
-int
-lefiPin::hasDirection() const
-{
-    return hasDirection_;
-}
-
-int
-lefiPin::hasUse() const
-{
-    return hasUse_;
-}
-
-int
-lefiPin::hasShape() const
-{
-    return hasShape_;
-}
-
-int
-lefiPin::hasMustjoin() const
-{
-    return hasMustjoin_;
-}
-
-int
-lefiPin::hasOutMargin() const
-{
-    return hasOutMargin_;
-}
-
-int
-lefiPin::hasOutResistance() const
-{
-    return hasOutResistance_;
-}
-
-int
-lefiPin::hasInMargin() const
-{
-    return hasInMargin_;
-}
-
-int
-lefiPin::hasPower() const
-{
-    return hasPower_;
-}
-
-int
-lefiPin::hasLeakage() const
-{
-    return hasLeakage_;
-}
-
-int
-lefiPin::hasMaxload() const
-{
-    return hasMaxload_;
-}
-
-int
-lefiPin::hasMaxdelay() const
-{
-    return hasMaxdelay_;
-}
-
-int
-lefiPin::hasCapacitance() const
-{
-    return hasCapacitance_;
-}
-
-int
-lefiPin::hasResistance() const
-{
-    return hasResistance_;
-}
-
-int
-lefiPin::hasPulldownres() const
-{
-    return hasPulldownres_;
-}
-
-int
-lefiPin::hasTieoffr() const
-{
-    return hasTieoffr_;
-}
-
-int
-lefiPin::hasVHI() const
-{
-    return hasVHI_;
-}
-
-int
-lefiPin::hasVLO() const
-{
-    return hasVLO_;
-}
-
-int
-lefiPin::hasFallSlewLimit() const
-{
-    return hasFallSlewLimit_;
-}
-
-int
-lefiPin::hasRiseSlewLimit() const
-{
-    return hasRiseSlewLimit_;
-}
-
-int
-lefiPin::hasRiseVoltage() const
-{
-    return hasRiseVoltage_;
-}
-
-int
-lefiPin::hasFallVoltage() const
-{
-    return hasFallVoltage_;
-}
-
-int
-lefiPin::hasRiseThresh() const
-{
-    return hasRiseThresh_;
-}
-
-int
-lefiPin::hasFallThresh() const
-{
-    return hasFallThresh_;
-}
-
-int
-lefiPin::hasRiseSatcur() const
-{
-    return hasRiseSatcur_;
-}
-
-int
-lefiPin::hasFallSatcur() const
-{
-    return hasFallSatcur_;
-}
-
-int
-lefiPin::hasCurrentSource() const
-{
-    return hasCurrentSource_;
-}
-
-int
-lefiPin::hasTables() const
-{
-    return hasTables_;
-}
-
-int
-lefiPin::hasAntennaSize() const
-{
-    return numAntennaSize_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaMetalLength() const
-{
-    return numAntennaMetalLength_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaMetalArea() const
-{
-    return numAntennaMetalArea_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaPartialMetalArea() const
-{
-    return numAntennaPartialMetalArea_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaPartialMetalSideArea() const
-{
-    return numAntennaPartialMetalSideArea_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaPartialCutArea() const
-{
-    return numAntennaPartialCutArea_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaDiffArea() const
-{
-    return numAntennaDiffArea_ ? 1 : 0;
-}
-
-int
-lefiPin::hasAntennaModel() const
-{
-    return antennaModel_ ? 1 : 0;
-}
-
-int
-lefiPin::hasTaperRule() const
-{
-    return taperRule_ ? 1 : 0;
-}
-
-int
-lefiPin::hasNetExpr() const
-{
-    return netEpxr_ ? 1 : 0;
-}
-
-int
-lefiPin::hasSupplySensitivity() const
-{
-    return ssPinName_ ? 1 : 0;
-}
-
-int
-lefiPin::hasGroundSensitivity() const
-{
-    return gsPinName_ ? 1 : 0;
-}
-
-const char *
-lefiPin::name() const
-{
-    return name_;
-}
-
-const char *
-lefiPin::taperRule() const
-{
-    return taperRule_;
-}
-
-const char *
-lefiPin::netExpr() const
-{
-    return netEpxr_;
-}
-
-const char *
-lefiPin::supplySensitivity() const
-{
-    return ssPinName_;
-}
-
-const char *
-lefiPin::groundSensitivity() const
-{
-    return gsPinName_;
-}
-
-int
-lefiPin::numPorts() const
-{
-    return numPorts_;
-}
-
-lefiGeometries *
-lefiPin::port(int index) const
-{
-    char msg[160];
-    if (index < 0 || index > numPorts_) {
-        sprintf(msg, "ERROR (LEFPARS-1350): The index number %d given for the macro PIN is invalid.\nValid index is from 0 to %d", index, numPorts_);
-        lefiError(0, 1350, msg);
-        return 0;
-    }
-    return ports_[index];
-}
-
-int
-lefiPin::numForeigns() const
-{
-    return numForeigns_;
-}
-
-const char *
-lefiPin::foreignName(int index) const
-{
-    return foreign_[index];
-}
-
-int
-lefiPin::foreignOrient(int index) const
-{
-    return foreignOrient_[index];
-}
-
-const char *
-lefiPin::foreignOrientStr(int index) const
-{
-    return (lefiOrientStr(foreignOrient_[index]));
-}
-
-double
-lefiPin::foreignX(int index) const
-{
-    return foreignX_[index];
-}
-
-double
-lefiPin::foreignY(int index) const
-{
-    return foreignY_[index];
-}
-
-const char *
-lefiPin::LEQ() const
-{
-    return LEQ_;
-}
-
-const char *
-lefiPin::direction() const
-{
-    return direction_;
-}
-
-const char *
-lefiPin::use() const
-{
-    return use_;
-}
-
-const char *
-lefiPin::shape() const
-{
-    return shape_;
-}
-
-const char *
-lefiPin::mustjoin() const
-{
-    return mustjoin_;
-}
-
-double
-lefiPin::outMarginHigh() const
-{
-    return outMarginH_;
-}
-
-double
-lefiPin::outMarginLow() const
-{
-    return outMarginL_;
-}
-
-double
-lefiPin::outResistanceHigh() const
-{
-    return outResistanceH_;
-}
-
-double
-lefiPin::outResistanceLow() const
-{
-    return outResistanceL_;
-}
-
-double
-lefiPin::inMarginHigh() const
-{
-    return inMarginH_;
-}
-
-double
-lefiPin::inMarginLow() const
-{
-    return inMarginL_;
-}
-
-double
-lefiPin::power() const
-{
-    return power_;
-}
-
-double
-lefiPin::leakage() const
-{
-    return leakage_;
-}
-
-double
-lefiPin::maxload() const
-{
-    return maxload_;
-}
-
-double
-lefiPin::maxdelay() const
-{
-    return maxdelay_;
-}
-
-double
-lefiPin::capacitance() const
-{
-    return capacitance_;
-}
-
-double
-lefiPin::resistance() const
-{
-    return resistance_;
-}
-
-double
-lefiPin::pulldownres() const
-{
-    return pulldownres_;
-}
-
-double
-lefiPin::tieoffr() const
-{
-    return tieoffr_;
-}
-
-double
-lefiPin::VHI() const
-{
-    return VHI_;
-}
-
-double
-lefiPin::VLO() const
-{
-    return VLO_;
-}
-
-double
-lefiPin::fallSlewLimit() const
-{
-    return fallSlewLimit_;
-}
-
-double
-lefiPin::riseSlewLimit() const
-{
-    return riseSlewLimit_;
-}
-
-double
-lefiPin::riseVoltage() const
-{
-    return riseVoltage_;
-}
-
-double
-lefiPin::fallVoltage() const
-{
-    return fallVoltage_;
-}
-
-double
-lefiPin::riseThresh() const
-{
-    return riseThresh_;
-}
-
-double
-lefiPin::fallThresh() const
-{
-    return fallThresh_;
-}
-
-double
-lefiPin::riseSatcur() const
-{
-    return riseSatcur_;
-}
-
-double
-lefiPin::fallSatcur() const
-{
-    return fallSatcur_;
-}
-
-const char *
-lefiPin::currentSource() const
-{
-    return currentSource_;
-}
-
-const char *
-lefiPin::tableHighName() const
-{
-    return highTable_;
-}
-
-const char *
-lefiPin::tableLowName() const
-{
-    return lowTable_;
-}
-
-const char *
-lefiPin::antennaSizeLayer(int i) const
-{
-    return antennaSizeLayer_[i];
-}
-
-const char *
-lefiPin::antennaMetalAreaLayer(int i) const
-{
-    return antennaMetalAreaLayer_[i];
-}
-
-const char *
-lefiPin::antennaMetalLengthLayer(int i) const
-{
-    return antennaMetalLengthLayer_[i];
-}
-
-const char *
-lefiPin::antennaPartialMetalAreaLayer(int i) const
-{
-    return antennaPartialMetalAreaLayer_[i];
-}
-
-const char *
-lefiPin::antennaPartialMetalSideAreaLayer(int i) const
-{
-    return antennaPartialMetalSideAreaLayer_[i];
-}
-
-const char *
-lefiPin::antennaPartialCutAreaLayer(int i) const
-{
-    return antennaPartialCutAreaLayer_[i];
-}
-
-const char *
-lefiPin::antennaDiffAreaLayer(int i) const
-{
-    return antennaDiffAreaLayer_[i];
-}
-
-int
-lefiPin::numAntennaSize() const
-{
-    return numAntennaSize_;
-}
-
-int
-lefiPin::numAntennaMetalArea() const
-{
-    return numAntennaMetalArea_;
-}
-
-int
-lefiPin::numAntennaMetalLength() const
-{
-    return numAntennaMetalLength_;
-}
-
-int
-lefiPin::numAntennaPartialMetalArea() const
-{
-    return numAntennaPartialMetalArea_;
-}
-
-int
-lefiPin::numAntennaPartialMetalSideArea() const
-{
-    return numAntennaPartialMetalSideArea_;
-}
-
-int
-lefiPin::numAntennaPartialCutArea() const
-{
-    return numAntennaPartialCutArea_;
-}
-
-int
-lefiPin::numAntennaDiffArea() const
-{
-    return numAntennaDiffArea_;
-}
-
-double
-lefiPin::antennaSize(int i) const
-{
-    return antennaSize_[i];
-}
-
-double
-lefiPin::antennaMetalArea(int i) const
-{
-    return antennaMetalArea_[i];
-}
-
-double
-lefiPin::antennaMetalLength(int i) const
-{
-    return antennaMetalLength_[i];
-}
-
-double
-lefiPin::antennaPartialMetalArea(int i) const
-{
-    return antennaPartialMetalArea_[i];
-}
-
-double
-lefiPin::antennaPartialMetalSideArea(int i) const
-{
-    return antennaPartialMetalSideArea_[i];
-}
-
-double
-lefiPin::antennaPartialCutArea(int i) const
-{
-    return antennaPartialCutArea_[i];
-}
-
-double
-lefiPin::antennaDiffArea(int i) const
-{
-    return antennaDiffArea_[i];
-}
-
-void
-lefiPin::addAntennaMetalLength(double       val,
-                               const char   *layer)
-{
-    int len;
-    if (numAntennaMetalLength_ == antennaMetalLengthAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaMetalLength_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaMetalLengthAllocated_ == 0)
-            max = antennaMetalLengthAllocated_ = 2;
-        else
-            max = antennaMetalLengthAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaMetalLengthLayer_[i];
-            nd[i] = antennaMetalLength_[i];
-        }
-        lefFree((char*) (antennaMetalLengthLayer_));
-        lefFree((char*) (antennaMetalLength_));
-        antennaMetalLengthLayer_ = nl;
-        antennaMetalLength_ = nd;
-    }
-    antennaMetalLength_[numAntennaMetalLength_] = val;
-    if (layer) {    // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaMetalLengthLayer_[numAntennaMetalLength_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaMetalLengthLayer_[numAntennaMetalLength_],
-               layer);
-    } else
-        antennaMetalLengthLayer_[numAntennaMetalLength_] = NULL;
-    numAntennaMetalLength_ += 1;
-}
-
-// 5.5
-void
-lefiPin::addAntennaModel(int oxide)
-{
-    // For version 5.5 only OXIDE1, OXIDE2, OXIDE3, & OXIDE4
-    // are defined within a macro pin
-    lefiPinAntennaModel *amo;
-    int                 i;
-
-    if (numAntennaModel_ == 0) {   // does not have antennaModel
-        antennaModel_ = (lefiPinAntennaModel**)
-            lefMalloc(sizeof(lefiPinAntennaModel*) * 4);
-        antennaModelAllocated_ = 4;
-        for (i = 0; i < 4; i++) {
-            antennaModel_[i] = (lefiPinAntennaModel*)
-                lefMalloc(sizeof(lefiPinAntennaModel));
-            antennaModel_[i]->setAntennaModel(0);
-            // just initialize it first
-        }
-        antennaModelAllocated_ = 4;
-        amo = antennaModel_[0];
-        curAntennaModelIndex_ = 0;
-    } 
-
-    // First can go any oxide, so fill pref oxides models.
-    for (int idx = 0; idx < oxide - 1; idx++) {
-        amo = antennaModel_[idx];
-        if (!amo->antennaOxide()) {
-            amo->Init();
-            amo->setAntennaModel(idx + 1);   
-        }
-    }
-
-        amo = antennaModel_[oxide - 1];
-        curAntennaModelIndex_ = oxide - 1;
-        // Oxide has not defined yet
-    if (amo->antennaOxide()) {
-            amo->clear();
-        }
-
-    if (oxide > numAntennaModel_) {
-        numAntennaModel_ = oxide;
-    }
-
-    amo->Init();
-    amo->setAntennaModel(oxide);
-    return;
-}
-
-// 5.5
-int
-lefiPin::numAntennaModel() const
-{
-    return numAntennaModel_;
-}
-
-// 5.5
-lefiPinAntennaModel *
-lefiPin::antennaModel(int index) const
-{
-    int                 j = index;
-    lefiPinAntennaModel *amo;
-
-    if (index == 0) {   // reset all the return flags to 0, beginning of the loop
-        int i;
-        for (i = 0; i < 4; i++)
-            antennaModel_[i]->setAntennaReturnFlag(0);
-    }
-    while (j < 4) {
-        amo = antennaModel_[j];
-        if (!(amo->antennaOxide()) &&
-            (amo->hasReturn() == 0))
-            j++;
-        else
-            break;
-        if (j == 4) {  // something very wrong, normally this can't happen
-            lefiError(0, 1351, "ERROR (LEFPARS-1351): There is an unexpected lef parser bug which cause it unable to retrieve ANTENNAMODEL data with the given index.");
-            return 0;
-        }
-    }
-    // If it arrived here, it is saved, mark the antennaModel has returned
-    antennaModel_[j]->setAntennaReturnFlag(1);
-    return antennaModel_[j];
-}
-
-void
-lefiPin::addAntennaSize(double      val,
-                        const char  *layer)
-{
-    int len;
-    if (numAntennaSize_ == antennaSizeAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaSize_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaSizeAllocated_ == 0)
-            max = antennaSizeAllocated_ = 2;
-        else
-            max = antennaSizeAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaSizeLayer_[i];
-            nd[i] = antennaSize_[i];
-        }
-        lefFree((char*) (antennaSizeLayer_));
-        lefFree((char*) (antennaSize_));
-        antennaSizeLayer_ = nl;
-        antennaSize_ = nd;
-    }
-    antennaSize_[numAntennaSize_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaSizeLayer_[numAntennaSize_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaSizeLayer_[numAntennaSize_],
-               layer);
-    } else
-        antennaSizeLayer_[numAntennaSize_] = NULL;
-    numAntennaSize_ += 1;
-}
-
-void
-lefiPin::addAntennaMetalArea(double     val,
-                             const char *layer)
-{
-    int len;
-    if (numAntennaMetalArea_ == antennaMetalAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaMetalArea_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaMetalAreaAllocated_ == 0)
-            max = antennaMetalAreaAllocated_ = 2;
-        else
-            max = antennaMetalAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaMetalAreaLayer_[i];
-            nd[i] = antennaMetalArea_[i];
-        }
-        lefFree((char*) (antennaMetalAreaLayer_));
-        lefFree((char*) (antennaMetalArea_));
-        antennaMetalAreaLayer_ = nl;
-        antennaMetalArea_ = nd;
-    }
-    antennaMetalArea_[numAntennaMetalArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaMetalAreaLayer_[numAntennaMetalArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaMetalAreaLayer_[numAntennaMetalArea_],
-               layer);
-    } else
-        antennaMetalAreaLayer_[numAntennaMetalArea_] = NULL;
-    numAntennaMetalArea_ += 1;
-}
-
-void
-lefiPin::addAntennaPartialMetalArea(double      val,
-                                    const char  *layer)
-{
-    int len;
-    if (numAntennaPartialMetalArea_ == antennaPartialMetalAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaPartialMetalArea_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaPartialMetalAreaAllocated_ == 0)
-            max = antennaPartialMetalAreaAllocated_ = 2;
-        else
-            max = antennaPartialMetalAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaPartialMetalAreaLayer_[i];
-            nd[i] = antennaPartialMetalArea_[i];
-        }
-        lefFree((char*) (antennaPartialMetalAreaLayer_));
-        lefFree((char*) (antennaPartialMetalArea_));
-        antennaPartialMetalAreaLayer_ = nl;
-        antennaPartialMetalArea_ = nd;
-    }
-    antennaPartialMetalArea_[numAntennaPartialMetalArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_],
-               layer);
-    } else
-        antennaPartialMetalAreaLayer_[numAntennaPartialMetalArea_] = NULL;
-    numAntennaPartialMetalArea_ += 1;
-}
-
-void
-lefiPin::addAntennaPartialMetalSideArea(double      val,
-                                        const char  *layer)
-{
-    int len;
-    if (numAntennaPartialMetalSideArea_ == antennaPartialMetalSideAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaPartialMetalSideArea_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaPartialMetalSideAreaAllocated_ == 0)
-            max = antennaPartialMetalSideAreaAllocated_ = 2;
-        else
-            max = antennaPartialMetalSideAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaPartialMetalSideAreaLayer_[i];
-            nd[i] = antennaPartialMetalSideArea_[i];
-        }
-        lefFree((char*) (antennaPartialMetalSideAreaLayer_));
-        lefFree((char*) (antennaPartialMetalSideArea_));
-        antennaPartialMetalSideAreaLayer_ = nl;
-        antennaPartialMetalSideArea_ = nd;
-    }
-    antennaPartialMetalSideArea_[numAntennaPartialMetalSideArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_],
-               layer);
-    } else
-        antennaPartialMetalSideAreaLayer_[numAntennaPartialMetalSideArea_] = NULL;
-    numAntennaPartialMetalSideArea_ += 1;
-}
-
-void
-lefiPin::addAntennaPartialCutArea(double        val,
-                                  const char    *layer)
-{
-    int len;
-    if (numAntennaPartialCutArea_ == antennaPartialCutAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaPartialCutArea_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaPartialCutAreaAllocated_ == 0)
-            max = antennaPartialCutAreaAllocated_ = 2;
-        else
-            max = antennaPartialCutAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaPartialCutAreaLayer_[i];
-            nd[i] = antennaPartialCutArea_[i];
-        }
-        lefFree((char*) (antennaPartialCutAreaLayer_));
-        lefFree((char*) (antennaPartialCutArea_));
-        antennaPartialCutAreaLayer_ = nl;
-        antennaPartialCutArea_ = nd;
-    }
-    antennaPartialCutArea_[numAntennaPartialCutArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaPartialCutAreaLayer_[numAntennaPartialCutArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaPartialCutAreaLayer_[numAntennaPartialCutArea_],
-               layer);
-    } else
-        antennaPartialCutAreaLayer_[numAntennaPartialCutArea_] = NULL;
-    numAntennaPartialCutArea_ += 1;
-}
-
-void
-lefiPin::addAntennaDiffArea(double      val,
-                            const char  *layer)
-{
-    int len;
-    if (numAntennaDiffArea_ == antennaDiffAreaAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numAntennaDiffArea_;
-        double  *nd;
-        char    **nl;
-
-        if (antennaDiffAreaAllocated_ == 0)
-            max = antennaDiffAreaAllocated_ = 2;
-        else
-            max = antennaDiffAreaAllocated_ *= 2;
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nl = (char**) lefMalloc(sizeof(double) * max);
-        for (i = 0; i < lim; i++) {
-            nl[i] = antennaDiffAreaLayer_[i];
-            nd[i] = antennaDiffArea_[i];
-        }
-        lefFree((char*) (antennaDiffAreaLayer_));
-        lefFree((char*) (antennaDiffArea_));
-        antennaDiffAreaLayer_ = nl;
-        antennaDiffArea_ = nd;
-    }
-    antennaDiffArea_[numAntennaDiffArea_] = val;
-    if (layer) {  // layer can be null, since it is optional
-        len = strlen(layer) + 1;
-        antennaDiffAreaLayer_[numAntennaDiffArea_] =
-            (char*) lefMalloc(len);
-        strcpy(antennaDiffAreaLayer_[numAntennaDiffArea_],
-               layer);
-    } else
-        antennaDiffAreaLayer_[numAntennaDiffArea_] = NULL;
-    numAntennaDiffArea_ += 1;
-}
-
-void
-lefiPin::addAntennaGateArea(double      val,
-                            const char  *layer)
-{
-    if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-        addAntennaModel(1);
-    antennaModel_[curAntennaModelIndex_]->addAntennaGateArea(val, layer);
-}
-
-void
-lefiPin::addAntennaMaxAreaCar(double        val,
-                              const char    *layer)
-{
-    if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-        addAntennaModel(1);
-    antennaModel_[curAntennaModelIndex_]->addAntennaMaxAreaCar(val,
-                                                               layer);
-}
-
-void
-lefiPin::addAntennaMaxSideAreaCar(double        val,
-                                  const char    *layer)
-{
-    if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-        addAntennaModel(1);
-    antennaModel_[curAntennaModelIndex_]->addAntennaMaxSideAreaCar(val,
-                                                                   layer);
-}
-
-void
-lefiPin::addAntennaMaxCutCar(double     val,
-                             const char *layer)
-{
-    if (numAntennaModel_ == 0)    // haven't created any antennaModel yet
-        addAntennaModel(1);
-    antennaModel_[curAntennaModelIndex_]->addAntennaMaxCutCar(val,
-                                                              layer);
-}
-
-int
-lefiPin::numProperties() const
-{
-    return numProperties_;
-}
-
-const char *
-lefiPin::propName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNames_[index];
-}
-
-const char *
-lefiPin::propValue(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propValues_[index];
-}
-
-double
-lefiPin::propNum(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index];
-}
-
-const char
-lefiPin::propType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propTypes_[index];
-}
-
-int
-lefiPin::propIsNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index] ? 1 : 0;
-}
-
-int
-lefiPin::propIsString(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index] ? 0 : 1;
-}
-
-void
-lefiPin::print(FILE *f) const
-{
-    int             i;
-    lefiGeometries  *g;
-
-    fprintf(f, "  Pin %s\n", name());
-
-    for (i = 0; i < numPorts(); i++) {
-        fprintf(f, "    Port %d ", i);
-        g = port(i);
-        g->print(f);
-    }
-
-}
-
-// *****************************************************************************
-// lefiMacro
-// *****************************************************************************
-
-lefiMacro::lefiMacro()
-: nameSize_(0),
-  name_(NULL),
-  generatorSize_(0),
-  generator_(NULL),
-  hasClass_(0),
-  hasGenerator_(0),
-  hasGenerate_(0),
-  hasPower_(0),
-  hasOrigin_(0),
-  hasSource_(0),
-  hasEEQ_(0),
-  hasLEQ_(0),
-  hasSymmetry_(0),
-  hasSiteName_(0),
-  hasSize_(0),
-  hasClockType_(0),
-  isBuffer_(0),
-  isInverter_(0),
-  EEQ_(NULL),
-  EEQSize_(0),
-  LEQ_(NULL),
-  LEQSize_(0),
-  gen1_(NULL),
-  gen1Size_(0),
-  gen2_(NULL),
-  gen2Size_(0),
-  power_(0.0),
-  originX_(0.0),
-  originY_(0.0),
-  sizeX_(0.0),
-  sizeY_(0.0),
-  numSites_(0),
-  sitesAllocated_(0),
-  pattern_(NULL),
-  numForeigns_(0),
-  foreignAllocated_(0),
-  hasForeignOrigin_(NULL),
-  hasForeignPoint_(NULL),
-  foreignOrient_(NULL),
-  foreignX_(NULL),
-  foreignY_(NULL),
-  foreign_(NULL),
-  siteNameSize_(0),
-  siteName_(NULL),
-  clockType_(NULL),
-  clockTypeSize_(0),
-  numProperties_(0),
-  propertiesAllocated_(0),
-  propNames_(NULL),
-  propValues_(NULL),
-  propNums_(NULL),
-  propTypes_(NULL),
-  isFixedMask_(0)
-{
-    Init();
-}
-
-void
-lefiMacro::Init()
-{
-    name_ = 0;
-    generator_ = 0;
-    EEQ_ = 0;
-    LEQ_ = 0;
-    gen1_ = 0;
-    gen2_ = 0;
-    foreign_ = 0;
-    siteName_ = 0;
-    clockType_ = 0;
-    propNames_ = 0;
-    propValues_ = 0;
-    propTypes_ = 0;
-
-    bump(&(name_), 16, &(nameSize_));
-    bump(&(generator_), 16, &(generatorSize_));
-    bump(&(EEQ_), 16, &(EEQSize_));
-    bump(&(LEQ_), 16, &(LEQSize_));
-    bump(&(gen1_), 16, &(gen1Size_));
-    bump(&(gen2_), 16, &(gen2Size_));
-    bump(&(siteName_), 16, &(siteNameSize_));
-    bump(&(clockType_), 16, &(clockTypeSize_));
-
-    propertiesAllocated_ = 2;
-    numProperties_ = 0;
-    propNames_ = (char**) lefMalloc(sizeof(char*) * 2);
-    propValues_ = (char**) lefMalloc(sizeof(char*) * 2);
-    propNums_ = (double*) lefMalloc(sizeof(double) * 2);
-    propTypes_ = (char*) lefMalloc(sizeof(char) * 2);
-
-    numSites_ = 0;
-    sitesAllocated_ = 0;
-    pattern_ = 0;
-    numForeigns_ = 0;
-    foreignAllocated_ = 0;
-    isFixedMask_ = 0;
-
-    clear();
-}
-
-void
-lefiMacro::Destroy()
-{
-    clear();
-    lefFree(name_);
-    lefFree(generator_);
-    lefFree(EEQ_);
-    lefFree(LEQ_);
-    lefFree(gen1_);
-    lefFree(gen2_);
-    lefFree(siteName_);
-    lefFree(clockType_);
-    lefFree((char*) (propNames_));
-    lefFree((char*) (propValues_));
-    lefFree((char*) (propNums_));
-    lefFree((char*) (propTypes_));
-    if (foreignAllocated_) {
-        lefFree((char*) (hasForeignOrigin_));
-        lefFree((char*) (hasForeignPoint_));
-        lefFree((char*) (foreignOrient_));
-        lefFree((char*) (foreignX_));
-        lefFree((char*) (foreignY_));
-        lefFree((char*) (foreign_));
-        foreignAllocated_ = 0;
-    }
-}
-
-lefiMacro::~lefiMacro()
-{
-    Destroy();
-}
-
-void
-lefiMacro::clear()
-{
-    int i;
-
-    hasClass_ = 0;
-    hasGenerator_ = 0;
-    hasGenerate_ = 0;
-    hasPower_ = 0;
-    hasOrigin_ = 0;
-    hasSource_ = 0;
-    hasEEQ_ = 0;
-    hasLEQ_ = 0;
-    hasSymmetry_ = 0;
-    hasSiteName_ = 0;
-    hasClockType_ = 0;
-    hasSize_ = 0;
-    isInverter_ = 0;
-    isBuffer_ = 0;
-
-    for (i = 0; i < numForeigns_; i++) {
-        hasForeignOrigin_[i] = 0;
-        hasForeignPoint_[i] = 0;
-        foreignOrient_[i] = -1;
-        lefFree((char*) (foreign_[i]));
-    }
-    numForeigns_ = 0;
-
-    if (pattern_) {
-        for (i = 0; i < numSites_; i++) {
-            pattern_[i]->Destroy();
-            lefFree((char*) (pattern_[i]));
-        }
-        numSites_ = 0;
-        sitesAllocated_ = 0;
-        lefFree((char*) (pattern_));
-        pattern_ = 0;
-    }
-
-    for (i = 0; i < numProperties_; i++) {
-        lefFree(propNames_[i]);
-        lefFree(propValues_[i]);
-    }
-
-    numProperties_ = 0;
-    isFixedMask_ = 0;
-}
-
-void
-lefiMacro::bump(char    **array,
-                int     len,
-                int     *size)
-{
-    if (*array)
-        lefFree(*array);
-    if (len)
-        *array = (char*) lefMalloc(len);
-    else
-        *array = 0;
-    *size = len;
-}
-
-void
-lefiMacro::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_)
-        bump(&(name_), len, &(nameSize_));
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiMacro::setGenerate(const char   *name,
-                       const char   *n2)
-{
-    int len = strlen(name) + 1;
-    if (len > gen1Size_)
-        bump(&(gen1_), len, &(gen1Size_));
-    strcpy(gen1_, CASE(name));
-    len = strlen(n2) + 1;
-    if (len > gen2Size_)
-        bump(&(gen2_), len, &(gen2Size_));
-    strcpy(gen2_, n2);
-}
-
-void
-lefiMacro::setGenerator(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > generatorSize_)
-        bump(&(generator_), len, &(generatorSize_));
-    strcpy(generator_, CASE(name));
-    hasGenerator_ = 1;
-}
-
-void
-lefiMacro::setInverter()
-{
-    isInverter_ = 1;
-}
-
-void
-lefiMacro::setBuffer()
-{
-    isBuffer_ = 1;
-}
-
-void
-lefiMacro::setSource(const char *name)
-{
-    strcpy(source_, CASE(name));
-    hasSource_ = 1;
-}
-
-void
-lefiMacro::setClass(const char *name)
-{
-    strcpy(macroClass_, CASE(name));
-    hasClass_ = 1;
-}
-
-void
-lefiMacro::setOrigin(double x,
-                     double y)
-{
-    originX_ = x;
-    originY_ = y;
-    hasOrigin_ = 1;
-}
-
-void
-lefiMacro::setPower(double p)
-{
-    power_ = p;
-    hasPower_ = 1;
-}
-
-void
-lefiMacro::setEEQ(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > EEQSize_)
-        bump(&(EEQ_), len, &(EEQSize_));
-    strcpy(EEQ_, CASE(name));
-    hasEEQ_ = 1;
-}
-
-void
-lefiMacro::setLEQ(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > LEQSize_)
-        bump(&(LEQ_), len, &(LEQSize_));
-    strcpy(LEQ_, CASE(name));
-    hasLEQ_ = 1;
-}
-
-void
-lefiMacro::setProperty(const char   *name,
-                       const char   *value,
-                       const char   type)
-{
-    int len;
-    if (numProperties_ == propertiesAllocated_)
-        bumpProps();
-    len = strlen(name) + 1;
-    propNames_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propNames_[numProperties_], CASE(name));
-    len = strlen(value) + 1;
-    propValues_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propValues_[numProperties_], CASE(value));
-    propNums_[numProperties_] = 0.0;
-    propTypes_[numProperties_] = type;
-    numProperties_ += 1;
-}
-
-void
-lefiMacro::setNumProperty(const char    *name,
-                          double        d,
-                          const char    *value,
-                          const char    type)
-{
-    int len;
-
-    if (numProperties_ == propertiesAllocated_)
-        bumpProps();
-    len = strlen(name) + 1;
-    propNames_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propNames_[numProperties_], CASE(name));
-    len = strlen(value) + 1;
-    propValues_[numProperties_] = (char*) lefMalloc(len);
-    strcpy(propValues_[numProperties_], CASE(value));
-    propNums_[numProperties_] = d;
-    propTypes_[numProperties_] = type;
-    numProperties_ += 1;
-}
-
-
-void
-lefiMacro::bumpProps()
-{
-    int     lim;
-    int     news;
-    char    **newpn;
-    char    **newpv;
-    double  *newd;
-    char    *newt;
-    int     i;
-
-    if (propertiesAllocated_ <= 0)
-        lim = 2;                 // starts with 4
-    else
-        lim = propertiesAllocated_;
-    news = lim + lim;
-    newpn = (char**) lefMalloc(sizeof(char*) * news);
-    newpv = (char**) lefMalloc(sizeof(char*) * news);
-    newd = (double*) lefMalloc(sizeof(double) * news);
-    newt = (char*) lefMalloc(sizeof(char) * news);
-
-    propertiesAllocated_ = news;
-
-    for (i = 0; i < lim; i++) {
-        newpn[i] = propNames_[i];
-        newpv[i] = propValues_[i];
-        newd[i] = propNums_[i];
-        newt[i] = propTypes_[i];
-    }
-    lefFree((char*) (propNames_));
-    lefFree((char*) (propValues_));
-    lefFree((char*) (propNums_));
-    lefFree((char*) (propTypes_));
-    propNames_ = newpn;
-    propValues_ = newpv;
-    propNums_ = newd;
-    propTypes_ = newt;
-}
-
-void
-lefiMacro::setFixedMask(int isFixedMask)
-{
-    isFixedMask_ = isFixedMask;
-}
-
-int
-lefiMacro::isFixedMask() const
-{
-    return isFixedMask_;
-}
-
-void
-lefiMacro::addForeign(const char    *name,
-                      int           hasPnt,
-                      double        x,
-                      double        y,
-                      int           orient)
-{
-    int     i;
-    int     *hfo;
-    int     *hfp;
-    int     *fo;
-    double  *fx;
-    double  *fy;
-    char    **f;
-
-    if (foreignAllocated_ == numForeigns_) {
-        if (foreignAllocated_ == 0)
-            foreignAllocated_ = 16; // since it involves char*, it will
-            // costly in the number is too small
-        else
-            foreignAllocated_ *= 2;
-        hfo = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        hfp = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        fo = (int*) lefMalloc(sizeof(int) * foreignAllocated_);
-        fx = (double*) lefMalloc(sizeof(double) * foreignAllocated_);
-        fy = (double*) lefMalloc(sizeof(double) * foreignAllocated_);
-        f = (char**) lefMalloc(sizeof(char*) * foreignAllocated_);
-        if (numForeigns_ != 0) {
-            for (i = 0; i < numForeigns_; i++) {
-                hfo[i] = hasForeignOrigin_[i];
-                hfp[i] = hasForeignPoint_[i];
-                fo[i] = foreignOrient_[i];
-                fx[i] = foreignX_[i];
-                fy[i] = foreignY_[i];
-                f[i] = foreign_[i];
-            }
-            lefFree((char*) (hasForeignOrigin_));
-            lefFree((char*) (hasForeignPoint_));
-            lefFree((char*) (foreignOrient_));
-            lefFree((char*) (foreignX_));
-            lefFree((char*) (foreignY_));
-            lefFree((char*) (foreign_));
-        }
-        hasForeignOrigin_ = hfo;
-        hasForeignPoint_ = hfp;
-        foreignOrient_ = fo;
-        foreignX_ = fx;
-        foreignY_ = fy;
-        foreign_ = f;
-    }
-
-    // orient=-1 means no orient was specified.
-    hasForeignOrigin_[numForeigns_] = orient;
-    hasForeignPoint_[numForeigns_] = hasPnt;
-    foreignOrient_[numForeigns_] = orient;
-    foreignX_[numForeigns_] = x;
-    foreignY_[numForeigns_] = y;
-    foreign_[numForeigns_] = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(foreign_[numForeigns_], CASE(name));
-    numForeigns_ += 1;
-
-}
-
-    
-void
-lefiMacro::setXSymmetry()
-{
-    hasSymmetry_ |= 1;
-}
-
-void
-lefiMacro::setYSymmetry()
-{
-    hasSymmetry_ |= 2;
-}
-
-void
-lefiMacro::set90Symmetry()
-{
-    hasSymmetry_ |= 4;
-}
-
-void
-lefiMacro::setSiteName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > siteNameSize_)
-        bump(&(siteName_), len, &(siteNameSize_));
-    strcpy(siteName_, CASE(name));
-    hasSiteName_ = 1;
-}
-
-void
-lefiMacro::setClockType(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > clockTypeSize_)
-        bump(&(clockType_), len, &(clockTypeSize_));
-    strcpy(clockType_, CASE(name));
-    hasClockType_ = 1;
-}
-
-void
-lefiMacro::setSitePattern(lefiSitePattern *p)
-{
-    if (numSites_ == sitesAllocated_) {
-        lefiSitePattern **np;
-        int             i, lim;
-        if (sitesAllocated_ == 0) {
-            lim = sitesAllocated_ = 4;
-            np = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) * lim);
-        } else {
-            lim = sitesAllocated_ * 2;
-            sitesAllocated_ = lim;
-            np = (lefiSitePattern**) lefMalloc(sizeof(lefiSitePattern*) * lim);
-            lim /= 2;
-            for (i = 0; i < lim; i++)
-                np[i] = pattern_[i];
-            lefFree((char*) (pattern_));
-        }
-        pattern_ = np;
-    }
-    pattern_[numSites_] = p;
-    numSites_ += 1;
-}
-
-void
-lefiMacro::setSize(double   x,
-                   double   y)
-{
-    hasSize_ = 1;
-    sizeX_ = x;
-    sizeY_ = y;
-}
-    
-
-int
-lefiMacro::hasClass() const
-{
-    return hasClass_;
-}
-
-int
-lefiMacro::hasSiteName() const
-{
-    return hasSiteName_;
-}
-
-int
-lefiMacro::hasGenerator() const
-{
-    return hasGenerator_;
-}
-
-int
-lefiMacro::hasGenerate() const
-{
-    return hasGenerate_;
-}
-
-int
-lefiMacro::hasPower() const
-{
-    return hasPower_;
-}
-
-int
-lefiMacro::hasOrigin() const
-{
-    return hasOrigin_;
-}
-
-int
-lefiMacro::hasSource() const
-{
-    return hasSource_;
-}
-
-int
-lefiMacro::hasEEQ() const
-{
-    return hasEEQ_;
-}
-
-int
-lefiMacro::hasLEQ() const
-{
-    return hasLEQ_;
-}
-
-int
-lefiMacro::hasXSymmetry() const
-{
-    return (hasSymmetry_ & 1) ? 1 : 0;
-}
-
-int
-lefiMacro::hasYSymmetry() const
-{
-    return (hasSymmetry_ & 2) ? 1 : 0;
-}
-
-int
-lefiMacro::has90Symmetry() const
-{
-    return (hasSymmetry_ & 4) ? 1 : 0;
-}
-
-int
-lefiMacro::hasSitePattern() const
-{
-    return (pattern_) ? 1 : 0;
-}
-
-int
-lefiMacro::hasSize() const
-{
-    return hasSize_;
-}
-
-int
-lefiMacro::hasForeign() const
-{
-    return (numForeigns_) ? 1 : 0;
-}
-
-int
-lefiMacro::hasForeignOrigin(int index) const
-{
-    return hasForeignOrigin_[index];
-}
-
-int
-lefiMacro::hasForeignOrient(int index) const
-{
-    return (foreignOrient_[index] == -1) ? 0 : 1;
-}
-
-int
-lefiMacro::hasForeignPoint(int index) const
-{
-    return hasForeignPoint_[index];
-}
-
-int
-lefiMacro::hasClockType() const
-{
-    return hasClockType_;
-}
-
-int
-lefiMacro::numSitePattern() const
-{
-    return numSites_;
-}
-
-int
-lefiMacro::numProperties() const
-{
-    return numProperties_;
-}
-
-const char *
-lefiMacro::propName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNames_[index];
-}
-
-const char *
-lefiMacro::propValue(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propValues_[index];
-}
-
-double
-lefiMacro::propNum(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index];
-}
-
-const char
-lefiMacro::propType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propTypes_[index];
-}
-
-int
-lefiMacro::propIsNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index] ? 1 : 0;
-}
-
-int
-lefiMacro::propIsString(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProperties_) {
-        sprintf(msg, "ERROR (LEFPARS-1352): The index number %d given for the macro property is invalid.\nValid index is from 0 to %d", index, numProperties_);
-        lefiError(0, 1352, msg);
-        return 0;
-    }
-    return propNums_[index] ? 0 : 1;
-}
-
-const char *
-lefiMacro::name() const
-{
-    return name_;
-}
-
-const char *
-lefiMacro::macroClass() const
-{
-    return macroClass_;
-}
-
-const char *
-lefiMacro::generator() const
-{
-    return generator_;
-}
-
-const char *
-lefiMacro::EEQ() const
-{
-    return EEQ_;
-}
-
-const char *
-lefiMacro::LEQ() const
-{
-    return LEQ_;
-}
-
-const char *
-lefiMacro::source() const
-{
-    return source_;
-}
-
-double
-lefiMacro::originX() const
-{
-    return originX_;
-}
-
-double
-lefiMacro::originY() const
-{
-    return originY_;
-}
-
-double
-lefiMacro::power() const
-{
-    return power_;
-}
-
-void
-lefiMacro::generate(char    **name1,
-                    char    **name2) const
-{
-    if (name1)
-        *name1 = gen1_;
-    if (name2)
-        *name2 = gen2_;
-}
-
-lefiSitePattern *
-lefiMacro::sitePattern(int index) const
-{
-    return pattern_[index];
-}
-
-const char *
-lefiMacro::siteName() const
-{
-    return siteName_;
-}
-
-double
-lefiMacro::sizeX() const
-{
-    return sizeX_;
-}
-
-double
-lefiMacro::sizeY() const
-{
-    return sizeY_;
-}
-
-int
-lefiMacro::numForeigns() const
-{
-    return numForeigns_;
-}
-
-int
-lefiMacro::foreignOrient(int index) const
-{
-    return foreignOrient_[index];
-}
-
-const char *
-lefiMacro::foreignOrientStr(int index) const
-{
-    return (lefiOrientStr(foreignOrient_[index]));
-}
-
-double
-lefiMacro::foreignX(int index) const
-{
-    return foreignX_[index];
-}
-
-double
-lefiMacro::foreignY(int index) const
-{
-    return foreignY_[index];
-}
-
-const char *
-lefiMacro::foreignName(int index) const
-{
-    return foreign_[index];
-}
-
-const char *
-lefiMacro::clockType() const
-{
-    return clockType_;
-}
-
-int
-lefiMacro::isBuffer() const
-{
-    return isBuffer_;
-}
-
-int
-lefiMacro::isInverter() const
-{
-    return isInverter_;
-}
-
-void
-lefiMacro::print(FILE *f) const
-{
-    char            *c1;
-    char            *c2;
-    lefiSitePattern *sp;
-    int             i;
-
-    fprintf(f, "MACRO %s\n", name());
-
-    if (hasClass())
-        fprintf(f, "  Class %s\n", macroClass());
-
-    if (hasGenerator())
-        fprintf(f, "  Generator %s\n", generator());
-
-    if (hasGenerator()) {
-        generate(&c1, &c2);
-        fprintf(f, "  Generate %s %s\n", c1, c2);
-    }
-
-    if (hasPower())
-        fprintf(f, "  Power %g\n", power());
-
-    if (hasOrigin())
-        fprintf(f, "  Origin %g,%g\n", originX(),
-                originY());
-
-    if (hasEEQ())
-        fprintf(f, "  EEQ %s\n", EEQ());
-
-    if (hasLEQ())
-        fprintf(f, "  LEQ %s\n", LEQ());
-
-    if (hasSource())
-        fprintf(f, "  Source %s\n", source());
-
-    if (hasXSymmetry())
-        fprintf(f, "  Symmetry X\n");
-
-    if (hasYSymmetry())
-        fprintf(f, "  Symmetry Y\n");
-
-    if (has90Symmetry())
-        fprintf(f, "  Symmetry R90\n");
-
-    if (hasSiteName())
-        fprintf(f, "  Site name %s\n", siteName());
-
-    if (hasSitePattern()) {
-        for (i = 0; i < numSitePattern(); i++) {
-            sp = sitePattern(i);
-            fprintf(f, "  Site pattern ");
-            sp->print(f);
-        }
-    }
-
-    if (hasSize())
-        fprintf(f, "  Size %g,%g\n", sizeX(),
-                sizeY());
-
-    if (hasForeign()) {
-        for (i = 0; i < numForeigns(); i++) {
-            fprintf(f, "  Foreign %s", foreignName(i));
-            if (hasForeignOrigin(i))
-                fprintf(f, "  %g,%g", foreignX(i),
-                        foreignY(i));
-            if (hasForeignOrient(i))
-                fprintf(f, "  orient %s", foreignOrientStr(i));
-            fprintf(f, "\n");
-        }
-    }
-
-    if (hasClockType())
-        fprintf(f, "  Clock type %s\n", clockType());
-
-    fprintf(f, "END MACRO %s\n", name());
-}
-
-// *****************************************************************************
-// lefiTiming
-// *****************************************************************************
-
-lefiTiming::lefiTiming()
-: numFrom_(0),
-  from_(NULL),
-  fromAllocated_(0),
-  numTo_(0),
-  to_(NULL),
-  toAllocated_(0),
-  hasTransition_(0),
-  hasDelay_(0),
-  hasRiseSlew_(0),
-  hasRiseSlew2_(0),
-  hasFallSlew_(0),
-  hasFallSlew2_(0),
-  hasRiseIntrinsic_(0),
-  hasFallIntrinsic_(0),
-  hasRiseRS_(0),
-  hasRiseCS_(0),
-  hasFallRS_(0),
-  hasFallCS_(0),
-  hasUnateness_(0),
-  hasFallAtt1_(0),
-  hasRiseAtt1_(0),
-  hasFallTo_(0),
-  hasRiseTo_(0),
-  hasStableTiming_(0),
-  hasSDFonePinTrigger_(0),
-  hasSDFtwoPinTrigger_(0),
-  hasSDFcondStart_(0),
-  hasSDFcondEnd_(0),
-  hasSDFcond_(0),
-  nowRise_(0),
-  numOfAxisNumbers_(0),
-  axisNumbers_(NULL),
-  axisNumbersAllocated_(0),
-  numOfTableEntries_(0),
-  tableEntriesAllocated_(0),
-  table_(NULL),  // three numbers per entry 
-  delayRiseOrFall_(NULL),
-  delayUnateness_(NULL),
-  delayTableOne_(0.0),
-  delayTableTwo_(0.0),
-  delayTableThree_(0.0),
-  transitionRiseOrFall_(NULL),
-  transitionUnateness_(NULL),
-  transitionTableOne_(0.0),
-  transitionTableTwo_(0.0),
-  transitionTableThree_(0.0),
-  riseIntrinsicOne_(0.0),
-  riseIntrinsicTwo_(0.0),
-  riseIntrinsicThree_(0.0),
-  riseIntrinsicFour_(0.0),
-  fallIntrinsicOne_(0.0),
-  fallIntrinsicTwo_(0.0),
-  fallIntrinsicThree_(0.0),
-  fallIntrinsicFour_(0.0),
-  riseSlewOne_(0.0),
-  riseSlewTwo_(0.0),
-  riseSlewThree_(0.0),
-  riseSlewFour_(0.0),
-  riseSlewFive_(0.0),
-  riseSlewSix_(0.0),
-  riseSlewSeven_(0.0),
-  fallSlewOne_(0.0),
-  fallSlewTwo_(0.0),
-  fallSlewThree_(0.0),
-  fallSlewFour_(0.0),
-  fallSlewFive_(0.0),
-  fallSlewSix_(0.0),
-  fallSlewSeven_(0.0),
-  riseRSOne_(0.0),
-  riseRSTwo_(0.0),
-  riseCSOne_(0.0),
-  riseCSTwo_(0.0),
-  fallRSOne_(0.0),
-  fallRSTwo_(0.0),
-  fallCSOne_(0.0),
-  fallCSTwo_(0.0),
-  unateness_(NULL),
-  riseAtt1One_(0.0),
-  riseAtt1Two_(0.0),
-  fallAtt1One_(0.0),
-  fallAtt1Two_(0.0),
-  fallToOne_(0.0),
-  fallToTwo_(0.0),
-  riseToOne_(0.0),
-  riseToTwo_(0.0),
-  stableSetup_(0.0),
-  stableHold_(0.0),
-  stableRiseFall_(NULL),
-  SDFtriggerType_(NULL),
-  SDFfromTrigger_(NULL),
-  SDFtoTrigger_(NULL),
-  SDFtriggerTableOne_(0.0),
-  SDFtriggerTableTwo_(0.0),
-  SDFtriggerTableThree_(0.0),
-  SDFcondStart_(NULL),
-  SDFcondEnd_(NULL),
-  SDFcond_(NULL)
-{
-    Init();
-}
-
-void
-lefiTiming::Init()
-{
-    numFrom_ = 0;
-    from_ = (char**) lefMalloc(sizeof(char*));
-    fromAllocated_ = 1;
-    numTo_ = 0;
-    to_ = (char**) lefMalloc(sizeof(char*));
-    toAllocated_ = 1;
-
-    numOfAxisNumbers_ = 0;
-    axisNumbers_ = (double*) lefMalloc(sizeof(double));
-    axisNumbersAllocated_ = 1;
-
-    numOfTableEntries_ = 0;
-    tableEntriesAllocated_ = 1;
-    table_ = (double*) lefMalloc(sizeof(double) * 3);  // three numbers per entry 
-
-    clear();
-}
-
-void
-lefiTiming::Destroy()
-{
-    clear();
-    lefFree((char*) (from_));
-    lefFree((char*) (to_));
-    lefFree((char*) (axisNumbers_));
-    lefFree((char*) (table_));
-}
-
-lefiTiming::~lefiTiming()
-{
-    Destroy();
-}
-
-void
-lefiTiming::addRiseFall(const char  *risefall,
-                        double      one,
-                        double      two)
-{
-    if (*risefall == 'r' || *risefall == 'R') {
-        hasRiseIntrinsic_ = 1;
-        nowRise_ = 1;
-        riseIntrinsicOne_ = one;
-        riseIntrinsicTwo_ = two;
-    } else {
-        nowRise_ = 0;
-        hasFallIntrinsic_ = 1;
-        fallIntrinsicOne_ = one;
-        fallIntrinsicTwo_ = two;
-    }
-}
-
-void
-lefiTiming::addRiseFallVariable(double  one,
-                                double  two)
-{
-    if (nowRise_ == 1) {
-        riseIntrinsicThree_ = one;
-        riseIntrinsicFour_ = two;
-    } else {
-        fallIntrinsicThree_ = one;
-        fallIntrinsicFour_ = two;
-    }
-}
-
-void
-lefiTiming::setRiseRS(double    one,
-                      double    two)
-{
-    hasRiseRS_ = 1;
-    riseRSOne_ = one;
-    riseRSTwo_ = two;
-}
-
-void
-lefiTiming::setFallRS(double    one,
-                      double    two)
-{
-    hasFallRS_ = 1;
-    fallRSOne_ = one;
-    fallRSTwo_ = two;
-}
-
-void
-lefiTiming::setRiseCS(double    one,
-                      double    two)
-{
-    hasRiseCS_ = 1;
-    riseCSOne_ = one;
-    riseCSTwo_ = two;
-}
-
-void
-lefiTiming::setFallCS(double    one,
-                      double    two)
-{
-    hasFallCS_ = 1;
-    fallCSOne_ = one;
-    fallCSTwo_ = two;
-}
-
-void
-lefiTiming::setRiseAtt1(double  one,
-                        double  two)
-{
-    hasRiseAtt1_ = 1;
-    riseAtt1One_ = one;
-    riseAtt1Two_ = two;
-}
-
-void
-lefiTiming::setFallAtt1(double  one,
-                        double  two)
-{
-    hasFallAtt1_ = 1;
-    fallAtt1One_ = one;
-    fallAtt1Two_ = two;
-}
-
-void
-lefiTiming::setRiseTo(double    one,
-                      double    two)
-{
-    hasRiseTo_ = 1;
-    riseToOne_ = one;
-    riseToTwo_ = two;
-}
-
-void
-lefiTiming::setFallTo(double    one,
-                      double    two)
-{
-    hasFallTo_ = 1;
-    fallToOne_ = one;
-    fallToTwo_ = two;
-}
-
-void
-lefiTiming::addUnateness(const char *typ)
-{
-    hasUnateness_ = 1;
-    unateness_ = (char*) typ;
-}
-
-void
-lefiTiming::setStable(double        one,
-                      double        two,
-                      const char    *typ)
-{
-    hasStableTiming_ = 1;
-    stableSetup_ = one;
-    stableHold_ = two;
-    stableRiseFall_ = (char*) typ;
-}
-
-void
-lefiTiming::addTableEntry(double    one,
-                          double    two,
-                          double    three)
-{
-    int     i;
-    double  *n;
-    if (numOfTableEntries_ >= tableEntriesAllocated_) {
-        int lim;
-
-        if (tableEntriesAllocated_ == 0)
-            lim = tableEntriesAllocated_ = 2;
-        else
-            lim = tableEntriesAllocated_ *= 2;
-        n = (double*) lefMalloc(sizeof(double) * 3 * lim);
-        lim = numOfTableEntries_ * 3;
-        for (i = 0; i < lim; i++) {
-            n[i] = table_[i];
-        }
-        lefFree((char*) (table_));
-        table_ = n;
-    }
-    i = numOfTableEntries_ * 3;
-    table_[i++] = one;
-    table_[i++] = two;
-    table_[i] = three;
-    numOfTableEntries_ += 1;
-}
-
-void
-lefiTiming::addTableAxisNumber(double one)
-{
-    if (numOfAxisNumbers_ == axisNumbersAllocated_) {
-        int     i;
-        int     lim;
-        double  *n;
-
-        if (axisNumbersAllocated_ == 0)
-            lim = axisNumbersAllocated_ = 2;
-        else
-            lim = axisNumbersAllocated_ *= 2;
-        n = (double*) lefMalloc(sizeof(double) * lim);
-        lim = numOfAxisNumbers_;
-        for (i = 0; i < lim; i++)
-            n[i] = axisNumbers_[i];
-        if (axisNumbersAllocated_ > 2)
-            lefFree((char*) (axisNumbers_));
-        axisNumbers_ = n;
-    }
-    axisNumbers_[(numOfAxisNumbers_)++] = one;
-}
-
-void
-lefiTiming::addRiseFallSlew(double  one,
-                            double  two,
-                            double  three,
-                            double  four)
-{
-    if (nowRise_) {
-        hasRiseSlew_ = 1;
-        riseSlewOne_ = one;
-        riseSlewTwo_ = two;
-        riseSlewThree_ = three;
-        riseSlewFour_ = four;
-    } else {
-        hasFallSlew_ = 1;
-        fallSlewOne_ = one;
-        fallSlewTwo_ = two;
-        fallSlewThree_ = three;
-        fallSlewFour_ = four;
-    }
-}
-
-void
-lefiTiming::addRiseFallSlew2(double one,
-                             double two,
-                             double three)
-{
-    if (nowRise_) {
-        hasRiseSlew2_ = 1;
-        riseSlewFive_ = one;
-        riseSlewSix_ = two;
-        riseSlewSeven_ = three;
-    } else {
-        hasFallSlew2_ = 1;
-        fallSlewFive_ = one;
-        fallSlewSix_ = two;
-        fallSlewSeven_ = three;
-    }
-}
-
-void
-lefiTiming::addFromPin(const char *name)
-{
-    if (numFrom_ == fromAllocated_) {
-        int     lim;
-        int     i;
-        char    **n;
-
-        if (fromAllocated_ == 0)
-            lim = fromAllocated_ = 2;
-        else
-            lim = fromAllocated_ *= 2;
-        n = (char**) lefMalloc(sizeof(char*) * lim);
-        lim = numFrom_;
-        for (i = 0; i < lim; i++)
-            n[i] = from_[i];
-        lefFree((char*) (from_));
-        from_ = n;
-    }
-    from_[(numFrom_)++] = (char*) name;
-}
-
-void
-lefiTiming::addToPin(const char *name)
-{
-    if (numTo_ == toAllocated_) {
-        int     lim;
-        int     i;
-        char    **n;
-
-        if (toAllocated_ == 0)
-            lim = toAllocated_ = 2;
-        else
-            lim = toAllocated_ *= 2;
-        n = (char**) lefMalloc(sizeof(char*) * lim);
-        lim = numTo_;
-        for (i = 0; i < lim; i++)
-            n[i] = to_[i];
-        lefFree((char*) (to_));
-        to_ = n;
-    }
-    to_[(numTo_)++] = (char*) name;
-}
-
-void
-lefiTiming::addDelay(const char *risefall,
-                     const char *unateness,
-                     double     one,
-                     double     two,
-                     double     three)
-{
-    hasDelay_ = 1;
-    delayRiseOrFall_ = (char*) risefall;
-    delayUnateness_ = (char*) unateness;
-    delayTableOne_ = one;
-    delayTableTwo_ = two;
-    delayTableThree_ = three;
-}
-
-void
-lefiTiming::addTransition(const char    *risefall,
-                          const char    *unateness,
-                          double        one,
-                          double        two,
-                          double        three)
-{
-    hasTransition_ = 1;
-    transitionRiseOrFall_ = (char*) risefall;
-    transitionUnateness_ = (char*) unateness;
-    transitionTableOne_ = one;
-    transitionTableTwo_ = two;
-    transitionTableThree_ = three;
-}
-
-void
-lefiTiming::addSDF1Pin(const char   *trigType,
-                       double       one,
-                       double       two,
-                       double       three)
-{
-    hasSDFonePinTrigger_ = 1;
-    SDFtriggerType_ = (char*) trigType;
-    SDFtriggerTableOne_ = one;
-    SDFtriggerTableTwo_ = two;
-    SDFtriggerTableThree_ = three;
-}
-
-void
-lefiTiming::addSDF2Pins(const char  *trigType,
-                        const char  *fromTrig,
-                        const char  *toTrig,
-                        double      one,
-                        double      two,
-                        double      three)
-{
-    hasSDFtwoPinTrigger_ = 1;
-    SDFtriggerType_ = (char*) trigType;
-    SDFfromTrigger_ = (char*) fromTrig;
-    SDFtoTrigger_ = (char*) toTrig;
-    SDFtriggerTableOne_ = one;
-    SDFtriggerTableTwo_ = two;
-    SDFtriggerTableThree_ = three;
-}
-
-void
-lefiTiming::setSDFcondStart(const char *condStart)
-{
-    SDFcondStart_ = (char*) condStart;
-}
-
-void
-lefiTiming::setSDFcondEnd(const char *condEnd)
-{
-    SDFcondEnd_ = (char*) condEnd;
-}
-
-void
-lefiTiming::setSDFcond(const char *cond)
-{
-    SDFcond_ = (char*) cond;
-}
-
-int
-lefiTiming::hasData()
-{
-    return ((numFrom_) ? 1 : 0);
-}
-
-void
-lefiTiming::clear()
-{
-    numFrom_ = 0;
-    numTo_ = 0;
-    numOfAxisNumbers_ = 0;
-    numOfTableEntries_ = 0;
-
-    nowRise_ = 0;
-    hasTransition_ = 0;
-    hasDelay_ = 0;
-    hasFallSlew_ = 0;
-    hasFallSlew2_ = 0;
-    hasRiseSlew_ = 0;
-    hasRiseSlew2_ = 0;
-    hasRiseIntrinsic_ = 0;
-    hasFallIntrinsic_ = 0;
-    hasRiseSlew_ = 0;
-    hasFallSlew_ = 0;
-    hasRiseSlew2_ = 0;
-    hasFallSlew2_ = 0;
-    hasRiseRS_ = 0;
-    hasRiseCS_ = 0;
-    hasFallRS_ = 0;
-    hasFallCS_ = 0;
-    hasUnateness_ = 0;
-    hasFallAtt1_ = 0;
-    hasRiseAtt1_ = 0;
-    hasFallTo_ = 0;
-    hasRiseTo_ = 0;
-    hasStableTiming_ = 0;
-    hasSDFonePinTrigger_ = 0;
-    hasSDFtwoPinTrigger_ = 0;
-    hasSDFcondStart_ = 0;
-    hasSDFcondEnd_ = 0;
-    hasSDFcond_ = 0;
-}
-
-int
-lefiTiming::numFromPins()
-{
-    return numFrom_;
-}
-
-const char *
-lefiTiming::fromPin(int index)
-{
-    return from_[index];
-}
-
-int
-lefiTiming::numToPins()
-{
-    return numTo_;
-}
-
-const char *
-lefiTiming::toPin(int index)
-{
-    return to_[index];
-}
-
-int
-lefiTiming::hasTransition()
-{
-    return hasTransition_;
-}
-
-int
-lefiTiming::hasDelay()
-{
-    return hasDelay_;
-}
-
-int
-lefiTiming::hasRiseSlew()
-{
-    return hasRiseSlew_;
-}
-
-int
-lefiTiming::hasRiseSlew2()
-{
-    return hasRiseSlew2_;
-}
-
-int
-lefiTiming::hasFallSlew()
-{
-    return hasFallSlew_;
-}
-
-int
-lefiTiming::hasFallSlew2()
-{
-    return hasFallSlew2_;
-}
-
-int
-lefiTiming::hasRiseIntrinsic()
-{
-    return hasRiseIntrinsic_;
-}
-
-int
-lefiTiming::hasFallIntrinsic()
-{
-    return hasFallIntrinsic_;
-}
-
-int
-lefiTiming::hasSDFonePinTrigger()
-{
-    return hasSDFonePinTrigger_;
-}
-
-int
-lefiTiming::hasSDFtwoPinTrigger()
-{
-    return hasSDFtwoPinTrigger_;
-}
-
-int
-lefiTiming::hasSDFcondStart()
-{
-    return hasSDFcondStart_;
-}
-
-int
-lefiTiming::hasSDFcondEnd()
-{
-    return hasSDFcondEnd_;
-}
-
-int
-lefiTiming::hasSDFcond()
-{
-    return hasSDFcond_;
-}
-
-int
-lefiTiming::numOfAxisNumbers()
-{
-    return numOfAxisNumbers_;
-}
-
-double *
-lefiTiming::axisNumbers()
-{
-    return axisNumbers_;
-}
-
-int
-lefiTiming::numOfTableEntries()
-{
-    return numOfTableEntries_;
-}
-
-void
-lefiTiming::tableEntry(int      num,
-                       double   *one,
-                       double   *two,
-                       double   *three)
-{
-    num *= 3;
-    *one = table_[num];
-    num++;
-    *two = table_[num];
-    num++;
-    *three = table_[num];
-}
-
-const char *
-lefiTiming::delayRiseOrFall()
-{
-    return delayRiseOrFall_;
-}
-
-const char *
-lefiTiming::delayUnateness()
-{
-    return delayUnateness_;
-}
-
-double
-lefiTiming::delayTableOne()
-{
-    return delayTableOne_;
-}
-
-double
-lefiTiming::delayTableTwo()
-{
-    return delayTableTwo_;
-}
-
-double
-lefiTiming::delayTableThree()
-{
-    return delayTableThree_;
-}
-
-const char *
-lefiTiming::transitionRiseOrFall()
-{
-    return transitionRiseOrFall_;
-}
-
-const char *
-lefiTiming::transitionUnateness()
-{
-    return transitionUnateness_;
-}
-
-double
-lefiTiming::transitionTableOne()
-{
-    return transitionTableOne_;
-}
-
-double
-lefiTiming::transitionTableTwo()
-{
-    return transitionTableTwo_;
-}
-
-double
-lefiTiming::transitionTableThree()
-{
-    return transitionTableThree_;
-}
-
-double
-lefiTiming::riseIntrinsicOne()
-{
-    return riseIntrinsicOne_;
-}
-
-double
-lefiTiming::riseIntrinsicTwo()
-{
-    return riseIntrinsicTwo_;
-}
-
-double
-lefiTiming::riseIntrinsicThree()
-{
-    return riseIntrinsicThree_;
-}
-
-double
-lefiTiming::riseIntrinsicFour()
-{
-    return riseIntrinsicFour_;
-}
-
-double
-lefiTiming::fallIntrinsicOne()
-{
-    return fallIntrinsicOne_;
-}
-
-double
-lefiTiming::fallIntrinsicTwo()
-{
-    return fallIntrinsicTwo_;
-}
-
-double
-lefiTiming::fallIntrinsicThree()
-{
-    return fallIntrinsicThree_;
-}
-
-double
-lefiTiming::fallIntrinsicFour()
-{
-    return fallIntrinsicFour_;
-}
-
-double
-lefiTiming::riseSlewOne()
-{
-    return riseSlewOne_;
-}
-
-double
-lefiTiming::riseSlewTwo()
-{
-    return riseSlewTwo_;
-}
-
-double
-lefiTiming::riseSlewThree()
-{
-    return riseSlewThree_;
-}
-
-double
-lefiTiming::riseSlewFour()
-{
-    return riseSlewFour_;
-}
-
-double
-lefiTiming::riseSlewFive()
-{
-    return riseSlewFive_;
-}
-
-double
-lefiTiming::riseSlewSix()
-{
-    return riseSlewSix_;
-}
-
-double
-lefiTiming::riseSlewSeven()
-{
-    return riseSlewSeven_;
-}
-
-double
-lefiTiming::fallSlewOne()
-{
-    return fallSlewOne_;
-}
-
-double
-lefiTiming::fallSlewTwo()
-{
-    return fallSlewTwo_;
-}
-
-double
-lefiTiming::fallSlewThree()
-{
-    return fallSlewThree_;
-}
-
-double
-lefiTiming::fallSlewFour()
-{
-    return fallSlewFour_;
-}
-
-double
-lefiTiming::fallSlewFive()
-{
-    return fallSlewFive_;
-}
-
-double
-lefiTiming::fallSlewSix()
-{
-    return fallSlewSix_;
-}
-
-double
-lefiTiming::fallSlewSeven()
-{
-    return fallSlewSeven_;
-}
-
-int
-lefiTiming::hasRiseRS()
-{
-    return hasRiseRS_;
-}
-
-double
-lefiTiming::riseRSOne()
-{
-    return riseRSOne_;
-}
-
-double
-lefiTiming::riseRSTwo()
-{
-    return riseRSTwo_;
-}
-
-int
-lefiTiming::hasRiseCS()
-{
-    return hasRiseCS_;
-}
-
-double
-lefiTiming::riseCSOne()
-{
-    return riseCSOne_;
-}
-
-double
-lefiTiming::riseCSTwo()
-{
-    return riseCSTwo_;
-}
-
-int
-lefiTiming::hasFallRS()
-{
-    return hasFallRS_;
-}
-
-double
-lefiTiming::fallRSOne()
-{
-    return fallRSOne_;
-}
-
-double
-lefiTiming::fallRSTwo()
-{
-    return fallRSTwo_;
-}
-
-int
-lefiTiming::hasFallCS()
-{
-    return hasFallCS_;
-}
-
-double
-lefiTiming::fallCSOne()
-{
-    return fallCSOne_;
-}
-
-double
-lefiTiming::fallCSTwo()
-{
-    return fallCSTwo_;
-}
-
-int
-lefiTiming::hasUnateness()
-{
-    return hasUnateness_;
-}
-
-const char *
-lefiTiming::unateness()
-{
-    return unateness_;
-}
-
-int
-lefiTiming::hasFallAtt1()
-{
-    return hasFallAtt1_;
-}
-
-double
-lefiTiming::fallAtt1One()
-{
-    return fallAtt1One_;
-}
-
-double
-lefiTiming::fallAtt1Two()
-{
-    return fallAtt1Two_;
-}
-
-int
-lefiTiming::hasRiseAtt1()
-{
-    return hasRiseAtt1_;
-}
-
-double
-lefiTiming::riseAtt1One()
-{
-    return riseAtt1One_;
-}
-
-double
-lefiTiming::riseAtt1Two()
-{
-    return riseAtt1Two_;
-}
-
-int
-lefiTiming::hasFallTo()
-{
-    return hasFallTo_;
-}
-
-double
-lefiTiming::fallToOne()
-{
-    return fallToOne_;
-}
-
-double
-lefiTiming::fallToTwo()
-{
-    return fallToTwo_;
-}
-
-int
-lefiTiming::hasRiseTo()
-{
-    return hasRiseTo_;
-}
-
-double
-lefiTiming::riseToOne()
-{
-    return riseToOne_;
-}
-
-double
-lefiTiming::riseToTwo()
-{
-    return riseToTwo_;
-}
-
-int
-lefiTiming::hasStableTiming()
-{
-    return hasStableTiming_;
-}
-
-double
-lefiTiming::stableSetup()
-{
-    return stableSetup_;
-}
-
-double
-lefiTiming::stableHold()
-{
-    return stableHold_;
-}
-
-const char *
-lefiTiming::stableRiseFall()
-{
-    return stableRiseFall_;
-}
-
-const char *
-lefiTiming::SDFonePinTriggerType()
-{
-    return SDFtriggerType_;
-}
-
-const char *
-lefiTiming::SDFtwoPinTriggerType()
-{
-    return SDFtriggerType_;
-}
-
-const char *
-lefiTiming::SDFfromTrigger()
-{
-    return SDFfromTrigger_;
-}
-
-const char *
-lefiTiming::SDFtoTrigger()
-{
-    return SDFtoTrigger_;
-}
-
-double
-lefiTiming::SDFtriggerOne()
-{
-    return SDFtriggerTableOne_;
-}
-
-double
-lefiTiming::SDFtriggerTwo()
-{
-    return SDFtriggerTableTwo_;
-}
-
-double
-lefiTiming::SDFtriggerThree()
-{
-    return SDFtriggerTableThree_;
-}
-
-const char *
-lefiTiming::SDFcondStart()
-{
-    return SDFcondStart_;
-}
-
-const char *
-lefiTiming::SDFcondEnd()
-{
-    return SDFcondEnd_;
-}
-
-const char *
-lefiTiming::SDFcond()
-{
-    return SDFcond_;
-}
-
-lefiMacroSite::lefiMacroSite(const char            *name, 
-                             const lefiSitePattern *pattern)
-: siteName_(name),
-  sitePattern_(pattern)
-{
-}
-
-const char *
-lefiMacroSite::siteName() const
-{
-    return siteName_;
-}
-
-const lefiSitePattern *
-lefiMacroSite::sitePattern() const
-{
-    return sitePattern_;
-}
-
-lefiMacroForeign::lefiMacroForeign(const char *name,
-                                   int        hasPts,
-                                   double     x,
-                                   double     y,
-                                   int        hasOrient,
-                                   int        orient)
-: cellName_(name),
-  cellHasPts_(hasPts),
-  py_(y),
-  px_(x),
-  cellHasOrient_(hasOrient),
-  cellOrient_(orient)
-{
-}
-
-const char *
-lefiMacroForeign::cellName() const
-{
-    return cellName_;
-}
-
-int 
-lefiMacroForeign::cellHasPts() const
-{
-    return cellHasPts_;
-}
-
-double
-lefiMacroForeign::px() const
-{
-    return px_;
-}
-
-double
-lefiMacroForeign::py() const
-{
-    return py_;
-}
-
-int
-lefiMacroForeign::cellHasOrient() const
-{
-    return cellHasOrient_;
-}
-
-int
-lefiMacroForeign::cellOrient() const
-{
-    return cellOrient_;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.hpp
deleted file mode 100644
index bcfcdce..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMacro.hpp
+++ /dev/null
@@ -1,939 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiMacro_h
-#define lefiMacro_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-#include "lefiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiObstruction {
-public:
-  lefiObstruction();
-  void Init();
-
-  void Destroy();
-  ~lefiObstruction();
-
-  void clear();
-  void setGeometries(lefiGeometries* g);
-
-  lefiGeometries* geometries() const;
-
-  void print(FILE* f) const;
-
-protected:
-
-  lefiGeometries* geometries_;
-};
-
-// 5.5
-class lefiPinAntennaModel {
-public:
-  lefiPinAntennaModel();
-  ~lefiPinAntennaModel();
-
-  void Init();
-  void clear();
-  void Destroy();
-
-  void setAntennaModel(int oxide);
-  void addAntennaGateArea(double value, const char* layer);
-  void addAntennaMaxAreaCar(double value, const char* layer);
-  void addAntennaMaxSideAreaCar(double value, const char* layer);
-  void addAntennaMaxCutCar(double value, const char* layer);
-  void setAntennaReturnFlag(int flag);
-
-  int hasAntennaGateArea() const;
-  int hasAntennaMaxAreaCar() const;
-  int hasAntennaMaxSideAreaCar() const;
-  int hasAntennaMaxCutCar() const;
-
-  char* antennaOxide() const;
-
-  int numAntennaGateArea() const;
-  double antennaGateArea(int index) const;
-  const char* antennaGateAreaLayer(int index) const;
-
-  int numAntennaMaxAreaCar() const;
-  double antennaMaxAreaCar(int index) const;
-  const char* antennaMaxAreaCarLayer(int index) const;
-
-  int numAntennaMaxSideAreaCar() const;
-  double antennaMaxSideAreaCar(int index) const;
-  const char* antennaMaxSideAreaCarLayer(int index) const;
-
-  int numAntennaMaxCutCar() const;
-  double antennaMaxCutCar(int index) const;
-  const char* antennaMaxCutCarLayer(int index) const;
-
-  int hasReturn() const;
-
-protected:
-  char* oxide_;
-  int   hasReturn_;
-
-  int numAntennaGateArea_;
-  int antennaGateAreaAllocated_;
-  double* antennaGateArea_;
-  char** antennaGateAreaLayer_;
-
-  int numAntennaMaxAreaCar_;
-  int antennaMaxAreaCarAllocated_;
-  double* antennaMaxAreaCar_;
-  char** antennaMaxAreaCarLayer_;
-
-  int numAntennaMaxSideAreaCar_;
-  int antennaMaxSideAreaCarAllocated_;
-  double* antennaMaxSideAreaCar_;
-  char** antennaMaxSideAreaCarLayer_;
-
-  int numAntennaMaxCutCar_;
-  int antennaMaxCutCarAllocated_;
-  double* antennaMaxCutCar_;
-  char** antennaMaxCutCarLayer_;
-};
-
-class lefiPin {
-public:
-  lefiPin();
-  void Init();
-
-  void Destroy();
-  ~lefiPin();
-
-  void clear();
-  void bump(char** array, int len, int* size);
-  void setName(const char* name);
-  void addPort(lefiGeometries* g);
-  void addForeign(const char* name, int hasPnt, double x, double y, int orient);
-  void setLEQ(const char* name);
-  void setDirection(const char* name);
-  void setUse(const char* name);
-  void setShape(const char* name);
-  void setMustjoin(const char* name);
-  void setOutMargin(double high, double low);
-  void setOutResistance(double high, double low);
-  void setInMargin(double high, double low);
-  void setPower(double power);
-  void setLeakage(double current);
-  void setMaxload(double capacitance);
-  void setMaxdelay(double delayTime);
-  void setCapacitance(double capacitance);
-  void setResistance(double resistance);
-  void setPulldownres(double resistance);
-  void setTieoffr(double resistance);
-  void setVHI(double voltage);
-  void setVLO(double voltage);
-  void setRiseVoltage(double voltage);
-  void setFallVoltage(double voltage);
-  void setRiseThresh(double capacitance);
-  void setFallThresh(double capacitance);
-  void setRiseSatcur(double current);
-  void setFallSatcur(double current);
-  void setCurrentSource(const char* name);
-  void setTables(const char* highName, const char* lowName);
-  void setProperty(const char* name, const char* value, const char type);
-  void setNumProperty(const char* name, double d, const char* value,
-                      const char type);
-  void addAntennaModel(int oxide);       // 5.5
-  void addAntennaSize(double value, const char* layer);
-  void addAntennaMetalArea(double value, const char* layer);
-  void addAntennaMetalLength(double value, const char* layer);
-  void addAntennaPartialMetalArea(double value, const char* layer);
-  void addAntennaPartialMetalSideArea(double value, const char* layer);
-  void addAntennaGateArea(double value, const char* layer);
-  void addAntennaDiffArea(double value, const char* layer);
-  void addAntennaMaxAreaCar(double value, const char* layer);
-  void addAntennaMaxSideAreaCar(double value, const char* layer);
-  void addAntennaPartialCutArea(double value, const char* layer);
-  void addAntennaMaxCutCar(double value, const char* layer);
-  void setRiseSlewLimit(double value);
-  void setFallSlewLimit(double value);
-  void setTaperRule(const char* name);
-  void setNetExpr(const char* name);                    // 5.6
-  void setSupplySensitivity(const char* pinName);       // 5.6
-  void setGroundSensitivity(const char* pinName);       // 5.6
-  void bumpProps();
-
-  int hasForeign() const;
-  int hasForeignOrient(int index = 0) const;
-  int hasForeignPoint(int index = 0) const;
-  int hasLEQ() const;
-  int hasDirection() const;
-  int hasUse() const;
-  int hasShape() const;
-  int hasMustjoin() const;
-  int hasOutMargin() const; 
-  int hasOutResistance() const;
-  int hasInMargin() const;
-  int hasPower() const;
-  int hasLeakage() const;
-  int hasMaxload() const;
-  int hasMaxdelay() const;
-  int hasCapacitance() const;
-  int hasResistance() const;
-  int hasPulldownres() const;
-  int hasTieoffr() const;
-  int hasVHI() const;
-  int hasVLO() const;
-  int hasRiseVoltage() const;
-  int hasFallVoltage() const;
-  int hasRiseThresh() const;
-  int hasFallThresh() const;
-  int hasRiseSatcur() const;
-  int hasFallSatcur() const;
-  int hasCurrentSource() const;
-  int hasTables() const;
-  int hasAntennaSize() const;
-  int hasAntennaMetalArea() const;
-  int hasAntennaMetalLength() const;
-  int hasAntennaPartialMetalArea() const;
-  int hasAntennaPartialMetalSideArea() const;
-  int hasAntennaPartialCutArea() const;
-  int hasAntennaDiffArea() const;
-  int hasAntennaModel() const;         // 5.5
-  int hasTaperRule() const;
-  int hasRiseSlewLimit() const;
-  int hasFallSlewLimit() const;
-  int hasNetExpr() const;              // 5.6
-  int hasSupplySensitivity() const;    // 5.6
-  int hasGroundSensitivity() const;    // 5.6
-
-  const char* name() const;
-
-  int numPorts() const;
-  lefiGeometries* port(int index) const;
-
-  int numForeigns() const;
-  const char* foreignName(int index = 0) const;
-  const char* taperRule() const;
-  int foreignOrient(int index = 0) const;
-  const char* foreignOrientStr(int index = 0) const;
-  double foreignX(int index = 0) const;
-  double foreignY(int index = 0) const;
-  const char* LEQ() const;
-  const char* direction() const;
-  const char* use() const;
-  const char* shape() const;
-  const char* mustjoin() const;
-  double outMarginHigh() const;
-  double outMarginLow() const;
-  double outResistanceHigh() const;
-  double outResistanceLow() const;
-  double inMarginHigh() const;
-  double inMarginLow() const;
-  double power() const;
-  double leakage() const;
-  double maxload() const;
-  double maxdelay() const;
-  double capacitance() const;
-  double resistance() const;
-  double pulldownres() const;
-  double tieoffr() const;
-  double VHI() const;
-  double VLO() const;
-  double riseVoltage() const;
-  double fallVoltage() const;
-  double riseThresh() const;
-  double fallThresh() const;
-  double riseSatcur() const;
-  double fallSatcur() const;
-  double riseSlewLimit() const;
-  double fallSlewLimit() const;
-  const char* currentSource() const;
-  const char* tableHighName() const;
-  const char* tableLowName() const;
-
-  int numAntennaSize() const;
-  double antennaSize(int index) const;
-  const char* antennaSizeLayer(int index) const;
-
-  int numAntennaMetalArea() const;
-  double antennaMetalArea(int index) const;
-  const char* antennaMetalAreaLayer(int index) const;
-
-  int numAntennaMetalLength() const;
-  double antennaMetalLength(int index) const;
-  const char* antennaMetalLengthLayer(int index) const;
-
-  int numAntennaPartialMetalArea() const;
-  double antennaPartialMetalArea(int index) const;
-  const char* antennaPartialMetalAreaLayer(int index) const;
-
-  int numAntennaPartialMetalSideArea() const;
-  double antennaPartialMetalSideArea(int index) const;
-  const char* antennaPartialMetalSideAreaLayer(int index) const;
-
-  int numAntennaPartialCutArea() const;
-  double antennaPartialCutArea(int index) const;
-  const char* antennaPartialCutAreaLayer(int index) const;
-
-  int numAntennaDiffArea() const;
-  double antennaDiffArea(int index) const;
-  const char* antennaDiffAreaLayer(int index) const;
-
-  // 5.6
-  const char* netExpr() const;
-  const char* supplySensitivity() const;
-  const char* groundSensitivity() const;
-
-  // 5.5
-  int numAntennaModel() const;
-  lefiPinAntennaModel* antennaModel(int index) const;
-
-  int    numProperties() const;
-  const  char* propName(int index) const;
-  const  char* propValue(int index) const;
-  double propNum(int index) const;
-  const  char  propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-  void print(FILE* f) const ;
-
-protected:
-  int   nameSize_;
-  char* name_;
-
-  char hasLEQ_;
-  char hasDirection_;
-  char hasUse_;
-  char hasShape_;
-  char hasMustjoin_;
-  char hasOutMargin_;
-  char hasOutResistance_;
-  char hasInMargin_;
-  char hasPower_;
-  char hasLeakage_;
-  char hasMaxload_;
-  char hasMaxdelay_;
-  char hasCapacitance_;
-  char hasResistance_;
-  char hasPulldownres_;
-  char hasTieoffr_;
-  char hasVHI_; 
-  char hasVLO_;
-  char hasRiseVoltage_;
-  char hasFallVoltage_;
-  char hasRiseThresh_;
-  char hasFallThresh_;
-  char hasRiseSatcur_;
-  char hasFallSatcur_;
-  char hasCurrentSource_;
-  char hasTables_;
-  char hasAntennasize_;
-  char hasRiseSlewLimit_;
-  char hasFallSlewLimit_;
-
-  int     numForeigns_;
-  int     foreignAllocated_;
-  int*    hasForeignOrient_;
-  int*    hasForeignPoint_;
-  int*    foreignOrient_;
-  double* foreignX_;
-  double* foreignY_;
-  char**  foreign_;
-
-  int    LEQSize_;
-  char*  LEQ_;
-  int    mustjoinSize_;
-  char*  mustjoin_;
-  double outMarginH_;
-  double outMarginL_;
-  double outResistanceH_;
-  double outResistanceL_;
-  double inMarginH_;
-  double inMarginL_;
-  double power_;
-  double leakage_;
-  double maxload_;
-  double maxdelay_;
-  double capacitance_;
-  double resistance_;
-  double pulldownres_;
-  double tieoffr_;
-  double VHI_;
-  double VLO_;
-  double riseVoltage_;
-  double fallVoltage_;
-  double riseThresh_;
-  double fallThresh_;
-  double riseSatcur_;
-  double fallSatcur_;
-  int lowTableSize_;
-  char* lowTable_;
-  int highTableSize_;
-  char* highTable_;
-  double riseSlewLimit_;
-  double fallSlewLimit_;
-
-  // 5.5 AntennaModel
-  int numAntennaModel_;
-  int antennaModelAllocated_;
-  int curAntennaModelIndex_;     // save the current index of the antenna
-  lefiPinAntennaModel** antennaModel_;
-
-  int numAntennaSize_;
-  int antennaSizeAllocated_;
-  double* antennaSize_;
-  char** antennaSizeLayer_;
-
-  int numAntennaMetalArea_;
-  int antennaMetalAreaAllocated_;
-  double* antennaMetalArea_;
-  char** antennaMetalAreaLayer_;
-
-  int numAntennaMetalLength_;
-  int antennaMetalLengthAllocated_;
-  double* antennaMetalLength_;
-  char** antennaMetalLengthLayer_;
-
-  int numAntennaPartialMetalArea_;
-  int antennaPartialMetalAreaAllocated_;
-  double* antennaPartialMetalArea_;
-  char** antennaPartialMetalAreaLayer_;
-
-  int numAntennaPartialMetalSideArea_;
-  int antennaPartialMetalSideAreaAllocated_;
-  double* antennaPartialMetalSideArea_;
-  char** antennaPartialMetalSideAreaLayer_;
-
-  int numAntennaPartialCutArea_;
-  int antennaPartialCutAreaAllocated_;
-  double* antennaPartialCutArea_;
-  char** antennaPartialCutAreaLayer_;
-
-  int numAntennaDiffArea_;
-  int antennaDiffAreaAllocated_;
-  double* antennaDiffArea_;
-  char** antennaDiffAreaLayer_;
-
-  char* taperRule_;
-
-  char* netEpxr_;
-  char* ssPinName_;
-  char* gsPinName_;
-
-  char direction_[32];
-  char use_[12];
-  char shape_[12];
-  char currentSource_[12];
-
-  int numProperties_;
-  int propertiesAllocated_;
-  char** propNames_;
-  char** propValues_;
-  double* propNums_;
-  char*  propTypes_;
-
-  int numPorts_;
-  int portsAllocated_;
-  lefiGeometries** ports_;
-};
-
-// 5.6
-class lefiDensity {
-public:
-  lefiDensity();
-  void Init();
-
-  void Destroy();
-  ~lefiDensity();
-
-  void clear();
-  void addLayer(const char* name);
-  void addRect(double x1, double y1, double x2, double y2, double value);
-
-  int numLayer() const;
-  char* layerName(int index) const;
-  int numRects(int index) const;
-  lefiGeomRect getRect(int index, int rectIndex) const;
-  double densityValue(int index, int rectIndex) const;
-
-  void print(FILE* f) const;
-
-protected:
-  int    numLayers_;
-  int    layersAllocated_;
-  char** layerName_;
-  int*   numRects_;
-  int*   rectsAllocated_;
-  struct lefiGeomRect** rects_;
-  double**       densityValue_;
-};
-
-class lefiMacro {
-public:
-  lefiMacro();
-  void Init();
-
-  void Destroy();
-  ~lefiMacro();
-
-  void clear();
-  void bump(char** array, int len, int* size);
-  void setName(const char* name);
-  void setGenerator(const char* name);
-  void setGenerate(const char* name1, const char* name2);
-  void setPower(double d);
-  void setOrigin(double x, double y);
-  void setClass(const char* name);
-  void setSource(const char* name);
-  void setEEQ(const char* name);
-  void setLEQ(const char* name);
-  void setClockType(const char* name);
-  void setProperty(const char* name, const char* value, const char type);
-  void setNumProperty(const char* name, double d, const char* value,
-                      const char type);
-  void bumpProps();
-
-  // orient=-1 means no orient was specified.
-  void addForeign(const char* name, int hasPnt,
-           double x, double y, int orient);
-
-  void setXSymmetry();
-  void setYSymmetry();
-  void set90Symmetry();
-  void setSiteName(const char* name);
-  void setSitePattern(lefiSitePattern* p);
-  void setSize(double x, double y);
-  void setBuffer();
-  void setInverter();
-  void setFixedMask(int isFixedMask = 0);
-
-  int hasClass() const;
-  int hasGenerator() const;
-  int hasGenerate() const;
-  int hasPower() const;
-  int hasOrigin() const;
-  int hasEEQ() const;
-  int hasLEQ() const;
-  int hasSource() const;
-  int hasXSymmetry() const;
-  int hasYSymmetry() const;
-  int has90Symmetry() const;
-  int hasSiteName() const;
-  int hasSitePattern() const;
-  int hasSize() const;
-  int hasForeign() const;
-  int hasForeignOrigin(int index = 0) const;
-  int hasForeignOrient(int index = 0) const;
-  int hasForeignPoint(int index = 0) const;
-  int hasClockType() const;
-  int isBuffer() const;
-  int isInverter() const;
-  int isFixedMask() const;
-
-  int numSitePattern() const;
-  int numProperties() const;
-  const char* propName(int index) const;
-  const char* propValue(int index) const;
-  double propNum(int index) const;
-  const char propType(int index) const;
-  int  propIsNumber(int index) const;
-  int  propIsString(int index) const;
-
-  const char* name() const;
-  const char* macroClass() const;
-  const char* generator() const;
-  const char* EEQ() const;
-  const char* LEQ() const;
-  const char* source() const;
-  const char* clockType() const;
-  double originX() const;
-  double originY() const;
-  double power() const;
-  void generate(char** name1, char** name2) const;
-  lefiSitePattern* sitePattern(int index) const;
-  const char* siteName() const;
-  double sizeX() const;
-  double sizeY() const;
-  int numForeigns() const;
-  int foreignOrient(int index = 0) const;
-  const char*  foreignOrientStr(int index = 0) const;
-  double foreignX(int index = 0) const;
-  double foreignY(int index = 0) const;
-  const char* foreignName(int index = 0) const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int nameSize_;
-  char* name_;
-  char macroClass_[32];
-  char source_[12];
-
-  int generatorSize_;
-  char* generator_;
-
-  char hasClass_;
-  char hasGenerator_;
-  char hasGenerate_;
-  char hasPower_;
-  char hasOrigin_;
-  char hasSource_;
-  char hasEEQ_;
-  char hasLEQ_;
-  char hasSymmetry_;  // X=1  Y=2  R90=4  (can be combined)
-  char hasSiteName_;
-  char hasSize_;
-  char hasClockType_;
-  char isBuffer_;
-  char isInverter_;
-
-  char* EEQ_;
-  int EEQSize_;
-  char* LEQ_;
-  int LEQSize_;
-  char* gen1_;
-  int gen1Size_;
-  char* gen2_;
-  int gen2Size_;
-  double power_;
-  double originX_;
-  double originY_;
-  double sizeX_;
-  double sizeY_;
-
-  int numSites_;
-  int sitesAllocated_;
-  lefiSitePattern** pattern_;
-
-  int numForeigns_;
-  int foreignAllocated_;
-  int*  hasForeignOrigin_;
-  int*  hasForeignPoint_;
-  int*  foreignOrient_;
-  double* foreignX_;
-  double* foreignY_;
-  char** foreign_;
-
-  int siteNameSize_;
-  char* siteName_;
-
-  char* clockType_;
-  int clockTypeSize_;
-
-  int numProperties_;
-  int propertiesAllocated_;
-  char** propNames_;
-  char** propValues_;
-  double* propNums_;
-  char*  propTypes_;
-
-  int isFixedMask_;
-};
-
-class lefiTiming {
-public:
-  lefiTiming();
-  void Init();
-
-  void Destroy();
-  ~lefiTiming();
-
-  void addRiseFall(const char* risefall, double one, double two);
-  void addRiseFallVariable(double one, double two);
-  void addRiseFallSlew(double one, double two, double three, double four);
-  void addRiseFallSlew2(double one, double two, double three);
-  void setRiseRS(double one, double two);
-  void setFallRS(double one, double two);
-  void setRiseCS(double one, double two);
-  void setFallCS(double one, double two);
-  void setRiseAtt1(double one, double two);
-  void setFallAtt1(double one, double two);
-  void setRiseTo(double one, double two);
-  void setFallTo(double one, double two);
-  void addUnateness(const char* typ);
-  void setStable(double one, double two, const char* typ);
-  void addTableEntry(double one, double two, double three);
-  void addTableAxisNumber(double one);
-  void addFromPin(const char* name);
-  void addToPin(const char* name);
-  void addDelay(const char* risefall, const char* unateness, double one,
-         double two, double three);
-  void addTransition(const char* risefall, const char* unateness, double one,
-         double two, double three);
-  // addSDF2Pins & addSDF1Pin are for 5.1
-  void addSDF2Pins(const char* trigType, const char* fromTrig,
-         const char* toTrig, double one, double two, double three);
-  void addSDF1Pin(const char* trigType, double one, double two, double three);
-  void setSDFcondStart(const char* condStart);
-  void setSDFcondEnd(const char* condEnd);
-  void setSDFcond(const char* cond);
-  int hasData();
-  void clear();
-
-  int numFromPins();
-  const char* fromPin(int index);
-  int numToPins();
-  const char* toPin(int index);
-  int hasTransition();
-  int hasDelay();
-  int hasRiseSlew();
-  int hasRiseSlew2();
-  int hasFallSlew();
-  int hasFallSlew2();
-  int hasRiseIntrinsic();
-  int hasFallIntrinsic();
-  int numOfAxisNumbers();
-  double* axisNumbers();
-  int numOfTableEntries();
-  void tableEntry(int num, double* one, double* two, double* three);
-  const char* delayRiseOrFall();
-  const char* delayUnateness();
-  double delayTableOne();
-  double delayTableTwo();
-  double delayTableThree();
-  const char* transitionRiseOrFall();
-  const char* transitionUnateness();
-  double transitionTableOne();
-  double transitionTableTwo();
-  double transitionTableThree();
-  double fallIntrinsicOne();
-  double fallIntrinsicTwo();
-  double fallIntrinsicThree();
-  double fallIntrinsicFour();
-  double riseIntrinsicOne();
-  double riseIntrinsicTwo();
-  double riseIntrinsicThree();
-  double riseIntrinsicFour();
-  double fallSlewOne();
-  double fallSlewTwo();
-  double fallSlewThree();
-  double fallSlewFour();
-  double fallSlewFive();
-  double fallSlewSix();
-  double fallSlewSeven();
-  double riseSlewOne();
-  double riseSlewTwo();
-  double riseSlewThree();
-  double riseSlewFour();
-  double riseSlewFive();
-  double riseSlewSix();
-  double riseSlewSeven();
-  int hasRiseRS();
-  double riseRSOne();
-  double riseRSTwo();
-  int hasRiseCS();
-  double riseCSOne();
-  double riseCSTwo();
-  int hasFallRS();
-  double fallRSOne();
-  double fallRSTwo();
-  int hasFallCS();
-  double fallCSOne();
-  double fallCSTwo();
-  int hasUnateness();
-  const char* unateness();
-  int hasRiseAtt1();
-  double riseAtt1One();
-  double riseAtt1Two();
-  int hasFallAtt1();
-  double fallAtt1One();
-  double fallAtt1Two();
-  int hasFallTo();
-  double fallToOne();
-  double fallToTwo();
-  int hasRiseTo();
-  double riseToOne();
-  double riseToTwo();
-  int hasStableTiming();
-  double stableSetup();
-  double stableHold();
-  const char* stableRiseFall();
-  // The following are for 5.1
-  int hasSDFonePinTrigger();
-  int hasSDFtwoPinTrigger();
-  int hasSDFcondStart();
-  int hasSDFcondEnd();
-  int hasSDFcond();
-  const char* SDFonePinTriggerType();
-  const char* SDFtwoPinTriggerType();
-  const char* SDFfromTrigger();
-  const char* SDFtoTrigger();
-  double SDFtriggerOne();
-  double SDFtriggerTwo();
-  double SDFtriggerThree();
-  const char* SDFcondStart();
-  const char* SDFcondEnd();
-  const char* SDFcond();
-
-protected:
-  int numFrom_;
-  char** from_;
-  int fromAllocated_;
-  int numTo_;
-  char** to_;
-  int toAllocated_;
-
-  int hasTransition_;
-  int hasDelay_;
-  int hasRiseSlew_;
-  int hasRiseSlew2_;
-  int hasFallSlew_;
-  int hasFallSlew2_;
-  int hasRiseIntrinsic_;
-  int hasFallIntrinsic_;
-  int hasRiseRS_;
-  int hasRiseCS_;
-  int hasFallRS_;
-  int hasFallCS_;
-  int hasUnateness_;
-  int hasFallAtt1_;
-  int hasRiseAtt1_;
-  int hasFallTo_;
-  int hasRiseTo_;
-  int hasStableTiming_;
-  int hasSDFonePinTrigger_;
-  int hasSDFtwoPinTrigger_;
-  int hasSDFcondStart_;
-  int hasSDFcondEnd_;
-  int hasSDFcond_;
-  int nowRise_;
-
-  int numOfAxisNumbers_;
-  double* axisNumbers_;
-  int axisNumbersAllocated_;
-
-  int numOfTableEntries_;
-  int tableEntriesAllocated_;
-  double* table_;  // three numbers per entry 
-
-  char* delayRiseOrFall_;
-  char* delayUnateness_;
-  double delayTableOne_;
-  double delayTableTwo_;
-  double delayTableThree_;
-  char* transitionRiseOrFall_;
-  char* transitionUnateness_;
-  double transitionTableOne_;
-  double transitionTableTwo_;
-  double transitionTableThree_;
-  double riseIntrinsicOne_;
-  double riseIntrinsicTwo_;
-  double riseIntrinsicThree_;
-  double riseIntrinsicFour_;
-  double fallIntrinsicOne_;
-  double fallIntrinsicTwo_;
-  double fallIntrinsicThree_;
-  double fallIntrinsicFour_;
-  double riseSlewOne_;
-  double riseSlewTwo_;
-  double riseSlewThree_;
-  double riseSlewFour_;
-  double riseSlewFive_;
-  double riseSlewSix_;
-  double riseSlewSeven_;
-  double fallSlewOne_;
-  double fallSlewTwo_;
-  double fallSlewThree_;
-  double fallSlewFour_;
-  double fallSlewFive_;
-  double fallSlewSix_;
-  double fallSlewSeven_;
-  double riseRSOne_;
-  double riseRSTwo_;
-  double riseCSOne_;
-  double riseCSTwo_;
-  double fallRSOne_;
-  double fallRSTwo_;
-  double fallCSOne_;
-  double fallCSTwo_;
-  char* unateness_;
-  double riseAtt1One_;
-  double riseAtt1Two_;
-  double fallAtt1One_;
-  double fallAtt1Two_;
-  double fallToOne_;
-  double fallToTwo_;
-  double riseToOne_;
-  double riseToTwo_;
-  double stableSetup_;
-  double stableHold_;
-  char* stableRiseFall_;
-  char* SDFtriggerType_;
-  char* SDFfromTrigger_;
-  char* SDFtoTrigger_;
-  double SDFtriggerTableOne_;
-  double SDFtriggerTableTwo_;
-  double SDFtriggerTableThree_;
-  char* SDFcondStart_;
-  char* SDFcondEnd_;
-  char* SDFcond_;
-};
-
-// 5.8 
-class lefiMacroSite {
-public:
-                        lefiMacroSite(const char *name, const lefiSitePattern* pattern);
-
-  const char            *siteName() const;
-  const lefiSitePattern *sitePattern() const;
-
-protected:
-  const char            *siteName_;
-  const lefiSitePattern *sitePattern_;
-};
-
-class lefiMacroForeign {
-public:
-             lefiMacroForeign(const char *name,
-                              int        hasPts,
-                              double     x,
-                              double     y,
-                              int        hasOrient,
-                              int        orient);
-
-  const char *cellName() const;
-  int        cellHasPts() const;
-  double     px() const;
-  double     py() const;
-  int        cellHasOrient() const;
-  int        cellOrient() const;
-
-protected:
-  const char *cellName_;
-  int        cellHasPts_;
-  double     px_;
-  double     py_;
-  int        cellHasOrient_;
-  int        cellOrient_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.cpp
deleted file mode 100644
index bb914ef..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.cpp
+++ /dev/null
@@ -1,1867 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "lefiMisc.hpp"
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "lefiDebug.hpp"
-#include "lefiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiGeometries
-// *****************************************************************************
-
-lefiGeometries::lefiGeometries()
-{
-    Init();
-}
-
-void
-lefiGeometries::Init()
-{
-    itemsAllocated_ = 2;
-    numItems_ = 0;
-    itemType_ = (lefiGeomEnum*) lefMalloc(sizeof(lefiGeomEnum) * 2);
-    items_ = (void**) lefMalloc(sizeof(void*) * 2);
-    numPoints_ = 0;
-    pointsAllocated_ = 0;
-    x_ = 0;
-    y_ = 0;
-    xStart_ = -1;
-    yStart_ = -1;
-    xStep_ = -1;
-    yStep_ = -1;
-}
-
-void
-lefiGeometries::Destroy()
-{
-    clear();
-    lefFree((char*) (items_));
-    lefFree((char*) (itemType_));
-    if (x_) {
-        lefFree((double*) (x_));
-        lefFree((double*) (y_));
-    }
-    pointsAllocated_ = 0;
-}
-
-lefiGeometries::~lefiGeometries()
-{
-    Destroy();
-}
-
-void
-lefiGeometries::clear()
-{
-    for (int i = 0; i < numItems_; i++) {
-        if (itemType_[i] == lefiGeomViaE) {
-            lefFree(((lefiGeomVia*) (items_[i]))->name);
-        }
-        if (itemType_[i] == lefiGeomViaIterE) {
-            lefFree(((lefiGeomViaIter*) (items_[i]))->name);
-        }
-        if (itemType_[i] == lefiGeomPathE) {
-            ((lefiGeomPath*) (items_[i]))->numPoints = 0;
-            lefFree((double*) ((lefiGeomPath*) items_[i])->x);
-            lefFree((double*) ((lefiGeomPath*) items_[i])->y);
-        }
-        if (itemType_[i] == lefiGeomPathIterE) {
-            ((lefiGeomPathIter*) (items_[i]))->numPoints = 0;
-            lefFree((double*) ((lefiGeomPathIter*) items_[i])->x);
-            lefFree((double*) ((lefiGeomPathIter*) items_[i])->y);
-        }
-        if (itemType_[i] == lefiGeomPolygonE) {
-            ((lefiGeomPolygon*) (items_[i]))->numPoints = 0;
-            lefFree((double*) ((lefiGeomPolygon*) items_[i])->x);
-            lefFree((double*) ((lefiGeomPolygon*) items_[i])->y);
-        }
-        if (itemType_[i] == lefiGeomPolygonIterE) {
-            ((lefiGeomPolygonIter*) (items_[i]))->numPoints = 0;
-            lefFree((double*) ((lefiGeomPolygonIter*) items_[i])->x);
-            lefFree((double*) ((lefiGeomPolygonIter*) items_[i])->y);
-        }
-        lefFree((char*) (items_[i]));
-    }
-    numItems_ = 0;
-}
-
-void
-lefiGeometries::clearPolyItems()
-{
-    lefFree((char*) (items_));
-    lefFree((char*) (itemType_));
-    if (x_) {
-        lefFree((double*) (x_));
-        lefFree((double*) (y_));
-    }
-    numPoints_ = 0;
-    pointsAllocated_ = 0;
-    numItems_ = 0;
-}
-
-void
-lefiGeometries::add(void            *v,
-                    lefiGeomEnum    e)
-{
-    if (numItems_ == itemsAllocated_) {
-        int             i;
-        void            **newi;
-        lefiGeomEnum    *newe;
-        if (itemsAllocated_ == 0)   // 9/12/2002 - for C version
-            itemsAllocated_ = 2;
-        else
-            itemsAllocated_ *= 2;
-        newe = (lefiGeomEnum*) lefMalloc(sizeof(lefiGeomEnum) * itemsAllocated_);
-        newi = (void**) lefMalloc(sizeof(void*) * itemsAllocated_);
-        for (i = 0; i < numItems_; i++) {
-            newe[i] = itemType_[i];
-            newi[i] = items_[i];
-        }
-        lefFree((char*) (items_));
-        lefFree((char*) (itemType_));
-        items_ = newi;
-        itemType_ = newe;
-    }
-    items_[numItems_] = v;
-    itemType_[numItems_] = e;
-    numItems_ += 1;
-}
-
-void
-lefiGeometries::addLayer(const char *name)
-{
-    char *c = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(c, CASE(name));
-    add((void*) c, lefiGeomLayerE);
-}
-
-// 5.7
-void
-lefiGeometries::addLayerExceptPgNet()
-{
-    int *d = (int*) lefMalloc(sizeof(int));
-    *d = 1;
-    add((void*) d, lefiGeomLayerExceptPgNetE);
-}
-
-void
-lefiGeometries::addLayerMinSpacing(double spacing)
-{
-    double *d = (double*) lefMalloc(sizeof(double));
-    *d = spacing;
-    add((void*) d, lefiGeomLayerMinSpacingE);
-}
-
-void
-lefiGeometries::addLayerRuleWidth(double width)
-{
-    double *d = (double*) lefMalloc(sizeof(double));
-    *d = width;
-    add((void*) d, lefiGeomLayerRuleWidthE);
-}
-
-void
-lefiGeometries::addClass(const char *name)
-{
-    char *c = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(c, CASE(name));
-    add((void*) c, lefiGeomClassE);
-}
-
-void
-lefiGeometries::addWidth(double w)
-{
-    double *d = (double*) lefMalloc(sizeof(double));
-    *d = w;
-    add((void*) d, lefiGeomWidthE);
-}
-
-void
-lefiGeometries::addPath(int colorMask)
-{
-    int             i;
-    int             lim;
-    lefiGeomPath    *p = (lefiGeomPath*) lefMalloc(sizeof(lefiGeomPath));
-
-    lim = p->numPoints = numPoints_;
-
-    if (lim > 0) {
-        p->x = (double*) lefMalloc(sizeof(double) * lim);
-        p->y = (double*) lefMalloc(sizeof(double) * lim);
-        for (i = 0; i < lim; i++) {
-            p->x[i] = x_[i];
-            p->y[i] = y_[i];
-        }
-    } else {
-        p->x = 0;
-        p->y = 0;
-    }
-
-    p->colorMask = colorMask;
-
-    add((void*) p, lefiGeomPathE);
-}
-
-void
-lefiGeometries::addPathIter(int colorMask)
-{
-    int                 i;
-    int                 lim;
-    lefiGeomPathIter    *p = (lefiGeomPathIter*) lefMalloc(sizeof(lefiGeomPathIter));
-
-    lim = p->numPoints = numPoints_;
-
-    if (lim > 0) {
-        p->x = (double*) lefMalloc(sizeof(double) * lim);
-        p->y = (double*) lefMalloc(sizeof(double) * lim);
-        for (i = 0; i < lim; i++) {
-            p->x[i] = x_[i];
-            p->y[i] = y_[i];
-        }
-    } else {
-        p->x = 0;
-        p->y = 0;
-    }
-
-    p->colorMask = colorMask;
-    p->xStart = xStart_;
-    p->yStart = yStart_;
-    p->xStep = xStep_;
-    p->yStep = yStep_;
-
-    add((void*) p, lefiGeomPathIterE);
-}
-
-// pcr 481783 & 560504 
-void
-lefiGeometries::addRect(int     colorMask,
-                        double  xl,
-                        double  yl,
-                        double  xh,
-                        double  yh)
-{
-    lefiGeomRect *p = (lefiGeomRect*) lefMalloc(sizeof(lefiGeomRect));
-    p->xl = xl;
-    p->yl = yl;
-    p->xh = xh;
-    p->yh = yh;
-    p->colorMask = colorMask;
-
-    add((void*) p, lefiGeomRectE);
-}
-
-void
-lefiGeometries::addRectIter(int     colorMask,
-                            double  xl,
-                            double  yl,
-                            double  xh,
-                            double  yh)
-{
-    lefiGeomRectIter *p = (lefiGeomRectIter*) lefMalloc(sizeof(lefiGeomRectIter));
-
-    p->xl = xl;
-    p->yl = yl;
-    p->xh = xh;
-    p->yh = yh;
-    p->xStart = xStart_;
-    p->yStart = yStart_;
-    p->xStep = xStep_;
-    p->yStep = yStep_;
-    p->colorMask = colorMask;
-
-    add((void*) p, lefiGeomRectIterE);
-}
-
-void
-lefiGeometries::addPolygon(int colorMask)
-{
-    int             i;
-    int             lim;
-    lefiGeomPolygon *p = (lefiGeomPolygon*) lefMalloc(sizeof(lefiGeomPolygon));
-
-    lim = p->numPoints = numPoints_;
-
-    if (lim > 0) {
-        p->x = (double*) lefMalloc(sizeof(double) * lim);
-        p->y = (double*) lefMalloc(sizeof(double) * lim);
-        for (i = 0; i < lim; i++) {
-            p->x[i] = x_[i];
-            p->y[i] = y_[i];
-        }
-    } else {
-        p->x = 0;
-        p->y = 0;
-    }
-
-
-    p->colorMask = colorMask;
-
-    add((void*) p, lefiGeomPolygonE);
-}
-
-void
-lefiGeometries::addPolygonIter(int colorMask)
-{
-    int                 i;
-    int                 lim;
-    lefiGeomPolygonIter *p = (lefiGeomPolygonIter*) lefMalloc(sizeof(lefiGeomPolygonIter));
-
-    lim = p->numPoints = numPoints_;
-
-    if (lim > 0) {
-        p->x = (double*) lefMalloc(sizeof(double) * lim);
-        p->y = (double*) lefMalloc(sizeof(double) * lim);
-        for (i = 0; i < lim; i++) {
-            p->x[i] = x_[i];
-            p->y[i] = y_[i];
-        }
-    } else {
-        p->x = 0;
-        p->y = 0;
-    }
-
-    p->xStart = xStart_;
-    p->yStart = yStart_;
-    p->xStep = xStep_;
-    p->yStep = yStep_;
-
-    p->colorMask = colorMask;
-
-    add((void*) p, lefiGeomPolygonIterE);
-}
-
-void
-lefiGeometries::addVia(int          viaMask,
-                       double       x,
-                       double       y,
-                       const char   *name)
-{
-    lefiGeomVia *p = (lefiGeomVia*) lefMalloc(sizeof(lefiGeomVia));
-    char        *c = (char*) lefMalloc(strlen(name) + 1);
-
-    strcpy(c, CASE(name));
-    p->x = x;
-    p->y = y;
-    p->name = c;
-    p->bottomMaskNum = viaMask % 10;
-    p->cutMaskNum = viaMask / 10 % 10;
-    p->topMaskNum = viaMask / 100;
-
-    add((void*) p, lefiGeomViaE);
-}
-
-void
-lefiGeometries::addViaIter(int          viaMask,
-                           double       x,
-                           double       y,
-                           const char   *name)
-{
-    lefiGeomViaIter *p = (lefiGeomViaIter*) lefMalloc(sizeof(lefiGeomViaIter));
-    char            *c = (char*) lefMalloc(strlen(name) + 1);
-
-    strcpy(c, CASE(name));
-    p->bottomMaskNum = viaMask % 10;
-    p->cutMaskNum = viaMask / 10 % 10;
-    p->topMaskNum = viaMask / 100;
-    p->x = x;
-    p->y = y;
-    p->name = c;
-    p->xStart = xStart_;
-    p->yStart = yStart_;
-    p->xStep = xStep_;
-    p->yStep = yStep_;
-
-    add((void*) p, lefiGeomViaIterE);
-}
-
-void
-lefiGeometries::addStepPattern(double   xStart,
-                               double   yStart,
-                               double   xStep,
-                               double   yStep)
-{
-    xStart_ = xStart;
-    yStart_ = yStart;
-    xStep_ = xStep;
-    yStep_ = yStep;
-}
-
-void
-lefiGeometries::startList(double    x,
-                          double    y)
-{
-    if (!x_) {
-        numPoints_ = 0;
-        pointsAllocated_ = 16;
-        x_ = (double*) lefMalloc(sizeof(double) * 16);
-        y_ = (double*) lefMalloc(sizeof(double) * 16);
-    } else {  // reset the numPoits to 0
-        numPoints_ = 0;
-    }
-    addToList(x, y);
-}
-
-void
-lefiGeometries::addToList(double    x,
-                          double    y)
-{
-    if (numPoints_ == pointsAllocated_) {
-        int     i;
-        double  *nx;
-        double  *ny;
-        if (pointsAllocated_ == 0)
-            pointsAllocated_ = 2;
-        else
-            pointsAllocated_ *= 2;
-        nx = (double*) lefMalloc(sizeof(double) * pointsAllocated_);
-        ny = (double*) lefMalloc(sizeof(double) * pointsAllocated_);
-        for (i = 0; i < numPoints_; i++) {
-            nx[i] = x_[i];
-            ny[i] = y_[i];
-        }
-        lefFree((char*) (x_));
-        lefFree((char*) (y_));
-        x_ = nx;
-        y_ = ny;
-    }
-    x_[numPoints_] = x;
-    y_[numPoints_] = y;
-    numPoints_ += 1;
-}
-
-int
-lefiGeometries::numItems() const
-{
-    return numItems_;
-}
-
-lefiGeomEnum
-lefiGeometries::itemType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1360): The index number %d given for the geometry item is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1360, msg);
-        return lefiGeomUnknown;
-    }
-    return itemType_[index];
-}
-
-lefiGeomRect *
-lefiGeometries::getRect(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1361): The index number %d given for the geometry RECTANGLE is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1361, msg);
-        return 0;
-    }
-    return (lefiGeomRect*) (items_[index]);
-}
-
-lefiGeomRectIter *
-lefiGeometries::getRectIter(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1362): The index number %d given for the geometry RECTANGLE ITERATE is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1362, msg);
-        return 0;
-    }
-    return (lefiGeomRectIter*) (items_[index]);
-}
-
-lefiGeomPath *
-lefiGeometries::getPath(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1363): The index number %d given for the geometry PATH is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1363, msg);
-        return 0;
-    }
-    return (lefiGeomPath*) (items_[index]);
-}
-
-lefiGeomPathIter *
-lefiGeometries::getPathIter(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1364): The index number %d given for the geometry PATH ITERATE is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1364, msg);
-        return 0;
-    }
-    return (lefiGeomPathIter*) (items_[index]);
-}
-
-char *
-lefiGeometries::getLayer(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1365): The index number %d given for the geometry LAYER is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1365, msg);
-        return 0;
-    }
-    return (char*) (items_[index]);
-}
-
-// 5.7
-int
-lefiGeometries::hasLayerExceptPgNet(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1366): The index number %d given for the geometry LAYER EXCEPT PG NET is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1366, msg);
-        return 0;
-    }
-    return *((int*) (items_[index]));
-}
-
-double
-lefiGeometries::getLayerMinSpacing(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1367): The index number %d given for the geometry LAYER MINSPACING is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1367, msg);
-        return 0;
-    }
-    return *((double*) (items_[index]));
-}
-
-double
-lefiGeometries::getLayerRuleWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1368): The index number %d given for the geometry LAYER RULE WIDTH is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1368, msg);
-        return 0;
-    }
-    return *((double*) (items_[index]));
-}
-
-double
-lefiGeometries::getWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1369): The index number %d given for the geometry WIDTH is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1369, msg);
-        return 0;
-    }
-    return *((double*) (items_[index]));
-}
-
-lefiGeomPolygon *
-lefiGeometries::getPolygon(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1370): The index number %d given for the geometry POLYGON is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1370, msg);
-        return 0;
-    }
-    return (lefiGeomPolygon*) (items_[index]);
-}
-
-lefiGeomPolygonIter *
-lefiGeometries::getPolygonIter(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1371): The index number %d given for the geometry POLYGON ITERATE is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1371, msg);
-        return 0;
-    }
-    return (lefiGeomPolygonIter*) (items_[index]);
-}
-
-char *
-lefiGeometries::getClass(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1372): The index number %d given for the geometry CLASS is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1372, msg);
-        return 0;
-    }
-    return (char*) (items_[index]);
-}
-
-lefiGeomVia *
-lefiGeometries::getVia(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1373): The index number %d given for the geometry VIA is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1373, msg);
-        return 0;
-    }
-    return (lefiGeomVia*) (items_[index]);
-}
-
-lefiGeomViaIter *
-lefiGeometries::getViaIter(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numItems_) {
-        sprintf(msg, "ERROR (LEFPARS-1374): The index number %d given for the geometry VIA ITERATE is invalid.\nValid index is from 0 to %d", index, numItems_);
-        lefiError(0, 1374, msg);
-        return 0;
-    }
-    return (lefiGeomViaIter*) (items_[index]);
-}
-
-void
-lefiGeometries::print(FILE *f) const
-{
-    int                 i;
-    int                 l;
-    lefiGeomRect        *rect;
-    lefiGeomRectIter    *rectiter;
-    lefiGeomPath        *path;
-    lefiGeomPathIter    *pathiter;
-    lefiGeomPolygon     *polygon;
-    lefiGeomPolygonIter *polygoniter;
-
-    for (i = 0; i < numItems_; i++) {
-        switch (itemType(i)) {
-
-        case lefiGeomLayerE:
-            fprintf(f, "Layer %s\n", getLayer(i));
-            break;
-
-        case lefiGeomLayerExceptPgNetE:
-            if (getLayerMinSpacing(i))
-                fprintf(f, "EXCEPTPGNET \n");
-            break;
-
-        case lefiGeomLayerMinSpacingE:
-            fprintf(f, "Spacing %g\n",
-                    getLayerMinSpacing(i));
-            break;
-
-        case lefiGeomLayerRuleWidthE:
-            fprintf(f, "DesignRuleWidth %g\n",
-                    getLayerRuleWidth(i));
-            break;
-
-        case lefiGeomWidthE:
-            fprintf(f, "Width %g\n", getWidth(i));
-            break;
-
-        case lefiGeomPathE:
-            path = getPath(i);
-            fprintf(f, "Path");
-
-            if (path->colorMask) {
-                fprintf(f, " MASK %d", path->colorMask);
-            }
-            for (l = 0; l < path->numPoints; l++)
-                fprintf(f, " %g,%g", path->x[l], path->y[l]);
-            fprintf(f, "\n");
-            break;
-
-        case lefiGeomPathIterE:
-            pathiter = getPathIter(i);
-
-            if (pathiter->colorMask) {
-                fprintf(f, "MASK %d", pathiter->colorMask);
-            }
-
-            fprintf(f, "Path iter  start %g,%g  step %g,%g\n",
-                    pathiter->xStart, pathiter->yStart,
-                    pathiter->xStep, pathiter->yStep);
-
-            for (l = 0; l < pathiter->numPoints; l++) {
-                fprintf(f, " %g,%g", pathiter->x[l], pathiter->y[l]);
-            }
-
-            fprintf(f, "\n");
-            break;
-
-        case lefiGeomRectE:
-            rect = getRect(i);
-
-            if (rect->colorMask) {
-                fprintf(f, "Rect MASK %d, %g,%g  %g,%g\n", rect->colorMask,
-                        rect->xl, rect->yl,
-                        rect->xh, rect->yh);
-            } else {
-                fprintf(f, "Rect %g,%g  %g,%g\n", rect->xl, rect->yl,
-                        rect->xh, rect->yh);
-            }
-            break;
-
-        case lefiGeomRectIterE:
-            rectiter = getRectIter(i);
-
-            if (rectiter->colorMask) {
-                fprintf(f, "Rect MASK %d iter  start %g,%g  step %g,%g\n",
-                        rectiter->colorMask,
-                        rectiter->xStart, rectiter->yStart,
-                        rectiter->xStep, rectiter->yStep);
-            } else {
-                fprintf(f, "Rect iter  start %g,%g  step %g,%g\n",
-                        rectiter->xStart, rectiter->yStart,
-                        rectiter->xStep, rectiter->yStep);
-            }
-
-            fprintf(f, "     %g,%g  %g,%g\n", rectiter->xl, rectiter->yl,
-                    rectiter->xh, rectiter->yh);
-            break;
-
-        case lefiGeomPolygonE:
-            polygon = getPolygon(i);
-            fprintf(f, "Polygon");
-
-            if (polygon->colorMask) {
-                fprintf(f, " MASK %d", polygon->colorMask);
-            }
-
-            for (l = 0; l < polygon->numPoints; l++) {
-                fprintf(f, " %g,%g", polygon->x[l], polygon->y[l]);
-            }
-
-            fprintf(f, "\n");
-            break;
-
-        case lefiGeomPolygonIterE:
-            polygoniter = getPolygonIter(i);
-
-            if (polygoniter->colorMask) {
-                fprintf(f, "Polygon MASK %d iter  start %g,%g  step %g,%g\n",
-                        polygoniter->colorMask,
-                        polygoniter->xStart, polygoniter->yStart,
-                        polygoniter->xStep, polygoniter->yStep);
-            } else {
-                fprintf(f, "Polygon iter  start %g,%g  step %g,%g\n",
-                        polygoniter->xStart, polygoniter->yStart,
-                        polygoniter->xStep, polygoniter->yStep);
-            }
-
-            for (l = 0; l < polygoniter->numPoints; l++) {
-                fprintf(f, " %g,%g", polygoniter->x[l], polygoniter->y[l]);
-            }
-
-            fprintf(f, "\n");
-            break;
-
-        case lefiGeomViaE:
-            fprintf(f, "Via \n");
-            break;
-
-        case lefiGeomViaIterE:
-            fprintf(f, "Via iter \n");
-            break;
-
-        case lefiGeomClassE:
-            fprintf(f, "Classtype %s\n", (char*) items_[i]);
-            break;
-
-        default:
-            lefiError(0, 1375, "ERROR (LEFPARS-1375): unknown geometry type");
-            fprintf(f, "Unknown geometry type %d\n",
-                    (int) (itemType(i)));
-            break;
-        }
-    }
-}
-
-// *****************************************************************************
-// lefiSpacing
-// *****************************************************************************
-
-lefiSpacing::lefiSpacing()
-{
-    Init();
-}
-
-void
-lefiSpacing::Init()
-{
-    name1_ = (char*) lefMalloc(16);
-    name2_ = (char*) lefMalloc(16);
-    name1Size_ = 16;
-    name2Size_ = 16;
-    distance_ = 0;
-    hasStack_ = 0;
-}
-
-void
-lefiSpacing::Destroy()
-{
-    if (name1_)
-        lefFree(name1_);
-    if (name2_)
-        lefFree(name2_);
-}
-
-lefiSpacing::~lefiSpacing()
-{
-    Destroy();
-}
-
-lefiSpacing *
-lefiSpacing::clone()
-{
-    lefiSpacing *sp = (lefiSpacing*) lefMalloc(sizeof(lefiSpacing));
-    sp->name1Size_ = strlen(name1_) + 1;
-    sp->name1_ = (char*) lefMalloc(sp->name1Size_);
-    strcpy(sp->name1_, name1_);
-    sp->name2Size_ = strlen(name2_) + 1;
-    sp->name2_ = (char*) lefMalloc(sp->name2Size_);
-    strcpy(sp->name2_, name2_);
-    sp->distance_ = distance_;
-    sp->hasStack_ = hasStack_;
-    return sp;
-}
-
-void
-lefiSpacing::set(const char *name1,
-                 const char *name2,
-                 double     d,
-                 int        hasStack)
-{
-    int len = strlen(name1) + 1;
-    if (len > name1Size_) {
-        lefFree(name1_);
-        name1_ = (char*) lefMalloc(len);
-        name1Size_ = len;
-    }
-    len = strlen(name2) + 1;
-    if (len > name2Size_) {
-        lefFree(name2_);
-        name2_ = (char*) lefMalloc(len);
-        name2Size_ = len;
-    }
-    strcpy(name1_, CASE(name1));
-    strcpy(name2_, CASE(name2));
-    distance_ = d;
-    hasStack_ = hasStack;
-}
-
-const char *
-lefiSpacing::name1() const
-{
-    return name1_;
-}
-
-const char *
-lefiSpacing::name2() const
-{
-    return name2_;
-}
-
-double
-lefiSpacing::distance() const
-{
-    return distance_;
-}
-
-int
-lefiSpacing::hasStack() const
-{
-    return hasStack_;
-}
-void
-lefiSpacing::print(FILE *f) const
-{
-    fprintf(f, "SPACING %s %s %g", name1(),
-            name2(), distance());
-
-    if (hasStack())
-        fprintf(f, "  STACK");
-
-    fprintf(f, "\n");
-}
-
-// *****************************************************************************
-// lefiIRDrop
-// *****************************************************************************
-
-lefiIRDrop::lefiIRDrop()
-{
-    Init();
-}
-
-void
-lefiIRDrop::Init()
-{
-    nameSize_ = 16;
-    value1Size_ = 16;
-    value2Size_ = 16;
-    name_ = (char*) lefMalloc(16);
-    numValues_ = 0;
-    valuesAllocated_ = 2;
-    value1_ = (double*) lefMalloc(sizeof(double) * 2);
-    value2_ = (double*) lefMalloc(sizeof(double) * 2);
-}
-
-void
-lefiIRDrop::Destroy()
-{
-    lefFree(name_);
-    clear();
-    lefFree((char*) (value1_));
-    lefFree((char*) (value2_));
-}
-
-lefiIRDrop::~lefiIRDrop()
-{
-    Destroy();
-}
-
-void
-lefiIRDrop::clear()
-{
-    numValues_ = 0;
-}
-
-void
-lefiIRDrop::setTableName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-    clear();
-    /*
-      *(value1_) = '\0';
-      *(value2_) = '\0';
-    */
-}
-
-void
-lefiIRDrop::setValues(double    value1,
-                      double    value2)
-{
-    if (numValues_ == valuesAllocated_) {
-        int     i;
-        double  *v1;
-        double  *v2;
-        if (valuesAllocated_ == 0) {
-            valuesAllocated_ = 2;
-            v1 = (double*) lefMalloc(sizeof(double) * valuesAllocated_);
-            v2 = (double*) lefMalloc(sizeof(double) * valuesAllocated_);
-        } else {
-            valuesAllocated_ *= 2;
-            v1 = (double*) lefMalloc(sizeof(double) * valuesAllocated_);
-            v2 = (double*) lefMalloc(sizeof(double) * valuesAllocated_);
-            for (i = 0; i < numValues_; i++) {
-                v1[i] = value1_[i];
-                v2[i] = value2_[i];
-            }
-            lefFree((char*) (value1_));
-            lefFree((char*) (value2_));
-        }
-        value1_ = v1;
-        value2_ = v2;
-    }
-    value1_[numValues_] = value1;
-    value2_[numValues_] = value2;
-    numValues_ += 1;
-}
-
-const char *
-lefiIRDrop::name() const
-{
-    return name_;
-}
-
-int
-lefiIRDrop::numValues() const
-{
-    return numValues_;
-}
-
-double
-lefiIRDrop::value1(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numValues_) {
-        sprintf(msg, "ERROR (LEFPARS-1376): The index number %d given for the IRDROP is invalid.\nValid index is from 0 to %d", index, numValues_);
-        lefiError(0, 1376, msg);
-        return 0;
-    }
-    return value1_[index];
-}
-
-double
-lefiIRDrop::value2(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numValues_) {
-        sprintf(msg, "ERROR (LEFPARS-1376): The index number %d given for the IRDROP is invalid.\nValid index is from 0 to %d", index, numValues_);
-        lefiError(0, 1376, msg);
-        return 0;
-    }
-    return value2_[index];
-}
-
-void
-lefiIRDrop::print(FILE *f) const
-{
-    int i;
-    fprintf(f, "IRDROP %s ", name());
-    for (i = 0; i < numValues(); i++) {
-        fprintf(f, "%g %g ", value1(i),
-                value2(i));
-    }
-    fprintf(f, "\n");
-    fprintf(f, "END IRDrop\n");
-}
-
-// *****************************************************************************
-// lefitMinFeature
-// *****************************************************************************
-lefiMinFeature::lefiMinFeature()
-{
-    Init();
-}
-
-void
-lefiMinFeature::Init()
-{
-    // nothing to do
-}
-
-void
-lefiMinFeature::Destroy()
-{
-    // nothing to do
-}
-
-lefiMinFeature::~lefiMinFeature()
-{
-    Destroy();
-}
-
-void
-lefiMinFeature::set(double  one,
-                    double  two)
-{
-    one_ = one;
-    two_ = two;
-}
-
-double
-lefiMinFeature::one() const
-{
-    return one_;
-}
-
-double
-lefiMinFeature::two() const
-{
-    return two_;
-}
-
-void
-lefiMinFeature::print(FILE *f) const
-{
-    fprintf(f, "MINfEATURE %g %g\n", one(),
-            two());
-}
-
-// *****************************************************************************
-// lefiSite
-// *****************************************************************************
-
-lefiSite::lefiSite()
-{
-    Init();
-}
-
-void
-lefiSite::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    numRowPattern_ = 0;
-    rowPatternAllocated_ = 0;
-    siteNames_ = 0;
-    siteOrients_ = 0;
-}
-
-void
-lefiSite::Destroy()
-{
-    int i;
-
-    lefFree(name_);
-    if (numRowPattern_) {
-        for (i = 0; i < numRowPattern_; i++)
-            lefFree(siteNames_[i]);
-        lefFree(siteNames_);
-        lefFree(siteOrients_);
-        numRowPattern_ = 0;
-    }
-}
-
-lefiSite::~lefiSite()
-{
-    Destroy();
-}
-
-void
-lefiSite::setName(const char *name)
-{
-    int i;
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-    hasClass_ = 0;
-    *(siteClass_) = 0;
-    hasSize_ = 0;
-    symmetry_ = 0;
-    if (numRowPattern_) {
-        for (i = 0; i < numRowPattern_; i++)
-            lefFree(siteNames_[i]);
-        numRowPattern_ = 0;
-    }
-}
-
-void
-lefiSite::setClass(const char *cls)
-{
-    strcpy(siteClass_, cls);
-    hasClass_ = 1;
-}
-
-void
-lefiSite::setSize(double    x,
-                  double    y)
-{
-    hasSize_ = 1;
-    sizeX_ = x;
-    sizeY_ = y;
-}
-
-void
-lefiSite::setXSymmetry()
-{
-    symmetry_ |= 1;
-}
-
-void
-lefiSite::setYSymmetry()
-{
-    symmetry_ |= 2;
-}
-
-void
-lefiSite::set90Symmetry()
-{
-    symmetry_ |= 4;
-}
-
-void
-lefiSite::addRowPattern(const char  *name,
-                        int         orient)
-{
-    if (numRowPattern_ == rowPatternAllocated_) {
-        int     i;
-        char    **sn;
-        int     *so;
-
-        rowPatternAllocated_ = (rowPatternAllocated_ == 0) ? 2 :
-            rowPatternAllocated_ * 2;
-        sn = (char**) lefMalloc(sizeof(char*) * rowPatternAllocated_);
-        so = (int*) lefMalloc(sizeof(int) * rowPatternAllocated_);
-        for (i = 0; i < numRowPattern_; i++) {
-            sn[i] = siteNames_[i];
-            so[i] = siteOrients_[i];
-        }
-        if (siteNames_) {
-            lefFree((char*) (siteNames_));
-            lefFree((char*) (siteOrients_));
-        }
-        siteNames_ = sn;
-        siteOrients_ = so;
-    }
-    siteNames_[numRowPattern_] = strdup(name);
-    siteOrients_[numRowPattern_] = orient;
-    numRowPattern_ += 1;
-}
-
-const char *
-lefiSite::name() const
-{
-    return name_;
-}
-
-int
-lefiSite::hasClass() const
-{
-    return hasClass_;
-}
-
-const char *
-lefiSite::siteClass() const
-{
-    return siteClass_;
-}
-
-double
-lefiSite::sizeX() const
-{
-    return sizeX_;
-}
-
-double
-lefiSite::sizeY() const
-{
-    return sizeY_;
-}
-
-int
-lefiSite::hasSize() const
-{
-    return hasSize_;
-}
-
-int
-lefiSite::hasXSymmetry() const
-{
-    return (symmetry_ & 1) ? 1 : 0;
-}
-
-int
-lefiSite::hasYSymmetry() const
-{
-    return (symmetry_ & 2) ? 1 : 0;
-}
-
-int
-lefiSite::has90Symmetry() const
-{
-    return (symmetry_ & 4) ? 1 : 0;
-}
-
-int
-lefiSite::hasRowPattern() const
-{
-    return (numRowPattern_) ? 1 : 0;
-}
-
-int
-lefiSite::numSites() const
-{
-    return (numRowPattern_);
-}
-
-char *
-lefiSite::siteName(int index) const
-{
-    return (siteNames_[index]);
-}
-
-int
-lefiSite::siteOrient(int index) const
-{
-    return (siteOrients_[index]);
-}
-
-char *
-lefiSite::siteOrientStr(int index) const
-{
-    return (lefiOrientStr(siteOrients_[index]));
-}
-
-void
-lefiSite::print(FILE *f) const
-{
-    fprintf(f, "SITE %s", name());
-
-    if (hasClass())
-        fprintf(f, " CLASS %s", siteClass());
-
-    if (hasSize())
-        fprintf(f, " SIZE %g %g", sizeX(),
-                sizeY());
-
-    if (hasXSymmetry())
-        fprintf(f, " SYMMETRY X");
-
-    if (hasYSymmetry())
-        fprintf(f, " SYMMETRY Y");
-
-    if (has90Symmetry())
-        fprintf(f, " SYMMETRY R90");
-
-    fprintf(f, "\n");
-}
-
-// *****************************************************************************
-// lefiSitePattern
-// *****************************************************************************
-
-lefiSitePattern::lefiSitePattern()
-{
-    Init();
-}
-
-void
-lefiSitePattern::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-}
-
-void
-lefiSitePattern::Destroy()
-{
-    lefFree(name_);
-}
-
-lefiSitePattern::~lefiSitePattern()
-{
-    Destroy();
-}
-
-void
-lefiSitePattern::set(const char *name,
-                     double     x,
-                     double     y,
-                     int        orient,
-                     double     xStart,
-                     double     yStart,
-                     double     xStep,
-                     double     yStep)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-
-    x_ = x;
-    y_ = y;
-    xStep_ = xStep;
-    yStep_ = yStep;
-    xStart_ = xStart;
-    yStart_ = yStart;
-    orient_ = orient;
-}
-
-const char *
-lefiSitePattern::name() const
-{
-    return name_;
-}
-
-int
-lefiSitePattern::orient() const
-{
-    return orient_;
-}
-
-const char *
-lefiSitePattern::orientStr() const
-{
-    return (lefiOrientStr(orient_));
-}
-
-double
-lefiSitePattern::x() const
-{
-    return x_;
-}
-
-double
-lefiSitePattern::y() const
-{
-    return y_;
-}
-
-int
-lefiSitePattern::hasStepPattern() const
-{
-    if (xStart_ == -1 && yStart_ == -1 &&
-        xStep_ == -1 && yStep_ == -1)
-        return 0;
-    return 1;
-}
-
-double
-lefiSitePattern::xStart() const
-{
-    return xStart_;
-}
-
-double
-lefiSitePattern::yStart() const
-{
-    return yStart_;
-}
-
-double
-lefiSitePattern::xStep() const
-{
-    return xStep_;
-}
-
-double
-lefiSitePattern::yStep() const
-{
-    return yStep_;
-}
-
-void
-lefiSitePattern::print(FILE *f) const
-{
-    fprintf(f, "  SITE Pattern %s  %g,%g %s\n",
-            name(),
-            x(),
-            y(),
-            orientStr());
-    fprintf(f, "    %g,%g step %g,%g\n",
-            xStart(),
-            yStart(),
-            xStep(),
-            yStep());
-}
-
-// *****************************************************************************
-// lefiTrackPattern
-// *****************************************************************************
-
-lefiTrackPattern::lefiTrackPattern()
-{
-    Init();
-}
-
-void
-lefiTrackPattern::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    start_ = 0;
-    numTracks_ = 0;
-    space_ = 0;
-    numLayers_ = 0;
-    layerAllocated_ = 2;
-    layerNames_ = (char**) lefMalloc(sizeof(char*) * 2);
-    clear();
-}
-
-void
-lefiTrackPattern::Destroy()
-{
-    if (name_)
-        lefFree(name_);
-    clear();
-    name_ = 0;
-    start_ = 0;
-    numTracks_ = 0;
-    space_ = 0;
-    lefFree((char*) (layerNames_));
-}
-
-void
-lefiTrackPattern::clear()
-{
-    int i;
-    for (i = 0; i < numLayers_; i++) {
-        lefFree(layerNames_[i]);
-    }
-}
-
-lefiTrackPattern::~lefiTrackPattern()
-{
-    Destroy();
-}
-
-void
-lefiTrackPattern::set(const char    *name,
-                      double        start,
-                      int           numTracks,
-                      double        space)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-
-    start_ = start;
-    numTracks_ = numTracks;
-    space_ = space;
-}
-
-void
-lefiTrackPattern::addLayer(const char *name)
-{
-    int len;
-    if (numLayers_ == layerAllocated_) {
-        int     i;
-        char    **nn;
-
-        if (layerAllocated_ == 0)
-            layerAllocated_ = 2;
-        else
-            layerAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * layerAllocated_);
-        for (i = 0; i < numLayers_; i++)
-            nn[i] = layerNames_[i];
-        lefFree((char*) (layerNames_));
-        layerNames_ = nn;
-    }
-    len = strlen(name) + 1;
-    layerNames_[numLayers_] = (char*) lefMalloc(len);
-    strcpy(layerNames_[numLayers_], CASE(name));
-    numLayers_ += 1;
-}
-
-const char *
-lefiTrackPattern::name() const
-{
-    return name_;
-}
-
-double
-lefiTrackPattern::start() const
-{
-    return start_;
-}
-
-int
-lefiTrackPattern::numTracks() const
-{
-    return numTracks_;
-}
-
-double
-lefiTrackPattern::space() const
-{
-    return space_;
-}
-
-int
-lefiTrackPattern::numLayers() const
-{
-    return numLayers_;
-}
-
-const char *
-lefiTrackPattern::layerName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1377): The index number %d given for the TRACK PATTERN  is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1377, msg);
-        return 0;
-    }
-    return layerNames_[index];
-}
-
-void
-lefiTrackPattern::print(FILE *f) const
-{
-    int i;
-    fprintf(f, "  TRACK Pattern %s  %g DO %d STEP %g\n",
-            name(),
-            start(),
-            numTracks(),
-            space());
-    if (numLayers() > 0) {
-        fprintf(f, "    LAYER ");
-        for (i = 0; i < numLayers(); i++)
-            fprintf(f, "%s ", layerName(i));
-        fprintf(f, "\n");
-    }
-}
-
-// *****************************************************************************
-// lefiGcellPattern
-// *****************************************************************************
-
-lefiGcellPattern::lefiGcellPattern()
-{
-    Init();
-}
-
-void
-lefiGcellPattern::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    start_ = 0;
-    numCRs_ = 0;
-    space_ = 0;
-}
-
-void
-lefiGcellPattern::Destroy()
-{
-    if (name_)
-        lefFree(name_);
-    name_ = 0;
-    start_ = 0;
-    numCRs_ = 0;
-    space_ = 0;
-}
-
-lefiGcellPattern::~lefiGcellPattern()
-{
-    Destroy();
-}
-
-void
-lefiGcellPattern::set(const char    *name,
-                      double        start,
-                      int           numCRs,
-                      double        space)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-
-    start_ = start;
-    numCRs_ = numCRs;
-    space_ = space;
-}
-
-const char *
-lefiGcellPattern::name() const
-{
-    return name_;
-}
-
-double
-lefiGcellPattern::start() const
-{
-    return start_;
-}
-
-int
-lefiGcellPattern::numCRs() const
-{
-    return numCRs_;
-}
-
-double
-lefiGcellPattern::space() const
-{
-    return space_;
-}
-
-void
-lefiGcellPattern::print(FILE *f) const
-{
-    fprintf(f, "  TRACK Pattern %s  %g DO %d STEP %g\n",
-            name(),
-            start(),
-            numCRs(),
-            space());
-}
-
-// *****************************************************************************
-// lefiUseMinSpacing
-// *****************************************************************************
-
-lefiUseMinSpacing::lefiUseMinSpacing()
-{
-    Init();
-}
-
-void
-lefiUseMinSpacing::Init()
-{
-    name_ = 0;
-    value_ = 0;
-}
-
-void
-lefiUseMinSpacing::Destroy()
-{
-    if (name_)
-        lefFree(name_);
-}
-
-lefiUseMinSpacing::~lefiUseMinSpacing()
-{
-    Destroy();
-}
-
-void
-lefiUseMinSpacing::set(const char   *name,
-                       int          value)
-{
-
-    Destroy();  // lefFree previous name, if there is any
-    name_ = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(name_, CASE(name));
-    value_ = value;
-}
-
-const char *
-lefiUseMinSpacing::name() const
-{
-    return name_;
-}
-
-int
-lefiUseMinSpacing::value() const
-{
-    return value_;
-}
-
-void
-lefiUseMinSpacing::print(FILE *f) const
-{
-    fprintf(f, "USEMINSPACING %s %d\n",
-            name(),
-            value());
-}
-
-// *****************************************************************************
-// lefiMaxStackVia
-// *****************************************************************************
-
-lefiMaxStackVia::lefiMaxStackVia()
-{
-    bottomLayer_ = 0;
-    topLayer_ = 0;
-    Init();
-}
-
-void
-lefiMaxStackVia::Init()
-{
-    value_ = 0;
-    hasRange_ = 0;
-    if (bottomLayer_)          // This is for C version, since C will
-        lefFree(bottomLayer_);  // call this function before calling
-    if (topLayer_)             // setMaxStackViaRange when more than 1 lef
-        lefFree(topLayer_);     // files are parse. C++ skips this function
-    bottomLayer_ = 0;
-    topLayer_ = 0;
-}
-
-void
-lefiMaxStackVia::Destroy()
-{
-    if (bottomLayer_)
-        lefFree(bottomLayer_);
-    if (topLayer_)
-        lefFree(topLayer_);
-    bottomLayer_ = 0;
-    topLayer_ = 0;
-    hasRange_ = 0;
-    value_ = 0;
-}
-
-lefiMaxStackVia::~lefiMaxStackVia()
-{
-    Destroy();
-}
-
-void
-lefiMaxStackVia::setMaxStackVia(int value)
-{
-    value_ = value;
-}
-
-void
-lefiMaxStackVia::setMaxStackViaRange(const char *bottomLayer,
-                                     const char *topLayer)
-{
-    hasRange_ = 1;
-    if (bottomLayer_)          // May be lefrReset is called and 
-        lefFree(bottomLayer_);  // bottomLayer_ and/or topLayer_ have
-    if (topLayer_)             // value malloc on them
-        lefFree(topLayer_);
-    bottomLayer_ = (char*) lefMalloc(strlen(bottomLayer) + 1);
-    strcpy(bottomLayer_, CASE(bottomLayer));
-    topLayer_ = (char*) lefMalloc(strlen(topLayer) + 1);
-    strcpy(topLayer_, CASE(topLayer));
-    //bottomLayer_ = strdup(bottomLayer);
-    //topLayer_    = strdup(topLayer);
-}
-
-int
-lefiMaxStackVia::maxStackVia() const
-{
-    return value_;
-}
-
-int
-lefiMaxStackVia::hasMaxStackViaRange() const
-{
-    return hasRange_ ? 1 : 0;
-}
-
-const char *
-lefiMaxStackVia::maxStackViaBottomLayer() const
-{
-    return bottomLayer_;
-}
-
-const char *
-lefiMaxStackVia::maxStackViaTopLayer() const
-{
-    return topLayer_;
-}
-
-void
-lefiMaxStackVia::print(FILE *f) const
-{
-    fprintf(f, "MAXVIASTACK %d", maxStackVia());
-    if (hasMaxStackViaRange())
-        fprintf(f, " RANGE %s %s", maxStackViaBottomLayer(),
-                maxStackViaTopLayer());
-    fprintf(f, "\n");
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.hpp
deleted file mode 100644
index add1d69..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiMisc.hpp
+++ /dev/null
@@ -1,493 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiMisc_h
-#define lefiMisc_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// The different types of items in a geometry list.
-
-struct lefiGeomRect {
-      double xl;
-      double yl;
-      double xh;
-      double yh;
-      int    colorMask;
-};
-
-struct lefiGeomRectIter {
-  double xl;
-  double yl;
-  double xh;
-  double yh;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-struct lefiGeomPath {
-  int     numPoints;
-  double* x;
-  double* y;
-  int     colorMask;
-};
-
-struct lefiGeomPathIter {
-  int     numPoints;
-  double* x;
-  double* y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-struct lefiGeomPolygon {
-  int     numPoints;
-  double* x;
-  double* y;
-  int     colorMask;
-};
-
-struct lefiGeomPolygonIter {
-  int numPoints;
-  double* x;
-  double* y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    colorMask;
-};
-
-enum lefiGeomEnum {
-  lefiGeomUnknown = 0,
-  lefiGeomLayerE,
-  lefiGeomLayerExceptPgNetE,
-  lefiGeomLayerMinSpacingE,
-  lefiGeomLayerRuleWidthE,
-  lefiGeomWidthE,
-  lefiGeomPathE,
-  lefiGeomPathIterE,
-  lefiGeomRectE,
-  lefiGeomRectIterE,
-  lefiGeomPolygonE,
-  lefiGeomPolygonIterE,
-  lefiGeomViaE,
-  lefiGeomViaIterE,
-  lefiGeomClassE,
-  lefiGeomEnd
-};
-
-struct lefiGeomVia {
-  char*  name;
-  double x;
-  double y;
-  int    topMaskNum;
-  int    cutMaskNum;
-  int    bottomMaskNum;
-};
-
-struct lefiGeomViaIter {
-  char*  name;
-  double x;
-  double y;
-  double xStart;
-  double yStart;
-  double xStep;
-  double yStep;
-  int    topMaskNum;
-  int    cutMaskNum;
-  int    bottomMaskNum;
-};
-
-class lefiGeometries {
-public:
-  lefiGeometries();
-  void Init();
-
-  void Destroy();
-  ~lefiGeometries();
-
-  void clear();
-  void clearPolyItems();
-  void add(void* v, lefiGeomEnum e);
-  void addLayer(const char* name);
-  void addLayerExceptPgNet();                     // 5.7
-  void addLayerMinSpacing(double spacing);
-  void addLayerRuleWidth(double width);
-  void addClass(const char* name);
-  void addWidth(double w);
-  void addPath(int colorMask);
-  void addPathIter(int colorMask);
-/*  pcr 481783 & 560504
-*/
-  void addRect(int colorMask, double xl, double yl, double xh, double yh);
-  void addRectIter(int colorMask, double xl, double yl, double xh, double yh);
-  void addPolygon(int colorMask = 0);
-  void addPolygonIter(int colorMask);
-  void addVia(int viaMasks,
-              double x, double y, const char* name);
-  void addViaIter(int viaMasks,
-                  double x, double y, const char* name);
-  void addStepPattern(double xStart, double yStart,
-                      double xStep, double yStep);
-  void startList(double x, double y);
-  void addToList(double x, double y);
-
-  int numItems() const;
-  lefiGeomEnum itemType(int index) const;
-  lefiGeomRect* getRect(int index) const;
-  lefiGeomRectIter* getRectIter(int index) const;
-  lefiGeomPath* getPath(int index) const;
-  lefiGeomPathIter* getPathIter(int index) const;
-  int    hasLayerExceptPgNet(int index) const ;     // 5.7
-  char*  getLayer(int index) const;
-  double getLayerMinSpacing(int index) const;
-  double getLayerRuleWidth(int index) const;
-  double getWidth(int index) const;
-  lefiGeomPolygon* getPolygon(int index) const;
-  lefiGeomPolygonIter* getPolygonIter(int index) const;
-  char*  getClass(int index) const;
-  lefiGeomVia* getVia(int index) const;
-  lefiGeomViaIter* getViaIter(int index) const;
-
-  void print(FILE* f) const;
-
-protected:
-
-  int numItems_;
-  int itemsAllocated_;
-  lefiGeomEnum* itemType_;
-  void** items_;
-
-  int numPoints_;
-  int pointsAllocated_;
-  double* x_;
-  double* y_;
-
-  double xStart_;
-  double yStart_;
-  double xStep_;
-  double yStep_;
-};
-
-class lefiSpacing {
-public:
-  lefiSpacing();
-  void Init();
-
-  void Destroy();
-  ~lefiSpacing();
-
-  lefiSpacing* clone();
-
-  void set(const char* name1, const char* name2, double num, int hasStack);
-
-  int hasStack() const;
-
-  const char* name1() const;
-  const char* name2() const;
-  double distance() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int    name1Size_;
-  int    name2Size_;
-  char*  name1_;
-  char*  name2_;
-  double distance_;
-  int    hasStack_;
-};
-
-class lefiIRDrop {
-public:
-  lefiIRDrop();
-  void Init();
-
-  void Destroy();
-  ~lefiIRDrop();
-
-  void clear();
-  void setTableName(const char* name);
-  void setValues(double name1, double name2);
-
-  const char* name() const;
-  double value1(int index) const;
-  double value2(int index) const;
-
-  int numValues() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int     nameSize_;
-  int     value1Size_;
-  int     value2Size_;
-  int     numValues_;
-  int     valuesAllocated_;
-  char*   name_;
-  double* value1_;
-  double* value2_;
-};
-
-class lefiMinFeature {
-public:
-  lefiMinFeature();
-  void Init();
-
-  void Destroy();
-  ~lefiMinFeature();
-
-  void set(double one, double two);
-
-  double one() const;
-  double two() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  double one_;
-  double two_;
-};
-
-class lefiSite {
-public:
-  lefiSite();
-  void Init();
-
-  void Destroy();
-  ~lefiSite();
-
-  void setName(const char* name);
-  void setClass(const char* cls);
-  void setSize(double x, double y);
-  void setXSymmetry();
-  void setYSymmetry();
-  void set90Symmetry();
-  void addRowPattern(const char* name, int orient);
-
-  const char* name() const;
-  int hasClass() const;
-  const char* siteClass() const;
-  double sizeX() const;
-  double sizeY() const;
-  int hasSize() const;
-  int hasXSymmetry() const;
-  int hasYSymmetry() const;
-  int has90Symmetry() const;
-  int hasRowPattern() const;                 // 5.6
-  int numSites() const;                      // 5.6
-  char* siteName(int index) const;           // 5.6
-  int   siteOrient(int index) const;         // 5.6
-  char* siteOrientStr(int index) const;      // 5.6
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int    nameSize_;
-  char*  name_;
-  int    hasClass_;
-  char   siteClass_[8];
-  double sizeX_;
-  double sizeY_;
-  int    hasSize_;
-  int    symmetry_;   // bit 0-x   bit 1-y   bit 2-90
-
-  int    numRowPattern_;         // 5.6 ROWPATTERN
-  int    rowPatternAllocated_;
-  char** siteNames_;
-  int*   siteOrients_;
-};
-
-class lefiSitePattern {
-public:
-  lefiSitePattern();
-  void Init();
-
-  void Destroy();
-  ~lefiSitePattern();
-
-  void set(const char* name, double x, double y, int orient,
-       double xStart, double yStart, double xStep, double yStep);
-
-  const  char* name() const;
-  int    orient() const;
-  const  char* orientStr() const;
-  double x() const;
-  double y() const;
-  int    hasStepPattern() const;    // 5.6
-  double xStart() const;
-  double yStart() const;
-  double xStep() const;
-  double yStep() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int    nameSize_;
-  char*  name_;
-  int    orient_;
-  double x_;
-  double y_;
-  double xStart_;
-  double yStart_;
-  double xStep_;
-  double yStep_;
-};
-
-class lefiTrackPattern {
-public:
-  lefiTrackPattern();
-  void Init();
-
-  void Destroy();
-  ~lefiTrackPattern();
-
-  void clear();
-  void set(const char* name, double start, int numTracks, double space);
-  void addLayer(const char* name);
-
-  const char* name() const;
-  double start() const;
-  int numTracks() const;
-  double space() const;
-
-  int numLayers() const;
-  const char* layerName(int index) const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int    nameSize_;
-  char*  name_;
-  double start_;
-  int    numTracks_;
-  double space_;
-
-  int    numLayers_;
-  int    layerAllocated_;
-  char** layerNames_;
-};
-
-class lefiGcellPattern {
-public:
-  lefiGcellPattern();
-  void Init();
-
-  void Destroy();
-  ~lefiGcellPattern();
-
-  void set(const char* name, double start, int numCRs, double space);
-
-  const char* name() const;
-  double start() const;
-  int numCRs() const;
-  double space() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int    nameSize_;
-  char*  name_;
-  double start_;
-  int    numCRs_;
-  double space_;
-};
-
-class lefiUseMinSpacing {
-public:
-  lefiUseMinSpacing();
-  void Init();
-
-  void Destroy();
-  ~lefiUseMinSpacing();
-
-  void set(const char* name, int value);
-
-  const char* name() const;
-  int   value() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int   value_;
-};
-
-// 5.5 for Maximum Stacked-via rule
-class lefiMaxStackVia {
-public:
-  lefiMaxStackVia();
-  void Init();
-
-  void Destroy();
-  ~lefiMaxStackVia();
-
-  void clear();
-  void setMaxStackVia(int value);
-  void setMaxStackViaRange(const char* bottomLayer, const char* topLayer);
-
-  int maxStackVia() const;
-  int hasMaxStackViaRange() const;
-  const char* maxStackViaBottomLayer() const;
-  const char* maxStackViaTopLayer() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  int   value_;
-  int   hasRange_;
-  char* bottomLayer_;
-  char* topLayer_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.cpp
deleted file mode 100644
index 895fad0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.cpp
+++ /dev/null
@@ -1,1120 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiNonDefault.hpp"
-#include "lefiDebug.hpp"
-#include "lefrCallBacks.hpp"
-
-#include "lefrData.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// 6/16/2000 - Wanda da Rosa
-// Make these variables in globals.  Can't use those defined
-// in the class because it generates warning when it casts.
-// Can't assign for example lefrViaCbkFnType to oldViaCbk_
-// in the class because it requires to include lefrReader.hpp
-// in lefiNonDefault.hpp.  But in lefrReader.hpp, it requires
-// include lefiNonDefault.hpp, this creates a loop and is
-// problematic...
-
-// *****************************************************************************
-// lefiNonDefault
-// *****************************************************************************
-
-lefiNonDefault::lefiNonDefault()
-: nameSize_(0),
-  name_(NULL),
-  numLayers_(0),
-  layersAllocated_(0),
-  layerName_(NULL),
-  width_(NULL),
-  spacing_(NULL),
-  wireExtension_(NULL),
-  hasWidth_(NULL),
-  hasSpacing_(NULL),
-  hasWireExtension_(NULL),
-  resistance_(NULL),
-  capacitance_(NULL),
-  edgeCap_(NULL),
-  hasResistance_(NULL),
-  hasCapacitance_(NULL),
-  hasEdgeCap_(NULL),
-  diagWidth_(NULL),
-  hasDiagWidth_(NULL),
-  numVias_(0),
-  allocatedVias_(0),
-  viaRules_(NULL),
-  numSpacing_(0),
-  allocatedSpacing_(0),
-  spacingRules_(NULL),
-  hardSpacing_(0),
-  numUseVias_(0),
-  allocatedUseVias_(0),
-  useViaName_(NULL),
-  numUseViaRules_(0),
-  allocatedUseViaRules_(0),
-  useViaRuleName_(NULL),
-  numMinCuts_(0),
-  allocatedMinCuts_(0),
-  cutLayerName_(NULL),
-  numCuts_(NULL),
-  numProps_(0),
-  propsAllocated_(0),
-  names_(NULL),
-  values_(NULL),
-  dvalues_(NULL),
-  types_(NULL)
-{
-    Init();
-}
-
-void
-lefiNonDefault::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-
-    layersAllocated_ = 2;
-    numLayers_ = 0;
-    layerName_ = (char**) lefMalloc(sizeof(char*) * 2);
-    width_ = (double*) lefMalloc(sizeof(double) * 2);
-    diagWidth_ = (double*) lefMalloc(sizeof(double) * 2);
-    spacing_ = (double*) lefMalloc(sizeof(double) * 2);
-    wireExtension_ = (double*) lefMalloc(sizeof(double) * 2);
-    resistance_ = (double*) lefMalloc(sizeof(double) * 2);
-    capacitance_ = (double*) lefMalloc(sizeof(double) * 2);
-    edgeCap_ = (double*) lefMalloc(sizeof(double) * 2);
-    hasWidth_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasDiagWidth_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasSpacing_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasWireExtension_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasResistance_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasCapacitance_ = (char*) lefMalloc(sizeof(char) * 2);
-    hasEdgeCap_ = (char*) lefMalloc(sizeof(char) * 2);
-
-    allocatedVias_ = 2;
-    numVias_ = 0;
-    viaRules_ = (lefiVia**) lefMalloc(sizeof(lefiVia*) * 2);
-
-    allocatedSpacing_ = 2;
-    numSpacing_ = 0;
-    spacingRules_ = (lefiSpacing**) lefMalloc(sizeof(lefiSpacing*) * 2);
-
-    numProps_ = 0;
-    propsAllocated_ = 1;
-    names_ = (char**) lefMalloc(sizeof(char*));
-    values_ = (char**) lefMalloc(sizeof(char*));
-    dvalues_ = (double*) lefMalloc(sizeof(double));
-    types_ = (char*) lefMalloc(sizeof(char));
-
-    hardSpacing_ = 0;
-    numUseVias_ = 0;             // Won't be allocated until they are used
-    allocatedUseVias_ = 0;
-    numUseViaRules_ = 0;
-    allocatedUseViaRules_ = 0;
-    numMinCuts_ = 0;
-    allocatedMinCuts_ = 0;
-}
-
-void
-lefiNonDefault::Destroy()
-{
-    clear();
-
-    lefFree(name_);
-
-    lefFree((char*) (layerName_));
-    lefFree((char*) (width_));
-    lefFree((char*) (diagWidth_));
-    lefFree((char*) (spacing_));
-    lefFree((char*) (wireExtension_));
-    lefFree((char*) (resistance_));
-    lefFree((char*) (capacitance_));
-    lefFree((char*) (edgeCap_));
-    lefFree(hasWidth_);
-    lefFree(hasDiagWidth_);
-    lefFree(hasSpacing_);
-    lefFree(hasWireExtension_);
-    lefFree(hasResistance_);
-    lefFree(hasCapacitance_);
-    lefFree(hasEdgeCap_);
-
-    lefFree((char*) (viaRules_));
-
-    lefFree((char*) (spacingRules_));
-    lefFree((char*) (names_));
-    lefFree((char*) (values_));
-    lefFree((char*) (dvalues_));
-    lefFree((char*) (types_));
-    if (allocatedUseVias_)
-        lefFree((char*) (useViaName_));
-    if (allocatedUseViaRules_)
-        lefFree((char*) (useViaRuleName_));
-    if (allocatedMinCuts_) {
-        lefFree((char*) (cutLayerName_));
-        lefFree((char*) (numCuts_));
-    }
-    allocatedUseVias_ = 0;
-    allocatedUseViaRules_ = 0;
-    allocatedMinCuts_ = 0;
-}
-
-lefiNonDefault::~lefiNonDefault()
-{
-    Destroy();
-}
-
-void
-lefiNonDefault::clear()
-{
-    int         i;
-    lefiSpacing *sr;
-    lefiVia     *vr;
-
-    for (i = 0; i < numProps_; i++) {
-        lefFree(names_[i]);
-        lefFree(values_[i]);
-        dvalues_[i] = 0;
-    }
-    numProps_ = 0;
-    for (i = 0; i < numLayers_; i++) {
-        lefFree(layerName_[i]);
-        layerName_[i] = 0;
-    }
-    numLayers_ = 0;
-    for (i = 0; i < numVias_; i++) {
-        vr = viaRules_[i];
-        vr->Destroy();
-        lefFree((char*) (viaRules_[i]));
-        viaRules_[i] = 0;
-    }
-    numVias_ = 0;
-    for (i = 0; i < numSpacing_; i++) {
-        sr = spacingRules_[i];
-        sr->Destroy();
-        lefFree((char*) (spacingRules_[i]));
-        spacingRules_[i] = 0;
-    }
-    numSpacing_ = 0;
-
-    hardSpacing_ = 0;
-    for (i = 0; i < numUseVias_; i++) {
-        lefFree((char*) (useViaName_[i]));
-    }
-    numUseVias_ = 0;
-    for (i = 0; i < numUseViaRules_; i++) {
-        lefFree((char*) (useViaRuleName_[i]));
-    }
-    numUseViaRules_ = 0;
-    for (i = 0; i < numMinCuts_; i++) {
-        lefFree((char*) (cutLayerName_[i]));
-    }
-    numMinCuts_ = 0;
-}
-
-void
-lefiNonDefault::addViaRule(lefiVia *v)
-{
-    if (numVias_ == allocatedVias_) {
-        int     i;
-        lefiVia **nv;
-
-        if (allocatedVias_ == 0)
-            allocatedVias_ = 2;
-        else
-            allocatedVias_ *= 2;
-        nv = (lefiVia**) lefMalloc(sizeof(lefiVia*) * allocatedVias_);
-        for (i = 0; i < numVias_; i++) {
-            nv[i] = viaRules_[i];
-        }
-        lefFree((char*) (viaRules_));
-        viaRules_ = nv;
-    }
-    viaRules_[numVias_++] = v->clone();
-}
-
-void
-lefiNonDefault::addSpacingRule(lefiSpacing *s)
-{
-    if (numSpacing_ == allocatedSpacing_) {
-        int         i;
-        lefiSpacing **ns;
-
-        if (allocatedSpacing_ == 0)
-            allocatedSpacing_ = 2;
-        else
-            allocatedSpacing_ *= 2;
-        ns = (lefiSpacing**) lefMalloc(sizeof(lefiSpacing*) *
-                                       allocatedSpacing_);
-        for (i = 0; i < numSpacing_; i++) {
-            ns[i] = spacingRules_[i];
-        }
-        lefFree((char*) (spacingRules_));
-        spacingRules_ = ns;
-    }
-    spacingRules_[numSpacing_++] = s->clone();
-}
-
-void
-lefiNonDefault::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    clear();
-
-    // Use our callback functions because a via and spacing
-    // rule is really part of the non default section.
-    // oldViaCbk_ = (void*)lefrViaCbk;
-    // oldSpacingCbk_ = (void*)lefrSpacingCbk;
-    // oldSpacingBeginCbk_ = (void*)lefrSpacingBeginCbk;
-    // oldSpacingEndCbk_ = (void*)lefrSpacingEndCbk;
-    //oldUserData_ = lefrGetUserData();
-    //oldViaCbk = lefCallbacks->ViaCbk;
-    //oldSpacingCbk = lefCallbacks->SpacingCbk;
-    //oldSpacingBeginCbk = lefCallbacks->SpacingBeginCbk;
-    //oldSpacingEndCbk = lefCallbacks->SpacingEndCbk;
-    //lefCallbacks->ViaCbk = lefiNonDefaultViaCbk;
-    //lefCallbacks->SpacingCbk = lefiNonDefaultSpacingCbk;
-    //lefCallbacks->SpacingBeginCbk = 0;
-    // lefCallbacks->SpacingEndCbk = 0;
-    // pcr 909010, instead of saving the pointer in userData,
-    // save it in the global lefData->nd.
-    // lefrSetUserData((lefiUserData)this);
-
-    lefData->nd = this;
-
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiNonDefault::addLayer(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (numLayers_ == layersAllocated_) {
-        int     i;
-        char    **newl;
-        double  *neww;
-        double  *newd;
-        double  *news;
-        double  *newe;
-        double  *newc;
-        double  *newr;
-        double  *newec;
-        char    *newhw;
-        char    *newhd;
-        char    *newhs;
-        char    *newhe;
-        char    *newhc;
-        char    *newhr;
-        char    *newhec;
-
-        if (layersAllocated_ == 0)
-            layersAllocated_ = 2;
-        else
-            layersAllocated_ *= 2;
-        newl = (char**) lefMalloc(sizeof(char*) *
-                                  layersAllocated_);
-        newe = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        neww = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        newd = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        news = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        newc = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        newr = (double*) lefMalloc(sizeof(double) *
-                                   layersAllocated_);
-        newec = (double*) lefMalloc(sizeof(double) *
-                                    layersAllocated_);
-        newhe = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhw = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhd = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhs = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhc = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhr = (char*) lefMalloc(sizeof(char) *
-                                  layersAllocated_);
-        newhec = (char*) lefMalloc(sizeof(char) *
-                                   layersAllocated_);
-        for (i = 0; i < numLayers_; i++) {
-            newl[i] = layerName_[i];
-            neww[i] = width_[i];
-            newd[i] = diagWidth_[i];
-            news[i] = spacing_[i];
-            newe[i] = wireExtension_[i];
-            newc[i] = capacitance_[i];
-            newr[i] = resistance_[i];
-            newec[i] = edgeCap_[i];
-            newhe[i] = hasWireExtension_[i];
-            newhw[i] = hasWidth_[i];
-            newhd[i] = hasDiagWidth_[i];
-            newhs[i] = hasSpacing_[i];
-            newhc[i] = hasCapacitance_[i];
-            newhr[i] = hasResistance_[i];
-            newhec[i] = hasEdgeCap_[i];
-        }
-        lefFree((char*) (layerName_));
-        lefFree((char*) (width_));
-        lefFree((char*) (diagWidth_));
-        lefFree((char*) (spacing_));
-        lefFree((char*) (wireExtension_));
-        lefFree((char*) (capacitance_));
-        lefFree((char*) (resistance_));
-        lefFree((char*) (edgeCap_));
-        lefFree((char*) (hasWireExtension_));
-        lefFree((char*) (hasWidth_));
-        lefFree((char*) (hasDiagWidth_));
-        lefFree((char*) (hasSpacing_));
-        lefFree((char*) (hasCapacitance_));
-        lefFree((char*) (hasResistance_));
-        lefFree((char*) (hasEdgeCap_));
-        layerName_ = newl;
-        width_ = neww;
-        diagWidth_ = newd;
-        spacing_ = news;
-        wireExtension_ = newe;
-        capacitance_ = newc;
-        resistance_ = newr;
-        edgeCap_ = newec;
-        hasWidth_ = newhw;
-        hasDiagWidth_ = newhd;
-        hasSpacing_ = newhs;
-        hasWireExtension_ = newhe;
-        hasCapacitance_ = newhc;
-        hasResistance_ = newhr;
-        hasEdgeCap_ = newhec;
-    }
-    layerName_[numLayers_] = (char*) lefMalloc(len);
-    strcpy(layerName_[numLayers_], CASE(name));
-    width_[numLayers_] = 0.0;
-    diagWidth_[numLayers_] = 0.0;
-    spacing_[numLayers_] = 0.0;
-    wireExtension_[numLayers_] = 0.0;
-    capacitance_[numLayers_] = 0.0;
-    resistance_[numLayers_] = 0.0;
-    edgeCap_[numLayers_] = 0.0;
-    hasWidth_[numLayers_] = '\0';
-    hasDiagWidth_[numLayers_] = '\0';
-    hasSpacing_[numLayers_] = '\0';
-    hasWireExtension_[numLayers_] = '\0';
-    hasCapacitance_[numLayers_] = '\0';
-    hasResistance_[numLayers_] = '\0';
-    hasEdgeCap_[numLayers_] = '\0';
-    numLayers_ += 1;
-}
-
-void
-lefiNonDefault::addWidth(double num)
-{
-    width_[numLayers_ - 1] = num;
-    hasWidth_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addDiagWidth(double num)
-{
-    diagWidth_[numLayers_ - 1] = num;
-    hasDiagWidth_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addSpacing(double num)
-{
-    spacing_[numLayers_ - 1] = num;
-    hasSpacing_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addWireExtension(double num)
-{
-    wireExtension_[numLayers_ - 1] = num;
-    hasWireExtension_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addCapacitance(double num)
-{
-    capacitance_[numLayers_ - 1] = num;
-    hasCapacitance_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addResistance(double num)
-{
-    resistance_[numLayers_ - 1] = num;
-    hasResistance_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::addEdgeCap(double num)
-{
-    edgeCap_[numLayers_ - 1] = num;
-    hasEdgeCap_[numLayers_ - 1] = 1;
-}
-
-void
-lefiNonDefault::setHardspacing()
-{
-    hardSpacing_ = 1;
-}
-
-void
-lefiNonDefault::addUseVia(const char *name)
-{
-    if (numUseVias_ == allocatedUseVias_) {
-        int     i;
-        char    **vn;
-
-        if (allocatedUseVias_ == 0)
-            allocatedUseVias_ = 2;
-        else
-            allocatedUseVias_ *= 2;
-        vn = (char**) lefMalloc(sizeof(char*) * allocatedUseVias_);
-        for (i = 0; i < numUseVias_; i++) {
-            vn[i] = useViaName_[i];
-        }
-        if (numUseVias_)
-            lefFree((char*) (useViaName_));
-        useViaName_ = vn;
-    }
-    useViaName_[numUseVias_] = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(useViaName_[numUseVias_], CASE(name));
-    numUseVias_ += 1;
-}
-
-void
-lefiNonDefault::addUseViaRule(const char *name)
-{
-    if (numUseViaRules_ == allocatedUseViaRules_) {
-        int     i;
-        char    **vn;
-
-        if (allocatedUseViaRules_ == 0)
-            allocatedUseViaRules_ = 2;
-        else
-            allocatedUseViaRules_ *= 2;
-        vn = (char**) lefMalloc(sizeof(char*) * allocatedUseViaRules_);
-        for (i = 0; i < numUseViaRules_; i++) {
-            vn[i] = useViaRuleName_[i];
-        }
-        if (numUseViaRules_)
-            lefFree((char*) (useViaRuleName_));
-        useViaRuleName_ = vn;
-    }
-    useViaRuleName_[numUseViaRules_] = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(useViaRuleName_[numUseViaRules_], CASE(name));
-    numUseViaRules_ += 1;
-}
-
-void
-lefiNonDefault::addMinCuts(const char   *name,
-                           int          numCuts)
-{
-    if (numMinCuts_ == allocatedMinCuts_) {
-        int     i;
-        char    **cn;
-        int     *nc;
-
-        if (allocatedMinCuts_ == 0)
-            allocatedMinCuts_ = 2;
-        else
-            allocatedMinCuts_ *= 2;
-        cn = (char**) lefMalloc(sizeof(char*) * allocatedMinCuts_);
-        nc = (int*) lefMalloc(sizeof(int) * allocatedMinCuts_);
-        for (i = 0; i < numMinCuts_; i++) {
-            cn[i] = cutLayerName_[i];
-            nc[i] = numCuts_[i];
-        }
-        if (numMinCuts_) {
-            lefFree((char*) (cutLayerName_));
-            lefFree((char*) (numCuts_));
-        }
-        cutLayerName_ = cn;
-        numCuts_ = nc;
-    }
-    cutLayerName_[numMinCuts_] = (char*) lefMalloc(strlen(name) + 1);
-    strcpy(cutLayerName_[numMinCuts_], CASE(name));
-    numCuts_[numMinCuts_] = numCuts;
-    numMinCuts_ += 1;
-}
-
-void
-lefiNonDefault::end()
-{
-    // Return the callbacks to their normal state.
-    // lefrSetViaCbk((lefrViaCbkFnType)oldViaCbk_);
-    // lefrSetSpacingCbk((lefrSpacingCbkFnType)oldSpacingCbk_);
-    // lefrSetSpacingBeginCbk((lefrVoidCbkFnType)oldSpacingBeginCbk_);
-    // lefrSetSpacingEndCbk((lefrVoidCbkFnType)oldSpacingEndCbk_);
-    //lefrSetViaCbk(oldViaCbk);
-    //lefrSetSpacingCbk(oldSpacingCbk);
-    //lefrSetSpacingBeginCbk(oldSpacingBeginCbk);
-    //lefrSetSpacingEndCbk(oldSpacingEndCbk);
-    // pcr 909010 - global var lefData->nd is used to pass nondefault rule data
-    // lefrSetUserData(oldUserData_);
-    lefData->nd = 0;
-}
-
-int
-lefiNonDefault::numLayers() const
-{
-    return numLayers_;
-}
-
-const char *
-lefiNonDefault::layerName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return layerName_[index];
-}
-
-int
-lefiNonDefault::hasLayerWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasWidth_[index];
-}
-
-double
-lefiNonDefault::layerWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return width_[index];
-}
-
-int
-lefiNonDefault::hasLayerDiagWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasDiagWidth_[index];
-}
-
-double
-lefiNonDefault::layerDiagWidth(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return diagWidth_[index];
-}
-
-int
-lefiNonDefault::hasLayerWireExtension(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasWireExtension_[index];
-}
-
-int
-lefiNonDefault::hasLayerSpacing(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasSpacing_[index];
-}
-
-double
-lefiNonDefault::layerWireExtension(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return wireExtension_[index];
-}
-
-double
-lefiNonDefault::layerSpacing(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return spacing_[index];
-}
-
-int
-lefiNonDefault::hasLayerResistance(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasResistance_[index];
-}
-
-double
-lefiNonDefault::layerResistance(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return resistance_[index];
-}
-
-int
-lefiNonDefault::hasLayerCapacitance(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasCapacitance_[index];
-}
-
-double
-lefiNonDefault::layerCapacitance(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return capacitance_[index];
-}
-
-int
-lefiNonDefault::hasLayerEdgeCap(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0;
-    }
-    return hasEdgeCap_[index];
-}
-
-double
-lefiNonDefault::layerEdgeCap(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1402): The index number %d given for the NONDEFAULT LAYER is invalid.\nValid index is from 0 to %d", index, numLayers_);
-        lefiError(0, 1402, msg);
-        return 0.0;
-    }
-    return edgeCap_[index];
-}
-
-int
-lefiNonDefault::numVias() const
-{
-    return numVias_;
-}
-
-lefiVia *
-lefiNonDefault::viaRule(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numVias_) {
-        sprintf(msg, "ERROR (LEFPARS-1403): The index number %d given for the NONDEFAULT VIA is invalid.\nValid index is from 0 to %d", index, numVias_);
-        lefiError(0, 1403, msg);
-        return 0;
-    }
-    return viaRules_[index];
-}
-
-int
-lefiNonDefault::numSpacingRules() const
-{
-    return numSpacing_;
-}
-
-lefiSpacing *
-lefiNonDefault::spacingRule(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numSpacing_) {
-        sprintf(msg, "ERROR (LEFPARS-1404): The index number %d given for the NONDEFAULT SPACING is invalid.\nValid index is from 0 to %d", index, numSpacing_);
-        lefiError(0, 1404, msg);
-        return 0;
-    }
-    return spacingRules_[index];
-}
-
-const char *
-lefiNonDefault::name() const
-{
-    return name_;
-}
-
-int
-lefiNonDefault::hasHardspacing() const
-{
-    return hardSpacing_;
-}
-
-int
-lefiNonDefault::numUseVia() const
-{
-    return numUseVias_;
-}
-
-const char *
-lefiNonDefault::viaName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numUseVias_) {
-        sprintf(msg, "ERROR (LEFPARS-1405): The index number %d given for the NONDEFAULT USE VIA is invalid.\nValid index is from 0 to %d", index, numUseVias_);
-        lefiError(0, 1405, msg);
-        return 0;
-    }
-    return useViaName_[index];
-}
-
-int
-lefiNonDefault::numUseViaRule() const
-{
-    return numUseViaRules_;
-}
-
-const char *
-lefiNonDefault::viaRuleName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numUseViaRules_) {
-        sprintf(msg, "ERROR (LEFPARS-1406): The index number %d given for the NONDEFAULT USE VIARULE is invalid.\nValid index is from 0 to %d", index, numUseViaRules_);
-        lefiError(0, 1406, msg);
-        return 0;
-    }
-    return useViaRuleName_[index];
-}
-
-int
-lefiNonDefault::numMinCuts() const
-{
-    return numMinCuts_;
-}
-
-const char *
-lefiNonDefault::cutLayerName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numMinCuts_) {
-        sprintf(msg, "ERROR (LEFPARS-1407): The index number %d given for the NONDEFAULT CUT is invalid.\nValid index is from 0 to %d", index, numMinCuts_);
-        lefiError(0, 1407, msg);
-        return 0;
-    }
-    return cutLayerName_[index];
-}
-
-int
-lefiNonDefault::numCuts(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numMinCuts_) {
-        sprintf(msg, "ERROR (LEFPARS-1407): The index number %d given for the NONDEFAULT CUT is invalid.\nValid index is from 0 to %d", index, numMinCuts_);
-        lefiError(0, 1407, msg);
-        return 0;
-    }
-    return numCuts_[index];
-}
-
-void
-lefiNonDefault::print(FILE *f)
-{
-    int         i;
-    lefiSpacing *s;
-    lefiVia     *v;
-
-    fprintf(f, "Nondefault rule %s\n",
-            name());
-    fprintf(f, "%d layers   %d vias   %d spacing rules\n",
-            numLayers(),
-            numVias(),
-            numSpacingRules());
-
-    for (i = 0; i < numLayers(); i++) {
-        fprintf(f, "  Layer %s\n", layerName(i));
-        if (hasLayerWidth(i))
-            fprintf(f, "    WIDTH %g\n", layerWidth(i));
-        if (hasLayerDiagWidth(i))
-            fprintf(f, "    DIAGWIDTH %g\n", layerDiagWidth(i));
-        if (hasLayerSpacing(i))
-            fprintf(f, "    SPACING %g\n", layerSpacing(i));
-        if (hasLayerWireExtension(i))
-            fprintf(f, "    WIREEXTENSION %g",
-                    layerWireExtension(i));
-        if (hasLayerResistance(i))
-            fprintf(f, "    RESISTANCE RPERSQ %g\n",
-                    layerResistance(i));
-        if (hasLayerCapacitance(i))
-            fprintf(f, "    CAPACITANCE CPERSQDIST %g\n",
-                    layerCapacitance(i));
-        if (hasLayerEdgeCap(i))
-            fprintf(f, "    EDGECAPACITANCE %g\n",
-                    layerEdgeCap(i));
-    }
-
-    for (i = 0; i < numVias(); i++) {
-        v = viaRule(i);
-        v->print(f);
-    }
-
-    for (i = 0; i < numSpacingRules(); i++) {
-        s = spacingRule(i);
-        s->print(f);
-    }
-}
-
-int
-lefiNonDefault::numProps() const
-{
-    return numProps_;
-}
-
-void
-lefiNonDefault::addProp(const char  *name,
-                        const char  *value,
-                        const char  type)
-{
-    int len = strlen(name) + 1;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numProps_;
-        char    **nn;
-        char    **nv;
-        double  *nD;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            max = propsAllocated_ = 2;
-        else
-            max = propsAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nD = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nD[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nD;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = 0;
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-void
-lefiNonDefault::addNumProp(const char   *name,
-                           const double d,
-                           const char   *value,
-                           const char   type)
-{
-    int len = strlen(name) + 1;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim = numProps_;
-        char    **nn;
-        char    **nv;
-        double  *nD;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            max = propsAllocated_ = 2;
-        else
-            max = propsAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nD = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nD[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nD;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = d;
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-const char *
-lefiNonDefault::propName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return names_[index];
-}
-
-const char *
-lefiNonDefault::propValue(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return values_[index];
-}
-
-double
-lefiNonDefault::propNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return dvalues_[index];
-}
-
-const char
-lefiNonDefault::propType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return types_[index];
-}
-
-int
-lefiNonDefault::propIsNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return dvalues_[index] ? 1 : 0;
-}
-
-int
-lefiNonDefault::propIsString(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1408): The index number %d given for the NONDEFAULT PROPERTY is invalid.\nValid index is from 0 to %d", index, numProps_);
-        lefiError(0, 1408, msg);
-        return 0;
-    }
-    return dvalues_[index] ? 0 : 1;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.hpp
deleted file mode 100644
index 7745af7..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiNonDefault.hpp
+++ /dev/null
@@ -1,178 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiNonDefault_h
-#define lefiNonDefault_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-#include "lefiVia.hpp"
-#include "lefiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiNonDefault {
-public:
-  lefiNonDefault();
-  void Init();
-
-  void Destroy();
-  ~lefiNonDefault();
-
-  void setName(const char* name);
-  void addLayer(const char* name);
-  void addWidth(double num);
-  void addWireExtension(double num);
-  void addSpacing(double num);
-  void addSpacingRule(lefiSpacing* s);
-  void addResistance(double num);
-  void addCapacitance(double num);
-  void addEdgeCap(double num);
-  void addViaRule(lefiVia* v);
-  void addDiagWidth(double num);                    // 5.6
-  void end();
-  void clear();
-  void addProp(const char* name, const char* value, const char type);
-  void addNumProp(const char* name, const double d,
-                  const char* value, const char type);
-  void setHardspacing();                            // 5.6
-  void addUseVia(const char* name);                 // 5.6
-  void addUseViaRule(const char* name);             // 5.6
-  void addMinCuts(const char* name, int numCuts);   // 5.6
-
-  const char* name() const;
-  int   hasHardspacing() const;                     // 5.6
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-  
-  // A non default rule can have one or more layers.
-  // The layer information is kept in an array.
-  int numLayers() const ;
-  const char* layerName(int index) const ;
-  int hasLayerWidth(int index) const;
-  double layerWidth(int index) const ;
-  int hasLayerSpacing(int index) const ;
-  double layerSpacing(int index) const ;
-  int hasLayerWireExtension(int index) const ;
-  double layerWireExtension(int index) const ;
-  int hasLayerResistance(int index) const;       // obsolete in 5.6
-  double layerResistance(int index) const;       // obsolete in 5.6
-  int hasLayerCapacitance(int index) const;      // obsolete in 5.6
-  double layerCapacitance(int index) const;      // obsolete in 5.6
-  int hasLayerEdgeCap(int index) const;          // obsolete in 5.6
-  double layerEdgeCap(int index) const;          // obsolete in 5.6
-  int hasLayerDiagWidth(int index) const;        // 5.6
-  double layerDiagWidth(int index) const;        // 5.6
-
-  // A non default rule can have one or more vias.
-  // These routines return the via info.
-  int numVias() const ;
-  lefiVia* viaRule(int index) const ;
-
-  // A non default rule can have one or more spacing rules.
-  // These routines return the that info.
-  int numSpacingRules() const ;
-  lefiSpacing* spacingRule(int index) const ;
-
-  int numUseVia() const;                         // 5.6
-  const char* viaName(int index) const;          // 5.6
-  int numUseViaRule() const;                     // 5.6
-  const char* viaRuleName(int index) const;      // 5.6
-  int numMinCuts() const;                        // 5.6
-  const char* cutLayerName(int index) const;     // 5.6
-  int numCuts(int index) const;                  // 5.6
-
-  // Debug print
-  void print(FILE* f);
-
-protected:
-  int nameSize_;
-  char* name_;
-
-  // Layer information
-  int numLayers_;
-  int layersAllocated_;
-  char** layerName_;
-  double* width_;
-  double* spacing_;
-  double* wireExtension_;
-  char* hasWidth_;
-  char* hasSpacing_;
-  char* hasWireExtension_;
-
-  // 5.4
-  double* resistance_;
-  double* capacitance_;
-  double* edgeCap_;
-  char*   hasResistance_;
-  char*   hasCapacitance_;
-  char*   hasEdgeCap_;
-
-  double* diagWidth_;              // 5.6
-  char*   hasDiagWidth_;           // 5.6
-
-  int numVias_;
-  int allocatedVias_;
-  lefiVia** viaRules_;
-
-  int numSpacing_;
-  int allocatedSpacing_;
-  lefiSpacing** spacingRules_;
-
-  int    hardSpacing_;             // 5.6
-  int    numUseVias_;              // 5.6
-  int    allocatedUseVias_;        // 5.6
-  char** useViaName_;              // 5.6
-  int    numUseViaRules_;          // 5.6
-  int    allocatedUseViaRules_;    // 5.6
-  char** useViaRuleName_;          // 5.6
-  int    numMinCuts_;              // 5.6
-  int    allocatedMinCuts_;        // 5.6
-  char** cutLayerName_;            // 5.6
-  int*   numCuts_;                 // 5.6
-
-  int numProps_;
-  int propsAllocated_;
-  char**  names_;
-  char**  values_;
-  double* dvalues_;
-  char*   types_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.cpp
deleted file mode 100644
index c2cc117..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiProp.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-lefiProp::lefiProp()
-: propType_(NULL),
-  propName_(NULL),
-  nameSize_(0),
-  hasRange_(0),
-  hasNumber_(0),
-  hasNameMapString_(0),
-  dataType_(0),
-  stringData_(NULL),
-  stringLength_(0),
-  left_(0.0),
-  right_(0.0),
-  d_(0.0)
-{
-    Init();
-}
-
-void
-lefiProp::Init()
-{
-    stringLength_ = 16;
-    stringData_ = (char*) lefMalloc(16);
-    nameSize_ = 16;
-    propName_ = (char*) lefMalloc(16);
-    clear();
-}
-
-void
-lefiProp::Destroy()
-{
-    lefFree(stringData_);
-    lefFree(propName_);
-}
-
-lefiProp::~lefiProp()
-{
-    Destroy();
-}
-
-void
-lefiProp::setPropType(const char    *typ,
-                      const char    *string)
-{
-    int len;
-    propType_ = (char*) typ;
-    if ((len = strlen(string) + 1) > nameSize_)
-        bumpName(len);
-    strcpy(propName_, CASE(string));
-}
-
-void
-lefiProp::setRange(double   left,
-                   double   right)
-{
-    hasRange_ = 1;
-    left_ = left;
-    right_ = right;
-}
-
-void
-lefiProp::setNumber(double d)
-{
-    hasNumber_ = 1;
-    d_ = d;
-}
-
-void
-lefiProp::setPropInteger()
-{
-    dataType_ = 'I';
-}
-
-void
-lefiProp::setPropReal()
-{
-    dataType_ = 'R';
-}
-
-void
-lefiProp::setPropString()
-{
-    dataType_ = 'S';
-}
-
-void
-lefiProp::setPropQString(const char *string)
-{
-    int len;
-    dataType_ = 'Q';
-    if ((len = strlen(string) + 1) > stringLength_)
-        bumpSize(len);
-    strcpy(stringData_, CASE(string));
-}
-
-void
-lefiProp::setPropNameMapString(const char *string)
-{
-    int len;
-    dataType_ = 'N';
-    hasNameMapString_ = 1;
-    if ((len = strlen(string) + 1) > stringLength_)
-        bumpSize(len);
-    strcpy(stringData_, CASE(string));
-}
-
-const char *
-lefiProp::string() const
-{
-    return stringData_;
-}
-
-const char *
-lefiProp::propType() const
-{
-    return propType_;
-}
-
-int
-lefiProp::hasNumber() const
-{
-    return (int) (hasNumber_);
-}
-
-int
-lefiProp::hasRange() const
-{
-    return (int) (hasRange_);
-}
-
-double
-lefiProp::number() const
-{
-    return d_;
-}
-
-double
-lefiProp::left() const
-{
-    return left_;
-}
-
-double
-lefiProp::right() const
-{
-    return right_;
-}
-
-void
-lefiProp::bumpSize(int size)
-{
-    lefFree(stringData_);
-    stringData_ = (char*) lefMalloc(size);
-    stringLength_ = size;
-    *(stringData_) = '\0';
-}
-
-void
-lefiProp::bumpName(int size)
-{
-    lefFree(propName_);
-    propName_ = (char*) lefMalloc(size);
-    nameSize_ = size;
-    *(propName_) = '\0';
-}
-
-void
-lefiProp::clear()
-{
-    if (stringData_)
-        *(stringData_) = '\0';
-    if (stringData_)
-        *(propName_) = '\0';
-    propType_ = 0;
-    hasRange_ = 0;
-    hasNumber_ = 0;
-    hasNameMapString_ = 0;
-    dataType_ = 'B'; // bogus 
-    d_ = left_ = right_ = 0.0;
-}
-
-int
-lefiProp::hasString() const
-{
-    return *(stringData_) ? 1 : 0;
-}
-
-int
-lefiProp::hasNameMapString() const
-{
-    return (hasNameMapString_) ? 1 : 0;
-}
-
-const char *
-lefiProp::propName() const
-{
-    return (propName_);
-}
-
-char
-lefiProp::dataType() const
-{
-    return (dataType_);
-}
-
-void
-lefiProp::print(FILE *f) const
-{
-    fprintf(f, "Prop type '%s'\n", propType());
-    if (hasString()) {
-        fprintf(f, "  string '%s'\n", string());
-    }
-    if (hasNumber()) {
-        fprintf(f, "  number %5.2f\n", number());
-    }
-    if (hasRange()) {
-        fprintf(f, "  range %5.2f - %5.2f\n",
-                left(), right());
-    }
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.hpp
deleted file mode 100644
index ef6338a..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiProp.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiProp_h
-#define lefiProp_h
-
-#include "lefiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Struct holds the data for one property.
-class lefiProp {
-public:
-  lefiProp();
-  void Init();
-
-  void Destroy();
-  ~lefiProp();
-
-  void setPropType(const char* typ, const char* string);
-  void setRange(double left, double right);
-  void setNumber(double num);
-  void setPropInteger();
-  void setPropReal();
-  void setPropString();
-  void setPropQString(const char* string);
-  void setPropNameMapString(const char* string);
-  void clear();
-
-  const char* string() const;
-  const char* propType() const;
-  const char* propName() const;
-  char  dataType() const;
-      // either I:integer R:real S:string Q:quotedstring
-      // N:property name is not defined in the property definition section
-  int hasNumber() const;
-  int hasRange() const;
-  int hasString() const;
-  int hasNameMapString() const;
-  double number() const;
-  double left() const;
-  double right() const;
-
-  void bumpSize(int size);
-  void bumpName(int size);
-
-  void print(FILE* f) const;
-
-protected:
-  char* propType_;      // "design" "net" "macro" ...
-  char* propName_;      // name.
-  int nameSize_;        // allocated size of name.
-  char hasRange_;       // either 0:NO or 1:YES.
-  char hasNumber_;      // either 0:NO or 1:YES.
-  char hasNameMapString_;
-  char dataType_;       // either I:integer R:real S:string Q:quotedstring.
-            // N:property name is not defined.
-  char* stringData_;    // if it is a string the data is here.
-  int stringLength_;    // allocated size of stringData.
-  double left_;
-  double right_; // if it has a range the numbers are here.
-  double d_;            // if it is a real or int the number is here.
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.cpp
deleted file mode 100644
index 06c99a1..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiPropType.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-lefiPropType::lefiPropType()
-: numProperties_(0),
-  propertiesAllocated_(0),
-  propNames_(NULL),
-  propTypes_(NULL)
-{
-    Init();
-}
-
-void
-lefiPropType::Init()
-{
-    numProperties_ = 0;
-    propertiesAllocated_ = 0;
-    propNames_ = 0;
-    propTypes_ = 0;
-}
-
-void
-lefiPropType::Clear()
-{
-    int i;
-
-    for (i = 0; i < numProperties_; i++) {
-        free(propNames_[i]);
-    }
-    numProperties_ = 0;
-    propertiesAllocated_ = 0;
-}
-
-void
-lefiPropType::Destroy()
-{
-    Clear();
-    if (propNames_)
-        free(propNames_);
-    if (propTypes_)
-        free(propTypes_);
-}
-
-lefiPropType::~lefiPropType()
-{
-    Destroy();
-}
-
-void
-lefiPropType::setPropType(const char    *name,
-                          const char    type)
-{
-    int len;
-
-    if (numProperties_ == propertiesAllocated_)
-        bumpProps();
-    len = strlen(name) + 1;
-    propNames_[numProperties_] = (char*) malloc(len);
-    strcpy(propNames_[numProperties_], CASE(name));
-    propTypes_[numProperties_] = type;
-    numProperties_ += 1;
-}
-
-void
-lefiPropType::bumpProps()
-{
-    int     lim = propertiesAllocated_;
-    int     news;
-    char    **newpn;
-    char    *newt;
-
-    news = lim ? lim + lim : 2;
-
-    newpn = (char**) malloc(sizeof(char*) * news);
-    newt = (char*) malloc(sizeof(char) * news);
-
-    lim = propertiesAllocated_ = news;
-
-    if (lim > 2) {
-        int i;
-        for (i = 0; i < numProperties_; i++) {
-            newpn[i] = propNames_[i];
-            newt[i] = propTypes_[i];
-        }
-        free((char*) (propNames_));
-        free((char*) (propTypes_));
-    }
-    propNames_ = newpn;
-    propTypes_ = newt;
-}
-
-const char
-lefiPropType::propType(char *name) const
-{
-    int i;
-
-    // Name is NULL, error
-    if (!name)
-        return ('N');
-
-    for (i = 0; i < numProperties_; i++) {
-        if (strcmp(name, propNames_[i]) == 0)
-            return (propTypes_[i]);  // found the prop name
-    }
-    return ('N'); // Can't found the name
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.hpp
deleted file mode 100644
index 88249a6..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiPropType.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiPropType_h
-#define lefiPropType_h
-
-#include "lefiKRDefs.hpp"
-#include <stdio.h>
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Struct holds the data type for one property, if the property is
-// either REAL or INTEGER.
-class lefiPropType {
-public:
-  lefiPropType();
-  void Init();
-
-  void Destroy();
-  ~lefiPropType();
-
-  void setPropType(const char* name, const char type);
-  void Clear();
-
-  const char propType(char* name) const;
-  void bumpProps();
-
-protected:
-  int    numProperties_;
-  int    propertiesAllocated_;
-  char** propNames_;      // name.
-  char*  propTypes_;      // 'R' == "REAL", 'I' == "INTEGER"
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiTBExt.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiTBExt.cpp
deleted file mode 100644
index e6500be..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiTBExt.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-static char tagName[200] = "CDNDESYS";
-static char tagNum[24] = "CDNCHKSM";
-
-time_t
-lefiCalcTime()
-{
-    // Calculate the number for the given date
-    // The date is 5/1/99
-
-    /* Used to calculate the UTC for a time bomb date in libcai.a
-    ** see caiInitWork() function
-    */
-    struct tm ts;
-
-    ts.tm_sec = 0;
-    ts.tm_min = 0;
-    ts.tm_hour = 0;
-    ts.tm_mday = 1;
-    ts.tm_mon = 5;
-    ts.tm_year = 1999 - 1900;
-    ts.tm_wday = 0;
-    ts.tm_yday = 0;
-    ts.tm_isdst = 0;
-
-    /*
-        printf("May 1, 1999 in UTC is %d\n", mktime(&ts));
-        ts.tm_mday = 2;
-        printf("May 2, 1999 in UTC is %d\n", mktime(&ts));
-    
-        printf("Right now is %d\n", time(0));
-    */
-    return (mktime(&ts));
-}
-
-// *****************************************************************************
-// lefiTimeBomb
-// *****************************************************************************
-
-// Check the current date against the date given
-int
-lefiValidTime()
-{
-    /*  Take the timebomb out for now
-        time_t    bombTime = lefiCalcTime();
-        time_t    bombTime = 928224000;
-        time_t    curTime;
-    
-        curTime = time((time_t *)NULL);
-        if (curTime == -1 || curTime > bombTime)
-        {
-        ()printf("The demonstration version of this code is no longer\n"
-                 "available.  Please contact your Lef/Def Parser\n"
-                 "software provider for up to date code.\n");
-        return(0);
-        }
-    */
-    return (1);
-}
-
-// *****************************************************************************
-// Check if the company is authorized to use the reader
-// *****************************************************************************
-
-int
-lefiValidUser()
-{
-    int j = 0, i;
-
-    for (i = 0; i < (int) strlen(tagName); i++) {
-        j += (int) tagName[i];
-    }
-
-    if (atoi(tagNum) == j)
-        return (1);
-    return (0);
-}
-
-// *****************************************************************************
-// Return user name from tagName
-// *****************************************************************************
-
-char *
-lefiUser()
-{
-    char *tmpUser = tagName;
-    tmpUser = tmpUser + 8;
-    if (strncmp(tmpUser, "     ", 5) == 0)
-        return ((char*) "Cadence Design Systems");
-    return (tmpUser);
-}
-
-// Convert the orient from integer to string
-//
-// *****************************************************************************
-char *
-lefiOrientStr(int orient)
-{
-    switch (orient) {
-    case 0:
-        return ((char*) "N");
-    case 1:
-        return ((char*) "W");
-    case 2:
-        return ((char*) "S");
-    case 3:
-        return ((char*) "E");
-    case 4:
-        return ((char*) "FN");
-    case 5:
-        return ((char*) "FW");
-    case 6:
-        return ((char*) "FS");
-    case 7:
-        return ((char*) "FE");
-    };
-    return ((char*) "");
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.cpp
deleted file mode 100644
index 6af2e5c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-#include <stdlib.h>
-#include "lex.h"
-#include "lefiUnits.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiUnits
-// *****************************************************************************
-
-lefiUnits::lefiUnits()
-: hasDatabase_(0),
-  hasCapacitance_(0),
-  hasResistance_(0),
-  hasTime_(0),
-  hasPower_(0),
-  hasCurrent_(0),
-  hasVoltage_(0),
-  hasFrequency_(0),
-  databaseName_(NULL),
-  databaseNumber_(0.0),
-  capacitance_(0.0),
-  resistance_(0.0),
-  power_(0.0),
-  time_(0.0),
-  current_(0.0),
-  voltage_(0.0),
-  frequency_(0.0)
-{
-    Init();
-}
-
-void
-lefiUnits::Init()
-{
-    clear();
-}
-
-void
-lefiUnits::Destroy()
-{
-    clear();
-}
-
-lefiUnits::~lefiUnits()
-{
-    Destroy();
-}
-
-void
-lefiUnits::setDatabase(const char   *name,
-                       double       num)
-{
-    int len = strlen(name) + 1;
-    databaseName_ = (char*) lefMalloc(len);
-    strcpy(databaseName_, CASE(name));
-    databaseNumber_ = num;
-    hasDatabase_ = 1;
-}
-
-void
-lefiUnits::clear()
-{
-    if (databaseName_)
-        lefFree(databaseName_);
-    hasTime_ = 0;
-    hasCapacitance_ = 0;
-    hasResistance_ = 0;
-    hasPower_ = 0;
-    hasCurrent_ = 0;
-    hasVoltage_ = 0;
-    hasDatabase_ = 0;
-    hasFrequency_ = 0;
-    databaseName_ = 0;
-}
-
-void
-lefiUnits::setTime(double num)
-{
-    hasTime_ = 1;
-    time_ = num;
-}
-
-void
-lefiUnits::setCapacitance(double num)
-{
-    hasCapacitance_ = 1;
-    capacitance_ = num;
-}
-
-void
-lefiUnits::setResistance(double num)
-{
-    hasResistance_ = 1;
-    resistance_ = num;
-}
-
-void
-lefiUnits::setPower(double num)
-{
-    hasPower_ = 1;
-    power_ = num;
-}
-
-void
-lefiUnits::setCurrent(double num)
-{
-    hasCurrent_ = 1;
-    current_ = num;
-}
-
-void
-lefiUnits::setVoltage(double num)
-{
-    hasVoltage_ = 1;
-    voltage_ = num;
-}
-
-void
-lefiUnits::setFrequency(double num)
-{
-    hasFrequency_ = 1;
-    frequency_ = num;
-}
-
-int
-lefiUnits::hasDatabase() const
-{
-    return hasDatabase_;
-}
-
-int
-lefiUnits::hasCapacitance() const
-{
-    return hasCapacitance_;
-}
-
-int
-lefiUnits::hasResistance() const
-{
-    return hasResistance_;
-}
-
-int
-lefiUnits::hasPower() const
-{
-    return hasPower_;
-}
-
-int
-lefiUnits::hasCurrent() const
-{
-    return hasCurrent_;
-}
-
-int
-lefiUnits::hasVoltage() const
-{
-    return hasVoltage_;
-}
-
-int
-lefiUnits::hasFrequency() const
-{
-    return hasFrequency_;
-}
-
-int
-lefiUnits::hasTime() const
-{
-    return hasTime_;
-}
-
-const char *
-lefiUnits::databaseName() const
-{
-    return databaseName_;
-}
-
-double
-lefiUnits::databaseNumber() const
-{
-    return databaseNumber_;
-}
-
-double
-lefiUnits::capacitance() const
-{
-    return capacitance_;
-}
-
-double
-lefiUnits::resistance() const
-{
-    return resistance_;
-}
-
-double
-lefiUnits::power() const
-{
-    return power_;
-}
-
-double
-lefiUnits::current() const
-{
-    return current_;
-}
-
-double
-lefiUnits::time() const
-{
-    return time_;
-}
-
-double
-lefiUnits::voltage() const
-{
-    return voltage_;
-}
-
-double
-lefiUnits::frequency() const
-{
-    return frequency_;
-}
-
-void
-lefiUnits::print(FILE *f) const
-{
-    fprintf(f, "Units:\n");
-    if (hasTime())
-        fprintf(f, "  %g nanoseconds\n", time());
-    if (hasCapacitance())
-        fprintf(f, "  %g picofarads\n", capacitance());
-    if (hasResistance())
-        fprintf(f, "  %g ohms\n", resistance());
-    if (hasPower())
-        fprintf(f, "  %g milliwatts\n", power());
-    if (hasCurrent())
-        fprintf(f, "  %g milliamps\n", current());
-    if (hasVoltage())
-        fprintf(f, "  %g volts\n", voltage());
-    if (hasFrequency())
-        fprintf(f, "  %g frequency\n", frequency());
-    if (hasDatabase())
-        fprintf(f, "  %s %g\n", databaseName(),
-                databaseNumber());
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.hpp
deleted file mode 100644
index 12b67e6..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUnits.hpp
+++ /dev/null
@@ -1,102 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiUnits_h
-#define lefiUnits_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiUnits {
-public:
-  lefiUnits();
-  void Init();
-
-  void Destroy();
-  ~lefiUnits();
-
-  void setDatabase(const char* name, double num);
-  void clear();
-  void setTime(double num);
-  void setCapacitance(double num);
-  void setResistance(double num);
-  void setPower(double num);
-  void setCurrent(double num);
-  void setVoltage(double num);
-  void setFrequency(double num);
-
-  int hasDatabase() const;
-  int hasCapacitance()const;
-  int hasResistance() const;
-  int hasTime() const;
-  int hasPower() const;
-  int hasCurrent() const;
-  int hasVoltage() const;
-  int hasFrequency() const;
-
-  const char* databaseName() const;
-  double databaseNumber() const;
-  double capacitance() const;
-  double resistance() const;
-  double time() const;
-  double power() const;
-  double current() const;
-  double voltage() const;
-  double frequency() const;
-
-  // Debug print
-  void print(FILE* f) const ;
-
-protected:
-  int hasDatabase_;
-  int hasCapacitance_;
-  int hasResistance_;
-  int hasTime_;
-  int hasPower_;
-  int hasCurrent_;
-  int hasVoltage_;
-  int hasFrequency_;
-  char* databaseName_;
-  double databaseNumber_;
-  double capacitance_;
-  double resistance_;
-  double power_;
-  double time_;
-  double current_;
-  double voltage_;
-  double frequency_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUser.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUser.hpp
deleted file mode 100644
index 4d73944..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUser.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-//  User header file for the LEF Interface.  This includes
-//  all of the header files which are relevant to both the
-//  reader and the writer.
-// 
-//  lefrReader.h and lefwWriter.h include this file, so that
-//  an application only needs to include either lefrReader.h(pp)
-//  or lefwWriter.h(pp).
-// 
-
-#ifndef LEFI_USER_H
-#define LEFI_USER_H
-
-#include "lefiDebug.hpp"
-#include "lefiUnits.hpp"
-#include "lefiLayer.hpp"
-#include "lefiVia.hpp"
-#include "lefiViaRule.hpp"
-#include "lefiMisc.hpp"
-#include "lefiNonDefault.hpp"
-#include "lefiMacro.hpp"
-#include "lefiArray.hpp"
-#include "lefiCrossTalk.hpp"
-#include "lefiProp.hpp"
-#include "lefiPropType.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// NEW CALLBACK add the reference here 
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUtil.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUtil.hpp
deleted file mode 100644
index 6d94f82..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiUtil.hpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiUtil_h
-#define lefiUtil_h
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Structure to return Macro data to FE
-struct lefiPoints {
-  double x;
-  double y;
-};
-
-typedef struct lefiPoints lefiNum;
-
-//int lefiValidTime();
-extern int lefiValidUser();
-
-extern char* lefiUser();
-
-extern char* lefiOrientStr(int orient);
-
-extern double convert_name2num(const char *versionName);
-
-extern bool  validateMaskNumber(int num);
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.cpp
deleted file mode 100644
index 29046f5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.cpp
+++ /dev/null
@@ -1,1460 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiVia.hpp"
-#include "lefiDebug.hpp"
-#include "lefiUtil.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiViaLayer
-// *****************************************************************************
-
-lefiViaLayer::lefiViaLayer()
-: name_(NULL),
-  rectColorMask_(NULL),
-  polyColorMask_(NULL),
-  numRects_(0),
-  rectsAllocated_(0),
-  xl_(NULL),
-  yl_(NULL),
-  xh_(NULL),
-  yh_(NULL),
-  numPolys_(0),
-  polysAllocated_(0),
-  polygons_(NULL)
-{
-    Init();
-}
-
-void
-lefiViaLayer::Init()
-{
-    name_ = 0;
-    rectsAllocated_ = 2;
-    numRects_ = 0;
-    rectColorMask_ = (int*) lefMalloc(sizeof(int) * 2);
-    polyColorMask_ = (int*) lefMalloc(sizeof(int) * 2);
-    xl_ = (double*) lefMalloc(sizeof(double) * 2);
-    yl_ = (double*) lefMalloc(sizeof(double) * 2);
-    xh_ = (double*) lefMalloc(sizeof(double) * 2);
-    yh_ = (double*) lefMalloc(sizeof(double) * 2);
-    polysAllocated_ = 2;
-    numPolys_ = 0;
-    polygons_ = ((lefiGeomPolygon**)
-                 lefMalloc(sizeof(lefiGeomPolygon*) * 2));
-}
-
-void
-lefiViaLayer::Destroy()
-{
-    if (xl_) {
-        lefFree((char*) (xl_));
-        lefFree((char*) (yl_));
-        lefFree((char*) (xh_));
-        lefFree((char*) (yh_));
-    }
-    if (polygons_) {
-        lefiGeomPolygon *geom;
-        for (int i = 0; i < numPolys_; i++) {
-            geom = polygons_[i];
-            lefFree((char*) (geom->x));
-            lefFree((char*) (geom->y));
-            lefFree((char*) (polygons_[i]));
-        }
-        lefFree((char*) (polygons_));
-
-        polygons_ = 0;
-        numPolys_ = 0;
-    }
-
-    lefFree(name_);
-    lefFree((char*) (rectColorMask_));
-    lefFree((char*) (polyColorMask_));
-}
-
-lefiViaLayer::~lefiViaLayer()
-{
-    Destroy();
-}
-
-void
-lefiViaLayer::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    name_ = (char*) lefMalloc(len);
-    strcpy(name_, CASE(name));
-}
-
-void
-lefiViaLayer::addRect(int       colorMask,
-                      double    xl,
-                      double    yl,
-                      double    xh,
-                      double    yh)
-{
-    if (numRects_ == rectsAllocated_) {
-        int     i;
-        double  *newxl;
-        double  *newyl;
-        double  *newxh;
-        double  *newyh;
-        int     *rectMask;
-
-        rectsAllocated_ = (rectsAllocated_ == 0) ?
-            2 : rectsAllocated_ * 2;
-        newxl = (double*) lefMalloc(sizeof(double) * rectsAllocated_);
-        newyl = (double*) lefMalloc(sizeof(double) * rectsAllocated_);
-        newxh = (double*) lefMalloc(sizeof(double) * rectsAllocated_);
-        newyh = (double*) lefMalloc(sizeof(double) * rectsAllocated_);
-        rectMask = (int*) lefMalloc(sizeof(int) * rectsAllocated_);
-
-        for (i = 0; i < numRects_; i++) {
-            newxl[i] = xl_[i];
-            newyl[i] = yl_[i];
-            newxh[i] = xh_[i];
-            newyh[i] = yh_[i];
-            rectMask[i] = rectColorMask_[i];
-        }
-
-        if (xl_) {
-            lefFree((char*) (xl_));
-            lefFree((char*) (yl_));
-            lefFree((char*) (xh_));
-            lefFree((char*) (yh_));
-            lefFree((char*) (rectColorMask_));
-        }
-
-        xl_ = newxl;
-        yl_ = newyl;
-        xh_ = newxh;
-        yh_ = newyh;
-        rectColorMask_ = rectMask;
-    }
-
-    xl_[numRects_] = xl;
-    yl_[numRects_] = yl;
-    xh_[numRects_] = xh;
-    yh_[numRects_] = yh;
-    rectColorMask_[numRects_] = colorMask;
-
-    numRects_ += 1;
-}
-
-void
-lefiViaLayer::addPoly(int               colorMask,
-                      lefiGeometries    *geom)
-{
-    if (numPolys_ == polysAllocated_) {
-        int             i;
-        lefiGeomPolygon **poly;
-        int             *polyMask;
-
-        polysAllocated_ = (polysAllocated_ == 0) ?
-            2 : polysAllocated_ * 2;
-        poly = (lefiGeomPolygon**) lefMalloc(sizeof(lefiGeomPolygon*) *
-                                             polysAllocated_);
-        polyMask = (int*) lefMalloc(sizeof(int) * polysAllocated_);
-
-        for (i = 0; i < numPolys_; i++) {
-            poly[i] = polygons_[i];
-            polyMask[i] = polyColorMask_[i];
-        }
-
-        if (polygons_) {
-            lefFree((char*) (polygons_));
-            lefFree((char*) (polyColorMask_));
-        }
-
-        polygons_ = poly;
-        polyColorMask_ = polyMask;
-    }
-
-    polygons_[numPolys_] = geom->getPolygon(0);
-    polyColorMask_[numPolys_] = colorMask;
-
-    numPolys_ += 1;
-}
-
-int
-lefiViaLayer::numRects()
-{
-    return numRects_;
-}
-
-int
-lefiViaLayer::numPolygons()
-{
-    return numPolys_;
-}
-
-lefiViaLayer *
-lefiViaLayer::clone()
-{
-    lefiViaLayer    *vl = (lefiViaLayer*) lefMalloc(sizeof(lefiViaLayer));
-    int             i, j;
-    if (numRects_ > 0) {
-        vl->xl_ = (double*) lefMalloc(sizeof(double) * numRects_);
-        vl->yl_ = (double*) lefMalloc(sizeof(double) * numRects_);
-        vl->xh_ = (double*) lefMalloc(sizeof(double) * numRects_);
-        vl->yh_ = (double*) lefMalloc(sizeof(double) * numRects_);
-        vl->rectColorMask_ = (int*) lefMalloc(sizeof(int) * numRects_);
-        vl->numRects_ = numRects_;
-        vl->rectsAllocated_ = rectsAllocated_;
-
-        for (i = 0; i < numRects_; i++) {
-            vl->xl_[i] = xl_[i];
-            vl->yl_[i] = yl_[i];
-            vl->xh_[i] = xh_[i];
-            vl->yh_[i] = yh_[i];
-            vl->rectColorMask_[i] = rectColorMask_[i];
-        }
-    } else {
-        vl->xl_ = 0;
-        vl->yl_ = 0;
-        vl->xh_ = 0;
-        vl->yh_ = 0;
-        vl->rectColorMask_ = 0;
-        vl->numRects_ = numRects_;
-        vl->rectsAllocated_ = rectsAllocated_;
-    }
-
-    vl->numPolys_ = numPolys_;
-    vl->polysAllocated_ = polysAllocated_;
-    vl->polygons_ = (lefiGeomPolygon**)
-        lefMalloc(sizeof(lefiGeomPolygon*) * polysAllocated_);
-
-    if (numPolys_ > 0) {
-        vl->polyColorMask_ = (int*) lefMalloc(sizeof(int) * numPolys_);
-    } else {
-        vl->polyColorMask_ = 0;
-    }
-
-    for (i = 0; i < numPolys_; i++) {
-        vl->polygons_[i] = (lefiGeomPolygon*) lefMalloc(sizeof(lefiGeomPolygon));
-        vl->polygons_[i]->numPoints = polygons_[i]->numPoints;
-        vl->polygons_[i]->x = (double*) lefMalloc(sizeof(double) *
-                                                  polygons_[i]->numPoints);
-        vl->polygons_[i]->y = (double*) lefMalloc(sizeof(double) *
-                                                  polygons_[i]->numPoints);
-        vl->polygons_[i]->colorMask = polygons_[i]->colorMask;
-        vl->polyColorMask_[i] = polyColorMask_[i];
-
-        for (j = 0; j < polygons_[i]->numPoints; j++) {
-            vl->polygons_[i]->x[j] = polygons_[i]->x[j];
-            vl->polygons_[i]->y[j] = polygons_[i]->y[j];
-        }
-        /*
-            vl->polygons_[i] =  polygons_[i];
-        */
-    }
-    vl->name_ = (char*) lefMalloc(strlen(name_) + 1);
-    strcpy(vl->name_, name_);
-    return vl;
-}
-
-char *
-lefiViaLayer::name()
-{
-    return name_;
-}
-
-int
-lefiViaLayer::rectColorMask(int index)
-{
-    char msg[160];
-
-    if (index < 0 || index >= numRects_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d", index, numRects_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-
-    return rectColorMask_[index];
-}
-
-int
-lefiViaLayer::polyColorMask(int index)
-{
-    char msg[160];
-
-    if (index < 0 || index >= numPolys_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER POLYGON is invalid.\nValid index is from 0 to %d", index, numPolys_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-
-    return polyColorMask_[index];
-}
-
-double
-lefiViaLayer::xl(int index)
-{
-    char msg[160];
-    if (index < 0 || index >= numRects_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d", index, numRects_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-    return xl_[index];
-}
-
-double
-lefiViaLayer::yl(int index)
-{
-    char msg[160];
-    if (index < 0 || index >= numRects_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d", index, numRects_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-    return yl_[index];
-}
-
-double
-lefiViaLayer::xh(int index)
-{
-    char msg[160];
-    if (index < 0 || index >= numRects_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d", index, numRects_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-    return xh_[index];
-}
-
-double
-lefiViaLayer::yh(int index)
-{
-    char msg[160];
-    if (index < 0 || index >= numRects_) {
-        sprintf(msg, "ERROR (LEFPARS-1420): The index number %d given for the VIA LAYER RECTANGLE is invalid.\nValid index is from 0 to %d", index, numRects_);
-        lefiError(0, 1420, msg);
-        return 0;
-    }
-    return yh_[index];
-}
-
-lefiGeomPolygon *
-lefiViaLayer::getPolygon(int index) const
-{
-    return polygons_[index];
-}
-
-// *****************************************************************************
-// lefiVia
-// *****************************************************************************
-
-lefiVia::lefiVia()
-: name_(NULL),
-  nameSize_(0),
-  hasDefault_(0),
-  hasGenerated_(0),
-  hasResistance_(0),
-  hasForeignPnt_(0),
-  hasTopOfStack_(0),
-  numProps_(0),
-  propsAllocated_(0),
-  propName_(NULL),
-  propValue_(NULL),
-  propDValue_(NULL),
-  propType_(NULL),
-  numLayers_(0),
-  layersAllocated_(0),
-  layers_(NULL),
-  resistance_(0.0),
-  foreign_(NULL),
-  foreignX_(0.0),
-  foreignY_(0.0),
-  foreignOrient_(0),
-  viaRuleName_(NULL),
-  xSize_(0.0),
-  ySize_(0.0),
-  botLayer_(NULL),
-  cutLayer_(NULL),
-  topLayer_(NULL),
-  xSpacing_(0.0),
-  ySpacing_(0.0),
-  xBotEnc_(0.0),
-  yBotEnc_(0.0),
-  xTopEnc_(0.0),
-  yTopEnc_(0.0),
-  numRows_(0),
-  numCols_(0),
-  xOffset_(0.0),
-  yOffset_(0.0),
-  xBotOs_(0.0),
-  yBotOs_(0.0),
-  xTopOs_(0.0),
-  yTopOs_(0.0),
-  cutPattern_(NULL)
-{
-    Init();
-}
-
-void
-lefiVia::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    foreign_ = 0;
-    numProps_ = 0;
-    propsAllocated_ = 0;
-    layersAllocated_ = 3;
-    layers_ = (lefiViaLayer**) lefMalloc(sizeof(lefiViaLayer*) * 3);
-    numLayers_ = 0;
-    clear();
-    viaRuleName_ = 0;
-}
-
-void
-lefiVia::Destroy()
-{
-    clear();
-    lefFree(name_);
-    if (layers_)
-        lefFree((char*) (layers_));
-    layers_ = 0;
-    if (propName_)
-        lefFree((char*) (propName_));
-    if (propValue_)
-        lefFree((char*) (propValue_));
-    if (propDValue_)
-        lefFree((char*) (propDValue_));
-    if (propType_)
-        lefFree((char*) (propType_));
-    if (viaRuleName_)
-        lefFree((char*) (viaRuleName_));
-    if (botLayer_)
-        lefFree((char*) (botLayer_));
-    if (cutLayer_)
-        lefFree((char*) (cutLayer_));
-    if (topLayer_)
-        lefFree((char*) (topLayer_));
-    if (cutPattern_)
-        lefFree((char*) (cutPattern_));
-    propName_ = 0;
-    propValue_ = 0;
-    propDValue_ = 0;
-    propType_ = 0;
-    viaRuleName_ = 0;
-    botLayer_ = 0;
-    cutLayer_ = 0;
-    topLayer_ = 0;
-    cutPattern_ = 0;
-}
-
-lefiVia::~lefiVia()
-{
-    Destroy();
-}
-
-lefiVia *
-lefiVia::clone()
-{
-    int             i;
-    lefiViaLayer    *l;
-    lefiVia         *v = (lefiVia*) lefMalloc(sizeof(lefiVia));
-    v->nameSize_ = strlen(name_) + 1;
-    v->name_ = (char*) lefMalloc(v->nameSize_);
-    strcpy(v->name_, name_);
-    v->foreign_ = 0;
-    if (hasForeign()) {
-        v->setForeign(foreign_, hasForeignPnt(),
-                      foreignX_, foreignY_, foreignOrient_);
-    }
-    v->hasDefault_ = hasDefault_;
-    v->hasGenerated_ = hasGenerated_;
-    v->hasResistance_ = hasResistance_;
-    v->hasForeignPnt_ = hasForeignPnt_;
-    v->hasTopOfStack_ = hasTopOfStack_;
-    v->numProps_ = numProps_;
-    v->propsAllocated_ = numProps_;
-    if (numProps_ > 0) {
-        v->propName_ = (char**) lefMalloc(sizeof(char*) * numProps_);
-        v->propValue_ = (char**) lefMalloc(sizeof(char*) * numProps_);
-        v->propDValue_ = (double*) lefMalloc(sizeof(double) * numProps_);
-        v->propType_ = (char*) lefMalloc(sizeof(char) * numProps_);
-        for (i = 0; i < numProps_; i++) {
-            v->propName_[i] = (char*) lefMalloc(strlen(propName_[i]) + 1);
-            strcpy(v->propName_[i], propName_[i]);
-            // Modified 8/27/99 - Wanda da Rosa for pcr 274891
-            // propValue_[i] can be null, if propValue was a number
-            if (propValue_[i]) {
-                v->propValue_[i] = (char*) lefMalloc(strlen(propValue_[i]) + 1);
-                strcpy(v->propValue_[i], propValue_[i]);
-            } else
-                v->propValue_[i] = 0;
-            v->propDValue_[i] = propDValue_[i];
-            v->propType_[i] = propType_[i];
-        }
-    } else {
-        v->propName_ = 0;
-        v->propValue_ = 0;
-        v->propDValue_ = 0;
-        v->propType_ = 0;
-    }
-    v->layersAllocated_ = layersAllocated_;
-    v->numLayers_ = numLayers_;
-    if (numLayers_ > 0)
-        v->layers_ =
-            (lefiViaLayer**) lefMalloc(sizeof(lefiViaLayer*) * numLayers_);
-    else   // still malloc the memory because lefiVia::Init does
-        v->layers_ =
-            (lefiViaLayer**) lefMalloc(sizeof(lefiViaLayer*) * 2);
-    for (i = 0; i < numLayers_; i++) {
-        l = layers_[i];
-        v->layers_[i] = l->clone();
-    }
-    v->resistance_ = resistance_;
-    if (foreignOrient_ == 0)
-        v->foreignOrient_ = -1;
-    else
-        v->foreignOrient_ = foreignOrient_;
-
-    v->viaRuleName_ = 0;
-    v->botLayer_ = 0;
-    v->cutLayer_ = 0;
-    v->topLayer_ = 0;
-    v->cutPattern_ = 0;
-    if (viaRuleName_)
-        v->viaRuleName_ = strdup(viaRuleName_);
-    v->xSize_ = xSize_;
-    v->ySize_ = ySize_;
-    if (botLayer_)
-        v->botLayer_ = strdup(botLayer_);
-    if (cutLayer_)
-        v->cutLayer_ = strdup(cutLayer_);
-    if (topLayer_)
-        v->topLayer_ = strdup(topLayer_);
-    v->xSpacing_ = xSpacing_;
-    v->ySpacing_ = ySpacing_;
-    v->xBotEnc_ = xBotEnc_;
-    v->yBotEnc_ = yBotEnc_;
-    v->xTopEnc_ = xTopEnc_;
-    v->yTopEnc_ = yTopEnc_;
-    v->numRows_ = numRows_;
-    v->numCols_ = numCols_;
-    v->xOffset_ = xOffset_;
-    v->yOffset_ = yOffset_;
-    v->xBotOs_ = xBotOs_;
-    v->yBotOs_ = yBotOs_;
-    v->xTopOs_ = xTopOs_;
-    v->yTopOs_ = yTopOs_;
-    if (cutPattern_)
-        v->cutPattern_ = strdup(cutPattern_);
-
-    return v;
-}
-
-void
-lefiVia::clear()
-{
-    int i;
-
-    if (name_)
-        *(name_) = '\0';
-    if (foreign_)
-        lefFree(foreign_);
-    foreign_ = 0;
-    hasDefault_ = 0;
-    hasGenerated_ = 0;
-    hasResistance_ = 0;
-    hasForeignPnt_ = 0;
-    hasTopOfStack_ = 0;
-    foreignOrient_ = -1;
-
-    for (i = 0; i < numProps_; i++) {
-        lefFree(propName_[i]);
-        propName_[i] = 0;
-        if (propValue_[i])
-            lefFree(propValue_[i]);
-        propValue_[i] = 0;
-        propType_[i] = ' ';
-    }
-    numProps_ = 0;
-
-    for (i = 0; i < numLayers_; i++) {
-        layers_[i]->Destroy();
-        lefFree((char*) (layers_[i]));
-        layers_[i] = 0;
-    }
-    numLayers_ = 0;
-
-    if (viaRuleName_)
-        lefFree(viaRuleName_);
-    viaRuleName_ = 0;
-    xSize_ = 0;
-    ySize_ = 0;
-    if (botLayer_)
-        lefFree(botLayer_);
-    if (cutLayer_)
-        lefFree(cutLayer_);
-    if (topLayer_)
-        lefFree(topLayer_);
-    botLayer_ = 0;
-    cutLayer_ = 0;
-    topLayer_ = 0;
-    xSpacing_ = 0;
-    ySpacing_ = 0;
-    xBotEnc_ = 0;
-    yBotEnc_ = 0;
-    xTopEnc_ = 0;
-    yTopEnc_ = 0;
-    numRows_ = 0;
-    numCols_ = 0;
-    xOffset_ = 0;
-    yOffset_ = 0;
-    xBotOs_ = 0;
-    yBotOs_ = 0;
-    xTopOs_ = 0;
-    yTopOs_ = 0;
-    if (cutPattern_)
-        lefFree(cutPattern_);
-    cutPattern_ = 0;
-}
-
-void
-lefiVia::setName(const char *name,
-                 int        viaType)
-{
-    int len;
-    // setName calls clear to init
-    // default=0 no default specified
-    // default=1 default specified in lef file
-    clear();
-    switch (viaType) {
-    case 1:
-        hasDefault_ = 1;
-        break;
-    case 2:
-        hasGenerated_ = 1;
-        break;
-    }
-
-    len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-
-}
-
-void
-lefiVia::setResistance(double num)
-{
-    hasResistance_ = 1;
-    resistance_ = num;
-}
-
-void
-lefiVia::bumpProps()
-{
-    int     i;
-    double  *d;
-    char    **n;
-    char    **v;
-    char    *t;
-
-    if (propsAllocated_ == 0)
-        propsAllocated_ = 2;
-    else
-        propsAllocated_ *= 2;
-
-    d = (double*) lefMalloc(sizeof(double) * propsAllocated_);
-    n = (char**) lefMalloc(sizeof(char*) * propsAllocated_);
-    v = (char**) lefMalloc(sizeof(char*) * propsAllocated_);
-    t = (char*) lefMalloc(sizeof(char) * propsAllocated_);
-
-    for (i = 0; i < numProps_; i++) {
-        d[i] = propDValue_[i];
-        n[i] = propName_[i];
-        v[i] = propValue_[i];
-        t[i] = propType_[i];
-    }
-
-    if (numProps_ > 0) {
-        lefFree((char*) (propDValue_));
-        lefFree((char*) (propName_));
-        lefFree((char*) (propValue_));
-        lefFree((char*) (propType_));
-    }
-
-    propDValue_ = d;
-    propName_ = n;
-    propValue_ = v;
-    propType_ = t;
-}
-
-void
-lefiVia::addProp(const char *name,
-                 const char *value,
-                 const char type)
-{
-    int len = strlen(name) + 1;
-
-    if (numProps_ == propsAllocated_)
-        bumpProps();
-
-    propName_[numProps_] = (char*) lefMalloc(len);
-    strcpy(propName_[numProps_], CASE(name));
-
-    len = strlen(value) + 1;
-    propValue_[numProps_] = (char*) lefMalloc(len);
-    strcpy(propValue_[numProps_], CASE(value));
-
-    propDValue_[numProps_] = 0.0;
-
-    propType_[numProps_] = type;
-
-    numProps_ += 1;
-}
-
-void
-lefiVia::addNumProp(const char  *name,
-                    double      d,
-                    const char  *value,
-                    const char  type)
-{
-    int len = strlen(name) + 1;
-
-    if (numProps_ == propsAllocated_)
-        bumpProps();
-
-    propName_[numProps_] = (char*) lefMalloc(len);
-    strcpy(propName_[numProps_], CASE(name));
-
-    len = strlen(value) + 1;
-    propValue_[numProps_] = (char*) lefMalloc(len);
-    strcpy(propValue_[numProps_], CASE(value));
-
-    propDValue_[numProps_] = d;
-
-    propType_[numProps_] = type;
-
-    numProps_ += 1;
-}
-
-void
-lefiVia::setForeign(const char  *name,
-                    int         hasPnt,
-                    double      x,
-                    double      y,
-                    int         orient)
-{
-    // orient=-1 means no orient was specified.
-    int len = strlen(name) + 1;
-
-    hasForeignPnt_ = hasPnt;
-    foreignOrient_ = orient;
-    foreignX_ = x;
-    foreignY_ = y;
-
-    foreign_ = (char*) lefMalloc(len);
-    strcpy(foreign_, CASE(name));
-}
-
-void
-lefiVia::setTopOfStack()
-{
-    hasTopOfStack_ = 1;
-}
-
-void
-lefiVia::addLayer(const char *name)
-{
-    lefiViaLayer *newl;
-    if (numLayers_ == layersAllocated_) {
-        int             i;
-        lefiViaLayer    **l;
-        if (layersAllocated_ == 0)
-            layersAllocated_ = 2;
-        else
-            layersAllocated_ *= 2;
-        l = (lefiViaLayer**) lefMalloc(sizeof(lefiViaLayer*) * layersAllocated_);
-        for (i = 0; i < numLayers_; i++) {
-            l[i] = layers_[i];
-        }
-        lefFree((char*) (layers_));
-        layers_ = l;
-    }
-    newl = (lefiViaLayer*) lefMalloc(sizeof(lefiViaLayer));
-    newl->Init();
-    layers_[numLayers_] = newl;
-    newl->setName(name);
-    numLayers_ += 1;
-}
-
-void
-lefiVia::addRectToLayer(int     mask,
-                        double  xl,
-                        double  yl,
-                        double  xh,
-                        double  yh)
-{
-    layers_[numLayers_ - 1]->addRect(mask, xl, yl, xh, yh);
-}
-
-void
-lefiVia::addPolyToLayer(int             mask,
-                        lefiGeometries  *geom)
-{
-    layers_[numLayers_ - 1]->addPoly(mask, geom);
-}
-
-void
-lefiVia::setViaRule(const char  *viaRuleName,
-                    double      xSize,
-                    double      ySize,
-                    const char  *botLayer,
-                    const char  *cutLayer,
-                    const char  *topLayer,
-                    double      xCut,
-                    double      yCut,
-                    double      xBotEnc,
-                    double      yBotEnc,
-                    double      xTopEnc,
-                    double      yTopEnc)
-{
-    viaRuleName_ = strdup(viaRuleName);
-    xSize_ = xSize;
-    ySize_ = ySize;
-    botLayer_ = strdup(botLayer);
-    cutLayer_ = strdup(cutLayer);
-    topLayer_ = strdup(topLayer);
-    xSpacing_ = xCut;
-    ySpacing_ = yCut;
-    xBotEnc_ = xBotEnc;
-    yBotEnc_ = yBotEnc;
-    xTopEnc_ = xTopEnc;
-    yTopEnc_ = yTopEnc;
-}
-
-void
-lefiVia::setRowCol(int  numRows,
-                   int  numCols)
-{
-    numRows_ = numRows;
-    numCols_ = numCols;
-}
-
-void
-lefiVia::setOrigin(double   xOffset,
-                   double   yOffset)
-{
-    xOffset_ = xOffset;
-    yOffset_ = yOffset;
-}
-
-void
-lefiVia::setOffset(double   xBot,
-                   double   yBot,
-                   double   xTop,
-                   double   yTop)
-{
-    xBotOs_ = xBot;
-    yBotOs_ = yBot;
-    xTopOs_ = xTop;
-    yTopOs_ = yTop;
-}
-
-void
-lefiVia::setPattern(const char *cutPattern)
-{
-    cutPattern_ = strdup(cutPattern);
-}
-
-int
-lefiVia::hasDefault() const
-{
-    return hasDefault_;
-}
-
-int
-lefiVia::hasGenerated() const
-{
-    return hasGenerated_;
-}
-
-int
-lefiVia::hasForeign() const
-{
-    return foreign_ ? 1 : 0;
-}
-
-int
-lefiVia::hasForeignPnt() const
-{
-    return hasForeignPnt_;
-}
-
-int
-lefiVia::hasForeignOrient() const
-{
-    return foreignOrient_ == -1 ? 0 : 1;
-}
-
-int
-lefiVia::hasProperties() const
-{
-    return numProps_ ? 1 : 0;
-}
-
-int
-lefiVia::hasResistance() const
-{
-    return hasResistance_;
-}
-
-int
-lefiVia::hasTopOfStack() const
-{
-    return hasTopOfStack_;
-}
-
-// 5.6
-int
-lefiVia::hasViaRule() const
-{
-    return viaRuleName_ ? 1 : 0;
-}
-
-// 5.6
-int
-lefiVia::hasRowCol() const
-{
-    if (numRows_ != 0 || numCols_ != 0)
-        return 1;
-    return 0;
-}
-
-// 5.6
-int
-lefiVia::hasOrigin() const
-{
-    if (xOffset_ != 0 || yOffset_ != 0)
-        return 1;
-    return 0;
-}
-
-// 5.6
-int
-lefiVia::hasOffset() const
-{
-    if (xBotOs_ != 0 || yBotOs_ != 0 ||
-        xTopOs_ != 0 || yTopOs_ != 0)
-        return 1;
-    return 0;
-}
-
-// 5.6
-int
-lefiVia::hasCutPattern() const
-{
-    return cutPattern_ ? 1 : 0;
-}
-
-int
-lefiVia::numLayers() const
-{
-    return numLayers_;
-}
-
-char *
-lefiVia::layerName(int layerNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->name();
-}
-
-int
-lefiVia::numRects(int layerNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->numRects();
-}
-
-double
-lefiVia::xl(int layerNum,
-            int rectNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->xl(rectNum);
-}
-
-double
-lefiVia::yl(int layerNum,
-            int rectNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->yl(rectNum);
-}
-
-double
-lefiVia::xh(int layerNum,
-            int rectNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->xh(rectNum);
-}
-
-double
-lefiVia::yh(int layerNum,
-            int rectNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->yh(rectNum);
-}
-
-int
-lefiVia::rectColorMask(int  layerNum,
-                       int  rectNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-
-    vl = layers_[layerNum];
-
-    return vl->rectColorMask(rectNum);
-}
-
-int
-lefiVia::polyColorMask(int  layerNum,
-                       int  polyNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-
-    vl = layers_[layerNum];
-
-    return vl->polyColorMask(polyNum);
-}
-
-int
-lefiVia::numPolygons(int layerNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return 0;
-    }
-    vl = layers_[layerNum];
-    return vl->numPolygons();
-}
-
-lefiGeomPolygon
-lefiVia::getPolygon(int layerNum,
-                    int polyNum) const
-{
-    lefiViaLayer    *vl;
-    char            msg[160];
-    lefiGeomPolygon tempPoly;
-
-    tempPoly.numPoints = 0;
-    tempPoly.x = 0;
-    tempPoly.y = 0;
-    tempPoly.colorMask = 0;
-
-    if (layerNum < 0 || layerNum >= numLayers_) {
-        sprintf(msg, "ERROR (LEFPARS-1421): The layer number %d given for the VIA LAYER is invalid.\nValid number is from 0 to %d", layerNum, numLayers_);
-        lefiError(0, 1421, msg);
-        return tempPoly;
-    }
-
-    vl = layers_[layerNum];
-
-    return *(vl->getPolygon(polyNum));
-}
-
-char *
-lefiVia::name() const
-{
-    return name_;
-}
-
-double
-lefiVia::resistance() const
-{
-    return resistance_;
-}
-
-// Given an index from 0 to numProperties()-1 return
-// information about that property.
-int
-lefiVia::numProperties() const
-{
-    return numProps_;
-}
-
-char *
-lefiVia::propName(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propName_[index];
-}
-
-char *
-lefiVia::propValue(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propValue_[index];
-}
-
-double
-lefiVia::propNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propDValue_[index];
-}
-
-char
-lefiVia::propType(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propType_[index];
-}
-
-int
-lefiVia::propIsNumber(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propDValue_[index] ? 1 : 0;
-}
-
-int
-lefiVia::propIsString(int index) const
-{
-    char msg[160];
-    if (index < 0 || index >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1422): The layer number %d given for the VIA PROPERTY is invalid.\nValid number is from 0 to %d", index, numLayers_);
-        lefiError(0, 1422, msg);
-        return 0;
-    }
-    return propDValue_[index] ? 0 : 1;
-}
-
-char *
-lefiVia::foreign() const
-{
-    return foreign_;
-}
-
-double
-lefiVia::foreignX() const
-{
-    return foreignX_;
-}
-
-double
-lefiVia::foreignY() const
-{
-    return foreignY_;
-}
-
-int
-lefiVia::foreignOrient() const
-{
-    return foreignOrient_;
-}
-
-char *
-lefiVia::foreignOrientStr() const
-{
-    return (lefiOrientStr(foreignOrient_));
-}
-
-// 5.6
-const char *
-lefiVia::viaRuleName() const
-{
-    return viaRuleName_;
-}
-
-double
-lefiVia::xCutSize() const
-{
-    return xSize_;
-}
-
-double
-lefiVia::yCutSize() const
-{
-    return ySize_;
-}
-
-const char *
-lefiVia::botMetalLayer() const
-{
-    return botLayer_;
-}
-
-const char *
-lefiVia::cutLayer() const
-{
-    return cutLayer_;
-}
-
-const char *
-lefiVia::topMetalLayer() const
-{
-    return topLayer_;
-}
-
-double
-lefiVia::xCutSpacing() const
-{
-    return xSpacing_;
-}
-
-double
-lefiVia::yCutSpacing() const
-{
-    return ySpacing_;
-}
-
-double
-lefiVia::xBotEnc() const
-{
-    return xBotEnc_;
-}
-
-double
-lefiVia::yBotEnc() const
-{
-    return yBotEnc_;
-}
-
-double
-lefiVia::xTopEnc() const
-{
-    return xTopEnc_;
-}
-
-double
-lefiVia::yTopEnc() const
-{
-    return yTopEnc_;
-}
-
-int
-lefiVia::numCutRows() const
-{
-    return numRows_;
-}
-
-int
-lefiVia::numCutCols() const
-{
-    return numCols_;
-}
-
-double
-lefiVia::xOffset() const
-{
-    return xOffset_;
-}
-
-double
-lefiVia::yOffset() const
-{
-    return yOffset_;
-}
-
-double
-lefiVia::xBotOffset() const
-{
-    return xBotOs_;
-}
-
-double
-lefiVia::yBotOffset() const
-{
-    return yBotOs_;
-}
-
-double
-lefiVia::xTopOffset() const
-{
-    return xTopOs_;
-}
-
-double
-lefiVia::yTopOffset() const
-{
-    return yTopOs_;
-}
-
-const char *
-lefiVia::cutPattern() const
-{
-    return cutPattern_;
-}
-
-// Debug print
-void
-lefiVia::print(FILE *f) const
-{
-    int i;
-    int h;
-
-    fprintf(f, "Via %s:\n", name());
-
-    if (hasDefault())
-        fprintf(f, "  DEFAULT\n");
-
-    if (hasForeign()) {
-        fprintf(f, "  foreign %s", foreign());
-        if (hasForeignPnt()) {
-            fprintf(f, " %g,%g", foreignX(),
-                    foreignY());
-        }
-        if (hasForeignOrient()) {
-            fprintf(f, " orient %s", foreignOrientStr());
-        }
-        fprintf(f, "\n");
-    }
-
-    if (hasResistance())
-        fprintf(f, "  RESISTANCE %g\n", resistance());
-
-    if (hasProperties()) {
-        for (i = 0; i < numProperties(); i++)
-            if (propIsString(i))
-                fprintf(f, "  PROP %s %s\n", propName(i),
-                        propValue(i));
-            else
-                fprintf(f, "  PROP %s %g\n", propName(i),
-                        propNumber(i));
-    }
-
-    for (i = 0; i < numLayers(); i++) {
-        fprintf(f, "  LAYER %s\n", layerName(i));
-        for (h = 0; h < numRects(i); h++) {
-            if (rectColorMask(i, h) != 0) {
-                fprintf(f, "    RECT MASK %d %g,%g %g,%g\n",
-                        rectColorMask(i, h),
-                        xl(i, h), yl(i, h),
-                        xh(i, h), yh(i, h));
-            } else {
-                fprintf(f, "    RECT %g,%g %g,%g\n",
-                        xl(i, h), yl(i, h),
-                        xh(i, h), yh(i, h));
-            }
-        }
-    }
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.hpp
deleted file mode 100644
index d4390b2..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiVia.hpp
+++ /dev/null
@@ -1,259 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiVia_h
-#define lefiVia_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-#include "lefiMisc.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiViaLayer {
-public:
-  lefiViaLayer();
-  void Init();
-
-  void Destroy();
-  ~lefiViaLayer();
-
-  void setName(const char* name);
-  void addRect(int mask,
-               double xl, double yl, 
-               double xh, double yh);
-  void addPoly(int mask,
-               lefiGeometries* geom);
-
-  lefiViaLayer* clone();
-
-  int numRects();
-  char* name();
-  double xl(int index);
-  double yl(int index);
-  double xh(int index);
-  double yh(int index);
-  int rectColorMask(int index);
-  int polyColorMask(int index);
-
-  int numPolygons();                                     // 5.6
-  lefiGeomPolygon* getPolygon(int index) const;   // 5.6
-
-protected:
-  char* name_;
-  int* rectColorMask_;
-  int* polyColorMask_;
-  int numRects_;
-  int rectsAllocated_;
-  double* xl_;
-  double* yl_;
-  double* xh_;
-  double* yh_;
-
-  int numPolys_;
-  int polysAllocated_;
-  lefiGeomPolygon** polygons_;
-
-};
-
-class lefiVia {
-public:
-  lefiVia();
-  void Init();
-
-  void Destroy();
-  ~lefiVia();
-
-  void clear();
-
-  // setName calls clear to init
-  // deflt=0 no default specified
-  // deflt=1 default specified in lef file
-  void setName(const char* name, int viaType);
-
-  void setResistance(double num);
-  void addProp(const char* name, const char* value, const char type);
-  void addNumProp(const char* name, double d, const char* value,
-                  const char type);
-
-  // orient=-1 means no orient was specified.
-  void setForeign(const char* name, int hasPnt,
-     double x, double y, int orient);
-  void setTopOfStack();
-
-  void addLayer(const char* name);
-  void addRectToLayer(int    mask, 
-                      double xl, double yl, 
-                      double xh, double yh);
-  void addPolyToLayer(int    mask,
-                      lefiGeometries* geom);
-  void bumpProps();
-
-  void setViaRule(const char* viaRuleName, double xSize, double ySize,
-                  const char* botLayer, const char* cutLayer,
-                  const char* topLayer, double xCut, double yCut,
-                  double xBotEnc, double yBotEnc, double xTopEnc,
-                  double yTopEnc);                          // 5.6
-  void setRowCol(int numRows, int numCols);                 // 5.6
-  void setOrigin(double xOffset, double yOffset);           // 5.6
-  void setOffset(double xBot, double yBot, double xTop, double yTop);   // 5.6
-  void setPattern(const char* cutPattern);                  // 5.6
-
-  // make a new one 
-  lefiVia* clone();
-
-  int hasDefault() const ;
-  int hasGenerated() const ; // 5.6, this no longer in 5.6, should be removed
-  int hasForeign() const ;
-  int hasForeignPnt() const ;
-  int hasForeignOrient() const ;
-  int hasProperties() const ;
-  int hasResistance() const ;
-  int hasTopOfStack() const ;
-
-  int numLayers() const;
-  char* layerName(int layerNum) const;
-  int numRects(int layerNum) const;
-  double xl(int layerNum, int rectNum) const;
-  double yl(int layerNum, int rectNum) const;
-  double xh(int layerNum, int rectNum) const;
-  double yh(int layerNum, int rectNum) const;
-  int rectColorMask(int layerNum, int rectNum) const;
-  int polyColorMask(int layerNum, int polyNum) const;
-  int numPolygons(int layerNum) const;                                 // 5.6
-  lefiGeomPolygon getPolygon(int layerNum, int polyNum) const;  // 5.6
-
-  char* name() const ;
-  double resistance() const ;
-
-  // Given an index from 0 to numProperties()-1 return
-  // information about that property.
-  int numProperties() const ;
-  char* propName(int index) const;
-  char* propValue(int index) const;
-  double propNumber(int index) const;
-  char  propType(int index) const;
-  int propIsNumber(int index) const;
-  int propIsString(int index) const;
-  char* foreign() const;
-  double foreignX() const;
-  double foreignY() const;
-  int foreignOrient() const;
-  char* foreignOrientStr() const;
-
-  // 5.6 VIARULE inside a VIA
-  int hasViaRule() const;
-  const char* viaRuleName() const;
-  double xCutSize() const;
-  double yCutSize() const;
-  const char* botMetalLayer() const;
-  const char* cutLayer() const;
-  const char* topMetalLayer() const;
-  double xCutSpacing() const;
-  double yCutSpacing() const;
-  double xBotEnc() const;
-  double yBotEnc() const;
-  double xTopEnc() const;
-  double yTopEnc() const;
-  int hasRowCol() const;
-  int numCutRows() const; 
-  int numCutCols() const; 
-  int hasOrigin() const;
-  double xOffset() const; 
-  double yOffset() const; 
-  int hasOffset() const;
-  double xBotOffset() const; 
-  double yBotOffset() const; 
-  double xTopOffset() const; 
-  double yTopOffset() const; 
-  int hasCutPattern() const;
-  const char* cutPattern() const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameSize_;
-
-  int hasDefault_;
-  int hasGenerated_;
-  int hasResistance_;
-  int hasForeignPnt_;
-  int hasTopOfStack_;
-
-  int numProps_;
-  int propsAllocated_;
-  char** propName_;
-  // The prop value is stored in the propValue_ or the propDValue_.
-  // If it is a string it is in propValue_.  If it is a number,
-  // then propValue_ is NULL and it is stored in propDValue_;
-  char** propValue_;
-  double* propDValue_;
-  char*   propType_;
-
-  int numLayers_;
-  int layersAllocated_;
-  lefiViaLayer** layers_;
-
-  double resistance_;
-
-  char* foreign_;
-  double foreignX_;
-  double foreignY_;
-  int foreignOrient_;
-
-  char* viaRuleName_;          // 5.6
-  double xSize_;               // 5.6
-  double ySize_;               // 5.6
-  char* botLayer_;             // 5.6
-  char* cutLayer_;             // 5.6
-  char* topLayer_;             // 5.6
-  double xSpacing_;            // 5.6
-  double ySpacing_;            // 5.6
-  double xBotEnc_;             // 5.6
-  double yBotEnc_;             // 5.6
-  double xTopEnc_;             // 5.6
-  double yTopEnc_;             // 5.6
-  int numRows_;                // 5.6
-  int numCols_;                // 5.6
-  double xOffset_;             // 5.6
-  double yOffset_;             // 5.6
-  double xBotOs_;              // 5.6
-  double yBotOs_;              // 5.6
-  double xTopOs_;              // 5.6
-  double yTopOs_;              // 5.6
-  char* cutPattern_;           // 5.6
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.cpp
deleted file mode 100644
index 8efaae8..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.cpp
+++ /dev/null
@@ -1,846 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "lex.h"
-#include "lefiViaRule.hpp"
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// *****************************************************************************
-// lefiViaRuleLayer
-// *****************************************************************************
-
-lefiViaRuleLayer::lefiViaRuleLayer()
-: name_(NULL),
-  direction_(0),
-  overhang1_(0.0),
-  overhang2_(0.0),
-  hasWidth_(0),
-  hasResistance_(0),
-  hasOverhang_(0),
-  hasMetalOverhang_(0),
-  hasSpacing_(0),
-  hasRect_(0),
-  widthMin_(0.0),
-  widthMax_(0.0),
-  overhang_(0.0),
-  metalOverhang_(0.0),
-  resistance_(0.0),
-  spacingStepX_(0.0),
-  spacingStepY_(0.0),
-  xl_(0.0),
-  xh_(0.0),
-  yl_(0.0),
-  yh_(0.0)
-{
-    Init();
-}
-
-void
-lefiViaRuleLayer::Init()
-{
-    name_ = 0;
-    overhang1_ = -1;
-    overhang2_ = -1;
-}
-
-void
-lefiViaRuleLayer::clearLayerOverhang()
-{
-    overhang1_ = -1;
-    overhang2_ = -1;
-}
-
-void
-lefiViaRuleLayer::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (name_)
-        lefFree(name_);
-    name_ = (char*) lefMalloc(len);
-    strcpy(name_, CASE(name));
-    direction_ = '\0';
-    // overhang1_ = -1;    already reset in clearLayerOverhang
-    // overhang2_ = -1;
-    hasWidth_ = 0;
-    hasResistance_ = 0;
-    hasOverhang_ = 0;
-    hasMetalOverhang_ = 0;
-    hasSpacing_ = 0;
-    hasRect_ = 0;
-}
-
-void
-lefiViaRuleLayer::Destroy()
-{
-    if (name_)
-        lefFree(name_);
-}
-
-lefiViaRuleLayer::~lefiViaRuleLayer()
-{
-    // Destroy will be called explicitly
-    // so do nothing here.
-}
-
-void
-lefiViaRuleLayer::setHorizontal()
-{
-    direction_ = 'H';
-}
-
-void
-lefiViaRuleLayer::setVertical()
-{
-    direction_ = 'V';
-}
-
-// 5.5
-void
-lefiViaRuleLayer::setEnclosure(double   overhang1,
-                               double   overhang2)
-{
-    overhang1_ = overhang1;
-    overhang2_ = overhang2;
-}
-
-void
-lefiViaRuleLayer::setWidth(double   minW,
-                           double   maxW)
-{
-    hasWidth_ = 1;
-    widthMin_ = minW;
-    widthMax_ = maxW;
-}
-
-void
-lefiViaRuleLayer::setOverhang(double d)
-{
-    hasOverhang_ = 1;
-    overhang_ = d;
-}
-
-// 5.6
-void
-lefiViaRuleLayer::setOverhangToEnclosure(double d)
-{
-    if ((overhang1_ != -1) && (overhang2_ != -1))
-        return;                    // both overhang1_ & overhang2_ are set
-    if (overhang1_ == -1)
-        overhang1_ = d;      // set value to overhang1_
-    else
-        overhang2_ = d;      // overhang1_ already set, set to overhang2_
-    return;
-}
-
-// 5.5
-void
-lefiViaRuleLayer::setMetalOverhang(double d)
-{
-    hasMetalOverhang_ = 1;
-    metalOverhang_ = d;
-}
-
-void
-lefiViaRuleLayer::setResistance(double d)
-{
-    hasResistance_ = 1;
-    resistance_ = d;
-}
-
-void
-lefiViaRuleLayer::setSpacing(double x,
-                             double y)
-{
-    hasSpacing_ = 1;
-    spacingStepX_ = x;
-    spacingStepY_ = y;
-}
-
-void
-lefiViaRuleLayer::setRect(double    xl,
-                          double    yl,
-                          double    xh,
-                          double    yh)
-{
-    hasRect_ = 1;
-    xl_ = xl;
-    yl_ = yl;
-    xh_ = xh;
-    yh_ = yh;
-}
-
-int
-lefiViaRuleLayer::hasRect() const
-{
-    return hasRect_;
-}
-
-int
-lefiViaRuleLayer::hasDirection() const
-{
-    return direction_ ? 1 : 0;
-}
-
-// 5.5
-int
-lefiViaRuleLayer::hasEnclosure() const
-{
-    return overhang1_ == -1 ? 0 : 1;
-}
-
-int
-lefiViaRuleLayer::hasWidth() const
-{
-    return hasWidth_;
-}
-
-int
-lefiViaRuleLayer::hasResistance() const
-{
-    return hasResistance_;
-}
-
-int
-lefiViaRuleLayer::hasOverhang() const
-{
-    return hasOverhang_;
-}
-
-int
-lefiViaRuleLayer::hasMetalOverhang() const
-{
-    return hasMetalOverhang_;
-}
-
-int
-lefiViaRuleLayer::hasSpacing() const
-{
-    return hasSpacing_;
-}
-
-char *
-lefiViaRuleLayer::name() const
-{
-    return name_;
-}
-
-int
-lefiViaRuleLayer::isHorizontal() const
-{
-    return direction_ == 'H' ? 1 : 0;
-}
-
-int
-lefiViaRuleLayer::isVertical() const
-{
-    return direction_ == 'V' ? 1 : 0;
-}
-
-// 5.5
-double
-lefiViaRuleLayer::enclosureOverhang1() const
-{
-    return overhang1_;
-}
-
-// 5.5
-double
-lefiViaRuleLayer::enclosureOverhang2() const
-{
-    return overhang2_;
-}
-
-double
-lefiViaRuleLayer::widthMin() const
-{
-    return widthMin_;
-}
-
-double
-lefiViaRuleLayer::widthMax() const
-{
-    return widthMax_;
-}
-
-double
-lefiViaRuleLayer::overhang() const
-{
-    return overhang_;
-}
-
-double
-lefiViaRuleLayer::metalOverhang() const
-{
-    return metalOverhang_;
-}
-
-double
-lefiViaRuleLayer::resistance() const
-{
-    return resistance_;
-}
-
-double
-lefiViaRuleLayer::spacingStepX() const
-{
-    return spacingStepX_;
-}
-
-double
-lefiViaRuleLayer::spacingStepY() const
-{
-    return spacingStepY_;
-}
-
-double
-lefiViaRuleLayer::xl() const
-{
-    return xl_;
-}
-
-double
-lefiViaRuleLayer::yl() const
-{
-    return yl_;
-}
-
-double
-lefiViaRuleLayer::xh() const
-{
-    return xh_;
-}
-
-double
-lefiViaRuleLayer::yh() const
-{
-    return yh_;
-}
-
-void
-lefiViaRuleLayer::print(FILE *f) const
-{
-    fprintf(f, "  Layer %s", name_);
-
-    if (isHorizontal())
-        fprintf(f, " HORIZONTAL");
-    if (isVertical())
-        fprintf(f, " VERTICAL");
-    fprintf(f, "\n");
-
-    if (hasWidth())
-        fprintf(f, "    WIDTH %g %g\n", widthMin(),
-                widthMax());
-
-    if (hasResistance())
-        fprintf(f, "    RESISTANCE %g\n", resistance());
-
-    if (hasOverhang())
-        fprintf(f, "    OVERHANG %g\n", overhang());
-
-    if (hasMetalOverhang())
-        fprintf(f, "    METALOVERHANG %g\n",
-                metalOverhang());
-
-    if (hasSpacing())
-        fprintf(f, "    SPACING %g %g\n",
-                spacingStepX(),
-                spacingStepY());
-
-    if (hasRect())
-        fprintf(f, "    RECT %g,%g %g,%g\n",
-                xl(), yl(),
-                xh(), yh());
-}
-
-// *****************************************************************************
-// lefiViaRule
-// *****************************************************************************
-
-lefiViaRule::lefiViaRule()
-: name_(NULL),
-  nameSize_(0),
-  hasGenerate_(0),
-  hasDefault_(0),
-  numLayers_(0),
-  numVias_(0),
-  viasAllocated_(0),
-  vias_(NULL),
-  numProps_(0),
-  propsAllocated_(0),
-  names_(NULL),
-  values_(NULL),
-  dvalues_(NULL),
-  types_(NULL)
-{
-    Init();
-}
-
-void
-lefiViaRule::Init()
-{
-    nameSize_ = 16;
-    name_ = (char*) lefMalloc(16);
-    viasAllocated_ = 2;
-    vias_ = (char**) lefMalloc(sizeof(char*) * 2);
-    layers_[0].Init();
-    layers_[1].Init();
-    layers_[2].Init();
-    numLayers_ = 0;
-    numVias_ = 0;
-    numProps_ = 0;
-    propsAllocated_ = 1;
-    names_ = (char**) lefMalloc(sizeof(char*));
-    values_ = (char**) lefMalloc(sizeof(char*));
-    dvalues_ = (double*) lefMalloc(sizeof(double));
-    types_ = (char*) lefMalloc(sizeof(char));
-}
-
-void
-lefiViaRule::clear()
-{
-    int i;
-    hasGenerate_ = 0;
-    hasDefault_ = 0;
-    for (i = 0; i < numProps_; i++) {
-        lefFree(names_[i]);
-        lefFree(values_[i]);
-        dvalues_[i] = 0;
-    }
-    numProps_ = 0;
-    numLayers_ = 0;
-    for (i = 0; i < numVias_; i++) {
-        lefFree(vias_[i]);
-    }
-    numVias_ = 0;
-}
-
-void
-lefiViaRule::clearLayerOverhang()
-{
-    layers_[0].clearLayerOverhang();
-    layers_[1].clearLayerOverhang();
-}
-
-void
-lefiViaRule::setName(const char *name)
-{
-    int len = strlen(name) + 1;
-    if (len > nameSize_) {
-        lefFree(name_);
-        name_ = (char*) lefMalloc(len);
-        nameSize_ = len;
-    }
-    strcpy(name_, CASE(name));
-    clear();
-}
-
-void
-lefiViaRule::Destroy()
-{
-    clear();
-    lefFree(name_);
-    lefFree((char*) (vias_));
-    lefFree((char*) (names_));
-    lefFree((char*) (values_));
-    lefFree((char*) (dvalues_));
-    lefFree((char*) (types_));
-    layers_[0].Destroy();
-    layers_[1].Destroy();
-    layers_[2].Destroy();
-}
-
-lefiViaRule::~lefiViaRule()
-{
-    Destroy();
-}
-
-void
-lefiViaRule::setGenerate()
-{
-    hasGenerate_ = 1;
-}
-
-void
-lefiViaRule::setDefault()
-{
-    hasDefault_ = 1;
-}
-
-void
-lefiViaRule::addViaName(const char *name)
-{
-    // Add one of possibly many via names
-    int len = strlen(name) + 1;
-    if (numVias_ == viasAllocated_) {
-        int     i;
-        char    **nn;
-        if (viasAllocated_ == 0)
-            viasAllocated_ = 2;
-        else
-            viasAllocated_ *= 2;
-        nn = (char**) lefMalloc(sizeof(char*) * viasAllocated_);
-        for (i = 0; i < numVias_; i++)
-            nn[i] = vias_[i];
-        lefFree((char*) (vias_));
-        vias_ = nn;
-    }
-    vias_[numVias_] = (char*) lefMalloc(len);
-    strcpy(vias_[numVias_], CASE(name));
-    numVias_ += 1;
-}
-
-void
-lefiViaRule::setRect(double xl,
-                     double yl,
-                     double xh,
-                     double yh)
-{
-    layers_[numLayers_ - 1].setRect(xl, yl, xh, yh);
-}
-
-void
-lefiViaRule::setSpacing(double  x,
-                        double  y)
-{
-    layers_[numLayers_ - 1].setSpacing(x, y);
-}
-
-void
-lefiViaRule::setWidth(double    x,
-                      double    y)
-{
-    layers_[numLayers_ - 1].setWidth(x, y);
-}
-
-void
-lefiViaRule::setResistance(double d)
-{
-    layers_[numLayers_ - 1].setResistance(d);
-}
-
-void
-lefiViaRule::setOverhang(double d)
-{
-    layers_[numLayers_ - 1].setOverhang(d);
-}
-
-// 5.6, try to set value to layers_[0] & layers_[1]
-void
-lefiViaRule::setOverhangToEnclosure(double d)
-{
-    layers_[0].setOverhangToEnclosure(d);
-    layers_[1].setOverhangToEnclosure(d);
-}
-
-void
-lefiViaRule::setMetalOverhang(double d)
-{
-    layers_[numLayers_ - 1].setMetalOverhang(d);
-}
-
-void
-lefiViaRule::setVertical()
-{
-    layers_[numLayers_ - 1].setVertical();
-}
-
-void
-lefiViaRule::setHorizontal()
-{
-    layers_[numLayers_ - 1].setHorizontal();
-}
-
-void
-lefiViaRule::setEnclosure(double    overhang1,
-                          double    overhang2)
-{
-    layers_[numLayers_ - 1].setEnclosure(overhang1,
-                                         overhang2);
-}
-
-void
-lefiViaRule::setLayer(const char *name)
-{
-    if (numLayers_ == 3) {
-        lefiError(0, 1430, "ERROR (LEFPARS-1430): too many via rule layers");
-        return;
-    }
-    // This routine sets and creates the active layer.
-    layers_[numLayers_].setName(name);
-    numLayers_ += 1;
-}
-
-int
-lefiViaRule::hasGenerate() const
-{
-    return hasGenerate_;
-}
-
-int
-lefiViaRule::hasDefault() const
-{
-    return hasDefault_;
-}
-
-int
-lefiViaRule::numLayers() const
-{
-    // There are 2 or 3 layers in a rule.
-    // numLayers() tells how many.
-    // If a third layer exists then it is the cut layer.
-    return numLayers_;
-}
-
-lefiViaRuleLayer *
-lefiViaRule::layer(int index) const
-{
-    if (index < 0 || index > 2)
-        return 0;
-    return (lefiViaRuleLayer*) &(layers_[index]);
-}
-
-char *
-lefiViaRule::name() const
-{
-    return name_;
-}
-
-void
-lefiViaRule::print(FILE *f) const
-{
-    int i;
-    fprintf(f, "VIA RULE %s", name());
-    if (hasGenerate())
-        fprintf(f, " GENERATE");
-    fprintf(f, "\n");
-
-    for (i = 0; i < numLayers(); i++) {
-        layers_[i].print(f);
-    }
-
-    for (i = 0; i < numVias(); i++) {
-        fprintf(f, "  Via %s\n", viaName(i));
-    }
-}
-
-int
-lefiViaRule::numVias() const
-{
-    return numVias_;
-}
-
-char *
-lefiViaRule::viaName(int index) const
-{
-    if (index < 0 || index >= numVias_)
-        return 0;
-    return vias_[index];
-}
-
-int
-lefiViaRule::numProps() const
-{
-    return numProps_;
-}
-
-void
-lefiViaRule::addProp(const char *name,
-                     const char *value,
-                     const char type)
-{
-    int len = strlen(name) + 1;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim;
-        char    **nn;
-        char    **nv;
-        double  *nd;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            propsAllocated_ = 1;    // initialize propsAllocated_
-        max = propsAllocated_ *= 2;
-        lim = numProps_;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nd[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nd;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = 0;
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-void
-lefiViaRule::addNumProp(const char      *name,
-                        const double    d,
-                        const char      *value,
-                        const char      type)
-{
-    int len = strlen(name) + 1;
-    if (numProps_ == propsAllocated_) {
-        int     i;
-        int     max;
-        int     lim;
-        char    **nn;
-        char    **nv;
-        double  *nd;
-        char    *nt;
-
-        if (propsAllocated_ == 0)
-            propsAllocated_ = 1;    // initialize propsAllocated_
-        max = propsAllocated_ *= 2;
-        lim = numProps_;
-        nn = (char**) lefMalloc(sizeof(char*) * max);
-        nv = (char**) lefMalloc(sizeof(char*) * max);
-        nd = (double*) lefMalloc(sizeof(double) * max);
-        nt = (char*) lefMalloc(sizeof(char) * max);
-        for (i = 0; i < lim; i++) {
-            nn[i] = names_[i];
-            nv[i] = values_[i];
-            nd[i] = dvalues_[i];
-            nt[i] = types_[i];
-        }
-        lefFree((char*) (names_));
-        lefFree((char*) (values_));
-        lefFree((char*) (dvalues_));
-        lefFree((char*) (types_));
-        names_ = nn;
-        values_ = nv;
-        dvalues_ = nd;
-        types_ = nt;
-    }
-    names_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(names_[numProps_], name);
-    len = strlen(value) + 1;
-    values_[numProps_] = (char*) lefMalloc(sizeof(char) * len);
-    strcpy(values_[numProps_], value);
-    dvalues_[numProps_] = d;
-    types_[numProps_] = type;
-    numProps_ += 1;
-}
-
-const char *
-lefiViaRule::propName(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return names_[i];
-}
-
-const char *
-lefiViaRule::propValue(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return values_[i];
-}
-
-double
-lefiViaRule::propNumber(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return dvalues_[i];
-}
-
-const char
-lefiViaRule::propType(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return types_[i];
-}
-
-int
-lefiViaRule::propIsNumber(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return dvalues_[i] ? 1 : 0;
-}
-
-int
-lefiViaRule::propIsString(int i) const
-{
-    char msg[160];
-    if (i < 0 || i >= numProps_) {
-        sprintf(msg, "ERROR (LEFPARS-1431): The index number %d given for the VIARULE PROPERTY is invalid.\nValid index is from 0 to %d", i, numProps_);
-        lefiError(0, 1431, msg);
-        return 0;
-    }
-    return dvalues_[i] ? 0 : 1;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.hpp
deleted file mode 100644
index 3a17c8d..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefiViaRule.hpp
+++ /dev/null
@@ -1,197 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefiViaRule_h
-#define lefiViaRule_h
-
-#include <stdio.h>
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefiViaRuleLayer {
-public:
-  lefiViaRuleLayer();
-  void Init();
-
-  void Destroy();
-  ~lefiViaRuleLayer();
-  void clearLayerOverhang();
-
-  void setName(const char* name);
-  void setHorizontal();
-  void setVertical();
-  void setEnclosure(double overhang1, double overhang2);     // 5.5
-  void setWidth(double minW, double maxW);
-  void setOverhang(double d);
-  void setOverhangToEnclosure(double d);                     // 5.6
-  void setMetalOverhang(double d);
-  void setResistance(double d);
-  void setSpacing(double x, double y);
-  void setRect(double xl, double yl, double xh, double yh);
-
-  int hasDirection() const ;
-  int hasEnclosure() const ;                                 // 5.5
-  int hasWidth() const ;
-  int hasResistance() const ;
-  int hasOverhang() const ;
-  int hasMetalOverhang() const ;
-  int hasSpacing() const ;
-  int hasRect() const ;
-
-  char* name() const ;
-  int isHorizontal() const ;
-  int isVertical() const ;
-  double enclosureOverhang1() const;                        // 5.5
-  double enclosureOverhang2() const;                        // 5.5
-  double widthMin() const ;
-  double widthMax() const ;
-  double overhang() const ;
-  double metalOverhang() const ;
-  double resistance() const ;
-  double spacingStepX() const ;
-  double spacingStepY() const ;
-  double xl() const ;
-  double yl() const ;
-  double xh() const ;
-  double yh() const ;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  char direction_;
-  double overhang1_;                                       // 5.5
-  double overhang2_;                                       // 5.5
-  int hasWidth_;
-  int hasResistance_;
-  int hasOverhang_;
-  int hasMetalOverhang_;
-  int hasSpacing_;
-  int hasRect_;
-  double widthMin_;
-  double widthMax_;
-  double overhang_;
-  double metalOverhang_;
-  double resistance_;
-  double spacingStepX_;
-  double spacingStepY_;
-  double xl_, yl_, xh_, yh_;
-};
-
-class lefiViaRule {
-public:
-  lefiViaRule();
-  void Init();
-
-  void clear();
-  void clearLayerOverhang();
-
-  void Destroy();
-  ~lefiViaRule();
-
-  void setGenerate();
-  void setDefault();
-
-  // This should clear out all the old stuff.
-  void setName(const char* name);
-
-  // Add one of possibly many via names
-  void addViaName(const char* name);
-
-  // These routines set a part of the active layer.
-  void setRect(double xl, double yl, double xh, double yh);
-  void setSpacing(double x, double y);
-  void setWidth(double x, double y);
-  void setResistance(double d);
-  void setOverhang(double d);
-  void setOverhangToEnclosure(double d);            // 5.6
-  void setMetalOverhang(double d);
-  void setVertical();
-  void setHorizontal();
-  void setEnclosure(double overhang1, double overhang2);
-  void addProp(const char* name, const char* value, const char type);
-  void addNumProp(const char* name, const double d,
-                  const char* value, const char type);
-
-  // This routine sets and creates the active layer.
-  void setLayer(const char* name);
-
-  int hasGenerate() const ;
-  int hasDefault() const ;
-  char* name() const ;
-
-  // There are 2 or 3 layers in a rule.
-  // numLayers() tells how many.
-  // If a third layer exists then it is the cut layer.
-  int numLayers() const ;
-  lefiViaRuleLayer* layer(int index) const;
-
-  int numVias() const ;
-  char* viaName(int index) const ;
-
-  int numProps() const;
-  const char*  propName(int index) const;
-  const char*  propValue(int index) const;
-  double propNumber(int index) const;
-  const char   propType(int index) const;
-  int    propIsNumber(int index) const;
-  int    propIsString(int index) const;
-
-  // Debug print
-  void print(FILE* f) const;
-
-protected:
-  char* name_;
-  int nameSize_;
- 
-  int hasGenerate_;
-  int hasDefault_;
-
-  int numLayers_;
-  lefiViaRuleLayer layers_[3];
-
-  int numVias_;
-  int viasAllocated_;
-  char** vias_;
-
-  int numProps_;
-  int propsAllocated_;
-  char**  names_;
-  char**  values_;
-  double* dvalues_;
-  char*   types_;
-};
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallBacks.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallBacks.hpp
deleted file mode 100644
index bea8ed4..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallBacks.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefrCallbacks_h
-#define lefrCallbacks_h
-
-#include "lefiKRDefs.hpp"
-#include "lefrReader.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-class lefrCallbacks {
-public:
-    lefrCallbacks();
-    static void reset();
-
-    // List of call back routines
-    // These are filled in by the user.  See the
-    // "set" routines at the end of the file
-    lefrDoubleCbkFnType AntennaInoutCbk;
-    lefrDoubleCbkFnType AntennaInputCbk;
-    lefrDoubleCbkFnType AntennaOutputCbk;
-    lefrStringCbkFnType ArrayBeginCbk;
-    lefrArrayCbkFnType ArrayCbk;
-    lefrStringCbkFnType ArrayEndCbk;
-    lefrStringCbkFnType BusBitCharsCbk;
-    lefrIntegerCbkFnType CaseSensitiveCbk;
-    lefrStringCbkFnType ClearanceMeasureCbk;
-    lefrCorrectionTableCbkFnType CorrectionTableCbk;
-    lefrDensityCbkFnType DensityCbk;
-    lefrDoubleCbkFnType DielectricCbk;
-    lefrStringCbkFnType DividerCharCbk;
-    lefrDoubleCbkFnType EdgeRateScaleFactorCbk;
-    lefrDoubleCbkFnType EdgeRateThreshold1Cbk;
-    lefrDoubleCbkFnType EdgeRateThreshold2Cbk;
-    lefrStringCbkFnType ExtensionCbk;
-    lefrIntegerCbkFnType FixedMaskCbk;
-    lefrVoidCbkFnType IRDropBeginCbk;
-    lefrIRDropCbkFnType IRDropCbk;
-    lefrVoidCbkFnType IRDropEndCbk;
-    lefrDoubleCbkFnType InoutAntennaCbk;
-    lefrDoubleCbkFnType InputAntennaCbk;
-    lefrLayerCbkFnType LayerCbk;
-    lefrVoidCbkFnType LibraryEndCbk;
-    lefrStringCbkFnType MacroBeginCbk;
-    lefrMacroCbkFnType MacroCbk;
-    lefrStringCbkFnType MacroClassTypeCbk;
-    lefrStringCbkFnType MacroEndCbk;
-    lefrIntegerCbkFnType MacroFixedMaskCbk;
-    lefrMacroNumCbkFnType MacroOriginCbk;
-    lefrMacroSiteCbkFnType MacroSiteCbk;
-    lefrMacroForeignCbkFnType MacroForeignCbk;
-    lefrMacroNumCbkFnType MacroSizeCbk;
-    lefrDoubleCbkFnType ManufacturingCbk;
-    lefrMaxStackViaCbkFnType MaxStackViaCbk;
-    lefrMinFeatureCbkFnType MinFeatureCbk;
-    lefrStringCbkFnType NoWireExtensionCbk;
-    lefrNoiseMarginCbkFnType NoiseMarginCbk;
-    lefrNoiseTableCbkFnType NoiseTableCbk;
-    lefrNonDefaultCbkFnType NonDefaultCbk;
-    lefrObstructionCbkFnType ObstructionCbk;
-    lefrDoubleCbkFnType OutputAntennaCbk;
-    lefrPinCbkFnType PinCbk;
-    lefrVoidCbkFnType PropBeginCbk;
-    lefrPropCbkFnType PropCbk;
-    lefrVoidCbkFnType PropEndCbk;
-    lefrSiteCbkFnType SiteCbk;
-    lefrVoidCbkFnType SpacingBeginCbk;
-    lefrSpacingCbkFnType SpacingCbk;
-    lefrVoidCbkFnType SpacingEndCbk;
-    lefrTimingCbkFnType TimingCbk;
-    lefrUnitsCbkFnType UnitsCbk;
-    lefrUseMinSpacingCbkFnType UseMinSpacingCbk;
-    lefrDoubleCbkFnType VersionCbk;
-    lefrStringCbkFnType VersionStrCbk;
-    lefrViaCbkFnType ViaCbk;
-    lefrViaRuleCbkFnType ViaRuleCbk;
-};
-
-extern lefrCallbacks *lefCallbacks;
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallbacks.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallbacks.cpp
deleted file mode 100644
index 272582c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrCallbacks.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #11 $
-//  $Date: 2013/04/23 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include "lefrCallBacks.hpp"
-#include "string.h"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-lefrCallbacks::lefrCallbacks()
-: AntennaInoutCbk(0),
-  AntennaInputCbk(0),
-  AntennaOutputCbk(0),
-  ArrayBeginCbk(0),
-  ArrayCbk(0),
-  ArrayEndCbk(0),
-  BusBitCharsCbk(0),
-  CaseSensitiveCbk(0),
-  ClearanceMeasureCbk(0),
-  CorrectionTableCbk(0),
-  DensityCbk(0),
-  DielectricCbk(0),
-  DividerCharCbk(0),
-  EdgeRateScaleFactorCbk(0),
-  EdgeRateThreshold1Cbk(0),
-  EdgeRateThreshold2Cbk(0),
-  ExtensionCbk(0),
-  FixedMaskCbk(0),
-  IRDropBeginCbk(0),
-  IRDropCbk(0),
-  IRDropEndCbk(0),
-  InoutAntennaCbk(0),
-  InputAntennaCbk(0),
-  LayerCbk(0),
-  LibraryEndCbk(0),
-  MacroBeginCbk(0),
-  MacroCbk(0),
-  MacroClassTypeCbk(0),
-  MacroEndCbk(0),
-  MacroFixedMaskCbk(0),
-  MacroOriginCbk(0),
-  MacroSiteCbk(0),
-  MacroForeignCbk(0),
-  MacroSizeCbk(0),
-  ManufacturingCbk(0),
-  MaxStackViaCbk(0),
-  MinFeatureCbk(0),
-  NoWireExtensionCbk(0),
-  NoiseMarginCbk(0),
-  NoiseTableCbk(0),
-  NonDefaultCbk(0),
-  ObstructionCbk(0),
-  OutputAntennaCbk(0),
-  PinCbk(0),
-  PropBeginCbk(0),
-  PropCbk(0),
-  PropEndCbk(0),
-  SiteCbk(0),
-  SpacingBeginCbk(0),
-  SpacingCbk(0),
-  SpacingEndCbk(0),
-  TimingCbk(0),
-  UnitsCbk(0),
-  UseMinSpacingCbk(0),
-  VersionCbk(0),
-  VersionStrCbk(0),
-  ViaCbk(0),
-  ViaRuleCbk(0)
-{
-}
-
-lefrCallbacks *lefCallbacks = NULL;
-
-void
-lefrCallbacks::reset()
-{
-    if (lefCallbacks) {
-        delete lefCallbacks;
-    }
-
-    lefCallbacks = new lefrCallbacks();
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.cpp
deleted file mode 100644
index cf6e51c..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #11 $
-//  $Date: 2013/04/23 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "lefrData.hpp"
-#include "lefrSettings.hpp"
-
-using namespace std;
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-extern void *lefMalloc(size_t lef_size);
-
-lefrData  *lefData = NULL;
-
-lefrData::lefrData()
-: antennaInoutWarnings(0),
-  antennaInputWarnings(0),
-  antennaOutputWarnings(0),
-  antennaType(lefiAntennaAR),
-  arrayCutsVal(0),
-  arrayCutsWar(0),
-  arrayName(NULL),
-  arrayWarnings(0),
-  caseSensitiveWarnings(0),
-  correctionTableWarnings(0),
-  dielectricWarnings(0),
-  doneLib(1),
-  edgeRateScaleFactorWarnings(0),
-  edgeRateThreshold1Warnings(0),
-  edgeRateThreshold2Warnings(0),
-  encrypted(0),
-  first(1),
-  first_buffer(0),
-  ge56almostDone(0),
-  ge56done(0),
-  hasBusBit(0),
-  hasDirection(0),
-  hasDivChar(0),
-  hasFixedMask(0),
-  hasGeoLayer(0),
-  hasInfluence(0),
-  hasLayerMincut(0),
-  hasManufactur(0),
-  hasMask(0),
-  hasMinfeature(0),
-  hasNameCase(0),
-  hasOpenedLogFile(0),
-  hasPRP(0),
-  hasParallel(0),
-  hasPitch(0),
-  hasSamenet(0),
-  hasSite(0),
-  hasSiteClass(0),
-  hasSiteSize(0),
-  hasSpCenter(0),
-  hasSpLayer(0),
-  hasSpParallel(0),
-  hasSpSamenet(0),
-  hasTwoWidths(0),
-  hasType(0),
-  hasVer(0),
-  hasViaRule_layer(0),
-  hasWidth(0),
-  hasFatalError(0),
-  iRDropWarnings(0),
-  ignoreVersion(0),
-  inDefine(0),
-  inoutAntennaWarnings(0),
-  inputAntennaWarnings(0),
-  input_level(-1),
-  isGenerate(0),
-  last(NULL),
-  layerCut(0),
-  layerCutSpacing(0),
-  layerDir(0),
-  layerMastOver(0),
-  layerName(NULL),
-  layerRout(0),
-  layerWarnings(0),
-  lefDefIf(FALSE),
-  lefDumbMode(0),
-  lefErrMsgPrinted(0),
-  lefFixedMask(0),
-  lefInfoMsgPrinted(0),
-  lefInvalidChar(0),
-  namesCaseSensitive(TRUE),
-  lefNdRule(0),
-  lefNewIsKeyword(0),
-  lefNlToken(FALSE),
-  lefNoNum(0),
-  lefPropDefType('\0'),
-  lefRetVal(0),
-  lefWRetVal(0),
-  lefWarnMsgPrinted(0),
-  lef_errors(0),
-  lef_nlines(1),
-  lef_ntokens(0),
-  lef_save_x(0.0),
-  lef_save_y(0.0),
-  lef_warnings(0),
-  lefch(NULL),
-  leflVal(0.0),
-  lefrAntennaPWLPtr(0),
-  lefrArray(),
-  lefrCorrectionTable(),
-  lefrDensity(),
-  lefrDoGcell(0),
-  lefrDoGeometries(0),
-  lefrDoSite(0),
-  lefrDoTrack(0),
-  lefrFile(0),
-  lefrFileName(0),
-  lefrGcellPatternPtr(0),
-  lefrGeometriesPtr(0),
-  lefrHasLayer(0),
-  lefrHasMaxVS(0),
-  lefrHasSpacing(0),
-  lefrHasSpacingTbl(0),
-  lefrIRDrop(),
-  lefrLayer(),
-  lefrLog(0),
-  lefrMacro(),
-  lefrMaxStackVia(),
-  lefrMinFeature(),
-  lefrNoiseMargin(),
-  lefrNoiseTable(),
-  lefrNonDefault(),
-  lefrObstruction(),
-  lefrPin(),
-  lefrProp(),
-  lefrSite(),
-  lefrSitePatternPtr(0),
-  lefrSpacing(),
-  lefrTiming(),
-  lefrTrackPatternPtr(0),
-  lefrUnits(),
-  lefrUseMinSpacing(),
-  lefrVal(0.0),
-  lefrVia(),
-  lefrViaRule(),
-  macroName(NULL),
-  macroNum(),
-  macroWarnings(0),
-  maxStackViaWarnings(0),
-
-  minFeatureWarnings(0),
-  msgCnt(1),
-  nd(0),
-  ndLayer(0),
-  ndLayerSpace(0),
-  ndLayerWidth(0),
-  ndName(0),
-  ndRule(0),
-  needGeometry(0),
-  next(NULL),
-  noWireExtensionWarnings(0),
-  noiseMarginWarnings(0),
-  noiseTableWarnings(0),
-  nonDefaultRuleName(NULL),
-  nonDefaultWarnings(0),
-  numVia(0),
-  obsDef(0),
-  origDef(0),
-  outMsg(NULL),
-  outputAntennaWarnings(0),
-  pinDef(0),
-  pinName(NULL),
-  pinWarnings(0),
-  prtNewLine(0),
-  prtSemiColon(0),
-  ringPlace(0),
-  shiftBuf(0),
-  shiftBufLength(0),
-  siteDef(0),
-  siteName(NULL),
-  siteWarnings(0),
-  sizeDef(0),
-  spParallelLength(0),
-  spaceMissing(0),
-  spacingWarnings(0),
-  symDef(0),
-  timingWarnings(0),
-  unitsWarnings(0),
-  use5_3(0),
-  use5_4(0),
-  useLenThr(0),
-  useMinSpacingWarnings(0),
-  versionNum(CURRENT_VERSION),
-  viaLayer(0),
-  viaName(NULL),
-  viaRuleHasDir(0),
-  viaRuleHasEnc(0),
-  viaRuleLayer(0),
-  viaRuleName(NULL),
-  viaRuleWarnings(0),
-  viaWarnings(0),
-  current_token((char*) malloc(TOKEN_SIZE)),
-  pv_token((char*) malloc(TOKEN_SIZE)),
-  uc_token((char*) malloc(TOKEN_SIZE)), 
-  tokenSize(TOKEN_SIZE)
-{
-    Hist_text.push_back('\0');
-
-    // Initialization of arrays.
-    memset(ring, 0, RING_SIZE * sizeof(char*));
-    memset(ringSizes, 0, RING_SIZE * sizeof(int));
-    memset(lefDebug, 0, 100 * sizeof(char));
-    memset(current_buffer, 0, IN_BUF_SIZE * sizeof(char));
-    memset(current_stack, 0, 20 * sizeof(char*));
-    memset(lefrErrMsg, 0, 1024 * sizeof(char));
-    memset(msgLimit, 0, 2 * MAX_LEF_MSGS * sizeof(int));
-    memset(temp_name, 0, 258 * sizeof(char));
-
-    
-    current_token[0] = '\0';
-
-    //lef_lex_init()
-    struct stat statbuf;
-
-    //initRingBuffer();
-    int i;
-    ringPlace = 0;
-    for (i = 0; i < RING_SIZE; i++) {
-        ring[i] = (char*) lefMalloc(TOKEN_SIZE);
-        ringSizes[i] = TOKEN_SIZE;
-    }
-
-    if (first) {
-        first = 0;
-    }
-
-    lef_nlines = 1;
-    last = current_buffer - 1;
-    next = current_buffer;
-    encrypted = 0;
-    first_buffer = 1;
-    // 12/08/1999 -- Wanda da Rosa 
-    // open the lefrLog to write 
-    /* 3/23/2000 -- Wanda da Rosa.  Due to lots of complain, don't open
-       the file until there is really warning messages only.
-    if ((lefrLog = fopen("lefRWarning.log", "w")) == 0) {
-       printf(
-       "WARNING: Unable to open the file lefRWarning.log for writing from the directory %s.\n",
-          getcwd(NULL, 64));
-       printf("Warning messages will not be printed.\n");
-    }
-    */
-
-    // 4/11/2003 - Remove file lefrRWarning.log from directory if it exist 
-    // pcr 569729 
-    if (stat("lefRWarning.log", &statbuf) != -1) {
-        // file exist, remove it 
-        if (!lefSettings->LogFileAppend)
-            remove("lefRWarning.log");
-    }
-
-    // initialize the value 
-    leflVal = strtod("-2147483648", &lefch);
-    lefrVal = strtod("2147483647", &lefch);  
-}
-
-
-lefrData::~lefrData()
-{
-    //lef_lex_un_init()
-    /* Close the file */
-    if (lefrLog) {
-        fclose(lefrLog);
-        lefrLog = 0;
-    }
-
-    //destroyRingBuffer();
-    for (int i = 0; i < RING_SIZE; i++) {
-        free(ring[i]);
-    }
-
-    free(current_token);
-    free(uc_token);
-    free(pv_token);
-
-    if (lefrAntennaPWLPtr) {
-        lefrAntennaPWLPtr->Destroy();
-        free(lefrAntennaPWLPtr);
-    }
-}
-
-void
-lefrData::reset()
-{
-    if (lefData) {
-        delete lefData;
-    }
-
-    lefData = new lefrData();
-}
-
-void 
-lefrData::initRead()
-{
-	hasVer = 1; 
-	hasBusBit = 0; 
-	hasDirection = 0; 
-	hasDivChar = 0; 
-	hasFixedMask = 0; 
-	hasGeoLayer = 0; 
-	hasInfluence = 0; 
-	hasLayerMincut = 0; 
-	hasManufactur = 0; 
-	hasMask = 0; 
-	hasMinfeature = 0; 
-	hasNameCase = 0; 
-	hasOpenedLogFile = 0; 
-	hasPRP = 0; 
-	hasParallel = 0; 
-	hasPitch = 0; 
-	hasSamenet = 0; 
-	hasSite = 0; 
-	hasSiteClass = 0; 
-	hasSiteSize = 0; 
-	hasSpCenter = 0; 
-	hasSpLayer = 0; 
-	hasSpParallel = 0; 
-	hasSpSamenet = 0; 
-	hasTwoWidths = 0; 
-	hasType = 0; 
-	hasViaRule_layer = 0; 
-	hasWidth = 0; 
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.hpp
deleted file mode 100644
index 0c88d76..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrData.hpp
+++ /dev/null
@@ -1,307 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2014, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #11 $
-//  $Date: 2013/04/23 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefrData_h
-#define lefrData_h
-
-#include <cstring>
-#include <string>
-#include <vector>
-#include <map>
-
-#include "lefiDefs.hpp"
-#include "lefiUser.hpp"
-#include "lefiLayer.hpp"
-#include "lefiArray.hpp"
-#include "lefiUtil.hpp"
-#include "lefiMacro.hpp"
-#include "lefiPropType.hpp"
-#include "lefiCrossTalk.hpp"
-#include "lefiProp.hpp"
-#include "lefiNonDefault.hpp"
-#include "lefiVia.hpp"
-#include "lefiViaRule.hpp"
-#include "lefiUnits.hpp"
-#include "lefrReader.hpp"
-
-#define CURRENT_VERSION 5.8
-#define RING_SIZE 10
-#define IN_BUF_SIZE 16384
-#define TOKEN_SIZE 4096
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-struct lefCompareStrings 
-{
-    bool operator()(const std::string &lhs, const std::string &rhs) const {
-        return std::strcmp(lhs.c_str(), rhs.c_str()) < 0;
-    }
-};
-
-typedef std::map<std::string, std::string, lefCompareStrings> lefAliasMap;
-
-typedef std::map<std::string, std::string, lefCompareStrings> lefStringMap;
-
-typedef std::map<std::string, int, lefCompareStrings> lefIntMap;
-
-typedef std::map<std::string, double, lefCompareStrings> lefDoubleMap;
-
-
-class lefrData {
-public:
-    lefrData();
-    ~lefrData();
-
-    static void reset();
-	void		initRead();
-    void		doubleBuffer();
-    
-    FILE*  lefrFile; 
-    FILE*  lefrLog; 
-
-    char   lefPropDefType;  
-    
-    char*  arrayName; 
-    char*  last; 
-    char*  layerName; 
-    char*  lefch; 
-    char*  lefrFileName; 
-    char*  macroName; 
-    char*  ndName; 
-    char*  next; 
-    char*  nonDefaultRuleName; 
-    char*  outMsg; 
-    char*  pinName; 
-    char*  shiftBuf; 
-    char*  siteName; 
-    char*  viaName; 
-    char*  viaRuleName; 
-    
-    double  layerCutSpacing; 
-    double  lef_save_x; 
-    double  lef_save_y; // for interpreting (*) notation of LEF/DEF
-    double  leflVal; 
-    double  lefrVal; 
-    double  versionNum; 
-    
-    int  antennaInoutWarnings; 
-    int  antennaInputWarnings; 
-    int  antennaOutputWarnings; 
-    int  arrayCutsVal; 
-    int  arrayCutsWar; 
-    int  arrayWarnings; 
-    int  caseSensitiveWarnings; 
-    int  correctionTableWarnings; 
-    int  dielectricWarnings; 
-    int  doneLib; // keep track if the library is done parsing
-    int  edgeRateScaleFactorWarnings; 
-    int  edgeRateThreshold1Warnings; 
-    int  edgeRateThreshold2Warnings; 
-    int  encrypted; 
-    int  first; 
-    int  first_buffer; 
-    int  ge56almostDone; // have reached the EXTENSION SECTION
-    int  ge56done; // a 5.6 and it has END LIBRARY statement
-    int  hasBusBit; 
-    int  hasDirection; 
-    int  hasDivChar; 
-    int  hasFixedMask; 
-    int  hasGeoLayer; 
-    int  hasInfluence; 
-    int  hasLayerMincut; 
-    int  hasManufactur; 
-    int  hasMask; 
-    int  hasMinfeature; 
-    int  hasNameCase; 
-    int  hasOpenedLogFile; 
-    int  hasPRP; 
-    int  hasParallel; 
-    int  hasPitch; 
-    int  hasSamenet; 
-    int  hasSite; 
-    int  hasSiteClass; 
-    int  hasSiteSize; 
-    int  hasSpCenter; 
-    int  hasSpLayer; 
-    int  hasSpParallel; 
-    int  hasSpSamenet; 
-    int  hasTwoWidths; 
-    int  hasType; 
-    int  hasVer; 
-    int  hasViaRule_layer; 
-    int  hasWidth; 
-    int  hasFatalError; // don't report errors after the file end.
-    int  iRDropWarnings; 
-    int  ignoreVersion; // ignore checking version number
-    int  inDefine; 
-    int  inoutAntennaWarnings; 
-    int  inputAntennaWarnings; 
-    int  input_level; 
-    int  isGenerate; 
-    int  layerCut; 
-    int  layerDir; 
-    int  layerMastOver; 
-    int  layerRout; 
-    int  layerWarnings; 
-    int  lefDefIf; 
-    int  lefDumbMode; 
-    int  lefErrMsgPrinted; 
-    int  lefFixedMask; //All the LEF MACRO PIN MASK assignments can be 
-    int  lefInfoMsgPrinted; 
-    int  lefInvalidChar; 
-    int  lefNdRule; 
-    int  lefNewIsKeyword; 
-    int  lefNlToken; 
-    int  lefNoNum; 
-    int  lefRetVal; 
-    int  lefWRetVal; 
-    int  lefWarnMsgPrinted; 
-    int  lef_errors; 
-    int  lef_nlines; 
-    int  lef_ntokens; 
-    int  lef_warnings; 
-    int  lefrDoGcell; 
-    int  lefrDoGeometries; 
-    int  lefrDoSite; 
-    int  lefrDoTrack;
-    int  lefrHasLayer; // 5.5 this & lefrHasMaxVS is to keep track that
-    int  lefrHasMaxVS; // MAXVIASTACK has to be after all layers
-    int  lefrHasSpacing; // keep track of spacing in a layer
-    int  lefrHasSpacingTbl; // keep track of spacing table in a layer
-
-    int  macroWarnings; 
-    int  maxStackViaWarnings; 
-    int  minFeatureWarnings; 
-    int  msgCnt; 
-    int  namesCaseSensitive; // always true in 5.6
-    int  ndLayer; 
-    int  ndLayerSpace; 
-    int  ndLayerWidth; 
-    int  ndRule; 
-    int  needGeometry; 
-    int  noWireExtensionWarnings; 
-    int  noiseMarginWarnings; 
-    int  noiseTableWarnings; 
-    int  nonDefaultWarnings; 
-    int  numVia; 
-    int  obsDef; 
-    int  origDef; 
-    int  outputAntennaWarnings; 
-    int  pinDef; 
-    int  pinWarnings; 
-    int  prtNewLine; // sometimes need to print a new line
-    int  prtSemiColon; // sometimes ; is not printed yet
-    int  ringPlace; 
-    int  shiftBufLength; 
-    int  siteDef; 
-    int  siteWarnings; 
-    int  sizeDef; 
-    int  spParallelLength; 
-    int  spaceMissing; 
-    int  spacingWarnings; 
-    int  symDef; 
-    int  timingWarnings; 
-    int  unitsWarnings; 
-    int  use5_3; 
-    int  use5_4; 
-    int  useLenThr; 
-    int  useMinSpacingWarnings; 
-    int  viaLayer; 
-    int  viaRuleHasDir; 
-    int  viaRuleHasEnc; 
-    int  viaRuleLayer; 
-    int  viaRuleWarnings; 
-    int  viaWarnings; 
-    
-    lefiAntennaEnum  antennaType; 
-    lefiAntennaPWL*  lefrAntennaPWLPtr; 
-    lefiArray  lefrArray; 
-    lefiCorrectionTable  lefrCorrectionTable; 
-    lefiDensity  lefrDensity; 
-    lefiGcellPattern*  lefrGcellPatternPtr; 
-    lefiGeometries*  lefrGeometriesPtr; 
-    lefiIRDrop  lefrIRDrop; 
-    lefiLayer  lefrLayer; 
-    lefiMacro  lefrMacro; 
-    lefiMaxStackVia  lefrMaxStackVia; // 5.5
-    lefiMinFeature  lefrMinFeature; 
-    lefiNoiseMargin  lefrNoiseMargin; 
-    lefiNoiseTable  lefrNoiseTable; 
-    lefiNonDefault  lefrNonDefault; 
-    lefiNonDefault*  nd; // PCR 909010 - For VIA in the nondefaultrule
-    lefiNum  macroNum; 
-    lefiObstruction  lefrObstruction; 
-    lefiPin  lefrPin; 
-    lefiProp  lefrProp; 
-    lefiSite  lefrSite; 
-    lefiSitePattern*  lefrSitePatternPtr; 
-    lefiSpacing  lefrSpacing; 
-    lefiTiming  lefrTiming; 
-    lefiTrackPattern*  lefrTrackPatternPtr; 
-    lefiUnits  lefrUnits; 
-    lefiUseMinSpacing  lefrUseMinSpacing; 
-    lefiVia  lefrVia; 
-    lefiViaRule  lefrViaRule; 
-    
-    lefStringMap        alias_set; 
-    lefDoubleMap        define_set; 
-    lefIntMap           defineb_set; 
-    lefStringMap        defines_set; 
-    int                 tokenSize;
-
-    //ARRAYS
-    // Ring buffer storage 
-    char       *ring[RING_SIZE];
-    int         ringSizes[RING_SIZE];
-    char        lefDebug[100];
-
-    char       *current_token; 
-    char       *pv_token; 
-    char       *uc_token; 
-
-    char       current_buffer[IN_BUF_SIZE];
-    const char *current_stack[20];  // the stack itself 
-
-    char       lefrErrMsg[1024];
-    char       temp_name[258];
-
-    std::vector<char>  Hist_text; 
-
-    // to hold the msg limit, 0 - num of limit 
-    // 1 - num of message printed, 4701 = 4700 + 1, message starts on 1 
-    // 2 - warning printed 
-    int msgLimit[2][MAX_LEF_MSGS];
-};
-
-extern lefrData *lefData;
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.cpp
deleted file mode 100644
index ccc9499..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.cpp
+++ /dev/null
@@ -1,1910 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-#include "lefrReader.hpp"
-#include "lex.h"
-#include <stdlib.h>
-#include <string.h>
-
-#include "lefiDebug.hpp"
-#include "lefrData.hpp"
-#include "lefrSettings.hpp"
-#include "lefrCallBacks.hpp"
-
-#define NOCBK 100
-#define NOLEFMSG 4701 // 4701 = 4700 + 1, message starts on 1
-
-# define LEF_INIT lef_init(__FUNCTION__)
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-static const char *init_call_func = NULL;
-
-extern double convert_name2num(const char *versionName);
-extern bool validateMaskNumber(int num);
-
-void
-lef_init(const char  *func)
-{
-    if (lefSettings == NULL) {
-		lefrSettings::reset();
-		init_call_func = func;
-	}
-
-    if (lefCallbacks == NULL) {
-		lefrCallbacks::reset();
-		init_call_func = func;
-    }
-}
-
-
-void
-lefiNerr(int i)
-{
-    sprintf(lefData->lefrErrMsg, "ERROR number %d\n", i);
-    lefiError(1, 0, lefData->lefrErrMsg);
-    exit(2);
-}
-
-void
-lefiNwarn(int i)
-{
-    sprintf(lefData->lefrErrMsg, "WARNING number %d\n", i);
-    lefiError(1, 0, lefData->lefrErrMsg);
-    exit(2);
-}
-
-double
-convert_name2num(const char *versionName)
-{
-    char    majorNm[80];
-    char    minorNm[80];
-    char    *subMinorNm = NULL;
-
-    char    *versionNm = strdup(versionName);
-
-    double  major = 0, minor = 0, subMinor = 0;
-    double  version, versionNumber;
-    char    finalVersion[80];
-
-    sscanf(versionNm, "%[^.].%s", majorNm, minorNm);
-    char    *p1 = strchr(minorNm, '.');
-    if (p1) {
-        subMinorNm = p1 + 1;
-        *p1 = '\0';
-    }
-    major = atof(majorNm);
-    minor = atof(minorNm);
-    if (subMinorNm)
-        subMinor = atof(subMinorNm);
-
-    version = major;
-
-    if (minor > 0)
-        version = major + minor / 10;
-
-    if (subMinor > 0)
-        version = version + subMinor / 1000;
-
-    lefFree(versionNm);
-
-    sprintf(finalVersion, "%.4f", version);
-
-    versionNumber = atof(finalVersion);
-
-    return versionNumber;
-}
-
-bool
-validateMaskNumber(int num)
-{
-    int digit = 0;
-    int index = 0;
-
-    if (num < 0) {
-        return false;
-    }
-
-    while (num > 0) {
-        digit = num % 10;
-
-        if (digit > 3) {
-            return false;
-        }
-
-        index++;
-        num = num / 10;
-    }
-
-    if (index > 3) {
-        return false;
-    }
-
-    return true;
-}
-
-// *****************************************************************************s
-// Global variables
-// *****************************************************************************
-
-// 5.6 END LIBRARY is optional.
-// Function to initialize global variables.
-// This make sure the global variables are initialized
-
-// User control warning to be printed by the parser
-void
-lefrDisableParserMsgs(int   nMsg,
-                      int   *msgs)
-{
-    LEF_INIT;
-    if (nMsg <= 0)
-        return;
-
-    for (int i = 0; i < nMsg; i++) {
-        lefSettings->disableMsg(msgs[i]);
-    }
-}
-
-void
-lefrEnableParserMsgs(int    nMsg,
-                     int    *msgs)
-{
-    LEF_INIT;
-    for (int i = 0; i < nMsg; i++) {
-        lefSettings->enableMsg(msgs[i]);
-    }
-}
-
-void
-lefrEnableAllMsgs()
-{
-    LEF_INIT;
-    lefSettings->enableAllMsgs();
-    lefSettings->dAllMsgs = 0;
-}
-
-void
-lefrSetTotalMsgLimit(int totNumMsgs)
-{
-    LEF_INIT;
-    lefSettings->TotalMsgLimit = totNumMsgs;
-}
-
-void
-lefrSetLimitPerMsg(int  msgId,
-                   int  numMsg)
-{
-    LEF_INIT;
-    
-    if ((msgId > 0) && (msgId < NOLEFMSG)) {
-        lefSettings->MsgLimit[msgId] = numMsg;
-    }
-}
-
-// *****************************************************************************
-// Since the lef parser only keep one list of disable message ids, and does
-// not have a list of enable message ids, if the API lefrDisableAllMsgs is
-// called to disable all message ids, user has to call API lefrEnableAllMsgs
-// to enable all message ids lefData->first, before calling lefrDisableParserMsgs &
-// lefrEnableParserMsgs.
-// Users cannot call lefrDisableAllMsgs and call lefrEnableParserMsgs to
-// enable a small list of message ids since lefrDisableAllMsgs does not have
-// a list of all message ids, hence there isn't a list for lefrEnableParserMsgs
-// to work on to enable the message ids.
-// *****************************************************************************
-void
-lefrDisableAllMsgs()
-{
-    LEF_INIT;
-    lefSettings->enableAllMsgs();
-    lefSettings->dAllMsgs = 1;
-}
-
-// Parser control by the user.
-// Reader initialization
-int
-lefrInit()
-{
-	return lefrInitSession(0);
-}
-
-int
-lefrInitSession(int startSession)
-{
-	if (startSession) { 
-		if (init_call_func != NULL) {
-			fprintf(stderr, "ERROR: Attempt to call configuration function '%s' in LEF parser before lefrInit() call in session-based mode.\n", init_call_func);
-			return 1;
-		}
-
-		lefrCallbacks::reset();
-		lefrSettings::reset();
-	} else {
-		if (lefCallbacks == NULL) {
-			lefrCallbacks::reset();
-		}
-	
-		if (lefSettings == NULL) {
-			lefrSettings::reset();
-		}
-	}
-
-    return 0;
-}
-
-int
-lefrReset()
-{
-    // obsoleted.
-    return 0;
-}
-
-
-int 
-lefrClear()
-{
-    delete lefData;
-    lefData = NULL;
-
-    delete lefCallbacks;
-    lefCallbacks = NULL;
-
-    delete lefSettings;
-    lefSettings = NULL;
-
-    return 0;
-}
-
-
-const char *
-lefrFName()
-{
-    return lefData->lefrFileName;
-}
-
-int
-lefrReleaseNResetMemory()
-{
-    return 0;
-}
-
-int
-lefrRead(FILE           *f,
-         const char     *fName,
-         lefiUserData   uData)
-{
-    LEF_INIT;
-    int status;
-
-    lefrData::reset();
-
-    lefData->versionNum = (lefSettings->VersionNum == 0.0) ?
-        CURRENT_VERSION :
-        lefData->versionNum = lefSettings->VersionNum;
-
-    if (lefSettings->CaseSensitiveSet) {
-        lefData->namesCaseSensitive = lefSettings->CaseSensitive;
-    } else if (lefData->versionNum > 5.5) {
-        lefData->namesCaseSensitive = true;
-    }
-
-    lefData->lefrFileName = (char*) fName;
-    lefData->lefrFile = f;
-    lefSettings->UserData = uData;
-
-    status = lefyyparse();
-
-    return status;
-}
-
-void
-lefrSetUnusedCallbacks(lefrVoidCbkFnType func)
-{
-    // Set all of the callbacks that have not been set yet to
-    // the given function.
-    LEF_INIT;
-
-    if (lefCallbacks->ArrayBeginCbk == 0)
-        lefCallbacks->ArrayBeginCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->ArrayCbk == 0)
-        lefCallbacks->ArrayCbk = (lefrArrayCbkFnType) func;
-    if (lefCallbacks->ArrayEndCbk == 0)
-        lefCallbacks->ArrayEndCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->DividerCharCbk == 0)
-        lefCallbacks->DividerCharCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->BusBitCharsCbk == 0)
-        lefCallbacks->BusBitCharsCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->CaseSensitiveCbk == 0)
-        lefCallbacks->CaseSensitiveCbk = (lefrIntegerCbkFnType) func;
-    if (lefCallbacks->NoWireExtensionCbk == 0)
-        lefCallbacks->NoWireExtensionCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->CorrectionTableCbk == 0)
-        lefCallbacks->CorrectionTableCbk = (lefrCorrectionTableCbkFnType) func;
-    if (lefCallbacks->DielectricCbk == 0)
-        lefCallbacks->DielectricCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->EdgeRateScaleFactorCbk == 0)
-        lefCallbacks->EdgeRateScaleFactorCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->EdgeRateThreshold1Cbk == 0)
-        lefCallbacks->EdgeRateThreshold1Cbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->EdgeRateThreshold2Cbk == 0)
-        lefCallbacks->EdgeRateThreshold2Cbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->IRDropBeginCbk == 0)
-        lefCallbacks->IRDropBeginCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->IRDropCbk == 0)
-        lefCallbacks->IRDropCbk = (lefrIRDropCbkFnType) func;
-    if (lefCallbacks->IRDropEndCbk == 0)
-        lefCallbacks->IRDropEndCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->LayerCbk == 0)
-        lefCallbacks->LayerCbk = (lefrLayerCbkFnType) func;
-    if (lefCallbacks->LibraryEndCbk == 0)
-        lefCallbacks->LibraryEndCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->MacroBeginCbk == 0)
-        lefCallbacks->MacroBeginCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->MacroCbk == 0)
-        lefCallbacks->MacroCbk = (lefrMacroCbkFnType) func;
-    if (lefCallbacks->MacroClassTypeCbk == 0)
-        lefCallbacks->MacroClassTypeCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->MacroOriginCbk == 0)
-        lefCallbacks->MacroOriginCbk = (lefrMacroNumCbkFnType) func;
-    if (lefCallbacks->MacroSiteCbk == 0)
-        lefCallbacks->MacroSiteCbk = (lefrMacroSiteCbkFnType) func;
-    if (lefCallbacks->MacroForeignCbk == 0)
-        lefCallbacks->MacroForeignCbk = (lefrMacroForeignCbkFnType) func;
-    if (lefCallbacks->MacroSizeCbk == 0)
-        lefCallbacks->MacroSizeCbk = (lefrMacroNumCbkFnType) func;
-    if (lefCallbacks->MacroFixedMaskCbk == 0)
-        lefCallbacks->MacroFixedMaskCbk = (lefrIntegerCbkFnType) func;
-    if (lefCallbacks->TimingCbk == 0)
-        lefCallbacks->TimingCbk = (lefrTimingCbkFnType) func;
-    if (lefCallbacks->MinFeatureCbk == 0)
-        lefCallbacks->MinFeatureCbk = (lefrMinFeatureCbkFnType) func;
-    if (lefCallbacks->NoiseMarginCbk == 0)
-        lefCallbacks->NoiseMarginCbk = (lefrNoiseMarginCbkFnType) func;
-    if (lefCallbacks->NoiseTableCbk == 0)
-        lefCallbacks->NoiseTableCbk = (lefrNoiseTableCbkFnType) func;
-    if (lefCallbacks->NonDefaultCbk == 0)
-        lefCallbacks->NonDefaultCbk = (lefrNonDefaultCbkFnType) func;
-    if (lefCallbacks->ObstructionCbk == 0)
-        lefCallbacks->ObstructionCbk = (lefrObstructionCbkFnType) func;
-    if (lefCallbacks->PinCbk == 0)
-        lefCallbacks->PinCbk = (lefrPinCbkFnType) func;
-    if (lefCallbacks->PropBeginCbk == 0)
-        lefCallbacks->PropBeginCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->PropCbk == 0)
-        lefCallbacks->PropCbk = (lefrPropCbkFnType) func;
-    if (lefCallbacks->PropEndCbk == 0)
-        lefCallbacks->PropEndCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->SiteCbk == 0)
-        lefCallbacks->SiteCbk = (lefrSiteCbkFnType) func;
-    if (lefCallbacks->SpacingBeginCbk == 0)
-        lefCallbacks->SpacingBeginCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->SpacingCbk == 0)
-        lefCallbacks->SpacingCbk = (lefrSpacingCbkFnType) func;
-    if (lefCallbacks->SpacingEndCbk == 0)
-        lefCallbacks->SpacingEndCbk = (lefrVoidCbkFnType) func;
-    if (lefCallbacks->UnitsCbk == 0)
-        lefCallbacks->UnitsCbk = (lefrUnitsCbkFnType) func;
-    if ((lefCallbacks->VersionCbk == 0) && (lefCallbacks->VersionStrCbk == 0)) {
-        // both version callbacks weren't set, if either one is set, it is ok
-        lefCallbacks->VersionCbk = (lefrDoubleCbkFnType) func;
-        lefCallbacks->VersionStrCbk = (lefrStringCbkFnType) func;
-    }
-    if (lefCallbacks->ViaCbk == 0)
-        lefCallbacks->ViaCbk = (lefrViaCbkFnType) func;
-    if (lefCallbacks->ViaRuleCbk == 0)
-        lefCallbacks->ViaRuleCbk = (lefrViaRuleCbkFnType) func;
-    if (lefCallbacks->InputAntennaCbk == 0)
-        lefCallbacks->InputAntennaCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->OutputAntennaCbk == 0)
-        lefCallbacks->OutputAntennaCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->InoutAntennaCbk == 0)
-        lefCallbacks->InoutAntennaCbk = (lefrDoubleCbkFnType) func;
-
-    // NEW CALLBACK - Add a line here for each new callback routine 
-    if (lefCallbacks->AntennaInputCbk == 0)
-        lefCallbacks->AntennaInputCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->AntennaInoutCbk == 0)
-        lefCallbacks->AntennaInoutCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->AntennaOutputCbk == 0)
-        lefCallbacks->AntennaOutputCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->ManufacturingCbk == 0)
-        lefCallbacks->ManufacturingCbk = (lefrDoubleCbkFnType) func;
-    if (lefCallbacks->UseMinSpacingCbk == 0)
-        lefCallbacks->UseMinSpacingCbk = (lefrUseMinSpacingCbkFnType) func;
-    if (lefCallbacks->ClearanceMeasureCbk == 0)
-        lefCallbacks->ClearanceMeasureCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->MacroClassTypeCbk == 0)
-        lefCallbacks->MacroClassTypeCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->MacroOriginCbk == 0)
-        lefCallbacks->MacroOriginCbk = (lefrMacroNumCbkFnType) func;
-    if (lefCallbacks->MacroSiteCbk == 0)
-        lefCallbacks->MacroSiteCbk = (lefrMacroSiteCbkFnType) func;
-    if (lefCallbacks->MacroForeignCbk == 0)
-        lefCallbacks->MacroForeignCbk = (lefrMacroForeignCbkFnType) func;
-    if (lefCallbacks->MacroSizeCbk == 0)
-        lefCallbacks->MacroSizeCbk = (lefrMacroNumCbkFnType) func;
-    if (lefCallbacks->MacroFixedMaskCbk == 0)
-        lefCallbacks->MacroFixedMaskCbk = (lefrIntegerCbkFnType) func;
-    if (lefCallbacks->MacroEndCbk == 0)
-        lefCallbacks->MacroEndCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->MaxStackViaCbk == 0)
-        lefCallbacks->MaxStackViaCbk = (lefrMaxStackViaCbkFnType) func;
-    if (lefCallbacks->ExtensionCbk == 0)
-        lefCallbacks->ExtensionCbk = (lefrStringCbkFnType) func;
-    if (lefCallbacks->DensityCbk == 0)
-        lefCallbacks->DensityCbk = (lefrDensityCbkFnType) func;
-    if (lefCallbacks->FixedMaskCbk == 0)
-        lefCallbacks->FixedMaskCbk = (lefrIntegerCbkFnType) func;
-}
-
-// These count up the number of times an unset callback is called... 
-static int lefrUnusedCount[NOCBK];
-
-int
-lefrCountFunc(lefrCallbackType_e    e,
-              void                  *v,
-              lefiUserData          d)
-{
-    LEF_INIT;
-    int i = (int) e;
-    if (lefiDebug(23))
-        printf("count %d 0x%p 0x%p\n", (int) e, v, d);
-    if (i >= 0 && i < NOCBK) {
-        lefrUnusedCount[i] += 1;
-        return 0;
-    }
-    return 1;
-}
-
-void
-lefrSetRegisterUnusedCallbacks()
-{
-    LEF_INIT;
-    int i;
-    lefSettings->RegisterUnused = 1;
-    lefrSetUnusedCallbacks(lefrCountFunc);
-    for (i = 0; i < NOCBK; i++)
-        lefrUnusedCount[i] = 0;
-}
-
-void
-lefrPrintUnusedCallbacks(FILE *f)
-{
-    LEF_INIT;
-    int i;
-    int firstCB = 1;
-    int trueCB = 1;
-
-    if (lefSettings->RegisterUnused == 0) {
-        fprintf(f,
-                "ERROR (LEFPARS-101): lefrSetRegisterUnusedCallbacks was not called to setup this data.\n");
-        return;
-    }
-
-    for (i = 0; i < NOCBK; i++) {
-        if (lefrUnusedCount[i]) {
-            // Do not need to print yet if i is:
-            //  lefrMacroClassTypeCbkType
-            //  lefrMacroOriginCbkType
-            //  lefrMacroSizeCbkType
-            //  lefrMacroEndCbkType
-            // it will be taken care later
-            if (firstCB &&
-                (lefrCallbackType_e) i != lefrMacroClassTypeCbkType &&
-                (lefrCallbackType_e) i != lefrMacroOriginCbkType &&
-                (lefrCallbackType_e) i != lefrMacroSiteCbkType &&
-                (lefrCallbackType_e) i != lefrMacroForeignCbkType &&
-                (lefrCallbackType_e) i != lefrMacroSizeCbkType &&
-                (lefrCallbackType_e) i != lefrMacroFixedMaskCbkType &&
-                (lefrCallbackType_e) i != lefrMacroEndCbkType) {
-                fprintf(f,
-                        "WARNING (LEFPARS-201): LEF items that were present but ignored because of no callback:\n");
-                firstCB = 0;
-            }
-            switch ((lefrCallbackType_e) i) {
-            case lefrArrayBeginCbkType:
-                fprintf(f, "ArrayBegin");
-                break;
-            case lefrArrayCbkType:
-                fprintf(f, "Array");
-                break;
-            case lefrArrayEndCbkType:
-                fprintf(f, "ArrayEnd");
-                break;
-            case lefrDividerCharCbkType:
-                fprintf(f, "DividerChar");
-                break;
-            case lefrBusBitCharsCbkType:
-                fprintf(f, "BusBitChars");
-                break;
-            case lefrNoWireExtensionCbkType:
-                fprintf(f, "NoWireExtensionAtPins");
-                break;
-            case lefrCaseSensitiveCbkType:
-                fprintf(f, "CaseSensitive");
-                break;
-            case lefrCorrectionTableCbkType:
-                fprintf(f, "CorrectionTable");
-                break;
-            case lefrDielectricCbkType:
-                fprintf(f, "Dielectric");
-                break;
-            case lefrEdgeRateScaleFactorCbkType:
-                fprintf(f, "EdgeRateScaleFactor");
-                break;
-            case lefrEdgeRateThreshold1CbkType:
-                fprintf(f, "EdgeRateThreshold1");
-                break;
-            case lefrEdgeRateThreshold2CbkType:
-                fprintf(f, "EdgeRateThreshold2");
-                break;
-            case lefrIRDropBeginCbkType:
-                fprintf(f, "IRDropBegin");
-                break;
-            case lefrIRDropCbkType:
-                fprintf(f, "IRDrop");
-                break;
-            case lefrIRDropEndCbkType:
-                fprintf(f, "IRDropEnd");
-                break;
-            case lefrLayerCbkType:
-                fprintf(f, "Layer");
-                break;
-            case lefrLibraryEndCbkType:
-                fprintf(f, "LibraryEnd");
-                break;
-            case lefrMacroBeginCbkType:
-                fprintf(f, "MacroBegin");
-                break;
-            case lefrMacroCbkType:
-                fprintf(f, "Macro");
-                break;
-            case lefrMinFeatureCbkType:
-                fprintf(f, "MinFeature");
-                break;
-            case lefrNoiseMarginCbkType:
-                fprintf(f, "NoiseMargin");
-                break;
-            case lefrNoiseTableCbkType:
-                fprintf(f, "NoiseTable");
-                break;
-            case lefrNonDefaultCbkType:
-                fprintf(f, "NonDefault");
-                break;
-            case lefrObstructionCbkType:
-                fprintf(f, "Obstruction");
-                break;
-            case lefrPinCbkType:
-                fprintf(f, "Pin");
-                break;
-            case lefrPropBeginCbkType:
-                fprintf(f, "PropBegin");
-                break;
-            case lefrPropCbkType:
-                fprintf(f, "Prop");
-                break;
-            case lefrPropEndCbkType:
-                fprintf(f, "PropEnd");
-                break;
-            case lefrSiteCbkType:
-                fprintf(f, "Site");
-                break;
-            case lefrSpacingBeginCbkType:
-                fprintf(f, "SpacingBegin");
-                break;
-            case lefrSpacingCbkType:
-                fprintf(f, "Spacing");
-                break;
-            case lefrSpacingEndCbkType:
-                fprintf(f, "SpacingEnd");
-                break;
-            case lefrUnitsCbkType:
-                fprintf(f, "Units");
-                break;
-            case lefrVersionCbkType:
-                fprintf(f, "Version");
-                break;
-            case lefrVersionStrCbkType:
-                fprintf(f, "Version");
-                break;
-            case lefrViaCbkType:
-                fprintf(f, "Via");
-                break;
-            case lefrViaRuleCbkType:
-                fprintf(f, "ViaRule");
-                break;
-            case lefrInputAntennaCbkType:
-                fprintf(f, "InputAntenna");
-                break;
-            case lefrOutputAntennaCbkType:
-                fprintf(f, "OutputAntenna");
-                break;
-            case lefrInoutAntennaCbkType:
-                fprintf(f, "InoutAntenna");
-                break;
-            case lefrAntennaInputCbkType:
-                fprintf(f, "AntennaInput");
-                break;
-            case lefrAntennaInoutCbkType:
-                fprintf(f, "AntennaInout");
-                break;
-            case lefrAntennaOutputCbkType:
-                fprintf(f, "AntennaOutput");
-                break;
-            case lefrManufacturingCbkType:
-                fprintf(f, "Manufacturing");
-                break;
-            case lefrUseMinSpacingCbkType:
-                fprintf(f, "UseMinSpacing");
-                break;
-            case lefrClearanceMeasureCbkType:
-                fprintf(f, "ClearanceMeasure");
-                break;
-            case lefrTimingCbkType:
-                fprintf(f, "Timing");
-                break;
-            case lefrMaxStackViaCbkType:
-                fprintf(f, "MaxStackVia");
-                break;
-            case lefrExtensionCbkType:
-                fprintf(f, "Extension");
-                break;
-                // 07/13/2001 - Wanda da Rosa
-                // Don't need to print MacroClassType if it is not set,
-                // since this is an extra CB for Ambit only.
-                // Other users should not have to deal with it.
-                // case lefrMacroClassTypeCbkType: fprintf(f, "MacroClassType"); break;
-            case lefrMacroClassTypeCbkType:
-            case lefrMacroOriginCbkType:
-            case lefrMacroSiteCbkType:
-            case lefrMacroForeignCbkType:
-            case lefrMacroSizeCbkType:
-            case lefrMacroFixedMaskCbkType:
-            case lefrMacroEndCbkType:
-                trueCB = 0;
-                break;
-                // NEW CALLBACK  add the print here 
-            case lefrDensityCbkType:
-                fprintf(f, "Density");
-                break;
-            case lefrFixedMaskCbkType:
-                fprintf(f, "FixedMask");
-                break;
-            default:
-                fprintf(f, "BOGUS ENTRY");
-                break;
-            }
-            if (trueCB)
-                fprintf(f, " %d\n", lefrUnusedCount[i]);
-            else
-                trueCB = 1;
-        }
-    }
-}
-
-void
-lefrUnsetCallbacks()
-{
-    lefrCallbacks::reset();
-}
-
-// Unset callbacks functions
-void
-lefrUnsetAntennaInoutCbk()
-{
-    LEF_INIT;
-    lefCallbacks->AntennaInoutCbk = 0;
-}
-
-void
-lefrUnsetAntennaInputCbk()
-{
-    LEF_INIT;
-    lefCallbacks->AntennaInputCbk = 0;
-}
-
-void
-lefrUnsetAntennaOutputCbk()
-{
-    LEF_INIT;
-    lefCallbacks->AntennaOutputCbk = 0;
-}
-
-void
-lefrUnsetArrayBeginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ArrayBeginCbk = 0;
-}
-
-void
-lefrUnsetArrayCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ArrayCbk = 0;
-}
-
-void
-lefrUnsetArrayEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ArrayEndCbk = 0;
-}
-
-void
-lefrUnsetBusBitCharsCbk()
-{
-    LEF_INIT;
-    lefCallbacks->BusBitCharsCbk = 0;
-}
-
-void
-lefrUnsetCaseSensitiveCbk()
-{
-    LEF_INIT;
-    lefCallbacks->CaseSensitiveCbk = 0;
-}
-
-void
-lefrUnsetClearanceMeasureCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ClearanceMeasureCbk = 0;
-}
-
-void
-lefrUnsetCorrectionTableCbk()
-{
-    LEF_INIT;
-    lefCallbacks->CorrectionTableCbk = 0;
-}
-
-void
-lefrUnsetDensityCbk()
-{
-    LEF_INIT;
-    lefCallbacks->DensityCbk = 0;
-}
-
-void
-lefrUnsetDielectricCbk()
-{
-    LEF_INIT;
-    lefCallbacks->DielectricCbk = 0;
-}
-
-void
-lefrUnsetDividerCharCbk()
-{
-    LEF_INIT;
-    lefCallbacks->DividerCharCbk = 0;
-}
-
-void
-lefrUnsetEdgeRateScaleFactorCbk()
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateScaleFactorCbk = 0;
-}
-
-void
-lefrUnsetEdgeRateThreshold1Cbk()
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateThreshold1Cbk = 0;
-}
-
-void
-lefrUnsetEdgeRateThreshold2Cbk()
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateThreshold2Cbk = 0;
-}
-
-void
-lefrUnsetExtensionCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ExtensionCbk = 0;
-}
-
-void
-lefrUnsetFixedMaskCbk()
-{
-    LEF_INIT;
-    lefCallbacks->FixedMaskCbk = 0;
-}
-void
-lefrUnsetIRDropBeginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->IRDropBeginCbk = 0;
-}
-
-void
-lefrUnsetIRDropCbk()
-{
-    LEF_INIT;
-    lefCallbacks->IRDropCbk = 0;
-}
-
-void
-lefrUnsetIRDropEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->IRDropEndCbk = 0;
-}
-
-void
-lefrUnsetInoutAntennaCbk()
-{
-    LEF_INIT;
-    lefCallbacks->InoutAntennaCbk = 0;
-}
-
-void
-lefrUnsetInputAntennaCbk()
-{
-    LEF_INIT;
-    lefCallbacks->InputAntennaCbk = 0;
-}
-
-void
-lefrUnsetLayerCbk()
-{
-    LEF_INIT;
-    lefCallbacks->LayerCbk = 0;
-}
-
-void
-lefrUnsetLibraryEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->LibraryEndCbk = 0;
-}
-
-void
-lefrUnsetMacroBeginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroBeginCbk = 0;
-}
-
-void
-lefrUnsetMacroCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroCbk = 0;
-}
-
-void
-lefrUnsetMacroClassTypeCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroClassTypeCbk = 0;
-}
-
-void
-lefrUnsetMacroEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroEndCbk = 0;
-}
-
-void
-lefrUnsetMacroFixedMaskCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroFixedMaskCbk = 0;
-}
-
-void
-lefrUnsetMacroOriginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroOriginCbk = 0;
-}
-
-void
-lefrUnsetMacroSiteCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroSiteCbk = 0;
-}
-
-void
-lefrUnsetMacroForeignCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroForeignCbk = 0;
-}
-
-void
-lefrUnsetMacroSizeCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MacroSizeCbk = 0;
-}
-
-void
-lefrUnsetManufacturingCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ManufacturingCbk = 0;
-}
-
-void
-lefrUnsetMaxStackViaCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MaxStackViaCbk = 0;
-}
-
-void
-lefrUnsetMinFeatureCbk()
-{
-    LEF_INIT;
-    lefCallbacks->MinFeatureCbk = 0;
-}
-
-void
-lefrUnsetNoWireExtensionCbk()
-{
-    LEF_INIT;
-    lefCallbacks->NoWireExtensionCbk = 0;
-}
-
-void
-lefrUnsetNoiseMarginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->NoiseMarginCbk = 0;
-}
-
-void
-lefrUnsetNoiseTableCbk()
-{
-    LEF_INIT;
-    lefCallbacks->NoiseTableCbk = 0;
-}
-
-void
-lefrUnsetNonDefaultCbk()
-{
-    LEF_INIT;
-    lefCallbacks->NonDefaultCbk = 0;
-}
-
-void
-lefrUnsetObstructionCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ObstructionCbk = 0;
-}
-
-void
-lefrUnsetOutputAntennaCbk()
-{
-    LEF_INIT;
-    lefCallbacks->OutputAntennaCbk = 0;
-}
-
-void
-lefrUnsetPinCbk()
-{
-    LEF_INIT;
-    lefCallbacks->PinCbk = 0;
-}
-
-void
-lefrUnsetPropBeginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->PropBeginCbk = 0;
-}
-
-void
-lefrUnsetPropCbk()
-{
-    LEF_INIT;
-    lefCallbacks->PropCbk = 0;
-}
-
-void
-lefrUnsetPropEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->PropEndCbk = 0;
-}
-
-void
-lefrUnsetSiteCbk()
-{
-    LEF_INIT;
-    lefCallbacks->SiteCbk = 0;
-}
-
-void
-lefrUnsetSpacingBeginCbk()
-{
-    LEF_INIT;
-    lefCallbacks->SpacingBeginCbk = 0;
-}
-
-void
-lefrUnsetSpacingCbk()
-{
-    LEF_INIT;
-    lefCallbacks->SpacingCbk = 0;
-}
-
-void
-lefrUnsetSpacingEndCbk()
-{
-    LEF_INIT;
-    lefCallbacks->SpacingEndCbk = 0;
-}
-
-void
-lefrUnsetTimingCbk()
-{
-    LEF_INIT;
-    lefCallbacks->TimingCbk = 0;
-}
-
-void
-lefrUnsetUnitsCbk()
-{
-    LEF_INIT;
-    lefCallbacks->UnitsCbk = 0;
-}
-
-void
-lefrUnsetUseMinSpacingCbk()
-{
-    LEF_INIT;
-    lefCallbacks->UseMinSpacingCbk = 0;
-}
-
-void
-lefrUnsetVersionCbk()
-{
-    LEF_INIT;
-    lefCallbacks->VersionCbk = 0;
-}
-
-void
-lefrUnsetVersionStrCbk()
-{
-    LEF_INIT;
-    lefCallbacks->VersionStrCbk = 0;
-}
-
-void
-lefrUnsetViaCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ViaCbk = 0;
-}
-
-void
-lefrUnsetViaRuleCbk()
-{
-    LEF_INIT;
-    lefCallbacks->ViaRuleCbk = 0;
-}
-
-// Setting of user data.
-void
-lefrSetUserData(lefiUserData d)
-{
-    LEF_INIT;
-    lefSettings->UserData = d;
-}
-
-lefiUserData
-lefrGetUserData()
-{
-    LEF_INIT;
-    return lefSettings->UserData;
-}
-
-// Callbacks set functions.
-
-void
-lefrSetAntennaInoutCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->AntennaInoutCbk = f;
-}
-
-void
-lefrSetAntennaInputCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->AntennaInputCbk = f;
-}
-
-void
-lefrSetAntennaOutputCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->AntennaOutputCbk = f;
-}
-
-void
-lefrSetArrayBeginCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ArrayBeginCbk = f;
-}
-
-void
-lefrSetArrayCbk(lefrArrayCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ArrayCbk = f;
-}
-
-void
-lefrSetArrayEndCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ArrayEndCbk = f;
-}
-
-void
-lefrSetBusBitCharsCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->BusBitCharsCbk = f;
-}
-
-void
-lefrSetCaseSensitiveCbk(lefrIntegerCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->CaseSensitiveCbk = f;
-}
-
-void
-lefrSetClearanceMeasureCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ClearanceMeasureCbk = f;
-}
-
-void
-lefrSetCorrectionTableCbk(lefrCorrectionTableCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->CorrectionTableCbk = f;
-}
-
-void
-lefrSetDensityCbk(lefrDensityCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->DensityCbk = f;
-}
-
-void
-lefrSetDielectricCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->DielectricCbk = f;
-}
-
-void
-lefrSetDividerCharCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->DividerCharCbk = f;
-}
-
-void
-lefrSetEdgeRateScaleFactorCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateScaleFactorCbk = f;
-}
-
-void
-lefrSetEdgeRateThreshold1Cbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateThreshold1Cbk = f;
-}
-
-void
-lefrSetEdgeRateThreshold2Cbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->EdgeRateThreshold2Cbk = f;
-}
-
-void
-lefrSetExtensionCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ExtensionCbk = f;
-}
-
-void
-lefrSetFixedMaskCbk(lefrIntegerCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->FixedMaskCbk = f;
-}
-
-void
-lefrSetIRDropBeginCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->IRDropBeginCbk = f;
-}
-
-void
-lefrSetIRDropCbk(lefrIRDropCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->IRDropCbk = f;
-}
-
-void
-lefrSetIRDropEndCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->IRDropEndCbk = f;
-}
-
-void
-lefrSetInoutAntennaCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->InoutAntennaCbk = f;
-}
-
-void
-lefrSetInputAntennaCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->InputAntennaCbk = f;
-}
-
-void
-lefrSetLayerCbk(lefrLayerCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->LayerCbk = f;
-}
-
-void
-lefrSetLibraryEndCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->LibraryEndCbk = f;
-}
-
-void
-lefrSetMacroBeginCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroBeginCbk = f;
-}
-
-void
-lefrSetMacroCbk(lefrMacroCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroCbk = f;
-}
-
-void
-lefrSetMacroClassTypeCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroClassTypeCbk = f;
-}
-
-void
-lefrSetMacroEndCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroEndCbk = f;
-}
-
-void
-lefrSetMacroFixedMaskCbk(lefrIntegerCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroFixedMaskCbk = f;
-}
-
-void
-lefrSetMacroOriginCbk(lefrMacroNumCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroOriginCbk = f;
-}
-
-void
-lefrSetMacroSiteCbk(lefrMacroSiteCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroSiteCbk = f;
-}
-
-void
-lefrSetMacroForeignCbk(lefrMacroForeignCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroForeignCbk = f;
-}
-
-void
-lefrSetMacroSizeCbk(lefrMacroNumCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MacroSizeCbk = f;
-}
-
-void
-lefrSetManufacturingCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ManufacturingCbk = f;
-}
-
-void
-lefrSetMaxStackViaCbk(lefrMaxStackViaCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MaxStackViaCbk = f;
-}
-
-void
-lefrSetMinFeatureCbk(lefrMinFeatureCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->MinFeatureCbk = f;
-}
-
-void
-lefrSetNoWireExtensionCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->NoWireExtensionCbk = f;
-}
-
-void
-lefrSetNoiseMarginCbk(lefrNoiseMarginCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->NoiseMarginCbk = f;
-}
-
-void
-lefrSetNoiseTableCbk(lefrNoiseTableCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->NoiseTableCbk = f;
-}
-
-void
-lefrSetNonDefaultCbk(lefrNonDefaultCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->NonDefaultCbk = f;
-}
-
-void
-lefrSetObstructionCbk(lefrObstructionCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ObstructionCbk = f;
-}
-
-void
-lefrSetOutputAntennaCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->OutputAntennaCbk = f;
-}
-
-void
-lefrSetPinCbk(lefrPinCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->PinCbk = f;
-}
-
-void
-lefrSetPropBeginCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->PropBeginCbk = f;
-}
-
-void
-lefrSetPropCbk(lefrPropCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->PropCbk = f;
-}
-
-void
-lefrSetPropEndCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->PropEndCbk = f;
-}
-
-void
-lefrSetSiteCbk(lefrSiteCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->SiteCbk = f;
-}
-
-void
-lefrSetSpacingBeginCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->SpacingBeginCbk = f;
-}
-
-void
-lefrSetSpacingCbk(lefrSpacingCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->SpacingCbk = f;
-}
-
-void
-lefrSetSpacingEndCbk(lefrVoidCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->SpacingEndCbk = f;
-}
-
-void
-lefrSetTimingCbk(lefrTimingCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->TimingCbk = f;
-}
-
-void
-lefrSetUnitsCbk(lefrUnitsCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->UnitsCbk = f;
-}
-
-void
-lefrSetUseMinSpacingCbk(lefrUseMinSpacingCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->UseMinSpacingCbk = f;
-}
-
-void
-lefrSetVersionCbk(lefrDoubleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->VersionCbk = f;
-}
-
-void
-lefrSetVersionStrCbk(lefrStringCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->VersionStrCbk = f;
-}
-
-void
-lefrSetViaCbk(lefrViaCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ViaCbk = f;
-}
-
-void
-lefrSetViaRuleCbk(lefrViaRuleCbkFnType f)
-{
-    LEF_INIT;
-    lefCallbacks->ViaRuleCbk = f;
-}
-
-int
-lefrLineNumber()
-{
-    // Compatibility feature: in old versions the translators,  
-    // the function can be called before lefData initialization. 
-    return lefData ? lefData->lef_nlines : 0; 
-}
-
-void
-lefrSetLogFunction(LEFI_LOG_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->ErrorLogFunction = f;
-}
-
-void
-lefrSetWarningLogFunction(LEFI_WARNING_LOG_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->WarningLogFunction = f;
-}
-
-void
-lefrSetMallocFunction(LEFI_MALLOC_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->MallocFunction = f;
-}
-
-void
-lefrSetReallocFunction(LEFI_REALLOC_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->ReallocFunction = f;
-}
-
-void
-lefrSetFreeFunction(LEFI_FREE_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->FreeFunction = f;
-}
-
-void
-lefrSetLineNumberFunction(LEFI_LINE_NUMBER_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->LineNumberFunction = f;
-}
-
-void
-lefrSetDeltaNumberLines(int numLines)
-{
-    LEF_INIT;
-    lefSettings->DeltaNumberLines = numLines;
-}
-
-// from the lexer
-
-void
-lefrSetShiftCase()
-{
-    LEF_INIT;
-    lefSettings->ShiftCase = 1;
-}
-
-void
-lefrSetCommentChar(char c)
-{
-    LEF_INIT;
-    lefSettings->CommentChar = c;
-}
-
-void
-lefrSetCaseSensitivity(int caseSense)
-{
-    LEF_INIT;
-    lefSettings->CaseSensitive = caseSense;
-    lefSettings->CaseSensitiveSet = TRUE;
-    if (lefData) {
-        lefData->namesCaseSensitive = caseSense;
-    }
-}
-
-void
-lefrSetRelaxMode()
-{
-    LEF_INIT;
-    lefSettings->RelaxMode = TRUE;
-}
-
-void
-lefrUnsetRelaxMode()
-{
-    LEF_INIT;
-    lefSettings->RelaxMode = FALSE;
-}
-
-void
-lefrSetVersionValue(const char *version)
-{
-    LEF_INIT;
-    lefSettings->VersionNum = convert_name2num(version);
-}
-
-void
-lefrSetOpenLogFileAppend()
-{
-    LEF_INIT;
-    lefSettings->LogFileAppend = TRUE;
-}
-
-void
-lefrUnsetOpenLogFileAppend()
-{
-    LEF_INIT;
-    lefSettings->LogFileAppend = FALSE;
-}
-
-void
-lefrSetReadFunction(LEFI_READ_FUNCTION f)
-{
-    LEF_INIT;
-    lefSettings->ReadFunction = f;
-}
-
-void
-lefrUnsetReadFunction()
-{
-    LEF_INIT;
-    lefSettings->ReadFunction = 0;
-}
-
-// Set the maximum number of warnings
-//
-// *****************************************************************************
-
-void
-lefrSetAntennaInoutWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->AntennaInoutWarnings = warn;
-}
-
-void
-lefrSetAntennaInputWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->AntennaInputWarnings = warn;
-}
-
-void
-lefrSetAntennaOutputWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->AntennaOutputWarnings = warn;
-}
-
-void
-lefrSetArrayWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->ArrayWarnings = warn;
-}
-
-void
-lefrSetCaseSensitiveWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->CaseSensitiveWarnings = warn;
-}
-
-void
-lefrSetCorrectionTableWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->CorrectionTableWarnings = warn;
-}
-
-void
-lefrSetDielectricWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->DielectricWarnings = warn;
-}
-
-void
-lefrSetEdgeRateThreshold1Warnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->EdgeRateThreshold1Warnings = warn;
-}
-
-void
-lefrSetEdgeRateThreshold2Warnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->EdgeRateThreshold2Warnings = warn;
-}
-
-void
-lefrSetEdgeRateScaleFactorWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->EdgeRateScaleFactorWarnings = warn;
-}
-
-void
-lefrSetInoutAntennaWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->InoutAntennaWarnings = warn;
-}
-
-void
-lefrSetInputAntennaWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->InputAntennaWarnings = warn;
-}
-
-void
-lefrSetIRDropWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->IRDropWarnings = warn;
-}
-
-void
-lefrSetLayerWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->LayerWarnings = warn;
-}
-
-void
-lefrSetMacroWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->MacroWarnings = warn;
-}
-
-void
-lefrSetMaxStackViaWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->MaxStackViaWarnings = warn;
-}
-
-void
-lefrSetMinFeatureWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->MinFeatureWarnings = warn;
-}
-
-void
-lefrSetNoiseMarginWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->NoiseMarginWarnings = warn;
-}
-
-void
-lefrSetNoiseTableWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->NoiseTableWarnings = warn;
-}
-
-void
-lefrSetNonDefaultWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->NonDefaultWarnings = warn;
-}
-
-void
-lefrSetNoWireExtensionWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->NoWireExtensionWarnings = warn;
-}
-
-void
-lefrSetOutputAntennaWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->OutputAntennaWarnings = warn;
-}
-
-void
-lefrSetPinWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->PinWarnings = warn;
-}
-
-void
-lefrSetSiteWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->SiteWarnings = warn;
-}
-
-void
-lefrSetSpacingWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->SpacingWarnings = warn;
-}
-
-void
-lefrSetTimingWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->TimingWarnings = warn;
-}
-
-void
-lefrSetUnitsWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->UnitsWarnings = warn;
-}
-
-void
-lefrSetUseMinSpacingWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->UseMinSpacingWarnings = warn;
-}
-
-void
-lefrSetViaRuleWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->ViaRuleWarnings = warn;
-}
-
-void
-lefrSetViaWarnings(int warn)
-{
-    LEF_INIT;
-    lefSettings->ViaWarnings = warn;
-}
-
-void
-lefrDisablePropStrProcess()
-{
-    LEF_INIT;
-    lefSettings->DisPropStrProcess = 1;
-}
-
-void
-lefrRegisterLef58Type(const char *lef58Type,
-                      const char *layerType)
-{
-    LEF_INIT;
-    const char *typeLayers[] = {layerType, ""};
-
-    lefSettings->addLef58Type(lef58Type, typeLayers);
-}
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.hpp
deleted file mode 100644
index 69872c0..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrReader.hpp
+++ /dev/null
@@ -1,586 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef LEFRREADER_H
-#define LEFRREADER_H
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "lefiKRDefs.hpp"
-#include "lefiDefs.hpp"
-#include "lefiUser.hpp"
-#include "lefiUtil.hpp"
-
-#define MAX_LEF_MSGS 4701
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// The reader initialization.  Must be called before lefrRead(). 
-extern int lefrInit ();
-extern int lefrInitSession (int startSession = 1);
-
-// obsolted
-extern int lefrReset ();
-
-// Clears parser configuration and return it in inial state.
-extern int lefrClear ();
-
-// obsoleted
-extern int lefrReleaseNResetMemory ();
-
-// Change the comment character in LEF.  The normal character is
-// '#'.   You can change it to anything you want, but be careful.
-extern void lefrSetCommentChar (char c);
-
-// Allow the parser to upshift all names if the LEF
-// file is case insensitive.  The default is no shift, so the user
-// must do case insensitive matching.
-extern void lefrSetShiftCase ();
-
-// Allow the user to change the casesensitivity anytime during
-// parsing.
-// caseSen = 0, will turn off the casesensitivity
-// caseSen != 0, will turn on the casesensitivity
- 
-extern void lefrSetCaseSensitivity (int caseSense);
-
-// The reader request the file name they are parsing
-
-extern const char * lefrFName ();
-
-
-//  The main reader function.
-//  The file should already be opened.  This requirement allows
-//  the reader to be used with stdin or a pipe.  The file name
-//  is only used for error messages.  The includeSearchPath is
-//  a colon-delimited list of directories in which to find
-//  include files.
-
-extern int lefrRead (FILE *file, const char *fileName, lefiUserData userData);
-
-//  Set all of the callbacks that have not yet been set to a function
-//  that will add up how many times a given lef data type was ignored
-//  (ie no callback was done).  The statistics can later be printed out.
-extern void lefrSetRegisterUnusedCallbacks ();
-extern void lefrPrintUnusedCallbacks (FILE* f);
-
-// Set/get the client-provided user data.  lefi doesn't look at
-// this data at all, it simply passes the opaque lefiUserData pointer
-// back to the application with each callback.  The client can
-// change the data at any time, and it will take effect on the
-// next callback.  The lefi reader and writer maintain separate
-// user data pointers.
-extern void lefrSetUserData (lefiUserData);
-extern lefiUserData lefrGetUserData ();
-
-// An enum describing all of the types of reader callbacks.
-typedef enum {
-  lefrUnspecifiedCbkType = 0,
-  lefrVersionCbkType,
-  lefrVersionStrCbkType,
-  lefrDividerCharCbkType,
-  lefrBusBitCharsCbkType,
-  lefrUnitsCbkType,
-  lefrCaseSensitiveCbkType,
-  lefrNoWireExtensionCbkType,
-  lefrPropBeginCbkType,
-  lefrPropCbkType,
-  lefrPropEndCbkType,
-  lefrLayerCbkType,
-  lefrViaCbkType,
-  lefrViaRuleCbkType,
-  lefrSpacingCbkType,
-  lefrIRDropCbkType,
-  lefrDielectricCbkType,
-  lefrMinFeatureCbkType,
-  lefrNonDefaultCbkType,
-  lefrSiteCbkType,
-  lefrMacroBeginCbkType,
-  lefrPinCbkType,
-  lefrMacroCbkType,
-  lefrObstructionCbkType,
-  lefrArrayCbkType,
-
-  // NEW CALLBACKS - each callback has its own type.  For each callback
-  // that you add, you must add an item to this enum. 
-
-  lefrSpacingBeginCbkType,
-  lefrSpacingEndCbkType,
-  lefrArrayBeginCbkType,
-  lefrArrayEndCbkType,
-  lefrIRDropBeginCbkType,
-  lefrIRDropEndCbkType,
-  lefrNoiseMarginCbkType,
-  lefrEdgeRateThreshold1CbkType,
-  lefrEdgeRateThreshold2CbkType,
-  lefrEdgeRateScaleFactorCbkType,
-  lefrNoiseTableCbkType,
-  lefrCorrectionTableCbkType,
-  lefrInputAntennaCbkType,
-  lefrOutputAntennaCbkType,
-  lefrInoutAntennaCbkType,
-  lefrAntennaInputCbkType,
-  lefrAntennaInoutCbkType,
-  lefrAntennaOutputCbkType,
-  lefrManufacturingCbkType,
-  lefrUseMinSpacingCbkType,
-  lefrClearanceMeasureCbkType,
-  lefrTimingCbkType,
-  lefrMacroClassTypeCbkType,
-  lefrMacroOriginCbkType,
-  lefrMacroSizeCbkType,
-  lefrMacroFixedMaskCbkType,
-  lefrMacroEndCbkType,
-  lefrMaxStackViaCbkType,
-  lefrExtensionCbkType,
-  lefrDensityCbkType,
-  lefrFixedMaskCbkType,
-  lefrMacroSiteCbkType,
-  lefrMacroForeignCbkType,
-
-  lefrLibraryEndCbkType
-} lefrCallbackType_e;
- 
-// Declarations of function signatures for each type of callback.
-// These declarations are type-safe when compiling with ANSI C
-// or C++; you will only be able to register a function pointer
-// with the correct signature for a given type of callback.
-//
-// Each callback function is expected to return 0 if successful.
-// A non-zero return code will cause the reader to abort.
-//
-// The lefrDesignStart and lefrDesignEnd callback is only called once.
-// Other callbacks may be called multiple times, each time with a different
-// set of data.
-//
-// For each callback, the Def API will make the callback to the
-// function supplied by the client, which should either make a copy
-// of the Def object, or store the data in the client's own data structures.
-// The Def API will delete or reuse each object after making the callback,
-// so the client should not keep a pointer to it.
-//
-// All callbacks pass the user data pointer provided in lefrRead()
-// or lefrSetUserData() back to the client; this can be used by the
-// client to obtain access to the rest of the client's data structures.
-//
-// The user data pointer is obtained using lefrGetUserData() immediately
-// prior to making each callback, so the client is free to change the
-// user data on the fly if necessary.
-//
-// Callbacks with the same signature are passed a callback type
-// parameter, which allows an application to write a single callback
-// function, register that function for multiple callbacks, then
-// switch based on the callback type to handle the appropriate type of
-// data.
- 
-
-// A declaration of the signature of all callbacks that return nothing. 
-typedef int (*lefrVoidCbkFnType) (lefrCallbackType_e, 
-                                  void* num, 
-                                  lefiUserData);
-
-// A declaration of the signature of all callbacks that return a string. 
-typedef int (*lefrStringCbkFnType) (lefrCallbackType_e, 
-                                    const char *string, 
-                                    lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a integer. 
-typedef int (*lefrIntegerCbkFnType) (lefrCallbackType_e, 
-                                     int number, 
-                                     lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a double. 
-typedef int (*lefrDoubleCbkFnType) (lefrCallbackType_e, 
-                                    double number, 
-                                    lefiUserData);
-
-// A declaration of the signature of all callbacks that return a lefiUnits. 
-typedef int (*lefrUnitsCbkFnType) (lefrCallbackType_e, 
-                                   lefiUnits* units, 
-                                   lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiLayer. 
-typedef int (*lefrLayerCbkFnType) (lefrCallbackType_e, 
-                                   lefiLayer* l, 
-                                   lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiVia. 
-typedef int (*lefrViaCbkFnType) (lefrCallbackType_e, 
-                                 lefiVia* l, 
-                                 lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiViaRule. 
-typedef int (*lefrViaRuleCbkFnType) (lefrCallbackType_e, 
-                                     lefiViaRule* l, 
-                                     lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiSpacing. 
-typedef int (*lefrSpacingCbkFnType) (lefrCallbackType_e, 
-                                     lefiSpacing* l, 
-                                     lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiIRDrop. 
-typedef int (*lefrIRDropCbkFnType) (lefrCallbackType_e, 
-                                    lefiIRDrop* l, 
-                                    lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiMinFeature. 
-typedef int (*lefrMinFeatureCbkFnType) (lefrCallbackType_e, 
-                                        lefiMinFeature* l, 
-                                        lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiNonDefault. 
-typedef int (*lefrNonDefaultCbkFnType) (lefrCallbackType_e, 
-                                        lefiNonDefault* l, 
-                                        lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiSite. 
-typedef int (*lefrSiteCbkFnType) (lefrCallbackType_e, 
-                                  lefiSite* l, 
-                                  lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiMacro. 
-typedef int (*lefrMacroCbkFnType) (lefrCallbackType_e, 
-                                   lefiMacro* l, 
-                                   lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiPin. 
-typedef int (*lefrPinCbkFnType) (lefrCallbackType_e, 
-                                 lefiPin* l, 
-                                 lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiObstruction. 
-typedef int (*lefrObstructionCbkFnType) (lefrCallbackType_e, 
-                                         lefiObstruction* l, 
-                                         lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiArray. 
-typedef int (*lefrArrayCbkFnType) (lefrCallbackType_e, 
-                                   lefiArray* l, 
-                                   lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiProp. 
-typedef int (*lefrPropCbkFnType) (lefrCallbackType_e, 
-                                  lefiProp* p, 
-                                  lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiNoiseMargin. 
-typedef int (*lefrNoiseMarginCbkFnType) (lefrCallbackType_e, 
-                                         struct lefiNoiseMargin* p, 
-                                         lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiNoiseTable. 
-typedef int (*lefrNoiseTableCbkFnType) (lefrCallbackType_e, 
-                                        lefiNoiseTable* p, 
-                                        lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiCorrectionTable. 
-typedef int (*lefrCorrectionTableCbkFnType) (lefrCallbackType_e, 
-                                             lefiCorrectionTable* p, 
-                                             lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiTiming. 
-typedef int (*lefrTimingCbkFnType) (lefrCallbackType_e, 
-                                    lefiTiming* p, 
-                                    lefiUserData);
- 
-// A declaration of the signature of all callbacks that return a lefiUseMinSpacing. 
-typedef int (*lefrUseMinSpacingCbkFnType) (lefrCallbackType_e, 
-                                           lefiUseMinSpacing* l, 
-                                           lefiUserData);
- 
-  // NEW CALLBACK - If your callback returns a pointer to a new class then
-  // you must add a type function here.
-
-// A declaration of the signature of all callbacks that return a lefiMaxStackVia. 
-typedef int (*lefrMaxStackViaCbkFnType) (lefrCallbackType_e, 
-                                         lefiMaxStackVia* l, 
-                                         lefiUserData);
-
-typedef int (*lefrMacroNumCbkFnType) (lefrCallbackType_e, 
-                                      lefiNum l, 
-                                      lefiUserData);
-
-typedef int (*lefrMacroSiteCbkFnType) (lefrCallbackType_e, 
-                                      const lefiMacroSite *site,
-                                      lefiUserData);
-
-typedef int (*lefrMacroForeignCbkFnType) (lefrCallbackType_e, 
-                                          const lefiMacroForeign *foreign,
-                                          lefiUserData);
-
-// 5.6 
-// A declaration of the signature of all callbacks that return a lefiDensity. 
-typedef int (*lefrDensityCbkFnType) (lefrCallbackType_e, 
-                                     lefiDensity* l, 
-                                     lefiUserData);
- 
-// Functions to call to register a callback function.
-extern void lefrSetUnitsCbk(lefrUnitsCbkFnType);
-extern void lefrSetVersionCbk(lefrDoubleCbkFnType);
-extern void lefrSetVersionStrCbk(lefrStringCbkFnType);
-extern void lefrSetDividerCharCbk(lefrStringCbkFnType);
-extern void lefrSetBusBitCharsCbk(lefrStringCbkFnType);
-extern void lefrSetNoWireExtensionCbk(lefrStringCbkFnType);
-extern void lefrSetCaseSensitiveCbk(lefrIntegerCbkFnType);
-extern void lefrSetPropBeginCbk(lefrVoidCbkFnType);
-extern void lefrSetPropCbk(lefrPropCbkFnType);
-extern void lefrSetPropEndCbk(lefrVoidCbkFnType);
-extern void lefrSetLayerCbk(lefrLayerCbkFnType);
-extern void lefrSetViaCbk(lefrViaCbkFnType);
-extern void lefrSetViaRuleCbk(lefrViaRuleCbkFnType);
-extern void lefrSetSpacingCbk(lefrSpacingCbkFnType);
-extern void lefrSetIRDropCbk(lefrIRDropCbkFnType);
-extern void lefrSetDielectricCbk(lefrDoubleCbkFnType);
-extern void lefrSetMinFeatureCbk(lefrMinFeatureCbkFnType);
-extern void lefrSetNonDefaultCbk(lefrNonDefaultCbkFnType);
-extern void lefrSetSiteCbk(lefrSiteCbkFnType);
-extern void lefrSetMacroBeginCbk(lefrStringCbkFnType);
-extern void lefrSetPinCbk(lefrPinCbkFnType);
-extern void lefrSetObstructionCbk(lefrObstructionCbkFnType);
-extern void lefrSetArrayCbk(lefrArrayCbkFnType);
-extern void lefrSetMacroCbk(lefrMacroCbkFnType);
-extern void lefrSetLibraryEndCbk(lefrVoidCbkFnType);
-
-// NEW CALLBACK - each callback must have a function to allow the user
-// to set it.  Add the function here.
-
-extern void lefrSetTimingCbk(lefrTimingCbkFnType);
-extern void lefrSetSpacingBeginCbk(lefrVoidCbkFnType);
-extern void lefrSetSpacingEndCbk(lefrVoidCbkFnType);
-extern void lefrSetArrayBeginCbk(lefrStringCbkFnType);
-extern void lefrSetArrayEndCbk(lefrStringCbkFnType);
-extern void lefrSetIRDropBeginCbk(lefrVoidCbkFnType);
-extern void lefrSetIRDropEndCbk(lefrVoidCbkFnType);
-extern void lefrSetNoiseMarginCbk(lefrNoiseMarginCbkFnType);
-extern void lefrSetEdgeRateThreshold1Cbk(lefrDoubleCbkFnType);
-extern void lefrSetEdgeRateThreshold2Cbk(lefrDoubleCbkFnType);
-extern void lefrSetEdgeRateScaleFactorCbk(lefrDoubleCbkFnType);
-extern void lefrSetNoiseTableCbk(lefrNoiseTableCbkFnType);
-extern void lefrSetCorrectionTableCbk(lefrCorrectionTableCbkFnType);
-extern void lefrSetInputAntennaCbk(lefrDoubleCbkFnType);
-extern void lefrSetOutputAntennaCbk(lefrDoubleCbkFnType);
-extern void lefrSetInoutAntennaCbk(lefrDoubleCbkFnType);
-extern void lefrSetAntennaInputCbk(lefrDoubleCbkFnType);
-extern void lefrSetAntennaInoutCbk(lefrDoubleCbkFnType);
-extern void lefrSetAntennaOutputCbk(lefrDoubleCbkFnType);
-extern void lefrSetClearanceMeasureCbk(lefrStringCbkFnType);
-extern void lefrSetManufacturingCbk(lefrDoubleCbkFnType);
-extern void lefrSetUseMinSpacingCbk(lefrUseMinSpacingCbkFnType);
-extern void lefrSetMacroClassTypeCbk(lefrStringCbkFnType);
-extern void lefrSetMacroOriginCbk(lefrMacroNumCbkFnType);
-extern void lefrSetMacroSiteCbk(lefrMacroSiteCbkFnType);
-extern void lefrSetMacroForeignCbk(lefrMacroForeignCbkFnType);
-extern void lefrSetMacroSizeCbk(lefrMacroNumCbkFnType);
-extern void lefrSetMacroFixedMaskCbk(lefrIntegerCbkFnType);
-extern void lefrSetMacroEndCbk(lefrStringCbkFnType);
-extern void lefrSetMaxStackViaCbk(lefrMaxStackViaCbkFnType);
-extern void lefrSetExtensionCbk(lefrStringCbkFnType);
-extern void lefrSetDensityCbk(lefrDensityCbkFnType);
-extern void lefrSetFixedMaskCbk(lefrIntegerCbkFnType);
-
-// Set all of the callbacks that have not yet been set to the following
-// function.  This is especially useful if you want to check to see
-// if you forgot anything.
-extern void lefrSetUnusedCallbacks (lefrVoidCbkFnType func);
-
-// Reset all the callback functions to nil
-extern void lefrUnsetCallbacks();
-
-// Functions to call to unregister a callback function.
-extern void lefrUnsetAntennaInputCbk();
-extern void lefrUnsetAntennaInoutCbk();
-extern void lefrUnsetAntennaOutputCbk();
-extern void lefrUnsetArrayBeginCbk();
-extern void lefrUnsetArrayCbk();
-extern void lefrUnsetArrayEndCbk();
-extern void lefrUnsetBusBitCharsCbk();
-extern void lefrUnsetCaseSensitiveCbk();
-extern void lefrUnsetClearanceMeasureCbk();
-extern void lefrUnsetCorrectionTableCbk();
-extern void lefrUnsetDensityCbk();
-extern void lefrUnsetDielectricCbk();
-extern void lefrUnsetDividerCharCbk();
-extern void lefrUnsetEdgeRateScaleFactorCbk();
-extern void lefrUnsetEdgeRateThreshold1Cbk();
-extern void lefrUnsetEdgeRateThreshold2Cbk();
-extern void lefrUnsetExtensionCbk();
-extern void lefrUnsetInoutAntennaCbk();
-extern void lefrUnsetInputAntennaCbk();
-extern void lefrUnsetIRDropBeginCbk();
-extern void lefrUnsetIRDropCbk();
-extern void lefrUnsetIRDropEndCbk();
-extern void lefrUnsetLayerCbk();
-extern void lefrUnsetLibraryEndCbk();
-extern void lefrUnsetMacroBeginCbk();
-extern void lefrUnsetMacroCbk();
-extern void lefrUnsetMacroClassTypeCbk();
-extern void lefrUnsetMacroEndCbk();
-extern void lefrUnsetMacroOriginCbk();
-extern void lefrUnsetMacroSiteCbk();
-extern void lefrUnsetMacroForeignCbk();
-extern void lefrUnsetMacroSizeCbk();
-extern void lefrUnsetManufacturingCbk();
-extern void lefrUnsetMaxStackViaCbk();
-extern void lefrUnsetMinFeatureCbk();
-extern void lefrUnsetNoiseMarginCbk();
-extern void lefrUnsetNoiseTableCbk();
-extern void lefrUnsetNonDefaultCbk();
-extern void lefrUnsetNoWireExtensionCbk();
-extern void lefrUnsetObstructionCbk();
-extern void lefrUnsetOutputAntennaCbk();
-extern void lefrUnsetPinCbk();
-extern void lefrUnsetPropBeginCbk();
-extern void lefrUnsetPropCbk();
-extern void lefrUnsetPropEndCbk();
-extern void lefrUnsetSiteCbk();
-extern void lefrUnsetSpacingBeginCbk();
-extern void lefrUnsetSpacingCbk();
-extern void lefrUnsetSpacingEndCbk();
-extern void lefrUnsetTimingCbk();
-extern void lefrUnsetUseMinSpacingCbk();
-extern void lefrUnsetUnitsCbk();
-extern void lefrUnsetVersionCbk();
-extern void lefrUnsetVersionStrCbk();
-extern void lefrUnsetViaCbk();
-extern void lefrUnsetViaRuleCbk();
-
-// Return the current line number in the parser.
-extern int lefrLineNumber ();
-
-// Routine to set the message logging routine for errors 
-typedef void (*LEFI_LOG_FUNCTION) (const char*);
-extern void lefrSetLogFunction(LEFI_LOG_FUNCTION);
-
-// Routine to set the message logging routine for warnings 
-typedef void (*LEFI_WARNING_LOG_FUNCTION) (const char*);
-extern void lefrSetWarningLogFunction(LEFI_WARNING_LOG_FUNCTION);
-
-// Routine to set the user defined malloc routine 
-typedef void* (*LEFI_MALLOC_FUNCTION) (int);
-extern void lefrSetMallocFunction(LEFI_MALLOC_FUNCTION);
-
-// Routine to set the user defined realloc routine 
-typedef void* (*LEFI_REALLOC_FUNCTION) (void *, int);
-extern void lefrSetReallocFunction(LEFI_REALLOC_FUNCTION);
-
-// Routine to set the user defined free routine 
-typedef void (*LEFI_FREE_FUNCTION) (void *);
-extern void lefrSetFreeFunction(LEFI_FREE_FUNCTION);
-
-// Routine to set the line number callback routine 
-typedef void (*LEFI_LINE_NUMBER_FUNCTION) (int);
-extern void lefrSetLineNumberFunction( LEFI_LINE_NUMBER_FUNCTION);
-
-// Set the number of lines before calling the line function callback routine 
-// Default is 10000 
-extern void lefrSetDeltaNumberLines  (int);
-
-// PCR 551229 - Set the parser to be more relax 
-// This api is specific for PKS. 
-// When in relax mode, the parser will not require width, pitch, & direction 
-// in routing layers. Also vias in nondefault rules 
-extern void lefrSetRelaxMode ();
-extern void lefrUnsetRelaxMode ();
-
-// PCR 565274 - LEF/DEF API should have the API call to overwrite default 
-//              version 
-extern void lefrSetVersionValue(const  char*  version);
-
-// Routine to set the read function 
-typedef size_t (*LEFI_READ_FUNCTION) (FILE*, char*, size_t);
-extern void lefrSetReadFunction(LEFI_READ_FUNCTION);
-extern void lefrUnsetReadFunction();
-
-// Routine to set the lefrWarning.log to open as append instead for write 
-// New in 5.7 
-extern void lefrSetOpenLogFileAppend();
-extern void lefrUnsetOpenLogFileAppend();
-
-// Routine to disable string property value process, default it will process 
-// the value string 
-extern void lefrDisablePropStrProcess();
-
-// Routine to set the max number of warnings for a perticular section 
-
-extern void lefrSetAntennaInoutWarnings(int warn);
-extern void lefrSetAntennaInputWarnings(int warn);
-extern void lefrSetAntennaOutputWarnings(int warn);
-extern void lefrSetArrayWarnings(int warn);
-extern void lefrSetCaseSensitiveWarnings(int warn);
-extern void lefrSetCorrectionTableWarnings(int warn);
-extern void lefrSetDielectricWarnings(int warn);
-extern void lefrSetEdgeRateThreshold1Warnings(int warn);
-extern void lefrSetEdgeRateThreshold2Warnings(int warn);
-extern void lefrSetEdgeRateScaleFactorWarnings(int warn);
-extern void lefrSetInoutAntennaWarnings(int warn);
-extern void lefrSetInputAntennaWarnings(int warn);
-extern void lefrSetIRDropWarnings(int warn);
-extern void lefrSetLayerWarnings(int warn);
-extern void lefrSetMacroWarnings(int warn);
-extern void lefrSetMaxStackViaWarnings(int warn);
-extern void lefrSetMinFeatureWarnings(int warn);
-extern void lefrSetNoiseMarginWarnings(int warn);
-extern void lefrSetNoiseTableWarnings(int warn);
-extern void lefrSetNonDefaultWarnings(int warn);
-extern void lefrSetNoWireExtensionWarnings(int warn);
-extern void lefrSetOutputAntennaWarnings(int warn);
-extern void lefrSetPinWarnings(int warn);
-extern void lefrSetSiteWarnings(int warn);
-extern void lefrSetSpacingWarnings(int warn);
-extern void lefrSetTimingWarnings(int warn);
-extern void lefrSetUnitsWarnings(int warn);
-extern void lefrSetUseMinSpacingWarnings(int warn);
-extern void lefrSetViaRuleWarnings(int warn);
-extern void lefrSetViaWarnings(int warn);
-
-// Handling output messages 
-extern void lefrDisableParserMsgs(int nMsg, int* msgs);
-extern void lefrEnableParserMsgs(int nMsg, int* msgs);
-extern void lefrEnableAllMsgs();
-extern void lefrDisableAllMsgs();
-extern void lefrSetTotalMsgLimit(int totNumMsgs);
-extern void lefrSetLimitPerMsg(int msgId, int numMsg);
-
-// Register lef58Type-layerType pair. 
-extern void lefrRegisterLef58Type(const char *lef58Type, 
-                                  const char *layerType);
-
-// Return codes for the user callbacks.
-// The user should return one of these values.
-#define PARSE_OK 0      // continue parsing 
-#define STOP_PARSE 1    // stop parsing with no error message 
-#define PARSE_ERROR 2   // stop parsing, print an error message
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.cpp
deleted file mode 100644
index 9fa31bb..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.cpp
+++ /dev/null
@@ -1,652 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #11 $
-//  $Date: 2013/04/23 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <string.h>
-
-
-#include "lefrSettings.hpp"
-#include "lef.tab.h"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-lefrSettings *lefSettings = NULL;
-
-lefrSettings::lefrSettings()
-: DisPropStrProcess(0),
-  CaseSensitive(FALSE),
-  CaseSensitiveSet(FALSE),
-  CommentChar('#'),
-  DeltaNumberLines(10000),
-  AntennaInoutWarnings(999),
-  AntennaInputWarnings(999),
-  AntennaOutputWarnings(999),
-  ArrayWarnings(999),
-  CaseSensitiveWarnings(999),
-  CorrectionTableWarnings(999),
-  DielectricWarnings(999),
-  EdgeRateScaleFactorWarnings(999),
-  EdgeRateThreshold1Warnings(999),
-  EdgeRateThreshold2Warnings(999),
-  ErrorLogFunction(0),
-  FreeFunction(0),
-  IRDropWarnings(999),
-  InoutAntennaWarnings(999),
-  InputAntennaWarnings(999),
-  LayerWarnings(999),
-  LineNumberFunction(0),
-  MacroWarnings(999),
-  MallocFunction(0),
-  MaxStackViaWarnings(999),
-  MinFeatureWarnings(999),
-  NoWireExtensionWarnings(999),
-  NoiseMarginWarnings(999),
-  NoiseTableWarnings(999),
-  NonDefaultWarnings(999),
-  OutputAntennaWarnings(999),
-  PinWarnings(999),
-  ReadFunction(0),
-  ReadEncrypted(0),
-  ReallocFunction(0),
-  RegisterUnused(0),
-  RelaxMode(FALSE),
-  ShiftCase(0),
-  SiteWarnings(999),
-  SpacingWarnings(999),
-  TimingWarnings(999),
-  UnitsWarnings(999),
-  UseMinSpacingWarnings(999),
-  UserData(NULL),
-  VersionNum(0.0),
-  ViaRuleWarnings(999),
-  ViaWarnings(999),
-  LogFileAppend(0),
-  SetLogFunction(0),
-  TotalMsgLimit(0),
-  WarningLogFunction(0),
-  dAllMsgs(0)
-{
-    memset(MsgLimit, 0, MAX_LEF_MSGS * sizeof(int));
-    init_symbol_table();
-
-    // Define LEF58_TYPE values and dependences here:
-
-    // Popular layer groups.
-    const char *polyroutingLayers[] = {"ROUTING", ""};
-    const char *mimcapLayers[] = {"ROUTING", "CUT", ""};    
-    const char *tsvLayers[] = {"CUT", ""};
-    const char *mastersliceOnly[] = {"MASTERSLICE", ""};
-    const char *wellLayers[] = {"MASTERSLICE", "OVERLAP", ""};
-
-    // Register LEF58 types and allowed layer types pairs.
-    addLef58Type("POLYROUTING", polyroutingLayers);
-    addLef58Type("MIMCAP", mimcapLayers);
-    addLef58Type("TSV", tsvLayers);
-    addLef58Type("PASSIVATION", tsvLayers);
-    addLef58Type("TRIMPOLY", mastersliceOnly);
-    addLef58Type("NWELL", wellLayers);
-    addLef58Type("PWELL", wellLayers);
-    addLef58Type("BELOWDIEEDGE", wellLayers);
-    addLef58Type("ABOVEDIEEDGE", wellLayers);
-    addLef58Type("DIFFUSION", wellLayers);
-    addLef58Type("TRIMMETAL", wellLayers);
-    addLef58Type("MEOL", mastersliceOnly);
-}
-
-
-void
-lefrSettings::reset()
-{
-    if (lefSettings) {
-        delete lefSettings;
-    }
-
-    lefSettings = new lefrSettings();
-}
-
-
-void
-lefrSettings::init_symbol_table()
-{
-    Keyword_set["&DEFINE"] = K_DEFINE;
-    Keyword_set["&DEFINEB"] = K_DEFINEB;
-    Keyword_set["&DEFINES"] = K_DEFINES;
-    Keyword_set["&MESSAGE"] = K_MESSAGE;
-    Keyword_set["&CREATEFILE"] = K_CREATEFILE;
-    Keyword_set["&OPENFILE"] = K_OPENFILE;
-    Keyword_set["&CLOSEFILE"] = K_CLOSEFILE;
-    Keyword_set["&WARNING"] = K_WARNING;
-    Keyword_set["&ERROR"] = K_ERROR;
-    Keyword_set["&FATALERROR"] = K_FATALERROR;
-    Keyword_set["namescasesensitive"] = K_NAMESCASESENSITIVE;
-    Keyword_set["off"] = K_OFF;
-    Keyword_set["on"] = K_ON;
-    Keyword_set["ABOVE"] = K_ABOVE;
-    Keyword_set["ABUT"] = K_ABUT;
-    Keyword_set["ABUTMENT"] = K_ABUTMENT;
-    Keyword_set["ACCURRENTDENSITY"] = K_ACCURRENTDENSITY;
-    Keyword_set["ACTIVE"] = K_ACTIVE;
-    Keyword_set["ADJACENTCUTS"] = K_ADJACENTCUTS;
-    Keyword_set["ANALOG"] = K_ANALOG;
-    Keyword_set["AND"] = K_AND;
-    Keyword_set["ANTENNAAREAFACTOR"] = K_ANTENNAAREAFACTOR;
-    Keyword_set["ANTENNAAREADIFFREDUCEPWL"] = K_ANTENNAAREADIFFREDUCEPWL;
-    Keyword_set["ANTENNAAREAMINUSDIFF"] = K_ANTENNAAREAMINUSDIFF;
-    Keyword_set["ANTENNAAREARATIO"] = K_ANTENNAAREARATIO;
-    Keyword_set["ANTENNACELL"] = K_ANTENNACELL;
-    Keyword_set["ANTENNACUMAREARATIO"] = K_ANTENNACUMAREARATIO;
-    Keyword_set["ANTENNACUMDIFFAREARATIO"] = K_ANTENNACUMDIFFAREARATIO;
-    Keyword_set["ANTENNACUMDIFFSIDEAREARATIO"] = K_ANTENNACUMDIFFSIDEAREARATIO;
-    Keyword_set["ANTENNACUMROUTINGPLUSCUT"] = K_ANTENNACUMROUTINGPLUSCUT;
-    Keyword_set["ANTENNACUMSIDEAREARATIO"] = K_ANTENNACUMSIDEAREARATIO;
-    Keyword_set["ANTENNADIFFAREA"] = K_ANTENNADIFFAREA;
-    Keyword_set["ANTENNADIFFAREARATIO"] = K_ANTENNADIFFAREARATIO;
-    Keyword_set["ANTENNADIFFSIDEAREARATIO"] = K_ANTENNADIFFSIDEAREARATIO;
-    Keyword_set["ANTENNAGATEAREA"] = K_ANTENNAGATEAREA;
-    Keyword_set["ANTENNAGATEPLUSDIFF"] = K_ANTENNAGATEPLUSDIFF;
-    Keyword_set["ANTENNAINOUTDIFFAREA"] = K_ANTENNAINOUTDIFFAREA;
-    Keyword_set["ANTENNAINPUTGATEAREA"] = K_ANTENNAINPUTGATEAREA;
-    Keyword_set["ANTENNALENGTHFACTOR"] = K_ANTENNALENGTHFACTOR;
-    Keyword_set["ANTENNAMAXAREACAR"] = K_ANTENNAMAXAREACAR;
-    Keyword_set["ANTENNAMAXCUTCAR"] = K_ANTENNAMAXCUTCAR;
-    Keyword_set["ANTENNAMAXSIDEAREACAR"] = K_ANTENNAMAXSIDEAREACAR;
-    Keyword_set["ANTENNAMETALAREA"] = K_ANTENNAMETALAREA;
-    Keyword_set["ANTENNAMETALLENGTH"] = K_ANTENNAMETALLENGTH;
-    Keyword_set["ANTENNAMODEL"] = K_ANTENNAMODEL;
-    Keyword_set["ANTENNAOUTPUTDIFFAREA"] = K_ANTENNAOUTPUTDIFFAREA;
-    Keyword_set["ANTENNAPARTIALCUTAREA"] = K_ANTENNAPARTIALCUTAREA;
-    Keyword_set["ANTENNAPARTIALMETALAREA"] = K_ANTENNAPARTIALMETALAREA;
-    Keyword_set["ANTENNAPARTIALMETALSIDEAREA"] = K_ANTENNAPARTIALMETALSIDEAREA;
-    Keyword_set["ANTENNASIDEAREARATIO"] = K_ANTENNASIDEAREARATIO;
-    Keyword_set["ANTENNASIZE"] = K_ANTENNASIZE;
-    Keyword_set["ANTENNASIDEAREAFACTOR"] = K_ANTENNASIDEAREAFACTOR;
-    Keyword_set["ANYEDGE"] = K_ANYEDGE;
-    Keyword_set["AREA"] = K_AREA;
-    Keyword_set["AREAIO"] = K_AREAIO;
-    Keyword_set["ARRAY"] = K_ARRAY;
-    Keyword_set["ARRAYCUTS"] = K_ARRAYCUTS;
-    Keyword_set["ARRAYSPACING"] = K_ARRAYSPACING;
-    Keyword_set["AVERAGE"] = K_AVERAGE;
-    Keyword_set["BELOW"] = K_BELOW;
-    Keyword_set["BEGINEXT"] = K_BEGINEXT;
-    Keyword_set["BLACKBOX"] = K_BLACKBOX;
-    Keyword_set["BLOCK"] = K_BLOCK;
-    Keyword_set["BOTTOMLEFT"] = K_BOTTOMLEFT;
-    Keyword_set["BOTTOMRIGHT"] = K_BOTTOMRIGHT;
-    Keyword_set["BUMP"] = K_BUMP;
-    Keyword_set["BUSBITCHARS"] = K_BUSBITCHARS;
-    Keyword_set["BUFFER"] = K_BUFFER;
-    Keyword_set["BY"] = K_BY;
-    Keyword_set["CANNOTOCCUPY"] = K_CANNOTOCCUPY;
-    Keyword_set["CANPLACE"] = K_CANPLACE;
-    Keyword_set["CAPACITANCE"] = K_CAPACITANCE;
-    Keyword_set["CAPMULTIPLIER"] = K_CAPMULTIPLIER;
-    Keyword_set["CENTERTOCENTER"] = K_CENTERTOCENTER;
-    Keyword_set["CLASS"] = K_CLASS;
-    Keyword_set["CLEARANCEMEASURE"] = K_CLEARANCEMEASURE;
-    Keyword_set["CLOCK"] = K_CLOCK;
-    Keyword_set["CLOCKTYPE"] = K_CLOCKTYPE;
-    Keyword_set["COLUMNMAJOR"] = K_COLUMNMAJOR;
-    Keyword_set["CURRENTDEN"] = K_CURRENTDEN;
-    Keyword_set["COMPONENTPIN"] = K_COMPONENTPIN;
-    Keyword_set["CORE"] = K_CORE;
-    Keyword_set["CORNER"] = K_CORNER;
-    Keyword_set["CORRECTIONFACTOR"] = K_CORRECTIONFACTOR;
-    Keyword_set["CORRECTIONTABLE"] = K_CORRECTIONTABLE;
-    Keyword_set["COVER"] = K_COVER;
-    Keyword_set["CPERSQDIST"] = K_CPERSQDIST;
-    Keyword_set["CURRENT"] = K_CURRENT;
-    Keyword_set["CURRENTSOURCE"] = K_CURRENTSOURCE;
-    Keyword_set["CUT"] = K_CUT;
-    Keyword_set["CUTAREA"] = K_CUTAREA;
-    Keyword_set["CUTSIZE"] = K_CUTSIZE;
-    Keyword_set["CUTSPACING"] = K_CUTSPACING;
-    Keyword_set["DATA"] = K_DATA;
-    Keyword_set["DATABASE"] = K_DATABASE;
-    Keyword_set["DCCURRENTDENSITY"] = K_DCCURRENTDENSITY;
-    Keyword_set["DEFAULT"] = K_DEFAULT;
-    Keyword_set["DEFAULTCAP"] = K_DEFAULTCAP;
-    Keyword_set["DELAY"] = K_DELAY;
-    Keyword_set["DENSITY"] = K_DENSITY;
-    Keyword_set["DENSITYCHECKSTEP"] = K_DENSITYCHECKSTEP;
-    Keyword_set["DENSITYCHECKWINDOW"] = K_DENSITYCHECKWINDOW;
-    Keyword_set["DESIGNRULEWIDTH"] = K_DESIGNRULEWIDTH;
-    Keyword_set["DIAG45"] = K_DIAG45;
-    Keyword_set["DIAG135"] = K_DIAG135;
-    Keyword_set["DIAGMINEDGELENGTH"] = K_DIAGMINEDGELENGTH;
-    Keyword_set["DIAGSPACING"] = K_DIAGSPACING;
-    Keyword_set["DIAGPITCH"] = K_DIAGPITCH;
-    Keyword_set["DIAGWIDTH"] = K_DIAGWIDTH;
-    Keyword_set["DIELECTRIC"] = K_DIELECTRIC;
-    Keyword_set["DIFFUSEONLY"] = K_DIFFUSEONLY;
-    Keyword_set["DIRECTION"] = K_DIRECTION;
-    Keyword_set["DIVIDERCHAR"] = K_DIVIDERCHAR;
-    Keyword_set["DO"] = K_DO;
-    Keyword_set["E"] = K_E;
-    Keyword_set["EDGECAPACITANCE"] = K_EDGECAPACITANCE;
-    Keyword_set["EDGERATE"] = K_EDGERATE;
-    Keyword_set["EDGERATESCALEFACTOR"] = K_EDGERATESCALEFACTOR;
-    Keyword_set["EDGERATETHRESHOLD1"] = K_EDGERATETHRESHOLD1;
-    Keyword_set["EDGERATETHRESHOLD2"] = K_EDGERATETHRESHOLD2;
-    Keyword_set["EEQ"] = K_EEQ;
-    Keyword_set["ELSE"] = K_ELSE;
-    Keyword_set["ENCLOSURE"] = K_ENCLOSURE;
-    Keyword_set["END"] = K_END;
-    Keyword_set["ENDEXT"] = K_ENDEXT;
-    Keyword_set["ENDCAP"] = K_ENDCAP;
-    Keyword_set["ENDOFLINE"] = K_ENDOFLINE;
-    Keyword_set["ENDOFNOTCHWIDTH"] = K_ENDOFNOTCHWIDTH;
-    Keyword_set["EUCLIDEAN"] = K_EUCLIDEAN;
-    Keyword_set["EXCEPTEXTRACUT"] = K_EXCEPTEXTRACUT;
-    Keyword_set["EXCEPTSAMEPGNET"] = K_EXCEPTSAMEPGNET;
-    Keyword_set["EXCEPTPGNET"] = K_EXCEPTPGNET;
-    Keyword_set["EXTENSION"] = K_EXTENSION;
-    Keyword_set["FALL"] = K_FALL;
-    Keyword_set["FALLCS"] = K_FALLCS;
-    Keyword_set["FALLRS"] = K_FALLRS;
-    Keyword_set["FALLSATCUR"] = K_FALLSATCUR;
-    Keyword_set["FALLSATT1"] = K_FALLSATT1;
-    Keyword_set["FALLSLEWLIMIT"] = K_FALLSLEWLIMIT;
-    Keyword_set["FALLT0"] = K_FALLT0;
-    Keyword_set["FALLTHRESH"] = K_FALLTHRESH;
-    Keyword_set["FALLVOLTAGETHRESHOLD"] = K_FALLVOLTAGETHRESHOLD;
-    Keyword_set["FALSE"] = K_FALSE;
-    Keyword_set["FE"] = K_FE;
-    Keyword_set["FEEDTHRU"] = K_FEEDTHRU;
-    Keyword_set["FILLACTIVESPACING"] = K_FILLACTIVESPACING;
-    Keyword_set["FIXED"] = K_FIXED;
-    Keyword_set["FIXEDMASK"] = K_FIXEDMASK;
-    Keyword_set["FLIP"] = K_FLIP;
-    Keyword_set["FLOORPLAN"] = K_FLOORPLAN;
-    Keyword_set["FN"] = K_FN;
-    Keyword_set["FOREIGN"] = K_FOREIGN;
-    Keyword_set["FREQUENCY"] = K_FREQUENCY;
-    Keyword_set["FROMABOVE"] = K_FROMABOVE;
-    Keyword_set["FROMBELOW"] = K_FROMBELOW;
-    Keyword_set["FROMPIN"] = K_FROMPIN;
-    Keyword_set["FUNCTION"] = K_FUNCTION;
-    Keyword_set["FS"] = K_FS;
-    Keyword_set["FW"] = K_FW;
-    Keyword_set["GCELLGRID"] = K_GCELLGRID;
-    Keyword_set["GENERATE"] = K_GENERATE;
-    Keyword_set["GENERATED"] = K_GENERATED;
-    Keyword_set["GENERATOR"] = K_GENERATOR;
-    Keyword_set["GROUND"] = K_GROUND;
-    Keyword_set["GROUNDSENSITIVITY"] = K_GROUNDSENSITIVITY;
-    Keyword_set["HARDSPACING"] = K_HARDSPACING;
-    Keyword_set["HEIGHT"] = K_HEIGHT;
-    Keyword_set["HISTORY"] = K_HISTORY;
-    Keyword_set["HOLD"] = K_HOLD;
-    Keyword_set["HORIZONTAL"] = K_HORIZONTAL;
-    Keyword_set["IF"] = K_IF;
-    Keyword_set["IMPLANT"] = K_IMPLANT;
-    Keyword_set["INFLUENCE"] = K_INFLUENCE;
-    Keyword_set["INOUT"] = K_INOUT;
-    Keyword_set["INOUTPINANTENNASIZE"] = K_INOUTPINANTENNASIZE;
-    Keyword_set["INPUT"] = K_INPUT;
-    Keyword_set["INPUTPINANTENNASIZE"] = K_INPUTPINANTENNASIZE;
-    Keyword_set["INPUTNOISEMARGIN"] = K_INPUTNOISEMARGIN;
-    Keyword_set["INSIDECORNER"] = K_INSIDECORNER;
-    Keyword_set["INTEGER"] = K_INTEGER;
-    Keyword_set["INTRINSIC"] = K_INTRINSIC;
-    Keyword_set["INVERT"] = K_INVERT;
-    Keyword_set["INVERTER"] = K_INVERTER;
-    Keyword_set["IRDROP"] = K_IRDROP;
-    Keyword_set["ITERATE"] = K_ITERATE;
-    Keyword_set["IV_TABLES"] = K_IV_TABLES;
-    Keyword_set["LAYER"] = K_LAYER;
-    Keyword_set["LAYERS"] = K_LAYERS;
-    Keyword_set["LEAKAGE"] = K_LEAKAGE;
-    Keyword_set["LENGTH"] = K_LENGTH;
-    Keyword_set["LENGTHSUM"] = K_LENGTHSUM;
-    Keyword_set["LENGTHTHRESHOLD"] = K_LENGTHTHRESHOLD;
-    Keyword_set["LEQ"] = K_LEQ;
-    Keyword_set["LIBRARY"] = K_LIBRARY;
-    Keyword_set["LONGARRAY"] = K_LONGARRAY;
-    Keyword_set["MACRO"] = K_MACRO;
-    Keyword_set["MANUFACTURINGGRID"] = K_MANUFACTURINGGRID;
-    Keyword_set["MASTERSLICE"] = K_MASTERSLICE;
-    Keyword_set["MASK"] = K_MASK;
-    Keyword_set["MATCH"] = K_MATCH;
-    Keyword_set["MAXADJACENTSLOTSPACING"] = K_MAXADJACENTSLOTSPACING;
-    Keyword_set["MAXCOAXIALSLOTSPACING"] = K_MAXCOAXIALSLOTSPACING;
-    Keyword_set["MAXDELAY"] = K_MAXDELAY;
-    Keyword_set["MAXEDGES"] = K_MAXEDGES;
-    Keyword_set["MAXEDGESLOTSPACING"] = K_MAXEDGESLOTSPACING;
-    Keyword_set["MAXLOAD"] = K_MAXLOAD;
-    Keyword_set["MAXIMUMDENSITY"] = K_MAXIMUMDENSITY;
-    Keyword_set["MAXVIASTACK"] = K_MAXVIASTACK;
-    Keyword_set["MAXWIDTH"] = K_MAXWIDTH;
-    Keyword_set["MAXXY"] = K_MAXXY;
-    Keyword_set["MEGAHERTZ"] = K_MEGAHERTZ;
-    Keyword_set["METALOVERHANG"] = K_METALOVERHANG;
-    Keyword_set["MICRONS"] = K_MICRONS;
-    Keyword_set["MILLIAMPS"] = K_MILLIAMPS;
-    Keyword_set["MILLIWATTS"] = K_MILLIWATTS;
-    Keyword_set["MINCUTS"] = K_MINCUTS;
-    Keyword_set["MINENCLOSEDAREA"] = K_MINENCLOSEDAREA;
-    Keyword_set["MINFEATURE"] = K_MINFEATURE;
-    Keyword_set["MINIMUMCUT"] = K_MINIMUMCUT;
-    Keyword_set["MINIMUMDENSITY"] = K_MINIMUMDENSITY;
-    Keyword_set["MINPINS"] = K_MINPINS;
-    Keyword_set["MINSIZE"] = K_MINSIZE;
-    Keyword_set["MINSTEP"] = K_MINSTEP;
-    Keyword_set["MINWIDTH"] = K_MINWIDTH;
-    Keyword_set["MPWH"] = K_MPWH;
-    Keyword_set["MPWL"] = K_MPWL;
-    Keyword_set["MUSTJOIN"] = K_MUSTJOIN;
-    Keyword_set["MX"] = K_MX;
-    Keyword_set["MY"] = K_MY;
-    Keyword_set["MXR90"] = K_MXR90;
-    Keyword_set["MYR90"] = K_MYR90;
-    Keyword_set["N"] = K_N;
-    Keyword_set["NAMEMAPSTRING"] = K_NAMEMAPSTRING;
-    Keyword_set["NAMESCASESENSITIVE"] = K_NAMESCASESENSITIVE;
-    Keyword_set["NANOSECONDS"] = K_NANOSECONDS;
-    Keyword_set["NEGEDGE"] = K_NEGEDGE;
-    Keyword_set["NETEXPR"] = K_NETEXPR;
-    Keyword_set["NETS"] = K_NETS;
-    Keyword_set["NEW"] = K_NEW;
-    Keyword_set["NONDEFAULTRULE"] = K_NONDEFAULTRULE;
-    Keyword_set["NONE"] = K_NONE;
-    Keyword_set["NONINVERT"] = K_NONINVERT;
-    Keyword_set["NONUNATE"] = K_NONUNATE;
-    Keyword_set["NOISETABLE"] = K_NOISETABLE;
-    Keyword_set["NOTCHLENGTH"] = K_NOTCHLENGTH;
-    Keyword_set["NOTCHSPACING"] = K_NOTCHSPACING;
-    Keyword_set["NOWIREEXTENSIONATPIN"] = K_NOWIREEXTENSIONATPIN;
-    Keyword_set["OBS"] = K_OBS;
-    Keyword_set["OFF"] = K_OFF;
-    Keyword_set["OFFSET"] = K_OFFSET;
-    Keyword_set["OHMS"] = K_OHMS;
-    Keyword_set["ON"] = K_ON;
-    Keyword_set["OR"] = K_OR;
-    Keyword_set["ORIENT"] = K_ORIENT;
-    Keyword_set["ORIENTATION"] = K_ORIENTATION;
-    Keyword_set["ORIGIN"] = K_ORIGIN;
-    Keyword_set["ORTHOGONAL"] = K_ORTHOGONAL;
-    Keyword_set["OUTPUT"] = K_OUTPUT;
-    Keyword_set["OUTPUTPINANTENNASIZE"] = K_OUTPUTPINANTENNASIZE;
-    Keyword_set["OUTPUTNOISEMARGIN"] = K_OUTPUTNOISEMARGIN;
-    Keyword_set["OUTPUTRESISTANCE"] = K_OUTPUTRESISTANCE;
-    Keyword_set["OUTSIDECORNER"] = K_OUTSIDECORNER;
-    Keyword_set["OVERHANG"] = K_OVERHANG;
-    Keyword_set["OVERLAP"] = K_OVERLAP;
-    Keyword_set["OVERLAPS"] = K_OVERLAPS;
-    Keyword_set["OXIDE1"] = K_OXIDE1;
-    Keyword_set["OXIDE2"] = K_OXIDE2;
-    Keyword_set["OXIDE3"] = K_OXIDE3;
-    Keyword_set["OXIDE4"] = K_OXIDE4;
-    Keyword_set["PAD"] = K_PAD;
-    Keyword_set["PARALLELEDGE"] = K_PARALLELEDGE;
-    Keyword_set["PARALLELOVERLAP"] = K_PARALLELOVERLAP;
-    Keyword_set["PARALLELRUNLENGTH"] = K_PARALLELRUNLENGTH;
-    Keyword_set["PATH"] = K_PATH;
-    Keyword_set["PATTERN"] = K_PATTERN;
-    Keyword_set["PEAK"] = K_PEAK;
-    Keyword_set["PERIOD"] = K_PERIOD;
-    Keyword_set["PGONLY"] = K_PGONLY;
-    Keyword_set["PICOFARADS"] = K_PICOFARADS;
-    Keyword_set["PIN"] = K_PIN;
-    Keyword_set["PITCH"] = K_PITCH;
-    Keyword_set["PLACED"] = K_PLACED;
-    Keyword_set["POLYGON"] = K_POLYGON;
-    Keyword_set["PORT"] = K_PORT;
-    Keyword_set["POSEDGE"] = K_POSEDGE;
-    Keyword_set["POST"] = K_POST;
-    Keyword_set["POWER"] = K_POWER;
-    Keyword_set["PRE"] = K_PRE;
-    Keyword_set["PREFERENCLOSURE"] = K_PREFERENCLOSURE;
-    Keyword_set["PRL"] = K_PRL;
-    Keyword_set["PROPERTY"] = K_PROPERTY;
-    Keyword_set["PROPERTYDEFINITIONS"] = K_PROPDEF;
-    Keyword_set["PROTRUSIONWIDTH"] = K_PROTRUSIONWIDTH;
-    Keyword_set["PULLDOWNRES"] = K_PULLDOWNRES;
-    Keyword_set["PWL"] = K_PWL;
-    Keyword_set["R0"] = K_R0;
-    Keyword_set["R90"] = K_R90;
-    Keyword_set["R180"] = K_R180;
-    Keyword_set["R270"] = K_R270;
-    Keyword_set["RANGE"] = K_RANGE;
-    Keyword_set["REAL"] = K_REAL;
-    Keyword_set["RECOVERY"] = K_RECOVERY;
-    Keyword_set["RECT"] = K_RECT;
-    Keyword_set["RESISTANCE"] = K_RESISTANCE;
-    Keyword_set["RESISTIVE"] = K_RESISTIVE;
-    Keyword_set["RING"] = K_RING;
-    Keyword_set["RISE"] = K_RISE;
-    Keyword_set["RISECS"] = K_RISECS;
-    Keyword_set["RISERS"] = K_RISERS;
-    Keyword_set["RISESATCUR"] = K_RISESATCUR;
-    Keyword_set["RISESATT1"] = K_RISESATT1;
-    Keyword_set["RISESLEWLIMIT"] = K_RISESLEWLIMIT;
-    Keyword_set["RISET0"] = K_RISET0;
-    Keyword_set["RISETHRESH"] = K_RISETHRESH;
-    Keyword_set["RISEVOLTAGETHRESHOLD"] = K_RISEVOLTAGETHRESHOLD;
-    Keyword_set["RMS"] = K_RMS;
-    Keyword_set["ROUTING"] = K_ROUTING;
-    Keyword_set["ROWABUTSPACING"] = K_ROWABUTSPACING;
-    Keyword_set["ROWCOL"] = K_ROWCOL;
-    Keyword_set["ROWMAJOR"] = K_ROWMAJOR;
-    Keyword_set["ROWMINSPACING"] = K_ROWMINSPACING;
-    Keyword_set["ROWPATTERN"] = K_ROWPATTERN;
-    Keyword_set["RPERSQ"] = K_RPERSQ;
-    Keyword_set["S"] = K_S;
-    Keyword_set["SAMENET"] = K_SAMENET;
-    Keyword_set["SCANUSE"] = K_SCANUSE;
-    Keyword_set["SDFCOND"] = K_SDFCOND;
-    Keyword_set["SDFCONDEND"] = K_SDFCONDEND;
-    Keyword_set["SDFCONDSTART"] = K_SDFCONDSTART;
-    Keyword_set["SETUP"] = K_SETUP;
-    Keyword_set["SHAPE"] = K_SHAPE;
-    Keyword_set["SHRINKAGE"] = K_SHRINKAGE;
-    Keyword_set["SIGNAL"] = K_SIGNAL;
-    Keyword_set["SITE"] = K_SITE;
-    Keyword_set["SIZE"] = K_SIZE;
-    Keyword_set["SKEW"] = K_SKEW;
-    Keyword_set["SLOTLENGTH"] = K_SLOTLENGTH;
-    Keyword_set["SLOTWIDTH"] = K_SLOTWIDTH;
-    Keyword_set["SLOTWIRELENGTH"] = K_SLOTWIRELENGTH;
-    Keyword_set["SLOTWIREWIDTH"] = K_SLOTWIREWIDTH;
-    Keyword_set["SPLITWIREWIDTH"] = K_SPLITWIREWIDTH;
-    Keyword_set["SOFT"] = K_SOFT;
-    Keyword_set["SOURCE"] = K_SOURCE;
-    Keyword_set["SPACER"] = K_SPACER;
-    Keyword_set["SPACING"] = K_SPACING;
-    Keyword_set["SPACINGTABLE"] = K_SPACINGTABLE;
-    Keyword_set["SPECIALNETS"] = K_SPECIALNETS;
-    Keyword_set["STABLE"] = K_STABLE;
-    Keyword_set["STACK"] = K_STACK;
-    Keyword_set["START"] = K_START;
-    Keyword_set["STEP"] = K_STEP;
-    Keyword_set["STOP"] = K_STOP;
-    Keyword_set["STRING"] = K_STRING;
-    Keyword_set["STRUCTURE"] = K_STRUCTURE;
-    Keyword_set["SUPPLYSENSITIVITY"] = K_SUPPLYSENSITIVITY;
-    Keyword_set["SYMMETRY"] = K_SYMMETRY;
-    Keyword_set["TABLE"] = K_TABLE;
-    Keyword_set["TABLEAXIS"] = K_TABLEAXIS;
-    Keyword_set["TABLEDIMENSION"] = K_TABLEDIMENSION;
-    Keyword_set["TABLEENTRIES"] = K_TABLEENTRIES;
-    Keyword_set["TAPERRULE"] = K_TAPERRULE;
-    Keyword_set["THEN"] = K_THEN;
-    Keyword_set["THICKNESS"] = K_THICKNESS;
-    Keyword_set["TIEHIGH"] = K_TIEHIGH;
-    Keyword_set["TIELOW"] = K_TIELOW;
-    Keyword_set["TIEOFFR"] = K_TIEOFFR;
-    Keyword_set["TIME"] = K_TIME;
-    Keyword_set["TIMING"] = K_TIMING;
-    Keyword_set["TO"] = K_TO;
-    Keyword_set["TOPIN"] = K_TOPIN;
-    Keyword_set["TOPLEFT"] = K_TOPLEFT;
-    Keyword_set["TOPOFSTACKONLY"] = K_TOPOFSTACKONLY;
-    Keyword_set["TOPRIGHT"] = K_TOPRIGHT;
-    Keyword_set["TRACKS"] = K_TRACKS;
-    Keyword_set["TRANSITIONTIME"] = K_TRANSITIONTIME;
-    Keyword_set["TRISTATE"] = K_TRISTATE;
-    Keyword_set["TRUE"] = K_TRUE;
-    Keyword_set["TWOEDGES"] = K_TWOEDGES;
-    Keyword_set["TWOWIDTHS"] = K_TWOWIDTHS;
-    Keyword_set["TYPE"] = K_TYPE;
-    Keyword_set["UNATENESS"] = K_UNATENESS;
-    Keyword_set["UNITS"] = K_UNITS;
-    Keyword_set["UNIVERSALNOISEMARGIN"] = K_UNIVERSALNOISEMARGIN;
-    Keyword_set["USE"] = K_USE;
-    Keyword_set["USELENGTHTHRESHOLD"] = K_USELENGTHTHRESHOLD;
-    Keyword_set["USEMINSPACING"] = K_USEMINSPACING;
-    Keyword_set["USER"] = K_USER;
-    Keyword_set["USEVIA"] = K_USEVIA;
-    Keyword_set["USEVIARULE"] = K_USEVIARULE;
-    Keyword_set["VARIABLE"] = K_VARIABLE;
-    Keyword_set["VERSION"] = K_VERSION;
-    Keyword_set["VERTICAL"] = K_VERTICAL;
-    Keyword_set["VHI"] = K_VHI;
-    Keyword_set["VIA"] = K_VIA;
-    Keyword_set["VIARULE"] = K_VIARULE;
-    Keyword_set["VICTIMLENGTH"] = K_VICTIMLENGTH;
-    Keyword_set["VICTIMNOISE"] = K_VICTIMNOISE;
-    Keyword_set["VIRTUAL"] = K_VIRTUAL;
-    Keyword_set["VLO"] = K_VLO;
-    Keyword_set["VOLTAGE"] = K_VOLTAGE;
-    Keyword_set["VOLTS"] = K_VOLTS;
-    Keyword_set["W"] = K_W;
-    Keyword_set["WELLTAP"] = K_WELLTAP;
-    Keyword_set["WIDTH"] = K_WIDTH;
-    Keyword_set["WITHIN"] = K_WITHIN;
-    Keyword_set["WIRECAP"] = K_WIRECAP;
-    Keyword_set["WIREEXTENSION"] = K_WIREEXTENSION;
-    Keyword_set["X"] = K_X;
-    Keyword_set["Y"] = K_Y;
-}
-
-
-void 
-lefrSettings::disableMsg(int msgId)
-{
-    msgsDisableMap[msgId] = 0;
-}
-
-
-void 
-lefrSettings::enableMsg(int msgId)
-{
-    std::map<int, int>::iterator search = msgsDisableMap.find(msgId);
-
-    if (search != msgsDisableMap.end()) {
-        msgsDisableMap.erase(search);
-    }
-}
-
-
-void 
-lefrSettings::enableAllMsgs()
-{
-    msgsDisableMap.clear();
-}
-
-
-// Check if the message was disabled and returns statuses:
-// 0 - enabled, 1 - disabled, need warning print, 2 - disabled no warning.
-int 
-lefrSettings::suppresMsg(int msgId)
-{
-    std::map<int, int>::iterator search = msgsDisableMap.find(msgId);
-
-    if (search != msgsDisableMap.end()) {
-        int status = msgsDisableMap[msgId];
-        if (!status) {
-            msgsDisableMap[msgId] = 1;
-            return 1;
-        } else {
-            return 2;
-        }
-    }
-
-    return 0;
-}
-
-
-// This function will get token from input string. Also sets 
-// startIdx on first character after the token.
-std::string
-lefrSettings::getToken(const std::string &input, int &startIdx)
-{
-    std::string  divChars = " \n\t\r;";
-    int          tokenStart = input.find_first_not_of(divChars, 
-                                                      startIdx);
-    int          tokenEnd = input.find_first_of(divChars, 
-                                                 tokenStart);
-
-    startIdx = tokenEnd;
-    return input.substr(tokenStart, tokenEnd - tokenStart);
-}
-
-
-// This function adds new lef58Type-layerType pairs. layerType 
-// is reference to string array last element of which should be 
-// "". The pairs will be created for each element of the array.
-// Duplicated pairs will be ignored.
-void 
-lefrSettings::addLef58Type(const char *lef58Type, 
-                           const char **layerType)
-{
-    for (;**layerType;     layerType++) {
-        std::string typesPair(lef58Type);
-
-        typesPair = typesPair + " " + *layerType;
-
-        Lef58TypePairs.insert(typesPair);
-    }
-}
-
-
-std::string
-lefrSettings::getLayerLef58Types(const char *type) const
-{
-    std::string                 result;
-    StringSet::const_iterator   pairsIter = Lef58TypePairs.begin();
-
-    for (; pairsIter != Lef58TypePairs.end(); ++pairsIter) {
-        const   std::string pair(*pairsIter);
-        int     sepIdx = pair.find(' ');
-
-        if (pair.substr(sepIdx + 1) != type) {
-            continue;
-        }
-
-        if (!result.empty()) {
-            result += ", ";
-        }
-
-        result += pair.substr(0, sepIdx);
-    }
-
-    return result;
-}
-
-END_LEFDEF_PARSER_NAMESPACE
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.hpp
deleted file mode 100644
index 7a80b8a..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefrSettings.hpp
+++ /dev/null
@@ -1,154 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: arakhman $
-//  $Revision: #11 $
-//  $Date: 2013/04/23 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef lefrSettings_h
-#define lefrSettings_h
-
-#include <cstring>
-#include <string>
-#include <map>
-#include <set>
-
-#include "lefrReader.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-struct lefCompareCStrings 
-{
-    bool operator()(const char* lhs, const char* rhs) const {
-        return std::strcmp(lhs, rhs) < 0;
-    }
-};
-
-typedef std::map<const char*, int, lefCompareCStrings>  lefKeywordMap;
-typedef std::map<int, int>                              MsgsDisableMap;
-
-typedef std::set<std::string>               StringSet;
-
-class lefrProps {
-public:
-    lefiPropType  lefrCompProp; 
-    lefiPropType  lefrLayerProp; 
-    lefiPropType  lefrLibProp; 
-    lefiPropType  lefrMacroProp; 
-    lefiPropType  lefrNondefProp; 
-    lefiPropType  lefrPinProp; 
-    lefiPropType  lefrViaProp; 
-    lefiPropType  lefrViaRuleProp; 
-};
-
-class lefrSettings {
-public:
-                    lefrSettings();
-
-    void            init_symbol_table();
-    static void     reset();
-    void            addLef58Type(const char *lef58Type, 
-                                 const char **layerType);
-
-    std::string     getLayerLef58Types(const char *type) const;
-
-    void            disableMsg(int msgId);
-    void            enableMsg(int msgId);
-    void            enableAllMsgs();
-    int             suppresMsg(int msgId);
-
-    static std::string     getToken(const std::string   &input, 
-                                    int                 &startIdx);
-
-    lefKeywordMap       Keyword_set; 
-
-    char CommentChar;
-    double VersionNum;
-    int DisPropStrProcess;
-    int CaseSensitive;
-    int CaseSensitiveSet;
-    int DeltaNumberLines;
-    int AntennaInoutWarnings;
-    int AntennaInputWarnings;
-    int AntennaOutputWarnings;
-    int ArrayWarnings;
-    int CaseSensitiveWarnings;
-    int CorrectionTableWarnings;
-    int DielectricWarnings;
-    int EdgeRateScaleFactorWarnings;
-    int EdgeRateThreshold1Warnings;
-    int EdgeRateThreshold2Warnings;
-    int IRDropWarnings;
-    int InoutAntennaWarnings;
-    int InputAntennaWarnings;
-    LEFI_LINE_NUMBER_FUNCTION LineNumberFunction;
-    int LayerWarnings;
-    int MacroWarnings;
-    int MaxStackViaWarnings;
-    int MinFeatureWarnings;
-    int NoWireExtensionWarnings;
-    int NoiseMarginWarnings;
-    int NoiseTableWarnings;
-    int NonDefaultWarnings;
-    int OutputAntennaWarnings;
-    int PinWarnings;
-    LEFI_READ_FUNCTION ReadFunction;
-    int ReadEncrypted; 
-    int RegisterUnused;
-    int RelaxMode;
-    int ShiftCase;
-    int SiteWarnings;
-    int SpacingWarnings;
-    int TimingWarnings;
-    int UnitsWarnings;
-    int UseMinSpacingWarnings;
-    int ViaRuleWarnings;
-    int ViaWarnings;
-    int LogFileAppend;
-    int TotalMsgLimit;
-    lefiUserData UserData;
-
-    StringSet Lef58TypePairs;
-
-    LEFI_MALLOC_FUNCTION MallocFunction;
-    LEFI_REALLOC_FUNCTION ReallocFunction;
-    LEFI_FREE_FUNCTION FreeFunction;
-    LEFI_LOG_FUNCTION ErrorLogFunction;
-    LEFI_LOG_FUNCTION SetLogFunction;
-    LEFI_WARNING_LOG_FUNCTION WarningLogFunction;
-
-    int MsgLimit[MAX_LEF_MSGS];
-
-    MsgsDisableMap msgsDisableMap;
-    int  dAllMsgs; 
-
-    lefrProps lefProps;
-};
-
-extern lefrSettings* lefSettings;
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.cpp
deleted file mode 100644
index 9f870e9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.cpp
+++ /dev/null
@@ -1,9839 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// *****************************************************************************
-// *****************************************************************************
-
-
-// This file contains code for implementing the lefwriter 5.3
-// It has all the functions user can call in their callbacks or
-// just their writer to write out the correct lef syntax.
-//
-// Author: Wanda da Rosa
-// Date:   Summer, 1998
-//
-// Revisions:
-
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include "lefwWriter.hpp"
-#include "crypt.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// States of the writer.
-#define LEFW_UNINIT                   0
-#define LEFW_INIT                     1
-#define LEFW_ARRAY_START              2
-#define LEFW_BEGINEXT_START           3
-#define LEFW_CORRECTTABLE_START       4
-#define LEFW_IRDROP_START             5
-#define LEFW_LAYER_START              6
-#define LEFW_LAYERROUTING_START       7
-#define LEFW_LAYERROUTING_SP_START    8
-#define LEFW_MACRO_START              9
-#define LEFW_NOISETABLE_START        10
-#define LEFW_NONDEFAULTRULE_START    11
-#define LEFW_PROPERTYDEF_START       12
-#define LEFW_SPACING_START           13
-#define LEFW_UNITS_START             14
-#define LEFW_VIA_START               15
-#define LEFW_VIARULE_START           16
-#define LEFW_VIARULEGEN_START        17
-
-#define LEFW_ANTENNASIZE             18
-#define LEFW_ARRAY                   19
-#define LEFW_BEGINEXT                20
-#define LEFW_BUSBITCHARS             21
-#define LEFW_CASESENSITIVE           22
-#define LEFW_CORRECTTABLE            23
-#define LEFW_DIELECTRIC              24
-#define LEFW_DIVIDERCHAR             25
-#define LEFW_EDGERATE                26
-#define LEFW_IRDROP                  27
-#define LEFW_LAYER                   28
-#define LEFW_LAYERACCURRENT          29
-#define LEFW_LAYERDCCURRENT          30
-#define LEFW_LAYERROUTING            31
-#define LEFW_LAYERROUTINGWIDTH       32
-#define LEFW_MACRO                   33
-#define LEFW_MACRO_CAPACITANCE       34
-#define LEFW_MACRO_INPUTNOISEMARGIN  35
-#define LEFW_MACRO_FALLCURRENTSOURCE 36
-#define LEFW_MACRO_FALLSATCUR        37
-#define LEFW_MACRO_FALLTHRESH        38
-#define LEFW_MACRO_FALLVOLTAGETHRESHOLD 39
-#define LEFW_MACRO_IV_TABLES         40
-#define LEFW_MACRO_LEAKAGE           41
-#define LEFW_MACRO_LEQ               42
-#define LEFW_MACRO_OUTPUTNOISEMARGIN 43
-#define LEFW_MACRO_OUTPUTRESISTANCE  44
-#define LEFW_MACRO_PINFOREIGN        45
-#define LEFW_MACRO_PINLEQ            46
-#define LEFW_MACRO_POWER             47
-#define LEFW_MACRO_PULLDOWNRES       48
-#define LEFW_MACRO_RESISTANCE        49
-#define LEFW_MACRO_RISESATCUR        50
-#define LEFW_MACRO_RISETHRESH        51
-#define LEFW_MACRO_RISEVOLTAGETHRESHOLD 52
-#define LEFW_MACRO_SOURCE            53
-#define LEFW_MACRO_TIEOFFR           54
-#define LEFW_MACRO_TIMING            55
-#define LEFW_MACRO_VHI               56
-#define LEFW_MACRO_VLO               57
-#define LEFW_MINFEATURE              58
-#define LEFW_NONDEFAULTRULE          59
-#define LEFW_NONDEFAULTRULELAYER     60
-#define LEFW_NOISEMARGIN             61
-#define LEFW_NOISETABLE              62
-#define LEFW_NOWIREEXTATPIN          63
-#define LEFW_PROPERTYDEF             64
-#define LEFW_SCALEFACTOR             65
-#define LEFW_SITE                    66
-#define LEFW_SPACING                 67
-#define LEFW_THRESHOLD1              68
-#define LEFW_THRESHOLD2              69
-#define LEFW_UNITS                   70
-#define LEFW_VERSION                 71
-#define LEFW_VIA                     72
-#define LEFW_VIAFOREIGN              73
-#define LEFW_VIARULE                 74
-#define LEFW_VIARULEGENERATE         75
-#define LEFW_VIARULEGEN              76
-#define LEFW_VIATOPOFSTACKONLY       77
-#define LEFW_VIAVIARULE              78
-
-#define LEFW_END                     79
-#define LEFW_ARRAY_END               80
-#define LEFW_BEGINEXT_END            81
-#define LEFW_CORRECTTABLE_END        82
-#define LEFW_IRDROP_END              83
-#define LEFW_LAYER_END               84
-#define LEFW_LAYERROUTING_END        85
-#define LEFW_LAYERROUTING_SPACINGTABLE_END 86
-#define LEFW_MACRO_END               87
-#define LEFW_NOISETABLE_END          88
-#define LEFW_NONDEFAULTRULE_END      89
-#define LEFW_PROPERTYDEF_END         90
-#define LEFW_SITE_END                91
-#define LEFW_SPACING_END             92
-#define LEFW_VIA_END                 93
-#define LEFW_VIARULE_END             94
-#define LEFW_VIARULEGEN_END          95
-#define LEFW_UNITS_END               96
-
-// 5.4
-// ANTENNA for LAYER
-#define LEFW_ANTENNAINPUTGATEAREA    97
-#define LEFW_ANTENNAINOUTDIFFAREA    98
-#define LEFW_ANTENNAOUTPUTDIFFAREA   99
-#define LEFW_ANTENNAMODEL            100
-#define LEFW_ANTENNAAREARATIO        101
-#define LEFW_ANTENNADIFFAREARATIO    102
-#define LEFW_ANTENNADIFFAREARATIOPWL 103
-#define LEFW_ANTENNACUMAREARATIO     104
-#define LEFW_ANTENNACUMDIFFAREARATIO 105
-#define LEFW_ANTENNACUMDIFFAREARATIOPWL      106
-#define LEFW_ANTENNAAREAFACTOR       107
-#define LEFW_ANTENNASIDEAREARATIO    108
-#define LEFW_ANTENNADIFFSIDEAREARATIO        109
-#define LEFW_ANTENNADIFFSIDEAREARATIOPWL     110
-#define LEFW_ANTENNACUMSIDEAREARATIO 111
-#define LEFW_ANTENNACUMDIFFSIDEAREARATIO     112
-#define LEFW_ANTENNACUMDIFFSIDEAREARATIOPWL  113
-#define LEFW_ANTENNASIDEAREAFACTOR   114
-// ANTENNA for MACRO PIN
-#define LEFW_ANTENNAPARTIALMETALAREA 115
-#define LEFW_ANTENNAPARTIALMETALSIDEAREA     116
-#define LEFW_ANTENNAGATEAREA         117
-#define LEFW_ANTENNADIFFAREA         118
-#define LEFW_ANTENNAMAXAREACAR       119
-#define LEFW_ANTENNAMAXSIDEAREACAR   120
-#define LEFW_ANTENNAPARTIALCUTAREA   121
-#define LEFW_ANTENNAMAXCUTCAR        122
-#define LEFW_CLEARANCEMEASURE        123
-#define LEFW_DENSITYCHECKWINDOW      124
-#define LEFW_DENSITYCHECKSTEP        125
-#define LEFW_DESIGNRULEWIDTH         126
-#define LEFW_FILLACTIVESPACING       127
-#define LEFW_MANUFACTURINGGRID       128
-#define LEFW_MAXADJACENTSLOTSPACING  129
-#define LEFW_MAXCOAXIALSLOTSPACING   130
-#define LEFW_MAXEDGESLOTSPACING      131
-#define LEFW_MAXIMUMDENSITY          132
-#define LEFW_MINIMUMDENSITY          133
-#define LEFW_ROWABUTSPACING          134
-#define LEFW_ROWMINSPACING           135
-#define LEFW_SLOTWIREWIDTH           136
-#define LEFW_SLOTWIRELENGTH          137
-#define LEFW_SLOTWIDTH               138
-#define LEFW_SLOTLENGTH              139
-#define LEFW_SPLITWIREWIDTH          140
-#define LEFW_USEMINSPACING           141
-#define LEFW_FIXEDMASK               142
-
-#define LEFW_DONE                    999
-
-#define MAXSYN                       143
-
-// *****************************************************************************
-// Global Variables
-// *****************************************************************************
-typedef void (*LEFI_LOG_FUNCTION)(const char*);
-typedef void (*LEFI_WARNING_LOG_FUNCTION)(const char*);
-
-LEFI_LOG_FUNCTION lefwErrorLogFunction;
-LEFI_WARNING_LOG_FUNCTION lefwWarningLogFunction;
-
-FILE *lefwFile = 0;   // File to write to.
-int lefwSynArray[MAXSYN]; // array of syntax
-int lefwLines = 0;    // number of lines written
-int lefwState = LEFW_UNINIT;  // Current state of writer
-int lefwDidInit = 0; // required section
-int lefwDidLayer = 0; // required section
-int lefwDidVia = 0; // required section
-int lefwDidViaRule = 0; // required section
-int lefwDidViaSite = 0; // required section
-int lefwDidViaMacro = 0; // required section
-int lefwCounter = 0;  // number of nets, components in section
-int lefwLineItemCounter = 0; // number of items on current line
-int lefwHasArrayReq = 0; // array required data
-int lefwIsArrayFloorp = 0; // array floorplan flag
-int lefwIsArrayDef = 0; // array default cap flag
-int lefwIsCorrectTable = 0; // correctiontable flag
-int lefwIsCut = 0; // cut layer
-int lefwIsEdgerate = 0; // edgerate within noisetable
-int lefwIsFloorp = 0; // floorplan within array
-int lefwIsImplant = 0; // implant layer
-int lefwIsMacroDensity = 0; // macro density flag
-int lefwIsMacroObs = 0; // macro obs flag
-int lefwIsMacroObsLayer = 0; // macro obs layer within macro obs
-int lefwIsMacroPin = 0; // macro pin flag
-int lefwIsMacroPinPortLayer = 0; // macro pin port layer within macro pin port
-int lefwIsMacroPinPort = 0; // macro pin port within macro pin
-int lefwIsMacroTiming = 0; // macro timing flag
-int lefwIsMacroTimingModel = 0; // macro timing model flag
-int lefwIsMaxviastack = 0; // maximum stacked-via
-int lefwIsNoiseTable = 0; // noisetable flag
-int lefwIsNonDefaultRule = 0; // nondefaultrule flag
-int lefwIsOutResist = 0; // outputResistance within edgerate
-int lefwIsRouting = 0; // routing
-int lefwIsRoutingMinCut = 0; // routing Minimumcut
-int lefwIsRoutingMinCutDist = 0; // routing Minimumcut distance
-int lefwIsRoutingMinCutLen = 0; // routing Minimumcut length within
-int lefwIsRoutingReqData = 0; // layer routing required data are provided
-int lefwNumViaRuleLayers = 0; // number of via rule in a via rule
-int lefwOldState = 0;  // the previous state
-int lefwTableLen = 0; // width or cutarea for the tableEntries
-int lefwHasInit = 0;    // for lefwInit has called
-int lefwHasInitCbk = 0; // for lefwInitCbk has called
-static int lefwWriteEncrypt = 0; // for writing out encrypted file, default is 0
-static int prtSemiColon = 0;  // sometimes ; is not printed yet
-static int prtNewLine = 0;  // sometimes need to print a new line
-static int lefwHasLayerRoutingRange = 0;  // mark if layer routing has range
-static int lefwHasLayerRoutingSpacing = 0;  // layer routing is lengththreshold
-static int lefwHasLayerRoutingEol = 0;  // mark if layer routing is endofline
-static int lefwIsLayerCutSpacing = 0;  // mark if layer cut spacing
-static int lefwAMaxAreaCar = 0;  // only allow to define once per pin
-static int lefwAMaxSideAreaCar = 0; // only allow to define once per pin
-static int lefwAMaxCutCar = 0; // only allow to define once per pin
-static int lefwSpacingVal = 0; // either this or lefwWidthVal
-static int lefwWidthVal = 0;   // is allowed
-static double versionNum = 5.7;  // default to 5.7
-static int lefwAntenna54 = 0;  // to keep track 5.4 antenna is used
-static int lefwAntenna53 = 0;  // to keep track 5.3 antenna is used
-static int lefwObsoleteNum = -1; // keep track the obsolote syntax for error
-static int lefw54Num = -1; // keep track the 5.4 syntax for error
-static int lefwViaHasVal = 0; // keep track only ViaRule or Resistance in a via
-
-char lefwStateStr[MAXSYN] [80] = {
-    "UNITS",                 //  0
-    "INIT",                  //  1
-    "ARRAY",                 //  2
-    "BEGINEXT",              //  3
-    "CORRECTTABLE",          //  4
-    "IRDROP",                //  5
-    "LAYER",                 //  6
-    "LAYERROUTING",          //  7
-    "LAYERROUTINGSPACINGTABLE", //  8
-    "MACRO",                 //  9
-    "NOISETABLE",            // 10
-    "NONDEFAULTRULE",        // 11
-    "PROPERTYDEFINITION",    // 12
-    "SPACING",               // 13
-    "UNITS",                 // 14
-    "VIA",                   // 15
-    "VIARULE",               // 16
-    "VIARULEGEN",            // 17
-    "ANTENNASIZE",           // 18
-    "ARRAY",                 // 19
-    "BEGINEXT",              // 20
-    "BUSBITCHARS",           // 21
-    "CASESENSITIVE",         // 22
-    "CORRECTABLE",           // 23
-    "DIELECTRIC",            // 24
-    "DIVIDERCHAR",           // 25
-    "EDGERATE",              // 26
-    "IRDROP",                // 27
-    "LAYER",                 // 28
-    "LAYERACCURRENT",        // 29
-    "LAYERDCCURRENT",        // 30
-    "LAYERROUTING",          // 31
-    "LAYERROUTINGWIDTH",     // 32
-    "MACRO",                 // 33
-    "MACRO_CAPACITANCE",     // 34
-    "MACRO_INPUTNOISEMARGIN",// 35
-    "MACRO_FALLCURRENTSOURCE",   // 36
-    "MACRO_FALLSATCUR",          // 37
-    "MACRO_FALLTHRESH",          // 38
-    "MACRO_FALLVOLTAGETHRESHOLD",// 39
-    "MACRO_IV_TABLES",       // 40
-    "MACRO_LEAKAGE",         // 41
-    "MACRO_LEQ",                 // 42
-    "MACRO_OUTPUTNOISEMARGIN",   // 43
-    "MACRO_OUTPUTRESISTANCE",    // 44
-    "MACRO_PINFOREIGN",          // 45
-    "MACRO_PINLEQ",              // 46
-    "MACRO_POWER",           // 47
-    "MACRO_PULLDOWNRES",     // 48
-    "MACRO_RESISTANCE",      // 49
-    "MACRO_RISESATCUR",      // 50
-    "MACRO_RISETHRESH",      // 51
-    "MACRO_RISEVOLTAGETHRESHOLD",// 52
-    "MACRO_SOURCE",          // 53
-    "MACRO_TIEOFFR",         // 54
-    "MACRO_TIMING",          // 55
-    "MACRO_VHI",             // 56
-    "MACRO_VLO",             // 57
-    "MINFEATURE",            // 58
-    "NONDEFAULTRULE",        // 59
-    "NONDEFAULTRULELAYERRESIST_CAPACITANCE_EDGECAP",  // 60
-    "NOISEMARGIN",           // 61
-    "NOISETABLE",            // 62
-    "NOWIREEXTSIONATPIN",    // 63
-    "PROPERTYDEFINITION",    // 64
-    "EDGERATESCALEFACTOR",   // 65
-    "SITE",                  // 66
-    "SPACING",               // 67
-    "EDGERATETHRESHOLD1",    // 68
-    "EDGERATETHRESHOLD2",    // 69
-    "UNTIS",                 // 70
-    "VERSION",               // 71
-    "VIA",                   // 72
-    "VIAFOREIGN",            // 73
-    "VIARULE",               // 74
-    "VIARULEDIRECTION_OVERHANG_METALOVERHANG", // 75
-    "VIARULEGEN",            // 76
-    "VIATOPOFSTACKONLY",            // 77
-    "VIAVIARULE",            // 78
-    "END",                   // 79
-    "ARRAY",                 // 80
-    "BEGINEXT",              // 81
-    "CORRECTABLE",           // 82
-    "IRDROP",                // 83
-    "LAYER",                 // 84
-    "LAYERROUTING",          // 85
-    "LAYERROUTINGSPACINGTABLE",     // 86
-    "MACRO",                 // 87
-    "NOISETABLE",            // 88
-    "NONDEFAULTRULE",        // 89
-    "PROERTYDEFINITION",     // 90
-    "SITE",                  // 91
-    "SPACING",               // 92
-    "VIA",                   // 93
-    "VIARULE",               // 94
-    "VIARULEGEN",            // 95
-    "UNITS",                 // 96
-    "ANTENNAINPUTGATEAREA",  // 97
-    "ANTENNAINOUTDIFFAREA",  // 98
-    "ANTENNAOUTPUTDIFFAREA", // 99
-    "ANTENNAMODEL",          // 100
-    "ANTENNAAREARATIO",      // 101
-    "ANTENNADIFFAREARATIO",  // 102
-    "ANTENNADIFFAREARATIO PWL",        // 103
-    "ANTENNACUMAREARATIO",   // 104
-    "ANTENNACUMDIFFAREARATIO",         // 105
-    "ANTENNACUMDIFFAREARATIO PWL",     // 106
-    "ANTENNAAREAFACTOR",     // 107
-    "ANTENNASIDEAREARATIO",  // 108
-    "ANTENNADIFFSIDEAREARATIO",        // 109
-    "ANTENNADIFFSIDEAREARATIO PWL",    // 110
-    "ANTENNACUMSIDEAREARATIO",         // 111
-    "ANTENNACUMDIFFSIDEAREARATIO",     // 112
-    "ANTENNACUMDIFFSIDEAREARATIO PWL", // 113
-    "ANTENNASIDEAREAFACTOR", // 114
-    "ANTENNAPARTIALMETALAREA",         // 115
-    "ANTENNAPARTIALMETALSIDEAREA",     // 116
-    "ANTENNAGATEAREA",       // 117
-    "ANTENNADIFFAREA",       // 118
-    "ANTENNAMAXAREACAR",     // 119
-    "ANTENNAMAXSIDEAREACAR", // 120
-    "ANTENNAPARTIALCUTAREA", // 121
-    "ANTENNAMAXCUTCAR",      // 122
-    "CLEARANCEMEASURE",      // 123
-    "DENSITYCHECKWINDOW",    // 124
-    "DENSITYCHECKSTEP",      // 125
-    "DESIGNRULEWIDTH",       // 126
-    "FILLACTIVESPACING",     // 127
-    "MANUFACTURINGGRID",     // 128
-    "MAXADJACENTSLOTSPACING",          // 129
-    "MAXCOAXIALSLOTSPACING",           // 130
-    "MAXEDGESLOTSPACING",    // 131
-    "MAXIMUMDENSITY",        // 132
-    "MINIMUMDENSITY",        // 133
-    "ROWABUTSPACING",        // 134
-    "ROWMINSPACING",         // 135
-    "SLOTWIREWIDTH",         // 136
-    "SLOTWIRELENGTH",        // 137
-    "SLOTWIDTH",             // 138
-    "SLOTLENGTH",            // 139
-    "SPLITWIREWIDTH",        // 140
-    "USEMINSPACING PIN"      // 141
-};
-
-// internal function
-char *
-lefwAddr(const char *x)
-{
-    return (char*) x;
-}
-
-// internal function
-char *
-lefwOrient(int num)
-{
-    switch (num) {
-    case 0:
-        return lefwAddr("N");
-    case 1:
-        return lefwAddr("W");
-    case 2:
-        return lefwAddr("S");
-    case 3:
-        return lefwAddr("E");
-    case 4:
-        return lefwAddr("FN");
-    case 5:
-        return lefwAddr("FW");
-    case 6:
-        return lefwAddr("FS");
-    case 7:
-        return lefwAddr("FE");
-    };
-    return lefwAddr("BOGUS");
-}
-
-// internal function
-bool
-lefwValidateMaskNumber(int num)
-{
-    int digit = 0;
-    int index = 0;
-
-    if (num < 0) {
-        return false;
-    }
-
-    while (num > 0) {
-        digit = num % 10;
-
-        if (digit > 3) {
-            return false;
-        }
-
-        index++;
-        num = num / 10;
-    }
-
-    if (index > 3) {
-        return false;
-    }
-
-    return true;
-}
-
-// this function is required to be called first to initialize the array
-// Either this function or lefwInitCbk can be called, cannot be both
-int
-lefwInit(FILE *f)
-{
-    int i;
-
-    // Check if the user is valid 
-    /* don't need anymore
-    if (!lefiValidUser())
-        exit(77);
-    */
-
-    // if (lefwFile) return LEFW_BAD_ORDER;
-    lefwFile = f;
-
-    if (lefwHasInitCbk == 1) {  // lefwInitCbk has already called, issue an error
-        fprintf(lefwFile,
-                "ERROR (LEFWRIT-4000): lefwInitCbk has already called, cannot call lefwInit again.\n");
-        fprintf(lefwFile, "Writer Exit.\n");
-        exit(LEFW_BAD_ORDER);
-    }
-    lefwState = LEFW_UNINIT;  // Current state of writer
-    lefwDidInit = 0;  // required section
-
-    for (i = 0; i < MAXSYN; i++)
-        lefwSynArray[i] = 0;
-
-    lefwDidInit = 1;
-    lefwState = LEFW_INIT;
-    lefwHasInit = 1;
-    return LEFW_OK;
-}
-
-// this function is required to be called first to initialize the array
-// Either this function or lefwInit can be called, cannot be both
-int
-lefwInitCbk(FILE *f)
-{
-    int i;
-
-    // if (lefwFile) return LEFW_BAD_ORDER;
-    lefwFile = f;
-
-    if (lefwHasInit == 1) {  // lefwInit has already called, issue an error
-        if (lefwWriteEncrypt) {
-            encPrint(lefwFile, (char*)
-                     "ERROR (LEFWRIT-4001): lefwInit has already called, cannot call lefwInitCbk again.\n");
-            encPrint(lefwFile, (char*) "Writer Exit.\n");
-        } else {
-            fprintf(lefwFile,
-                    "ERROR (LEFWRIT-4002): lefwInit has already called, cannot call lefwInitCbk again.\n");
-            fprintf(lefwFile, "Writer Exit.\n");
-        }
-        exit(LEFW_BAD_ORDER);
-    }
-    lefwState = LEFW_UNINIT;  // Current state of writer
-    lefwDidInit = 0;  // required section
-
-    for (i = 0; i < MAXSYN; i++)
-        lefwSynArray[i] = 0;
-
-    lefwDidInit = 1;
-    lefwState = LEFW_INIT;
-    lefwHasInitCbk = 1;
-    return LEFW_OK;
-}
-
-// This function sets the global variable lefwEncrypt to 1, which will
-// write out an output encrypted file, make sure to call lefwCloseEncrypt
-// before closing the output file
-int
-lefwEncrypt()
-{
-    if (!lefwFile || (lefwFile == stdout)) {
-        // No output filename is given
-        fprintf(stderr, "ERROR (LEFWRITE-4006): Need an output file if writing in encrypted format.\n");
-        return LEFW_BAD_ORDER;
-    }
-
-    // Set the flag in crypt.cpp
-    encWritingEncrypted();
-
-    lefwWriteEncrypt = 1;
-    return LEFW_OK;
-}
-
-// This function needs to be called if lefwEncrypt is called
-// It will clear the encrypted buffer
-int
-lefwCloseEncrypt()
-{
-
-    if (lefwWriteEncrypt)
-        encClearBuf(lefwFile);
-    return LEFW_OK;
-}
-
-int
-lefwNewLine()
-{
-    if (!lefwFile)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n");
-    else
-        fprintf(lefwFile, "\n");
-    return LEFW_OK;
-}
-
-int
-lefwVersion(int vers1,
-            int vers2)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_VERSION])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "VERSION %d.%d ;\n", vers1, vers2);
-    else
-        fprintf(lefwFile, "VERSION %d.%d ;\n", vers1, vers2);
-    if (vers2 >= 10)
-        versionNum = vers1 + (vers2 / 100.0);
-    else
-        versionNum = vers1 + (vers2 / 10.0);
-    lefwSynArray[LEFW_VERSION] = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwCaseSensitive(const char *caseSensitive)
-{
-    lefwObsoleteNum = LEFW_CASESENSITIVE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (lefwSynArray[LEFW_CASESENSITIVE])
-        return LEFW_ALREADY_DEFINED;
-    if (strcmp(caseSensitive, "ON") && strcmp(caseSensitive, "OFF"))
-        return LEFW_BAD_DATA;     // has to be either ON or OFF
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "NAMESCASESENSITIVE %s ;\n", caseSensitive);
-    else
-        fprintf(lefwFile, "NAMESCASESENSITIVE %s ;\n", caseSensitive);
-    lefwSynArray[LEFW_CASESENSITIVE] = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwNoWireExtensionAtPin(const char *noWireExt)
-{
-    lefwObsoleteNum = LEFW_NOWIREEXTATPIN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (lefwSynArray[LEFW_NOWIREEXTATPIN])
-        return LEFW_ALREADY_DEFINED;
-    if (strcmp(noWireExt, "ON") && strcmp(noWireExt, "OFF"))
-        return LEFW_BAD_DATA;     // has to be either ON or OFF
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "NOWIREEXTENSIONATPIN %s ;\n", noWireExt);
-    else
-        fprintf(lefwFile, "NOWIREEXTENSIONATPIN %s ;\n", noWireExt);
-    lefwSynArray[LEFW_NOWIREEXTATPIN] = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMinfeature(double   minFeatureX,
-               double   minFeatureY)
-{
-    lefwObsoleteNum = LEFW_MINFEATURE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwSynArray[LEFW_MINFEATURE])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "MINFEATURE %.11g %.11g ;\n",
-                 minFeatureX, minFeatureY);
-    else
-        fprintf(lefwFile, "MINFEATURE %.11g %.11g ;\n", minFeatureX, minFeatureY);
-    lefwSynArray[LEFW_MINFEATURE] = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwDielectric(double dielectric)
-{
-    lefwObsoleteNum = LEFW_DIELECTRIC;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwSynArray[LEFW_DIELECTRIC])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "DIELECTRIC %.11g ;\n", dielectric);
-    else
-        fprintf(lefwFile, "DIELECTRIC %.11g ;\n", dielectric);
-    lefwSynArray[LEFW_DIELECTRIC] = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwBusBitChars(const char *busBitChars)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_BUSBITCHARS])
-        return LEFW_ALREADY_DEFINED;
-    if (busBitChars && busBitChars != 0 && *busBitChars != 0) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "BUSBITCHARS \"%s\" ;\n", busBitChars);
-        else
-            fprintf(lefwFile, "BUSBITCHARS \"%s\" ;\n", busBitChars);
-    }
-    lefwLines++;
-    lefwSynArray[LEFW_BUSBITCHARS] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwDividerChar(const char *dividerChar)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_DIVIDERCHAR])
-        return LEFW_ALREADY_DEFINED;
-    if (dividerChar && dividerChar != 0 && *dividerChar != 0) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "DIVIDERCHAR \"%s\" ;\n", dividerChar);
-        else
-            fprintf(lefwFile, "DIVIDERCHAR \"%s\" ;\n", dividerChar);
-    }
-    lefwLines++;
-    lefwSynArray[LEFW_DIVIDERCHAR] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwManufacturingGrid(double grid)
-{
-    lefw54Num = LEFW_MANUFACTURINGGRID;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_MANUFACTURINGGRID])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "MANUFACTURINGGRID %.11g ;\n", grid);
-    else
-        fprintf(lefwFile, "MANUFACTURINGGRID %.11g ;\n", grid);
-    lefwLines++;
-    lefwSynArray[LEFW_MANUFACTURINGGRID] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwFixedMask()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-
-    if (versionNum < 5.8)
-        return LEFW_WRONG_VERSION;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "FIXEDMASK ;\n");
-    else
-        fprintf(lefwFile, "FIXEDMASK ;\n");
-
-    lefwLines++;
-    lefwSynArray[LEFW_FIXEDMASK] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwUseMinSpacing(const char    *type,
-                  const char    *onOff)
-{
-    lefwObsoleteNum = LEFW_USEMINSPACING;
-    lefw54Num = LEFW_USEMINSPACING;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    // Can define more than once
-    // if (lefwSynArray[LEFW_USEMINSPACING]) return LEFW_ALREADY_DEFINED;
-    if (!type || (strcmp(type, "OBS") && strcmp(type, "PIN")))
-        return LEFW_BAD_DATA;   // has to be OBS or PIN 
-    if ((strcmp(type, "PIN") == 0) && (versionNum >= 5.6))
-        return LEFW_OBSOLETE;
-    if (!onOff || (strcmp(onOff, "ON") && strcmp(onOff, "OFF")))
-        return LEFW_BAD_DATA;   // has to be ON or OFF 
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "USEMINSPACING %s %s ;\n", type, onOff);
-    else
-        fprintf(lefwFile, "USEMINSPACING %s %s ;\n", type, onOff);
-    lefwLines++;
-    // lefwSynArray[LEFW_USEMINSPACING] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwClearanceMeasure(const char *type)
-{
-    lefw54Num = LEFW_CLEARANCEMEASURE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_CLEARANCEMEASURE])
-        return LEFW_ALREADY_DEFINED;
-    if (!type || (strcmp(type, "MAXXY") && strcmp(type, "EUCLIDEAN")))
-        return LEFW_BAD_DATA;   // has to be MAXXY or EUCLIDEAN 
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "CLEARANCEMEASURE %s ;\n", type);
-    else
-        fprintf(lefwFile, "CLEARANCEMEASURE %s ;\n", type);
-    lefwLines++;
-    lefwSynArray[LEFW_CLEARANCEMEASURE] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwStartUnits()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwSynArray[LEFW_UNITS_START])
-        return LEFW_ALREADY_DEFINED;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "UNITS\n");
-    else
-        fprintf(lefwFile, "UNITS\n");
-    lefwLines++;
-    lefwSynArray[LEFW_UNITS_START] = 1;
-    lefwState = LEFW_UNITS_START;
-    return LEFW_OK;
-}
-
-int
-lefwUnits(double    time,        // optional 
-          double    capacitance, // optional 
-          double    resistance,  // optional 
-          double    power,       // optional 
-          double    current,     // optional 
-          double    voltage,     // optional 
-          double    database     // optional 
-          )
-{
-
-    int databaseVal;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_UNITS_START &&
-        lefwState != LEFW_UNITS)
-        return LEFW_BAD_ORDER;
-
-    if (time) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   TIME NANOSECONDS %.11g ;\n", time);
-        else
-            fprintf(lefwFile, "   TIME NANOSECONDS %.11g ;\n", time);
-    }
-    if (capacitance) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   CAPACITANCE PICOFARADS %.11g ;\n",
-                     capacitance);
-        else
-            fprintf(lefwFile, "   CAPACITANCE PICOFARADS %.11g ;\n", capacitance);
-    }
-    if (resistance) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   RESISTANCE OHMS %.11g ;\n", resistance);
-        else
-            fprintf(lefwFile, "   RESISTANCE OHMS %.11g ;\n", resistance);
-    }
-    if (power) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   POWER MILLIWATTS %.11g ;\n", power);
-        else
-            fprintf(lefwFile, "   POWER MILLIWATTS %.11g ;\n", power);
-    }
-    if (current) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   CURRENT MILLIAMPS %.11g ;\n", current);
-        else
-            fprintf(lefwFile, "   CURRENT MILLIAMPS %.11g ;\n", current);
-    }
-    if (voltage) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   VOLTAGE VOLTS %.11g ;\n", voltage);
-        else
-            fprintf(lefwFile, "   VOLTAGE VOLTS %.11g ;\n", voltage);
-    }
-    if (database) {
-        databaseVal = (int) database;
-        switch (databaseVal) {
-        case 100:
-        case 200:
-        case 1000:
-        case 2000:
-        case 10000:
-        case 20000:
-            if (lefwWriteEncrypt)
-                encPrint(lefwFile, (char*) "   DATABASE MICRONS %d ;\n",
-                         database);
-            else
-                fprintf(lefwFile, "   DATABASE MICRONS %d ;\n", databaseVal);
-            break;
-        default:
-            return LEFW_BAD_DATA;
-        }
-    }
-
-    lefwState = LEFW_UNITS;
-    return LEFW_OK;
-}
-
-int
-lefwUnitsFrequency(double frequency)
-{  // required since only by itself 
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_UNITS_START &&
-        lefwState != LEFW_UNITS)
-        return LEFW_BAD_ORDER;
-    if (!frequency)
-        return LEFW_BAD_DATA;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   FREQUENCY MEGAHERTZ %.11g ;\n", frequency);
-    else
-        fprintf(lefwFile, "   FREQUENCY MEGAHERTZ %.11g ;\n", frequency);
-
-    lefwState = LEFW_UNITS;
-    return LEFW_OK;
-}
-
-int
-lefwEndUnits()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_UNITS_START &&
-        lefwState != LEFW_UNITS)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END UNITS\n\n");
-    else
-        fprintf(lefwFile, "END UNITS\n\n");
-    lefwLines++;
-    lefwState = LEFW_UNITS_END;
-    return LEFW_OK;
-}
-
-int
-lefwStartLayer(const char   *layerName,
-               const char   *type)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_LAYER_START ||
-        lefwState == LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (strcmp(type, "CUT") == 0)
-        lefwIsCut = 1;
-    else if (strcmp(type, "IMPLANT") == 0)  // IMPLANT is 5.5 syntax
-        lefwIsImplant = 1;
-    else if (strcmp(type, "MASTERSLICE") && strcmp(type, "OVERLAP") &&
-             strcmp(type, "IMPLANT"))  // IMPLANT is 5.5 syntax
-        return LEFW_BAD_DATA;  // type is CUT, MASTERSLICE or OVERLAP only
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "LAYER %s\n", layerName);
-        encPrint(lefwFile, (char*) "   TYPE %s ;\n", type);
-    } else {
-        fprintf(lefwFile, "LAYER %s\n", layerName);
-        fprintf(lefwFile, "   TYPE %s ;\n", type);
-    }
-    lefwIsRouting = 0;
-    lefwLines = lefwLines + 2;
-    lefwState = LEFW_LAYER_START;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacing(double spacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER;
-    if ((!lefwIsCut) && (!lefwIsImplant))
-        return LEFW_BAD_DATA;
-    // only cut & implant call this func
-    if (spacing) {
-        if (lefwWriteEncrypt) {
-            encPrint(lefwFile, (char*) "   SPACING %.11g", spacing);
-        } else {
-            fprintf(lefwFile, "   SPACING %.11g", spacing);
-        }
-    } else
-        return LEFW_BAD_ORDER;
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    lefwIsLayerCutSpacing = 1;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingCenterToCenter()
-{
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n     CENTERTOCENTER");
-    else
-        fprintf(lefwFile, "\n     CENTERTOCENTER");
-    lefwLines++;
-
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingSameNet()
-{
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n     SAMENET");
-    else
-        fprintf(lefwFile, "\n     SAMENET");
-    lefwLines++;
-
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingLayer(const char *name2,
-                         int        stack)
-{   // optional 
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n     LAYER %s", name2);
-        if (stack)
-            encPrint(lefwFile, (char*) " STACK");
-    } else {
-        fprintf(lefwFile, "\n     LAYER %s", name2);
-        if (stack)
-            fprintf(lefwFile, " STACK");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingAdjacent(int     viaCuts,    // either 2, 3 or 4, optional 
-                            double  distance,
-                            int     except)
-{ // optional 
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt) {
-        if (viaCuts < 2 && viaCuts > 4)
-            return LEFW_BAD_DATA;
-        encPrint(lefwFile, (char*) "\n     ADJACENTCUTS %d WITHIN %.11g",
-                 viaCuts, distance);
-        if (except)
-            encPrint(lefwFile, (char*) " EXCEPTSAMEPGNET");
-
-    } else {
-        if (viaCuts < 2 && viaCuts > 4)
-            return LEFW_BAD_DATA;
-        fprintf(lefwFile, "\n     ADJACENTCUTS %d WITHIN %.11g", viaCuts,
-                distance);
-        if (except)
-            fprintf(lefwFile, " EXCEPTSAMEPGNET");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingParallel()
-{
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n     PARALLELOVERLAP");
-    } else {
-        fprintf(lefwFile, "\n     PARALLELOVERLAP");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingArea(double cutArea)
-{
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n     AREA %.11g", cutArea);
-    } else {
-        fprintf(lefwFile, "\n     AREA %.11g", cutArea);
-    }
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingEnd()
-{
-    if (!lefwIsLayerCutSpacing)
-        return LEFW_BAD_ORDER; // has to be after 
-    // lefwLayerCutSpacing is called
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) " ;\n");
-    } else {
-        fprintf(lefwFile, " ;\n");
-    }
-
-    lefwIsLayerCutSpacing = 0;
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-int
-lefwLayerMask(int colorMask)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER &&
-        lefwState != LEFW_LAYERROUTING_START)
-        return LEFW_BAD_ORDER;
-
-    if (versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(colorMask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MASK %d ;\n", colorMask);
-    else
-        fprintf(lefwFile, "   MASK %d ;\n", colorMask);
-
-    lefwLines++;
-
-    lefwState = (lefwState == LEFW_LAYERROUTING_START) ? LEFW_LAYERROUTING : LEFW_LAYER;
-
-    return LEFW_OK;
-}
-
-int
-lefwLayerWidth(double minWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if ((!lefwIsImplant) && (!lefwIsCut))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   WIDTH %.11g ;\n", minWidth);
-    else
-        fprintf(lefwFile, "   WIDTH %.11g ;\n", minWidth);
-
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerCutSpacingTableOrtho(int       numSpacing,
-                              double    *cutWithins,
-                              double    *orthoSpacings)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (numSpacing) {
-        if (lefwWriteEncrypt) {
-            encPrint(lefwFile, (char*) "   SPACINGTABLE ORTHOGONAL");
-            lefwLines++;
-            for (i = 0; i < numSpacing; i++) {
-                encPrint(lefwFile, (char*) "\n     WITHING %.11g SPACING %.11g ",
-                         *cutWithins++, *orthoSpacings++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*) " ;\n");
-        } else {
-            fprintf(lefwFile, "   SPACINGTABLE ORTHOGONAL");
-            lefwLines++;
-            for (i = 0; i < numSpacing; i++) {
-                fprintf(lefwFile, "\n     WITHIN %.11g SPACING %.11g",
-                        *cutWithins++, *orthoSpacings++);
-                lefwLines++;
-            }
-            fprintf(lefwFile, " ;\n");
-        }
-    }
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerArraySpacing(int       longArray,
-                      double    viaWidth,
-                      double    cutSpacing,
-                      int       numArrayCut,
-                      int       *arrayCuts,
-                      double    *arraySpacings)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (cutSpacing) {
-        if (lefwWriteEncrypt) {
-            encPrint(lefwFile, (char*) "   ARRAYSPACING ");
-            if (longArray)
-                encPrint(lefwFile, (char*) "LONGARRAY ");
-            if (viaWidth)
-                encPrint(lefwFile, (char*) "WIDTH %.11g ", viaWidth);
-            encPrint(lefwFile, (char*) "CUTSPACING %.11g ", cutSpacing);
-            for (i = 0; i < numArrayCut; i++) {
-                encPrint(lefwFile, (char*) "ARRAYCUTS %d SPACING %.11g ",
-                         *arrayCuts++, *arraySpacings++);
-            }
-            encPrint(lefwFile, (char*) " ;\n");
-        } else {
-            fprintf(lefwFile, "  ARRAYSPACING ");
-            if (longArray)
-                fprintf(lefwFile, "LONGARRAY ");
-            if (viaWidth)
-                fprintf(lefwFile, "WIDTH %.11g ", viaWidth);
-            fprintf(lefwFile, "CUTSPACING %.11g ", cutSpacing);
-            for (i = 0; i < numArrayCut; i++) {
-                fprintf(lefwFile, "ARRAYCUTS %d SPACING %.11g ",
-                        *arrayCuts++, *arraySpacings++);
-            }
-            fprintf(lefwFile, " ;\n");
-        }
-        lefwLines++;
-    }
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-int
-lefwLayerEnclosure(const char   *location,
-                   double       overhang1,
-                   double       overhang2,
-                   double       width)
-{         // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                encPrint(lefwFile, (char*)
-                         "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            encPrint(lefwFile, (char*) "%s ", location);
-        }
-        encPrint(lefwFile, (char*) "%.11g %.11g ", overhang1, overhang2);
-        if (width)
-            encPrint(lefwFile, (char*) "WIDTH %.11g ", width);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                fprintf(lefwFile,
-                        "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            fprintf(lefwFile, "%s ", location);
-        }
-        fprintf(lefwFile, "%.11g %.11g ", overhang1, overhang2);
-        if (width)
-            fprintf(lefwFile, "WIDTH %.11g ", width);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerEnclosureWidth(const char  *location,
-                        double      overhang1,
-                        double      overhang2,
-                        double      width,               // optional 
-                        double      cutWithin)
-{         // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                encPrint(lefwFile, (char*)
-                         "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            encPrint(lefwFile, (char*) "%s ", location);
-        }
-        encPrint(lefwFile, (char*) "%.11g %.11g ", overhang1, overhang2);
-        if (width) {
-            encPrint(lefwFile, (char*) "WIDTH %.11g ", width);
-            if (cutWithin)
-                encPrint(lefwFile, (char*) "EXCEPTEXTRACUT %.11g ", cutWithin);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                fprintf(lefwFile,
-                        "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            fprintf(lefwFile, "%s ", location);
-        }
-        fprintf(lefwFile, "%.11g %.11g ", overhang1, overhang2);
-        if (width) {
-            fprintf(lefwFile, "WIDTH %.11g ", width);
-            if (cutWithin)
-                fprintf(lefwFile, "EXCEPTEXTRACUT %.11g ", cutWithin);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerEnclosureLength(const char *location,
-                         double     overhang1,
-                         double     overhang2,
-                         double     minLength)
-{         // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                encPrint(lefwFile, (char*)
-                         "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            encPrint(lefwFile, (char*) "%s ", location);
-        }
-        encPrint(lefwFile, (char*) "%.11g %.11g ", overhang1, overhang2);
-        if (minLength)
-            encPrint(lefwFile, (char*) "LENGTH %.11g ", minLength);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   ENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                fprintf(lefwFile,
-                        "ENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            fprintf(lefwFile, "%s ", location);
-        }
-        fprintf(lefwFile, "%.11g %.11g ", overhang1, overhang2);
-        if (minLength)
-            fprintf(lefwFile, "LENGTH %.11g ", minLength);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-int
-lefwLayerPreferEnclosure(const char *location,
-                         double     overhang1,
-                         double     overhang2,
-                         double     width)
-{         // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   PREFERENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                encPrint(lefwFile, (char*)
-                         "PREFERENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            encPrint(lefwFile, (char*) "%s ", location);
-        }
-        encPrint(lefwFile, (char*) "%.11g %.11g ", overhang1, overhang2);
-        if (width)
-            encPrint(lefwFile, (char*) "WIDTH %.11g ", width);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   PREFERENCLOSURE ");
-        if (location && (*location != 0)) {
-            if (strcmp(location, "ABOVE") && strcmp(location, "BELOW")) {
-                fprintf(lefwFile,
-                        "PREFERENCLOSURE in Layer(Cut) can only be ABOVE, BELOW.\n");
-                return LEFW_BAD_DATA;
-            }
-            fprintf(lefwFile, "%s ", location);
-        }
-        fprintf(lefwFile, "%.11g %.11g ", overhang1, overhang2);
-        if (width)
-            fprintf(lefwFile, "WIDTH %.11g ", width);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-int
-lefwLayerResistancePerCut(double resistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsCut)
-        return LEFW_BAD_DATA;  // only cut calls this func
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;  // Layer after maximum stacked-via
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   RESISTANCEPERCUT %.11g ;\n", resistance);
-    else
-        fprintf(lefwFile, "   RESISTANCEPERCUT %.11g ;\n", resistance);
-    lefwLines++;
-    lefwState = LEFW_LAYER;
-    return LEFW_OK;
-}
-
-int
-lefwEndLayer(const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYER_START &&
-        lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", layerName);
-    else
-        fprintf(lefwFile, "END %s\n\n", layerName);
-
-    lefwLines++;
-    lefwState = LEFW_LAYER_END;
-    lefwIsCut = 0;
-    lefwIsImplant = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartLayerRouting(const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_LAYERROUTING_START ||
-        lefwState == LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "LAYER %s\n", layerName);
-        encPrint(lefwFile, (char*) "   TYPE ROUTING ;\n");
-    } else {
-        fprintf(lefwFile, "LAYER %s\n", layerName);
-        fprintf(lefwFile, "   TYPE ROUTING ;\n");
-    }
-    lefwIsRouting = 1;
-    lefwIsRoutingReqData = 0;
-    lefwLines = lefwLines + 2;
-    lefwState = LEFW_LAYERROUTING_START;
-    lefwSynArray[LEFW_LAYERROUTING_START] = 1;
-
-    return LEFW_OK;
-}
-
-int
-lefwLayerRouting(const char *direction,
-                 double     width)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    // this routine should call only once per layer routing
-    if (lefwSynArray[LEFW_LAYERROUTING])
-        return LEFW_ALREADY_DEFINED;
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt) {
-        if (!direction || direction == 0 || *direction == 0) {
-            encPrint(lefwFile, (char*) "DIRECTION is required in Layer(Routing).\n");
-            return LEFW_BAD_DATA;
-        }
-        if (strcmp(direction, "HORIZONTAL") && strcmp(direction, "VERTICAL") &&
-            strcmp(direction, "DIAG45") && strcmp(direction, "DIAG135")) {
-            encPrint(lefwFile, (char*)
-                     "DIRECTION in Layer(Routing) can only be HORIZONTAL, VERTICAL, DIAG45, DIAG135.\n");
-            return LEFW_BAD_DATA; // direction is either HORIZONTAL, VERTICAL, DIAG45, DIAG135 only
-        }
-        encPrint(lefwFile, (char*) "   DIRECTION %s ;\n", direction);
-        encPrint(lefwFile, (char*) "   WIDTH %.11g ;\n", width);
-    } else {
-        if (!direction || direction == 0 || *direction == 0) {
-            fprintf(lefwFile, "DIRECTION is required in Layer(Routing).\n");
-            return LEFW_BAD_DATA;
-        }
-        if (strcmp(direction, "HORIZONTAL") && strcmp(direction, "VERTICAL") &&
-            strcmp(direction, "DIAG45") && strcmp(direction, "DIAG135")) {
-            fprintf(lefwFile,
-                    "DIRECTION in Layer(Routing) can only be HORIZONTAL, VERTICAL, DIAG45, DIAG135.\n");
-            return LEFW_BAD_DATA; // direction is either HORIZONTAL, VERTICAL, DIAG45, DIAG135 only
-        }
-        fprintf(lefwFile, "   DIRECTION %s ;\n", direction);
-        fprintf(lefwFile, "   WIDTH %.11g ;\n", width);
-    }
-
-    lefwLines += 2;
-    lefwIsRoutingReqData = 1;
-    lefwSynArray[LEFW_LAYERROUTING] = 1;
-    lefwIsRoutingMinCut = 0;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingPitch(double pitch)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    // this routine should call only once per layer routing
-    // it is required for SE only, other is optional
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PITCH %.11g ;\n", pitch);
-    else
-        fprintf(lefwFile, "   PITCH %.11g ;\n", pitch);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingPitchXYDistance(double  xDistance,
-                                double  yDistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    // this routine should call only once per layer routing
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PITCH %.11g %.11g ;\n",
-                 xDistance, yDistance);
-    else
-        fprintf(lefwFile, "   PITCH %.11g %.11g ;\n", xDistance, yDistance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingOffset(double offset)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   OFFSET %.11g ;\n", offset);
-    else
-        fprintf(lefwFile, "   OFFSET %.11g ;\n", offset);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingOffsetXYDistance(double xDistance,
-                                 double yDistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   OFFSET %.11g %.11g ;\n",
-                 xDistance, yDistance);
-    else
-        fprintf(lefwFile, "   OFFSET %.11g %.11g ;\n", xDistance, yDistance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingDiagPitch(double distance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DIAGPITCH %.11g ;\n", distance);
-    else
-        fprintf(lefwFile, "   DIAGPITCH %.11g ;\n", distance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingDiagPitchXYDistance(double  xDistance,
-                                    double  yDistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DIAGPITCH %.11g %.11g ;\n",
-                 xDistance, yDistance);
-    else
-        fprintf(lefwFile, "   DIAGPITCH %.11g %.11g ;\n", xDistance, yDistance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingDiagWidth(double diagWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    // this routine should call only once per layer routing
-    // it is required for SE only, other is optional
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DIAGWIDTH %.11g ;\n", diagWidth);
-    else
-        fprintf(lefwFile, "   DIAGWIDTH %.11g ;\n", diagWidth);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingDiagSpacing(double diagSpacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    // this routine should call only once per layer routing
-    // it is required for SE only, other is optional
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DIAGSPACING %.11g ;\n", diagSpacing);
-    else
-        fprintf(lefwFile, "   DIAGSPACING %.11g ;\n", diagSpacing);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingDiagMinEdgeLength(double diagLength)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    // this routine should call only once per layer routing
-    // it is required for SE only, other is optional
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DIAGMINEDGELENGTH %.11g ;\n", diagLength);
-    else
-        fprintf(lefwFile, "   DIAGMINEDGELENGTH %.11g ;\n", diagLength);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingArea(double area)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   AREA %.11g ;\n", area);
-    else
-        fprintf(lefwFile, "   AREA %.11g ;\n", area);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinsize(int     numRect,
-                        double  *minWidth,
-                        double  *minLength)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   MINSIZE ");
-        for (i = 0; i < numRect; i++)
-            encPrint(lefwFile, (char*) "%.11g %.11g ", minWidth[i], minLength[i]);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   MINSIZE ");
-        for (i = 0; i < numRect; i++)
-            fprintf(lefwFile, "%.11g %.11g ", minWidth[i], minLength[i]);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinimumcut(double   numCuts,
-                           double   minWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINIMUMCUT %.11g WIDTH %.11g ", numCuts,
-                 minWidth);
-    else
-        fprintf(lefwFile, "   MINIMUMCUT %.11g WIDTH %.11g ", numCuts, minWidth);
-    lefwLines++;
-    prtSemiColon = 1;
-    lefwIsRoutingMinCut = 1;
-    lefwIsRoutingMinCutDist = 0;
-    lefwIsRoutingMinCutLen = 0;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingMinimumcutWithin(double numCuts,
-                                 double minWidth,
-                                 double cutDistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINIMUMCUT %.11g WIDTH %.11g WITHIN %.11g ",
-                 numCuts, minWidth, cutDistance);
-    else
-        fprintf(lefwFile, "   MINIMUMCUT %.11g WIDTH %.11g WITHIN %.11g ",
-                numCuts, minWidth, cutDistance);
-    lefwLines++;
-    prtSemiColon = 1;
-    lefwIsRoutingMinCut = 1;
-    lefwIsRoutingMinCutDist = 0;
-    lefwIsRoutingMinCutLen = 0;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinimumcutConnections(const char *direction)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsRoutingMinCut || lefwIsRoutingMinCutDist)
-        return LEFW_BAD_ORDER;
-    // lefwLayerRoutingMinimumcut has not being called or
-    // lefwLayerRoutingMinimumcutConnections has already called
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n     %s ", direction);
-    else
-        fprintf(lefwFile, "\n     %s ", direction);
-    lefwLines++;
-    prtSemiColon = 1;
-    lefwIsRoutingMinCutDist = 1;
-    if (lefwIsRoutingMinCutLen)   // both distance & length within has defined
-        lefwIsRoutingMinCut = 0;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinimumcutLengthWithin(double   length,
-                                       double   distance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsRoutingMinCut || lefwIsRoutingMinCutLen)
-        return LEFW_BAD_ORDER;
-    // lefwLayerRoutingMinimumcut has not being called or
-    // lefwLayerRoutingMinimumcutLengthWithin has already called
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "     LENGTH %.11g WITHIN %.11g ",
-                 length, distance);
-    else
-        fprintf(lefwFile, "     LENGTH %.11g WITHIN %.11g ", length, distance);
-    lefwLines++;
-    prtSemiColon = 1;
-    lefwIsRoutingMinCutLen = 1;
-    if (lefwIsRoutingMinCutDist)   // both distance & length within has defined
-        lefwIsRoutingMinCut = 0;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacing(double spacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   SPACING %.11g ", spacing);
-    else
-        fprintf(lefwFile, "   SPACING %.11g ", spacing);
-    lefwLines++;
-    lefwHasLayerRoutingRange = 0; // initialization
-    lefwHasLayerRoutingSpacing = 1; // initialization
-    lefwHasLayerRoutingEol = 0; // initialization
-    prtNewLine = 1;
-    prtSemiColon = 1;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingRange(double leftRange,
-                             double rightRange)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingSpacing)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", leftRange, rightRange);
-    else
-        fprintf(lefwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-    lefwHasLayerRoutingRange = 1; // initialization
-    lefwLines++;
-    prtNewLine = 1;
-    prtSemiColon = 1;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingRangeUseLengthThreshold()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingRange) {
-        // This routine can be called only if range are non zero
-        fprintf(lefwFile,
-                "ERROR (LEFWRIT-4003): lefwLayerRoutingSpacingUseLengthThreshold cannot be called if\n");
-        fprintf(lefwFile,
-                "       lefwLayerRoutingSpacingRange has not been called.\n");
-        return LEFW_BAD_DATA;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n     USELENGTHTHRESHOLD ");
-    else
-        fprintf(lefwFile, "\n     USELENGTHTHRESHOLD ");
-    prtSemiColon = 1;
-    prtNewLine = 1;
-    lefwHasLayerRoutingRange = 0; // reset to 0
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingRangeInfluence(double    infValue,
-                                      double    subMinWidth,
-                                      double    subMaxWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingRange) {
-        // This routine can be called only if range are non zero
-        fprintf(lefwFile,
-                "ERROR (LEFWRIT-4004): lefwLayerRoutingSpacingInfluence cannot be called if\n");
-        fprintf(lefwFile,
-                "       lefRange and rightRange in lefwLayerRoutingSpacing are both zero.\n");
-        return LEFW_BAD_DATA;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n     INFLUENCE %.11g ", infValue);
-        if (subMinWidth || subMaxWidth)
-            encPrint(lefwFile, (char*) "RANGE %.11g %.11g ",
-                     subMinWidth, subMaxWidth);
-    } else {
-        fprintf(lefwFile, "\n     INFLUENCE %.11g ", infValue);
-        if (subMinWidth || subMaxWidth)
-            fprintf(lefwFile, (char*) "RANGE %.11g %.11g ",
-                    subMinWidth, subMaxWidth);
-    }
-    prtNewLine = 1;
-    prtSemiColon = 1;
-    lefwHasLayerRoutingRange = 0; // reset to 0
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingRangeRange(double    minWidth,
-                                  double    maxWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingRange) {
-        // This routine can be called only if range are non zero
-        fprintf(lefwFile,
-                "ERROR (LEFWRIT-4005): lefwLayerRoutingSpacingInfluence cannot be called if\n");
-        fprintf(lefwFile,
-                "       lefRange and rightRange in lefwLayerRoutingSpacing are both zero.\n");
-        return LEFW_BAD_DATA;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", minWidth, maxWidth);
-    } else {
-        fprintf(lefwFile, (char*) "RANGE %.11g %.11g ", minWidth, maxWidth);
-    }
-    prtNewLine = 1;
-    prtSemiColon = 1;
-    lefwHasLayerRoutingRange = 0; // reset to 0
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingLengthThreshold(double   lengthValue,
-                                       double   minWidth,
-                                       double   maxWidth)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingSpacing)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   LENGTHTHRESHOLD %.11g ", lengthValue);
-        if (minWidth || maxWidth) {
-            encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", minWidth, maxWidth);
-        }
-    } else {
-        fprintf(lefwFile, "   LENGTHTHRESHOLD %.11g ", lengthValue);
-        if (minWidth || maxWidth) {
-            fprintf(lefwFile, "RANGE %.11g %.11g ", minWidth, maxWidth);
-        }
-    }
-    prtSemiColon = 1;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingSpacingSameNet(int PGOnly)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!lefwHasLayerRoutingSpacing)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        if (PGOnly)
-            encPrint(lefwFile, (char*) "   SAMENET PGONLY ");
-        else
-            encPrint(lefwFile, (char*) "   SAMENET ");
-    } else {
-        if (PGOnly)
-            fprintf(lefwFile, "   SAMENET PGONLY ");
-        else
-            fprintf(lefwFile, "   SAMENET ");
-    }
-    prtSemiColon = 1;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingSpacingEndOfLine(double eolWidth,
-                                 double eolWithin)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (lefwHasLayerRoutingEol)
-        return LEFW_BAD_DATA;// already defined in Spacing
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ENDOFLINE %.11g WITHIN %.11g ", eolWidth,
-                 eolWithin);
-    else
-        fprintf(lefwFile, "   ENDOFLINE %.11g WITHIN %.11g ", eolWidth,
-                eolWithin);
-    lefwLines++;
-    lefwHasLayerRoutingEol = 1;
-    prtSemiColon = 1;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingSpacingEOLParallel(double   parSpace,
-                                   double   parWithin,
-                                   int      twoEdges)
-{
-    if (!lefwHasLayerRoutingEol)
-        return LEFW_BAD_DATA;// EndOfLine in not defined
-    if (lefwWriteEncrypt) {
-        if (twoEdges)
-            encPrint(lefwFile, (char*) "PARALLELEDGE %.11g WITHIN %.11g TWOEDGES ;\n",
-                     parSpace, parWithin);
-        else
-            encPrint(lefwFile, (char*) "PARALLELEDGE %.11g WITHIN %.11g ;\n",
-                     parSpace, parWithin);
-    } else {
-        if (twoEdges)
-            fprintf(lefwFile, "PARALLELEDGE %.11g WITHIN %.11g TWOEDGES ;\n",
-                    parSpace, parWithin);
-        else
-            fprintf(lefwFile, "PARALLELEDGE %.11g WITHIN %.11g ;\n",
-                    parSpace, parWithin);
-    }
-    lefwLines++;
-    lefwHasLayerRoutingEol = 0;
-    prtSemiColon = 0;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingSpacingNotchLength(double minNLength)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   NOTCHLENGTH %.11g ;\n", minNLength);
-    else
-        fprintf(lefwFile, "   NOTCHLENGTH %.11g ;\n", minNLength);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingSpacingEndOfNotchWidth(double   eonWidth,
-                                       double   minNSpacing,
-                                       double   minNLength)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ENDOFNOTCHWIDTH %.11g NOTCHSPACING %.11g NOTCHLENGTH %.11g ;\n",
-                 eonWidth, minNSpacing, minNLength);
-    else
-        fprintf(lefwFile, "    ENDOFNOTCHWIDTH %.11g NOTCHSPACING %.11g NOTCHLENGTH %.11g ;\n",
-                eonWidth, minNSpacing, minNLength);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingWireExtension(double wireExtension)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   WIREEXTENSION %.11g ;\n", wireExtension);
-    else
-        fprintf(lefwFile, "   WIREEXTENSION %.11g ;\n", wireExtension);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingResistance(const char *resistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (!resistance || resistance == 0 || *resistance == 0)
-        return LEFW_BAD_DATA;
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   RESISTANCE RPERSQ %s ;\n", resistance);
-    else
-        fprintf(lefwFile, "   RESISTANCE RPERSQ %s ;\n", resistance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingCapacitance(const char *capacitance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (!capacitance || capacitance == 0 || *capacitance == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   CAPACITANCE CPERSQDIST %s ;\n", capacitance);
-    else
-        fprintf(lefwFile, "   CAPACITANCE CPERSQDIST %s ;\n", capacitance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingHeight(double height)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   HEIGHT %.11g ;\n", height);
-    else
-        fprintf(lefwFile, "   HEIGHT %.11g ;\n", height);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingThickness(double thickness)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   THICKNESS %.11g ;\n", thickness);
-    else
-        fprintf(lefwFile, "   THICKNESS %.11g ;\n", thickness);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingShrinkage(double shrinkage)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   SHRINKAGE %.11g ;\n", shrinkage);
-    else
-        fprintf(lefwFile, "   SHRINKAGE %.11g ;\n", shrinkage);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingCapMultiplier(double capMultiplier)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   CAPMULTIPLIER %.11g ;\n", capMultiplier);
-    else
-        fprintf(lefwFile, "   CAPMULTIPLIER %.11g ;\n", capMultiplier);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingEdgeCap(double edgeCap)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   EDGECAPACITANCE %.11g ;\n", edgeCap);
-    else
-        fprintf(lefwFile, "   EDGECAPACITANCE %.11g ;\n", edgeCap);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingAntennaArea(double antennaArea)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNAAREAFACTOR %.11g ;\n", antennaArea);
-    else
-        fprintf(lefwFile, "   ANTENNAAREAFACTOR %.11g ;\n", antennaArea);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingAntennaLength(double antennaLength)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNALENGTHFACTOR %.11g ;\n",
-                 antennaLength);
-    else
-        fprintf(lefwFile, "   ANTENNALENGTHFACTOR %.11g ;\n", antennaLength);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMaxwidth(double width)
-{
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MAXWIDTH %.11g ;\n", width);
-    else
-        fprintf(lefwFile, "   MAXWIDTH %.11g ;\n", width);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinwidth(double width)
-{
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINWIDTH %.11g ;\n", width);
-    else
-        fprintf(lefwFile, "   MINWIDTH %.11g ;\n", width);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinenclosedarea(int     numMinenclosed,
-                                double  *area,
-                                double  *width)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt) {
-        for (i = 0; i < numMinenclosed; i++) {
-            encPrint(lefwFile, (char*) "   MINENCLOSEDAREA %.11g ", area[i]);
-            if (width[i] != 0)
-                encPrint(lefwFile, (char*) "WIDTH %.11g ", width[i]);
-            encPrint(lefwFile, (char*) ";\n");
-        }
-    } else {
-        for (i = 0; i < numMinenclosed; i++) {
-            fprintf(lefwFile, "   MINENCLOSEDAREA %.11g ", area[i]);
-            if (width[i] != 0)
-                fprintf(lefwFile, "WIDTH %.11g ", width[i]);
-            fprintf(lefwFile, ";\n");
-        }
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinstep(double distance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINSTEP %.11g ;\n", distance);
-    else
-        fprintf(lefwFile, "   MINSTEP %.11g ;\n", distance);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingMinstepWithOptions(double       distance,
-                                   const char   *rule,
-                                   double       maxLength)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINSTEP %.11g ", distance);
-    else
-        fprintf(lefwFile, "   MINSTEP %.11g ", distance);
-    if (rule && ((strcmp(rule, "INSIDECORNER") == 0) ||
-                 (strcmp(rule, "OUTSIDECORNER") == 0) || (strcmp(rule, "STEP") == 0))) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "%s ", rule);
-        else
-            fprintf(lefwFile, "%s ", rule);
-    }
-    if (maxLength) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "LENGTHSUM %.11g ", maxLength);
-        else
-            fprintf(lefwFile, "LENGTHSUM %.11g ", maxLength);
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) ";\n");
-    else
-        fprintf(lefwFile, ";\n");
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerRoutingMinstepMaxEdges(double  distance,
-                                double  maxEdges)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINSTEP %.11g MAXEDGES %.11g ;\n", distance,
-                 maxEdges);
-    else
-        fprintf(lefwFile, "   MINSTEP %.11g MAXEDGES %.11g ;\n", distance,
-                maxEdges);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingProtrusion(double   width1,
-                           double   length,
-                           double   width2)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;  // only routing calls this func
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PROTRUSIONWIDTH %.11g LENGTH %.11g WIDTH %.11g ;\n",
-                 width1, length, width2);
-    else
-        fprintf(lefwFile, "   PROTRUSIONWIDTH %.11g LENGTH %.11g WIDTH %.11g ;\n",
-                width1, length, width2);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingStartSpacingtableParallel(int       numLength,
-                                          double    *length)
-{
-    int i;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRoutingReqData) {
-        return LEFW_BAD_ORDER;
-    }
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SPACINGTABLE\n");
-        encPrint(lefwFile, (char*) "     PARALLELRUNLENGTH");
-        for (i = 0; i < numLength; i++)
-            encPrint(lefwFile, (char*) " %.11g", length[i]);
-    } else {
-        fprintf(lefwFile, "   SPACINGTABLE\n");
-        fprintf(lefwFile, "     PARALLELRUNLENGTH");
-        for (i = 0; i < numLength; i++)
-            fprintf(lefwFile, " %.11g", length[i]);
-    }
-    lefwState = LEFW_LAYERROUTING_SP_START;
-    lefwLines += 2;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingtableParallelWidth(double    width,
-                                          int       numSpacing,
-                                          double    *spacing)
-{
-    int i;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_SP_START &&
-        lefwState != LEFW_LAYERROUTINGWIDTH)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n       WIDTH %.11g", width);
-        for (i = 0; i < numSpacing; i++)
-            encPrint(lefwFile, (char*) " %.11g", spacing[i]);
-    } else {
-        fprintf(lefwFile, "\n       WIDTH %.11g", width);
-        for (i = 0; i < numSpacing; i++)
-            fprintf(lefwFile, " %.11g", spacing[i]);
-    }
-    lefwState = LEFW_LAYERROUTINGWIDTH;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingStartSpacingtableInfluence()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRoutingReqData) {
-        return LEFW_BAD_ORDER;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SPACINGTABLE\n");
-        encPrint(lefwFile, (char*) "     INFLUENCE");
-    } else {
-        fprintf(lefwFile, "   SPACINGTABLE\n");
-        fprintf(lefwFile, "     INFLUENCE");
-    }
-    lefwState = LEFW_LAYERROUTINGWIDTH;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingInfluenceWidth(double    width,
-                                      double    distance,
-                                      double    spacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTINGWIDTH)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile,
-                 (char*) "\n       WIDTH %.11g WITHIN %.11%.11gSPACING %.11g",
-                 width, distance, spacing);
-    else
-        fprintf(lefwFile, "\n       WIDTH %.11g WITHIN %.11g SPACING %.11g", width,
-                distance, spacing);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingStartSpacingtableTwoWidths()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRoutingReqData) {
-        return LEFW_BAD_ORDER;
-    }
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SPACINGTABLE\n");
-        encPrint(lefwFile, (char*) "     TWOWIDTHS");
-    } else {
-        fprintf(lefwFile, "   SPACINGTABLE\n");
-        fprintf(lefwFile, "     TWOWIDTHS");
-    }
-    lefwState = LEFW_LAYERROUTINGWIDTH;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutingSpacingtableTwoWidthsWidth(double   width,
-                                           double   runLength,
-                                           int      numSpacing,
-                                           double   *spacing)
-{
-    int i;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_SP_START &&
-        lefwState != LEFW_LAYERROUTINGWIDTH)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "\n       WIDTH %.11g", width);
-        if (runLength)
-            encPrint(lefwFile, (char*) " PRL %.11g", runLength);
-        for (i = 0; i < numSpacing; i++)
-            encPrint(lefwFile, (char*) " %.11g", spacing[i]);
-    } else {
-        fprintf(lefwFile, "\n       WIDTH %.11g", width);
-        if (runLength)
-            fprintf(lefwFile, " PRL %.11g", runLength);
-        for (i = 0; i < numSpacing; i++)
-            fprintf(lefwFile, " %.11g", spacing[i]);
-    }
-    lefwState = LEFW_LAYERROUTINGWIDTH;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerRoutineEndSpacingtable()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTINGWIDTH)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) " ;\n");
-    else
-        fprintf(lefwFile, " ;\n");
-
-    lefwLines++;
-    lefwState = LEFW_LAYERROUTING;
-    return LEFW_OK;
-}
-
-int
-lefwEndLayerRouting(const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START &&
-        lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRoutingReqData) {
-        return LEFW_BAD_ORDER;
-    }
-    if (prtSemiColon) {
-        // the previous statement hasn't written the ; yet
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) ";\n");
-        else
-            fprintf(lefwFile, ";\n");
-        prtSemiColon = 0;
-    }
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", layerName);
-    else
-        fprintf(lefwFile, "END %s\n\n", layerName);
-
-    lefwLines++;
-    lefwSynArray[LEFW_LAYERROUTING] = 0;
-    lefwState = LEFW_LAYERROUTING_END;
-    lefwIsRouting = 0;
-    return LEFW_OK;
-}
-
-int
-lefwLayerACCurrentDensity(const char    *type,
-                          double        value)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (strcmp(type, "PEAK") && strcmp(type, "AVERAGE") && strcmp(type, "RMS"))
-        return LEFW_BAD_DATA;  // type is PEAK, AVERAGE & RMS only
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ACCURRENTDENSITY %s", type);
-        lefwLines++;
-        lefwTableLen = 5;
-        if (value)
-            encPrint(lefwFile, (char*) " %.11g ;\n", value);
-            // that's it for accurrentdensity
-        else {
-            encPrint(lefwFile, (char*) "\n");
-            // expect to have frequency & tableentries
-            lefwOldState = lefwState;   // save the previous state
-            lefwState = LEFW_LAYERACCURRENT;
-        }
-    } else {
-        fprintf(lefwFile, "   ACCURRENTDENSITY %s", type);
-        lefwLines++;
-        lefwTableLen = 5;
-        if (value)
-            fprintf(lefwFile, " %.11g ;\n", value); // that's it for accurrentdensity
-        else {
-            fprintf(lefwFile, "\n");  //  expect to have frequency & tableentries
-            lefwOldState = lefwState;  // save the previous state
-            lefwState = LEFW_LAYERACCURRENT;
-        }
-    }
-    return LEFW_OK;
-}
-
-int
-lefwLayerACFrequency(int    numFrequency,
-                     double *frequency)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERACCURRENT)
-        return LEFW_BAD_ORDER;
-
-    if (numFrequency <= 0)
-        return LEFW_BAD_DATA;  // frequency are required
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      FREQUENCY ");
-        for (i = 0; i < numFrequency; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *frequency++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      FREQUENCY ");
-        for (i = 0; i < numFrequency; i++) {
-            fprintf(lefwFile, "%.11g ", *frequency++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerACWidth(int    numWidths,
-                 double *widths)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERACCURRENT)
-        return LEFW_BAD_ORDER;
-
-    if (numWidths <= 0)
-        return LEFW_OK;  // width is optional
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      WIDTH ");
-        for (i = 0; i < numWidths; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *widths++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      WIDTH ");
-        for (i = 0; i < numWidths; i++) {
-            fprintf(lefwFile, "%.11g ", *widths++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwTableLen = numWidths;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerACCutarea(int      numCutareas,
-                   double   *cutareas)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERACCURRENT)
-        return LEFW_BAD_ORDER;
-
-    if (numCutareas <= 0)
-        return LEFW_OK;  // cutarea is optional
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      CUTAREA ");
-        for (i = 0; i < numCutareas; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *cutareas++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      CUTAREA ");
-        for (i = 0; i < numCutareas; i++) {
-            fprintf(lefwFile, "%.11g ", *cutareas++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwTableLen = numCutareas;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerACTableEntries(int     numEntries,
-                        double  *entries)
-{
-    int i;
-    int j = 0;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERACCURRENT)
-        return LEFW_BAD_ORDER;
-
-    if (numEntries <= 0)
-        return LEFW_BAD_DATA;  // tableEntries are required
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      TABLEENTRIES\n        ");
-        for (i = 0; i < numEntries; i++) {
-            if (++j > lefwTableLen) {
-                encPrint(lefwFile, (char*) "\n        ");
-                j = 1;
-            }
-            encPrint(lefwFile, (char*) "%.11g ", *entries++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      TABLEENTRIES\n        ");
-        for (i = 0; i < numEntries; i++) {
-            if (++j > lefwTableLen) {
-                fprintf(lefwFile, "\n        ");
-                j = 1;
-            }
-            fprintf(lefwFile, "%.11g ", *entries++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwState = lefwOldState;   // restore the previous state
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerDCCurrentDensity(const char    *type,
-                          double        value)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (strcmp(type, "AVERAGE"))
-        return LEFW_BAD_DATA;  // type is AVERAGE
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   DCCURRENTDENSITY %s", type);
-        lefwLines++;
-        lefwTableLen = 5;
-        if (value)
-            encPrint(lefwFile, (char*) " %.11g ;\n", value);
-            // that's it for accurrentdensity
-        else {
-            encPrint(lefwFile, (char*) "\n");
-            // expect to have frequency & tableentries
-            lefwOldState = lefwState;   // save the previous state
-            lefwState = LEFW_LAYERDCCURRENT;
-        }
-    } else {
-        fprintf(lefwFile, "   DCCURRENTDENSITY %s", type);
-        lefwLines++;
-        lefwTableLen = 5;
-        if (value)
-            fprintf(lefwFile, " %.11g ;\n", value); // that's it for accurrentdensity
-        else {
-            fprintf(lefwFile, "\n");    // expect to have frequency & tableentries
-            lefwOldState = lefwState;   // save the previous state
-            lefwState = LEFW_LAYERDCCURRENT;
-        }
-    }
-    return LEFW_OK;
-}
-
-int
-lefwLayerDCWidth(int    numWidths,
-                 double *widths)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERDCCURRENT)
-        return LEFW_BAD_ORDER;
-
-    // width is allowed in Layer routing only
-    if (lefwOldState != LEFW_LAYER_START && lefwOldState != LEFW_LAYER &&
-        lefwOldState != LEFW_LAYERROUTING_START &&
-        lefwOldState != LEFW_LAYERROUTING)
-        return LEFW_BAD_DATA;
-
-    if (numWidths <= 0)
-        return LEFW_BAD_DATA;  // width is required
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      WIDTH ");
-        for (i = 0; i < numWidths; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *widths++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      WIDTH ");
-        for (i = 0; i < numWidths; i++) {
-            fprintf(lefwFile, "%.11g ", *widths++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwTableLen = numWidths;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerDCCutarea(int      numCutareas,
-                   double   *cutareas)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERDCCURRENT)
-        return LEFW_BAD_ORDER;
-
-    // cutarea is allowed in Layer non-routing only
-    if (lefwOldState != LEFW_LAYER_START && lefwOldState != LEFW_LAYER &&
-        lefwOldState != LEFW_LAYERROUTING_START &&
-        lefwOldState != LEFW_LAYERROUTING)
-        return LEFW_BAD_DATA;
-
-    if (numCutareas <= 0)
-        return LEFW_BAD_DATA;  // cutarea is required
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      CUTAREA ");
-        for (i = 0; i < numCutareas; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *cutareas++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      CUTAREA ");
-        for (i = 0; i < numCutareas; i++) {
-            fprintf(lefwFile, "%.11g ", *cutareas++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwTableLen = numCutareas;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerDCTableEntries(int     numEntries,
-                        double  *entries)
-{
-    int i;
-    int j = 0;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERDCCURRENT)
-        return LEFW_BAD_ORDER;
-
-    if (numEntries <= 0)
-        return LEFW_BAD_DATA;  // tableEntries are required
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      TABLEENTRIES\n        ");
-        for (i = 0; i < numEntries; i++) {
-            if (++j > lefwTableLen) {
-                encPrint(lefwFile, (char*) "\n        ");
-                j = 1;
-            }
-            encPrint(lefwFile, (char*) "%.11g ", *entries++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      TABLEENTRIES\n        ");
-        for (i = 0; i < numEntries; i++) {
-            if (++j > lefwTableLen) {
-                fprintf(lefwFile, "\n        ");
-                j = 1;
-            }
-            fprintf(lefwFile, "%.11g ", *entries++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwState = lefwOldState;   // restore the previous state
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaModel(const char *oxide)
-{
-    lefw54Num = LEFW_ANTENNAMODEL;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNAMODEL %s ;\n", oxide);
-    else
-        fprintf(lefwFile, "   ANTENNAMODEL %s ;\n", oxide);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNAAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNAAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNAAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaDiffAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNADIFFAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNADIFFAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNADIFFAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaDiffAreaRatioPwl(int    numPwls,
-                                 double *diffusions,
-                                 double *ratios)
-{
-    int i;
-
-    lefw54Num = LEFW_ANTENNADIFFAREARATIOPWL;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNADIFFAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            encPrint(lefwFile, (char*) "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        encPrint(lefwFile, (char*) ") ;\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNADIFFAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            fprintf(lefwFile, "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        fprintf(lefwFile, ") ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaCumAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNACUMAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNACUMAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNACUMAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaCumDiffAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNACUMDIFFAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNACUMDIFFAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNACUMDIFFAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaCumDiffAreaRatioPwl(int     numPwls,
-                                    double  *diffusions,
-                                    double  *ratios)
-{
-    int i;
-
-    lefw54Num = LEFW_ANTENNACUMDIFFAREARATIOPWL;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNACUMDIFFAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            encPrint(lefwFile, (char*) "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        encPrint(lefwFile, (char*) ") ;\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNACUMDIFFAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            fprintf(lefwFile, "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        fprintf(lefwFile, ") ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaAreaFactor(double       value,
-                           const char   *diffUseOnly)
-{
-    lefw54Num = LEFW_ANTENNAAREAFACTOR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    if ((versionNum < 5.4) &&
-        (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0))
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNAAREAFACTOR %.11g ", value);
-        if (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0)
-            encPrint(lefwFile, (char*) "   DIFFUSEONLY ");
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNAAREAFACTOR %.11g ", value);
-        if (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0)
-            fprintf(lefwFile, "DIFFUSEONLY ");
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaSideAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNASIDEAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNASIDEAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNASIDEAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaDiffSideAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNADIFFSIDEAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNADIFFSIDEAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNADIFFSIDEAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaDiffSideAreaRatioPwl(int    numPwls,
-                                     double *diffusions,
-                                     double *ratios)
-{
-    int i;
-
-    lefw54Num = LEFW_ANTENNADIFFSIDEAREARATIOPWL;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNADIFFSIDEAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            encPrint(lefwFile, (char*) "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        encPrint(lefwFile, (char*) ") ;\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNADIFFSIDEAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            fprintf(lefwFile, "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        fprintf(lefwFile, ") ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaCumSideAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNACUMSIDEAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNACUMSIDEAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNACUMSIDEAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 11/25/2002 - bug fix: submitted by Craig Files (cfiles@ftc.agilent.com)
-// Renamed from lefwLayerAntennaCumSideDiffAreaRatio to match
-// the header  
-int
-lefwLayerAntennaCumDiffSideAreaRatio(double value)
-{
-    lefw54Num = LEFW_ANTENNACUMDIFFSIDEAREARATIO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNACUMDIFFSIDEAREARATIO %.11g ;\n", value);
-    else
-        fprintf(lefwFile, "   ANTENNACUMDIFFSIDEAREARATIO %.11g ;\n", value);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaCumDiffSideAreaRatioPwl(int     numPwls,
-                                        double  *diffusions,
-                                        double  *ratios)
-{
-    int i;
-
-    lefw54Num = LEFW_ANTENNACUMDIFFSIDEAREARATIOPWL;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing or cut calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNACUMDIFFSIDEAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            encPrint(lefwFile, (char*) "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        encPrint(lefwFile, (char*) ") ;\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNACUMDIFFSIDEAREARATIO PWL ( ");
-        for (i = 0; i < numPwls; i++)
-            fprintf(lefwFile, "( %.11g %.11g ) ", *diffusions++, *ratios++);
-        fprintf(lefwFile, ") ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwLayerAntennaSideAreaFactor(double       value,
-                               const char   *diffUseOnly)
-{
-    lefw54Num = LEFW_ANTENNASIDEAREAFACTOR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING)
-        return LEFW_BAD_ORDER;
-    // only routing calls this func
-    if (!lefwIsRouting)
-        return LEFW_BAD_DATA;
-    if ((versionNum < 5.4) &&
-        (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0))
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNASIDEAREAFACTOR %.11g ", value);
-        if (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0)
-            encPrint(lefwFile, (char*) "   DIFFUSEONLY ");
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNASIDEAREAFACTOR %.11g ", value);
-        if (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0)
-            fprintf(lefwFile, "DIFFUSEONLY ");
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerAntennaCumRoutingPlusCut()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING &&
-        lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    /* WANDA
-      if ((versionNum < 5.4) &&
-          (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0))
-         return LEFW_WRONG_VERSION;
-    */
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNACUMROUTINGPLUSCUT ;\n");
-    else {
-        fprintf(lefwFile, "   ANTENNACUMROUTINGPLUSCUT ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerAntennaGatePlusDiff(double plusDiffFactor)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING &&
-        lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    /* WANDA
-      if ((versionNum < 5.4) &&
-          (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0))
-         return LEFW_WRONG_VERSION;
-    */
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNAGATEPLUSDIFF %.11g ;\n",
-                 plusDiffFactor);
-    else {
-        fprintf(lefwFile, "   ANTENNAGATEPLUSDIFF %.11g ;\n", plusDiffFactor);
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerAntennaAreaMinusDiff(double minusDiffFactor)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING &&
-        lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    /* WANDA
-      if ((versionNum < 5.4) &&
-          (diffUseOnly && strcmp(diffUseOnly, "DIFFUSEONLY") == 0))
-         return LEFW_WRONG_VERSION;
-    */
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ANTENNAAREAMINUSDIFF %.11g ;\n",
-                 minusDiffFactor);
-    else {
-        fprintf(lefwFile, "   ANTENNAAREAMINUSDIFF %.11g ;\n", minusDiffFactor);
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// 5.7
-int
-lefwLayerAntennaAreaDiffReducePwl(int       numPwls,
-                                  double    *diffAreas,
-                                  double    *metalDiffFactors)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_LAYERROUTING_START && lefwState != LEFW_LAYERROUTING
-        && lefwState != LEFW_LAYER_START && lefwState != LEFW_LAYER)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsRouting && !lefwIsCut)
-        return LEFW_BAD_DATA;
-    /* WANDA
-      if (versionNum < 5.4)
-         return LEFW_WRONG_VERSION;
-    */
-    if (numPwls < 2)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   ANTENNAAREADIFFREDUCEPWL ( ");
-        for (i = 0; i < numPwls; i++)
-            encPrint(lefwFile, (char*) "( %.11g %.11g ) ", *diffAreas++,
-                     *metalDiffFactors++);
-        encPrint(lefwFile, (char*) ") ;\n");
-    } else {
-        fprintf(lefwFile, "   ANTENNAAREADIFFREDUCEPWL ( ");
-        for (i = 0; i < numPwls; i++)
-            fprintf(lefwFile, "( %.11g %.11g ) ", *diffAreas++,
-                    *metalDiffFactors++);
-        fprintf(lefwFile, ") ;\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwMinimumDensity(double minDensity)
-{
-    lefw54Num = LEFW_MINIMUMDENSITY;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINIMUMDENSITY %.11g ;\n", minDensity);
-    else
-        fprintf(lefwFile, "   MINIMUMDENSITY %.11g ;\n", minDensity);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwMaximumDensity(double maxDensity)
-{
-    lefw54Num = LEFW_MAXIMUMDENSITY;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MAXIMUMDENSITY %.11g ;\n", maxDensity);
-    else
-        fprintf(lefwFile, "   MAXIMUMDENSITY %.11g ;\n", maxDensity);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwDensityCheckWindow(double   checkWindowLength,
-                       double   checkWindowWidth)
-{
-    lefw54Num = LEFW_DENSITYCHECKWINDOW;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DENSITYCHECKWINDOW %.11g %.11g ;\n",
-                 checkWindowLength, checkWindowWidth);
-    else
-        fprintf(lefwFile, "   DENSITYCHECKWINDOW %.11g %.11g ;\n",
-                checkWindowLength, checkWindowWidth);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwDensityCheckStep(double checkStepValue)
-{
-    lefw54Num = LEFW_DENSITYCHECKSTEP;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DENSITYCHECKSTEP %.11g ;\n",
-                 checkStepValue);
-    else
-        fprintf(lefwFile, "   DENSITYCHECKSTEP %.11g ;\n", checkStepValue);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwFillActiveSpacing(double fillToActiveSpacing)
-{
-    lefw54Num = LEFW_FILLACTIVESPACING;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   FILLACTIVESPACING %.11g ;\n",
-                 fillToActiveSpacing);
-    else
-        fprintf(lefwFile, "   FILLACTIVESPACING %.11g ;\n", fillToActiveSpacing);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwMaxviastack(int         value,
-                const char  *bottomLayer,
-                const char  *topLayer)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwIsMaxviastack)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "MAXVIASTACK %d ", value);
-        if (bottomLayer)
-            encPrint(lefwFile, (char*) "RANGE %s %s ;\n", bottomLayer, topLayer);
-        else
-            encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "MAXVIASTACK %d ", value);
-        if (bottomLayer)
-            fprintf(lefwFile, "RANGE %s %s ;\n", bottomLayer, topLayer);
-        else
-            fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwStartPropDef()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwSynArray[LEFW_PROPERTYDEF_START])
-        return LEFW_ALREADY_DEFINED;
-    lefwSynArray[LEFW_ANTENNASIZE] = 1;
-    if (lefwState == LEFW_PROPERTYDEF_START ||
-        lefwState == LEFW_PROPERTYDEF)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "PROPERTYDEFINITIONS\n");
-    else
-        fprintf(lefwFile, "PROPERTYDEFINITIONS\n");
-
-    lefwLines++;
-    lefwState = LEFW_PROPERTYDEF_START;
-    lefwSynArray[LEFW_PROPERTYDEF_START] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwIntPropDef(const char   *objType,
-               const char   *propName,
-               double       leftRange,
-               double       rightRange,    // optional 
-               int          propValue                        // optional 
-               )
-{
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_PROPERTYDEF_START &&
-        lefwState != LEFW_PROPERTYDEF)
-        return LEFW_BAD_ORDER;
-    /*
-      if ((! objType && ! *objType) || (! propName && ! *propName))
-    */
-    if (((objType == 0) || (*objType == 0)) || ((propName == 0) || (*propName == 0)))
-        return LEFW_BAD_DATA;
-
-    if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") &&
-        strcmp(objType, "MACRO") && strcmp(objType, "PIN") &&
-        strcmp(objType, "LAYER") && strcmp(objType, "NONDEFAULTRULE") &&
-        strcmp(objType, "VIARULE"))
-        return LEFW_BAD_DATA;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   %s %s INTEGER ", objType, propName);
-        if (leftRange || rightRange)
-            encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            encPrint(lefwFile, (char*) "%d ", propValue);
-
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   %s %s INTEGER ", objType, propName);
-        if (leftRange || rightRange)
-            fprintf(lefwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            fprintf(lefwFile, "%d ", propValue);
-
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_PROPERTYDEF;
-    return LEFW_OK;
-}
-
-
-int
-lefwRealPropDef(const char  *objType,
-                const char  *propName,
-                double      leftRange,
-                double      rightRange,    // optional 
-                double      propValue                        // optional 
-                )
-{
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_PROPERTYDEF_START &&
-        lefwState != LEFW_PROPERTYDEF)
-        return LEFW_BAD_ORDER;
-    if (((objType == 0) || (*objType == 0)) || ((propName == 0) || (*propName == 0))) // require
-        return LEFW_BAD_DATA;
-
-    if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") &&
-        strcmp(objType, "MACRO") && strcmp(objType, "PIN") &&
-        strcmp(objType, "LAYER") && strcmp(objType, "NONDEFAULTRULE") &&
-        strcmp(objType, "VIARULE"))
-        return LEFW_BAD_DATA;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   %s %s REAL ", objType, propName);
-        if (leftRange || rightRange)
-            encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            encPrint(lefwFile, (char*) "%.11g ", propValue);
-
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   %s %s REAL ", objType, propName);
-        if (leftRange || rightRange)
-            fprintf(lefwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            fprintf(lefwFile, "%.11g ", propValue);
-
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_PROPERTYDEF;
-    return LEFW_OK;
-}
-
-
-int
-lefwStringPropDef(const char    *objType,
-                  const char    *propName,
-                  double        leftRange,
-                  double        rightRange,    // optional 
-                  const char    *propValue                   // optional 
-                  )
-{
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_PROPERTYDEF_START &&
-        lefwState != LEFW_PROPERTYDEF)
-        return LEFW_BAD_ORDER;
-    if (((objType == 0) || (*objType == 0)) || ((propName == 0) || (*propName == 0)))
-        return LEFW_BAD_DATA;
-
-    if (strcmp(objType, "LIBRARY") && strcmp(objType, "VIA") &&
-        strcmp(objType, "MACRO") && strcmp(objType, "PIN") &&
-        strcmp(objType, "LAYER") && strcmp(objType, "NONDEFAULTRULE") &&
-        strcmp(objType, "VIARULE"))
-        return LEFW_BAD_DATA;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   %s %s STRING ", objType, propName);
-        if (leftRange || rightRange)
-            encPrint(lefwFile, (char*) "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            encPrint(lefwFile, (char*) "\"%s\" ", propValue);  // string, set quotes
-
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   %s %s STRING ", objType, propName);
-        if (leftRange || rightRange)
-            fprintf(lefwFile, "RANGE %.11g %.11g ", leftRange, rightRange);
-
-        if (propValue)
-            fprintf(lefwFile, "\"%s\" ", propValue);  // string, set quotes
-
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_PROPERTYDEF;
-    return LEFW_OK;
-}
-
-
-int
-lefwEndPropDef()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_PROPERTYDEF_START &&
-        lefwState != LEFW_PROPERTYDEF)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END PROPERTYDEFINITIONS\n\n");
-    else
-        fprintf(lefwFile, "END PROPERTYDEFINITIONS\n\n");
-    lefwLines++;
-    lefwState = LEFW_PROPERTYDEF_END;
-    return LEFW_OK;
-}
-
-
-int
-lefwEnd()
-{
-    if (!lefwFile)
-        return 1;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END LIBRARY\n");
-    else
-        fprintf(lefwFile, "END LIBRARY\n");
-    lefwLines++;
-    // lefwFile = 0;
-    lefwState = LEFW_DONE;
-    return LEFW_OK;
-}
-
-int
-lefwStartVia(const char *viaName,
-             const char *isDefault)
-{   // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_VIA_START ||
-        lefwState == LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END &&
-        (!lefwIsNonDefaultRule))  // via defined in nondefaultrule 
-        return LEFW_BAD_ORDER;  // not of the ENDs
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "VIA %s ", viaName);
-        if (isDefault && strcmp(isDefault, "DEFAULT") == 0)
-            encPrint(lefwFile, (char*) "DEFAULT");
-        encPrint(lefwFile, (char*) "\n");
-    } else {
-        fprintf(lefwFile, "VIA %s ", viaName);
-        if (isDefault && strcmp(isDefault, "DEFAULT") == 0)
-            fprintf(lefwFile, "DEFAULT");
-        fprintf(lefwFile, "\n");
-    }
-    lefwLines++;
-
-    lefwSynArray[LEFW_VIA_START] = 1;
-    lefwState = LEFW_VIA_START;
-    lefwDidLayer = 0;           // hasn't set the layer yet
-    lefwViaHasVal = 0;
-    return LEFW_OK;
-}
-
-int
-lefwViaTopofstackonly()
-{
-    lefwObsoleteNum = LEFW_VIATOPOFSTACKONLY;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START &&
-        lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   TOPOFSTACKONLY\n");
-    else
-        fprintf(lefwFile, "   TOPOFSTACKONLY\n");
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwViaForeign(const char   *foreignName,
-               double       xl,          // optional 
-               double       yl,          // optional 
-               int          orient)
-{        // optional 
-    lefwObsoleteNum = LEFW_VIAFOREIGN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START &&
-        lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   FOREIGN %s ", foreignName);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) { // assume user has 0 0 for pt 
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   FOREIGN %s ", foreignName);
-        if (xl || yl) {
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                fprintf(lefwFile, "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) { // assume user has 0 0 for pt 
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", lefwOrient(orient));
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    return LEFW_OK;
-}
-
-int
-lefwViaForeignStr(const char    *foreignName,
-                  double        xl,            // optional 
-                  double        yl,            // optional 
-                  const char    *orient)
-{  // optional 
-    lefwObsoleteNum = LEFW_VIAFOREIGN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START &&
-        lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   FOREIGN %s ", foreignName);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                encPrint(lefwFile, (char*) "%s ", orient);
-        } else if (orient && *orient != '\0') { // assume user has 0 0 for pt 
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", orient);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   FOREIGN %s ", foreignName);
-        if (xl || yl) {
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                fprintf(lefwFile, "%s ", orient);
-        } else if (orient && *orient != '\0') { // assume user has 0 0 for pt 
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", orient);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    return LEFW_OK;
-}
-
-int
-lefwViaResistance(double resistance)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-
-    if (lefwViaHasVal)
-        return LEFW_ALREADY_DEFINED;  // either Resistance or
-    // ViaRule has defined
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   RESISTANCE %.11g ;\n", resistance);
-    else
-        fprintf(lefwFile, "   RESISTANCE %.11g ;\n", resistance);
-
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    lefwViaHasVal = 1;
-    return LEFW_OK;
-}
-
-int
-lefwViaLayer(const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   LAYER %s ;\n", layerName);
-    else
-        fprintf(lefwFile, "   LAYER %s ;\n", layerName);
-
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    lefwDidLayer = 1;
-    return LEFW_OK;
-}
-
-int
-lefwViaLayerRect(double x1l,
-                 double y1l,
-                 double x2l,
-                 double y2l,
-                 int    mask)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (!lefwDidLayer)
-        return LEFW_BAD_ORDER;
-
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (mask) {
-            encPrint(lefwFile,
-                     (char*) "      RECT MASK %d %.11g %.11g %.11g %.11g ;\n", mask, x1l, y1l, x2l, y2l);
-        } else {
-            encPrint(lefwFile,
-                     (char*) "      RECT %.11g %.11g %.11g %.11g ;\n", x1l, y1l, x2l, y2l);
-        }
-    } else {
-        if (mask) {
-            fprintf(lefwFile, "      RECT MASK %d %.11g %.11g %.11g %.11g ;\n", mask, x1l, y1l, x2l, y2l);
-        } else {
-            fprintf(lefwFile, "      RECT %.11g %.11g %.11g %.11g ;\n", x1l, y1l, x2l, y2l);
-        }
-    }
-
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    return LEFW_OK;
-}
-
-int
-lefwViaLayerPolygon(int     num_polys,
-                    double  *xl,
-                    double  *yl,
-                    int     mask)
-{
-    int i;
-    int polyCount;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (!lefwDidLayer)
-        return LEFW_BAD_ORDER;
-    if (num_polys < 4)
-        return LEFW_BAD_DATA;
-
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (mask) {
-            encPrint(lefwFile, (char*) "      POLYGON MASK %d ", mask);
-        } else {
-            encPrint(lefwFile, (char*) "      POLYGON ");
-        }
-        polyCount = 0;
-        for (i = 0; i < num_polys; i++) {
-            if (i == 0)
-                encPrint(lefwFile, (char*) "%.11g %.11g ", *xl++, *yl++);
-            else {
-                if ((i % 5) == 0) {
-                    encPrint(lefwFile, (char*) "\n              %.11g %.11g",
-                             *xl++, *yl++);
-                    lefwLines++;
-                } else
-                    encPrint(lefwFile, (char*) "%.11g %.11g ", *xl++, *yl++);
-            }
-        }
-        encPrint(lefwFile, (char*) " ;\n");
-    } else {
-        if (mask) {
-            fprintf(lefwFile, "      POLYGON MASK %d ", mask);
-        } else {
-            fprintf(lefwFile, "      POLYGON ");
-        }
-        polyCount = 0;
-        for (i = 0; i < num_polys; i++) {
-            if (i == 0)
-                fprintf(lefwFile, "%.11g %.11g", *xl++, *yl++);
-            else {
-                if ((i % 5) == 0) {
-                    fprintf(lefwFile, "\n              %.11g %.11g", *xl++, *yl++);
-                    lefwLines++;
-                } else
-                    fprintf(lefwFile, "%.11g %.11g ", *xl++, *yl++);
-            }
-        }
-        fprintf(lefwFile, " ;\n");
-    }
-    lefwLines++;
-    lefwState = LEFW_VIA;
-    return LEFW_OK;
-}
-
-int
-lefwViaViarule(const char   *viaRuleName,
-               double       xCutSize,
-               double       yCutSize,
-               const char   *botMetalLayer,
-               const char   *cutLayer,
-               const char   *topMetalLayer,
-               double       xCutSpacing,
-               double       yCutSpacing,
-               double       xBotEnc,
-               double       yBotEnc,
-               double       xTopEnc,
-               double       yTopEnc)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-
-    if (lefwViaHasVal)
-        return LEFW_ALREADY_DEFINED;  // either Resistance or
-    // ViaRule has defined
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   VIARULE %s ;\n", viaRuleName);
-        encPrint(lefwFile, (char*) "     CUTSIZE %.11g %.11g ;\n",
-                 xCutSize, yCutSize);
-        encPrint(lefwFile, (char*) "     LAYERS %s %s %s ;\n", botMetalLayer,
-                 cutLayer, topMetalLayer);
-        encPrint(lefwFile, (char*) "     CUTSPACING %.11g %.11g ;\n",
-                 xCutSpacing, yCutSpacing);
-        encPrint(lefwFile, (char*) "     ENCLOSURE %.11g %.11g %.11g %.11g ;\n",
-                 xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-    } else {
-        fprintf(lefwFile, "   VIARULE %s ;\n", viaRuleName);
-        fprintf(lefwFile, "     CUTSIZE %.11g %.11g ;\n", xCutSize, yCutSize);
-        fprintf(lefwFile, "     LAYERS %s %s %s ;\n", botMetalLayer,
-                cutLayer, topMetalLayer);
-        fprintf(lefwFile, "     CUTSPACING %.11g %.11g ;\n",
-                xCutSpacing, yCutSpacing);
-        fprintf(lefwFile, "     ENCLOSURE %.11g %.11g %.11g %.11g ;\n",
-                xBotEnc, yBotEnc, xTopEnc, yTopEnc);
-    }
-    lefwLines++;
-    lefwState = LEFW_VIAVIARULE;
-    lefwViaHasVal = 1;
-    return LEFW_OK;
-}
-
-int
-lefwViaViaruleRowCol(int    numCutRows,
-                     int    numCutCols)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIAVIARULE)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "     ROWCOL %d %d ;\n", numCutRows, numCutCols);
-    else
-        fprintf(lefwFile, "     ROWCOL %d %d ;\n", numCutRows, numCutCols);
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwViaViaruleOrigin(double xOffset,
-                     double yOffset)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIAVIARULE)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "     ORIGIN %.11g %.11g ;\n", xOffset, yOffset);
-    else
-        fprintf(lefwFile, "     ORIGIN %.11g %.11g ;\n", xOffset, yOffset);
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwViaViaruleOffset(double xBotOffset,
-                     double yBotOffset,
-                     double xTopOffset,
-                     double yTopOffset)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIAVIARULE)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "     OFFSET %.11g %.11g %.11g %.11g ;\n",
-                 xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-    else
-        fprintf(lefwFile, "     OFFSET %.11g %.11g %.11g %.11g ;\n",
-                xBotOffset, yBotOffset, xTopOffset, yTopOffset);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwViaViarulePattern(const char *cutPattern)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIAVIARULE)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "     PATTERN %s ;\n", cutPattern);
-    else
-        fprintf(lefwFile, "     PATTERN %s ;\n", cutPattern);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwStringProperty(const char   *propName,
-                   const char   *propValue)
-{
-    if ((lefwState != LEFW_VIA) && (lefwState != LEFW_LAYER) &&
-        (lefwState != LEFW_VIARULE) && (lefwState != LEFW_MACRO_START) &&
-        (lefwState != LEFW_MACRO) && (lefwState != LEFW_VIA_START) &&
-        (lefwState != LEFW_VIARULE_START) && (lefwState != LEFW_LAYER_START) &&
-        (lefwState != LEFW_BEGINEXT) && (lefwState != LEFW_VIAVIARULE) &&
-        (lefwState != LEFW_LAYERROUTING_START) &&
-        (lefwState != LEFW_LAYERROUTING))
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile,
-                 (char*) "   PROPERTY %s \"%s\" ;\n", propName, propValue);
-    else
-        fprintf(lefwFile, "   PROPERTY %s \"%s\" ;\n", propName, propValue);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwRealProperty(const char *propName,
-                 double     propValue)
-{
-    if ((lefwState != LEFW_VIA) && (lefwState != LEFW_LAYER) &&
-        (lefwState != LEFW_VIARULE) && (lefwState != LEFW_MACRO_START) &&
-        (lefwState != LEFW_MACRO) && (lefwState != LEFW_VIA_START) &&
-        (lefwState != LEFW_VIARULE_START) && (lefwState != LEFW_LAYER_START) &&
-        (lefwState != LEFW_BEGINEXT) && (lefwState != LEFW_VIAVIARULE))
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PROPERTY %s %.11g ;\n", propName, propValue);
-    else
-        fprintf(lefwFile, "   PROPERTY %s %.11g ;\n", propName, propValue);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwIntProperty(const char  *propName,
-                int         propValue)
-{
-    if ((lefwState != LEFW_VIA) && (lefwState != LEFW_LAYER) &&
-        (lefwState != LEFW_VIARULE) && (lefwState != LEFW_MACRO_START) &&
-        (lefwState != LEFW_MACRO) && (lefwState != LEFW_VIA_START) &&
-        (lefwState != LEFW_VIARULE_START) && (lefwState != LEFW_LAYER_START) &&
-        (lefwState != LEFW_BEGINEXT) && (lefwState != LEFW_VIAVIARULE))
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PROPERTY %s %d ;\n", propName, propValue);
-    else
-        fprintf(lefwFile, "   PROPERTY %s %d ;\n", propName, propValue);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwEndVia(const char *viaName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START && lefwState != LEFW_VIA &&
-        lefwState != LEFW_VIAVIARULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", viaName);
-    else
-        fprintf(lefwFile, "END %s\n\n", viaName);
-
-    lefwLines++;
-    lefwState = LEFW_VIA_END;
-    lefwDidLayer = 0;
-    return LEFW_OK;
-}
-
-// internal function
-int
-lefwViaRulePrtLayer(const char  *layerName,
-                    const char  *direction,
-                    double      minWidth,
-                    double      maxWidth,
-                    double      overhang,
-                    double      metalOverhang)
-{
-    lefwObsoleteNum = LEFW_VIARULEGENERATE;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   LAYER %s ;\n", layerName);
-    else
-        fprintf(lefwFile, "   LAYER %s ;\n", layerName);
-    if (direction && strcmp(direction, "HORIZONTAL") &&
-        strcmp(direction, "VERTICAL"))
-        return LEFW_BAD_DATA;
-    if (versionNum >= 5.6 && (direction || overhang || metalOverhang))
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt) {
-        if (direction) {
-            encPrint(lefwFile, (char*) "      DIRECTION %s ;\n", direction);
-            lefwLines = lefwLines + 2;
-        } else
-            lefwLines++;
-        if (minWidth || maxWidth) {
-            encPrint(lefwFile, (char*) "      WIDTH %.11g TO %.11g ;\n",
-                     minWidth, maxWidth);
-            lefwLines++;
-        }
-        if (overhang) {
-            encPrint(lefwFile, (char*) "      OVERHANG %.11g ;\n", overhang);
-            lefwLines++;
-        }
-        if (metalOverhang) {
-            encPrint(lefwFile, (char*) "      METALOVERHANG %.11g ;\n",
-                     metalOverhang);
-            lefwLines++;
-        }
-    } else {
-        if (direction) {
-            fprintf(lefwFile, "      DIRECTION %s ;\n", direction);
-            lefwLines = lefwLines + 2;
-        } else
-            lefwLines++;
-        if (minWidth || maxWidth) {
-            fprintf(lefwFile, "      WIDTH %.11g TO %.11g ;\n",
-                    minWidth, maxWidth);
-            lefwLines++;
-        }
-        if (overhang) {
-            fprintf(lefwFile, "      OVERHANG %.11g ;\n", overhang);
-            lefwLines++;
-        }
-        if (metalOverhang) {
-            fprintf(lefwFile, "      METALOVERHANG %.11g ;\n", metalOverhang);
-            lefwLines++;
-        }
-    }
-    return LEFW_OK;
-}
-
-int
-lefwStartViaRule(const char *viaRuleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_VIARULE_START ||
-        lefwState == LEFW_VIARULE)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-
-    if (!viaRuleName || viaRuleName == 0 || *viaRuleName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "VIARULE %s\n", viaRuleName);
-    else
-        fprintf(lefwFile, "VIARULE %s\n", viaRuleName);
-    lefwLines++;
-
-    lefwSynArray[LEFW_VIARULE_START] = 1;
-    lefwState = LEFW_VIARULE_START;
-    lefwDidLayer = 0;           // hasn't set the layer yet
-    lefwNumViaRuleLayers = 0;
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleLayer(const char *layerName,
-                 const char *direction,
-                 double     minWidth,
-                 double     maxWidth,        // optional 
-                 double     overhang,
-                 double     metalOverhang)
-{ // optional 
-    int status;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULE_START &&
-        lefwState != LEFW_VIARULE)
-        return LEFW_BAD_ORDER;
-    if (lefwNumViaRuleLayers >= 2)
-        return LEFW_BAD_ORDER;
-    if ((status = lefwViaRulePrtLayer(layerName, direction, minWidth, maxWidth,
-                                      overhang, metalOverhang)) != LEFW_OK)
-        return status;
-    lefwNumViaRuleLayers++;
-    lefwState = LEFW_VIARULE;
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleVia(const char *viaName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULE)
-        return LEFW_BAD_ORDER;
-    if (lefwNumViaRuleLayers != 2)   // this routine has to be after two layers
-        return LEFW_BAD_ORDER;      // be written
-    if (!viaName || !*viaName)      // viaName is required
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      VIA %s ;\n", viaName);
-    else
-        fprintf(lefwFile, "      VIA %s ;\n", viaName);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwEndViaRule(const char *viaRuleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIARULE_START &&
-        lefwState != LEFW_VIARULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", viaRuleName);
-    else
-        fprintf(lefwFile, "END %s\n\n", viaRuleName);
-
-    lefwLines++;
-    lefwState = LEFW_VIARULE_END;
-    lefwDidLayer = 0;
-    lefwNumViaRuleLayers = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartViaRuleGen(const char *viaRuleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_VIARULEGEN_START ||
-        lefwState == LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-
-    if (!viaRuleName || viaRuleName == 0 || *viaRuleName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "VIARULE %s GENERATE", viaRuleName);
-    else
-        fprintf(lefwFile, "VIARULE %s GENERATE", viaRuleName);
-    lefwLines++;
-
-    lefwSynArray[LEFW_VIARULEGEN_START] = 1;
-    lefwState = LEFW_VIARULEGEN_START;
-    lefwDidLayer = 0;           // hasn't set the layer yet
-    lefwNumViaRuleLayers = 0;
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleGenDefault()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULEGEN_START &&
-        lefwState != LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) " DEFAULT");
-    else
-        fprintf(lefwFile, " DEFAULT");
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleGenLayer(const char  *layerName,
-                    const char  *direction,
-                    double      minWidth,
-                    double      maxWidth,        // optional 
-                    double      overhang,
-                    double      metalOverhang)
-{ // optional 
-    int status;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULEGEN_START &&
-        lefwState != LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwNumViaRuleLayers >= 2)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)                // add a new line since, lefwViaRuleGen
-        encPrint(lefwFile, (char*) "\n");  // & lefwViaRuleGenDefault do not
-    else
-        fprintf(lefwFile, "\n");
-    if ((status = lefwViaRulePrtLayer(layerName, direction, minWidth, maxWidth,
-                                      overhang, metalOverhang)) != LEFW_OK)
-        return status;
-    lefwNumViaRuleLayers++;
-    lefwState = LEFW_VIARULEGEN;
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleGenLayerEnclosure(const char *layerName,
-                             double     overhang1,
-                             double     overhang2,
-                             double     minWidth,
-                             double     maxWidth)
-{       // optional 
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULEGEN_START &&
-        lefwState != LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwNumViaRuleLayers >= 2)
-        return LEFW_BAD_ORDER;
-
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n   LAYER %s ;\n", layerName);
-    else
-        fprintf(lefwFile, "\n   LAYER %s ;\n", layerName);
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ENCLOSURE %.11g %.11g ;\n", overhang1,
-                 overhang2);
-        lefwLines = lefwLines + 2;
-        if (minWidth || maxWidth) {
-            encPrint(lefwFile, (char*) "      WIDTH %.11g TO %.11g ;\n", minWidth,
-                     maxWidth);
-            lefwLines++;
-        }
-    } else {
-        fprintf(lefwFile, "      ENCLOSURE %.11g %.11g ;\n", overhang1, overhang2);
-        lefwLines = lefwLines + 2;
-        if (minWidth || maxWidth) {
-            fprintf(lefwFile, "      WIDTH %.11g TO %.11g ;\n", minWidth, maxWidth);
-            lefwLines++;
-        }
-    }
-
-    lefwNumViaRuleLayers++;
-    lefwState = LEFW_VIARULEGEN;
-    return LEFW_OK;
-}
-
-int
-lefwViaRuleGenLayer3(const char *layerName,
-                     double     xl,
-                     double     yl,
-                     double     xh,
-                     double     yh,
-                     double     xSpacing,
-                     double     ySpacing,
-                     double     resistance)
-{    // optional 
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwNumViaRuleLayers != 2)   // this routine has to be after two layers
-        return LEFW_BAD_ORDER;      // be written
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   LAYER %s ;\n", layerName);
-        encPrint(lefwFile,
-                 (char*) "      RECT %.11g %.11g %.11g %.11g ;\n", xl, yl, xh, yh);
-        encPrint(lefwFile,
-                 (char*) "      SPACING %.11g BY %.11g ;\n", xSpacing, ySpacing);
-        if (resistance) {
-            encPrint(lefwFile, (char*) "      RESISTANCE %.11g ;\n", resistance);
-            lefwLines++;
-        }
-    } else {
-        fprintf(lefwFile, "   LAYER %s ;\n", layerName);
-        fprintf(lefwFile, "      RECT %.11g %.11g %.11g %.11g ;\n",
-                xl, yl, xh, yh);
-        fprintf(lefwFile, "      SPACING %.11g BY %.11g ;\n", xSpacing, ySpacing);
-        if (resistance) {
-            fprintf(lefwFile, "      RESISTANCE %.11g ;\n", resistance);
-            lefwLines++;
-        }
-    }
-    lefwLines += 3;
-    return LEFW_OK;
-}
-
-int
-lefwEndViaRuleGen(const char *viaRuleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIARULEGEN_START &&
-        lefwState != LEFW_VIARULEGEN)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", viaRuleName);
-    else
-        fprintf(lefwFile, "END %s\n\n", viaRuleName);
-
-    lefwLines++;
-    lefwState = LEFW_VIARULEGEN_END;
-    lefwDidLayer = 0;
-    lefwNumViaRuleLayers = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartNonDefaultRule(const char *ruleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_NONDEFAULTRULE_START ||
-        lefwState == LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-
-    if (!ruleName || ruleName == 0 || *ruleName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "NONDEFAULTRULE %s\n", ruleName);
-    else
-        fprintf(lefwFile, "NONDEFAULTRULE %s\n", ruleName);
-    lefwLines++;
-
-    lefwSynArray[LEFW_NONDEFAULTRULE_START] = 1;
-    lefwState = LEFW_NONDEFAULTRULE_START;
-    lefwDidLayer = 0;           // hasn't set the layer yet
-    lefwIsNonDefaultRule = 1;
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleHardspacing()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   HARDSPACING ;\n");
-    else
-        fprintf(lefwFile, "   HARDSPACING ;\n");
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleStartVia(const char   *viaName,
-                           const char   *isDefault)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_VIA_START || lefwState == LEFW_VIA ||
-        (lefwState != LEFW_NONDEFAULTRULE_START &&
-         lefwState != LEFW_NONDEFAULTRULE))
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   VIA %s ", viaName);
-        if (isDefault && strcmp(isDefault, "DEFAULT") == 0)
-            encPrint(lefwFile, (char*) "DEFAULT");
-        encPrint(lefwFile, (char*) "\n");
-    } else {
-        fprintf(lefwFile, "   VIA %s ", viaName);
-        if (isDefault && strcmp(isDefault, "DEFAULT") == 0)
-            fprintf(lefwFile, "DEFAULT");
-        fprintf(lefwFile, "\n");
-    }
-    lefwLines++;
-    lefwViaHasVal = 0;
-
-    lefwSynArray[LEFW_VIA_START] = 1;
-    lefwState = LEFW_VIA_START;
-    lefwDidLayer = 0;           // hasn't set the layer yet
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleEndVia(const char *viaName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_VIA_START &&
-        lefwState != LEFW_VIA)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END %s\n\n", viaName);
-    else
-        fprintf(lefwFile, "   END %s\n\n", viaName);
-
-    lefwLines++;
-    lefwState = LEFW_NONDEFAULTRULE;
-    lefwDidLayer = 0;
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleUseVia(const char *viaName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   USEVIA %s ;\n", viaName);
-    else
-        fprintf(lefwFile, "   USEVIA %s ;\n", viaName);
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleUseViaRule(const char *viaRuleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   USEVIARULE %s ;\n", viaRuleName);
-    else
-        fprintf(lefwFile, "   USEVIARULE %s ;\n", viaRuleName);
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleMinCuts(const char    *layerName,
-                          int           numCuts)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   MINCUTS %s %d ;\n", layerName, numCuts);
-    else
-        fprintf(lefwFile, "   MINCUTS %s %d ;\n", layerName, numCuts);
-    return LEFW_OK;
-}
-
-int
-lefwNonDefaultRuleLayer(const char  *routingLayerName,
-                        double      width,
-                        double      minSpacing,
-                        double      wireExtension,
-                        double      resist,
-                        double      capacitance,
-                        double      edgeCap)
-{
-    lefwObsoleteNum = LEFW_NONDEFAULTRULELAYER;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE)
-        return LEFW_BAD_ORDER;
-    if (!routingLayerName || routingLayerName == 0 || *routingLayerName == 0)
-        return LEFW_BAD_DATA;
-    if (versionNum >= 5.6 && (resist || capacitance || edgeCap))
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   LAYER %s\n", routingLayerName);
-        encPrint(lefwFile, (char*) "      WIDTH %.11g ;\n", width);
-        encPrint(lefwFile, (char*) "      SPACING %.11g ;\n", minSpacing);
-        if (wireExtension) {
-            encPrint(lefwFile,
-                     (char*) "      WIREEXTENSION %.11g ;\n", wireExtension);
-            lefwLines++;
-        }
-        if (resist) {
-            encPrint(lefwFile, (char*) "      RESISTANCE RPERSQ %.11g ;\n", resist);
-            lefwLines++;
-        }
-        if (capacitance) {
-            encPrint(lefwFile, (char*) "      CAPACITANCE CPERSQDIST %.11g ;\n",
-                     capacitance);
-            lefwLines++;
-        }
-        if (edgeCap) {
-            encPrint(lefwFile, (char*) "      EDGECAPACITANCE %.11g ;\n", edgeCap);
-            lefwLines++;
-        }
-        encPrint(lefwFile, (char*) "   END %s\n\n", routingLayerName);
-    } else {
-        fprintf(lefwFile, "   LAYER %s\n", routingLayerName);
-        fprintf(lefwFile, "      WIDTH %.11g ;\n", width);
-        fprintf(lefwFile, "      SPACING %.11g ;\n", minSpacing);
-        if (wireExtension) {
-            fprintf(lefwFile, "      WIREEXTENSION %.11g ;\n", wireExtension);
-            lefwLines++;
-        }
-        if (resist) {
-            fprintf(lefwFile, "      RESISTANCE RPERSQ %.11g ;\n", resist);
-            lefwLines++;
-        }
-        if (capacitance) {
-            fprintf(lefwFile,
-                    "      CAPACITANCE CPERSQDIST %.11g ;\n", capacitance);
-            lefwLines++;
-        }
-        if (edgeCap) {
-            fprintf(lefwFile, "      EDGECAPACITANCE %.11g ;\n", edgeCap);
-            lefwLines++;
-        }
-        fprintf(lefwFile, "   END %s\n\n", routingLayerName);
-    }
-
-    lefwLines = lefwLines + 4;
-    lefwSynArray[LEFW_NONDEFAULTRULE] = 1;
-    lefwState = LEFW_NONDEFAULTRULE;
-    return LEFW_OK;
-}
-
-int
-lefwEndNonDefaultRule(const char *ruleName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_NONDEFAULTRULE_START &&
-        lefwState != LEFW_NONDEFAULTRULE &&
-        lefwState != LEFW_VIA_END && lefwState != LEFW_SPACING_END)
-        return LEFW_BAD_ORDER;
-    // can be right after a via or spacing defined in nondefaultrule 
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", ruleName);
-    else
-        fprintf(lefwFile, "END %s\n\n", ruleName);
-
-    lefwLines++;
-    lefwState = LEFW_NONDEFAULTRULE_END;
-    lefwDidLayer = 0;
-    lefwIsNonDefaultRule = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartSpacing()
-{
-    lefwObsoleteNum = LEFW_SPACING;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_SPACING_START ||
-        lefwState == LEFW_SPACING)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END &&
-        (!lefwIsNonDefaultRule))  // spacing defined in nondefaultrule
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "SPACING\n");
-    else
-        fprintf(lefwFile, "SPACING\n");
-
-    lefwLines++;
-    lefwState = LEFW_SPACING_START;
-    return LEFW_OK;
-}
-
-int
-lefwSpacing(const char  *layerName1,
-            const char  *layerName2,
-            double      minSpace,
-            const char  *stack)
-{  // optioanl 
-    lefwObsoleteNum = LEFW_SPACING;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_SPACING_START &&
-        lefwState != LEFW_SPACING)
-        return LEFW_BAD_ORDER;
-    if (!layerName1 || layerName1 == 0 || *layerName1 == 0)
-        return LEFW_BAD_DATA;
-    if (!layerName2 || layerName2 == 0 || *layerName2 == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SAMENET %s %s %.11g ",
-                 layerName1, layerName2, minSpace);
-        if (stack && strcmp(stack, "STACK") == 0)
-            encPrint(lefwFile, (char*) "STACK ");
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   SAMENET %s %s %.11g ", layerName1, layerName2,
-                minSpace);
-        if (stack && strcmp(stack, "STACK") == 0)
-            fprintf(lefwFile, "STACK ");
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_SPACING;
-    return LEFW_OK;
-}
-
-int
-lefwEndSpacing()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_SPACING_START &&
-        lefwState != LEFW_SPACING)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END SPACING\n\n");
-    else
-        fprintf(lefwFile, "END SPACING\n\n");
-
-    lefwLines++;
-    lefwState = LEFW_SPACING_END;
-    return LEFW_OK;
-}
-
-int
-lefwUniversalNoiseMargin(double high,
-                         double low)
-{
-    lefwObsoleteNum = LEFW_NOISEMARGIN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_NOISEMARGIN])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile,
-                 (char*) "UNIVERSALNOISEMARGIN %.11g %.11g ;\n", high, low);
-    else
-        fprintf(lefwFile, "UNIVERSALNOISEMARGIN %.11g %.11g ;\n", high, low);
-    lefwSynArray[LEFW_NOISEMARGIN] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwEdgeRateThreshold1(double num)
-{
-    lefwObsoleteNum = LEFW_THRESHOLD1;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_THRESHOLD1])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "EDGERATETHRESHOLD1 %.11g ;\n", num);
-    else
-        fprintf(lefwFile, "EDGERATETHRESHOLD1 %.11g ;\n", num);
-    lefwSynArray[LEFW_THRESHOLD1] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwEdgeRateThreshold2(double num)
-{
-    lefwObsoleteNum = LEFW_THRESHOLD2;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_THRESHOLD2])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "EDGERATETHRESHOLD2 %.11g ;\n", num);
-    else
-        fprintf(lefwFile, "EDGERATETHRESHOLD2 %.11g ;\n", num);
-    lefwSynArray[LEFW_THRESHOLD2] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwEdgeRateScaleFactor(double num)
-{
-    lefwObsoleteNum = LEFW_SCALEFACTOR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_SCALEFACTOR])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "EDGERATESCALEFACTOR %.11g ;\n", num);
-    else
-        fprintf(lefwFile, "EDGERATESCALEFACTOR %.11g ;\n", num);
-    lefwSynArray[LEFW_SCALEFACTOR] = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwStartNoiseTable(int num)
-{
-    lefwObsoleteNum = LEFW_NOISETABLE_START;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_NOISETABLE_START ||
-        lefwState == LEFW_NOISETABLE)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_NOISETABLE_START])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "NOISETABLE %d ;\n", num);
-    else
-        fprintf(lefwFile, "NOISETABLE %d ;\n", num);
-
-    lefwLines++;
-    lefwState = LEFW_NOISETABLE_START;
-    lefwIsNoiseTable = 1;
-    lefwIsEdgerate = 0;
-    lefwSynArray[LEFW_NOISETABLE_START] = 1;
-    return LEFW_OK;
-}
-
-// for both noisetable and correctiontable
-// Obsolete in 5.4
-int
-lefwEdgeRate(double num)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsNoiseTable && !lefwIsCorrectTable)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   EDGERATE %.11g ;\n", num);
-    else
-        fprintf(lefwFile, "   EDGERATE %.11g ;\n", num);
-
-    lefwLines++;
-    if (lefwState == LEFW_NOISETABLE_START)
-        lefwState = LEFW_NOISETABLE;
-    else if (lefwState == LEFW_CORRECTTABLE_START)
-        lefwState = LEFW_CORRECTTABLE;
-    lefwIsEdgerate = 1;
-    lefwIsOutResist = 0;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwOutputResistance(int    numResists,
-                     double *resistance)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsEdgerate)
-        return LEFW_BAD_ORDER;
-    if (lefwIsOutResist)
-        return LEFW_BAD_ORDER;
-
-    if (numResists <= 0)
-        return LEFW_OK;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   OUTPUTRESISTANCE ");
-        for (i = 0; i < numResists; i++) {
-            encPrint(lefwFile, (char*) "%.11g ", *resistance++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   OUTPUTRESISTANCE ");
-        for (i = 0; i < numResists; i++) {
-            fprintf(lefwFile, "%.11g ", *resistance++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwIsOutResist = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwVictims(int     length,
-            int     numNoises,
-            double  *noises)
-{
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsOutResist)
-        return LEFW_BAD_ORDER;
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      VICTIMLENGTH %d ;\n", length);
-        if (numNoises <= 0)
-            return LEFW_BAD_DATA;   // noises are required
-        for (i = 0; i < numNoises; i++) {
-            if (lefwIsNoiseTable)
-                encPrint(lefwFile, (char*) "      VICTIMNOISE ");
-            else
-                encPrint(lefwFile, (char*) "      CORRECTIONFACTOR ");
-            encPrint(lefwFile, (char*) "%.11g ", *noises++);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      VICTIMLENGTH %d ;\n", length);
-        if (numNoises <= 0)
-            return LEFW_BAD_DATA;   // noises are required
-        for (i = 0; i < numNoises; i++) {
-            if (lefwIsNoiseTable)
-                fprintf(lefwFile, "      VICTIMNOISE ");
-            else
-                fprintf(lefwFile, "      CORRECTIONFACTOR ");
-            fprintf(lefwFile, "%.11g ", *noises++);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwEndNoiseTable()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_NOISETABLE_START &&
-        lefwState != LEFW_NOISETABLE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END NOISETABLE\n\n");
-    else
-        fprintf(lefwFile, "END NOISETABLE\n\n");
-    lefwLines++;
-
-    lefwState = LEFW_NOISETABLE_END;
-    lefwIsNoiseTable = 0;
-    lefwIsOutResist = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartCorrectTable(int num)
-{
-    lefwObsoleteNum = LEFW_CORRECTTABLE_START;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_CORRECTTABLE_START ||
-        lefwState == LEFW_CORRECTTABLE)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwSynArray[LEFW_CORRECTTABLE_START])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "CORRECTIONTABLE %d ;\n", num);
-    else
-        fprintf(lefwFile, "CORRECTIONTABLE %d ;\n", num);
-
-    lefwLines++;
-    lefwState = LEFW_CORRECTTABLE_START;
-    lefwIsCorrectTable = 1;
-    lefwIsEdgerate = 0;
-    lefwSynArray[LEFW_CORRECTTABLE_START] = 1;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwEndCorrectTable()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_CORRECTTABLE_START &&
-        lefwState != LEFW_CORRECTTABLE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END CORRECTIONTABLE\n\n");
-    else
-        fprintf(lefwFile, "END CORRECTIONTABLE\n\n");
-    lefwLines++;
-
-    lefwState = LEFW_CORRECTTABLE_END;
-    lefwIsNoiseTable = 0;
-    return LEFW_OK;
-}
-
-int
-lefwMinFeature(double   x,
-               double   y)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_MINFEATURE])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "MINFEATURE %.11g %.11g ;\n", x, y);
-    else
-        fprintf(lefwFile, "MINFEATURE %.11g %.11g ;\n", x, y);
-    lefwSynArray[LEFW_MINFEATURE] = 1;
-    return LEFW_OK;
-}
-
-// *********************
-//  int lefwDielectric (float dielectric) {
-//    if (! lefwFile) return LEFW_UNINITIALIZED;
-//    if (! lefwDidInit) return LEFW_BAD_ORDER;
-//    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-//       return LEFW_BAD_ORDER;
-//    if (lefwSynArray[LEFW_DIELECTRIC]) return LEFW_ALREADY_DEFINED;
-//    fprintf(lefwFile, "DIELECTRIC %.11g ;\n", dielectric);
-//    lefwSynArray[LEFW_DIELECTRIC] = 1;
-//    return LEFW_OK; 
-//  }
-// ********************
-
-int
-lefwStartIrdrop()
-{
-    lefwObsoleteNum = LEFW_IRDROP_START;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_IRDROP_START ||
-        lefwState == LEFW_IRDROP)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_IRDROP_START])
-        return LEFW_ALREADY_DEFINED;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "IRDROP\n");
-    else
-        fprintf(lefwFile, "IRDROP\n");
-
-    lefwLines++;
-    lefwState = LEFW_IRDROP_START;
-    lefwSynArray[LEFW_IRDROP_START] = 1;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwIrdropTable(const char  *tableName,
-                const char  *currentsNvolts)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_IRDROP_START &&
-        lefwState != LEFW_IRDROP)
-        return LEFW_BAD_ORDER;
-    if (!tableName || tableName == 0 || *tableName == 0)
-        return LEFW_BAD_DATA;
-    if (!currentsNvolts || currentsNvolts == 0 || *currentsNvolts == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   TABLE %s %s ;\n", tableName, currentsNvolts);
-    else
-        fprintf(lefwFile, "   TABLE %s %s ;\n", tableName, currentsNvolts);
-    lefwLines++;
-
-    lefwState = LEFW_IRDROP;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwEndIrdrop()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_IRDROP_START &&
-        lefwState != LEFW_IRDROP)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END IRDROP\n\n");
-    else
-        fprintf(lefwFile, "END IRDROP\n\n");
-    lefwLines++;
-
-    lefwState = LEFW_IRDROP_END;
-    return LEFW_OK;
-}
-
-int
-lefwSite(const char *siteName,
-         const char *classType,
-         const char *symmetry,
-         double     width,
-         double     height)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_SITE)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (!siteName || siteName == 0 || *siteName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "SITE %s\n", siteName);
-        if (classType && strcmp(classType, "PAD") && strcmp(classType, "CORE"))
-            return LEFW_BAD_DATA;
-        encPrint(lefwFile, (char*) "   CLASS %s ;\n", classType);
-        if (symmetry)
-            encPrint(lefwFile, (char*) "   SYMMETRY %s ;\n", symmetry);
-        encPrint(lefwFile, (char*) "   SIZE %.11g BY %.11g ;\n", width, height);
-        // encPrint(lefwFile, (char*)"END %s\n\n", siteName);
-    } else {
-        fprintf(lefwFile, "SITE %s\n", siteName);
-        if (classType && strcmp(classType, "PAD") && strcmp(classType, "CORE"))
-            return LEFW_BAD_DATA;
-        fprintf(lefwFile, "   CLASS %s ;\n", classType);
-        if (symmetry)
-            fprintf(lefwFile, "   SYMMETRY %s ;\n", symmetry);
-        fprintf(lefwFile, "   SIZE %.11g BY %.11g ;\n", width, height);
-        // a separate function call, lefwEndSite
-        // fprintf(lefwFile, "END %s\n\n", siteName);
-    }
-
-    lefwLines = lefwLines + 4;
-    lefwSynArray[LEFW_SITE] = 1;
-    lefwState = LEFW_SITE;
-    return LEFW_OK;
-}
-
-int
-lefwSiteRowPattern(const char   *siteName,
-                   int          orient)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_SITE)
-        return LEFW_BAD_ORDER;
-    if (!siteName || siteName == 0 || *siteName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ROWPATTERN %s %s ;\n", siteName,
-                 lefwOrient(orient));
-    else
-        fprintf(lefwFile, "   ROWPATTERN %s %s ;\n", siteName, lefwOrient(orient));
-    lefwLines++;
-    lefwState = LEFW_SITE;
-    return LEFW_OK;
-}
-
-int
-lefwSiteRowPatternStr(const char    *siteName,
-                      const char    *orient)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_SITE)
-        return LEFW_BAD_ORDER;
-    if (!siteName || siteName == 0 || *siteName == 0)
-        return LEFW_BAD_DATA;
-    if (!orient || orient == 0 || *orient == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ROWPATTERN %s %s ;\n", siteName, orient);
-    else
-        fprintf(lefwFile, "   ROWPATTERN %s %s ;\n", siteName, orient);
-    lefwLines++;
-    lefwState = LEFW_SITE;
-    return LEFW_OK;
-}
-
-int
-lefwEndSite(const char *siteName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_SITE)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", siteName);
-    else
-        fprintf(lefwFile, "END %s\n\n", siteName);
-
-    lefwLines++;
-    lefwState = LEFW_SITE_END;
-    return LEFW_OK;
-}
-
-int
-lefwStartArray(const char *arrayName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_ARRAY_START ||
-        lefwState == LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (!arrayName || arrayName == 0 || *arrayName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "ARRAY %s\n", arrayName);
-    else
-        fprintf(lefwFile, "ARRAY %s\n", arrayName);
-
-    lefwLines++;
-    lefwState = LEFW_ARRAY_START;
-    lefwSynArray[LEFW_ARRAY_START] = 1;
-    lefwHasArrayReq = 0;
-    lefwIsArrayFloorp = 0;
-    return LEFW_OK;
-}
-
-int
-lefwArraySite(const char    *name,
-              double        origX,
-              double        origY,
-              int           orient,
-              double        numX,
-              double        numY,
-              double        spaceX,
-              double        spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   SITE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "   SITE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArraySiteStr(const char *name,
-                 double     origX,
-                 double     origY,
-                 const char *orient,
-                 double     numX,
-                 double     numY,
-                 double     spaceX,
-                 double     spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   SITE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, orient, numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "   SITE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, orient, numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArrayCanplace(const char    *name,
-                  double        origX,
-                  double        origY,
-                  int           orient,
-                  double        numX,
-                  double        numY,
-                  double        spaceX,
-                  double        spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   CANPLACE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "   CANPLACE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArrayCanplaceStr(const char *name,
-                     double     origX,
-                     double     origY,
-                     const char *orient,
-                     double     numX,
-                     double     numY,
-                     double     spaceX,
-                     double     spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   CANPLACE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, orient, numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile, "   CANPLACE %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, orient, numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArrayCannotoccupy(const char    *name,
-                      double        origX,
-                      double        origY,
-                      int           orient,
-                      double        numX,
-                      double        numY,
-                      double        spaceX,
-                      double        spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   CANNOTOCCUPY %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "   CANNOTOCCUPY %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, lefwOrient(orient), numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArrayCannotoccupyStr(const char *name,
-                         double     origX,
-                         double     origY,
-                         const char *orient,
-                         double     numX,
-                         double     numY,
-                         double     spaceX,
-                         double     spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "   CANNOTOCCUPY %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                 name, origX, origY, orient, numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "   CANNOTOCCUPY %s %.11g %.11g %s DO %.11g BY %.11g STEP %.11g %.11g ;\n",
-                name, origX, origY, orient, numX, numY, spaceX, spaceY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwArrayTracks(const char  *xy,
-                double      start,
-                int         numTracks,
-                double      space,
-                const char  *layers)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!xy || xy == 0 || *xy == 0)
-        return LEFW_BAD_DATA;
-    if (strcmp(xy, "X") && strcmp(xy, "Y"))
-        return LEFW_BAD_DATA;
-    if (!layers || layers == 0 || *layers == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile,
-                 (char*) "   TRACKS %s %.11g DO %d STEP %.11g LAYER %s ;\n",
-                 xy, start, numTracks, space, layers);
-    else
-        fprintf(lefwFile, "   TRACKS %s %.11g DO %d STEP %.11g LAYER %s ;\n",
-                xy, start, numTracks, space, layers);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwStartArrayFloorplan(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (lefwIsArrayFloorp)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   FLOORPLAN %s\n", name);
-    else
-        fprintf(lefwFile, "   FLOORPLAN %s\n", name);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-    lefwIsArrayFloorp = 1;
-    return LEFW_OK;
-}
-
-int
-lefwArrayFloorplan(const char   *site,
-                   const char   *name,
-                   double       origX,
-                   double       origY,
-                   int          orient,
-                   int          numX,
-                   int          numY,
-                   double       spaceX,
-                   double       spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsArrayFloorp)
-        return LEFW_BAD_ORDER;
-    if (site && strcmp(site, "CANPLACE") && strcmp(site, "CANNOTOCCUPY"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "      %s %s %.11g %.11g %s DO %d BY %d STEP %.11g %.11g ;\n",
-                 site, name, origX, origY, lefwOrient(orient), numX, numY,
-                 spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "      %s %s %.11g %.11g %s DO %d BY %d STEP %.11g %.11g ;\n",
-                site, name, origX, origY, lefwOrient(orient), numX, numY,
-                spaceX, spaceY);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwArrayFloorplanStr(const char    *site,
-                      const char    *name,
-                      double        origX,
-                      double        origY,
-                      const char    *orient,
-                      int           numX,
-                      int           numY,
-                      double        spaceX,
-                      double        spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsArrayFloorp)
-        return LEFW_BAD_ORDER;
-    if (site && strcmp(site, "CANPLACE") && strcmp(site, "CANNOTOCCUPY"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*)
-                 "      %s %s %.11g %.11g %s DO %d BY %d STEP %.11g %.11g ;\n",
-                 site, name, origX, origY, orient, numX, numY, spaceX, spaceY);
-    else
-        fprintf(lefwFile,
-                "      %s %s %.11g %.11g %s DO %d BY %d STEP %.11g %.11g ;\n",
-                site, name, origX, origY, orient, numX, numY, spaceX, spaceY);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwEndArrayFloorplan(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsArrayFloorp)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END %s\n\n", name);
-    else
-        fprintf(lefwFile, "   END %s\n\n", name);
-
-    lefwLines++;
-    lefwIsArrayFloorp = 0;
-    return LEFW_OK;
-}
-
-int
-lefwArrayGcellgrid(const char   *xy,
-                   double       startXY,
-                   int          colRows,
-                   double       spaceXY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!xy || xy == 0 || *xy == 0)
-        return LEFW_BAD_DATA;
-    if (strcmp(xy, "X") && strcmp(xy, "Y"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   GCELLGRID %s %.11g DO %d STEP %.11g ;\n",
-                 xy, startXY, colRows, spaceXY);
-    else
-        fprintf(lefwFile, "   GCELLGRID %s %.11g DO %d STEP %.11g ;\n",
-                xy, startXY, colRows, spaceXY);
-
-    lefwLines++;
-    lefwHasArrayReq = 1;
-
-    lefwState = LEFW_ARRAY;
-    return LEFW_OK;
-}
-
-int
-lefwStartArrayDefaultCap(int size)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (lefwIsArrayDef)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DEFAULTCAP %d\n", size);
-    else
-        fprintf(lefwFile, "   DEFAULTCAP %d\n", size);
-
-    lefwLines++;
-    lefwIsArrayDef = 1;
-    return LEFW_OK;
-}
-
-int
-lefwArrayDefaultCap(double  numPins,
-                    double  cap)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsArrayDef)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      MINPINS %.11g WIRECAP %.11g ;\n",
-                 numPins, cap);
-    else
-        fprintf(lefwFile, "      MINPINS %.11g WIRECAP %.11g ;\n", numPins, cap);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwEndArrayDefaultCap()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwIsArrayDef)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END DEFAULTCAP\n\n");
-    else
-        fprintf(lefwFile, "   END DEFAULTCAP\n\n");
-
-    lefwLines++;
-    lefwIsArrayDef = 0;
-    return LEFW_OK;
-}
-
-int
-lefwEndArray(const char *arrayName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_ARRAY_START &&
-        lefwState != LEFW_ARRAY)
-        return LEFW_BAD_ORDER;
-    if (!arrayName || arrayName == 0 || *arrayName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwIsFloorp || lefwIsArrayDef)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", arrayName);
-    else
-        fprintf(lefwFile, "END %s\n\n", arrayName);
-
-    lefwLines++;
-    lefwState = LEFW_ARRAY_END;
-    return LEFW_OK;
-}
-
-int
-lefwStartMacro(const char *macroName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState == LEFW_MACRO_START ||
-        lefwState == LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!macroName || macroName == 0 || *macroName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "MACRO %s\n", macroName);
-    else
-        fprintf(lefwFile, "MACRO %s\n", macroName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO_START;
-    lefwIsMacroDensity = 0;
-    lefwIsMacroPin = 0;
-    lefwIsMacroObs = 0;
-    lefwIsMacroTiming = 0;
-    return LEFW_OK;
-}
-
-int
-lefwMacroClass(const char   *value1,
-               const char   *value2)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!value1 || value1 == 0 || *value1 == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        if (strcmp(value1, "RING") == 0)
-            encPrint(lefwFile, (char*) "   CLASS %s ;\n", value1);
-        else if (strcmp(value1, "BLOCK") == 0) {
-            if (value2) {
-                if (strcmp(value2, "BLACKBOX") && strcmp(value2, "SOFT"))
-                    return LEFW_BAD_DATA;
-                encPrint(lefwFile, (char*) "   CLASS %s %s ;\n", value1, value2);
-            } else
-                encPrint(lefwFile, (char*) "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "COVER") == 0) {
-            if (value2) {
-                if (strcmp(value2, "BUMP"))
-                    return LEFW_BAD_DATA;
-                encPrint(lefwFile, (char*) "   CLASS %s %s ;\n", value1, value2);
-            } else
-                encPrint(lefwFile, (char*) "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "PAD") == 0) {
-            if (value2) {
-                if (strcmp(value2, "INPUT") && strcmp(value2, "OUTPUT") &&
-                    strcmp(value2, "INOUT") && strcmp(value2, "POWER") &&
-                    strcmp(value2, "SPACER") && strcmp(value2, "AREAIO"))
-                    return LEFW_BAD_DATA;
-                encPrint(lefwFile, (char*) "   CLASS %s %s ;\n", value1, value2);
-            } else
-                encPrint(lefwFile, (char*) "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "CORE") == 0) {
-            if (value2) {
-                if (strcmp(value2, "FEEDTHRU") && strcmp(value2, "TIEHIGH") &&
-                    strcmp(value2, "TIELOW") && strcmp(value2, "SPACER") &&
-                    strcmp(value2, "ANTENNACELL") && strcmp(value2, "WELLTAP"))
-                    return LEFW_BAD_DATA;
-                encPrint(lefwFile, (char*) "   CLASS %s %s ;\n", value1, value2);
-            } else
-                encPrint(lefwFile, (char*) "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "ENDCAP") == 0) {
-            if (value2) {
-                if (strcmp(value2, "PRE") && strcmp(value2, "POST") &&
-                    strcmp(value2, "TOPLEFT") && strcmp(value2, "TOPRIGHT") &&
-                    strcmp(value2, "BOTTOMLEFT") && strcmp(value2, "BOTTOMRIGHT"))
-                    return LEFW_BAD_DATA;
-                encPrint(lefwFile, (char*) "   CLASS %s %s ;\n", value1, value2);
-            } else
-                return LEFW_BAD_DATA;   // require 2nd value
-        } else
-            return LEFW_BAD_DATA;
-    } else {
-        if (strcmp(value1, "RING") == 0)
-            fprintf(lefwFile, "   CLASS %s ;\n", value1);
-        else if (strcmp(value1, "BLOCK") == 0) {
-            if (value2) {
-                if (strcmp(value2, "BLACKBOX") && strcmp(value2, "SOFT"))
-                    return LEFW_BAD_DATA;
-                fprintf(lefwFile, "   CLASS %s %s ;\n", value1, value2);
-            } else
-                fprintf(lefwFile, "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "COVER") == 0) {
-            if (value2) {
-                if (strcmp(value2, "BUMP"))
-                    return LEFW_BAD_DATA;
-                fprintf(lefwFile, "   CLASS %s %s ;\n", value1, value2);
-            } else
-                fprintf(lefwFile, "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "PAD") == 0) {
-            if (value2) {
-                if (strcmp(value2, "INPUT") && strcmp(value2, "OUTPUT") &&
-                    strcmp(value2, "INOUT") && strcmp(value2, "POWER") &&
-                    strcmp(value2, "SPACER") && strcmp(value2, "AREAIO"))
-                    return LEFW_BAD_DATA;
-                fprintf(lefwFile, "   CLASS %s %s ;\n", value1, value2);
-            } else
-                fprintf(lefwFile, "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "CORE") == 0) {
-            if (value2) {
-                if (strcmp(value2, "FEEDTHRU") && strcmp(value2, "TIEHIGH") &&
-                    strcmp(value2, "TIELOW") && strcmp(value2, "SPACER") &&
-                    strcmp(value2, "ANTENNACELL") && strcmp(value2, "WELLTAP"))
-                    return LEFW_BAD_DATA;
-                fprintf(lefwFile, "   CLASS %s %s ;\n", value1, value2);
-            } else
-                fprintf(lefwFile, "   CLASS %s ;\n", value1);
-        } else if (strcmp(value1, "ENDCAP") == 0) {
-            if (value2) {
-                if (strcmp(value2, "PRE") && strcmp(value2, "POST") &&
-                    strcmp(value2, "TOPLEFT") && strcmp(value2, "TOPRIGHT") &&
-                    strcmp(value2, "BOTTOMLEFT") && strcmp(value2, "BOTTOMRIGHT"))
-                    return LEFW_BAD_DATA;
-                fprintf(lefwFile, "   CLASS %s %s ;\n", value1, value2);
-            } else
-                return LEFW_BAD_DATA;   // require 2nd value
-        } else
-            return LEFW_BAD_DATA;
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroFixedMask()
-{
-    if (!lefwFile) {
-        return LEFW_UNINITIALIZED;
-    }
-
-    if (!lefwDidInit) {
-        return LEFW_BAD_ORDER;
-    }
-
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO) {
-        return LEFW_BAD_ORDER;
-    }
-
-    if (versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   FIXEDMASK ;\n");
-    } else {
-        fprintf(lefwFile, "   FIXEDMASK ;\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSource(const char *value1)
-{
-    lefwObsoleteNum = LEFW_MACRO_SOURCE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (!value1 || value1 == 0 || *value1 == 0)
-        return LEFW_BAD_DATA;
-    if (strcmp(value1, "USER") == 0 || strcmp(value1, "GENERATE") == 0 ||
-        strcmp(value1, "BLOCK") == 0)
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "   SOURCE %s ;\n", value1);
-        else
-            fprintf(lefwFile, "   SOURCE %s ;\n", value1);
-    else
-        return LEFW_BAD_DATA;
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroForeign(const char *name,
-                 double     xl,
-                 double     yl,
-                 int        orient)
-{    // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   FOREIGN %s ", name);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) {  // assume user has 0, 0 pt 
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   FOREIGN %s ", name);
-        if (xl || yl) {
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                fprintf(lefwFile, "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) {  // assume user has 0, 0 pt 
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", lefwOrient(orient));
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroForeignStr(const char  *name,
-                    double      xl,
-                    double      yl,
-                    const char  *orient)
-{//optional
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   FOREIGN %s ", name);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                encPrint(lefwFile, (char*) "%s ", orient);
-        } else if (orient && *orient != '\0') {  // assume user has 0, 0 pt 
-            encPrint(lefwFile, (char*) "%.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", orient);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   FOREIGN %s ", name);
-        if (xl || yl) {
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                fprintf(lefwFile, "%s ", orient);
-        } else if (orient && *orient != '\0') {  // assume user has 0, 0 pt 
-            fprintf(lefwFile, "%.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", orient);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroOrigin(double  xl,
-                double  yl)
-{    // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ORIGIN %.11g %.11g ;\n", xl, yl);
-    else
-        fprintf(lefwFile, "   ORIGIN %.11g %.11g ;\n", xl, yl);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroEEQ(const char *macroName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!macroName || macroName == 0 || *macroName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   EEQ %s ;\n", macroName);
-    else
-        fprintf(lefwFile, "   EEQ %s ;\n", macroName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroLEQ(const char *macroName)
-{
-    lefwObsoleteNum = LEFW_MACRO_LEQ;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (!macroName || macroName == 0 || *macroName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   LEQ %s ;\n", macroName);
-    else
-        fprintf(lefwFile, "   LEQ %s ;\n", macroName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSize(double    width,
-              double    height)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   SIZE %.11g BY %.11g ;\n", width, height);
-    else
-        fprintf(lefwFile, "   SIZE %.11g BY %.11g ;\n", width, height);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSymmetry(const char *symmetry)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!symmetry || symmetry == 0 || *symmetry == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   SYMMETRY %s ;\n", symmetry);
-    else
-        fprintf(lefwFile, "   SYMMETRY %s ;\n", symmetry);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSite(const char *siteName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!siteName || siteName == 0 || *siteName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   SITE %s ;\n", siteName);
-    else
-        fprintf(lefwFile, "   SITE %s ;\n", siteName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSitePattern(const char *name,
-                     double     origX,
-                     double     origY,
-                     int        orient,
-                     int        numX,
-                     int        numY,
-                     double     spaceX,
-                     double     spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SITE %s ", name);
-        if (origX || origY || (orient != 1)) {
-            encPrint(lefwFile, (char*) "%.11g %.11g %s ", origX, origY,
-                     lefwOrient(orient));
-            if (numX || numY || spaceX || spaceY)
-                encPrint(lefwFile, (char*) "DO %d BY %d STEP %.11g %.11g ",
-                         numX, numY, spaceX, spaceY);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   SITE %s ", name);
-        if (origX || origY || (orient != 1)) {
-            fprintf(lefwFile, "%.11g %.11g %s ", origX, origY, lefwOrient(orient));
-            if (numX || numY || spaceX || spaceY)
-                fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ",
-                        numX, numY, spaceX, spaceY);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroSitePatternStr(const char  *name,
-                        double      origX,
-                        double      origY,
-                        const char  *orient,
-                        int         numX,
-                        int         numY,
-                        double      spaceX,
-                        double      spaceY)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "   SITE %s ", name);
-        if (origX || origY || orient) {
-            encPrint(lefwFile, (char*) "%.11g %.11g %s ", origX, origY, orient);
-            if (numX || numY || spaceX || spaceY)
-                encPrint(lefwFile, (char*) "DO %d BY %d STEP %.11g %.11g ",
-                         numX, numY, spaceX, spaceY);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "   SITE %s ", name);
-        if (origX || origY || orient) {
-            fprintf(lefwFile, "%.11g %.11g %s ", origX, origY, orient);
-            if (numX || numY || spaceX || spaceY)
-                fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ",
-                        numX, numY, spaceX, spaceY);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPower(double power)
-{
-    lefwObsoleteNum = LEFW_MACRO_POWER;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   POWER %.11g ;\n", power);
-    else
-        fprintf(lefwFile, "   POWER %.11g ;\n", power);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwEndMacro(const char *macroName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (!macroName || macroName == 0 || *macroName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "END %s\n\n", macroName);
-    else
-        fprintf(lefwFile, "END %s\n\n", macroName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO_END;
-    return LEFW_OK;
-}
-
-int
-lefwStartMacroDensity(const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwIsMacroDensity)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   DENSITY %s\n", layerName);
-    else
-        fprintf(lefwFile, "   DENSITY %s\n", layerName);
-
-    lefwState = LEFW_MACRO;
-    lefwIsMacroDensity = 1;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-int
-lefwMacroDensityLayerRect(double    x1,
-                          double    y1,
-                          double    x2,
-                          double    y2,
-                          double    densityValue)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroDensity)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile,
-                 (char*) "      RECT %.11g %.11g %.11g %.11g %.11g ;\n", x1, y1, x2, y2,
-                 densityValue);
-    else
-        fprintf(lefwFile,
-                "      RECT %.11g %.11g %.11g %.11g %.11g ;\n", x1, y1, x2, y2,
-                densityValue);
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwEndMacroDensity()
-{
-    if (!lefwIsMacroDensity)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END\n\n");
-    else
-        fprintf(lefwFile, "   END\n\n");
-
-    lefwLines++;
-    lefwIsMacroDensity = 0;
-    return LEFW_OK;
-}
-
-int
-lefwStartMacroPin(const char *pinName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!pinName || pinName == 0 || *pinName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   PIN %s\n", pinName);
-    else
-        fprintf(lefwFile, "   PIN %s\n", pinName);
-
-    lefwIsMacroPin = 1;
-    lefwIsMacroPinPort = 0;    // port within macropin
-    lefwLines++;
-    lefwAMaxAreaCar = 0;       // reset
-    lefwAMaxSideAreaCar = 0;   // reset
-    lefwAMaxCutCar = 0;        // reset
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinTaperRule(const char *ruleName)
-{ // opitonal 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!ruleName || ruleName == 0 || *ruleName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      TAPERRULE %s ;\n", ruleName);
-    else
-        fprintf(lefwFile, "      TAPERRULE %s ;\n", ruleName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinForeign(const char  *name,
-                    double      xl,
-                    double      yl,
-                    int         orient)
-{ // optional 
-    lefwObsoleteNum = LEFW_MACRO_PINFOREIGN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      FOREIGN %s ", name);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "STRUCTURE %.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) { // assume user has 0 0 for pt 
-            encPrint(lefwFile, (char*) "STRUCTURE %.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", lefwOrient(orient));
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      FOREIGN %s ", name);
-        if (xl || yl) {
-            fprintf(lefwFile, "STRUCTURE %.11g %.11g ", xl, yl);
-            if (orient >= 0 && orient <= 7)
-                fprintf(lefwFile, "%s ", lefwOrient(orient));
-        } else if (orient > 0 && orient <= 7) { // assume user has 0 0 for pt 
-            fprintf(lefwFile, "STRUCTURE %.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", lefwOrient(orient));
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinForeignStr(const char   *name,
-                       double       xl,
-                       double       yl, // optional 
-                       const char   *orient)
-{ // optional 
-    lefwObsoleteNum = LEFW_MACRO_PINFOREIGN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      FOREIGN %s ", name);
-        if (xl || yl) {
-            encPrint(lefwFile, (char*) "STRUCTURE %.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                encPrint(lefwFile, (char*) "%s ", orient);
-        } else if (orient && *orient != '\0') { // assume user has 0 0 for pt 
-            encPrint(lefwFile, (char*) "STRUCTURE %.11g %.11g ", xl, yl);
-            encPrint(lefwFile, (char*) "%s ", orient);
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      FOREIGN %s ", name);
-        if (xl || yl) {
-            fprintf(lefwFile, "STRUCTURE %.11g %.11g ", xl, yl);
-            if (orient && *orient != '\0')
-                fprintf(lefwFile, "%s ", orient);
-        } else if (orient && *orient != '\0') { // assume user has 0 0 for pt 
-            fprintf(lefwFile, "STRUCTURE %.11g %.11g ", xl, yl);
-            fprintf(lefwFile, "%s ", orient);
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinLEQ(const char *pinName)
-{
-    lefwObsoleteNum = LEFW_MACRO_PINLEQ;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.6)
-        return LEFW_OBSOLETE;
-    if (!pinName || pinName == 0 || *pinName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      LEQ %s ;\n", pinName);
-    else
-        fprintf(lefwFile, "      LEQ %s ;\n", pinName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinDirection(const char *direction)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!direction || direction == 0 || *direction == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      DIRECTION %s ;\n", direction);
-    else
-        fprintf(lefwFile, "      DIRECTION %s ;\n", direction);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinUse(const char *use)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!use || use == 0 || *use == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      USE %s ;\n", use);
-    else
-        fprintf(lefwFile, "      USE %s ;\n", use);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinShape(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        if (!name || name == 0 || *name == 0)
-            encPrint(lefwFile, (char*) "      SHAPE ;\n");
-        else
-            encPrint(lefwFile, (char*) "      SHAPE %s ;\n", name);
-    } else {
-        if (!name || name == 0 || *name == 0)
-            fprintf(lefwFile, "      SHAPE ;\n");
-        else
-            fprintf(lefwFile, "      SHAPE %s ;\n", name);
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinMustjoin(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      MUSTJOIN %s ;\n", name);
-    else
-        fprintf(lefwFile, "      MUSTJOIN %s ;\n", name);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinNetExpr(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      NETEXPR \"%s\" ;\n", name);
-    else
-        fprintf(lefwFile, "      NETEXPR \"%s\" ;\n", name);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinSupplySensitivity(const char *pinName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!pinName || pinName == 0 || *pinName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      SUPPLYSENSITIVITY %s ;\n", pinName);
-    else
-        fprintf(lefwFile, "      SUPPLYSENSITIVITY %s ;\n", pinName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinGroundSensitivity(const char *pinName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!pinName || pinName == 0 || *pinName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      GROUNDSENSITIVITY %s ;\n", pinName);
-    else
-        fprintf(lefwFile, "      GROUNDSENSITIVITY %s ;\n", pinName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinOutputnoisemargin(int   high,
-                              int   low)
-{
-    lefwObsoleteNum = LEFW_MACRO_OUTPUTNOISEMARGIN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      OUTPUTNOISEMARGIN %d %d ;\n", high, low);
-    else
-        fprintf(lefwFile, "      OUTPUTNOISEMARGIN %d %d ;\n", high, low);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinOutputresistance(int    high,
-                             int    low)
-{
-    lefwObsoleteNum = LEFW_MACRO_OUTPUTRESISTANCE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      OUTPUTRESISTANCE %d %d ;\n", high, low);
-    else
-        fprintf(lefwFile, "      OUTPUTRESISTANCE %d %d ;\n", high, low);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinInputnoisemargin(int    high,
-                             int    low)
-{
-    lefwObsoleteNum = LEFW_MACRO_INPUTNOISEMARGIN;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      INPUTNOISEMARGIN %d %d ;\n", high, low);
-    else
-        fprintf(lefwFile, "      INPUTNOISEMARGIN %d %d ;\n", high, low);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinPower(double power)
-{
-    lefwObsoleteNum = LEFW_MACRO_POWER;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      POWER %.11g ;\n", power);
-    else
-        fprintf(lefwFile, "      POWER %.11g ;\n", power);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinLeakage(double leakage)
-{
-    lefwObsoleteNum = LEFW_MACRO_LEAKAGE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      LEAKAGE %.11g ;\n", leakage);
-    else
-        fprintf(lefwFile, "      LEAKAGE %.11g ;\n", leakage);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinCapacitance(double capacitance)
-{
-    lefwObsoleteNum = LEFW_MACRO_CAPACITANCE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      CAPACITANCE %.11g ;\n", capacitance);
-    else
-        fprintf(lefwFile, "      CAPACITANCE %.11g ;\n", capacitance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinResistance(double resistance)
-{
-    lefwObsoleteNum = LEFW_MACRO_RESISTANCE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RESISTANCE %.11g ;\n", resistance);
-    else
-        fprintf(lefwFile, "      RESISTANCE %.11g ;\n", resistance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinPulldownres(double resistance)
-{
-    lefwObsoleteNum = LEFW_MACRO_PULLDOWNRES;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      PULLDOWNRES %.11g ;\n", resistance);
-    else
-        fprintf(lefwFile, "      PULLDOWNRES %.11g ;\n", resistance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinTieoffr(double resistance)
-{
-    lefwObsoleteNum = LEFW_MACRO_TIEOFFR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      TIEOFFR %.11g ;\n", resistance);
-    else
-        fprintf(lefwFile, "      TIEOFFR %.11g ;\n", resistance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinVHI(double voltage)
-{
-    lefwObsoleteNum = LEFW_MACRO_VHI;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      VHI %.11g ;\n", voltage);
-    else
-        fprintf(lefwFile, "      VHI %.11g ;\n", voltage);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinVLO(double voltage)
-{
-    lefwObsoleteNum = LEFW_MACRO_VLO;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      VLO %.11g ;\n", voltage);
-    else
-        fprintf(lefwFile, "      VLO %.11g ;\n", voltage);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinRisevoltagethreshold(double voltage)
-{
-    lefwObsoleteNum = LEFW_MACRO_RISEVOLTAGETHRESHOLD;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISEVOLTAGETHRESHOLD %.11g ;\n", voltage);
-    else
-        fprintf(lefwFile, "      RISEVOLTAGETHRESHOLD %.11g ;\n", voltage);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinFallvoltagethreshold(double voltage)
-{
-    lefwObsoleteNum = LEFW_MACRO_FALLVOLTAGETHRESHOLD;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLVOLTAGETHRESHOLD %.11g ;\n", voltage);
-    else
-        fprintf(lefwFile, "      FALLVOLTAGETHRESHOLD %.11g ;\n", voltage);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinRisethresh(double capacitance)
-{
-    lefwObsoleteNum = LEFW_MACRO_RISETHRESH;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISETHRESH %.11g ;\n", capacitance);
-    else
-        fprintf(lefwFile, "      RISETHRESH %.11g ;\n", capacitance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinFallthresh(double capacitance)
-{
-    lefwObsoleteNum = LEFW_MACRO_FALLTHRESH;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLTHRESH %.11g ;\n", capacitance);
-    else
-        fprintf(lefwFile, "      FALLTHRESH %.11g ;\n", capacitance);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinRisesatcur(double current)
-{
-    lefwObsoleteNum = LEFW_MACRO_RISESATCUR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISESATCUR %.11g ;\n", current);
-    else
-        fprintf(lefwFile, "      RISESATCUR %.11g ;\n", current);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-int
-lefwMacroPinFallsatcur(double current)
-{
-    lefwObsoleteNum = LEFW_MACRO_FALLSATCUR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLSATCUR %.11g ;\n", current);
-    else
-        fprintf(lefwFile, "      FALLSATCUR %.11g ;\n", current);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinCurrentsource(const char *name)
-{
-    lefwObsoleteNum = LEFW_MACRO_FALLCURRENTSOURCE;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (strcmp(name, "ACTIVE") && strcmp(name, "RESISTIVE"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      CURRENTSOURCE %s ;\n", name);
-    else
-        fprintf(lefwFile, "      CURRENTSOURCE %s ;\n", name);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinIV_Tables(const char    *lowName,
-                      const char    *highName)
-{
-    lefwObsoleteNum = LEFW_MACRO_IV_TABLES;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (!lowName || lowName == 0 || *lowName == 0)
-        return LEFW_BAD_DATA;
-    if (!highName || highName == 0 || *highName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      IV_TABLES %s %s ;\n", lowName, highName);
-    else
-        fprintf(lefwFile, "      IV_TABLES %s %s ;\n", lowName, highName);
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennasize(double      value,
-                        const char  *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwAntenna54)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNASIZE %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNASIZE %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna53 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaMetalArea(double     value,
-                             const char *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMETALAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAMETALAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaMetalLength(double       value,
-                               const char   *layerName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwAntenna54)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMETALLENGTH %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAMETALLENGTH %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna53 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaPartialMetalArea(double      value,
-                                    const char  *layerName)
-{
-    lefw54Num = LEFW_ANTENNAPARTIALMETALAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAPARTIALMETALAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAPARTIALMETALAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaPartialMetalSideArea(double      value,
-                                        const char  *layerName)
-{
-    lefw54Num = LEFW_ANTENNAPARTIALMETALSIDEAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile,
-                 (char*) "      ANTENNAPARTIALMETALSIDEAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAPARTIALMETALSIDEAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaPartialCutArea(double        value,
-                                  const char    *layerName)
-{
-    lefw54Num = LEFW_ANTENNAPARTIALCUTAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAPARTIALCUTAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAPARTIALCUTAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaDiffArea(double      value,
-                            const char  *layerName)
-{
-    lefw54Num = LEFW_ANTENNADIFFAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNADIFFAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNADIFFAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaModel(const char *oxide)
-{
-    lefw54Num = LEFW_ANTENNAGATEAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMODEL %s ;\n", oxide);
-    } else {
-        fprintf(lefwFile, "      ANTENNAMODEL %s ;\n", oxide);
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaGateArea(double      value,
-                            const char  *layerName)
-{
-    lefw54Num = LEFW_ANTENNAGATEAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAGATEAREA %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAGATEAREA %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaMaxAreaCar(double        value,
-                              const char    *layerName)
-{
-    lefw54Num = LEFW_ANTENNAMAXAREACAR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwAMaxAreaCar)
-        return LEFW_BAD_DATA;  // ANTENNAMAXAREACAR has defined
-    // more than once
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMAXAREACAR %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAMAXAREACAR %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaMaxSideAreaCar(double        value,
-                                  const char    *layerName)
-{
-    lefw54Num = LEFW_ANTENNAMAXSIDEAREACAR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwAMaxSideAreaCar)
-        return LEFW_BAD_DATA;  // ANTENNAMAXSIDEAREACAR has
-    // defined more than once
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMAXSIDEAREACAR %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAMAXSIDEAREACAR %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinAntennaMaxCutCar(double     value,
-                             const char *layerName)
-{
-    lefw54Num = LEFW_ANTENNAMAXCUTCAR;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwAMaxCutCar)
-        return LEFW_BAD_DATA;  // ANTENNAMAXCUTCAR has
-    // defined more than once
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwAntenna53)
-        return LEFW_MIX_VERSION_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      ANTENNAMAXCUTCAR %.11g ", value);
-        if (layerName)
-            encPrint(lefwFile, (char*) "LAYER %s ", layerName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      ANTENNAMAXCUTCAR %.11g ", value);
-        if (layerName)
-            fprintf(lefwFile, "LAYER %s ", layerName);
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwState = LEFW_MACRO;
-    lefwAntenna54 = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwEndMacroPin(const char *pinName)
-{
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (!pinName || pinName == 0 || *pinName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END %s\n\n", pinName);
-    else
-        fprintf(lefwFile, "   END %s\n\n", pinName);
-
-    lefwLines++;
-    lefwIsMacroPin = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwStartMacroPinPort(const char *classType)
-{    // optional 
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPin)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt) {
-        if (classType) {
-            if (strcmp(classType, "NONE") && strcmp(classType, "CORE"))
-                return LEFW_BAD_DATA;
-            encPrint(lefwFile, (char*) "      PORT CLASS %s ;\n", classType);
-        } else
-            encPrint(lefwFile, (char*) "      PORT \n");
-    } else {
-        if (classType) {
-            if (strcmp(classType, "NONE") && strcmp(classType, "CORE") &&
-                strcmp(classType, "BUMP"))
-                return LEFW_BAD_DATA;
-            fprintf(lefwFile, "      PORT CLASS %s ;\n", classType);
-        } else
-            fprintf(lefwFile, "      PORT \n");
-    }
-
-    lefwLines++;
-    lefwIsMacroPinPort = 1;
-    lefwIsMacroPinPortLayer = 0;
-    lefwSpacingVal = 0;
-    lefwWidthVal = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortLayer(const char    *layerName,
-                      double        spacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPort)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWidthVal)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "         LAYER %s ", layerName);
-        if (spacing)
-            encPrint(lefwFile, (char*) "SPACING %.11g ", spacing);
-        encPrint(lefwFile, (char*) ";\n ");
-    } else {
-        fprintf(lefwFile, "         LAYER %s ", layerName);
-        if (spacing)
-            fprintf(lefwFile, "SPACING %.11g ", spacing);
-        fprintf(lefwFile, ";\n ");
-    }
-    lefwLines++;
-    lefwIsMacroPinPortLayer = 1;
-    lefwSpacingVal = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortDesignRuleWidth(const char  *layerName,
-                                double      width)
-{
-    lefw54Num = LEFW_DESIGNRULEWIDTH;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPort)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwSpacingVal)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "         LAYER %s ", layerName);
-        if (width)
-            encPrint(lefwFile, (char*) "DESIGNRULEWIDTH %.11g ", width);
-        encPrint(lefwFile, (char*) ";\n ");
-    } else {
-        fprintf(lefwFile, "         LAYER %s ", layerName);
-        if (width)
-            fprintf(lefwFile, "DESIGNRULEWIDTH %.11g ", width);
-        fprintf(lefwFile, ";\n ");
-    }
-    lefwLines++;
-    lefwIsMacroPinPortLayer = 1;
-    lefwWidthVal = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortLayerWidth(double width)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPortLayer)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "         WIDTH %.11g ;\n", width);
-    else
-        fprintf(lefwFile, "         WIDTH %.11g ;\n", width);
-    lefwLines++;
-    lefwIsMacroPinPortLayer = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortLayerPath(int       num_paths,
-                          double    *xl,
-                          double    *yl,
-                          int       numX,
-                          int       numY,           // optional 
-                          double    spaceX,
-                          double    spaceY, // optional 
-                          int       mask)
-{                   // optional 
-    int i, numItem;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPortLayer)
-        return LEFW_BAD_ORDER;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         PATH MASK %d ITERATE ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         PATH ITERATE ");
-            }
-            for (i = 0; i < num_paths; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g\n", xl[i], yl[i]);
-                else
-                    encPrint(lefwFile,
-                             (char*) "           %.11g %.11g\n", xl[i], yl[i]);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*)
-                     "           DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         PATH MASK %d ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         PATH ");
-            }
-            numItem = 0;
-            for (i = 0; i < num_paths; i++) {
-                if (numItem > 5) {
-                    encPrint(lefwFile, (char*) "\n");
-                    encPrint(lefwFile,
-                             (char*) "           %.11g %.11g ", xl[i], yl[i]);
-                    numItem = 0;
-                    lefwLines++;
-                } else
-                    encPrint(lefwFile, (char*) "%.11g %.11g ", xl[i], yl[i]);
-                numItem++;
-            }
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "         PATH MASK %d ITERATE ", mask);
-            } else {
-                fprintf(lefwFile, "         PATH ITERATE ");
-            }
-            for (i = 0; i < num_paths; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g\n", xl[i], yl[i]);
-                else
-                    fprintf(lefwFile, "           %.11g %.11g\n", xl[i], yl[i]);
-                lefwLines++;
-            }
-            fprintf(lefwFile,
-                    "           DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "         PATH MASK %d ", mask);
-            } else {
-                fprintf(lefwFile, "         PATH ");
-            }
-            numItem = 0;
-            for (i = 0; i < num_paths; i++) {
-                if (numItem > 5) {
-                    fprintf(lefwFile, "\n");
-                    fprintf(lefwFile, "           %.11g %.11g ", xl[i], yl[i]);
-                    numItem = 0;
-                    lefwLines++;
-                } else
-                    fprintf(lefwFile, "%.11g %.11g ", xl[i], yl[i]);
-                numItem++;
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortLayerRect(double    xl1,
-                          double    yl1,
-                          double    xl2,
-                          double    yl2,
-                          int       numX,
-                          int       numY,             // optional 
-                          double    spaceX,
-                          double    spaceY,   // optional 
-                          int       mask)
-{                     // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPortLayer)
-        return LEFW_BAD_ORDER;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile,
-                         (char*) "            RECT MASK %d ITERATE %.11g %.11g %.11g %.11g ",
-                         mask, xl1, yl1, xl2, yl2);
-            } else {
-                encPrint(lefwFile,
-                         (char*) "            RECT ITERATE %.11g %.11g %.11g %.11g ",
-                         xl1, yl1, xl2, yl2);
-            }
-            encPrint(lefwFile,
-                     (char*) "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                     spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*)
-                         "            RECT MASK %d %.11g %.11g %.11g %.11g ", mask, xl1, yl1, xl2, yl2);
-            } else {
-                encPrint(lefwFile, (char*)
-                         "            RECT %.11g %.11g %.11g %.11g ", xl1, yl1, xl2, yl2);
-            }
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "            RECT MASK %d ITERATE %.11g %.11g %.11g %.11g ",
-                        mask, xl1, yl1, xl2, yl2);
-            } else {
-                fprintf(lefwFile, "            RECT ITERATE %.11g %.11g %.11g %.11g ",
-                        xl1, yl1, xl2, yl2);
-            }
-            fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                    spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile,
-                        "            RECT MASK %d %.11g %.11g %.11g %.11g ", mask, xl1, yl1, xl2, yl2);
-            } else {
-                fprintf(lefwFile,
-                        "            RECT %.11g %.11g %.11g %.11g ", xl1, yl1, xl2, yl2);
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortLayerPolygon(int    num_polys,
-                             double *xl,
-                             double *yl,
-                             int    numX,
-                             int    numY,             // optional 
-                             double spaceX,
-                             double spaceY,   // optional 
-                             int    mask)
-{                    // optional 
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPortLayer)
-        return LEFW_BAD_ORDER;
-    if (num_polys < 4)
-        return LEFW_BAD_DATA;   // at least 4 points
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile, (char*) "            POLYGON MASK %d ITERATE ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "            POLYGON ITERATE ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    encPrint(lefwFile,
-                             (char*) "               %.11g %.11g\n", *xl++, *yl++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*)
-                     "               DO %d BY %d STEP %.11g %.11g ;\n",
-                     numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "            POLYGON MASK %d ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "            POLYGON ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g", *xl++, *yl++);
-                else
-                    encPrint(lefwFile,
-                             (char*) "\n               %.11g %.11g", *xl++, *yl++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*) " ;\n");
-        }
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "            POLYGON MASK %d ITERATE ", mask);
-            } else {
-                fprintf(lefwFile, "            POLYGON ITERATE ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    fprintf(lefwFile, "               %.11g %.11g\n", *xl++, *yl++);
-                lefwLines++;
-            }
-            fprintf(lefwFile,
-                    "               DO %d BY %d STEP %.11g %.11g ;\n",
-                    numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "            POLYGON MASK %d ", mask);
-            } else {
-                fprintf(lefwFile, "            POLYGON ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g", *xl++, *yl++);
-                else
-                    fprintf(lefwFile, "\n               %.11g %.11g", *xl++, *yl++);
-                lefwLines++;
-            }
-            fprintf(lefwFile, " ;\n");
-        }
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroPinPortVia(double      xl,
-                    double      yl,
-                    const char  *viaName,
-                    int         numX,
-                    int         numY,             // optional 
-                    double      spaceX,
-                    double      spaceY,   // optional 
-                    int         mask)
-{                     // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroPinPort)
-        return LEFW_BAD_ORDER;
-    if (!viaName || viaName == 0 || *viaName == 0)
-        return LEFW_BAD_DATA;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile,
-                         (char*) "            VIA ITERATE MASK %d %.11g %.11g %s ", mask, xl, yl,
-                         viaName);
-            } else {
-                encPrint(lefwFile,
-                         (char*) "            VIA ITERATE %.11g %.11g %s ", xl, yl,
-                         viaName);
-            }
-            encPrint(lefwFile,
-                     (char*) "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                     spaceY);
-        } else
-            encPrint(lefwFile, (char*) "            VIA %.11g %.11g %s ", xl, yl, viaName);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile,
-                        "            VIA ITERATE MASK %d %.11g %.11g %s ", mask, xl, yl, viaName);
-            } else {
-                fprintf(lefwFile,
-                        "            VIA ITERATE %.11g %.11g %s ", xl, yl, viaName);
-            }
-            fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                    spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "            VIA MASK %d %.11g %.11g %s ", mask, xl, yl, viaName);
-            } else {
-                fprintf(lefwFile, "            VIA %.11g %.11g %s ", xl, yl, viaName);
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwEndMacroPinPort()
-{
-    if (!lefwIsMacroPinPort)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      END\n");
-    else
-        fprintf(lefwFile, "      END\n");
-
-    lefwLines++;
-    lefwIsMacroPinPort = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwStartMacroObs()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   OBS\n");
-    else
-        fprintf(lefwFile, "   OBS\n");
-
-    lefwIsMacroObs = 1;
-    lefwSpacingVal = 0;
-    lefwWidthVal = 0;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsLayer(const char    *layerName,
-                  double        spacing)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWidthVal)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      LAYER %s ", layerName);
-        if (spacing)
-            encPrint(lefwFile, (char*) "SPACING %.11g ", spacing);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      LAYER %s ", layerName);
-        if (spacing)
-            fprintf(lefwFile, "SPACING %.11g ", spacing);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwIsMacroObsLayer = 1;
-    lefwSpacingVal = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsDesignRuleWidth(const char  *layerName,
-                            double      width)
-{
-    lefw54Num = LEFW_DESIGNRULEWIDTH;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwSpacingVal)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      LAYER %s ", layerName);
-        if (width)
-            encPrint(lefwFile, (char*) "DESIGNRULEWIDTH %.11g ", width);
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        fprintf(lefwFile, "      LAYER %s ", layerName);
-        if (width)
-            fprintf(lefwFile, "DESIGNRULEWIDTH %.11g ", width);
-        fprintf(lefwFile, ";\n");
-    }
-    lefwLines++;
-    lefwIsMacroObsLayer = 1;
-    lefwWidthVal = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroExceptPGNet(const char *layerName)
-{
-    lefw54Num = LEFW_DESIGNRULEWIDTH;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (!layerName || layerName == 0 || *layerName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwSpacingVal)
-        return LEFW_BAD_DATA;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      LAYER %s EXCEPTPGNET ;\n", layerName);
-    else
-        fprintf(lefwFile, "      LAYER %s EXCEPTPGNET ;\n", layerName);
-    lefwLines++;
-    lefwIsMacroObsLayer = 1;
-    lefwWidthVal = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsLayerWidth(double width)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObsLayer)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      WIDTH %.11g ;\n", width);
-    else
-        fprintf(lefwFile, "      WIDTH %.11g ;\n", width);
-    lefwLines++;
-    lefwIsMacroObsLayer = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsLayerPath(int       num_paths,
-                      double    *xl,
-                      double    *yl,
-                      int       numX,
-                      int       numY,             // optional 
-                      double    spaceX,
-                      double    spaceY,   // optional 
-                      int       mask)
-{                      // optional 
-    int i, numItem;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObsLayer)
-        return LEFW_BAD_ORDER;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         PATH MASK %d ITERATE ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         PATH ITERATE ");
-            }
-            for (i = 0; i < num_paths; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    encPrint(lefwFile,
-                             (char*) "            %.11g %.11g\n", *xl++, *yl++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*) "           DO %d BY %d STEP %.11g %.11g ",
-                     numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         PATH MASK %d ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         PATH ");
-            }
-            numItem = 0;
-            for (i = 0; i < num_paths; i++) {
-                if (numItem > 5) {
-                    encPrint(lefwFile, (char*) "\n");
-                    encPrint(lefwFile, (char*) "         %.11g %.11g ", xl[i], yl[i]);
-                    numItem = 0;
-                    lefwLines++;
-                } else
-                    encPrint(lefwFile, (char*) "%.11g %.11g ", xl[i], yl[i]);
-                numItem++;
-            }
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "         PATH MASK %d ITERATE ", mask);
-            } else {
-                fprintf(lefwFile, "         PATH ITERATE ");
-            }
-            for (i = 0; i < num_paths; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    fprintf(lefwFile, "            %.11g %.11g\n", *xl++, *yl++);
-                lefwLines++;
-            }
-            fprintf(lefwFile, "           DO %d BY %d STEP %.11g %.11g ",
-                    numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "         PATH MASK %d ", mask);
-            } else {
-                fprintf(lefwFile, "         PATH ");
-            }
-            numItem = 0;
-            for (i = 0; i < num_paths; i++) {
-                if (numItem > 5) {
-                    fprintf(lefwFile, "\n");
-                    fprintf(lefwFile, "         %.11g %.11g ", xl[i], yl[i]);
-                    numItem = 0;
-                    lefwLines++;
-                } else
-                    fprintf(lefwFile, "%.11g %.11g ", xl[i], yl[i]);
-                numItem++;
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsLayerRect(double    xl1,
-                      double    yl1,
-                      double    xl2,
-                      double    yl2,
-                      int       numX,
-                      int       numY,             // optional 
-                      double    spaceX,
-                      double    spaceY,   // optional 
-                      int       mask)
-{                     // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObsLayer)
-        return LEFW_BAD_ORDER;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile,
-                         (char*) "         RECT MASK %d ITERATE %.11g %.11g %.11g %.11g ",
-                         mask, xl1, yl1, xl2, yl2);
-            } else {
-                encPrint(lefwFile,
-                         (char*) "         RECT ITERATE %.11g %.11g %.11g %.11g ",
-                         xl1, yl1, xl2, yl2);
-            }
-            encPrint(lefwFile, (char*) "DO %d BY %d STEP %.11g %.11g ",
-                     numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         RECT MASK %d %.11g %.11g %.11g %.11g ",
-                         mask, xl1, yl1, xl2, yl2);
-            } else {
-                encPrint(lefwFile, (char*) "         RECT %.11g %.11g %.11g %.11g ",
-                         xl1, yl1, xl2, yl2);
-            }
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "         RECT MASK %d ITERATE %.11g %.11g %.11g %.11g ",
-                        mask, xl1, yl1, xl2, yl2);
-            } else {
-                fprintf(lefwFile, "         RECT ITERATE %.11g %.11g %.11g %.11g ",
-                        xl1, yl1, xl2, yl2);
-            }
-            fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                    spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "         RECT MASK %d %.11g %.11g %.11g %.11g ",
-                        mask, xl1, yl1, xl2, yl2);
-            } else {
-                fprintf(lefwFile, "         RECT %.11g %.11g %.11g %.11g ",
-                        xl1, yl1, xl2, yl2);
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsLayerPolygon(int    num_polys,
-                         double *xl,
-                         double *yl,
-                         int    numX,
-                         int    numY,             // optional 
-                         double spaceX,
-                         double spaceY,   // optional 
-                         int    mask)
-{                    // optional 
-    int i;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObsLayer)
-        return LEFW_BAD_ORDER;
-    if (num_polys < 4)
-        return LEFW_BAD_DATA;   // at least 4 points
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         POLYGON MASK %d ITERATE ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         POLYGON ITERATE ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    encPrint(lefwFile, (char*) "           %.11g %.11g\n",
-                             *xl++, *yl++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*) "           DO %d BY %d STEP %.11g %.11g ;",
-                     numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "         POLYGON MASK %d ", mask);
-            } else {
-                encPrint(lefwFile, (char*) "         POLYGON ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    encPrint(lefwFile, (char*) "%.11g %.11g", *xl++, *yl++);
-                else
-                    encPrint(lefwFile,
-                             (char*) "\n           %.11g %.11g", *xl++, *yl++);
-                lefwLines++;
-            }
-            encPrint(lefwFile, (char*) " ;\n");
-        }
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "         POLYGON MASK %d ITERATE ", mask);
-            } else {
-                fprintf(lefwFile, "         POLYGON ITERATE ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g\n", *xl++, *yl++);
-                else
-                    fprintf(lefwFile, "           %.11g %.11g\n", *xl++, *yl++);
-                lefwLines++;
-            }
-            fprintf(lefwFile, "           DO %d BY %d STEP %.11g %.11g ;",
-                    numX, numY, spaceX, spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "         POLYGON MASK %d ", mask);
-            } else {
-                fprintf(lefwFile, "         POLYGON ");
-            }
-            for (i = 0; i < num_polys; i++) {
-                if (i == 0)
-                    fprintf(lefwFile, "%.11g %.11g", *xl++, *yl++);
-                else
-                    fprintf(lefwFile, "\n           %.11g %.11g", *xl++, *yl++);
-                lefwLines++;
-            }
-            fprintf(lefwFile, " ;\n");
-        }
-    }
-
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwMacroObsVia(double      xl,
-                double      yl,
-                const char  *viaName,
-                int         numX,
-                int         numY,             // optional 
-                double      spaceX,
-                double      spaceY,   // optional 
-                int         mask)
-{                     // optional 
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (!viaName || viaName == 0 || *viaName == 0)
-        return LEFW_BAD_DATA;
-    if (mask && versionNum < 5.8) {
-        return LEFW_WRONG_VERSION;
-    }
-
-    if (!lefwValidateMaskNumber(mask)) {
-        return LEFW_BAD_DATA;
-    }
-
-    if (lefwWriteEncrypt) {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                encPrint(lefwFile, (char*) "      VIA ITERATE MASK %d %.11g %.11g %s ",
-                         mask, xl, yl, viaName);
-            } else {
-                encPrint(lefwFile, (char*) "      VIA ITERATE %.11g %.11g %s ",
-                         xl, yl, viaName);
-            }
-            encPrint(lefwFile, (char*) "DO %d BY %d STEP %.11g %.11g ",
-                     numX, numY, spaceX,
-                     spaceY);
-        } else {
-            if (mask) {
-                encPrint(lefwFile, (char*) "      VIA MASK %d %.11g %.11g %s ", mask, xl, yl, viaName);
-            } else {
-                encPrint(lefwFile, (char*) "      VIA %.11g %.11g %s ", xl, yl, viaName);
-            }
-        }
-        encPrint(lefwFile, (char*) ";\n");
-    } else {
-        if (numX || numY || spaceX || spaceY) {
-            if (mask) {
-                fprintf(lefwFile, "      VIA ITERATE MASK %d %.11g %.11g %s ", mask, xl, yl, viaName);
-            } else {
-                fprintf(lefwFile, "      VIA ITERATE %.11g %.11g %s ", xl, yl, viaName);
-            }
-            fprintf(lefwFile, "DO %d BY %d STEP %.11g %.11g ", numX, numY, spaceX,
-                    spaceY);
-        } else {
-            if (mask) {
-                fprintf(lefwFile, "      VIA MASK %d %.11g %.11g %s ", mask, xl, yl, viaName);
-            } else {
-                fprintf(lefwFile, "      VIA %.11g %.11g %s ", xl, yl, viaName);
-            }
-        }
-        fprintf(lefwFile, ";\n");
-    }
-
-    lefwLines++;
-    lefwIsMacroObsLayer = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwEndMacroObs()
-{
-    if (!lefwIsMacroObs)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END\n");
-    else
-        fprintf(lefwFile, "   END\n");
-
-    lefwLines++;
-    lefwIsMacroObs = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwStartMacroTiming()
-{
-    lefwObsoleteNum = LEFW_MACRO_TIMING;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_MACRO_START &&
-        lefwState != LEFW_MACRO)
-        return LEFW_BAD_ORDER;
-    if (lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (versionNum >= 5.4)
-        return LEFW_OBSOLETE;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   TIMING\n");
-    else
-        fprintf(lefwFile, "   TIMING\n");
-
-    lefwIsMacroTiming = 1;
-    lefwIsMacroTimingModel = 0;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingPin(const char   *fromPin,
-                   const char   *toPin)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (fromPin) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "      FROMPIN %s ;\n", fromPin);
-        else
-            fprintf(lefwFile, "      FROMPIN %s ;\n", fromPin);
-        lefwLines++;
-    }
-    if (toPin) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "      TOPIN %s ;\n", toPin);
-        else
-            fprintf(lefwFile, "      TOPIN %s ;\n", toPin);
-        lefwLines++;
-    }
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingIntrinsic(const char *riseFall,
-                         double     min,
-                         double     max,
-                         double     slewT1,
-                         double     slewT1Min,       // optional 
-                         double     slewT1Max,
-                         double     slewT2,       // optional 
-                         double     slewT2Min,
-                         double     slewT2Max,    // optional 
-                         double     slewT3,                         // optional 
-                         double     varMin,
-                         double     varMax)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (strcmp(riseFall, "RISE") && strcmp(riseFall, "FALL"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt) {
-        encPrint(lefwFile, (char*) "      %s INTRINSIC %.11g %.11g ",
-                 riseFall, min, max);
-        if (slewT1 || slewT1Min || slewT1Max || slewT2) {
-            encPrint(lefwFile, (char*) "%.11g %.11g %.11g %.11g ",
-                     slewT1, slewT1Min, slewT1Max, slewT2);
-            if (slewT2Min || slewT2Max || slewT3)
-                encPrint(lefwFile, (char*) "%.11g %.11g %.11g \n",
-                         slewT2Min, slewT2Max, slewT3);
-        } else if (slewT2Min || slewT2Max || slewT3)
-            return LEFW_BAD_DATA;     // slewT2Min... has to be inside of slewT1...
-        encPrint(lefwFile, (char*) "         VARIABLE %.11g %.11g ;\n",
-                 varMin, varMax);
-    } else {
-        fprintf(lefwFile, "      %s INTRINSIC %.11g %.11g ", riseFall, min, max);
-        if (slewT1 || slewT1Min || slewT1Max || slewT2) {
-            fprintf(lefwFile, "%.11g %.11g %.11g %.11g ",
-                    slewT1, slewT1Min, slewT1Max, slewT2);
-            if (slewT2Min || slewT2Max || slewT3)
-                fprintf(lefwFile, "%.11g %.11g %.11g \n",
-                        slewT2Min, slewT2Max, slewT3);
-        } else if (slewT2Min || slewT2Max || slewT3)
-            return LEFW_BAD_DATA;     // slewT2Min... has to be inside of slewT1...
-        fprintf(lefwFile, "         VARIABLE %.11g %.11g ;\n", varMin, varMax);
-    }
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-// Obsolete in 5.4
-int
-lefwMacroTimingRisers(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISERS %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      RISERS %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingFallrs(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLRS %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      FALLRS %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingRisecs(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISECS %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      RISECS %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingFallcs(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLCS %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      FALLCS %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingRisesatt1(double min,
-                         double max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISESATT1 %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      RISESATT1 %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingFallsatt1(double min,
-                         double max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLSATT1 %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      FALLSATT1 %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingRiset0(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      RISET0 %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      RISET0 %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingFallt0(double    min,
-                      double    max)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      FALLT0 %.11g %.11g ;\n", min, max);
-    else
-        fprintf(lefwFile, "      FALLT0 %.11g %.11g ;\n", min, max);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwMacroTimingUnateness(const char *unateness)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (strcmp(unateness, "INVERT") && strcmp(unateness, "NONINVERT") &&
-        strcmp(unateness, "NONUNATE"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "      UNATENESS %s ; \n", unateness);
-    else
-        fprintf(lefwFile, "      UNATENESS %s ; \n", unateness);
-    lefwLines++;
-    return LEFW_OK;
-}
-
-// Obsolete in 5.4
-int
-lefwEndMacroTiming()
-{
-    if (!lefwIsMacroTiming)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   END TIMING\n\n");
-    else
-        fprintf(lefwFile, "   END TIMING\n\n");
-
-    lefwLines++;
-    lefwIsMacroTiming = 0;
-    return LEFW_OK;
-}
-
-
-int
-lefwAntenna(const char  *type,
-            double      value)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (!type || type == 0 || *type == 0)
-        return LEFW_BAD_DATA;
-    if (strcmp(type, "INPUTPINANTENNASIZE") &&
-        strcmp(type, "OUTPUTPINANTENNASIZE") &&
-        strcmp(type, "INOUTPINANTENNASIZE"))
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "%s %.11g ;\n", type, value);
-    else
-        fprintf(lefwFile, "%s %.11g ;\n", type, value);
-
-    lefwLines++;
-    lefwSynArray[LEFW_ANTENNASIZE] = 1;
-    return LEFW_OK;
-}
-
-
-int
-lefwAntennaInputGateArea(double inputGateArea)
-{
-    lefw54Num = LEFW_ANTENNAINPUTGATEAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_ANTENNAINPUTGATEAREA])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "ANTENNAINPUTGATEAREA %.11g ;\n",
-                 inputGateArea);
-    else
-        fprintf(lefwFile, "ANTENNAINPUTGATEAREA %.11g ;\n", inputGateArea);
-    lefwLines++;
-    lefwSynArray[LEFW_ANTENNAINPUTGATEAREA] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwAntennaInOutDiffArea(double inOutDiffArea)
-{
-    lefw54Num = LEFW_ANTENNAINOUTDIFFAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_ANTENNAINOUTDIFFAREA])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "ANTENNAINOUTDIFFAREA %.11g ;\n",
-                 inOutDiffArea);
-    else
-        fprintf(lefwFile, "ANTENNAINOUTDIFFAREA %.11g ;\n", inOutDiffArea);
-    lefwLines++;
-    lefwSynArray[LEFW_ANTENNAINOUTDIFFAREA] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwAntennaOutputDiffArea(double outputDiffArea)
-{
-    lefw54Num = LEFW_ANTENNAOUTPUTDIFFAREA;
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_INIT && lefwState < LEFW_END)
-        return LEFW_BAD_ORDER;  // not of the ENDs
-    if (lefwSynArray[LEFW_ANTENNAOUTPUTDIFFAREA])
-        return LEFW_ALREADY_DEFINED;
-    if (versionNum < 5.4)
-        return LEFW_WRONG_VERSION;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "ANTENNAOUTPUTDIFFAREA %.11g ;\n",
-                 outputDiffArea);
-    else
-        fprintf(lefwFile, "ANTENNAOUTPUTDIFFAREA %.11g ;\n", outputDiffArea);
-    lefwLines++;
-    lefwSynArray[LEFW_ANTENNAOUTPUTDIFFAREA] = 1;
-    return LEFW_OK;
-}
-
-int
-lefwStartBeginext(const char *name)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState == LEFW_BEGINEXT_START ||
-        lefwState == LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-    if (!name || name == 0 || *name == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "BEGINEXT \"%s\"", name);
-        // \n will be added later
-    else
-        fprintf(lefwFile, "BEGINEXT \"%s\"", name);
-
-    lefwState = LEFW_BEGINEXT_START;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwBeginextCreator(const char *creatorName)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_BEGINEXT_START &&
-        lefwState != LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-    if (!creatorName || creatorName == 0 || *creatorName == 0)
-        return LEFW_BAD_DATA;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n   CREATOR \"%s\"", creatorName);
-    else
-        fprintf(lefwFile, "\n   CREATOR \"%s\"", creatorName);
-
-    lefwState = LEFW_BEGINEXT;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwBeginextDate()
-{
-    time_t  todayTime;
-    char    *rettime;
-
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_BEGINEXT_START &&
-        lefwState != LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-
-    todayTime = time(NULL);             // time in UTC 
-    rettime = ctime(&todayTime);        // convert to string
-    rettime[strlen(rettime) - 1] = '\0';  // replace \n with \0
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n   DATE \"%s\"", rettime);
-    else
-        fprintf(lefwFile, "\n   DATE \"%s\"", rettime);
-
-    lefwState = LEFW_BEGINEXT;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwBeginextRevision(int    vers1,
-                     int    vers2)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_BEGINEXT_START &&
-        lefwState != LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n   REVISION %d.%d", vers1, vers2);
-    else
-        fprintf(lefwFile, "\n   REVISION %d.%d", vers1, vers2);
-
-    lefwState = LEFW_BEGINEXT;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwBeginextSyntax(const char   *title,
-                   const char   *string)
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_BEGINEXT_START &&
-        lefwState != LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "\n   - %s %s", title, string);
-    else
-        fprintf(lefwFile, "\n   - %s %s", title, string);
-
-    lefwState = LEFW_BEGINEXT;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwEndBeginext()
-{
-    if (!lefwFile)
-        return LEFW_UNINITIALIZED;
-    if (!lefwDidInit)
-        return LEFW_BAD_ORDER;
-    if (lefwState != LEFW_BEGINEXT_START &&
-        lefwState != LEFW_BEGINEXT)
-        return LEFW_BAD_ORDER;
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) ";\nENDEXT\n\n");
-    else
-        fprintf(lefwFile, ";\nENDEXT\n\n");
-
-    lefwState = LEFW_BEGINEXT_END;
-    lefwLines++;
-    return LEFW_OK;
-}
-
-
-int
-lefwCurrentLineNumber()
-{
-    return lefwLines;
-}
-
-void
-lefwPrintError(int status)
-{
-    switch (status) {
-    case LEFW_OK:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "No Error.\n");
-        else
-            fprintf(lefwFile, "No Error.\n");
-        break;
-    case LEFW_UNINITIALIZED:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "Need to call lefwInit first.\n");
-        else
-            fprintf(lefwFile, "Need to call lefwInit first.\n");
-        break;
-    case LEFW_BAD_ORDER:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "Incorrect order of data.\n");
-        else
-            fprintf(lefwFile, "Incorrect order of data.\n");
-        break;
-    case LEFW_BAD_DATA:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "Invalid data.\n");
-        else
-            fprintf(lefwFile, "Invalid data.\n");
-        break;
-    case LEFW_ALREADY_DEFINED:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "Section is allowed to define only once.\n");
-        else
-            fprintf(lefwFile, "Section is allowed to define only once.\n");
-        break;
-    case LEFW_WRONG_VERSION:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile,
-                     (char*) "Version number is set before 5.4, API: %s is for 5.4.\n",
-                     lefwStateStr[lefw54Num]);
-        else
-            fprintf(lefwFile, "Version number is set before 5.4, but 5.4, API: %s is for 5.4.\n", lefwStateStr[lefw54Num]);
-        break;
-    case LEFW_MIX_VERSION_DATA:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "You have made both 5.4 & pre 5.4 Antenna API called, which is invalid.\n");
-
-        else
-            fprintf(lefwFile, "You have made both 5.4 & pre 5.4 Antenna API called, which is invalid.\n");
-        break;
-    case LEFW_OBSOLETE:
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "%s is no longer valid in %g.\n",
-                     lefwStateStr[lefwObsoleteNum], versionNum);
-
-        else
-            fprintf(lefwFile, "%s is no longer valid in %g.\n",
-                    lefwStateStr[lefwObsoleteNum], versionNum);
-    }
-    return;
-}
-
-void
-lefwAddComment(const char *comment)
-{
-    if (comment) {
-        if (lefwWriteEncrypt)
-            encPrint(lefwFile, (char*) "# %s\n", comment);
-        else
-            fprintf(lefwFile, "# %s\n", comment);
-    }
-    return;
-}
-
-void
-lefwAddIndent()
-{
-    if (lefwWriteEncrypt)
-        encPrint(lefwFile, (char*) "   ");
-    else
-        fprintf(lefwFile, "   ");
-    return;
-}
-
-// ***************************
-//   Questions:
-// - Is only one row rule allowed
-// - Is only one tracks rule allowed
-// - In the die area is a zero area allowed? overlaps?
-// - What type of checking is needed for the rows and tracks do loop?
-// - Can you have a default prop with a number AND a range?
-// - What is the pin properties section mentioned in the 5.1 spec?
-// *****************************
-
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.hpp
deleted file mode 100644
index 0e37802..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriter.hpp
+++ /dev/null
@@ -1,2374 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef LEFW_WRITERCALLS_H
-#define LEFW_WRITERCALLS_H
-
-#include <stdio.h>
-
-#include "lefiKRDefs.hpp"
-#include "lefiDefs.hpp"
-#include "lefiUser.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-// Return codes for writing functions: 
-#define LEFW_OK               0
-#define LEFW_UNINITIALIZED    1
-#define LEFW_BAD_ORDER        2
-#define LEFW_BAD_DATA         3
-#define LEFW_ALREADY_DEFINED  4
-#define LEFW_WRONG_VERSION    5
-#define LEFW_MIX_VERSION_DATA 6
-#define LEFW_OBSOLETE         7
-
-// orient 
-//   0 = N
-//   1 = W
-//   2 = S
-//   3 = E
-//   4 = FN
-//   5 = FW
-//   6 = FS
-//   7 = FE
-
-// The LEF writer initialization.  Must be called first.
-// Either this routine or lefwInitCbk should be call only,
-// Can't call both routines.
-// This routine must be called only once.
-// Returns 0 if successful. 
-extern int lefwInit(FILE* f);
-
-// The LEF writer initialization.  Must be called first.
-// Either this routine or lefwInit should be call only,
-// Can't call both routines.
-// This routine must be called only once.
-// Returns 0 if successful. 
-extern int lefwInitCbk(FILE* f);
-
-// This routine will set the writer to write out an encrypted
-// lef file.
-// This routine must be called only once and has to be called after
-// lefwInit or lefwInitCbk 
-// Need to call lefwCloseEncrypt to do some cleaning if this routine
-// has called
-extern int lefwEncrypt();
-
-// This routine needs to be called if lefwEncrypt has called.
-// It should be called before the fclose.
-// It does some house cleaning.
-extern int lefwCloseEncrypt();
-
-// This routine will write a blank line
-
-extern int lefwNewLine();
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwVersion (int vers1, int vers2);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful.
-// The caseSensitive can be ON or OFF. 
-extern int lefwCaseSensitive (const char* caseSensitive);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful.
-// The noWireExtensionAtPin can be ON or OFF. 
-extern int lefwNoWireExtensionAtPin (const char* noWireExt);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful.
-//     already have one
-extern int lefwMinfeature (double minFeatureX, double minFeatureY);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwDielectric (double dielectric);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwBusBitChars (const char* busBitChars);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwDividerChar (const char* dividerChar);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwManufacturingGrid (double grid);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.8 syntax.
-// Returns 0 if successful. 
-extern int lefwFixedMask();
-
-// This routine is called after lefwInit.
-// This routine can be called multiple times.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwUseMinSpacing (const char* type, const char* onOff);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwClearanceMeasure (const char* type);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwAntennaInputGateArea (double inputGateArea);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwAntennaInOutDiffArea (double inOutDiffArea);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwAntennaOutputDiffArea (double outputDiffArea);
-
-// This routine is called after lefwInit.
-// This routine can be called only once.
-// Returns 0 if successful.
-// This section of routines is optional.
-// The routine starts the units section. All of the units must follow. 
-extern int lefwStartUnits();
-
-// This routine is called once for each unit.  The call must
-// be preceeded by a call to lefwStartUnits and must be
-// terminated by a call to lefwEndUnits.
-// Returns 0 if successful. 
-extern int lefwUnits(double time,    // optional(0) - TIME NANOSECONDS 
-               double capacitance,   // optional(0) - CAPACITANCE PICOFARADS 
-               double resistance,    // optional(0) - RESISTANCE OHMS 
-               double power,         // optional(0) - POWER MILLIWATTS 
-               double current,       // optional(0) - CURRENT MILLIAMPS 
-               double voltage,       // optional(0) - VOLTAGE VOLTS 
-               double database);     // optional(0) - DATABASE MICRONS 
-
-// This routine is called once for each unit.  It is separated from
-// lefwUnits due to backwards compatible for pre 5.3.
-// Returns 0 if successful. 
-extern int lefwUnitsFrequency(double frequency);
-
-// This routine must be called after the lefwUnits call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndUnits();
-
-// This routine is called after lefwInit.
-// Either this routine or lefwStartLayerRouting must be called.
-// Multiple sections of lefwStartLayer can be called.
-// This routine can be called only once per section.
-// Returns 0 if successful.
-// The routine starts the layer section. All of the layers must follow.
-// The type can be either CUT for Cut Layer, MASTERSLICE or OVERLAP for
-// Masterslice or Overlay Layer. 
-extern int lefwStartLayer(const char* layerName,
-                          const char* type);  // CUT | MASTERSLICE | OVERLAP 
-
-// This routine must be called after lefwStartLayer.
-// This section of routines is optional.
-// Returns 0 if successful.
-// This is a 5.8 syntax. 
-extern int lefwLayerMask(int maskColor);
-
-// This routine must be called after lefwStartLayer.
-// This section of routines is optional.
-// Returns 0 if successful.
-// This is a 5.5 syntax.
-// This routine is called if the layer type is IMPLANT when
-// lefwStartLayer is called. 
-extern int lefwLayerWidth(double minWidth);
-
-// The following APIs are for lefwrite 5.7 Layer, Spacing with type CUT
-// Due to adding new constructs, it is impossible to use the previous
-// APIs.
-// The following APIs are obsoleted in 5.7:
-//    lefwLayer
-//    lefwLayerStack
-//    lefwLayerSpacingAdjacent
-//    lefwLayerSpacingCenterToCenter
-
-// This routine must be called after lefwStartLayer.
-// This routine starts the Layer Type Cut Spacing
-// Returns 0 if successful.
-// The routing lefwLayerCutSpacingEnd has to call at the end of each spacing.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacing(double spacing) ;
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingCenterToCenter();
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingSameNet();
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Either this routine, lefwLayerCutSpacingAdjacent,
-// lefwLayerCutSpacingParallel or lefwLayerCutSpacingArea is called per Spacing.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingLayer(const char* name2,
-                                   int stack);         // optional(0) 
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Either this routine, lefwLayerCutSpacingLayer,
-// lefwLayerCutSpacingParallel or lefwLayerCutSpacingArea is called per Spacing.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingAdjacent(int viaCuts, // either 2, 3, or 4, opt 
-                                      double distance,
-                                      int stack);  // optional(0) 
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Either this routine, lefwLayerCutSpacingLayer,
-// lefwLayerCutSpacingAdjacent or lefwLayerCutSpacingArea is called per Spacing.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingParallel();
-
-// This routine must be called after lefwLayerSpacing
-// This routine is optional.
-// Either this routine, lefwLayerCutSpacingLayer, * lefwLayerCutSpacingAdjacent
-// or lefwLayerCutSpacingParallel is called per Spacing.
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingArea(double cutArea);
-
-// This routine must be called after lefwLayerSpacing
-// This routine marks the end of a Layer Type CUT Spacing
-// Returns 0 if successful.
-// This is a 5.7 syntax. 
-extern int lefwLayerCutSpacingEnd();
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called only once.
-// This section of routines is optional.
-// This is a 5.7 syntax
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerCutSpacingTableOrtho(int numSpacing,
-                                         double* cutWithins,
-                                         double* orthoSpacings);
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called only once.
-// This section of routines is optional.
-// This is a 5.7 syntax
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerArraySpacing(int longArray,    // optional (0) 
-                                 double viaWidth,  // optional (0) 
-                                 double cutSpacing,
-                                 int numArrayCut,
-                                 int* arrayCuts, double* arraySpacings);
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called multiple times.
-// This section of routines is optional.
-// This is a 5.6 syntax.
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerEnclosure(const char* location, //ABOVE|BELOW, optional ""
-                              double overhang1,
-                              double overhang2,
-                              double width);    // optional (0) 
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called multiple times.
-// This routine is similar as lefwLayerEnclosure, but allow user to add
-// EXCEPTEXTRACUT option
-// This section of routines is optional.
-// This is a 5.7 syntax.
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerEnclosureWidth(
-                              const char* location, //ABOVE|BELOW, optional ""
-                              double overhang1,
-                              double overhang2,
-                              double width,         // optional (0) 
-                              double cutWithin);    // optional (0) 
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called multiple times.
-// This routine is to write out minLength inside ENCLOSURE instead of WIDTH
-// as in the routine lefwLayerEnclosure & lefwLayerEnclosureWidth.
-// This section of routines is optional.
-// This is a 5.7 syntax.
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerEnclosureLength(
-                              const char* location, //ABOVE|BELOW, optional ""
-                              double overhang1,
-                              double overhang2,
-                              double minLength);    // optional (0) 
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called multiple times.
-// This section of routines is optional.
-// This is a 5.6 syntax.
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerPreferEnclosure(
-                              const char* location, //ABOVE|BELOW, optional ""
-                              double overhang1,
-                              double overhang2,
-                              double width);    // optional (0) 
-
-// This routine must be called after lefwStartLayer.
-// This routine can be called only once per Layer.
-// This section of routines is optional.
-// This is a 5.6 syntax.
-// Returns 0 if successful.
-// This routine is called if the layer type is CUT when
-// lefwStartLayer is called. 
-extern int lefwLayerResistancePerCut(double resistance);
-
-// This routine must be called after the lefwStartLayer call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful. 
-extern int lefwEndLayer(const char* layerName);
-
-// This routine is called after lefwInit.
-// Either this routine or lefwStartLayer must be called.
-// Multiple section of lefwStartLayer can be called.
-// The routine can be called only once per section.
-// Returns 0 if successful.
-// The routine starts the layer routing section.
-// All of the layers must follow. 
-extern int lefwStartLayerRouting(const char* layerName);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is required for LayerRouting.
-// Returns 0 if successful. 
-extern int lefwLayerRouting(const char* direction, // HORIZONTAL | VERTICAL | 
-                                                   // DIAG45 | DIAG135 
-                            double width);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// Either this routine or lefwLayerRoutingPitchXYDistance can be called
-// but not both
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingPitch(double pitch);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// Either this routine or lefwLayerRoutingPitch can be called but not both
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingPitchXYDistance(double xDistance, double yDistance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// Either this routine or lefwLayerRoutingDiagPitchXYDistance can be called
-// but not both
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingDiagPitch(double distance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// Either this routine or lefwLayerRoutingDiagPitch can be called
-// but not both
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingDiagPitchXYDistance(double diag45Distance,
-                                               double diag135Distance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingDiagWidth(double diagWidth);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingDiagSpacing(double diagSpacing);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingDiagMinEdgeLength(double diagLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Either this routine or lefwLayerRoutingOffsetXYDistance can be called
-// but not both
-// Returns 0 if successful. 
-extern int lefwLayerRoutingOffset(double offset);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Either this routine or lefwLayerRoutingOffset can be called but not both
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingOffsetXYDistance(double xDistance, double yDistance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingArea(double area);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinsize(int numRect, double* minWidth,
-                                   double* minLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinimumcut(double numCuts, double minWidth);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is similar as lefwLayerRoutingMinimumcut, but allow user
-// to specify value for WITHIN
-// This is a 5.7 syntax.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinimumcutWithin(double numCuts, double minWidth,
-                                            double cutDistance);
-
-// This routine must be called only once after lefwLayerRoutingMinimumcut.
-// This routine is optional.
-// Direction can be either FROMABOVE or FROMBELOW
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinimumcutConnections(const char* direction);
-
-// This routine must be called only once after lefwLayerRoutingMinimumcut.
-// This routine is optional.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinimumcutLengthWithin(double length,
-               double distance);
-
-// This routine must be called multiple time after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacing(double spacing);
-
-// Either this routine, lefwLayerRoutingSpacingLengthThreshold or
-// lefwLayerRoutingSpacingSameNet can be
-// called only once after lefwLayerRoutingSpacing.
-// This routine is optional.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingRange(double minWidth, double maxWidth);
-
-// Either this routine or lefwLayerRoutingSpacingRangeInfluence or
-// lefwLayerRoutingSpacingRangeRange can
-// be called once after llefwLayerRoutingSpacingRange.
-// This routine is valid only if either or both leftRange and rightRange
-// in lefwLayerRoutingSpacing are non zero
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingRangeUseLengthThreshold();
-
-// Either this routine or lefwLayerRoutingSpacingRangeUseLengthThreshold or
-// lefwLayerRoutingSpacingRangeRange can be called once after
-// lefwLayerRoutingSpacingRange.
-// subMinWidth & subMaxWidth are optional.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingRangeInfluence(double infValue,
-              double subMinWidth, double subMaxWidth);
-
-// Either this routine or lefwLayerRoutingSpacingRangeUseLengthThreshold or
-// lefwLayerRoutingSpacingRangeInfluence can be called once after
-// lefwLayerRoutingSpacingRange.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingRangeRange(double minWidth, double maxWidth);
-
-// Either this routine, lefwLayerRoutingSpacingRange or
-// lefwLayerRoutingSpacingSameNet can be
-// be called once after lefwLayerRoutingSpacing.
-// minWidth & maxWidth are optional.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingLengthThreshold(double lengthValue,
-              double minWidth, double maxWidth);
-
-// Either this routine, lefwLayerRoutingSpacingRange or
-// lefwLayerRoutingSpacingRange can be
-// be called once after lefwLayerRoutingSpacing.
-// This is a 5.7 routine.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingSameNet(int PGOnly) ; // optional (0) 
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingEndOfLine(double eolWidth, double eolWithin);
-
-// This routine must be called only once after lefwLayerRoutingSpacingEndOfLine
-// This routine is optional
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingEOLParallel(double parSpace, double parWithin,
-                                              int twoEdges); // optional(0) 
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingNotchLength(double minNLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingEndOfNotchWidth(double eonWidth,
-                  double minNSpacing, double minNLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingWireExtension(double wireExtension);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingResistance(const char* resistance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingCapacitance(const char* capacitance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingHeight(double height);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingThickness(double thickness);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingShrinkage(double shrinkage);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingCapMultiplier(double capMultiplier);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingEdgeCap(double edgeCap);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingAntennaArea(double antennaArea);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional
-// Returns 0 if successful. 
-extern int lefwLayerRoutingAntennaLength(double antennaLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This is a 5.5 syntax.
-// width is the maximum width.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMaxwidth(double width);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This is a 5.5 syntax.
-// width is the maximum width.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinwidth(double width);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional.
-// This is a 5.5 syntax.
-// Area is the minimum area size limit for metal that encloses an empty area.
-// Width is optional, it says the rule only applies when a donut is careted
-// from a wire of width <= width.  The parameter width is required for the
-// routine lefwLayerRoutineMinenclosedarea.  If width is optional, a "0"
-// value is assigned for that index slot of the array.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinenclosedarea(int numMinenclosed, double* area,
-                                           double* width);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinstep(double distance);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This routine is equivalent to lefwLayerRoutingMinstep, except it also
-// takes the options for type & Lengthsum.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinstepWithOptions(double distance,
-                       const char* rule, // INSIDECORNER|OUTSIDECORNER|STEP 
-                       double maxLength);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This routine is equivalent to lefwLayerRoutingMinstep, except it also
-// takes the option for MaxEdges.
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingMinstepMaxEdges(double distance,
-                                           double maxEdges);
-
-// This routine must be called only once after lefwStartLayerRouting.
-// This routine is optional and can be called once.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingProtrusion(double width1, double length,
-                                      double width2);
-
-// This routine must be called only after lefwStartLayerRouting.
-// This routine is optional and can be called multiple times.
-// This is a 5.5 syntax.
-// numLength has the size of the array length.
-// length is an array of length values.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingStartSpacingtableParallel(int numLength,
-                                                     double* length);
-
-// This routine must be called only after
-// lefwLayerRoutingStartSpacingtableParallel.
-// This routine is required after lefwLayerRoutingStartSpacingtableParallel.
-// This routine can be called multiple times.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingSpacingtableParallelWidth(double width,
-                                     int numSpacing, double* spacing);
-
-// This routine must be called only after lefwStartLayerRouting.
-// This routine is optional and can be called multiple times.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingStartSpacingtableInfluence();
-
-// This routine must be called only after
-// lefwLayerRoutingStartSpacingtableInfluence.
-// This routine is required after lefwLayerRoutingStartSpacingtableInfluence.
-// This routine can be called multiple times.
-// This is a 5.5 syntax.
-// Returns 0 if successful.  
-extern int lefwLayerRoutingSpacingInfluenceWidth(double width, double distance,
-                                     double spacing);
-
-// This routine must be called only after lefwStartLayerRouting.
-// This routine is optional and can be called multiple times.
-// This is a 5.7 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutingStartSpacingtableTwoWidths();
-
-// This routine must be called only after
-// lefwLayerRoutingStartSpacingtableInfluence.
-// This routine is required after lefwLayerRoutingStartSpacingtableTwoWidths.
-// This routine can be called multiple times.
-// This is a 5.7 syntax.
-// Returns 0 if successful.  
-extern int lefwLayerRoutingSpacingtableTwoWidthsWidth(double width,
-                                     double runLength, // PRL, optional (0) 
-                                     int numSpacing,
-                                     double* spacing);
-
-// This routine can be called after lefwLayerRoutingStartSpacingtableParallel
-// or lefwLayerRoutingStartSpacingtableInfluence.
-// It can only be called once.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerRoutineEndSpacingtable();
-
-// This routine must be called after the lefwStartLayer call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful. 
-extern int lefwEndLayerRouting(const char* layerName);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called multiple times.
-// if the value for the variable value is not 0, one of the following
-// routines have to be called: lefwLayerACFrequency,
-// lefwLayerACWidth, lefwLayerACCutarea, or
-// lefwLayerACTableEntries
-// Returns 0 if successful. 
-extern int lefwLayerACCurrentDensity(const char* type, double value);
-
-// This routine must be called after lefwLayerACCurrentDensity.
-// This routine is required and can be called only once after each
-// lefwLayerACCurrentDensity.
-// Returns 0 if successful. 
-extern int lefwLayerACFrequency(int numFrequency, double* frequency);
-
-// This routine must be called after lefwLayerACCurrentDensity.
-// This routine is optional and can be called only once after each
-// lefwLayerACCurrentDensity.
-// This routine can only be called in Layer Routing
-// Returns 0 if successful. 
-extern int lefwLayerACWidth(int numWidths, double* widths);
-
-// This routine must be called after lefwLayerACCurrentDensity.
-// This routine is optional and can be called only once after each
-// lefwLayerACCurrentDensity.
-// This routine can only be called in Layer
-// Returns 0 if successful. 
-extern int lefwLayerACCutarea(int numCutareas, double* cutareas);
-
-// This routine must be called after lefwLayerACCurrentDensity.
-// This routine is required and can be called only once after each
-// lefwLayerACCurrentDensity.
-// Returns 0 if successful. 
-extern int lefwLayerACTableEntries(int numEntries, double* entries);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called multiple times.
-// if the value for the variable value is not 0, one of the following
-// routines have to be called: lefwLayerDCWidth, lefwLayerDCCutarea, or
-// lefwLayerDCTableEntries
-// Returns 0 if successful. 
-extern int lefwLayerDCCurrentDensity(const char* type, double value);
-
-// This routine must be called after lefwLayerDCCurrentDensity.
-// This routine is optional and can be called only once after each
-// lefwLayerDCCurrentDensity.
-// This routine can only be called in Layer Routing
-// Returns 0 if successful. 
-extern int lefwLayerDCWidth(int numWidths, double* widths);
-
-// This routine must be called after lefwLayerDCCurrentDensity.
-// This routine is optional and can be called only once after each
-// lefwLayerDCCurrentDensity.
-// This routine can only be called in Layer
-// Returns 0 if successful. 
-extern int lefwLayerDCCutarea(int numCutareas, double* cutareas);
-
-// This routine must be called after lefwLayerDCCurrentDensity.
-// This routine is required and can be called only once after each
-// lefwLayerDCCurrentDensity.
-// Returns 0 if successful. 
-extern int lefwLayerDCTableEntries(int numEntries, double* entries);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional.  The oxide value, can be either OXIDE1, OXIDE2,
-// OXIDE3, or OXIDE4.  Each can only be called once within a layer.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaModel(const char* oxide);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaDiffAreaRatioPwl can be called, but
-// not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaDiffAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaDiffAreaRatio can be called, but
-// not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaDiffAreaRatioPwl(int numPwls,
-               double* diffusions, double* ratios);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaCumDiffAreaRatioPwl can be called,
-// but not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumDiffAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaCumDiffAreaRatio can be called, but
-// not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumDiffAreaRatioPwl(int numPwls,
-               double* diffusions, double* ratios);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// The option DIFFUSEONLY is a 5.4 syntax.
-// If DIFFUSEONLY, lefwLayerRoutingAntennaLength is not allowed.
-// This function is similar to lefwLayerRoutingAntennaArea
-// diffUseOnly has to be DIFFUSEONLY.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaAreaFactor(double value,
-               const char* diffUseOnly);    // optional(NULL) 
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING.
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaSideAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING.
-// Either this routine or lefwLayerAntennaDiffSideAreaRatioPwl can be
-// called, but not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaDiffSideAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaDiffSideAreaRatio can be called,
-// but not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaDiffSideAreaRatioPwl(int numPwls,
-               double* diffusions, double* ratios);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING.
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumSideAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING.
-// Either this routine or lefwLayerAntennaCumDiffSideAreaRatioPwl can be
-// called, but not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumDiffSideAreaRatio(double value);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// Either this routine or lefwLayerAntennaCumDiffSideAreaRatio can be called,
-// but not both
-// This is a 5.4 syntax.
-// Either this routine or lefwLayerRoutingAntennaLength is allowed, not both.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumDiffSideAreaRatioPwl(int numPwls,
-               double* diffusions, double* ratios);
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING.
-// The option DIFFUSEONLY is a 5.4 syntax.
-// diffUseOnly has to be DIFFUSEONLY.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaSideAreaFactor(double value,
-               const char* diffUseOnly);    // optional(NULL) 
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.7 routine.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaCumRoutingPlusCut() ;
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.7 routine.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaGatePlusDiff(double plusDiffFactor) ;
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.7 routine.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaAreaMinusDiff(double minusDiffFactor) ;
-
-// This routine must be called after lefwStartLayerRouting or lefwStartLayer.
-// This routine is optional and can be called only once within a layer 
-// after each lefwLayerAntennaModel function.
-// This routine is valid only if the layer type is either ROUTING or CUT.
-// This is a 5.7 routine.
-// Returns 0 if successful. 
-extern int lefwLayerAntennaAreaDiffReducePwl(int numPwls,
-               double* diffAreas, double* metalDiffFactors);
-
-// This routine must be called only once after lefwStartLayer.
-// The option MINIMUMDENSITY is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwMinimumDensity(double minDensity);
-
-// This routine must be called only once after lefwStartLayer.
-// The option MAXIMUMDENSITY is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwMaximumDensity(double maxDensity);
-
-// This routine must be called only once after lefwStartLayer.
-// The option DENSITYCHECKWINDOW is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwDensityCheckWindow(double checkWindowLength,
-                                  double checkWindowWidth);
-
-// This routine must be called only once after lefwStartLayer.
-// The option DENSITYCHECKSTEP is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwDensityCheckStep(double checkStepValue);
-
-// This routine must be called only once after lefwStartLayer.
-// The option FILLACTIVESPACING is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwFillActiveSpacing(double fillToActiveSpacing);
-
-// This routine must be called only once after all the layers.
-// This routine is optional.
-// This is a 5.5 syntax.
-// Returns 0 if succesful. 
-extern int lefwMaxviastack(int value,
-                           const char* bottomLayer, // optional (NULL) 
-                           const char* topLayer);   // optional (NULL) 
-
-// This routine is called after lefwInit.
-// This section of routines is optional.
-// The routine can be called only once.
-// Returns 0 if successful.
-// The routine starts propertydefinitions section. 
-extern int lefwStartPropDef();
-
-// This routine must be called after lefwStartPropDef.
-// This routine can be called multiple times.
-// It adds integer property definition to the statement.
-// Returns 0 if successful.
-// The objType can be LIBRARY or VIA or MACRO or PIN. 
-extern int lefwIntPropDef(
-               const char* objType,   // LIBRARY | LAYER | VIA | VIARULE |
-                                      // NONDEFAULTRULE | MACRO | PIN 
-               const char* propName,
-               double leftRange,      // optional(0) - RANGE 
-               double rightRange,     // optional(0) 
-               int    propValue);     // optional(NULL) 
-
-// This routine must be called after lefwStartPropDef.
-// This routine can be called multiple times.
-// It adds real property definition to the statement.
-// Returns 0 if successful.
-// The objType can be LIBRARY or VIA or MACRO or PIN. 
-extern int lefwRealPropDef(
-               const char* objType,   // LIBRARY | LAYER | VIA | VIARULE |
-                                      // NONDEFAULTRULE | MACRO | PIN 
-               const char* propName,
-               double leftRange,      // optional(0) - RANGE 
-               double rightRange,     // optional(0) 
-               double propValue);     // optional(NULL) 
-
-// This routine must be called after lefwStartPropDef.
-// This routine can be called multiple times.
-// It adds string property definition to the statement.
-// Returns 0 if successful.
-// The objType can be LIBRARY or VIA or MACRO or PIN. 
-extern int lefwStringPropDef(
-               const char* objType,    // LIBRARY | LAYER | VIA | VIARULE |
-                                       //  NONDEFAULTRULE | MACRO | PIN 
-               const char* propName,
-               double leftRange,       // optional(0) - RANGE 
-               double rightRange,      // optional(0) 
-               const char* propValue); // optional(NULL) 
-
-// This routine must be called after the lefwStartPropDef call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndPropDef();
-
-// This routine is called after lefwInit.
-// This routine must be called only once.
-// Returns 0 if successful.
-// The routine starts the via section. All of the vias must follow. 
-extern int lefwStartVia(const char* viaName,
-               const char* isDefault);    // optional(NULL) - DEFAULT 
-
-// This routine is optional, it call only be called after lefwStartVia.
-// It can only be called once.
-// Returns 0 if successful. 
-extern int lefwViaTopofstackonly();       // TOPOFSTACKONLY 
-
-// This routine is optional, it call only be called after lefwStartVia.
-// It can only be called once.
-// Returns 0 if successful. 
-extern int lefwViaForeign(const char* foreignName,
-               double xl,            // optional(0) - pt(x) 
-               double yl,            // optional(0) - pt(y) 
-               int orient);          // optional(-1) 
-
-// This routine is optional, it call only be called after lefwStartVia.
-// It can only be called once.
-// Returns 0 if successful.
-// This routine is the same as lefwViaForeign, except orient is a char* 
-extern int lefwViaForeignStr(const char* foreignName,
-               double xl,            // optional(0) - pt(x) 
-               double yl,            // optional(0) - pt(y) 
-               const char* orient);  // optional("") 
-
-// This routine is optional, it call only be called after lefwStartVia.
-// Either this routine or lefwViaViarule can be called within a via.
-// It can only be called once in a via.
-// Returns 0 if successful. 
-extern int lefwViaResistance(double resistance); // RESISTANCE 
-
-// This routine must be called after lefwStartVia.
-// It can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwViaLayer(const char* layerName);  // LAYER 
-
-// This routine can call only after lefwViaLayer.
-// Either this routine or lefwViaLayerPolygon can be called within a layer
-// It can be called multiple times.
-// Returns 0 if successful. 
-// mask is 5.8 syntax  
-extern int lefwViaLayerRect(double x1l,   // RECT pt1(x) 
-                            double y1l,   // RECT pt1(y) 
-                            double x2l,   // RECT pt2(x) 
-                            double y2l,   // RECT pt2(y) 
-                int mask = 0); 
-
-// This routine can call only after lefwViaLayer.
-// Either this routine or lefwViaLayerRect can be called within a layer
-// It can be called multiple times.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-// mask is 5.8 syntax  
-extern int lefwViaLayerPolygon(int num_polys, double* xl, double* yl,
-                   int mask = 0);
-
-// This routine can call only after lefwStartVia.
-// Either this routine or lefwViaResistance can be called within a via.
-// It can only be called once in a via.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwViaViarule(const char* viaRuleName,
-                          double xCutSize, double yCutSize,
-                          const char* botMetalLayer, const char* cutLayer,
-                          const char* topMetalLayer,
-                          double xCutSpacing, double yCutSpacing,
-                          double xBotEnc, double yBotEnc,
-                          double xTopEnc, double yTopEnc);
-
-// This routine can call only after lefwViaViarule.
-// It can only be called once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwViaViaruleRowCol(int numCutRows, int numCutCols);
-
-// This routine can call only after lefwViaViarule.
-// It can only be called once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwViaViaruleOrigin(double xOffset, double yOffset);
-
-// This routine can call only after lefwViaViarule.
-// It can only be called once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwViaViaruleOffset(double xBotOffset, double yBotOffset,
-                                double xTopOffset, double yTopOffset);
-
-// This routine can call only after lefwViaViarule.
-// It can only be called once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwViaViarulePattern(const char* cutPattern);
-
-// This routine is called after lefwVia.
-// This routine is optional, it adds string property to the statement.
-// It can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwStringProperty(const char* propName, const char* propValue);
-
-// This routine is called after lefwVia.
-// This routine is optional, it adds real property to the statement.
-// It can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwRealProperty(const char* propName, double propValue);
-
-// This routine is called after lefwVia.
-// This routine is optional, it adds int property to the statement.
-// It can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwIntProperty(const char* propName, int propValue);
-
-// This routine must be called after the lefwStartVia call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndVia(const char* viaName);
-
-// This routine is called after lefwInit.
-// This routine must be called as a set with lefwViaRuleLayer, lefwViaRuleVia
-// and lefwEndViaRule
-// multiple times.
-// Returns 0 if successful.
-// The routine starts the via rule section. The via rule data and its property
-// must follow 
-extern int lefwStartViaRule(const char* viaRuleName);
-
-// This routine is called after lefwStartViaRule.
-// This routine has to be called 2 times exact.
-// Returns 0 if successful.
-// The direction1 or direction2 can be HORIZONTAL or VERTICAL. 
-extern int lefwViaRuleLayer(
-               const char* layerName,
-               const char* direction,    // HORIZONTAL | VERTICAL 
-               double minWidth,          // optional(0) - WIDTH 
-               double maxWidth,          // optional(0) - WIDTH 
-               double overhang,          // optional(0) - OVERHANG 
-               double metalOverhang);    // optional(0) - METALOVERHANG 
-
-// This routine is called after lefwViaRuleLayer is called twice.
-// This routine is required in a viarule and can be called more than once.
-// Returns 0 if successful.
-// The direction1 or direction2 can be HORIZONTAL or VERTICAL. 
-extern int lefwViaRuleVia(
-               const char* viaName);
-
-// This routine must be called after the lefwStartViaRule call (if any).
-// The routine can be called only once per lefwStartViaRule.
-// Returns 0 if successful. 
-extern int lefwEndViaRule(const char* viaRuleName);
-
-// This routine is called after lefwInit.
-// This routine must be called as a set with lefwViaRuleGenLayer,
-// lefwViaRuleGenLayer3, and lefwEndViaRuleGen multiple times.
-// Returns 0 if successful.
-// The routine starts the via rule section. The via rule data and its property
-// must follow 
-extern int lefwStartViaRuleGen(const char* viaRuleName);
- 
-// This routine is called after lefwSartViaRuleGen.
-// This routine is optional
-// Returns 0 if successful  
-extern int lefwViaRuleGenDefault();
-
-// This routine is called after lefwStartViaRuleGen.
-// This routine has to be called 2 times exact.
-// Returns 0 if successful.
-// Either this routine or lefwViaRuleGenLayerEnclosure, not both.
-// The direction1 or direction2 can be HORIZONTAL or VERTICAL. 
-extern int lefwViaRuleGenLayer(
-               const char* layerName,
-               const char* direction,    // HORIZONTAL | VERTICAL 
-               double minWidth,          // optional(0) - WIDTH 
-               double maxWidth,          // optional(0) - WIDTH 
-               double overhang,          // optional(0) - OVERHANG 
-               double metalOverhang);    // optional(0) - METALOVERHANG 
-
-// This routine is called after lefwStartViaRuleGen.
-// This routine has to be called 2 times exact.
-// This is 5.5 syntax
-// Returns 0 if successful.
-// Either this routine or lefwViaRuleGenLayer, not both. 
-extern int lefwViaRuleGenLayerEnclosure(
-               const char* layerName,
-               double overhang1,
-               double overhang2,
-               double minWidth,          // optional(0) - WIDTH 
-               double maxWidth);         // optional(0) - WIDTH 
- 
-// This routine is called after lefwViaRuleLayerGen is called twice.
-// This routine is optional in a viarule generate and can be called once.
-// Returns 0 if successful.
-// The direction1 or direction2 can be HORIZONTAL or VERTICAL. 
-extern int lefwViaRuleGenLayer3(
-               const char* layerName,
-               double xl, double yl,      // RECT pt1(x), pt1(y) 
-               double xh, double yh,      // RECT pt2(x), pt2(y) 
-               double xSpacing, double ySpacing, // SPACING x and y 
-               double resistance);        // optional(0) - RESISTANCE 
- 
-// This routine must be called after the lefwStartViaRuleGen call (if any).
-// The routine can be called only once per lefwStartViaRuleGen.
-// Returns 0 if successful. 
-extern int lefwEndViaRuleGen(const char* viaRuleName);
- 
-
-// This routine is called after lefwInit.
-// This routine must be called only once.
-// Returns 0 if successful.
-// The routine starts the nonDefaultRule section. The nonDefaultRule layers
-// must follow 
-extern int lefwStartNonDefaultRule(const char* ruleName);
-
-// This routine is called after lefwInit.
-// This routine must be called after lefwStartNonDefaultRule
-// This routine can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleLayer(const char* routingLayerName,
-               double width,           // WIDTH 
-               double minSpacing,      // MINSPACING 
-               double wireExtension,   // optinal(0) - WIREEXTENSION 
-               double resistance,      // optinal(0) - RESISTANCE RPERQ 
-               double capacitance,     // optinal(0) - CAPACITANCE CPERSQDIST
-               double edgeCap);        // optinal(0) - EDGECAPACITANCE 
-
-// This routine is called after lefwInit.
-// This routine must be called after lefwStartNonDefaultRule
-// This routine is optional and it can be called only once.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleHardspacing();
-
-// This routine is called after lefwStartNonDefaultRule.
-// This routine must be called only once for each via section.
-// Returns 0 if successful.
-// The routine starts the nondefaultrule via section.
-// Call the following via functions for the rest of NONDEFAULTRULE VIA:
-//   lefwViaTopofstackonly
-//   lefwViaForeign
-//   lefwViaForeignStr
-//   lefwViaResistance
-//   lefwViaLayer
-//   lefwViaLayerRect
-//   lefwNonDefaultRuleEndVia 
-extern int lefwNonDefaultRuleStartVia(const char* viaName,
-               const char* isDefault);    // optional(NULL) - DEFAULT 
-
-// This routine must be called after the lefwNonDefaultRuleStartVia call.
-// The routine can be called only once per via section.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleEndVia(const char* viaName);
-
-// This routine is called after lefwStartNonDefaultRule.
-// This routine can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleUseVia(const char* viaName);
-
-// This routine is called after lefwStartNonDefaultRule.
-// This routine can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleUseViaRule(const char* viaRuleName);
-
-// This routine is called after lefwStartNonDefaultRule.
-// This routine can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwNonDefaultRuleMinCuts(const char* layerName, int numCuts);
-
-// This routine must be called after the lefwStartNonDefaultRule call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndNonDefaultRule(const char* ruleName);
-
-// This routine is called after lefwInit.
-// This section of routines is optional.
-// This routine can be called only once.
-// Returns 0 if successful.
-// It starts the spacing section. 
-extern int lefwStartSpacing();
-
-// This routine must be called after lefwStartSpacing.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The stack has to be STACK. 
-extern int lefwSpacing(const char* layerName1,
-               const char* layerName2,
-               double minSpace,
-               const char* stack);        // optional(NULL) 
-
-// This routine must be called after the lefwStartSpacing call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndSpacing();
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwUniversalNoiseMargin (double high, double low);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEdgeRateThreshold1 (double num);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEdgeRateThreshold2 (double num);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEdgeRateScaleFactor (double num);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This routine starts the noisetable section.
-// This api is obsolete in 5.4. 
-extern int lefwStartNoiseTable(int num);
-
-// This routine is called after lefwStartNoiseTable or lefwStartCorrectTable.
-// This routine is optional and it can be called multiple times
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEdgeRate(double num) ;
-
-// This routine is called after lefwEdgeRate.
-// This routine is optional and it can be called only once inside lefwEdgeRate.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwOutputResistance(int numResists, double* resistance);
-
-// This routine is called after lefwOutputResistance.
-// This routine is optional and it can be called multiple times inside
-// lefwOutputResistance
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwVictims(int length, int numNoises, double* noises);
-
-// This routine must be called after the lefwStartNoiseTable call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEndNoiseTable();
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This routine starts the correctTable section.
-// This api is obsolete in 5.4. 
-extern int lefwStartCorrectTable(int num);
-
-// This routine must be called after the lefwStartCorrectTable call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEndCorrectTable();
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful. 
-extern int lefwMinFeature (double x, double y);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-// extern int lefwDielectric (float dielectric); 
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful.
-// This routine starts the irdrop section.
-// This api is obsolete in 5.4. 
-extern int lefwStartIrdrop();
-
-// This routine is must be called after lefwStartIrdrop.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The currentsNvolts is a list of current and volts.
-// This api is obsolete in 5.4. 
-extern int lefwIrdropTable(const char* tableName, const char* currentsNvolts);
-
-// This routine must be called after the lefwStartIrdrop call (if any).
-// The routine can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEndIrdrop();
-
-// This routine is must be called after lefwInit.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The classType can be PAD or CORE.
-// The symmetry can be a list of X or Y or R90. 
-extern int lefwSite(const char* siteName, const char* classType,
-              const char* symmetry, double width, double height);
-
-// This routine is must be called after lefwSite.
-// It can be called multiple times.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwSiteRowPattern(const char* siteName, int orient);
-
-// This routine is must be called after lefwSite.
-// It can be called multiple times.
-// This is a 5.6 syntax.
-// Returns 0 if successful.
-// This routine is the same as lefwSiteRowPattern, except orient is a char* 
-extern int lefwSiteRowPatternStr(const char* siteName, const char *orient);
-
-// This routine must be called after the lefwSite call (if any).
-// The routine can be called only once after lefwSite.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwEndSite(const char* siteName);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called multiple times.
-// Returns 0 if successful.
-// This routine starts the array section. 
-extern int lefwStartArray(const char* arrayName);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArrayCanplace, lefwArrayCannotoccupy,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful. 
-extern int lefwArraySite(const char* name, double origX, double origY,
-               int orient, double numX, double numY, double spaceX,
-               double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArrayCanplace, lefwArrayCannotoccupy,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful.
-// This routine is the same as lefwArraySite, except orient is a char* 
-extern int lefwArraySiteStr(const char* name, double origX, double origY,
-               const char *orient, double numX, double numY, double spaceX,
-               double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCannotoccupy,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful. 
-extern int lefwArrayCanplace(const char* name, double origX, double origY,
-               int orient, double numX, double numY, double spaceX,
-               double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCannotoccupy,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful.
-// This routine is the same as lefwArrayCanplace, except orient is a char* 
-extern int lefwArrayCanplaceStr(const char* name, double origX, double origY,
-               const char *orient, double numX, double numY, double spaceX,
-               double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCanplace,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful. 
-extern int lefwArrayCannotoccupy(const char* name, double origX, double origY,
-               int orient, double numX, double numY, double spaceX,
-               double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCanplace,
-// lefwArrayTracks, or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful.
-// This routine is the same as lefwArrayTracks, except orient is a char* 
-extern int lefwArrayCannotoccupyStr(const char* name, double origX,
-               double origY, const char *orient, double numX, double numY,
-               double spaceX, double spaceY);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCanplace, lefwArrayCannotoccupy,
-// or lefwStartArrayFloorplan must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful. 
-extern int lefwArrayTracks(const char* xy, double start, int numTracks,
-               double space, const char* layers);
-
-// This routine is called after lefwStartArray. 
-// Either this routine, lefwArraySite, lefwArrayCanplace, lefwArrayCannotoccupy,
-// or lefwArrayTracks must be called at least once.
-// It can be call multiple times.
-// Returns 0 if successful.
-// The routine starts the array floorplan section 
-extern int lefwStartArrayFloorplan(const char* name);
-
-// This routine must be called after lefwStartArrayFloorplan.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The site can be CANPLACE or CANNOTOCCUPY 
-extern int lefwArrayFloorplan(const char* site, const char* name,
-                              double origX, double origY, int orient,
-                              int numX, int numY, double spaceX, double spaceY);
-
-// This routine must be called after lefwStartArrayFloorplan.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The site can be CANPLACE or CANNOTOCCUPY
-// This routine is the same as lefwArrayFloorplan, except orient is a char* 
-extern int lefwArrayFloorplanStr(const char* site, const char* name,
-                              double origX, double origY, const char *orient,
-                              int numX, int numY, double spaceX, double spaceY);
-
-// This routine must be called after the lefwStartArrayFloorplan call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful. 
-extern int lefwEndArrayFloorplan(const char* name);
-
-// This routine is called after lefwStartArray.
-// This routine is optional.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The xy can be X or Y. 
-extern int lefwArrayGcellgrid(const char* xy, double startXY, int colRows, 
-               double spaceXY);
-
-// This routine is called after lefwStartArray.
-// This section of routines is optional and can be call only once.
-// Returns 0 if successful.
-// The routine starts the array defaultcap section 
-extern int lefwStartArrayDefaultCap(int size);
-
-// This routine must be called after lefwStartArrayDefaultCap.
-// It can be called multiple times.
-// Returns 0 if successful. 
-extern int lefwArrayDefaultCap(double numPins, double cap);
-
-// This routine must be called after the lefwStartArrayDefaultCap call (if any).
-// The routine can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndArrayDefaultCap();
-
-// This routine must be called after the lefwStartArray call (if any).
-// The routine can be called only once per section.
-// Returns 0 if successful. 
-extern int lefwEndArray(const char* arrayName);
-
-// This routine is must be called after lefwInit.
-// This routine can be called multiple times.
-// Returns 0 if successful.
-// This routine starts the macro section. 
-extern int lefwStartMacro(const char* macroName);
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful.
-// The value1 can be COVER, RING, BLOCK, PAD, CORE, or ENCAP.
-// The value2 can be BUMP if value1 is COVER,
-// or BLACKBOX, or SOFT if value1 is BLOCK,
-// or INPUT, OUTPUT, INOUT, POWER, or SPACER if value1 is PAD,
-// or FEEDTHRU, TIEHIGH, TIELOW, SPACER, ANTENNACELL, or WELLTAP
-// if value1 is CORE,
-// or PRE, POST, TOPLEFT, TOPRIGHT, BOOTOMLEFT, or BOTTOMRIGHT if value1 is
-// ENCAP. 
-extern int lefwMacroClass(const char* value1,
-                          const char* value2);     // optional(NULL)
-
-// This routine is must be called after lefwInit.
-// This routine can be called multiple times.
-// Returns 0 if successful.
-// This is a 5.8 syntax. 
-extern int lefwMacroFixedMask();
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful.
-// The value1 can be USER, GENERATE, or BLOCK. 
-extern int lefwMacroSource(const char* value1);
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called multiple times per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroForeign(const char* name,
-               double xl,          // optional(0) - pt(x) 
-               double yl,          // optional(0) - pt(y) 
-               int orient);        // optional(-1) - 0 to 7 
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called multiple times per macro section.
-// Returns 0 if successful.
-// This routine is the same as lefwMacroForeign, except orient is a char* 
-extern int lefwMacroForeignStr(const char* name,
-               double xl,             // optional(0) - pt(x) 
-               double yl,             // optional(0) - pt(y) 
-               const char *orient);   // optional("") 
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroOrigin(double xl,   // pt(x) 
-                           double yl);  // pt(y) 
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroEEQ(const char* macroName);
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroLEQ(const char* macroName);
-
-// This routine is called after lefwStartMacro.
-// This routine must be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroSize(double width, double height);
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful.
-// The symmetry can be a list of X, Y, or R90 
-extern int lefwMacroSymmetry(const char* symmetry);
-
-// This routine is called after lefwStartMacro.
-// This routine must be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroSite(const char* siteName);
-
-// This routine is called after lefwStartMacro.
-// This routine must be called at least once per macro section.
-// Returns 0 if successful. 
-extern int lefwMacroSitePattern(const char* name,
-                                double origX, double origY,  // optional(0) 
-                                int orient,                  // optional(-1) 
-                                int numX, int numY,          // optional(0) 
-                                double spaceX, double spaceY); // optional(0) 
-
-// This routine is called after lefwStartMacro.
-// This routine must be called at least once per macro section.
-// Returns 0 if successful.
-// This routine is the same as lefwMacroSitePattern, except orient is a char* 
-extern int lefwMacroSitePatternStr(const char* name,
-                                double origX, double origY,    // optional(0) 
-                                const char *orient,          // optional (-1) 
-                                int numX, int numY,            // optional(0) 
-                                double spaceX, double spaceY); // optional(0) 
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPower(double power);
-
-// This routine must be called after the lefwStartMacro call (if any).
-// The routine can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwEndMacro(const char* macroName);
-
-// This routine is called after lefwStartMacro.
-// This routine is optional and can be called only once per macro section.
-// This is a 5.6 syntax.
-// Returns 0 if successful.
-extern int lefwStartMacroDensity(const char* layerName);
-
-// This routine is called after lefwStartMacroDensity.
-// This routine can be called multiple times.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroDensityLayerRect(double x1, double y1,
-                                     double x2, double y2,
-                                     double densityValue);
-
-// This routine must be called after the lefwStartMacroPin call (if any).
-// The routine can be called only once per macro section.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwEndMacroDensity();
-
-// This routine must be called after the lefwStartMacro call (if any).
-// The routine can be called multiple time.
-// Returns 0 if successful.
-// It starts the macro pin section within macro. 
-extern int lefwStartMacroPin(const char* pinName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful. 
-extern int lefwMacroPinTaperRule(const char* ruleName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful. 
-extern int lefwMacroPinForeign(const char* name,
-               double xl,       // optional(0) 
-               double yl,       // optional(0) 
-               int orient);     // optional(-1) - 0 to 7 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// Ths routine is the same as lefwMacroPinForeign, except orient is a char* 
-extern int lefwMacroPinForeignStr(const char* name,
-               double xl,             // optional(0) 
-               double yl,             // optional(0) 
-               const char* orient);   // optional("") 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful. 
-extern int lefwMacroPinLEQ(const char* pinName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// The direction can be INPUT, OUTPUT, OUTPUT TRISTATE, INOUT, or FEEDTHRU. 
-extern int lefwMacroPinDirection(const char* direction);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// The use can be SIGNAL, ANALOG, POWER, GROUND, or CLOCK. 
-extern int lefwMacroPinUse(const char* use);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// The namce can be ABUTMENT, RING, or FEEDTHRU. 
-extern int lefwMacroPinShape(const char* name);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful. 
-extern int lefwMacroPinMustjoin(const char* name);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroPinNetExpr(const char* name);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroPinSupplySensitivity(const char* pinName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.6 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroPinGroundSensitivity(const char* pinName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinOutputnoisemargin(int high, int low);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinOutputresistance(int high, int low);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinInputnoisemargin(int high, int low);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinPower(double power);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinLeakage(double leakage);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinCapacitance(double capacitance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinResistance(double resistance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinPulldownres(double resistance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinTieoffr(double resistance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinVHI(double voltage);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinVLO(double voltage);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinRisevoltagethreshold(double voltage);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinFallvoltagethreshold(double voltage);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinRisethresh(double capacitance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinFallthresh(double capacitance);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinRisesatcur(double current);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinFallsatcur(double current);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// The name can be ACTIVE or RESISTIVE.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinCurrentsource(const char* name);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroPinIV_Tables(const char* lowName, const char* highName);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// Either this routine or 5.4 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennasize(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// Either this routine or 5.4 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaMetalArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// Either this routine or 5.4 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaMetalLength(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaPartialMetalArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaPartialMetalSideArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaPartialCutArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaDiffArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// The oxide value, can be either OXIDE1, OXIDE2, OXIDE3, or OXIDE4.
-// This routine is optional. Each oxide value can be called only once
-// after the lefwStartMacroPin.
-// This is a 5.5 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaModel(const char* oxide);
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called multiple times.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaGateArea(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaMaxAreaCar(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaMaxSideAreaCar(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPin.
-// This routine is optional and can be called only once.
-// This is a 5.4 syntax.
-// Either this routine or 5.3 Antenna syntax, cannot be both
-// Returns 0 if successful. 
-extern int lefwMacroPinAntennaMaxCutCar(double value,
-               const char* layerName); // optional(NULL) 
-
-// This routine must be called after the lefwStartMacroPin call (if any).
-// The routine can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwEndMacroPin(const char* pinName);
-
-// This routine must be called after the lefwStartMacroPin call (if any).
-// The routine can be called multiple time.
-// Returns 0 if successful.
-// It starts the macro pin port section within macro pin.
-// The classType can be NONE or CORE. 
-extern int lefwStartMacroPinPort(const char* classType); // optional(NULL) 
-
-// This routine is called after lefwStartMacroPinPort.
-// Either this routine or lefwMacroPinPortDesignRuleWidth must be called, 
-// but can't be both.
-// Spacing is optional for minimum spacing.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortLayer(const char* layerName,
-                                 double spacing);       // optional(0) 
-
-// This routine is called after lefwStartMacroPinPort.
-// Either this routine or lefwMacroPinPortLayer must be called, but can't
-// be both.
-// width is optional for DesignRuleWidth
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortDesignRuleWidth(const char* layerName,
-                                           double width);     // optional(0) 
-
-// This routine is called after lefwMacroPinPortLayer.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortLayerWidth(double width);
-
-// This routine is called after lefwStartMacroPinPortLayer.
-// Either this routine, lefwStartMacroPinPortLayerRect, or
-// lefwStartMacroPinPortLayerPolygon must be called.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortLayerPath(int num_paths, double* xl, double* yl,
-               int numX,               // optional(0) 
-               int numY,               // optional(0) 
-               double spaceX,          // optional(0) 
-               double spaceY,          // optional(0) 
-           int    mask = 0);       // optional(0) 
-
-// This routine is called after lefwStartMacroPinPortLayer.
-// Either this routine, lefwStartMacroPinPortLayerPath, or
-// lefwStartMacroPinPortLayerPolygon must be called.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortLayerRect(double xl1, double yl1,
-               double xl2, double yl2,
-               int numX,               // optional(0) 
-               int numY,               // optional(0) 
-               double spaceX,          // optional(0) 
-               double spaceY,          // optional(0) 
-           int mask = 0);          // optional(0) 
-
-// This routine is called after lefwStartMacroPinPortLayer.
-// Either this routine, lefwStartMacroPinPortLayerPath, or
-// lefwStartMacroPinPortLayerRect must be called.
-// Returns 0 if successful. 
-extern int lefwMacroPinPortLayerPolygon(int num_polys,
-               double* xl, double* yl,
-               int numX,               // optional(0) 
-               int numY,               // optional(0) 
-               double spaceX,          // optional(0) 
-               double spaceY,          // optional(0) 
-           int mask = 0);          // optional(0) 
-
-// This routine is called after lefwStartMacroPinPort.
-// Either this routine or lefwStartMacroPinPortLayer must be called. 
-// Returns 0 if successful. 
-extern int lefwMacroPinPortVia(double xl, double yl, const char* viaName,
-               int numX,               // optional(0) 
-               int numY,               // optional(0) 
-               double spaceX,          // optional(0) 
-               double spaceY,          // optional(0) 
-           int mask = 0);          // optional(0) 
-
-// This routine must be called after the lefwStartMacroPinPort call (if any).
-// The routine can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwEndMacroPinPort();
-
-// This routine is called after the lefwStartMacro call (if any).
-// The routine is optional and can be called multiple times.
-// Returns 0 if successful.
-// It starts the macro obs section within macro. 
-extern int lefwStartMacroObs();
-
-// This routine is called after lefwStartMacroObs.
-// Either this routine, lefwMacroObsDesignRuleWidth, lefwMacroObsVia or
-// lefwMacroExceptPGNet must be called.
-// Spacing is optional for minimum spacing.
-// Returns 0 if successful. 
-extern int lefwMacroObsLayer(const char* layerName,
-                             double spacing);       // optional(0) 
-
-// This routine is called after lefwStartMacroObs.
-// Either this routine, lefwMacroObsLayer, lefwMacroObsVia or
-// lefwMacroExceptPGNet must be called.
-// Spacing is optional for minimum spacing.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroObsDesignRuleWidth(const char* layerName,
-                                       double width);       // optional(0) 
-
-// This routine is called after lefwStartMacroObs.
-// Either this routine, lefwMacroObsLayer, lefwMacroObsVia or
-// lefwMacroObsDesignRuleWidth must be called.
-// Spacing is optional for minimum spacing.
-// This is a 5.4 syntax.
-// Returns 0 if successful. 
-extern int lefwMacroExceptPGNet(const char* layerName);
-
-// This routine is called after lefwStartMacroObs.
-// Returns 0 if successful. 
-extern int lefwMacroObsLayerWidth(double width);
-
-// This routine is called after lefwStartMacroObsLayer.
-// Either this routine, lefwMacroObsLayerRect, or
-// lefwStartMacroObsLayerPolygon must be called.
-// Returns 0 if successful. 
-extern int lefwMacroObsLayerPath(int num_paths, double* xl, double* yl,
-               int numX,                  // optional(0) 
-               int numY,                  // optional(0) 
-               double spaceX,             // optional(0) 
-               double spaceY,             // optional(0) 
-           int mask = 0);             // optional(0) 
-
-// This routine is called after lefwStartMacroObsLayer.
-// Either this routine, lefwMacroObsLayerPath, or
-// lefwStartMacroObsLayerPolygon must be called.
-// Returns 0 if successful. 
-extern int lefwMacroObsLayerRect(double xl1, double yl1,
-               double xl2, double yl2,
-               int numX,                  // optional(0) 
-               int numY,                  // optional(0) 
-               double spaceX,             // optional(0) 
-               double spaceY,             // optional(0) 
-           int mask = 0);             // optional(0) 
-
-// This routine is called after lefwStartMacroObsLayer.
-// Either this routine, lefwMacroObsLayerPath, or
-// lefwStartMacroObsLayerPath must be called.
-// Returns 0 if successful. 
-extern int lefwMacroObsLayerPolygon(int num_polys, double* xl, double* yl,
-               int numX,                  // optional(0) 
-               int numY,                  // optional(0) 
-               double spaceX,             // optional(0) 
-               double spaceY,             // optional(0) 
-           int mask = 0);             // optional(0) 
-
-// This routine is called after lefwStartMacroObs.
-// Either this routine or lefwMacroObsLayer|lefwMacroObsDesignRuleWidth
-// must be called.
-// Returns 0 if successful. 
-extern int lefwMacroObsVia(double xl, double yl, const char* viaName,
-               int numX,                  // optional(0) 
-               int numY,                  // optional(0) 
-               double spaceX,             // optional(0) 
-               double spaceY,             // optional(0) 
-           int mask = 0);             // optional(0) 
-
-// This routine must be called after the lefwStartMacroObs call (if any).
-// The routine can be called only once per macro section.
-// Returns 0 if successful. 
-extern int lefwEndMacroObs();
-
-// This routine is called after the lefwStartMacro call (if any).
-// The routine is optional and can be called only once.
-// Returns 0 if successful.
-// It starts the macro timing section within macro.
-// This api is obsolete in 5.4. 
-extern int lefwStartMacroTiming();
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This routine is for {FROMPIN pinName...; [TOPIN pinName...;] | FROMPIN
-// pinName...;}
-// This routince can be called multiple times.
-// The num_frPinNames contains the number of object in the array fromPins.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingPin(const char* fromPin, const char* toPin);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The riseFall can be RISE or FALL.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingIntrinsic(const char* riseFall, double min,
-               double max,
-               double slewT1,          // optional(0) 
-               double slewT1Min,       // optional(0) 
-               double slewT1Max,       // optional(0) 
-               double slewT2,          // optional(0) 
-               double slewT2Min,       // optional(0) 
-               double slewT2Max,       // optional(0) 
-               double slewT3,          // optional(0) 
-               double varMin, double varMax);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingRisers(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingFallrs(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingRisecs(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingFallcs(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingRisesatt1(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingFallsatt1(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingRiset0(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingFallt0(double min, double max);
-
-// This routine must be called after the lefwStartMacroTiming.
-// It can be called multiple times.
-// Returns 0 if successful.
-// The unateness can be INVERT, NONINVERT or NONUNATE.
-// This api is obsolete in 5.4. 
-extern int lefwMacroTimingUnateness(const char* unateness);
-
-// This routine must be called after the lefwStartMacroTiming call (if any).
-// The routine can be called only once.
-// Returns 0 if successful.
-// This api is obsolete in 5.4. 
-extern int lefwEndMacroTiming();
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful. 
-extern int lefwAntenna(const char* type,   // INPUTPINANTENNASIZE |
-                                           // OUTPUTPINANTENNASIZE |
-                                           // INOUTPINANTENNASIZE
-                       double value);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful. 
-extern int lefwStartBeginext(const char* name);
-
-// This routine is called after lefwBeginext.
-// This routine is optional, it can be called only once.
-// Returns 0 if successful. 
-extern int lefwBeginextCreator (const char* creatorName);
-
-// This routine is called after lefwBeginext.
-// This routine is optional, it can be called only once.
-// It gets the current system time and date.
-// Returns 0 if successful. 
-extern int lefwBeginextDate ();
-
-// This routine is called after lefwBeginext.
-// This routine is optional, it can be called only once.
-// Returns 0 if successful. 
-extern int lefwBeginextRevision (int vers1, int vers2);   // vers1.vers2 
-
-// This routine is called after lefwBeginext.
-// This routine is optional, it can be called many times.
-// It allows user to customize their own syntax.
-// Returns 0 if successful. 
-extern int lefwBeginextSyntax (const char* title, const char* string);
-
-// This routine is called after lefwInit.
-// This routine is optional and it can be called only once.
-// Returns 0 if successful. 
-extern int lefwEndBeginext();
-
-// General routines that can be called anytime after the Init is called.
-extern int lefwCurrentLineNumber();
-
-// This routine must call last, it ends the Lef library.
-// It must be called only once.
-// Returns 0 if successful. 
-extern int lefwEnd();
-
-// This routine will print the error message. 
-extern void lefwPrintError(int status);
-
-// This routine will allow user to write their own comemnt.  It will
-// automactically add a # infront of the line.
-extern void lefwAddComment(const char* comment);
-
-// This routine will indent 3 blank spaces 
-extern void lefwAddIndent();
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.cpp
deleted file mode 100644
index ed633e9..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.cpp
+++ /dev/null
@@ -1,664 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// *****************************************************************************
-// *****************************************************************************
-
-// This file contains code for implementing the lefwriter 5.3
-// It has functions to set the user callback functions.  If functions
-// are set, the lefwriter will call the user callback functions when
-// it comes to the section.  If the section is required, but user
-// does not set any callback functions, a warning will be printed
-// both on stderr and on the output file if there is one.
-// The lef writer does not provide any default callback functions for
-// the required sections.
-//
-// Author: Wanda da Rosa
-// Date:   05/06/99 
-//
-// Revisions:
-
-#include "lefwWriterCalls.hpp"
-#include <stdlib.h>
-#include <string.h>
-#include "lefiDebug.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-#define MAXCBS    30
-
-#define lefwVersionCbk 0
-#define lefwCaseSensitiveCbk 1
-#define lefwNoWireExtensionCbk 2
-#define lefwBusBitCharsCbk 3
-#define lefwDividerCharCbk 4
-#define lefwManufacturingGridCbk 5
-#define lefwUseMinSpacingCbk 6
-#define lefwClearanceMeasureCbk 7
-#define lefwUnitsCbk 8
-#define lefwAntennaInputGateAreaCbk 9
-#define lefwAntennaInOutDiffAreaCbk 10
-#define lefwAntennaOutputDiffAreaCbk 11
-#define lefwPropDefCbk 12
-#define lefwLayerCbk 13
-#define lefwViaCbk 14
-#define lefwViaRuleCbk 15
-#define lefwNonDefaultCbk 16
-#define lefwCrossTalkCbk 17
-#define lefwNoiseTableCbk 18
-#define lefwCorrectionTableCbk 19
-#define lefwSpacingCbk 20
-#define lefwMinFeatureCbk 21
-#define lefwDielectricCbk 22
-#define lefwIRDropCbk 23
-#define lefwSiteCbk 24
-#define lefwArrayCbk 25
-#define lefwMacroCbk 26
-#define lefwAntennaCbk 27
-#define lefwExtCbk 28
-#define lefwEndLibCbk 29
-
-// NEW CALLBACK - then place it here. 
-
-int lefWRetVal;
-extern int lefwHasInit;
-extern int lefwHasInitCbk;
-
-#define WRITER_CALLBACK(func, type) \
-    if (func) { \
-       if ((lefWRetVal = (*func)(type, lefwUserData)) == 0) { \
-       } else { \
-          lefiError(1, 0, "User callback routine returned bad status"); \
-          return lefWRetVal; \
-       } \
-    }
-
-// *****************************************************************************
-//   Global variables
-// *****************************************************************************
-
-lefiUserData lefwUserData = 0;
-static char *lefwFileName = 0;
-static int lefwRegisterUnused = 0;
-
-extern FILE *lefwFile;
-
-// *****************************************************************************
-//       List of call back routines
-//  These are filled in by the user.  See the
-//   "set" routines at the end of the file
-// *****************************************************************************
-// The callback routines
-lefwVoidCbkFnType lefwCallbacksSeq[MAXCBS] = {
-    0, // lefwVersionCbk
-    0, // lefwCaseSensitiveCbk
-    0, // lefwNoWireExtensionCbk
-    0, // lefwBusBitCharsCbk
-    0, // lefwDividerCharCbk
-    0, // lefwManufacturingGridCbk
-    0, // lefwUseMinSpacingCbk
-    0, // lefwClearanceMeasureCbk
-    0, // lefwUnitsCbk 
-    0, // lefwAntennaInputGateAreaCbk
-    0, // lefwAntennaInOutDiffAreaCbk
-    0, // lefwAntennaOutputDiffAreaCbk
-    0, // lefwPropDefCbk
-    0, // lefwLayerCbk
-    0, // lefwViaCbk
-    0, // lefwViaRuleCbk
-    0, // lefwNonDefaultCbk
-    0, // lefwCrossTalkCbk
-    0, // lefwNoiseTableCbk
-    0, // lefwCorrectionTableCbk
-    0, // lefwSpacingCbk
-    0, // lefwMinFeatureCbk
-    0, // lefwDielectricCbk
-    0, // lefwIRDropCbk
-    0, // lefwSiteCbk
-    0, // lefwArrayCbk
-    0, // lefwMacroCbk
-    0, // lefwAntennaCbk
-    0, // lefwExtCbk
-    0, // lefwEndLibCbk
-    // Add NEW CALLBACK here
-};
-
-// the optional and required callbacks
-int lefwCallbacksReq[MAXCBS] = {
-    0,    // Version
-    0,    // CaseSensitive
-    0,    // NoWireExtension
-    0,    // BusBitChars
-    0,    // Divider
-    0,    // ManufacturingGrid
-    0,    // UseMinSpacing
-    0,    // ClearanceMeasure
-    0,    // Units
-    0,    // AntennaInputGateArea
-    0,    // AntennaInOutDiffArea
-    0,    // AntennaOutputDiffArea
-    0,    // PropDefinition
-    0,    // Layer
-    0,    // Via
-    0,    // ViaRule
-    0,    // NonDefault
-    0,    // CrossTalk
-    0,    // NoiseTable
-    0,    // CorrectionTable
-    0,    // Spacing
-    0,    // MinFeature
-    0,    // Dielectric
-    0,    // IRDrop
-    0,    // Site
-    0,    // Array
-    0,    // Macro
-    0,    // Antenna
-    0,    // Extension
-    0,    // End Library
-    // Add NEW CALLBACK here
-};
-
-// The section names
-char lefwSectionNames[MAXCBS] [80] = {
-    "Version",
-    "CaseSensitive",
-    "NoWireExtension",
-    "BusBitChars",
-    "DividerChar",
-    "ManufacturingGrid",
-    "UseMinSpacing",
-    "ClearanceMeasure",
-    "Units",
-    "AntennaInputGateArea",
-    "AntennaInOutDiffArea",
-    "AntennaOutputDiffArea",
-    "PropertyDefinition",
-    "Layer",
-    "Via",
-    "ViaRule",
-    "NonDefault",
-    "CrossTalk",
-    "NoiseTable",
-    "CorrectionTable",
-    "Spacing",
-    "MinFeature",
-    "Dielectric",
-    "IRDrop",
-    "Site",
-    "Array",
-    "Macro",
-    "Antenna",
-    "Ext",
-    "End Library",
-    // Add NEW CALLBACK here
-};
-
-// the call back types from the lefwCallbackType_e
-lefwCallbackType_e lefwCallbacksType[MAXCBS] = {
-    lefwVersionCbkType,
-    lefwCaseSensitiveCbkType,
-    lefwNoWireExtensionCbkType,
-    lefwBusBitCharsCbkType,
-    lefwDividerCharCbkType,
-    lefwManufacturingGridCbkType,
-    lefwUseMinSpacingCbkType,
-    lefwClearanceMeasureCbkType,
-    lefwUnitsCbkType,
-    lefwAntennaInputGateAreaCbkType,
-    lefwAntennaInOutDiffAreaCbkType,
-    lefwAntennaOutputDiffAreaCbkType,
-    lefwPropDefCbkType,
-    lefwLayerCbkType,
-    lefwViaCbkType,
-    lefwViaRuleCbkType,
-    lefwNonDefaultCbkType,
-    lefwCrossTalkCbkType,
-    lefwNoiseTableCbkType,
-    lefwCorrectionTableCbkType,
-    lefwSpacingCbkType,
-    lefwMinFeatureCbkType,
-    lefwDielectricCbkType,
-    lefwIRDropCbkType,
-    lefwSiteCbkType,
-    lefwArrayCbkType,
-    lefwMacroCbkType,
-    lefwAntennaCbkType,
-    lefwExtCbkType,
-    lefwEndLibCbkType,
-    // Add NEW TYPES here
-};
-
-// *****************************************************************************
-//   Routines for the callbacks
-// *****************************************************************************
-const char *
-lefwFName()
-{
-    return lefwFileName;
-}
-
-
-int
-lefwWrite(FILE          *f,
-          const char    *fName,
-          lefiUserData  uData)
-{
-    int i;
-
-    if (lefwHasInitCbk == 0 && lefwHasInit == 0) {
-        fprintf(stderr, "ERROR (LEFWRIT-4100): lefwWrite called before lefwInitCbk\n");
-        return -1;
-    }
-
-    lefwFileName = (char*) fName;
-    lefwFile = f;
-    lefwUserData = uData;
-
-    // Loop through the list of callbacks and call the user define
-    // callback routines if any are set
-
-    for (i = 0; i < MAXCBS; i++) {
-        if (lefwCallbacksSeq[i] != 0) {   // user has set a callback function
-            WRITER_CALLBACK(lefwCallbacksSeq[i], lefwCallbacksType[i]);
-        } else if (lefwCallbacksReq[i]) { // it is required but user hasn't set up
-            fprintf(f,
-                    "# WARNING (LEFWRIT-4500): Callback for %s is required, but is not defined\n\n",
-                    lefwSectionNames[i]);
-            fprintf(stderr,
-                    "WARNING (LEFWRIT-4500): Callback for %s is required, but is not defined\n\n",
-                    lefwSectionNames[i]);
-        }
-    }
-    return 0;
-}
-
-void
-lefwSetUnusedCallbacks(lefwVoidCbkFnType func)
-{
-    // Set all of the callbacks that have not been set yet to
-    // the given function.
-    int i;
-
-    for (i = 0; i < MAXCBS; i++) {
-        if (lefwCallbacksSeq[i] == 0)
-            lefwCallbacksSeq[i] = (lefwVoidCbkFnType) func;
-    }
-}
-
-// These count up the number of times an unset callback is called... 
-static int lefwUnusedCount[100];
-
-int
-lefwCountFunc(lefwCallbackType_e    e,
-              lefiUserData          d)
-{
-    int i = (int) e;
-    if (lefiDebug(23))
-        printf("count %d 0x%p\n", (int) e, d);
-    if (i >= 0 && i < 100) {
-        lefwUnusedCount[i] += 1;
-        return 0;
-    }
-    return 1;
-}
-
-void
-lefwSetRegisterUnusedCallbacks()
-{
-    int i;
-    lefwRegisterUnused = 1;
-    lefwSetUnusedCallbacks(lefwCountFunc);
-    for (i = 0; i < 100; i++)
-        lefwUnusedCount[i] = 0;
-}
-
-void
-lefwPrintUnusedCallbacks(FILE *f)
-{
-    int i;
-    int first = 1;
-
-    if (lefwRegisterUnused == 0) {
-        fprintf(f,
-                "ERROR (LEFWRIT-4101): lefwSetRegisterUnusedCallbacks was not called to setup this data.\n");
-        return;
-    }
-
-    for (i = 0; i < 100; i++) {
-        if (lefwUnusedCount[i]) {
-            if (first)
-                fprintf(f,
-                        "INFO (LEFWRIT-4700): LEF items that were present but ignored because of no callback were set.\n");
-            first = 0;
-            switch ((lefwCallbackType_e) i) {
-            case lefwVersionCbkType:
-                fprintf(f, "Version");
-                break;
-            case lefwCaseSensitiveCbkType:
-                fprintf(f, "CaseSensitive");
-                break;
-            case lefwNoWireExtensionCbkType:
-                fprintf(f, "NoWireExtensionAtPins");
-                break;
-            case lefwBusBitCharsCbkType:
-                fprintf(f, "BusBitChars");
-                break;
-            case lefwDividerCharCbkType:
-                fprintf(f, "DividerChar");
-                break;
-            case lefwManufacturingGridCbkType:
-                fprintf(f, "ManufacturingGrid");
-                break;
-            case lefwUseMinSpacingCbkType:
-                fprintf(f, "UseMinSpacing");
-                break;
-            case lefwClearanceMeasureCbkType:
-                fprintf(f, "ClearanceMeasure");
-                break;
-            case lefwUnitsCbkType:
-                fprintf(f, "Units");
-                break;
-            case lefwAntennaInputGateAreaCbkType:
-                fprintf(f, "AntennaInputGateArea");
-                break;
-            case lefwAntennaInOutDiffAreaCbkType:
-                fprintf(f, "AntennaInOutDiffArea");
-                break;
-            case lefwAntennaOutputDiffAreaCbkType:
-                fprintf(f, "AntennaOutputDiffArea");
-                break;
-            case lefwPropDefCbkType:
-                fprintf(f, "PropertyDefintion");
-                break;
-            case lefwLayerCbkType:
-                fprintf(f, "Layer");
-                break;
-            case lefwViaCbkType:
-                fprintf(f, "Via");
-                break;
-            case lefwViaRuleCbkType:
-                fprintf(f, "ViaRule");
-                break;
-            case lefwNonDefaultCbkType:
-                fprintf(f, "NonDefault");
-                break;
-            case lefwCrossTalkCbkType:
-                fprintf(f, "CrossTalk");
-                break;
-            case lefwNoiseTableCbkType:
-                fprintf(f, "NoiseTable");
-                break;
-            case lefwCorrectionTableCbkType:
-                fprintf(f, "CorrectionTable");
-                break;
-            case lefwSpacingCbkType:
-                fprintf(f, "Spacing");
-                break;
-            case lefwMinFeatureCbkType:
-                fprintf(f, "MinFeature");
-                break;
-            case lefwDielectricCbkType:
-                fprintf(f, "Dielectric");
-                break;
-            case lefwIRDropCbkType:
-                fprintf(f, "IRDrop");
-                break;
-            case lefwSiteCbkType:
-                fprintf(f, "Site");
-                break;
-            case lefwArrayCbkType:
-                fprintf(f, "Array");
-                break;
-            case lefwMacroCbkType:
-                fprintf(f, "Macro");
-                break;
-            case lefwAntennaCbkType:
-                fprintf(f, "OutputAntenna");
-                break;
-            case lefwExtCbkType:
-                fprintf(f, "Extension");
-                break;
-            case lefwEndLibCbkType:
-                fprintf(f, "End Library");
-                break;
-                // NEW CALLBACK  add the print here 
-            default:
-                fprintf(f, "BOGUS ENTRY");
-                break;
-            }
-            fprintf(f, " %d\n", lefwUnusedCount[i]);
-        }
-    }
-}
-
-void
-lefwSetUserData(lefiUserData d)
-{
-    lefwUserData = d;
-}
-
-lefiUserData
-lefwGetUserData()
-{
-    return lefwUserData;
-}
-
-void
-lefwSetUnitsCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwUnitsCbk] = f;
-}
-
-void
-lefwSetDividerCharCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwDividerCharCbk] = f;
-}
-
-void
-lefwSetManufacturingGridCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwManufacturingGridCbk] = f;
-}
-
-void
-lefwSetUseMinSpacingCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwUseMinSpacingCbk] = f;
-}
-
-void
-lefwSetClearanceMeasureCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwClearanceMeasureCbk] = f;
-}
-
-void
-lefwSetNoWireExtensionCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwNoWireExtensionCbk] = f;
-}
-
-void
-lefwSetBusBitCharsCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwBusBitCharsCbk] = f;
-}
-
-void
-lefwSetCaseSensitiveCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwCaseSensitiveCbk] = f;
-}
-
-void
-lefwSetVersionCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwVersionCbk] = f;
-}
-
-void
-lefwSetLayerCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwLayerCbk] = f;
-}
-
-void
-lefwSetViaCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwViaCbk] = f;
-}
-
-void
-lefwSetViaRuleCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwViaRuleCbk] = f;
-}
-
-void
-lefwSetSpacingCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwSpacingCbk] = f;
-}
-
-void
-lefwSetIRDropCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwIRDropCbk] = f;
-}
-
-void
-lefwSetDielectricCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwDielectricCbk] = f;
-}
-
-void
-lefwSetMinFeatureCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwMinFeatureCbk] = f;
-}
-
-void
-lefwSetNonDefaultCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwNonDefaultCbk] = f;
-}
-
-void
-lefwSetSiteCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwSiteCbk] = f;
-}
-
-void
-lefwSetMacroCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwMacroCbk] = f;
-}
-
-void
-lefwSetArrayCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwArrayCbk] = f;
-}
-
-void
-lefwSetPropDefCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwPropDefCbk] = f;
-}
-
-void
-lefwSetCrossTalkCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwCrossTalkCbk] = f;
-}
-
-void
-lefwSetNoiseTableCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwNoiseTableCbk] = f;
-}
-
-
-void
-lefwSetCorrectionTableCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwCorrectionTableCbk] = f;
-}
-
-
-void
-lefwSetAntennaCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwAntennaCbk] = f;
-}
-
-void
-lefwSetExtCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwExtCbk] = f;
-}
-
-void
-lefwSetEndLibCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwEndLibCbk] = f;
-}
-
-/* NEW CALLBACK - Each callback routine must have a routine that allows
- * the user to set it.  The set routines go here. */
-
-void
-lefwSetAntennaInputGateAreaCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwAntennaInputGateAreaCbk] = f;
-}
-
-void
-lefwSetAntennaInOutDiffAreaCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwAntennaInOutDiffAreaCbk] = f;
-}
-
-void
-lefwSetAntennaOutputDiffAreaCbk(lefwVoidCbkFnType f)
-{
-    lefwCallbacksSeq[lefwAntennaOutputDiffAreaCbk] = f;
-}
-
-extern LEFI_LOG_FUNCTION lefwErrorLogFunction;
-
-void
-lefwSetLogFunction(LEFI_LOG_FUNCTION f)
-{
-    lefwErrorLogFunction = f;
-}
-extern LEFI_WARNING_LOG_FUNCTION lefwWarningLogFunction;
-
-void
-lefwSetWarningLogFunction(LEFI_WARNING_LOG_FUNCTION f)
-{
-    lefwWarningLogFunction = f;
-}
-END_LEFDEF_PARSER_NAMESPACE
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.hpp
deleted file mode 100644
index 2b32372..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lefwWriterCalls.hpp
+++ /dev/null
@@ -1,210 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2013, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef LEFI_WRITER_H
-#define LEFI_WRITER_H
-
-#include <stdarg.h>
-#include <stdio.h>
- 
-#include "lefiKRDefs.hpp"
-#include "lefiDefs.hpp"
-#include "lefiUser.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-/*
- * The main writer function.
- * The file should already be opened.  This requirement allows
- * the writer to be used with stdin or a pipe.  The file name
- * is only used for error messages.  The includeSearchPath is
- * a colon-delimited list of directories in which to find
- * include files.
- */
-extern int lefwWrite ( FILE *file,
-                 const char *fileName,
-                 lefiUserData userData );
-
-/*
- * Set all of the callbacks that have not yet been set to a function
- * that will add up how many times a given lef data type was ignored
- * (ie no callback was done).  The statistics can later be printed out.
- */
-extern void lefwSetRegisterUnusedCallbacks ( void );
-extern void lefwPrintUnusedCallbacks ( FILE* f );
-
-/*
- * Set/get the client-provided user data.  lefi doesn't look at
- * this data at all, it simply passes the opaque lefiUserData pointer
- * back to the application with each callback.  The client can
- * change the data at any time, and it will take effect on the
- * next callback.  The lefi writer and writer maintain separate
- * user data pointers.
- */
-extern void lefwSetUserData ( lefiUserData );
-extern lefiUserData lefwGetUserData ( void );
- 
-/*
- * An enum describing all of the types of writer callbacks.
- */
-typedef enum {
-  lefwUnspecifiedCbkType = 0,
-  lefwVersionCbkType,
-  lefwCaseSensitiveCbkType,
-  lefwNoWireExtensionCbkType,
-  lefwBusBitCharsCbkType,
-  lefwDividerCharCbkType,
-  lefwManufacturingGridCbkType,
-  lefwUseMinSpacingCbkType,
-  lefwClearanceMeasureCbkType,
-  lefwUnitsCbkType,
-  lefwAntennaInputGateAreaCbkType,
-  lefwAntennaInOutDiffAreaCbkType,
-  lefwAntennaOutputDiffAreaCbkType,
-  lefwPropDefCbkType,
-  lefwLayerCbkType,
-  lefwViaCbkType,
-  lefwViaRuleCbkType,
-  lefwNonDefaultCbkType,
-  lefwCrossTalkCbkType,
-  lefwNoiseTableCbkType,
-  lefwCorrectionTableCbkType,
-  lefwSpacingCbkType,
-  lefwMinFeatureCbkType,
-  lefwDielectricCbkType,
-  lefwIRDropCbkType,
-  lefwSiteCbkType,
-  lefwArrayCbkType,
-  lefwMacroCbkType,
-  lefwAntennaCbkType,
-  lefwExtCbkType,
-  lefwEndLibCbkType
-
-  /* NEW CALLBACKS - each callback has its own type.  For each callback
-   * that you add, you must add an item to this enum. */
-
-} lefwCallbackType_e;
- 
- 
-/* Declarations of function signatures for each type of callback.
- * These declarations are type-safe when compiling with ANSI C
- * or C++; you will only be able to register a function pointer
- * with the correct signature for a given type of callback.
- *
- * Each callback function is expected to return 0 if successful.
- * A non-zero return code will cause the writer to abort.
- *
- * The lefwDesignStart and lefwDesignEnd callback is only called once.
- * Other callbacks may be called multiple times, each time with a different
- * set of data.
- *
- * For each callback, the Lef API will make the callback to the
- * function supplied by the client, which should either make a copy
- * of the Lef object, or store the data in the client's own data structures.
- * The Lef API will delete or reuse each object after making the callback,
- * so the client should not keep a pointer to it.
- *
- * All callbacks pass the user data pointer provided in lefwRead()
- * or lefwSetUserData() back to the client; this can be used by the
- * client to obtain access to the rest of the client's data structures.
- *
- * The user data pointer is obtained using lefwGetUserData() immediately
- * prior to making each callback, so the client is free to change the
- * user data on the fly if necessary.
- *
- * Callbacks with the same signature are passed a callback type
- * parameter, which allows an application to write a single callback
- * function, register that function for multiple callbacks, then
- * switch based on the callback type to handle the appropriate type of
- * data.
- */
- 
-
-// A declaration of the signature of all callbacks that return nothing. 
-typedef int (*lefwVoidCbkFnType) ( lefwCallbackType_e, lefiUserData );
-
- /* NEW CALLBACK - If your callback returns a pointer to a new class then
-  * you must add a type function here. */
-
-/* Functions to call to register a callback function.
- */
-extern void lefwSetVersionCbk(lefwVoidCbkFnType);
-extern void lefwSetCaseSensitiveCbk(lefwVoidCbkFnType);
-extern void lefwSetNoWireExtensionCbk(lefwVoidCbkFnType);
-extern void lefwSetBusBitCharsCbk(lefwVoidCbkFnType);
-extern void lefwSetDividerCharCbk(lefwVoidCbkFnType);
-extern void lefwSetManufacturingGridCbk(lefwVoidCbkFnType);
-extern void lefwSetUseMinSpacingCbk(lefwVoidCbkFnType);
-extern void lefwSetClearanceMeasureCbk(lefwVoidCbkFnType);
-extern void lefwSetUnitsCbk(lefwVoidCbkFnType);
-extern void lefwAntennaInputGateAreaCbk(lefwVoidCbkFnType);
-extern void lefwAntennaInOutDiffAreaCbk(lefwVoidCbkFnType);
-extern void lefwAntennaOutputDiffAreaCbk(lefwVoidCbkFnType);
-extern void lefwSetPropDefCbk(lefwVoidCbkFnType);
-extern void lefwSetLayerCbk(lefwVoidCbkFnType);
-extern void lefwSetViaCbk(lefwVoidCbkFnType);
-extern void lefwSetViaRuleCbk(lefwVoidCbkFnType);
-extern void lefwSetNonDefaultCbk(lefwVoidCbkFnType);
-extern void lefwSetCrossTalkCbk(lefwVoidCbkFnType);
-extern void lefwSetNoiseTableCbk(lefwVoidCbkFnType);
-extern void lefwSetCorrectionTableCbk(lefwVoidCbkFnType);
-extern void lefwSetSpacingCbk(lefwVoidCbkFnType);
-extern void lefwSetMinFeatureCbk(lefwVoidCbkFnType);
-extern void lefwSetDielectricCbk(lefwVoidCbkFnType);
-extern void lefwSetIRDropCbk(lefwVoidCbkFnType);
-extern void lefwSetSiteCbk(lefwVoidCbkFnType);
-extern void lefwSetArrayCbk(lefwVoidCbkFnType);
-extern void lefwSetMacroCbk(lefwVoidCbkFnType);
-extern void lefwSetAntennaCbk(lefwVoidCbkFnType);
-extern void lefwSetExtCbk(lefwVoidCbkFnType);
-extern void lefwSetEndLibCbk(lefwVoidCbkFnType);
-
-/* NEW CALLBACK - each callback must have a function to allow the user
- * to set it.  Add the function here. */
-
-/*
- * Set all of the callbacks that have not yet been set to the following
- * function.  This is especially useful if you want to check to see
- * if you forgot anything.
- */
-extern void lefwSetUnusedCallbacks (lefwVoidCbkFnType func);
-
-// Routine to set the message logging routine for errors 
-typedef void (*LEFI_LOG_FUNCTION)(const char*);
-extern void lefwSetLogFunction( LEFI_LOG_FUNCTION );
-
-// Routine to set the message logging routine for warnings 
-typedef void (*LEFI_WARNING_LOG_FUNCTION)(const char*);
-extern void lefwSetWarningLogFunction( LEFI_WARNING_LOG_FUNCTION );
-
-END_LEFDEF_PARSER_NAMESPACE
-
-USE_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lex.h b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lex.h
deleted file mode 100644
index 4f95319..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lef/lex.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- *******************************************************************************
- * Copyright 2012 - 2014, Cadence Design Systems
- * 
- * This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
- * Distribution,  Product Version 5.8. 
- * 
- * 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
- * 
- *        http://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.
- * 
- * For updates, support, or to become part of the LEF/DEF Community,
- * check www.openeda.org for details.
- *******************************************************************************
- * 
- *  $Author: dell $
- *  $Revision: #1 $
- *  $Date: 2017/06/06 $
- *  $State:  $
- ******************************************************************************/
-
-#ifndef leh_h
-#define leh_h
-
-#include "lefiKRDefs.hpp"
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-
-void lefAddStringDefine(const char    *token,
-                        const char    *string);
-
-void lefAddBooleanDefine(const char   *token,
-                         int          val);
-
-void lefAddNumDefine(const char  *token,
-                     double      val);
-
-void yyerror(const char *s);
-void lefError(int           msgNum,
-              const char    *s);
-void lefWarning(int         msgNum,
-                const char  *s);
-void lefInfo(int        msgNum,
-             const char *s);
-void *lefMalloc(size_t lef_size);
-void *lefRealloc(void   *name,
-                 size_t    lef_size);
-void lefFree(void *name);
-void lefSetNonDefault(const char *name);
-void lefUnsetNonDefault();
-
-extern int yylex();
-extern void lex_init();
-extern int lefyyparse();
-extern void lex_un_init();
-
-int fake_ftell();
-
-END_LEFDEF_PARSER_NAMESPACE
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.cpp
deleted file mode 100644
index bda1515..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.cpp
+++ /dev/null
@@ -1,2101 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2015, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
- 
-// This program is the diffLef core program.  It has all the callback
-// routines and write it out to a temporary file
-
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "lefrReader.hpp"
-#include "lefwWriter.hpp"
-#include "lefiDebug.hpp"
-
-char    defaultName[128];
-char    defaultOut[128];
-FILE*   fout;
-int     printing = 0;     // Printing the output.
-void*   userData;
-
-// TX_DIR:TRANSLATION ON
- 
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
- 
-
-void checkType(lefrCallbackType_e c) {
-  if (c >= 0 && c <= lefrLibraryEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-// 05/24/2001 - Wanda da Rosa.  PCR 373170
-// This function is added due to the rounding between machines are
-// different.  For a 5, solaries will round down while hppa will roundup.
-// This function will make sure it round up for all the machine
-double chkNum(double num) {
-  long tempNum;
-  if ((num > 1000004) || (num < -1000004)) {
-     tempNum = (long)num;
-     if ((tempNum%5) == 0)
-        return num + 3;
-  }
-  return num;
-}
-
-// Print Via
-void lefVia(lefiVia* via, char* inName) {
-  int i, j;
-
-  fprintf(fout, "%s %s", inName, via->name());
-  if (via->hasDefault())
-     fprintf(fout, " DEFAULT");
-  if (via->hasGenerated())
-     fprintf(fout, " GENERATED");
-  if (via->hasTopOfStack())
-     fprintf(fout, " TOPOFSTACKONLY");
-  if (via->hasForeign()) {
-     fprintf(fout, " FOREIGN %s", via->foreign());
-     if (via->hasForeignPnt()) {
-        fprintf(fout, " ( %g %g )", chkNum(via->foreignX()),
-                chkNum(via->foreignY()));
-        if (via->hasForeignOrient())
-           fprintf(fout, " %s", lefiOrientStr(via->foreignOrient()));
-     }
-  }
-  fprintf(fout, "\n");
-  if (via->hasProperties()) {
-     for (i = 0; i < via->numProperties(); i++) {
-        fprintf(fout, "%s %s PROP", inName, via->name());
-        fprintf(fout, " %s", via->propName(i));
-        if (via->propIsNumber(i))
-           fprintf(fout, " %g", chkNum(via->propNumber(i)));
-        if (via->propIsString(i))
-           fprintf(fout, " %s", via->propValue(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (via->hasViaRule()) {
-     fprintf(fout, "%s %s %g %g %s %s %s %g %g %g %g %g %g", via->name(),
-             via->viaRuleName(), via->xCutSize(), via->yCutSize(),
-             via->botMetalLayer(),  via->cutLayer(), via->topMetalLayer(),
-             via->xCutSpacing(), via->yCutSpacing(), via->xBotEnc(),
-             via->yBotEnc(), via->xTopEnc(), via->yTopEnc());
-     if (via->hasRowCol())
-        fprintf(fout, " %d %d", via->numCutRows(), via->numCutCols());
-     if (via->hasOrigin())
-        fprintf(fout, " %g %g", via->xOffset(), via->yOffset());
-     if (via->hasOffset())
-        fprintf(fout, " %g %g %g %g", via->xBotOffset(), via->yBotOffset(),
-                via->xTopOffset(), via->yTopOffset());
-     if (via->hasCutPattern())
-        fprintf(fout, " %s", via->cutPattern());
-     fprintf(fout, "\n");
-  }
-  if (via->hasResistance())
-     fprintf(fout, "%s %s RESISTANCE %g\n",inName, via->name(),
-             chkNum(via->resistance()));
-  if (via->numLayers() > 0) {
-     for (i = 0; i < via->numLayers(); i++) {
-        fprintf(fout, "%s %s LAYER %s\n", inName, via->name(),
-                via->layerName(i));
-        for (j = 0; j < via->numRects(i); j++) {
-	   if (via->rectColorMask(i, j)) {
-		fprintf(fout, "%s %s RECT MASK % d ( %g %g ) ( %g %g )\n", 
-			inName, via->name(), via->rectColorMask(i, j),
-			chkNum(via->xl(i, j)), chkNum(via->yl(i, j)),
-			chkNum(via->xh(i, j)), chkNum(via->yh(i, j)));
-           } else {
-		fprintf(fout, "%s %s RECT ( %g %g ) ( %g %g )\n", inName,
-			via->name(), 
-			chkNum(via->xl(i, j)), chkNum(via->yl(i, j)),
-			chkNum(via->xh(i, j)), chkNum(via->yh(i, j)));
-	    }
-	}
-        for (j = 0; j < via->numPolygons(i); j++) {
-           struct lefiGeomPolygon poly;
-           poly = via->getPolygon(i, j);
-	   if (via->polyColorMask(i, j)) {
-               fprintf(fout, "%s %s POLYGON MASK %d", inName, via->name(),
-		       via->polyColorMask(i, j));
-           } else {
-	       fprintf(fout, "%s %s POLYGON", inName, via->name());
-	   }
-           for (int k = 0; k < poly.numPoints; k++)
-              fprintf(fout, " %g %g", poly.x[k], poly.y[k]);
-           fprintf(fout, "\n");
-        }
-     }
-  }
-  return;
-}
-
-// Print Spacing
-void lefSpacing(lefiSpacing* spacing, char *inName) {
-  fprintf(fout, "%s SAMENET %s %s %g ", inName, spacing->name1(),
-          spacing->name2(), chkNum(spacing->distance()));
-  if (spacing->hasStack())
-     fprintf(fout, " STACK");
-  fprintf(fout,"\n");
-  return;
-}
-
-// Print Via Rule Layer
-void lefViaRuleLayer(lefiViaRuleLayer* vLayer, char* viaName) {
-  fprintf(fout, "VIARULE %s LAYER %s", viaName, vLayer->name());
-  if (vLayer->hasDirection()) {
-     if (vLayer->isHorizontal())
-        fprintf(fout, " DIRECTION HORIZONTAL");
-     if (vLayer->isVertical())
-        fprintf(fout, " DIRECTION VERTICAL");
-  }
-  if (vLayer->hasEnclosure())
-     fprintf(fout, " ENCLOSURE %g %g\n", chkNum(vLayer->enclosureOverhang1()),
-             chkNum(vLayer->enclosureOverhang2()));
-  if (vLayer->hasWidth())
-     fprintf(fout, " WIDTH %g TO %g", chkNum(vLayer->widthMin()),
-                   chkNum(vLayer->widthMax()));
-  if (vLayer->hasResistance())
-     fprintf(fout, " RESISTANCE %g", chkNum(vLayer->resistance()));
-  if (vLayer->hasOverhang())
-     fprintf(fout, " OVERHANG %g", chkNum(vLayer->overhang()));
-  if (vLayer->hasMetalOverhang())
-     fprintf(fout, " METALOVERHANG %g", chkNum(vLayer->metalOverhang()));
-  if (vLayer->hasSpacing())
-     fprintf(fout, " SPACING %g BY %g", chkNum(vLayer->spacingStepX()),
-             chkNum(vLayer->spacingStepY()));
-  if (vLayer->hasRect())
-     fprintf(fout, " RECT ( %g %g ) ( %g %g )", chkNum(vLayer->xl()),
-             chkNum(vLayer->yl()), chkNum(vLayer->xh()), chkNum(vLayer->yh()));
-  fprintf(fout, "\n");
-  return;
-}
- 
-// Print Geometry
-void prtGeometry(lefiGeometries* geometry, char* inName) {
-  int                   numItems = geometry->numItems();
-  int                   i, j;
-  lefiGeomPath*         path;
-  lefiGeomPathIter*     pathIter;
-  lefiGeomRect*         rect;
-  lefiGeomRectIter*     rectIter;
-  lefiGeomPolygon*      polygon;
-  lefiGeomPolygonIter*  polygonIter;
-  lefiGeomVia*          via;
-  lefiGeomViaIter*      viaIter;
- 
-  for (i = 0; i < numItems; i++) {
-     switch (geometry->itemType(i)) {
-        case  lefiGeomClassE:
-             fprintf(fout, "%s CLASS %s\n", inName, geometry->getClass(i));
-             break;
-        case lefiGeomLayerE:
-             fprintf(fout, "%s LAYER %s\n", inName, geometry->getLayer(i));
-             break;
-        case lefiGeomLayerMinSpacingE:
-             fprintf(fout, "%s SPACING %g\n", inName,
-                     chkNum(geometry->getLayerMinSpacing(i)));
-             break;
-        case lefiGeomLayerExceptPgNetE:
-             fprintf(fout, "%s EXCEPTPGNET\n", inName);
-             break;
-        case lefiGeomLayerRuleWidthE:
-             fprintf(fout, "%s DESIGNRULEWIDTH %g\n", inName,
-                     chkNum(geometry->getLayerRuleWidth(i)));
-             break;
-        case lefiGeomWidthE:
-             fprintf(fout, "%s WIDTH %g\n", inName,
-                     chkNum(geometry->getWidth(i)));
-             break;
-        case lefiGeomPathE:
-             path = geometry->getPath(i);
-	     if (path->colorMask != 0) {
-                fprintf(fout, "%s PATH MASK %d ", inName, path->colorMask);
-             } else {
-		fprintf(fout, "%s PATH ", inName);
-             }
-
-             for (j = 0; j < path->numPoints; j++) {
-                if (j+1 == path->numPoints) // last one on the list
-                   fprintf(fout, " ( %g %g )\n", chkNum(path->x[j]),
-                           chkNum(path->y[j]));
-                else
-                   fprintf(fout, " ( %g %g )", chkNum(path->x[j]),
-                           chkNum(path->y[j]));
-             }
-             break;
-        case lefiGeomPathIterE:
-             pathIter = geometry->getPathIter(i);
-	     if (pathIter->colorMask != 0) {
-                fprintf(fout, "%s PATH MASK %d ITERATED ", inName,
-			pathIter->colorMask);
-            } else { 
-		fprintf(fout, "%s PATH ITERATED ", inName);
-	    }
-             for (j = 0; j < pathIter->numPoints; j++)
-                fprintf(fout, " ( %g %g )", chkNum(pathIter->x[j]),
-                        chkNum(pathIter->y[j]));
-             fprintf(fout, " DO %g BY %g STEP %g %g\n",
-                     chkNum(pathIter->xStart), chkNum(pathIter->yStart),
-                     chkNum(pathIter->xStep), chkNum(pathIter->yStep));
-             break;
-        case lefiGeomRectE:
-             rect = geometry->getRect(i);
-	     if (rect->colorMask != 0) {
-		 fprintf(fout, "%s RECT MASK %d ( %g %g ) ( %g %g )\n", 
-			 inName, rect->colorMask,
-			 chkNum(rect->xl), chkNum(rect->yl), 
-			 chkNum(rect->xh), chkNum(rect->yh));
-	     } else {
-		fprintf(fout, "%s RECT ( %g %g ) ( %g %g )\n", inName,
-			chkNum(rect->xl), chkNum(rect->yl), 
-			chkNum(rect->xh), chkNum(rect->yh));
-	     }
-             break;
-        case lefiGeomRectIterE:
-             rectIter = geometry->getRectIter(i);
-	     if (rectIter->colorMask != 0) {
-		 fprintf(fout, "%s RECT MASK %d ITERATE ( %g %g ) ( %g %g )", 
-			 inName, rectIter->colorMask,
-			 chkNum(rectIter->xl), chkNum(rectIter->yl),
-			 chkNum(rectIter->xh), chkNum(rectIter->yh));
-	     } else {
-		 fprintf(fout, "%s RECT ITERATE ( %g %g ) ( %g %g )", inName,
-			 chkNum(rectIter->xl), chkNum(rectIter->yl),
-                         chkNum(rectIter->xh), chkNum(rectIter->yh));
-	     }
-             fprintf(fout, " DO %g BY %g STEP %g %g ;\n",
-                     chkNum(rectIter->xStart), chkNum(rectIter->yStart),
-                     chkNum(rectIter->xStep), chkNum(rectIter->yStep));
-             break;
-        case lefiGeomPolygonE:
-             polygon = geometry->getPolygon(i);
-	     if (polygon->colorMask != 0) {
-		 fprintf(fout, "%s POLYGON MASK %d ", inName, polygon->colorMask);
-	     } else {
-		 fprintf(fout, "%s POLYGON ", inName);
-	     }
-             for (j = 0; j < polygon->numPoints; j++) {
-                if (j+1 == polygon->numPoints) // last one on the list
-                   fprintf(fout, " ( %g %g )\n", chkNum(polygon->x[j]),
-                           chkNum(polygon->y[j]));
-                else
-                   fprintf(fout, " ( %g %g )", chkNum(polygon->x[j]),
-                           chkNum(polygon->y[j]));
-             }
-             break;
-        case lefiGeomPolygonIterE:
-             polygonIter = geometry->getPolygonIter(i);
-	     if (polygonIter->colorMask != 0) {
-		 fprintf(fout, "%s POLYGON MASK %d ITERATE", inName,
-			 polygonIter->colorMask);
-	     } else {
-		 fprintf(fout, "%s POLYGON ITERATE", inName);
-	     }
-             for (j = 0; j < polygonIter->numPoints; j++)
-                   fprintf(fout, " ( %g %g )", chkNum(polygonIter->x[j]),
-                           chkNum(polygonIter->y[j]));
-             fprintf(fout, " DO %g BY %g STEP %g %g\n",
-                     chkNum(polygonIter->xStart), chkNum(polygonIter->yStart),
-                     chkNum(polygonIter->xStep), chkNum(polygonIter->yStep));
-             break;
-        case lefiGeomViaE:
-             via = geometry->getVia(i);
-	     if (via->topMaskNum != 0 || via->bottomMaskNum != 0 || via->cutMaskNum !=0) {
-		fprintf(fout, "%s VIA MASK %d%d%d ( %g %g ) %s\n", inName, 
-			via->topMaskNum, via->cutMaskNum, via->bottomMaskNum,
-			chkNum(via->x),
-			chkNum(via->y), via->name);
-	     } else {
-		fprintf(fout, "%s VIA ( %g %g ) %s\n", inName, chkNum(via->x),
-			chkNum(via->y), via->name);
-	     }
-             break;
-        case lefiGeomViaIterE:
-             viaIter = geometry->getViaIter(i);
-	     if (viaIter->topMaskNum != 0 || viaIter->cutMaskNum != 0 || viaIter->bottomMaskNum != 0) {
-		fprintf(fout, "%s VIA ITERATE MASK %d%d%d ( %g %g ) %s", inName,
-			viaIter->topMaskNum, viaIter->cutMaskNum, 
-			viaIter->bottomMaskNum,
-			chkNum(viaIter->x), chkNum(viaIter->y), viaIter->name);
-	     } else {
-		fprintf(fout, "%s VIA ITERATE ( %g %g ) %s", inName,
-			chkNum(viaIter->x), chkNum(viaIter->y), viaIter->name);
-	     }
-             fprintf(fout, " DO %g BY %g STEP %g %g\n",
-                     chkNum(viaIter->xStart), chkNum(viaIter->yStart),
-                     chkNum(viaIter->xStep), chkNum(viaIter->yStep));
-             break;
-        default:
-             fprintf(fout, "BOGUS geometries type.\n");
-             break;
-     }
-  }
-}
-
-// Antenna
-int antennaCB(lefrCallbackType_e c, double value, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-
-  switch (c) {
-        case lefrAntennaInputCbkType:
-             fprintf(fout, "ANTINPUTGATEAREA %g\n", chkNum(value));
-             break;
-        case lefrAntennaInoutCbkType:
-             fprintf(fout, "ANTINOUTDIFFAREA %g\n", chkNum(value));
-             break;
-        case lefrAntennaOutputCbkType:
-             fprintf(fout, "ANTOUTPUTDIFFAREA %g\n", chkNum(value));
-             break;
-        case lefrInputAntennaCbkType:
-             fprintf(fout, "INPUTPINANTENNASIZE %g\n", chkNum(value));
-             break;
-        case lefrOutputAntennaCbkType:
-             fprintf(fout, "OUTPUTPINANTENNASIZE %g\n", chkNum(value));
-             break;
-        case lefrInoutAntennaCbkType:
-             fprintf(fout, "INOUTPINANTENNASIZE %g\n", chkNum(value));
-             break;
-        default:
-             break;
-  }
-  return 0;
-}
-
-// Array
-int arrayCB(lefrCallbackType_e c, lefiArray* a, lefiUserData ud) {
-  int              i, j, defCaps;
-  lefiSitePattern* pattern;
-  lefiTrackPattern* track;
-  lefiGcellPattern* gcell;
-
-  checkType(c);
-  if (ud != userData) dataError();
-   
-  if (a->numSitePattern() > 0) {
-     for (i = 0; i < a->numSitePattern(); i++) {
-        pattern = a->sitePattern(i);
-        fprintf(fout, "ARRAY %s SITE %s %g %g %s DO %g BY %g STEP %g %g\n",
-               a->name(), pattern->name(), chkNum(pattern->x()),
-               chkNum(pattern->y()), lefiOrientStr(pattern->orient()),
-               chkNum(pattern->xStart()), chkNum(pattern->yStart()),
-               chkNum(pattern->xStep()), chkNum(pattern->yStep()));
-     }
-  }
-  if (a->numCanPlace() > 0) {
-     for (i = 0; i < a->numCanPlace(); i++) {
-        pattern = a->canPlace(i);
-        fprintf(fout, "ARRAY %s CANPLACE %s %g %g %s DO %g BY %g STEP %g %g\n",
-               a->name(), pattern->name(), chkNum(pattern->x()),
-               chkNum(pattern->y()), lefiOrientStr(pattern->orient()),
-               chkNum(pattern->xStart()), chkNum(pattern->yStart()),
-               chkNum(pattern->xStep()), chkNum(pattern->yStep()));
-     }
-  }
-  if (a->numCannotOccupy() > 0) {
-     for (i = 0; i < a->numCannotOccupy(); i++) {
-        pattern = a->cannotOccupy(i);
-        fprintf(fout, "ARRAY %s CANNOTOCCUPY %s %g %g %s DO %g BY %g STEP %g %g\n",
-               a->name(), pattern->name(), chkNum(pattern->x()),
-               chkNum(pattern->y()), lefiOrientStr(pattern->orient()),
-               chkNum(pattern->xStart()), chkNum(pattern->yStart()),
-               chkNum(pattern->xStep()), chkNum(pattern->yStep()));
-     }
-  }
-
-  if (a->numTrack() > 0) {
-     for (i = 0; i < a->numTrack(); i++) {
-        track = a->track(i);
-        // 11/22/99 - Wanda da Rosa, PCR 283781.  Merge the track with
-        // layer names.  This way, if user split the layer into different
-        // line, the diff program won't generate extra lines.
-        if (track->numLayers() == 0) {
-           fprintf(fout, "ARRAY %s TRACKS %s, %g DO %d STEP %g\n", a->name(),
-                   track->name(), chkNum(track->start()), track->numTracks(), 
-                   chkNum(track->space())); 
-        } else {
-           fprintf(fout, "ARRAY %s TRACKS %s, %g DO %d STEP %g ", a->name(),
-                   track->name(), chkNum(track->start()), track->numTracks(), 
-                   chkNum(track->space())); 
-           for (j = 0; j < track->numLayers(); j++)
-              fprintf(fout, "%s ", track->layerName(j));
-           fprintf(fout, ";\n"); 
-        }
-     }
-  }
-
-  if (a->numGcell() > 0) {
-     for (i = 0; i < a->numGcell(); i++) {
-        gcell = a->gcell(i);
-        fprintf(fout, "ARRAY %s GCELLGRID %s, %g DO %d STEP %g\n", a->name(),
-                gcell->name(), chkNum(gcell->start()), gcell->numCRs(),
-                chkNum(gcell->space())); 
-     }
-  }
-
-  if (a->numFloorPlans() > 0) {
-     for (i = 0; i < a->numFloorPlans(); i++) {
-        for (j = 0; j < a->numSites(i); j++) {
-           pattern = a->site(i, j);
-           fprintf(fout,
-               "ARRAY %s FLOORPLAN %s %s %s %g %g %s DO %d BY %d STEP %g %g\n",
-               a->name(), a->floorPlanName(i), a->siteType(i, j),
-               pattern->name(), chkNum(pattern->x()), chkNum(pattern->y()),
-               lefiOrientStr(pattern->orient()), pattern->xStart(),
-               pattern->yStart(), chkNum(pattern->xStep()),
-               chkNum(pattern->yStep()));
-        }
-     }
-  }
-
-  defCaps = a->numDefaultCaps();
-  if (defCaps > 0) {
-     for (i = 0; i < defCaps; i++)
-        fprintf(fout, "ARRAY %s DEFAULTCAP %d MINPINS %g WIRECAP %g\n",
-                a->name(), defCaps, chkNum(a->defaultCapMinPins(i)),
-                chkNum(a->defaultCap(i)));
-  }
-  return 0;
-}
-
-// Busbitchar
-int busBitCharsCB(lefrCallbackType_e c, const char* busBit, lefiUserData ud)
-{
-  checkType(c);
-  if (ud != userData) dataError();
-  // use the lef writer to write out the data
-  fprintf(fout, "BUSBITCHARS %s\n", busBit);
-  return 0;
-}
-
-// CaseSensitive
-int caseSensCB(lefrCallbackType_e c, int caseSense, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-
-  if (caseSense == TRUE)
-     fprintf(fout, "NAMESCASESENSITIVE ON\n");
-  else
-     fprintf(fout, "NAMESCASESENSITIVE OFF\n");
-  return 0;
-}
-
-// FixedMask
-int fixedMaskCB(lefrCallbackType_e c, int fixedMask, lefiUserData ud) {
-    checkType(c);
-    if (ud != userData) dataError();
-
-    if (fixedMask == 1) 
-        fprintf(fout, "FIXEDMASK ;\n");
-    return 0;
-}
-
-// Crearance
-int clearanceCB(lefrCallbackType_e c, const char* name, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-
-  fprintf(fout, "CLEARANCEMEASURE %s\n", name);
-  return 0;
-}
-
-// Crosstalk correcttable
-int correctTableCB(lefrCallbackType_e c, lefiCorrectionTable* table,
-                   lefiUserData ud) {
-  int                      i, j, k, l;
-  lefiCorrectionEdge       *edge;
-  lefiCorrectionResistance *resist;
-  lefiCorrectionVictim     *victim;
- 
-  checkType(c);
-  if (ud != userData) dataError();
-
-  fprintf(fout, "CROSSTALK CORRECTIONTABLE %d\n", table->num());
-  for (i = 0; i < table->numEdges(); i++) {
-     edge = table->edge(i);
-     // resistances
-     if (edge->numResistances()) {
-        for (j = 0; j < edge->numResistances(); j++) {
-           resist = edge->resistance(j);
-           fprintf(fout, "CROSSTALK CORRECTIONTABLE %d RESISTANCE %g\n",
-                   table->num(), chkNum(resist->num(j)));
-           // victims
-           for (k = 0; k < resist->numVictims(); k++) {
-              victim = resist->victim(k);
-              if (victim->length() > 0)
-                 fprintf(fout,
-                    "CROSSTALK CORRECTIONTABLE %d RESISTANCE %g VICTIMLEN %g\n",
-                         table->num(), chkNum(resist->num(j)),
-                         chkNum(victim->length()));
-                 for (l = 0; l < victim->numCorrections(); l++)
-                    fprintf(fout,
-                    "CROSSTALK CORRECTIONTABLE %d RESISTANCE %g VICTIM GTH %g CORRECTIONFACTOR %g\n",
-                       table->num(), chkNum(resist->num(j)),
-                       chkNum(victim->length()), chkNum(victim->correction(l)));
-           }
-        }
-     }
-  }
-  return 0;
-}
-
-// Dielectric
-int dielectricCB(lefrCallbackType_e c, double dielectric, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-
-  fprintf(fout, "DIELECTRIC %g\n", chkNum(dielectric));
-  return 0;
-}
-
-// Divider
-int dividerCB(lefrCallbackType_e c, const char* divideChar, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DIVIDER %s\n", divideChar);
-  return 0;
-}
-
-// Crosstalk edgeRate
-int edgeRateCB(lefrCallbackType_e c, double rate, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "CROSSTALK EDGERATESCALEFACTOR %g\n", chkNum(rate));
-  return 0;
-}
-
-// Callback routine for edgeratethreshold1
-int edgeRate1CB(lefrCallbackType_e c, double rate, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "CROSSTALK EDGERATETHRESHOLD1 %g\n", chkNum(rate));
-  return 0;
-}
-
-// Callback routine for edgeratethreshold2
-int edgeRate2CB(lefrCallbackType_e c, double rate, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "CROSSTALK EDGERATETHRESHOLD2 %g\n", chkNum(rate));
-  return 0;
-}
-
-// InputAntenna
-int inputAntCB(lefrCallbackType_e c, double antenna, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "INPUTINANTENNASIZE %g\n", chkNum(antenna));
-  return 0;
-}
-
-// OutputAntenna
-int outputAntCB(lefrCallbackType_e c, double antenna, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "OUTPUTINANTENNASIZE %g\n", chkNum(antenna));
-  return 0;
-}
-
-
-// InOutAntenna
-int inoutAntCB(lefrCallbackType_e c, double antenna, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "INOUTPUTINANTENNASIZE %g\n", chkNum(antenna));
-  return 0;
-}
-
-// Irdrop
-int irdropCB(lefrCallbackType_e c, lefiIRDrop* irdrop, lefiUserData ud) {
-  int i;
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "IRDROP TABLE %s ", irdrop->name());
-  for (i = 0; i < irdrop->numValues(); i++) 
-     fprintf(fout, "%g %g ", chkNum(irdrop->value1(i)),
-             chkNum(irdrop->value2(i)));
-  fprintf(fout, "\n");
-  return 0;
-}
-
-// Layer
-int layerCB(lefrCallbackType_e c, lefiLayer* layer, lefiUserData ud) {
-  int                 i, j, k;
-  double              *widths, *current;
-  lefiLayerDensity*   density;
-  char                pType;
-  int                 numPoints, propNum;
-  lefiAntennaPWL*     pwl;
-  int                 needHeading;
-  int                 numMinCut, numMinenclosed;
-  lefiSpacingTable*   spTable;
-  lefiInfluence*      influence;
-  lefiParallel*       parallel;
-  lefiTwoWidths*      twoWidths;
-  lefiAntennaModel*   aModel;
-  lefiOrthogonal*     ortho;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (layer->hasType())
-     fprintf(fout, "LAYER %s TYPE %s\n", layer->name(), layer->type());
-  if (layer->hasMask())
-     fprintf(fout, "LAYER %s MASK %d\n", layer->name(), layer->mask());
-  if (layer->hasPitch())
-     fprintf(fout, "LAYER %s PITCH %g\n", layer->name(), chkNum(layer->pitch()));
-  else if (layer->hasXYPitch())
-     fprintf(fout, "LAYER %s PITCH %g %g\n", layer->name(),
-             chkNum(layer->pitchX()), chkNum(layer->pitchY()));
-  if (layer->hasOffset())
-     fprintf(fout, "LAYER %s OFFSET %g\n", layer->name(),
-             chkNum(layer->offset()));
-  else if (layer->hasXYOffset())
-     fprintf(fout, "LAYER %s OFFSET %g %g\n", layer->name(),
-             chkNum(layer->offsetX()), chkNum(layer->offsetY()));
-  if (layer->hasDiagPitch())
-     fprintf(fout, "LAYER %s DIAGPITCH %g\n", layer->name(),
-             chkNum(layer->diagPitch()));
-  else if (layer->hasXYDiagPitch())
-     fprintf(fout, "LAYER %s DIAGPITCH %g %g\n", layer->name(),
-             chkNum(layer->diagPitchX()), chkNum(layer->diagPitchY()));
-  if (layer->hasDiagWidth())
-     fprintf(fout, "LAYER %s DIAGWIDTH %g\n", layer->name(),
-             chkNum(layer->diagWidth()));
-  if (layer->hasDiagSpacing())
-     fprintf(fout, "LAYER %s DIAGSPACING %g\n", layer->name(),
-             chkNum(layer->diagSpacing()));
-  if (layer->hasDiagMinEdgeLength())
-     fprintf(fout, "LAYER %s DIAGMINEDGELENGTH %g\n", layer->name(),
-             chkNum(layer->diagMinEdgeLength()));
-  if (layer->hasWidth())
-     fprintf(fout, "LAYER %s WIDTH %g\n", layer->name(),
-             chkNum(layer->width()));
-  if (layer->hasArea())
-     fprintf(fout, "LAYER %s AREA %g\n", layer->name(),
-             chkNum(layer->area()));
-  if (layer->numMinSize()) {
-     fprintf(fout, "LAYER %s MINSIZE", layer->name());
-     for (i = 0; i < layer->numMinSize(); i++)
-        fprintf(fout, " %g %g", layer->minSizeWidth(i),
-                                layer->minSizeLength(i));
-     fprintf(fout, "\n");
-  }
-  if (layer->hasSlotWireWidth())
-     fprintf(fout, "LAYER %s SLOTWIREWIDTH %g\n", layer->name(),
-             chkNum(layer->slotWireWidth()));
-  if (layer->hasSlotWireLength())
-     fprintf(fout, "LAYER %s SLOTWIRELENGTH %g\n", layer->name(),
-             chkNum(layer->slotWireLength()));
-  if (layer->hasSlotWidth())
-     fprintf(fout, "LAYER %s SLOTWIDTH %g\n", layer->name(),
-             chkNum(layer->slotWidth()));
-  if (layer->hasSlotLength())
-     fprintf(fout, "LAYER %s SLOTLENGTH %g\n", layer->name(),
-             chkNum(layer->slotLength()));
-  if (layer->hasMaxAdjacentSlotSpacing())
-     fprintf(fout, "LAYER %s MAXADJACENTSLOTSPACING %g\n", layer->name(),
-             chkNum(layer->maxAdjacentSlotSpacing()));
-  if (layer->hasMaxCoaxialSlotSpacing())
-     fprintf(fout, "LAYER %s MAXCOAXIALSLOTSPACING %g\n", layer->name(),
-             chkNum(layer->maxCoaxialSlotSpacing()));
-  if (layer->hasMaxEdgeSlotSpacing())
-     fprintf(fout, "LAYER %s MAXEDGESLOTSPACING %g\n", layer->name(),
-             chkNum(layer->maxEdgeSlotSpacing()));
-  if (layer->hasArraySpacing()) {
-     fprintf(fout, "LAYER %s ARRAYSPACING", layer->name());
-     if (layer->hasLongArray())
-        fprintf(fout, " LONGARRAY");
-     if (layer->hasViaWidth())
-        fprintf(fout, " WIDTH %g", chkNum(layer->viaWidth()));
-     fprintf(fout, " CUTSPACING %g", chkNum(layer->cutSpacing()));
-     fprintf(fout, "\n");
-     for (i = 1; i < layer->numArrayCuts(); i++) {
-        fprintf(fout, "LAYER %s ARRAYCUTS %i SPACING %g\n", layer->name(),
-                layer->arrayCuts(i),
-                layer->arraySpacing(i));
-     }
-  }
-  if (layer->hasSplitWireWidth())
-     fprintf(fout, "LAYER %s SPLITWIREWIDTH %g\n", layer->name(),
-             chkNum(layer->splitWireWidth()));
-  if (layer->hasMinimumDensity())
-     fprintf(fout, "LAYER %s MINIMUMDENSITY %g\n", layer->name(),
-             chkNum(layer->minimumDensity()));
-  if (layer->hasMaximumDensity())
-     fprintf(fout, "LAYER %s MAXIMUMDENSITY %g\n", layer->name(),
-             chkNum(layer->maximumDensity()));
-  if (layer->hasDensityCheckWindow())
-     fprintf(fout, "LAYER %s DENSITYCHECKWINDOW %g %g\n", layer->name(),
-             chkNum(layer->densityCheckWindowLength()),
-             chkNum(layer->densityCheckWindowWidth()));
-  if (layer->hasDensityCheckStep())
-     fprintf(fout, "LAYER %s DENSITYCHECKSTEP %g\n", layer->name(),
-             chkNum(layer->densityCheckStep()));
-  if (layer->hasFillActiveSpacing())
-     fprintf(fout, "LAYER %s FILLACTIVESPACING %g\n", layer->name(),
-             chkNum(layer->fillActiveSpacing()));
-  numMinCut = layer->numMinimumcut();    // 5.4.1
-  if (numMinCut > 0) {
-     for (i = 0; i < numMinCut; i++) {
-         fprintf(fout, "LAYER %s MINIMUMCUT %d WIDTH %g", layer->name(),
-              layer->minimumcut(i),
-              layer->minimumcutWidth(i));
-         if (layer->hasMinimumcutWithin(i))
-            fprintf(fout, " WITHIN %g", layer->minimumcutWithin(i));
-         if (layer->hasMinimumcutConnection(i))
-            fprintf(fout, " %s", layer->minimumcutConnection(i));
-         if (layer->hasMinimumcutNumCuts(i))
-            fprintf(fout, " LENGTH %g WITHIN %g",
-            layer->minimumcutLength(i),
-            layer->minimumcutDistance(i));
-         fprintf(fout, "\n");
-     }
-  }
-  if (layer->hasMaxwidth())              // 5.4.1
-     fprintf(fout, "LAYER %s MAXWIDTH %g\n", layer->name(), layer->maxwidth()); 
-  if (layer->hasMinwidth())              // 5.5
-     fprintf(fout, "LAYER %s MINWIDTH %g\n", layer->name(), layer->minwidth()); 
-  numMinenclosed = layer->numMinenclosedarea();
-  if (numMinenclosed > 0) {
-     for (i = 0; i < numMinenclosed; i++) {  // 5.5, made it multiples
-        fprintf(fout, "LAYER %s MINENCLOSEDAREA %g", layer->name(),
-               layer->minenclosedarea(i));
-        if (layer->hasMinenclosedareaWidth(i))
-           fprintf(fout, " MINENCLOSEDAREAWIDTH %g",
-                   layer->minenclosedareaWidth(i));
-        fprintf(fout,"\n");
-     }
-  }
-  if (layer->hasMinstep()) {               // 5.4.1 & 5.6
-     for (i = 0; i < layer->numMinstep(); i++) {
-        fprintf(fout, "LAYER %s MINSTEP %g", layer->name(),
-                layer->minstep(i));
-        if (layer->hasMinstepType(i))
-           fprintf(fout, " %s", layer->minstepType(i));
-        if (layer->hasMinstepLengthsum(i))
-           fprintf(fout, " LENGTHSUM %g", layer->minstepLengthsum(i));
-        if (layer->hasMinstepMaxedges(i))
-           fprintf(fout, " MAXEDGES %d", layer->minstepMaxedges(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (layer->hasProtrusion())            // 5.4.1
-     fprintf(fout, "LAYER %s PROTRUSIONWIDTH %g LENGTH %g WIDTH %g\n",
-             layer->name(), layer->protrusionWidth1(),
-             layer->protrusionLength(), layer->protrusionWidth2());
-  if (layer->hasSpacingNumber()) {
-     for (i = 0; i < layer->numSpacing(); i++) {
-        fprintf(fout, "LAYER %s SPACING %g", layer->name(),
-                chkNum(layer->spacing(i)));
-        if (layer->spacingName(i))
-           fprintf(fout, " LAYER %s", layer->spacingName(i));
-        if (layer->hasSpacingLayerStack(i))
-           fprintf(fout, " STACK");
-        fprintf(fout,"\n");
-        if (layer->hasSpacingAdjacent(i))
-           fprintf(fout, "LAYER %s ADJACENTCUTS %d WITHIN %g\n", layer->name(),
-                   layer->spacingAdjacentCuts(i),
-                   chkNum(layer->spacingAdjacentWithin(i)));
-        if (layer->hasSpacingAdjacentExcept(i))
-           fprintf(fout, "LAYER %s EXCEPTSAMEPGNET\n", layer->name());
-        if (layer->hasSpacingCenterToCenter(i))
-           fprintf(fout, "LAYER %s CENTERTOCENTER\n", layer->name());
-        if (layer->hasSpacingSamenet(i)) {
-           fprintf(fout, "LAYER %s SAMENET", layer->name());
-           if (layer->hasSpacingSamenetPGonly(i))
-              fprintf(fout, " PGONLY\n");
-           else
-              fprintf(fout, "\n");
-        }
-        if (layer->hasSpacingArea(i))
-           fprintf(fout, "LAYER %s AREA %g\n", layer->name(),
-                  chkNum(layer->spacingArea(i)));
-        if (layer->hasSpacingRange(i)) {
-           fprintf(fout, "LAYER %s RANGE %g %g", layer->name(),
-                   chkNum(layer->spacingRangeMin(i)),
-                   chkNum(layer->spacingRangeMax(i)));
-           if (layer->hasSpacingRangeUseLengthThreshold(i))
-              fprintf(fout, "USELENGTHTHRESHOLD ");
-          else if (layer->hasSpacingRangeInfluence(i)) {
-              fprintf(fout, "INFLUENCE %g ",
-                 layer->spacingRangeInfluence(i));
-              if (layer->hasSpacingRangeInfluenceRange(i))
-                 fprintf(fout, "RANGE %g %g ",
-                    layer->spacingRangeInfluenceMin(i),
-                    layer->spacingRangeInfluenceMax(i));
-           } else if (layer->hasSpacingRangeRange(i))
-               fprintf(fout, "RANGE %g %g ",
-                 layer->spacingRangeRangeMin(i),
-                 layer->spacingRangeRangeMax(i));
-           fprintf(fout,"\n");
-        }
-        else if (layer->hasSpacingLengthThreshold(i)) {
-           fprintf(fout, "LAYER %s LENGTHTHRESHOLD %g\n", layer->name(),
-                   chkNum(layer->spacingLengthThreshold(i)));
-           if (layer->hasSpacingLengthThresholdRange(i))
-              fprintf(fout, "RANGE %g %g",
-                 layer->spacingLengthThresholdRangeMin(i),
-                 layer->spacingLengthThresholdRangeMax(i));
-           fprintf(fout,"\n");
-        }
-        else if (layer->hasSpacingNotchLength(i)) {
-           fprintf(fout, "LAYER %s NOTCHLENGTH %g\n", layer->name(),
-                   chkNum(layer->spacingNotchLength(i)));
-        }
-        else if (layer->hasSpacingEndOfNotchWidth(i)) {
-           fprintf(fout, "LAYER %s ENDOFNOTCHWIDTH %g NOTCHSPACING %g, NOTCHLENGTH %g\n",
-                   layer->name(),
-                   chkNum(layer->spacingEndOfNotchWidth(i)),
-                   chkNum(layer->spacingEndOfNotchSpacing(i)),
-                   chkNum(layer->spacingEndOfNotchLength(i)));
-        }
-        if (layer->hasSpacingParallelOverlap(i))
-           fprintf(fout, "LAYER %s PARALLELOVERLAP\n", layer->name());
-        if (layer->hasSpacingEndOfLine(i)) {
-           fprintf(fout, "LAYER %s ENDOFLINE %g WITHIN %g ", layer->name(),
-              chkNum(layer->spacingEolWidth(i)),
-              chkNum(layer->spacingEolWithin(i)));
-           if (layer->hasSpacingParellelEdge(i)) {
-              fprintf(fout, "PARALLELEDGE %g WITHIN %g ",
-                 chkNum(layer->spacingParSpace(i)),
-                 chkNum(layer->spacingParWithin(i)));
-              if (layer->hasSpacingTwoEdges(i)) {
-                 fprintf(fout, "TWOEDGES ");
-              }
-           }
-           fprintf(fout,"\n");
-        }
-     }
-  }
-  if (layer->hasSpacingTableOrtho()) { 
-     fprintf(fout, "LAYER %s SPACINGTABLE ORTHOGONAL\n", layer->name());
-     ortho = layer->orthogonal();
-     for (i = 0; i < ortho->numOrthogonal(); i++) {
-        fprintf(fout, "LAYER %s SPACINGTABLE ORTHOGONAL WITHIN %g SPACING %g\n",
-                layer->name(), ortho->cutWithin(i),
-                ortho->orthoSpacing(i));
-     }
-     fprintf(fout, ";\n");
-  }
-  if (layer->numEnclosure() > 0) {
-     fprintf(fout, "LAYER %s ENCLOSURE", layer->name());
-     for (i = 0; i < layer->numEnclosure(); i++) {
-        if (layer->hasEnclosureRule(i))
-           fprintf(fout, " %s", layer->enclosureRule(i));
-        fprintf(fout, " %g %g", layer->enclosureOverhang1(i),
-                                layer->enclosureOverhang2(i));
-        if (layer->hasEnclosureWidth(i))
-           fprintf(fout, " WIDTH %g", layer->enclosureMinWidth(i));
-        if (layer->hasEnclosureExceptExtraCut(i))
-           fprintf(fout, " EXCEPTEXTRACUT %g",
-                   layer->enclosureExceptExtraCut(i));
-        if (layer->hasEnclosureMinLength(i))
-           fprintf(fout, " LENGTH %g", layer->enclosureMinLength(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (layer->numPreferEnclosure() > 0) {
-     fprintf(fout, "LAYER %s PREFERENCLOSURE", layer->name());
-     for (i = 0; i < layer->numPreferEnclosure(); i++) {
-        if (layer->hasPreferEnclosureRule(i))
-           fprintf(fout, "%s ", layer->preferEnclosureRule(i));
-        fprintf(fout, "%g %g ", layer->preferEnclosureOverhang1(i),
-                                layer->preferEnclosureOverhang2(i));
-        if (layer->hasPreferEnclosureWidth(i))
-           fprintf(fout, "WIDTH %g ",layer->preferEnclosureMinWidth(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (layer->hasResistancePerCut())
-     fprintf(fout, "LAYER %s RESISTANCE %g\n", layer->name(),
-             chkNum(layer->resistancePerCut()));
-  if (layer->hasCurrentDensityPoint())
-     fprintf(fout, "LAYER %s CURRENTDEN %g\n", layer->name(),
-             chkNum(layer->currentDensityPoint()));
-  if (layer->hasCurrentDensityArray()) {
-     layer->currentDensityArray(&numPoints, &widths, &current);
-     for (i = 0; i < numPoints; i++)
-         fprintf(fout, "LAYER %s CURRENTDEN ( %g %g )\n", layer->name(),
-                 chkNum(widths[i]), chkNum(current[i]));
-  }
-  if (layer->hasDirection())
-     fprintf(fout, "LAYER %s DIRECTION %s\n", layer->name(),
-             layer->direction());
-  if (layer->hasResistance())
-     fprintf(fout, "LAYER %s RESISTANCE RPERSQ %g\n", layer->name(),
-             chkNum(layer->resistance()));
-  if (layer->hasCapacitance())
-     fprintf(fout, "LAYER %s CAPACITANCE CPERSQDIST %g\n", layer->name(),
-             chkNum(layer->capacitance()));
-  if (layer->hasHeight())
-     fprintf(fout, "LAYER %s HEIGHT %g\n", layer->name(), chkNum(layer->height()));
-  if (layer->hasThickness())
-     fprintf(fout, "LAYER %s THICKNESS %g\n", layer->name(),
-             chkNum(layer->thickness()));
-  if (layer->hasWireExtension())
-     fprintf(fout, "LAYER %s WIREEXTENSION %g\n", layer->name(),
-             chkNum(layer->wireExtension()));
-  if (layer->hasShrinkage())
-     fprintf(fout, "LAYER %s SHRINKAGE %g\n", layer->name(),
-             chkNum(layer->shrinkage()));
-  if (layer->hasCapMultiplier())
-     fprintf(fout, "LAYER %s CAPMULTIPLIER %g\n", layer->name(),
-             chkNum(layer->capMultiplier()));
-  if (layer->hasEdgeCap())
-     fprintf(fout, "LAYER %s EDGECAPACITANCE %g\n", layer->name(),
-             chkNum(layer->edgeCap()));
-  if (layer->hasAntennaArea())
-     fprintf(fout, "LAYER %s ANTAREAFACTOR %g\n", layer->name(),
-             chkNum(layer->antennaArea()));
-  if (layer->hasAntennaLength())
-     fprintf(fout, "LAYER %s ANTLENGTHFACTOR %g\n", layer->name(),
-             chkNum(layer->antennaLength()));
-  for (j = 0; j < layer->numAntennaModel(); j++) { // 5.5
-     aModel = layer->antennaModel(j);
-
-     if (aModel->hasAntennaAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaAreaRatio()));
-     if (aModel->hasAntennaDiffAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTDIFFAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaDiffAreaRatio()));
-     else if (aModel->hasAntennaDiffAreaRatioPWL()) {
-        pwl = aModel->antennaDiffAreaRatioPWL();
-        fprintf(fout, "LAYER %s %s ANTDIFFAREARATIO PWL", layer->name(),
-                aModel->antennaOxide());
-        for (i = 0; i < pwl->numPWL(); i++)
-           fprintf(fout, " %g %g", chkNum(pwl->PWLdiffusion(i)),
-                   chkNum(pwl->PWLratio(i)));
-        fprintf(fout, "\n");
-     }
-     if (aModel->hasAntennaCumAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTCUMAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaCumAreaRatio()));
-     if (aModel->hasAntennaCumDiffAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTCUMDIFFAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaCumDiffAreaRatio()));
-     else if (aModel->hasAntennaCumDiffAreaRatioPWL()) {
-        pwl = aModel->antennaCumDiffAreaRatioPWL();
-        fprintf(fout, "LAYER %s %s ANTCUMDIFFAREARATIO PWL", layer->name(),
-                aModel->antennaOxide());
-        for (i = 0; i < pwl->numPWL(); i++)
-           fprintf(fout, " %g %g", chkNum(pwl->PWLdiffusion(i)),
-                   chkNum(pwl->PWLratio(i)));
-        fprintf(fout, "\n");
-     }
-     if (aModel->hasAntennaAreaFactor()) {
-        fprintf(fout, "LAYER %s %s ANTAREAFACTOR %g", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaAreaFactor()));
-        if (aModel->hasAntennaAreaFactorDUO())
-           fprintf(fout, "  DIFFUSEONLY");
-        fprintf(fout, "\n");
-     }
-     if (aModel->hasAntennaSideAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTSIDEAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaSideAreaRatio()));
-     if (aModel->hasAntennaDiffSideAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTDIFFSIDEAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaDiffSideAreaRatio()));
-     else if (aModel->hasAntennaDiffSideAreaRatioPWL()) {
-        pwl = aModel->antennaDiffSideAreaRatioPWL();
-        fprintf(fout, "LAYER %s %s ANTDIFFSIDEAREARATIO PWL", layer->name(),
-                aModel->antennaOxide());
-        for (i = 0; i < pwl->numPWL(); i++)
-           fprintf(fout, " %g %g", chkNum(pwl->PWLdiffusion(i)),
-                   chkNum(pwl->PWLratio(i)));
-        fprintf(fout, "\n");
-     }
-     if (aModel->hasAntennaCumSideAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTCUMSIDEAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaCumSideAreaRatio()));
-     if (aModel->hasAntennaCumDiffSideAreaRatio())
-        fprintf(fout, "LAYER %s %s ANTCUMDIFFSIDEAREARATIO %g\n", layer->name(),
-                aModel->antennaOxide(),
-                chkNum(aModel->antennaCumDiffSideAreaRatio()));
-     else if (aModel->hasAntennaCumDiffSideAreaRatioPWL()) {
-        pwl = aModel->antennaCumDiffSideAreaRatioPWL();
-        fprintf(fout, "LAYER %s %s ANTCUMDIFFSIDEAREARATIO PWL", layer->name(),
-                aModel->antennaOxide());
-        for (i = 0; i < pwl->numPWL(); i++)
-           fprintf(fout, "%g %g ", chkNum(pwl->PWLdiffusion(i)),
-                   chkNum(pwl->PWLratio(i)));
-        fprintf(fout, "\n");
-     }
-     if (aModel->hasAntennaSideAreaFactor()) {
-        fprintf(fout, "  ANTSIDEAREAFACTOR %g ",
-                chkNum(aModel->antennaSideAreaFactor()));
-        if (aModel->hasAntennaSideAreaFactorDUO())
-           fprintf(fout, "  DIFFUSEONLY ");
-        fprintf(fout, "\n");
-     }
-  }
-
-  if (layer->numAccurrentDensity()) {
-     for (i = 0; i < layer->numAccurrentDensity(); i++) {
-         density = layer->accurrent(i);
-         fprintf(fout, "LAYER %s ACCURRENTDENSITY %s", layer->name(),
-                 density->type());
-         needHeading = 0;
-         if (density->hasOneEntry())
-             fprintf(fout, " %g\n", chkNum(density->oneEntry()));
-         else {
-             if (density->numFrequency()) {
-/*
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s ACCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                }
-*/
-                fprintf(fout, " FREQUENCY");
-                for (j = 0; j < density->numFrequency(); j++)
-                   fprintf(fout, " %g", chkNum(density->frequency(j)));
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-             if (density->numWidths()) {
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s ACCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                }
-                fprintf(fout, " WIDTH");
-                for (j = 0; j < density->numWidths(); j++)
-                   fprintf(fout, " %g", chkNum(density->width(j)));
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-             if (density->numTableEntries()) {
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s ACCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                   k = 0;
-                }
-                else k = 5;
-                fprintf(fout, " TABLEENTRIES");
-                for (j = 0; j < density->numTableEntries(); j++) {
-                   if (k > 4) {
-                      fprintf(fout,
-                          "\nLAYER %s ACCURRENTDENSITY %s TABLEENTRIES %g",
-                          layer->name(), density->type(),
-                          chkNum(density->tableEntry(j)));
-                      k = 1;
-                   } else {
-                      fprintf(fout, " %g", chkNum(density->tableEntry(j)));
-                      k++;
-                   }
-                }
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-         }
-     }
-  }
-  if (layer->numDccurrentDensity()) {
-     for (i = 0; i < layer->numDccurrentDensity(); i++) {
-         density = layer->dccurrent(i);
-         fprintf(fout, "LAYER %s DCCURRENTDENSITY %s", layer->name(),
-                 density->type());
-         needHeading = 0;
-         if (density->hasOneEntry())
-             fprintf(fout, " %g\n", chkNum(density->oneEntry()));
-         else {
-             if (density->numCutareas()) {
-/*
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s DCCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                }
-*/
-                fprintf(fout, " CUTAREA");
-                for (j = 0; j < density->numCutareas(); j++)
-                   fprintf(fout, " %g", chkNum(density->cutArea(j)));
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-             if (density->numWidths()) {
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s DCCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                }
-                fprintf(fout, " WIDTH");
-                for (j = 0; j < density->numWidths(); j++)
-                   fprintf(fout, " %g", chkNum(density->width(j)));
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-             if (density->numTableEntries()) {
-                if (needHeading) {
-                   fprintf(fout, "LAYER %s DCCURRENTDENSITY %s", layer->name(),
-                   density->type());
-                }
-                fprintf(fout, " TABLEENTRIES");
-                for (j = 0; j < density->numTableEntries(); j++)
-                   fprintf(fout, " %g", chkNum(density->tableEntry(j)));
-                fprintf(fout, "\n");
-                needHeading = 1;
-             }
-         }
-     }
-  }
-
-  for (i = 0; i < layer->numSpacingTable(); i++) {
-     spTable = layer->spacingTable(i);
-     if (spTable->isInfluence()) {
-        influence = spTable->influence();
-        for (j = 0; j < influence->numInfluenceEntry(); j++) {
-           fprintf(fout, "LAYER %s SPACINGTABLE INFLUENCE WIDTH %g WITHIN %g SPACING %g\n",
-                   layer->name(), influence->width(j), influence->distance(j),
-                   influence->spacing(j));
-        }
-     } else if (spTable->isParallel()) {
-        parallel = spTable->parallel();
-        fprintf(fout, "LAYER %s SPACINGTABLE PARALLELRUNLENGTH", layer->name());
-        for (j = 0; j < parallel->numLength(); j++) {
-           fprintf(fout, " %g", parallel->length(j));
-        }
-        fprintf(fout, "\n");
-        for (j = 0; j < parallel->numWidth(); j++) {
-           fprintf(fout, "LAYER %s SPACINGTABLE PARALLELRUNLENGTH WIDTH %g",
-                   layer->name(), parallel->width(j));
-           for (k = 0; k < parallel->numLength(); k++) {
-              fprintf(fout, " %g", parallel->widthSpacing(j, k));
-           }
-        }
-        fprintf(fout, "\n");
-     } else {
-        twoWidths = spTable->twoWidths();
-        for (j = 0; j < twoWidths->numWidth(); j++) {
-           fprintf(fout, "LAYER %s TWOWIDTHS", layer->name());
-           fprintf(fout, " WIDTH %g", twoWidths->width(j));
-           if (twoWidths->hasWidthPRL(j))
-              fprintf(fout, " PRL %g", twoWidths->widthPRL(j));
-           for (k = 0; k < twoWidths->numWidthSpacing(j); k++)
-              fprintf(fout, " %g",twoWidths->widthSpacing(j, k));
-           fprintf(fout, "\n");
-        }
-     }
-  }
-  propNum = layer->numProps();
-  if (propNum > 0) {
-     for (i = 0; i < propNum; i++) {
-        fprintf(fout, "LAYER %s PROP ", layer->name());
-        // value can either be a string or number
-        fprintf(fout, "%s %s ", layer->propName(i),
-                layer->propValue(i));
-        pType = layer->propType(i);
-        switch (pType) {
-           case 'R': fprintf(fout, "REAL");
-                     break;
-           case 'I': fprintf(fout, "INTEGER");
-                     break;
-           case 'S': fprintf(fout, "STRING");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING");
-                     break;
-           case 'N': fprintf(fout, "NUMBER");
-                     break;
-        }
-        fprintf(fout, "\n");
-     }
-  }
-
-  return 0;
-}
-
-// Macro
-int macroCB(lefrCallbackType_e c, lefiMacro* macro, lefiUserData ud) {
-  lefiSitePattern* pattern;
-  int              propNum, i, hasPrtSym = 0;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "MACRO %s", macro->name());
-  if (macro->hasClass())
-     fprintf(fout, " CLASS %s", macro->macroClass());
-  if (macro->isFixedMask())
-     fprintf(fout, " FIXEDMASK ");
-  if (macro->hasEEQ())
-     fprintf(fout, " EEQ %s", macro->EEQ());
-  if (macro->hasLEQ())
-     fprintf(fout, " LEQ %s", macro->LEQ());
-  if (macro->hasSource())
-     fprintf(fout, " SOURCE %s", macro->source());
-  if (macro->hasXSymmetry()) {
-     fprintf(fout, " SYMMETRY X ");
-     hasPrtSym = 1;
-  }
-  if (macro->hasYSymmetry()) {   // print X Y & R90 in one line
-     if (!hasPrtSym) {
-        fprintf(fout, "  SYMMETRY Y ");
-        hasPrtSym = 1;
-     }
-     else
-        fprintf(fout, "Y ");
-  }
-  if (macro->has90Symmetry()) {
-     if (!hasPrtSym) {
-        fprintf(fout, "  SYMMETRY R90 ");
-        hasPrtSym = 1;
-     }
-     else
-        fprintf(fout, "R90 ");
-  }
-  fprintf (fout, "\n");
-  if (macro->hasSiteName())
-     fprintf(fout, "MACRO %s SITE %s\n", macro->name(), macro->siteName());
-  if (macro->hasSitePattern()) {
-     for (i = 0; i < macro->numSitePattern(); i++ ) {
-        pattern = macro->sitePattern(i);
-        if (pattern->hasStepPattern())
-           fprintf(fout, "MACRO %s SITE %s %g %g %d DO %g BY %g STEP %g %g\n",
-                 macro->name(), pattern->name(), chkNum(pattern->x()),
-                 chkNum(pattern->y()), pattern->orient(),
-                 chkNum(pattern->xStart()), chkNum(pattern->yStart()),
-                 chkNum(pattern->xStep()), chkNum(pattern->yStep()));
-        else
-           fprintf(fout, "MACRO %s SITE %s %g %g %d\n",
-                 macro->name(), pattern->name(), chkNum(pattern->x()),
-                 chkNum(pattern->y()), pattern->orient());
-     }
-  }
-  if (macro->hasSize())
-     fprintf(fout, "MACRO %s SIZE %g BY %g\n", macro->name(), 
-             chkNum(macro->sizeX()), chkNum(macro->sizeY()));
-  if (macro->hasForeign()) {
-     for (i = 0; i < macro->numForeigns(); i++) {
-        fprintf(fout, "MACRO %s FOREIGN %s", macro->name(),
-                macro->foreignName(i));
-        if (macro->hasForeignPoint(i)) {
-           fprintf(fout, " ( %g %g )", chkNum(macro->foreignX(i)),
-                   chkNum(macro->foreignY(i)));
-           if (macro->hasForeignOrient(i))
-              fprintf(fout, " %s", lefiOrientStr(macro->foreignOrient(i)));
-        }
-        fprintf(fout, "\n");
-     }
-  }
-  if (macro->hasOrigin())
-     fprintf(fout, "MACRO %s ORIGIN ( %g %g )\n", macro->name(),
-             chkNum(macro->originX()), chkNum(macro->originY()));
-  if (macro->hasPower())
-     fprintf(fout, "MACRO %s POWER %g\n", macro->name(), chkNum(macro->power()));
-  propNum = macro->numProperties();
-  if (propNum > 0) {
-     for (i = 0; i < propNum; i++) {
-        fprintf(fout, "MACRO %s PROP", macro->name());
-        // value can either be a string or number
-        if (macro->propValue(i)) {
-           fprintf(fout, " %s %s\n", macro->propName(i), macro->propValue(i));
-        }
-        else
-           fprintf(fout, " %s %g\n", macro->propName(i),
-                   chkNum(macro->propNum(i)));
-     }
-  }
-  return 0;
-}
-
-// Manufacturinggrid
-int manufacturingCB(lefrCallbackType_e c, double num, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "MANUFACTURINGGRID %g\n", chkNum(num));
-  return 0;
-}
-
-// Maxviastack
-int maxStackViaCB(lefrCallbackType_e c, lefiMaxStackVia* maxStack,
-  lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "MAXVIASTACK %d", maxStack->maxStackVia());
-  if (maxStack->hasMaxStackViaRange())
-     fprintf(fout, " RANGE %s %s",
-             maxStack->maxStackViaBottomLayer(),
-             maxStack->maxStackViaTopLayer());
-  fprintf(fout, "\n");
-  return 0;
-}
-
-// Minfeature
-int minFeatureCB(lefrCallbackType_e c, lefiMinFeature* min, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "MINFEATURE %g %g\n", chkNum(min->one()), chkNum(min->two()));
-  return 0;
-}
-
-// Universalnoisemargin
-int noiseMarginCB(lefrCallbackType_e c, lefiNoiseMargin* margin,
-                  lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "UNIVERSALNOISEMARGIN %g %g\n", chkNum(margin->high),
-          chkNum(margin->low));
-  return 0;
-}
-
-// NoiseTable
-int noiseTableCB(lefrCallbackType_e c, lefiNoiseTable* table, lefiUserData ud) {
-  int                 i, j, k, l;
-  lefiNoiseEdge       *edge;
-  lefiNoiseResistance *resist;
-  lefiNoiseVictim     *victim;
- 
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "CROSSTALK NOISETABLE %d\n", table->num());
-  if (table->numEdges() > 0) {
-     for (i = 0; i < table->numEdges(); i++) {
-        edge = table->edge(i);
-        // resistances
-        if (edge->numResistances()) {
-           for (j = 0; j < edge->numResistances(); j++) {
-              resist = edge->resistance(j);
-              fprintf(fout, "NOISETABLE %d RESISTANCE %g\n",
-                      table->num(), chkNum(resist->num(j)));
-              // victims
-              for (k = 0; k < resist->numVictims(); k++) {
-                 victim = resist->victim(k);
-                 if (victim->length() > 0)
-                    fprintf(fout, "CROSSTALK NOISETABLE %d RESISTANCE %g VICTIMLENGTH % g\n",
-                            table->num(), chkNum(resist->num(j)),
-                            chkNum(victim->length()));
-                    for (l = 0; l < victim->numNoises(); l++)
-                       fprintf(fout, "CROSSTALK NOISETABLE %d RESISTANCE %g VICTIMLENGT %g NOISEFACTOR %g\n",
-                          table->num(), chkNum(resist->num(j)),
-                          chkNum(victim->length()), chkNum(victim->noise(l)));
-              }
-           }
-        }
-     }
-  }
-  return 0;
-}
-
-// Nondefault
-int nonDefaultCB(lefrCallbackType_e c, lefiNonDefault* def, lefiUserData ud) {
-  int          i;
-  lefiVia*     via;
-  lefiSpacing* spacing;
-  char         defName[1024];
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (def->hasHardspacing())
-     fprintf(fout, "NONDEFAULTRULE HARDSPACING\n");
-  for (i = 0; i < def->numLayers(); i++) {
-     fprintf(fout, "NONDEFAULTRULE %s LAYER %s", def->name(),
-             def->layerName(i));
-     if (def->hasLayerWidth(i))
-        fprintf(fout, " WIDTH %g", chkNum(def->layerWidth(i)));
-     if (def->hasLayerDiagWidth(i))
-        fprintf(fout, " DIAGWIDTH %g", chkNum(def->layerDiagWidth(i)));
-     if (def->hasLayerSpacing(i))
-        fprintf(fout, " SPACING %g", chkNum(def->layerSpacing(i)));
-     if (def->hasLayerWireExtension(i))
-        fprintf(fout, " WIREEXTENSION %g", chkNum(def->layerWireExtension(i)));
-     if (def->hasLayerResistance(i))
-        fprintf(fout, " RESISTANCE RPERSQ %g", chkNum(def->layerResistance(i)));
-     if (def->hasLayerCapacitance(i))
-        fprintf(fout, " CAPACITANCE CPERSQDIST %g",
-                chkNum(def->layerCapacitance(i)));
-     if (def->hasLayerEdgeCap(i))
-        fprintf(fout, " EDGECAPACITANCE %g", chkNum(def->layerEdgeCap(i)));
-     fprintf(fout, "\n");
-  }
-
-  sprintf(defName, "NONDEFAULTRULE %s VIA", def->name());
-  // handle via in nondefaultrule
-  for (i = 0; i < def->numVias(); i++) {
-     via = def->viaRule(i);
-     lefVia(via, defName);
-  }
-
-  sprintf(defName, "NONDEFAULTRULE %s SPACING", def->name());
-  // handle spacing in nondefaultrule
-  for (i = 0; i < def->numSpacingRules(); i++) {
-     spacing = def->spacingRule(i);
-     lefSpacing(spacing, defName);
-  }
-
-  if (def->numUseVia() > 0) {
-     fprintf(fout, "NONDEFAULTRULE %s USEVIA", def->name());
-     // handle spacing in nondefaultrule
-     for (i = 0; i < def->numUseVia(); i++)
-        fprintf(fout, " %s", def->viaName(i));
-     fprintf(fout, "\n");
-  }
-
-  if (def->numUseViaRule() > 0) {
-     fprintf(fout, "NONDEFAULTRULE %s USEVIARULE", def->name());
-     // handle spacing in nondefaultrule
-     for (i = 0; i < def->numUseViaRule(); i++)
-        fprintf(fout, " %s", def->viaRuleName(i));
-     fprintf(fout, "\n");
-  }
-
-  if (def->numMinCuts() > 0) {
-     fprintf(fout, "NONDEFAULTRULE %s MINCUTS", def->name());
-     // handle spacing in nondefaultrule
-     for (i = 0; i < def->numMinCuts(); i++)
-        fprintf(fout, " %s %d", def->cutLayerName(i), def->numCuts(i));
-     fprintf(fout, "\n");
-  }
-
-  return 0;
-}
-
-// Nowireextension
-int noWireExtCB(lefrCallbackType_e c, const char* wireExt, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "NOWIREEXTENSION %s\n", wireExt);
-  return 0;
-}
-
-// Obstruction
-int obstructionCB(lefrCallbackType_e c, lefiObstruction* obs,
-                  lefiUserData ud) {
-  lefiGeometries* geometry;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  geometry = obs->geometries();
-  prtGeometry(geometry, (char*)"OBS");
-  return 0;
-}
-
-// Pin
-int pinCB(lefrCallbackType_e c, lefiPin* pin, lefiUserData ud) {
-  int                  numPorts, i, j;
-  lefiGeometries*      geometry;
-  lefiPinAntennaModel* aModel;
- 
-  checkType(c);
-  if (ud != userData) dataError();
-  if (pin->hasForeign()) {
-     if (pin->hasForeignOrient())
-        fprintf(fout, "PIN %s FOREIGN %s STRUCTURE %g %g %s\n", pin->name(),
-                pin->foreignName(), chkNum(pin->foreignX()),
-                chkNum(pin->foreignY()), lefiOrientStr(pin->foreignOrient()));
-     else if (pin->hasForeignPoint())
-        fprintf(fout, "PIN %s FOREIGN %s STRUCTURE %g %g", pin->name(),
-                pin->foreignName(), chkNum(pin->foreignX()),
-                chkNum(pin->foreignY()));
-     else
-        fprintf(fout, "PIN %s FOREIGN %s\n", pin->name(), pin->foreignName());
-  }
-  if (pin->hasLEQ())
-     fprintf(fout, "PIN %s LEQ %s\n", pin->name(), pin->LEQ());
-  if (pin->hasDirection())
-     fprintf(fout, "PIN %s DIRECTION %s\n", pin->name(), pin->direction());
-  if (pin->hasUse())
-     fprintf(fout, "PIN %s USE %s\n", pin->name(), pin->use());
-  if (pin->hasShape())
-     fprintf(fout, "PIN %s SHAPE %s\n", pin->name(), pin->shape());
-  if (pin->hasMustjoin())
-     fprintf(fout, "PIN %s MUSTJOIN %s\n", pin->name(), pin->mustjoin());
-  if (pin->hasOutMargin())
-     fprintf(fout, "PIN %s OUTPUTNOISEMARGIN %g %g\n", pin->name(),
-             chkNum(pin->outMarginHigh()), chkNum(pin->outMarginLow()));
-  if (pin->hasOutResistance())
-     fprintf(fout, "PIN %s OUTPUTRESISTANCE %g %g\n", pin->name(),
-             chkNum(pin->outResistanceHigh()), chkNum(pin->outResistanceLow()));
-  if (pin->hasInMargin())
-     fprintf(fout, "PIN %s INPUTNOISEMARGIN %g %g\n", pin->name(),
-             chkNum(pin->inMarginHigh()), chkNum(pin->inMarginLow()));
-  if (pin->hasPower())
-     fprintf(fout, "PIN %s POWER %g\n", pin->name(), chkNum(pin->power()));
-  if (pin->hasLeakage())
-     fprintf(fout, "PIN %s LEAKAGE %g\n", pin->name(), chkNum(pin->leakage()));
-  if (pin->hasMaxload())
-     fprintf(fout, "PIN %s MAXLOAD %g\n", pin->name(), chkNum(pin->maxload()));
-  if (pin->hasCapacitance())
-     fprintf(fout, "PIN %s CAPACITANCE %g\n", pin->name(),
-             chkNum(pin->capacitance()));
-  if (pin->hasResistance())
-     fprintf(fout, "PIN %s RESISTANCE %g\n", pin->name(),
-             chkNum(pin->resistance()));
-  if (pin->hasPulldownres())
-     fprintf(fout, "PIN %s PULLDOWNRES %g\n", pin->name(),
-             chkNum(pin->pulldownres()));
-  if (pin->hasTieoffr())
-     fprintf(fout, "PIN %s TIEOFFR %g\n", pin->name(), chkNum(pin->tieoffr()));
-  if (pin->hasVHI())
-     fprintf(fout, "PIN %s VHI %g\n", pin->name(), chkNum(pin->VHI()));
-  if (pin->hasVLO())
-     fprintf(fout, "PIN %s VLO %g\n", pin->name(), chkNum(pin->VLO()));
-  if (pin->hasRiseVoltage())
-     fprintf(fout, "PIN %s RISEVOLTAGETHRESHOLD %g\n", pin->name(),
-             chkNum(pin->riseVoltage()));
-  if (pin->hasFallVoltage())
-     fprintf(fout, "PIN %s FALLVOLTAGETHRESHOLD %g\n", pin->name(),
-             chkNum(pin->fallVoltage()));
-  if (pin->hasRiseThresh())
-     fprintf(fout, "PIN %s RISETHRESH %g\n", pin->name(),
-             chkNum(pin->riseThresh()));
-  if (pin->hasFallThresh())
-     fprintf(fout, "PIN %s FALLTHRESH %g\n", pin->name(),
-             chkNum(pin->fallThresh()));
-  if (pin->hasRiseSatcur())
-     fprintf(fout, "PIN %s RISESATCUR %g\n", pin->name(),
-             chkNum(pin->riseSatcur()));
-  if (pin->hasFallSatcur())
-     fprintf(fout, "PIN %s FALLSATCUR %g\n", pin->name(),
-             chkNum(pin->fallSatcur()));
-  if (pin->hasRiseSlewLimit())
-     fprintf(fout, "PIN %s RISESLEWLIMIT %g\n", pin->name(),
-             chkNum(pin->riseSlewLimit()));
-  if (pin->hasFallSlewLimit())
-     fprintf(fout, "PIN %s FALLSLEWLIMIT %g\n", pin->name(),
-             chkNum(pin->fallSlewLimit()));
-  if (pin->hasCurrentSource())
-     fprintf(fout, "PIN %s CURRENTSOURCE %s\n", pin->name(),
-             pin->currentSource());
-  if (pin->hasTables())
-     fprintf(fout, "PIN %s IV_TABLES %s %s\n", pin->name(),
-             pin->tableHighName(), pin->tableLowName());
-  if (pin->hasTaperRule())
-     fprintf(fout, "PIN %s TAPERRULE %s\n", pin->name(), pin->taperRule());
-  if (pin->hasNetExpr())
-     fprintf(fout, "PIN %s NETEXPR %s\n",pin->name(),  pin->netExpr());
-  if (pin->hasSupplySensitivity())
-     fprintf(fout, "PIN %s SUPPLYSENSITIVITY %s\n", pin->name(),
-             pin->supplySensitivity());
-  if (pin->hasGroundSensitivity())
-     fprintf(fout, "PIN %s GROUNDSENSITIVITY %s\n", pin->name(),
-             pin->groundSensitivity());
-  if (pin->hasAntennaSize()) {
-     for (i = 0; i < pin->numAntennaSize(); i++) {
-        fprintf(fout, "PIN %s ANTSIZE %g", pin->name(),
-           chkNum(pin->antennaSize(i)));
-        if (pin->antennaSizeLayer(i))
-           fprintf(fout, " LAYER %s\n", pin->antennaSizeLayer(i));
-        else
-           fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaMetalArea()) {
-     for (i = 0; i < pin->numAntennaMetalArea(); i++) {
-        fprintf(fout, "PIN %s ANTMETALAREA %g", pin->name(),
-           chkNum(pin->antennaMetalArea(i)));
-        if (pin->antennaMetalAreaLayer(i))
-           fprintf(fout, " LAYER %s\n", pin->antennaMetalAreaLayer(i));
-        else
-           fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaMetalLength()) {
-     for (i = 0; i < pin->numAntennaMetalLength(); i++) {
-        fprintf(fout, "PIN %s ANTMETALLENGTH %g", pin->name(),
-           chkNum(pin->antennaMetalLength(i)));
-        if (pin->antennaMetalLengthLayer(i))
-           fprintf(fout, " LAYER %s\n", pin->antennaMetalLengthLayer(i));
-        else
-           fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaPartialMetalArea()) {
-     for (i = 0; i < pin->numAntennaPartialMetalArea(); i++) {
-        fprintf(fout, "PIN %s ANTPARTIALMETALAREA %g", pin->name(),
-                chkNum(pin->antennaPartialMetalArea(i)));
-        if (pin->antennaPartialMetalAreaLayer(i))
-           fprintf(fout, " LAYER %s",
-                   pin->antennaPartialMetalAreaLayer(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaPartialMetalSideArea()) {
-     for (i = 0; i < pin->numAntennaPartialMetalSideArea(); i++) {
-        fprintf(fout, "PIN %s ANTPARTIALMETALSIDEAREA %g", pin->name(),
-                chkNum(pin->antennaPartialMetalSideArea(i)));
-        if (pin->antennaPartialMetalSideAreaLayer(i))
-           fprintf(fout, " LAYER %s ",
-                   pin->antennaPartialMetalSideAreaLayer(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaPartialCutArea()) {
-     for (i = 0; i < pin->numAntennaPartialCutArea(); i++) {
-        fprintf(fout, "PIN %s ANTPARTIALCUTAREA %g", pin->name(),
-                chkNum(pin->antennaPartialCutArea(i)));
-        if (pin->antennaPartialCutAreaLayer(i))
-           fprintf(fout, " LAYER %s ",
-                   pin->antennaPartialCutAreaLayer(i));
-        fprintf(fout, "\n");
-     }
-  }
-  if (pin->hasAntennaDiffArea()) {
-     for (i = 0; i < pin->numAntennaDiffArea(); i++) {
-        fprintf(fout, "PIN %s ANTDIFFAREA %g", pin->name(),
-                chkNum(pin->antennaDiffArea(i)));
-        if (pin->antennaDiffAreaLayer(i))
-           fprintf(fout, " LAYER %s ", pin->antennaDiffAreaLayer(i));
-        fprintf(fout, "\n");
-     }
-  }
-
-  for (j = 0; j < pin->numAntennaModel(); j++) {
-     aModel = pin->antennaModel(j);
-
-     if (aModel->hasAntennaGateArea()) {
-        for (i = 0; i < aModel->numAntennaGateArea(); i++)
-        {
-           fprintf(fout, "PIN %s %s ANTGATEAREA %g", pin->name(),
-                   aModel->antennaOxide(),
-                   chkNum(aModel->antennaGateArea(i)));
-           if (aModel->antennaGateAreaLayer(i))
-              fprintf(fout, " LAYER %s ",
-                      aModel->antennaGateAreaLayer(i));
-           fprintf(fout, "\n");
-        }
-     }
-     if (aModel->hasAntennaMaxAreaCar()) {
-        for (i = 0; i < aModel->numAntennaMaxAreaCar();
-             i++) {
-           fprintf(fout, "PIN %s %s ANTMAXAREACAR %g", pin->name(),
-                   aModel->antennaOxide(),
-                   chkNum(aModel->antennaMaxAreaCar(i)));
-           if (aModel->antennaMaxAreaCarLayer(i))
-              fprintf(fout, " LAYER %s ",
-                      aModel->antennaMaxAreaCarLayer(i));
-           fprintf(fout, "\n");
-        }
-     }
-     if (aModel->hasAntennaMaxSideAreaCar()) {
-        for (i = 0; i < aModel->numAntennaMaxSideAreaCar();
-             i++) {
-           fprintf(fout, "PIN %s %s ANTMAXAREACAR %g", pin->name(),
-                 aModel->antennaOxide(),
-                 chkNum(aModel->antennaMaxSideAreaCar(i)));
-           if (aModel->antennaMaxSideAreaCarLayer(i))
-              fprintf(fout, " LAYER %s ",
-                    aModel->antennaMaxSideAreaCarLayer(i));
-           fprintf(fout, "\n");
-        }
-     }
-     if (aModel->hasAntennaMaxCutCar()) {
-        for (i = 0; i < aModel->numAntennaMaxCutCar(); i++)
-        {
-           fprintf(fout, "PIN %s %s ANTMAXCUTCAR %g", pin->name(),
-                   aModel->antennaOxide(),
-                   chkNum(aModel->antennaMaxCutCar(i)));
-           if (aModel->antennaMaxCutCarLayer(i))
-              fprintf(fout, " LAYER %s ",
-                      aModel->antennaMaxCutCarLayer(i));
-           fprintf(fout, "\n");
-        }
-     }
-  }
-
-  if (pin->numProperties() > 0) {
-     for (i = 0; i < pin->numProperties(); i++) {
-        fprintf(fout, "PIN %s PROP ", pin->name());
-        // value can either be a string or number
-        if (pin->propValue(i)) {
-           fprintf(fout, "%s %s\n", pin->propName(i), pin->propValue(i));
-        }
-        else
-           fprintf(fout, "%s %g\n", pin->propName(i), chkNum(pin->propNum(i)));
-     }
-  }
-  
-  numPorts = pin->numPorts();
-
-  char pinName[1024];
-
-  for (i = 0; i < numPorts; i++) {
-     sprintf(pinName, "PIN %s PORT", pin->name());
-     geometry = pin->port(i);
-     prtGeometry(geometry, pinName);
-  }
-  return 0;  
-}
-
-int densityCB(lefrCallbackType_e c, lefiDensity* density,
-                  lefiUserData ud) {
-  struct lefiGeomRect rect;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  for (int i = 0; i < density->numLayer(); i++) {
-    for (int j = 0; j < density->numRects(i); j++) {
-      rect = density->getRect(i,j);
-      fprintf(fout, "DENSITY LAYER %s RECT %g %g %g %g %g\n",
-              density->layerName(i), rect.xl, rect.yl, rect.xh, rect.yh,
-              density->densityValue(i,j));
-    }
-  }
-  return 0;
-}
-
-// Property definition
-int propDefCB(lefrCallbackType_e c, lefiProp* prop, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "PROPDEF %s %s",
-          prop->propType(), prop->propName());
-  if (prop->hasRange())
-     fprintf(fout, " RANGE %g %g", chkNum(prop->left()), chkNum(prop->right()));
-  if (prop->hasNumber())
-     fprintf(fout, " NUMBER %g", chkNum(prop->number()));
-  switch (prop->dataType()) {
-      case 'I':
-           fprintf(fout, " TYPE I");
-           break;
-      case 'R':
-           fprintf(fout, " TYPE R");
-           break;
-      case 'S':
-           fprintf(fout, " TYPE S");
-           break;
-      case 'Q':
-           fprintf(fout, " TYPE Q");
-           break;
-      case 'N':
-           fprintf(fout, " TYPE N");
-           break;
-  }
-  fprintf(fout, "\n");
-  return 0;
-}
-
-// Site
-int siteCB(lefrCallbackType_e c, lefiSite* site, lefiUserData ud) {
-  int hasPrtSym = 0;
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "SITE %s", site->name());
-  if (site->hasClass())
-     fprintf(fout, " CLASS %s", site->siteClass());
-  if (site->hasXSymmetry()) {
-     fprintf(fout, " SYMMETRY X ");
-     hasPrtSym = 1;
-  }
-  if (site->hasYSymmetry()) {
-     if (hasPrtSym)
-        fprintf(fout, "Y ");
-     else {
-        fprintf(fout, " SYMMETRY Y ");
-        hasPrtSym = 1;
-     }
-  }
-  if (site->has90Symmetry()) {
-     if (hasPrtSym)
-        fprintf(fout, "R90 ");
-     else {
-        fprintf(fout, " SYMMETRY R90 ");
-        hasPrtSym = 1;
-     }
-  }
-  if (site->hasSize())
-     fprintf(fout, " SIZE %g BY %g", chkNum(site->sizeX()),
-             chkNum(site->sizeY()));
-  fprintf(fout, "\n");
-  if (site->hasRowPattern()) {    // 5.6, a line for ea rowpattern for sorting
-     for (i = 0; i < site->numSites(); i++)
-        fprintf(fout, "SITE %s ROWPATTERN %s %s\n", site->name(),
-                site->siteName(i), site->siteOrientStr(i));
-  }
-
-  return 0;
-}
-
-// Spacing
-int spacingCB(lefrCallbackType_e c, lefiSpacing* spacing, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  lefSpacing(spacing, (char*)"SPACING");
-  return 0;
-}
-
-// Timing
-int timingCB(lefrCallbackType_e c, lefiTiming* timing, lefiUserData ud) {
-  int i;
-  checkType(c);
-  if (ud != userData) dataError();
-  for (i = 0; i < timing->numFromPins(); i++)
-     fprintf(fout, "TIMING FROMPIN %s\n", timing->fromPin(i));
-  for (i = 0; i < timing->numToPins(); i++)
-     fprintf(fout, "TIMING TOPIN %s\n", timing->toPin(i));
-     fprintf(fout, "TIMING RISE SLEW1 %g %g %g %g\n",
-             chkNum(timing->riseSlewOne()), chkNum(timing->riseSlewTwo()),
-             chkNum(timing->riseSlewThree()), chkNum(timing->riseSlewFour()));
-  if (timing->hasRiseSlew2())
-     fprintf(fout, "TIMING RISE SLEW2 %g %g %g\n",
-             chkNum(timing->riseSlewFive()), chkNum(timing->riseSlewSix()),
-             chkNum(timing->riseSlewSeven()));
-  if (timing->hasFallSlew())
-     fprintf(fout, "TIMING FALL SLEW1 %g %g %g %g\n",
-             chkNum(timing->fallSlewOne()), chkNum(timing->fallSlewTwo()),
-             chkNum(timing->fallSlewThree()), chkNum(timing->fallSlewFour()));
-  if (timing->hasFallSlew2())
-     fprintf(fout, "TIMING FALL SLEW2 %g %g %g\n",
-             chkNum(timing->fallSlewFive()), chkNum(timing->fallSlewSix()),
-             chkNum(timing->riseSlewSeven()));
-  if (timing->hasRiseIntrinsic()) {
-     fprintf(fout, "TIMING RISE INTRINSIC %g %g\n",
-             chkNum(timing->riseIntrinsicOne()),
-             chkNum(timing->riseIntrinsicTwo()));
-     fprintf(fout, "TIMING RISE VARIABLE %g %g\n",
-             chkNum(timing->riseIntrinsicThree()),
-             chkNum(timing->riseIntrinsicFour()));
-  }
-  if (timing->hasFallIntrinsic()) {
-     fprintf(fout, "TIMING FALL INTRINSIC %g %g\n",
-             chkNum(timing->fallIntrinsicOne()),
-             chkNum(timing->fallIntrinsicTwo()));
-     fprintf(fout, "TIMING RISE VARIABLE %g %g\n",
-             chkNum(timing->fallIntrinsicThree()),
-             chkNum(timing->fallIntrinsicFour()));
-  }
-  if (timing->hasRiseRS())
-     fprintf(fout, "TIMING RISERS %g %g\n",
-             chkNum(timing->riseRSOne()), chkNum(timing->riseRSTwo()));
-     if (timing->hasRiseCS())
-     fprintf(fout, "TIMING RISECS %g %g\n",
-             chkNum(timing->riseCSOne()), chkNum(timing->riseCSTwo()));
-  if (timing->hasFallRS())
-     fprintf(fout, "TIMING FALLRS %g %g\n",
-             chkNum(timing->fallRSOne()), chkNum(timing->fallRSTwo()));
-  if (timing->hasFallCS())
-     fprintf(fout, "TIMING FALLCS %g %g\n",
-             chkNum(timing->fallCSOne()), chkNum(timing->fallCSTwo()));
-  if (timing->hasUnateness())
-     fprintf(fout, "TIMING UNATENESS %s\n", timing->unateness());
-  if (timing->hasRiseAtt1())
-     fprintf(fout, "TIMING RISESATT1 %g %g\n", chkNum(timing->riseAtt1One()),
-             chkNum(timing->riseAtt1Two()));
-  if (timing->hasFallAtt1())
-     fprintf(fout, "TIMING FALLSATT1 %g %g\n", chkNum(timing->fallAtt1One()),
-             chkNum(timing->fallAtt1Two()));
-  if (timing->hasRiseTo())
-     fprintf(fout, "TIMING RISET0 %g %g\n", chkNum(timing->riseToOne()),
-             chkNum(timing->riseToTwo()));
-  if (timing->hasFallTo())
-     fprintf(fout, "TIMING FALLT0 %g %g\n", chkNum(timing->fallToOne()),
-             chkNum(timing->fallToTwo()));
-  return 0;
-}
-
-// Units
-int unitsCB(lefrCallbackType_e c, lefiUnits* unit, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (unit->hasDatabase())
-     fprintf(fout, "UNITS DATABASE %s %g\n", unit->databaseName(),
-             chkNum(unit->databaseNumber()));
-  if (unit->hasCapacitance())
-     fprintf(fout, "UNITS CAPACITANCE PICOFARADS %g\n",
-             chkNum(unit->capacitance()));
-  if (unit->hasResistance())
-     fprintf(fout, "UNITS RESISTANCE OHMS %g\n", chkNum(unit->resistance()));
-  if (unit->hasPower())
-     fprintf(fout, "UNITS POWER MILLIWATTS %g\n", chkNum(unit->power()));
-  if (unit->hasCurrent())
-     fprintf(fout, "UNITS CURRENT MILLIAMPS %g\n", chkNum(unit->current()));
-  if (unit->hasVoltage())
-     fprintf(fout, "UNITS VOLTAGE VOLTS %g\n", chkNum(unit->voltage()));
-  if (unit->hasFrequency())
-     fprintf(fout, "UNITS FREQUENCY MEGAHERTZ %g\n", chkNum(unit->frequency()));
-  return 0;
-}
-
-// UseMinSpacing
-int useMinSpacingCB(lefrCallbackType_e c, lefiUseMinSpacing* spacing,
-                    lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "USEMINSPACING %s ", spacing->name());
-  if (spacing->value())
-      fprintf(fout, "USEMINSPACING ON\n");
-  else
-      fprintf(fout, "USEMINSPACING OFF\n");
-  return 0;
-}
-
-// Version
-int versionCB(lefrCallbackType_e c, double num, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "VERSION %g\n", num);
-  return 0;
-}
-
-// Via
-int viaCB(lefrCallbackType_e c, lefiVia* via, lefiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  lefVia(via, (char*)"VIA");
-  return 0;
-}
-
-// Viarule
-int viaRuleCB(lefrCallbackType_e c, lefiViaRule* viaRule, lefiUserData ud) {
-  int               numLayers, numVias, i;
-  lefiViaRuleLayer* vLayer;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "VIARULE %s", viaRule->name());
-  if (viaRule->hasGenerate())
-     fprintf(fout, " GENERATE");
-  if (viaRule->hasDefault())
-     fprintf(fout, " DEFAULT");
-  fprintf(fout, "\n");
-
-  numLayers = viaRule->numLayers();
-  // if numLayers == 2, it is VIARULE without GENERATE and has via name
-  // if numLayers == 3, it is VIARULE with GENERATE, and the 3rd layer is cut
-  for (i = 0; i < numLayers; i++) {
-     vLayer = viaRule->layer(i); 
-     lefViaRuleLayer(vLayer, viaRule->name());
-  }
-
-  if (numLayers == 2) {    // should have vianames
-     numVias = viaRule->numVias();
-     if (numVias == 0)
-        fprintf(fout, "Should have via names in VIARULE.\n");
-     else {
-        for (i = 0; i < numVias; i++)
-           fprintf(fout, "VIARULE %s  VIA %s ;\n", viaRule->name(),
-                   viaRule->viaName(i));
-     }
-  }
-  if (viaRule->numProps() > 0) {
-     for (i = 0; i < viaRule->numProps(); i++) {
-        fprintf(fout, "VIARULE %s PROP %s ", viaRule->name(),
-                viaRule->propName(i));
-        if (viaRule->propValue(i))
-           fprintf(fout, "%s ", viaRule->propValue(i));
-        switch (viaRule->propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        fprintf(fout, "\n");
-        }
-     }
-  }
-  return 0;
-}
-
-//========
- 
-int diffLefReadFile(char* inFile, char* outFile) {
-  FILE* f;
-  int   res;
- 
-  userData = (void*)0x01020304;
-  lefrInit();
-
-  // Fix of CCR 758312
-  lefrSetRelaxMode();
-
-  lefrSetAntennaInputCbk(antennaCB);
-  lefrSetAntennaInoutCbk(antennaCB);
-  lefrSetAntennaOutputCbk(antennaCB);
-  lefrSetArrayCbk(arrayCB);
-  lefrSetBusBitCharsCbk(busBitCharsCB);
-  lefrSetCaseSensitiveCbk(caseSensCB);
-  lefrSetFixedMaskCbk(fixedMaskCB);
-  lefrSetClearanceMeasureCbk(clearanceCB);
-  lefrSetCorrectionTableCbk(correctTableCB);
-  lefrSetDensityCbk(densityCB);
-  lefrSetDielectricCbk(dielectricCB);
-  lefrSetDividerCharCbk(dividerCB);
-  lefrSetEdgeRateScaleFactorCbk(edgeRateCB);
-  lefrSetEdgeRateThreshold1Cbk(edgeRate1CB);
-  lefrSetEdgeRateThreshold2Cbk(edgeRate2CB);
-  lefrSetInputAntennaCbk(inputAntCB);
-  lefrSetOutputAntennaCbk(outputAntCB);
-  lefrSetInoutAntennaCbk(inoutAntCB);
-  lefrSetIRDropCbk(irdropCB);
-  lefrSetLayerCbk(layerCB);
-  lefrSetMacroCbk(macroCB);
-  lefrSetManufacturingCbk(manufacturingCB);
-  lefrSetMaxStackViaCbk(maxStackViaCB);
-  lefrSetMinFeatureCbk(minFeatureCB);
-  lefrSetNoiseMarginCbk(noiseMarginCB);
-  lefrSetNoiseTableCbk(noiseTableCB);
-  lefrSetNonDefaultCbk(nonDefaultCB);
-  lefrSetNoWireExtensionCbk(noWireExtCB);
-  lefrSetObstructionCbk(obstructionCB);
-  lefrSetPinCbk(pinCB);
-  lefrSetPropCbk(propDefCB);
-  lefrSetSiteCbk(siteCB);
-  lefrSetSpacingCbk(spacingCB);
-  lefrSetTimingCbk(timingCB);
-  lefrSetUnitsCbk(unitsCB);
-  lefrSetUseMinSpacingCbk(useMinSpacingCB);
-  lefrSetUserData((void*)3);
-  lefrSetVersionCbk(versionCB);
-  lefrSetViaCbk(viaCB);
-  lefrSetViaRuleCbk(viaRuleCB);
-
-  if ((f = fopen(inFile,"r")) == 0) {
-    fprintf(stderr,"Couldn't open input file '%s'\n", inFile);
-    return(2);
-  }
-
-  if ((fout = fopen(outFile,"w")) == 0) {
-    fprintf(stderr,"Couldn't open output file '%s'\n", outFile);
-    fclose(f);
-    return(2);
-  }
-
-  res = lefrRead(f, inFile, userData);
-
-  fclose(f);
-  fclose(fout);
-
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.hpp
deleted file mode 100644
index c6ab0c8..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/diffLefRW.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef DIFFDEFRW_H
-#define DIFFDEFRW_H
-
-#include <stdarg.h>
-#include <stdio.h>
-
-int diffLefReadFile(char* inFile, char* outFile);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/differLef.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/differLef.cpp
deleted file mode 100644
index 35ed2ad..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefdiff/differLef.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2016, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
- 
-// This program will diff two lef files or two def files and list the
-// different between the two files.  This problem is not intend to
-// diff a real design.  If user runs this program will a big design,
-// they may experience long execution time and may even ran out of
-// memory.
-//
-// This program is to give user a feel of whether they are using the
-// parser correctly.  After they read the lef/def file in, and
-// write them back out in lef/def format.
-//
-// This program support lef/def 5.6.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef ibmrs
-#   include <strings.h>
-#endif
-#ifndef WIN32
-#   include <unistd.h>
-extern char VersionIdent[];
-#else
-char* VersionIdent = "N/A";
-#endif /* not WIN32 */
-#include "lefrReader.hpp"
-#include "diffLefRW.hpp"
-
-char * exeName;    // use to save the executable name
-
-// This program requires 2 inputs, fileName1 and fileName2
-void diffUsage() {
-   printf("Usage: lefdefdiff -lef|-def fileName1 fileName2 [-o outputFileName]\n");
-}
-
-int main(int argc, char** argv) {
-  char *fileName1, *fileName2;   // For the filenames to compare
-  char *lefOut1, *lefOut2;       // For the tmp output files
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-  exeName = argv[0];
-  
-  if (argc != 5) {               // If pass in from lefdefdiff, argc is
-      diffUsage();               // always 5
-      return(1);
-  }
-
-  fileName1 = argv[1];
-  fileName2 = argv[2];
-
-  // These are temporary files to hold the lef data as they are read in,
-  // later these files will be sorted for comparison.
-  lefOut1 = argv[3];
-  lefOut2 = argv[4];
-
-  // just read in the 1st file to memory
-  printf("Reading file: %s\n", fileName1);
-  if (diffLefReadFile(fileName1, lefOut1) != 0)
-      return(1);
-  // read and compare with the 1st file in memory
-  printf("Reading file: %s\n", fileName2);
-  if (diffLefReadFile(fileName2, lefOut2) != 0)
-      return(1);
-
-  return (0);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefrw/lefrw.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefrw/lefrw.cpp
deleted file mode 100644
index 1fb4618..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefrw/lefrw.cpp
+++ /dev/null
@@ -1,2656 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2014 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifdef WIN32
-#pragma warning (disable : 4786)
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <iostream>
-#include <stdlib.h>
-
-#ifndef WIN32
-#   include <unistd.h>
-#else
-#   include <windows.h>
-#endif /* not WIN32 */
-#include "lefrReader.hpp"
-#include "lefwWriter.hpp"
-#include "lefiDebug.hpp"
-#include "lefiEncryptInt.hpp"
-#include "lefiUtil.hpp"
-
-char defaultName[128];
-char defaultOut[128];
-FILE* fout;
-int printing = 0;     // Printing the output.
-int parse65nm = 0;
-int parseLef58Type = 0;
-int isSessionles = 0;
-
-// TX_DIR:TRANSLATION ON
- 
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
- 
-
-void checkType(lefrCallbackType_e c) {
-  if (c >= 0 && c <= lefrLibraryEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-
-char* orientStr(int orient) {
-  switch (orient) {
-      case 0: return ((char*)"N");
-      case 1: return ((char*)"W");
-      case 2: return ((char*)"S");
-      case 3: return ((char*)"E");
-      case 4: return ((char*)"FN");
-      case 5: return ((char*)"FW");
-      case 6: return ((char*)"FS");
-      case 7: return ((char*)"FE");
-  };
-  return ((char*)"BOGUS");
-}
-
-void lefVia(lefiVia *via) {
-    int i, j;
-
-    lefrSetCaseSensitivity(1);
-    fprintf(fout, "VIA %s ", via->lefiVia::name());
-    if (via->lefiVia::hasDefault())
-        fprintf(fout, "DEFAULT");
-    else if (via->lefiVia::hasGenerated())
-        fprintf(fout, "GENERATED");
-    fprintf(fout, "\n");
-    if (via->lefiVia::hasTopOfStack())
-        fprintf(fout, "  TOPOFSTACKONLY\n");
-    if (via->lefiVia::hasForeign()) {
-        fprintf(fout, "  FOREIGN %s ", via->lefiVia::foreign());
-        if (via->lefiVia::hasForeignPnt()) {
-            fprintf(fout, "( %g %g ) ", via->lefiVia::foreignX(),
-                    via->lefiVia::foreignY());
-            if (via->lefiVia::hasForeignOrient())
-                fprintf(fout, "%s ", orientStr(via->lefiVia::foreignOrient()));
-        }
-        fprintf(fout, ";\n");
-    }
-    if (via->lefiVia::hasProperties()) {
-        fprintf(fout, "  PROPERTY ");
-        for (i = 0; i < via->lefiVia::numProperties(); i++) {
-            fprintf(fout, "%s ", via->lefiVia::propName(i));
-            if (via->lefiVia::propIsNumber(i))
-                fprintf(fout, "%g ", via->lefiVia::propNumber(i));
-            if (via->lefiVia::propIsString(i))
-                fprintf(fout, "%s ", via->lefiVia::propValue(i));
-            /*
-            if (i+1 == via->lefiVia::numProperties())  // end of properties
-            fprintf(fout, ";\n");
-            else      // just add new line
-            fprintf(fout, "\n");
-            */
-            switch (via->lefiVia::propType(i)) {
-            case 'R':
-                fprintf(fout, "REAL ");
-                break;
-            case 'I':
-                fprintf(fout, "INTEGER ");
-                break;
-            case 'S':
-                fprintf(fout, "STRING ");
-                break;
-            case 'Q':
-                fprintf(fout, "QUOTESTRING ");
-                break;
-            case 'N':
-                fprintf(fout, "NUMBER ");
-                break;
-            }
-        }
-        fprintf(fout, ";\n");
-    }
-    if (via->lefiVia::hasResistance())
-        fprintf(fout, "  RESISTANCE %g ;\n", via->lefiVia::resistance());
-    if (via->lefiVia::numLayers() > 0) {
-        for (i = 0; i < via->lefiVia::numLayers(); i++) {
-            fprintf(fout, "  LAYER %s\n", via->lefiVia::layerName(i));
-            for (j = 0; j < via->lefiVia::numRects(i); j++)
-                if (via->lefiVia::rectColorMask(i, j)) {
-                    fprintf(fout, "    RECT MASK %d ( %f %f ) ( %f %f ) ;\n",
-                            via->lefiVia::rectColorMask(i, j),
-                            via->lefiVia::xl(i, j), via->lefiVia::yl(i, j),
-                            via->lefiVia::xh(i, j), via->lefiVia::yh(i, j));
-                } else {
-                    fprintf(fout, "    RECT ( %f %f ) ( %f %f ) ;\n",
-                            via->lefiVia::xl(i, j), via->lefiVia::yl(i, j),
-                            via->lefiVia::xh(i, j), via->lefiVia::yh(i, j));
-                }
-            for (j = 0; j < via->lefiVia::numPolygons(i); j++) {
-                struct lefiGeomPolygon poly;
-                poly = via->lefiVia::getPolygon(i, j);
-                if (via->lefiVia::polyColorMask(i, j)) {
-                    fprintf(fout, "    POLYGON MASK %d", via->lefiVia::polyColorMask(i, j));
-                } else {
-                    fprintf(fout, "    POLYGON ");
-                }
-                for (int k = 0; k < poly.numPoints; k++)
-                    fprintf(fout, " %g %g ", poly.x[k], poly.y[k]);
-                fprintf(fout, ";\n");
-            }
-        }
-    }
-    if (via->lefiVia::hasViaRule()) {
-        fprintf(fout, "  VIARULE %s ;\n", via->lefiVia::viaRuleName());
-        fprintf(fout, "    CUTSIZE %g %g ;\n", via->lefiVia::xCutSize(),
-                via->lefiVia::yCutSize());
-        fprintf(fout, "    LAYERS %s %s %s ;\n", via->lefiVia::botMetalLayer(),
-                via->lefiVia::cutLayer(), via->lefiVia::topMetalLayer());
-        fprintf(fout, "    CUTSPACING %g %g ;\n", via->lefiVia::xCutSpacing(),
-                via->lefiVia::yCutSpacing());
-        fprintf(fout, "    ENCLOSURE %g %g %g %g ;\n", via->lefiVia::xBotEnc(),
-                via->lefiVia::yBotEnc(), via->lefiVia::xTopEnc(),
-                via->lefiVia::yTopEnc());
-        if (via->lefiVia::hasRowCol())
-            fprintf(fout, "    ROWCOL %d %d ;\n", via->lefiVia::numCutRows(),
-                    via->lefiVia::numCutCols());
-        if (via->lefiVia::hasOrigin())
-            fprintf(fout, "    ORIGIN %g %g ;\n", via->lefiVia::xOffset(),
-                    via->lefiVia::yOffset());
-        if (via->lefiVia::hasOffset())
-            fprintf(fout, "    OFFSET %g %g %g %g ;\n", via->lefiVia::xBotOffset(),
-                    via->lefiVia::yBotOffset(), via->lefiVia::xTopOffset(),
-                    via->lefiVia::yTopOffset());
-        if (via->lefiVia::hasCutPattern())
-            fprintf(fout, "    PATTERN %s ;\n", via->lefiVia::cutPattern());
-    }
-    fprintf(fout, "END %s\n", via->lefiVia::name());
-
-    return;
-}
-
-void lefSpacing(lefiSpacing* spacing) {
-  fprintf(fout, "  SAMENET %s %s %g ", spacing->lefiSpacing::name1(),
-          spacing->lefiSpacing::name2(), spacing->lefiSpacing::distance());
-  if (spacing->lefiSpacing::hasStack())
-     fprintf(fout, "STACK ");
-  fprintf(fout,";\n");
-  return;
-}
-
-void lefViaRuleLayer(lefiViaRuleLayer* vLayer) {
-  fprintf(fout, "  LAYER %s ;\n", vLayer->lefiViaRuleLayer::name());
-  if (vLayer->lefiViaRuleLayer::hasDirection()) {
-     if (vLayer->lefiViaRuleLayer::isHorizontal())
-        fprintf(fout, "    DIRECTION HORIZONTAL ;\n");
-     if (vLayer->lefiViaRuleLayer::isVertical())
-        fprintf(fout, "    DIRECTION VERTICAL ;\n");
-  }
-  if (vLayer->lefiViaRuleLayer::hasEnclosure()) {
-     fprintf(fout, "    ENCLOSURE %g %g ;\n",
-             vLayer->lefiViaRuleLayer::enclosureOverhang1(),
-             vLayer->lefiViaRuleLayer::enclosureOverhang2());
-  }
-  if (vLayer->lefiViaRuleLayer::hasWidth())
-     fprintf(fout, "    WIDTH %g TO %g ;\n",
-             vLayer->lefiViaRuleLayer::widthMin(),
-             vLayer->lefiViaRuleLayer::widthMax());
-  if (vLayer->lefiViaRuleLayer::hasResistance())
-     fprintf(fout, "    RESISTANCE %g ;\n",
-             vLayer->lefiViaRuleLayer::resistance());
-  if (vLayer->lefiViaRuleLayer::hasOverhang())
-     fprintf(fout, "    OVERHANG %g ;\n",
-             vLayer->lefiViaRuleLayer::overhang());
-  if (vLayer->lefiViaRuleLayer::hasMetalOverhang())
-     fprintf(fout, "    METALOVERHANG %g ;\n",
-             vLayer->lefiViaRuleLayer::metalOverhang());
-  if (vLayer->lefiViaRuleLayer::hasSpacing())
-     fprintf(fout, "    SPACING %g BY %g ;\n",
-             vLayer->lefiViaRuleLayer::spacingStepX(),
-             vLayer->lefiViaRuleLayer::spacingStepY());
-  if (vLayer->lefiViaRuleLayer::hasRect())
-     fprintf(fout, "    RECT ( %f %f ) ( %f %f ) ;\n",
-             vLayer->lefiViaRuleLayer::xl(), vLayer->lefiViaRuleLayer::yl(),
-             vLayer->lefiViaRuleLayer::xh(), vLayer->lefiViaRuleLayer::yh());
-  return;
-}
- 
-void prtGeometry(lefiGeometries *geometry) {
-    int                 numItems = geometry->lefiGeometries::numItems();
-    int                 i, j;
-    lefiGeomPath        *path;
-    lefiGeomPathIter    *pathIter;
-    lefiGeomRect        *rect;
-    lefiGeomRectIter    *rectIter;
-    lefiGeomPolygon     *polygon;
-    lefiGeomPolygonIter *polygonIter;
-    lefiGeomVia         *via;
-    lefiGeomViaIter     *viaIter;
-
-    for (i = 0; i < numItems; i++) {
-        switch (geometry->lefiGeometries::itemType(i)) {
-        case  lefiGeomClassE:
-            fprintf(fout, "CLASS %s ",
-                    geometry->lefiGeometries::getClass(i));
-            break;
-        case lefiGeomLayerE:
-            fprintf(fout, "      LAYER %s ;\n",
-                    geometry->lefiGeometries::getLayer(i));
-            break;
-        case lefiGeomLayerExceptPgNetE:
-            fprintf(fout, "      EXCEPTPGNET ;\n");
-            break;
-        case lefiGeomLayerMinSpacingE:
-            fprintf(fout, "      SPACING %g ;\n",
-                    geometry->lefiGeometries::getLayerMinSpacing(i));
-            break;
-        case lefiGeomLayerRuleWidthE:
-            fprintf(fout, "      DESIGNRULEWIDTH %g ;\n",
-                    geometry->lefiGeometries::getLayerRuleWidth(i));
-            break;
-        case lefiGeomWidthE:
-            fprintf(fout, "      WIDTH %g ;\n",
-                    geometry->lefiGeometries::getWidth(i));
-            break;
-        case lefiGeomPathE:
-            path = geometry->lefiGeometries::getPath(i);
-            if (path->colorMask != 0) {
-                fprintf(fout, "      PATH MASK %d ", path->colorMask);
-            } else {
-                fprintf(fout, "      PATH ");
-            }
-            for (j = 0; j < path->numPoints; j++) {
-                if (j + 1 == path->numPoints) // last one on the list
-                    fprintf(fout, "      ( %g %g ) ;\n", path->x[j], path->y[j]);
-                else
-                    fprintf(fout, "      ( %g %g )\n", path->x[j], path->y[j]);
-            }
-            break;
-        case lefiGeomPathIterE:
-            pathIter = geometry->lefiGeometries::getPathIter(i);
-            if (pathIter->colorMask != 0) {
-                fprintf(fout, "      PATH MASK %d ITERATED ", pathIter->colorMask);
-            } else {
-                fprintf(fout, "      PATH ITERATED ");
-            }
-            for (j = 0; j < pathIter->numPoints; j++)
-                fprintf(fout, "      ( %g %g )\n", pathIter->x[j],
-                        pathIter->y[j]);
-            fprintf(fout, "      DO %g BY %g STEP %g %g ;\n", pathIter->xStart,
-                    pathIter->yStart, pathIter->xStep, pathIter->yStep);
-            break;
-        case lefiGeomRectE:
-            rect = geometry->lefiGeometries::getRect(i);
-            if (rect->colorMask != 0) {
-                fprintf(fout, "      RECT MASK %d ( %f %f ) ( %f %f ) ;\n",
-                        rect->colorMask, rect->xl,
-                        rect->yl, rect->xh, rect->yh);
-            } else {
-                fprintf(fout, "      RECT ( %f %f ) ( %f %f ) ;\n", rect->xl,
-                        rect->yl, rect->xh, rect->yh);
-            }
-            break;
-        case lefiGeomRectIterE:
-            rectIter = geometry->lefiGeometries::getRectIter(i);
-            if (rectIter->colorMask != 0) {
-                fprintf(fout, "      RECT MASK %d ITERATE ( %f %f ) ( %f %f )\n",
-                        rectIter->colorMask,
-                        rectIter->xl, rectIter->yl, rectIter->xh, rectIter->yh);
-            } else {
-                fprintf(fout, "      RECT ITERATE ( %f %f ) ( %f %f )\n",
-                        rectIter->xl, rectIter->yl, rectIter->xh, rectIter->yh);
-            }
-            fprintf(fout, "      DO %g BY %g STEP %g %g ;\n",
-                    rectIter->xStart, rectIter->yStart, rectIter->xStep,
-                    rectIter->yStep);
-            break;
-        case lefiGeomPolygonE:
-            polygon = geometry->lefiGeometries::getPolygon(i);
-            if (polygon->colorMask != 0) {
-                fprintf(fout, "      POLYGON MASK %d ", polygon->colorMask);
-            } else {
-                fprintf(fout, "      POLYGON ");
-            }
-            for (j = 0; j < polygon->numPoints; j++) {
-                if (j + 1 == polygon->numPoints) // last one on the list
-                    fprintf(fout, "      ( %g %g ) ;\n", polygon->x[j],
-                            polygon->y[j]);
-                else
-                    fprintf(fout, "      ( %g %g )\n", polygon->x[j],
-                            polygon->y[j]);
-            }
-            break;
-        case lefiGeomPolygonIterE:
-            polygonIter = geometry->lefiGeometries::getPolygonIter(i);
-            if (polygonIter->colorMask != 0) {
-                fprintf(fout, "       POLYGON MASK %d ITERATE ", polygonIter->colorMask);
-            } else {
-                fprintf(fout, "      POLYGON ITERATE");
-            }
-            for (j = 0; j < polygonIter->numPoints; j++)
-                fprintf(fout, "      ( %g %g )\n", polygonIter->x[j],
-                        polygonIter->y[j]);
-            fprintf(fout, "      DO %g BY %g STEP %g %g ;\n",
-                    polygonIter->xStart, polygonIter->yStart,
-                    polygonIter->xStep, polygonIter->yStep);
-            break;
-        case lefiGeomViaE:
-            via = geometry->lefiGeometries::getVia(i);
-            if (via->topMaskNum != 0 || via->bottomMaskNum != 0 || via->cutMaskNum !=0) {
-                fprintf(fout, "      VIA MASK %d%d%d ( %g %g ) %s ;\n",
-                        via->topMaskNum, via->cutMaskNum, via->bottomMaskNum,
-                        via->x, via->y,
-                        via->name);
-
-            } else {
-                fprintf(fout, "      VIA ( %g %g ) %s ;\n", via->x, via->y,
-                        via->name);
-            }
-            break;
-        case lefiGeomViaIterE:
-            viaIter = geometry->lefiGeometries::getViaIter(i);
-            if (viaIter->topMaskNum != 0 || viaIter->cutMaskNum != 0 || viaIter->bottomMaskNum != 0) {
-                fprintf(fout, "      VIA ITERATE MASK %d%d%d ( %g %g ) %s\n",
-                        viaIter->topMaskNum, viaIter->cutMaskNum, viaIter->bottomMaskNum,
-                        viaIter->x,
-                        viaIter->y, viaIter->name);
-            } else {
-                fprintf(fout, "      VIA ITERATE ( %g %g ) %s\n", viaIter->x,
-                        viaIter->y, viaIter->name);
-            }
-            fprintf(fout, "      DO %g BY %g STEP %g %g ;\n",
-                    viaIter->xStart, viaIter->yStart,
-                    viaIter->xStep, viaIter->yStep);
-            break;
-        default:
-            fprintf(fout, "BOGUS geometries type.\n");
-            break;
-        }
-    }
-}
-
-int antennaCB(lefrCallbackType_e c, double value, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  switch (c) {
-        case lefrAntennaInputCbkType:
-             fprintf(fout, "ANTENNAINPUTGATEAREA %g ;\n", value);
-             break;
-        case lefrAntennaInoutCbkType:
-             fprintf(fout, "ANTENNAINOUTDIFFAREA %g ;\n", value);
-             break;
-        case lefrAntennaOutputCbkType:
-             fprintf(fout, "ANTENNAOUTPUTDIFFAREA %g ;\n", value);
-             break;
-        case lefrInputAntennaCbkType:
-             fprintf(fout, "INPUTPINANTENNASIZE %g ;\n", value);
-             break;
-        case lefrOutputAntennaCbkType:
-             fprintf(fout, "OUTPUTPINANTENNASIZE %g ;\n", value);
-             break;
-        case lefrInoutAntennaCbkType:
-             fprintf(fout, "INOUTPINANTENNASIZE %g ;\n", value);
-             break;
-        default:
-             fprintf(fout, "BOGUS antenna type.\n");
-             break;
-  }
-  return 0;
-}
-
-int arrayBeginCB(lefrCallbackType_e c, const char* name, lefiUserData) {
-  int  status;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  // use the lef writer to write the data out
-  status = lefwStartArray(name);
-  if (status != LEFW_OK)
-     return status;
-  return 0;
-}
-
-int arrayCB(lefrCallbackType_e c, lefiArray* a, lefiUserData) {
-  int              status, i, j, defCaps;
-  lefiSitePattern* pattern;
-  lefiTrackPattern* track;
-  lefiGcellPattern* gcell;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-   
-  if (a->lefiArray::numSitePattern() > 0) {
-     for (i = 0; i < a->lefiArray::numSitePattern(); i++) {
-        pattern = a->lefiArray::sitePattern(i);
-        status = lefwArraySite(pattern->lefiSitePattern::name(),
-                               pattern->lefiSitePattern::x(),
-                               pattern->lefiSitePattern::y(),
-                               pattern->lefiSitePattern::orient(),
-                               pattern->lefiSitePattern::xStart(),
-                               pattern->lefiSitePattern::yStart(),
-                               pattern->lefiSitePattern::xStep(),
-                               pattern->lefiSitePattern::yStep());
-        if (status != LEFW_OK)
-           dataError();
-     }
-  }
-  if (a->lefiArray::numCanPlace() > 0) {
-     for (i = 0; i < a->lefiArray::numCanPlace(); i++) {
-        pattern = a->lefiArray::canPlace(i);
-        status = lefwArrayCanplace(pattern->lefiSitePattern::name(),
-                                   pattern->lefiSitePattern::x(),
-                                   pattern->lefiSitePattern::y(),
-                                   pattern->lefiSitePattern::orient(),
-                                   pattern->lefiSitePattern::xStart(),
-                                   pattern->lefiSitePattern::yStart(),
-                                   pattern->lefiSitePattern::xStep(),
-                                   pattern->lefiSitePattern::yStep());
-        if (status != LEFW_OK)
-           dataError();
-     }
-  }
-  if (a->lefiArray::numCannotOccupy() > 0) {
-     for (i = 0; i < a->lefiArray::numCannotOccupy(); i++) {
-        pattern = a->lefiArray::cannotOccupy(i);
-        status = lefwArrayCannotoccupy(pattern->lefiSitePattern::name(),
-                                       pattern->lefiSitePattern::x(),
-                                       pattern->lefiSitePattern::y(),
-                                       pattern->lefiSitePattern::orient(),
-                                       pattern->lefiSitePattern::xStart(),
-                                       pattern->lefiSitePattern::yStart(),
-                                       pattern->lefiSitePattern::xStep(),
-                                       pattern->lefiSitePattern::yStep());
-        if (status != LEFW_OK)
-           dataError();
-     }
-  }
-
-  if (a->lefiArray::numTrack() > 0) {
-     for (i = 0; i < a->lefiArray::numTrack(); i++) {
-        track = a->lefiArray::track(i);
-        fprintf(fout, "  TRACKS %s, %g DO %d STEP %g\n",
-                track->lefiTrackPattern::name(),
-                track->lefiTrackPattern::start(), 
-                track->lefiTrackPattern::numTracks(), 
-                track->lefiTrackPattern::space()); 
-        if (track->lefiTrackPattern::numLayers() > 0) {
-           fprintf(fout, "  LAYER ");
-           for (j = 0; j < track->lefiTrackPattern::numLayers(); j++)
-              fprintf(fout, "%s ", track->lefiTrackPattern::layerName(j));
-           fprintf(fout, ";\n"); 
-        }
-     }
-  }
-
-  if (a->lefiArray::numGcell() > 0) {
-     for (i = 0; i < a->lefiArray::numGcell(); i++) {
-        gcell = a->lefiArray::gcell(i);
-        fprintf(fout, "  GCELLGRID %s, %g DO %d STEP %g\n",
-                gcell->lefiGcellPattern::name(),
-                gcell->lefiGcellPattern::start(), 
-                gcell->lefiGcellPattern::numCRs(), 
-                gcell->lefiGcellPattern::space()); 
-     }
-  }
-
-  if (a->lefiArray::numFloorPlans() > 0) {
-     for (i = 0; i < a->lefiArray::numFloorPlans(); i++) {
-        status = lefwStartArrayFloorplan(a->lefiArray::floorPlanName(i));
-        if (status != LEFW_OK)
-           dataError();
-        for (j = 0; j < a->lefiArray::numSites(i); j++) {
-           pattern = a->lefiArray::site(i, j);
-           status = lefwArrayFloorplan(a->lefiArray::siteType(i, j),
-                                       pattern->lefiSitePattern::name(),
-                                       pattern->lefiSitePattern::x(),
-                                       pattern->lefiSitePattern::y(),
-                                       pattern->lefiSitePattern::orient(),
-                                       (int)pattern->lefiSitePattern::xStart(),
-                                       (int)pattern->lefiSitePattern::yStart(),
-                                       pattern->lefiSitePattern::xStep(),
-                                       pattern->lefiSitePattern::yStep());
-           if (status != LEFW_OK)
-              dataError();
-        }
-     status = lefwEndArrayFloorplan(a->lefiArray::floorPlanName(i));
-     if (status != LEFW_OK)
-        dataError();
-     }
-  }
-
-  defCaps = a->lefiArray::numDefaultCaps();
-  if (defCaps > 0) {
-     status = lefwStartArrayDefaultCap(defCaps);
-     if (status != LEFW_OK)
-        dataError();
-     for (i = 0; i < defCaps; i++) {
-        status = lefwArrayDefaultCap(a->lefiArray::defaultCapMinPins(i),
-                                     a->lefiArray::defaultCap(i));
-        if (status != LEFW_OK)
-           dataError();
-     }
-     status = lefwEndArrayDefaultCap();
-     if (status != LEFW_OK)
-        dataError();
-  }
-  return 0;
-}
-
-int arrayEndCB(lefrCallbackType_e c, const char* name, lefiUserData) {
-  int  status;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  // use the lef writer to write the data out
-  status = lefwEndArray(name);
-  if (status != LEFW_OK)
-     return status;
-  return 0;
-}
-
-int busBitCharsCB(lefrCallbackType_e c, const char* busBit, lefiUserData)
-{
-  int status;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  // use the lef writer to write out the data
-  status = lefwBusBitChars(busBit);
-  if (status != LEFW_OK)
-     dataError();
-  return 0;
-}
-
-int caseSensCB(lefrCallbackType_e c, int caseSense, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  if (caseSense == TRUE)
-     fprintf(fout, "NAMESCASESENSITIVE ON ;\n");
-  else
-     fprintf(fout, "NAMESCASESENSITIVE OFF ;\n");
-  return 0;
-}
-
-int fixedMaskCB(lefrCallbackType_e c, int fixedMask, lefiUserData) {
-    checkType(c);
-
-    if (fixedMask == 1) 
-        fprintf(fout, "FIXEDMASK ;\n");
-    return 0;
-}
-
-int clearanceCB(lefrCallbackType_e c, const char* name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "CLEARANCEMEASURE %s ;\n", name);
-  return 0;
-}
-
-int dividerCB(lefrCallbackType_e c, const char* name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "DIVIDER %s ;\n", name);
-  return 0;
-}
-
-int noWireExtCB(lefrCallbackType_e c, const char* name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "NOWIREEXTENSION %s ;\n", name);
-  return 0;
-}
-
-int noiseMarCB(lefrCallbackType_e c, lefiNoiseMargin *, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  return 0;
-}
-
-int edge1CB(lefrCallbackType_e c, double name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "EDGERATETHRESHOLD1 %g ;\n", name);
-  return 0;
-}
-
-int edge2CB(lefrCallbackType_e c, double name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "EDGERATETHRESHOLD2 %g ;\n", name);
-  return 0;
-}
-
-int edgeScaleCB(lefrCallbackType_e c, double name, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "EDGERATESCALEFACTORE %g ;\n", name);
-  return 0;
-}
-
-int noiseTableCB(lefrCallbackType_e c, lefiNoiseTable *, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  return 0;
-}
-
-int correctionCB(lefrCallbackType_e c, lefiCorrectionTable *, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  return 0;
-}
-
-int dielectricCB(lefrCallbackType_e c, double dielectric, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  fprintf(fout, "DIELECTRIC %g ;\n", dielectric);
-  return 0;
-}
-
-int irdropBeginCB(lefrCallbackType_e c, void*, lefiUserData){
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "IRDROP\n");
-  return 0;
-}
-
-int irdropCB(lefrCallbackType_e c, lefiIRDrop* irdrop, lefiUserData) {
-  int i;
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "  TABLE %s ", irdrop->lefiIRDrop::name());
-  for (i = 0; i < irdrop->lefiIRDrop::numValues(); i++) 
-     fprintf(fout, "%g %g ", irdrop->lefiIRDrop::value1(i),
-             irdrop->lefiIRDrop::value2(i));
-  fprintf(fout, ";\n");
-  return 0;
-}
-
-int irdropEndCB(lefrCallbackType_e c, void*, lefiUserData){
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "END IRDROP\n");
-  return 0;
-}
-
-int layerCB(lefrCallbackType_e c, lefiLayer* layer, lefiUserData) {
-  int i, j, k;
-  int numPoints, propNum;
-  double *widths, *current;
-  lefiLayerDensity* density;
-  lefiAntennaPWL* pwl;
-  lefiSpacingTable* spTable;
-  lefiInfluence* influence;
-  lefiParallel* parallel;
-  lefiTwoWidths* twoWidths;
-  char pType;
-  int numMinCut, numMinenclosed;
-  lefiAntennaModel* aModel;
-  lefiOrthogonal*   ortho;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-
-  lefrSetCaseSensitivity(0);
-
-  // Call parse65nmRules for 5.7 syntax in 5.6
-  if (parse65nm)
-     layer->lefiLayer::parse65nmRules();
-
-  // Call parseLef58Type for 5.8 syntax in 5.7
-  if (parseLef58Type)
-     layer->lefiLayer::parseLEF58Layer();
-
-  fprintf(fout, "LAYER %s\n", layer->lefiLayer::name());
-  if (layer->lefiLayer::hasType())
-     fprintf(fout, "  TYPE %s ;\n", layer->lefiLayer::type());
-  if (layer->lefiLayer::hasLayerType())
-     fprintf(fout, "  LAYER TYPE %s ;\n", layer->lefiLayer::layerType());
-  if (layer->lefiLayer::hasMask())
-     fprintf(fout, "  MASK %d ;\n", layer->lefiLayer::mask());
-  if (layer->lefiLayer::hasPitch())
-     fprintf(fout, "  PITCH %g ;\n", layer->lefiLayer::pitch());
-  else if (layer->lefiLayer::hasXYPitch())
-     fprintf(fout, "  PITCH %g %g ;\n", layer->lefiLayer::pitchX(),
-             layer->lefiLayer::pitchY());
-  if (layer->lefiLayer::hasOffset())
-     fprintf(fout, "  OFFSET %g ;\n", layer->lefiLayer::offset());
-  else if (layer->lefiLayer::hasXYOffset())
-     fprintf(fout, "  OFFSET %g %g ;\n", layer->lefiLayer::offsetX(),
-             layer->lefiLayer::offsetY());
-  if (layer->lefiLayer::hasDiagPitch())
-     fprintf(fout, "  DIAGPITCH %g ;\n", layer->lefiLayer::diagPitch());
-  else if (layer->lefiLayer::hasXYDiagPitch())
-     fprintf(fout, "  DIAGPITCH %g %g ;\n", layer->lefiLayer::diagPitchX(),
-             layer->lefiLayer::diagPitchY());
-  if (layer->lefiLayer::hasDiagWidth())
-     fprintf(fout, "  DIAGWIDTH %g ;\n", layer->lefiLayer::diagWidth());
-  if (layer->lefiLayer::hasDiagSpacing())
-     fprintf(fout, "  DIAGSPACING %g ;\n", layer->lefiLayer::diagSpacing());
-  if (layer->lefiLayer::hasWidth())
-     fprintf(fout, "  WIDTH %g ;\n", layer->lefiLayer::width());
-  if (layer->lefiLayer::hasArea())
-     fprintf(fout, "  AREA %g ;\n", layer->lefiLayer::area());
-  if (layer->lefiLayer::hasSlotWireWidth())
-     fprintf(fout, "  SLOTWIREWIDTH %g ;\n", layer->lefiLayer::slotWireWidth());
-  if (layer->lefiLayer::hasSlotWireLength())
-     fprintf(fout, "  SLOTWIRELENGTH %g ;\n",
-             layer->lefiLayer::slotWireLength());
-  if (layer->lefiLayer::hasSlotWidth())
-     fprintf(fout, "  SLOTWIDTH %g ;\n", layer->lefiLayer::slotWidth());
-  if (layer->lefiLayer::hasSlotLength())
-     fprintf(fout, "  SLOTLENGTH %g ;\n", layer->lefiLayer::slotLength());
-  if (layer->lefiLayer::hasMaxAdjacentSlotSpacing())
-     fprintf(fout, "  MAXADJACENTSLOTSPACING %g ;\n",
-             layer->lefiLayer::maxAdjacentSlotSpacing());
-  if (layer->lefiLayer::hasMaxCoaxialSlotSpacing())
-     fprintf(fout, "  MAXCOAXIALSLOTSPACING %g ;\n",
-             layer->lefiLayer::maxCoaxialSlotSpacing());
-  if (layer->lefiLayer::hasMaxEdgeSlotSpacing())
-     fprintf(fout, "  MAXEDGESLOTSPACING %g ;\n",
-             layer->lefiLayer::maxEdgeSlotSpacing());
-  if (layer->lefiLayer::hasMaxFloatingArea())          // 5.7
-     fprintf(fout, "  MAXFLOATINGAREA %g ;\n",
-             layer->lefiLayer::maxFloatingArea());
-  if (layer->lefiLayer::hasArraySpacing()) {           // 5.7
-     fprintf(fout, "  ARRAYSPACING ");
-     if (layer->lefiLayer::hasLongArray())
-        fprintf(fout, "LONGARRAY ");
-     if (layer->lefiLayer::hasViaWidth())
-        fprintf(fout, "WIDTH %g ", layer->lefiLayer::viaWidth());
-     fprintf(fout, "CUTSPACING %g", layer->lefiLayer::cutSpacing());
-     for (i = 0; i < layer->lefiLayer::numArrayCuts(); i++) 
-        fprintf(fout, "\n\tARRAYCUTS %d SPACING %g",
-                layer->lefiLayer::arrayCuts(i),
-                layer->lefiLayer::arraySpacing(i));
-     fprintf(fout, " ;\n");
-  }
-  if (layer->lefiLayer::hasSplitWireWidth())
-     fprintf(fout, "  SPLITWIREWIDTH %g ;\n",
-             layer->lefiLayer::splitWireWidth());
-  if (layer->lefiLayer::hasMinimumDensity())
-     fprintf(fout, "  MINIMUMDENSITY %g ;\n",
-             layer->lefiLayer::minimumDensity());
-  if (layer->lefiLayer::hasMaximumDensity())
-     fprintf(fout, "  MAXIMUMDENSITY %g ;\n",
-             layer->lefiLayer::maximumDensity());
-  if (layer->lefiLayer::hasDensityCheckWindow())
-     fprintf(fout, "  DENSITYCHECKWINDOW %g %g ;\n",
-             layer->lefiLayer::densityCheckWindowLength(),
-             layer->lefiLayer::densityCheckWindowWidth());
-  if (layer->lefiLayer::hasDensityCheckStep())
-     fprintf(fout, "  DENSITYCHECKSTEP %g ;\n",
-             layer->lefiLayer::densityCheckStep());
-  if (layer->lefiLayer::hasFillActiveSpacing())
-     fprintf(fout, "  FILLACTIVESPACING %g ;\n",
-             layer->lefiLayer::fillActiveSpacing());
-  // 5.4.1
-  numMinCut = layer->lefiLayer::numMinimumcut();
-  if (numMinCut > 0) {
-     for (i = 0; i < numMinCut; i++) {
-         fprintf(fout, "  MINIMUMCUT %d WIDTH %g ",
-              layer->lefiLayer::minimumcut(i),
-              layer->lefiLayer::minimumcutWidth(i));
-         if (layer->lefiLayer::hasMinimumcutWithin(i))
-            fprintf(fout, "WITHIN %g ", layer->lefiLayer::minimumcutWithin(i));
-         if (layer->lefiLayer::hasMinimumcutConnection(i))
-            fprintf(fout, "%s ", layer->lefiLayer::minimumcutConnection(i));
-         if (layer->lefiLayer::hasMinimumcutNumCuts(i))
-            fprintf(fout, "LENGTH %g WITHIN %g ",
-            layer->lefiLayer::minimumcutLength(i),
-            layer->lefiLayer::minimumcutDistance(i));
-         fprintf(fout, ";\n");
-     }
-  }
-  // 5.4.1
-  if (layer->lefiLayer::hasMaxwidth()) {
-     fprintf(fout, "  MAXWIDTH %g ;\n", layer->lefiLayer::maxwidth());
-  }
-  // 5.5
-  if (layer->lefiLayer::hasMinwidth()) {
-     fprintf(fout, "  MINWIDTH %g ;\n", layer->lefiLayer::minwidth());
-  }
-  // 5.5
-  numMinenclosed = layer->lefiLayer::numMinenclosedarea();
-  if (numMinenclosed > 0) {
-     for (i = 0; i < numMinenclosed; i++) {
-         fprintf(fout, "  MINENCLOSEDAREA %g ",
-              layer->lefiLayer::minenclosedarea(i));
-         if (layer->lefiLayer::hasMinenclosedareaWidth(i))
-              fprintf(fout, "MINENCLOSEDAREAWIDTH %g ",
-                      layer->lefiLayer::minenclosedareaWidth(i));
-         fprintf (fout, ";\n"); 
-     }
-  }
-  // 5.4.1 & 5.6
-  if (layer->lefiLayer::hasMinstep()) {
-     for (i = 0; i < layer->lefiLayer::numMinstep(); i++) {
-        fprintf(fout, "  MINSTEP %g ", layer->lefiLayer::minstep(i));
-        if (layer->lefiLayer::hasMinstepType(i))
-           fprintf(fout, "%s ", layer->lefiLayer::minstepType(i));
-        if (layer->lefiLayer::hasMinstepLengthsum(i))
-           fprintf(fout, "LENGTHSUM %g ",
-                   layer->lefiLayer::minstepLengthsum(i));
-        if (layer->lefiLayer::hasMinstepMaxedges(i))
-           fprintf(fout, "MAXEDGES %d ", layer->lefiLayer::minstepMaxedges(i));
-        if (layer->lefiLayer::hasMinstepMinAdjLength(i))
-           fprintf(fout, "MINADJLENGTH %g ", layer->lefiLayer::minstepMinAdjLength(i));
-        if (layer->lefiLayer::hasMinstepMinBetLength(i))
-           fprintf(fout, "MINBETLENGTH %g ", layer->lefiLayer::minstepMinBetLength(i));
-        if (layer->lefiLayer::hasMinstepXSameCorners(i))
-           fprintf(fout, "XSAMECORNERS");
-        fprintf(fout, ";\n");
-     }
-  }
-  // 5.4.1
-  if (layer->lefiLayer::hasProtrusion()) {
-     fprintf(fout, "  PROTRUSIONWIDTH %g LENGTH %g WIDTH %g ;\n",
-             layer->lefiLayer::protrusionWidth1(),
-             layer->lefiLayer::protrusionLength(),
-             layer->lefiLayer::protrusionWidth2());
-  } 
-  if (layer->lefiLayer::hasSpacingNumber()) {
-     for (i = 0; i < layer->lefiLayer::numSpacing(); i++) {
-       fprintf(fout, "  SPACING %g ", layer->lefiLayer::spacing(i));
-       if (layer->lefiLayer::hasSpacingName(i))
-          fprintf(fout, "LAYER %s ", layer->lefiLayer::spacingName(i));
-       if (layer->lefiLayer::hasSpacingLayerStack(i))
-          fprintf(fout, "STACK ");                           // 5.7
-       if (layer->lefiLayer::hasSpacingAdjacent(i))
-          fprintf(fout, "ADJACENTCUTS %d WITHIN %g ",
-                  layer->lefiLayer::spacingAdjacentCuts(i),
-                  layer->lefiLayer::spacingAdjacentWithin(i));
-       if (layer->lefiLayer::hasSpacingAdjacentExcept(i))    // 5.7
-          fprintf(fout, "EXCEPTSAMEPGNET "); 
-       if (layer->lefiLayer::hasSpacingCenterToCenter(i))
-          fprintf(fout, "CENTERTOCENTER ");
-       if (layer->lefiLayer::hasSpacingSamenet(i))           // 5.7
-          fprintf(fout, "SAMENET ");
-           if (layer->lefiLayer::hasSpacingSamenetPGonly(i)) // 5.7
-              fprintf(fout, "PGONLY ");
-       if (layer->lefiLayer::hasSpacingArea(i))              // 5.7
-          fprintf(fout, "AREA %g ", layer->lefiLayer::spacingArea(i));
-       if (layer->lefiLayer::hasSpacingRange(i)) {
-          fprintf(fout, "RANGE %g %g ", layer->lefiLayer::spacingRangeMin(i),
-                  layer->lefiLayer::spacingRangeMax(i));
-          if (layer->lefiLayer::hasSpacingRangeUseLengthThreshold(i))
-             fprintf(fout, "USELENGTHTHRESHOLD "); 
-          else if (layer->lefiLayer::hasSpacingRangeInfluence(i)) {
-              fprintf(fout, "INFLUENCE %g ",
-                 layer->lefiLayer::spacingRangeInfluence(i));
-              if (layer->lefiLayer::hasSpacingRangeInfluenceRange(i))
-                 fprintf(fout, "RANGE %g %g ",
-                    layer->lefiLayer::spacingRangeInfluenceMin(i),
-                    layer->lefiLayer::spacingRangeInfluenceMax(i));
-           } else if (layer->lefiLayer::hasSpacingRangeRange(i))
-               fprintf(fout, "RANGE %g %g ",
-                 layer->lefiLayer::spacingRangeRangeMin(i),
-                 layer->lefiLayer::spacingRangeRangeMax(i));
-       } else if (layer->lefiLayer::hasSpacingLengthThreshold(i)) {
-           fprintf(fout, "LENGTHTHRESHOLD %g ",
-              layer->lefiLayer::spacingLengthThreshold(i));
-           if (layer->lefiLayer::hasSpacingLengthThresholdRange(i))
-              fprintf(fout, "RANGE %g %g",
-                 layer->lefiLayer::spacingLengthThresholdRangeMin(i),
-                 layer->lefiLayer::spacingLengthThresholdRangeMax(i));
-       } else if (layer->lefiLayer::hasSpacingNotchLength(i)) {// 5.7
-           fprintf(fout, "NOTCHLENGTH %g",
-                   layer->lefiLayer::spacingNotchLength(i));
-       } else if (layer->lefiLayer::hasSpacingEndOfNotchWidth(i)) // 5.7
-           fprintf(fout, "ENDOFNOTCHWIDTH %g NOTCHSPACING %g, NOTCHLENGTH %g",
-                   layer->lefiLayer::spacingEndOfNotchWidth(i),
-                   layer->lefiLayer::spacingEndOfNotchSpacing(i),
-                   layer->lefiLayer::spacingEndOfNotchLength(i));
-
-       if (layer->lefiLayer::hasSpacingParallelOverlap(i))   // 5.7
-          fprintf(fout, "PARALLELOVERLAP "); 
-       if (layer->lefiLayer::hasSpacingEndOfLine(i)) {       // 5.7
-          fprintf(fout, "ENDOFLINE %g WITHIN %g ",
-             layer->lefiLayer::spacingEolWidth(i),
-             layer->lefiLayer::spacingEolWithin(i));
-          if (layer->lefiLayer::hasSpacingParellelEdge(i)) {
-             fprintf(fout, "PARALLELEDGE %g WITHIN %g ",
-                layer->lefiLayer::spacingParSpace(i),
-                layer->lefiLayer::spacingParWithin(i));
-             if (layer->lefiLayer::hasSpacingTwoEdges(i)) {
-                fprintf(fout, "TWOEDGES ");
-             }
-          }
-       }
-       fprintf(fout, ";\n");
-     }
-  }
-  if (layer->lefiLayer::hasSpacingTableOrtho()) {            // 5.7
-     fprintf(fout, "SPACINGTABLE ORTHOGONAL"); 
-     ortho = layer->lefiLayer::orthogonal();
-     for (i = 0; i < ortho->lefiOrthogonal::numOrthogonal(); i++) {
-        fprintf(fout, "\n   WITHIN %g SPACING %g",
-                ortho->lefiOrthogonal::cutWithin(i),
-                ortho->lefiOrthogonal::orthoSpacing(i));
-     }
-     fprintf(fout, ";\n");
-  }
-  for (i = 0; i < layer->lefiLayer::numEnclosure(); i++) {
-     fprintf(fout, "ENCLOSURE ");
-     if (layer->lefiLayer::hasEnclosureRule(i))
-        fprintf(fout, "%s ", layer->lefiLayer::enclosureRule(i));
-     fprintf(fout, "%g %g ", layer->lefiLayer::enclosureOverhang1(i),
-                             layer->lefiLayer::enclosureOverhang2(i));
-     if (layer->lefiLayer::hasEnclosureWidth(i))
-        fprintf(fout, "WIDTH %g ", layer->lefiLayer::enclosureMinWidth(i));
-     if (layer->lefiLayer::hasEnclosureExceptExtraCut(i))
-        fprintf(fout, "EXCEPTEXTRACUT %g ",
-                layer->lefiLayer::enclosureExceptExtraCut(i));
-     if (layer->lefiLayer::hasEnclosureMinLength(i))
-        fprintf(fout, "LENGTH %g ", layer->lefiLayer::enclosureMinLength(i));
-     fprintf(fout, ";\n");
-  }
-  for (i = 0; i < layer->lefiLayer::numPreferEnclosure(); i++) {
-     fprintf(fout, "PREFERENCLOSURE ");
-     if (layer->lefiLayer::hasPreferEnclosureRule(i))
-        fprintf(fout, "%s ", layer->lefiLayer::preferEnclosureRule(i));
-     fprintf(fout, "%g %g ", layer->lefiLayer::preferEnclosureOverhang1(i),
-                             layer->lefiLayer::preferEnclosureOverhang2(i));
-     if (layer->lefiLayer::hasPreferEnclosureWidth(i))
-        fprintf(fout, "WIDTH %g ",layer->lefiLayer::preferEnclosureMinWidth(i));
-     fprintf(fout, ";\n");
-  }
-  if (layer->lefiLayer::hasResistancePerCut())
-     fprintf(fout, "  RESISTANCE %g ;\n",
-             layer->lefiLayer::resistancePerCut());
-  if (layer->lefiLayer::hasCurrentDensityPoint())
-     fprintf(fout, "  CURRENTDEN %g ;\n",
-             layer->lefiLayer::currentDensityPoint());
-  if (layer->lefiLayer::hasCurrentDensityArray()) { 
-     layer->lefiLayer::currentDensityArray(&numPoints, &widths, &current);
-     for (i = 0; i < numPoints; i++)
-         fprintf(fout, "  CURRENTDEN ( %g %g ) ;\n", widths[i], current[i]);
-  }
-  if (layer->lefiLayer::hasDirection())
-     fprintf(fout, "  DIRECTION %s ;\n", layer->lefiLayer::direction());
-  if (layer->lefiLayer::hasResistance())
-     fprintf(fout, "  RESISTANCE RPERSQ %g ;\n",
-             layer->lefiLayer::resistance());
-  if (layer->lefiLayer::hasCapacitance())
-     fprintf(fout, "  CAPACITANCE CPERSQDIST %g ;\n",
-             layer->lefiLayer::capacitance());
-  if (layer->lefiLayer::hasEdgeCap())
-     fprintf(fout, "  EDGECAPACITANCE %g ;\n", layer->lefiLayer::edgeCap());
-  if (layer->lefiLayer::hasHeight())
-     fprintf(fout, "  TYPE %g ;\n", layer->lefiLayer::height());
-  if (layer->lefiLayer::hasThickness())
-     fprintf(fout, "  THICKNESS %g ;\n", layer->lefiLayer::thickness());
-  if (layer->lefiLayer::hasWireExtension())
-     fprintf(fout, "  WIREEXTENSION %g ;\n", layer->lefiLayer::wireExtension());
-  if (layer->lefiLayer::hasShrinkage())
-     fprintf(fout, "  SHRINKAGE %g ;\n", layer->lefiLayer::shrinkage());
-  if (layer->lefiLayer::hasCapMultiplier())
-     fprintf(fout, "  CAPMULTIPLIER %g ;\n", layer->lefiLayer::capMultiplier());
-  if (layer->lefiLayer::hasAntennaArea())
-     fprintf(fout, "  ANTENNAAREAFACTOR %g ;\n",
-             layer->lefiLayer::antennaArea());
-  if (layer->lefiLayer::hasAntennaLength())
-     fprintf(fout, "  ANTENNALENGTHFACTOR %g ;\n",
-             layer->lefiLayer::antennaLength());
-
-  // 5.5 AntennaModel
-  for (i = 0; i < layer->lefiLayer::numAntennaModel(); i++) {
-     aModel = layer->lefiLayer::antennaModel(i);
-
-     fprintf(fout, "  ANTENNAMODEL %s ;\n",
-             aModel->lefiAntennaModel::antennaOxide());
-     
-     if (aModel->lefiAntennaModel::hasAntennaAreaRatio())
-        fprintf(fout, "  ANTENNAAREARATIO %g ;\n",
-                aModel->lefiAntennaModel::antennaAreaRatio());
-     if (aModel->lefiAntennaModel::hasAntennaDiffAreaRatio())
-        fprintf(fout, "  ANTENNADIFFAREARATIO %g ;\n",
-                aModel->lefiAntennaModel::antennaDiffAreaRatio());
-     else if (aModel->lefiAntennaModel::hasAntennaDiffAreaRatioPWL()) {
-        pwl = aModel->lefiAntennaModel::antennaDiffAreaRatioPWL();
-        fprintf(fout, "  ANTENNADIFFAREARATIO PWL ( ");
-        for (j = 0; j < pwl->lefiAntennaPWL::numPWL(); j++)
-           fprintf(fout, "( %g %g ) ", pwl->lefiAntennaPWL::PWLdiffusion(j),
-                   pwl->lefiAntennaPWL::PWLratio(j));
-        fprintf(fout, ") ;\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaCumAreaRatio())
-        fprintf(fout, "  ANTENNACUMAREARATIO %g ;\n",
-                aModel->lefiAntennaModel::antennaCumAreaRatio());
-     if (aModel->lefiAntennaModel::hasAntennaCumDiffAreaRatio())
-        fprintf(fout, "  ANTENNACUMDIFFAREARATIO %g\n",
-                aModel->lefiAntennaModel::antennaCumDiffAreaRatio());
-     if (aModel->lefiAntennaModel::hasAntennaCumDiffAreaRatioPWL()) {
-        pwl = aModel->lefiAntennaModel::antennaCumDiffAreaRatioPWL();
-        fprintf(fout, "  ANTENNACUMDIFFAREARATIO PWL ( ");
-        for (j = 0; j < pwl->lefiAntennaPWL::numPWL(); j++)
-           fprintf(fout, "( %g %g ) ", pwl->lefiAntennaPWL::PWLdiffusion(j),
-                   pwl->lefiAntennaPWL::PWLratio(j));
-        fprintf(fout, ") ;\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaAreaFactor()) {
-        fprintf(fout, "  ANTENNAAREAFACTOR %g ",
-                aModel->lefiAntennaModel::antennaAreaFactor());
-        if (aModel->lefiAntennaModel::hasAntennaAreaFactorDUO())
-           fprintf(fout, "  DIFFUSEONLY ");
-        fprintf(fout, ";\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaSideAreaRatio())
-        fprintf(fout, "  ANTENNASIDEAREARATIO %g ;\n",
-                aModel->lefiAntennaModel::antennaSideAreaRatio());
-     if (aModel->lefiAntennaModel::hasAntennaDiffSideAreaRatio())
-        fprintf(fout, "  ANTENNADIFFSIDEAREARATIO %g\n",
-                aModel->lefiAntennaModel::antennaDiffSideAreaRatio());
-     else if (aModel->lefiAntennaModel::hasAntennaDiffSideAreaRatioPWL()) {
-        pwl = aModel->lefiAntennaModel::antennaDiffSideAreaRatioPWL();
-        fprintf(fout, "  ANTENNADIFFSIDEAREARATIO PWL ( ");
-        for (j = 0; j < pwl->lefiAntennaPWL::numPWL(); j++)
-           fprintf(fout, "( %g %g ) ", pwl->lefiAntennaPWL::PWLdiffusion(j),
-                   pwl->lefiAntennaPWL::PWLratio(j));
-        fprintf(fout, ") ;\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaCumSideAreaRatio())
-        fprintf(fout, "  ANTENNACUMSIDEAREARATIO %g ;\n",
-                aModel->lefiAntennaModel::antennaCumSideAreaRatio());
-     if (aModel->lefiAntennaModel::hasAntennaCumDiffSideAreaRatio())
-        fprintf(fout, "  ANTENNACUMDIFFSIDEAREARATIO %g\n",
-                aModel->lefiAntennaModel::antennaCumDiffSideAreaRatio());
-     else if (aModel->lefiAntennaModel::hasAntennaCumDiffSideAreaRatioPWL()) {
-        pwl = aModel->lefiAntennaModel::antennaCumDiffSideAreaRatioPWL();
-        fprintf(fout, "  ANTENNACUMDIFFSIDEAREARATIO PWL ( ");
-        for (j = 0; j < pwl->lefiAntennaPWL::numPWL(); j++)
-           fprintf(fout, "( %g %g ) ", pwl->lefiAntennaPWL::PWLdiffusion(j),
-                   pwl->lefiAntennaPWL::PWLratio(j));
-        fprintf(fout, ") ;\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaSideAreaFactor()) {
-        fprintf(fout, "  ANTENNASIDEAREAFACTOR %g ",
-                aModel->lefiAntennaModel::antennaSideAreaFactor());
-        if (aModel->lefiAntennaModel::hasAntennaSideAreaFactorDUO())
-           fprintf(fout, "  DIFFUSEONLY ");
-        fprintf(fout, ";\n");
-     }
-     if (aModel->lefiAntennaModel::hasAntennaCumRoutingPlusCut())
-        fprintf(fout, "  ANTENNACUMROUTINGPLUSCUT ;\n");
-     if (aModel->lefiAntennaModel::hasAntennaGatePlusDiff())
-        fprintf(fout, "  ANTENNAGATEPLUSDIFF %g ;\n",
-                aModel->lefiAntennaModel::antennaGatePlusDiff());
-     if (aModel->lefiAntennaModel::hasAntennaAreaMinusDiff())
-        fprintf(fout, "  ANTENNAAREAMINUSDIFF %g ;\n",
-                aModel->lefiAntennaModel::antennaAreaMinusDiff());
-     if (aModel->lefiAntennaModel::hasAntennaAreaDiffReducePWL()) {
-        pwl = aModel->lefiAntennaModel::antennaAreaDiffReducePWL();
-        fprintf(fout, "  ANTENNAAREADIFFREDUCEPWL ( ");
-        for (j = 0; j < pwl->lefiAntennaPWL::numPWL(); j++)
-           fprintf(fout, "( %g %g ) ", pwl->lefiAntennaPWL::PWLdiffusion(j),
-                   pwl->lefiAntennaPWL::PWLratio(j));
-        fprintf(fout, ") ;\n");
-     }
-  }
-
-  if (layer->lefiLayer::numAccurrentDensity()) {
-     for (i = 0; i < layer->lefiLayer::numAccurrentDensity(); i++) {
-         density = layer->lefiLayer::accurrent(i);
-         fprintf(fout, "  ACCURRENTDENSITY %s", density->type()); 
-         if (density->hasOneEntry())
-             fprintf(fout, " %g ;\n", density->oneEntry()); 
-         else {
-             fprintf(fout, "\n");
-             if (density->numFrequency()) {
-                fprintf(fout, "    FREQUENCY");
-                for (j = 0; j < density->numFrequency(); j++)
-                   fprintf(fout, " %g", density->frequency(j));
-                fprintf(fout, " ;\n");    
-             }
-             if (density->numCutareas()) {
-                fprintf(fout, "    CUTAREA");
-                for (j = 0; j < density->numCutareas(); j++)
-                   fprintf(fout, " %g", density->cutArea(j));
-                fprintf(fout, " ;\n");    
-             }
-             if (density->numWidths()) {
-                fprintf(fout, "    WIDTH");
-                for (j = 0; j < density->numWidths(); j++)
-                   fprintf(fout, " %g", density->width(j));
-                fprintf(fout, " ;\n");    
-             }
-             if (density->numTableEntries()) {
-                k = 5;
-                fprintf(fout, "    TABLEENTRIES");
-                for (j = 0; j < density->numTableEntries(); j++)
-                   if (k > 4) {
-                      fprintf(fout, "\n     %g", density->tableEntry(j));
-                      k = 1;
-                   } else {
-                      fprintf(fout, " %g", density->tableEntry(j));
-                      k++;
-                   }
-                fprintf(fout, " ;\n");    
-             }
-         }
-     }
-  }
-  if (layer->lefiLayer::numDccurrentDensity()) {
-     for (i = 0; i < layer->lefiLayer::numDccurrentDensity(); i++) {
-         density = layer->lefiLayer::dccurrent(i);
-         fprintf(fout, "  DCCURRENTDENSITY %s", density->type()); 
-         if (density->hasOneEntry())
-             fprintf(fout, " %g ;\n", density->oneEntry()); 
-         else {
-             fprintf(fout, "\n");
-             if (density->numCutareas()) {
-                fprintf(fout, "    CUTAREA");
-                for (j = 0; j < density->numCutareas(); j++)
-                   fprintf(fout, " %g", density->cutArea(j));
-                fprintf(fout, " ;\n");    
-             }
-             if (density->numWidths()) {
-                fprintf(fout, "    WIDTH");
-                for (j = 0; j < density->numWidths(); j++)
-                   fprintf(fout, " %g", density->width(j));
-                fprintf(fout, " ;\n");    
-             }
-             if (density->numTableEntries()) {
-                fprintf(fout, "    TABLEENTRIES");
-                for (j = 0; j < density->numTableEntries(); j++)
-                   fprintf(fout, " %g", density->tableEntry(j));
-                fprintf(fout, " ;\n");    
-             }
-         }
-     }
-  }
-
-  for (i = 0; i < layer->lefiLayer::numSpacingTable(); i++) {
-     spTable = layer->lefiLayer::spacingTable(i);
-     fprintf(fout, "   SPACINGTABLE\n");
-     if (spTable->lefiSpacingTable::isInfluence()) {
-        influence = spTable->lefiSpacingTable::influence();
-        fprintf(fout, "      INFLUENCE");
-        for (j = 0; j < influence->lefiInfluence::numInfluenceEntry(); j++) {
-           fprintf(fout, "\n          WIDTH %g WITHIN %g SPACING %g",
-                   influence->lefiInfluence::width(j),
-                   influence->lefiInfluence::distance(j),
-                   influence->lefiInfluence::spacing(j));
-        }   
-        fprintf(fout, " ;\n");
-     } else if (spTable->lefiSpacingTable::isParallel()){
-        parallel = spTable->lefiSpacingTable::parallel();
-        fprintf(fout, "      PARALLELRUNLENGTH");
-        for (j = 0; j < parallel->lefiParallel::numLength(); j++) {
-           fprintf(fout, " %g", parallel->lefiParallel::length(j));
-        }
-        for (j = 0; j < parallel->lefiParallel::numWidth(); j++) {
-           fprintf(fout, "\n          WIDTH %g",
-                   parallel->lefiParallel::width(j));
-           for (k = 0; k < parallel->lefiParallel::numLength(); k++) {
-              fprintf(fout, " %g", parallel->lefiParallel::widthSpacing(j, k));
-           }
-        }
-        fprintf(fout, " ;\n");
-     } else {    // 5.7 TWOWIDTHS
-        twoWidths = spTable->lefiSpacingTable::twoWidths();
-        fprintf(fout, "      TWOWIDTHS"); 
-        for (j = 0; j < twoWidths->lefiTwoWidths::numWidth(); j++) {
-           fprintf(fout, "\n          WIDTH %g ",
-                   twoWidths->lefiTwoWidths::width(j));
-           if (twoWidths->lefiTwoWidths::hasWidthPRL(j))
-              fprintf(fout, "PRL %g ", twoWidths->lefiTwoWidths::widthPRL(j));
-           for (k = 0; k < twoWidths->lefiTwoWidths::numWidthSpacing(j); k++)
-              fprintf(fout, "%g ",twoWidths->lefiTwoWidths::widthSpacing(j, k));
-        }
-        fprintf(fout, " ;\n");
-     }
-  }
-
-  propNum = layer->lefiLayer::numProps();
-  if (propNum > 0) {
-     fprintf(fout, "  PROPERTY ");
-     for (i = 0; i < propNum; i++) {
-        // value can either be a string or number
-        fprintf(fout, "%s ", layer->lefiLayer::propName(i));
-        if (layer->lefiLayer::propIsNumber(i))
-            fprintf(fout, "%g ", layer->lefiLayer::propNumber(i));
-        if (layer->lefiLayer::propIsString(i)) 
-            fprintf(fout, "%s ", layer->lefiLayer::propValue(i));
-        pType = layer->lefiLayer::propType(i);
-        switch (pType) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        } 
-     }
-     fprintf(fout, ";\n");
-  }
-  if (layer->lefiLayer::hasDiagMinEdgeLength())
-     fprintf(fout, "  DIAGMINEDGELENGTH %g ;\n",
-             layer->lefiLayer::diagMinEdgeLength());
-  if (layer->lefiLayer::numMinSize()) {
-     fprintf(fout, "  MINSIZE ");
-     for (i = 0; i < layer->lefiLayer::numMinSize(); i++) {
-        fprintf(fout, "%g %g ", layer->lefiLayer::minSizeWidth(i),
-                                layer->lefiLayer::minSizeLength(i)); 
-     }
-     fprintf(fout, ";\n");
-  }
-
-  fprintf(fout, "END %s\n", layer->lefiLayer::name()); 
-
-  // Set it to case sensitive from here on
-  lefrSetCaseSensitivity(1);
-
-  return 0;
-}
-
-int macroBeginCB(lefrCallbackType_e c, const char* macroName, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "MACRO %s\n",  macroName);
-  return 0;
-}
-
-int macroFixedMaskCB(lefrCallbackType_e c, int, 
-                     lefiUserData) {
-  checkType(c);
-
-  return 0;
-}
-
-int macroClassTypeCB(lefrCallbackType_e c, const char* macroClassType,
-                     lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "MACRO CLASS %s\n",  macroClassType);
-  return 0;
-}
-
-int macroOriginCB(lefrCallbackType_e c, lefiNum,
-                     lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  // fprintf(fout, "  ORIGIN ( %g %g ) ;\n", macroNum.x, macroNum.y);
-  return 0;
-}
-
-int macroSizeCB(lefrCallbackType_e c, lefiNum,
-                     lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  // fprintf(fout, "  SIZE %g BY %g ;\n", macroNum.x, macroNum.y);
-  return 0;
-}
-
-int macroCB(lefrCallbackType_e c, lefiMacro* macro, lefiUserData) {
-  lefiSitePattern* pattern;
-  int              propNum, i, hasPrtSym = 0;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  if (macro->lefiMacro::hasClass())
-     fprintf(fout, "  CLASS %s ;\n", macro->lefiMacro::macroClass());
-  if (macro->lefiMacro::isFixedMask())
-      fprintf(fout, "  FIXEDMASK ;\n");
-  if (macro->lefiMacro::hasEEQ())
-     fprintf(fout, "  EEQ %s ;\n", macro->lefiMacro::EEQ());
-  if (macro->lefiMacro::hasLEQ())
-     fprintf(fout, "  LEQ %s ;\n", macro->lefiMacro::LEQ());
-  if (macro->lefiMacro::hasSource())
-     fprintf(fout, "  SOURCE %s ;\n", macro->lefiMacro::source());
-  if (macro->lefiMacro::hasXSymmetry()) {
-     fprintf(fout, "  SYMMETRY X ");
-     hasPrtSym = 1;
-  }
-  if (macro->lefiMacro::hasYSymmetry()) {   // print X Y & R90 in one line
-     if (!hasPrtSym) {
-        fprintf(fout, "  SYMMETRY Y ");
-        hasPrtSym = 1;
-     }
-     else
-        fprintf(fout, "Y ");
-  }
-  if (macro->lefiMacro::has90Symmetry()) {
-     if (!hasPrtSym) {
-        fprintf(fout, "  SYMMETRY R90 ");
-        hasPrtSym = 1;
-     }
-     else
-        fprintf(fout, "R90 ");
-  }
-  if (hasPrtSym) {
-     fprintf (fout, ";\n");
-     hasPrtSym = 0;
-  }
-  if (macro->lefiMacro::hasSiteName())
-     fprintf(fout, "  SITE %s ;\n", macro->lefiMacro::siteName());
-  if (macro->lefiMacro::hasSitePattern()) {
-     for (i = 0; i < macro->lefiMacro::numSitePattern(); i++ ) {
-       pattern = macro->lefiMacro::sitePattern(i);
-       if (pattern->lefiSitePattern::hasStepPattern()) {
-          fprintf(fout, "  SITE %s %g %g %s DO %g BY %g STEP %g %g ;\n",
-                pattern->lefiSitePattern::name(), pattern->lefiSitePattern::x(),
-                pattern->lefiSitePattern::y(),
-                orientStr(pattern->lefiSitePattern::orient()),
-                pattern->lefiSitePattern::xStart(),
-                pattern->lefiSitePattern::yStart(),
-                pattern->lefiSitePattern::xStep(),
-                pattern->lefiSitePattern::yStep());
-       } else {
-          fprintf(fout, "  SITE %s %g %g %s ;\n",
-                pattern->lefiSitePattern::name(), pattern->lefiSitePattern::x(),
-                pattern->lefiSitePattern::y(),
-                orientStr(pattern->lefiSitePattern::orient()));
-       }
-     }
-  }
-  if (macro->lefiMacro::hasSize())
-     fprintf(fout, "  SIZE %g BY %g ;\n", macro->lefiMacro::sizeX(),
-             macro->lefiMacro::sizeY());
-
-  if (macro->lefiMacro::hasForeign()) {
-     for (i = 0; i < macro->lefiMacro::numForeigns(); i++) {
-        fprintf(fout, "  FOREIGN %s ", macro->lefiMacro::foreignName(i));
-        if (macro->lefiMacro::hasForeignPoint(i)) {
-           fprintf(fout, "( %g %g ) ", macro->lefiMacro::foreignX(i),
-                   macro->lefiMacro::foreignY(i));
-           if (macro->lefiMacro::hasForeignOrient(i))
-              fprintf(fout, "%s ", macro->lefiMacro::foreignOrientStr(i));
-        }
-        fprintf(fout, ";\n");
-     }
-  }
-  if (macro->lefiMacro::hasOrigin())
-     fprintf(fout, "  ORIGIN ( %g %g ) ;\n", macro->lefiMacro::originX(),
-             macro->lefiMacro::originY());
-  if (macro->lefiMacro::hasPower())
-     fprintf(fout, "  POWER %g ;\n", macro->lefiMacro::power());
-  propNum = macro->lefiMacro::numProperties();
-  if (propNum > 0) {
-     fprintf(fout, "  PROPERTY ");
-     for (i = 0; i < propNum; i++) {
-        // value can either be a string or number
-        if (macro->lefiMacro::propValue(i)) {
-           fprintf(fout, "%s %s ", macro->lefiMacro::propName(i),
-                   macro->lefiMacro::propValue(i));
-        }
-        else
-           fprintf(fout, "%s %g ", macro->lefiMacro::propName(i),
-                   macro->lefiMacro::propNum(i));
-
-        switch (macro->lefiMacro::propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        } 
-     }
-     fprintf(fout, ";\n");
-  }
-  //fprintf(fout, "END %s\n", macro->lefiMacro::name());
-  return 0;
-}
-
-int macroEndCB(lefrCallbackType_e c, const char* macroName, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "END %s\n", macroName);
-  return 0;
-}
-
-int manufacturingCB(lefrCallbackType_e c, double num, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "MANUFACTURINGGRID %g ;\n", num);
-  return 0;
-}
-
-int maxStackViaCB(lefrCallbackType_e c, lefiMaxStackVia* maxStack,
-  lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "MAXVIASTACK %d ", maxStack->lefiMaxStackVia::maxStackVia());
-  if (maxStack->lefiMaxStackVia::hasMaxStackViaRange())
-     fprintf(fout, "RANGE %s %s ",
-             maxStack->lefiMaxStackVia::maxStackViaBottomLayer(),
-             maxStack->lefiMaxStackVia::maxStackViaTopLayer());
-  fprintf(fout, ";\n");
-  return 0;
-}
-
-int minFeatureCB(lefrCallbackType_e c, lefiMinFeature* min, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "MINFEATURE %g %g ;\n", min->lefiMinFeature::one(),
-          min->lefiMinFeature::two());
-  return 0;
-}
-
-int nonDefaultCB(lefrCallbackType_e c, lefiNonDefault* def, lefiUserData) {
-  int          i;
-  lefiVia*     via;
-  lefiSpacing* spacing;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "NONDEFAULTRULE %s\n", def->lefiNonDefault::name());
-  if (def->lefiNonDefault::hasHardspacing())
-     fprintf(fout, "  HARDSPACING ;\n");
-  for (i = 0; i < def->lefiNonDefault::numLayers(); i++) {
-     fprintf(fout, "  LAYER %s\n", def->lefiNonDefault::layerName(i));
-     if (def->lefiNonDefault::hasLayerWidth(i))
-        fprintf(fout, "    WIDTH %g ;\n", def->lefiNonDefault::layerWidth(i));
-     if (def->lefiNonDefault::hasLayerSpacing(i))
-        fprintf(fout, "    SPACING %g ;\n",
-                def->lefiNonDefault::layerSpacing(i));
-     if (def->lefiNonDefault::hasLayerDiagWidth(i))
-        fprintf(fout, "    DIAGWIDTH %g ;\n",
-                def->lefiNonDefault::layerDiagWidth(i));
-     if (def->lefiNonDefault::hasLayerWireExtension(i))
-        fprintf(fout, "    WIREEXTENSION %g ;\n",
-                def->lefiNonDefault::layerWireExtension(i));
-     if (def->lefiNonDefault::hasLayerResistance(i))
-        fprintf(fout, "    RESISTANCE RPERSQ %g ;\n",
-                def->lefiNonDefault::layerResistance(i));
-     if (def->lefiNonDefault::hasLayerCapacitance(i))
-        fprintf(fout, "    CAPACITANCE CPERSQDIST %g ;\n",
-                def->lefiNonDefault::layerCapacitance(i));
-     if (def->lefiNonDefault::hasLayerEdgeCap(i))
-        fprintf(fout, "    EDGECAPACITANCE %g ;\n",
-                def->lefiNonDefault::layerEdgeCap(i));
-     fprintf(fout, "  END %s\n", def->lefiNonDefault::layerName(i));
-  }
-
-  // handle via in nondefaultrule
-  for (i = 0; i < def->lefiNonDefault::numVias(); i++) {
-     via = def->lefiNonDefault::viaRule(i);
-     lefVia(via);
-  }
-
-  // handle spacing in nondefaultrule
-  for (i = 0; i < def->lefiNonDefault::numSpacingRules(); i++) {
-     spacing = def->lefiNonDefault::spacingRule(i);
-     lefSpacing(spacing);
-  }
-
-  // handle usevia
-  for (i = 0; i < def->lefiNonDefault::numUseVia(); i++)
-     fprintf(fout, "    USEVIA %s ;\n", def->lefiNonDefault::viaName(i));
-
-  // handle useviarule
-  for (i = 0; i < def->lefiNonDefault::numUseViaRule(); i++)
-     fprintf(fout, "    USEVIARULE %s ;\n",
-             def->lefiNonDefault::viaRuleName(i));
-
-  // handle mincuts
-  for (i = 0; i < def->lefiNonDefault::numMinCuts(); i++) {
-     fprintf(fout, "   MINCUTS %s %d ;\n", def->lefiNonDefault::cutLayerName(i),
-             def->lefiNonDefault::numCuts(i));
-  }
-
-  // handle property in nondefaultrule
-  if (def->lefiNonDefault::numProps() > 0) {
-     fprintf(fout, "   PROPERTY ");
-     for (i = 0; i < def->lefiNonDefault::numProps(); i++) {
-        fprintf(fout, "%s ", def->lefiNonDefault::propName(i));
-        if (def->lefiNonDefault::propIsNumber(i))
-            fprintf(fout, "%g ", def->lefiNonDefault::propNumber(i));   
-        if (def->lefiNonDefault::propIsString(i))
-            fprintf(fout, "%s ", def->lefiNonDefault::propValue(i));   
-        switch(def->lefiNonDefault::propType(i)) {
-            case 'R': fprintf(fout, "REAL ");
-                      break;
-            case 'I': fprintf(fout, "INTEGER ");
-                      break;
-            case 'S': fprintf(fout, "STRING ");
-                      break;
-            case 'Q': fprintf(fout, "QUOTESTRING ");
-                      break;
-            case 'N': fprintf(fout, "NUMBER ");
-                      break;
-        }
-     }
-     fprintf(fout, ";\n");
-  }
-  fprintf(fout, "END %s ;\n", def->lefiNonDefault::name());
-
-  return 0;
-}
-
-int obstructionCB(lefrCallbackType_e c, lefiObstruction* obs,
-                  lefiUserData) {
-  lefiGeometries* geometry;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "  OBS\n");
-  geometry = obs->lefiObstruction::geometries();
-  prtGeometry(geometry);
-  fprintf(fout, "  END\n");
-  return 0;
-}
-
-int pinCB(lefrCallbackType_e c, lefiPin* pin, lefiUserData) {
-  int                  numPorts, i, j;
-  lefiGeometries*      geometry;
-  lefiPinAntennaModel* aModel;
- 
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "  PIN %s\n", pin->lefiPin::name());
-  if (pin->lefiPin::hasForeign()) {
-     for (i = 0; i < pin->lefiPin::numForeigns(); i++) {
-        if (pin->lefiPin::hasForeignOrient(i))
-           fprintf(fout, "    FOREIGN %s STRUCTURE ( %g %g ) %s ;\n",
-                   pin->lefiPin::foreignName(i), pin->lefiPin::foreignX(i),
-                   pin->lefiPin::foreignY(i),
-                   pin->lefiPin::foreignOrientStr(i));
-        else if (pin->lefiPin::hasForeignPoint(i))
-           fprintf(fout, "    FOREIGN %s STRUCTURE ( %g %g ) ;\n",
-                   pin->lefiPin::foreignName(i), pin->lefiPin::foreignX(i),
-                   pin->lefiPin::foreignY(i));
-        else
-           fprintf(fout, "    FOREIGN %s ;\n", pin->lefiPin::foreignName(i));
-     }
-  }
-  if (pin->lefiPin::hasLEQ())
-     fprintf(fout, "    LEQ %s ;\n", pin->lefiPin::LEQ());
-  if (pin->lefiPin::hasDirection())
-     fprintf(fout, "    DIRECTION %s ;\n", pin->lefiPin::direction());
-  if (pin->lefiPin::hasUse())
-     fprintf(fout, "    USE %s ;\n", pin->lefiPin::use());
-  if (pin->lefiPin::hasShape())
-     fprintf(fout, "    SHAPE %s ;\n", pin->lefiPin::shape());
-  if (pin->lefiPin::hasMustjoin())
-     fprintf(fout, "    MUSTJOIN %s ;\n", pin->lefiPin::mustjoin());
-  if (pin->lefiPin::hasOutMargin())
-     fprintf(fout, "    OUTPUTNOISEMARGIN %g %g ;\n",
-             pin->lefiPin::outMarginHigh(), pin->lefiPin::outMarginLow());
-  if (pin->lefiPin::hasOutResistance())
-     fprintf(fout, "    OUTPUTRESISTANCE %g %g ;\n",
-             pin->lefiPin::outResistanceHigh(),
-             pin->lefiPin::outResistanceLow());
-  if (pin->lefiPin::hasInMargin())
-     fprintf(fout, "    INPUTNOISEMARGIN %g %g ;\n",
-             pin->lefiPin::inMarginHigh(), pin->lefiPin::inMarginLow());
-  if (pin->lefiPin::hasPower())
-     fprintf(fout, "    POWER %g ;\n", pin->lefiPin::power());
-  if (pin->lefiPin::hasLeakage())
-     fprintf(fout, "    LEAKAGE %g ;\n", pin->lefiPin::leakage());
-  if (pin->lefiPin::hasMaxload())
-     fprintf(fout, "    MAXLOAD %g ;\n", pin->lefiPin::maxload());
-  if (pin->lefiPin::hasCapacitance())
-     fprintf(fout, "    CAPACITANCE %g ;\n", pin->lefiPin::capacitance());
-  if (pin->lefiPin::hasResistance())
-     fprintf(fout, "    RESISTANCE %g ;\n", pin->lefiPin::resistance());
-  if (pin->lefiPin::hasPulldownres())
-     fprintf(fout, "    PULLDOWNRES %g ;\n", pin->lefiPin::pulldownres());
-  if (pin->lefiPin::hasTieoffr())
-     fprintf(fout, "    TIEOFFR %g ;\n", pin->lefiPin::tieoffr());
-  if (pin->lefiPin::hasVHI())
-     fprintf(fout, "    VHI %g ;\n", pin->lefiPin::VHI());
-  if (pin->lefiPin::hasVLO())
-     fprintf(fout, "    VLO %g ;\n", pin->lefiPin::VLO());
-  if (pin->lefiPin::hasRiseVoltage())
-     fprintf(fout, "    RISEVOLTAGETHRESHOLD %g ;\n",
-             pin->lefiPin::riseVoltage());
-  if (pin->lefiPin::hasFallVoltage())
-     fprintf(fout, "    FALLVOLTAGETHRESHOLD %g ;\n",
-             pin->lefiPin::fallVoltage());
-  if (pin->lefiPin::hasRiseThresh())
-     fprintf(fout, "    RISETHRESH %g ;\n", pin->lefiPin::riseThresh());
-  if (pin->lefiPin::hasFallThresh())
-     fprintf(fout, "    FALLTHRESH %g ;\n", pin->lefiPin::fallThresh());
-  if (pin->lefiPin::hasRiseSatcur())
-     fprintf(fout, "    RISESATCUR %g ;\n", pin->lefiPin::riseSatcur());
-  if (pin->lefiPin::hasFallSatcur())
-     fprintf(fout, "    FALLSATCUR %g ;\n", pin->lefiPin::fallSatcur());
-  if (pin->lefiPin::hasRiseSlewLimit())
-     fprintf(fout, "    RISESLEWLIMIT %g ;\n", pin->lefiPin::riseSlewLimit());
-  if (pin->lefiPin::hasFallSlewLimit())
-     fprintf(fout, "    FALLSLEWLIMIT %g ;\n", pin->lefiPin::fallSlewLimit());
-  if (pin->lefiPin::hasCurrentSource())
-     fprintf(fout, "    CURRENTSOURCE %s ;\n", pin->lefiPin::currentSource());
-  if (pin->lefiPin::hasTables())
-     fprintf(fout, "    IV_TABLES %s %s ;\n", pin->lefiPin::tableHighName(),
-             pin->lefiPin::tableLowName());
-  if (pin->lefiPin::hasTaperRule())
-     fprintf(fout, "    TAPERRULE %s ;\n", pin->lefiPin::taperRule());
-  if (pin->lefiPin::hasNetExpr())
-     fprintf(fout, "    NETEXPR \"%s\" ;\n", pin->lefiPin::netExpr());
-  if (pin->lefiPin::hasSupplySensitivity())
-     fprintf(fout, "    SUPPLYSENSITIVITY %s ;\n",
-             pin->lefiPin::supplySensitivity());
-  if (pin->lefiPin::hasGroundSensitivity())
-     fprintf(fout, "    GROUNDSENSITIVITY %s ;\n",
-             pin->lefiPin::groundSensitivity());
-  if (pin->lefiPin::hasAntennaSize()) {
-     for (i = 0; i < pin->lefiPin::numAntennaSize(); i++) {
-        fprintf(fout, "    ANTENNASIZE %g ", pin->lefiPin::antennaSize(i));
-        if (pin->lefiPin::antennaSizeLayer(i))
-           fprintf(fout, "LAYER %s ", pin->lefiPin::antennaSizeLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-  if (pin->lefiPin::hasAntennaMetalArea()) {
-     for (i = 0; i < pin->lefiPin::numAntennaMetalArea(); i++) {
-        fprintf(fout, "    ANTENNAMETALAREA %g ",
-           pin->lefiPin::antennaMetalArea(i));
-        if (pin->lefiPin::antennaMetalAreaLayer(i))
-           fprintf(fout, "LAYER %s ", pin->lefiPin::antennaMetalAreaLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-  if (pin->lefiPin::hasAntennaMetalLength()) {
-     for (i = 0; i < pin->lefiPin::numAntennaMetalLength(); i++) {
-        fprintf(fout, "    ANTENNAMETALLENGTH %g ",
-           pin->lefiPin::antennaMetalLength(i));
-        if (pin->lefiPin::antennaMetalLengthLayer(i))
-           fprintf(fout, "LAYER %s ", pin->lefiPin::antennaMetalLengthLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-
-  if (pin->lefiPin::hasAntennaPartialMetalArea()) {
-     for (i = 0; i < pin->lefiPin::numAntennaPartialMetalArea(); i++) {
-        fprintf(fout, "    ANTENNAPARTIALMETALAREA %g ",
-                pin->lefiPin::antennaPartialMetalArea(i));
-        if (pin->lefiPin::antennaPartialMetalAreaLayer(i))
-           fprintf(fout, "LAYER %s ",
-                   pin->lefiPin::antennaPartialMetalAreaLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-
-  if (pin->lefiPin::hasAntennaPartialMetalSideArea()) {
-     for (i = 0; i < pin->lefiPin::numAntennaPartialMetalSideArea(); i++) {
-        fprintf(fout, "    ANTENNAPARTIALMETALSIDEAREA %g ",
-                pin->lefiPin::antennaPartialMetalSideArea(i));
-        if (pin->lefiPin::antennaPartialMetalSideAreaLayer(i))
-           fprintf(fout, "LAYER %s ",
-                   pin->lefiPin::antennaPartialMetalSideAreaLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-
-  if (pin->lefiPin::hasAntennaPartialCutArea()) {
-     for (i = 0; i < pin->lefiPin::numAntennaPartialCutArea(); i++) {
-        fprintf(fout, "    ANTENNAPARTIALCUTAREA %g ",
-                pin->lefiPin::antennaPartialCutArea(i));
-        if (pin->lefiPin::antennaPartialCutAreaLayer(i))
-           fprintf(fout, "LAYER %s ",
-                   pin->lefiPin::antennaPartialCutAreaLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-
-  if (pin->lefiPin::hasAntennaDiffArea()) {
-     for (i = 0; i < pin->lefiPin::numAntennaDiffArea(); i++) {
-        fprintf(fout, "    ANTENNADIFFAREA %g ",
-                pin->lefiPin::antennaDiffArea(i));
-        if (pin->lefiPin::antennaDiffAreaLayer(i))
-           fprintf(fout, "LAYER %s ", pin->lefiPin::antennaDiffAreaLayer(i));
-        fprintf(fout, ";\n");
-     }
-  }
-
-  for (j = 0; j < pin->lefiPin::numAntennaModel(); j++) {
-     aModel = pin->lefiPin::antennaModel(j); 
-    
-     fprintf(fout, "    ANTENNAMODEL %s ;\n",
-             aModel->lefiPinAntennaModel::antennaOxide());
-
-     if (aModel->lefiPinAntennaModel::hasAntennaGateArea()) {
-        for (i = 0; i < aModel->lefiPinAntennaModel::numAntennaGateArea(); i++)
-        {
-           fprintf(fout, "    ANTENNAGATEAREA %g ",
-                   aModel->lefiPinAntennaModel::antennaGateArea(i));
-           if (aModel->lefiPinAntennaModel::antennaGateAreaLayer(i))
-              fprintf(fout, "LAYER %s ",
-                      aModel->lefiPinAntennaModel::antennaGateAreaLayer(i));
-           fprintf(fout, ";\n");
-        }
-     }
-
-     if (aModel->lefiPinAntennaModel::hasAntennaMaxAreaCar()) {
-        for (i = 0; i < aModel->lefiPinAntennaModel::numAntennaMaxAreaCar();
-           i++) {
-           fprintf(fout, "    ANTENNAMAXAREACAR %g ",
-                   aModel->lefiPinAntennaModel::antennaMaxAreaCar(i));
-           if (aModel->lefiPinAntennaModel::antennaMaxAreaCarLayer(i))
-              fprintf(fout, "LAYER %s ",
-                   aModel->lefiPinAntennaModel::antennaMaxAreaCarLayer(i));
-           fprintf(fout, ";\n");
-        }
-     }
-
-     if (aModel->lefiPinAntennaModel::hasAntennaMaxSideAreaCar()) {
-        for (i = 0; i < aModel->lefiPinAntennaModel::numAntennaMaxSideAreaCar();
-           i++) {
-           fprintf(fout, "    ANTENNAMAXSIDEAREACAR %g ",
-                   aModel->lefiPinAntennaModel::antennaMaxSideAreaCar(i));
-           if (aModel->lefiPinAntennaModel::antennaMaxSideAreaCarLayer(i))
-              fprintf(fout, "LAYER %s ",
-                   aModel->lefiPinAntennaModel::antennaMaxSideAreaCarLayer(i));
-           fprintf(fout, ";\n");
-        }
-     }
-
-     if (aModel->lefiPinAntennaModel::hasAntennaMaxCutCar()) {
-        for (i = 0; i < aModel->lefiPinAntennaModel::numAntennaMaxCutCar(); i++)
-        {
-           fprintf(fout, "    ANTENNAMAXCUTCAR %g ",
-                   aModel->lefiPinAntennaModel::antennaMaxCutCar(i));
-           if (aModel->lefiPinAntennaModel::antennaMaxCutCarLayer(i))
-              fprintf(fout, "LAYER %s ",
-                   aModel->lefiPinAntennaModel::antennaMaxCutCarLayer(i));
-           fprintf(fout, ";\n");
-        }
-     }
-  }
-
-  if (pin->lefiPin::numProperties() > 0) {
-     fprintf(fout, "    PROPERTY ");
-     for (i = 0; i < pin->lefiPin::numProperties(); i++) {
-        // value can either be a string or number
-        if (pin->lefiPin::propValue(i)) {
-           fprintf(fout, "%s %s ", pin->lefiPin::propName(i),
-                   pin->lefiPin::propValue(i));
-        }
-        else
-           fprintf(fout, "%s %g ", pin->lefiPin::propName(i),
-                   pin->lefiPin::propNum(i));
-        switch (pin->lefiPin::propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        } 
-     }
-     fprintf(fout, ";\n");
-  }
-  
-  numPorts = pin->lefiPin::numPorts();
-  for (i = 0; i < numPorts; i++) {
-     fprintf(fout,"    PORT\n");
-     geometry = pin->lefiPin::port(i);
-     prtGeometry(geometry);
-     fprintf(fout, "    END\n");
-  }
-  fprintf(fout, "  END %s\n", pin->lefiPin::name());
-  return 0;  
-}
-
-int densityCB(lefrCallbackType_e c, lefiDensity* density,
-                  lefiUserData) {
-
-  struct lefiGeomRect rect;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "  DENSITY\n");
-  for (int i = 0; i < density->lefiDensity::numLayer(); i++) {
-    fprintf(fout, "    LAYER %s ;\n", density->lefiDensity::layerName(i));
-    for (int j = 0; j < density->lefiDensity::numRects(i); j++) {
-      rect = density->lefiDensity::getRect(i,j);
-      fprintf(fout, "      RECT %g %g %g %g ", rect.xl, rect.yl, rect.xh,
-              rect.yh);
-      fprintf(fout, "%g ;\n", density->lefiDensity::densityValue(i,j));
-    }
-  }
-  fprintf(fout, "  END\n");
-  return 0;
-}
-
-int propDefBeginCB(lefrCallbackType_e c, void*, lefiUserData) {
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "PROPERTYDEFINITIONS\n");
-  return 0;
-}
-
-int propDefCB(lefrCallbackType_e c, lefiProp* prop, lefiUserData) {
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, " %s %s", prop->lefiProp::propType(),
-          prop->lefiProp::propName());
-  switch(prop->lefiProp::dataType()) {
-     case 'I':
-          fprintf(fout, " INTEGER"); 
-          break;
-     case 'R':
-          fprintf(fout, " REAL"); 
-          break;
-     case 'S':
-          fprintf(fout, " STRING"); 
-          break;
-  }
-  if (prop->lefiProp::hasNumber())
-     fprintf(fout, " %g", prop->lefiProp::number());
-  if (prop->lefiProp::hasRange())
-     fprintf(fout, " RANGE %g %g", prop->lefiProp::left(),
-             prop->lefiProp::right());
-  if (prop->lefiProp::hasString())
-     fprintf(fout, " %s", prop->lefiProp::string());
-  fprintf(fout, "\n");
-  return 0;
-}
-
-int propDefEndCB(lefrCallbackType_e c, void*, lefiUserData) {
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "END PROPERTYDEFINITIONS\n");
-  return 0;
-}
-
-int siteCB(lefrCallbackType_e c, lefiSite* site, lefiUserData) {
-  int hasPrtSym = 0;
-  int i;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "SITE %s\n", site->lefiSite::name());
-  if (site->lefiSite::hasClass())
-     fprintf(fout, "  CLASS %s ;\n", site->lefiSite::siteClass());
-  if (site->lefiSite::hasXSymmetry()) {
-     fprintf(fout, "  SYMMETRY X ");
-     hasPrtSym = 1;
-  }
-  if (site->lefiSite::hasYSymmetry()) {
-     if (hasPrtSym)
-        fprintf(fout, "Y ");
-     else {
-        fprintf(fout, "  SYMMETRY Y ");
-        hasPrtSym = 1;
-     }
-  }
-  if (site->lefiSite::has90Symmetry()) {
-     if (hasPrtSym)
-        fprintf(fout, "R90 ");
-     else {
-        fprintf(fout, "  SYMMETRY R90 ");
-        hasPrtSym = 1;
-     }
-  }
-  if (hasPrtSym)
-     fprintf(fout, ";\n");
-  if (site->lefiSite::hasSize())
-     fprintf(fout, "  SIZE %g BY %g ;\n", site->lefiSite::sizeX(),
-             site->lefiSite::sizeY());
-
-  if (site->hasRowPattern()) {
-     fprintf(fout, "  ROWPATTERN ");
-     for (i = 0; i < site->lefiSite::numSites(); i++)
-        fprintf(fout, "  %s %s ", site->lefiSite::siteName(i),
-                site->lefiSite::siteOrientStr(i));
-     fprintf(fout, ";\n");
-  }
-
-  fprintf(fout, "END %s\n", site->lefiSite::name());
-  return 0;
-}
-
-int spacingBeginCB(lefrCallbackType_e c, void*, lefiUserData){
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "SPACING\n");
-  return 0;
-}
-
-int spacingCB(lefrCallbackType_e c, lefiSpacing* spacing, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  lefSpacing(spacing);
-  return 0;
-}
-
-int spacingEndCB(lefrCallbackType_e c, void*, lefiUserData){
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "END SPACING\n");
-  return 0;
-}
-
-int timingCB(lefrCallbackType_e c, lefiTiming* timing, lefiUserData) {
-  int i;
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "TIMING\n");
-  for (i = 0; i < timing->numFromPins(); i++)
-     fprintf(fout, " FROMPIN %s ;\n", timing->fromPin(i));
-  for (i = 0; i < timing->numToPins(); i++)
-     fprintf(fout, " TOPIN %s ;\n", timing->toPin(i));
-     fprintf(fout, " RISE SLEW1 %g %g %g %g ;\n", timing->riseSlewOne(),
-             timing->riseSlewTwo(), timing->riseSlewThree(),
-             timing->riseSlewFour());
-  if (timing->hasRiseSlew2())
-     fprintf(fout, " RISE SLEW2 %g %g %g ;\n", timing->riseSlewFive(),
-             timing->riseSlewSix(), timing->riseSlewSeven());
-  if (timing->hasFallSlew())
-     fprintf(fout, " FALL SLEW1 %g %g %g %g ;\n", timing->fallSlewOne(),
-             timing->fallSlewTwo(), timing->fallSlewThree(),
-             timing->fallSlewFour());
-  if (timing->hasFallSlew2())
-     fprintf(fout, " FALL SLEW2 %g %g %g ;\n", timing->fallSlewFive(),
-             timing->fallSlewSix(), timing->riseSlewSeven());
-  if (timing->hasRiseIntrinsic()) {
-     fprintf(fout, "TIMING RISE INTRINSIC %g %g ;\n",
-             timing->riseIntrinsicOne(), timing->riseIntrinsicTwo());
-     fprintf(fout, "TIMING RISE VARIABLE %g %g ;\n",
-             timing->riseIntrinsicThree(), timing->riseIntrinsicFour());
-  }
-  if (timing->hasFallIntrinsic()) {
-     fprintf(fout, "TIMING FALL INTRINSIC %g %g ;\n",
-             timing->fallIntrinsicOne(), timing->fallIntrinsicTwo());
-     fprintf(fout, "TIMING RISE VARIABLE %g %g ;\n",
-             timing->fallIntrinsicThree(), timing->fallIntrinsicFour());
-  }
-  if (timing->hasRiseRS())
-     fprintf(fout, "TIMING RISERS %g %g ;\n",
-             timing->riseRSOne(), timing->riseRSTwo());
-     if (timing->hasRiseCS())
-     fprintf(fout, "TIMING RISECS %g %g ;\n",
-             timing->riseCSOne(), timing->riseCSTwo());
-  if (timing->hasFallRS())
-     fprintf(fout, "TIMING FALLRS %g %g ;\n",
-             timing->fallRSOne(), timing->fallRSTwo());
-  if (timing->hasFallCS())
-     fprintf(fout, "TIMING FALLCS %g %g ;\n",
-             timing->fallCSOne(), timing->fallCSTwo());
-  if (timing->hasUnateness())
-     fprintf(fout, "TIMING UNATENESS %s ;\n", timing->unateness());
-  if (timing->hasRiseAtt1())
-     fprintf(fout, "TIMING RISESATT1 %g %g ;\n", timing->riseAtt1One(),
-             timing->riseAtt1Two());
-  if (timing->hasFallAtt1())
-     fprintf(fout, "TIMING FALLSATT1 %g %g ;\n", timing->fallAtt1One(),
-             timing->fallAtt1Two());
-  if (timing->hasRiseTo())
-     fprintf(fout, "TIMING RISET0 %g %g ;\n", timing->riseToOne(),
-             timing->riseToTwo());
-  if (timing->hasFallTo())
-     fprintf(fout, "TIMING FALLT0 %g %g ;\n", timing->fallToOne(),
-             timing->fallToTwo());
-  if (timing->hasSDFonePinTrigger())
-     fprintf(fout, " %s TABLEDIMENSION %g %g %g ;\n",
-             timing->SDFonePinTriggerType(), timing->SDFtriggerOne(),
-             timing->SDFtriggerTwo(), timing->SDFtriggerThree());
-  if (timing->hasSDFtwoPinTrigger())
-     fprintf(fout, " %s %s %s TABLEDIMENSION %g %g %g ;\n",
-             timing->SDFtwoPinTriggerType(), timing->SDFfromTrigger(),
-             timing->SDFtoTrigger(), timing->SDFtriggerOne(),
-             timing->SDFtriggerTwo(), timing->SDFtriggerThree());
-  fprintf(fout, "END TIMING\n");
-  return 0;
-}
-
-int unitsCB(lefrCallbackType_e c, lefiUnits* unit, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "UNITS\n");
-  if (unit->lefiUnits::hasDatabase())
-     fprintf(fout, "  DATABASE %s %g ;\n", unit->lefiUnits::databaseName(),
-             unit->lefiUnits::databaseNumber());
-  if (unit->lefiUnits::hasCapacitance())
-     fprintf(fout, "  CAPACITANCE PICOFARADS %g ;\n",
-             unit->lefiUnits::capacitance());
-  if (unit->lefiUnits::hasResistance())
-     fprintf(fout, "  RESISTANCE OHMS %g ;\n", unit->lefiUnits::resistance());
-  if (unit->lefiUnits::hasPower())
-     fprintf(fout, "  POWER MILLIWATTS %g ;\n", unit->lefiUnits::power());
-  if (unit->lefiUnits::hasCurrent())
-     fprintf(fout, "  CURRENT MILLIAMPS %g ;\n", unit->lefiUnits::current());
-  if (unit->lefiUnits::hasVoltage())
-     fprintf(fout, "  VOLTAGE VOLTS %g ;\n", unit->lefiUnits::voltage());
-  if (unit->lefiUnits::hasFrequency())
-     fprintf(fout, "  FREQUENCY MEGAHERTZ %g ;\n",
-             unit->lefiUnits::frequency());
-  fprintf(fout, "END UNITS\n");
-  return 0;
-}
-
-int useMinSpacingCB(lefrCallbackType_e c, lefiUseMinSpacing* spacing,
-                    lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "USEMINSPACING %s ", spacing->lefiUseMinSpacing::name());
-  if (spacing->lefiUseMinSpacing::value())
-      fprintf(fout, "ON ;\n");
-  else
-      fprintf(fout, "OFF ;\n");
-  return 0;
-}
-
-int versionCB(lefrCallbackType_e c, double num, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "VERSION %g ;\n", num);
-  return 0;
-}
-
-int versionStrCB(lefrCallbackType_e c, const char* versionName, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "VERSION %s ;\n", versionName);
-  return 0;
-}
-
-int viaCB(lefrCallbackType_e c, lefiVia* via, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  lefVia(via);
-  return 0;
-}
-
-int viaRuleCB(lefrCallbackType_e c, lefiViaRule* viaRule, lefiUserData) {
-  int               numLayers, numVias, i;
-  lefiViaRuleLayer* vLayer;
-
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "VIARULE %s", viaRule->lefiViaRule::name());
-  if (viaRule->lefiViaRule::hasGenerate())
-     fprintf(fout, " GENERATE");
-  if (viaRule->lefiViaRule::hasDefault())
-     fprintf(fout, " DEFAULT");
-  fprintf(fout, "\n");
-
-  numLayers = viaRule->lefiViaRule::numLayers();
-  // if numLayers == 2, it is VIARULE without GENERATE and has via name
-  // if numLayers == 3, it is VIARULE with GENERATE, and the 3rd layer is cut
-  for (i = 0; i < numLayers; i++) {
-     vLayer = viaRule->lefiViaRule::layer(i); 
-     lefViaRuleLayer(vLayer);
-  }
-
-  if (numLayers == 2 && !(viaRule->lefiViaRule::hasGenerate())) {
-     // should have vianames
-     numVias = viaRule->lefiViaRule::numVias();
-     if (numVias == 0)
-        fprintf(fout, "Should have via names in VIARULE.\n");
-     else {
-        for (i = 0; i < numVias; i++)
-           fprintf(fout, "  VIA %s ;\n", viaRule->lefiViaRule::viaName(i));
-     }
-  }
-  if (viaRule->lefiViaRule::numProps() > 0) {
-     fprintf(fout, "  PROPERTY ");
-     for (i = 0; i < viaRule->lefiViaRule::numProps(); i++) {
-        fprintf(fout, "%s ", viaRule->lefiViaRule::propName(i));
-        if (viaRule->lefiViaRule::propValue(i))
-           fprintf(fout, "%s ", viaRule->lefiViaRule::propValue(i));
-        switch (viaRule->lefiViaRule::propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        } 
-     }
-     fprintf(fout, ";\n");
-  }
-  fprintf(fout, "END %s\n", viaRule->lefiViaRule::name());
-  return 0;
-}
-
-int extensionCB(lefrCallbackType_e c, const char* extsn, lefiUserData) {
-  checkType(c);
-  // lefrSetCaseSensitivity(0);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "BEGINEXT %s ;\n", extsn);
-  // lefrSetCaseSensitivity(1);
-  return 0;
-}
-
-int doneCB(lefrCallbackType_e c, void*, lefiUserData) {
-  checkType(c);
-  // if ((long)ud != userData) dataError();
-  fprintf(fout, "END LIBRARY\n");
-  return 0;
-}
- 
-void errorCB(const char* msg) {
-  printf ("%s : %s\n", lefrGetUserData(), msg);
-}
-
-void warningCB(const char* msg) {
-  printf ("%s : %s\n", lefrGetUserData(), msg);
-}
-
-void* mallocCB(int size) {
-  return malloc(size);
-}
-
-void* reallocCB(void* name, int size) {
-  return realloc(name, size);
-}
-
-void freeCB(void* name) {
-  free(name);
-  return;
-}
-
-void lineNumberCB(int lineNo) {
-  fprintf(fout, "Parsed %d number of lines!!\n", lineNo);
-  return;
-}
-
-void printWarning(const char *str)
-{
-    fprintf(stderr, "%s\n", str);
-}
-
-
-
-int
-main(int argc, char** argv) {
-  char* inFile[100];
-  char* outFile;
-  FILE* f;
-  int res;
-  int noCalls = 0;
-//  long start_mem;
-  int num;
-  int status;
-  int retStr = 0;
-  int numInFile = 0;
-  int fileCt = 0;
-  int relax = 0;
-  const char* version = "N/A";
-  int setVer = 0;
-  char* userData;
-  int msgCb = 0;
-  int test1 = 0;
-  int test2 = 0;
-  int ccr749853 = 0;
-  int ccr1688946 = 0;
-  int ccr1709089 = 0;
-  int verbose = 0;
-
-// start_mem = (long)sbrk(0);
-
-  userData = strdup ("(lefrw-5100)");
-  strcpy(defaultName,"lef.in");
-  strcpy(defaultOut,"list");
-  inFile[0] = defaultName;
-  outFile = defaultOut;
-  fout = stdout;
-//  userData = 0x01020304;
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-  argc--;
-  argv++;
-  while (argc--) {
-
-    if (strcmp(*argv, "-d") == 0) {
-      argv++;
-      argc--;
-      sscanf(*argv, "%d", &num);
-      lefiSetDebug(num, 1);
-    }else if (strcmp(*argv, "-nc") == 0) {
-      noCalls = 1;
-
-    } else if (strcmp(*argv, "-p") == 0) {
-      printing = 1;
-
-    } else if (strcmp(*argv, "-m") == 0) { // use the user error/warning CB
-      msgCb = 1;
-
-    } else if (strcmp(*argv, "-o") == 0) {
-      argv++;
-      argc--;
-      outFile = *argv;
-      if ((fout = fopen(outFile, "w")) == 0) {
-	fprintf(stderr, "ERROR: could not open output file\n");
-	return 2;
-      }
-
-    } else if (strcmp(*argv, "-verStr") == 0) {
-        /* New to set the version callback routine to return a string    */
-        /* instead of double.                                            */
-        retStr = 1;
-
-    } else if (strcmp(*argv, "-relax") == 0) {
-        relax = 1;
-
-    } else if (strcmp(*argv, "-65nm") == 0) {
-        parse65nm = 1;
-
-    } else if (strcmp(*argv, "-lef58") == 0) {
-        parseLef58Type = 1;
-
-    } else if (strcmp(*argv, "-ver") == 0) {
-      argv++;
-      argc--;
-      setVer = 1;
-      version = *argv;
-    } else if (strcmp(*argv, "-test1") == 0) {
-      test1 = 1; 
-    } else if (strcmp(*argv, "-test2") == 0) {
-      test2 = 1; 
-    } else if (strcmp(*argv, "-sessionless") == 0) {
-      isSessionles = 1; 
-    } else if (strcmp(*argv, "-ccr749853") == 0) {
-      ccr749853 = 1; 
-    } else if (strcmp(*argv, "-ccr1688946") == 0) {
-      ccr1688946 = 1; 
-    } else if (strcmp(*argv, "-ccr1709089") == 0) {
-      ccr1709089 = 1;
-    } else if (argv[0][0] != '-') {
-      if (numInFile >= 100) {
-        fprintf(stderr, "ERROR: too many input files, max = 3.\n");
-        return 2;
-      }
-      inFile[numInFile++] = *argv;
-
-    } else {
-      fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-      return 2;
-    }
-
-    argv++;
-  }
-  
-  // sets the parser to be case sensitive...
-  // default was supposed to be the case but false...
-  // lefrSetCaseSensitivity(true);
-  if (isSessionles) {
-	lefrSetOpenLogFileAppend();
-  }
-
-  lefrInitSession(isSessionles ? 0 : 1);
-
-  if (noCalls == 0) {
-     lefrSetWarningLogFunction(printWarning);
-     lefrSetAntennaInputCbk(antennaCB);
-     lefrSetAntennaInoutCbk(antennaCB);
-     lefrSetAntennaOutputCbk(antennaCB);
-     lefrSetArrayBeginCbk(arrayBeginCB);
-     lefrSetArrayCbk(arrayCB);
-     lefrSetArrayEndCbk(arrayEndCB);
-     lefrSetBusBitCharsCbk(busBitCharsCB);
-     lefrSetCaseSensitiveCbk(caseSensCB);
-     lefrSetFixedMaskCbk(fixedMaskCB);
-     lefrSetClearanceMeasureCbk(clearanceCB);
-     lefrSetDensityCbk(densityCB);
-     lefrSetDividerCharCbk(dividerCB);
-     lefrSetNoWireExtensionCbk(noWireExtCB);
-     lefrSetNoiseMarginCbk(noiseMarCB);
-     lefrSetEdgeRateThreshold1Cbk(edge1CB);
-     lefrSetEdgeRateThreshold2Cbk(edge2CB);
-     lefrSetEdgeRateScaleFactorCbk(edgeScaleCB);
-     lefrSetExtensionCbk(extensionCB);
-     lefrSetNoiseTableCbk(noiseTableCB);
-     lefrSetCorrectionTableCbk(correctionCB);
-     lefrSetDielectricCbk(dielectricCB);
-     lefrSetIRDropBeginCbk(irdropBeginCB);
-     lefrSetIRDropCbk(irdropCB);
-     lefrSetIRDropEndCbk(irdropEndCB);
-     lefrSetLayerCbk(layerCB);
-     lefrSetLibraryEndCbk(doneCB); 
-     lefrSetMacroBeginCbk(macroBeginCB);
-     lefrSetMacroCbk(macroCB);
-     lefrSetMacroClassTypeCbk(macroClassTypeCB);
-     lefrSetMacroOriginCbk(macroOriginCB);
-     lefrSetMacroSizeCbk(macroSizeCB);
-     lefrSetMacroFixedMaskCbk(macroFixedMaskCB);
-     lefrSetMacroEndCbk(macroEndCB);
-     lefrSetManufacturingCbk(manufacturingCB);
-     lefrSetMaxStackViaCbk(maxStackViaCB);
-     lefrSetMinFeatureCbk(minFeatureCB);
-     lefrSetNonDefaultCbk(nonDefaultCB);
-     lefrSetObstructionCbk(obstructionCB);
-     lefrSetPinCbk(pinCB);
-     lefrSetPropBeginCbk(propDefBeginCB);
-     lefrSetPropCbk(propDefCB);
-     lefrSetPropEndCbk(propDefEndCB);
-     lefrSetSiteCbk(siteCB);
-     lefrSetSpacingBeginCbk(spacingBeginCB);
-     lefrSetSpacingCbk(spacingCB);
-     lefrSetSpacingEndCbk(spacingEndCB);
-     lefrSetTimingCbk(timingCB);
-     lefrSetUnitsCbk(unitsCB);
-     lefrSetUseMinSpacingCbk(useMinSpacingCB);
-     lefrSetUserData((void*)3);
-     if (!retStr)
-       lefrSetVersionCbk(versionCB);
-     else
-       lefrSetVersionStrCbk(versionStrCB);
-     lefrSetViaCbk(viaCB);
-     lefrSetViaRuleCbk(viaRuleCB);
-     lefrSetInputAntennaCbk(antennaCB);
-     lefrSetOutputAntennaCbk(antennaCB);
-     lefrSetInoutAntennaCbk(antennaCB);
-
-     if (msgCb) {
-       lefrSetLogFunction(errorCB);
-       lefrSetWarningLogFunction(warningCB);
-     }
-
-     lefrSetMallocFunction(mallocCB);
-     lefrSetReallocFunction(reallocCB);
-     lefrSetFreeFunction(freeCB);
-
-     lefrSetLineNumberFunction(lineNumberCB);
-     lefrSetDeltaNumberLines(50);
-  
-     lefrSetRegisterUnusedCallbacks();
-
-     if (relax)
-       lefrSetRelaxMode();
-
-     if (setVer)
-       (void)lefrSetVersionValue(version);
-
-     lefrSetAntennaInoutWarnings(30);
-     lefrSetAntennaInputWarnings(30);
-     lefrSetAntennaOutputWarnings(30);
-     lefrSetArrayWarnings(30);
-     lefrSetCaseSensitiveWarnings(30);
-     lefrSetCorrectionTableWarnings(30);
-     lefrSetDielectricWarnings(30);
-     lefrSetEdgeRateThreshold1Warnings(30);
-     lefrSetEdgeRateThreshold2Warnings(30);
-     lefrSetEdgeRateScaleFactorWarnings(30);
-     lefrSetInoutAntennaWarnings(30);
-     lefrSetInputAntennaWarnings(30);
-     lefrSetIRDropWarnings(30);
-     lefrSetLayerWarnings(30);
-     lefrSetMacroWarnings(30);
-     lefrSetMaxStackViaWarnings(30);
-     lefrSetMinFeatureWarnings(30);
-     lefrSetNoiseMarginWarnings(30);
-     lefrSetNoiseTableWarnings(30);
-     lefrSetNonDefaultWarnings(30);
-     lefrSetNoWireExtensionWarnings(30);
-     lefrSetOutputAntennaWarnings(30);
-     lefrSetPinWarnings(30);
-     lefrSetSiteWarnings(30);
-     lefrSetSpacingWarnings(30);
-     lefrSetTimingWarnings(30);
-     lefrSetUnitsWarnings(30);
-     lefrSetUseMinSpacingWarnings(30);
-     lefrSetViaRuleWarnings(30);
-     lefrSetViaWarnings(30);
-  }
-
-  (void) lefrSetShiftCase();  // will shift name to uppercase if caseinsensitive
-                              // is set to off or not set
-  if (!isSessionles) {
-	lefrSetOpenLogFileAppend();
-  }
-
-  if (ccr749853) {
-    lefrSetTotalMsgLimit (5);
-    lefrSetLimitPerMsg (1618, 2);
-  }
-
-  if (ccr1688946) {
-    lefrRegisterLef58Type("XYZ", "CUT");
-    lefrRegisterLef58Type("XYZ", "CUT");
-  }
-
-  if (test1) {  // for special tests
-    for (fileCt = 0; fileCt < numInFile; fileCt++) {
-      lefrReset();
-
-      if ((f = fopen(inFile[fileCt],"r")) == 0) {
-        fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-        return(2);
-      }
-
-      (void)lefrEnableReadEncrypted();
-
-      status = lefwInit(fout); // initialize the lef writer,
-                               // need to be called 1st
-      if (status != LEFW_OK)
-         return 1;
-  
-      res = lefrRead(f, inFile[fileCt], (void*)userData);
-
-      if (res)
-         fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-      (void)lefrPrintUnusedCallbacks(fout);
-      (void)lefrReleaseNResetMemory();
-      //(void)lefrUnsetCallbacks();
-      (void)lefrUnsetLayerCbk();
-      (void)lefrUnsetNonDefaultCbk();
-      (void)lefrUnsetViaCbk();
-
-    }
-  }
-  else if (test2) {  // for special tests
-    // this test is design to test the 3 APIs, lefrDisableParserMsgs,
-    // lefrEnableParserMsgs & lefrEnableAllMsgs
-    // It uses the file ccr566209.lef.  This file will parser 3 times
-    // 1st it will have lefrDisableParserMsgs set to both 2007 & 2008
-    // 2nd will enable 2007 by calling lefrEnableParserMsgs
-    // 3rd enable all msgs by call lefrEnableAllMsgs
-
-    int nMsgs = 3;
-    int dMsgs[3];
-    if (numInFile != 1) {
-        fprintf(stderr,"Test 2 mode needs only 1 file\n");
-        return 2;
-    } 
-
-    for (int idx=0; idx<5; idx++) {
-      if (idx == 0) {  // msgs 2005 & 2011
-         fprintf(stderr,"\nPass 0: Disabling 2007, 2008, 2009\n");
-         dMsgs[0] = 2007;
-         dMsgs[1] = 2008;
-         dMsgs[2] = 2009;
-         lefrDisableParserMsgs (3, (int*)dMsgs);
-      } else if (idx == 1) { // msgs 2007 & 2005, 2011 did not print because
-         fprintf(stderr,"\nPass 1: Enable 2007\n");
-         dMsgs[0] = 2007;       // lefrUnsetLayerCbk() was called
-         lefrEnableParserMsgs (1, (int*)dMsgs);
-      } else if (idx == 2) { // nothing were printed
-         fprintf(stderr,"\nPass 2: Disable all\n");
-         lefrDisableAllMsgs();
-      } else if (idx == 3) { // nothing were printed, lefrDisableParserMsgs
-         fprintf(stderr,"\nPass 3: Enable All\n");
-         lefrEnableAllMsgs();
-      } else if (idx == 4) { // msgs 2005 was printed
-         fprintf(stderr,"\nPass 4: Set limit on 2007 up 2\n");
-         lefrSetLimitPerMsg (2007, 2);
-      } 
-
-      if ((f = fopen(inFile[fileCt],"r")) == 0) {
-        fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-        return(2);
-      }
-
-      (void)lefrEnableReadEncrypted();
-
-      status = lefwInit(fout); // initialize the lef writer,
-                               // need to be called 1st
-      if (status != LEFW_OK)
-         return 1;
-  
-      res = lefrRead(f, inFile[fileCt], (void*)userData);
-
-      if (res)
-         fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-      (void)lefrPrintUnusedCallbacks(fout);
-      (void)lefrReleaseNResetMemory();
-      //(void)lefrUnsetCallbacks();
-      (void)lefrUnsetLayerCbk();
-      (void)lefrUnsetNonDefaultCbk();
-      (void)lefrUnsetViaCbk();
-
-    }
-  } else {
-    for (fileCt = 0; fileCt < numInFile; fileCt++) {
-      lefrReset();
-
-      if ((f = fopen(inFile[fileCt],"r")) == 0) {
-        fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-        return(2);
-      }
-
-      (void)lefrEnableReadEncrypted();
-
-      status = lefwInit(fout); // initialize the lef writer,
-                               // need to be called 1st
-      if (status != LEFW_OK)
-         return 1;
-  
-      if (ccr1709089) {
-        // CCR 1709089 test.
-        // Non-initialized lefData case.
-        lefrSetLimitPerMsg(10000, 10000);
-      }
-
-      res = lefrRead(f, inFile[fileCt], (void*)userData);
-
-      if (ccr1709089) {
-        // CCR 1709089 test.
-        // Initialized lefData case.
-        lefrSetLimitPerMsg(10000, 10000);
-      }
-
-      if (res)
-         fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-      (void)lefrPrintUnusedCallbacks(fout);
-      (void)lefrReleaseNResetMemory();
-
-    }
-    (void)lefrUnsetCallbacks();
-  }
-  // Unset all the callbacks
-  void lefrUnsetAntennaInputCbk();
-  void lefrUnsetAntennaInoutCbk();
-  void lefrUnsetAntennaOutputCbk();
-  void lefrUnsetArrayBeginCbk();
-  void lefrUnsetArrayCbk();
-  void lefrUnsetArrayEndCbk();
-  void lefrUnsetBusBitCharsCbk();
-  void lefrUnsetCaseSensitiveCbk();
-  void lefrUnsetFixedMaskCbk();
-  void lefrUnsetClearanceMeasureCbk();
-  void lefrUnsetCorrectionTableCbk();
-  void lefrUnsetDensityCbk();
-  void lefrUnsetDielectricCbk();
-  void lefrUnsetDividerCharCbk();
-  void lefrUnsetEdgeRateScaleFactorCbk();
-  void lefrUnsetEdgeRateThreshold1Cbk();
-  void lefrUnsetEdgeRateThreshold2Cbk();
-  void lefrUnsetExtensionCbk();
-  void lefrUnsetInoutAntennaCbk();
-  void lefrUnsetInputAntennaCbk();
-  void lefrUnsetIRDropBeginCbk();
-  void lefrUnsetIRDropCbk();
-  void lefrUnsetIRDropEndCbk();
-  void lefrUnsetLayerCbk();
-  void lefrUnsetLibraryEndCbk();
-  void lefrUnsetMacroBeginCbk();
-  void lefrUnsetMacroCbk();
-  void lefrUnsetMacroClassTypeCbk();
-  void lefrUnsetMacroEndCbk();
-  void lefrUnsetMacroOriginCbk();
-  void lefrUnsetMacroSizeCbk();
-  void lefrUnsetManufacturingCbk();
-  void lefrUnsetMaxStackViaCbk();
-  void lefrUnsetMinFeatureCbk();
-  void lefrUnsetNoiseMarginCbk();
-  void lefrUnsetNoiseTableCbk();
-  void lefrUnsetNonDefaultCbk();
-  void lefrUnsetNoWireExtensionCbk();
-  void lefrUnsetObstructionCbk();
-  void lefrUnsetOutputAntennaCbk();
-  void lefrUnsetPinCbk();
-  void lefrUnsetPropBeginCbk();
-  void lefrUnsetPropCbk();
-  void lefrUnsetPropEndCbk();
-  void lefrUnsetSiteCbk();
-  void lefrUnsetSpacingBeginCbk();
-  void lefrUnsetSpacingCbk();
-  void lefrUnsetSpacingEndCbk();
-  void lefrUnsetTimingCbk();
-  void lefrUnsetUseMinSpacingCbk();
-  void lefrUnsetUnitsCbk();
-  void lefrUnsetVersionCbk();
-  void lefrUnsetVersionStrCbk();
-  void lefrUnsetViaCbk();
-  void lefrUnsetViaRuleCbk();
-
-  fclose(fout);
-
-  // Release allocated singleton data.
-  lefrClear();    
-
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwrite.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwrite.cpp
deleted file mode 100644
index 6e4e353..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwrite.cpp
+++ /dev/null
@@ -1,2116 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012 - 2017, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "lefwWriter.hpp"
-
-char defaultOut[128];
-
-// Global variables
-FILE* fout;
-
-#define CHECK_STATUS(status) \
-  if (status) {              \
-     lefwPrintError(status); \
-     return(status);         \
-  }
-
-int main(int argc, char** argv) {
-  char* outfile;
-  int   status;    // return code, if none 0 means error
-  int   lineNum = 0;
-
-  // assign the default
-  strcpy(defaultOut, "lef.in");
-  outfile = defaultOut;
-  fout = stdout;
-
-  double *xpath;
-  double *ypath;
-  double *xl;
-  double *yl;
-  double *wthn, *spng;
-  int    *aspc;
-  int    encrypt = 0;
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-  argc--;
-  argv++;
-  while (argc--) {
-     if (strcmp(*argv, "-o") == 0) {   // output filename
-        argv++;
-        argc--;
-        outfile = *argv;
-        if ((fout = fopen(outfile, "w")) == 0) {
-           fprintf(stderr, "ERROR: could not open output file\n");
-           return 2;
-        }
-     } else if (strncmp(*argv,  "-h", 2) == 0) {  // compare with -h[elp]
-        fprintf(stderr, "Usage: lefwrite [-o <filename>] [-e] [-help]\n");
-        return 1;
-     } else if (strncmp(*argv,  "-e", 2) == 0) {  // compare with -e[ncrypt]
-        encrypt = 1; 
-     } else {
-        fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-        return 2;
-     }
-     argv++;
-  }
-
-  // initalize
-  status = lefwInit(fout);
-  CHECK_STATUS(status);
-
-  // set to write an encrypted file
-  if (encrypt) {
-     status = lefwEncrypt();
-     CHECK_STATUS(status);
-  }
-
-  status = lefwVersion(5, 8);
-  CHECK_STATUS(status);
-//  status = lefwCaseSensitive("ON");   5.6
-//  CHECK_STATUS(status);
-//  status = lefwNoWireExtensionAtPin("ON");  5.6
-//  CHECK_STATUS(status);
-  status = lefwBusBitChars("<>");
-  CHECK_STATUS(status);
-  status = lefwDividerChar(":");
-  CHECK_STATUS(status);
-  status = lefwManufacturingGrid(3.5);
-  CHECK_STATUS(status);
-  status = lefwFixedMask();
-  CHECK_STATUS(status);
-  status = lefwUseMinSpacing("OBS", "OFF");
-  CHECK_STATUS(status);
-//  status = lefwUseMinSpacing("PIN", "ON");  5.6
-//  CHECK_STATUS(status);
-  status = lefwClearanceMeasure("EUCLIDEAN");
-  CHECK_STATUS(status);
-  // status = lefwClearanceMeasure("MAXXY");  5.6
-  // CHECK_STATUS(status);
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-
-  // 5.4 ANTENNA
-  status = lefwAntennaInputGateArea(45);
-  CHECK_STATUS(status);
-  status = lefwAntennaInOutDiffArea(65);
-  CHECK_STATUS(status);
-  status = lefwAntennaOutputDiffArea(55);
-  CHECK_STATUS(status);
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-
-  // UNITS
-  status = lefwStartUnits();
-  CHECK_STATUS(status);
-  status = lefwUnits(100, 10, 10000, 10000, 10000, 1000, 20000);
-  CHECK_STATUS(status);
-  status = lefwUnitsFrequency(10);
-  CHECK_STATUS(status);
-  status = lefwEndUnits();
-  CHECK_STATUS(status);
-
-  // PROPERTYDEFINITIONS
-  status = lefwStartPropDef();
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("LIBRARY", "NAME", 0, 0, "Cadence96");
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("LIBRARY", "intNum", 0, 0, 20);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("LIBRARY", "realNum", 0, 0, 21.22);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("PIN", "TYPE", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("PIN", "intProp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("PIN", "realProp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("MACRO", "stringProp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("MACRO", "integerProp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("MACRO", "WEIGHT", 1.0, 100.0, 0);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("VIA", "stringProperty", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("VIA", "realProp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("VIA", "COUNT", 1, 100, 0);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("LAYER", "lsp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("LAYER", "lip", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("LAYER", "lrp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("VIARULE", "vrip", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("VIARULE", "vrrp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("NONDEFAULTRULE", "ndrip", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("NONDEFAULTRULE", "ndrrp", 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndPropDef();
-  CHECK_STATUS(status);
-
-  // LAYERS
-  double *current;
-  double *diffs;
-  double *ratios;
-  double *area;
-  double *width;
-
-  current = (double*)malloc(sizeof(double)*15);
-  diffs = (double*)malloc(sizeof(double)*15);
-  ratios = (double*)malloc(sizeof(double)*15);
-
-  status = lefwStartLayer("POLYS", "MASTERSLICE");
-  CHECK_STATUS(status);
-  status = lefwStringProperty("lsp", "top");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("lip", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("lrp", 2.3);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("POLYS");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("CUT01", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 2.0;
-  current[1] = 5.0;
-  current[2] = 10.0;
-  status = lefwLayerDCCutarea(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  current[2] = 0.4E-6;
-  status = lefwLayerDCTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CUT01");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("RX");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingDiagPitch(1.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingDiagWidth(1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingDiagSpacing(0.05);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingDiagMinEdgeLength(0.07);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingArea(34.1);
-  CHECK_STATUS(status);
-  xl = (double*)malloc(sizeof(double)*2);
-  yl = (double*)malloc(sizeof(double)*2);
-  xl[0] = 0.14;
-  yl[0] = 0.30;
-  xl[1] = 0.08;
-  yl[1] = 0.33;
-  status = lefwLayerRoutingMinsize(2, xl, yl);
-  CHECK_STATUS(status);
-  free((char*)xl);
-  free((char*)yl);
-  status = lefwLayerRoutingWireExtension(0.75);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingOffset(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRange(0.1, 9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.103");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000156");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingHeight(9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingThickness(1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingShrinkage(0.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingEdgeCap(0.00005);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapMultiplier(1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinwidth(0.15); 
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingAntennaArea(1);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumAreaRatio(6.7);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumRoutingPlusCut();            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaMinusDiff(100.0);           // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaGatePlusDiff(2.0);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumDiffAreaRatio(1000);         // 5.7
-  CHECK_STATUS(status);
-  xl = (double*)malloc(sizeof(double)*5);
-  yl = (double*)malloc(sizeof(double)*5);
-  xl[0] = 0.0;
-  yl[0] = 1.0;
-  xl[1] = 0.09999;
-  yl[1] = 1.0;
-  xl[2] = 0.1;
-  yl[2] = 0.2;
-  xl[3] = 1.0;
-  yl[3] = 0.1;
-  xl[4] = 100;
-  yl[4] = 0.1;
-  status = lefwLayerAntennaAreaDiffReducePwl(5, xl, yl);   // 5.7
-  CHECK_STATUS(status);
-  free((char*)xl);
-  free((char*)yl);
-  status = lefwLayerAntennaCumDiffAreaRatio(1000);         // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingAntennaLength(1);
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 10.0);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("PEAK", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  current[2] = 400E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 2.0E-6;
-  current[1] = 1.9E-6;
-  current[2] = 1.8E-6;
-  current[3] = 1.7E-6;
-  current[4] = 1.5E-6;
-  current[5] = 1.4E-6;
-  current[6] = 1.3E-6;
-  current[7] = 1.2E-6;
-  current[8] = 1.1E-6;
-  current[9] = 1.0E-6;
-  current[10] = 0.9E-6;
-  current[11] = 0.8E-6;
-  current[12] = 0.7E-6;
-  current[13] = 0.6E-6;
-  current[14] = 0.4E-6;
-  status = lefwLayerACTableEntries(15, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  current[2] = 400E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  current[2] = 0.4E-6;
-  status = lefwLayerACTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("RMS", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 400E6;
-  current[2] = 800E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.4;
-  current[1] = 0.8;
-  current[2] = 10.0;
-  current[3] = 50.0;
-  current[4] = 100.0;
-  status = lefwLayerACWidth(5, current);
-  CHECK_STATUS(status);
-  current[0] = 2.0E-6;
-  current[1] = 1.9E-6;
-  current[2] = 1.8E-6;
-  current[3] = 1.7E-6;
-  current[4] = 1.5E-6;
-  current[5] = 1.4E-6;
-  current[6] = 1.3E-6;
-  current[7] = 1.2E-6;
-  current[8] = 1.1E-6;
-  current[9] = 1.0E-6;
-  current[10] = 0.9E-6;
-  current[11] = 0.8E-6;
-  current[12] = 0.7E-6;
-  current[13] = 0.6E-6;
-  current[14] = 0.4E-6;
-  status = lefwLayerACTableEntries(15, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("RX");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("CUT12", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.7);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingLayer("RX", 0);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();
-  CHECK_STATUS(status);
-  status = lefwLayerResistancePerCut(8.0);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.22);                // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingAdjacent(3, 0.25, 0);  // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(1.5);                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingParallel();            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(1.2);                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingAdjacent(2, 1.5, 0);   // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaModel("OXIDE1");
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaRatio(5.6);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaDiffAreaRatio(6.5);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaFactor(5.4, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumDiffAreaRatio(4.5);
-  CHECK_STATUS(status);
-  diffs[0] = 5.4;
-  ratios[0] = 5.4;
-  diffs[1] = 6.5;
-  ratios[1] = 6.5;
-  diffs[2] = 7.5;
-  ratios[2] = 7.5;
-  status = lefwLayerAntennaCumDiffAreaRatioPwl(3, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumAreaRatio(6.7);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaModel("OXIDE2");
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumAreaRatio(300);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumRoutingPlusCut();            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaMinusDiff(100.0);           // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaGatePlusDiff(2.0);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaDiffAreaRatio(1000);            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumDiffAreaRatio(5000);         // 5.7
-  CHECK_STATUS(status);
-  xl = (double*)malloc(sizeof(double)*5);
-  yl = (double*)malloc(sizeof(double)*5);
-  xl[0] = 0.0;
-  yl[0] = 1.0;
-  xl[1] = 0.09999;
-  yl[1] = 1.0;
-  xl[2] = 0.1;
-  yl[2] = 0.2;
-  xl[3] = 1.0;
-  yl[3] = 0.1;
-  xl[4] = 100;
-  yl[4] = 0.1;
-  status = lefwLayerAntennaAreaDiffReducePwl(5, xl, yl);   // 5.7
-  CHECK_STATUS(status);
-  free((char*)xl);
-  free((char*)yl);
-  diffs[0] = 1;
-  ratios[0] = 4;
-  diffs[1] = 2;
-  ratios[1] = 5;
-  status = lefwLayerAntennaCumDiffAreaRatioPwl(2, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("PEAK", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.5E-6;
-  current[1] = 0.4E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("RMS", 0);
-  CHECK_STATUS(status);
-  current[0] = 100E6;
-  current[1] = 800E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.5E-6;
-  current[1] = 0.4E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CUT12");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("PC");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("DIAG45", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(0.4);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(1.2);                    // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEndOfLine(1.3, 0.6);      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(1.3);                    // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEndOfLine(1.4, 0.7);      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEOLParallel(1.1, 0.5, 1); // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(1.4);                    // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEndOfLine(1.5, 0.8);      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEOLParallel(1.2, 0.6, 0); // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingOffsetXYDistance(0.9, 0.7);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("PWL ( ( 1 0.103 ) )");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("PWL ( ( 1 0.000156 ) ( 10 0.001 ) )");
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaRatio(5.4);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaDiffAreaRatio(6.5);
-  CHECK_STATUS(status);
-  diffs[0] = 4.0;
-  ratios[0] = 4.1;
-  diffs[1] = 4.2;
-  ratios[1] = 4.3;
-  status = lefwLayerAntennaDiffAreaRatioPwl(2, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumAreaRatio(7.5);
-  CHECK_STATUS(status);
-  diffs[0] = 5.0;
-  ratios[0] = 5.1;
-  diffs[1] = 6.0;
-  ratios[1] = 6.1;
-  status = lefwLayerAntennaCumDiffAreaRatioPwl(2, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaAreaFactor(4.5, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaSideAreaRatio(6.5);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumDiffSideAreaRatio(4.6);
-  CHECK_STATUS(status);
-  diffs[0] = 8.0;
-  ratios[0] = 8.1;
-  diffs[1] = 8.2;
-  ratios[1] = 8.3;
-  diffs[2] = 8.4;
-  ratios[2] = 8.5;
-  diffs[3] = 8.6;
-  ratios[3] = 8.7;
-  status = lefwLayerAntennaCumDiffSideAreaRatioPwl(4, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumSideAreaRatio(7.4);
-  CHECK_STATUS(status);
-  diffs[0] = 7.0;
-  ratios[0] = 7.1;
-  diffs[1] = 7.2;
-  ratios[1] = 7.3;
-  status = lefwLayerAntennaDiffSideAreaRatioPwl(2, diffs, ratios);
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaSideAreaFactor(9.0, "DIFFUSEONLY");
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("PEAK", 10.0);
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 20.0;
-  current[1] = 50.0;
-  current[2] = 100.0;
-  status = lefwLayerDCWidth(3, current);
-  CHECK_STATUS(status);
-  current[0] = 1.0E-6;
-  current[1] = 0.7E-6;
-  current[2] = 0.5E-6;
-  status = lefwLayerDCTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("PC");
-  CHECK_STATUS(status);
-  status = lefwStartLayer("CA", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.15);                // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingCenterToCenter();      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("BELOW", 0.3, 0.01, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("ABOVE", 0.5, 0.01, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerPreferEnclosure("BELOW", 0.06, 0.01, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerPreferEnclosure("ABOVE", 0.08, 0.02, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("", 0.02, 0.02, 1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure(NULL, 0.05, 0.05, 2.0);
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("BELOW", 0.07, 0.07, 1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("ABOVE", 0.09, 0.09, 1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerResistancePerCut(10.0);
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 2.0;
-  current[1] = 5.0;
-  current[2] = 10.0;
-  status = lefwLayerDCWidth(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  current[2] = 0.4E-6;
-  status = lefwLayerDCTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CA");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("M1");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("DIAG135", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRange(1.1, 100.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRangeUseLengthThreshold();
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.61);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRange(1.1, 100.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRangeInfluence(2.01, 2.0, 1000.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.62);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRange(1.1, 100.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRangeRange(4.1, 6.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.63);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingLengthThreshold(1.34, 4.5, 6.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(7);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.103");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000156");
-  CHECK_STATUS(status);
-  current[0] = 0.00;
-  current[1] = 0.50;
-  current[2] = 3.00;
-  current[3] = 5.00;
-  status = lefwLayerRoutingStartSpacingtableParallel(4, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.15;
-  current[2] = 0.15;
-  current[3] = 0.15;
-  status = lefwLayerRoutingSpacingtableParallelWidth(0.00, 4, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.20;
-  current[2] = 0.20;
-  current[3] = 0.20;
-  status = lefwLayerRoutingSpacingtableParallelWidth(0.25, 4, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.50;
-  current[2] = 0.50;
-  current[3] = 0.50;
-  status = lefwLayerRoutingSpacingtableParallelWidth(1.50, 4, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.50;
-  current[2] = 1.00;
-  current[3] = 1.00;
-  status = lefwLayerRoutingSpacingtableParallelWidth(3.00, 4, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.50;
-  current[2] = 1.00;
-  current[3] = 2.00;
-  status = lefwLayerRoutingSpacingtableParallelWidth(5.00, 4, current);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutineEndSpacingtable();
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingStartSpacingtableInfluence();
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingInfluenceWidth(1.5, 0.5, 0.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingInfluenceWidth(3.0, 1.0, 1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingInfluenceWidth(5.0, 2.0, 2.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutineEndSpacingtable();
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingStartSpacingtableInfluence();
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingInfluenceWidth(1.5, 0.5, 0.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingInfluenceWidth(5.0, 2.0, 2.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutineEndSpacingtable();
-  CHECK_STATUS(status);
-  current[0] = 0.00;
-  current[1] = 0.50;
-  current[2] = 5.00;
-  status = lefwLayerRoutingStartSpacingtableParallel(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.15;
-  current[2] = 0.15;
-  status = lefwLayerRoutingSpacingtableParallelWidth(0.00, 3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.20;
-  current[2] = 0.20;
-  status = lefwLayerRoutingSpacingtableParallelWidth(0.25, 3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.50;
-  current[2] = 1.00;
-  status = lefwLayerRoutingSpacingtableParallelWidth(3.00, 3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.15;
-  current[1] = 0.50;
-  current[2] = 2.00;
-  status = lefwLayerRoutingSpacingtableParallelWidth(5.00, 3, current);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutineEndSpacingtable();
-  CHECK_STATUS(status);
-  free((char*)current);
-  free((char*)diffs);
-  free((char*)ratios);
-  status = lefwLayerAntennaGatePlusDiff(2.0);      // 5.7 
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaDiffAreaRatio(1000);    // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerAntennaCumDiffAreaRatio(5000); // 5.7
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M1");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V1", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingLayer("CA", 0);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V1");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("M2");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("VERTICAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingLengthThreshold(100.9, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingLengthThreshold(0.9, 0, 0.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingLengthThreshold(1.9, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(1.0);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingSameNet(1);         // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(1.1);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingSameNet(0);         // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V2", "CUT");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("M3");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitchXYDistance(1.8, 1.5);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingDiagPitchXYDistance(1.5, 1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M3");
-  CHECK_STATUS(status);
-
-  area = (double*)malloc(sizeof(double)*3);
-  width = (double*)malloc(sizeof(double)*3);
-
-  status = lefwStartLayerRouting("M4");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcut(2, 0.50);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcut(2, 0.70);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcutConnections("FROMBELOW");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcut(4, 1.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcutConnections("FROMABOVE");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcut(2, 1.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinimumcutLengthWithin(20.0, 5.0);
-  CHECK_STATUS(status);
-  area[0]  = 0.40;
-  width[0] = 0;
-  area[1]  = 0.40;
-  width[1] = 0.15;
-  area[2]  = 0.80;
-  width[2] = 0.50;
-  status = lefwLayerRoutingMinenclosedarea(3, area, width);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMaxwidth(10.0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingProtrusion(0.30, 0.60, 1.20);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstep(0.20);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstep(0.05);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, NULL, 0.08);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, NULL, 0.16);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, "INSDECORNER", 0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, "INSIDECORNER", 0.15);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, "STEP", 0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.05, "STEP", 0.08);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepWithOptions(0.04, "STEP", 0);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingMinstepMaxEdges(1.0, 2);    // 5.7
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M4");
-  CHECK_STATUS(status);
-  free((char*)area);
-  free((char*)width);
-
-  status = lefwStartLayer("implant1", "IMPLANT");
-  CHECK_STATUS(status);
-  status = lefwLayerWidth(0.50);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.50);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();
-  CHECK_STATUS(status);
-  status = lefwEndLayer("implant1");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("implant2", "IMPLANT");
-  CHECK_STATUS(status);
-  status = lefwLayerWidth(0.50);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.50);
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();
-  CHECK_STATUS(status);
-  status = lefwEndLayer("implant2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V3", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerMask(2);
-  CHECK_STATUS(status);
-  status = lefwLayerWidth(0.60);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V3");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("MT");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("VERTICAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("MT");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("OVERLAP", "OVERLAP");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("OVERLAP");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("MET2");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("VERTICAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerMask(2);
-  CHECK_STATUS(status);
-  status = lefwMinimumDensity(20.2);
-  CHECK_STATUS(status);
-  status = lefwMaximumDensity(80.0);
-  CHECK_STATUS(status);
-  status = lefwDensityCheckWindow(200.0, 200.0);
-  CHECK_STATUS(status);
-  status = lefwDensityCheckStep(100.0);
-  CHECK_STATUS(status);
-  status = lefwFillActiveSpacing(3.0);
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("MET2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("via34", "CUT");                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerWidth(0.25);                           // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.1);                       // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingCenterToCenter();            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                       // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure(0, .05, .01, 0);             // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosureLength(0, .05, 0, 0.7);       // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("BELOW", .07, .07, 1.0);     // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosure("ABOVE", .09, .09, 1.0);     // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerEnclosureWidth(0, .03, .03, 1.0, 0.2); // 5.7
-  CHECK_STATUS(status);
-  status = lefwEndLayer("via34");                          // 5.7
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("cut23", "CUT");                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacing(0.20);                      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingSameNet();                   // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingLayer("cut12", 1);           // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                       // 5.7
-  CHECK_STATUS(status);
-
-  status = lefwLayerCutSpacing(0.30);                      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingCenterToCenter();            // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingSameNet();                   // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingArea(0.02);                  // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                       // 5.7
-  CHECK_STATUS(status);
-
-  status = lefwLayerCutSpacing(0.40);                      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingArea(0.5);                   // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                       // 5.7
-  CHECK_STATUS(status);
-
-  status = lefwLayerCutSpacing(0.10);                      // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerCutSpacingEnd();                       // 5.7
-  CHECK_STATUS(status);
-
-  wthn = (double*)malloc(sizeof(double)*3);                // 5.7
-  spng = (double*)malloc(sizeof(double)*3);
-  aspc = (int*)malloc(sizeof(int)*3);
-  wthn[0] = 0.15;
-  spng[0] = 0.11;
-  wthn[1] = 0.13;
-  spng[1] = 0.13;
-  wthn[2] = 0.11;
-  spng[2] = 0.15;
-  status = lefwLayerCutSpacingTableOrtho(3, wthn, spng);
-  CHECK_STATUS(status);
-
-  aspc[0] = 3;
-  spng[0] = 1;
-  status = lefwLayerArraySpacing(0, 2.0, 0.2, 1, aspc, spng);
-  CHECK_STATUS(status);
-  aspc[0] = 3;
-  spng[0] = 1;
-  aspc[1] = 4;
-  spng[1] = 1.5;
-  aspc[2] = 5;
-  spng[2] = 2.0;
-  status = lefwLayerArraySpacing(1, 2.0, 0.2, 3, aspc, spng);
-  CHECK_STATUS(status);
-  free((char*)wthn);
-  free((char*)spng);
-  free((char*)aspc);
-  status = lefwEndLayer("cut23");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("cut24");                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.2);                     // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.10);                  // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.12);                  // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingNotchLength(0.15);       // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.14);                  // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingEndOfNotchWidth(0.15, 0.16, 0.08); // 5.7
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("cut24");                   // 5.7
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("cut25");                 // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.2);                     // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);              // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(7);               // 5.7
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingStartSpacingtableTwoWidths();   // 5.7
-  CHECK_STATUS(status);
-  wthn = (double*)malloc(sizeof(double)*4);                // 5.7
-  wthn[0] = 0.15;
-  wthn[1] = 0.20;
-  wthn[2] = 0.50;
-  wthn[3] = 1.00;
-  status = lefwLayerRoutingSpacingtableTwoWidthsWidth(0.0, 0, 4, wthn);  // 5.7
-  CHECK_STATUS(status);
-  wthn[0] = 0.20;
-  wthn[1] = 0.25;
-  wthn[2] = 0.50;
-  wthn[3] = 1.00;
-  status = lefwLayerRoutingSpacingtableTwoWidthsWidth(0.25, 0.1, 4, wthn);// 5.7
-  CHECK_STATUS(status);
-  wthn[0] = 0.50;
-  wthn[1] = 0.50;
-  wthn[2] = 0.60;
-  wthn[3] = 1.00;
-  status = lefwLayerRoutingSpacingtableTwoWidthsWidth(1.5, 1.5, 4, wthn);// 5.7
-  CHECK_STATUS(status);
-  wthn[0] = 1.00;
-  wthn[1] = 1.00;
-  wthn[2] = 1.00;
-  wthn[3] = 1.20;
-  status = lefwLayerRoutingSpacingtableTwoWidthsWidth(3.0, 3.0, 4, wthn);// 5.7
-  CHECK_STATUS(status);
-  free(wthn);
-  status = lefwLayerRoutineEndSpacingtable();
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("cut25");                   // 5.7
-  CHECK_STATUS(status);
-
-  // MAXVIASTACK
-  status = lefwMaxviastack(4, "m1", "m7");
-  CHECK_STATUS(status);
-
-  // VIA
-  status = lefwStartVia("RX_PC", "DEFAULT");
-  CHECK_STATUS(status);
-  status = lefwViaResistance(2);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("RX");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.7, -0.7, 0.7, 0.7, 3);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT12");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.25, -0.25, 0.25, 0.25);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("PC");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.6, -0.6, 0.6, 0.6, 2);
-  CHECK_STATUS(status);
-  status = lefwStringProperty("stringProperty", "DEFAULT");
-  CHECK_STATUS(status);
-  status = lefwRealProperty("realProperty", 32.33);
-  CHECK_STATUS(status);
-  status = lefwIntProperty("COUNT", 34);
-  CHECK_STATUS(status);
-  status = lefwEndVia("PC");
-  CHECK_STATUS(status);
-
-  status = lefwStartVia("M2_M3_PWR", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaResistance(0.4);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("M2");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("V2");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, -0.45, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(0.45, -1.35, 1.35, -0.45);
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(0.45, 0.45, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("M3");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwEndVia("M2_M3_PWR");
-  CHECK_STATUS(status);
-
-  xl = (double*)malloc(sizeof(double)*6);
-  yl = (double*)malloc(sizeof(double)*6);
-  status = lefwStartVia("IN1X", 0);
-  CHECK_STATUS(status);
-//  status = lefwViaTopofstackonly();  5.6
-//  CHECK_STATUS(status);
-//  status = lefwViaForeign("IN1X", 0, 0, -1);  5.6
-//  CHECK_STATUS(status);
-  status = lefwViaLayer("metal2");
-  CHECK_STATUS(status);
-  xl[0] = -2.1;
-  yl[0] = -1.0;
-  xl[1] = -0.2;
-  yl[1] = 1.0;
-  xl[2] = 2.1;
-  yl[2] = 1.0;
-  xl[3] = 0.2;
-  yl[3] = -1.0;
-  xl[4] = 0.2;
-  yl[4] = -1.0;
-  xl[5] = 0.2;
-  yl[5] = -1.0;
-  status = lefwViaLayerPolygon(6, xl, yl, 2);
-  CHECK_STATUS(status);
-  xl[0] = -1.1;
-  yl[0] = -2.0;
-  xl[1] = -0.1;
-  yl[1] = 2.0;
-  xl[2] = 1.1;
-  yl[2] = 2.0;
-  xl[3] = 0.1;
-  yl[3] = -2.0;
-  status = lefwViaLayerPolygon(4, xl, yl, 1);
-  CHECK_STATUS(status);
-  xl[0] = -3.1;
-  yl[0] = -2.0;
-  xl[1] = -0.3;
-  yl[1] = 2.0;
-  xl[2] = 3.1;
-  yl[2] = 2.0;
-  xl[3] = 0.3;
-  yl[3] = -2.0;
-  status = lefwViaLayerPolygon(4, xl, yl);
-  CHECK_STATUS(status);
-  xl[0] = -4.1;
-  yl[0] = -2.0;
-  xl[1] = -0.4;
-  yl[1] = 2.0;
-  xl[2] = 4.1;
-  yl[2] = 2.0;
-  xl[3] = 0.4;
-  yl[3] = -2.0;
-  status = lefwViaLayerPolygon(4, xl, yl);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("cut23");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.4, -0.4, 0.4, 0.4);
-  CHECK_STATUS(status);
-  xl[0] = -2.1;
-  yl[0] = -1.0;
-  xl[1] = -0.2;
-  yl[1] = 1.0;
-  xl[2] = 2.1;
-  yl[2] = 1.0;
-  xl[3] = 0.2;
-  yl[3] = -1.0;
-  status = lefwViaLayerPolygon(4, xl, yl);
-  CHECK_STATUS(status);
-  status = lefwEndVia("IN1X");
-  CHECK_STATUS(status);
-
-  status = lefwStartVia("myBlockVia", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaViarule("DEFAULT", 0.1, 0.1, "metal1", "via12", "metal2",
-                          0.1, 0.1, 0.05, 0.01, 0.01, 0.05);
-  CHECK_STATUS(status);
-  status = lefwViaViaruleRowCol(1, 2);
-  CHECK_STATUS(status);
-  status = lefwViaViaruleOrigin(1.5, 2.5);
-  CHECK_STATUS(status);
-  status = lefwViaViaruleOffset(1.5, 2.5, 3.5, 4.5);
-  CHECK_STATUS(status);
-  status = lefwViaViarulePattern("2_1RF1RF1R71R0_3_R1FFFF");
-  CHECK_STATUS(status);
-  status = lefwEndVia("myBlockVia");
-  CHECK_STATUS(status);
-
-  status = lefwStartVia("myVia23", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("metal2"); 
-  CHECK_STATUS(status);
-  status = lefwViaLayerPolygon(6, xl, yl);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("cut23"); 
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.4, -0.4, 0.4, 0.4);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("metal3"); 
-  CHECK_STATUS(status);
-  status = lefwViaLayerPolygon(5, xl, yl);
-  CHECK_STATUS(status);
-  status = lefwEndVia("myVia23");
-  CHECK_STATUS(status);
-
-  free((char*)xl);
-  free((char*)yl);
-
-  // VIARULE
-  status = lefwStartViaRule("VIALIST12");
-  CHECK_STATUS(status);
-  lefwAddComment("Break up the old lefwViaRule into 2 routines");
-  lefwAddComment("lefwViaRuleLayer and lefwViaRuleVia");
-//  status = lefwViaRuleLayer("M1", "VERTICAL", 9.0, 9.6, 4.5, 0);  5.6
-//  CHECK_STATUS(status);
-//  status = lefwViaRuleLayer("M2", "HORIZONTAL", 3.0, 3.0, 0, 0);  5.6
-//  CHECK_STATUS(status);
-  status = lefwViaRuleLayer("M1", NULL, 9.0, 9.6, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleLayer("M2", NULL, 3.0, 3.0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleVia("VIACENTER12");
-  CHECK_STATUS(status);
-  status = lefwStringProperty("vrsp", "new");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("vrip", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("vrrp", 4.5);
-  CHECK_STATUS(status);
-  status = lefwEndViaRule("VIALIST12");
-  CHECK_STATUS(status);
-
-  // VIARULE with GENERATE
-  lefwAddComment("Break up the old lefwViaRuleGenearte into 4 routines");
-  lefwAddComment("lefwStartViaRuleGen, lefwViaRuleGenLayer,");
-  lefwAddComment("lefwViaRuleGenLayer3, and lefwEndViaRuleGen");
-  status = lefwStartViaRuleGen("VIAGEN12");
-  CHECK_STATUS(status);
-//  status = lefwViaRuleGenLayer("M1", "VERTICAL", 0.1, 19, 1.4, 0);  5.6
-//  CHECK_STATUS(status);
-//  status = lefwViaRuleGenLayer("M2", "HORIZONTAL", 0, 0, 1.4, 0);  5.6
-//  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer("M1", NULL, 0.1, 19, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer("M2", NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer3("V1", -0.8, -0.8, 0.8, 0.8, 5.6, 6.0, 0.2);
-  CHECK_STATUS(status);
-  status = lefwEndViaRuleGen("VIAGEN12");
-  CHECK_STATUS(status);
-
-  // VIARULE with GENERATE & ENCLOSURE & DEFAULT	
-  status = lefwStartViaRuleGen("via12");
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenDefault();
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayerEnclosure("m1", 0.05, 0.005, 1.0, 100.0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayerEnclosure("m2", 0.05, 0.005, 1.0, 100.0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer3("cut12", -0.07, -0.07, 0.07, 0.07, 0.16, 0.16, 0);
-  CHECK_STATUS(status);
-  status = lefwEndViaRuleGen("via12");
-  CHECK_STATUS(status);
-
-  // NONDEFAULTRULE
-  status = lefwStartNonDefaultRule("RULE1"); 
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleHardspacing(); 
-  CHECK_STATUS(status);
-//  status = lefwNonDefaultRuleLayer("RX", 10.0, 2.2, 6, 6.5, 6.5, 6.5);  5.6
-//  CHECK_STATUS(status);
-//  status = lefwNonDefaultRuleLayer("PC", 10.0, 2.2, 0, 0, 6.5, 0);  5.6
-//  CHECK_STATUS(status);
-//  status = lefwNonDefaultRuleLayer("M1", 10.0, 2.2, 0, 6.5, 0, 0);  5.6
-//  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("RX", 10.0, 2.2, 6, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("PC", 10.0, 2.2, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("M1", 10.0, 2.2, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwStartVia("nd1VARX0", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaResistance(0.2);
-  CHECK_STATUS(status);
-//  status = lefwViaForeignStr("IN1X", 0, 0, "N");  5.6
-// CHECK_STATUS(status);
-  status = lefwViaLayer("RX");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT12");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.0, -1.0, 1.0, 1.0);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("PC");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwEndVia("nd1VARX0");
-  CHECK_STATUS(status);
-  status = lefwStartSpacing();
-  CHECK_STATUS(status);
-  status = lefwSpacing("CUT01", "RX", 0.1, "STACK");
-  CHECK_STATUS(status);
-  status = lefwEndSpacing();
-  CHECK_STATUS(status);
-  status = lefwEndNonDefaultRule("RULE1"); 
-  CHECK_STATUS(status);
-  status = lefwStartNonDefaultRule("wide1_5x"); 
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("fw", 4.8, 4.8, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleStartVia("nd1VIARX0", "DEFAULT");
-  CHECK_STATUS(status);
-//  status = lefwViaTopofstackonly();  5.6
-//  CHECK_STATUS(status);
-//  status = lefwViaForeign("IN1X", 0, 0, -1);  5.6
-//  CHECK_STATUS(status);
-  status = lefwViaResistance(0.2);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("RX");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT12");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.0, -1.0, 1.0, 1.0);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("PC");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleEndVia("nd1VIARX0");
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleUseVia("via12_fixed_analog_via");
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleMinCuts("cut12", 2);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleUseVia("via23_fixed_analog_via");
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleMinCuts("cut23", 2);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleUseViaRule("viaRule23_fixed_analog_via");
-  CHECK_STATUS(status);
-  status = lefwEndNonDefaultRule("wide1_5x"); 
-  CHECK_STATUS(status);
-
-  // UNIVERSALNOISEMARGIN
-  /* obsolete in 5.4
-  status = lefwUniversalNoiseMargin(0.1, 20);
-  CHECK_STATUS(status);
-  status = lefwEdgeRateThreshold1(0.1);
-  CHECK_STATUS(status);
-  status = lefwEdgeRateThreshold2(0.9);
-  CHECK_STATUS(status);
-  status = lefwEdgeRateScaleFactor(1.0);
-  CHECK_STATUS(status);
-  */
-
-  // NOISETABLE
-  /* obsolete in 5.4
-  double *holder;
-  holder = (double*)malloc(sizeof(double)*1);
-  status = lefwStartNoiseTable(1);
-  CHECK_STATUS(status);
-  status = lefwEdgeRate(20);
-  CHECK_STATUS(status);
-  holder[0] = 3;
-  status = lefwOutputResistance(1, holder);
-  CHECK_STATUS(status);
-  holder[0] = 10; 
-  status = lefwVictims(25, 1, holder);
-  CHECK_STATUS(status);
-  status = lefwEndNoiseTable();
-  CHECK_STATUS(status);
-  */
-
-  // CORRECTIONTABLE
-  /* obsolete in 5.4
-  status = lefwStartCorrectTable(1);
-  CHECK_STATUS(status);
-  status = lefwEdgeRate(20);
-  CHECK_STATUS(status);
-  holder[0] = 3;
-  status = lefwOutputResistance(1, holder); // Share the same functions with
-  CHECK_STATUS(status);                     // noisetable
-  holder[0] = 10.5; 
-  status = lefwVictims(25, 1, holder);
-  CHECK_STATUS(status);
-  status = lefwEndCorrectTable();
-  CHECK_STATUS(status);
-  free((char*)holder);
-  */
-
-  // SPACING
-  status = lefwStartSpacing();
-  CHECK_STATUS(status);
-  status = lefwSpacing("CUT01", "CA", 1.5, NULL);
-  CHECK_STATUS(status);
-  status = lefwSpacing("CA", "V1", 1.5, "STACK");
-  CHECK_STATUS(status);
-  status = lefwSpacing("M1", "M1", 3.5, "STACK");
-  CHECK_STATUS(status);
-  status = lefwSpacing("V1", "V2", 1.5, "STACK");
-  CHECK_STATUS(status);
-  status = lefwSpacing("M2", "M2", 3.5, "STACK");
-  CHECK_STATUS(status);
-  status = lefwSpacing("V2", "V3", 1.5, "STACK");
-  CHECK_STATUS(status);
-  status = lefwEndSpacing();
-  CHECK_STATUS(status);
-
-  // MINFEATURE & DIELECTRIC
-  status = lefwMinFeature(0.1, 0.1);
-  CHECK_STATUS(status);
-  /* obsolete in 5.4
-  status = lefwDielectric(0.000345);
-  CHECK_STATUS(status);
-  */
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-
-  // IRDROP
-  /* obsolete in 5.4
-  status = lefwStartIrdrop();
-  CHECK_STATUS(status);
-  status = lefwIrdropTable("DRESHI", "0.0001 -0.7 0.001 -0.8 0.01 -0.9 0.1 -1.0");
-  CHECK_STATUS(status);
-  status = lefwIrdropTable("DRESLO", "0.0001 -1.7 0.001 -1.6 0.01 -1.5 0.1 -1.3");
-  CHECK_STATUS(status);
-  status = lefwIrdropTable("DNORESHI", "0.0001 -0.6 0.001 -0.7 0.01 -0.9 0.1 -1.1");
-  CHECK_STATUS(status);
-  status = lefwIrdropTable("DNORESLO", "0.0001 -1.5 0.001 -1.5 0.01 -1.4 0.1 -1.4");
-  CHECK_STATUS(status);
-  status = lefwEndIrdrop();
-  CHECK_STATUS(status);
-  */
-
-  // SITE
-  status = lefwSite("CORE1", "CORE", "X", 67.2, 6);
-  CHECK_STATUS(status);
-  status = lefwSiteRowPattern("Fsite", 0);
-  CHECK_STATUS(status);
-  status = lefwSiteRowPatternStr("Lsite", "N");
-  CHECK_STATUS(status);
-  status = lefwSiteRowPatternStr("Lsite", "FS");
-  CHECK_STATUS(status);
-  lefwEndSite("CORE1");
-  CHECK_STATUS(status);
-  status = lefwSite("CORE", "CORE", "Y", 3.6, 28.8);
-  CHECK_STATUS(status);
-  lefwEndSite("CORE");
-  CHECK_STATUS(status);
-  status = lefwSite("MRCORE", "CORE", "Y", 3.6, 28.8);
-  CHECK_STATUS(status);
-  lefwEndSite("MRCORE");
-  CHECK_STATUS(status);
-  status = lefwSite("IOWIRED", "PAD", NULL, 57.6, 432);
-  CHECK_STATUS(status);
-  lefwEndSite("IOWIRED");
-  CHECK_STATUS(status);
-
-  // ARRAY
-  status = lefwStartArray("M7E4XXX");
-  CHECK_STATUS(status);
-  status = lefwArraySite("CORE", -5021.450, -4998.000, 0, 14346, 595, 0.700,
-                         16.800);
-  CHECK_STATUS(status);
-  status = lefwArraySiteStr("CORE", -5021.450, -4998.600, "FS", 14346, 595,
-                            0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArraySite("IO", 6148.800, 5800.000, 3, 1, 1, 0.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArraySiteStr("IO", 6148.800, 5240.000, "E", 1, 1, 0.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArraySite("COVER", -7315.0, -7315.000, 1, 1, 1, 0.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArraySiteStr("COVER", 7315.0, 7315.000, "FN", 1, 1, 0.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArrayCanplace("COVER", -7315.000, -7315.000, 0, 1, 1, 0.000,
-                             0.000);
-  CHECK_STATUS(status);
-  status = lefwArrayCanplaceStr("COVER", -7250.000, -7250.000, "N", 5, 1,
-                                40.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArrayCannotoccupy("CORE", -5021.450, -4989.600, 6, 100, 595,
-                                 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArrayCannotoccupyStr("CORE", -5021.450, -4989.600, "N", 100, 595,
-                                 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArrayTracks("X", -6148.800, 17569, 0.700, "RX");
-  CHECK_STATUS(status);
-  status = lefwArrayTracks("Y", -6148.800, 20497, 0.600, "RX");
-  CHECK_STATUS(status);
-  status = lefwStartArrayFloorplan("100%");
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplan("CANPLACE", "COVER", -7315.000, -7315.000, 1, 1,
-                              1, 0.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplanStr("CANPLACE", "COVER", -7250.000, -7250.000,
-                                 "N", 5, 1, 40.000, 0.000);
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplan("CANPLACE", "CORE", -5021.000, -4998.000, 1,
-                              14346, 595, 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplanStr("CANPLACE", "CORE", -5021.000, -4998.000, "FS",
-                                 100, 595, 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplan("CANNOTOCCUPY", "CORE", -5021.000, -4998.000, 7,
-                              14346, 595, 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwArrayFloorplanStr("CANNOTOCCUPY", "CORE", -5021.000, -4998.000,
-                                 "E", 100, 595, 0.700, 16.800);
-  CHECK_STATUS(status);
-  status = lefwEndArrayFloorplan("100%");
-  CHECK_STATUS(status);
-  status = lefwArrayGcellgrid("X", -6157.200, 1467, 8.400);
-  CHECK_STATUS(status);
-  status = lefwArrayGcellgrid("Y", -6157.200, 1467, 8.400);
-  CHECK_STATUS(status);
-  status = lefwEndArray("M7E4XXX");
-  CHECK_STATUS(status);
-
-  // MACRO
-  status = lefwStartMacro("CHK3A");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("RING", NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroFixedMask();
-  CHECK_STATUS(status);
-//  status = lefwMacroSource("USER");  5.6
-//  CHECK_STATUS(status);
-  status = lefwMacroOrigin(0.9, 0.9);
-  CHECK_STATUS(status);
-  status = lefwMacroSize(10.8, 28.8);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X Y R90");
-  CHECK_STATUS(status);
-  status = lefwMacroSite("CORE");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("GND");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INOUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinMustjoin("PA3");
-  CHECK_STATUS(status);
-  status = lefwMacroPinTaperRule("RULE1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("GROUND");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT");
-  CHECK_STATUS(status);
-//  status = lefwMacroPinLEQ("A");  5.6
-//  CHECK_STATUS(status);
-  status = lefwMacroPinSupplySensitivity("vddpin1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinNetExpr("power1 VDD1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalArea(3, "M1");
-  CHECK_STATUS(status);
-  // MACRO - PIN
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-//  status = lefwMacroPinForeign("GROUND", 4, 7, 6);  5.6
-//  CHECK_STATUS(status);
-//  status = lefwMacroPinForeignStr("VSS", 4, 7, "W");  5.6
-//  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0.05);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.9, 3, 9.9, 6, 0, 0, 0, 0, 3); 
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwStringProperty("TYPE", "special");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("intProp", 23);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("realProp", 24.25);
-  CHECK_STATUS(status);
-/* WMD - Comment them out due to mix 5.3 & 5.4 syntax
-  status = lefwMacroPinAntennasize(1, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennasize(2, "M2");
-*/
-  status = lefwMacroPinAntennaModel("OXIDE1");
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("GND");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("VDD");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INOUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("POWER");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT"); 
-  CHECK_STATUS(status);
-  status = lefwMacroPinNetExpr("power2 VDD2");
-  CHECK_STATUS(status);
-  // MACRO - PIN - PORT
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.9, 21, 9.9, 24, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortVia(100, 300, "nd1VIA12", 1, 2, 1, 2, 123);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort("BUMP");
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M2", 0.06);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  xl = (double*)malloc(sizeof(double)*5);
-  yl = (double*)malloc(sizeof(double)*5);
-  xl[0] = 30.8;
-  yl[0] = 30.5;
-  xl[1] = 42;
-  yl[1] = 53.5;
-  xl[2] = 60.8;
-  yl[2] = 25.5;
-  xl[3] = 47;
-  yl[3] = 15.5;
-  xl[4] = 20.8;
-  yl[4] = 0.5;
-  status = lefwStartMacroPinPort("CORE");
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("P1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerPolygon(5, xl, yl, 5, 6, 454.6, 345.6, 2);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerPolygon(5, xl, yl, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  free((char*)xl);
-  free((char*)yl);
-/* WMD - Comment them out due to mix 5.3 & 5.4 syntax
-  status = lefwMacroPinAntennaMetalArea(3, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalArea(4, "M2");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalLength(5, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalLength(6, "M2");
-  CHECK_STATUS(status);
-*/
-  status = lefwEndMacroPin("VDD");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("PA3"); 
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INPUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinNetExpr("gnd1 GND");
-  CHECK_STATUS(status);
-  // 5.4
-  status = lefwMacroPinAntennaPartialMetalArea(4, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialMetalArea(5, "M2");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialMetalSideArea(5, "M2");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaGateArea(1, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaGateArea(2, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaGateArea(3, "M3");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaDiffArea(1, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMaxAreaCar(1, "L1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMaxSideAreaCar(1, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialCutArea(1, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialCutArea(2, "M2");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialCutArea(3, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaPartialCutArea(4, "M4");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMaxCutCar(1, 0);
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort("CORE");
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0.02);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(1.35, -0.45, 2.25, 0.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.45, -0.45, 0.45, 0.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("PC", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.45, 12.15, 0.45, 13.05, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort(); 
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortDesignRuleWidth("PC", 2);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(8.55, 8.55, 9.45, 9.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 6.75, 7.65, 7.65, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 8.75, 7.65, 9.65, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 10.35, 7.65, 11.25, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("PA3"); 
-  CHECK_STATUS(status);
-  // MACRO - OBS
-  status = lefwStartMacroObs();
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayer("M1", 5.6);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerWidth(5.4);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(6.6, -0.6, 9.6, 0.6, 0, 0, 0, 0, 2);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(4.8, 12.9, 9.6, 13.2, 0, 0, 0, 0, 3);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(3, 13.8, 7.8, 16.8, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(3, -0.6, 6, 0.6, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroObs();
-  CHECK_STATUS(status);
-  status = lefwStringProperty("stringProp", "first");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("integerProp", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("WEIGHT", 30.31);
-  CHECK_STATUS(status);
-  status = lefwEndMacro("CHK3A");
-  CHECK_STATUS(status);
-
-  // 2nd MACRO
-  status = lefwStartMacro("INV");
-  CHECK_STATUS(status);
-  status = lefwMacroEEQ("CHK1");
-  CHECK_STATUS(status);
-//  status = lefwMacroLEQ("CHK2");  5.6
-//  CHECK_STATUS(status);
-  status = lefwMacroClass("CORE", "SPACER");
-  CHECK_STATUS(status);
-  status = lefwMacroForeign("INVS", 0, 0, -1);
-  CHECK_STATUS(status);
-  /* obsolete in 5.4
-  status = lefwMacroPower(1.0);
-  CHECK_STATUS(status);
-  */
-  status = lefwMacroSize(67.2, 24);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X Y R90");
-  CHECK_STATUS(status);
-  status = lefwMacroSite("CORE1");
-  CHECK_STATUS(status);
-  status = lefwStartMacroDensity("metal1");
-  CHECK_STATUS(status);
-  status = lefwMacroDensityLayerRect(0, 0, 100, 100, 45.5);
-  CHECK_STATUS(status);
-  status = lefwMacroDensityLayerRect(100, 0, 200, 100, 42.2);
-  CHECK_STATUS(status);
-  status = lefwEndMacroDensity();
-  CHECK_STATUS(status);
-  status = lefwStartMacroDensity("metal2");
-  CHECK_STATUS(status);
-  status = lefwMacroDensityLayerRect(200, 1, 300, 200, 43.3);
-  CHECK_STATUS(status);
-  status = lefwEndMacroDensity();
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("Z");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("OUTPUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("SIGNAL");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT");
-  CHECK_STATUS(status);
-  /* obsolete in 5.4
-  status = lefwMacroPinRisethresh(22);
-  CHECK_STATUS(status);
-  status = lefwMacroPinFallthresh(100);
-  CHECK_STATUS(status);
-  status = lefwMacroPinRisesatcur(4);
-  CHECK_STATUS(status);
-  status = lefwMacroPinFallsatcur(.5);
-  CHECK_STATUS(status);
-  status = lefwMacroPinVLO(0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinVHI(5);
-  CHECK_STATUS(status);
-  status = lefwMacroPinCapacitance(0.08);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPower(0.1);
-  CHECK_STATUS(status);
-  */
-  status = lefwMacroPinAntennaModel("OXIDE1");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M2", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerWidth(5.6);
-  CHECK_STATUS(status);
-  xpath = (double*)malloc(sizeof(double)*7);
-  ypath = (double*)malloc(sizeof(double)*7);
-  xpath[0] = 30.8;
-  ypath[0] = 9;
-  xpath[1] = 42;
-  ypath[1] = 9;
-  xpath[2] = 30.8;
-  ypath[2] = 9;
-  xpath[3] = 42;
-  ypath[3] = 9;
-  xpath[4] = 30.8;
-  ypath[4] = 9;
-  xpath[5] = 42;
-  ypath[5] = 9;
-  xpath[6] = 30.8;
-  ypath[6] = 9;
-  status = lefwMacroPinPortLayerPath(7, xpath, ypath, 0, 0, 0, 0, 2);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("Z"); 
-  free((char*)xpath);
-  free((char*)ypath);
-  // MACRO - TIMING
-  /* obsolete in 5.4
-  status = lefwStartMacroTiming();
-  CHECK_STATUS(status);
-  status = lefwMacroTimingPin("A", "Z");
-  CHECK_STATUS(status);
-  status = lefwMacroTimingIntrinsic("RISE", .39, .41, 1.2, .25, .29, 1.8,
-                                    .67, .87, 2.2, 0.12, 0.13);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingIntrinsic("FALL", .25, .29, 1.3, .26, .31, 1.7,
-                                    .6, .8, 2.1, 0.11, 0.14);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingRisers(83.178, 90.109);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingFallrs(76.246, 97.041);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingRisecs(0.751, 0.751);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingFallcs(0.751, 0.751);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingRiset0(0.65453, 0.65453);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingFallt0(0.38, 0.38);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingRisesatt1(0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingFallsatt1(0.15, 0.15);
-  CHECK_STATUS(status);
-  status = lefwMacroTimingUnateness("INVERT");
-  CHECK_STATUS(status);
-  status = lefwEndMacroTiming();
-  CHECK_STATUS(status);
-  */
-  // MACRO - OBS
-  status = lefwStartMacroObs();
-  CHECK_STATUS(status);
-  status = lefwMacroObsDesignRuleWidth("M1", 2);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(24.1, 1.5, 43.5, 208.5, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  xpath = (double*)malloc(sizeof(double)*2);
-  ypath = (double*)malloc(sizeof(double)*2);
-  xpath[0] = 8.4;
-  ypath[0] = 3;
-  xpath[1] = 8.4;
-  ypath[1] = 124;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0, 2);
-  CHECK_STATUS(status);
-  xpath[0] = 58.8;
-  ypath[0] = 3;
-  xpath[1] = 58.8;
-  ypath[1] = 123;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0, 3);
-  CHECK_STATUS(status);
-  xpath[0] = 64.4;
-  ypath[0] = 3;
-  xpath[1] = 64.4;
-  ypath[1] = 123;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  free((char*)xpath);
-  free((char*)ypath);
-  xl = (double*)malloc(sizeof(double)*5);
-  yl = (double*)malloc(sizeof(double)*5);
-  xl[0] = 6.4;
-  xl[1] = 3.4;
-  xl[2] = 5.4;
-  xl[3] = 8.4;
-  xl[4] = 9.4;
-  yl[0] = 9.2;
-  yl[1] = 0.2;
-  yl[2] = 7.2;
-  yl[3] = 8.2;
-  yl[4] = 1.2;
-  status = lefwMacroObsLayerPolygon(5, xl, yl, 0, 0, 0, 0, 3);
-  CHECK_STATUS(status);
-  free((char*)xl);
-  free((char*)yl);
-  status = lefwEndMacroObs();
-  CHECK_STATUS(status);
-  status = lefwEndMacro("INV");
-  CHECK_STATUS(status);
-
-  // 3rd MACRO
-  status = lefwStartMacro("DFF3");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("CORE", "ANTENNACELL");
-  CHECK_STATUS(status);
-  status = lefwMacroForeignStr("DFF3S", 0, 0, "N");
-  CHECK_STATUS(status);
-  /* obsolete in 5.4
-  status = lefwMacroPower(4.0);
-  CHECK_STATUS(status);
-  */
-  status = lefwMacroSize(67.2, 210);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X Y R90");
-  CHECK_STATUS(status);
-  status = lefwMacroSitePattern("CORE", 34, 54, 7, 30, 3, 1, 1);
-  CHECK_STATUS(status);
-  status = lefwMacroSitePatternStr("CORE1", 21, 68, "S", 30, 3, 2, 2);
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF3");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF4");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("COVER", "BUMP");
-  CHECK_STATUS(status);
-  status = lefwMacroForeignStr("DFF3S", 0, 0, "");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF4");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF5");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("COVER", NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroForeignStr("DFF3S", 0, 0, "");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF5");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF6");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("BLOCK", "BLACKBOX");
-  CHECK_STATUS(status);
-  status = lefwMacroForeignStr("DFF3S", 0, 0, "");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF6");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF7");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("PAD", "AREAIO");
-  CHECK_STATUS(status);
-  status = lefwMacroForeignStr("DFF3S", 0, 0, "");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF7");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF8");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("BLOCK", "SOFT");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF8");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("DFF9");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("CORE", "WELLTAP");
-  CHECK_STATUS(status);
-  status = lefwEndMacro("DFF9");
-  CHECK_STATUS(status);
-
-  status = lefwStartMacro("myTest");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("CORE", NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroSize(10.0, 14.0);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X");
-  CHECK_STATUS(status);
-  status = lefwMacroSitePatternStr("Fsite", 0, 0, "N", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroSitePatternStr("Fsite", 0, 7.0, "FS", 30, 3, 2, 2);
-  CHECK_STATUS(status);
-  status = lefwMacroSitePatternStr("Fsite", 4.0, 0, "N", 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacro("myTest");
-  CHECK_STATUS(status);
-
-  // ANTENNA, this will generate error for 5.4 since I already have ANTENNA
-  // somewhere
-  status = lefwAntenna("INPUTPINANTENNASIZE", 1);
-  CHECK_STATUS(status);
-  status = lefwAntenna("OUTPUTPINANTENNASIZE", -1);
-  CHECK_STATUS(status);
-  status = lefwAntenna("INOUTPINANTENNASIZE", -1);
-  CHECK_STATUS(status);
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-
-  // BEGINEXT
-  status = lefwStartBeginext("SIGNATURE");
-  CHECK_STATUS(status);
-  lefwAddIndent();
-  status = lefwBeginextCreator("CADENCE");
-  CHECK_STATUS(status);
-  // since the date is different each run,
-  // comment it out, so the quick test will not fail
-  // status = lefwBeginextDate(); 
-  // CHECK_STATUS(status);
-  status = lefwEndBeginext();
-  CHECK_STATUS(status);
-
-  status = lefwEnd();
-  CHECK_STATUS(status);
-
-  lineNum = lefwCurrentLineNumber();
-  if (lineNum == 0)
-     fprintf(stderr, "ERROR: Nothing has been written!!!\n");
-
-  fclose(fout);
-
-  return 0;
-}
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwriteCbs.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwriteCbs.cpp
deleted file mode 100644
index 75c5cc5..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefwrite/lefwriteCbs.cpp
+++ /dev/null
@@ -1,997 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author$
-//  $Revision$
-//  $Date$
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "lefwWriter.hpp"
-#include "lefwWriterCalls.hpp"
-
-// Global variables
-char  defaultOut[128];
-FILE* fout;
-int   userData;
-
-#define CHECK_STATUS(status) \
-  if (status) {              \
-     lefwPrintError(status); \
-     return(status);         \
-  }
-
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
-
-void checkType(lefwCallbackType_e c) {
-  if (c >= 0 && c <= lefwEndLibCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-int versionCB(lefwCallbackType_e c, lefiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = lefwVersion(5, 6);
-  CHECK_STATUS(status);
-  return 0;
-}
-
-int busBitCharsCB(lefwCallbackType_e c, lefiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = lefwBusBitChars("<>");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-int dividerCB(lefwCallbackType_e c, lefiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = lefwDividerChar(":");
-  CHECK_STATUS(status);
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// UNITS
-int unitsCB(lefwCallbackType_e c, lefiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = lefwStartUnits();
-  CHECK_STATUS(status);
-  status = lefwUnits(100, 10, 10000, 10000, 10000, 1000, 0);
-  CHECK_STATUS(status);
-  status = lefwEndUnits();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// PROPERTYDEFINITIONS
-int propDefCB(lefwCallbackType_e c, lefiUserData ud) {
-  int status;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  status = lefwStartPropDef();
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("LIBRARY", "NAME", 0, 0, "Cadence96");
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("LIBRARY", "intNum", 0, 0, 20);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("LIBRARY", "realNum", 0, 0, 21.22);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("PIN", "TYPE", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("PIN", "intProp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("PIN", "realProp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("MACRO", "stringProp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("MACRO", "integerProp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("MACRO", "WEIGHT", 1.0, 100.0, NULL);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("VIA", "stringProperty", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("VIA", "realProp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("VIA", "COUNT", 1, 100, NULL);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("LAYER", "lsp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("LAYER", "lip", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("LAYER", "lrp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("VIARULE", "vrsp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("VIARULE", "vrip", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("VIARULE", "vrrp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwStringPropDef("NONDEFAULTRULE", "ndrsp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwIntPropDef("NONDEFAULTRULE", "ndrip", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwRealPropDef("NONDEFAULTRULE", "ndrrp", 0, 0, NULL);
-  CHECK_STATUS(status);
-  status = lefwEndPropDef();
-  return 0;
-}
-
-// LAYERS
-int layerCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-  double *current;
-
-  checkType(c);
-  if ((int)ud != userData) dataError();
-  current = (double*)malloc(sizeof(double)*15);
-
-  status = lefwStartLayer("POLYS", "MASTERSLICE");
-  CHECK_STATUS(status);
-  status = lefwStringProperty("lsp", "top");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("lip", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("lrp", 2.3);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("POLYS");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("CUT01", "CUT");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CUT01");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("RX");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(0.75);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingOffset(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacingRange(0.1, 9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.103");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000156");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingHeight(9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingThickness(1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingShrinkage(0.1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingEdgeCap(0.00005);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingAntennaArea(1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingAntennaLength(1);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("PEAK", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  current[2] = 400E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.4;
-  current[1] = 0.8;
-  current[2] = 10.0;
-  current[3] = 50.0;
-  current[4] = 100.0;
-  status = lefwLayerACWidth(5, current);
-  CHECK_STATUS(status);
-  current[0] = 2.0E-6;
-  current[1] = 1.9E-6;
-  current[2] = 1.8E-6;
-  current[3] = 1.7E-6;
-  current[4] = 1.5E-6;
-  current[5] = 1.4E-6;
-  current[6] = 1.3E-6;
-  current[7] = 1.2E-6;
-  current[8] = 1.1E-6;
-  current[9] = 1.0E-6;
-  current[10] = 0.9E-6;
-  current[11] = 0.8E-6;
-  current[12] = 0.7E-6;
-  current[13] = 0.6E-6;
-  current[14] = 0.4E-6;
-  status = lefwLayerACTableEntries(15, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  current[2] = 400E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  current[2] = 0.4E-6;
-  status = lefwLayerACTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("RMS", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 400E6;
-  current[2] = 800E6;
-  status = lefwLayerACFrequency(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.4;
-  current[1] = 0.8;
-  current[2] = 10.0;
-  current[3] = 50.0;
-  current[4] = 100.0;
-  status = lefwLayerACWidth(5, current);
-  CHECK_STATUS(status);
-  current[0] = 2.0E-6;
-  current[1] = 1.9E-6;
-  current[2] = 1.8E-6;
-  current[3] = 1.7E-6;
-  current[4] = 1.5E-6;
-  current[5] = 1.4E-6;
-  current[6] = 1.3E-6;
-  current[7] = 1.2E-6;
-  current[8] = 1.1E-6;
-  current[9] = 1.0E-6;
-  current[10] = 0.9E-6;
-  current[11] = 0.8E-6;
-  current[12] = 0.7E-6;
-  current[13] = 0.6E-6;
-  current[14] = 0.4E-6;
-  status = lefwLayerACTableEntries(15, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("RX");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("CUT12", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("PEAK", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.5E-6;
-  current[1] = 0.4E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 1E6;
-  current[1] = 100E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwLayerACCurrentDensity("RMS", 0);
-  CHECK_STATUS(status);
-  current[0] = 100E6;
-  current[1] = 800E6;
-  status = lefwLayerACFrequency(2, current);
-  CHECK_STATUS(status);
-  current[0] = 0.5E-6;
-  current[1] = 0.4E-6;
-  status = lefwLayerACTableEntries(2, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CUT12");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("PC");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(0.4);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("PWL ( ( 1 0.103 ) )");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("PWL ( ( 1 0.000156 ) ( 10 0.001 ) )");
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 20.0;
-  current[1] = 50.0;
-  current[2] = 100.0;
-  status = lefwLayerDCWidth(3, current);
-  CHECK_STATUS(status);
-  current[0] = 1.0E-6;
-  current[1] = 0.7E-6;
-  current[2] = 0.5E-6;
-  status = lefwLayerDCTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("PC");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("CA", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayerDCCurrentDensity("AVERAGE", 0);
-  CHECK_STATUS(status);
-  current[0] = 2.0;
-  current[1] = 5.0;
-  current[2] = 10.0;
-  status = lefwLayerDCWidth(3, current);
-  CHECK_STATUS(status);
-  current[0] = 0.6E-6;
-  current[1] = 0.5E-6;
-  current[2] = 0.4E-6;
-  status = lefwLayerDCTableEntries(3, current);
-  CHECK_STATUS(status);
-  status = lefwEndLayer("CA");
-  CHECK_STATUS(status);
-  free((char*)current);
-
-  status = lefwStartLayerRouting("M1");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 1);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.6);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(7);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.103");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000156");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M1");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V1", "CUT");
-  CHECK_STATUS(status);
-  status = lefwLayer(0.6, "CA");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V1");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("M2");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("VERTICAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V2", "CUT");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V2");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("M3");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("HORIZONTAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingWireExtension(8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("M3");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("V3", "CUT");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("V3");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayerRouting("MT");
-  CHECK_STATUS(status);
-  status = lefwLayerRouting("VERTICAL", 0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingPitch(1.8);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingSpacing(0.9);
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingResistance("0.0608");
-  CHECK_STATUS(status);
-  status = lefwLayerRoutingCapacitance("0.000184");
-  CHECK_STATUS(status);
-  status = lefwEndLayerRouting("MT");
-  CHECK_STATUS(status);
-
-  status = lefwStartLayer("OVERLAP", "OVERLAP");
-  CHECK_STATUS(status);
-  status = lefwEndLayer("OVERLAP");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// VIA
-int viaCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwStartVia("RX_PC", "DEFAULT");
-  CHECK_STATUS(status);
-  status = lefwViaResistance(2);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("RX");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.7, -0.7, 0.7, 0.7);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT12");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.25, -0.25, 0.25, 0.25);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("PC");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.6, -0.6, 0.6, 0.6);
-  CHECK_STATUS(status);
-  status = lefwStringProperty("stringProperty", "DEFAULT");
-  CHECK_STATUS(status);
-  status = lefwRealProperty("realProperty", 32.33);
-  CHECK_STATUS(status);
-  status = lefwIntProperty("COUNT", 34);
-  CHECK_STATUS(status);
-  status = lefwEndVia("RX_PC");
-  CHECK_STATUS(status);
-
-  status = lefwStartVia("M2_M3_PWR", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaResistance(0.4);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("M2");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("V2");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, -0.45, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(0.45, -1.35, 1.35, -0.45);
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(0.45, 0.45, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("M3");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.35, -1.35, 1.35, 1.35);
-  CHECK_STATUS(status);
-  status = lefwEndVia("M2_M3_PWR");
-  CHECK_STATUS(status);
-
-  status = lefwStartVia("IN1X", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT01");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-0.45, -0.45, 0.45, 0.45);
-  CHECK_STATUS(status);
-  status = lefwIntProperty("COUNT", 1);
-  CHECK_STATUS(status);
-  status = lefwEndVia("IN1X");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// VIARULE
-int viaRuleCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwStartViaRule("VIALIST12");
-  CHECK_STATUS(status);
-  lefwAddComment("Break up the old lefwViaRule into 2 routines");
-  lefwAddComment("lefwViaRuleLayer and lefwViaRuleVia");
-  status = lefwViaRuleLayer("M1", NULL, 9.0, 9.6, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleLayer("M2", NULL, 3.0, 3.0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleVia("VIACENTER12");
-  CHECK_STATUS(status);
-  status = lefwStringProperty("vrsp", "new");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("vrip", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("vrrp", 4.5);
-  CHECK_STATUS(status);
-  status = lefwEndViaRule("VIALIST12");
-  CHECK_STATUS(status);
-
-  // VIARULE with GENERATE
-  lefwAddComment("Break up the old lefwViaRuleGenearte into 4 routines");
-  lefwAddComment("lefwStartViaRuleGen, lefwViaRuleGenLayer,");
-  lefwAddComment("lefwViaRuleGenLayer3, and lefwEndViaRuleGen");
-  status = lefwStartViaRuleGen("VIAGEN12");
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer("M1", NULL, 0.1, 19, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer("M2", NULL, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwViaRuleGenLayer3("V1", -0.8, -0.8, 0.8, 0.8, 5.6, 6.0, 0.2);
-  CHECK_STATUS(status);
-  status = lefwEndViaRuleGen("VIAGEN12");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-  // NONDEFAULTRULE
-int nonDefaultCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwStartNonDefaultRule("RULE1"); 
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("RX", 10.0, 2.2, 6, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("PC", 10.0, 2.2, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwNonDefaultRuleLayer("M1", 10.0, 2.2, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwStartVia("nd1VARX0", NULL);
-  CHECK_STATUS(status);
-  status = lefwViaResistance(0.2);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("RX");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("CUT12");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-1.0, -1.0, 1.0, 1.0);
-  CHECK_STATUS(status);
-  status = lefwViaLayer("PC");
-  CHECK_STATUS(status);
-  status = lefwViaLayerRect(-3, -3, 3, 3);
-  CHECK_STATUS(status);
-  status = lefwEndVia("nd1VARX0");
-  CHECK_STATUS(status);
-  status = lefwEndNonDefaultRule("RULE1"); 
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// MINFEATURE & DIELECTRIC
-int minFeatureCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwMinFeature(0.1, 0.1);
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// SITE
-int siteCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwSite("CORE1", "CORE", "X", 67.2, 6);
-  CHECK_STATUS(status);
-  status = lefwSiteRowPattern("Fsite", 0);
-  CHECK_STATUS(status);
-  status = lefwSiteRowPatternStr("Lsite", "N");
-  CHECK_STATUS(status);
-  status = lefwSiteRowPatternStr("Lsite", "FS");
-  CHECK_STATUS(status);
-  lefwEndSite("CORE1");
-  CHECK_STATUS(status);
-  status = lefwSite("CORE", "CORE", "Y", 3.6, 28.8);
-  CHECK_STATUS(status);
-  lefwEndSite("CORE");
-  CHECK_STATUS(status);
-  status = lefwSite("MRCORE", "CORE", "Y", 3.6, 28.8);
-  CHECK_STATUS(status);
-  lefwEndSite("MRCORE");
-  CHECK_STATUS(status);
-  status = lefwSite("IOWIRED", "PAD", NULL, 57.6, 432);
-  CHECK_STATUS(status);
-  lefwEndSite("IOWIRED");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// MACRO
-int macroCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-  double *xpath;
-  double *ypath;
-
-  checkType(c);
-  status = lefwStartMacro("CHK3A");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("RING", NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroOrigin(0.9, 0.9);
-  CHECK_STATUS(status);
-  status = lefwMacroSize(10.8, 28.8);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X Y R90");
-  CHECK_STATUS(status);
-  status = lefwMacroSite("CORE");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("GND");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INOUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinTaperRule("RULE1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("GROUND");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT");
-  CHECK_STATUS(status);
-  // MACRO - PIN
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.9, 3, 9.9, 6, 0, 0, 0, 0); 
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwStringProperty("TYPE", "special");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("intProp", 23);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("realProp", 24.25);
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennasize(1, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennasize(2, "M2");
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("GND");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("VDD");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INOUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("POWER");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT"); 
-  CHECK_STATUS(status);
-  // MACRO - PIN - PORT
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.9, 21, 9.9, 24, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalArea(3, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalArea(4, "M2");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalLength(5, "M1");
-  CHECK_STATUS(status);
-  status = lefwMacroPinAntennaMetalLength(6, "M2");
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("VDD");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("PA3"); 
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("INPUT");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(1.35, -0.45, 2.25, 0.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.45, -0.45, 0.45, 0.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("PC", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(-0.45, 12.15, 0.45, 13.05, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort(); 
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("PC", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(8.55, 8.55, 9.45, 9.45, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 6.75, 7.65, 7.65, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 8.75, 7.65, 9.65, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayerRect(6.75, 10.35, 7.65, 11.25, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("PA3"); 
-  CHECK_STATUS(status);
-  // MACRO - OBS
-  status = lefwStartMacroObs();
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(6.6, -0.6, 9.6, 0.6, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(4.8, 12.9, 9.6, 13.2, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(3, 13.8, 7.8, 16.8, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(3, -0.6, 6, 0.6, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroObs();
-  CHECK_STATUS(status);
-  status = lefwStringProperty("stringProp", "first");
-  CHECK_STATUS(status);
-  status = lefwIntProperty("integerProp", 1);
-  CHECK_STATUS(status);
-  status = lefwRealProperty("WEIGHT", 30.31);
-  CHECK_STATUS(status);
-  status = lefwEndMacro("CHK3A");
-  CHECK_STATUS(status);
-
-  // 2nd MACRO
-  status = lefwStartMacro("INV");
-  CHECK_STATUS(status);
-  status = lefwMacroClass("CORE", NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroForeign("INVS", 0, 0, -1);
-  CHECK_STATUS(status);
-  status = lefwMacroSize(67.2, 24);
-  CHECK_STATUS(status);
-  status = lefwMacroSymmetry("X Y R90");
-  CHECK_STATUS(status);
-  status = lefwMacroSite("CORE1");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPin("Z");
-  CHECK_STATUS(status);
-  status = lefwMacroPinDirection("OUTPUT");
-  CHECK_STATUS(status);
-  status = lefwMacroPinUse("SIGNAL");
-  CHECK_STATUS(status);
-  status = lefwMacroPinShape("ABUTMENT");
-  CHECK_STATUS(status);
-  status = lefwStartMacroPinPort(NULL);
-  CHECK_STATUS(status);
-  status = lefwMacroPinPortLayer("M2", 5.6);
-  CHECK_STATUS(status);
-  xpath = (double*)malloc(sizeof(double)*7);
-  ypath = (double*)malloc(sizeof(double)*7);
-  xpath[0] = 30.8;
-  ypath[0] = 9;
-  xpath[1] = 42;
-  ypath[1] = 9;
-  xpath[2] = 30.8;
-  ypath[2] = 9;
-  xpath[3] = 42;
-  ypath[3] = 9;
-  xpath[4] = 30.8;
-  ypath[4] = 9;
-  xpath[5] = 42;
-  ypath[5] = 9;
-  xpath[6] = 30.8;
-  ypath[6] = 9;
-  status = lefwMacroPinPortLayerPath(7, xpath, ypath, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  status = lefwEndMacroPinPort();
-  CHECK_STATUS(status);
-  status = lefwEndMacroPin("Z"); 
-  free((char*)xpath);
-  free((char*)ypath);
-  // MACRO - OBS
-  status = lefwStartMacroObs();
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayer("M1", 0);
-  CHECK_STATUS(status);
-  status = lefwMacroObsLayerRect(24.1, 1.5, 43.5, 208.5, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  xpath = (double*)malloc(sizeof(double)*2);
-  ypath = (double*)malloc(sizeof(double)*2);
-  xpath[0] = 8.4;
-  ypath[0] = 3;
-  xpath[1] = 8.4;
-  ypath[1] = 124;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  xpath[0] = 58.8;
-  ypath[0] = 3;
-  xpath[1] = 58.8;
-  ypath[1] = 123;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  xpath[0] = 64.4;
-  ypath[0] = 3;
-  xpath[1] = 64.4;
-  ypath[1] = 123;
-  status = lefwMacroObsLayerPath(2, xpath, ypath, 0, 0, 0, 0);
-  CHECK_STATUS(status);
-  free((char*)xpath);
-  free((char*)ypath);
-  status = lefwEndMacroObs();
-  CHECK_STATUS(status);
-  status = lefwEndMacro("INV");
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// ANTENNA
-int antennaCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwAntenna("INPUTPINANTENNASIZE", 1);
-  CHECK_STATUS(status);
-  status = lefwAntenna("OUTPUTPINANTENNASIZE", -1);
-  CHECK_STATUS(status);
-  status = lefwAntenna("INOUTPINANTENNASIZE", -1);
-  CHECK_STATUS(status);
-  status = lefwNewLine();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-// BEGINEXT
-int extCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwStartBeginext("SIGNATURE");
-  CHECK_STATUS(status);
-  status = lefwBeginextCreator("CADENCE");
-  CHECK_STATUS(status);
-  status = lefwBeginextDate(); 
-  CHECK_STATUS(status);
-  status = lefwEndBeginext();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-int endLibCB(lefwCallbackType_e c, lefiUserData ud) {
-  int    status;
-
-  checkType(c);
-  status = lefwEnd();
-  CHECK_STATUS(status);
-  return 0;
-}
-
-main(int argc, char** argv) {
-  char* outfile;
-  int   status;    // return code, if none 0 means error
-  int   res;
-
-  // assign the default
-  strcpy(defaultOut, "lef.in");
-  outfile  = defaultOut;
-  fout     = stdout;
-  userData = 0x01020304;
-
-  double* axis;
-  double* num1;
-  double* num2;
-  double* num3;
-
-  int     encrypt = 0; // if user wants encrypted output
-
-  argc--;
-  argv++;
-  while (argc--) {
-     if (strcmp(*argv, "-o") == 0) {   // output filename
-        argv++;
-        argc--;
-        outfile = *argv;
-        if ((fout = fopen(outfile, "w")) == 0) {
-           fprintf(stderr, "ERROR: could not open output file\n");
-           return 2;
-        }
-     } else if (strncmp(*argv,  "-h", 2) == 0) {  // compare with -h[elp]
-        fprintf(stderr, "Usage: lefwrite [-o <filename>] [-help] [-e]\n");
-        return 1;
-     } else if (strcmp(*argv, "-e") == 0) { // user wants to write out encrpyted
-        encrypt = 1;
-     } else {
-        fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-        return 2;
-     }
-     argv++;
-  }
-
-  // initalize
-  // status = lefwInit(fout);
-  // CHECK_STATUS(status);
-  status = lefwInitCbk(fout);
-  CHECK_STATUS(status);
-
-  if (encrypt) {
-     // user wants encrypted output, make sure to call lefwCloseEncrypt()
-     // before calling fclose();
-     status = lefwEncrypt();
-     CHECK_STATUS(status);
-  }
-
-  // set the callback functions
-  lefwSetAntennaCbk(antennaCB);
-  lefwSetBusBitCharsCbk(busBitCharsCB);
-  lefwSetDividerCharCbk(dividerCB);
-  lefwSetEndLibCbk(endLibCB);
-  lefwSetExtCbk(extCB);
-  lefwSetLayerCbk(layerCB);
-  lefwSetMacroCbk(macroCB);
-  lefwSetMinFeatureCbk(minFeatureCB);
-  lefwSetNonDefaultCbk(nonDefaultCB);
-  lefwSetPropDefCbk(propDefCB);
-  lefwSetSiteCbk(siteCB);
-  lefwSetUnitsCbk(unitsCB);
-  lefwSetUserData((void*)3);
-  lefwSetVersionCbk(versionCB);
-  lefwSetViaCbk(viaCB);
-  lefwSetViaRuleCbk(viaRuleCB);
-
-  res = lefwWrite(fout, outfile, (void*)userData);
-
-  if (encrypt) {
-     // output has been written in encrypted, need to close the encrypted
-     // buffer
-     status = lefwCloseEncrypt();
-     CHECK_STATUS(status);
-  }
-
-  fclose(fout);
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.cpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.cpp
deleted file mode 100644
index fc9498b..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "zlib.h"
-#include "lefzlib.hpp"
-#include "lefrReader.hpp"
-
-/*
- * Private functions:
- */
-size_t lefGZip_read(FILE* file, char* buf, size_t len) {
-  return (gzread((gzFile)file, buf, len));
-}
-
-/*
- * Public functions:
- */
-lefGZFile 
-lefGZipOpen(const char *gzipPath, const char* mode) {
-
-  if (!gzipPath)
-    return NULL;
-
-  lefGZFile fptr = gzopen(gzipPath, mode);
-  if (fptr) {
-    /* successfully open the gzip file */
-    /* set the read function to read from a compressed file */
-    lefrSetReadFunction(lefGZip_read);
-    return (lefGZFile)fptr;
-  } else
-    return NULL;
-}
-
-int lefGZipClose(lefGZFile filePtr) {
-  lefrUnsetReadFunction();
-  return (gzclose((gzFile)filePtr));
-}
-
-int lefrReadGZip(lefGZFile file, const char* gzipFile, lefiUserData uData) {
-  return lefrRead((FILE*)file, gzipFile, uData);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.hpp b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.hpp
deleted file mode 100644
index ff71054..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/lefzlib/lefzlib.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// *****************************************************************************
-// *****************************************************************************
-// Copyright 2012, Cadence Design Systems
-// 
-// This  file  is  part  of  the  Cadence  LEF/DEF  Open   Source
-// Distribution,  Product Version 5.8. 
-// 
-// 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
-// 
-//        http://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.
-// 
-// For updates, support, or to become part of the LEF/DEF Community,
-// check www.openeda.org for details.
-// 
-//  $Author: dell $
-//  $Revision: #1 $
-//  $Date: 2017/06/06 $
-//  $State:  $
-// *****************************************************************************
-// *****************************************************************************
-
-#ifndef LEFZLIB_H
-
-typedef void* lefGZFile;
-
-/* 
- * Name: lefGZipOpen
- * Description: Open a gzip file
- * Returns: A file pointer
- */
-extern lefGZFile lefGZipOpen(const char* gzipFile, const char* mode);
-
-/* 
- * Name: lefGZipClose
- * Description: Close a gzip file
- * Returns: 0 if no errors
- */
-extern int lefGZipClose(lefGZFile filePtr);
-
-/*
- * Name: lefrReadGZip
- * Description: Parse a lef gzip file
- * Returns: 0 if no errors
- */
-extern int lefrReadGZip(lefGZFile file, const char* gzipFile, void* uData);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/template.mk b/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/template.mk
deleted file mode 100644
index 8411dab..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lef/5.8-p029/template.mk
+++ /dev/null
@@ -1,94 +0,0 @@
-SHELL=/bin/sh
-
-OS_TYPE	:= $(shell uname -s)
-ifeq ($(OS_TYPE),AIX)
-    ARCH=ibmrs
-    CXX=/usr/bin/xlC_r -+ -Dibmrs
-    CC=/usr/bin/cc_r -Dibmrs
-endif
-ifeq ($(OS_TYPE),HP-UX)
-    ARCH=hppa
-    CXX=/opt/aCC/bin/aCC
-    CXXFLAGS=+DAportable -AA
-    BIN_LINK_FLAGS=-lPW
-endif
-
-ifeq ($(OS_TYPE),SunOS)
-    ARCH=sun4v
-    CXX=CC
-    CXXFLAGS=-g
-endif
-
-ifeq ($(OS_TYPE),Linux)
-    ARCH=lnx86 
-    CXX=g++
-    CC=gcc
-endif
-
-.SUFFIXES: $(SUFFIXES) .cpp
-
-
-TMP1	=	$(LIBSRCS:.cpp=.o)
-TMP2	=	$(TMP1:.cc=.o)
-LIBOBJS =	$(TMP2:.c=.o)
-
-TMP3	=	$(BINSRCS:.cpp=.o)
-TMP4	=	$(TMP3:.cc=.o)
-BINOBJS =	$(TMP4:.c=.o)
-
-all: $(LIBTARGET) $(BINTARGET)
-
-ifdef BINTARGET
-INSTALLED_BIN = ../bin/$(BINTARGET)
-endif
-
-
-$(INSTALLED_BIN): $(BINTARGET)
-	@mkdir -p ../bin
-	@echo $< =\> $@
-	@rm -f $(INSTALLED_BIN)
-	@cp $(BINTARGET) $(INSTALLED_BIN)
-
-installbin: $(INSTALLED_BIN)
-
-ifdef LIBTARGET
-INSTALLED_LIB = ../lib/$(LIBTARGET)
-endif
-
-
-$(INSTALLED_LIB): $(LIBTARGET)
-	@mkdir -p ../lib
-	@echo $< =\> $@
-	@rm -f $(INSTALLED_LIB)
-	@cp $(LIBTARGET) $(INSTALLED_LIB)
-
-installlib: $(INSTALLED_LIB)
-
-install release: all installhdrs installlib installbin
-
-INSTALLED_HDRS = $(PUBLIC_HDRS:%=../include/%)
-$(INSTALLED_HDRS):	../include/%:	%
-	@mkdir -p ../include
-	@echo $< =\> $@
-	@rm -f $@
-	@cp -p $< $@
-
-installhdrs: $(INSTALLED_HDRS)
-
-.cpp.o:
-	$(COMPILE.cc) -I../include $<
-
-.c.o:
-	$(COMPILE.c) -I../include $<
-
-$(LIBTARGET): $(LIBOBJS)
-	rm -f $(LIBTARGET)
-	$(AR) $(ARFLAGS) $(LIBTARGET) $^
-
-$(BINTARGET): $(BINOBJS) $(LIBTARGET) $(LDLIBS)
-	rm -f $(BINTARGET)
-	$(LINK.cc) -o $(BINTARGET) $(BINOBJS) $(LIBTARGET) $(LDLIBS) $(BIN_LINK_FLAGS)
-
-clean doclean:
-	rm -f $(LIBTARGET) $(LIBOBJS) $(BINTARGET) $(BINOBJS) $(INSTALLED_LIB) \
-			$(INSTALLED_BIN) $(INSTALLED_HDRS) lef.tab.c* lef.tab.h
diff --git a/scripts/pdn/src/PdnPinDumper/module/lefdefReadme.txt b/scripts/pdn/src/PdnPinDumper/module/lefdefReadme.txt
deleted file mode 100644
index b303301..0000000
--- a/scripts/pdn/src/PdnPinDumper/module/lefdefReadme.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-This directory contains the the 5.8 version of Library Exchange Format (LEF) and Design
-Exchange Format (DEF). LEF and DEF are distributed free of charge. See the
-License.txt file in the LEF and DEF modules for conditions attached to the use of this
-software, and the copying or distribution of it.
-
-The Make programs for some systems may not be able to process the Makefile for the
-LEF/DEF utilities. If your system's native Make program returns errors when building
-LEF/DEF, use GNU Make, or change the Makefiles so that they work on your system.
-
-Mixing 5.4, 5.5, 5.6 and 5.7 Syntax with 5.8 Syntax
-
-Use caution when mixing versions 5.4, 5.5, 5.6, and 5.7 syntax in LEF and DEF files. If you
-include obsolete 5.4, 5.5, 5.6 and 5.7 constructs in a 5.8 file, the reader generates a warning.
-
-Documentation
-
-Documentation for the LEF and DEF application programming interfaces can be found in
-the lef/doc and def/doc subdirectories, but it has not yet been updated with the
-changes required for the new 5.8 syntax. Please contact Cadence for the version of 
-the LEF/DEF 5.8 syntax.
-
-Bug Reporting
-
-Please report issues with this version of the LEF/DEF 5.8 parser directly to Cadence.
-Email mguiney@cadence.com
-
-Platforms Supported
-
-The LEF/DEF utilities have been tested on Linux RH 5.5. They should also work on Solaris 5.10.
-
-Installation
-
-The following information explains how to compile the LEF and DEF packages.
-
-Installing LEF 
-
-To install LEF, do the following:
-
-1. Change directories (cd) to the lef subdirectory containing the package's source code.
-2. To compile and build the package, type the following command:
-gmake
-
-3. To set DEBUG with OPTIMIZE_FLAG, type the following command:
-gmake release
-
-4. To install headers before compiling lefrw lefdiff lefwrite, type the following
-command:
-gmake installhdrs
-
-5. Optionally, to run the tests that come with the package, type the following command:
-./gmake test
-
-NOTE: To remove the program binaries and object files from the source code directory,
-type the following command:
-
-gmake clean
-
-
-Installing DEF
-
-To install DEF, do the following:
-
-1. Change directories (cd) to the def subdirectory containing the package's source code.
-2. To compile and build the package, type the following command:
-gmake
-
-3. To set DEBUG with OPTIMIZE_FLAG, type the following command:
-gmake release
-
-4. To install headers before compiling defrw defdiff defwrite, type the following command:
-gmake installhdrs
-
-5. Optionally, to run the tests that come with the package, type the following command:
-./gmake test
-
-NOTE: To remove the program binaries and object files from the source code directory,
-type the following command:
-
-gmake clean
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/FlexAccessPattern.h b/scripts/pdn/src/PdnPinDumper/src/FlexAccessPattern.h
deleted file mode 100644
index 99bbdd7..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/FlexAccessPattern.h
+++ /dev/null
@@ -1,340 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEX_ACCESS_PATTERN_H
-#define _FLEX_ACCESS_PATTERN_H
-
-#include "frBaseTypes.h"
-#include "db/obj/frShape.h"
-#include "db/obj/frVia.h"
-#include <memory>
-
-namespace fr {
-  class FlexAccessPattern: public frBlockObject {
-  public:
-    FlexAccessPattern(): beginPoint(),beginLayerNum(0), pin(nullptr), insts(), 
-                         validAccess(std::vector<bool>(6, false)), accessViaDefs(std::vector<std::vector<frViaDef*> >(2)), 
-                         apCost(std::numeric_limits<int>::max()), nearestAPDist(0), conflict(true), preferred(false) {}
-    FlexAccessPattern(const FlexAccessPattern &in): beginPoint(in.beginPoint), beginLayerNum(in.beginLayerNum),
-                                                    pin(in.pin), net(in.net), insts(in.insts), validAccess(in.validAccess),
-                                                    accessViaDefs(in.accessViaDefs), apCost(in.apCost), nearestAPDist(in.nearestAPDist), 
-                                                    conflict(in.conflict), preferred(in.preferred) {}
-    // deprecated
-    //FlexAccessPattern(const FlexAccessPattern &in, const frTransform &xform) {
-    //  frPoint bpIn, epIn;
-    //  in.getPoints(bpIn, epIn);
-    //  bpIn.transform(xform);
-    //  epIn.transform(xform);
-    //  beginPoint.set(bpIn);
-    //  endPoint.set(epIn);
-    //  beginLayerNum = in.getBeginLayerNum();
-    //  endLayerNum = in.getEndLayerNum();
-    //  //APCost = in.getCost();
-    //  //pathsegs = in.getPathSegs();
-    //  //for (auto pathSeg: in.getPathSegs()) {
-    //  //  pathSeg.move(xform);
-    //  //  pathsegs.push_back(pathSeg);
-    //  //}
-    //  //// vias = in.getVias();
-    //  //for (auto via: in.getVias()) {
-    //  //  via.move(xform);
-    //  //  vias.push_back(via);
-    //  //}
-    //  pin = in.getPin();
-    //  net = in.getNet();
-    //  insts = in.getInsts();
-    //  validAccess = in.getValidAccess();
-    //  accessViaDefs = in.getAccessViaDefs();
-    //}
-
-    // getters
-    //void getPoint(frPoint &in) const {
-    //  in.set(beginPoint);
-    //}
-    void getPoints(frPoint &bpIn, frPoint &epIn) const {
-      bpIn.set(beginPoint);
-      //epIn.set(endPoint);
-    }
-    frLayerNum getBeginLayerNum() const {
-      return beginLayerNum;
-    }
-    //frLayerNum getEndLayerNum() const {
-    //  return endLayerNum;
-    //}
-    //frCost getCost() const {
-    //  return APCost;
-    //}
-    //frList<frPathSeg>& getPathSegs() {
-    //  return pathsegs;
-    //}
-    //const frList<frPathSeg>& getPathSegs() const {
-    //  return pathsegs;
-    //}
-    //frList<frVia>& getVias() {
-    //  return vias;
-    //}
-    //const frList<frVia>& getVias() const {
-    //  return vias;
-    //}
-    frPin* getPin() const {
-      return pin;
-    }
-    frNet* getNet() const {
-      return net;
-    }
-    const std::set<frInst*>& getInsts() const {
-      return insts;
-    }
-    std::set<frInst*>& getInsts() {
-      return insts;
-    }
-
-    const std::vector<bool>& getValidAccess() const {
-      return validAccess;
-    }
-    std::vector<bool>& getValidAccess() {
-      return validAccess;
-    }
-
-    const std::vector<std::vector<frViaDef*> >& getAccessViaDefs() const {
-      return accessViaDefs;
-    }
-    std::vector<std::vector<frViaDef*> >& getAccessViaDefs() {
-      return accessViaDefs;
-    }
-
-    int getCost() {
-      return apCost;
-    }
-
-    frCoord getNearestAPDist() {
-      return nearestAPDist;
-    }
-
-    bool hasInst(frInst* inst) const {
-      return (!(insts.find(inst) == insts.end()));
-    }
-
-    bool hasValidAccess(const frDirEnum &dir) {
-      switch (dir) {
-        case (frDirEnum::E):
-          return validAccess[0];
-          break;
-        case (frDirEnum::S):
-          return validAccess[1];
-          break;
-        case (frDirEnum::W):
-          return validAccess[2];
-          break;
-        case (frDirEnum::N):
-          return validAccess[3];
-          break;
-        case (frDirEnum::U):
-          return validAccess[4];
-          break;
-        case (frDirEnum::D):
-          return validAccess[5];
-          break;
-        default:
-          return false;
-      }
-    }
-
-    bool hasValidAccess() {
-      return (validAccess[0] || validAccess[1] || validAccess[2] || validAccess[3] || validAccess[4] || validAccess[5]);
-    }
-
-    // frViaDef* getAccessViaDef(const frDirEnum &dir) {
-    //   if (dir ==  frDirEnum::U) {
-    //     return accessViaDefs[0];
-    //   } else if (dir == frDirEnum::D) {
-    //     return accessViaDefs[1];
-    //   } else {
-    //     return nullptr;
-    //   }
-    // }
-    bool isConflict() {
-      return conflict;
-    }
-
-    bool isPreferred() {
-      return preferred;
-    }
-
-    std::vector<frViaDef*>& getAccessViaDef(const frDirEnum &dir) {
-      if (dir == frDirEnum::U) {
-        return accessViaDefs[0];
-      } else {
-        return accessViaDefs[1];
-      }
-    }
-    
-    const std::vector<frViaDef*>& getAccessViaDef(const frDirEnum &dir) const {
-      if (dir == frDirEnum::U) {
-        return accessViaDefs[0];
-      } else {
-        return accessViaDefs[1];
-      }
-    }
-
-    // setters
-    void setPoints(const frPoint &bpIn, const frPoint &epIn) {
-      beginPoint.set(bpIn);
-      //endPoint.set(epIn);
-    }
-    void setBeginLayerNum(frLayerNum in) {
-      beginLayerNum = in;
-    }
-    //void setEndLayerNum(frLayerNum in) {
-    //  endLayerNum = in;
-    //}
-    //void setCost(frCost in) {
-    //  APCost = in;
-    //}
-
-    void setValidAccess(const frDirEnum &dir, const bool isValid) {
-      switch (dir) {
-        case (frDirEnum::E):
-          validAccess[0] = isValid;
-          break;
-        case (frDirEnum::S):
-          validAccess[1] = isValid;
-          break;
-        case (frDirEnum::W):
-          validAccess[2] = isValid;
-          break;
-        case (frDirEnum::N):
-          validAccess[3] = isValid;
-          break;
-        case (frDirEnum::U):
-          validAccess[4] = isValid;
-          break;
-        case (frDirEnum::D):
-          validAccess[5] = isValid;
-          break;
-        default:
-          std::cout << "Error: unexpected direction in setValidAccess\n";
-      }
-    }
-
-    // void setAccessViaDef(const frDirEnum dir, frViaDef *viaDef) {
-    //   if (dir == frDirEnum::U) {
-    //     accessViaDefs[0] = viaDef;
-    //   } else if (dir == frDirEnum::D) {
-    //     accessViaDefs[1] = viaDef;
-    //   } else {
-    //     std::cout << "Error: unexpected direction in setAccessVia\n";
-    //   }
-    // }
-
-    void addAccessViaDef(const frDirEnum dir, frViaDef *viaDef) {
-      if (dir == frDirEnum::U) {
-        accessViaDefs[0].push_back(viaDef);
-      } else if (dir == frDirEnum::D) {
-        accessViaDefs[1].push_back(viaDef);
-      } else {
-        std::cout << "Error: unexpected direction in addAccessViaDef\n";
-      }
-    }
-
-
-    //frListIter<frPathSeg> addPathSeg(const frPathSeg &in) {
-    //  pathsegs.push_back(in);
-    //  return (--pathsegs.end());
-    //}
-    //void removePathSeg(frListIter<frPathSeg> &in);
-    //frListIter<frVia> addVia(const frVia &in) {;
-    //  vias.push_back(in);
-    //  return (--vias.end());
-    //}
-    //void removeVia(frListIter<frVia> &in);
-    void addToPin(frPin* in) {
-      pin = in;
-    }
-    void addToNet(frNet* in) {
-      net = in;
-    }
-    void addInst(frInst *inst) {
-      insts.insert(inst);
-    }
-    void addInsts(const std::set<frInst*> &instsIn) {
-      insts.insert(instsIn.begin(), instsIn.end());
-    }
-    virtual frBlockObjectEnum typeId() const override {
-      return frcAccessPattern;
-    }
-    void setCost(int in) {
-      apCost = in;
-    }
-    void setNearestAPDist(frCoord in) {
-      nearestAPDist = in;
-    }
-    void setConflict(bool in) {
-      conflict = in;
-    }
-    void setPreferred(bool in) {
-      preferred = in;
-    }
-
-  protected:
-    frPoint beginPoint;
-    frLayerNum beginLayerNum;
-    frPin* pin;
-    frNet* net;
-    std::set<frInst*>    insts;
-    std::vector<bool> validAccess; // 0 = E, 1 = S, 2 = W, 3 = N, 4 = U, 5 = D
-    // std::vector<frViaDef*> accessViaDefs; // 0 = U, 1 = D
-    std::vector<std::vector<frViaDef*> > accessViaDefs;
-    int apCost;
-    frCoord nearestAPDist;
-    bool conflict, preferred;
-  };
-
-  struct APComp {
-    bool operator()(const std::unique_ptr<FlexAccessPattern> &a, const std::unique_ptr<FlexAccessPattern> &b) {
-      if (a->isPreferred() && !b->isPreferred()) {
-        return true;
-      } else if (!a->isPreferred() && b->isPreferred()) {
-        return false;
-      } else {
-        if (!a->isConflict() && b->isConflict()) {
-          return true;
-        } else if (a->isConflict() && !b->isConflict()) {
-          return false;
-        } else {
-          return (a.get() < b.get());
-        }
-      }
-    }
-  };
-}
-
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/FlexRoute.cpp b/scripts/pdn/src/PdnPinDumper/src/FlexRoute.cpp
deleted file mode 100644
index 2e9eb70..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/FlexRoute.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include "global.h"
-#include "FlexRoute.h"
-#include "io/io.h"
-#include "ta/FlexTA.h"
-#include "dr/FlexDR.h"
-#include "io/frPinPrep.h"
-
-using namespace std;
-using namespace fr;
-
-void FlexRoute::init() {
-  io::Parser parser(getDesign());
-  parser.readLefDef();
-  parser.readGuide();
-  parser.postProcess();
-  // get access pattern for post process
-  FlexPinPrep pp(getDesign()->getTech(), getDesign(), parser.getPrefTrackPatterns(), parser.getTrackOffsetMap());
-  pp.reportPinLoc();
-  exit(0);
-  pp.init();
-  pp.main();
-  std::cout << "finished pinPrep\n" << std::flush;
-  parser.postProcessGuide();
-  //parser.buildRtree4Routes();
-  //parser.buildRtree4Insts();
-  //exit(0);
-}
-
-void FlexRoute::ta() {
-  FlexTA ta(getDesign());
-  ta.main();
-}
-
-void FlexRoute::dr() {
-  FlexDR dr(getDesign());
-  dr.main();
-}
-
-void FlexRoute::endFR() {
-  io::Writer writer(getDesign());
-  writer.writeFromTA();
-  writer.writeFromDR();
-}
-
-int FlexRoute::main() {
-  init();
-  ta();
-  dr();
-  endFR();
-
-
-  /*
-  // rtree test
-  vector<rtree_frConnFig_value_t> result1;
-  design->getTopBlock()->queryRtree4Routes(frBox(585000, 1098000, 590000, 1101000), 6, result1);
-  cout <<endl <<"query1:" <<endl;
-  for (auto &it: result1) {
-    if (it.second->typeId() == frcPathSeg) {
-      frPoint pt1, pt2;
-      dynamic_pointer_cast<frPathSeg>(it.second)->getPoints(pt1, pt2);
-      cout <<"found pathseg " <<pt1.x() <<" " <<pt1.y() <<" " << pt2.x() <<" " <<pt2.y() 
-           <<" " <<dynamic_pointer_cast<frPathSeg>(it.second)->getNet()->getName() <<endl;
-    } else if (it.second->typeId() == frcGuide) {
-      frPoint pt1, pt2;
-      dynamic_pointer_cast<frGuide>(it.second)->getPoints(pt1, pt2);
-      cout <<"found guide   " <<pt1.x() <<" " <<pt1.y() <<" " << pt2.x() <<" " <<pt2.y()
-           <<" " <<dynamic_pointer_cast<frGuide>(it.second)->getNet()->getName();
-      if (dynamic_pointer_cast<frGuide>(it.second)->getBeginLayerNum() !=
-          dynamic_pointer_cast<frGuide>(it.second)->getEndLayerNum()) {
-        cout <<" via guide";
-      }
-      cout <<endl;
-    }
-  }
-  exit(0);
-  */
-  return 0;
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/FlexRoute.h b/scripts/pdn/src/PdnPinDumper/src/FlexRoute.h
deleted file mode 100644
index 1eec2f5..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/FlexRoute.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEXROUTE_H_
-#define _FLEXROUTE_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "frDesign.h"
-
-namespace fr {
-  class FlexRoute {
-  public:
-    FlexRoute(): design(std::make_unique<frDesign>()) {}
-    frDesign* getDesign() const {
-      return design.get();
-    }
-    int main();
-  protected:
-    std::unique_ptr<frDesign> design;
-  
-    void init();
-    //void pinPrep();
-    void ta();
-    void dr();
-    void endFR();
-  };
-}
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/Makefile b/scripts/pdn/src/PdnPinDumper/src/Makefile
deleted file mode 100644
index 2a6c86a..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# subdir and objects in current dir
-#SUBDIRS	= db io ta dr drc
-SUBDIRS	= db io ta dr drc
-#OBJECTS	= main.o
-SRC_DIR := .
-SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp)
-OBJECTS = $(patsubst $(SRC_DIR)/%.cpp, $(SRC_DIR)/%.o, $(SRC_FILES))
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/Makefile
deleted file mode 100644
index b4e8307..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= infra obj tech drObj taObj
-OBJECTS	= 
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/drObj/Makefile
deleted file mode 100644
index dc3aa25..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= drShape.o drVia.o
-#OBJECTS	= 
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drAccessPattern.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drAccessPattern.h
deleted file mode 100644
index ee95232..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drAccessPattern.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_ACCESS_PATTERN_H
-#define _DR_ACCESS_PATTERN_H
-
-#include "db/drObj/drBlockObject.h"
-#include "dr/FlexMazeTypes.h"
-
-namespace fr {
-  class drPin;
-  class frViaDef;
-  class drAccessPattern: public drBlockObject {
-  public:
-    drAccessPattern(): beginPoint(), beginLayerNum(0), pin(nullptr), validAccess(std::vector<bool>(6, true)),
-                       vU(nullptr), vD(nullptr), vUIdx(0), vDIdx(0) {}
-    // getters
-    void getPoint(frPoint &bpIn) const {
-      bpIn.set(beginPoint);
-    }
-    frLayerNum getBeginLayerNum() const {
-      return beginLayerNum;
-    }
-    drPin* getPin() const {
-      return pin;
-    }
-    bool hasMazeIdx() const {
-      return (!mazeIdx.empty());
-    }
-    FlexMazeIdx& getMazeIdx() {
-      return mazeIdx;
-    }
-    void getMazeIdx(FlexMazeIdx &in) const {
-      in.set(mazeIdx);
-    }
-    bool hasValidAccess(const frDirEnum &dir) {
-      switch (dir) {
-        case (frDirEnum::E):
-          return validAccess[0];
-          break;
-        case (frDirEnum::S):
-          return validAccess[1];
-          break;
-        case (frDirEnum::W):
-          return validAccess[2];
-          break;
-        case (frDirEnum::N):
-          return validAccess[3];
-          break;
-        case (frDirEnum::U):
-          return validAccess[4];
-          break;
-        case (frDirEnum::D):
-          return validAccess[5];
-          break;
-        default:
-          return false;
-      }
-    }
-    bool hasAccessViaDef(const frDirEnum &dir = frDirEnum::U) {
-      if (dir ==  frDirEnum::U) {
-        return !(vU == nullptr);
-      } else {
-        return !(vD == nullptr);
-      }
-    }
-    frViaDef* getAccessViaDef(const frDirEnum &dir = frDirEnum::U) {
-      if (dir ==  frDirEnum::U) {
-        return (*vU)[vUIdx];
-      } else {
-        return (*vD)[vDIdx];
-      }
-    }
-    bool nextAccessViaDef(const frDirEnum &dir = frDirEnum::U) {
-      bool sol = true;
-      if (dir ==  frDirEnum::U) {
-        if ((*vU).size() == 1) {
-          sol = false;
-        } else {
-          ++vUIdx;
-          if (vUIdx >= (int)(*vU).size()) {
-            vUIdx -= (int)(*vU).size();
-          }
-        }
-      } else {
-        if ((*vD).size() == 1) {
-          sol = false;
-        } else {
-          ++vDIdx;
-          if (vDIdx >= (int)(*vD).size()) {
-            vDIdx -= (int)(*vD).size();
-          }
-        }
-      }
-      return sol;
-    }
-    bool prevAccessViaDef(const frDirEnum &dir = frDirEnum::U) {
-      bool sol = true;
-      if (dir ==  frDirEnum::U) {
-        if ((*vU).size() == 1) {
-          sol = false;
-        } else {
-          --vUIdx;
-          if (vUIdx < 0) {
-            vUIdx += (int)(*vU).size();
-          }
-        }
-      } else {
-        if ((*vD).size() == 1) {
-          sol = false;
-        } else {
-          --vDIdx;
-          if (vDIdx < 0) {
-            vDIdx += (int)(*vD).size();
-          }
-        }
-      }
-      return sol;
-    }
-    // setters
-    void setPoint(const frPoint &bpIn) {
-      beginPoint.set(bpIn);
-    }
-    void setBeginLayerNum(frLayerNum in) {
-      beginLayerNum = in;
-    }
-    void setMazeIdx(const FlexMazeIdx &in) {
-      mazeIdx.set(in);
-    }
-    void setPin(drPin* in) {
-      pin = in;
-    }
-    void setValidAccess(const std::vector<bool> &in) {
-      validAccess = in;
-    }
-
-    void setAccessViaDef(const frDirEnum dir, std::vector<frViaDef*>* viaDef) {
-      if (dir == frDirEnum::U) {
-        vU = viaDef;
-      } else {
-        vD = viaDef;
-      }
-    }
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcAccessPattern;
-    }
-
-  protected:
-    frPoint                 beginPoint;
-    frLayerNum              beginLayerNum;
-    FlexMazeIdx             mazeIdx;
-    drPin*                  pin;
-    std::vector<bool>       validAccess;
-    std::vector<frViaDef*>* vU;
-    std::vector<frViaDef*>* vD;
-    int                     vUIdx;
-    int                     vDIdx;
-  };
-}
-
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drBlockObject.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drBlockObject.h
deleted file mode 100644
index 2ced47c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drBlockObject.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_BLOCKOBJECT_H_
-#define _DR_BLOCKOBJECT_H_
-
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-
-namespace fr {
-  class drBlockObject: public frBlockObject {
-  public:
-    // constructors
-    drBlockObject() {}
-    virtual ~drBlockObject() {}
-    // getters
-    // setters
-    // others
-    frBlockObjectEnum typeId() const {
-      return drcBlockObject;
-    }
-  protected:
-
-  };
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drFig.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drFig.h
deleted file mode 100644
index 8a30675..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drFig.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_FIG_H_
-#define _DR_FIG_H_
-
-#include <memory>
-#include "db/drObj/drBlockObject.h"
-#include "db/infra/frBox.h"
-#include "db/infra/frTransform.h"
-
-namespace fr {
-  class drFig: public drBlockObject {
-  public:
-    // constructors
-    drFig(): drBlockObject() {}
-    // getters
-    virtual void getBBox(frBox &box) const = 0;
-    //virtual void getBBox(box_t &box) const = 0;
-    // setters
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcFig;
-    }
-  protected:
-  };
-
-  class drNet;
-  class drConnFig: public drFig {
-  public:
-    // constructors
-    drConnFig(): drFig() {}
-    // getters
-    virtual bool hasNet() const = 0;
-    virtual drNet* getNet() const = 0;
-    // setters
-    virtual void addToNet(drNet* in) = 0;
-    virtual void removeFromNet() = 0;
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcConnFig;
-    }
-
-    /* drom drFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-  class drPin;
-  class drPinFig: public drConnFig {
-  public:
-    drPinFig(): drConnFig() {}
-    // getters
-    virtual bool hasPin() const = 0;
-    virtual drPin* getPin() const = 0;
-    // setters
-    virtual void addToPin(drPin* in) = 0;
-    virtual void removeFromPin() = 0;
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcPinFig;
-    }
-
-    /* drom drConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removedromNet
-     */
-
-    /* drom drFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drMarker.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drMarker.h
deleted file mode 100644
index a42819c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drMarker.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_MARKER_H_
-#define _DR_MARKER_H_
-
-#include "db/drObj/drBlockObject.h"
-//#include "db/tech/frConstraint.h"
-
-namespace fr {
-  class frConstraint;
-  class drNet;
-  class drMazeMarker: public drBlockObject {
-  public:
-    // constructors
-    drMazeMarker(): constraint(nullptr), trigNets(), cnt(0) {}
-    // setters
-    void setConstraint(frConstraint* in) {
-      constraint = in;
-    }
-    void addTrigNet(drNet* in) {
-      auto it = trigNets.find(in);
-      if (it == trigNets.end()) {
-        trigNets[in] = 1;
-      } else {
-        ++(trigNets[in]);
-      }
-      cnt++;
-    }
-    bool subTrigNet(drNet* in) {
-      auto it = trigNets.find(in);
-      if (it != trigNets.end()) {
-        if (it->second == 1) {
-          trigNets.erase(it);
-        } else {
-          --(it->second);
-        }
-        --cnt;
-      }
-      return (cnt) ? true : false;
-    }
-    // getters
-    frConstraint* getConstraint() const {
-      return constraint;
-    }
-    drNet* getTrigNet() const {
-      return trigNets.cbegin()->first;
-    }
-    const std::map<drNet*, int>& getTrigNets() const {
-      return trigNets;
-    }
-    std::map<drNet*, int>& getTrigNets() {
-      return trigNets;
-    }
-    int getCnt() const {
-      return cnt;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcMazeMarker;
-    }
-    bool operator< (const drMazeMarker &b) const {
-      //return (constraint == b.constraint) ? (trigNet < b.trigNet) : (constraint < b.constraint);
-      return (constraint < b.constraint);
-    }
-  protected:
-    frConstraint*         constraint;
-    std::map<drNet*, int> trigNets;
-    int                   cnt;
-  };
-}
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drNet.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drNet.h
deleted file mode 100644
index 32fe479..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drNet.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_NET_H_
-#define _DR_NET_H_
-
-#include <memory>
-#include "db/drObj/drBlockObject.h"
-#include "db/drObj/drPin.h"
-#include "db/drObj/drShape.h"
-#include "db/drObj/drVia.h"
-
-namespace fr {
-  class frNet;
-  class drNet: public drBlockObject {
-  public:
-    // constructors
-    drNet(): drBlockObject(), pins(), extConnFigs(), routeConnFigs(), bestRouteConnFigs(),
-             fNet(nullptr), modified(false), numMarkers(0), numPinsIn(0), pinBox(), ripup(false) {}
-    // getters
-    const std::vector<std::unique_ptr<drPin> >& getPins() const {
-      return pins;
-    }
-    std::vector<std::unique_ptr<drPin> >& getPins() {
-      return pins;
-    }
-    const std::vector<std::unique_ptr<drConnFig> >& getExtConnFigs() const {
-      return extConnFigs;
-    }
-    std::vector<std::unique_ptr<drConnFig> >& getExtConnFigs() {
-      return extConnFigs;
-    }
-    const std::vector<std::unique_ptr<drConnFig> >& getRouteConnFigs() const {
-      return routeConnFigs;
-    }
-    std::vector<std::unique_ptr<drConnFig> >& getRouteConnFigs() {
-      return routeConnFigs;
-    }
-    const std::vector<std::unique_ptr<drConnFig> >& getBestRouteConnFigs() const {
-      return bestRouteConnFigs;
-    }
-    std::vector<std::unique_ptr<drConnFig> >& getBestRouteConnFigs() {
-      return bestRouteConnFigs;
-    }
-    frNet* getFrNet() const {
-      return fNet;
-    }
-    bool isModified() const {
-      return modified;
-    }
-    int getNumMarkers() const {
-      return numMarkers;
-    }
-    int getNumPinsIn() const {
-      return numPinsIn;
-    }
-    void getPinBox(frBox &in) {
-      in.set(pinBox);
-    }
-    bool isRipup() const {
-      return ripup;
-    }
-
-    // setters
-    void addPin(std::unique_ptr<drPin> &pinIn) {
-      pinIn->setNet(this);
-      //pinIn->setId(pins.size());
-      pins.push_back(std::move(pinIn));
-    }
-    void addRoute(std::unique_ptr<drConnFig> &in, bool isExt = false) {
-      in->addToNet(this);
-      if (isExt) {
-        extConnFigs.push_back(std::move(in));
-      } else {
-        routeConnFigs.push_back(std::move(in));
-      }
-    }
-    void setBestRouteConnFigs() {
-      for (auto &uConnFig: routeConnFigs) {
-        if (uConnFig->typeId() == drcPathSeg) {
-          std::unique_ptr<drConnFig> uPtr = std::make_unique<drPathSeg>(*static_cast<drPathSeg*>(uConnFig.get()));
-          bestRouteConnFigs.push_back(std::move(uPtr));
-        } else if (uConnFig->typeId() == drcVia) {
-          std::unique_ptr<drConnFig> uPtr = std::make_unique<drVia>(*static_cast<drVia*>(uConnFig.get()));
-          bestRouteConnFigs.push_back(std::move(uPtr));
-        } else if (uConnFig->typeId() == drcPatchWire) {
-          std::unique_ptr<drConnFig> uPtr = std::make_unique<drPatchWire>(*static_cast<drPatchWire*>(uConnFig.get()));
-          bestRouteConnFigs.push_back(std::move(uPtr));
-        }
-      }
-    }
-    void clear() {
-      routeConnFigs.clear();
-    }
-    void setFrNet(frNet* in) {
-      fNet = in;
-    }
-    void setModified(bool in) {
-      modified = in;
-    }
-
-    void setNumMarkers(int in) {
-      numMarkers = in;
-    }
-    void addMarker() {
-      numMarkers++;
-    }
-    void setNumPinsIn(int in) {
-      numPinsIn = in;
-    }
-    void setPinBox(const frBox &in) {
-      pinBox.set(in);
-    }
-    void setRipup() {
-      ripup = true;
-    }
-    void resetRipup() {
-      ripup = false;
-    }
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcNet;
-    }
-
-    bool operator< (const drNet &b) const {
-      return (numMarkers == b.numMarkers) ? (id < b.id) : (numMarkers > b.numMarkers);
-    }
-
-  protected:
-    std::vector<std::unique_ptr<drPin> >         pins;
-    std::vector<std::unique_ptr<drConnFig> >     extConnFigs;
-    std::vector<std::unique_ptr<drConnFig> >     routeConnFigs;
-    std::vector<std::unique_ptr<drConnFig> >     bestRouteConnFigs;
-    frNet*                                       fNet;
-    bool                                         modified;
-    int                                          numMarkers;
-    int                                          numPinsIn;
-    frBox                                        pinBox;
-    bool                                         ripup;
-  };
-}
-
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drPin.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drPin.h
deleted file mode 100644
index 7ed74b8..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drPin.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_PIN_H
-#define _DR_PIN_H
-
-#include "db/drObj/drBlockObject.h"
-#include "db/drObj/drAccessPattern.h"
-
-namespace fr {
-  class drNet;
-  class drPin: public drBlockObject {
-  public:
-    // constructors
-    drPin(): drBlockObject(), term(nullptr), accessPatterns(), net(nullptr) {}
-    // setters
-    void setFrTerm(frBlockObject* in) {
-      term = in;
-    }
-    void addAccessPattern(std::unique_ptr<drAccessPattern> &in) {
-      in->setPin(this);
-      accessPatterns.push_back(std::move(in));
-    }
-    void setNet(drNet* in) {
-      net = in;
-    }
-    // getters
-    bool hasFrTerm() const {
-      return (term);
-    }
-    frBlockObject* getFrTerm() const {
-      return term;
-    }
-    const std::vector<std::unique_ptr<drAccessPattern> >& getAccessPatterns() const {
-      return accessPatterns;
-    }
-    std::vector<std::unique_ptr<drAccessPattern> >& getAccessPatterns() {
-      return accessPatterns;
-    }
-    drNet* getNet() const {
-      return net;
-    }
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcPin;
-    }
-  protected:
-    frBlockObject*                                 term;  // either frTerm or frInstTerm
-    std::vector<std::unique_ptr<drAccessPattern> > accessPatterns;
-    drNet*                                         net;
-  };
-}
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drRef.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drRef.h
deleted file mode 100644
index cb194ff..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drRef.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_REF_H_
-#define _DR_REF_H_
-
-#include "db/drObj/drFig.h"
-#include "db/infra/frOrient.h"
-
-namespace fr {
-  class drRef: public drPinFig {
-  public:
-    // constructors
-    drRef(): drPinFig() {}
-    // getters
-    virtual frOrient getOrient() const = 0;
-    virtual void getOrigin(frPoint &tmpOrigin) const = 0;
-    virtual void getTransform(frTransform &xform) const = 0;
-    // setters
-    virtual void setOrient(const frOrient &tmpOrient) = 0;
-    virtual void setOrigin(const frPoint &tmpPoint) = 0;
-    virtual void setTransform(const frTransform &xform) = 0;
-    frBlockObjectEnum typeId() const override {
-      return drcRef;
-    }
-  protected:
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.cpp b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.cpp
deleted file mode 100644
index ec5421d..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frShape.h"
-#include "db/drObj/drShape.h"
-#include "db/drObj/drNet.h"
-
-using namespace std;
-using namespace fr;
-
-
-drPathSeg::drPathSeg(const frPathSeg &in): layer(in.getLayerNum()), 
-                                           owner(nullptr), 
-                                           beginMazeIdx(), endMazeIdx(), patchSeg(false) {
-  in.getPoints(begin, end);
-  in.getStyle(style);
-}
-
-drPatchWire::drPatchWire(const frPatchWire &in): layer(in.getLayerNum()), 
-                                           owner(nullptr) {
-  in.getOffsetBox(offsetBox);
-  in.getOrigin(origin);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.h
deleted file mode 100644
index 36e2ecd..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drShape.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_SHAPE_H_
-#define _DR_SHAPE_H_
-
-#include "db/drObj/drFig.h"
-#include "db/infra/frSegStyle.h"
-#include "dr/FlexMazeTypes.h"
-
-
-namespace fr {
-  class drNet;
-  class drPin;
-  class frPathSeg;
-  class frPatchWire;
-  class drShape: public drPinFig {
-  public:
-    // constructors
-    drShape(): drPinFig() {}
-    drShape(const drShape &in): drPinFig(in) {}
-    // setters
-    virtual void setLayerNum (frLayerNum tmpLayerNum) = 0;
-    // getters
-    virtual frLayerNum getLayerNum() const = 0;
-    // others
-    //drBlockObjectEnum typeId() const override = 0;
-
-    /* drom drPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removedromPin
-     */
-
-    /* drom drConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removedromNet
-     */
-
-    /* drom drFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    //virtual void setIter(frListIter<std::unique_ptr<drShape> > &in) = 0;
-    //virtual frListIter<std::unique_ptr<drShape> > getIter() const = 0;
-    //virtual bool isExt() const  = 0;
-    //virtual void setExt() = 0;
-  protected:
-  };
-
-  class drPathSeg: public drShape {
-  public:
-    // constructors
-    drPathSeg(): drShape(), begin(), end(), layer(0), style(), owner(nullptr), 
-                 beginMazeIdx(), endMazeIdx(), patchSeg(false) {}
-    drPathSeg(const drPathSeg &in): drShape(in), begin(in.begin), end(in.end), layer(in.layer), style(in.style), owner(in.owner), 
-                                    beginMazeIdx(in.beginMazeIdx), endMazeIdx(in.endMazeIdx), patchSeg(in.patchSeg) {}
-    drPathSeg(const frPathSeg &in);
-    // getters
-    void getPoints(frPoint &beginIn, frPoint &endIn) const {
-      beginIn.set(begin);
-      endIn.set(end);
-    }
-    void getStyle(frSegStyle &styleIn) const {
-      styleIn.setBeginStyle(style.getBeginStyle(), style.getBeginExt());
-      styleIn.setEndStyle(style.getEndStyle(), style.getEndExt());
-      styleIn.setWidth(style.getWidth());
-    }
-    // setters
-    void setPoints(const frPoint &beginIn, const frPoint &endIn) {
-      begin.set(beginIn);
-      end.set(endIn);
-    }
-    void setStyle(const frSegStyle &styleIn) {
-      style.setBeginStyle(styleIn.getBeginStyle(), styleIn.getBeginExt());
-      style.setEndStyle(styleIn.getEndStyle(), styleIn.getEndExt());
-      style.setWidth(styleIn.getWidth());
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcPathSeg;
-    }
-
-    /* drom drShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* drom drPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removedromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == drcPin);
-    }
-    
-    drPin* getPin() const override {
-      return reinterpret_cast<drPin*>(owner);
-    }
-    
-    void addToPin(drPin* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* drom drConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removedromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == drcNet);
-    }
-    
-    drNet* getNet() const override {
-      return reinterpret_cast<drNet*>(owner);
-    }
-    
-    void addToNet(drNet* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* drom drFig
-     * getBBox
-     * move, in .cpp
-     * overlaps, in .cpp
-     */
-    // needs to be updated
-    void getBBox (frBox &boxIn) const override {
-      bool isHorizontal = true;
-      if (begin.x() == end.x()) {
-        isHorizontal = false;
-      }
-      auto width    = style.getWidth();
-      auto beginExt = style.getBeginExt();
-      auto endExt   = style.getEndExt();
-      if (isHorizontal) {
-        boxIn.set(begin.x() - beginExt, begin.y() - width / 2,
-                  end.x()   + endExt,   end.y()   + width / 2);
-      } else {
-        boxIn.set(begin.x() - width / 2, begin.y() - beginExt,
-                  end.x()   + width / 2, end.y()   + endExt);
-      }
-    }
-
-    //void setIter(frListIter<std::unique_ptr<drShape> >& in) override {
-    //  iter = in;
-    //}
-    //frListIter<std::unique_ptr<drShape> > getIter() const override {
-    //  return iter;
-    //}
-
-    // determine whether shape is stored in net fixed obj or routed obj
-    //bool isExt() const override {
-    //  return ext;
-    //}
-    //void setExt(bool in) override {
-    //  ext = in;
-    //}
-    bool hasMazeIdx() const {
-      return (!beginMazeIdx.empty());
-    }
-    void getMazeIdx(FlexMazeIdx &bi, FlexMazeIdx &ei) const {
-      bi.set(beginMazeIdx);
-      ei.set(endMazeIdx);
-    }
-    void setMazeIdx(FlexMazeIdx &bi, FlexMazeIdx &ei) {
-      beginMazeIdx.set(bi);
-      endMazeIdx.set(ei);
-    }
-    void setPatchSeg(bool in) {
-      patchSeg = in;
-    }
-    bool isPatchSeg() const {
-      return patchSeg;
-    }
-  protected:
-    frPoint        begin; // begin always smaller than end, assumed
-    frPoint        end;
-    frLayerNum     layer;
-    frSegStyle     style;
-    drBlockObject* owner;
-    //frListIter<std::unique_ptr<drShape> > iter;
-    //bool           ext;
-    FlexMazeIdx    beginMazeIdx;
-    FlexMazeIdx    endMazeIdx;
-    bool           patchSeg; 
-  };
-
-  class drPatchWire: public drShape {
-  public:
-    // constructors
-    drPatchWire(): drShape(), offsetBox(), origin(), layer(0), owner(nullptr) {};
-    drPatchWire(const drPatchWire& in): drShape(in), offsetBox(in.offsetBox), origin(in.origin), layer(in.layer), owner(in.owner) {};
-    drPatchWire(const frPatchWire& in);
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcPatchWire;
-    }
-
-    /* from drShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-
-
-    /* from drPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == drcPin);
-    }
-    
-    drPin* getPin() const override {
-      return reinterpret_cast<drPin*>(owner);
-    }
-    
-    void addToPin(drPin* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from drConnfig
-     * hasNet
-     * getNet
-     * addToNet
-     * removedFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == drcNet);
-    }
-    
-    drNet* getNet() const override {
-      return reinterpret_cast<drNet*>(owner);
-    }
-    
-    void addToNet(drNet* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from drFig
-     * getBBox
-     * setBBox
-     */
-    void getBBox (frBox &boxIn) const override {
-      frTransform xform(origin);
-      boxIn.set(offsetBox);
-      boxIn.transform(xform);
-    }
-    // void setBBox (const frBox &boxIn) {
-    //   box.set(boxIn);
-    // }
-
-    void getOffsetBox (frBox &boxIn) const {
-      boxIn = offsetBox;
-    }
-    void setOffsetBox (const frBox &boxIn) {
-      offsetBox.set(boxIn);
-    }
-
-    // frPoint getOrigin() const {
-    //   return origin;
-    // }
-    void getOrigin(frPoint &in) const {
-      in.set(origin);
-    }
-    void setOrigin(const frPoint &in) {
-      origin.set(in);
-    }
-
-
-  protected:
-    // frBox           box;
-    frBox           offsetBox;
-    frPoint         origin;
-    frLayerNum      layer;
-    drBlockObject*  owner;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.cpp b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.cpp
deleted file mode 100644
index 9ae888f..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frVia.h"
-#include "db/drObj/drVia.h"
-#include "db/drObj/drNet.h"
-
-using namespace std;
-using namespace fr;
-
-
-drVia::drVia(const frVia &in): viaDef(in.getViaDef()), owner(nullptr), 
-                               beginMazeIdx(), endMazeIdx() {
-  in.getOrigin(origin);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.h b/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.h
deleted file mode 100644
index faad575..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/drObj/drVia.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DR_VIA_H_
-#define _DR_VIA_H_
-
-#include <memory>
-#include "db/drObj/drRef.h"
-#include "db/tech/frViaDef.h"
-#include "dr/FlexMazeTypes.h"
-
-namespace fr {
-  class drNet;
-  class frVia;
-  class drVia: public drRef {
-  public:
-    // constructors
-    drVia(): drRef() {}
-    drVia(frViaDef* in): drRef(), origin(), viaDef(in), owner(nullptr), beginMazeIdx(), endMazeIdx() {}
-    drVia(const drVia &in): origin(in.origin), viaDef(in.viaDef), owner(in.owner), 
-                            beginMazeIdx(in.beginMazeIdx), endMazeIdx(in.endMazeIdx) {}
-    drVia(const frVia &in);
-    // getters
-    frViaDef* getViaDef() const {
-      return viaDef;
-    }
-    void getLayer1BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer1Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getCutBBox(frBox &boxIn) const {
-      auto &figs = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getLayer2BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer2Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    // setters
-    void setViaDef(frViaDef* in) {
-      viaDef = in;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return drcVia;
-    }
-
-    /* from frRef
-     * getOrient
-     * setOrient
-     * getOrigin
-     * setOrigin
-     * getTransform
-     * setTransform
-     */
-
-    frOrient getOrient() const override {
-      return frOrient();
-    }
-    void setOrient(const frOrient &tmpOrient) override {
-      ;
-    }
-    void getOrigin(frPoint &tmpOrigin) const override {
-      tmpOrigin.set(origin);
-    }
-    void setOrigin(const frPoint &tmpPoint) override {
-      origin.set(tmpPoint);
-    }
-    void getTransform(frTransform &xformIn) const override {
-      xformIn.set(origin);
-    }
-    void setTransform(const frTransform &xformIn) override {}
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == drcPin);
-    }
-    drPin* getPin() const override {
-      return reinterpret_cast<drPin*>(owner);
-    }
-    void addToPin(drPin* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == drcNet);
-    }
-    drNet* getNet() const override {
-      return reinterpret_cast<drNet*>(owner);
-    }
-    void addToNet(drNet* in) override {
-      owner = reinterpret_cast<drBlockObject*>(in);
-    }
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    void getBBox (frBox &boxIn) const override {
-      auto &layer1Figs = viaDef->getLayer1Figs();
-      auto &layer2Figs = viaDef->getLayer2Figs();
-      auto &cutFigs    = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: layer1Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: layer2Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: cutFigs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      //cout <<"origin " <<origin.x() <<" " <<origin.y() <<endl;
-      boxIn.transform(xform);
-    }
-    
-    //void setIter(frListIter<std::unique_ptr<frVia> >& in) {
-    //  iter = in;
-    //}
-    //frListIter<std::unique_ptr<frVia> > getIter() const {
-    //  return iter;
-    //}
-    // determine whether shape is stored in net fixed obj or routed obj
-    //bool isExt() const {
-    //  return ext;
-    //}
-    //void setExt(bool in) {
-    //  ext = in;
-    //}
-    bool hasMazeIdx() const {
-      return (!beginMazeIdx.empty());
-    }
-    void getMazeIdx(FlexMazeIdx &bi, FlexMazeIdx &ei) const {
-      bi.set(beginMazeIdx);
-      ei.set(endMazeIdx);
-    }
-    void setMazeIdx(const FlexMazeIdx &bi, const FlexMazeIdx &ei) {
-      beginMazeIdx.set(bi);
-      endMazeIdx.set(ei);
-    }
-
-  protected:
-    frPoint        origin;
-    frViaDef*      viaDef;
-    drBlockObject* owner;
-    //frListIter<std::unique_ptr<frVia> > iter;
-    //bool           ext;
-    FlexMazeIdx    beginMazeIdx;
-    FlexMazeIdx    endMazeIdx;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/infra/Makefile
deleted file mode 100644
index 203cedf..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= frPoint.o frBox.o frTime_helper.o frTime.o
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.cpp b/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.cpp
deleted file mode 100644
index cbad43a..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/infra/frBox.h"
-#include "db/infra/frTransform.h"
-
-using namespace std;
-using namespace fr;
-
-void frBox::transform(const frTransform &xform) {
-  //auto ll = bBox.lowerLeft.transform(xform);
-  //ll.transform(xform);
-  //auto ur = bBox.upperRight.transform(xform);
-  //ur.transform(xform);
-  //this->set(ll, ur);
-  ll.transform(xform);
-  ur.transform(xform);
-  this->set(ll, ur);
-}
-
-bool frBox::overlaps(const frBox &boxIn, bool incEdges) const {
-  if (incEdges) {
-    return !(right() < boxIn.left()   || // left
-             top()   < boxIn.bottom() || // bottom
-             left()  > boxIn.right()  || // right
-             bottom()> boxIn.top()        // top
-             );
-  } else {
-    return !(right() <= boxIn.left()   || // left
-             top()   <= boxIn.bottom() || // bottom
-             left()  >= boxIn.right()  || // right
-             bottom()>= boxIn.top()        // top
-             );
-  }
-}
-
-void frBox::bloat(const frCoord distance, frBox &boxOut) const {
-  boxOut.set(left() - distance, bottom() - distance, right() + distance, top() + distance);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.h
deleted file mode 100644
index 4e18918..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frBox.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BOX_H_
-#define _FR_BOX_H_
-
-#include "db/infra/frPoint.h"
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frBox {
-  public:
-    // constructor
-    frBox(): ll(), ur() {}
-    frBox(const frBox &tmpBox): ll(tmpBox.ll), ur(tmpBox.ur) {}
-    frBox(const box_t &in) {
-      auto minCorner = in.min_corner();
-      auto maxCorner = in.max_corner();
-      set(minCorner.x(), minCorner.y(), maxCorner.x(), maxCorner.y());
-    }
-    frBox(frCoord llx, frCoord lly, frCoord urx, frCoord ury) {
-      ll.set((llx > urx) ? urx : llx,
-                    (lly > ury) ? ury : lly);
-      ur.set((llx > urx) ? llx : urx, 
-                     (lly > ury) ? lly : ury);
-    }
-    frBox(const frPoint &tmpLowerLeft, const frPoint &tmpUpperRight) 
-      : frBox(tmpLowerLeft.x(), tmpLowerLeft.y(), tmpUpperRight.x(), tmpUpperRight.y()) {}
-    // setters
-    void set(const frBox &tmpBox) {
-      ll.set(tmpBox.ll);
-      ur.set(tmpBox.ur);
-    }
-    void set(frCoord llx, frCoord lly, frCoord urx, frCoord ury) {
-      ll.set((llx > urx) ? urx : llx,
-             (lly > ury) ? ury : lly);
-      ur.set((llx > urx) ? llx : urx, 
-             (lly > ury) ? lly : ury);
-    }
-    void set(const frPoint &tmpLowerLeft, const frPoint &tmpUpperRight) {
-      set(tmpLowerLeft.x(), tmpLowerLeft.y(), tmpUpperRight.x(), tmpUpperRight.y());
-    }
-    void setUnsafe(const frPoint &tmpLowerLeft, const frPoint &tmpUpperRight) {
-      ll.set(tmpLowerLeft);
-      ur.set(tmpUpperRight);
-    }
-    // getters
-    frCoord left() const {
-      return ll.x();
-    }
-    frCoord bottom() const {
-      return ll.y();
-    }
-    frCoord right() const {
-      return ur.x();
-    }
-    frCoord top() const {
-      return ur.y();
-    }
-    frPoint& lowerLeft() {
-      return ll;
-    }
-    const frPoint& lowerLeft() const {
-      return ll;
-    }
-    frPoint& upperRight() {
-      return ur;
-    }
-    const frPoint& upperRight() const {
-      return ur;
-    }
-    frCoord width() const {
-      frCoord xSpan = right() - left();
-      frCoord ySpan = top()   - bottom();
-      return (xSpan > ySpan) ? ySpan : xSpan;
-    }
-    frCoord length() const {
-      frCoord xSpan = right() - left();
-      frCoord ySpan = top()   - bottom();
-      return (xSpan > ySpan) ? xSpan : ySpan;
-    }
-    bool contains(const frBox &box, bool incEdges = true) const {;
-      if (incEdges) {
-        return (box.right() <= ur.x() && box.left()  >= ll.x() &&
-                box.top()   <= ur.y() && box.bottom()>= ll.y());
-      } else {
-        return (box.right() < ur.x() && box.left()   > ll.x() &&
-                box.top()   < ur.y() && box.bottom() > ll.y());
-      }
-    }
-    bool contains(const frPoint &in, bool incEdges = true) const {
-      if (incEdges) {
-        return ll.x() <= in.x() && in.x() <= ur.x() &&
-               ll.y() <= in.y() && in.y() <= ur.y();
-      } else {
-        return ll.x() < in.x() && in.x() < ur.x() &&
-               ll.y() < in.y() && in.y() < ur.y();
-      }
-    }
-    void transform(const frTransform &xform);
-    bool overlaps(const frBox &boxIn, bool incEdges = true) const;
-    void bloat(const frCoord distance, frBox &boxOut) const;
-    bool operator==(const frBox &boxIn) const {
-      return (ll == boxIn.ll) && (ur == boxIn.ur);
-    }
-    bool operator<(const frBox &boxIn) const {
-      if (!(ll == boxIn.lowerLeft())) {
-        return (ll < boxIn.lowerLeft());
-      } else {
-        return (ur < boxIn.upperRight());
-      }
-    }
-  protected:
-    frPoint ll, ur;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frOrient.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frOrient.h
deleted file mode 100644
index 464f300..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frOrient.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_ORIENT_H_
-#define _FR_ORIENT_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frOrient {
-  public:
-    // constructor
-    frOrient(): orient(frcR0) {}
-    frOrient(const frOrient &tmpOrient): orient(tmpOrient.orient) {}
-    frOrient(frOrientEnum tmpOrient): orient(tmpOrient) {}
-    frOrient(const frString &name) {
-      if (name == frString("frcR90")) {
-        orient = frcR90;
-      } else if (name == frString("frcR180")) {
-        orient = frcR180;
-      } else if (name == frString("frcR270")) {
-        orient = frcR270;
-      } else if (name == frString("frcMY")) {
-        orient = frcMY;
-      } else if (name == frString("frcMYR90")) {
-        orient = frcMYR90;
-      } else if (name == frString("frcMX")) {
-        orient = frcMX;
-      } else if (name == frString("frcMXR90")) {
-        orient = frcMXR90;
-      } else {
-        orient = frcR0;
-      }
-    }
-    // setters
-    void set(frOrientEnum tmpOrient) {
-      orient = tmpOrient;
-    }
-    void set(const frOrient &tmpOrient) {
-      orient = tmpOrient.orient;
-    }
-    void set(const frString &name) {
-      if (name == frString("frcR90")) {
-        orient = frcR90;
-      } else if (name == frString("frcR180")) {
-        orient = frcR180;
-      } else if (name == frString("frcR270")) {
-        orient = frcR270;
-      } else if (name == frString("frcMY")) {
-        orient = frcMY;
-      } else if (name == frString("frcMYR90")) {
-        orient = frcMYR90;
-      } else if (name == frString("frcMX")) {
-        orient = frcMX;
-      } else if (name == frString("frcMXR90")) {
-        orient = frcMXR90;
-      } else {
-        orient = frcR0;
-      }
-    }
-    // getters
-    //frOrientEnum get() const {
-    //  return orient;
-    //}
-    frString getName() const {
-      switch(orient) {
-        //case frcR0    : return frString("frcR0");
-        case frcR90   : return frString("frcR90");
-        case frcR180  : return frString("frcR180");
-        case frcR270  : return frString("frcR270");
-        case frcMY    : return frString("frcMY");
-        case frcMYR90 : return frString("frcMYR90");
-        case frcMX    : return frString("frcMX");
-        case frcMXR90 : return frString("frcMXR90");
-        default       : return frString("frcR0");
-      }
-    }
-    void getName(frString &name) const {
-      switch(orient) {
-        //case frcR0    : return frString("frcR0");
-        case frcR90   : 
-          name = "frcR90";
-          break;
-        case frcR180  : 
-          name = "frcR180";
-          break;
-        case frcR270  : 
-          name = "frcR270";
-          break;
-        case frcMY    : 
-          name = "frcMY";
-          break;
-        case frcMYR90 : 
-          name = "frcMYR90";
-          break;
-        case frcMX    : 
-          name = "frcMX";
-          break;
-        case frcMXR90 : 
-          name = "frcMXR90";
-          break;
-        default       : 
-          name = "frcR0";
-      }
-    }
-    // overloads
-    //frOrientEnum operator()() const {
-    //  return orient;
-    //}
-    operator frOrientEnum() const {
-      return orient;
-    }
-  protected:
-    frOrientEnum orient;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.cpp b/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.cpp
deleted file mode 100644
index eba0f6d..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/infra/frPoint.h"
-#include "db/infra/frTransform.h"
-
-using namespace std;
-using namespace fr;
-
-void frPoint::transform(const frTransform &xform) {
-  frCoord tmpX = 0;
-  frCoord tmpY = 0;
-  //cout <<xform.orient() <<endl;
-  switch(xform.orient()) {
-    case frcR90 :
-      tmpX = xform.xOffset() - yCoord;
-      tmpY = xform.yOffset() + xCoord;
-      break;
-    case frcR180 :
-      tmpX = xform.xOffset() - xCoord;
-      tmpY = xform.yOffset() - yCoord;
-      break;
-    case frcR270 :
-      tmpX = xform.xOffset() + yCoord;
-      tmpY = xform.yOffset() - xCoord;
-      break;
-    case frcMY :
-      tmpX = xform.xOffset() - xCoord;
-      tmpY = xform.yOffset() + yCoord;
-      break;
-    case frcMYR90 : // MY, rotate, then shift 
-      tmpX = xform.xOffset() - yCoord;
-      tmpY = xform.yOffset() - xCoord;
-      break;
-    case frcMX :
-      tmpX = xform.xOffset() + xCoord;
-      tmpY = xform.yOffset() - yCoord;
-      break;
-    case frcMXR90 : // MX, rotate, then shift
-      tmpX = xform.xOffset() + yCoord;
-      tmpY = xform.yOffset() + xCoord;
-      break;
-    // frcR0
-    default :
-      tmpX = xform.xOffset() + xCoord;
-      tmpY = xform.yOffset() + yCoord;
-      break;
-  }
-  xCoord = tmpX;
-  yCoord = tmpY;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.h
deleted file mode 100644
index 37d3052..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPoint.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_POINT_H_
-#define _FR_POINT_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frTransform;
-
-  class frPoint {
-  public:
-    // constructors
-    frPoint(): xCoord(0), yCoord(0) {}
-    frPoint(const frPoint &tmpPoint): xCoord(tmpPoint.xCoord), yCoord(tmpPoint.yCoord) {}
-    frPoint(const frCoord tmpX, const frCoord tmpY)
-      : xCoord(tmpX), yCoord(tmpY) {};
-    // setters
-    void set(const frPoint &tmpPoint) {
-      xCoord = tmpPoint.xCoord;
-      yCoord = tmpPoint.yCoord;
-    }
-    void set(const frCoord tmpX, const frCoord tmpY) {
-      xCoord = tmpX;
-      yCoord = tmpY;
-    }
-    // getters
-    frCoord x() const {
-      return xCoord;
-    }
-    frCoord y() const {
-      return yCoord;
-    }
-    // others
-    void transform(const frTransform &xform);
-    bool operator<(const frPoint &pIn) const {
-      return (xCoord == pIn.xCoord) ? (yCoord < pIn.yCoord) : (xCoord < pIn.xCoord);
-    }
-    bool operator==(const frPoint &pIn) const {
-      return (xCoord == pIn.xCoord) && (yCoord == pIn.yCoord);
-    }
-  protected:
-    frCoord xCoord, yCoord;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPrefRoutingDir.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frPrefRoutingDir.h
deleted file mode 100644
index 59befbe..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frPrefRoutingDir.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_PREFROUTINGDIR_H_
-#define _FR_PREFROUTINGDIR_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frPrefRoutingDir {
-  public:
-    // constructor
-    frPrefRoutingDir(): dir(frcNotApplicablePrefRoutingDir) {}
-    frPrefRoutingDir(const frPrefRoutingDir &in): dir(in.dir) {}
-    frPrefRoutingDir(frPrefRoutingDirEnum dirIn): dir(dirIn) {}
-    // setters
-    void set(frPrefRoutingDirEnum dirIn) {
-      dir = dirIn;
-    }
-    // getters
-    // overloads
-    operator frPrefRoutingDirEnum() const {
-      return dir;
-    }
-  protected:
-    frPrefRoutingDirEnum dir;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frSegStyle.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frSegStyle.h
deleted file mode 100644
index 069f560..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frSegStyle.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_SEGSTYLE_H_
-#define _FR_SEGSTYLE_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frEndStyle {
-  public:
-    // constructor
-    frEndStyle(): style(frcExtendEndStyle) {}
-    frEndStyle(const frEndStyle &styleIn): style(styleIn.style) {}
-    frEndStyle(frEndStyleEnum styleIn): style(styleIn) {}
-    // setters
-    void set(frEndStyleEnum styleIn) {
-      style = styleIn;
-    }
-    void set(const frEndStyle &styleIn) {
-      style = styleIn.style;
-    }
-    // getters
-    operator frEndStyleEnum() const {
-      return style;
-    }
-  protected:
-    frEndStyleEnum style;
-  };
-
-  class frSegStyle {
-  public:
-    // constructor
-    frSegStyle(): beginExt(0), endExt(0), width(0), beginStyle(), endStyle() {}
-    frSegStyle(const frSegStyle &in): beginExt(in.beginExt), endExt(in.endExt),
-                                      width(in.width), beginStyle(in.beginStyle),
-                                      endStyle(in.endStyle) {}
-    // setters
-    void setWidth(frUInt4 widthIn) {
-      width = widthIn;
-    }
-    void setBeginStyle(const frEndStyle &style, frUInt4 ext = 0) {
-      beginStyle.set(style);
-      beginExt = ext;
-    }
-    void setEndStyle(const frEndStyle &style, frUInt4 ext = 0) {
-      endStyle.set(style);
-      endExt = ext;
-    }
-    // getters
-    frUInt4 getWidth() const {
-      return width;
-    }
-    frUInt4 getBeginExt() const {
-      return beginExt;
-    }
-    frEndStyle getBeginStyle() const {
-      return beginStyle;
-    }
-    frUInt4 getEndExt() const {
-      return endExt;
-    }
-    frEndStyle getEndStyle() const {
-      return endStyle;
-    }
-  protected:
-    frUInt4 beginExt;
-    frUInt4 endExt;
-    frUInt4 width;
-    frEndStyle beginStyle;
-    frEndStyle endStyle;
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.cpp b/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.cpp
deleted file mode 100644
index e0ac668..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iomanip>
-#include <boost/io/ios_state.hpp>
-#include "frTime.h"
-
-using namespace std;
-using namespace fr;
-
-void frTime::print() {
-  boost::io::ios_all_saver guard(std::cout);
-  auto t1        = std::chrono::high_resolution_clock::now();
-  auto time_span = std::chrono::duration_cast<std::chrono::seconds>(t1 - t0);
-  int hour       = time_span.count() / 3600;
-  int min        = (time_span.count() % 3600) / 60;
-  int sec        = time_span.count() % 60;
-  auto t2        = (clock() - t) / CLOCKS_PER_SEC;
-  int chour      = t2 / 3600;
-  int cmin       = (t2 % 3600) / 60;
-  int csec       = t2 % 60;
-  std::cout <<"cpu time = ";
-  std::cout <<std::setw(2) <<std::setfill('0') <<chour;
-  std::cout <<":";
-  std::cout <<std::setw(2) <<std::setfill('0') <<cmin;
-  std::cout <<":";
-  std::cout <<std::setw(2) <<std::setfill('0') <<csec;
-  std::cout <<", elapsed time = ";
-  std::cout <<std::setw(2) <<std::setfill('0') <<hour;
-  std::cout <<":";
-  std::cout <<std::setw(2) <<std::setfill('0') <<min;
-  std::cout <<":";
-  std::cout <<std::setw(2) <<std::setfill('0') <<sec;
-  std::cout <<", memory = " <<std::fixed <<std::setprecision(2) <<getCurrentRSS() * 1.0 / 1024 / 1024 <<" (MB)";
-  std::cout <<", peak = "   <<std::fixed <<std::setprecision(2) <<getPeakRSS()    * 1.0 / 1024 / 1024 <<" (MB)";
-  guard.restore();
-}
-
-std::ostream& operator<<(std::ostream& os, const frTime &t) {
-  boost::io::ios_all_saver guard(std::cout);
-  auto t1        = std::chrono::high_resolution_clock::now();
-  auto time_span = std::chrono::duration_cast<std::chrono::seconds>(t1 - t.getT0());
-  int hour       = time_span.count() / 3600;
-  int min        = (time_span.count() % 3600) / 60;
-  int sec        = time_span.count() % 60;
-  os <<"elapsed time = ";
-  os <<std::setw(2) <<std::setfill('0') <<hour;
-  os <<":";
-  os <<std::setw(2) <<std::setfill('0') <<min;
-  os <<":";
-  os <<std::setw(2) <<std::setfill('0') <<sec;
-  os <<", memory = " <<std::fixed <<std::setprecision(2) <<getCurrentRSS() * 1.0 / 1024 / 1024 <<" (MB)";
-  guard.restore();
-  return os;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.h
deleted file mode 100644
index 1930e31..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_TIME_H_
-#define _FR_TIME_H_
-
-#include <iostream>
-#include <chrono>
-#include <ctime>
-//#include <boost/io/ios_state.hpp>
-
-extern size_t getPeakRSS();
-extern size_t getCurrentRSS();
-
-namespace fr {
-  class frTime {
-  public:
-    frTime(): t0(std::chrono::high_resolution_clock::now()), t(clock()) {}
-    //void begin() {
-    //  t0 = std::chrono::high_resolution_clock::now();
-    //}
-    //void end() {
-    //  t1 = std::chrono::high_resolution_clock::now();
-    //}
-    std::chrono::high_resolution_clock::time_point getT0() const {
-      return t0;
-    }
-    void print();
-    bool isExceed(double in) {
-      auto t1        = std::chrono::high_resolution_clock::now();
-      auto time_span = std::chrono::duration_cast<std::chrono::duration<double> >(t1 - t0);
-      return (time_span.count() > in);
-    }
-  protected:
-    std::chrono::high_resolution_clock::time_point t0;
-    clock_t t;
-    //std::chrono::high_resolution_clock::time_point t1;
-  };
-}
-
-extern std::ostream& operator<<(std::ostream& os, const fr::frTime &t);
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime_helper.cpp b/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime_helper.cpp
deleted file mode 100644
index 633cd85..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTime_helper.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Author:  David Robert Nadeau
- * Site:    http://NadeauSoftware.com/
- * License: Creative Commons Attribution 3.0 Unported License
- *          http://creativecommons.org/licenses/by/3.0/deed.en_US
- */
-
-#if defined(_WIN32)
-#include <windows.h>
-#include <psapi.h>
-
-#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
-#include <unistd.h>
-#include <sys/resource.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <mach/mach.h>
-
-#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
-#include <fcntl.h>
-#include <procfs.h>
-
-#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
-#include <stdio.h>
-
-#endif
-
-#else
-#error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
-#endif
-
-
-
-
-
-/**
- * Returns the peak (maximum so far) resident set size (physical
- * memory use) measured in bytes, or zero if the value cannot be
- * determined on this OS.
- */
-size_t getPeakRSS( )
-{
-#if defined(_WIN32)
-    /* Windows -------------------------------------------------- */
-    PROCESS_MEMORY_COUNTERS info;
-    GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
-    return (size_t)info.PeakWorkingSetSize;
-
-#elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
-    /* AIX and Solaris ------------------------------------------ */
-    struct psinfo psinfo;
-    int fd = -1;
-    if ( (fd = open( "/proc/self/psinfo", O_RDONLY )) == -1 )
-        return (size_t)0L;      /* Can't open? */
-    if ( read( fd, &psinfo, sizeof(psinfo) ) != sizeof(psinfo) )
-    {
-        close( fd );
-        return (size_t)0L;      /* Can't read? */
-    }
-    close( fd );
-    return (size_t)(psinfo.pr_rssize * 1024L);
-
-#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
-    /* BSD, Linux, and OSX -------------------------------------- */
-    struct rusage rusage;
-    getrusage( RUSAGE_SELF, &rusage );
-#if defined(__APPLE__) && defined(__MACH__)
-    return (size_t)rusage.ru_maxrss;
-#else
-    return (size_t)(rusage.ru_maxrss * 1024L);
-#endif
-
-#else
-    /* Unknown OS ----------------------------------------------- */
-    return (size_t)0L;          /* Unsupported. */
-#endif
-}
-
-
-
-
-
-/**
- * Returns the current resident set size (physical memory use) measured
- * in bytes, or zero if the value cannot be determined on this OS.
- */
-size_t getCurrentRSS( )
-{
-#if defined(_WIN32)
-    /* Windows -------------------------------------------------- */
-    PROCESS_MEMORY_COUNTERS info;
-    GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
-    return (size_t)info.WorkingSetSize;
-
-#elif defined(__APPLE__) && defined(__MACH__)
-    /* OSX ------------------------------------------------------ */
-    struct mach_task_basic_info info;
-    mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
-    if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
-        (task_info_t)&info, &infoCount ) != KERN_SUCCESS )
-        return (size_t)0L;      /* Can't access? */
-    return (size_t)info.resident_size;
-
-#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
-    /* Linux ---------------------------------------------------- */
-    long rss = 0L;
-    FILE* fp = NULL;
-    if ( (fp = fopen( "/proc/self/statm", "r" )) == NULL )
-        return (size_t)0L;      /* Can't open? */
-    if ( fscanf( fp, "%*s%ld", &rss ) != 1 )
-    {
-        fclose( fp );
-        return (size_t)0L;      /* Can't read? */
-    }
-    fclose( fp );
-    return (size_t)rss * (size_t)sysconf( _SC_PAGESIZE);
-
-#else
-    /* AIX, BSD, Solaris, and Unknown OS ------------------------ */
-    return (size_t)0L;          /* Unsupported. */
-#endif
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTransform.h b/scripts/pdn/src/PdnPinDumper/src/db/infra/frTransform.h
deleted file mode 100644
index b167ab2..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/infra/frTransform.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_TRANSFORM_H_
-#define _FR_TRANSFORM_H_
-
-#include "db/infra/frPoint.h"
-#include "db/infra/frOrient.h"
-
-namespace fr {
-  class frTransform {
-  public:
-    // constructor
-    frTransform(): offset(), ori() {}
-    frTransform(const frPoint &pointIn, const frOrient &orientIn = frOrient(frcR0)): offset(pointIn), ori(orientIn) {}
-    frTransform(frCoord xOffsetIn, frCoord yOffsetIn, const frOrient &orientIn = frOrient(frcR0)): offset(xOffsetIn, yOffsetIn), ori(orientIn) {}
-    // setters
-    void set(const frPoint &pointIn) {
-      offset = pointIn;
-    }
-    void set(const frOrient &orientIn) {
-      ori = orientIn;
-    }
-    void set(const frPoint &pointIn, const frOrient &orientIn) {
-      set(pointIn);
-      set(orientIn);
-    }
-    void set(frCoord xOffsetIn, frCoord yOffsetIn) {
-      set(frPoint(xOffsetIn, yOffsetIn));
-    }
-    void set(frCoord xOffsetIn, frCoord yOffsetIn, const frOrient &orientIn) {
-      set(xOffsetIn, yOffsetIn);
-      set(orientIn);
-    }
-    // getters
-    frCoord xOffset() const {
-      return offset.x();
-    }
-    frCoord yOffset() const {
-      return offset.y();
-    }
-    frOrient orient() const {
-      return ori;
-    }
-    // util
-    void updateXform(frPoint &size) {
-      switch(orient()) {
-        //case frcR0: == default
-        case frcR90:
-          set(xOffset() + size.y(), yOffset()           );
-          break;
-        case frcR180: // verified
-          set(xOffset() + size.x(), yOffset() + size.y());
-          break;
-        case frcR270:
-          set(xOffset(),            yOffset() + size.x());
-          break;
-        case frcMY: // verified
-          set(xOffset() + size.x(), yOffset()           );
-          break;
-        case frcMXR90:
-          set(xOffset(),            yOffset()           );
-          break;
-        case frcMX: // verified
-          set(xOffset(),            yOffset() + size.y());
-          break;
-        case frcMYR90:
-          set(xOffset() + size.y(), yOffset() + size.x());
-          break;
-        default      : // verified
-          set(xOffset(),            yOffset()           );
-          break;
-      }
-    }
-    void revert(frTransform &transformIn) {
-      frCoord resXOffset, resYOffset;
-      frOrient resOrient;
-      switch(ori) {
-        case frcR0:
-          resXOffset = -offset.x();
-          resYOffset = -offset.y();
-          resOrient = frcR0;
-          break;
-        case frcR90:
-          resXOffset = -offset.y();
-          resYOffset = offset.x();
-          resOrient = frcR270;
-          break;
-        case frcR180:
-          resXOffset = offset.x();
-          resYOffset = offset.y();
-          resOrient = frcR180;
-          break;
-        case frcR270:
-          resXOffset = offset.y();
-          resYOffset = -offset.x();
-          resOrient = frcR90;
-          break;
-        case frcMY:
-          resXOffset = offset.x();
-          resYOffset = -offset.y();
-          resOrient = frcMY;
-          break;
-        case frcMYR90:
-          resXOffset = offset.y();
-          resYOffset = offset.x();
-          resOrient = frcMYR90;
-          break;
-        case frcMX:
-          resXOffset = -offset.x();
-          resYOffset = offset.y();
-          resOrient = frcMX;
-          break;
-        case frcMXR90:
-          resXOffset = -offset.y();
-          resYOffset = -offset.x();
-          resOrient = frcMXR90;
-          break;
-        default:
-          resXOffset = -offset.x();
-          resYOffset = -offset.y();
-          resOrient = frcR0;
-          std::cout << "Error: unrecognized orient in revert\n";
-      }
-      transformIn.set(resXOffset, resYOffset, resOrient);
-    }
-  protected:
-    frPoint offset;
-    frOrient ori;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/obj/Makefile
deleted file mode 100644
index 11b8b3c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= frInst.o frShape.o frVia.o
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlock.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlock.h
deleted file mode 100644
index 1a84371..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlock.h
+++ /dev/null
@@ -1,363 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BLOCK_H_
-#define _FR_BLOCK_H_
-
-#include <algorithm>
-#include "frBaseTypes.h"
-#include "db/obj/frTrackPattern.h"
-#include "db/obj/frBlockage.h"
-#include "db/obj/frInst.h"
-#include "db/obj/frTerm.h"
-#include "db/obj/frNet.h"
-#include "db/obj/frBoundary.h"
-#include "db/obj/frCMap.h"
-#include "db/obj/frMarker.h"
-
-namespace fr {
-  namespace io {
-    class Parser;
-  }
-  class frGuide;
-  class frBlock: public frBlockObject {
-  public:
-    // constructors
-    frBlock(): frBlockObject(), name(), dbUnit(0), macroClass(MacroClassEnum::UNKNOWN) {};
-    // getters
-    frUInt4 getDBUPerUU() const {
-      return dbUnit;
-    }
-    void getBBox(frBox &boxIn) const {
-      if (boundaries.size()) {
-        boundaries.begin()->getBBox(boxIn);
-      }
-      frCoord llx = boxIn.left();
-      frCoord lly = boxIn.bottom();
-      frCoord urx = boxIn.right();
-      frCoord ury = boxIn.top();
-      frBox tmpBox;
-      for (auto &boundary: boundaries) {
-        boundary.getBBox(tmpBox);
-        llx = llx < tmpBox.left()   ? llx : tmpBox.left();
-        lly = lly < tmpBox.bottom() ? lly : tmpBox.bottom();
-        urx = urx > tmpBox.right()  ? urx : tmpBox.right();
-        ury = ury > tmpBox.top()    ? ury : tmpBox.top();
-      }
-      //std::cout <<"dieBox after bound " <<llx <<" " <<lly <<" " <<urx <<" " <<ury <<std::endl;
-      for (auto &inst: getInsts()) {
-        inst->getBBox(tmpBox);
-        llx = llx < tmpBox.left()   ? llx : tmpBox.left();
-        lly = lly < tmpBox.bottom() ? lly : tmpBox.bottom();
-        urx = urx > tmpBox.right()  ? urx : tmpBox.right();
-        ury = ury > tmpBox.top()    ? ury : tmpBox.top();
-      }
-      //std::cout <<"dieBox after inst " <<llx <<" " <<lly <<" " <<urx <<" " <<ury <<std::endl;
-      for (auto &term: getTerms()) {
-        for (auto &pin: term->getPins()) {
-          for (auto &fig: pin->getFigs()) {
-            fig->getBBox(tmpBox);
-            llx = llx < tmpBox.left()   ? llx : tmpBox.left();
-            lly = lly < tmpBox.bottom() ? lly : tmpBox.bottom();
-            urx = urx > tmpBox.right()  ? urx : tmpBox.right();
-            ury = ury > tmpBox.top()    ? ury : tmpBox.top();
-          }
-        }
-      }
-      //std::cout <<"dieBox after term " <<llx <<" " <<lly <<" " <<urx <<" " <<ury <<std::endl;
-      boxIn.set(llx, lly, urx, ury);
-    }
-    void getBoundaryBBox(frBox &boxIn) const {
-      if (boundaries.size()) {
-        boundaries.begin()->getBBox(boxIn);
-      }
-      frCoord llx = boxIn.left();
-      frCoord lly = boxIn.bottom();
-      frCoord urx = boxIn.right();
-      frCoord ury = boxIn.top();
-      frBox tmpBox;
-      for (auto &boundary: boundaries) {
-        boundary.getBBox(tmpBox);
-        llx = llx < tmpBox.left()   ? llx : tmpBox.left();
-        lly = lly < tmpBox.bottom() ? lly : tmpBox.bottom();
-        urx = urx > tmpBox.right()  ? urx : tmpBox.right();
-        ury = ury > tmpBox.top()    ? ury : tmpBox.top();
-      }
-      boxIn.set(llx, lly, urx, ury);
-    }
-    const std::vector<frBoundary>& getBoundaries() const {
-      return boundaries;
-    }
-    std::vector<frBoundary>& getBoundaries() {
-      return boundaries;
-    }
-    std::vector< std::unique_ptr<frBlockage> >& getBlockages() {
-      return blockages;
-    }
-    const std::vector< std::unique_ptr<frBlockage> >& getBlockages() const {
-      return blockages;
-    }
-    const frCMap& getCMap() const {
-      return cMap;
-    }
-    frCMap& getCMap() {
-      return cMap;
-    }
-    const std::vector<frGCellPattern>& getGCellPatterns() const {
-      return gCellPatterns;
-    }
-    std::vector<frGCellPattern>& getGCellPatterns() {
-      return gCellPatterns;
-    }
-    std::vector<frGuide*> getGuides() const {
-      std::vector<frGuide*> sol;
-      for(auto &net: getNets()) {
-        for (auto &guide: net->getGuides()) {
-          sol.push_back(guide.get());
-        }
-      }
-      return sol;
-    }
-    const frString& getName() const {
-      return name;
-    }
-    const std::vector<std::unique_ptr<frInst> >& getInsts() const {
-      return insts;
-    }
-    std::vector<std::unique_ptr<frInst> >& getInsts() {
-      return insts;
-    }
-    std::vector<std::unique_ptr<frNet> >& getNets() {
-      return nets;
-    }
-    const std::vector<std::unique_ptr<frNet> >& getNets() const {
-      return nets;
-    }
-    std::vector<std::unique_ptr<frNet> >& getSNets() {
-      return snets;
-    }
-    const std::vector<std::unique_ptr<frNet> >& getSNets() const {
-      return snets;
-    }
-    std::vector<frTrackPattern*> getTrackPatterns() const {
-      std::vector<frTrackPattern*> sol;
-      for (auto &m: trackPatterns) {
-        for (auto &n: m) {
-          sol.push_back(n.get());
-        }
-      }
-      return sol;
-    }
-    const std::vector<std::unique_ptr<frTrackPattern> >& getTrackPatterns(frLayerNum lNum) const {
-      return trackPatterns.at(lNum);
-    }
-    std::vector<std::unique_ptr<frTrackPattern> >& getTrackPatterns(frLayerNum lNum) {
-      return trackPatterns.at(lNum);
-    }
-    std::vector<std::unique_ptr<frTerm> >& getTerms() {
-      return terms;
-    }
-    const std::vector<std::unique_ptr<frTerm> >& getTerms() const {
-      return terms;
-    }
-    frTerm* getTerm(const std::string &in) const {
-      auto it = name2term.find(in);
-      if (it == name2term.end()) {
-        return nullptr;
-      } else {
-        return it->second;
-      }
-    }
-    // idx must be legal
-    void getGCellBox(const frPoint &idx, frBox &box) const {
-      frBox dieBox;
-      getBoundaryBBox(dieBox);
-      auto &gp = getGCellPatterns();
-      auto &xgp = gp[0];
-      auto &ygp = gp[1];
-      frCoord xl = (frCoord)xgp.getSpacing() * idx.x()       + xgp.getStartCoord();
-      frCoord yl = (frCoord)ygp.getSpacing() * idx.y()       + ygp.getStartCoord();
-      frCoord xh = (frCoord)xgp.getSpacing() * (idx.x() + 1) + xgp.getStartCoord();
-      frCoord yh = (frCoord)ygp.getSpacing() * (idx.y() + 1) + ygp.getStartCoord();
-      if (idx.x() == 0) {
-        xl = dieBox.left();
-      }
-      if (idx.y() == 0) {
-        yl = dieBox.bottom();
-      }
-      if (idx.x() == (int)xgp.getCount() - 1) {
-        xh = dieBox.right();
-      }
-      if (idx.y() == (int)ygp.getCount() - 1) {
-        yh = dieBox.top();
-      }
-      box.set(xl, yl, xh, yh);
-    }
-    void getGCellCenter(const frPoint &idx, frPoint &pt) const {
-      frBox dieBox;
-      getBoundaryBBox(dieBox);
-      auto &gp = getGCellPatterns();
-      auto &xgp = gp[0];
-      auto &ygp = gp[1];
-      frCoord xl = (frCoord)xgp.getSpacing() * idx.x()       + xgp.getStartCoord();
-      frCoord yl = (frCoord)ygp.getSpacing() * idx.y()       + ygp.getStartCoord();
-      frCoord xh = (frCoord)xgp.getSpacing() * (idx.x() + 1) + xgp.getStartCoord();
-      frCoord yh = (frCoord)ygp.getSpacing() * (idx.y() + 1) + ygp.getStartCoord();
-      if (idx.x() == 0) {
-        xl = dieBox.left();
-      }
-      if (idx.y() == 0) {
-        yl = dieBox.bottom();
-      }
-      if (idx.x() == (int)xgp.getCount() - 1) {
-        xh = dieBox.right();
-      }
-      if (idx.y() == (int)ygp.getCount() - 1) {
-        yh = dieBox.top();
-      }
-      pt.set((xl + xh) / 2, (yl + yh) / 2);
-    }
-    void getGCellIdx(const frPoint &pt, frPoint &idx) const {
-      auto &gp = getGCellPatterns();
-      auto &xgp = gp[0];
-      auto &ygp = gp[1];
-      frCoord idxX = (pt.x() - xgp.getStartCoord()) / (frCoord)xgp.getSpacing();
-      frCoord idxY = (pt.y() - ygp.getStartCoord()) / (frCoord)ygp.getSpacing();
-      if (idxX < 0) {
-        idxX = 0;
-      }
-      if (idxY < 0) {
-        idxY = 0;
-      }
-      if (idxX >= (int)xgp.getCount()) {
-        idxX = (int)xgp.getCount() - 1;
-      }
-      if (idxY >= (int)ygp.getCount()) {
-        idxY = (int)ygp.getCount() - 1;
-      }
-      idx.set(idxX, idxY);
-    }
-    MacroClassEnum getMacroClass() {
-      return macroClass;
-    }
-    const frList<std::unique_ptr<frMarker> >& getMarkers() const {
-      return markers;
-    }
-    frList<std::unique_ptr<frMarker> >& getMarkers() {
-      return markers;
-    }
-    int getNumMarkers() const {
-      return markers.size();
-    }
-    // setters
-    void setDBUPerUU(frUInt4 uIn) {
-      dbUnit = uIn;
-    }
-    void setName(const frString &nameIn) {
-      name = nameIn;
-    }
-    void addTerm(std::unique_ptr<frTerm> &in) {
-      name2term[in->getName()] = in.get();
-      terms.push_back(std::move(in));
-    }
-    void addInst(std::unique_ptr<frInst> &in) {
-      name2inst[in->getName()] = in.get();
-      //in->setId(insts.size());
-      insts.push_back(std::move(in));
-    }
-    void addNet(std::unique_ptr<frNet> &in) {
-      name2net[in->getName()] = in.get();
-      //in->setId(snets.size() + nets.size());
-      nets.push_back(std::move(in));
-    }
-    void addSNet(std::unique_ptr<frNet> &in) {
-      name2snet[in->getName()] = in.get();
-      //in->setId(snets.size() + nets.size());
-      snets.push_back(std::move(in));
-    }
-    void setBoundaries(const std::vector<frBoundary> &in) {
-      boundaries = in;
-    }
-    void setBlockages(std::vector<std::unique_ptr<frBlockage> > &in) {
-      for (auto &blk : in) {
-        blockages.push_back(std::move(blk));
-      }
-    }
-    void setCMap(const frCMap &cIn) {
-      cMap = cIn;
-    }
-    void setGCellPatterns(const std::vector<frGCellPattern> &gpIn) {
-      gCellPatterns = gpIn;
-    }
-    void setMacroClass(const MacroClassEnum &in) {
-      macroClass = in;
-    }
-    void addMarker(std::unique_ptr<frMarker> &in) {
-      auto rptr = in.get();
-      markers.push_back(std::move(in));
-      rptr->setIter(--(markers.end()));
-    }
-    void removeMarker(frMarker* in) {
-      markers.erase(in->getIter());
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcBlock;
-    }
-    friend class io::Parser;
-
-  protected:
-    frString                                                      name;
-    frUInt4                                                       dbUnit;
-
-    MacroClassEnum                                                macroClass;
-
-    std::map<std::string, frInst*>                                name2inst;
-    std::vector<std::unique_ptr<frInst> >                         insts;
-
-    std::map<std::string, frTerm*>                                name2term;
-    std::vector<std::unique_ptr<frTerm> >                         terms;
-
-    std::map<std::string, frNet*>                                 name2net;
-    std::vector<std::unique_ptr<frNet> >                          nets;
-    
-    std::map<std::string, frNet*>                                 name2snet;
-    std::vector<std::unique_ptr<frNet> >                          snets;
-
-    std::vector<std::unique_ptr<frBlockage> >                     blockages;
-    
-    std::vector<frBoundary>                                       boundaries;
-    std::vector<std::vector<std::unique_ptr<frTrackPattern> > >   trackPatterns;
-    frCMap                                                        cMap;
-    std::vector<frGCellPattern>                                   gCellPatterns;
-
-    frList<std::unique_ptr<frMarker> >                            markers;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockObject.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockObject.h
deleted file mode 100644
index 1f4e695..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockObject.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BLOCKOBJECT_H_
-#define _FR_BLOCKOBJECT_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frBlockObject {
-  public:
-    // constructors
-    //frBlockObject() {}
-    frBlockObject(): id(-1) {}
-    frBlockObject(const frBlockObject &in): id(in.id) {}
-    virtual ~frBlockObject() {}
-    // getters
-    int getId() const {
-      return id;
-    }
-    // setters
-    void setId(int in) {
-      id = in;
-    }
-    // others
-    virtual frBlockObjectEnum typeId() const {
-      return frcBlockObject;
-    }
-    bool operator<(const frBlockObject &rhs) const {
-      return id < rhs.id;
-    }
-  protected:
-    int id;
-  };
-  struct frBlockObjectComp {
-    bool operator()(const frBlockObject* lhs, const frBlockObject* rhs) const {
-      return *lhs < *rhs;
-    }
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockage.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockage.h
deleted file mode 100644
index 6a7dd8d..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBlockage.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BLOCKAGE_H_
-#define _FR_BLOCKAGE_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frFig.h"
-
-namespace fr {
-  class frBlockage: public frFig {
-  public:
-    // constructors
-    frBlockage(): frFig(), points(), owner(nullptr) {}
-    // getters
-    frBlockObject* getOwner() const {
-      return owner;
-    }
-    const std::vector<frPoint>& getPoints() const {
-      return points;
-    }
-    std::vector<frPoint>& getPoints() {
-      return points;
-    }
-    frUInt4 getNumPoints() const {
-      return points.size();
-    }
-    // setters
-    void setOwner(frBlockObject* in) {
-      owner = in;
-    }
-    void setPoints(const fr::frCollection<frPoint> &pIn) {
-      points = pIn;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcBlockage;
-    }
-
-    void getBBox(frBox &boxIn) const override {
-      frCoord llx = 0;
-      frCoord lly = 0;
-      frCoord urx = 0;
-      frCoord ury = 0;
-      if (points.size()) {
-        llx = points.begin()->x();
-        urx = points.begin()->x();
-        lly = points.begin()->y();
-        ury = points.begin()->y();
-      }
-      for (auto &point: points) {
-        llx = (llx < point.x()) ? llx : point.x();
-        lly = (lly < point.y()) ? lly : point.y();
-        urx = (urx > point.x()) ? urx : point.x();
-        ury = (ury > point.y()) ? ury : point.y();
-      }
-      boxIn.set(llx, lly, urx, ury);
-    }
-    void move(const frTransform &xform) override {
-      for (auto &point: points) {
-        point.transform(xform);
-      }
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-  protected:
-    std::vector<frPoint> points;
-    frBlockObject*       owner; // optional, set later
-  };
-
-  class frLayerBlockage: public frBlockage {
-  public:
-    // constructors
-    frLayerBlockage(): frBlockage() {}
-    // getters
-    frLayerNum getLayerNum() const {
-      return layerNum;
-    }
-    // setters
-    void setLayerNum(frLayerNum numIn) {
-      layerNum = numIn;
-    }
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcLayerBlockage;
-    }
-  protected:
-    frLayerNum layerNum;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBoundary.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frBoundary.h
deleted file mode 100644
index 94f9c2b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frBoundary.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BOUNDARY_H_
-#define _FR_BOUNDARY_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frFig.h"
-
-namespace fr {
-  class frBoundary: public frFig {
-  public:
-    // constructors
-    frBoundary(): frFig() {}
-    // getters
-    const std::vector<frPoint>& getPoints() const {
-      return points;
-    }
-    std::vector<frPoint>& getPoints() {
-      return points;
-    }
-    frUInt4 getNumPoints() const {
-      return points.size();
-    }
-    // setters
-    void setPoints(const std::vector<frPoint> &pIn) {
-      points = pIn;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcBoundary;
-    }
-
-    void getBBox(frBox &boxIn) const override {
-      frCoord llx = 0;
-      frCoord lly = 0;
-      frCoord urx = 0;
-      frCoord ury = 0;
-      if (points.size()) {
-        llx = points.begin()->x();
-        urx = points.begin()->x();
-        lly = points.begin()->y();
-        ury = points.begin()->y();
-      }
-      for (auto &point: points) {
-        llx = (llx < point.x()) ? llx : point.x();
-        lly = (lly < point.y()) ? lly : point.y();
-        urx = (urx > point.x()) ? urx : point.x();
-        ury = (ury > point.y()) ? ury : point.y();
-      }
-      boxIn.set(llx, lly, urx, ury);
-    }
-    void move(const frTransform &xform) override {
-      for (auto &point: points) {
-        point.transform(xform);
-      }
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-  protected:
-    std::vector<frPoint> points;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frCMap.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frCMap.h
deleted file mode 100644
index cf51230..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frCMap.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_CMAP_H_
-#define _FR_CMAP_H_
-
-#include "db/obj/frBlockObject.h"
-
-namespace fr {
-  class frGCellPattern: public frBlockObject {
-  public:
-    // constructors
-    frGCellPattern(): frBlockObject() {}
-    // getters
-    bool isHorizontal() const {
-      return horizontal;
-    }
-    frCoord getStartCoord() const {
-      return startCoord;
-    }
-    frUInt4 getSpacing() const {
-      return spacing;
-    }
-    frUInt4 getCount() const {
-      return count;
-    }
-    // setters
-    void setHorizontal(bool isH) {
-      horizontal = isH;
-    }
-    void setStartCoord(frCoord scIn) {
-      startCoord = scIn;
-    }
-    void setSpacing(frUInt4 sIn) {
-      spacing = sIn;
-    }
-    void setCount(frUInt4 cIn) {
-      count = cIn;
-    }
-    // others
-  protected:
-    bool    horizontal;
-    frCoord startCoord;
-    frUInt4 spacing;
-    frUInt4 count;
-  };
-
-  class frCMap: public frBlockObject {
-  public:
-    // constructors
-    frCMap(): frBlockObject(), numX(0), numY(0) {}
-    // getters
-    frUInt4 getThroughDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return cmap_through.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getLocalDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return cmap_local.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getEdge1Demand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return cmap_edge1.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getEdge2Demand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return cmap_edge2.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getUpDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return cmap_up.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getDownDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      if (layerNum == 0) { 
-        return 0;
-      } else {
-        return cmap_up.at(xIndex).at(yIndex).at(layerNum/2 - 1);
-      }
-    }
-    frUInt4 getSupply(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum) const {
-      return supply.at(xIndex).at(yIndex).at(layerNum/2);
-    }
-    frUInt4 getNumX() {
-      return numX;
-    }
-    frUInt4 getNumY() {
-      return numY;
-    }
-    // setters
-    void setThroughDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      cmap_through.at(xIndex).at(yIndex).at(layerNum/2) = num;
-    }
-    void setLocalDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      cmap_local.at(xIndex).at(yIndex).at(layerNum/2)   = num;
-    }
-    void setEdge1Demand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      cmap_edge1.at(xIndex).at(yIndex).at(layerNum/2)   = num;
-    }
-    void setEdge2Demand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      cmap_edge2.at(xIndex).at(yIndex).at(layerNum/2)   = num;
-    }
-    void setUpDemand(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      cmap_up.at(xIndex).at(yIndex).at(layerNum/2)      = num;
-    }
-    void setSupply(frUInt4 xIndex, frUInt4 yIndex, frLayerNum layerNum, frUInt4 num) {
-      supply.at(xIndex).at(yIndex).at(layerNum/2)      = num;
-    }
-    // others
-    void init(frUInt4 numX, frUInt4 numY, frLayerNum topLayer) {
-      this->numX = numX;
-      this->numY = numY;
-      frCollection<frUInt4> v3(topLayer/2 + 1, 0);
-      frCollection<frCollection<frUInt4> > v2(numY, v3);
-      frCollection<frCollection<frCollection<frUInt4> > > v1(numX, v2);
-      supply = cmap_through = cmap_local = cmap_edge1=  cmap_edge2 = cmap_up = v1;
-    }
-
-  protected:
-    frUInt4 numX, numY;
-    frCollection<frCollection<frCollection<frUInt4> > > supply;
-    frCollection<frCollection<frCollection<frUInt4> > > cmap_through;
-    frCollection<frCollection<frCollection<frUInt4> > > cmap_local;
-    frCollection<frCollection<frCollection<frUInt4> > > cmap_edge1;
-    frCollection<frCollection<frCollection<frUInt4> > > cmap_edge2;
-    frCollection<frCollection<frCollection<frUInt4> > > cmap_up;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frFig.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frFig.h
deleted file mode 100644
index d4dab97..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frFig.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_FIG_H_
-#define _FR_FIG_H_
-
-#include <memory>
-#include "db/obj/frBlockObject.h"
-#include "db/infra/frBox.h"
-#include "db/infra/frTransform.h"
-
-namespace fr {
-  class frFig: public frBlockObject {
-  public:
-    // constructors
-    frFig(): frBlockObject() {}
-    // getters
-    virtual void getBBox(frBox &box) const = 0;
-    //virtual void getBBox(box_t &box) const = 0;
-    // setters
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-    virtual void move(const frTransform &xform) = 0;
-    virtual bool overlaps(const frBox &box) const = 0;
-  protected:
-  };
-
-  class frNet;
-  class frConnFig: public frFig {
-  public:
-    // constructors
-    frConnFig(): frFig() {}
-    // getters
-    virtual bool hasNet() const = 0;
-    virtual frNet* getNet() const = 0;
-    // setters
-    virtual void addToNet(frNet* in) = 0;
-    virtual void removeFromNet() = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-  class frPin;
-  class frPinFig: public frConnFig {
-  public:
-    frPinFig(): frConnFig() {}
-    // getters
-    virtual bool hasPin() const = 0;
-    virtual frPin* getPin() const = 0;
-    // setters
-    virtual void addToPin(frPin* in) = 0;
-    virtual void removeFromPin() = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frGuide.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frGuide.h
deleted file mode 100644
index 1d189a0..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frGuide.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_GUIDE_H_
-#define _FR_GUIDE_H_
-
-#include "frBaseTypes.h"
-#include "db/obj/frFig.h"
-
-namespace fr {
-  class frNet;
-  class frGuide: public frConnFig {
-  public:
-    frGuide(): frConnFig(), begin(), end(), beginLayer(0), endLayer(0), routeObj(), net(nullptr) {}
-    frGuide(const frGuide &in): frConnFig(), begin(in.begin), end(in.end), beginLayer(in.beginLayer),
-                                endLayer(in.endLayer), routeObj(), net(nullptr) {}
-    // getters
-    void getPoints(frPoint &beginIn, frPoint &endIn) const {
-      beginIn.set(begin);
-      endIn.set(end);
-    }
-    frLayerNum getBeginLayerNum() const {
-      return beginLayer;
-    }
-    frLayerNum getEndLayerNum() const {
-      return endLayer;
-    }
-    bool hasRoutes() const {
-      return routeObj.empty() ? false : true;
-    }
-    std::vector<std::unique_ptr<frConnFig> >& getRoutes() {
-      return routeObj;
-    }
-    const std::vector<std::unique_ptr<frConnFig> >& getRoutes() const {
-      return routeObj;
-    }
-    // setters
-    void setPoints(const frPoint &beginIn, const frPoint &endIn) {
-      begin.set(beginIn);
-      end.set(endIn);
-    }
-    void setBeginLayerNum (frLayerNum numIn) {
-      beginLayer = numIn;
-    }
-    void setEndLayerNum (frLayerNum numIn) {
-      endLayer = numIn;
-    }
-    void addRoute(std::unique_ptr<frConnFig> &cfgIn) {
-      routeObj.push_back(std::move(cfgIn));
-    }
-    void setRoutes(std::vector<std::unique_ptr<frConnFig> > &routesIn) {
-      routeObj = std::move(routesIn);
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcGuide;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (net);
-    }
-    frNet* getNet() const override {
-      return net;
-    }
-    void addToNet(frNet* in) override {
-      net = in;
-    }
-    void removeFromNet() override {
-      net = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps, incomplete
-     */
-    // needs to be updated
-    void getBBox(frBox &boxIn) const override {
-      boxIn.set(begin, end);
-    }
-    void move(const frTransform &xform) override {
-      ;
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-
-  protected:
-    frPoint begin;
-    frPoint end;
-    frLayerNum beginLayer;
-    frLayerNum endLayer;
-    std::vector<std::unique_ptr<frConnFig> > routeObj;
-    frNet* net;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.cpp b/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.cpp
deleted file mode 100644
index e292da6..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frInst.h"
-#include "frBlock.h"
-using namespace std;
-using namespace fr;
-
-void frInst::getBBox (frBox &boxIn) const {
-  getRefBlock()->getBBox(boxIn);
-  frTransform xform;
-  getTransform(xform);
-  frPoint origin(boxIn.left(), boxIn.bottom());
-  origin.transform(frTransform(0, 0, xform.orient()));
-  xform.set(xform.xOffset() + origin.x(), xform.yOffset() + origin.y());
-  frPoint s(boxIn.right(), boxIn.top());
-  xform.updateXform(s);
-  boxIn.transform(xform);
-}
-
-void frInst::getUpdatedXform(frTransform &in, bool noOrient) const {
-  getTransform(in);
-  frBox mbox;
-  getRefBlock()->getBoundaryBBox(mbox);
-  frPoint origin(mbox.left(), mbox.bottom());
-  origin.transform(frTransform(0, 0, in.orient()));
-  in.set(in.xOffset() + origin.x(), in.yOffset() + origin.y());
-  if (!noOrient) {
-    frPoint s(mbox.right(), mbox.top());
-    in.updateXform(s);
-  } else {
-    in.set(frOrient(frcR0));
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.h
deleted file mode 100644
index 89215ff..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInst.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_INST_H_
-#define _FR_INST_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frRef.h"
-#include "db/obj/frBlockage.h"
-#include "db/obj/frInstTerm.h"
-#include "db/obj/frInstBlockage.h"
-
-namespace fr {
-  class frBlock;
-  class frInst: public frRef {
-  public:
-    // constructors
-    frInst(): frRef() {}
-    //frInst(const frInst &instIn): frRef(), name(instIn.name), cellName(instIn.cellName),
-    //                              instTerms(), xform(instIn.xform) {
-    //  instTerms.clear();
-    //  instTerms.shrink_to_fit();
-    //  for (auto &m: instIn.instTerms) {
-    //    copyInstTerm(m);
-    //  }
-    //}
-    // getters
-    const frString& getName() const {
-      return name;
-    }
-    frBlock* getRefBlock() const {
-      return refBlock;
-    }
-    const std::vector<std::unique_ptr<frInstTerm> >& getInstTerms() const {
-      return instTerms;
-    }
-    std::vector<std::unique_ptr<frInstTerm> >& getInstTerms() {
-      return instTerms;
-    }
-    const std::vector<std::unique_ptr<frInstBlockage> >& getInstBlockages() const {
-      return instBlockages;
-    }
-    std::vector<std::unique_ptr<frInstBlockage> >& getInstBlockages() {
-      return instBlockages;
-    }
-    // setters
-    void setName(const frString &tmpString) {
-      name = tmpString;
-    }
-    void setRefBlock(frBlock* in) {
-      refBlock = in;
-    }
-    void addInstTerm(std::unique_ptr<frInstTerm> &in) {
-      instTerms.push_back(std::move(in));
-    }
-    void addInstBlockage(std::unique_ptr<frInstBlockage> &in) {
-      instBlockages.push_back(std::move(in));
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcInst;
-    }
-
-
-    /* from frRef
-     * getOrient
-     * setOrient
-     * getOrigin
-     * setOrigin
-     * getTransform
-     * setTransform
-     */
-
-    frOrient getOrient() const override {
-      return xform.orient();
-    }
-    void setOrient(const frOrient &tmpOrient) override {
-      xform.set(tmpOrient);
-    }
-    void getOrigin(frPoint &tmpOrigin) const override {
-      tmpOrigin.set(xform.xOffset(), xform.yOffset());
-    }
-    void setOrigin(const frPoint &tmpPoint) override {
-      xform.set(tmpPoint);
-    }
-    void getTransform(frTransform &xformIn) const override {
-      xformIn.set(xform.xOffset(), xform.yOffset(), xform.orient());
-    }
-    void setTransform(const frTransform &xformIn) override {
-      xform.set(xformIn.xOffset(), xformIn.yOffset(), xformIn.orient());
-    }
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-
-    bool hasPin() const override {
-      return false;
-    }
-    frPin* getPin() const override {
-      return nullptr;
-    }
-    void addToPin(frPin* in) override {
-      ;
-    }
-    void removeFromPin() override {
-      ;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-
-    bool hasNet() const override {
-      return false;
-    }
-    frNet* getNet() const override {
-      return nullptr;
-    }
-    void addToNet(frNet* in) override {
-      ;
-    }
-    void removeFromNet() override {
-      ;
-    }
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    // BX 181204 implemented
-    void getBBox (frBox &boxIn) const override;
-    
-    void move(const frTransform &xform) override {
-      ;
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-    void getUpdatedXform(frTransform &in, bool noOrient = false) const;
-  protected:
-    frString                                       name;
-    frBlock*                                       refBlock;
-    std::vector<std::unique_ptr<frInstTerm> >      instTerms;
-    std::vector<std::unique_ptr<frInstBlockage> >  instBlockages;
-    frTransform                                    xform;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstBlockage.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstBlockage.h
deleted file mode 100644
index 86b3642..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstBlockage.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_INSTBLOCKAGE_H_
-#define _FR_INSTBLOCKAGE_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-#include "db/obj/frBlockage.h"
-
-namespace fr {
-  class frInst;
-  class frInstBlockage: public frBlockObject {
-  public:
-    // constructors
-    frInstBlockage(): frBlockObject(), inst(nullptr), blockage(nullptr) {}
-    //frInstTerm(const frInstTerm &in): frBlockObject(), inst(in.inst), term(in.term), 
-    //                                  net(in.net) {}
-    // getters
-    frInst* getInst() const {
-      return inst;
-    }
-    frBlockage* getBlockage() const {
-      return blockage;
-    }
-    // setters
-    void addToInst(frInst* in) {
-      inst = in;
-    }
-    // do not call from outside
-    void addBlockage(frBlockage* in) {
-      blockage = in;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcInstBlockage;
-    }
-  protected:
-    frInst*     inst;
-    frBlockage* blockage;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstTerm.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstTerm.h
deleted file mode 100644
index a456850..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frInstTerm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_INSTTERM_H_
-#define _FR_INSTTERM_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-#include "db/obj/frTerm.h"
-
-namespace fr {
-  class frNet;
-  class frInst;
-
-  class frInstTerm: public frBlockObject {
-  public:
-    // constructors
-    frInstTerm(): frBlockObject(), inst(nullptr), term(nullptr), net(nullptr) {}
-    frInstTerm(const frInstTerm &in): frBlockObject(), inst(in.inst), term(in.term), 
-                                      net(in.net) {}
-    // getters
-    bool hasNet() const {
-      return (net);
-    }
-    frNet* getNet() const {
-      return net;
-    }
-    frInst* getInst() const {
-      return inst;
-    }
-    frTerm* getTerm() const {
-      return term;
-    }
-    void addToNet(frNet* in) {
-      net = in;
-    }
-    // setters
-    void addToInst(frInst* in) {
-      inst = in;
-    }
-    // do not call from outside
-    void addTerm(frTerm* in) {
-      term = in;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcInstTerm;
-    }
-  protected:
-    frInst* inst;
-    frTerm* term;
-    frNet*  net;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frMarker.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frMarker.h
deleted file mode 100644
index 50ebfb4..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frMarker.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_MARKER_H_
-#define _FR_MARKER_H_
-
-#include "db/obj/frFig.h"
-//#include "db/tech/frConstraint.h"
-
-namespace fr {
-  class frConstraint;
-  class frMarker: public frFig {
-  public:
-    // constructors
-    frMarker(): frFig(), constraint(nullptr), bbox(), layerNum(0), srcs(), iter() {}
-    frMarker(const frMarker &in): constraint(in.constraint), bbox(in.bbox), layerNum(in.layerNum),
-                                  srcs(in.srcs), iter() {}
-    // setters
-    void setConstraint(frConstraint* constraintIn) {
-      constraint = constraintIn;
-    }
-
-    void setBBox(const frBox &bboxIn) {
-      bbox = bboxIn;
-    }
-
-    void setLayerNum(const frLayerNum &layerNumIn) {
-      layerNum = layerNumIn;
-    }
-
-    // void addNet(frNet* netIn) {
-    //   srcs.push_back(netIn);
-    // }
-    // void addInstTerm(frInstTerm* instTermIn) {
-    //   srcs.push_back(instTermIn);
-    // }
-    // void addTerm(frTerm* termIn) {
-    //   srcs.push_back(termIn);
-    // }
-    void addSrc(frBlockObject *srcIn) {
-      srcs.push_back(srcIn);
-    }
-    // getters
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps in .cpp
-     */
-
-    void getBBox(frBox &bboxIn) const override {
-      bboxIn.set(bbox);
-    }
-
-    frLayerNum getLayerNum() const {
-      return layerNum;
-    }
-
-    // frVector<frNet*> getNets() const {
-    //   return nets;
-    // }
-
-    frVector<frBlockObject*> getSrcs() {
-      return srcs;
-    }
-
-    frConstraint* getConstraint() {
-      return constraint;
-    }
-
-
-    void move(const frTransform &xform) override {
-      
-    }
-
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcMarker;
-    }
-
-    void setIter(frListIter<std::unique_ptr<frMarker> >& in) {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frMarker> > getIter() const {
-      return iter;
-    }
-
-  protected:
-    frConstraint* constraint;
-    frBox bbox;
-    frLayerNum layerNum;
-    frVector<frBlockObject*> srcs; // either frNet or instTerm or term
-    frListIter<std::unique_ptr<frMarker> > iter;
-  };
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frNet.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frNet.h
deleted file mode 100644
index a85b9db..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frNet.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_NET_H_
-#define _FR_NET_H_
-
-//#include <boost/graph/adjacency_list.hpp>
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-#include "db/obj/frGuide.h"
-#include "db/obj/frShape.h"
-#include "db/obj/frVia.h"
-
-namespace fr {
-  class frInstTerm;
-  class frTerm;
-
-  class frNet: public frBlockObject {
-  public:
-    // constructors
-    //frNet(): frBlockObject() {}
-    frNet(const frString &in): frBlockObject(), name(in), instTerms(), terms(), shapes(), vias(), pwires(), guides(), type(frNetEnum::frcNormalNet) {}
-    // getters
-    const frString& getName() const {
-      return name;
-    }
-    const std::vector<frInstTerm*>& getInstTerms() const {
-      return instTerms;
-    }
-    std::vector<frInstTerm*>& getInstTerms() {
-      return instTerms;
-    }
-    const std::vector<frTerm*>& getTerms() const {
-      return terms;
-    }
-    std::vector<frTerm*>& getTerms() {
-      return terms;
-    }
-    std::list<std::unique_ptr<frShape> >& getShapes() {
-      return shapes;
-    }
-    const std::list<std::unique_ptr<frShape> >& getShapes() const {
-      return shapes;
-    }
-    std::list<std::unique_ptr<frVia> >& getVias() {
-      return vias;
-    }
-    const std::list<std::unique_ptr<frVia> >& getVias() const {
-      return vias;
-    }
-    std::list<std::unique_ptr<frShape> >& getPatchWires() {
-      return pwires;
-    }
-    const std::list<std::unique_ptr<frShape> >& getPatchWires() const {
-      return pwires;
-    }
-    std::vector<std::unique_ptr<frGuide> >& getGuides() {
-      return guides;
-    }
-    const std::vector<std::unique_ptr<frGuide> >& getGuides() const {
-      return guides;
-    }
-    // setters
-    void addInstTerm(frInstTerm* in) {
-      instTerms.push_back(in);
-    }
-    void addTerm(frTerm* in) {
-      terms.push_back(in);
-    }
-    void setName(const frString &stringIn) {
-      name = stringIn;
-    }
-    void addShape(std::unique_ptr<frShape> &in) {
-      in->addToNet(this);
-      auto rptr = in.get();
-      shapes.push_back(std::move(in));
-      rptr->setIter(--shapes.end());
-    }
-    void addVia(std::unique_ptr<frVia> &in) {
-      in->addToNet(this);
-      auto rptr = in.get();
-      vias.push_back(std::move(in));
-      rptr->setIter(--vias.end());
-    }
-    void addPatchWire(std::unique_ptr<frShape> &in) {
-      in->addToNet(this);
-      auto rptr = in.get();
-      pwires.push_back(std::move(in));
-      rptr->setIter(--pwires.end());
-    }
-    void addGuide(std::unique_ptr<frGuide> &in) {
-      auto rptr = in.get();
-      rptr->addToNet(this);
-      guides.push_back(std::move(in));
-      //rptr->setIter(--vias.end());
-    }
-    void clearGuides() {
-      guides.clear();
-    }
-    void removeShape(frShape* in) {
-      shapes.erase(in->getIter());
-    }
-    void removeVia(frVia* in) {
-      vias.erase(in->getIter());
-    }
-    void removePatchWire(frShape* in) {
-      pwires.erase(in->getIter());
-    }
-    // others
-    frNetEnum getType() const {
-      return type;
-    }
-    void setType(frNetEnum in) {
-      type = in;
-    }
-    virtual frBlockObjectEnum typeId() const override {
-      return frcNet;
-    }
-  protected:
-    frString                                  name;
-    std::vector<frInstTerm*>                  instTerms;
-    std::vector<frTerm*>                      terms;     // terms is IO
-    std::list<std::unique_ptr<frShape> >      shapes;
-    std::list<std::unique_ptr<frVia> >        vias;
-    std::list<std::unique_ptr<frShape> >      pwires;
-    //std::list<std::unique_ptr<frGuide> >    guides;
-    std::vector<std::unique_ptr<frGuide> >    guides;
-    frNetEnum                                 type;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.cpp b/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.cpp
deleted file mode 100644
index b81feb9..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frPin.h"
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.h
deleted file mode 100644
index 5e0dc4f..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frPin.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_PIN_H_
-#define _FR_PIN_H_
-
-#include <iostream>
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-#include "db/obj/frShape.h"
-#include "FlexAccessPattern.h"
-
-
-namespace fr {
-  class frTerm;
-
-  class frPin: public frBlockObject {
-  public:
-    // constructors
-    frPin(): frBlockObject(), term(nullptr), pinFigs()/*, accessPatterns()*/ {}
-    frPin(const frPin &in): frBlockObject(), term(in.term)/*, accessPatterns(in.accessPatterns)*/ {
-      for (auto &uPinFig: in.getFigs()) {
-        auto pinFig = uPinFig.get();
-        if (pinFig->typeId() == frcRect) {
-          std::unique_ptr<frPinFig> tmp = std::make_unique<frRect>(*static_cast<frRect*>(pinFig));
-          addPinFig(tmp);
-        } else if (pinFig->typeId() == frcPolygon) {
-          std::unique_ptr<frPinFig> tmp = std::make_unique<frPolygon>(*static_cast<frPolygon*>(pinFig));
-          addPinFig(tmp);
-        } else {
-          std::cout <<"Unsupported pinFig in copy constructor" <<std::endl;
-          exit(1);
-        }
-      }
-    }
-    frPin(const frPin &in, const frTransform &xform): frBlockObject(), term(in.term)/*, accessPatterns(in.accessPatterns)*/ {
-      for (auto &uPinFig: in.getFigs()) {
-        auto pinFig = uPinFig.get();
-        if (pinFig->typeId() == frcRect) {
-          std::unique_ptr<frPinFig> tmp = std::make_unique<frRect>(*static_cast<frRect*>(pinFig));
-          tmp->move(xform);
-          addPinFig(tmp);
-        } else if (pinFig->typeId() == frcPolygon) {
-          std::unique_ptr<frPinFig> tmp = std::make_unique<frPolygon>(*static_cast<frPolygon*>(pinFig));
-          tmp->move(xform);
-          addPinFig(tmp);
-        } else {
-          std::cout <<"Unsupported pinFig in copy constructor" <<std::endl;
-          exit(1);
-        }
-      }
-    }
-
-    // getters
-    frTerm* getTerm() const {
-      return term;
-    }
-    const std::vector< std::unique_ptr<frPinFig> >& getFigs() const {
-      return pinFigs;
-    }
-    std::vector< std::unique_ptr<frPinFig> >& getFigs() {
-      return pinFigs;
-    }
-    //frList<FlexAccessPattern>& getAccessPatterns() {
-    //  return accessPatterns;
-    //}
-    frVector<std::unique_ptr<FlexAccessPattern> >& getAccessPatterns() {
-      return accessPatterns;
-    }
-
-    frVector<std::unique_ptr<FlexAccessPattern> >& getAccessPatterns(const frOrient &oriIn) {
-      return orient2APs[oriIn];
-    }
-
-    // setters
-    // cannot have setterm, must be available when creating
-    void setTerm(frTerm *in) {
-      term = in;
-    }
-    void addPinFig(std::unique_ptr<frPinFig> &in) {
-      in->addToPin(this);
-      pinFigs.push_back(std::move(in));
-    }
-    void addLayerShape(const frLayerNum &layerNum, const Rectangle &rectIn) {
-      using namespace boost::polygon::operators;
-      layer2PolySet[layerNum] += rectIn;
-    }
-    void addLayerShape(const frLayerNum &layerNum, const Polygon &polyIn) {
-      using namespace boost::polygon::operators;
-      layer2PolySet[layerNum] += polyIn;
-    }
-    std::map< frLayerNum, PolygonSet >& getLayer2PolySet() {
-      return layer2PolySet;
-    }
-    //frListIter<FlexAccessPattern> addAccessPattern(const FlexAccessPattern &apIn) {
-    //  accessPatterns.push_back(apIn);
-    //  return (--accessPatterns.end());
-    //}
-    void addAccessPattern(const FlexAccessPattern &apIn) {
-      auto uptr = std::make_unique<FlexAccessPattern>(apIn);
-      accessPatterns.push_back(std::move(uptr));
-    }
-    void addAccessPattern(const frOrient &oriIn, const FlexAccessPattern &apIn) {
-      auto uptr = std::make_unique<FlexAccessPattern>(apIn);
-      orient2APs[oriIn].push_back(std::move(uptr));
-    }
-
-
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcPin;
-    }
-  protected:
-    frTerm* term;
-    std::vector< std::unique_ptr<frPinFig> > pinFigs; // optional, set later
-    std::map< frLayerNum, PolygonSet> layer2PolySet;
-    frVector<std::unique_ptr<FlexAccessPattern> > accessPatterns;
-    std::map< frOrient, frVector<std::unique_ptr<FlexAccessPattern> > > orient2APs;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frRef.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frRef.h
deleted file mode 100644
index 1bc3f32..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frRef.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_REF_H_
-#define _FR_REF_H_
-
-#include "db/obj/frFig.h"
-#include "db/infra/frOrient.h"
-
-namespace fr {
-  class frRef: public frPinFig {
-  public:
-    // constructors
-    frRef(): frPinFig() {}
-    // getters
-    virtual frOrient getOrient() const = 0;
-    virtual void getOrigin(frPoint &tmpOrigin) const = 0;
-    virtual void getTransform(frTransform &xform) const = 0;
-    // setters
-    virtual void setOrient(const frOrient &tmpOrient) = 0;
-    virtual void setOrigin(const frPoint &tmpPoint) = 0;
-    virtual void setTransform(const frTransform &xform) = 0;
-  protected:
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.cpp b/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.cpp
deleted file mode 100644
index d229f6c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frShape.h"
-#include "db/drObj/drShape.h"
-#include "db/taObj/taShape.h"
-
-using namespace std;
-using namespace fr;
-
-frPathSeg::frPathSeg(const drPathSeg &in) {
-  in.getPoints(begin, end);
-  layer = in.getLayerNum();
-  in.getStyle(style);
-  owner = nullptr;
-}
-
-frPathSeg::frPathSeg(const taPathSeg &in) {
-  in.getPoints(begin, end);
-  layer = in.getLayerNum();
-  in.getStyle(style);
-  owner = nullptr;
-}
-
-frPatchWire::frPatchWire(const drPatchWire &in) {
-  in.getOrigin(origin);
-  in.getOffsetBox(offsetBox);
-  layer = in.getLayerNum();
-  owner = nullptr;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.h
deleted file mode 100644
index b952183..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frShape.h
+++ /dev/null
@@ -1,568 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_SHAPE_H_
-#define _FR_SHAPE_H_
-
-#include "db/obj/frFig.h"
-#include "db/infra/frSegStyle.h"
-
-
-namespace fr {
-  class frNet;
-  class frPin;
-  class drPathSeg;
-  class taPathSeg;
-  class drPatchWire;
-  class frShape: public frPinFig {
-  public:
-    // constructors
-    frShape(): frPinFig() {}
-    // setters
-    virtual void setLayerNum (frLayerNum tmpLayerNum) = 0;
-    // getters
-    virtual frLayerNum getLayerNum() const = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    virtual void setIter(frListIter<std::unique_ptr<frShape> > &in) = 0;
-    virtual frListIter<std::unique_ptr<frShape> > getIter() const = 0;
-  protected:
-  };
-
-  class frRect: public frShape {
-  public:
-    // constructors
-    frRect(): frShape(), box(), layer(0), owner(nullptr) {}
-    frRect(const frRect &in): frShape(), box(in.box), layer(in.layer), owner(in.owner) {}
-    // setters
-    void setBBox (const frBox &boxIn) {
-      box.set(boxIn);
-    }
-    // getters
-    // others
-    bool isHor() const {
-      frCoord xSpan = box.right() - box.left();
-      frCoord ySpan = box.top()   - box.bottom();
-      return (xSpan >= ySpan) ? true : false;
-    }
-    frCoord width() const {
-      frCoord xSpan = box.right() - box.left();
-      frCoord ySpan = box.top()   - box.bottom();
-      return (xSpan > ySpan) ? ySpan : xSpan;
-    }
-    frBlockObjectEnum typeId() const override {
-      return frcRect;
-    }
-
-    /* from frShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == frcPin);
-    }
-    
-    frPin* getPin() const override {
-      return reinterpret_cast<frPin*>(owner);
-    }
-    
-    void addToPin(frPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps in .cpp
-     */
-    void getBBox (frBox &boxIn) const override {
-      boxIn.set(box);
-    }
-    void move(const frTransform &xform) override {
-      box.transform(xform);
-    }
-    bool overlaps(const frBox &box) const override {
-      frBox rectBox;
-      getBBox(rectBox);
-      return rectBox.overlaps(box);
-    }
-    
-    void setIter(frListIter<std::unique_ptr<frShape> >& in) override {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frShape> > getIter() const override {
-      return iter;
-    }
-
-  protected:
-    frBox          box;
-    frLayerNum     layer;
-    frBlockObject* owner; // general back pointer 0
-    frListIter<std::unique_ptr<frShape> > iter;
-  };
-
-  class frPatchWire: public frShape {
-  public:
-    // constructors
-    frPatchWire(): frShape(), offsetBox(), origin(), layer(0), owner(nullptr) {}
-    frPatchWire(const frPatchWire &in): frShape(), offsetBox(in.offsetBox), 
-                                        origin(in.origin), layer(in.layer), owner(in.owner) {}
-    frPatchWire(const drPatchWire &in);
-    // setters
-    // void setBBox (const frBox &boxIn) {
-    //   box.set(boxIn);
-    // }
-    void setOffsetBox (const frBox &in) {
-      offsetBox.set(in);
-    }
-    void setOrigin(const frPoint &in) {
-      origin.set(in);
-    }
-    // getters
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcPatchWire;
-    }
-
-    /* from frShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == frcPin);
-    }
-    
-    frPin* getPin() const override {
-      return reinterpret_cast<frPin*>(owner);
-    }
-    
-    void addToPin(frPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps in .cpp
-     */
-    void getBBox (frBox &boxIn) const override {
-      frTransform xform(origin);
-      boxIn.set(offsetBox);
-      boxIn.transform(xform);
-    }
-    void getOffsetBox (frBox &boxIn) const {
-      boxIn.set(offsetBox);
-    }
-    // frPoint getOrigin() const {
-    //   return origin;
-    // }
-    void getOrigin(frPoint &in) const {
-      in.set(origin);
-    }
-    void move(const frTransform &xform) override {
-      // offsetBox.transform(xform);
-    }
-    bool overlaps(const frBox &box) const override {
-      frBox rectBox;
-      getBBox(rectBox);
-      return rectBox.overlaps(box);
-    }
-    
-    void setIter(frListIter<std::unique_ptr<frShape> >& in) override {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frShape> > getIter() const override {
-      return iter;
-    }
-
-  protected:
-    // frBox          box;
-    frBox          offsetBox;
-    frPoint        origin;
-    frLayerNum     layer;
-    frBlockObject* owner; // general back pointer 0
-    frListIter<std::unique_ptr<frShape> > iter;
-  };
-
-  class frPolygon: public frShape {
-  public:
-    // constructors
-    frPolygon(): frShape(), points(), layer(0), owner(nullptr) {}
-    frPolygon(const frPolygon &in): frShape(), points(in.points), layer(in.layer), owner(in.owner) {}
-    // setters
-    void setPoints (const std::vector<frPoint> &pointsIn) {
-      points = pointsIn;
-    }
-    // getters
-    const std::vector<frPoint>& getPoints() const {
-      return points;
-    }
-    std::vector<frPoint>& getPoints() {
-      return points;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcPolygon;
-    }
-
-    /* from frShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == frcPin);
-    }
-    
-    frPin* getPin() const override {
-      return reinterpret_cast<frPin*>(owner);
-    }
-    
-    void addToPin(frPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps, in .cpp
-     */
-    void getBBox (frBox &boxIn) const override {
-      frCoord llx = 0;
-      frCoord lly = 0;
-      frCoord urx = 0;
-      frCoord ury = 0;
-      if (points.size()) {
-        llx = points.begin()->x();
-        urx = points.begin()->x();
-        lly = points.begin()->y();
-        ury = points.begin()->y();
-      }
-      for (auto &point: points) {
-        llx = (llx < point.x()) ? llx : point.x();
-        lly = (lly < point.y()) ? lly : point.y();
-        urx = (urx > point.x()) ? urx : point.x();
-        ury = (ury > point.y()) ? ury : point.y();
-      }
-      boxIn.set(llx, lly, urx, ury);
-    }
-    void move(const frTransform &xform) override {
-      for (auto &point: points) {
-        point.transform(xform);
-      }
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-    
-    void setIter(frListIter<std::unique_ptr<frShape> >& in) override {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frShape> > getIter() const override {
-      return iter;
-    }
-
-  protected:
-    std::vector<frPoint> points;
-    frLayerNum           layer;
-    frBlockObject*       owner;
-    frListIter<std::unique_ptr<frShape> > iter;
-  };
-
-
-  class frPathSeg: public frShape {
-  public:
-    // constructors
-    frPathSeg(): frShape(), begin(), end(), layer(0), style(), owner(nullptr) {}
-    frPathSeg(const frPathSeg &in): begin(in.begin), end(in.end), layer(in.layer), style(in.style), owner(in.owner) {}
-    frPathSeg(const drPathSeg &in);
-    frPathSeg(const taPathSeg &in);
-    // getters
-    void getPoints(frPoint &beginIn, frPoint &endIn) const {
-      beginIn.set(begin);
-      endIn.set(end);
-    }
-    void getStyle(frSegStyle &styleIn) const {
-      styleIn.setBeginStyle(style.getBeginStyle(), style.getBeginExt());
-      styleIn.setEndStyle(style.getEndStyle(), style.getEndExt());
-      styleIn.setWidth(style.getWidth());
-    }
-    // setters
-    void setPoints(const frPoint &beginIn, const frPoint &endIn) {
-      begin.set(beginIn);
-      end.set(endIn);
-    }
-    void setStyle(const frSegStyle &styleIn) {
-      style.setBeginStyle(styleIn.getBeginStyle(), styleIn.getBeginExt());
-      style.setEndStyle(styleIn.getEndStyle(), styleIn.getEndExt());
-      style.setWidth(styleIn.getWidth());
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcPathSeg;
-    }
-
-    /* from frShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == frcPin);
-    }
-    
-    frPin* getPin() const override {
-      return reinterpret_cast<frPin*>(owner);
-    }
-    
-    void addToPin(frPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps, in .cpp
-     */
-    // needs to be updated
-    void getBBox (frBox &boxIn) const override {
-      bool isHorizontal = true;
-      if (begin.x() == end.x()) {
-        isHorizontal = false;
-      }
-      auto width    = style.getWidth();
-      auto beginExt = style.getBeginExt();
-      auto endExt   = style.getEndExt();
-      if (isHorizontal) {
-        boxIn.set(begin.x() - beginExt, begin.y() - width / 2,
-                  end.x()   + endExt,   end.y()   + width / 2);
-      } else {
-        boxIn.set(begin.x() - width / 2, begin.y() - beginExt,
-                  end.x()   + width / 2, end.y()   + endExt);
-      }
-    }
-    void move(const frTransform &xform) override {
-      begin.transform(xform);
-      end.transform(xform);
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-
-    void setIter(frListIter<std::unique_ptr<frShape> >& in) override {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frShape> > getIter() const override {
-      return iter;
-    }
-  protected:
-    frPoint        begin; // begin always smaller than end, assumed
-    frPoint        end;
-    frLayerNum     layer;
-    frSegStyle     style;
-    frBlockObject* owner;
-    frListIter<std::unique_ptr<frShape> > iter;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frTerm.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frTerm.h
deleted file mode 100644
index b971c34..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frTerm.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_TERM_H_
-#define _FR_TERM_H_
-
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-#include "db/obj/frPin.h"
-
-namespace fr {
-  class frNet;
-  class frInstTerm;
-
-  class frTerm: public frBlockObject {
-  public:
-    // constructors
-    //frTerm(): frBlockObject(), name(), net(), pins() {}
-    frTerm(const frString &in): frBlockObject(), name(in), net(nullptr), pins(), type(frTermEnum::frcNormalTerm) {}
-    frTerm(const frTerm &in): frBlockObject(), name(in.name), net(in.net), type(in.type) {
-      for (auto &uPin: in.getPins()) {
-        auto pin = uPin.get();
-        auto tmp = std::make_unique<frPin>(*pin);
-        addPin(tmp);
-      }
-    }
-    frTerm(const frTerm &in, const frTransform &xform): frBlockObject(), name(in.name), net(in.net), type(in.type) {
-      for (auto &uPin: in.getPins()) {
-        auto pin = uPin.get();
-        auto tmp = std::make_unique<frPin>(*pin, xform);
-        addPin(tmp);
-      }
-    }
-    // getters
-    bool hasNet() const {
-      return (net);
-    }
-    frNet* getNet() const {
-      return net;
-    }
-    const frString& getName() const {
-      return name;
-    }
-    const std::vector< std::unique_ptr<frPin> >& getPins() const {
-      return pins;
-    }
-    std::vector< std::unique_ptr<frPin> >& getPins() {
-      return pins;
-    }
-    // setters
-    void addToNet(frNet* in) {
-      net = in;
-    }
-    //void removeFromNet() {
-    //  net.reset();
-    //}
-    void addPin(std::unique_ptr<frPin> &in) {
-      in->setTerm(this);
-      pins.push_back(std::move(in));
-    }
-    void setType(frTermEnum in) {
-      type = in;
-    }
-    frTermEnum getType() const {
-      return type;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcTerm;
-    }
-  protected:
-    frString name; // A, B, Z, VSS, VDD
-    frNet* net; // set later, term in instTerm does not have net
-    std::vector<std::unique_ptr<frPin> > pins; // set later
-    frTermEnum type;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frTrackPattern.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frTrackPattern.h
deleted file mode 100644
index 8ce50f5..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frTrackPattern.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_TRACKPATTERN_H_
-#define _FR_TRACKPATTERN_H_
-
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-
-namespace fr {
-  class frTrackPattern: public frBlockObject {
-  public:
-    // constructors
-    frTrackPattern() = default;
-    frTrackPattern(const frTrackPattern& tmpTrackPattern) : 
-      horizontal(tmpTrackPattern.horizontal), startCoord(tmpTrackPattern.startCoord), 
-      numTracks(tmpTrackPattern.numTracks), trackSpacing(tmpTrackPattern.trackSpacing), layerNum(tmpTrackPattern.layerNum) {}
-    frTrackPattern(bool tmpIsH, frCoord tmpSC, frUInt4 tmpNT, frUInt4 tmpTS, frLayerNum tmpLN) :
-      horizontal(tmpIsH), startCoord(tmpSC), numTracks(tmpNT), trackSpacing(tmpTS), layerNum(tmpLN) {}
-    // getters
-    // vertical track has horizontal = true;
-    bool isHorizontal() const {
-      return horizontal;
-    }
-    frCoord getStartCoord() const {
-      return startCoord;
-    }
-    frUInt4 getNumTracks() const {
-      return numTracks;
-    }
-    frUInt4 getTrackSpacing() const {
-      return trackSpacing;
-    }
-    frLayerNum getLayerNum() const {
-      return layerNum;
-    }
-    // setters
-    // vertical track has horizontal = true;
-    void setHorizontal(bool tmpIsHorizontal) {
-      horizontal = tmpIsHorizontal;
-    }
-    void setStartCoord(frCoord tmpStartCoord) {
-      startCoord = tmpStartCoord;
-    }
-    void setNumTracks(frUInt4 tmpNumTracks) {
-      numTracks = tmpNumTracks;
-    }
-    void setTrackSpacing(frUInt4 tmpTrackSpacing) {
-      trackSpacing = tmpTrackSpacing;
-    }
-    void setLayerNum(frLayerNum tmpLayerNum) {
-      layerNum = tmpLayerNum;
-    }
-  protected:
-    bool       horizontal;
-    frCoord    startCoord;
-    frUInt4    numTracks;
-    frUInt4    trackSpacing;
-    frLayerNum layerNum;
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.cpp b/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.cpp
deleted file mode 100644
index 2b4b546..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/obj/frVia.h"
-#include "db/drObj/drVia.h"
-
-using namespace std;
-using namespace fr;
-
-frVia::frVia(const drVia &in) {
-  in.getOrigin(origin);
-  viaDef = in.getViaDef();
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.h b/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.h
deleted file mode 100644
index 39fec7e..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/obj/frVia.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_VIA_H_
-#define _FR_VIA_H_
-
-#include <memory>
-#include "db/obj/frRef.h"
-#include "db/obj/frShape.h"
-#include "db/tech/frViaDef.h"
-
-namespace fr {
-  class frNet;
-  class drVia;
-  class frVia: public frRef {
-  public:
-    // constructors
-    frVia(): frRef() {}
-    frVia(frViaDef* in): frRef(), origin(), viaDef(in), owner(nullptr) {}
-    frVia(const frVia &in): origin(in.origin), viaDef(in.viaDef), owner(in.owner) {}
-    frVia(const drVia &in);
-    // getters
-    frViaDef* getViaDef() const {
-      return viaDef;
-    }
-    void getLayer1BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer1Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getCutBBox(frBox &boxIn) const {
-      auto &figs = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getLayer2BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer2Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    // setters
-    void setViaDef(frViaDef* in) {
-      viaDef = in;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return frcVia;
-    }
-
-    /* from frRef
-     * getOrient
-     * setOrient
-     * getOrigin
-     * setOrigin
-     * getTransform
-     * setTransform
-     */
-
-    frOrient getOrient() const override {
-      return frOrient();
-    }
-    void setOrient(const frOrient &tmpOrient) override {
-      ;
-    }
-    void getOrigin(frPoint &tmpOrigin) const override {
-      tmpOrigin.set(origin);
-    }
-    void setOrigin(const frPoint &tmpPoint) override {
-      origin.set(tmpPoint);
-    }
-    void getTransform(frTransform &xformIn) const override {
-      xformIn.set(origin);
-    }
-    void setTransform(const frTransform &xformIn) override {}
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == frcPin);
-    }
-    frPin* getPin() const override {
-      return reinterpret_cast<frPin*>(owner);
-    }
-    void addToPin(frPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    void getBBox (frBox &boxIn) const override {
-      auto &layer1Figs = viaDef->getLayer1Figs();
-      auto &layer2Figs = viaDef->getLayer2Figs();
-      auto &cutFigs    = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: layer1Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: layer2Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: cutFigs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      //cout <<"origin " <<origin.x() <<" " <<origin.y() <<endl;
-      boxIn.transform(xform);
-    }
-    void move(const frTransform &xform) override {
-      ;
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-    
-    void setIter(frListIter<std::unique_ptr<frVia> >& in) {
-      iter = in;
-    }
-    frListIter<std::unique_ptr<frVia> > getIter() const {
-      return iter;
-    }
-
-    //friend void copyRefresh(std::shared_ptr<frInst> &instIn);
-  protected:
-    frPoint        origin;
-    frViaDef*      viaDef;
-    frBlockObject* owner;
-    frListIter<std::unique_ptr<frVia> > iter;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/taObj/Makefile
deleted file mode 100644
index 6ada946..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= taShape.o taTrack.o
-#OBJECTS	= 
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taBlockObject.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taBlockObject.h
deleted file mode 100644
index 0b78c7b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taBlockObject.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_BLOCKOBJECT_H_
-#define _TA_BLOCKOBJECT_H_
-
-#include "frBaseTypes.h"
-#include "db/obj/frBlockObject.h"
-
-namespace fr {
-  class taBlockObject: public frBlockObject {
-  public:
-    // constructors
-    taBlockObject() {}
-    taBlockObject(const taBlockObject &in): frBlockObject(in) {}
-    virtual ~taBlockObject() {}
-    // getters
-    // setters
-    // others
-    frBlockObjectEnum typeId() const override {
-      return tacBlockObject;
-    }
-  protected:
-
-  };
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taFig.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taFig.h
deleted file mode 100644
index 79ccfc7..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taFig.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_FIG_H_
-#define _TA_FIG_H_
-
-#include <memory>
-#include "db/taObj/taBlockObject.h"
-#include "db/infra/frBox.h"
-#include "db/infra/frTransform.h"
-
-namespace fr {
-  class taFig: public taBlockObject {
-  public:
-    // constructors
-    taFig(): taBlockObject() {}
-    // getters
-    virtual void getBBox(frBox &box) const = 0;
-    //virtual void getBBox(box_t &box) const = 0;
-    // setters
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-    virtual void move(const frTransform &xform) = 0;
-    virtual bool overlaps(const frBox &box) const = 0;
-  protected:
-  };
-
-  class frNet;
-  class taConnFig: public taFig {
-  public:
-    // constructors
-    taConnFig(): taFig() {}
-    // getters
-    virtual bool hasNet() const = 0;
-    virtual frNet* getNet() const = 0;
-    // setters
-    virtual void addToNet(frNet* in) = 0;
-    virtual void removeFromNet() = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-  class taPin;
-  class taPinFig: public taConnFig {
-  public:
-    taPinFig(): taConnFig() {}
-    // getters
-    virtual bool hasPin() const = 0;
-    virtual taPin* getPin() const = 0;
-    // setters
-    virtual void addToPin(taPin* in) = 0;
-    virtual void removeFromPin() = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taPin.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taPin.h
deleted file mode 100644
index 204adf5..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taPin.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_PIN_H_
-#define _TA_PIN_H_
-
-#include "db/taObj/taBlockObject.h"
-//#include "db/taObj/taFig.h"
-#include "db/taObj/taShape.h"
-#include "db/taObj/taVia.h"
-
-namespace fr{
-  //class taTrack;
-  class frGuide;
-  //class frNet;
-  class taPin: public taBlockObject {
-  public:
-    // constructors
-    //taPin(): begin(0), end(0), trackIdx(0), wlen_helper(0), nbrBegin(0), nbrEnd(0),
-    //         downViaCoords(), upViaCoords(), guide(nullptr), cost(0) {}
-    //taPin(const taIroute &in): taBlockObject(in), begin(in.begin), end(in.end), trackIdx(in.trackIdx), 
-    //                           wlen_helper(in.wlen_helper), nbrBegin(in.nbrBegin), nbrEnd(in.nbrEnd),
-    //                           downViaCoords(in.downViaCoords), upViaCoords(in.upViaCoords), guide(in.guide),
-    //                           cost(0) {}
-    taPin(): taBlockObject(), guide(nullptr), pinFigs(), wlen_helper(0), pin(false), wlen_helper2(0), cost(0), numAssigned(0)/*, drcCost(0)*/ {}
-    // getters
-    //void getCoords(frCoord &bp, frCoord &ep) const {
-    //  bp = begin;
-    //  ep = end;
-    //}
-    //void getNbrCoords(frCoord &bp, frCoord &ep) const {
-    //  bp = nbrBegin;
-    //  ep = nbrEnd;
-    //}
-    //taTrack* getTrack() const {
-    //  return track;
-    //}
-    //int getTrackIdx() const {
-    //  return trackIdx;
-    //}
-    int getWlenHelper() const {
-      return wlen_helper;
-    }
-    bool hasWlenHelper2() const {
-      return pin;
-    }
-    int getWlenHelper2() const {
-      return wlen_helper2;
-    }
-    //const std::vector<frCoord>& getViaCoords(bool isUpVia) const {
-    //  return isUpVia ? upViaCoords : downViaCoords;
-    //}
-    //std::vector<frCoord>& getViaCoords(bool isUpVia) {
-    //  return isUpVia ? upViaCoords : downViaCoords;
-    //}
-    frGuide* getGuide() const {
-      return guide;
-    }
-    const std::vector<std::unique_ptr<taPinFig> >& getFigs() const {
-      return pinFigs;
-    }
-    std::vector<std::unique_ptr<taPinFig> >& getFigs() {
-      return pinFigs;
-    }
-    frCost getCost() const {
-      return cost;
-    }
-    int getNumAssigned() const {
-      return numAssigned;
-    }
-    //frCost getDrcCost() const {
-    //  return drcCost;
-    //}
-    // setters
-    //void setCoords(frCoord bp, frCoord ep) {
-    //  begin = bp;
-    //  end = ep;
-    //}
-    //void setNbrCoords(frCoord bp, frCoord ep) {
-    //  nbrBegin = bp;
-    //  nbrEnd = ep;
-    //}
-    //void setTrack(taTrack *in) {
-    //  track = in;
-    //}
-    //void setTrackIdx(int in) {
-    //  trackIdx = in;
-    //}
-    void setWlenHelper(int in) {
-      wlen_helper = in;
-    }
-    void setWlenHelper2(frCoord in) {
-      pin = true;
-      wlen_helper2 = in;
-    }
-    //void addViaCoords(frCoord in, bool isUpVia) {
-    //  if (isUpVia) {
-    //    upViaCoords.push_back(in);
-    //  } else {
-    //    downViaCoords.push_back(in);
-    //  }
-    //}
-    void setGuide(frGuide* in) {
-      guide = in;
-    }
-    void addPinFig(std::unique_ptr<taPinFig> &in) {
-      in->addToPin(this);
-      pinFigs.push_back(std::move(in));
-    }
-    void setCost(frCost in) {
-      cost = in;
-    }
-    void addCost(frCost in) {
-      cost += in;
-    }
-    void addNumAssigned() {
-      numAssigned++;
-    }
-    //void setDrcCost(frCost in) {
-    //  drcCost = in;
-    //}
-    // others
-    frBlockObjectEnum typeId() const override {
-      return tacPin;
-    }
-    bool operator<(const taPin &b) const {
-      if (this->cost != b.cost) {
-        return this->getCost() > b.getCost();
-      } else {
-        return this->getId() < b.getId();
-      }
-    }
-  protected:
-    //frCoord                begin, end;
-    //int                    trackIdx;
-    //frCoord                nbrBegin, nbrEnd; // for nbr local guides
-    //std::vector<frCoord>   downViaCoords;
-    //std::vector<frCoord>   upViaCoords;
-    frGuide*                                guide;
-    std::vector<std::unique_ptr<taPinFig> > pinFigs;
-    int                                     wlen_helper; // for nbr global guides
-    bool                                    pin;
-    frCoord                                 wlen_helper2; // for local guides and pin guides
-    frCost                                  cost;
-    int                                     numAssigned;
-    //frCost                                  drcCost;
-  };
-  struct taPinComp {
-    bool operator()(const taPin* lhs, const taPin* rhs) const {
-      return *lhs < *rhs;
-    }
-  };
-}
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.cpp b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.cpp
deleted file mode 100644
index 48f6b8b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/taObj/taShape.h"
-#include "db/obj/frShape.h"
-
-using namespace std;
-using namespace fr;
-
-taPathSeg::taPathSeg(const frPathSeg &in) {
-  in.getPoints(begin, end);
-  layer = in.getLayerNum();
-  in.getStyle(style);
-  owner = nullptr;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.h
deleted file mode 100644
index 705e38c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taShape.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_SHAPE_H_
-#define _TA_SHAPE_H_
-
-#include "db/taObj/taFig.h"
-#include "db/infra/frSegStyle.h"
-
-
-namespace fr {
-  class frNet;
-  class taPin;
-  class frPathSeg;
-  class taShape: public taPinFig {
-  public:
-    // constructors
-    taShape(): taPinFig() {}
-    // setters
-    virtual void setLayerNum (frLayerNum tmpLayerNum) = 0;
-    // getters
-    virtual frLayerNum getLayerNum() const = 0;
-    // others
-    //frBlockObjectEnum typeId() const override = 0;
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-  protected:
-  };
-
-  class taPathSeg: public taShape {
-  public:
-    // constructors
-    taPathSeg(): taShape(), begin(), end(), layer(0), style(), owner(nullptr) {}
-    taPathSeg(const taPathSeg &in): begin(in.begin), end(in.end), layer(in.layer), style(in.style), owner(in.owner) {}
-    taPathSeg(const frPathSeg &in);
-    // getters
-    void getPoints(frPoint &beginIn, frPoint &endIn) const {
-      beginIn.set(begin);
-      endIn.set(end);
-    }
-    void getStyle(frSegStyle &styleIn) const {
-      styleIn.setBeginStyle(style.getBeginStyle(), style.getBeginExt());
-      styleIn.setEndStyle(style.getEndStyle(), style.getEndExt());
-      styleIn.setWidth(style.getWidth());
-    }
-    // setters
-    void setPoints(const frPoint &beginIn, const frPoint &endIn) {
-      begin.set(beginIn);
-      end.set(endIn);
-    }
-    void setStyle(const frSegStyle &styleIn) {
-      style.setBeginStyle(styleIn.getBeginStyle(), styleIn.getBeginExt());
-      style.setEndStyle(styleIn.getEndStyle(), styleIn.getEndExt());
-      style.setWidth(styleIn.getWidth());
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return tacPathSeg;
-    }
-
-    /* from frShape
-     * setLayerNum
-     * getLayerNum
-     */
-    void setLayerNum (frLayerNum numIn) override {
-      layer = numIn;
-    }
-    frLayerNum getLayerNum() const override {
-      return layer;
-    }
-    
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == tacPin);
-    }
-    
-    taPin* getPin() const override {
-      return reinterpret_cast<taPin*>(owner);
-    }
-    
-    void addToPin(taPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move, in .cpp
-     * overlaps, in .cpp
-     */
-    // needs to be updated
-    void getBBox (frBox &boxIn) const override {
-      bool isHorizontal = true;
-      if (begin.x() == end.x()) {
-        isHorizontal = false;
-      }
-      auto width    = style.getWidth();
-      auto beginExt = style.getBeginExt();
-      auto endExt   = style.getEndExt();
-      if (isHorizontal) {
-        boxIn.set(begin.x() - beginExt, begin.y() - width / 2,
-                  end.x()   + endExt,   end.y()   + width / 2);
-      } else {
-        boxIn.set(begin.x() - width / 2, begin.y() - beginExt,
-                  end.x()   + width / 2, end.y()   + endExt);
-      }
-    }
-    void move(const frTransform &xform) override {
-      begin.transform(xform);
-      end.transform(xform);
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-  protected:
-    frPoint        begin; // begin always smaller than end, assumed
-    frPoint        end;
-    frLayerNum     layer;
-    frSegStyle     style;
-    frBlockObject* owner;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.cpp b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.cpp
deleted file mode 100644
index b0bad2b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "db/taObj/taTrack.h"
-#include "db/taObj/taFig.h"
-#include "db/taObj/taPin.h"
-#include "frDesign.h"
-
-using namespace std;
-using namespace fr;
-
-// for pathseg, return overlapped length * #overlaps per interval
-// for via, return #overlaps
-frUInt4 taTrack::getCost(frCoord x1, frCoord x2, int type, taPinFig* fig) const {
-  frUInt4 cost = 0;
-  decltype(costPlanar.equal_range(boost::icl::interval<frCoord>::closed(x1,x2))) itRes;
-  switch(type) {
-    case 0:
-      itRes = costPlanar.equal_range(boost::icl::interval<frCoord>::closed(x1,x2));
-      break;
-    case 1:
-      itRes = costVia1.equal_range(boost::icl::interval<frCoord>::closed(x1,x2));
-      break;
-    case 2:
-      itRes = costVia2.equal_range(boost::icl::interval<frCoord>::closed(x1,x2));
-      break;
-    default:
-      ;
-  }
-  for (auto it = itRes.first; it != itRes.second; ++it) {
-    auto &intv = it->first;
-    auto &objS = it->second;
-    frUInt4 tmpCost = 0;
-    frUInt4 len = max(intv.upper() - intv.lower(), 1);
-    for (auto &obj: objS) {
-      if (obj == nullptr) {
-        tmpCost++;
-      // only add cost for diff-net
-      } else if (obj->typeId() == frcNet) {
-        if (fig->getPin()->getGuide()->getNet() != obj) {
-          tmpCost++;
-        }
-      // two taObjs
-      } else if (obj->typeId() == tacPathSeg || obj->typeId() == tacVia) {
-        auto taObj = static_cast<taPinFig*>(obj);
-        if (fig->getPin()->getGuide()->getNet() != taObj->getPin()->getGuide()->getNet()) {
-          tmpCost++;
-        }
-      } else {
-        cout <<"Warning: taTrack::getCost unsupported type" <<endl;
-      }
-    }
-    cost += tmpCost * len;
-  }
-  return cost;
-}
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.h
deleted file mode 100644
index 7f77b51..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taTrack.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_TRACK_H_
-#define _TA_TRACK_H_
-
-#include "db/taObj/taBlockObject.h"
-#include <boost/icl/interval_map.hpp>
-
-namespace fr{
-  class frTrackPattern;
-  class taPinFig;
-  class taTrack: public taBlockObject {
-  public:
-    // constructors
-    taTrack(): trackLoc(0), planar(), via1(), via2(), costPlanar(), costVia1(), costVia2() {}
-    // getters
-    frCoord getTrackLoc() const {
-      return trackLoc;
-    }
-    frUInt4 getCost(frCoord x1, frCoord x2, int type, taPinFig* fig) const;
-    // setters
-    void setTrackLoc(frCoord loc) {
-      trackLoc = loc;
-    }
-    // type 0/1/2: planar/down/up
-    void addToIntv(taPinFig* obj, frCoord x1, frCoord x2, int type) {
-      std::set<taPinFig*> tmpS {obj};
-      switch(type) {
-        case 0:
-          planar += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 1:
-          via1   += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 2:
-          via2   += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        default:
-          ;
-      }
-    }
-    void removeFromIntv(taPinFig* obj, frCoord x1, frCoord x2, int type) {
-      std::set<taPinFig*> tmpS {obj};
-      switch(type) {
-        case 0:
-          planar -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 1:
-          via1   -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 2:
-          via2   -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        default:
-          ;
-      }
-    }
-    // type 0/1/2: planar/down/up
-    void addToCost(frBlockObject* obj, frCoord x1, frCoord x2, int type) {
-      std::set<frBlockObject*> tmpS {obj};
-      switch(type) {
-        case 0:
-          costPlanar += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 1:
-          costVia1   += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 2:
-          costVia2   += std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        default:
-          ;
-      }
-    }
-    void removeFromCost(frBlockObject* obj, frCoord x1, frCoord x2, int type) {
-      std::set<frBlockObject*> tmpS {obj};
-      switch(type) {
-        case 0:
-          costPlanar -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 1:
-          costVia1   -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        case 2:
-          costVia2   -= std::make_pair(boost::icl::interval<frCoord>::closed(x1, x2), tmpS);
-          break;
-        default:
-          ;
-      }
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return tacTrack;
-    }
-    bool operator<(const taTrack &b) const {
-      return trackLoc < b.trackLoc;
-    }
-  protected:
-    frCoord trackLoc;
-    // intervals, ps bp-->ep, viaLoc
-    boost::icl::interval_map<frCoord, std::set<taPinFig*> > planar;
-    boost::icl::interval_map<frCoord, std::set<taPinFig*> > via1; // down via
-    boost::icl::interval_map<frCoord, std::set<taPinFig*> > via2; // up via
-    // block others bp, ep, viaLoc
-    boost::icl::interval_map<frCoord, std::set<frBlockObject*> > costPlanar; // all cost to others
-    boost::icl::interval_map<frCoord, std::set<frBlockObject*> > costVia1; // all cost to others
-    boost::icl::interval_map<frCoord, std::set<frBlockObject*> > costVia2; // all cost to others
-  };
-}
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taVia.h b/scripts/pdn/src/PdnPinDumper/src/db/taObj/taVia.h
deleted file mode 100644
index 129bbd8..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/taObj/taVia.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _TA_VIA_H_
-#define _TA_VIA_H_
-
-#include <memory>
-#include "db/taObj/taFig.h"
-#include "db/obj/frShape.h"
-#include "db/tech/frViaDef.h"
-#include "db/infra/frOrient.h"
-
-namespace fr {
-  class frNet;
-  class taRef: public taPinFig {
-  public:
-    // constructors
-    taRef(): taPinFig() {}
-    // getters
-    virtual frOrient getOrient() const = 0;
-    virtual void getOrigin(frPoint &tmpOrigin) const = 0;
-    virtual void getTransform(frTransform &xform) const = 0;
-    // setters
-    virtual void setOrient(const frOrient &tmpOrient) = 0;
-    virtual void setOrigin(const frPoint &tmpPoint) = 0;
-    virtual void setTransform(const frTransform &xform) = 0;
-  protected:
-  };
-  class taVia: public taRef {
-  public:
-    // constructors
-    taVia(): taRef() {}
-    taVia(frViaDef* in): taRef(), origin(), viaDef(in), owner(nullptr) {}
-    // getters
-    frViaDef* getViaDef() const {
-      return viaDef;
-    }
-    void getLayer1BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer1Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getCutBBox(frBox &boxIn) const {
-      auto &figs = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    void getLayer2BBox(frBox &boxIn) const {
-      auto &figs = viaDef->getLayer2Figs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      boxIn.transform(xform);
-    }
-    // setters
-    void setViaDef(frViaDef* in) {
-      viaDef = in;
-    }
-    // others
-    frBlockObjectEnum typeId() const override {
-      return tacVia;
-    }
-
-    /* from frRef
-     * getOrient
-     * setOrient
-     * getOrigin
-     * setOrigin
-     * getTransform
-     * setTransform
-     */
-
-    frOrient getOrient() const override {
-      return frOrient();
-    }
-    void setOrient(const frOrient &tmpOrient) override {
-      ;
-    }
-    void getOrigin(frPoint &tmpOrigin) const override {
-      tmpOrigin.set(origin);
-    }
-    void setOrigin(const frPoint &tmpPoint) override {
-      origin.set(tmpPoint);
-    }
-    void getTransform(frTransform &xformIn) const override {
-      xformIn.set(origin);
-    }
-    void setTransform(const frTransform &xformIn) override {}
-
-    /* from frPinFig
-     * hasPin
-     * getPin
-     * addToPin
-     * removeFromPin
-     */
-    bool hasPin() const override {
-      return (owner) && (owner->typeId() == tacPin);
-    }
-    taPin* getPin() const override {
-      return reinterpret_cast<taPin*>(owner);
-    }
-    void addToPin(taPin* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    void removeFromPin() override {
-      owner = nullptr;
-    }
-
-    /* from frConnFig
-     * hasNet
-     * getNet
-     * addToNet
-     * removeFromNet
-     */
-    bool hasNet() const override {
-      return (owner) && (owner->typeId() == frcNet);
-    }
-    frNet* getNet() const override {
-      return reinterpret_cast<frNet*>(owner);
-    }
-    void addToNet(frNet* in) override {
-      owner = reinterpret_cast<frBlockObject*>(in);
-    }
-    void removeFromNet() override {
-      owner = nullptr;
-    }
-
-    /* from frFig
-     * getBBox
-     * move
-     * overlaps
-     */
-
-    void getBBox (frBox &boxIn) const override {
-      auto &layer1Figs = viaDef->getLayer1Figs();
-      auto &layer2Figs = viaDef->getLayer2Figs();
-      auto &cutFigs    = viaDef->getCutFigs();
-      bool isFirst = true;
-      frBox box;
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      for (auto &fig: layer1Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: layer2Figs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      for (auto &fig: cutFigs) {
-        fig->getBBox(box);
-        if (isFirst) {
-          xl = box.left();
-          yl = box.bottom();
-          xh = box.right();
-          yh = box.top();
-          isFirst = false;
-        } else {
-          xl = std::min(xl, box.left());
-          yl = std::min(yl, box.bottom());
-          xh = std::max(xh, box.right());
-          yh = std::max(yh, box.top());
-        }
-      }
-      boxIn.set(xl,yl,xh,yh);
-      frTransform xform;
-      xform.set(origin);
-      //cout <<"origin " <<origin.x() <<" " <<origin.y() <<endl;
-      boxIn.transform(xform);
-    }
-    void move(const frTransform &xform) override {
-      ;
-    }
-    bool overlaps(const frBox &box) const override {
-      return false;
-    }
-  protected:
-    frPoint        origin;
-    frViaDef*      viaDef;
-    frBlockObject* owner;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/Makefile b/scripts/pdn/src/PdnPinDumper/src/db/tech/Makefile
deleted file mode 100644
index af27bc5..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= 
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frConstraint.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frConstraint.h
deleted file mode 100644
index f263872..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frConstraint.h
+++ /dev/null
@@ -1,1721 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_CONSTRAINT_H_
-#define _FR_CONSTRAINT_H_
-
-#include "frBaseTypes.h"
-#include <map>
-#include <iterator>
-#include <algorithm>
-#include <memory>
-#include <utility>
-#include "db/tech/frLookupTbl.h"
-
-namespace fr {
-  // enum class frConstraintTypeEnum {
-  //   SPACING,
-  //   SPACINGTABLE
-  // };
-
-  //enum class frSpacingConstraintTypeEnum {
-  //  RANGE,
-  //  LENGTHTHRESHOLD,
-  //  ENDOFLINE,
-  //  SAMENET,
-  //  NOTCHLENGTH,
-  //  ENDOFNOTCHWIDTH
-  //};
-
-  //enum class frSpacingTableConstraintTypeEnum {
-  //  PARALLELRUNLENGTH,
-  //  TWOWIDTH
-  //};
-
-  enum class frLef58CornerSpacingExceptionEnum {
-    NONE,
-    EXCEPTSAMENET,
-    EXCEPTSAMEMETAL
-  };
-
-
-  // base type for design rule
-  class frConstraint {
-  public:
-    frConstraint() {}
-    virtual ~frConstraint() {}
-    virtual frConstraintTypeEnum typeId() const = 0;    
-  protected:
-  };
-
-  namespace io {
-    class Parser;
-  }
-  class frLef58CutClassConstraint : public frConstraint {
-  public:
-    friend class io::Parser;
-    // constructors;
-    frLef58CutClassConstraint() {}
-    // getters
-    frCollection< std::shared_ptr<frLef58CutClass> > getCutClasses() const {
-      frCollection<std::shared_ptr<frLef58CutClass> > sol;
-      std::transform(cutClasses.begin(), cutClasses.end(), 
-                     std::back_inserter(sol), 
-                     [](auto &kv) {return kv.second;});
-      return sol;
-    }
-    // setters
-    void addToCutClass(const std::shared_ptr<frLef58CutClass> &in) {
-      cutClasses[in->getName()] = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutClassConstraint;
-    }
-  protected:
-    std::map<frString, std::shared_ptr<frLef58CutClass> > cutClasses;
-  };
-
-  // short
-
-  class frShortConstraint : public frConstraint {
-  public:
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcShortConstraint;
-    }
-  };
-
-  // minStep
-  class frMinStepConstraint : public frConstraint {
-  public:
-    // constructor
-    frMinStepConstraint() : minStepLength(-1), 
-                            maxLength(-1), 
-                            insideCorner(false), 
-                            outsideCorner(true), 
-                            step(false),
-                            maxEdges(-1) {}
-    // getter
-    frCoord getMinStepLength() {
-      return minStepLength;
-    }
-    bool hasMaxLength() {
-      return (maxLength != -1);
-    }
-    frCoord getMaxLength() {
-      return maxLength;
-    }
-    bool hasInsideCorner() {
-      return insideCorner;
-    }
-    bool hasOutsideCorner() {
-      return outsideCorner;
-    }
-    bool hasStep() {
-      return step;
-    }
-    bool hasMaxEdges() {
-      return (maxEdges != -1);
-    }
-    int getMaxEdges() {
-      return maxEdges;
-    }
-    // setter
-    void setInsideCorner(bool in) {
-      insideCorner = in;
-    }
-    void setOutsideCorner(bool in) {
-      outsideCorner = in;
-    }
-    void setStep(bool in) {
-      step = in;
-    }
-    void setMinStepLength(frCoord in) {
-      minStepLength = in;
-    }
-    void setMaxLength(frCoord in) {
-      maxLength = in;
-    }
-    void setMaxEdges(int in) {
-      maxEdges = in;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcMinStepConstraint;
-    }
-
-  protected:
-    frCoord minStepLength;
-    frCoord maxLength;
-    bool insideCorner;
-    bool outsideCorner;
-    bool step;
-    int maxEdges;
-  };
-
-  // minArea
-
-  class frAreaConstraint : public frConstraint {
-  public:
-    // constructor
-    frAreaConstraint(frCoord minAreaIn) {
-      minArea = minAreaIn;
-    }
-    // getter
-    frCoord getMinArea() {
-      return minArea;
-    }
-    // setter
-    void setMinArea(frCoord &minAreaIn) {
-      minArea = minAreaIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcAreaConstraint;
-    }
-  protected:
-    frCoord minArea;
-  };
-
-  // minWidth
-  class frMinWidthConstraint: public frConstraint {
-  public:
-    // constructor
-    frMinWidthConstraint(frCoord minWidthIn) {
-      minWidth = minWidthIn;
-    }
-    // getter
-    frCoord getMinWidth() {
-      return minWidth;
-    }
-    // setter
-    void set(frCoord &minWidthIn) {
-      minWidth = minWidthIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcMinWidthConstraint;
-    }
-  protected:
-    frCoord minWidth;
-  };
-
-  class frLef58SpacingEndOfLineWithinEndToEndConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58SpacingEndOfLineWithinEndToEndConstraint(): endToEndSpace(0), cutSpace(false), oneCutSpace(0),
-                                                       twoCutSpace(0), hExtension(false), extension(0),
-                                                       wrongDirExtension(false), hOtherEndWidth(false),
-                                                       otherEndWidth(0) {}
-    // getters
-    frCoord getEndToEndSpace() const {
-      return endToEndSpace;
-    }
-    frCoord getOneCutSpace() const {
-      return oneCutSpace;
-    }
-    frCoord getTwoCutSpace() const {
-      return twoCutSpace;
-    }
-    bool hasExtension() const {
-      return hExtension;
-    }
-    frCoord getExtension() const {
-      return extension;
-    }
-    frCoord getWrongDirExtension() const {
-      return wrongDirExtension;
-    }
-    bool hasOtherEndWidth() const {
-      return hOtherEndWidth;
-    }
-    frCoord getOtherEndWidth() const {
-      return otherEndWidth;
-    }
-    
-    // setters
-    void setEndToEndSpace(frCoord in) {
-      endToEndSpace = in;
-    }
-    void setCutSpace(frCoord one, frCoord two) {
-      oneCutSpace = one;
-      twoCutSpace = two;
-    }
-    void setExtension(frCoord extensionIn) {
-      hExtension = true;
-      extension = extensionIn;
-      wrongDirExtension = extensionIn;
-    }
-    void setExtension(frCoord extensionIn, frCoord wrongDirExtensionIn) {
-      hExtension = true;
-      extension = extensionIn;
-      wrongDirExtension = wrongDirExtensionIn;
-    }
-    void setOtherEndWidth(frCoord in) {
-      hOtherEndWidth = true;
-      otherEndWidth = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingEndOfLineWithinEndToEndConstraint;
-    }
-  protected:
-    frCoord    endToEndSpace;
-    bool       cutSpace;
-    frCoord    oneCutSpace;
-    frCoord    twoCutSpace;
-    bool       hExtension;
-    frCoord    extension;
-    frCoord    wrongDirExtension;
-    bool       hOtherEndWidth;
-    frCoord    otherEndWidth;
-  };
-
-  class frLef58SpacingEndOfLineWithinParallelEdgeConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58SpacingEndOfLineWithinParallelEdgeConstraint(): subtractEolWidth(false), parSpace(0), parWithin(0),
-                                                           hPrl(false), prl(0), hMinLength(false), minLength(0),
-                                                           twoEdges(false), sameMetal(false), nonEolCornerOnly(false),
-                                                           parallelSameMask(false) {}
-    // getters
-    bool hasSubtractEolWidth() const {
-      return subtractEolWidth;
-    }
-    frCoord getParSpace() const {
-      return parSpace;
-    }
-    frCoord getParWithin() const {
-      return parWithin;
-    }
-    bool hasPrl() const {
-      return hPrl;
-    }
-    frCoord getPrl() const {
-      return prl;
-    }
-    bool hasMinLength() const {
-      return hMinLength;
-    }
-    frCoord getMinLength() const {
-      return minLength;
-    }
-    bool hasTwoEdges() const {
-      return twoEdges;
-    }
-    bool hasSameMetal() const {
-      return sameMetal;
-    }
-    bool hasNonEolCornerOnly() const {
-      return nonEolCornerOnly;
-    }
-    bool hasParallelSameMask() const {
-      return parallelSameMask;
-    }
-    // setters
-    void setSubtractEolWidth(bool in) {
-      subtractEolWidth = in;
-    }
-    void setPar(frCoord parSpaceIn, frCoord parWithinIn) {
-      parSpace = parSpaceIn;
-      parWithin = parWithinIn;
-    }
-    void setPrl(frCoord in) {
-      hPrl = true;
-      prl = in;
-    }
-    void setMinLength(frCoord in) {
-      hMinLength = true;
-      minLength = in;
-    }
-    void setTwoEdges(bool in) {
-      twoEdges = in;
-    }
-    void setSameMetal(bool in) {
-      sameMetal = in;
-    }
-    void setNonEolCornerOnly(bool in) {
-      nonEolCornerOnly = in;
-    }
-    void setParallelSameMask(bool in) {
-      parallelSameMask = in;
-    }
-    
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingEndOfLineWithinParallelEdgeConstraint;
-    }
-  protected:
-    bool    subtractEolWidth;
-    frCoord parSpace;
-    frCoord parWithin;
-    bool    hPrl;
-    frCoord prl;
-    bool    hMinLength;
-    frCoord minLength;
-    bool    twoEdges;
-    bool    sameMetal;
-    bool    nonEolCornerOnly;
-    bool    parallelSameMask;
-  };
-
-  class frLef58SpacingEndOfLineWithinMaxMinLengthConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58SpacingEndOfLineWithinMaxMinLengthConstraint(): maxLength(false), length(0), twoSides(false) {}
-    // getters
-    frCoord getLength() const {
-      return length;
-    }
-    bool isMaxLength() const {
-      return maxLength;
-    }
-    // setters
-    void setLength(bool maxLengthIn, frCoord lengthIn, bool twoSidesIn = false) {
-      maxLength = maxLengthIn;
-      length    = lengthIn;
-      twoSides  = twoSidesIn;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingEndOfLineWithinMaxMinLengthConstraint;
-    }
-  protected:
-    bool    maxLength;
-    frCoord length;
-    bool    twoSides;
-  };
-
-
-  class frLef58SpacingEndOfLineWithinConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58SpacingEndOfLineWithinConstraint(): hOppositeWidth(false), oppositeWidth(0), eolWithin(0),
-                                               wrongDirWithin(false), sameMask(false), 
-                                               endToEndConstraint(nullptr), parallelEdgeConstraint(nullptr) {}
-    // getters
-    bool hasOppositeWidth() const {
-      return hOppositeWidth;
-    }
-    frCoord getOppositeWidth() const {
-      return oppositeWidth;
-    }
-    frCoord getEolWithin() const {
-      return eolWithin;
-    }
-    frCoord getWrongDirWithin() const {
-      return wrongDirWithin;
-    }
-    bool hasSameMask() const {
-      return sameMask;
-    }
-    bool hasExceptExactWidth() const {
-      return false; // skip for now
-    }
-    bool hasFillConcaveCorner() const {
-      return false; // skip for now
-    }
-    bool hasWithCut() const {
-      return false; // skip for now
-    }
-    bool hasEndPrlSpacing() const {
-      return false; // skip for now
-    }
-    bool hasEndToEndConstraint() const {
-      return (endToEndConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58SpacingEndOfLineWithinEndToEndConstraint> getEndToEndConstraint() const {
-      return endToEndConstraint;
-    }
-    bool hasMinMaxLength() const {
-      return false; // skip for now
-    }
-    bool hasEqualRectWidth() const {
-      return false; // skip for now
-    }
-    bool hasParallelEdgeConstraint() const {
-      return (parallelEdgeConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58SpacingEndOfLineWithinParallelEdgeConstraint> getParallelEdgeConstraint() const {
-      return parallelEdgeConstraint;
-    }
-    bool hasMaxMinLengthConstraint() const {
-      return (maxMinLengthConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58SpacingEndOfLineWithinMaxMinLengthConstraint> getMaxMinLengthConstraint() const {
-      return maxMinLengthConstraint;
-    }
-    bool hasEncloseCut() const {
-      return false; // skip for now
-    }
-    // setters
-    void setOppositeWidth(frCoord in) {
-      hOppositeWidth = true;
-      oppositeWidth = in;
-    }
-    void setEolWithin(frCoord in) {
-      eolWithin = in;
-      wrongDirWithin = in;
-    }
-    void setWrongDirWithin(frCoord in) {
-      wrongDirWithin = in;
-    }
-    void setSameMask(bool in) {
-      sameMask = in;
-    }
-    void setEndToEndConstraint(const std::shared_ptr<frLef58SpacingEndOfLineWithinEndToEndConstraint> &in) {
-      endToEndConstraint = in;
-    }
-    void setParallelEdgeConstraint(const std::shared_ptr<frLef58SpacingEndOfLineWithinParallelEdgeConstraint> &in) {
-      parallelEdgeConstraint = in;
-    }
-    void setMaxMinLengthConstraint(const std::shared_ptr<frLef58SpacingEndOfLineWithinMaxMinLengthConstraint> &in) {
-      maxMinLengthConstraint = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingEndOfLineWithinConstraint;
-    }
-  protected:
-    bool                                                                 hOppositeWidth;
-    frCoord                                                              oppositeWidth;
-    frCoord                                                              eolWithin;
-    frCoord                                                              wrongDirWithin;
-    bool                                                                 sameMask;
-    std::shared_ptr<frLef58SpacingEndOfLineWithinEndToEndConstraint>     endToEndConstraint;
-    std::shared_ptr<frLef58SpacingEndOfLineWithinParallelEdgeConstraint> parallelEdgeConstraint;
-    std::shared_ptr<frLef58SpacingEndOfLineWithinMaxMinLengthConstraint> maxMinLengthConstraint;
-  };
-
-  class frLef58SpacingEndOfLineConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58SpacingEndOfLineConstraint(): eolSpace(0), eolWidth(0), exactWidth(false),
-                                         wrongDirSpacing(false), wrongDirSpace(0),
-                                         withinConstraint(nullptr) {}
-    // getters
-    frCoord getEolSpace() const {
-      return eolSpace;
-    }
-    frCoord getEolWidth() const {
-      return eolWidth;
-    }
-    bool hasExactWidth() const {
-      return exactWidth;
-    }
-    bool hasWrongDirSpacing() const {
-      return wrongDirSpacing;
-    }
-    frCoord getWrongDirSpace() const {
-      return wrongDirSpace;
-    }
-    bool hasWithinConstraint() const {
-      return (withinConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58SpacingEndOfLineWithinConstraint> getWithinConstraint() const {
-      return withinConstraint;
-    }
-    bool hasToConcaveCornerConstraint() const {
-      return false;
-    }
-    bool hasToNotchLengthConstraint() const {
-      return false;
-    }
-    // setters
-    void setEol(frCoord eolSpaceIn, frCoord eolWidthIn, bool exactWidthIn = false) {
-      eolSpace = eolSpaceIn;
-      eolWidth = eolWidthIn;
-      exactWidth = exactWidthIn;
-    }
-    void setWrongDirSpace(bool in) {
-      wrongDirSpacing = true;
-      wrongDirSpace = in;
-    }
-    void setWithinConstraint(const std::shared_ptr<frLef58SpacingEndOfLineWithinConstraint> &in) {
-      withinConstraint = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingEndOfLineConstraint;
-    }
-  protected:
-    frCoord                                                  eolSpace;
-    frCoord                                                  eolWidth;
-    bool                                                     exactWidth;
-    bool                                                     wrongDirSpacing;
-    frCoord                                                  wrongDirSpace;
-    std::shared_ptr<frLef58SpacingEndOfLineWithinConstraint> withinConstraint;
-  };
-
-  class frLef58CornerSpacingSpacingConstraint;
-
-  // SPACING Constraints
-  class frSpacingConstraint : public frConstraint {
-  public:
-    frSpacingConstraint(): minSpacing(0) {}
-    frSpacingConstraint(frCoord &minSpacingIn): minSpacing(minSpacingIn) {}
-
-    // getter
-    frCoord getMinSpacing() const {
-      return minSpacing;
-    }
-    // setter
-    void setMinSpacing(frCoord &minSpacingIn) {
-      minSpacing = minSpacingIn;
-    }
-    // check
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcSpacingConstraint;
-    }
-  protected:
-    frCoord minSpacing;
-  };
-
-  // PARALLELEDGE
-  //class frSpacingEndOfLineParallelEdgeConstraint : public frConstraint {
-  //public:
-  //  // constructor
-  //  frSpacingEndOfLineParallelEdgeConstraint(): parSpace(0), parWithin(0), isTwoEdges(false) {}
-  //  frSpacingEndOfLineParallelEdgeConstraint(frCoord parSpaceIn, frCoord parWithinIn, bool isTwoEdgesIn)
-  //    : parSpace(parSpaceIn), parWithin(parWithinIn), isTwoEdges(isTwoEdgesIn) {}
-  //  // getters
-  //  frCoord getParSpace() const {
-  //    return parSpace;
-  //  }
-  //  frCoord getParWithin() const {
-  //    return parWithin;
-  //  }
-  //  bool hasTwoEdges() const {
-  //    return isTwoEdges;
-  //  }
-  //  // setters
-  //  void setParSpace(frCoord parSpaceIn) {
-  //    parSpace = parSpaceIn;
-  //  }
-  //  void setParWithin(frCoord parWithinIn) {
-  //    parWithin = parWithinIn;
-  //  }
-  //  void setTwoEdges(bool isTwoEdgesIn) {
-  //    isTwoEdges = isTwoEdgesIn;
-  //  }
-  //  frConstraintTypeEnum typeId() const override {
-  //    return frConstraintTypeEnum::frcSpacingEndOfLineParallelEdgeConstraint;
-  //  }
-
-  //protected:
-  //  frCoord parSpace, parWithin;
-  //  bool isTwoEdges;
-  //};
-
-  //class frLef58SpacingEndOfLineParallelEdgeConstraint : public frSpacingEndOfLineParallelEdgeConstraint {
-  //public:
-  //  // constructors
-  //  frLef58SpacingEndOfLineParallelEdgeConstraint(): frSpacingEndOfLineParallelEdgeConstraint(), subtractEolWidth(false) {}
-  //  // getters
-  //  bool hasSubtractEolWidth() const {
-  //    return subtractEolWidth;
-  //  }
-  //  // setters
-  //  void setSubtractEolWidth(bool in) {
-  //    subtractEolWidth = in;
-  //  }
-  //  // others
-  //  frConstraintTypeEnum typeId() const override {
-  //    return frConstraintTypeEnum::frcLef58SpacingEndOfLineParallelEdgeConstraint;
-  //  }
-  //protected:
-  //  bool subtractEolWidth;
-  //};
-
-  // EOL spacing
-  class frSpacingEndOfLineConstraint : public frSpacingConstraint {
-  public:
-    // constructor
-    frSpacingEndOfLineConstraint(): frSpacingConstraint(), 
-                                    eolWidth(-1), eolWithin(-1), 
-                                    parSpace(-1), parWithin(-1),
-                                    isTwoEdges(false) {}
-    // getter
-    frCoord getEolWidth() const {
-      return eolWidth;
-    }
-    frCoord getEolWithin() const {
-      return eolWithin;
-    }
-    frCoord getParSpace() const {
-      return parSpace;
-    }
-    frCoord getParWithin() const {
-      return parWithin;
-    }
-    bool hasParallelEdge() const {
-      return ((parSpace == -1) ? false : true);
-    }
-    bool hasTwoEdges() const {
-      return isTwoEdges;
-    }
-    //bool hasParallelEdge() const {
-    //  return (parallelEdgeConstraint) ? true : false;
-    //}
-    //std::shared_ptr<frSpacingEndOfLineParallelEdgeConstraint> getParallelEdge() const {
-    //  return parallelEdgeConstraint;
-    //}
-    // setter
-    void setEolWithin(frCoord &eolWithinIn) {
-      eolWithin = eolWithinIn;
-    }
-    void setEolWidth(frCoord &eolWidthIn) {
-      eolWidth = eolWidthIn;
-    }
-    void setParSpace(frCoord parSpaceIn) {
-      parSpace = parSpaceIn;
-    }
-    void setParWithin(frCoord parWithinIn) {
-      parWithin = parWithinIn;
-    }
-    void setTwoEdges(bool isTwoEdgesIn) {
-      isTwoEdges = isTwoEdgesIn;
-    }
-    //void setParallelEdge(const std::shared_ptr<frSpacingEndOfLineParallelEdgeConstraint> &parallelEdgeConstraintIn) {
-    //  parallelEdgeConstraint = parallelEdgeConstraintIn;
-    //}
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcSpacingEndOfLineConstraint;
-    }
-
-  protected:
-    frCoord eolWidth, eolWithin;
-    frCoord parSpace, parWithin;
-    bool isTwoEdges;
-    //std::shared_ptr<frSpacingEndOfLineParallelEdgeConstraint> parallelEdgeConstraint;
-  };
-
-  //class frLef58SpacingEndOfLineEndToEndConstraint: public frConstraint {
-  //public:
-  //  ;
-  //protected:
-  //  ;
-  //};
-
-  //class frLef58SpacingEndOfLineConstraint : public frSpacingEndOfLineConstraint {
-  //public:
-  //  // constructors
-  //  frLef58SpacingEndOfLineConstraint() : frSpacingEndOfLineConstraint(), sameMask(false), exactWidth(false),
-  //    wrongDirSpacing(false), wrongDirSpace(0), endToEnd(false), endToEndSpace(0), maxLength(false), 
-  //    minLength(false), length(0), twoSides(false) {}
-  //  // getters
-  //  std::shared_ptr<frLef58SpacingEndOfLineParallelEdgeConstraint> getParallelEdge() const {
-  //    return std::dynamic_pointer_cast<frLef58SpacingEndOfLineParallelEdgeConstraint>(parallelEdgeConstraint);
-  //  }
-  //  bool hasSameMask() const {
-  //    return sameMask;
-  //  }
-  //  bool hasExactWidth() const {
-  //    return exactWidth;
-  //  }
-  //  bool hasWrongDirSpacing() const {
-  //    return wrongDirSpacing;
-  //  }
-  //  frCoord getWrongDirSpace() const {
-  //    return wrongDirSpace;
-  //  }
-  //  bool hasEndToEnd() const {
-  //    return endToEnd;
-  //  }
-  //  frCoord getEndToEndSpace() const {
-  //    return endToEndSpace;
-  //  }
-  //  bool hasMaxLength() const {
-  //    return maxLength;
-  //  }
-  //  bool hasMinLength() const {
-  //    return minLength;
-  //  }
-  //  frCoord getLength() const {
-  //    return length;
-  //  }
-  //  bool hasTwoSides() const {
-  //    return twoSides;
-  //  }
-  //  // setters
-  //  void setSameMask(bool in) {
-  //    sameMask = in;
-  //  }
-  //  void setExactWidth(bool in) {
-  //    exactWidth = in;
-  //  }
-  //  void setWrongDirSpace(frCoord in) {
-  //    wrongDirSpacing = true;
-  //    wrongDirSpace   = in;
-  //  }
-  //  void setEndToEndSpace(frCoord in) {
-  //    endToEnd      = true;
-  //    endToEndSpace = in;
-  //  }
-  //  void setMaxLength(frCoord in) {
-  //    maxLength = true;
-  //    length = in;
-  //  }
-  //  void setMinLength(frCoord in) {
-  //    minLength = true;
-  //    length = in;
-  //  }
-  //  void setTwoSides(bool in) {
-  //    twoSides = in;
-  //  }
-  //  // others
-  //  frConstraintTypeEnum typeId() const override {
-  //    return frConstraintTypeEnum::frcLef58SpacingEndOfLineConstraint;
-  //  }
-  //protected:
-  //  bool sameMask;
-  //  bool exactWidth;
-  //  bool wrongDirSpacing;
-  //  frCoord wrongDirSpace;
-  //  bool endToEnd;
-  //  frCoord endToEndSpace;
-  //  bool maxLength;
-  //  bool minLength;
-  //  frCoord length;
-  //  bool twoSides;
-  //};
-
-
-  class frLef58CutSpacingLayerConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CutSpacingLayerConstraint() : secondLayerName(""), className(""), 
-                                         hAboveWidth(false), aboveWidth(0),
-                                         hEnclosure(false), enclosure(0) {}
-    // getter
-    //frUInt4 getSecondLayerNum() const {
-    //  return secondLayerNum;
-    //}
-    frString getSecondLayerName() const {
-      return secondLayerName;
-    }
-    // cutclass
-    bool hasCutClass() const {
-      return (className == "");
-    }
-    frString getClassName() const {
-      return className;
-    }
-    void getClassName(frString &in) const {
-      in = className;
-    }
-    bool hasAboveWidth() const {
-      return hAboveWidth;
-    }
-    frCoord getAboveWidth() const {
-      return aboveWidth;
-    }
-    bool hasEnclosure() const {
-      return hEnclosure;
-    }
-    frCoord getEnclosure() const {
-      return enclosure;
-    }
-
-    // setter
-    //void setSecondLayerNum(frLayerNum in) {
-    //  secondLayerNum = in;
-    //}
-    void setSecondLayerName(const frString &in) {
-      secondLayerName = in;
-    }
-    void setCutClass(const frString &classNameIn) {
-      className = classNameIn;
-    }
-    void setAboveWidth(frCoord in) {
-      hAboveWidth = true;
-      aboveWidth  = in;
-    }
-    void setEnclosure(frCoord in) {
-      hEnclosure = true;
-      enclosure  = in;
-    }
-
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingLayerConstraint;
-    }
-  protected:
-    //frUInt4  secondLayerNum;
-    frString secondLayerName;
-    // cutclass
-    frString className;
-    bool     hAboveWidth;
-    frCoord  aboveWidth;
-    bool     hEnclosure;
-    frCoord  enclosure;
-  };
-
-  class frLef58CutSpacingAdjacentCutsConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CutSpacingAdjacentCutsConstraint() : numAdjCuts(0), hTwoCuts(false), 
-                                                twoCuts(0), hTwoCutsSpacing(false), 
-                                                twoCutsSpacing(0), sameCut(false),
-                                                cutWithin1(0), cutWithin2(0),
-                                                className(""), toAll(false) {}
-    // getter
-    frUInt4 getNumAdjCuts() const {
-      return numAdjCuts;
-    }
-    // two cuts
-    bool hasTwoCuts() const {
-      return hTwoCuts;
-    }
-    frUInt4 getTwoCuts() const {
-      return twoCuts;
-    }
-    bool hasTwoCutsSpacing() const {
-      return hTwoCutsSpacing;
-    }
-    frCoord getTwoCutsSpacing() const {
-      return twoCutsSpacing;
-    }
-    bool isSameCut() const {
-      return sameCut;
-    }
-    // within
-    frCoord getCutWithin1() const {
-      return cutWithin1;
-    }
-    frCoord getCutWithin2() const {
-      return cutWithin2;
-    }
-    // cutclass
-    bool hasCutClass() const {
-      return (className == "");
-    }
-    frString getClassName() const {
-      return className;
-    }
-    void getClassName(frString &in) const {
-      in = className;
-    }
-    bool isToAll() const {
-      return toAll;
-    }
-
-    // setter
-    void setNumAdjCuts(frUInt4 in) {
-      numAdjCuts = in;
-    }
-    void setTwoCuts(frUInt4 twoCutsIn, bool sameCutIn = false) {
-      hTwoCuts        = true;
-      twoCuts         = twoCutsIn;
-      sameCut         = sameCutIn;
-    }
-    void setTwoCuts(frUInt4 twoCutsIn, frCoord twoCutsSpacingIn, bool sameCutIn = false) {
-      hTwoCuts        = true;
-      twoCuts         = twoCutsIn;
-      hTwoCutsSpacing = true;
-      twoCutsSpacing  = twoCutsSpacingIn;
-      sameCut         = sameCutIn;
-    }
-    void setWithin(frCoord cutWithin1In, frCoord cutWithin2In) {
-      cutWithin1 = cutWithin1In;
-      cutWithin2 = cutWithin2In;
-    }
-    void setCutClass(const frString &classNameIn, bool toAllIn) {
-      className = classNameIn;
-      toAll     = toAllIn;
-    }
-
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingAdjacentCutsConstraint;
-    }
-  protected:
-    frUInt4  numAdjCuts;
-    // two cuts
-    bool     hTwoCuts;
-    frUInt4  twoCuts;
-    bool     hTwoCutsSpacing;
-    frCoord  twoCutsSpacing;
-    bool     sameCut;
-    // within
-    frCoord  cutWithin1;
-    frCoord  cutWithin2;
-    // cutclass
-    frString className;
-    bool     toAll;
-  };
-
-  class frLef58CutSpacingParallelWithinConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CutSpacingParallelWithinConstraint() : within(0), exceptSameNet(false), className(""), longEdgeOnly(false),
-                                                  enclosure(0), above(false), parLength(0), parWithin(0) {}
-    // getter
-    frCoord getWithin() const {
-      return within;
-    }
-    bool isExceptSameNet() const {
-      return exceptSameNet;
-    }
-    bool hasCutClass() const {
-      return (className == "");
-    }
-    frString getClassName() const {
-      return className;
-    }
-    void getClassName(frString &in) const {
-      in = className;
-    }
-    bool isLongEdgeOnly() const {
-      return longEdgeOnly;
-    }
-    bool isEnclosure() const {
-      return (longEdgeOnly) ? false : true;
-    }
-    frCoord getEnclosure() const {
-      return enclosure;
-    }
-    bool isAbove() const {
-      return above;
-    }
-    frCoord getParLength() const {
-      return parLength;
-    }
-    frCoord getParWithin() const {
-      return parWithin;
-    }
-
-    // setter
-    void setParallelWithin(frCoord withinIn, bool exceptSameNetIn) {
-      within        = withinIn;
-      exceptSameNet = exceptSameNetIn;
-    }
-    void setClassName(const frString &in) {
-      className = in;
-    }
-    void setLongEdgeOnly(bool in) {
-      longEdgeOnly = in;
-    }
-    void setEnclosure(frCoord enclosureIn, bool aboveIn) {
-      enclosure = enclosureIn;
-      above = aboveIn;
-    }
-    void setParallel(frCoord parLengthIn, frCoord parWithinIn) {
-      parLength = parLengthIn;
-      parWithin = parWithinIn;
-    }
-
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingParallelWithinConstraint;
-    }
-  protected:
-    frCoord  within;
-    bool     exceptSameNet;
-    frString className;
-    // longedgeonly
-    bool     longEdgeOnly;
-    // enclosure
-    frCoord  enclosure;
-    bool     above;
-    frCoord  parLength;
-    frCoord  parWithin;
-  };
-
-  // LEF58 cut spacing
-  class frLef58CutSpacingConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CutSpacingConstraint() {}
-    // getter
-    frCoord getCutSpacing() const {
-      return cutSpacing;
-    }
-    bool hasParallelWithinConstraint() const {
-      return (parallelWithinConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58CutSpacingParallelWithinConstraint> getParallelWithinConstraint() const {
-      return parallelWithinConstraint;
-    }
-    bool hasAdjacentCutsConstraint() const {
-      return (adjacentCutsConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58CutSpacingAdjacentCutsConstraint> getAdjacentCutsConstraint() const {
-      return adjacentCutsConstraint;
-    }
-    bool hasLayerConstraint() const {
-      return (layerConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58CutSpacingLayerConstraint> getLayerConstraint() const {
-      return layerConstraint;
-    }
-    // setter
-    void setCutSpacing(frCoord in) {
-      cutSpacing = in;
-    }
-    void setParallelWithinConstraint(const std::shared_ptr<frLef58CutSpacingParallelWithinConstraint> &in) {
-      parallelWithinConstraint = in;
-    }
-    void setAdjacentCutsConstraint(const std::shared_ptr<frLef58CutSpacingAdjacentCutsConstraint> &in) {
-      adjacentCutsConstraint = in;
-    }
-    void setLayerConstraint(const std::shared_ptr<frLef58CutSpacingLayerConstraint> &in) {
-      layerConstraint = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingConstraint;
-    }
-  protected:
-    frCoord                                                    cutSpacing;
-    std::shared_ptr<frLef58CutSpacingParallelWithinConstraint> parallelWithinConstraint;
-    std::shared_ptr<frLef58CutSpacingAdjacentCutsConstraint>   adjacentCutsConstraint;
-    std::shared_ptr<frLef58CutSpacingLayerConstraint>          layerConstraint;
-  };
-
-
-
-
-
-  class frLef58CutSpacingTableLayerConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58CutSpacingTableLayerConstraint(): secondLayerNum(0), nonZeroEnc(false) {}
-    // getters
-    frLayerNum getSecondLayerNum() const {
-      return secondLayerNum;
-    }
-    bool isNonZeroEnc() const {
-      return nonZeroEnc;
-    }
-    // setters
-    void setSecondLayerNum(frLayerNum in) {
-      secondLayerNum = in;
-    }
-    void setNonZeroEnc(bool in) {
-      nonZeroEnc = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingTableLayerConstraint;
-    }
-  protected:
-    frLayerNum secondLayerNum;
-    bool       nonZeroEnc;
-  };
-
-  class frLef58CutSpacingTablePrlConstraint : public frConstraint {
-  public:
-    // constructors
-    frLef58CutSpacingTablePrlConstraint(): prl(0), horizontal(false), vertical(false), 
-                                           maxXY(false) {}
-    // getters
-    frCoord getPrl() const {
-      return prl;
-    }
-    bool isHorizontal() const {
-      return horizontal;
-    }
-    bool isVertical() const {
-      return vertical;
-    }
-    bool isMaxXY() const {
-      return maxXY;
-    }
-    // setters
-    void setPrl(frCoord in) {
-      prl = in;
-    }
-    void setHorizontal(bool in) {
-      horizontal = in;
-    }
-    void setVertical(bool in) {
-      vertical = in;
-    }
-    void setMaxXY(bool in) {
-      maxXY = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingTablePrlConstraint;
-    }
-  protected:
-    frCoord prl;
-    bool    horizontal;
-    bool    vertical;
-    bool    maxXY;
-  };
-
-  // LEF58 cut spacing table
-  class frLef58CutSpacingTableConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CutSpacingTableConstraint(): cutClassHasAll(false), defaultCutSpacing(0) {}
-    // getter
-    std::shared_ptr<fr2DLookupTbl<frString, frString, std::pair<frCoord, frCoord> > > getCutClassTbl() const {
-      return cutClassTbl;
-    }
-    bool hasPrlConstraint() const {
-      return (prlConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58CutSpacingTablePrlConstraint> getPrlConstraint() const {
-      return prlConstraint;
-    }
-    bool hasLayerConstraint() const {
-      return (layerConstraint) ? true : false;
-    }
-    std::shared_ptr<frLef58CutSpacingTableLayerConstraint> getLayerConstraint() const {
-      return layerConstraint;
-    }
-    bool hasAll() const {
-      return cutClassHasAll;
-    }
-    frCoord getDefaultCutSpacing() const {
-      return defaultCutSpacing;
-    }
-    // setter
-    void setCutClassTbl(std::shared_ptr<fr2DLookupTbl<frString, frString, std::pair<frCoord, frCoord> > > &in) {
-      cutClassTbl = in;
-    }
-    void setPrlConstraint(const std::shared_ptr<frLef58CutSpacingTablePrlConstraint> &in) {
-      prlConstraint = in;
-    }
-    void setLayerConstraint(const std::shared_ptr<frLef58CutSpacingTableLayerConstraint> &in) {
-      layerConstraint = in;
-    }
-    void setAll(bool in) {
-      cutClassHasAll = in;
-    }
-    void setDefaultCutSpacing(frCoord in) {
-      defaultCutSpacing = in;
-    }
-    // others
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CutSpacingTableConstraint;
-    }
-  protected:
-    std::shared_ptr<fr2DLookupTbl<frString, frString, std::pair<frCoord, frCoord> > > cutClassTbl;
-    std::shared_ptr<frLef58CutSpacingTablePrlConstraint>                              prlConstraint;
-    std::shared_ptr<frLef58CutSpacingTableLayerConstraint>                            layerConstraint;
-    bool                                                                              cutClassHasAll;
-    frCoord                                                                           defaultCutSpacing;
-  };
-
-  // new SPACINGTABLE Constraints
-  class frSpacingTablePrlConstraint : public frConstraint {
-  public:
-    // constructor
-    //frSpacingTablePrlConstraint() {}
-    frSpacingTablePrlConstraint(const fr2DLookupTbl<frCoord, frCoord, frCoord> &in): tbl(in) {}
-    // getter
-    const fr2DLookupTbl<frCoord, frCoord, frCoord>& getLookupTbl() const {
-      return tbl;
-    }
-    fr2DLookupTbl<frCoord, frCoord, frCoord>& getLookupTbl() {
-      return tbl;
-    }
-    frCoord find(frCoord width, frCoord prl) const {
-      return tbl.find(width, prl);
-    }
-    // setter
-    void setLookupTbl(const fr2DLookupTbl<frCoord, frCoord, frCoord> &in) {
-      tbl = in;
-    }
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcSpacingTablePrlConstraint;
-    }
-  protected:
-    fr2DLookupTbl<frCoord, frCoord, frCoord> tbl;
-  };
-
-  struct frSpacingTableTwRowType {
-    frSpacingTableTwRowType(frCoord in1, frCoord in2): width(in1), prl(in2) {}
-    frCoord width;
-    frCoord prl;
-    bool operator<(const frSpacingTableTwRowType &b) const {
-      return width < b.width || prl < b.prl;
-    }
-    //bool operator<=(const frSpacingTableTwRowType &b) const {
-    //  return width <= b.width || prl <= b.prl;
-    //}
-    //bool operator>(const frSpacingTableTwRowType &b) const {
-    //  return width > b.width || prl > b.prl;
-    //}
-    //bool operator>=(const frSpacingTableTwRowType &b) const {
-    //  return width >= b.width || prl >= b.prl;
-    //}
-    //bool operator==(const frSpacingTableTwRowType &b) const {
-    //  return width == b.width && prl == b.prl;
-    //}
-    //bool operator!=(const frSpacingTableTwRowType &b) const {
-    //  return !(*this == b);
-    //}
-  };
-  // new SPACINGTABLE Constraints
-  class frSpacingTableTwConstraint : public frConstraint {
-  public:
-    // constructor
-    //frSpacingTableTwConstraint() {}
-    frSpacingTableTwConstraint(const fr2DLookupTbl<frSpacingTableTwRowType, frSpacingTableTwRowType, frCoord> &in): tbl(in) {}
-    // getter
-    const fr2DLookupTbl<frSpacingTableTwRowType, frSpacingTableTwRowType, frCoord>& getLookupTbl() const {
-      return tbl;
-    }
-    fr2DLookupTbl<frSpacingTableTwRowType, frSpacingTableTwRowType, frCoord>& getLookupTbl() {
-      return tbl;
-    }
-    frCoord find(frCoord width1, frCoord width2, frCoord prl) const {
-      return tbl.find(frSpacingTableTwRowType(width1, prl), frSpacingTableTwRowType(width2, prl));
-    }
-    // setter
-    void setLookupTbl(const fr2DLookupTbl<frSpacingTableTwRowType, frSpacingTableTwRowType, frCoord> &in) {
-      tbl = in;
-    }
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcSpacingTableTwConstraint;
-    }
-  protected:
-    fr2DLookupTbl<frSpacingTableTwRowType, frSpacingTableTwRowType, frCoord> tbl;
-  };
-  
-  // original SPACINGTABLE Constraints
-  class frSpacingTableConstraint : public frConstraint {
-  public:
-    // constructor
-    frSpacingTableConstraint(std::shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > parallelRunLengthConstraintIn) {
-      parallelRunLengthConstraint = parallelRunLengthConstraintIn;
-    }
-    // getter
-    std::shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > getParallelRunLengthConstraint() {
-      return parallelRunLengthConstraint;
-    }
-    // setter
-    void setParallelRunLengthConstraint(std::shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > &parallelRunLengthConstraintIn) {
-      parallelRunLengthConstraint = parallelRunLengthConstraintIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcSpacingTableConstraint;
-    }
-  protected:
-    std::shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > parallelRunLengthConstraint;
-  };
-  
-  class frLef58SpacingTableConstraint : public frSpacingTableConstraint {
-  public:
-    // constructor
-    frLef58SpacingTableConstraint(const std::shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > &parallelRunLengthConstraintIn,
-                                  const std::map<int, std::pair<frCoord, frCoord> > &exceptWithinConstraintIn): 
-      frSpacingTableConstraint(parallelRunLengthConstraintIn), exceptWithinConstraint(exceptWithinConstraintIn), 
-      wrongDirection(false), sameMask(false), exceptEol(false), eolWidth(0) {}
-    // getter
-    bool hasExceptWithin(frCoord val) const {
-      auto rowIdx = parallelRunLengthConstraint->getRowIdx(val);
-      return (exceptWithinConstraint.find(rowIdx) != exceptWithinConstraint.end());
-    }
-    std::pair<frCoord, frCoord> getExceptWithin(frCoord val) const {
-      auto rowIdx = parallelRunLengthConstraint->getRowIdx(val);
-      return exceptWithinConstraint.at(rowIdx);
-    }
-    bool isWrongDirection() const {
-      return wrongDirection;
-    }
-    bool isSameMask() const {
-      return sameMask;
-    }
-    bool hasExceptEol() const {
-      return exceptEol;
-    }
-    frUInt4 getEolWidth() const {
-      return eolWidth;
-    }
-    // setters
-    void setExceptWithinConstraint(std::map<int, std::pair<frCoord, frCoord> > &exceptWithinConstraintIn) {
-      exceptWithinConstraint = exceptWithinConstraintIn;
-    }
-    void setWrongDirection(bool in) {
-      wrongDirection = in;
-    }
-    void setSameMask(bool in) {
-      sameMask = in;
-    }
-    void setEolWidth(frUInt4 in) {
-      exceptEol = true;
-      eolWidth = in;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58SpacingTableConstraint;
-    }
-  protected:
-    //std::shared_ptr<fr1DLookupTbl<frCoord, std::pair<frCoord, frCoord> > > exceptWithinConstraint;
-    std::map<frCoord, std::pair<frCoord, frCoord> > exceptWithinConstraint;
-    bool wrongDirection;
-    bool sameMask;
-    bool exceptEol;
-    frUInt4 eolWidth;
-  };
-
-  // class frSpacingTableTwoWidthConstraint : public frSpacingTableConstraint {
-  // public:
-  //   // getter
-  //   // setter
-  //   // check
-  //   virtual bool check() {
-
-  //   }
-  // protected:
-  //   frCollection<frCoord> widths;
-  //   frCollection<frCoord> lengths;
-  //   frCollection<frCollection<frCoord> > spTbl;
-  // };
-
-  // ADJACENTCUTS
-  class frCutSpacingConstraint : public frConstraint {
-  public:
-  // constructor
-  frCutSpacingConstraint() {}
-  frCutSpacingConstraint(
-    frCoord &cutSpacingIn,
-    bool centerToCenterIn,
-    bool sameNetIn,
-    frString secondLayerNameIn,
-    bool stackIn,
-    int adjacentCutsIn,
-    frCoord cutWithinIn,
-    bool isExceptSamePGNetIn,
-    bool isParallelOverlapIn,
-    frCoord cutAreaIn
-  ) {
-    cutSpacing = cutSpacingIn;
-    centerToCenter = centerToCenterIn;
-    sameNet = sameNetIn;
-    secondLayerName = secondLayerNameIn;
-    stack = stackIn;
-    adjacentCuts = adjacentCutsIn;
-    cutWithin = cutWithinIn;
-    exceptSamePGNet = isExceptSamePGNetIn;
-    parallelOverlap = isParallelOverlapIn;
-    cutArea = cutAreaIn;
-  }
-  // getter
-  bool hasCenterToCenter() const {
-    return centerToCenter;
-  }
-  bool getCenterToCenter() const {
-    return centerToCenter;
-  }
-  bool getSameNet() const {
-    return sameNet;
-  }
-  bool hasSameNet() const {
-    return sameNet;
-  }
-  bool getStack() const {
-    return stack;
-  }
-  bool hasStack() const {
-    return stack;
-  }
-  bool isLayer() const {
-    return !(secondLayerName.empty());
-  }
-  const frString& getSecondLayerName() const {
-    return secondLayerName;
-  }
-  bool isAdjacentCuts() const {
-    return !(adjacentCuts == -1);
-  }
-  int getAdjacentCuts() const {
-    return adjacentCuts;
-  }
-  frCoord getCutWithin() const {
-    return cutWithin;
-  }
-  bool hasExceptSamePGNet() const {
-    return exceptSamePGNet;
-  }
-  bool getExceptSamePGNet() const {
-    return exceptSamePGNet;
-  }
-  bool isParallelOverlap() const {
-    return parallelOverlap;
-  }
-  bool getParallelOverlap() const {
-    return parallelOverlap;
-  }
-  bool isArea() const {
-    return !(cutArea == -1);
-  }
-  bool getCutArea() const {
-    return cutArea;
-  }
-  frCoord getCutSpacing() const {
-    return cutSpacing;
-  }
-  frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcCutSpacingConstraint;
-  }
-
-
-
-  // setter
-
-  protected:
-    frCoord cutSpacing = -1;
-    bool centerToCenter = false;
-    bool sameNet = false;
-    bool stack = false;
-    bool exceptSamePGNet = false;
-    bool parallelOverlap = false;
-    frString secondLayerName;
-    int adjacentCuts = -1;
-    frCoord cutWithin = -1;
-    frCoord cutArea = -1;
-
-  };
-
-  // Lef58_CORNERSPACING
-  class frLef58CornerSpacingConvexCornerConstraint;
-  class frLef58CornerSpacingConcaveCornerConstraint;
-
-  class frLef58CornerSpacingConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingConstraint(
-      std::shared_ptr<frLef58CornerSpacingConcaveCornerConstraint> concaveConstraintIn,
-      frLef58CornerSpacingExceptionEnum &exceptionIn,
-      frCollection<std::shared_ptr<frLef58CornerSpacingSpacingConstraint> > &spacingsIn
-    ) {
-      concaveConstraint = concaveConstraintIn;
-      exception = exceptionIn;
-      spacings = spacingsIn;
-    }
-    frLef58CornerSpacingConstraint(
-      std::shared_ptr<frLef58CornerSpacingConvexCornerConstraint> convexConstraintIn,
-      frLef58CornerSpacingExceptionEnum &exceptionIn,
-      frCollection<std::shared_ptr<frLef58CornerSpacingSpacingConstraint> > &spacingsIn
-    ) {
-      convexConstraint = convexConstraintIn;
-      exception = exceptionIn;
-      spacings = spacingsIn;
-    }
-
-    // getter
-    std::shared_ptr<frLef58CornerSpacingConcaveCornerConstraint> getConcaveConstraint() {
-      return concaveConstraint;
-    }
-    std::shared_ptr<frLef58CornerSpacingConvexCornerConstraint> getConvexConstraint() {
-      return convexConstraint;
-    }
-    frLef58CornerSpacingExceptionEnum getException() {
-      return exception;
-    }
-    frCollection<std::shared_ptr<frLef58CornerSpacingSpacingConstraint> > getSpacings() {
-      return spacings;
-    }
-    // setter
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CornerSpacingConstraint;
-    }
-
-
-  protected:
-    std::shared_ptr<frLef58CornerSpacingConcaveCornerConstraint> concaveConstraint;
-    std::shared_ptr<frLef58CornerSpacingConvexCornerConstraint> convexConstraint;
-    frLef58CornerSpacingExceptionEnum exception = frLef58CornerSpacingExceptionEnum::NONE;
-    frCollection<std::shared_ptr<frLef58CornerSpacingSpacingConstraint> > spacings;
-
-  };
-
-  class frLef58CornerSpacingConcaveCornerConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingConcaveCornerConstraint(
-      frCoord minLengthIn = -1,
-      frCoord notchLengthIn = -1
-    ) {
-      if (minLengthIn != -1) {
-        minLength = minLengthIn;
-      }
-      if (notchLengthIn != -1) {
-        notchLength = notchLengthIn;
-      }
-    }
-    // getter
-    frCoord getMinLength() {
-      return minLength;
-    }
-    frCoord getNotchLength() {
-      return notchLength;
-    }
-  protected:
-    frCoord minLength = -1;
-    frCoord notchLength = -1;
-  };
-
-  class frLef58CornerSpacingConvexCornerConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingConvexCornerConstraint(
-      bool &sameMaskIn, 
-      bool &edgeLengthIn, 
-      bool &includeLShapeIn,
-      frCoord withinIn = -1,
-      frCoord eolWidthIn = -1,
-      frCoord lengthIn = -1
-    )
-      : sameMask(sameMaskIn), edgeLength(edgeLengthIn), includeLShape(includeLShapeIn)
-    {
-      if (withinIn != -1) {
-        within = withinIn;
-      }
-      if (eolWidthIn != -1) {
-        eolWidth = eolWidthIn;
-        if (lengthIn != -1) {
-          length = lengthIn;
-        }
-      }
-
-    }
-    // getter
-    bool isSameMask() {
-      return sameMask;
-    }
-    bool isEdgeLength() {
-      return edgeLength;
-    }
-    bool isIncludeLShape() {
-      return includeLShape;
-    }
-    frCoord getWithin() {
-      return within;
-    }
-    frCoord getEOLWidth() {
-      return eolWidth;
-    }
-    frCoord getExceptJogLength() {
-      return length;
-    }
-    // setter
-    void setSameMask(bool &sameMaskIn) {
-      sameMask = sameMaskIn;
-    }
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CornerSpacingConvexCornerConstraint;
-    }
-
-
-  protected:
-    frCoord within = -1;
-    frCoord eolWidth = -1;
-    frCoord length = -1;
-    bool sameMask = false;
-    bool edgeLength = false;
-    bool includeLShape = false;
-  };
-
-
-
-
-  class frLef58CornerSpacingSpacingConstraint : public frConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingSpacingConstraint(frCoord &widthIn)
-      : width(widthIn)
-    {}
-    // getter
-    frCoord getWidth() {
-      return width;
-    }
-    // setter
-    void setWidth(frCoord &widthIn) {
-      width = widthIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CornerSpacingSpacingConstraint;
-    }
-  protected:
-    frCoord width;
-  };
-
-  class frLef58CornerSpacingSpacing1DConstraint : public frLef58CornerSpacingSpacingConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingSpacing1DConstraint(frCoord widthIn, frCoord spacingIn)
-      : frLef58CornerSpacingSpacingConstraint(widthIn), spacing(spacingIn)
-    {}
-    // getter
-    frCoord getSpacing() {
-      return spacing;
-    }
-    // setter
-    void setSpacing(frCoord &spacingIn) {
-      spacing = spacingIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CornerSpacingSpacing1DConstraint;
-    }
-    
-  protected:
-    frCoord spacing = -1;
-  };
-
-  class frLef58CornerSpacingSpacing2DConstraint : public frLef58CornerSpacingSpacingConstraint {
-  public:
-    // constructor
-    frLef58CornerSpacingSpacing2DConstraint(frCoord widthIn, frCoord horizontalSpacingIn, frCoord verticalSpacingIn)
-      : frLef58CornerSpacingSpacingConstraint(widthIn), horizontalSpacing(horizontalSpacingIn), verticalSpacing(verticalSpacingIn)
-    {}
-    // getter
-    frCoord getHorizontalSpacing() {
-      return horizontalSpacing;
-    }
-    frCoord getVerticalSpacing() {
-      return verticalSpacing;
-    }
-    // setter
-    void setHorizontalSpacing(frCoord &horizontalSpacingIn) {
-      horizontalSpacing = horizontalSpacingIn;
-    }
-    void setVerticalSpacing(frCoord &verticalSpacingIn) {
-      verticalSpacing = verticalSpacingIn;
-    }
-
-    frConstraintTypeEnum typeId() const override {
-      return frConstraintTypeEnum::frcLef58CornerSpacingSpacing2DConstraint;
-    }
-  protected:
-    frCoord horizontalSpacing = -1, verticalSpacing = -1;
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frLayer.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frLayer.h
deleted file mode 100644
index 8bba188..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frLayer.h
+++ /dev/null
@@ -1,278 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_LAYER_H_
-#define _FR_LAYER_H_
-
-#include "frBaseTypes.h"
-#include "db/infra/frPrefRoutingDir.h"
-#include "db/infra/frSegStyle.h"
-#include "db/obj/frVia.h"
-#include "db/tech/frConstraint.h"
-
-namespace fr {
-  namespace io {
-    class Parser;
-  }
-  class frLayer {
-  public:
-    friend class io::Parser;
-    // constructor
-    frLayer(): pitch(0), width(0), defaultViaDef(nullptr), minSpc(nullptr), shortConstraint(nullptr), areaConstraint(nullptr), minStepConstraint(nullptr) {}
-    frLayer(frLayerNum layerNumIn, const frString &nameIn): layerNum(layerNumIn), name(nameIn), pitch(0), width(0), minWidth(-1), defaultViaDef(nullptr),
-                                                            minSpc(nullptr), shortConstraint(nullptr), areaConstraint(nullptr), minStepConstraint(nullptr),
-                                                            minWidthConstraint(nullptr) {}
-    // setters
-    void setLayerNum(frLayerNum layerNumIn) {
-      layerNum = layerNumIn;
-    }
-    void setName(const frString &nameIn) {
-      name = nameIn;
-    }
-    void setPitch(frUInt4 in) {
-      pitch = in;
-    }
-    void setWidth(frUInt4 widthIn) {
-      width = widthIn;
-    }
-    void setMinWidth(frUInt4 minWidthIn) {
-      minWidth = minWidthIn;
-    }
-    void setDir(frPrefRoutingDirEnum dirIn) {
-      dir.set(dirIn);
-    }
-    void setDefaultViaDef(frViaDef* in) {
-      defaultViaDef = in;
-    }
-    void addConstraint(const std::shared_ptr<frConstraint> &consIn) {
-      constraints.push_back(consIn);
-    }
-    void setType(frLayerTypeEnum typeIn) {
-      type = typeIn;
-    }
-    void addViaDef(frViaDef* viaDefIn) {
-      viaDefs.insert(viaDefIn);
-    }
-
-    // getters
-    frLayerNum getLayerNum() const {
-      return layerNum;
-    }
-    void getName(frString &nameIn) const {
-      nameIn = name;
-    }
-    frString getName() const {
-      return name;
-    }
-    frUInt4 getPitch() const {
-      return pitch;
-    }
-    frUInt4 getWidth() const {
-      return width;
-    }
-    frUInt4 getMinWidth() const {
-      return minWidth;
-    }
-    frPrefRoutingDir getDir() const {
-      return dir;
-    }
-    frSegStyle getDefaultSegStyle() const {
-      frSegStyle style;
-      style.setWidth(width);
-      style.setBeginStyle(frcExtendEndStyle, width/2);
-      style.setEndStyle(frcExtendEndStyle, width/2);
-      return style;
-    }
-    frViaDef* getDefaultViaDef() const {
-      return defaultViaDef;
-    }
-    std::set<frViaDef*> getViaDefs() const {
-      return viaDefs;
-    }
-    frCollection<std::shared_ptr<frConstraint> > getConstraints() const {
-      frCollection<std::shared_ptr<frConstraint> > constraintsOut;
-      for (auto constraint: constraints) {
-        constraintsOut.push_back(constraint.lock());
-      }
-      return constraintsOut;
-    }
-    frLayerTypeEnum getType() const {
-      return type;
-    }
-
-    // cut classes
-    bool hasLef58CutClassConstraint() const {
-      return (lef58CutClassConstraint.lock()) ? true : false;
-    }
-    std::shared_ptr<frLef58CutClassConstraint> getLef58CutClassConstraint() const {
-      return lef58CutClassConstraint.lock();
-    }
-    // cut spacing table
-    bool hasLef58CutSpacingTableConstraints() const {
-      return (lef58CutSpacingTableConstraints.size()) ? true : false;
-    }
-    frCollection<std::shared_ptr<frLef58CutSpacingTableConstraint> > getLef58CutSpacingTableConstraints() const {
-      frCollection<std::shared_ptr<frLef58CutSpacingTableConstraint> > sol;
-      std::transform(lef58CutSpacingTableConstraints.begin(), lef58CutSpacingTableConstraints.end(), 
-                     std::back_inserter(sol), 
-                     [](auto &kv) {return kv.lock();});
-      return sol;
-    }
-    // cut spacing
-    bool hasLef58CutSpacingConstraints() const {
-      return (lef58CutSpacingConstraints.size()) ? true : false;
-    }
-    frCollection<std::shared_ptr<frLef58CutSpacingConstraint> > getLef58CutSpacingConstraints() const {
-      frCollection<std::shared_ptr<frLef58CutSpacingConstraint> > sol;
-      std::transform(lef58CutSpacingConstraints.begin(), lef58CutSpacingConstraints.end(), 
-                     std::back_inserter(sol), 
-                     [](auto &kv) {return kv.lock();});
-      return sol;
-    }
-    // spacing end of line
-    bool hasLef58SpacingEndOfLineConstraints() const {
-      return (lef58SpacingEndOfLineConstraints.size()) ? true : false;
-    }
-    frCollection<std::shared_ptr<frLef58SpacingEndOfLineConstraint> > getLef58SpacingEndOfLineConstraints() const {
-      frCollection<std::shared_ptr<frLef58SpacingEndOfLineConstraint> > sol;
-      std::transform(lef58SpacingEndOfLineConstraints.begin(), lef58SpacingEndOfLineConstraints.end(), 
-                     std::back_inserter(sol), 
-                     [](auto &kv) {return kv.lock();});
-      return sol;
-    }
-
-    // new functions
-    bool hasMinSpacing() const {
-      return (minSpc);
-    }
-    frConstraint* getMinSpacing() const {
-      return minSpc;
-    }
-    void setMinSpacing(frConstraint* in) {
-      if (minSpc != nullptr) {
-        std::cout <<"Warning: override minspacing rule, ";
-        if (minSpc->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-          std::cout <<"original type is SPACING, ";
-        } else if (minSpc->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-          std::cout <<"original type is SPACINGTABLE PARALLELRUNLENGTH, ";
-        } else if (minSpc->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-          std::cout <<"original type is SPACINGTABLE TWOWIDTHS, ";
-        } else {
-          std::cout <<"original type is UNKNWON, ";
-        }
-        if (in->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-          std::cout <<"new type is SPACING";
-        } else if (in->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-          std::cout <<"new type is SPACINGTABLE PARALLELRUNLENGTH";
-        } else if (in->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-          std::cout <<"new type is SPACINGTABLE TWOWIDTHS";
-        } else {
-          std::cout <<"new type is UNKNWON";
-        }
-        std::cout <<std::endl;
-      }
-      minSpc = in;
-    }
-    bool hasEolSpacing() const {
-      return (eols.empty() ? false : true);
-    }
-    void addEolSpacing(frSpacingEndOfLineConstraint* in) {
-      eols.push_back(in);
-    }
-    const std::vector<frSpacingEndOfLineConstraint*>& getEolSpacing() const {
-      return eols;
-    }
-    std::vector<frSpacingEndOfLineConstraint*>& getEolSpacing() {
-      return eols;
-    }
-    void addCutConstraint(frCutSpacingConstraint* in) {
-      cutConstraints.push_back(in);
-    }
-    const std::vector<frCutSpacingConstraint*>& getCutConstraint() const {
-      return cutConstraints;
-    }
-    const std::vector<frCutSpacingConstraint*>& getCutSpacing() const {
-      return cutConstraints;
-    }
-    std::vector<frCutSpacingConstraint*>& getCutSpacing() {
-      return cutConstraints;
-    }
-    bool hasCutSpacing() const {
-      return (!cutConstraints.empty());
-    }
-    void setShortConstraint(frShortConstraint* in) {
-      shortConstraint = in;
-    }
-    frShortConstraint* getShortConstraint() {
-      return shortConstraint;
-    }
-    void setAreaConstraint(frAreaConstraint* in) {
-      areaConstraint = in;
-    }
-    frAreaConstraint* getAreaConstraint() {
-      return areaConstraint;
-    }
-    void setMinStepConstraint(frMinStepConstraint* in) {
-      minStepConstraint = in;
-    }
-    frMinStepConstraint* getMinStepConstraint() {
-      return minStepConstraint;
-    }
-    void setMinWidthConstraint(frMinWidthConstraint* in) {
-      minWidthConstraint = in;
-    }
-    frMinWidthConstraint* getMinWidthConstraint() {
-      return minWidthConstraint;
-    }
-
-  protected:
-    frLayerTypeEnum                                                 type;
-    frLayerNum                                                      layerNum;
-    frString                                                        name;
-    frUInt4                                                         pitch;
-    frUInt4                                                         width;
-    frUInt4                                                         minWidth;
-    frPrefRoutingDir                                                dir;
-    frViaDef*                                                       defaultViaDef;
-    std::set<frViaDef*>                                             viaDefs;
-    frCollection<std::weak_ptr<frConstraint>  >                     constraints;
-    std::weak_ptr<frLef58CutClassConstraint>                        lef58CutClassConstraint;     
-    frCollection<std::weak_ptr<frLef58CutSpacingTableConstraint> >  lef58CutSpacingTableConstraints;
-    frCollection<std::weak_ptr<frLef58CutSpacingConstraint> >       lef58CutSpacingConstraints;
-    frCollection<std::weak_ptr<frLef58SpacingEndOfLineConstraint> > lef58SpacingEndOfLineConstraints;
-    frConstraint*                                                   minSpc;
-    std::vector<frSpacingEndOfLineConstraint*>                      eols;
-    std::vector<frCutSpacingConstraint*>                            cutConstraints;
-    frShortConstraint*                                              shortConstraint;
-    frAreaConstraint*                                               areaConstraint;
-    frMinStepConstraint*                                            minStepConstraint;
-    frMinWidthConstraint*                                           minWidthConstraint;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frLookupTbl.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frLookupTbl.h
deleted file mode 100644
index ae62230..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frLookupTbl.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_LOOKUP_TBL_H_
-#define _FR_LOOKUP_TBL_H_
-
-// #include <map>
-#include "frBaseTypes.h"
-#include <iostream>
-
-namespace fr {
-  enum class frInterpolateType {
-    frcSnapDown,
-    frcSnapUp,
-    frcLinear
-  };
-
-  enum class frExtrapolateType {
-    frcSnapDown,
-    frcSnapUp,
-    frcLinear
-  };
-
-  // fr1DLookupTbl
-  template <class rowClass, class valClass>
-  class fr1DLookupTbl {
-  public:
-    // constructor
-    fr1DLookupTbl(frString &rowNameIn,
-                  frCollection<rowClass> &rowsIn,
-                  frCollection<valClass> &valsIn) {
-      rowName = rowNameIn;
-      rows = rowsIn;
-      vals = valsIn;
-      interpolateTypeRow = frInterpolateType::frcSnapDown;
-      interpolateTypeCol = frInterpolateType::frcSnapDown;
-      extrapolateTypeRowLower = frExtrapolateType::frcSnapUp;
-      extrapolateTypeRowUpper = frExtrapolateType::frcSnapUp;
-    }
-
-    // getters
-    frString getRowName();
-    frCollection<rowClass> getRows();
-
-    // setters
-    void setRowName(frString &name);
-    void setInterpolateTypeRow(frInterpolateType &type);
-    void setInterpolateTypeCol(frInterpolateType &type);
-    void setExtrapolateTypeRowLower(frExtrapolateType &type);
-    void setExtrapolateTypeRowUpper(frExtrapolateType &type);
-
-    // others
-    valClass find(rowClass &rowVal) {
-      valClass retVal;
-      frUInt4 rowIdx = getRowIdx(rowVal);
-      retVal = vals[rowIdx];
-      return retVal;
-    }
-
-  private:
-    frUInt4 getRowIdx(rowClass &rowVal) {
-      // currently only implement spacingtable style
-      // interpolation
-      frUInt4 retIdx;
-      if (rowVal >= rows.front() && rowVal <= rows.back()) {
-        if (true) {
-        // if (interpolateTypeRow == frInterpolateType::frcSnapDown) {
-          auto pos = lower_bound(rows.begin(), rows.end(), rowVal);
-          // if (*pos != rowVal && pos != rows.begin()) {
-          //   --pos;
-          // }
-          if (pos != rows.begin()) {
-            --pos;
-          }
-          retIdx = pos - rows.begin();
-        }
-      }
-      // lower extrapolation
-      else if (rowVal < rows.front()) {
-        if (true) {
-        // if (extrapolateTypeRowLower == frExtrapolateType::frcSnapUp) {
-          retIdx = 0;
-        }
-      }
-      // upper extrapolation
-      else {
-        if (true) {
-        // if (extrapolateTypeRowUpper == frExtrapolateType::frcSnapDown) {
-          retIdx = rows.size() - 1;
-        }
-      }
-      return retIdx;
-    }
-
-
-
-    frCollection<rowClass> rows;
-    frCollection<valClass> vals;
-
-
-    frString rowName;
-
-    frInterpolateType interpolateTypeRow;
-    frInterpolateType interpolateTypeCol;
-    frExtrapolateType extrapolateTypeRowLower;
-    frExtrapolateType extrapolateTypeRowUpper;
-
-
-  };
-
-
-  // fr2DLookupTbl
-  template <class rowClass, class colClass, class valClass>
-  class fr2DLookupTbl {
-  public:
-    friend class frLef58SpacingTableConstraint;
-    // constructor
-    fr2DLookupTbl() {}
-    fr2DLookupTbl(const fr2DLookupTbl &in): rows(in.rows), cols(in.cols), vals(in.vals),
-                                            rowName(in.rowName), colName(in.colName),
-                                            interpolateTypeRow(in.interpolateTypeRow),
-                                            interpolateTypeCol(in.interpolateTypeCol),
-                                            extrapolateTypeRowLower(in.extrapolateTypeRowLower),
-                                            extrapolateTypeRowUpper(in.extrapolateTypeRowUpper),
-                                            extrapolateTypeColLower(in.extrapolateTypeColLower),
-                                            extrapolateTypeColUpper(in.extrapolateTypeColUpper) {}
-    fr2DLookupTbl(const frString &rowNameIn,
-                  const frCollection<rowClass> &rowsIn,
-                  const frString &colNameIn,
-                  const frCollection<colClass> &colsIn,
-                  const frCollection<frCollection<valClass> > &valsIn) {
-      rowName = rowNameIn;
-      rows = rowsIn;
-      colName = colNameIn;
-      cols = colsIn;
-      vals = valsIn;
-      interpolateTypeRow = frInterpolateType::frcSnapDown;
-      interpolateTypeCol = frInterpolateType::frcSnapDown;
-      extrapolateTypeRowLower = frExtrapolateType::frcSnapUp;
-      extrapolateTypeRowUpper = frExtrapolateType::frcSnapUp;
-      extrapolateTypeColLower = frExtrapolateType::frcSnapDown;
-      extrapolateTypeColUpper = frExtrapolateType::frcSnapDown;
-    }
-
-    // getters
-    frString getRowName() const;
-    frString getColName() const;
-
-    frCollection<rowClass> getRows() {
-      return rows;
-    }
-    frCollection<colClass> getCols() {
-      return cols;
-    }
-
-    // setters
-    void setRowName(frString &name);
-    void setColName(frString &name);
-    void setInterpolateTypeRow(frInterpolateType &type);
-    void setInterpolateTypeCol(frInterpolateType &type);
-    void setExtrapolateTypeRowLower(frExtrapolateType &type);
-    void setExtrapolateTypeColLower(frExtrapolateType &type);
-    void setExtrapolateTypeRowUpper(frExtrapolateType &type);
-    void setExtrapolateTypeColUpper(frExtrapolateType &type);
-
-    // others
-    valClass find(const rowClass &rowVal, const colClass &colVal) const {
-      valClass retVal;
-      frUInt4 rowIdx = getRowIdx(rowVal);
-      frUInt4 colIdx = getColIdx(colVal);
-      //std::cout << "rowIdx = " << rowIdx << ", colIdx = " << colIdx << std::endl <<std::flush;
-      retVal = vals[rowIdx][colIdx];
-      return retVal;
-    }
-
-    // debug
-    void printTbl() const {
-      std::cout << "rowName: " << rowName << std::endl;
-      for (auto &m : rows) {
-        std::cout << m << " ";
-      }
-      std::cout << "\n colName: " << colName << std::endl;
-      for (auto &m : cols) {
-        std::cout << m << " ";
-      }
-      std::cout << "\n vals: " << std::endl;
-      for (auto &m : vals) {
-        for (auto &n : m) {
-          std::cout << n << " ";
-        }
-        std::cout << std::endl;
-      }
-    }
-
-  private:
-    frUInt4 getRowIdx(const rowClass &rowVal) const {
-      // currently only implement spacingtable style
-      auto pos = --(std::lower_bound(rows.begin(), rows.end(), rowVal));
-      return std::max(0, (int)std::distance(rows.begin(), pos));
-    }
-    frUInt4 getColIdx(const colClass &colVal) const {
-      // currently only implement spacingtable style
-      auto pos = --(std::lower_bound(cols.begin(), cols.end(), colVal));
-      return std::max(0, (int)std::distance(cols.begin(), pos));
-    }
-    //frUInt4 getRowIdx(const rowClass &rowVal) const {
-    //  // currently only implement spacingtable style
-    //  // interpolation
-    //  frUInt4 retIdx;
-    //  if (rowVal >= rows.front() && rowVal <= rows.back()) {
-    //    if (true) {
-    //    // if (interpolateTypeRow == frInterpolateType::frcSnapDown) {
-    //      auto pos = lower_bound(rows.begin(), rows.end(), rowVal);
-    //      if (*pos != rowVal && pos != rows.begin()) {
-    //        --pos;
-    //      }
-    //      retIdx = pos - rows.begin();
-    //    }
-    //  }
-    //  // lower extrapolation
-    //  else if (rowVal < rows.front()) {
-    //    if (true) {
-    //    // if (extrapolateTypeRowLower == frExtrapolateType::frcSnapUp) {
-    //      retIdx = 0;
-    //    }
-    //  }
-    //  // upper extrapolation
-    //  else {
-    //    if (true) {
-    //    // if (extrapolateTypeRowUpper == frExtrapolateType::frcSnapDown) {
-    //      retIdx = rows.size() - 1;
-    //    }
-    //  }
-    //  return retIdx;
-    //}
-    //frUInt4 getColIdx(const colClass &colVal) const {
-    //  // currently only implement spacingtable style
-    //  // interpolation
-    //  frUInt4 retIdx;
-    //  if (colVal >= cols.front() && colVal <= cols.back()) {
-    //    if (true) {
-    //    // if (interpolateTypeCol == frInterpolateType::frcSnapDown) {
-    //      auto pos = lower_bound(cols.begin(), cols.end(), colVal);
-    //      if (*pos != colVal && pos != cols.begin()) {
-    //        --pos;
-    //      }
-    //      retIdx = pos - cols.begin();
-    //    }
-    //  }
-    //  // lower extrapolation
-    //  else if (colVal < cols.front()) {
-    //    if (true) {
-    //    // if (extrapolateTypeColLower == frExtrapolateType::frcSnapUp) {
-    //      retIdx = 0;
-    //    }
-    //  }
-    //  // upper extrapolation
-    //  else {
-    //    if (true) {
-    //    // if (extrapolateTypeColUpper == frExtrapolateType::frcSnapDown) {
-    //      retIdx = cols.size() - 1;
-    //    }
-    //  }
-    //  return retIdx;  
-    //}
-
-
-    frCollection<rowClass> rows;
-    frCollection<colClass> cols;
-    frCollection<frCollection<valClass> > vals;
-
-
-    frString rowName;
-    frString colName;
-
-    frInterpolateType interpolateTypeRow;
-    frInterpolateType interpolateTypeCol;
-    frExtrapolateType extrapolateTypeRowLower;
-    frExtrapolateType extrapolateTypeRowUpper;
-    frExtrapolateType extrapolateTypeColLower;
-    frExtrapolateType extrapolateTypeColUpper;
-
-
-  };
-
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frTechObject.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frTechObject.h
deleted file mode 100644
index 36daf76..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frTechObject.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_TECHOBJECT_H_
-#define _FR_TECHOBJECT_H_
-
-#include <map>
-#include <iostream>
-#include <vector>
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/tech/frLayer.h"
-#include "db/obj/frVia.h"
-#include "db/tech/frViaRuleGenerate.h"
-
-namespace fr {
-  namespace io {
-    class Parser;
-  }
-  class frTechObject {
-  public:
-    // constructors
-    frTechObject() {}
-    // getters
-    frUInt4 getDBUPerUU() const {
-      return dbUnit;
-    }
-    frLayer* getLayer(const frString &name) const {
-      if (name2layer.find(name) == name2layer.end()) {
-        // std::cout <<"Error: cannot find layer" <<std::endl;
-        // exit(1);
-        return nullptr;
-      } else {
-        return name2layer.at(name);
-      }
-    }
-    frLayer* getLayer(frLayerNum in) const {
-      if ((int)in < 0 || in >= (int)layers.size()) {
-        std::cout <<"Error: cannot find layer" <<std::endl;
-        exit(1);
-      } else {
-        return layers.at(in).get();
-      }
-    }
-    frLayerNum getBottomLayerNum() const {
-      return 0;
-    }
-    frLayerNum getTopLayerNum() const {
-      return (frLayerNum)((int)layers.size() - 1);
-    }
-    std::vector<std::unique_ptr<frLayer> >& getLayers() {
-      return layers;
-    }
-    const std::vector<std::unique_ptr<frLayer> >& getLayers() const {
-      return layers;
-    }
-    std::vector<std::unique_ptr<frViaDef> >& getVias() {
-      return vias;
-    }
-    const std::vector<std::unique_ptr<frViaDef> >& getVias() const {
-      return vias;
-    }
-    std::vector<std::unique_ptr<frViaRuleGenerate> >& getViaRuleGenerates() {
-      return viaRuleGenerates;
-    }
-    const std::vector<std::unique_ptr<frViaRuleGenerate> >& getViaRuleGenerates() const {
-      return viaRuleGenerates;
-    }
-
-    // setters
-    void setDBUPerUU(frUInt4 uIn) {
-      dbUnit = uIn;
-    }
-    void addLayer(std::unique_ptr<frLayer> &in) {
-      name2layer[in->getName()] = in.get();
-      layers.push_back(std::move(in));
-    }
-    void addVia(std::unique_ptr<frViaDef> &in) {
-      name2via[in->getName()] = in.get();
-      vias.push_back(std::move(in));
-    }
-    void addViaRuleGenerate(std::unique_ptr<frViaRuleGenerate> &in) {
-      name2viaRuleGenerate[in->getName()] = in.get();
-      viaRuleGenerates.push_back(std::move(in));
-    }
-    void addConstraint(const std::shared_ptr<frConstraint> &constraintIn) {
-      constraints.push_back(constraintIn);
-    }
-    void addUConstraint(std::unique_ptr<frConstraint> &in) {
-      uConstraints.push_back(std::move(in));
-    }
-
-    // debug
-    void printAllConstraints() {
-      std::cout << "List of Constraints:\n";
-      for (auto &layer: layers) {
-        std::cout << "  Layer " << layer->getName() << "\n";
-        for (auto &constraint: layer->getConstraints()) {
-          if (std::dynamic_pointer_cast<frCutSpacingConstraint>(constraint)) {
-            std::cout << "    CUT SPACING " << std::dynamic_pointer_cast<frCutSpacingConstraint>(constraint)->getCutSpacing() * 1.0 / dbUnit << "\n";
-          }
-          if (std::dynamic_pointer_cast<frSpacingConstraint>(constraint)) {
-            std::cout << "    ROUTING SPACING " << std::dynamic_pointer_cast<frSpacingConstraint>(constraint)->getMinSpacing() * 1.0 / dbUnit << "\n"; 
-          }
-        }
-      }
-    }
-
-    void printDefaultVias() {
-      std::cout << "List of default vias:\n";
-      for (auto &layer: layers) {
-        if (layer->getType() == frLayerTypeEnum::CUT) {
-          std::cout << "  Layer " << layer->getName() << "\n" << std::flush;
-          std::cout << "    default via: " << layer->getDefaultViaDef()->getName() << "\n";
-        }
-      }
-    }     
-
-    // others
-    void printAllVias();
-    friend class io::Parser;
-  protected:
-    frUInt4                                          dbUnit;
-
-    std::map<frString, frLayer*>                     name2layer;
-    std::vector<std::unique_ptr<frLayer> >           layers;
-
-    std::map<frString, frViaDef*>                    name2via;
-    std::vector<std::unique_ptr<frViaDef> >          vias;
-
-    std::map<frString, frViaRuleGenerate*>           name2viaRuleGenerate;
-    std::vector<std::unique_ptr<frViaRuleGenerate> > viaRuleGenerates;
-
-    frCollection<std::shared_ptr<frConstraint> >     constraints;
-    std::vector<std::unique_ptr<frConstraint> >      uConstraints;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaDef.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaDef.h
deleted file mode 100644
index 20c9150..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaDef.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_VIADEF_H_
-#define _FR_VIADEF_H_
-
-#include <vector>
-#include <memory>
-#include "frBaseTypes.h"
-#include "db/obj/frShape.h"
-
-namespace fr{
-  class frLef58CutClass {
-  public:
-    // constructors
-    frLef58CutClass(): name(""), viaWidth(0), viaLength(0), numCut(1) {}
-    // getters
-    void getName(frString &in) const {
-      in = name;
-    }
-    frString getName() const {
-      return name;
-    }
-    frCoord getViaWidth() const {
-      return viaWidth;
-    }
-    bool hasViaLength() const {
-      return (viaLength == viaWidth) ? false : true;
-    }
-    frCoord getViaLength() const {
-      return viaLength;
-    }
-    //bool hasNumCut() const {
-    //  return hNumCut;
-    //}
-    frUInt4 getNumCut() const {
-      return numCut;
-    }
-    // setters
-    void setName(frString &in) {
-      name = in;
-    }
-    void setViaWidth(frCoord in) {
-      viaWidth = in;
-    }
-    void setViaLength(frCoord in) {
-      //hViaLength = true;
-      viaLength = in;
-    }
-    void setNumCut(frUInt4 in) {
-      numCut = in;
-    }
-  protected:
-    frString name;
-    frCoord  viaWidth;
-    //bool     hViaLength;
-    frCoord  viaLength;
-    frUInt4  numCut; // this value is not equal to #multi cuts, only used for calculating resistance, currently ignored in rule checking process
-  };
-
-
-  class frViaDef {
-  public:
-    // constructors
-    frViaDef(): name(), isDefault(false), layer1Figs(), layer2Figs(), cutFigs(), cutClass() {}
-    //frViaDef(const frViaDef &in): name(defIn.name), isDefault(defIn.isDefault), cutClass(defIn.cutClass) {}
-    frViaDef(const frString &nameIn): name(nameIn), isDefault(false), layer1Figs(),
-                                     layer2Figs(), cutFigs(), cutClass() {}
-    // getters
-    void getName(frString &nameIn) const {
-      nameIn = name;
-    }
-    frString getName() const {
-      return name;
-    }
-    frLayerNum getLayer1Num() const {
-      if (layer1Figs.size()) {
-        return (layer1Figs.at(0))->getLayerNum();
-      } else {
-        std::cout <<"Error: via does not have shape on layer 1" <<std::endl;
-        exit(1);
-      }
-    }
-    frLayerNum getLayer2Num() const {
-      if (layer2Figs.size()) {
-        return (layer2Figs.at(0))->getLayerNum();
-      } else {
-        std::cout <<"Error: via does not have shape on layer 2" <<std::endl;
-        exit(1);
-      }
-    }
-    frLayerNum getCutLayerNum() const {
-      if (cutFigs.size()) {
-        return (cutFigs.at(0))->getLayerNum();
-      } else {
-        std::cout <<"Error: via does not have shape on layer cut" <<std::endl;
-        exit(1);
-      }
-    }
-    std::vector<std::unique_ptr<frShape> >& getLayer1Figs() {
-      return layer1Figs;
-    }
-    std::vector<std::unique_ptr<frShape> >& getLayer2Figs() {
-      return layer2Figs;
-    }
-    std::vector<std::unique_ptr<frShape> >& getCutFigs() {
-      return cutFigs;
-    }
-    const std::vector<std::unique_ptr<frShape> >& getLayer1Figs() const {
-      return layer1Figs;
-    }
-    const std::vector<std::unique_ptr<frShape> >& getLayer2Figs() const {
-      return layer2Figs;
-    }
-    const std::vector<std::unique_ptr<frShape> >& getCutFigs() const {
-      return cutFigs;
-    }
-    bool getDefault() const {
-      return isDefault;
-    }
-    bool hasCutClass() const {
-      return (cutClass.lock()) ? true : false;
-    }
-    std::shared_ptr<frLef58CutClass> getCutClass() const {
-      return cutClass.lock();
-    }
-    bool isMultiCut() const {
-      return (cutFigs.size() > 1) ? true : false;
-    }
-    //void getLayer1BBox (frBox &boxIn) const;
-    //void getCutBBox (frBox &boxIn) const;
-    //void getLayer2BBox (frBox &boxIn) const;
-    // setters
-    void addLayer1Fig(std::unique_ptr<frShape> &figIn) {
-      layer1Figs.push_back(std::move(figIn));
-    }
-    void addLayer2Fig(std::unique_ptr<frShape> &figIn) {
-      layer2Figs.push_back(std::move(figIn));
-    }
-    void addCutFig(std::unique_ptr<frShape> &figIn) {
-      cutFigs.push_back(std::move(figIn));
-    }
-    void setDefault(bool isDefaultIn) {
-      isDefault = isDefaultIn;
-    }
-    void setCutClass(const std::shared_ptr<frLef58CutClass> &in) {
-      cutClass = in;
-    }
-  protected:
-    frString                                 name;
-    bool                                     isDefault;
-    std::vector< std::unique_ptr<frShape> >  layer1Figs;
-    std::vector< std::unique_ptr<frShape> >  layer2Figs;
-    std::vector< std::unique_ptr<frShape> >  cutFigs;
-    std::weak_ptr<frLef58CutClass>           cutClass;
-  };
-}
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaRuleGenerate.h b/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaRuleGenerate.h
deleted file mode 100644
index 67b1f83..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/db/tech/frViaRuleGenerate.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_VIARULEGEN_H_
-#define _FR_VIARULEGEN_H_
-
-#include <memory>
-#include "db/infra/frBox.h"
-
-namespace fr {
-  class frViaRuleGenerate {
-  public:
-    // constructors
-    frViaRuleGenerate(const frString &nameIn): name(nameIn), isDefault(false), botEnc(), cutRect(), 
-                                               cutSpacing(), topEnc(), botLayerNum(0), cutLayerNum(0),
-                                               topLayerNum(0) {}
-    // getters
-    const frString& getName() const {
-      return name;
-    }
-    bool getDefault() const {
-      return isDefault;
-    }
-    const frPoint& getLayer1Enc() const {
-      return botEnc;
-    }
-    const frBox& getCutRect() const {
-      return cutRect;
-    }
-    const frPoint& getCutSpacing() const {
-      return cutSpacing;
-    }
-    const frPoint& getLayer2Enc() const {
-      return topEnc;
-    }
-    frLayerNum getLayer1Num() const {
-      return botLayerNum;
-    }
-    frLayerNum getLayer2Num() const {
-      return topLayerNum;
-    }
-    frLayerNum getCutLayerNum() const {
-      return cutLayerNum;
-    }
-    // setters
-    void setDefault(bool in) {
-      isDefault = in;
-    }
-    void setLayer1Enc(const frPoint &in) {
-      botEnc = in;
-    }
-    void setCutRect(const frBox &in) {
-      cutRect = in;
-    }
-    void setCutSpacing(const frPoint &in) {
-      cutSpacing = in;
-    }
-    void setLayer2Enc(const frPoint &in) {
-      topEnc = in;
-    }
-    void setLayer1Num(frLayerNum in) {
-      botLayerNum = in;
-    }
-    void setCutLayerNum(frLayerNum in) {
-      cutLayerNum = in;
-    }
-    void setLayer2Num(frLayerNum in) {
-      topLayerNum = in;
-    }
-  protected:
-    frString                                 name;
-    bool                                     isDefault;
-    frPoint                                  botEnc;
-    frBox                                    cutRect;
-    frPoint                                  cutSpacing;
-    frPoint                                  topEnc;
-    frLayerNum                               botLayerNum;
-    frLayerNum                               cutLayerNum;
-    frLayerNum                               topLayerNum;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.cpp
deleted file mode 100644
index 9322893..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.cpp
+++ /dev/null
@@ -1,926 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <chrono>
-#include <fstream>
-#include <boost/io/ios_state.hpp>
-//#include <taskflow/taskflow.hpp>
-#include "dr/FlexDR.h"
-#include "io/io.h"
-#include "db/infra/frTime.h"
-//#include <omp.h>
-
-using namespace std;
-using namespace fr;
-
-// std::chrono::duration<double> time_span_init(0);
-// std::chrono::duration<double> time_span_init0(0);
-// std::chrono::duration<double> time_span_init1(0);
-// std::chrono::duration<double> time_span_init2(0);
-// std::chrono::duration<double> time_span_init3(0);
-// std::chrono::duration<double> time_span_route(0);
-// std::chrono::duration<double> time_span_end(0);
-
-int FlexDRWorker::main() {
-  using namespace std::chrono;
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  if (VERBOSE > 1) {
-    frBox scaledBox;
-    stringstream ss;
-    ss <<endl <<"start DR worker (BOX) "
-                <<"( " <<routeBox.left()   * 1.0 / getTech()->getDBUPerUU() <<" "
-                <<routeBox.bottom() * 1.0 / getTech()->getDBUPerUU() <<" ) ( "
-                <<routeBox.right()  * 1.0 / getTech()->getDBUPerUU() <<" "
-                <<routeBox.top()    * 1.0 / getTech()->getDBUPerUU() <<" )" <<endl;
-    cout <<ss.str() <<flush;
-  }
-  //return 0;
-
-  init();
-  //FlexMazeRoute mazeInst(getDesign(), routeBox, extBox);
-  //mazeInst.setInitDR(isInitDR());
-  //mazeInst.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  //mazeInst.route();
-  route();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  end();
-  //mazeInst.end();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-
-  duration<double> time_span0 = duration_cast<duration<double>>(t1 - t0);
-  //time_span_init  += time_span0;
-  duration<double> time_span1 = duration_cast<duration<double>>(t2 - t1);
-  //time_span_route += time_span1;
-  duration<double> time_span2 = duration_cast<duration<double>>(t3 - t2);
-  //time_span_end   += time_span2;
-
-  if (VERBOSE > 1) {
-    stringstream ss;
-    ss   <<"time (INIT/ROUTE/POST) " <<time_span0.count() <<" " 
-                                     <<time_span1.count() <<" "
-                                     <<time_span2.count() <<" "
-                                     <<endl;
-    cout <<ss.str() <<flush;
-  }
-  return 0;
-}
-
-void FlexDR::initFromTA() {
-  bool enableOutput = false;
-  // initialize lists
-  int cnt = 0;
-  for (auto &net: getDesign()->getTopBlock()->getNets()) {
-    for (auto &guide: net->getGuides()) {
-      for (auto &connFig: guide->getRoutes()) {
-        if (connFig->typeId() == frcPathSeg) {
-          unique_ptr<frShape> ps = make_unique<frPathSeg>(*(static_cast<frPathSeg*>(connFig.get())));
-          frPoint bp, ep;
-          static_cast<frPathSeg*>(ps.get())->getPoints(bp, ep);
-          if (ep.x() - bp.x() + ep.y() - bp.y() == 1) {
-            ; // skip TA dummy segment
-          } else {
-            net->addShape(ps);
-          }
-        } else {
-          cout <<"Error: initFromTA unsupported shape" <<endl;
-        }
-      }
-    }
-    //net->clearGuides(); // should not clear guide because of initGCellBoundary
-    cnt++;
-    //if (cnt < 100000) {
-    //  if (cnt % 10000 == 0) {
-    //    cout <<"  initFromTA complete " <<cnt <<" nets" <<endl;
-    //  }
-    //} else {
-    //  if (cnt % 100000 == 0) {
-    //    cout <<"  initFromTA complete " <<cnt <<" nets" <<endl;
-    //  }
-    //}
-  }
-  //getRegionQuery()->clearGuides(); // should not clear guide because of initGCellBoundary
-
-  if (enableOutput) {
-    for (auto &net: getDesign()->getTopBlock()->getNets()) {
-      cout <<"net " <<net->getName() <<" has " <<net->getShapes().size() <<" shape" <<endl;
-    }
-  }
-}
-
-void FlexDR::initGCell2BoundaryPin() {
-  bool enableOutput = false;
-  // initiailize size
-  frBox dieBox;
-  getDesign()->getTopBlock()->getBoundaryBBox(dieBox);
-  auto gCellPatterns = getDesign()->getTopBlock()->getGCellPatterns();
-  auto &xgp = gCellPatterns.at(0);
-  auto &ygp = gCellPatterns.at(1);
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  //frCoord GCELLOFFSETX = xgp.getStartCoord();
-  //frCoord GCELLOFFSETY = ygp.getStartCoord();
-  //frCoord GCELLCNTX    = xgp.getCount();
-  //frCoord GCELLCNTY    = ygp.getCount();
-  auto tmpVec = vector<map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> >((int)ygp.getCount());
-  gcell2BoundaryPin = vector<vector<map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> > >((int)xgp.getCount(), tmpVec);
-  for (auto &net: getDesign()->getTopBlock()->getNets()) {
-    auto netPtr = net.get();
-    for (auto &guide: net->getGuides()) {
-      for (auto &connFig: guide->getRoutes()) {
-        if (connFig->typeId() == frcPathSeg) {
-          auto ps = static_cast<frPathSeg*>(connFig.get());
-          frLayerNum layerNum;
-          frPoint bp, ep;
-          ps->getPoints(bp, ep);
-          layerNum = ps->getLayerNum();
-          // skip TA dummy segment
-          if (ep.x() - bp.x() + ep.y() - bp.y() == 1 || ep.x() - bp.x() + ep.y() - bp.y() == 0) {
-            continue; 
-          }
-          frPoint idx1, idx2;
-          getDesign()->getTopBlock()->getGCellIdx(bp, idx1);
-          getDesign()->getTopBlock()->getGCellIdx(ep, idx2);
-          //frBox gcellBox1, gcellBox2;
-          //getDesign()->getTopBlock()->getGCellBox(idx1, gcellBox1);
-          //getDesign()->getTopBlock()->getGCellBox(idx2, gcellBox2);
-          // update gcell2BoundaryPin
-          // horizontal
-          if (bp.y() == ep.y()) {
-            //int x1 = (bp.x() - xgp.getStartCoord()) / xgp.getSpacing();
-            //int x2 = (ep.x() - xgp.getStartCoord()) / xgp.getSpacing();
-            //int y  = (bp.y() - ygp.getStartCoord()) / ygp.getSpacing();
-            int x1 = idx1.x();
-            int x2 = idx2.x();
-            int y  = idx1.y();
-            //if (x1 < 0 || x2 < 0 || y < 0) {
-            //  cout <<"Warning: initGCell2BoundaryPin < 0";
-            //  exit(1);
-            //}
-            //if (x1 >= (int)GCELLCNTX) {
-            //  x1 = (int)GCELLCNTX - 1;
-            //}
-            //if (x2 >= (int)GCELLCNTX) {
-            //  x2 = (int)GCELLCNTX - 1;
-            //}
-            //if (y >= (int)GCELLCNTY) {
-            //  y = (int)GCELLCNTY - 1;
-            //}
-            for (auto x = x1; x <= x2; ++x) {
-              frBox gcellBox;
-              getDesign()->getTopBlock()->getGCellBox(frPoint(x, y), gcellBox);
-              //frCoord leftBound  = x * xgp.getSpacing() + xgp.getStartCoord();
-              //frCoord rightBound = (x == (int)GCELLCNTX - 1) ? dieBox.right() : (x + 1) * xgp.getSpacing() + xgp.getStartCoord();
-              frCoord leftBound  = gcellBox.left();
-              frCoord rightBound = gcellBox.right();
-              bool hasLeftBound  = true;
-              bool hasRightBound = true;
-              if (bp.x() < leftBound) {
-                hasLeftBound = true;
-              } else {
-                hasLeftBound = false;
-              }
-              if (ep.x() >= rightBound) {
-                hasRightBound = true;
-              } else {
-                hasRightBound = false;
-              }
-              if (hasLeftBound) {
-                frPoint boundaryPt(leftBound, bp.y());
-                gcell2BoundaryPin[x][y][netPtr].insert(make_pair(boundaryPt, layerNum));
-                if (enableOutput) {
-                  cout << "init left boundary pin (" 
-                       << boundaryPt.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                       << boundaryPt.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") at ("
-                       << x <<", " <<y <<") " 
-                       << getTech()->getLayer(layerNum)->getName() <<" "
-                       << string((net == nullptr) ? "null" : net->getName()) <<"\n";
-                }
-              }
-              if (hasRightBound) {
-                frPoint boundaryPt(rightBound, ep.y());
-                gcell2BoundaryPin[x][y][netPtr].insert(make_pair(boundaryPt, layerNum));
-                if (enableOutput) {
-                  cout << "init right boundary pin (" 
-                       << boundaryPt.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                       << boundaryPt.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") at ("
-                       << x <<", " <<y <<") " 
-                       << getTech()->getLayer(layerNum)->getName() <<" "
-                       << string((net == nullptr) ? "null" : net->getName()) <<"\n";
-                }
-              }
-            }
-          } else if (bp.x() == ep.x()) {
-            //int x  = (bp.x() - xgp.getStartCoord()) / xgp.getSpacing();
-            //int y1 = (bp.y() - ygp.getStartCoord()) / ygp.getSpacing();
-            //int y2 = (ep.y() - ygp.getStartCoord()) / ygp.getSpacing();
-            int x  = idx1.x();
-            int y1 = idx1.y();
-            int y2 = idx2.y();
-            //if (y1 < 0 || y2 < 0 || x < 0) {
-            //  cout <<"Warning: initGCell2BoundaryPin < 0";
-            //  exit(1);
-            //}
-            //if (x >= (int)GCELLCNTX) {
-            //  x = (int)GCELLCNTX - 1;
-            //}
-            //if (y1 >= (int)GCELLCNTY) {
-            //  y1 = (int)GCELLCNTY - 1;
-            //}
-            //if (y2 >= (int)GCELLCNTY) {
-            //  y2 = (int)GCELLCNTY - 1;
-            //}
-            for (auto y = y1; y <= y2; ++y) {
-              frBox gcellBox;
-              getDesign()->getTopBlock()->getGCellBox(frPoint(x, y), gcellBox);
-              //frCoord bottomBound = y * ygp.getSpacing() + ygp.getStartCoord();
-              //frCoord topBound    = (y == (int)GCELLCNTY - 1) ? dieBox.top() : (y + 1) * ygp.getSpacing() + ygp.getStartCoord();
-              frCoord bottomBound = gcellBox.bottom();
-              frCoord topBound    = gcellBox.top();
-              bool hasBottomBound = true;
-              bool hasTopBound    = true;
-              if (bp.y() < bottomBound) {
-                hasBottomBound = true;
-              } else {
-                hasBottomBound = false;
-              }
-              if (ep.y() >= topBound) {
-                hasTopBound = true;
-              } else {
-                hasTopBound = false;
-              }
-              if (hasBottomBound) {
-                frPoint boundaryPt(bp.x(), bottomBound);
-                gcell2BoundaryPin[x][y][netPtr].insert(make_pair(boundaryPt, layerNum));
-                if (enableOutput) {
-                  cout << "init bottom boundary pin (" 
-                       << boundaryPt.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                       << boundaryPt.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") at ("
-                       << x <<", " <<y <<") " 
-                       << getTech()->getLayer(layerNum)->getName() <<" "
-                       << string((net == nullptr) ? "null" : net->getName()) <<"\n";
-                }
-              }
-              if (hasTopBound) {
-                frPoint boundaryPt(ep.x(), topBound);
-                gcell2BoundaryPin[x][y][netPtr].insert(make_pair(boundaryPt, layerNum));
-                if (enableOutput) {
-                  cout << "init top boundary pin (" 
-                       << boundaryPt.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                       << boundaryPt.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") at ("
-                       << x <<", " <<y <<") " 
-                       << getTech()->getLayer(layerNum)->getName() <<" "
-                       << string((net == nullptr) ? "null" : net->getName()) <<"\n";
-                }
-              }
-            }
-          } else {
-            cout << "Error: non-orthogonal pathseg in initGCell2BoundryPin\n";
-          }
-        }
-      }
-    }
-  }
-}
-
-void FlexDR::init() {
-  frTime t;
-  if (VERBOSE > 0) {
-    cout <<endl <<"start routing data preparation" <<endl;
-  }
-  //initFromTA();
-  initGCell2BoundaryPin();
-  //if (VERBOSE > 0) {
-  //  cout <<endl <<"init dr objs ..." <<endl;
-  //}
-  getRegionQuery()->initDRObj(getTech()->getLayers().size());
-  //getRegionQuery()->printDRObj();
-  if (VERBOSE > 0) {
-    t.print();
-  }
-}
-
-void FlexDR::removeGCell2BoundaryPin() {
-  gcell2BoundaryPin.clear();
-  gcell2BoundaryPin.shrink_to_fit();
-}
-
-map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> FlexDR::initDR_mergeBoundaryPin(int startX, int startY, int size, const frBox &routeBox) {
-  map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> bp;
-  auto gCellPatterns = getDesign()->getTopBlock()->getGCellPatterns();
-  auto &xgp = gCellPatterns.at(0);
-  auto &ygp = gCellPatterns.at(1);
-  for (int i = startX; i < (int)xgp.getCount() && i < startX + size; i++) {
-    for (int j = startY; j < (int)ygp.getCount() && j < startY + size; j++) {
-      auto &currBp = gcell2BoundaryPin[i][j];
-      for (auto &[net, s]: currBp) {
-        for (auto &[pt, lNum]: s) {
-          if (pt.x() == routeBox.left()   || pt.x() == routeBox.right() ||
-              pt.y() == routeBox.bottom() || pt.y() == routeBox.top()) {
-            bp[net].insert(make_pair(pt, lNum));
-          }
-        }
-      }
-    }
-  }
-  return bp;
-}
-
-void FlexDR::initDR(int size, bool enableDRC) {
-  bool TEST = false;
-  //bool TEST = true;
-  //cout <<"sizeof listiter   = " <<sizeof(frListIter<frPathSeg>) <<endl;
-  //cout <<"sizeof raw ptr    = " <<sizeof(frPathSeg*) <<endl;
-  //cout <<"sizeof unique ptr = " <<sizeof(unique_ptr<frPathSeg>) <<endl;
-  //cout <<"sizeof shared_ptr = " <<sizeof(shared_ptr<frPathSeg>) <<endl;
-  //exit(0);
-
-  //FlexGridGraph gg(getTech(), getDesign());
-  ////frBox testBBox(225000, 228100, 228000, 231100); // net1702 in ispd19_test1
-  //frBox testBBox(0, 0, 2000, 2000); // net1702 in ispd19_test1
-  ////gg.setBBox(testBBox);
-  //gg.init(testBBox);
-  //gg.print();
-  //exit(1);
-
-  frTime t;
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"start initial detail routing ..." <<endl;
-  }
-  frBox dieBox;
-  getDesign()->getTopBlock()->getBoundaryBBox(dieBox);
-
-  auto gCellPatterns = getDesign()->getTopBlock()->getGCellPatterns();
-  auto &xgp = gCellPatterns.at(0);
-  auto &ygp = gCellPatterns.at(1);
-
-  int numQuickMarkers = 0;
-  if (TEST) {
-    FlexDRWorker worker(getDesign());
-    //frBox routeBox;
-    //routeBox.set(0*2000, 0*2000, 1*2000, 1*2000);
-    frCoord xl = 0 * 2000;
-    frCoord yl = 45.6 * 2000;
-    //frCoord xh = 129 * 2000;
-    //frCoord yh = 94.05 * 2000;
-    frPoint idx;
-    getDesign()->getTopBlock()->getGCellIdx(frPoint(xl, yl), idx);
-    if (VERBOSE > 1) {
-      cout <<"(i,j) = (" <<idx.x() <<", " <<idx.y() <<")" <<endl;
-    }
-    //getDesign()->getTopBlock()->getGCellBox(idx, routeBox);
-    frBox routeBox1;
-    getDesign()->getTopBlock()->getGCellBox(frPoint(idx.x(), idx.y()), routeBox1);
-    frBox routeBox2;
-    getDesign()->getTopBlock()->getGCellBox(frPoint(min((int)xgp.getCount() - 1, idx.x() + size-1), 
-                                                    min((int)ygp.getCount(), idx.y() + size-1)), routeBox2);
-    frBox routeBox(routeBox1.left(), routeBox1.bottom(), routeBox2.right(), routeBox2.top());
-    auto bp = initDR_mergeBoundaryPin(idx.x(), idx.y(), size, routeBox);
-    //routeBox.set(129*2000, 94.05*2000, 132*2000, 96.9*2000);
-    worker.setRouteBox(routeBox);
-    frBox extBox;
-    routeBox.bloat(1000, extBox);
-    worker.setRouteBox(routeBox);
-    worker.setExtBox(extBox);
-    //int i = (129   * 2000 - xgp.getStartCoord()) / xgp.getSpacing();
-    //int j = (94.05 * 2000 - ygp.getStartCoord()) / ygp.getSpacing();
-    //worker.setDRIter(0, gcell2BoundaryPin[idx.x()][idx.y()]);
-    worker.setDRIter(0, bp);
-    worker.setEnableDRC(enableDRC);
-    worker.main();
-    cout <<"done"  <<endl <<flush;
-  } else {
-    //vector<FlexDRWorker> workers;
-    int cnt = 0;
-    //int tot = (int)xgp.getCount() * (int)ygp.getCount();
-    int tot = (((int)xgp.getCount() - 1) / size + 1) * (((int)ygp.getCount() - 1) / size + 1);
-    int prev_perc = 0;
-    bool isExceed = false;
-    for (int i = 0; i < (int)xgp.getCount(); i += size) {
-      for (int j = 0; j < (int)ygp.getCount(); j += size) {
-    //for (int i = 310; i < 330; i++) {
-    //  for (int j = 300; j < 320; j++) {
-        FlexDRWorker worker(getDesign());
-        frBox routeBox1;
-        getDesign()->getTopBlock()->getGCellBox(frPoint(i, j), routeBox1);
-        frBox routeBox2;
-        getDesign()->getTopBlock()->getGCellBox(frPoint(min((int)xgp.getCount() - 1, i + size-1), 
-                                                        min((int)ygp.getCount(), j + size-1)), routeBox2);
-        //frBox routeBox;
-        frBox routeBox(routeBox1.left(), routeBox1.bottom(), routeBox2.right(), routeBox2.top());
-        //getDesign()->getTopBlock()->getGCellBox(frPoint(i, j), routeBox);
-        //if (!(routeBox.left()   >= 504 * 2000  && routeBox.right() <= 525*2000 &&
-        //    routeBox.bottom() >= 538.65*2000 && routeBox.top()   <= 558.6*2000)) {
-        //  continue;
-        //}
-        frBox extBox;
-        routeBox.bloat(1000, extBox);
-        worker.setRouteBox(routeBox);
-        worker.setExtBox(extBox);
-        //workers.push_back(worker);
-        //worker.setDRIter(0, &gcell2BoundaryPin[i][j]);
-        auto bp = initDR_mergeBoundaryPin(i, j, size, routeBox);
-        worker.setDRIter(0, bp);
-        // set boundary pin
-        worker.setEnableDRC(enableDRC);
-        worker.main();
-        numQuickMarkers += worker.getNumQuickMarkers();
-        //cout <<"i/j = " <<i <<", " <<j <<endl;
-        cnt++;
-        if (VERBOSE > 0) {
-          if (cnt * 1.0 / tot >= prev_perc / 100.0 + 0.1) {
-            if (prev_perc == 0 && t.isExceed(2)) {
-              isExceed = true;
-            }
-            prev_perc += 10;
-            //if (true) {
-            if (isExceed) {
-              if (enableDRC) {
-                cout <<"    completing " <<prev_perc <<"% with " <<getDesign()->getTopBlock()->getNumMarkers() <<" violations" <<endl;
-              } else {
-                cout <<"    completing " <<prev_perc <<"% with " <<numQuickMarkers <<" quick violations" <<endl;
-              }
-              cout <<"    " <<t <<endl <<flush;
-            }
-          }
-        }
-        //if (cnt % 10000 == 0) {
-        //  cout <<"    complete " <<cnt <<"/" <<tot <<endl;
-        //  cout <<"    " <<t <<endl;
-        //  //cout <<"  completing XX% with YY violations" <<endl;
-        //  //cout <<"  elapsed time = 00:04:55, memory = ZZZZ.ZZ (MB)" <<endl;
-        //}
-      }
-    }
-  }
-
-  //cout <<"  number of violations = " <<numMarkers <<endl;
-  removeGCell2BoundaryPin();
-  checkConnectivity();
-
-  if (VERBOSE > 0) {
-    if (enableDRC) {
-      cout <<"  number of violations = "       <<getDesign()->getTopBlock()->getNumMarkers() <<endl;
-    } else {
-      cout <<"  number of quick violations = " <<numQuickMarkers <<endl;
-    }
-    //cout <<"    by layer and type :" <<endl;
-    //cout <<"           MetSpc EOLSpc Loop CutSpc AdjCut CorSpc Others Totals" <<endl;
-    //cout <<"    Metal1      0      0    0      0      0      0      0      0" <<endl;
-    //cout <<"    Totals      0      0    0      0      0      0      0      0" <<endl;
-    //cout <<"cpu time = 00:00:00, elapsed time = 00:00:00, memory = 0000.00 (MB), peak = 0000.00 (MB)" <<endl;
-    t.print();
-    cout <<flush;
-  }
-}
-
-void FlexDR::searchRepair(int iter, int size, int offset, int mazeEndIter, 
-                          frUInt4 workerDRCCost, frUInt4 workerMarkerCost,
-                          bool enableDRC, int ripupMode, bool TEST) {
-  frTime t;
-  //bool TEST = false;
-  //bool TEST = true;
-  if (VERBOSE > 0) {
-    cout <<endl <<"start " <<iter;
-    string suffix;
-    if (iter == 1 || (iter > 20 && iter % 10 == 1)) {
-      suffix = "st";
-    } else if (iter == 2 || (iter > 20 && iter % 10 == 2)) {
-      suffix = "nd";
-    } else if (iter == 3 || (iter > 20 && iter % 10 == 3)) {
-      suffix = "rd";
-    } else {
-      suffix = "th";
-    }
-    cout <<suffix <<" optimization iteration ..." <<endl;
-  }
-  frBox dieBox;
-  getDesign()->getTopBlock()->getBoundaryBBox(dieBox);
-  //getRegionQuery()->initDRObj(getTech()->getLayers().size());
-  //getRegionQuery()->printDRObj();
-  auto gCellPatterns = getDesign()->getTopBlock()->getGCellPatterns();
-  auto &xgp = gCellPatterns.at(0);
-  auto &ygp = gCellPatterns.at(1);
-  int numQuickMarkers = 0;
-  if (TEST) {
-    cout <<"search and repair test mode" <<endl <<flush;
-    FlexDRWorker worker(getDesign());
-    frBox routeBox;
-    //frCoord xl = 148.5 * 2000;
-    //frCoord yl = 570 * 2000;
-    //frPoint idx;
-    //getDesign()->getTopBlock()->getGCellIdx(frPoint(xl, yl), idx);
-    //if (VERBOSE > 1) {
-    //  cout <<"(i,j) = (" <<idx.x() <<", " <<idx.y() <<")" <<endl;
-    //}
-    //getDesign()->getTopBlock()->getGCellBox(idx, routeBox);
-    //routeBox.set(156*2000, 108.3*2000, 177*2000, 128.25*2000);
-    // routeBox.set(175*2000, 3.5*2000, 185*2000, 13.5*2000);
-    routeBox.set(0*2000, 0*2000, 200*2000, 200*2000);
-    worker.setRouteBox(routeBox);
-    frBox extBox;
-    routeBox.bloat(1000, extBox);
-    worker.setRouteBox(routeBox);
-    worker.setExtBox(extBox);
-    worker.setMazeEndIter(mazeEndIter);
-    // worker.setTest(true);
-    worker.setTest(false);
-    worker.setDRCTest(true);
-    worker.setDRIter(iter);
-    worker.setEnableDRC(enableDRC);
-    worker.setRipupMode(ripupMode);
-    worker.setCost(workerDRCCost, workerMarkerCost);
-    worker.main();
-    numQuickMarkers += worker.getNumQuickMarkers();
-    cout <<"done"  <<endl <<flush;
-  } else {
-    //vector<FlexDRWorker> workers;
-    int clipSize = size;
-    int cnt = 0;
-    int tot = (((int)xgp.getCount() - 1 - offset) / clipSize + 1) * (((int)ygp.getCount() - 1 - offset) / clipSize + 1);
-    int prev_perc = 0;
-    bool isExceed = false;
-    for (int i = offset; i < (int)xgp.getCount(); i += clipSize) {
-      for (int j = offset; j < (int)ygp.getCount(); j += clipSize) {
-    //for (int i = 312; i < 330; i += 3) {
-    //  for (int j = 300; j < 318; j += 3) {
-        FlexDRWorker worker(getDesign());
-        frBox routeBox1;
-        getDesign()->getTopBlock()->getGCellBox(frPoint(i, j), routeBox1);
-        frBox routeBox2;
-        getDesign()->getTopBlock()->getGCellBox(frPoint(min((int)xgp.getCount() - 1, i + clipSize-1), 
-                                                        min((int)ygp.getCount(), j + clipSize-1)), routeBox2);
-        frBox routeBox(routeBox1.left(), routeBox1.bottom(), routeBox2.right(), routeBox2.top());
-        frBox extBox;
-        routeBox.bloat(1000, extBox);
-        worker.setRouteBox(routeBox);
-        worker.setExtBox(extBox);
-        worker.setMazeEndIter(mazeEndIter);
-        worker.setDRIter(iter);
-        worker.setEnableDRC(enableDRC);
-        worker.setRipupMode(ripupMode);
-        worker.setCost(workerDRCCost, workerMarkerCost);
-        //workers.push_back(worker);
-        worker.main();
-        numQuickMarkers += worker.getNumQuickMarkers();
-        cnt++;
-        if (VERBOSE > 0) {
-          if (cnt * 1.0 / tot >= prev_perc / 100.0 + 0.1) {
-            if (prev_perc == 0 && t.isExceed(2)) {
-              isExceed = true;
-            }
-            prev_perc += 10;
-            //if (true) {
-            if (isExceed) {
-              if (enableDRC) {
-                cout <<"    completing " <<prev_perc <<"% with " <<getDesign()->getTopBlock()->getNumMarkers() <<" violations" <<endl;
-              } else {
-                cout <<"    completing " <<prev_perc <<"% with " <<numQuickMarkers <<" quick violations" <<endl;
-              }
-              cout <<"    " <<t <<endl <<flush;
-            }
-          }
-        }
-        //if (cnt > 10000 && ) {
-        //  cout <<"    completing " <<cnt <<"/" <<tot <<endl;
-        //  cout <<"    " <<t <<endl;
-        //  //cout <<"  completing XX% with YY violations" <<endl;
-        //  //cout <<"  elapsed time = 00:04:55, memory = ZZZZ.ZZ (MB)" <<endl;
-        //}
-      }
-    }
-  }
-  //cout <<"  number of violations = " <<numMarkers <<endl;
-  checkConnectivity();
-  if (VERBOSE > 0) {
-    if (enableDRC) {
-      cout <<"  number of violations = " <<getDesign()->getTopBlock()->getNumMarkers() <<endl;
-    } else {
-      cout <<"  number of quick violations = " <<numQuickMarkers <<endl;
-    }
-    //cout <<"    by layer and type :" <<endl;
-    //cout <<"           MetSpc EOLSpc Loop CutSpc AdjCut CorSpc Others Totals" <<endl;
-    //cout <<"    Metal1      0      0    0      0      0      0      0      0" <<endl;
-    //cout <<"    Totals      0      0    0      0      0      0      0      0" <<endl;
-    //cout <<"cpu time = 00:00:00, elapsed time = 00:00:00, memory = 0000.00 (MB), peak = 0000.00 (MB)" <<endl;
-    t.print();
-    cout <<flush;
-  }
-}
-
-void FlexDR::end() {
-  vector<unsigned long long> wlen(getTech()->getLayers().size(), 0);
-  vector<unsigned long long> sCut(getTech()->getLayers().size(), 0);
-  vector<unsigned long long> mCut(getTech()->getLayers().size(), 0);
-  unsigned long long totWlen = 0;
-  unsigned long long totSCut = 0;
-  unsigned long long totMCut = 0;
-  frPoint bp, ep;
-  for (auto &net: getDesign()->getTopBlock()->getNets()) {
-    for (auto &shape: net->getShapes()) {
-      if (shape->typeId() == frcPathSeg) {
-        auto obj = static_cast<frPathSeg*>(shape.get());
-        obj->getPoints(bp, ep);
-        auto lNum = obj->getLayerNum();
-        frCoord psLen = ep.x() - bp.x() + ep.y() - bp.y();
-        wlen[lNum] += psLen;
-        totWlen += psLen;
-      }
-    }
-    for (auto &via: net->getVias()) {
-      auto lNum = via->getViaDef()->getCutLayerNum();
-      if (via->getViaDef()->isMultiCut()) {
-        ++mCut[lNum];
-        ++totMCut;
-      } else {
-        ++sCut[lNum];
-        ++totSCut;
-      }
-    }
-  }
-  if (VERBOSE > 0) {
-    boost::io::ios_all_saver guard(std::cout);
-    cout <<endl <<"total wire length = " <<totWlen / getDesign()->getTopBlock()->getDBUPerUU() <<" um" <<endl;
-    for (int i = getTech()->getBottomLayerNum(); i <= getTech()->getTopLayerNum(); i++) {
-      if (getTech()->getLayer(i)->getType() == frLayerTypeEnum::ROUTING) {
-        cout <<"total wire length on LAYER " <<getTech()->getLayer(i)->getName() <<" = " 
-             <<wlen[i] / getDesign()->getTopBlock()->getDBUPerUU() <<" um" <<endl;
-      }
-    }
-    cout <<"total number of vias = " <<totSCut + totMCut <<endl;
-    if (totMCut > 0) {
-      cout <<"total number of multi-cut vias = " <<totMCut 
-           << " (" <<setw(5) <<fixed <<setprecision(1) <<totMCut * 100.0 / (totSCut + totMCut) <<"%)" <<endl;
-      cout <<"total number of single-cut vias = " <<totSCut 
-           << " (" <<setw(5) <<fixed <<setprecision(1) <<totSCut * 100.0 / (totSCut + totMCut) <<"%)" <<endl;
-    }
-    cout <<"up-via summary (total " <<totSCut + totMCut <<"):" <<endl;
-    int nameLen = 0;
-    for (int i = getTech()->getBottomLayerNum(); i <= getTech()->getTopLayerNum(); i++) {
-      if (getTech()->getLayer(i)->getType() == frLayerTypeEnum::CUT) {
-        nameLen = max(nameLen, (int)getTech()->getLayer(i-1)->getName().size());
-      }
-    }
-    int maxL = 1 + nameLen + 4 + (int)to_string(totSCut).length();
-    if (totMCut) {
-      maxL += 9 + 4 + (int)to_string(totMCut).length() + 9 + 4 + (int)to_string(totSCut + totMCut).length();
-    }
-    if (totMCut) {
-      cout <<" " <<setw(nameLen + 4 + (int)to_string(totSCut).length() + 9) <<"single-cut";
-      cout <<setw(4 + (int)to_string(totMCut).length() + 9) <<"multi-cut" 
-           <<setw(4 + (int)to_string(totSCut + totMCut).length()) <<"total";
-    }
-    cout <<endl;
-    for (int i = 0; i < maxL; i++) {
-      cout <<"-";
-    }
-    cout <<endl;
-    for (int i = getTech()->getBottomLayerNum(); i <= getTech()->getTopLayerNum(); i++) {
-      if (getTech()->getLayer(i)->getType() == frLayerTypeEnum::CUT) {
-        cout <<" "    <<setw(nameLen) <<getTech()->getLayer(i-1)->getName() 
-             <<"    " <<setw((int)to_string(totSCut).length()) <<sCut[i];
-        if (totMCut) {
-          cout <<" ("   <<setw(5) <<(double)((sCut[i] + mCut[i]) ? sCut[i] * 100.0 / (sCut[i] + mCut[i]) : 0.0) <<"%)";
-          cout <<"    " <<setw((int)to_string(totMCut).length()) <<mCut[i] 
-               <<" ("   <<setw(5) <<(double)((sCut[i] + mCut[i]) ? mCut[i] * 100.0 / (sCut[i] + mCut[i]) : 0.0) <<"%)"
-               <<"    " <<setw((int)to_string(totSCut + totMCut).length()) <<sCut[i] + mCut[i];
-        }
-        cout <<endl;
-      }
-    }
-    for (int i = 0; i < maxL; i++) {
-      cout <<"-";
-    }
-    cout <<endl;
-    cout <<" "    <<setw(nameLen) <<""
-         <<"    " <<setw((int)to_string(totSCut).length()) <<totSCut;
-    if (totMCut) {
-      cout <<" ("   <<setw(5) <<(double)((totSCut + totMCut) ? totSCut * 100.0 / (totSCut + totMCut) : 0.0) <<"%)";
-      cout <<"    " <<setw((int)to_string(totMCut).length()) <<totMCut 
-           <<" ("   <<setw(5) <<(double)((totSCut + totMCut) ? totMCut * 100.0 / (totSCut + totMCut) : 0.0) <<"%)"
-           <<"    " <<setw((int)to_string(totSCut + totMCut).length()) <<totSCut + totMCut;
-    }
-    cout <<endl <<endl <<flush;
-    guard.restore();
-  }
-}
-
-void FlexDR::reportDRC() {
-  double dbu = design->getTech()->getDBUPerUU();
-  cout << DRC_RPT_FILE << "\n";
-  if (DRC_RPT_FILE != string("")) {
-    ofstream drcRpt(DRC_RPT_FILE.c_str());
-    if (drcRpt.is_open()) {
-      for (auto &marker: getDesign()->getTopBlock()->getMarkers()) {
-        drcRpt << "  violation type: " << int(marker->getConstraint()->typeId()) << "\n";
-        // get source(s) of violation
-        drcRpt << "    srcs: ";
-        for (auto src: marker->getSrcs()) {
-          if (src) {
-            switch (src->typeId()) {
-              case frcNet:
-                drcRpt << (static_cast<frNet*>(src))->getName() << " ";
-                break;
-              case frcInstTerm: {
-                frInstTerm* instTerm = (static_cast<frInstTerm*>(src));
-                // drcRpt << instTerm->getInst()->getName() 
-                       // << "/" << instTerm->getTerm()->getName() << " ";
-                drcRpt << "Pin of Cell " << instTerm->getInst()->getName() << " ";
-                break;
-              }
-              case frcTerm: {
-                frTerm* term = (static_cast<frTerm*>(src));
-                drcRpt << term->getName() << " ";
-                break;
-              }
-              default:
-                std::cout << "Error: unexpected src type in marker\n";
-            }
-          }
-        }
-        drcRpt << "\n";
-        // get violation bbox
-        frBox bbox;
-        marker->getBBox(bbox);
-        drcRpt << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-               << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    } else {
-      cout << "Error: Fail to open DRC report file\n";
-    }
-  } else {
-    cout << "Error: DRC report file is not specified\n";
-  }
-}
-
-
-int FlexDR::main() {
-  init();
-  frTime t;
-  if (VERBOSE > 0) {
-    cout <<endl <<endl <<"start detail routing ...";
-  }
-  // initDR: enableDRC
-  initDR(7, true);
-  //cout   <<endl
-  //       <<"time (INIT/ROUTE/POST) " <<time_span_init.count() <<" " 
-  //                                   <<time_span_route.count() <<" "
-  //                                   <<time_span_end.count() <<" "
-  //                                   <<endl;
-  //io::Writer writer(getDesign());
-  //writer.writeFromDR("_init");
-  // search and repair: iter, size, offset, mazeEndIter, workerDRCCost, workerMarkerCost, enableDRC, ripupMode, TEST
-  // assume only mazeEndIter > 1 if enableDRC and ripupMode == 0 (partial ripup)
-  end();
-  searchRepair(1, 7, 3, 1, DRCCOST, 0, true, 1); // func as fully rerouting iter, no marker cost
-  //end();
-  //searchRepair(2, 7, 0, 1, DRCCOST, 0, true, 1); // func as rerouting iter, no marker cost
-  //end();
-  //searchRepair(3, 7, 0, 1, DRCCOST, 0, true, 1); // func as rerouting iter, no marker cost
-  //end();
-  //searchRepair(4, 7, 3, 1, DRCCOST, 0, true, 1); // func as rerouting iter, no marker cost
-  end();
-  searchRepair(2, 7, 0, 1, DRCCOST, MARKERCOST, true, 0); // true search and repair
-  end();
-  searchRepair(3, 7, 3, 1, DRCCOST, MARKERCOST, true, 0); // true search and repair
-  end();
-  searchRepair(4, 7, 0, 1, DRCCOST, MARKERCOST*2, true, 0); // true search and repair
-  end();
-  searchRepair(5, 7, 3, 1, DRCCOST, MARKERCOST*2, true, 0); // true search and repair
-  //reportDRC();
-  //end();
-  //searchRepair(7, 7, 0, 1, DRCCOST, MARKERCOST*32, true, 0);
-  //end();
-  //searchRepair(8, 7, 3, 1, DRCCOST, MARKERCOST*32, true, 0);
-  //end();
-  //searchRepair(4, 11, 5, 1, true);
-  //end();
-  //searchRepair(5, 13, 0, 1, true);
-  //end();
-  //searchRepair(6, 13, 7, 1, true);
-  //end();
-  //searchRepair(7, 17, 0, 1, true);
-  //end();
-  //searchRepair(8, 17, 9, 1, true);
-  //end();
-  //searchRepair(3, 7, 1, 4);
-  //end();
-  //searchRepair(4, 11, 0, 6);
-  //end();
-  //BOTTOM_ROUTING_LAYER = 2;
-  //searchRepair(3, 7, 0, 1, true);
-  //end();
-  //searchRepair(5, 11, 5, 6);
-  //end();
-  //searchRepair(4, 17, 0);
-  //end();
-  //searchRepair(2, 16, 1);
-  //end();
-  //searchRepair(3, 16, 2);
-  //end();
-  //searchRepair(4, 16, 3);
-  //end();
-  //searchRepair(5, 16, 4);
-  //for (int i = 1; i <= END_ITERATION; i++) {
-  //  end();
-  //  searchRepair(i, 5, 0);
-  //}
-  //omp_set_num_threads(40);
-  //#pragma omp parallel for schedule(dynamic)
-  //for (int i = 0; i < 999999999; i++) {
-  //  auto j = i*i;
-  //  if (VERBOSE > 100) {
-  //    cout <<j <<endl;
-  //  }
-  //}
-  //time_span_init  = std::chrono::duration<double>(0);
-  //time_span_route = std::chrono::duration<double>(0);
-  //time_span_end   = std::chrono::duration<double>(0);
-  //cout   <<endl 
-  //       <<"time (INIT/ROUTE/POST) " <<time_span_init.count() <<" " 
-  //                                   <<time_span_route.count() <<" "
-  //                                   <<time_span_end.count() <<" "
-  //                                   <<endl;
-
-  if (DRC_RPT_FILE != std::string("")) {
-    double dbu = getDesign()->getTech()->getDBUPerUU();
-    std::ofstream drcRpt(DRC_RPT_FILE.c_str());
-    if (drcRpt.is_open()) {
-      for (auto &umarker: getDesign()->getTopBlock()->getMarkers()) {
-        auto &marker = *umarker;
-        drcRpt << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        // get source(s) of violation
-        drcRpt << "    srcs: ";
-        for (auto src: marker.getSrcs()) {
-          if (src) {
-            switch (src->typeId()) {
-              case frcNet:
-                drcRpt << (static_cast<frNet*>(src))->getName() << " ";
-                break;
-              case frcInstTerm: {
-                frInstTerm* instTerm = (static_cast<frInstTerm*>(src));
-                // drcRpt << instTerm->getInst()->getName() 
-                       // << "/" << instTerm->getTerm()->getName() << " ";
-                drcRpt << "Pin of Cell " << instTerm->getInst()->getName() << " ";
-                break;
-              }
-              case frcTerm: {
-                frTerm* term = (static_cast<frTerm*>(src));
-                drcRpt << term->getName() << " ";
-                break;
-              }
-              default:
-                std::cout << "Error: unexpected src type in marker\n";
-            }
-          }
-        }
-        drcRpt << "\n";
-        // get violation bbox
-        frBox bbox;
-        marker.getBBox(bbox);
-        drcRpt << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-               << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    } else {
-      std::cout << "Error: Fail to open DRC report file\n";
-    }
-  }
-
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"complete detail routing";
-    end();
-  }
-  if (VERBOSE > 0) {
-    t.print();
-    cout <<endl;
-  }
-  return 0;
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.h b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.h
deleted file mode 100644
index 504aa2c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR.h
+++ /dev/null
@@ -1,507 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_FLEXDR_H_
-#define _FR_FLEXDR_H_
-
-#include <memory>
-#include "frDesign.h"
-#include "db/drObj/drNet.h"
-#include "db/drObj/drMarker.h"
-#include "dr/FlexGridGraph.h"
-#include "dr/FlexWavefront.h"
-
-namespace fr {
-
-  class FlexDR {
-  public:
-    // constructors
-    FlexDR(frDesign* designIn): design(designIn) {}
-    // getters
-    frTechObject* getTech() const {
-      return design->getTech();
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    frRegionQuery* getRegionQuery() const {
-      return design->getRegionQuery();
-    }
-    // others
-    int main();
-  protected:
-    frDesign*          design;
-    std::vector<std::vector<std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> > > gcell2BoundaryPin;
-    // others
-    void init();
-    void initFromTA();
-    void initGCell2BoundaryPin();
-    void removeGCell2BoundaryPin();
-    void checkConnectivity();
-    void checkConnectivity_initDRObjs(frNet* net, std::vector<frConnFig*> &netDRObjs);
-    void checkConnectivity_pin2epMap(frNet* net, std::vector<frConnFig*> &netDRObjs,
-                                     std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap);
-    void checkConnectivity_pin2epMap_helper(frNet* net, const frPoint &bp, frLayerNum lNum, 
-                                            std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap);
-    void checkConnectivity_nodeMap(frNet* net, 
-                                   std::vector<frConnFig*> &netDRObjs,
-                                   std::vector<frBlockObject*> &netPins,
-                                   std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                   std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void checkConnectivity_nodeMap_routeObjEnd(frNet* net, std::vector<frConnFig*> &netRouteObjs,
-                                               std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void checkConnectivity_nodeMap_routeObjSplit(frNet* net, std::vector<frConnFig*> &netRouteObjs,
-                                                 std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void checkConnectivity_nodeMap_routeObjSplit_helper(const frPoint &crossPt, 
-                   frCoord trackCoord, frCoord splitCoord, frLayerNum lNum, 
-                   std::vector<std::map<frCoord, std::map<frCoord, std::pair<frCoord, int> > > > &mergeHelper,
-                   std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void checkConnectivity_nodeMap_pin(frNet* net, 
-                                       std::vector<frConnFig*> &netRouteObjs,
-                                       std::vector<frBlockObject*> &netPins,
-                                       std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                       std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    bool checkConnectivity_astar(frNet* net, std::vector<bool> &adjVisited, std::vector<int> &adjPrevIdx, 
-                                 std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap, int &gCnt, int &nCnt);
-    void checkConnectivity_final(frNet *net, std::vector<frConnFig*> &netRouteObjs, std::vector<frBlockObject*> &netPins,
-                                 std::vector<bool> &adjVisited, int gCnt, int nCnt,
-                                 std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void initDR(int size, bool enableDRC = false);
-    std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> initDR_mergeBoundaryPin(int i, int j, int size, const frBox &routeBox);
-    void searchRepair(int iter, int size, int offset, int mazeEndIter = 1, frUInt4 workerDRCCost = DRCCOST, frUInt4 workerMarkerCost = MARKERCOST, 
-                      bool enableDRC = false, int ripupMode = 1, bool TEST = false);
-    void end();
-    void reportDRC();
-  };
-
-  class FlexDRWorker;
-  class FlexDRWorkerRegionQuery {
-  public:
-      FlexDRWorkerRegionQuery(FlexDRWorker* in): drWorker(in) {}
-      frDesign* getDesign() const;
-      FlexDRWorker* getDRWorker() const {
-        return drWorker;
-      }
-      void add(drConnFig* connFig);
-      void add(drConnFig* connFig, std::vector<std::vector<rq_rptr_value_t<drConnFig> > > &allShapes);
-      void remove(drConnFig* connFig);
-      void query(const frBox &box, frLayerNum layerNum, std::vector<drConnFig*> &result);
-      void init();
-  protected:
-      FlexDRWorker* drWorker;
-      std::vector<bgi::rtree<rq_rptr_value_t<drConnFig>, bgi::quadratic<16> > > shapes; // only for drXXX in dr worker
-  };
-
-  class FlexDRMinAreaVio {
-  public:
-    // constructors
-    FlexDRMinAreaVio() {}
-    FlexDRMinAreaVio(drNet* netIn, FlexMazeIdx bpIn, FlexMazeIdx epIn, frCoord gapAreaIn): net(netIn), 
-                                                                                           bp(bpIn),
-                                                                                           ep(epIn),
-                                                                                           gapArea(gapAreaIn) {}
-    // setters
-    void setDRNet(drNet *netIn) {
-      net = netIn;
-    }
-    void setPoints(FlexMazeIdx bpIn, FlexMazeIdx epIn) {
-      bp = bpIn;
-      ep = epIn;
-    }
-    void setGapArea(frCoord gapAreaIn) {
-      gapArea = gapAreaIn;
-    }
-
-    // getters
-    drNet* getNet() const {
-      return net;
-    }
-    void getPoints(FlexMazeIdx &bpIn, FlexMazeIdx &epIn) const {
-      bpIn = bp;
-      epIn = ep;
-    }
-    frCoord getGapArea() const {
-      return gapArea;
-    }
-
-  protected:
-    drNet *net;
-    FlexMazeIdx bp, ep;
-    frCoord gapArea;
-  };
-
-  class FlexDRWorker {
-  public:
-    // constructors
-    FlexDRWorker(frDesign* designIn): design(designIn), routeBox(), extBox(), drIter(0), mazeEndIter(1), 
-                                      TEST(false), DRCTEST(false), enableDRC(true), ripupMode(1), workerDRCCost(DRCCOST), 
-                                      workerMarkerCost(MARKERCOST), boundaryPin(), pinCnt(0), initNumMarkers(0),
-                                      apSVia(), fixedObjs(), planarHistoryMarkers(), viaHistoryMarkers(), 
-                                      nets(), gridGraph(designIn), markers(), rq(this) {}
-    // setters
-    void setRouteBox(const frBox &boxIn) {
-      routeBox.set(boxIn);
-    }
-    void setExtBox(const frBox &boxIn) {
-      extBox.set(boxIn);
-    }
-    void setDRIter(int in) {
-      drIter = in;
-    }
-    void setDRIter(int in, std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &bp) {
-      drIter = in;
-      boundaryPin = std::move(bp);
-    }
-    void setMazeEndIter(int in) {
-      mazeEndIter = in;
-    }
-    void setTest(bool in) {
-      TEST = in;
-    }
-    void setDRCTest(bool in) {
-      DRCTEST = in;
-    }
-    void setEnableDRC(bool in) {
-      enableDRC = in;
-    }
-    void setRipupMode(int in) {
-      ripupMode = in;
-    }
-    void setCost(frUInt4 drcCostIn, frUInt4 markerCostIn) {
-      workerDRCCost = drcCostIn;
-      workerMarkerCost = markerCostIn;
-    }
-    //void addMarker(std::unique_ptr<frMarker> &in) {
-    //  auto rptr = in.get();
-    //  markers.push_back(std::move(in));
-    //  rptr->setIter(--(markers.end()));
-    //}
-    //void removeMarker(frMarker* in) {
-    //  markers.erase(in->getIter());
-    //}
-    void setMarkers(std::vector<frMarker> &in) {
-      markers.clear();
-      frBox box;
-      for (auto &marker: in) {
-        marker.getBBox(box);
-        if (getRouteBox().overlaps(box)) {
-          markers.push_back(marker);
-        }
-      }
-    }
-    void setBestMarkers() {
-      bestMarkers = markers;
-    }
-    void clearMarkers() {
-      markers.clear();
-    }
-    void setInitNumMarkers(int in) {
-      initNumMarkers = in;
-    }
-
-    // getters
-    frTechObject* getTech() const {
-      return design->getTech();
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    void getRouteBox(frBox &boxIn) const {
-      boxIn.set(routeBox);
-    }
-    const frBox& getRouteBox() const {
-      return routeBox;
-    }
-    frBox& getRouteBox() {
-      return routeBox;
-    }
-    void getExtBox(frBox &boxIn) const {
-      boxIn.set(extBox);
-    }
-    const frBox& getExtBox() const {
-      return extBox;
-    }
-    frBox& getExtBox() {
-      return extBox;
-    }
-    frRegionQuery* getRegionQuery() const {
-      return design->getRegionQuery();
-    }
-    bool isInitDR() const {
-      return (drIter == 0);
-    }
-    int getDRIter() const {
-      return drIter;
-    }
-    bool isEnableDRC() const {
-      return enableDRC;
-    }
-    int getRipupMode() const {
-      return ripupMode;
-    }
-    //const std::vector<std::unique_ptr<frMarker> >& getMarkers() const {
-    //  return markers;
-    //}
-    //std::vector<std::unique_ptr<frMarker> >& getMarkers() {
-    //  return markers;
-    //}
-    const std::vector<std::unique_ptr<drNet> >& getNets() const {
-      return nets;
-    }
-    std::vector<std::unique_ptr<drNet> >& getNets() {
-      return nets;
-    }
-    const std::vector<frMarker>& getMarkers() const {
-      return markers;
-    }
-    std::vector<frMarker>& getMarkers() {
-      return markers;
-    }
-    const std::vector<frMarker>& getBestMarkers() const {
-      return bestMarkers;
-    }
-    std::vector<frMarker>& getBestMarkers() {
-      return bestMarkers;
-    }
-    const FlexDRWorkerRegionQuery& getWorkerRegionQuery() const {
-      return rq;
-    }
-    FlexDRWorkerRegionQuery& getWorkerRegionQuery() {
-      return rq;
-    }
-    int getInitNumMarkers() const {
-      return initNumMarkers;
-    }
-    int getNumMarkers() const {
-      return markers.size();
-    }
-
-    // others
-    int main();
-    // others
-    int getNumQuickMarkers();
-    
-  protected:
-    frDesign* design;
-    frBox     routeBox;
-    frBox     extBox;
-    int       drIter;
-    int       mazeEndIter;
-    bool      TEST, DRCTEST;
-    bool      enableDRC;
-    int       ripupMode;
-    frUInt4   workerDRCCost, workerMarkerCost;
-    std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> boundaryPin;
-    int       pinCnt;
-    int       initNumMarkers;
-    std::map<FlexMazeIdx, drAccessPattern*> apSVia;
-    std::vector<frBlockObject*>             fixedObjs;
-    std::set<FlexMazeIdx>                   planarHistoryMarkers;
-    std::set<FlexMazeIdx>                   viaHistoryMarkers;
-    std::vector<FlexDRMinAreaVio>           minAreaVios;
-
-    // local storage
-    std::vector<std::unique_ptr<drNet> >    nets;
-    FlexGridGraph                           gridGraph;
-    //std::vector<std::unique_ptr<frMarker> > markers;
-    std::vector<frMarker>                   markers;
-    std::vector<frMarker>                   bestMarkers;
-    FlexDRWorkerRegionQuery                 rq;
-
-    // init
-    void init();
-    void initNets();
-    void initNetObjs(std::set<frNet*, frBlockObjectComp> &nets, 
-                     std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                     std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNetObjs_pathSeg(frPathSeg* pathSeg,
-                             std::set<frNet*, frBlockObjectComp> &nets, 
-                             std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                             std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNetObjs_via(frVia* via,
-                         std::set<frNet*, frBlockObjectComp> &nets, 
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNetObjs_patchWire(frPatchWire* pwire,
-                               std::set<frNet*, frBlockObjectComp> &nets, 
-                               std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                               std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNets_initDR(std::set<frNet*, frBlockObjectComp> &nets, 
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNets_searchRepair(std::set<frNet*, frBlockObjectComp> &nets, 
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                         std::map<frNet*, std::vector<std::unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs);
-    void initNets_searchRepair_pin2epMap(frNet* net, 
-                                         std::vector<std::unique_ptr<drConnFig> > &netRouteObjs,
-                                         /*std::vector<std::unique_ptr<drConnFig> > &netExtObjs,
-                                         std::vector<frBlockObject*> &netPins,*/
-                                         std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap/*,
-                                         std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap*/);
-
-    void initNets_searchRepair_pin2epMap_helper(frNet* net, const frPoint &bp, frLayerNum lNum, 
-                                                std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap);
-    void initNets_searchRepair_nodeMap(frNet* net, 
-                                       std::vector<std::unique_ptr<drConnFig> > &netRouteObjs,
-                                       std::vector<frBlockObject*> &netPins,
-                                       std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                       std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-
-    void initNets_searchRepair_nodeMap_routeObjEnd(frNet* net, std::vector<std::unique_ptr<drConnFig> > &netRouteObjs,
-                                                   std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void initNets_searchRepair_nodeMap_routeObjSplit(frNet* net, std::vector<std::unique_ptr<drConnFig> > &netRouteObjs,
-                                                     std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void initNets_searchRepair_nodeMap_routeObjSplit_helper(const frPoint &crossPt, 
-                   frCoord trackCoord, frCoord splitCoord, frLayerNum lNum, 
-                   std::vector<std::map<frCoord, std::map<frCoord, std::pair<frCoord, int> > > > &mergeHelper,
-                   std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void initNets_searchRepair_nodeMap_pin(frNet* net, 
-                                           std::vector<std::unique_ptr<drConnFig> > &netRouteObjs,
-                                           std::vector<frBlockObject*> &netPins,
-                                           std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                           std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap);
-    void initNets_searchRepair_connComp(frNet* net, 
-                                        std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap,
-                                        std::vector<int> &compIdx);
-
-
-
-    void initNet(frNet* net, 
-                 std::vector<std::unique_ptr<drConnFig> > &routeObjs,
-                 std::vector<std::unique_ptr<drConnFig> > &extObjs,
-                 std::vector<frBlockObject*> &terms);
-    void initNet_term(drNet* dNet, std::vector<frBlockObject*> &terms);
-    void initNet_termGenAp(drPin* dPin);
-    void getTrackLocs(bool isHorzTracks, frLayerNum currLayerNum, frCoord low, frCoord high, std::set<frCoord> &trackLocs);
-    void initNet_boundary(drNet* net, std::vector<std::unique_ptr<drConnFig> > &extObjs);
-    void initNets_regionQuery();
-    void initNets_numPinsIn();
-
-    void initGridGraph();
-    void initTrackCoords(std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xMap,
-                         std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yMap);
-    void initTrackCoords_route(drNet* net, 
-                               std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xMap,
-                               std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yMap);
-    void initTrackCoords_pin(drNet* net, 
-                             std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xMap,
-                             std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yMap);
-    void initMazeIdx();
-    void initMazeIdx_connFig(drConnFig *connFig);
-    void initMazeIdx_ap(drAccessPattern *ap);
-    void initMazeCost();
-    void initMazeCost_connFig();
-    void initMazeCost_pin();
-    void initMazeCost_pin_helper(const frBox &box, frCoord bloatDist, frMIdx zIdx);
-    void initMazeCost_ap(); // disable maze edge
-    void initMazeCost_marker();
-    //void initMazeCost_via();
-    void initMazeCost_via_helper(drNet* net, bool isAddPathCost);
-    void initMazeCost_ap_helper(drNet* net, bool isAddPathCost);
-    void initMazeCost_boundary_helper(drNet* net, bool isAddPathCost);
-    void addToCostGrids(const Rectangle &region, std::set<std::pair<frMIdx, frMIdx> > &costGrids);
-
-    // DRC
-    void initFixedObjs();
-    void initMarkers();
-
-    // route
-    void route();
-    void addPathCost(drConnFig *connFig);
-    void subPathCost(drConnFig *connFig);
-    /*inline*/ void modPathCost(drConnFig *connFig, bool isAddPathCost);
-    // minSpc
-    /*inline*/ void modMinSpacingCost(drNet* net, const frBox &box, frMIdx z, bool isAddPathCost, bool isCurrPs);
-    /*inline*/ void modMinSpacingCostPlaner(drNet* net, const frBox &box, frMIdx z, bool isAddPathCost);
-    /*inline*/ void modMinSpacingCostVia(const frBox &box, frMIdx z, bool isAddPathCost, bool isUpperVia, bool isCurrPs);
-    inline frCoord pt2boxDistSquare(const frPoint &pt, const frBox &box);
-    inline frCoord box2boxDistSquare(const frBox &box1, const frBox &box2, frCoord &dx, frCoord &dy);
-    /*inline*/ void modMinSpacingCostVia_eol(const frBox &box, const frBox &tmpBx, bool isAddPathCost, bool isUpperVia, frMIdx i, frMIdx j, frMIdx z);
-    /*inline*/ void modMinSpacingCostVia_eol_helper(const frBox &box, const frBox &testBox, bool isAddPathCost, bool isUpperVia, frMIdx i, frMIdx j, frMIdx z);
-    // eolSpc
-    /*inline*/ void modEolSpacingCost_helper(const frBox &testbox, frMIdx z, bool isAddPathCost, int type);
-    /*inline*/ void modEolSpacingCost(const frBox &box, frMIdx z, bool isAddPathCost);
-    // cutSpc
-    /*inline*/ void modCutSpacingCost(const frBox &box, frMIdx z, bool isAddPathCost);
-
-    void mazeIterInit(std::vector<drNet*> &rerouteNets);
-    void mazeIterInit_initDR(std::vector<drNet*> &rerouteNets);
-    void mazeIterInit_sortRerouteNets(std::vector<drNet*> &rerouteNets);
-    void mazeIterInit_searchRepair(std::vector<drNet*> &rerouteNets);
-
-    void mazeNetInit(drNet* net);
-    void mazeNetEnd(drNet* net);
-    bool routeNet(drNet* net);
-    void routeNet_prep(drNet* net, std::set<drPin*, frBlockObjectComp> &pins, 
-                       std::map<FlexMazeIdx, std::set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins);
-    void routeNet_setSrc(std::set<drPin*, frBlockObjectComp> &unConnPins, 
-                         std::map<FlexMazeIdx, std::set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins,
-                         std::vector<FlexMazeIdx> &connComps, FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2);
-    void mazePinInit();
-    drPin* routeNet_getNextDst(FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2, 
-                               std::map<FlexMazeIdx, std::set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins);
-    void        routeNet_postAstarUpdate(std::vector<FlexMazeIdx> &path, std::vector<FlexMazeIdx> &connComps,
-                                         std::set<drPin*, frBlockObjectComp> &unConnPins, 
-                                         std::map<FlexMazeIdx, std::set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins,
-                                         bool isFirstConn);
-    void        routeNet_postAstarWritePath(drNet* net, std::vector<FlexMazeIdx> &points);
-    void        routeNet_postAstarPatchMinAreaVio(drNet* net, const std::vector<FlexMazeIdx> &path);
-    void        routeNet_postAstarAddPatchMetal(drNet* net, const FlexMazeIdx bpIdx, const FlexMazeIdx epIdx, const frCoord gapArea, const frCoord patchWidth);
-    void        routeNet_postRouteAddPathCost(drNet* net);
-    void        routeNet_postRouteAddPatchMetalCost(drNet* net);
-
-    // drc
-    void route_drc();
-    void route_postRouteViaSwap();
-
-    // end
-    void end();
-    void endGetModNets(std::set<frNet*, frBlockObjectComp> &modNets);
-    void endRemoveNets(std::set<frNet*, frBlockObjectComp> &modNets, 
-                       std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &boundPts);
-    void endRemoveNets_pathSeg(frPathSeg* pathSeg, std::set<std::pair<frPoint, frLayerNum> > &boundPts);
-    //void endRemoveNets(std::set<frNet*> &modNets);
-    //void endRemoveNets_pathSeg(frPathSeg* pathSeg);
-    void endRemoveNets_via(frVia* via);
-    void endRemoveNets_patchWire(frPatchWire* pwire);
-    void endAddNets(std::map<frNet*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &boundPts);
-    void endAddNets_pathSeg(drPathSeg* pathSeg);
-    //void endAddNets();
-    //void endAddNets_pathSeg(drPathSeg* pathSeg);
-    void endAddNets_via(drVia* via);
-    void endAddNets_patchWire(drPatchWire* pwire);
-    void endAddNets_merge(frNet* net, std::set<std::pair<frPoint, frLayerNum> > &boundPts);
-
-    void endRemoveMarkers();
-    void endAddMarkers();
-
-  };
-
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_conn.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_conn.cpp
deleted file mode 100644
index 55f2cb3..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_conn.cpp
+++ /dev/null
@@ -1,625 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexDR.h"
-#include "io/io.h"
-
-using namespace std;
-using namespace fr;
-
-// copied from FlexDRWorker::initNets_searchRepair_pin2epMap_helper
-void FlexDR::checkConnectivity_pin2epMap_helper(frNet *net, const frPoint &bp, frLayerNum lNum, 
-                                                map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  auto regionQuery = getRegionQuery();
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  //result.clear();
-  regionQuery->query(frBox(bp, bp), lNum, result);
-  for (auto &[bx, rqObj]: result) {
-    if (rqObj->typeId() == frcInstTerm) {
-      auto instTerm = static_cast<frInstTerm*>(rqObj);
-      if (instTerm->getNet() == net) {
-        if (enableOutput) {
-          cout <<"    found " <<instTerm->getInst()->getName() <<"/" <<instTerm->getTerm()->getName() <<endl;
-        }
-        pin2epMap[rqObj].insert(make_pair(bp, lNum));
-      } else {
-        //if (enableOutput) {
-        //  cout <<"    found other instTerm" <<endl;
-        //}
-      }
-    } else if (rqObj->typeId() == frcTerm) {
-      auto term = static_cast<frTerm*>(rqObj);
-      if (term->getNet() == net) {
-        if (enableOutput) {
-          cout <<"    found PIN/" <<term->getName() <<endl;
-        }
-        pin2epMap[rqObj].insert(make_pair(bp, lNum));
-      } else {
-        //if (enableOutput) {
-        //  cout <<"    found other term" <<endl;
-        //}
-      }
-    }
-  }
-}
-
-void FlexDR::checkConnectivity_pin2epMap(frNet* net, vector<frConnFig*> &netDRObjs,
-                                         map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  frPoint bp, ep;
-  for (auto &connFig: netDRObjs) {
-    if (connFig->typeId() == frcPathSeg) {
-      auto obj = static_cast<frPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      if (enableOutput) {
-       cout <<"(bp, ep) (" <<bp.x() / 2000.0 <<" ," <<bp.y() / 2000.0 <<") ("
-                           <<ep.x() / 2000.0 <<" ," <<ep.y() / 2000.0 <<") " 
-            <<getTech()->getLayer(lNum)->getName() <<endl;
-      }
-      if (enableOutput) {
-        cout <<"  query bp" <<endl;
-      }
-      checkConnectivity_pin2epMap_helper(net, bp, lNum, pin2epMap);
-      if (enableOutput) {
-        cout <<"  query ep" <<endl;
-      }
-      checkConnectivity_pin2epMap_helper(net, ep, lNum, pin2epMap);
-    } else if (connFig->typeId() == frcVia) {
-      auto obj = static_cast<frVia*>(connFig);
-      obj->getOrigin(bp);
-      auto l1Num = obj->getViaDef()->getLayer1Num();
-      auto l2Num = obj->getViaDef()->getLayer2Num();
-      if (enableOutput) {
-        cout <<"pt (" <<bp.x() / 2000.0 <<" ," <<bp.y() / 2000.0 <<") "
-             <<obj->getViaDef()->getName() <<endl;
-      }
-      if (enableOutput) {
-        cout <<"  query pt l1" <<endl;
-      }
-      checkConnectivity_pin2epMap_helper(net, bp, l1Num, pin2epMap);
-      if (enableOutput) {
-        cout <<"  query pt l2" <<endl;
-      }
-      checkConnectivity_pin2epMap_helper(net, bp, l2Num, pin2epMap);
-    } else {
-      cout <<"Error: checkConnectivity_pin2epMap unsupported type" <<endl;
-    }
-  }
-
-}
-
-void FlexDR::checkConnectivity_initDRObjs(frNet* net, vector<frConnFig*> &netDRObjs) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  for (auto &uPtr: net->getShapes()) {
-    auto connFig = uPtr.get();
-    if (connFig->typeId() == frcPathSeg) {
-      netDRObjs.push_back(connFig);
-      if (enableOutput) {
-        auto obj = static_cast<frPathSeg*>(connFig);
-        frPoint bp, ep;
-        auto lNum = obj->getLayerNum();
-        obj->getPoints(bp, ep);
-        cout <<" (" <<bp.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                    <<bp.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") ("
-                    <<ep.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                    <<ep.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") "
-             <<getTech()->getLayer(lNum)->getName() <<endl;
-      }
-    } else {
-      cout <<"Error: checkConnectivity_initDRObjs unsupported type" <<endl;
-    }
-  }
-  for (auto &uPtr: net->getVias()) {
-    auto connFig = uPtr.get();
-    if (connFig->typeId() == frcVia) {
-      netDRObjs.push_back(connFig);
-      if (enableOutput) {
-        auto obj = static_cast<frVia*>(connFig);
-        frPoint bp;
-        obj->getOrigin(bp);
-        cout <<" (" <<bp.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                    <<bp.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") "
-             <<obj->getViaDef()->getName() <<endl;
-      }
-    } else {
-      cout <<"Error: checkConnectivity_initDRObjs unsupported type" <<endl;
-    }
-  }
-}
-
-void FlexDR::checkConnectivity_nodeMap_routeObjEnd(frNet* net, vector<frConnFig*> &netRouteObjs,
-                                                   map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  bool enableOutput = false;
-  frPoint bp, ep;
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto &connFig = netRouteObjs[i];
-    if (connFig->typeId() == frcPathSeg) {
-      auto obj = static_cast<frPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      nodeMap[make_pair(bp, lNum)].insert(i);
-      nodeMap[make_pair(ep, lNum)].insert(i);
-      if (enableOutput) {
-        cout <<"node idx = " <<i <<", (" <<bp.x() / 2000.0 <<", " <<bp.y() / 2000.0 <<") (" 
-                                         <<ep.x() / 2000.0 <<", " <<ep.y() / 2000.0 <<") " 
-             <<getTech()->getLayer(lNum)->getName() <<endl;
-      }
-    } else if (connFig->typeId() == frcVia) {
-      auto obj = static_cast<frVia*>(connFig);
-      obj->getOrigin(bp);
-      auto l1Num = obj->getViaDef()->getLayer1Num();
-      auto l2Num = obj->getViaDef()->getLayer2Num();
-      nodeMap[make_pair(bp, l1Num)].insert(i);
-      nodeMap[make_pair(bp, l2Num)].insert(i);
-      if (enableOutput) {
-        cout <<"node idx = " <<i <<", (" <<bp.x() / 2000.0 <<", " <<bp.y() / 2000.0 <<") "
-             <<getTech()->getLayer(l1Num)->getName() <<" --> " <<getTech()->getLayer(l2Num)->getName() <<endl;
-      }
-    } else {
-      cout <<"Error: checkConnectivity_nodeMap_routeObjEnd unsupported type" <<endl;
-    }
-  }
-}
-
-void FlexDR::checkConnectivity_nodeMap_routeObjSplit_helper(const frPoint &crossPt, 
-             frCoord trackCoord, frCoord splitCoord, frLayerNum lNum, 
-             vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > &mergeHelper,
-             map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  auto it1 = mergeHelper[lNum].find(trackCoord);
-  if (it1 != mergeHelper[lNum].end()) {
-    auto &mp = it1->second; // map<ep, pair<bp, objIdx> >
-    auto it2 = mp.lower_bound(splitCoord);
-    if (it2 != mp.end()) {
-      auto &endP = it2->first;
-      auto &[beginP, objIdx] = it2->second;
-      if (endP > splitCoord && beginP < splitCoord) {
-        nodeMap[make_pair(crossPt, lNum)].insert(objIdx);
-      }
-    }
-  }
-}
-
-void FlexDR::checkConnectivity_nodeMap_routeObjSplit(frNet* net, vector<frConnFig*> &netRouteObjs,
-                                                     map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  frPoint bp, ep;
-  // vector<map<track, map<ep, pair<bp, objIdx> > > > interval_map
-  vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > horzMergeHelper(getTech()->getLayers().size());
-  vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > vertMergeHelper(getTech()->getLayers().size());
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto &connFig = netRouteObjs[i];
-    if (connFig->typeId() == frcPathSeg) {
-      auto obj = static_cast<frPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      // vert seg
-      if (bp.x() == ep.x()) {
-        vertMergeHelper[lNum][bp.x()][ep.y()] = make_pair(bp.y(), i);
-      // horz seg
-      } else {
-        horzMergeHelper[lNum][bp.y()][ep.x()] = make_pair(bp.x(), i);
-      }
-    }
-  }
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto &connFig = netRouteObjs[i];
-    // ep on pathseg
-    if (connFig->typeId() == frcPathSeg) {
-      auto obj = static_cast<frPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      // vert seg, find horz crossing seg
-      if (bp.x() == ep.x()) {
-        //find whether there is horz track at bp
-        auto crossPt    = bp;
-        auto trackCoord = bp.y();
-        auto splitCoord = bp.x();
-        checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-        //find whether there is horz track at ep
-        crossPt    = ep;
-        trackCoord = ep.y();
-        splitCoord = ep.x();
-        checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      // horz seg
-      } else {
-        //find whether there is vert track at bp
-        auto crossPt    = bp;
-        auto trackCoord = bp.x();
-        auto splitCoord = bp.y();
-        checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-        //find whether there is vert track at ep
-        crossPt    = ep;
-        trackCoord = ep.x();
-        splitCoord = ep.y();
-        checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-      }
-    } else if (connFig->typeId() == frcVia) {
-      auto obj = static_cast<frVia*>(connFig);
-      obj->getOrigin(bp);
-      auto lNum = obj->getViaDef()->getLayer1Num();
-      //find whether there is horz track at bp on layer1
-      auto crossPt    = bp;
-      auto trackCoord = bp.y();
-      auto splitCoord = bp.x();
-      checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      //find whether there is vert track at bp on layer1
-      crossPt    = bp;
-      trackCoord = bp.x();
-      splitCoord = bp.y();
-      checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-      
-      lNum = obj->getViaDef()->getLayer2Num();
-      //find whether there is horz track at bp on layer2
-      crossPt    = bp;
-      trackCoord = bp.y();
-      splitCoord = bp.x();
-      checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      //find whether there is vert track at bp on layer2
-      crossPt    = bp;
-      trackCoord = bp.x();
-      splitCoord = bp.y();
-      checkConnectivity_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-    }
-  }
-}
-
-void FlexDR::checkConnectivity_nodeMap_pin(frNet* net, 
-                                           vector<frConnFig*> &netRouteObjs,
-                                           vector<frBlockObject*> &netPins,
-                                           map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                           map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  bool enableOutput = false;
-  int currCnt = (int)netRouteObjs.size();
-  for (auto &[obj, locS]: pin2epMap) {
-    netPins.push_back(obj);
-    for (auto &pr: locS) {
-      nodeMap[pr].insert(currCnt);
-      if (enableOutput) {
-        cout <<"pin idx = " <<currCnt <<", (" <<pr.first.x() <<", " <<pr.first.y() <<") " 
-             <<getTech()->getLayer(pr.second)->getName() <<endl;
-      }
-    }
-    ++currCnt;
-  }
-}
-
-void FlexDR::checkConnectivity_nodeMap(frNet* net, 
-                                       vector<frConnFig*> &netRouteObjs,
-                                       vector<frBlockObject*> &netPins,
-                                       map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2epMap,
-                                       map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  checkConnectivity_nodeMap_routeObjEnd(net, netRouteObjs, nodeMap);
-  checkConnectivity_nodeMap_routeObjSplit(net, netRouteObjs, nodeMap);
-  checkConnectivity_nodeMap_pin(net, netRouteObjs, netPins, pin2epMap, nodeMap);
-  if (enableOutput) {
-    int idx = 0;
-    for (auto connFig: netRouteObjs) {
-      if (connFig->typeId() == frcPathSeg) {
-        auto obj = static_cast<frPathSeg*>(connFig);
-        frPoint bp, ep;
-        auto lNum = obj->getLayerNum();
-        obj->getPoints(bp, ep);
-        cout <<"#" <<idx <<" (" 
-             <<bp.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-             <<bp.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") ("
-             <<ep.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-             <<ep.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") "
-             <<getTech()->getLayer(lNum)->getName() <<endl;
-      } else if (connFig->typeId() == frcVia) {
-        auto obj = static_cast<frVia*>(connFig);
-        frPoint bp;
-        obj->getOrigin(bp);
-        cout <<"#" <<idx <<" (" 
-             <<bp.x() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<", "
-             <<bp.y() * 1.0/ getDesign()->getTopBlock()->getDBUPerUU() <<") "
-             <<obj->getViaDef()->getName() <<endl;
-      } else {
-        cout <<"Error: checkConnectivity_nodeMap unsupported type" <<endl;
-      }
-      idx++;
-    }
-    for (auto obj: netPins) {
-      if (obj->typeId() == frcInstTerm) {
-        auto instTerm = static_cast<frInstTerm*>(obj);
-        cout <<"#" <<idx <<" " <<instTerm->getInst()->getName() <<"/" <<instTerm->getTerm()->getName() <<endl;
-      } else if (obj->typeId() == frcTerm) {
-        auto term = static_cast<frTerm*>(obj);
-        cout <<"#" <<idx <<" PIN/" <<term->getName() <<endl;
-      }
-      idx++;
-    }
-  }
-}
-
-bool FlexDR::checkConnectivity_astar(frNet* net, vector<bool> &adjVisited, vector<int> &adjPrevIdx, 
-                                     map<pair<frPoint, frLayerNum>, set<int> > &nodeMap, int &gCnt, int &nCnt) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  // a star search
-
-  // node index, node visited
-  vector<vector<int> > adjVec(nCnt, vector<int>());
-  vector<bool> onPathIdx(nCnt, false);
-  adjVisited.clear();
-  adjPrevIdx.clear();
-  adjVisited.resize(nCnt, false);
-  adjPrevIdx.resize(nCnt, -1);
-  for (auto &[pr, idxS]: nodeMap) {
-    //auto &[pt, lNum] = pr;
-    for (auto it1 = idxS.begin(); it1 != idxS.end(); it1++) {
-      auto it2 = it1;
-      it2++;
-      auto idx1 = *it1;
-      for (; it2 != idxS.end(); it2++) {
-        auto idx2 = *it2;
-        adjVec[idx1].push_back(idx2);
-        adjVec[idx2].push_back(idx1);
-        //cout <<"add edge #" <<idx1 <<" -- #" <<idx2 <<endl;
-        // one pin, one gcell
-      }
-    }
-  }
-
-  struct wf {
-    int nodeIdx;
-    int prevIdx;
-    int cost;
-    bool operator<(const wf &b) const {
-      if (cost == b.cost) {
-        return nodeIdx > b.nodeIdx;
-      } else {
-        return cost > b.cost;
-      }
-    }
-  };
-  for (int findNode = gCnt; findNode < nCnt - 1; findNode++) {
-    //adjVisited = onPathIdx;
-    //cout <<"finished " <<findNode <<" nodes" <<endl;
-    priority_queue<wf> pq;
-    if (enableOutput) {
-      //cout <<"visit";
-    }
-    if (findNode == gCnt) {
-      // push only first pin into pq
-      pq.push({gCnt, -1, 0});
-    } else {
-      // push every visited node into pq
-      for (int i = 0; i < nCnt; i++) {
-        //if (adjVisited[i]) {
-        if (onPathIdx[i]) {
-          // penalize feedthrough in normal mode
-          if (i >= gCnt) {
-            pq.push({i, adjPrevIdx[i], 0});
-          } else {
-            pq.push({i, adjPrevIdx[i], 0});
-          }
-        }
-      }
-    }
-    int lastNodeIdx = -1;
-    while (!pq.empty()) {
-      auto wfront = pq.top();
-      pq.pop();
-      if (!onPathIdx[wfront.nodeIdx] && adjVisited[wfront.nodeIdx]) {
-        continue;
-      }
-      if (wfront.nodeIdx > gCnt && wfront.nodeIdx < nCnt && adjVisited[wfront.nodeIdx] == false) {
-        adjVisited[wfront.nodeIdx] = true;
-        adjPrevIdx[wfront.nodeIdx] = wfront.prevIdx;
-        if (enableOutput) {
-          //cout <<" " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<" exit" <<endl;
-          cout <<"visit " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<" exit" <<endl;
-        }
-        lastNodeIdx = wfront.nodeIdx;
-        break;
-      }
-      adjVisited[wfront.nodeIdx] = true;
-      adjPrevIdx[wfront.nodeIdx] = wfront.prevIdx;
-      if (enableOutput) {
-        //cout <<" " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")";
-        cout <<"visit " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<endl;
-      }
-      // visit other nodes
-      for (auto nbrIdx: adjVec[wfront.nodeIdx]) {
-        if (!adjVisited[nbrIdx]) {
-          pq.push({nbrIdx, wfront.nodeIdx, wfront.cost + 1});
-          if (enableOutput) {
-            cout <<"push " <<nbrIdx <<endl;
-          }
-        }
-      }
-    }
-    // trace back path
-    if (enableOutput) {
-      cout <<"trace back id";
-    }
-    while ((lastNodeIdx != -1) && (!onPathIdx[lastNodeIdx])) {
-      onPathIdx[lastNodeIdx] = true;
-      if (enableOutput) {
-        cout <<" " <<lastNodeIdx <<" (" <<adjPrevIdx[lastNodeIdx] <<")";
-      }
-      lastNodeIdx = adjPrevIdx[lastNodeIdx];
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-    adjVisited = onPathIdx;
-  }
-  if (enableOutput) {
-  cout <<"stat: " <<net->getName() <<" #guide/#pin/#unused = " <<gCnt <<"/" <<nCnt - gCnt <<"/" 
-       <<nCnt - count(adjVisited.begin(), adjVisited.end(), true) <<endl;
-  }
-  int pinVisited = count(adjVisited.begin() + gCnt, adjVisited.end(), true);
-  // true error when allowing feedthrough
-  if (pinVisited != nCnt - gCnt) {
-    cout <<"Error: " <<net->getName() <<" " <<nCnt - gCnt - pinVisited <<" pin not visited #guides = " <<gCnt <<endl;
-    if (enableOutput) {
-      for (int i = gCnt; i < nCnt; i++) {
-        if (!adjVisited[i]) {
-          cout <<"  pin id = " <<i <<endl;
-        }
-      }
-    }
-  }
-  if (pinVisited == nCnt - gCnt) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-void FlexDR::checkConnectivity_final(frNet *net, vector<frConnFig*> &netRouteObjs, vector<frBlockObject*> &netPins,
-                                     vector<bool> &adjVisited, int gCnt, int nCnt,
-                                     map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  
-  auto regionQuery = getRegionQuery();
-
-  // from obj to pt
-  map<int, set<pair<frPoint, frLayerNum> > > reverseNodeMap;
-  for (auto &[pr, idxS]: nodeMap) {
-    for (auto &idx: idxS) {
-      reverseNodeMap[idx].insert(pr);
-    }
-  }
-
-  // nodeMap delete redundant objs
-  for (int i = 0; i < (int)adjVisited.size(); i++) {
-    if (adjVisited[i]) {
-      continue;
-    }
-    for (auto &pr: reverseNodeMap[i]) {
-      nodeMap[pr].erase(i);
-    }
-    if (i < gCnt) {
-      if (netRouteObjs[i]->typeId() == frcPathSeg) {
-        regionQuery->removeDRObj(static_cast<frShape*>(netRouteObjs[i]));
-        net->removeShape(static_cast<frShape*>(netRouteObjs[i]));
-        if (enableOutput) {
-          cout <<"net " <<net->getName() <<" deleting pathseg" <<endl;
-        }
-      } else if (netRouteObjs[i]->typeId() == frcVia) {
-        regionQuery->removeDRObj(static_cast<frVia*>(netRouteObjs[i]));
-        net->removeVia(static_cast<frVia*>(netRouteObjs[i]));
-        if (enableOutput) {
-          cout <<"net " <<net->getName() <<" deleting via" <<endl;
-        }
-      } else {
-        cout <<"Error: checkConnectivity_final unsupporterd type" <<endl;
-        exit(1);
-      }
-      netRouteObjs[i] = nullptr;
-    } else {
-      cout <<"Error: checkConnectivity_final i >= gCnt" <<endl;
-      exit(1);
-    }
-  }
-  
-  // rebuild reverseNodeMap
-  reverseNodeMap.clear();
-  for (auto &[pr, idxS]: nodeMap) {
-    if (idxS.size() == 1) {
-      continue;
-    }
-    for (auto &idx: idxS) {
-      reverseNodeMap[idx].insert(pr);
-    }
-  }
-
-  for (auto &[idx, ptS]: reverseNodeMap) {
-    if (idx < gCnt && netRouteObjs[idx]->typeId() == frcPathSeg) {
-      auto ps = static_cast<frPathSeg*>(netRouteObjs[idx]);
-      frPoint bp, ep;
-      ps->getPoints(bp, ep);
-      auto [minPr, maxPr] = minmax_element(ptS.begin(), ptS.end());
-      auto &minPt = minPr->first;
-      auto &maxPt = maxPr->first;
-      // shrink segment
-      if (bp < minPt || maxPt < ep) {
-        regionQuery->removeDRObj(ps);
-        ps->setPoints(minPt, maxPt);
-        regionQuery->addDRObj(ps);
-        if (enableOutput) {
-          cout <<"net " <<net->getName() <<" shrinking pathseg" <<endl;
-        }
-      }
-    }
-  }
-}
-
-
-
-
-// feedthrough and loop check
-void FlexDR::checkConnectivity() {
-  //cout <<"checking connectivity " <<endl;
-
-  bool isWrong = false;
-  for (auto &uPtr: getDesign()->getTopBlock()->getNets()) {
-    auto net = uPtr.get();
-    //if (net->getName() != "net3097") {
-    //  continue;
-    //}
-    vector<frConnFig*> netDRObjs;
-    checkConnectivity_initDRObjs(net, netDRObjs);
-    
-    map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> pin2epMap;
-    checkConnectivity_pin2epMap(net, netDRObjs, pin2epMap);
-
-    vector<frBlockObject*> netPins;
-    map<pair<frPoint, frLayerNum>, set<int> > nodeMap;
-    checkConnectivity_nodeMap(net, netDRObjs, netPins, pin2epMap, nodeMap);
-
-    int gCnt = (int)netDRObjs.size();
-    int nCnt = (int)netDRObjs.size() + (int)netPins.size();
-    vector<bool> adjVisited;
-    vector<int>  adjPrevIdx;
-    if (!checkConnectivity_astar(net, adjVisited, adjPrevIdx, nodeMap, gCnt, nCnt)) {
-      cout <<"Error: checkConnectivity break, net " <<net->getName() <<endl;
-      isWrong = true;
-    } else {
-      // get lock
-      // delete / shrink netRouteObjs, 
-      checkConnectivity_final(net, netDRObjs, netPins, adjVisited, gCnt, nCnt, nodeMap);
-      // release lock
-    }
-  }
-  if (isWrong) {
-    io::Writer writer(getDesign());
-    writer.writeFromDR("_conn");
-    exit(1);
-  }
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_end.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_end.cpp
deleted file mode 100644
index 4bb226d..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_end.cpp
+++ /dev/null
@@ -1,570 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexDR.h"
-
-using namespace std;
-using namespace fr;
-
-void FlexDRWorker::endGetModNets(set<frNet*, frBlockObjectComp> &modNets) {
-  for (auto &net: nets) {
-    if (net->isModified()) {
-      modNets.insert(net->getFrNet());
-    }
-  }
-  // change modified flag to true if another subnet get routed
-  for (auto &net: nets) {
-    if (!net->isModified() && modNets.find(net->getFrNet()) != modNets.end()) {
-      net->setModified(true);
-    }
-  }
-}
-
-void FlexDRWorker::endRemoveNets_pathSeg(frPathSeg* pathSeg, 
-                                         set<pair<frPoint, frLayerNum> > &boundPts) {
-  bool enableOutput = false;
-  frPoint begin, end;
-  pathSeg->getPoints(begin, end);
-  auto routeBox = getRouteBox();
-  auto net = pathSeg->getNet();
-  auto regionQuery = getRegionQuery();
-  // vertical seg
-  if (begin.x() == end.x()) {
-    // if cross routeBBox
-    bool condition1 = isInitDR() ? (begin.x() < routeBox.right()) : (begin.x() <= routeBox.right());
-    if (routeBox.left() <= begin.x() && condition1 &&
-        //!(begin.y() >= routeBox.top() || end.y() <= routeBox.bottom())) {
-        !(begin.y() > routeBox.top() || end.y() < routeBox.bottom())) {
-      // bottom seg to ext
-      if (begin.y() < routeBox.bottom()) {
-        auto uPathSeg = make_unique<frPathSeg>(*pathSeg);
-        frPoint boundPt(end.x(), min(end.y(), routeBox.bottom()));
-        uPathSeg->setPoints(begin, boundPt);
-        unique_ptr<frShape> uShape(std::move(uPathSeg));
-        auto sptr = uShape.get();
-        net->addShape(uShape);
-        regionQuery->addDRObj(sptr);
-        // add cutSegs
-        auto lNum = sptr->getLayerNum();
-        //cutSegs[make_pair(boundPt, lNum)].insert(sptr);
-        boundPts.insert(make_pair(boundPt, lNum));
-        if (enableOutput) {
-          cout <<"trim pathseg to ext bottom" <<endl;
-        }
-      }
-      // top seg to ext
-      if (end.y() > routeBox.top()) {
-        auto uPathSeg = make_unique<frPathSeg>(*pathSeg);
-        frPoint boundPt(begin.x(), max(begin.y(), routeBox.top()));
-        uPathSeg->setPoints(boundPt, end);
-        unique_ptr<frShape> uShape(std::move(uPathSeg));
-        auto sptr = uShape.get();
-        net->addShape(uShape);
-        regionQuery->addDRObj(sptr);
-        // add cutSegs
-        auto lNum = sptr->getLayerNum();
-        //cutSegs[make_pair(boundPt, lNum)].insert(sptr);
-        boundPts.insert(make_pair(boundPt, lNum));
-        if (enableOutput) {
-          cout <<"trim pathseg to ext top" <<endl;
-        }
-      }
-      //std::cout << "  removingPathSeg " << &(*pathSeg) << " (" << begin.x() << ", " << begin.y() 
-      //          << ") -- (" << end.x() << ", " << end.y() << ") " << drNet->getName() <<  "\n" << std::flush;
-      regionQuery->removeDRObj(pathSeg); // delete rq
-      net->removeShape(pathSeg); // delete segment
-    }
-  // horizontal seg
-  } else if (begin.y() == end.y()) {
-    // if cross routeBBox
-    bool condition1 = isInitDR() ? (begin.y() < routeBox.top()) : (begin.y() <= routeBox.top());
-    if (routeBox.bottom() <= begin.y() && condition1 &&
-        //!(begin.x() >= routeBox.right() || end.x() <= routeBox.left())) {
-        !(begin.x() > routeBox.right() || end.x() < routeBox.left())) {
-      // left seg to ext
-      if (begin.x() < routeBox.left()) {
-        auto uPathSeg = make_unique<frPathSeg>(*pathSeg);
-        frPoint boundPt(min(end.x(), routeBox.left()), end.y());
-        uPathSeg->setPoints(begin, boundPt);
-        unique_ptr<frShape> uShape(std::move(uPathSeg));
-        auto sptr = uShape.get();
-        net->addShape(uShape);
-        regionQuery->addDRObj(sptr);
-        // add cutSegs
-        auto lNum = sptr->getLayerNum();
-        //cutSegs[make_pair(boundPt, lNum)].insert(sptr);
-        boundPts.insert(make_pair(boundPt, lNum));
-        if (enableOutput) {
-          cout <<"trim pathseg to ext left" <<endl;
-        }
-      }
-      // right seg to ext
-      if (end.x() > routeBox.right()) {
-        auto uPathSeg = make_unique<frPathSeg>(*pathSeg);
-        frPoint boundPt(max(begin.x(), routeBox.right()), begin.y());
-        uPathSeg->setPoints(boundPt, end);
-        unique_ptr<frShape> uShape(std::move(uPathSeg));
-        auto sptr = uShape.get();
-        net->addShape(uShape);
-        regionQuery->addDRObj(sptr);
-        // add cutSegs
-        auto lNum = sptr->getLayerNum();
-        //cutSegs[make_pair(boundPt, lNum)].insert(sptr);
-        boundPts.insert(make_pair(boundPt, lNum));
-        if (enableOutput) {
-          cout <<"trim pathseg to ext right" <<endl;
-        }
-      }
-      regionQuery->removeDRObj(pathSeg); // delete rq
-      net->removeShape(pathSeg); // delete segment
-    }
-  }
-}
-
-void FlexDRWorker::endRemoveNets_via(frVia* via) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto gridBBox = getRouteBox();
-  auto regionQuery = getRegionQuery();
-  auto net = via->getNet();
-  frPoint viaPoint;
-  via->getOrigin(viaPoint);
-  bool condition1 = isInitDR() ? 
-                    (viaPoint.x() <  gridBBox.right() && viaPoint.y() <  gridBBox.top()) : 
-                    (viaPoint.x() <= gridBBox.right() && viaPoint.y() <= gridBBox.top());
-  if (viaPoint.x() >= gridBBox.left() && viaPoint.y() >= gridBBox.bottom() && condition1) {
-    regionQuery->removeDRObj(via); // delete rq
-    net->removeVia(via);
-    if (enableOutput) {
-      cout <<"delete via in route" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::endRemoveNets_patchWire(frPatchWire* pwire) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto gridBBox = getRouteBox();
-  auto regionQuery = getRegionQuery();
-  auto net = pwire->getNet();
-  frPoint origin;
-  pwire->getOrigin(origin);
-  bool condition1 = isInitDR() ? 
-                    (origin.x() <  gridBBox.right() && origin.y() <  gridBBox.top()) : 
-                    (origin.x() <= gridBBox.right() && origin.y() <= gridBBox.top());
-  if (origin.x() >= gridBBox.left() && origin.y() >= gridBBox.bottom() && condition1) {
-    regionQuery->removeDRObj(pwire); // delete rq
-    net->removePatchWire(pwire);
-    if (enableOutput) {
-      cout <<"delete pwire in route" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::endRemoveNets(set<frNet*, frBlockObjectComp> &modNets, 
-                                 map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &boundPts) {
-  vector<frBlockObject*> result;
-  getRegionQuery()->queryDRObj(getRouteBox(), result);
-  for (auto rptr: result) {
-    if (rptr->typeId() == frcPathSeg) {
-      auto cptr = static_cast<frPathSeg*>(rptr);
-      if (cptr->hasNet()) {
-        if (modNets.find(cptr->getNet()) != modNets.end()) {
-          endRemoveNets_pathSeg(cptr, boundPts[cptr->getNet()]);
-        }
-      } else {
-        cout <<"Error: endRemoveNet hasNet() empty" <<endl;
-      }
-    } else if (rptr->typeId() == frcVia) {
-      auto cptr = static_cast<frVia*>(rptr);
-      if (cptr->hasNet()) {
-        if (modNets.find(cptr->getNet()) != modNets.end()) {
-          endRemoveNets_via(cptr);
-        }
-      } else {
-        cout <<"Error: endRemoveNet hasNet() empty" <<endl;
-      }
-    } else if (rptr->typeId() == frcPatchWire) {
-      auto cptr = static_cast<frPatchWire*>(rptr);
-      if (cptr->hasNet()) {
-        if (modNets.find(cptr->getNet()) != modNets.end()) {
-          endRemoveNets_patchWire(cptr);
-        }
-      } else {
-        cout <<"Error: endRemoveNet hasNet() empty" <<endl;
-      }
-    } else {
-      cout <<"Error: endRemoveNets unsupported type" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::endAddNets_pathSeg(drPathSeg* pathSeg/*, map<pair<frPoint, frLayerNum>, set<frBlockObject*> > &cutSegs*/) {
-  //cout <<"add pathseg" <<endl;
-  auto net = pathSeg->getNet()->getFrNet();
-  /*
-  frPoint bp, ep;
-  pathSeg->getPoints(bp, ep);
-  auto lNum = pathSeg->getLayerNum();
-  bool isHorzSeg = (bp.y() == ep.y());
-  auto &rbox = getRouteBox();
-  //bool merged = false;
-  // horizontal segment
-  if (isHorzSeg) {
-    // check if it can be merged on left boundary
-    frPathSeg* mergeWithL = nullptr;
-    frPoint    pL;
-    frPathSeg* mergeWithR = nullptr;
-    frPoint    pR;
-    if (bp.x() == rbox.left() && cutSegs.find(make_pair(bp, lNum)) != cutSegs.end()) {
-      for (auto &obj: cutSegs.find(make_pair(bp, lNum))->second) {
-        if (obj->typeId() == frcPathSeg) {
-          auto nbrSeg = static_cast<frPathSeg*>(obj);
-          frPoint nbrBp, nbrEp;
-          nbrSeg->getPoints(nbrBp, nbrEp);
-          if (nbrBp.y() == nbrEp.y()) {
-            mergeWithL = nbrSeg;
-            pL.set(nbrBp);
-            break;
-          }
-        }
-      }
-    }
-    // check if it can be merged on right boundary
-    if (ep.x() == rbox.right() && cutSegs.find(make_pair(ep, lNum)) != cutSegs.end()) {
-      for (auto &obj: cutSegs.find(make_pair(ep, lNum))->second) {
-        if (obj->typeId() == frcPathSeg) {
-          auto nbrSeg = static_cast<frPathSeg*>(obj);
-          frPoint nbrBp, nbrEp;
-          nbrSeg->getPoints(nbrBp, nbrEp);
-          if (nbrBp.y() == nbrEp.y()) {
-            mergeWithR = nbrSeg;
-            pR.set(nbrEp);
-            break;
-          }
-        }
-      }
-    }
-    if (mergeWithL) {
-      bp.set(pL);
-      getRegionQuery()->removeDRObj(mergeWithL);
-      net->removeShape(mergeWithL);
-    }
-    if (mergeWithR) {
-      ep.set(pR);
-      getRegionQuery()->removeDRObj(mergeWithR);
-      net->removeShape(mergeWithR);
-    }
-  // vertical segment
-  } else {
-    // check if it can be merged on bottom boundary
-    frPathSeg* mergeWithB = nullptr;
-    frPoint    pB;
-    frPathSeg* mergeWithT = nullptr;
-    frPoint    pT;
-    if (bp.y() == rbox.bottom() && cutSegs.find(make_pair(bp, lNum)) != cutSegs.end()) {
-      for (auto &obj: cutSegs.find(make_pair(bp, lNum))->second) {
-        if (obj->typeId() == frcPathSeg) {
-          auto nbrSeg = static_cast<frPathSeg*>(obj);
-          frPoint nbrBp, nbrEp;
-          nbrSeg->getPoints(nbrBp, nbrEp);
-          if (nbrBp.x() == nbrEp.x()) {
-            mergeWithB = nbrSeg;
-            pB.set(nbrBp);
-            break;
-          }
-        }
-      }
-    }
-    // check if it can be merged on right boundary
-    if (ep.y() == rbox.top() && cutSegs.find(make_pair(ep, lNum)) != cutSegs.end()) {
-      for (auto &obj: cutSegs.find(make_pair(ep, lNum))->second) {
-        if (obj->typeId() == frcPathSeg) {
-          auto nbrSeg = static_cast<frPathSeg*>(obj);
-          frPoint nbrBp, nbrEp;
-          nbrSeg->getPoints(nbrBp, nbrEp);
-          if (nbrBp.x() == nbrEp.x()) {
-            mergeWithT = nbrSeg;
-            pT.set(nbrEp);
-            break;
-          }
-        }
-      }
-    }
-    if (mergeWithB) {
-      bp.set(pB);
-      getRegionQuery()->removeDRObj(mergeWithB);
-      net->removeShape(mergeWithB);
-    }
-    if (mergeWithT) {
-      ep.set(pT);
-      getRegionQuery()->removeDRObj(mergeWithT);
-      net->removeShape(mergeWithT);
-    }
-  }
-  pathSeg->setPoints(bp, ep);
-  */
-  unique_ptr<frShape> uShape = make_unique<frPathSeg>(*pathSeg);
-  auto rptr = uShape.get();
-  net->addShape(uShape);
-  getRegionQuery()->addDRObj(rptr);
-}
-
-void FlexDRWorker::endAddNets_via(drVia* via) {
-  auto net = via->getNet()->getFrNet();
-  unique_ptr<frVia> uVia = make_unique<frVia>(*via);
-  auto rptr = uVia.get();
-  net->addVia(uVia);
-  getRegionQuery()->addDRObj(rptr);
-}
-
-void FlexDRWorker::endAddNets_patchWire(drPatchWire* pwire) {
-  auto net = pwire->getNet()->getFrNet();
-  unique_ptr<frShape> uShape = make_unique<frPatchWire>(*pwire);
-  auto rptr = uShape.get();
-  net->addPatchWire(uShape);
-  getRegionQuery()->addDRObj(rptr);
-}
-
-void FlexDRWorker::endAddNets_merge(frNet* net, set<pair<frPoint, frLayerNum> > &boundPts) {
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  vector<frBlockObject*> drObjs;
-  vector<frPathSeg*> horzPathSegs;
-  vector<frPathSeg*> vertPathSegs;
-  auto regionQuery = getRegionQuery();
-  for (auto &[pt, lNum]: boundPts) {
-    bool skip = false;
-    result.clear();
-    regionQuery->query(frBox(pt, pt), lNum, result);
-    for (auto &[bx, obj]: result) {
-      if (obj->typeId() == frcInstTerm) {
-        auto instTerm = static_cast<frInstTerm*>(obj);
-        if (instTerm->getNet() == net) {
-          skip = true;
-          break;
-        }
-      } else if (obj->typeId() == frcTerm) {
-        auto term = static_cast<frTerm*>(obj);
-        if (term->getNet() == net) {
-          skip = true;
-          break;
-        }
-      }
-    }
-    if (skip) {
-      continue;
-    }
-    // get all drObjs
-    drObjs.clear();
-    horzPathSegs.clear();
-    vertPathSegs.clear();
-    regionQuery->queryDRObj(frBox(pt, pt), lNum, drObjs);
-    for (auto &obj: drObjs) {
-      if (obj->typeId() == frcPathSeg) {
-        auto ps = static_cast<frPathSeg*>(obj);
-        if (!(ps->getNet() == net)) {
-          continue;
-        }
-        frPoint bp, ep;
-        ps->getPoints(bp, ep);
-        if (bp == pt || ep == pt) {
-          // vertical
-          if (bp.x() == ep.x()) {
-            vertPathSegs.push_back(ps);
-          // horizontal
-          } else {
-            horzPathSegs.push_back(ps);
-          }
-        }
-      }
-    }
-    // merge horz pathseg
-    if ((int)horzPathSegs.size() == 2 && vertPathSegs.empty()) {
-      unique_ptr<frShape> uShape = make_unique<frPathSeg>(*horzPathSegs[0]);
-      auto rptr = static_cast<frPathSeg*>(uShape.get());
-      frPoint bp1, ep1, bp2, ep2;
-      horzPathSegs[0]->getPoints(bp1, ep1);
-      horzPathSegs[1]->getPoints(bp2, ep2);
-      frPoint bp(min(bp1.x(), bp2.x()), bp1.y());
-      frPoint ep(max(ep1.x(), ep2.x()), ep1.y());
-      rptr->setPoints(bp, ep);
-      
-      regionQuery->removeDRObj(horzPathSegs[0]);
-      regionQuery->removeDRObj(horzPathSegs[1]);
-      net->removeShape(horzPathSegs[0]);
-      net->removeShape(horzPathSegs[1]);
-
-      net->addShape(uShape);
-      regionQuery->addDRObj(rptr);
-    }
-    if ((int)vertPathSegs.size() == 2 && horzPathSegs.empty()) {
-      unique_ptr<frShape> uShape = make_unique<frPathSeg>(*vertPathSegs[0]);
-      auto rptr = static_cast<frPathSeg*>(uShape.get());
-      frPoint bp1, ep1, bp2, ep2;
-      vertPathSegs[0]->getPoints(bp1, ep1);
-      vertPathSegs[1]->getPoints(bp2, ep2);
-      frPoint bp(bp1.x(), min(bp1.y(), bp2.y()));
-      frPoint ep(ep1.x(), max(ep1.y(), ep2.y()));
-      rptr->setPoints(bp, ep);
-      
-      regionQuery->removeDRObj(vertPathSegs[0]);
-      regionQuery->removeDRObj(vertPathSegs[1]);
-      net->removeShape(vertPathSegs[0]);
-      net->removeShape(vertPathSegs[1]);
-
-      net->addShape(uShape);
-      regionQuery->addDRObj(rptr);
-    }
-  }
-}
-
-void FlexDRWorker::endAddNets(map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &boundPts) {
-  for(auto &net: nets) {
-    if (!net->isModified()) {
-      continue;
-    }
-    //auto fNet = net->getFrNet();
-    //for (auto &connFig: net->getRouteConnFigs()) {
-    for (auto &connFig: net->getBestRouteConnFigs()) {
-      if (connFig->typeId() == drcPathSeg) {
-        endAddNets_pathSeg(static_cast<drPathSeg*>(connFig.get())/*, cutSegs[fNet]*/);
-      } else if (connFig->typeId() == drcVia) {
-        endAddNets_via(static_cast<drVia*>(connFig.get()));
-      } else if (connFig->typeId() == drcPatchWire) {
-        endAddNets_patchWire(static_cast<drPatchWire*>(connFig.get()));
-      } else {
-        cout <<"Error: endAddNets unsupported type" <<endl;
-      }
-    }
-  }
-  for (auto &[net, bPts]: boundPts) {
-    endAddNets_merge(net, bPts);
-  }
-}
-
-/*
-void FlexDRWorker::endFilterCutSegs(map<frNet*, map<pair<frPoint, frLayerNum>, set<frBlockObject*> > > &cutSegs) {
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  auto regionQuery = getRegionQuery();
-  // remove merging point if there is a pin
-  for (auto &[net, mp]: cutSegs) {
-    //for (auto &[pr, objS]: mp) {
-    for (auto it = mp.begin(); it != mp.end(); ) {
-      auto localIt = it;
-      ++it;
-      auto &pr = localIt->first;
-      //auto &objS = localIt->second;
-      result.clear();
-      auto &[pt, lNum] = pr;
-      regionQuery->query(frBox(pt, pt), lNum, result);
-      for (auto &[bx, obj]: result) {
-        if (obj->typeId() == frcInstTerm) {
-          auto instTerm = static_cast<frInstTerm*>(obj);
-          if (instTerm->getNet() == net) {
-            mp.erase(localIt);
-            break;
-          }
-        } else if (obj->typeId() == frcTerm) {
-          auto term = static_cast<frTerm*>(obj);
-          if (term->getNet() == net) {
-            mp.erase(localIt);
-            break;
-          }
-        }
-      }
-    }
-  }
-  // remove merging point if there is a crossing segment 
-}
-*/
-
-void FlexDRWorker::endRemoveMarkers() {
-  auto regionQuery = getRegionQuery();
-  auto topBlock = getDesign()->getTopBlock();
-  vector<frMarker*> result;
-  regionQuery->queryMarker(getRouteBox(), result);
-  for (auto mptr: result) {
-    regionQuery->removeMarker(mptr);
-    topBlock->removeMarker(mptr);
-  }
-}
-
-void FlexDRWorker::endAddMarkers() {
-  auto regionQuery = getRegionQuery();
-  auto topBlock = getDesign()->getTopBlock();
-  frBox mBox;
-  //for (auto &m: getMarkers()) {
-  for (auto &m: getBestMarkers()) {
-    m.getBBox(mBox);
-    if (getRouteBox().overlaps(mBox)) {
-      auto uptr = make_unique<frMarker>(m);
-      auto ptr = uptr.get();
-      regionQuery->addMarker(ptr);
-      topBlock->addMarker(uptr);
-    }
-  }
-}
-
-void FlexDRWorker::end() {
-  // skip if current clip does not have input DRCs
-  // ripupMode = 0 must have enableDRC = true in previous iteration
-  if (isEnableDRC() && getRipupMode() == 0 && getInitNumMarkers() == 0) {
-    return;
-  // do not write back if current clip is worse than input
-  } else if (isEnableDRC() && getRipupMode() == 0 && getNumMarkers() > getInitNumMarkers()) {
-    //cout <<"skip clip with #init/final = " <<getInitNumMarkers() <<"/" <<getNumMarkers() <<endl;
-    return;
-  } else if (isEnableDRC() && getRipupMode() == 0 && getNumMarkers() == getInitNumMarkers()) {
-    //cout <<"write back clip with no improvement #final = " <<getNumMarkers() <<endl;
-  } else if (isEnableDRC() && getRipupMode() == 0 && getNumMarkers() < getInitNumMarkers()) {
-    //cout <<"write back clip with #init/final = " <<getInitNumMarkers() <<"/" <<getNumMarkers() <<endl;
-  }
-  set<frNet*, frBlockObjectComp> modNets;
-  endGetModNets(modNets);
-  // get lock
-  map<frNet*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> boundPts;
-  endRemoveNets(modNets, boundPts);
-  //endRemoveNets(modNets);
-  //endFilterCutSegs(cutSegs);
-  endAddNets(boundPts); // if two subnets have diff isModified() status, then should always write back
-  //endAddNets();
-  if (isEnableDRC()) {
-    endRemoveMarkers();
-    endAddMarkers();
-  }
-  // release lock
-
-}
-
-int FlexDRWorker::getNumQuickMarkers() {
-  int totNum = 0;
-  for (auto &net: nets) {
-    totNum += net->getNumMarkers();
-  }
-  return totNum;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_init.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_init.cpp
deleted file mode 100644
index 3ce84a8..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_init.cpp
+++ /dev/null
@@ -1,2262 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexDR.h"
-
-using namespace std;
-using namespace fr;
-
-void FlexDRWorker::initNetObjs_pathSeg(frPathSeg* pathSeg,
-                                       set<frNet*, frBlockObjectComp> &nets, 
-                                       map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                                       map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto gridBBox = getRouteBox();
-  auto net = pathSeg->getNet();
-  nets.insert(net);
-  // split seg
-  frPoint begin, end;
-  pathSeg->getPoints(begin, end);
-  //cout <<"here" <<endl;
-  // vertical seg
-  if (begin.x() == end.x()) {
-    //cout <<"vert seg" <<endl;
-    // may cross routeBBox
-    bool condition1 = isInitDR() ? (begin.x() < gridBBox.right()) : (begin.x() <= gridBBox.right());
-    if (gridBBox.left() <= begin.x() && condition1) {
-      //cout << " pathSeg (" << begin.x() << ", " << begin.y() << ") - (" << end.x() << ", " << end.y() << ")\n";
-      // bottom seg to ext
-      if (begin.y() < gridBBox.bottom()) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        auto ps = uPathSeg.get();
-        uPathSeg->setPoints(begin, frPoint(end.x(), min(end.y(), gridBBox.bottom())));
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        if (end.y() < gridBBox.bottom()) {
-          netExtObjs[net].push_back(std::move(uDRObj)); // pure ext
-        } else {
-          netRouteObjs[net].push_back(std::move(uDRObj));
-        }
-        if (enableOutput) {
-          cout <<"find pathseg to ext bottom (" << begin.x() / 2000.0 << ", " << begin.y() / 2000.0 << ") to ("
-               << end.x() / 2000.0 << ", " << min(end.y(), gridBBox.bottom()) / 2000.0 << ") on Layer " << ps->getLayerNum() <<endl;
-        }
-      }
-      // middle seg to route
-      if (!(begin.y() >= gridBBox.top() || end.y() <= gridBBox.bottom())) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        //auto ps = uPathSeg.get();
-        uPathSeg->setPoints(frPoint(begin.x(), max(begin.y(), gridBBox.bottom())), 
-                            frPoint(end.x(),   min(end.y(),   gridBBox.top())));
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        netRouteObjs[net].push_back(std::move(uDRObj));
-        if (enableOutput) {
-          cout <<"find pathseg to route vert (" << begin.x() / 2000.0 << ", " << max(begin.y(), gridBBox.bottom()) / 2000.0
-               << ") to (" << end.x() / 2000.0 << ", " << min(end.y(),   gridBBox.top()) / 2000.0 << ")" <<endl;
-        }
-      }
-      // top seg to ext
-      if (end.y() > gridBBox.top()) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        auto ps = uPathSeg.get();
-        uPathSeg->setPoints(frPoint(begin.x(), max(begin.y(), gridBBox.top())), end);
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        if (begin.y() > gridBBox.top()) {
-          netExtObjs[net].push_back(std::move(uDRObj)); // pure ext
-        } else {
-          netRouteObjs[net].push_back(std::move(uDRObj));
-        }
-        if (enableOutput) {
-          cout <<"find pathseg to ext top (at " << begin.x() / 2000.0 << ", " 
-               << max(begin.y(), gridBBox.top()) / 2000.0 << ", " << ps->getLayerNum() << ") )" <<endl;
-        }
-      }
-    // cannot cross routeBBox
-    } else {
-      auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-      unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-      netExtObjs[net].push_back(std::move(uDRObj));
-      if (enableOutput) {
-        cout <<"find pathseg to pure ext vert" <<endl;
-      }
-    }
-  // horizontal seg
-  } else if (begin.y() == end.y()) {
-    //cout <<"horz seg" <<endl;
-    // may cross routeBBox
-    bool condition1 = isInitDR() ? (begin.y() < gridBBox.top()) : (begin.y() <= gridBBox.top());
-    if (gridBBox.bottom() <= begin.y() && condition1) {
-      //cout << " pathSeg (" << begin.x() / 2000.0 << ", " << begin.y() / 2000.0 << ") - (" 
-      //                     << end.x()   / 2000.0 << ", " << end.y() / 2000.0   << ")\n";
-      // left seg to ext
-      if (begin.x() < gridBBox.left()) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        auto ps = uPathSeg.get();
-        uPathSeg->setPoints(begin, frPoint(min(end.x(), gridBBox.left()), end.y()));
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        if (end.x() < gridBBox.left()) {
-          netExtObjs[net].push_back(std::move(uDRObj)); // pure ext
-        } else {
-          netRouteObjs[net].push_back(std::move(uDRObj)); //touching bounds
-        }
-        if (enableOutput) {
-          cout <<"find pathseg to ext left (at " << min(end.x(), gridBBox.left()) / 2000.0 << ", " 
-               << end.y() / 2000.0 << ", " << ps->getLayerNum() << ") )" <<endl;
-        }
-      }
-      // middle seg to route
-      if (!(begin.x() >= gridBBox.right() || end.x() <= gridBBox.left())) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        //auto ps = uPathSeg.get();
-        uPathSeg->setPoints(frPoint(max(begin.x(), gridBBox.left()),  begin.y()), 
-                            frPoint(min(end.x(),   gridBBox.right()), end.y()));
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        netRouteObjs[net].push_back(std::move(uDRObj));
-        if (enableOutput) {
-          cout <<"find pathseg to route horz" <<endl;
-        }
-      }
-      // right seg to ext
-      if (end.x() > gridBBox.right()) {
-        auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-        auto ps = uPathSeg.get();
-        uPathSeg->setPoints(frPoint(max(begin.x(), gridBBox.right()), begin.y()), end);
-        unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-        if (begin.x() > gridBBox.right()) {
-          netExtObjs[net].push_back(std::move(uDRObj)); // pure ext
-        } else {
-          netRouteObjs[net].push_back(std::move(uDRObj)); // touching bounds
-        }
-        if (enableOutput) {
-          cout <<"find pathseg to ext right (at " << max(begin.x(), gridBBox.right()) / 2000.0 << ", " 
-               << begin.y() / 2000.0 << ", " << ps->getLayerNum() << ") )" <<endl;
-        }
-      }
-    // cannot cross routeBBox
-    } else {
-      auto uPathSeg = make_unique<drPathSeg>(*pathSeg);
-      unique_ptr<drConnFig> uDRObj(std::move(uPathSeg));
-      netExtObjs[net].push_back(std::move(uDRObj));
-      if (enableOutput) {
-        cout <<"find pathseg to pure ext horz" <<endl;
-      }
-    }
-  } else {
-    cout <<"wtf" <<endl;
-  }
-}
-
-void FlexDRWorker::initNetObjs_via(frVia* via,
-                                          set<frNet*, frBlockObjectComp> &nets, 
-                                          map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                                          map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto gridBBox = getRouteBox();
-  auto net = via->getNet();
-  nets.insert(net);
-  frPoint viaPoint;
-  via->getOrigin(viaPoint);
-  bool condition1 = isInitDR() ? 
-                    (viaPoint.x() <  gridBBox.right() && viaPoint.y() <  gridBBox.top()) :
-                    (viaPoint.x() <= gridBBox.right() && viaPoint.y() <= gridBBox.top());
-  if (viaPoint.x() >= gridBBox.left() && viaPoint.y() >= gridBBox.bottom() && condition1) {
-    auto uVia = make_unique<drVia>(*via);
-    unique_ptr<drConnFig> uDRObj(std::move(uVia));
-    netRouteObjs[net].push_back(std::move(uDRObj));
-    if (enableOutput) {
-      cout <<"find via route" <<endl;
-    }
-  } else {
-    auto uVia = make_unique<drVia>(*via);
-    unique_ptr<drConnFig> uDRObj(std::move(uVia));
-    netExtObjs[net].push_back(std::move(uDRObj));
-    if (enableOutput) {
-      cout <<"find via ext" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::initNetObjs_patchWire(frPatchWire* pwire,
-                                         set<frNet*, frBlockObjectComp> &nets, 
-                                         map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                                         map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto gridBBox = getRouteBox();
-  auto net = pwire->getNet();
-  nets.insert(net);
-  frPoint origin;
-  pwire->getOrigin(origin);
-  bool condition1 = isInitDR() ? 
-                    (origin.x() <  gridBBox.right() && origin.y() <  gridBBox.top()) :
-                    (origin.x() <= gridBBox.right() && origin.y() <= gridBBox.top());
-  if (origin.x() >= gridBBox.left() && origin.y() >= gridBBox.bottom() && condition1) {
-    auto uPWire = make_unique<drPatchWire>(*pwire);
-    unique_ptr<drConnFig> uDRObj(std::move(uPWire));
-    netRouteObjs[net].push_back(std::move(uDRObj));
-    if (enableOutput) {
-      cout <<"find patch wire route" <<endl;
-    }
-  } else {
-    auto uPWire = make_unique<drPatchWire>(*pwire);
-    unique_ptr<drConnFig> uDRObj(std::move(uPWire));
-    netExtObjs[net].push_back(std::move(uDRObj));
-    if (enableOutput) {
-      cout <<"find patch wire ext" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::initNetObjs(set<frNet*, frBlockObjectComp> &nets, 
-                               map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                               map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  vector<frBlockObject*> result;
-  getRegionQuery()->queryDRObj(getExtBox(), result);
-  int cnt1 = 0;
-  int cnt2 = 0;
-  for (auto rptr: result) {
-    if (rptr->typeId() == frcPathSeg) {
-      auto cptr = static_cast<frPathSeg*>(rptr);
-      if (cptr->hasNet()) {
-        initNetObjs_pathSeg(cptr, nets, netRouteObjs, netExtObjs);
-        cnt1++;
-      } else {
-        cout <<"Error: initNetObjs hasNet() empty" <<endl;
-      }
-    } else if (rptr->typeId() == frcVia) {
-      auto cptr = static_cast<frVia*>(rptr);
-      if (cptr->hasNet()) {
-        initNetObjs_via(cptr, nets, netRouteObjs, netExtObjs);
-        cnt2++;
-      } else {
-        cout <<"Error: initNetObjs hasNet() empty" <<endl;
-      }
-    } else if (rptr->typeId() == frcPatchWire) {
-      auto cptr = static_cast<frPatchWire*>(rptr);
-      if (cptr->hasNet()) {
-        initNetObjs_patchWire(cptr, nets, netRouteObjs, netExtObjs);
-        cnt1++;
-      } else {
-        cout <<"Error: initNetObjs hasNet() empty" <<endl;
-      }
-    } else {
-      cout << rptr->typeId() << "\n";
-      cout <<"Error: initCopyDRObjs unsupported type" <<endl;
-    }
-  }
-  if (isInitDR()) {
-    vector<frGuide*> guides;
-    getRegionQuery()->queryGuide(getRouteBox(), guides);
-    for (auto &guide: guides) {
-      if (guide->hasNet()) {
-        auto net = guide->getNet();
-        if (nets.find(net) == nets.end()) {
-          nets.insert(net);
-          netRouteObjs[net].clear();
-          netExtObjs[net].clear();
-        }
-      }
-    }
-  }
-  if (enableOutput) {
-    cout <<"cnt1/2 = " <<cnt1 <<"/" <<cnt2 <<endl;
-    cout <<"nets size = " <<nets.size() <<endl;
-  }
-}
-
-void FlexDRWorker::initNets_initDR(set<frNet*, frBlockObjectComp> &nets,
-                                   map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                                   map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  //map<frNet*, vector<frBlockObject*>, frBlockObjectComp > netTerms;
-  map<frNet*, set<frBlockObject*, frBlockObjectComp>, frBlockObjectComp > netTerms;
-  vector<frBlockObject*> result;
-  getRegionQuery()->queryGRPin(getRouteBox(), result);
-  for (auto obj: result) {
-    if (obj->typeId() == frcInstTerm) {
-      auto net = static_cast<frInstTerm*>(obj)->getNet();
-      nets.insert(net);
-      //netTerms[net].push_back(obj);
-      netTerms[net].insert(obj);
-    } else if (obj->typeId() == frcTerm) {
-      auto net = static_cast<frTerm*>(obj)->getNet();
-      nets.insert(net);
-      //netTerms[net].push_back(obj);
-      netTerms[net].insert(obj);
-    } else {
-      cout <<"Error: initNetTerms unsupported obj" <<endl;
-    }
-  }
-  vector<unique_ptr<drConnFig> > vRouteObjs;
-  vector<unique_ptr<drConnFig> > vExtObjs;
-  for (auto net: nets) {
-    vRouteObjs.clear();
-    vExtObjs.clear();
-    vExtObjs = std::move(netExtObjs[net]);
-    for (int i = 0; i < (int)netRouteObjs[net].size(); i++) {
-      auto &obj = netRouteObjs[net][i];
-      if (obj->typeId() == drcPathSeg) {
-        auto ps = static_cast<drPathSeg*>(obj.get());
-        frPoint bp, ep;
-        ps->getPoints(bp, ep);
-        auto &box = getRouteBox();
-        if (box.contains(bp) && box.contains(ep)) {
-          vRouteObjs.push_back(std::move(netRouteObjs[net][i]));
-        } else {
-          vExtObjs.push_back(std::move(netRouteObjs[net][i]));
-        }
-      } else if (obj->typeId() == drcVia) {
-        vRouteObjs.push_back(std::move(netRouteObjs[net][i]));
-      } else if (obj->typeId() == drcPatchWire) {
-        vRouteObjs.push_back(std::move(netRouteObjs[net][i]));
-      }
-    }
-    //initNet(net, netRouteObjs[net], netExtObjs[net], netTerms[net]);
-    vector<frBlockObject*> tmpTerms;
-    tmpTerms.assign(netTerms[net].begin(), netTerms[net].end());
-    //initNet(net, vRouteObjs, vExtObjs, netTerms[net]);
-    initNet(net, vRouteObjs, vExtObjs, tmpTerms);
-  }
-}
-
-// copied to FlexDR::checkConnectivity_pin2epMap_helper
-void FlexDRWorker::initNets_searchRepair_pin2epMap_helper(frNet *net, const frPoint &bp, frLayerNum lNum, 
-                                                          map<frBlockObject*, 
-                                                              set<pair<frPoint, frLayerNum> >, 
-                                                              frBlockObjectComp > &pin2epMap) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  auto regionQuery = getRegionQuery();
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  //result.clear();
-  regionQuery->query(frBox(bp, bp), lNum, result);
-  for (auto &[bx, rqObj]: result) {
-    if (rqObj->typeId() == frcInstTerm) {
-      auto instTerm = static_cast<frInstTerm*>(rqObj);
-      if (instTerm->getNet() == net) {
-        if (enableOutput) {
-          cout <<"found instTerm" <<endl;
-        }
-        pin2epMap[rqObj].insert(make_pair(bp, lNum));
-      } else {
-        if (enableOutput) {
-          cout <<"found other instTerm" <<endl;
-        }
-      }
-    } else if (rqObj->typeId() == frcTerm) {
-      auto term = static_cast<frTerm*>(rqObj);
-      if (term->getNet() == net) {
-        if (enableOutput) {
-          cout <<"found term" <<endl;
-        }
-        pin2epMap[rqObj].insert(make_pair(bp, lNum));
-      } else {
-        if (enableOutput) {
-          cout <<"found other term" <<endl;
-        }
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initNets_searchRepair_pin2epMap(frNet* net, 
-                                                   vector<unique_ptr<drConnFig> > &netRouteObjs,
-                                                   /*vector<unique_ptr<drConnFig> > &netExtObjs,*/
-                                                   /*vector<frBlockObject> &netPins,*/
-                                                   map<frBlockObject*, 
-                                                       set<pair<frPoint, frLayerNum> >,
-                                                       frBlockObjectComp> &pin2epMap/*,
-                                                   map<pair<frPoint, frLayerNum>, set<int> > &nodeMap*/) {
-  bool enableOutput = false;
-  frPoint bp, ep;
-  //auto regionQuery = getRegionQuery();
-  //vector<rq_rptr_value_t<frBlockObject> > result;
-  // should not count extObjs in union find
-  for (auto &uPtr: netRouteObjs) {
-    auto connFig = uPtr.get();
-    if (connFig->typeId() == drcPathSeg) {
-      auto obj = static_cast<drPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      if (enableOutput) {
-       cout <<"(bp, ep) (" <<bp.x() / 2000.0 <<" ," <<bp.y() / 2000.0 <<") ("
-                           <<ep.x() / 2000.0 <<" ," <<ep.y() / 2000.0 <<") " 
-            <<getTech()->getLayer(lNum)->getName() <<endl;
-      }
-      if (getRouteBox().contains(bp)) {
-        if (enableOutput) {
-          cout <<"query bp" <<endl;
-        }
-        initNets_searchRepair_pin2epMap_helper(net, bp, lNum, pin2epMap);
-      }
-      if (getRouteBox().contains(ep)) {
-        if (enableOutput) {
-          cout <<"query ep" <<endl;
-        }
-        initNets_searchRepair_pin2epMap_helper(net, ep, lNum, pin2epMap);
-      }
-    } else if (connFig->typeId() == drcVia) {
-      auto obj = static_cast<drVia*>(connFig);
-      obj->getOrigin(bp);
-      auto l1Num = obj->getViaDef()->getLayer1Num();
-      auto l2Num = obj->getViaDef()->getLayer2Num();
-      if (enableOutput) {
-        cout <<"bp (" <<bp.x() / 2000.0 <<" ," <<bp.y() / 2000.0 <<") "
-             <<getTech()->getLayer(l1Num)->getName() <<endl;
-      }
-      if (getRouteBox().contains(bp)) {
-        if (enableOutput) {
-          cout <<"query bp l1" <<endl;
-        }
-        initNets_searchRepair_pin2epMap_helper(net, bp, l1Num, pin2epMap);
-        if (enableOutput) {
-          cout <<"query bp l2" <<endl;
-        }
-        initNets_searchRepair_pin2epMap_helper(net, bp, l2Num, pin2epMap);
-      }
-    } else if (connFig->typeId() == drcPatchWire) {
-    } else {
-      cout <<"Error: initNets_searchRepair_pin2epMap unsupported type" <<endl;
-    }
-  }
-  //cout <<net->getName() <<" " <<pin2epMap.size() <<endl;
-}
-
-void FlexDRWorker::initNets_searchRepair_nodeMap_routeObjEnd(frNet* net, vector<unique_ptr<drConnFig> > &netRouteObjs,
-                                                   map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  bool enableOutput = false;
-  frPoint bp, ep;
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto connFig = netRouteObjs[i].get();
-    if (connFig->typeId() == drcPathSeg) {
-      auto obj = static_cast<drPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      nodeMap[make_pair(bp, lNum)].insert(i);
-      nodeMap[make_pair(ep, lNum)].insert(i);
-      if (enableOutput) {
-        cout <<"node idx = " <<i <<", (" <<bp.x() / 2000.0 <<", " <<bp.y() / 2000.0 <<") (" 
-                                         <<ep.x() / 2000.0 <<", " <<ep.y() / 2000.0 <<") " 
-             <<getTech()->getLayer(lNum)->getName() <<endl;
-      }
-    } else if (connFig->typeId() == drcVia) {
-      auto obj = static_cast<drVia*>(connFig);
-      obj->getOrigin(bp);
-      auto l1Num = obj->getViaDef()->getLayer1Num();
-      auto l2Num = obj->getViaDef()->getLayer2Num();
-      nodeMap[make_pair(bp, l1Num)].insert(i);
-      nodeMap[make_pair(bp, l2Num)].insert(i);
-      if (enableOutput) {
-        cout <<"node idx = " <<i <<", (" <<bp.x() / 2000.0 <<", " <<bp.y() / 2000.0 <<") "
-             <<getTech()->getLayer(l1Num)->getName() <<" --> " <<getTech()->getLayer(l2Num)->getName() <<endl;
-      }
-    } else if (connFig->typeId() == drcPatchWire) {
-      auto obj = static_cast<drPatchWire*>(connFig);
-      obj->getOrigin(bp);
-      auto lNum = obj->getLayerNum();
-      nodeMap[make_pair(bp, lNum)].insert(i);
-      if (enableOutput) {
-        cout <<"node idx = " <<i <<", (" <<bp.x() / 2000.0 <<", " <<bp.y() / 2000.0 <<") "
-             <<getTech()->getLayer(lNum)->getName() << endl;
-      }
-    } else {
-      cout <<"Error: initNets_searchRepair_nodeMap unsupported type" <<endl;
-    }
-  }
-}
-
-void FlexDRWorker::initNets_searchRepair_nodeMap_routeObjSplit_helper(const frPoint &crossPt, 
-                   frCoord trackCoord, frCoord splitCoord, frLayerNum lNum, 
-                   vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > &mergeHelper,
-                   map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  auto it1 = mergeHelper[lNum].find(trackCoord);
-  if (it1 != mergeHelper[lNum].end()) {
-    auto &mp = it1->second; // map<ep, pair<bp, objIdx> >
-    auto it2 = mp.lower_bound(splitCoord);
-    if (it2 != mp.end()) {
-      auto &endP = it2->first;
-      auto &[beginP, objIdx] = it2->second;
-      if (endP > splitCoord && beginP < splitCoord) {
-        nodeMap[make_pair(crossPt, lNum)].insert(objIdx);
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initNets_searchRepair_nodeMap_routeObjSplit(frNet* net, vector<unique_ptr<drConnFig> > &netRouteObjs,
-                                                               map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  frPoint bp, ep;
-  // vector<map<track, map<ep, pair<bp, objIdx> > > > interval_map
-  vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > horzMergeHelper(getTech()->getLayers().size());
-  vector<map<frCoord, map<frCoord, pair<frCoord, int> > > > vertMergeHelper(getTech()->getLayers().size());
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto connFig = netRouteObjs[i].get();
-    if (connFig->typeId() == drcPathSeg) {
-      auto obj = static_cast<drPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      // vert seg
-      if (bp.x() == ep.x()) {
-        vertMergeHelper[lNum][bp.x()][ep.y()] = make_pair(bp.y(), i);
-      // horz seg
-      } else {
-        horzMergeHelper[lNum][bp.y()][ep.x()] = make_pair(bp.x(), i);
-      }
-    }
-  }
-  for (int i = 0; i < (int)netRouteObjs.size(); i++) {
-    auto connFig = netRouteObjs[i].get();
-    // ep on pathseg
-    if (connFig->typeId() == drcPathSeg) {
-      auto obj = static_cast<drPathSeg*>(connFig);
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      // vert seg, find horz crossing seg
-      if (bp.x() == ep.x()) {
-        //find whether there is horz track at bp
-        auto crossPt    = bp;
-        auto trackCoord = bp.y();
-        auto splitCoord = bp.x();
-        initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-        //find whether there is horz track at ep
-        crossPt    = ep;
-        trackCoord = ep.y();
-        splitCoord = ep.x();
-        initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      // horz seg
-      } else {
-        //find whether there is vert track at bp
-        auto crossPt    = bp;
-        auto trackCoord = bp.x();
-        auto splitCoord = bp.y();
-        initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-        //find whether there is vert track at ep
-        crossPt    = ep;
-        trackCoord = ep.x();
-        splitCoord = ep.y();
-        initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-      }
-    } else if (connFig->typeId() == drcVia) {
-      auto obj = static_cast<drVia*>(connFig);
-      obj->getOrigin(bp);
-      auto lNum = obj->getViaDef()->getLayer1Num();
-      //find whether there is horz track at bp on layer1
-      auto crossPt    = bp;
-      auto trackCoord = bp.y();
-      auto splitCoord = bp.x();
-      initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      //find whether there is vert track at bp on layer1
-      crossPt    = bp;
-      trackCoord = bp.x();
-      splitCoord = bp.y();
-      initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-      
-      lNum = obj->getViaDef()->getLayer2Num();
-      //find whether there is horz track at bp on layer2
-      crossPt    = bp;
-      trackCoord = bp.y();
-      splitCoord = bp.x();
-      initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, horzMergeHelper, nodeMap);
-      //find whether there is vert track at bp on layer2
-      crossPt    = bp;
-      trackCoord = bp.x();
-      splitCoord = bp.y();
-      initNets_searchRepair_nodeMap_routeObjSplit_helper(crossPt, trackCoord, splitCoord, lNum, vertMergeHelper, nodeMap);
-    }
-  }
-}
-  
-void FlexDRWorker::initNets_searchRepair_nodeMap_pin(frNet* net, 
-                                                     vector<unique_ptr<drConnFig> > &netRouteObjs,
-                                                     vector<frBlockObject*> &netPins,
-                                                     map<frBlockObject*, 
-                                                         set<pair<frPoint, frLayerNum> >, 
-                                                         frBlockObjectComp > &pin2epMap,
-                                                     map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  bool enableOutput = false;
-  int currCnt = (int)netRouteObjs.size();
-  for (auto &[obj, locS]: pin2epMap) {
-    netPins.push_back(obj);
-    for (auto &pr: locS) {
-      nodeMap[pr].insert(currCnt);
-      if (enableOutput) {
-        cout <<"pin idx = " <<currCnt <<", (" <<pr.first.x() <<", " <<pr.first.y() <<") " 
-             <<getTech()->getLayer(pr.second)->getName() <<endl;
-      }
-    }
-    ++currCnt;
-  }
-}
-
-void FlexDRWorker::initNets_searchRepair_nodeMap(frNet* net, 
-                                                 vector<unique_ptr<drConnFig> > &netRouteObjs,
-                                                 vector<frBlockObject*> &netPins,
-                                                 map<frBlockObject*, 
-                                                     set<pair<frPoint, frLayerNum> >,
-                                                     frBlockObjectComp> &pin2epMap,
-                                                 map<pair<frPoint, frLayerNum>, set<int> > &nodeMap) {
-  initNets_searchRepair_nodeMap_routeObjEnd(net, netRouteObjs, nodeMap);
-  initNets_searchRepair_nodeMap_routeObjSplit(net, netRouteObjs, nodeMap);
-  initNets_searchRepair_nodeMap_pin(net, netRouteObjs, netPins, pin2epMap, nodeMap);
-}
-
-void FlexDRWorker::initNets_searchRepair_connComp(frNet* net, 
-                                                  map<pair<frPoint, frLayerNum>, set<int> > &nodeMap,
-                                                  vector<int> &compIdx) {
-  bool enableOutput = false;
-  int nCnt = (int)compIdx.size(); // total node cnt
-
-  vector<vector<int> > adjVec(nCnt, vector<int>());
-  vector<bool> adjVisited(nCnt, false);
-  for (auto &[pr, idxS]: nodeMap) {
-    //auto &[pt, lNum] = pr;
-    for (auto it1 = idxS.begin(); it1 != idxS.end(); it1++) {
-      auto it2 = it1;
-      it2++;
-      auto idx1 = *it1;
-      for (; it2 != idxS.end(); it2++) {
-        auto idx2 = *it2;
-        if (enableOutput) {
-          cout <<"edge = " <<idx1 <<"/" <<idx2 <<endl <<flush;
-        }
-        adjVec[idx1].push_back(idx2);
-        adjVec[idx2].push_back(idx1);
-      }
-    }
-  }
-
-  struct wf {
-    int nodeIdx;
-    int cost;
-    bool operator<(const wf &b) const {
-      if (cost == b.cost) {
-        return nodeIdx > b.nodeIdx;
-      } else {
-        return cost > b.cost;
-      }
-    }
-  };
-
-  int currNetIdx = 0;
-  auto it = find(adjVisited.begin(), adjVisited.end(), false);
-  while (it != adjVisited.end()) {
-    if (enableOutput) {
-      cout <<"union";
-    }
-    priority_queue<wf> pq;
-    int srcIdx = distance(adjVisited.begin(), it);
-    pq.push({srcIdx, 0});
-    while (!pq.empty()) {
-      auto wfront = pq.top();
-      auto currIdx = wfront.nodeIdx;
-      pq.pop();
-      if (adjVisited[currIdx]) {
-        continue;
-      }
-      adjVisited[currIdx] = true;
-      if (enableOutput) {
-        cout <<" " <<currIdx;
-      }
-      compIdx[currIdx] = currNetIdx;
-      for (auto nbrIdx: adjVec[currIdx]) {
-        if (!adjVisited[nbrIdx]) {
-          pq.push({nbrIdx, wfront.cost + 1});
-        }
-      }
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-    it = find(adjVisited.begin(), adjVisited.end(), false);
-    ++currNetIdx;
-  }
-  //if (currNetIdx > 1) {
-  //  cout <<"@@debug " <<net->getName() <<" union find get " <<currNetIdx <<" subnets" <<endl;
-  //}
-}
-
-void FlexDRWorker::initNets_searchRepair(set<frNet*, frBlockObjectComp> &nets, 
-                                         map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netRouteObjs,
-                                         map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp> &netExtObjs) {
-  for (auto net: nets) {
-    // build big graph;
-    // node number : routeObj, pins
-    map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> pin2epMap;
-    initNets_searchRepair_pin2epMap(net, netRouteObjs[net]/*, netExtObjs[net], netPins*/, pin2epMap/*, nodeMap*/);
-
-    vector<frBlockObject*> netPins;
-    map<pair<frPoint, frLayerNum>, set<int> > nodeMap;
-    initNets_searchRepair_nodeMap(net, netRouteObjs[net], netPins, pin2epMap, nodeMap);
-
-    //cout <<"size1(pin/robj) = " <<netPins.size() <<"/" <<netRouteObjs.size() <<endl;
-    vector<int> compIdx((int)netPins.size() + (int)netRouteObjs[net].size(), 0);
-    //cout <<"size2(pin/robj/comp) = " <<netPins.size() <<"/" <<netRouteObjs[net].size() <<"/" <<compIdx.size() <<endl;
-    initNets_searchRepair_connComp(net, nodeMap, compIdx);
-
-    vector<vector<unique_ptr<drConnFig> > > vRouteObjs;
-    vector<vector<unique_ptr<drConnFig> > > vExtObjs;
-    vector<vector<frBlockObject*> >         vPins;
-
-    auto it = max_element(compIdx.begin(), compIdx.end());
-    int numSubNets = (it == compIdx.end()) ? 1 : ((*it) + 1);
-    // put all pure ext objs to the first subnet
-    vExtObjs.resize(numSubNets);
-    vExtObjs[0] = std::move(netExtObjs[net]);
-
-    vRouteObjs.resize(numSubNets);
-    vPins.resize(numSubNets);
-
-    for (int i = 0; i < (int)compIdx.size(); i++) {
-      int subNetIdx = compIdx[i];
-      if (i < (int)netRouteObjs[net].size()) {
-        auto &obj = netRouteObjs[net][i];
-        if (obj->typeId() == drcPathSeg) {
-          auto ps = static_cast<drPathSeg*>(obj.get());
-          frPoint bp, ep;
-          ps->getPoints(bp, ep);
-          auto &box = getRouteBox();
-          if (box.contains(bp) && box.contains(ep)) {
-            vRouteObjs[subNetIdx].push_back(std::move(netRouteObjs[net][i]));
-          } else {
-            vExtObjs[subNetIdx].push_back(std::move(netRouteObjs[net][i]));
-          }
-        } else if (obj->typeId() == drcVia) {
-          vRouteObjs[subNetIdx].push_back(std::move(netRouteObjs[net][i]));
-        } else if (obj->typeId() == drcPatchWire) {
-          vRouteObjs[subNetIdx].push_back(std::move(netRouteObjs[net][i]));
-        }
-      } else {
-        vPins[subNetIdx].push_back(netPins[i - (int)netRouteObjs[net].size()]);
-      }
-    }
-
-    for (int i = 0; i < numSubNets; i++) {
-      initNet(net, vRouteObjs[i], vExtObjs[i], vPins[i]);
-    }
-
-  }
-}
-
-void FlexDRWorker::initNet_termGenAp(drPin* dPin) {
-  using namespace boost::polygon::operators;
-
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  bool hasOnTrack = false;
-  auto routeBox = getRouteBox();
-  Rectangle routeRect(routeBox.left(), routeBox.bottom(), routeBox.right(), routeBox.top());
-  auto dPinTerm = dPin->getFrTerm();
-  if (dPinTerm->typeId() == frcInstTerm) {
-    frInstTerm *instTerm = static_cast<frInstTerm*>(dPinTerm);
-    //frTransform xform;
-    frInst *inst = instTerm->getInst();
-    //frBox mbox;
-    //
-    //inst->getTransform(xform);
-    //inst->getRefBlock()->getBoundaryBBox(mbox);
-    //frPoint size(mbox.right(), mbox.top());
-    //xform.updateXform(size);
-    frTransform xform;
-    inst->getUpdatedXform(xform);
-    
-    for (auto &pin: instTerm->getTerm()->getPins()) {
-      auto pinPtr = pin.get();
-      auto pinLayer2PolySet = pinPtr->getLayer2PolySet();
-      std::map<frLayerNum, PolygonSet> layer2PolySet;
-      // populate layer2PolySet
-      for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-        auto currLayerNum = layerIt->first;
-        auto currPolySet = layerIt->second;
-        std::vector<Rectangle> pinRects;
-        boost::polygon::get_rectangles(pinRects, currPolySet);
-        for (auto &pinRect: pinRects) {
-          frBox tmpBox(xl(pinRect), yl(pinRect), xh(pinRect), yh(pinRect));
-          tmpBox.transform(xform);
-          Rectangle transformedRect(tmpBox.left(), tmpBox.bottom(), tmpBox.right(), tmpBox.top());
-          layer2PolySet[currLayerNum] += transformedRect;
-        }
-      }
-      // now let the work begin with transformed pin shapes
-      for (auto layerIt = layer2PolySet.begin(); layerIt != layer2PolySet.end(); ++layerIt) {
-        auto currLayerNum = layerIt->first;
-        auto currPolyset = layerIt->second;
-        std::vector<Rectangle> pinRects;
-        boost::polygon::get_rectangles(pinRects, currPolyset);
-        for (auto &pinRect: pinRects) {
-          if (!intersect(pinRect, routeRect)) {
-            continue;
-          }
-          Rectangle overlapRect;
-          overlapRect = generalized_intersect(pinRect, routeRect);
-          if (xl(overlapRect) == xl(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              hasOnTrack = true;
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(xl(overlapRect), trackLoc);
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                dPin->addAccessPattern(uap);
-              }
-            }
-          }
-          if (xh(overlapRect) == xh(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(xh(overlapRect), trackLoc);
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                if (!isInitDR() || yh(overlapRect) != yh(routeRect)) {
-                  hasOnTrack = true;
-                  dPin->addAccessPattern(uap);
-                }
-              }
-            }
-          }
-          if (yl(overlapRect) == yl(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              hasOnTrack = true;
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(trackLoc, yl(overlapRect));
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                dPin->addAccessPattern(uap);
-              }
-            }
-          }
-          if (yh(overlapRect) == yh(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(trackLoc, yh(overlapRect));
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                if (!isInitDR() || xh(overlapRect) != xh(routeRect)) {
-                  hasOnTrack = true;
-                  dPin->addAccessPattern(uap);
-                }
-              }
-            }
-          }
-
-        }
-
-        // if there is no on track...
-        if (!hasOnTrack) {
-          for (auto &pinRect: pinRects) {
-            if (!intersect(pinRect, routeRect)) {
-              continue;
-            }
-            Rectangle overlapRect;
-            overlapRect = generalized_intersect(pinRect, routeRect);
-            if (xl(overlapRect) == xl(routeRect)) {
-              // std::set<frCoord> trackLocs;
-              // getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint(xl(overlapRect), (yl(overlapRect) + yh(overlapRect)) / 2);
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  dPin->addAccessPattern(uap);
-                  break;
-                // }
-              // }
-            }
-            if (xh(overlapRect) == xh(routeRect)) {
-              // std::set<frCoord> trackLocs;
-              // getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint(xh(overlapRect), (yl(overlapRect) + yh(overlapRect)) / 2);
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  if (!isInitDR() || ((yl(overlapRect) + yh(overlapRect)) / 2) != yh(routeRect)) {
-                    dPin->addAccessPattern(uap);
-                    break;
-                  }
-                // }
-              // }
-            }
-            if (yl(overlapRect) == yl(routeRect)) {
-              // std::set<frCoord> trackLocs;
-              // getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint((xl(overlapRect) + xh(overlapRect)) / 2, yl(overlapRect));
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  dPin->addAccessPattern(uap);
-                  break;
-                // }
-              // }
-            }
-            if (yh(overlapRect) == yh(routeRect)) {
-              std::set<frCoord> trackLocs;
-              // getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint((xl(overlapRect) + xh(overlapRect)) / 2, yh(overlapRect));
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  if (!isInitDR() || ((xl(overlapRect) + xh(overlapRect)) / 2) != xh(routeRect)) {
-                    dPin->addAccessPattern(uap);
-                    break;
-                  }
-                // }
-              // }
-            }
-
-          }
-        }
-
-
-      }
-      
-    }
-  } else if (dPinTerm->typeId() == frcTerm) {
-    frTerm *term = static_cast<frTerm*>(dPinTerm);
-    for (auto &pin: term->getPins()) {
-      auto pinPtr = pin.get();
-      // auto pinLayer2PolySet = pinPtr->getLayer2PolySet();
-      std::map<frLayerNum, PolygonSet> layer2PolySet = pinPtr->getLayer2PolySet();
-      // populate layer2PolySet
-      // for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-      //   auto currLayerNum = layerIt->first;
-      //   auto currPolySet = layerIt->second;
-      //   std::vector<Rectangle> pinRects;
-      //   boost::polygon::get_rectangles(pinRects, currPolySet);
-      //   for (auto &pinRect: pinRects) {
-      //     frBox tmpBox(xl(pinRect), yl(pinRect), xh(pinRect), yh(pinRect));
-      //     tmpBox.transform(xform);
-      //     Rectangle transformedRect(tmpBox.left(), tmpBox.bottom(), tmpBox.right(), tmpBox.top());
-      //     layer2PolySet[currLayerNum] += transformedRect;
-      //   }
-      // }
-
-      // now let the work begin with transformed pin shapes
-      for (auto layerIt = layer2PolySet.begin(); layerIt != layer2PolySet.end(); ++layerIt) {
-        auto currLayerNum = layerIt->first;
-        auto currPolyset = layerIt->second;
-        std::vector<Rectangle> pinRects;
-        boost::polygon::get_rectangles(pinRects, currPolyset);
-        for (auto &pinRect: pinRects) {
-          if (!intersect(pinRect, routeRect)) {
-            continue;
-          }
-          Rectangle overlapRect;
-          overlapRect = generalized_intersect(pinRect, routeRect);
-          if (xl(overlapRect) == xl(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              hasOnTrack = true;
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(xl(overlapRect), trackLoc);
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                dPin->addAccessPattern(uap);
-              }
-            }
-          }
-          if (xh(overlapRect) == xh(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(xh(overlapRect), trackLoc);
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                if (!isInitDR() || yh(overlapRect) != yh(routeRect)) {
-                  hasOnTrack = true;
-                  dPin->addAccessPattern(uap);
-                }
-              }
-            }
-          }
-          if (yl(overlapRect) == yl(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              hasOnTrack = true;
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(trackLoc, yl(overlapRect));
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                dPin->addAccessPattern(uap);
-              }
-            }
-          }
-          if (yh(overlapRect) == yh(routeRect)) {
-            std::set<frCoord> trackLocs;
-            getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-            if (!trackLocs.empty()) {
-              for (auto &trackLoc: trackLocs) {
-                auto uap = std::make_unique<drAccessPattern>();
-                frPoint startPoint(trackLoc, yh(overlapRect));
-                uap->setBeginLayerNum(currLayerNum);
-                uap->setPoint(startPoint);
-                if (!isInitDR() || xh(overlapRect) != xh(routeRect)) {
-                  hasOnTrack = true;
-                  dPin->addAccessPattern(uap);
-                }
-              }
-            }
-          }
-
-        }
-
-        // if there is no on track...
-        if (!hasOnTrack) {
-          for (auto &pinRect: pinRects) {
-            if (!intersect(pinRect, routeRect)) {
-              continue;
-            }
-            Rectangle overlapRect;
-            overlapRect = generalized_intersect(pinRect, routeRect);
-            if (xl(overlapRect) == xl(routeRect)) {
-              std::set<frCoord> trackLocs;
-              // getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint(xl(overlapRect), (yl(overlapRect) + yh(overlapRect)) / 2);
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  dPin->addAccessPattern(uap);
-                  break;
-                // }
-              // }
-            }
-            if (xh(overlapRect) == xh(routeRect)) {
-              std::set<frCoord> trackLocs;
-              // getTrackLocs(true, currLayerNum, yl(overlapRect), yh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint(xh(overlapRect), (yl(overlapRect) + yh(overlapRect)) / 2);
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  if (!isInitDR() || ((yl(overlapRect) + yh(overlapRect)) / 2) != yh(routeRect)) {
-                    dPin->addAccessPattern(uap);
-                    break;
-                  }
-                // }
-              // }
-            }
-            if (yl(overlapRect) == yl(routeRect)) {
-              std::set<frCoord> trackLocs;
-              // getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint((xl(overlapRect) + xh(overlapRect)) / 2, yl(overlapRect));
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  dPin->addAccessPattern(uap);
-                  break;
-                // }
-              // }
-            }
-            if (yh(overlapRect) == yh(routeRect)) {
-              std::set<frCoord> trackLocs;
-              // getTrackLocs(false, currLayerNum, xl(overlapRect), xh(overlapRect), trackLocs);
-              // if (!trackLocs.empty()) {
-                // for (auto &trackLoc: trackLocs) {
-                  auto uap = std::make_unique<drAccessPattern>();
-                  frPoint startPoint((xl(overlapRect) + xh(overlapRect)) / 2, yh(overlapRect));
-                  uap->setBeginLayerNum(currLayerNum);
-                  uap->setPoint(startPoint);
-                  if (!isInitDR() || ((xl(overlapRect) + xh(overlapRect)) / 2) != xh(routeRect)) {
-                    dPin->addAccessPattern(uap);
-                    break;
-                  }
-                // }
-              // }
-            }
-
-          }
-        }
-
-
-      }
-      
-    }
-  } else {
-    if (enableOutput) {
-      std::cout << "Error: unexpected type in initNet_termGenAp";
-    }
-  }
-}
-
-// when isHorzTracks == true, it means track loc == y loc
-void FlexDRWorker::getTrackLocs(bool isHorzTracks, frLayerNum currLayerNum, frCoord low, frCoord high, std::set<frCoord> &trackLocs) {
-  frPrefRoutingDirEnum currPrefRouteDir = getTech()->getLayer(currLayerNum)->getDir(); 
-  for (auto &tp: design->getTopBlock()->getTrackPatterns(currLayerNum)) {
-    if (tp->isHorizontal() && currPrefRouteDir == frcVertPrefRoutingDir ||
-       !tp->isHorizontal() && currPrefRouteDir == frcHorzPrefRoutingDir) {
-      int trackNum = (low - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-      if (trackNum < 0) {
-        trackNum = 0;
-      }
-      if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < low) {
-        ++trackNum;
-      }
-      for (; 
-           trackNum < (int)tp->getNumTracks() && 
-           trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < high; 
-           ++trackNum) {
-        frCoord trackLoc = trackNum * tp->getTrackSpacing() + tp->getStartCoord();
-        trackLocs.insert(trackLoc);
-        if (tp->isHorizontal() && !isHorzTracks) {
-          trackLocs.insert(trackLoc);
-        } else if (!tp->isHorizontal() && isHorzTracks) {
-          trackLocs.insert(trackLoc);
-        } else {
-          continue;
-        }
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initNet_term(drNet* dNet, vector<frBlockObject*> &terms) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  for (auto term: terms) {
-    auto dPin = make_unique<drPin>();
-    dPin->setFrTerm(term);
-    // ap
-    frTransform instXform; // (0,0), frcR0
-    frTransform shiftXform;
-    frTerm* trueTerm = nullptr;
-    string  name;
-    bool hasInst = false;
-    frInst* inst = nullptr;
-    if (term->typeId() == frcInstTerm) {
-      hasInst = true;
-      inst = static_cast<frInstTerm*>(term)->getInst();
-      //inst->getTransform(instXform);
-      inst->getTransform(shiftXform);
-      shiftXform.set(frOrient(frcR0));
-      inst->getUpdatedXform(instXform);
-      //inst->getUpdatedXform(shiftXform, true); // get no orient version
-      trueTerm = static_cast<frInstTerm*>(term)->getTerm();
-      name = inst->getName() + string("/") + trueTerm->getName();
-    } else if (term->typeId() == frcTerm) {
-      trueTerm = static_cast<frTerm*>(term);
-      name = string("PIN/") + trueTerm->getName();
-    }
-    if (enableOutput) {
-      cout <<"pin " <<name;
-    }
-    for (auto &pin: trueTerm->getPins()) {
-      for (auto &ap: pin->getAccessPatterns(instXform.orient())) {
-        if (hasInst && !(ap->hasInst(inst))) {
-          continue;
-        }
-        if (ap->isConflict()) {
-          continue;
-        }
-        frPoint bp, ep;
-        ap->getPoints(bp, ep);
-        if (enableOutput) {
-          cout <<" (" <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                      <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") origin";
-        }
-        auto bNum = ap->getBeginLayerNum();
-        bp.transform(shiftXform);
-
-        auto dAp  = make_unique<drAccessPattern>();
-        dAp->setPoint(bp);
-        dAp->setBeginLayerNum(bNum);
-        dAp->setValidAccess(ap->getValidAccess());
-        if (!(ap->getAccessViaDef(frDirEnum::U).empty())) {
-          dAp->setAccessViaDef(frDirEnum::U, &(ap->getAccessViaDef(frDirEnum::U)));
-        }
-        if (!(ap->getAccessViaDef(frDirEnum::D).empty())) {
-          dAp->setAccessViaDef(frDirEnum::D, &(ap->getAccessViaDef(frDirEnum::D)));
-        }
-        if (getRouteBox().contains(bp)) {
-          dPin->addAccessPattern(dAp);
-          if (enableOutput) {
-            cout <<" (" <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                        <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") added";
-          }
-        } else {
-          if (enableOutput) {
-            cout <<" (" <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                        <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") skipped";
-          }
-        }
-      }
-    }
-
-
-    if (enableOutput) {
-       cout <<endl;
-       cout <<"ap size = " <<dPin->getAccessPatterns().size() <<endl;
-    }
-
-    if (dPin->getAccessPatterns().empty()) {
-      if (enableOutput) {
-        cout <<"Warning: pin " <<name <<" does not have pre-calculated ap, gen temp ap ";
-        //for (auto &[bp, bNum]: pts) {
-        //  cout <<" (" <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-        //              <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") ";
-        //}
-        //cout <<endl;
-      }
-      initNet_termGenAp(dPin.get());
-      if (dPin->getAccessPatterns().empty()) {
-        cout <<endl <<"Error: pin " <<name <<" still does not have temp ap" <<endl;
-        exit(1);
-      } else {
-        if (enableOutput) {
-          for (auto &ap: dPin->getAccessPatterns()) {
-            frPoint bp;
-            ap->getPoint(bp);
-            cout <<" (" <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                        <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") ";
-          }
-          cout <<endl;
-        }
-      }
-    }
-    dPin->setId(pinCnt);
-    pinCnt++;
-    dNet->addPin(dPin);
-  }
-}
-
-void FlexDRWorker::initNet_boundary(drNet* dNet, 
-                                    vector<unique_ptr<drConnFig> > &extObjs) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //if (!isInitDR() && dNet->getFrNet()->getName() == string("net14488")) {
-  //if (!isInitDR() && dNet->getFrNet()->getName() == string("net100629")) {
-  //  enableOutput = true;
-  //  cout <<"here" <<endl;
-  //}
-  auto gridBBox = getRouteBox();
-  set<pair<frPoint, frLayerNum> > extBounds;
-  if (!isInitDR()) {
-    for (auto &obj: extObjs) {
-      if (obj->typeId() == drcPathSeg) {
-        auto ps = static_cast<drPathSeg*>(obj.get());
-        frPoint begin, end;
-        ps->getPoints(begin, end);
-        frLayerNum lNum = ps->getLayerNum();
-        // vert pathseg
-        if (begin.x() == end.x() && begin.x() >= gridBBox.left() && end.x() <= gridBBox.right()) {
-          if (begin.y() == gridBBox.top()) {
-            if (enableOutput) {
-              cout << "top bound (" 
-                   << begin.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                   << begin.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") - (" 
-                   << end.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ", " 
-                   << end.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ") " 
-                   << getTech()->getLayer(lNum)->getName() <<"\n";
-            }
-            extBounds.insert(make_pair(begin, lNum));
-          }
-          if (end.y() == gridBBox.bottom()) {
-            if (enableOutput) {
-              cout << "bottom bound ("
-                   << begin.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                   << begin.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") - (" 
-                   << end.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ", " 
-                   << end.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ") " 
-                   << getTech()->getLayer(lNum)->getName() <<"\n";
-            }
-            extBounds.insert(make_pair(end, lNum));
-          }
-        // horz pathseg
-        } else if (begin.y() == end.y() && begin.y() >= gridBBox.bottom() && end.y() <= gridBBox.top()) {
-          if (begin.x() == gridBBox.right()) {
-            if (enableOutput) {
-              cout << "right bound ("
-                   << begin.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                   << begin.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") - (" 
-                   << end.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ", " 
-                   << end.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ") " 
-                   << getTech()->getLayer(lNum)->getName() <<"\n";
-            }
-            extBounds.insert(make_pair(begin, lNum));
-          }
-          if (end.x() == gridBBox.left()) {
-            if (enableOutput) {
-              cout << "left bound (" 
-                   << begin.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-                   << begin.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") - (" 
-                   << end.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ", " 
-                   << end.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()<< ") " 
-                   << getTech()->getLayer(lNum)->getName() <<"\n";
-            }
-            extBounds.insert(make_pair(end, lNum));
-          }
-        }
-      }
-    }
-  // initDR
-  } else {
-    auto it = boundaryPin.find(dNet->getFrNet());
-    //cout <<string(dNet->getFrNet() == nullptr ? "null" : dNet->getFrNet()->getName()) <<endl;
-    if (it != boundaryPin.end()) {
-      //cout <<"here" <<endl;
-      extBounds = it->second;
-      if (enableOutput) {
-        for (auto &[pt, lNum]: it->second) {
-          cout << "init bound (" 
-               << pt.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ", " 
-               << pt.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() << ") " 
-               << getTech()->getLayer(lNum)->getName() <<"\n";
-        }
-      }
-    }
-  }
-  for (auto &[pt, lNum]: extBounds) {
-    auto dPin = make_unique<drPin>();
-    auto dAp  = make_unique<drAccessPattern>();
-    dAp->setPoint(pt);
-    dAp->setBeginLayerNum(lNum);
-    dPin->addAccessPattern(dAp);
-    // ap
-    dPin->setId(pinCnt);
-    pinCnt++;
-    dNet->addPin(dPin);
-  }
-}
-
-void FlexDRWorker::initNet(frNet* net, 
-                           vector<unique_ptr<drConnFig> > &routeObjs,
-                           vector<unique_ptr<drConnFig> > &extObjs,
-                           vector<frBlockObject*> &terms) {
-  //bool enableOutput = false;
-  //bool enableOutput = true;
-  auto dNet = make_unique<drNet>();
-  dNet->setFrNet(net);
-  // true pin
-  initNet_term(dNet.get(), terms);
-  // boundary pin, could overlap with any of true pins
-  initNet_boundary(dNet.get(), extObjs);
-  // no ext routes in initDR to avoid weird TA shapes
-  for (auto &obj: extObjs) {
-    dNet->addRoute(obj, true);
-  }
-  if (!isInitDR()) {
-    for (auto &obj: routeObjs) {
-      dNet->addRoute(obj, false);
-    }
-  }
-  dNet->setId(nets.size());
-  nets.push_back(std::move(dNet));
-}
-
-void FlexDRWorker::initNets_regionQuery() {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  workerRegionQuery.init();
-}
-
-void FlexDRWorker::initNets_numPinsIn() {
-  vector<rq_rptr_value_t<drPin> > allPins;
-  frPoint pt;
-  for (auto &net: nets) {
-    for (auto &pin: net->getPins()) {
-      for (auto &ap: pin->getAccessPatterns()) {
-        ap->getPoint(pt);
-        //pinRegionQuery.insert(make_pair(box_t(point_t(pt.x(), pt.y()), point_t(pt.x(), pt.y())), pin.get()));
-        allPins.push_back(make_pair(box_t(point_t(pt.x(), pt.y()), point_t(pt.x(), pt.y())), pin.get()));
-        break;
-      }
-    }
-  }
-  bgi::rtree<rq_rptr_value_t<drPin>, bgi::quadratic<16> > pinRegionQuery(allPins);
-  for (auto &net: nets) {
-    frCoord x1 = getExtBox().right();
-    frCoord x2 = getExtBox().left();
-    frCoord y1 = getExtBox().top();
-    frCoord y2 = getExtBox().bottom();
-    for (auto &pin: net->getPins()) {
-      for (auto &ap: pin->getAccessPatterns()) {
-        ap->getPoint(pt);
-        if (pt.x() < x1) {
-          x1 = pt.x();
-        }
-        if (pt.x() > x2) {
-          x2 = pt.x();
-        }
-        if (pt.y() < y1) {
-          y1 = pt.y();
-        }
-        if (pt.y() > y2) {
-          y2 = pt.y();
-        }
-        break;
-      }
-    }
-    if (x1 <= x2 && y1 <= y2) {
-      box_t boostb = box_t(point_t(x1, y1), point_t(x2, y2));
-      allPins.clear();
-      pinRegionQuery.query(bgi::intersects(boostb), back_inserter(allPins));
-      net->setNumPinsIn(allPins.size());
-      frBox tmpBox(x1, y1, x2, y2);
-      net->setPinBox(tmpBox);
-    } else {
-      net->setNumPinsIn(99999);
-      net->setPinBox(getExtBox());
-    }
-  }
-}
-
-void FlexDRWorker::initNets() {
-  set<frNet*, frBlockObjectComp>                                      nets;
-  map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp>      netRouteObjs;
-  map<frNet*, vector<unique_ptr<drConnFig> >, frBlockObjectComp>      netExtObjs;
-  // get lock
-  initNetObjs(nets, netRouteObjs, netExtObjs);
-  // release lock
-  if (isInitDR()) {
-    initNets_initDR(nets, netRouteObjs, netExtObjs);
-  } else {
-    // find inteTerm/terms using netRouteObjs;
-    initNets_searchRepair(nets, netRouteObjs, netExtObjs);
-  }
-  initNets_regionQuery();
-  initNets_numPinsIn();
-}
-
-void FlexDRWorker::initTrackCoords_route(drNet* net, 
-                                         map<frCoord, map<frLayerNum, frTrackPattern*> > &xMap,
-                                         map<frCoord, map<frLayerNum, frTrackPattern*> > &yMap) {
-  //auto rbox = getRouteBox();
-  //auto ebox = getExtBox();
-  // add for routes
-  vector<drConnFig*> allObjs;
-  for (auto &uConnFig: net->getExtConnFigs()) {
-    allObjs.push_back(uConnFig.get());
-  }
-  for (auto &uConnFig: net->getRouteConnFigs()) {
-    allObjs.push_back(uConnFig.get());
-  }
-  //for (auto &uConnFig: net->getExtConnFigs()) {
-  for (auto &uConnFig: allObjs) {
-    if (uConnFig->typeId() == drcPathSeg) {
-      auto obj = static_cast<drPathSeg*>(uConnFig);
-      frPoint bp, ep;
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      // vertical
-      if (bp.x() == ep.x()) {
-        // non pref dir
-        if (getTech()->getLayer(lNum)->getDir() == frcHorzPrefRoutingDir) {
-          if (lNum + 2 <= getTech()->getTopLayerNum()) {
-            xMap[bp.x()][lNum + 2] = nullptr; // default add track to upper layer
-          } else if (lNum - 2 >= getTech()->getBottomLayerNum()) {
-            xMap[bp.x()][lNum - 2] = nullptr;
-          } else {
-            cout <<"Error: initTrackCoords cannot add non-pref track" <<endl;
-          }
-          // add bp, ep
-          //if (!isInitDR()) {
-            yMap[bp.y()][lNum] = nullptr;
-            yMap[ep.y()][lNum] = nullptr;
-          //}
-        // pref dir 
-        } else {
-          xMap[bp.x()][lNum] = nullptr;
-          // add bp, ep
-          //if (!isInitDR()) {
-            if (lNum + 2 <= getTech()->getTopLayerNum()) {
-              yMap[bp.y()][lNum + 2] = nullptr; // default add track to upper layer
-              yMap[ep.y()][lNum + 2] = nullptr; // default add track to upper layer
-            } else if (lNum - 2 >= getTech()->getBottomLayerNum()) {
-              yMap[bp.y()][lNum - 2] = nullptr;
-              yMap[ep.y()][lNum - 2] = nullptr;
-            } else {
-              cout <<"Error: initTrackCoords cannot add non-pref track" <<endl;
-            }
-          //}
-        }
-      // horizontal
-      } else {
-        // non pref dir
-        if (getTech()->getLayer(lNum)->getDir() == frcVertPrefRoutingDir) {
-          if (lNum + 2 <= getTech()->getTopLayerNum()) {
-            yMap[bp.y()][lNum + 2] = nullptr;
-          } else if (lNum - 2 >= getTech()->getBottomLayerNum()) {
-            yMap[bp.y()][lNum - 2] = nullptr;
-          } else {
-            cout <<"Error: initTrackCoords cannot add non-pref track" <<endl;
-          }
-          // add bp, ep
-          //if (!isInitDR()) {
-            xMap[bp.x()][lNum] = nullptr;
-            xMap[ep.x()][lNum] = nullptr;
-          //}
-        } else {
-          yMap[bp.y()][lNum] = nullptr;
-          // add bp, ep
-          //if (!isInitDR()) {
-            if (lNum + 2 <= getTech()->getTopLayerNum()) {
-              xMap[bp.x()][lNum + 2] = nullptr; // default add track to upper layer
-              xMap[ep.x()][lNum + 2] = nullptr; // default add track to upper layer
-            } else if (lNum - 2 >= getTech()->getBottomLayerNum()) {
-              xMap[bp.x()][lNum - 2] = nullptr;
-              xMap[ep.x()][lNum - 2] = nullptr;
-            } else {
-              cout <<"Error: initTrackCoords cannot add non-pref track" <<endl;
-            }
-          //}
-        }
-      }
-    } else if (uConnFig->typeId() == drcVia) {
-      auto obj = static_cast<drVia*>(uConnFig);
-      frPoint pt;
-      obj->getOrigin(pt);
-      // add pref dir track to layer1
-      auto layer1Num = obj->getViaDef()->getLayer1Num();
-      if (getTech()->getLayer(layer1Num)->getDir() == frcHorzPrefRoutingDir) {
-        yMap[pt.y()][layer1Num] = nullptr;
-      } else {
-        xMap[pt.x()][layer1Num] = nullptr;
-      }
-      // add pref dir track to layer2
-      auto layer2Num = obj->getViaDef()->getLayer2Num();
-      if (getTech()->getLayer(layer2Num)->getDir() == frcHorzPrefRoutingDir) {
-        yMap[pt.y()][layer2Num] = nullptr;
-      } else {
-        xMap[pt.x()][layer2Num] = nullptr;
-      }
-    } else if (uConnFig->typeId() == drcPatchWire) {
-
-    } else {
-      cout <<"Error: initTrackCoords unsupported type" <<endl;
-    }
-  }
-}
-    
-void FlexDRWorker::initTrackCoords_pin(drNet* net, 
-                                       map<frCoord, map<frLayerNum, frTrackPattern*> > &xMap,
-                                       map<frCoord, map<frLayerNum, frTrackPattern*> > &yMap) {
-  //auto rbox = getRouteBox();
-  //auto ebox = getExtBox();
-  // add for aps
-  for (auto &pin: net->getPins()) {
-    for (auto &ap: pin->getAccessPatterns()) {
-      frPoint pt;
-      ap->getPoint(pt);
-      // ap must be within rbox
-      //if (!ebox.contains(pt)) {
-      //  continue;
-      //}
-      auto lNum = ap->getBeginLayerNum();
-      frLayerNum lNum2 = 0;
-      if (lNum + 2 <= getTech()->getTopLayerNum()) {
-        lNum2 = lNum + 2;
-      } else if (lNum - 2 >= getTech()->getBottomLayerNum()) {
-        lNum2 = lNum - 2;
-      } else {
-        cout <<"Error: initTrackCoords cannot add non-pref track" <<endl;
-      }
-      if (getTech()->getLayer(lNum)->getDir() == frcHorzPrefRoutingDir) {
-        yMap[pt.y()][lNum] = nullptr;
-      } else {
-        xMap[pt.x()][lNum] = nullptr;
-      }
-      if (getTech()->getLayer(lNum2)->getDir() == frcHorzPrefRoutingDir) {
-        yMap[pt.y()][lNum2] = nullptr;
-      } else {
-        xMap[pt.x()][lNum2] = nullptr;
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initTrackCoords(map<frCoord, map<frLayerNum, frTrackPattern*> > &xMap,
-                                   map<frCoord, map<frLayerNum, frTrackPattern*> > &yMap) {
-  // add boundary points
-  // lNum = -10 to indicate routeBox and extBox frCoord
-  auto rbox = getRouteBox();
-  auto ebox = getExtBox();
-  yMap[rbox.bottom()][-10] = nullptr;
-  yMap[rbox.top()][-10] = nullptr;
-  yMap[ebox.bottom()][-10] = nullptr;
-  yMap[ebox.top()][-10] = nullptr;
-  xMap[rbox.left()][-10] = nullptr;
-  xMap[rbox.right()][-10] = nullptr;
-  xMap[ebox.left()][-10] = nullptr;
-  xMap[ebox.right()][-10] = nullptr;
-  // add all track coords
-  for (auto &net: nets) {
-    initTrackCoords_route(net.get(), xMap, yMap);
-    initTrackCoords_pin(net.get(), xMap, yMap);
-  }
-}
-
-void FlexDRWorker::initGridGraph() {
-  // get all track coords based on existing objs and aps
-  map<frCoord, map<frLayerNum, frTrackPattern*> > xMap;
-  map<frCoord, map<frLayerNum, frTrackPattern*> > yMap;
-  initTrackCoords(xMap, yMap);
-  gridGraph.setCost(workerDRCCost, workerMarkerCost);
-  gridGraph.init(getRouteBox(), getExtBox(), xMap, yMap, isInitDR());
-  //gridGraph.print();
-}
-
-void FlexDRWorker::initMazeIdx_connFig(drConnFig *connFig) {
-  if (connFig->typeId() == drcPathSeg) {
-    auto obj = static_cast<drPathSeg*>(connFig);
-    frPoint bp, ep;
-    obj->getPoints(bp, ep);
-    bp.set(max(bp.x(), getExtBox().left()),  max(bp.y(), getExtBox().bottom()));
-    ep.set(min(ep.x(), getExtBox().right()), min(ep.y(), getExtBox().top()));
-    auto lNum = obj->getLayerNum();
-    if (gridGraph.hasMazeIdx(bp, lNum) && gridGraph.hasMazeIdx(ep, lNum)) {
-      FlexMazeIdx bi, ei;
-      gridGraph.getMazeIdx(bi, bp, lNum);
-      gridGraph.getMazeIdx(ei, ep, lNum);
-      obj->setMazeIdx(bi, ei);
-      //cout <<"has idx pathseg" <<endl;
-    } else {
-      cout <<"Error: initMazeIdx_connFig pathseg no idx (" 
-           << bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<", "
-           << bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<") ("
-           << ep.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<", "
-           << ep.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<") "
-           << getTech()->getLayer(lNum)->getName()
-           <<endl;
-    }
-  } else if (connFig->typeId() == drcVia) {
-    auto obj = static_cast<drVia*>(connFig);
-    frPoint bp;
-    obj->getOrigin(bp);
-    auto layer1Num = obj->getViaDef()->getLayer1Num();
-    auto layer2Num = obj->getViaDef()->getLayer2Num();
-    if (gridGraph.hasMazeIdx(bp, layer1Num) && gridGraph.hasMazeIdx(bp, layer2Num)) {
-      FlexMazeIdx bi, ei;
-      gridGraph.getMazeIdx(bi, bp, layer1Num);
-      gridGraph.getMazeIdx(ei, bp, layer2Num);
-      obj->setMazeIdx(bi, ei);
-      //cout <<"has idx via" <<endl;
-    } else {
-      cout <<"Error: initMazeIdx_connFig via no idx (" 
-           << bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<", "
-           << bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<") "
-           << getTech()->getLayer(layer1Num + 1)->getName()
-           <<endl;
-    }
-  } else if (connFig->typeId() == drcPatchWire) {
-
-  } else {
-    cout <<"Error: initMazeIdx_connFig unsupported type" <<endl;
-  }
-}
-
-void FlexDRWorker::initMazeIdx_ap(drAccessPattern *ap) {
-  frPoint bp;
-  ap->getPoint(bp);
-  auto lNum = ap->getBeginLayerNum();
-  if (gridGraph.hasMazeIdx(bp, lNum)) {
-    FlexMazeIdx bi;
-    gridGraph.getMazeIdx(bi, bp, lNum);
-    ap->setMazeIdx(bi);
-    //cout <<"has idx via" <<endl;
-  } else {
-    cout <<"Error: initMazeIdx_ap no idx (" 
-         << bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<", "
-         << bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU()  <<") "
-         << getTech()->getLayer(lNum)->getName()
-         <<endl;
-  }
-}
-
-void FlexDRWorker::initMazeIdx() {
-  for (auto &net: nets) {
-    for (auto &connFig: net->getExtConnFigs()) {
-      initMazeIdx_connFig(connFig.get());
-    }
-    for (auto &connFig: net->getRouteConnFigs()) {
-      initMazeIdx_connFig(connFig.get());
-    }
-    for (auto &pin: net->getPins()) {
-      for (auto &ap: pin->getAccessPatterns()) {
-        initMazeIdx_ap(ap.get());
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost_ap_helper(drNet* net, bool isAddPathCost) {
-  FlexMazeIdx mi;
-  for (auto &pin: net->getPins()) {
-    for (auto &ap: pin->getAccessPatterns()) {
-      ap->getMazeIdx(mi);
-      if (ap->hasValidAccess(frDirEnum::U)) {
-        if (isAddPathCost) {
-          gridGraph.setShapeVia(mi.x(), mi.y(), mi.z());
-        } else {
-          gridGraph.resetShapeVia(mi.x(), mi.y(), mi.z());
-        }
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost_ap() {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  int cnt = 0;
-  FlexMazeIdx mi;
-  for (auto &net: nets) {
-    for (auto &pin: net->getPins()) {
-      for (auto &ap: pin->getAccessPatterns()) {
-        ap->getMazeIdx(mi);
-        //if (ap->hasValidAccess(frDirEnum::E) ||
-        //    ap->hasValidAccess(frDirEnum::S) ||
-        //    ap->hasValidAccess(frDirEnum::W) ||
-        //    ap->hasValidAccess(frDirEnum::N)) {
-        //  gridGraph.resetShapePlanar(mi.x(), mi.y(), mi.z());
-        //}
-        // currently hasValidAccess down is somehow true......
-        //if (ap->hasValidAccess(frDirEnum::D)) {
-        //  gridGraph.resetShapeVia(mi.x(), mi.y(), mi.z() - 1);
-        //}
-
-        // set when routing this net
-        //if (ap->hasValidAccess(frDirEnum::U)) {
-        //  gridGraph.resetShapeVia(mi.x(), mi.y(), mi.z());
-        //  //gridGraph.resetShapePlanar(mi.x(), mi.y(), mi.z());
-        //}
-
-        if (ap->hasAccessViaDef(frDirEnum::U)) {
-          gridGraph.setSVia(mi.x(), mi.y(), mi.z());
-          apSVia[mi] = ap.get();
-          if (ap->getAccessViaDef() != 
-              getDesign()->getTech()->getLayer(ap->getBeginLayerNum() + 1)->getDefaultViaDef()) {
-            cnt++;
-          }
-        }
-      }
-    }
-  }
-  if (enableOutput) {
-    cout <<"@@Test: " <<cnt <<" svia detected" <<endl;
-  }
-}
-
-void FlexDRWorker::initMazeCost_marker() {
-  // decay all existing mi
-  for (auto it = planarHistoryMarkers.begin(); it != planarHistoryMarkers.end();) {
-    auto currIt = it;
-    auto &mi = *currIt;
-    ++it;
-    if (gridGraph.decayMarkerCostPlanar(mi.x(), mi.y(), mi.z(), MARKERDECAY)) {
-      planarHistoryMarkers.erase(currIt);
-    }
-  }
-  for (auto it = viaHistoryMarkers.begin(); it != viaHistoryMarkers.end();) {
-    auto currIt = it;
-    auto &mi = *currIt;
-    ++it;
-    if (gridGraph.decayMarkerCostVia(mi.x(), mi.y(), mi.z(), MARKERDECAY)) {
-      viaHistoryMarkers.erase(currIt);
-    }
-  }
-  // add new marker mi
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  vector<drConnFig*> results;
-  frBox mBox, bloatBox;
-  FlexMazeIdx mIdx1, mIdx2;
-  //double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  for (auto &marker: markers) {
-    results.clear();
-    marker.getBBox(mBox);
-    if (!getRouteBox().overlaps(mBox)) {
-      continue;
-    }
-    auto lNum   = marker.getLayerNum();
-    //cout <<"marker @(" <<mBox.left()  / dbu <<", " <<mBox.bottom() / dbu <<") ("
-    //                   <<mBox.right() / dbu <<", " <<mBox.top()    / dbu <<") "
-    //     <<getDesign()->getTech()->getLayer(lNum)->getName() <<endl;
-    frCoord z = 0;
-    if (getDesign()->getTech()->getLayer(lNum)->getType() == frLayerTypeEnum::CUT) {
-      z = gridGraph.getMazeZIdx(lNum - 1);
-    } else {
-      z = gridGraph.getMazeZIdx(lNum);
-    }
-    workerRegionQuery.query(mBox, lNum, results);
-    for (auto &connFig: results) {
-      // for pathseg-related marker, bloat marker by half width and add marker cost planar
-      if (connFig->typeId() == drcPathSeg) {
-        //cout <<"@@pathseg" <<endl;
-        connFig->getNet()->setRipup();
-        frCoord bloatDist = getDesign()->getTech()->getLayer(lNum)->getWidth() / 2;
-        //if (marker.getConstraint()->typeId() == frConstraintTypeEnum::frcMinWidthConstraint) {
-        //  bloatDist = SHAPEBLOATWIDTH;
-        //}
-        mBox.bloat(bloatDist, bloatBox);
-        gridGraph.getIdxBox(mIdx1, mIdx2, bloatBox);
-        for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-          for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-            gridGraph.addMarkerCostPlanar(i, j, z);
-            //cout <<"add marker cost planar @(" <<i <<", " <<j <<", " <<z <<")" <<endl;
-            planarHistoryMarkers.insert(FlexMazeIdx(i, j, z));
-          }
-        }
-      // for via-related marker, add marker cost via
-      } else if (connFig->typeId() == drcVia) {
-        //cout <<"@@via" <<endl;
-        auto obj = static_cast<drVia*>(connFig);
-        obj->getMazeIdx(mIdx1, mIdx2);
-        connFig->getNet()->setRipup();
-        gridGraph.addMarkerCostVia(mIdx1.x(), mIdx1.y(), mIdx1.z());
-        //cout <<"add marker cost via @(" <<mIdx1.x() <<", " <<mIdx1.y() <<", " <<mIdx1.z() <<")" <<endl;
-        viaHistoryMarkers.insert(mIdx1);
-      } else if (connFig->typeId() == drcPatchWire) {
-        // TODO: could add marker // for now we think the other part in the violation would not be patchWire
-      } else {
-        cout <<"Error: unsupporterd dr type" <<endl;
-      }
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost() {
-  // init Maze Cost by pin shapes
-  initMazeCost_pin();
-  // added in maze route
-  // via access cost
-  //initMazeCost_via();
-  initMazeCost_ap();
-  // init Maze Cost by connFig
-  initMazeCost_connFig();
-}
-
-void FlexDRWorker::initMazeCost_pin_helper(const frBox &box, frCoord bloatDist, frMIdx zIdx) {
-  FlexMazeIdx mIdx1, mIdx2;
-  frBox bloatBox;
-  box.bloat(bloatDist, bloatBox);
-  gridGraph.getIdxBox(mIdx1, mIdx2, bloatBox);
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      gridGraph.setShapePlanar(i, j, zIdx);
-      gridGraph.setShapeVia(i, j, zIdx);
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost_pin() {
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  frBox box;
-  frCoord width = 0;
-  frCoord bloatDist = 0;
-  frMIdx  zIdx = 0;
-  for (auto layerNum = getTech()->getBottomLayerNum(); layerNum <= getTech()->getTopLayerNum(); ++layerNum) {
-    result.clear();
-    if (getTech()->getLayer(layerNum)->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    zIdx = gridGraph.getMazeZIdx(layerNum);
-    width = getTech()->getLayer(layerNum)->getWidth();
-    getRegionQuery()->query(getExtBox(), layerNum, result);
-    for (auto &[boostb, obj]: result) {
-      // instterm term
-      if (obj->typeId() == frcTerm || obj->typeId() == frcInstTerm) {
-        box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-        bloatDist = SHAPEBLOATWIDTH * width;
-        initMazeCost_pin_helper(box, bloatDist, zIdx);
-      // snet
-      } else if (obj->typeId() == frcPathSeg || obj->typeId() == frcVia) {
-        box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-        bloatDist = SHAPEBLOATWIDTH * width;
-        initMazeCost_pin_helper(box, bloatDist, zIdx);
-      } else if (obj->typeId() == frcBlockage || obj->typeId() == frcInstBlockage) {
-        if (USEMINSPACING_OBS) {
-          box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-          bloatDist = SHAPEBLOATWIDTH * width;
-          initMazeCost_pin_helper(box, bloatDist, zIdx);
-        } else {
-          box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-          bloatDist = SHAPEBLOATWIDTH * width;
-          initMazeCost_pin_helper(box, bloatDist, zIdx);
-        }
-      } else {
-        cout <<"Warning: unsupported type in initMazeCost_pin" <<endl;
-      }
-    }
-  }
-
-  /*
-  set<frBlockObject*, frBlockObjectComp> resultSet;
-  for (auto layerNum = getTech()->getBottomLayerNum(); layerNum <= getTech()->getTopLayerNum(); ++layerNum) {
-    std::vector<rq_rptr_value_t<frBlockObject> > result;
-    if (getTech()->getLayer(layerNum)->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    getRegionQuery()->query(getExtBox(), layerNum, result);
-    for (auto &ele: result) {
-      resultSet.insert(ele.second);  
-    }
-    
-  }
-  
-  for (auto obj: resultSet) {
-    if (obj->typeId() == frcInstTerm) {
-      frInstTerm *instTerm = static_cast<frInstTerm*>(obj);
-      frTransform xform;
-      frInst *inst = instTerm->getInst();
-      //frBox mbox;
-
-      //inst->getTransform(xform);
-      //inst->getRefBlock()->getBoundaryBBox(mbox);
-      //frPoint size(mbox.right(), mbox.top());
-      //xform.updateXform(size);
-      inst->getUpdatedXform(xform);
-
-      for (auto &pin: instTerm->getTerm()->getPins()) {
-        auto pinPtr = pin.get();
-        auto pinLayer2PolySet = pinPtr->getLayer2PolySet();
-        // std::map<frLayerNum, PolygonSet> layer2PolySet;
-        // populate layer2PolySet
-        for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-          std::set<std::pair<frMIdx, frMIdx> > costGrids;
-          auto currLayerNum = layerIt->first;
-          auto currPolySet = layerIt->second;
-          auto currLayerWidth = getTech()->getLayer(currLayerNum)->getWidth();
-          //auto currLayerPrefDir = getTech()->getLayer(currLayerNum)->getDir();
-          frCoord bloatWidth = SHAPEBLOATWIDTH * currLayerWidth;
-          std::vector<Rectangle> pinRects;
-          boost::polygon::get_rectangles(pinRects, currPolySet);
-          for (auto &pinRect: pinRects) {
-            frBox tmpBox(xl(pinRect), yl(pinRect), xh(pinRect), yh(pinRect));
-            tmpBox.transform(xform);
-            Rectangle transformedRect(tmpBox.left(), tmpBox.bottom(), tmpBox.right(), tmpBox.top());
-            bloat(transformedRect, bloatWidth);
-            addToCostGrids(transformedRect, costGrids);
-          }
-          auto zIdx = gridGraph.getMazeZIdx(currLayerNum);
-          for (auto &pairGrid: costGrids) {
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::E, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::W, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::N, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::S, PINSHORTCOST);
-            gridGraph.setShapePlanar(pairGrid.first, pairGrid.second, zIdx);
-            gridGraph.setShapeVia(pairGrid.first, pairGrid.second, zIdx);
-          }
-        }
-      }
-    } else if (obj->typeId() == frcTerm) {
-      frTerm *term = static_cast<frTerm*>(obj);
-      for (auto &pin: term->getPins()) {
-        auto pinPtr = pin.get();
-        auto pinLayer2PolySet = pinPtr->getLayer2PolySet();
-        // std::map<frLayerNum, PolygonSet> layer2PolySet;
-        // populate layer2PolySet
-        for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-          std::set<std::pair<frMIdx, frMIdx> > costGrids;
-          auto currLayerNum = layerIt->first;
-          auto currPolySet = layerIt->second;
-          auto currLayerWidth = getTech()->getLayer(currLayerNum)->getWidth();
-          //auto currLayerPrefDir = getTech()->getLayer(currLayerNum)->getDir();
-          frCoord bloatWidth = SHAPEBLOATWIDTH * currLayerWidth;
-          std::vector<Rectangle> pinRects;
-          boost::polygon::get_rectangles(pinRects, currPolySet);
-          for (auto &pinRect: pinRects) {
-            frBox tmpBox(xl(pinRect), yl(pinRect), xh(pinRect), yh(pinRect));
-            Rectangle transformedRect(tmpBox.left(), tmpBox.bottom(), tmpBox.right(), tmpBox.top());
-            bloat(transformedRect, bloatWidth);
-            addToCostGrids(transformedRect, costGrids);
-          }
-          auto zIdx = gridGraph.getMazeZIdx(currLayerNum);
-          for (auto &pairGrid: costGrids) {
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::E, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::W, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::N, PINSHORTCOST);
-            //gridGraph.addEdgeShapeCost(pairGrid.first, pairGrid.second, zIdx, frDirEnum::S, PINSHORTCOST);
-            gridGraph.setShapePlanar(pairGrid.first, pairGrid.second, zIdx);
-            gridGraph.setShapeVia(pairGrid.first, pairGrid.second, zIdx);
-          }
-        }
-      }
-    }
-  }
-  */
-}
-
-void FlexDRWorker::addToCostGrids(const Rectangle &region, std::set<std::pair<frMIdx, frMIdx> > &costGrids) {
-  frMIdx startXIdx, endXIdx, startYIdx, endYIdx;
-  startXIdx = gridGraph.getMazeXIdx(xl(region));
-  endXIdx = gridGraph.getMazeXIdx(xh(region));
-  startYIdx = gridGraph.getMazeYIdx(yl(region));
-  endYIdx = gridGraph.getMazeYIdx(yh(region));
-  frMIdx xDim, yDim, zDim;
-  gridGraph.getDim(xDim,yDim,zDim);
-  xDim -= 1;
-  yDim -= 1;
-  zDim -= 1;
-  for (auto currXIdx = startXIdx; currXIdx < min(endXIdx, xDim); ++currXIdx) {
-    for (auto currYIdx = startYIdx; currYIdx < min(endYIdx, yDim); ++currYIdx) {
-      costGrids.insert(make_pair(currXIdx, currYIdx));
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost_connFig() {
-  int cnt = 0;
-  for (auto &net: nets) {
-    for (auto &connFig: net->getExtConnFigs()) {
-      if (TEST) {
-        cout <<"  initMazeCost_connFig " <<net->getFrNet()->getName() <<" extConnFigs";
-      }
-      addPathCost(connFig.get());
-      cnt++;
-    }
-    for (auto &connFig: net->getRouteConnFigs()) {
-      if (TEST) {
-        cout <<"  initMazeCost_connFig " <<net->getFrNet()->getName() <<" routeConnFigs";
-      }
-      addPathCost(connFig.get());
-      cnt++;
-    }
-  }
-  //cout <<"init " <<cnt <<" connfig costs" <<endl;
-}
-
-void FlexDRWorker::initMazeCost_via_helper(drNet* net, bool isAddPathCost) {
-  unique_ptr<drVia> via = nullptr;
-  frPoint bp;
-  for (auto &pin: net->getPins()) {
-    if (pin->getFrTerm() == nullptr) {
-      continue;
-    }
-    for (auto &ap: pin->getAccessPatterns()) {
-      if (!ap->hasAccessViaDef(frDirEnum::U)) {
-        continue;
-      }
-      ap->getPoint(bp);
-      auto lNum = ap->getBeginLayerNum();
-      frViaDef* viaDef = ap->getAccessViaDef();
-      via = make_unique<drVia>(viaDef);
-      via->setOrigin(bp);
-      via->addToNet(net);
-      initMazeIdx_connFig(via.get());
-      FlexMazeIdx bi, ei;
-      via->getMazeIdx(bi, ei);
-      if (TEST) {
-        cout <<"  initMazeCost_via_helper @(" 
-             <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-             <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") "
-             <<getTech()->getLayer(lNum)->getName() <<" " 
-             <<net->getFrNet()->getName() <<" " <<via->getViaDef()->getName();
-      }
-      if (isAddPathCost) {
-        addPathCost(via.get());
-      } else {
-        subPathCost(via.get());
-      }
-
-      //break;
-
-      // only reserve upper layer metal, but not via
-      //if (ap->hasValidAccess(frDirEnum::U) && 
-      //    lNum + 2 <= getTech()->getTopLayerNum()) {
-      //  //ap->getPoint(bp);
-      //  //auto lNum = ap->getBeginLayerNum() + 2;
-      //  drPathSeg currPathSeg;
-      //  currPathSeg.setPoints(bp, bp);
-      //  currPathSeg.setLayerNum(lNum + 2);
-      //  currPathSeg.addToNet(net);
-      //  currPathSeg.setStyle(getTech()->getLayer(lNum + 2)->getDefaultSegStyle());
-      //  initMazeIdx_connFig(&currPathSeg);
-      //  FlexMazeIdx bi, ei;
-      //  currPathSeg.getMazeIdx(bi, ei);
-      //  if (TEST) {
-      //    cout <<"  initMazeCost_via_helper @(" 
-      //         <<bp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-      //         <<bp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") "
-      //         <<getTech()->getLayer(lNum + 2)->getName() <<" " 
-      //         <<net->getFrNet()->getName();
-      //  }
-      //  frBox box;
-      //  currPathSeg.getBBox(box);
-      //  if (isAddPathCost) {
-      //    modMinSpacingCostPlaner(net, box, bi.z(), isAddPathCost);
-      //  } else {
-      //    modMinSpacingCostPlaner(net, box, bi.z(), isAddPathCost);
-      //  }
-      //}
-
-
-    }
-  }
-}
-
-void FlexDRWorker::initMazeCost_boundary_helper(drNet* net, bool isAddPathCost) {
-  // do not check same-net rules between ext and route objs to avoid pessimism
-  for (auto &connFig: net->getExtConnFigs()) {
-    if (TEST) {
-      cout <<"  initMazeCost_boundary_helper " <<net->getFrNet()->getName();
-    }
-    if (isAddPathCost) {
-      addPathCost(connFig.get());
-    } else {
-      subPathCost(connFig.get());
-    }
-    //if (connFig->typeId() == drcPathSeg) {
-    //  auto obj = static_cast<drPathSeg*>(connFig.get());
-    //  frPoint bp, ep;
-    //  obj->getPoints(bp, ep);
-    //  auto &box = getRouteBox();
-    //  frCoord dxbp = max(max(box.left()   - bp.x(), bp.x() - box.right()), 0);
-    //  frCoord dybp = max(max(box.bottom() - bp.y(), bp.y() - box.top()),   0);
-    //  frCoord dxep = max(max(box.left()   - ep.x(), ep.x() - box.right()), 0);
-    //  frCoord dyep = max(max(box.bottom() - ep.y(), ep.y() - box.top()),   0);
-    //  // boundary segment as if it does not exist
-    //  if (dxbp + dybp == 0 || dxep + dyep == 0) {
-    //    if (TEST) {
-    //      cout <<"  initMazeCost_boundary_helper true bound dist(bp, ep) = (" 
-    //           <<dxbp <<", " <<dybp <<") (" 
-    //           <<dxep <<", " <<dyep <<") "
-    //           <<net->getFrNet()->getName();
-    //    }
-    //    if (isAddPathCost) {
-    //      addPathCost(obj);
-    //    } else {
-    //      subPathCost(obj);
-    //    }
-    //  } else {
-    //    if (TEST) {
-    //      FlexMazeIdx bi, ei;
-    //      obj->getMazeIdx(bi, ei);
-    //      cout <<"  initMazeCost_boundary_helper true bound not entered dist(bp, ep) = (" 
-    //           <<dxbp <<", " <<dybp <<") (" 
-    //           <<dxep <<", " <<dyep <<") "
-    //           <<net->getFrNet()->getName() <<" "
-    //           <<bi <<" -- " <<ei <<endl;
-    //    }
-    //  }
-    // via as if same-net metal spacing does not exist,
-    // e.g., via eol on metal layer may be false because metal is connected
-    //   --> DRC engine to add cost if true eol 
-    // currently prl and tw are also included to avoid pessimistism
-    // after adding via spacing rule, addPathCost should add an argument to allow only metal rules
-    // via spacing should still be applied
-    //} else if (connFig->typeId() == drcVia) {
-    //  auto obj = static_cast<drVia*>(connFig.get());
-    //  if (TEST) {
-    //    cout <<"  initMazeCost_boundary_helper false bound " <<net->getFrNet()->getName();
-    //  }
-    //  if (isAddPathCost) {
-    //    addPathCost(obj);
-    //  } else {
-    //    subPathCost(obj);
-    //  }
-    //}
-  }
-}
-
-void FlexDRWorker::initFixedObjs() {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  double dbu = getTech()->getDBUPerUU();
-  auto &drcBox = getRouteBox();
-  if (enableOutput) {
-    cout << "  DRC (" << drcBox.left() / dbu << ", " << drcBox.bottom() / dbu
-         << ") -- (" << drcBox.right() / dbu << ", " << drcBox.top() / dbu << "):\n";
-  }
-  box_t queryBox(point_t(drcBox.left(), drcBox.bottom()), point_t(drcBox.right(), drcBox.top()));
-  set<frBlockObject*> drcObjSet;
-  // fixed obj
-  for (auto layerNum = getDesign()->getTech()->getBottomLayerNum(); 
-       layerNum <= design->getTech()->getTopLayerNum(); ++layerNum) {
-    auto regionQuery = getDesign()->getRegionQuery();
-    vector<rq_rptr_value_t<frBlockObject> > queryResult;
-    regionQuery->query(queryBox, layerNum, queryResult);
-    for (auto &objPair: queryResult) {
-      drcObjSet.insert(objPair.second);
-    }
-  }
-  for (auto drcObj:drcObjSet) {
-    fixedObjs.push_back(drcObj);
-  }
-  if (enableOutput) {
-    cout << "#fixed obj = " << fixedObjs.size() << "\n";
-  }
-}
-
-void FlexDRWorker::initMarkers() {
-  vector<frMarker*> result;
-  getRegionQuery()->queryMarker(getRouteBox(), result);
-  for (auto mptr: result) {
-    markers.push_back(*mptr);
-  }
-  setInitNumMarkers(getNumMarkers());
-}
-
-void FlexDRWorker::init() {
-  // if initDR
-  //   get all instterm/term for each net
-  // else
-  //   1. get all insterm/term based on begin/end of pathseg, via
-  //   2. union and find
-  //
-  //using namespace std::chrono;
-  initMarkers();
-  if (isEnableDRC() && getRipupMode() == 0 && getInitNumMarkers() == 0) {
-    return;
-  }
-  initFixedObjs();
-  //high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  initNets();
-  //high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  initGridGraph();
-  //high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  initMazeIdx();
-  //high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  initMazeCost();
-  //high_resolution_clock::time_point t4 = high_resolution_clock::now();
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_maze.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_maze.cpp
deleted file mode 100644
index 290e3e3..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_maze.cpp
+++ /dev/null
@@ -1,1758 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexDR.h"
-#include "drc/frDRC.h"
-#include <chrono>
-
-using namespace std;
-using namespace fr;
-
-inline frCoord FlexDRWorker::pt2boxDistSquare(const frPoint &pt, const frBox &box) {
-  frCoord dx = max(max(box.left()   - pt.x(), pt.x() - box.right()), 0);
-  frCoord dy = max(max(box.bottom() - pt.y(), pt.y() - box.top()),   0);
-  return dx * dx + dy * dy;
-}
-
-inline frCoord FlexDRWorker::box2boxDistSquare(const frBox &box1, const frBox &box2, frCoord &dx, frCoord &dy) {
-  dx = max(max(box1.left(), box2.left())     - min(box1.right(), box2.right()), 0);
-  dy = max(max(box1.bottom(), box2.bottom()) - min(box1.top(), box2.top()),     0);
-  return dx * dx + dy * dy;
-}
-
-
-/*inline*/ void FlexDRWorker::modMinSpacingCostPlaner(drNet* net, const frBox &box, frMIdx z, bool isAddPathCost) {
-  auto lNum = gridGraph.getLayerNum(z);
-  // obj1 = curr obj
-  frCoord width1  = box.width();
-  frCoord length1 = box.length();
-  // obj2 = other obj
-  // layer default width
-  frCoord width2     = getDesign()->getTech()->getLayer(lNum)->getWidth();
-  frCoord halfwidth2 = width2 / 2;
-  // spacing value needed
-  frCoord bloatDist = 0;
-  auto con = getDesign()->getTech()->getLayer(lNum)->getMinSpacing();
-  if (con) {
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      bloatDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      bloatDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), length1);
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      bloatDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, length1);
-    } else {
-      cout <<"Warning: min spacing rule not supporterd" <<endl;
-      return;
-    }
-  } else {
-    cout <<"Warning: no min spacing rule" <<endl;
-    return;
-  }
-  frCoord bloatDistSquare = bloatDist * bloatDist;
-
-  FlexMazeIdx mIdx1;
-  FlexMazeIdx mIdx2;
-  // assumes width always > 2
-  frBox bx(box.left()   - bloatDist - halfwidth2 + 1, box.bottom() - bloatDist - halfwidth2 + 1,
-           box.right()  + bloatDist + halfwidth2 - 1, box.top()    + bloatDist + halfwidth2 - 1);
-  gridGraph.getIdxBox(mIdx1, mIdx2, bx);
-  //if (!isInitDR()) {
-  //  cout <<" box " <<box <<" bloatDist " <<bloatDist <<" bx " <<bx <<endl;
-  //  cout <<" midx1/2 (" <<mIdx1.x() <<", " <<mIdx1.y() <<") ("
-  //                      <<mIdx2.x() <<", " <<mIdx2.y() <<") (" <<endl;
-  //}
-
-  frPoint pt, pt1, pt2, pt3, pt4;
-  frCoord distSquare = 0;
-  int cnt = 0;
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      gridGraph.getPoint(pt, i, j);
-      pt1.set(pt.x() + halfwidth2, pt.y() - halfwidth2);
-      pt2.set(pt.x() + halfwidth2, pt.y() + halfwidth2);
-      pt3.set(pt.x() - halfwidth2, pt.y() - halfwidth2);
-      pt4.set(pt.x() - halfwidth2, pt.y() + halfwidth2);
-      distSquare = min(pt2boxDistSquare(pt1, box), pt2boxDistSquare(pt2, box));
-      distSquare = min(pt2boxDistSquare(pt3, box), distSquare);
-      distSquare = min(pt2boxDistSquare(pt4, box), distSquare);
-      if (distSquare < bloatDistSquare) {
-        if (isAddPathCost) {
-          gridGraph.addDRCCostPlanar(i, j, z); // safe access
-        } else {
-          gridGraph.subDRCCostPlanar(i, j, z); // safe access
-        }
-        if (TEST) {
-          cout <<"    (" <<i <<", " <<j <<", " <<z <<") minSpc planer" <<endl;
-        }
-        cnt++;
-        //if (!isInitDR()) {
-        //  cout <<" planer find viol mIdx (" <<i <<", " <<j <<") " <<pt <<endl;
-        //}
-      }
-    }
-  }
-  //cout <<"planer mod " <<cnt <<" edges" <<endl;
-}
-
-
-/*inline*/ void FlexDRWorker::modMinSpacingCost(drNet* net, const frBox &box, frMIdx z, bool isAddPathCost, bool isCurrPs) {
-  auto lNum = gridGraph.getLayerNum(z);
-  // obj1 = curr obj
-  frCoord width1  = box.width();
-  frCoord length1 = box.length();
-  // obj2 planar = other obj
-  // layer default width
-  frCoord width2planar     = getDesign()->getTech()->getLayer(lNum)->getWidth();
-  frCoord halfwidth2planar = width2planar / 2;
-  // obj2 viaL = other obj
-  frViaDef* viaDefL = (lNum > getDesign()->getTech()->getBottomLayerNum()) ? 
-                      getDesign()->getTech()->getLayer(lNum-1)->getDefaultViaDef() : 
-                      nullptr;
-  frVia viaL(viaDefL);
-  frBox viaBoxL(0,0,0,0);
-  if (viaDefL) {
-    viaL.getLayer2BBox(viaBoxL);
-  }
-  frCoord width2viaL  = viaBoxL.width();
-  frCoord length2viaL = viaBoxL.length();
-  // obj2 viaU = other obj
-  frViaDef* viaDefU = (lNum < getDesign()->getTech()->getTopLayerNum()) ? 
-                      getDesign()->getTech()->getLayer(lNum+1)->getDefaultViaDef() : 
-                      nullptr;
-  frVia viaU(viaDefU);
-  frBox viaBoxU(0,0,0,0);
-  if (viaDefU) {
-    viaU.getLayer1BBox(viaBoxU);
-  }
-  frCoord width2viaU  = viaBoxU.width();
-  frCoord length2viaU = viaBoxU.length();
-
-  // spacing value needed
-  frCoord bloatDistPlanar = 0;
-  frCoord bloatDistViaL   = 0;
-  frCoord bloatDistViaU   = 0;
-  auto con = getDesign()->getTech()->getLayer(lNum)->getMinSpacing();
-  if (con) {
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      bloatDistPlanar = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-      bloatDistViaL   = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-      bloatDistViaU   = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      bloatDistPlanar = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2planar), length1);
-      bloatDistViaL   = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2viaL), isCurrPs ? length2viaL : min(length1, length2viaL));
-      bloatDistViaU   = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2viaU), isCurrPs ? length2viaU : min(length1, length2viaU));
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      bloatDistPlanar = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2planar, length1);
-      bloatDistViaL   = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2viaL, isCurrPs ? length2viaL : min(length1, length2viaL));
-      bloatDistViaU   = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2viaU, isCurrPs ? length2viaU : min(length1, length2viaU));
-    } else {
-      cout <<"Warning: min spacing rule not supporterd" <<endl;
-      return;
-    }
-  } else {
-    cout <<"Warning: no min spacing rule" <<endl;
-    return;
-  }
-
-  // other obj eol spc to curr obj
-  // no need to bloat eolWithin because eolWithin always < minSpacing
-  frCoord bloatDistEolX = 0;
-  frCoord bloatDistEolY = 0;
-  for (auto con: getDesign()->getTech()->getLayer(lNum)->getEolSpacing()) {
-    auto eolSpace  = con->getMinSpacing();
-    auto eolWidth  = con->getEolWidth();
-    // eol up and down
-    if (viaDefL && viaBoxL.right() - viaBoxL.left() < eolWidth) {
-      bloatDistEolY = max(bloatDistEolY, eolSpace);
-    } 
-    if (viaDefU && viaBoxU.right() - viaBoxU.left() < eolWidth) {
-      bloatDistEolY = max(bloatDistEolY, eolSpace);
-    } 
-    // eol left and right
-    if (viaDefL && viaBoxL.top() - viaBoxL.bottom() < eolWidth) {
-      bloatDistEolX = max(bloatDistEolX, eolSpace);
-    }
-    if (viaDefU && viaBoxU.top() - viaBoxU.bottom() < eolWidth) {
-      bloatDistEolX = max(bloatDistEolX, eolSpace);
-    }
-  }
-
-  frCoord bloatDist = max(max(bloatDistPlanar, bloatDistViaL), bloatDistViaU);
-  //frCoord bloatDistSquare = bloatDist * bloatDist;
-
-  FlexMazeIdx mIdx1;
-  FlexMazeIdx mIdx2;
-  // assumes width always > 2
-  frBox bx(box.left()   - max(bloatDist, bloatDistEolX) - max(max(halfwidth2planar, viaBoxL.right() ), viaBoxU.right() ) + 1, 
-           box.bottom() - max(bloatDist, bloatDistEolY) - max(max(halfwidth2planar, viaBoxL.top()   ), viaBoxU.top()   ) + 1,
-           box.right()  + max(bloatDist, bloatDistEolX) + max(max(halfwidth2planar, viaBoxL.left()  ), viaBoxU.left()  ) - 1, 
-           box.top()    + max(bloatDist, bloatDistEolY) + max(max(halfwidth2planar, viaBoxL.bottom()), viaBoxU.bottom()) - 1);
-  gridGraph.getIdxBox(mIdx1, mIdx2, bx);
-  //if (!isInitDR()) {
-  //  cout <<" box " <<box <<" bloatDist " <<bloatDist <<" bx " <<bx <<endl;
-  //  cout <<" midx1/2 (" <<mIdx1.x() <<", " <<mIdx1.y() <<") ("
-  //                      <<mIdx2.x() <<", " <<mIdx2.y() <<") (" <<endl;
-  //}
-
-  frPoint pt;
-  frBox tmpBx;
-  frCoord dx, dy, prl;
-  frTransform xform;
-  frCoord reqDist = 0;
-  frCoord distSquare = 0;
-  int cnt = 0;
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      gridGraph.getPoint(pt, i, j);
-      xform.set(pt);
-      // planar
-      tmpBx.set(pt.x() - halfwidth2planar, pt.y() - halfwidth2planar,
-                pt.x() + halfwidth2planar, pt.y() + halfwidth2planar);
-      distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-      prl = max(dx, dy);
-      if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-        reqDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-      } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-        reqDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2planar), prl > 0 ? length1 : 0);
-      } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-        reqDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2planar, prl > 0 ? length1 : 0);
-      }
-      if (distSquare < reqDist * reqDist) {
-        if (isAddPathCost) {
-          gridGraph.addDRCCostPlanar(i, j, z); // safe access
-        } else {
-          gridGraph.subDRCCostPlanar(i, j, z); // safe access
-        }
-        if (TEST) {
-          cout <<"    (" <<i <<", " <<j <<", " <<z <<") minSpc planer" <<endl;
-        }
-        cnt++;
-      }
-      // viaL
-      if (viaDefL) {
-        tmpBx.set(viaBoxL);
-        tmpBx.transform(xform);
-        distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-        prl = max(dx, dy);
-        // curr is ps
-        if (isCurrPs) {
-          if (dx == 0 && dy > 0) {
-            prl = viaBoxL.right() - viaBoxL.left();
-          } else if (dx > 0 && dy == 0) {
-            prl = viaBoxL.top() - viaBoxL.bottom();
-          }
-        }
-        if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-          reqDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-        } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-          reqDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2viaL), prl);
-        } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-          reqDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2viaL, prl);
-        }
-        if (distSquare < reqDist * reqDist) {
-          if (isAddPathCost) {
-            gridGraph.addDRCCostVia(i, j, z - 1);
-          } else {
-            gridGraph.subDRCCostVia(i, j, z - 1);
-          }
-          if (TEST) {
-            cout <<"    (" <<i <<", " <<j <<", " <<z - 1 <<") U minSpc via" <<endl;
-          }
-        } else {
-          modMinSpacingCostVia_eol(box, tmpBx, isAddPathCost, false, i, j, z);
-        }
-        //modMinSpacingCostVia_eol(box, tmpBx, isAddPathCost, false, i, j, z);
-      }
-      if (viaDefU) {
-        tmpBx.set(viaBoxU);
-        tmpBx.transform(xform);
-        distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-        prl = max(dx, dy);
-        // curr is ps
-        if (isCurrPs) {
-          if (dx == 0 && dy > 0) {
-            prl = viaBoxU.right() - viaBoxU.left();
-          } else if (dx > 0 && dy == 0) {
-            prl = viaBoxU.top() - viaBoxU.bottom();
-          }
-        }
-        if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-          reqDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-        } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-          reqDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2viaU), prl);
-        } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-          reqDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2viaU, prl);
-        }
-        if (distSquare < reqDist * reqDist) {
-          if (isAddPathCost) {
-            gridGraph.addDRCCostVia(i, j, z);
-          } else {
-            gridGraph.subDRCCostVia(i, j, z);
-          }
-          if (TEST) {
-            cout <<"    (" <<i <<", " <<j <<", " <<z <<") U minSpc via" <<endl;
-          }
-        } else {
-          modMinSpacingCostVia_eol(box, tmpBx, isAddPathCost, true, i, j, z);
-        }
-        //modMinSpacingCostVia_eol(box, tmpBx, isAddPathCost, true, i, j, z);
-      }
-    }
-  }
-  //cout <<"planer mod " <<cnt <<" edges" <<endl;
-}
-
-/*inline*/ void FlexDRWorker::modMinSpacingCostVia_eol_helper(const frBox &box, const frBox &testBox, bool isAddPathCost, bool isUpperVia,
-                                                          frMIdx i, frMIdx j, frMIdx z) {
-  if (testBox.overlaps(box, false)) {
-    if (isUpperVia) {
-      if (isAddPathCost) {
-        gridGraph.addDRCCostVia(i, j, z);
-      } else {
-        gridGraph.subDRCCostVia(i, j, z);
-      }
-      if (TEST) {
-        cout <<"    (" <<i <<", " <<j <<", " <<z <<") U minSpc eol helper" <<endl;
-      }
-    } else {
-      if (isAddPathCost) {
-        gridGraph.addDRCCostVia(i, j, z - 1);
-      } else {
-        gridGraph.subDRCCostVia(i, j, z - 1);
-      }
-      if (TEST) {
-        cout <<"    (" <<i <<", " <<j <<", " <<z - 1 <<") U minSpc eol helper" <<endl;
-      }
-    }
-  }
-}
-
-/*inline*/ void FlexDRWorker::modMinSpacingCostVia_eol(const frBox &box, const frBox &tmpBx, bool isAddPathCost, bool isUpperVia,
-                                                   frMIdx i, frMIdx j, frMIdx z) {
-  auto lNum = gridGraph.getLayerNum(z);
-  frBox testBox;
-  if (getDesign()->getTech()->getLayer(lNum)->hasEolSpacing()) {
-    for (auto eolCon: getDesign()->getTech()->getLayer(lNum)->getEolSpacing()) {
-      auto eolSpace  = eolCon->getMinSpacing();
-      auto eolWidth  = eolCon->getEolWidth();
-      auto eolWithin = eolCon->getEolWithin();
-      // eol to up and down
-      if (tmpBx.right() - tmpBx.left() < eolWidth) {
-        testBox.set(tmpBx.left() - eolWithin, tmpBx.top(),               tmpBx.right() + eolWithin, tmpBx.top() + eolSpace);
-        modMinSpacingCostVia_eol_helper(box, testBox, isAddPathCost, isUpperVia, i, j, z);
-
-        testBox.set(tmpBx.left() - eolWithin, tmpBx.bottom() - eolSpace, tmpBx.right() + eolWithin, tmpBx.bottom());
-        modMinSpacingCostVia_eol_helper(box, testBox, isAddPathCost, isUpperVia, i, j, z);
-      }
-      // eol to left and right
-      if (tmpBx.top() - tmpBx.bottom() < eolWidth) {
-        testBox.set(tmpBx.right(),           tmpBx.bottom() - eolWithin, tmpBx.right() + eolSpace, tmpBx.top() + eolWithin);
-        modMinSpacingCostVia_eol_helper(box, testBox, isAddPathCost, isUpperVia, i, j, z);
-
-        testBox.set(tmpBx.left() - eolSpace, tmpBx.bottom() - eolWithin, tmpBx.left(),             tmpBx.top() + eolWithin);
-        modMinSpacingCostVia_eol_helper(box, testBox, isAddPathCost, isUpperVia, i, j, z);
-      }
-    }
-  }
-}
-
-
-void FlexDRWorker::modMinSpacingCostVia(const frBox &box, frMIdx z, bool isAddPathCost, bool isUpperVia, bool isCurrPs) {
-  auto lNum = gridGraph.getLayerNum(z);
-  // obj1 = curr obj
-  frCoord width1  = box.width();
-  frCoord length1 = box.length();
-  // obj2 = other obj
-  // default via dimension
-  frViaDef* viaDef = nullptr;
-  if (isUpperVia) {
-    viaDef = (lNum < getDesign()->getTech()->getTopLayerNum()) ? 
-             getDesign()->getTech()->getLayer(lNum+1)->getDefaultViaDef() : 
-             nullptr;
-  } else {
-    viaDef = (lNum > getDesign()->getTech()->getBottomLayerNum()) ? 
-             getDesign()->getTech()->getLayer(lNum-1)->getDefaultViaDef() : 
-             nullptr;
-  }
-  if (viaDef == nullptr) {
-    return;
-  }
-  frVia via(viaDef);
-  frBox viaBox(0,0,0,0);
-  if (isUpperVia) {
-    via.getLayer1BBox(viaBox);
-  } else {
-    via.getLayer2BBox(viaBox);
-  }
-  frCoord width2  = viaBox.width();
-  frCoord length2 = viaBox.length();
-
-  // spacing value needed
-  frCoord bloatDist = 0;
-  auto con = getDesign()->getTech()->getLayer(lNum)->getMinSpacing();
-  if (con) {
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      bloatDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      bloatDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), isCurrPs ? length2 : min(length1, length2));
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      bloatDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, isCurrPs ? length2 : min(length1, length2));
-    } else {
-      cout <<"Warning: min spacing rule not supporterd" <<endl;
-      return;
-    }
-  } else {
-    cout <<"Warning: no min spacing rule" <<endl;
-    return;
-  }
-  // other obj eol spc to curr obj
-  // no need to blaot eolWithin because eolWithin always < minSpacing
-  frCoord bloatDistEolX = 0;
-  frCoord bloatDistEolY = 0;
-  for (auto con: getDesign()->getTech()->getLayer(lNum)->getEolSpacing()) {
-    auto eolSpace  = con->getMinSpacing();
-    auto eolWidth  = con->getEolWidth();
-    // eol up and down
-    if (viaBox.right() - viaBox.left() < eolWidth) {
-      bloatDistEolY = max(bloatDistEolY, eolSpace);
-    } 
-    // eol left and right
-    if (viaBox.top() - viaBox.bottom() < eolWidth) {
-      bloatDistEolX = max(bloatDistEolX, eolSpace);
-    }
-  }
-  //frCoord bloatDistSquare = bloatDist * bloatDist;
-  
-  FlexMazeIdx mIdx1;
-  FlexMazeIdx mIdx2;
-  // assumes width always > 2
-  frBox bx(box.left()   - max(bloatDist, bloatDistEolX) - (viaBox.right() - 0) + 1, 
-             box.bottom() - max(bloatDist, bloatDistEolY) - (viaBox.top() - 0) + 1,
-           box.right()  + max(bloatDist, bloatDistEolX) + (0 - viaBox.left())  - 1, 
-             box.top()    + max(bloatDist, bloatDistEolY) + (0 - viaBox.bottom()) - 1);
-  gridGraph.getIdxBox(mIdx1, mIdx2, bx);
-
-  frPoint pt;
-  frBox tmpBx;
-  frCoord distSquare = 0;
-  frCoord dx, dy, prl;
-  frTransform xform;
-  frCoord reqDist = 0;
-  frBox sViaBox;
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      gridGraph.getPoint(pt, i, j);
-      xform.set(pt);
-      //if (gridGraph.isSVia(i, j, isUpperVia ? z : z - 1)) {
-        //auto sViaDef= apSVia[FlexMazeIdx(i, j, isUpperVia ? z : z - 1)];
-        //frVia sVia(sViaDef);
-        //if (isUpperVia) {
-        //  sVia.getLayer1BBox(sViaBox);
-        //} else {
-        //  sVia.getLayer2BBox(sViaBox);
-        //}
-        //tmpBx.set(sViaBox);
-        //continue;
-      //}
-      tmpBx.set(viaBox);
-      tmpBx.transform(xform);
-      distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-      prl = max(dx, dy);
-      // curr is ps
-      if (isCurrPs) {
-        if (dx == 0 && dy > 0) {
-          prl = viaBox.right() - viaBox.left();
-        } else if (dx > 0 && dy == 0) {
-          prl = viaBox.top() - viaBox.bottom();
-        }
-      }
-      if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-        reqDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-      } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-        reqDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), prl);
-      } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-        reqDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, prl);
-      }
-      if (distSquare < reqDist * reqDist) {
-        if (isUpperVia) {
-          if (isAddPathCost) {
-            gridGraph.addDRCCostVia(i, j, z);
-          } else {
-            gridGraph.subDRCCostVia(i, j, z);
-          }
-          if (TEST) {
-            cout <<"    (" <<i <<", " <<j <<", " <<z <<") U minSpc via" <<endl;
-          }
-        } else {
-          if (isAddPathCost) {
-            gridGraph.addDRCCostVia(i, j, z - 1);
-          } else {
-            gridGraph.subDRCCostVia(i, j, z - 1);
-          }
-          if (TEST) {
-            cout <<"    (" <<i <<", " <<j <<", " <<z - 1 <<") U minSpc via" <<endl;
-          }
-        }
-      }
-      // eol, other obj to curr obj
-      modMinSpacingCostVia_eol(box, tmpBx, isAddPathCost, isUpperVia, i, j, z);
-    }
-  }
-
-}
-
-
-// type == 0: planer
-// type == 1: down
-// type == 2: up
-/*inline*/ void FlexDRWorker::modEolSpacingCost_helper(const frBox &testbox, frMIdx z, bool isAddPathCost, int type) {
-  auto lNum = gridGraph.getLayerNum(z);
-  frBox bx;
-  if (type == 0) {
-    // layer default width
-    frCoord width2     = getDesign()->getTech()->getLayer(lNum)->getWidth();
-    frCoord halfwidth2 = width2 / 2;
-    // assumes width always > 2
-    bx.set(testbox.left()   - halfwidth2 + 1, testbox.bottom() - halfwidth2 + 1,
-           testbox.right()  + halfwidth2 - 1, testbox.top()    + halfwidth2 - 1);
-  } else {
-    // default via dimension
-    frViaDef* viaDef = nullptr;
-    if (type == 1) {
-      viaDef = (lNum > getDesign()->getTech()->getBottomLayerNum()) ? 
-               getDesign()->getTech()->getLayer(lNum-1)->getDefaultViaDef() : 
-               nullptr;
-    } else if (type == 2) {
-      viaDef = (lNum < getDesign()->getTech()->getTopLayerNum()) ? 
-               getDesign()->getTech()->getLayer(lNum+1)->getDefaultViaDef() : 
-               nullptr;
-    }
-    if (viaDef == nullptr) {
-      return;
-    }
-    frVia via(viaDef);
-    frBox viaBox(0,0,0,0);
-    if (type == 2) { // upper via
-      via.getLayer1BBox(viaBox);
-    } else {
-      via.getLayer2BBox(viaBox);
-    }
-    // assumes via bbox always > 2
-    bx.set(testbox.left()  - (viaBox.right() - 0) + 1, testbox.bottom() - (viaBox.top() - 0) + 1,
-           testbox.right() + (0 - viaBox.left())  - 1, testbox.top()    + (0 - viaBox.bottom()) - 1);
-  }
-
-  FlexMazeIdx mIdx1;
-  FlexMazeIdx mIdx2;
-  gridGraph.getIdxBox(mIdx1, mIdx2, bx); // >= bx
-  
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      if (type == 0) {
-        if (isAddPathCost) {
-          gridGraph.addDRCCostPlanar(i, j, z); // safe access
-        } else {
-          gridGraph.subDRCCostPlanar(i, j, z); // safe access
-        }
-        if (TEST) {
-          cout <<"    (" <<i <<", " <<j <<", " <<z <<") N eolSpc" <<endl;
-        }
-      } else if (type == 1) {
-        //if (gridGraph.isSVia(i, j, z - 1)) {
-        //  continue;
-        //}
-        if (isAddPathCost) {
-          gridGraph.addDRCCostVia(i, j, z - 1); // safe access
-        } else {
-          gridGraph.subDRCCostVia(i, j, z - 1); // safe access
-        }
-        if (TEST) {
-          cout <<"    (" <<i <<", " <<j <<", " <<z - 1 <<") U eolSpc" <<endl;
-        }
-      } else if (type == 2) {
-        //if (gridGraph.isSVia(i, j, z)) {
-        //  continue;
-        //}
-        if (isAddPathCost) {
-          gridGraph.addDRCCostVia(i, j, z); // safe access
-        } else {
-          gridGraph.subDRCCostVia(i, j, z); // safe access
-        }
-        if (TEST) {
-          cout <<"    (" <<i <<", " <<j <<", " <<z <<") U eolSpc" <<endl;
-        }
-      }
-    }
-  }
-}
-
-/*inline*/ void FlexDRWorker::modEolSpacingCost(const frBox &box, frMIdx z, bool isAddPathCost) {
-  auto lNum = gridGraph.getLayerNum(z);
-  frBox testBox;
-  if (getDesign()->getTech()->getLayer(lNum)->hasEolSpacing()) {
-    for (auto con: getDesign()->getTech()->getLayer(lNum)->getEolSpacing()) {
-      auto eolSpace  = con->getMinSpacing();
-      auto eolWidth  = con->getEolWidth();
-      auto eolWithin = con->getEolWithin();
-      // curr obj to other obj eol
-      //if (!isInitDR()) {
-      //  cout <<"eolSpace/within = " <<eolSpace <<" " <<eolWithin <<endl;
-      //}
-      // eol to up and down
-      if (box.right() - box.left() < eolWidth) {
-        testBox.set(box.left() - eolWithin, box.top(),               box.right() + eolWithin, box.top() + eolSpace);
-        //if (!isInitDR()) {
-        //  cout <<"  topBox " <<testBox <<endl;
-        //}
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 0);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 1);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 2);
-        testBox.set(box.left() - eolWithin, box.bottom() - eolSpace, box.right() + eolWithin, box.bottom());
-        //if (!isInitDR()) {
-        //  cout <<"  bottomBox " <<testBox <<endl;
-        //}
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 0);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 1);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 2);
-      }
-      // eol to left and right
-      if (box.top() - box.bottom() < eolWidth) {
-        testBox.set(box.right(),           box.bottom() - eolWithin, box.right() + eolSpace, box.top() + eolWithin);
-        //if (!isInitDR()) {
-        //  cout <<"  rightBox " <<testBox <<endl;
-        //}
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 0);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 1);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 2);
-        testBox.set(box.left() - eolSpace, box.bottom() - eolWithin, box.left(),             box.top() + eolWithin);
-        //if (!isInitDR()) {
-        //  cout <<"  leftBox " <<testBox <<endl;
-        //}
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 0);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 1);
-        modEolSpacingCost_helper(testBox, z, isAddPathCost, 2);
-      }
-      // other obj to curr obj eol
-    }
-  }
-}
-
-/*inline*/ void FlexDRWorker::modCutSpacingCost(const frBox &box, frMIdx z, bool isAddPathCost) {
-  auto lNum = gridGraph.getLayerNum(z) + 1;
-  if (!getDesign()->getTech()->getLayer(lNum)->hasCutSpacing()) {
-    return;
-  }
-  // obj1 = curr obj
-  // obj2 = other obj
-  // default via dimension
-  frViaDef* viaDef = getDesign()->getTech()->getLayer(lNum)->getDefaultViaDef();
-  frVia via(viaDef);
-  frBox viaBox(0,0,0,0);
-  via.getCutBBox(viaBox);
-
-  // spacing value needed
-  frCoord bloatDist = 0;
-  for (auto con: getDesign()->getTech()->getLayer(lNum)->getCutSpacing()) {
-    bloatDist = max(bloatDist, con->getCutSpacing());
-  }
-  //frCoord bloatDistSquare = bloatDist * bloatDist;
-  
-  FlexMazeIdx mIdx1;
-  FlexMazeIdx mIdx2;
-  // assumes width always > 2
-  frBox bx(box.left()   - bloatDist - (viaBox.right() - 0) + 1, 
-           box.bottom() - bloatDist - (viaBox.top() - 0) + 1,
-           box.right()  + bloatDist + (0 - viaBox.left())  - 1, 
-           box.top()    + bloatDist + (0 - viaBox.bottom()) - 1);
-  gridGraph.getIdxBox(mIdx1, mIdx2, bx);
-
-  frPoint pt;
-  frBox tmpBx;
-  frCoord distSquare = 0;
-  frCoord c2cSquare = 0;
-  frCoord dx, dy, prl;
-  frTransform xform;
-  //frCoord reqDist = 0;
-  frCoord reqDistSquare = 0;
-  frPoint boxCenter, tmpBxCenter;
-  boxCenter.set((box.left() + box.right()) / 2, (box.bottom() + box.top()) / 2);
-  frCoord currDistSquare = 0;
-  bool hasViol = false;
-  for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
-    for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
-      for (auto &uFig: via.getViaDef()->getCutFigs()) {
-        auto obj = static_cast<frRect*>(uFig.get());
-        gridGraph.getPoint(pt, i, j);
-        xform.set(pt);
-        obj->getBBox(tmpBx);
-        //tmpBx.set(viaBox);
-        tmpBx.transform(xform);
-        tmpBxCenter.set((tmpBx.left() + tmpBx.right()) / 2, (tmpBx.bottom() + tmpBx.top()) / 2);
-        distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-        c2cSquare = (boxCenter.x() - tmpBxCenter.x()) * (boxCenter.x() - tmpBxCenter.x()) + 
-                    (boxCenter.y() - tmpBxCenter.y()) * (boxCenter.y() - tmpBxCenter.y()); 
-        prl = max(dx, dy);
-        for (auto con: getDesign()->getTech()->getLayer(lNum)->getCutSpacing()) {
-          hasViol = false;
-          //reqDist = con->getCutSpacing();
-          reqDistSquare = con->getCutSpacing() * con->getCutSpacing();
-          currDistSquare = con->hasCenterToCenter() ? c2cSquare : distSquare;
-          if (con->hasSameNet()) {
-            continue;
-          }
-          if (con->isLayer()) {
-            ;
-          } else if (con->isAdjacentCuts()) {
-            if (currDistSquare < reqDistSquare) {
-              hasViol = true;
-              // should disable hasViol and modify this part to new grid graph
-            }
-          } else if (con->isParallelOverlap()) {
-            if (prl > 0 && currDistSquare < reqDistSquare) {
-              hasViol = true;
-            }
-          } else if (con->isArea()) {
-            auto currArea = max(box.length() * box.width(), tmpBx.length() * tmpBx.width());
-            if (currArea >= con->getCutArea() && currDistSquare < reqDistSquare) {
-              hasViol = true;
-            }
-          } else {
-            if (currDistSquare < reqDistSquare) {
-              hasViol = true;
-            }
-          }
-          if (hasViol) {
-            if (isAddPathCost) {
-              gridGraph.addDRCCostVia(i, j, z);
-            } else {
-              gridGraph.subDRCCostVia(i, j, z);
-            }
-            if (TEST) {
-              cout <<"    (" <<i <<", " <<j <<", " <<z <<") U cutSpc" <<endl;
-            }
-            break;
-          }
-        }
-      }
-    }
-  }
-}
-
-void FlexDRWorker::addPathCost(drConnFig *connFig) {
-  modPathCost(connFig, true);
-}
-
-void FlexDRWorker::subPathCost(drConnFig *connFig) {
-  modPathCost(connFig, false);
-}
-
-/*inline*/ void FlexDRWorker::modPathCost(drConnFig *connFig, bool isAddPathCost) {
-  if (connFig->typeId() == drcPathSeg) {
-    auto obj = static_cast<drPathSeg*>(connFig);
-    auto net = obj->getNet();
-    FlexMazeIdx bi, ei;
-    obj->getMazeIdx(bi, ei);
-    if (TEST) {
-      cout <<"  ";
-      if (isAddPathCost) {
-        cout <<"add";
-      } else {
-        cout <<"sub";
-      }
-      cout <<"PsCost for " <<bi <<" -- " <<ei <<endl;
-    }
-    // new 
-    frBox box;
-    obj->getBBox(box);
-    
-    modMinSpacingCostPlaner(net, box, bi.z(), isAddPathCost);
-    modMinSpacingCostVia(box, bi.z(), isAddPathCost, true,  true);
-    modMinSpacingCostVia(box, bi.z(), isAddPathCost, false, true);
-    //modMinSpacingCost(net, box, bi.z(), isAddPathCost, true);
-    modEolSpacingCost(box, bi.z(), isAddPathCost);
-  } else if (connFig->typeId() == drcPatchWire) {
-    auto obj = static_cast<drPatchWire*>(connFig);
-    auto net = obj->getNet();
-    frMIdx zIdx = gridGraph.getMazeZIdx(obj->getLayerNum());
-    // FlexMazeIdx bi, ei;
-    // obj->getMazeIdx(bi, ei);
-    // if (TEST) {
-    //   cout <<"  ";
-    //   if (isAddPathCost) {
-    //     cout <<"add";
-    //   } else {
-    //     cout <<"sub";
-    //   }
-    //   cout <<"PsCost for " <<bi <<" -- " <<ei <<endl;
-    // }
-    // new 
-    frBox box;
-    obj->getBBox(box);
-    
-    modMinSpacingCostPlaner(net, box, zIdx, isAddPathCost);
-    modMinSpacingCostVia(box, zIdx, isAddPathCost, true,  true);
-    modMinSpacingCostVia(box, zIdx, isAddPathCost, false, true);
-    //modMinSpacingCost(net, box, bi.z(), isAddPathCost, true);
-    modEolSpacingCost(box, zIdx, isAddPathCost);
-  } else if (connFig->typeId() == drcVia) {
-    auto obj = static_cast<drVia*>(connFig);
-    auto net = obj->getNet();
-    FlexMazeIdx bi, ei;
-    obj->getMazeIdx(bi, ei);
-    if (TEST) {
-      cout <<"  ";
-      if (isAddPathCost) {
-        cout <<"add";
-      } else {
-        cout <<"sub";
-      }
-      cout <<"ViaCost for " <<bi <<" -- " <<ei <<endl;
-    }
-    // new
-    
-    frBox box;
-    obj->getLayer1BBox(box); // assumes enclosure for via is always rectangle
-
-    modMinSpacingCostPlaner(net, box, bi.z(), isAddPathCost);
-    modMinSpacingCostVia(box, bi.z(), isAddPathCost, true,  false);
-    modMinSpacingCostVia(box, bi.z(), isAddPathCost, false, false);
-    //modMinSpacingCost(net, box, bi.z(), isAddPathCost, false);
-    modEolSpacingCost(box, bi.z(), isAddPathCost);
-    
-    obj->getLayer2BBox(box); // assumes enclosure for via is always rectangle
-
-    modMinSpacingCostPlaner(net, box, ei.z(), isAddPathCost);
-    modMinSpacingCostVia(box, ei.z(), isAddPathCost, true,  false);
-    modMinSpacingCostVia(box, ei.z(), isAddPathCost, false, false);
-    //modMinSpacingCost(net, box, ei.z(), isAddPathCost, false);
-    modEolSpacingCost(box, ei.z(), isAddPathCost);
-
-    //obj->getCutBBox(box);
-    frTransform xform;
-    frPoint pt;
-    obj->getOrigin(pt);
-    xform.set(pt);
-    for (auto &uFig: obj->getViaDef()->getCutFigs()) {
-      //if (uFig->typeId() == frcRect) {
-        auto rect = static_cast<frRect*>(uFig.get());
-        rect->getBBox(box);
-        box.transform(xform);
-        modCutSpacingCost(box, bi.z(), isAddPathCost);
-      //}
-    }
-  }
-}
-
-void FlexDRWorker::mazeIterInit_sortRerouteNets(vector<drNet*> &rerouteNets) {
-  // sort
-  sort(rerouteNets.begin(), rerouteNets.end(), 
-       [](drNet* const &a, drNet* const &b) {
-       frBox boxA, boxB;
-       a->getPinBox(boxA);
-       b->getPinBox(boxB);
-       auto areaA = (boxA.right() - boxA.left()) * (boxA.top() - boxA.bottom());
-       auto areaB = (boxB.right() - boxB.left()) * (boxB.top() - boxB.bottom());
-       return (a->getNumPinsIn() == b->getNumPinsIn() ? (areaA == areaB ? a->getId() < b->getId() : areaA < areaB) : 
-                                                        a->getNumPinsIn() < b->getNumPinsIn());
-       });
-}
-
-void FlexDRWorker::mazeIterInit_initDR(vector<drNet*> &rerouteNets) {
-  for (auto &net: nets) {
-    rerouteNets.push_back(net.get());
-  }
-  mazeIterInit_sortRerouteNets(rerouteNets);
-  for (auto &net: rerouteNets) {
-    net->setModified(true);
-    net->setNumMarkers(0);
-    // add via access cost when net is not routed
-    if (RESERVE_VIA_ACCESS) {
-      initMazeCost_via_helper(net, true);
-    }
-    //net->clear();
-  }
-}
-
-// temporary settings to test search and repair
-void FlexDRWorker::mazeIterInit_searchRepair(vector<drNet*> &rerouteNets) {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  int cnt = 0;
-  if (getRipupMode() == 0) {
-    for (auto &net: nets) {
-      if (net->isRipup()) {
-        rerouteNets.push_back(net.get());
-      }
-    }
-  } else if (getRipupMode() == 1) {
-    for (auto &net: nets) {
-      rerouteNets.push_back(net.get());
-    }
-  }
-  // change the drNet magical sorting bit here
-  // to do
-  //sort(rerouteNets.begin(), rerouteNets.end(), 
-  //     [](drNet* const &a, drNet* const &b) {return *a < *b;});
-  mazeIterInit_sortRerouteNets(rerouteNets);
-  for (auto &net: rerouteNets) {
-    net->setModified(true);
-    net->setNumMarkers(0);
-    for (auto &uConnFig: net->getRouteConnFigs()) {
-      subPathCost(uConnFig.get());
-      workerRegionQuery.remove(uConnFig.get()); // worker region query
-      cnt++;
-    }
-    // add via access cost when net is not routed
-    if (RESERVE_VIA_ACCESS) {
-      initMazeCost_via_helper(net, true);
-    }
-    net->clear();
-  }
-  //cout <<"sr sub " <<cnt <<" connfig costs" <<endl;
-}
-
-void FlexDRWorker::mazeIterInit(vector<drNet*> &rerouteNets) {
-  initMazeCost_marker();
-  if (isInitDR()) {
-    mazeIterInit_initDR(rerouteNets);
-  } else {
-    mazeIterInit_searchRepair(rerouteNets);
-  }
-}
-
-void FlexDRWorker::mazeNetInit(drNet* net) {
-  gridGraph.resetStatus();
-  // sub via access cost when net is about to route
-  if (RESERVE_VIA_ACCESS) {
-    initMazeCost_via_helper(net, false);
-  }
-  initMazeCost_ap_helper(net, false);
-  initMazeCost_boundary_helper(net, false);
-}
-
-void FlexDRWorker::mazeNetEnd(drNet* net) {
-  initMazeCost_ap_helper(net, true);
-  initMazeCost_boundary_helper(net, true);
-}
-
-void FlexDRWorker::route_drc() {
-  DRCWorker drcWorker(getDesign(), fixedObjs);
-  drcWorker.addDRNets(nets);
-  using namespace std::chrono;
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  drcWorker.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  drcWorker.setup();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  drcWorker.main();
-  setMarkers(drcWorker.getViolations());
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  //drcWorker.report();
-  
-  duration<double> time_span0 = duration_cast<duration<double>>(t1 - t0);
-
-  duration<double> time_span1 = duration_cast<duration<double>>(t2 - t1);
-
-  duration<double> time_span2 = duration_cast<duration<double>>(t3 - t2);
-  if (VERBOSE > 1) {
-    stringstream ss;
-    ss   <<"DRC  (INIT/SETUP/MAIN) " <<time_span0.count() <<" " 
-                                    <<time_span1.count() <<" "
-                                    <<time_span2.count() <<" "
-                                    <<endl;
-    ss <<"#viol = " <<markers.size() <<endl;
-    cout <<ss.str() <<flush;
-  }
-}
-
-void FlexDRWorker::route_postRouteViaSwap() {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  set<FlexMazeIdx> modifiedViaIdx;
-  frBox box;
-  vector<drConnFig*> results;
-  frPoint bp;
-  FlexMazeIdx bi, ei;
-  bool flag = false;
-  for (auto &marker: getMarkers()) {
-    results.clear();
-    marker.getBBox(box);
-    auto lNum = marker.getLayerNum();
-    workerRegionQuery.query(box, lNum, results);
-    for (auto &connFig: results) {
-      if (connFig->typeId() == drcVia) {
-        auto obj = static_cast<drVia*>(connFig);
-        obj->getMazeIdx(bi, ei);
-        auto it = apSVia.find(bi);
-        if (modifiedViaIdx.find(bi) == modifiedViaIdx.end() && it != apSVia.end()) {
-          auto ap = it->second;
-          if (ap->nextAccessViaDef()) {
-            auto newViaDef = ap->getAccessViaDef();
-            workerRegionQuery.remove(obj);
-            obj->setViaDef(newViaDef);
-            workerRegionQuery.add(obj);
-            modifiedViaIdx.insert(bi);
-            flag = true;
-          }
-        }
-      }
-    }
-  }
-  if (flag) {
-    route_drc();
-  }
-}
-
-void FlexDRWorker::route() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout << "start Maze route #nets = " <<nets.size() <<endl;
-  }
-  if (isEnableDRC() && getRipupMode() == 0 && getInitNumMarkers() == 0) {
-    return;
-  }
-  if (DRCTEST) {
-    DRCWorker drcWorker(getDesign(), fixedObjs);
-    drcWorker.addDRNets(nets);
-    using namespace std::chrono;
-    high_resolution_clock::time_point t0 = high_resolution_clock::now();
-    drcWorker.init();
-    high_resolution_clock::time_point t1 = high_resolution_clock::now();
-    drcWorker.setup();
-    high_resolution_clock::time_point t2 = high_resolution_clock::now();
-    drcWorker.main();
-    high_resolution_clock::time_point t3 = high_resolution_clock::now();
-    drcWorker.report();
-    
-    duration<double> time_span0 = duration_cast<duration<double>>(t1 - t0);
-
-    duration<double> time_span1 = duration_cast<duration<double>>(t2 - t1);
-
-    duration<double> time_span2 = duration_cast<duration<double>>(t3 - t2);
-    stringstream ss;
-    ss   <<"time (INIT/SETUP/MAIN) " <<time_span0.count() <<" " 
-                                     <<time_span1.count() <<" "
-                                     <<time_span2.count() <<" "
-                                     <<endl;
-    cout <<ss.str() <<flush;
-
-
-  } else {
-    for (int i = 0; i < mazeEndIter; ++i) {
-      vector<drNet*> rerouteNets;
-      mazeIterInit(rerouteNets);
-      minAreaVios.clear();
-      //if (i == 0) {
-      //  workerDRCCost    = DRCCOST;
-      //  workerMarkerCost = MARKERCOST;
-      //} else {
-      //  workerDRCCost *= 2;
-      //  workerMarkerCost *= 2;
-      //}
-      for (auto net: rerouteNets) {
-        //for (auto &pin: net->getPins()) {
-        //  for (auto &ap: )
-        mazeNetInit(net);
-        bool isRouted = routeNet(net);
-        if (isRouted == false) {
-          // TODO: output maze area
-          cout << "Fatal error: Maze Route cannot find path. Connectivity Changed.\n";
-          if (OUT_MAZE_FILE != string("")) {
-            gridGraph.print();
-          }
-          exit(1);
-        }
-        mazeNetEnd(net);
-      }
-      // drc worker here
-      if (isEnableDRC()) {
-        route_drc();
-        route_postRouteViaSwap();
-      }
-
-      // save to best drc
-      if (i == 0 || (isEnableDRC() && getMarkers().size() < getBestMarkers().size())) {
-        for (auto &net: nets) {
-          net->setBestRouteConnFigs();
-        }
-        setBestMarkers();
-      }
-
-      // quick drc
-      int violNum = getNumQuickMarkers();
-      if (VERBOSE > 1) {
-        cout <<"#quick viol = " <<getNumQuickMarkers() <<endl;
-      }
-      if (isEnableDRC() && getMarkers().empty()) {
-        break;
-      } else if (violNum == 0) {
-        break;
-      }
-    }
-  }
-}
-
-void FlexDRWorker::routeNet_prep(drNet* net, set<drPin*, frBlockObjectComp> &unConnPins, 
-                                 map<FlexMazeIdx, set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins/*,
-                                 map<FlexMazeIdx, frViaDef*> &apSVia*/) {
-  for (auto &pin: net->getPins()) {
-    unConnPins.insert(pin.get());
-    for (auto &ap: pin->getAccessPatterns()) {
-      FlexMazeIdx mi;
-      ap->getMazeIdx(mi);
-      mazeIdx2unConnPins[mi].insert(pin.get());
-      gridGraph.setDst(mi);
-    }
-  }
-}
-
-void FlexDRWorker::routeNet_setSrc(set<drPin*, frBlockObjectComp> &unConnPins, 
-                                   map<FlexMazeIdx, set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins,
-                                   vector<FlexMazeIdx> &connComps, 
-                                   FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2) {
-  frMIdx xDim, yDim, zDim;
-  gridGraph.getDim(xDim, yDim, zDim);
-  ccMazeIdx1.set(xDim - 1, yDim - 1, zDim - 1);
-  ccMazeIdx2.set(0, 0, 0);
-  // first pin selection algorithm goes here
-  // choose the center pin
-  int totAPCnt = 0;
-  frCoord totX = 0;
-  frCoord totY = 0;
-  frCoord totZ = 0;
-  FlexMazeIdx mi;
-  frPoint bp;
-  for (auto &pin: unConnPins) {
-    for (auto &ap: pin->getAccessPatterns()) {
-      ap->getMazeIdx(mi);
-      ap->getPoint(bp);
-      totX += bp.x();
-      totY += bp.y();
-      totZ += gridGraph.getZHeight(mi.z());
-      totAPCnt++;
-    }
-  }
-  totX /= totAPCnt;
-  totY /= totAPCnt;
-  totZ /= totAPCnt;
-
-  frCoord currDist = std::numeric_limits<frCoord>::max();
-  drPin* currPin = nullptr;
-  for (auto &pin: unConnPins) {
-    for (auto &ap: pin->getAccessPatterns()) {
-      ap->getMazeIdx(mi);
-      ap->getPoint(bp);
-      frCoord dist = abs(totX - bp.x()) + abs(totY - bp.y()) + abs(totZ - gridGraph.getZHeight(mi.z()));
-      if (dist < currDist) {
-        currDist = dist;
-        currPin  = pin;
-      }
-    }
-  }
-  unConnPins.erase(currPin);
-
-  //auto currPin = *(unConnPins.begin());
-  //unConnPins.erase(unConnPins.begin());
-  // first pin selection algorithm ends here
-  for (auto &ap: currPin->getAccessPatterns()) {
-    ap->getMazeIdx(mi);
-    connComps.push_back(mi);
-    ccMazeIdx1.set(min(ccMazeIdx1.x(), mi.x()),
-                   min(ccMazeIdx1.y(), mi.y()),
-                   min(ccMazeIdx1.z(), mi.z()));
-    ccMazeIdx2.set(max(ccMazeIdx2.x(), mi.x()),
-                   max(ccMazeIdx2.y(), mi.y()),
-                   max(ccMazeIdx2.z(), mi.z()));
-    auto it = mazeIdx2unConnPins.find(mi);
-    if (it == mazeIdx2unConnPins.end()) {
-      continue;
-    }
-    auto it2 = it->second.find(currPin);
-    if (it2 == it->second.end()) {
-      continue;
-    }
-    it->second.erase(it2);
-
-    gridGraph.setSrc(mi);
-    // remove dst label only when no other pins share the same loc
-    if (it->second.empty()) {
-      mazeIdx2unConnPins.erase(it);
-      gridGraph.resetDst(mi);
-    }
-  }
-
-}
-
-drPin* FlexDRWorker::routeNet_getNextDst(FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2, 
-                                         map<FlexMazeIdx, set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins) {
-  frPoint pt;
-  frPoint ll, ur;
-  gridGraph.getPoint(ll, ccMazeIdx1.x(), ccMazeIdx1.y());
-  gridGraph.getPoint(ur, ccMazeIdx2.x(), ccMazeIdx2.y());
-  frCoord currDist = std::numeric_limits<frCoord>::max();
-  drPin* nextDst = nullptr;
-  for (auto &[mazeIdx, setS]: mazeIdx2unConnPins) {
-    gridGraph.getPoint(pt, mazeIdx.x(), mazeIdx.y());
-    frCoord dx = max(max(ll.x() - pt.x(), pt.x() - ur.x()), 0);
-    frCoord dy = max(max(ll.y() - pt.y(), pt.y() - ur.y()), 0);
-    frCoord dz = max(max(gridGraph.getZHeight(ccMazeIdx1.z()) - gridGraph.getZHeight(mazeIdx.z()), 
-                         gridGraph.getZHeight(mazeIdx.z()) - gridGraph.getZHeight(ccMazeIdx2.z())), 0);
-    if (dx + dy + dz < currDist) {
-      currDist = dx + dy + dz;
-      nextDst = *(setS.begin());
-    }
-    if (currDist == 0) {
-      break;
-    }
-  }
-  return nextDst;
-}
-
-void FlexDRWorker::mazePinInit() {
-  gridGraph.resetPrevNodeDir();
-}
-
-void FlexDRWorker::routeNet_postAstarUpdate(vector<FlexMazeIdx> &path, vector<FlexMazeIdx> &connComps,
-                                            set<drPin*, frBlockObjectComp> &unConnPins, 
-                                            map<FlexMazeIdx, set<drPin*, frBlockObjectComp> > &mazeIdx2unConnPins,
-                                            bool isFirstConn) {
-  // first point is dst
-  set<FlexMazeIdx> localConnComps;
-  if (!path.empty()) {
-    auto mi = path[0];
-    vector<drPin*> tmpPins;
-    for (auto pin: mazeIdx2unConnPins[mi]) {
-      //unConnPins.erase(pin);
-      tmpPins.push_back(pin);
-    }
-    for (auto pin: tmpPins) {
-      unConnPins.erase(pin);
-      for (auto &ap: pin->getAccessPatterns()) {
-        FlexMazeIdx mi;
-        ap->getMazeIdx(mi);
-        auto it = mazeIdx2unConnPins.find(mi);
-        if (it == mazeIdx2unConnPins.end()) {
-          continue;
-        }
-        auto it2 = it->second.find(pin);
-        if (it2 == it->second.end()) {
-          continue;
-        }
-        it->second.erase(it2);
-        if (it->second.empty()) {
-          mazeIdx2unConnPins.erase(it);
-          gridGraph.resetDst(mi);
-        }
-        if (ALLOW_PIN_AS_FEEDTHROUGH) {
-          localConnComps.insert(mi);
-          gridGraph.setSrc(mi);
-        }
-      }
-    }
-  } else {
-    cout <<"Error: routeNet_postAstarUpdate path is empty" <<endl;
-  }
-  // must be before comment line ABC so that the used actual src is set in gridgraph
-  if (isFirstConn && (!ALLOW_PIN_AS_FEEDTHROUGH)) {
-    for (auto &mi: connComps) {
-      gridGraph.resetSrc(mi);
-    }
-    connComps.clear();
-    if ((int)path.size() == 1) {
-      connComps.push_back(path[0]);
-      gridGraph.setSrc(path[0]);
-    }
-  }
-  // line ABC
-  // must have >0 length
-  for (int i = 0; i < (int)path.size() - 1; ++i) {
-    auto start = path[i];
-    auto end = path[i + 1];
-    auto startX = start.x(), startY = start.y(), startZ = start.z();
-    auto endX = end.x(), endY = end.y(), endZ = end.z();
-    // horizontal wire
-    if (startX != endX && startY == endY && startZ == endZ) {
-      for (auto currX = std::min(startX, endX); currX <= std::max(startX, endX); ++currX) {
-        localConnComps.insert(FlexMazeIdx(currX, startY, startZ));
-        gridGraph.setSrc(currX, startY, startZ);
-        //gridGraph.resetDst(currX, startY, startZ);
-      }
-    // vertical wire
-    } else if (startX == endX && startY != endY && startZ == endZ) {
-      for (auto currY = std::min(startY, endY); currY <= std::max(startY, endY); ++currY) {
-        localConnComps.insert(FlexMazeIdx(startX, currY, startZ));
-        gridGraph.setSrc(startX, currY, startZ);
-        //gridGraph.resetDst(startX, currY, startZ);
-      }
-    // via
-    } else if (startX == endX && startY == endY && startZ != endZ) {
-      for (auto currZ = std::min(startZ, endZ); currZ <= std::max(startZ, endZ); ++currZ) {
-        localConnComps.insert(FlexMazeIdx(startX, startY, currZ));
-        gridGraph.setSrc(startX, startY, currZ);
-        //gridGraph.resetDst(startX, startY, currZ);
-      }
-    // zero length
-    } else if (startX == endX && startY == endY && startZ == endZ) {
-      //root.addPinGrid(startX, startY, startZ);
-      std::cout << "Warning: zero-length path in updateFlexPin\n";
-    } else {
-      std::cout << "Error: non-colinear path in updateFlexPin\n";
-    }
-  }
-  for (auto &mi: localConnComps) {
-    if (isFirstConn && !ALLOW_PIN_AS_FEEDTHROUGH) {
-      connComps.push_back(mi);
-    } else {
-      if (!(mi == *(path.cbegin()))) {
-        connComps.push_back(mi);
-      }
-    }
-  }
-}
-
-void FlexDRWorker::routeNet_postAstarWritePath(drNet* net, vector<FlexMazeIdx> &points/*, 
-                                               const map<FlexMazeIdx, frViaDef*> &apSVia*/) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (points.empty()) {
-    if (enableOutput) {
-      std::cout << "Warning: path is empty in writeMazePath\n";
-    }
-    return;
-  }
-  if (TEST && points.size()) {
-    cout <<"path";
-    for (auto &mIdx: points) {
-      cout <<" (" <<mIdx.x() <<", " <<mIdx.y() <<", " <<mIdx.z() <<")";
-    }
-    cout <<endl;
-  }
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  for (int i = 0; i < (int)points.size() - 1; ++i) {
-    FlexMazeIdx start, end;
-    if (points[i + 1] < points[i]) {
-      start = points[i + 1];
-      end = points[i];
-    } else {
-      start = points[i];
-      end = points[i + 1];
-    }
-    auto startX = start.x(), startY = start.y(), startZ = start.z();
-    auto endX = end.x(), endY = end.y(), endZ = end.z();
-    // horizontal wire
-    if (startX != endX && startY == endY && startZ == endZ) {
-      frPoint startLoc, endLoc;
-      frLayerNum currLayerNum = gridGraph.getLayerNum(startZ);
-      gridGraph.getPoint(startLoc, startX, startY);
-      gridGraph.getPoint(endLoc, endX, endY);
-      auto currPathSeg = make_unique<drPathSeg>();
-      currPathSeg->setPoints(startLoc, endLoc);
-      currPathSeg->setLayerNum(currLayerNum);
-      currPathSeg->addToNet(net);
-      currPathSeg->setStyle(getTech()->getLayer(currLayerNum)->getDefaultSegStyle());
-      currPathSeg->setMazeIdx(start, end);
-      unique_ptr<drConnFig> tmp(std::move(currPathSeg));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-      // quick drc cnt
-      bool prevHasCost = false;
-      for (int i = startX; i < endX; i++) {
-        if (gridGraph.hasDRCCost(i, startY, startZ, frDirEnum::E)) {
-          if (!prevHasCost) {
-            net->addMarker();
-            prevHasCost = true;
-          }
-          if (TEST) {
-            cout <<" pass marker @(" <<i <<", " <<startY <<", " <<startZ <<") E" <<endl;
-          }
-        } else {
-          prevHasCost = false;
-        }
-      }
-      if (enableOutput) {
-        cout <<" write horz pathseg (" 
-             <<startLoc.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-             <<startLoc.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") (" 
-             <<endLoc.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-             <<endLoc.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") " 
-             <<getTech()->getLayer(currLayerNum)->getName() <<endl;
-      }
-    // vertical wire
-    } else if (startX == endX && startY != endY && startZ == endZ) {
-      frPoint startLoc, endLoc;
-      frLayerNum currLayerNum = gridGraph.getLayerNum(startZ);
-      gridGraph.getPoint(startLoc, startX, startY);
-      gridGraph.getPoint(endLoc, endX, endY);
-      auto currPathSeg = make_unique<drPathSeg>();
-      currPathSeg->setPoints(startLoc, endLoc);
-      currPathSeg->setLayerNum(currLayerNum);
-      currPathSeg->addToNet(net);
-      currPathSeg->setStyle(getTech()->getLayer(currLayerNum)->getDefaultSegStyle());
-      currPathSeg->setMazeIdx(start, end);
-      unique_ptr<drConnFig> tmp(std::move(currPathSeg));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-      // quick drc cnt
-      bool prevHasCost = false;
-      for (int i = startY; i < endY; i++) {
-        if (gridGraph.hasDRCCost(startX, i, startZ, frDirEnum::E)) {
-          if (!prevHasCost) {
-            net->addMarker();
-            prevHasCost = true;
-          }
-          if (TEST) {
-            cout <<" pass marker @(" <<startX <<", " <<i <<", " <<startZ <<") N" <<endl;
-          }
-        } else {
-          prevHasCost = false;
-        }
-      }
-      if (enableOutput) {
-        cout <<" write vert pathseg (" 
-             <<startLoc.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-             <<startLoc.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") (" 
-             <<endLoc.x()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-             <<endLoc.y()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") " 
-             <<getTech()->getLayer(currLayerNum)->getName() <<endl;
-      }
-    // via
-    } else if (startX == endX && startY == endY && startZ != endZ) {
-      for (auto currZ = startZ; currZ < endZ; ++currZ) {
-        frPoint loc;
-        frLayerNum startLayerNum = gridGraph.getLayerNum(currZ);
-        //frLayerNum endLayerNum = gridGraph.getLayerNum(currZ + 1);
-        gridGraph.getPoint(loc, startX, startY);
-        FlexMazeIdx mi(startX, startY, currZ); 
-        auto cutLayerDefaultVia = getTech()->getLayer(startLayerNum + 1)->getDefaultViaDef();
-        if (gridGraph.isSVia(startX, startY, currZ)) {
-          cutLayerDefaultVia = apSVia.find(mi)->second->getAccessViaDef();
-        }
-        auto currVia = make_unique<drVia>(cutLayerDefaultVia);
-        currVia->setOrigin(loc);
-        currVia->setMazeIdx(FlexMazeIdx(startX, startY, currZ), FlexMazeIdx(startX, startY, currZ+1));
-        unique_ptr<drConnFig> tmp(std::move(currVia));
-        workerRegionQuery.add(tmp.get());
-        net->addRoute(tmp);
-        if (gridGraph.hasDRCCost(startX, startY, currZ, frDirEnum::U)) {
-          net->addMarker();
-          if (TEST) {
-            cout <<" pass marker @(" <<startX <<", " <<startY <<", " <<currZ <<") U" <<endl;
-          }
-        }
-        if (enableOutput) {
-          cout <<" write via (" 
-               <<loc.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-               <<loc.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") " 
-               <<cutLayerDefaultVia->getName() <<endl;
-        }
-      }
-    // zero length
-    } else if (startX == endX && startY == endY && startZ == endZ) {
-      std::cout << "Warning: zero-length path in updateFlexPin\n";
-    } else {
-      std::cout << "Error: non-colinear path in updateFlexPin\n";
-    }
-  }
-}
-
-void FlexDRWorker::routeNet_postRouteAddPathCost(drNet* net) {
-  int cnt = 0;
-  for (auto &connFig: net->getRouteConnFigs()) {
-    addPathCost(connFig.get());
-    cnt++;
-  }
-  //cout <<"updated " <<cnt <<" connfig costs" <<endl;
-}
-
-bool FlexDRWorker::routeNet(drNet* net) {
-  if (net->getPins().size() <= 1) {
-    return true;
-  }
-  
-  if (TEST) {
-    cout <<"route " <<net->getFrNet()->getName() <<endl;
-  }
-
-  set<drPin*, frBlockObjectComp> unConnPins;
-  map<FlexMazeIdx, set<drPin*, frBlockObjectComp> > mazeIdx2unConnPins;
-  //map<FlexMazeIdx, frViaDef*> apSVia;
-  routeNet_prep(net, unConnPins, mazeIdx2unConnPins/*, apSVia*/);
-
-  FlexMazeIdx ccMazeIdx1, ccMazeIdx2; // connComps ll, ur flexmazeidx
-  vector<FlexMazeIdx> connComps;
-  routeNet_setSrc(unConnPins, mazeIdx2unConnPins, connComps, ccMazeIdx1, ccMazeIdx2);
-
-  vector<FlexMazeIdx> path; // astar must return with >= 1 idx
-  bool isFirstConn = true;
-  while(!unConnPins.empty()) {
-    mazePinInit();
-    auto nextPin = routeNet_getNextDst(ccMazeIdx1, ccMazeIdx2, mazeIdx2unConnPins);
-    path.clear();
-    if (gridGraph.search(connComps, nextPin, path, ccMazeIdx1, ccMazeIdx2)) {
-      routeNet_postAstarUpdate(path, connComps, unConnPins, mazeIdx2unConnPins, isFirstConn);
-      routeNet_postAstarWritePath(net, path/*, apSVia*/);
-      routeNet_postAstarPatchMinAreaVio(net, path);
-      isFirstConn = false;
-    }
-  }
-  routeNet_postRouteAddPathCost(net);
-  return true;
-}
-
-void FlexDRWorker::routeNet_postAstarPatchMinAreaVio(drNet* net, const vector<FlexMazeIdx> &path) {
-  if (path.empty()) {
-    return;
-  }
-  // get path with separated (stacked vias)
-  vector<FlexMazeIdx> points;
-  for (int i = 0; i < (int)path.size() - 1; ++i) {
-    auto currIdx = path[i];
-    auto nextIdx = path[i+1];
-    if (currIdx.z() == nextIdx.z()) {
-      points.push_back(currIdx);
-    } else {
-      if (currIdx.z() < nextIdx.z()) {
-        for (auto z = currIdx.z(); z < nextIdx.z(); ++z) {
-          FlexMazeIdx tmpIdx(currIdx.x(), currIdx.y(), z);
-          points.push_back(tmpIdx);
-        }
-      } else {
-        for (auto z = currIdx.z(); z > nextIdx.z(); --z) {
-          FlexMazeIdx tmpIdx(currIdx.x(), currIdx.y(), z);
-          points.push_back(tmpIdx);
-        }
-      }
-    }
-  }
-  points.push_back(path.back());
-
-
-  auto layerNum = gridGraph.getLayerNum(points.front().z());
-  auto minAreaConstraint = getDesign()->getTech()->getLayer(layerNum)->getAreaConstraint();
-  frCoord currArea = (minAreaConstraint) ? minAreaConstraint->getMinArea() : 0;
-  frCoord startViaHalfEncArea = 0, endViaHalfEncArea = 0;
-  FlexMazeIdx prevIdx = points[0], currIdx;
-  for (int i = 1; i < (int)points.size(); ++i) {
-    currIdx = points[i];
-    // check minAreaViolation when change layer
-    if (currIdx.z() != prevIdx.z()) {
-      auto layerNum = gridGraph.getLayerNum(prevIdx.z());
-      auto minAreaConstraint = getDesign()->getTech()->getLayer(layerNum)->getAreaConstraint();
-      frCoord reqArea = (minAreaConstraint) ? minAreaConstraint->getMinArea() : 0;
-      // add next via enclosure
-      if (currIdx.z() < prevIdx.z()) {
-        currArea += gridGraph.getHalfViaEncArea(prevIdx.z() - 1, false);
-        endViaHalfEncArea = gridGraph.getHalfViaEncArea(prevIdx.z() - 1, false);
-      } else {
-        currArea += gridGraph.getHalfViaEncArea(prevIdx.z(), true);
-        endViaHalfEncArea = gridGraph.getHalfViaEncArea(prevIdx.z(), true);
-      }
-      // push to minArea violation
-      if (currArea < reqArea) {
-        FlexMazeIdx bp, ep;
-        frCoord gapArea = reqArea - (currArea - startViaHalfEncArea - endViaHalfEncArea) - std::min(startViaHalfEncArea, endViaHalfEncArea);
-        // bp = std::min(prevIdx, currIdx);
-        // ep = std::max(prevIdx, currIdx);
-        if (points[i-1].z() == points[i-2].z()) {
-          bp = std::min(points[i-1], points[i-2]);
-          ep = std::max(points[i-1], points[i-2]);
-        } else {
-          bp = points[i-1];
-          ep = points[i-1];
-        }
-
-
-        auto patchWidth = getDesign()->getTech()->getLayer(layerNum)->getWidth();
-        // FlexDRMinAreaVio minAreaVio(net, bp, ep, reqArea - (currArea - startViaHalfEncArea) - std::min(startViaHalfEncArea, endViaHalfEncArea));
-        // minAreaVios.push_back(minAreaVio);
-        routeNet_postAstarAddPatchMetal(net, bp, ep, gapArea, patchWidth);
-      }
-      // init for next path
-      if (currIdx.z() < prevIdx.z()) {
-        currArea = gridGraph.getHalfViaEncArea(prevIdx.z() - 1, true);
-        startViaHalfEncArea = gridGraph.getHalfViaEncArea(prevIdx.z() - 1, true);
-      } else {
-        currArea = gridGraph.getHalfViaEncArea(prevIdx.z(), false);
-        startViaHalfEncArea = gridGraph.getHalfViaEncArea(prevIdx.z(), false);
-      }
-    } 
-    // add the wire area
-    else {
-      auto layerNum = gridGraph.getLayerNum(prevIdx.z());
-      auto pathWidth = getDesign()->getTech()->getLayer(layerNum)->getWidth();
-      frPoint bp, ep;
-      gridGraph.getPoint(bp, prevIdx.x(), prevIdx.y());
-      gridGraph.getPoint(ep, currIdx.x(), currIdx.y());
-      frCoord pathLength = abs(bp.x() - ep.x()) + abs(bp.y() - ep.y());
-      currArea += pathLength * pathWidth;
-    }
-    prevIdx = currIdx;
-  }
-}
-
-// void FlexDRWorker::routeNet_postRouteAddPatchMetalCost(drNet* net) {
-//   for (auto &patch: net->getRoutePatchConnFigs()) {
-//     addPathCost(patch.get());
-//   }
-// }
-
-void FlexDRWorker::routeNet_postAstarAddPatchMetal(drNet* net, 
-                                                   const FlexMazeIdx bpIdx,
-                                                   const FlexMazeIdx epIdx,
-                                                   const frCoord gapArea,
-                                                   const frCoord patchWidth) {
-  bool isPatchHorz;
-  bool isLeftClean = true;
-  frLayerNum layerNum = gridGraph.getLayerNum(bpIdx.z());
-  frCoord patchLength = gapArea / patchWidth;
-  if (gapArea % patchWidth != 0) {
-    ++patchLength;
-  }
-  frPoint origin;
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  // stacked via
-  if (bpIdx.x() == epIdx.x() && bpIdx.y() == epIdx.y()) {
-    if (getDesign()->getTech()->getLayer(layerNum)->getDir() == frcHorzPrefRoutingDir) {
-      isPatchHorz = true;
-    } else {
-      isPatchHorz = false;
-    }
-  }
-  // vertical patch 
-  else if (bpIdx.x() == epIdx.x()) {
-    isPatchHorz = false;
-  }
-  // horizontal patch
-  else {
-    isPatchHorz = true;
-  }
-
-  // try bottom / left option
-  if (isPatchHorz) {
-    gridGraph.getPoint(origin, bpIdx.x(), bpIdx.y());
-    frPoint patchEnd(origin.x() - patchLength, origin.y());
-    if (!getRouteBox().contains(patchEnd)) {
-      isLeftClean = false;
-    } else {
-      frPoint patchLL(origin.x() - patchLength, origin.y() - patchWidth / 2);
-      frPoint patchUR(origin.x(), origin.y() + patchWidth / 2);
-      FlexMazeIdx startIdx, endIdx;
-      gridGraph.getMazeIdx(startIdx, patchLL, layerNum);
-      gridGraph.getMazeIdx(endIdx, patchUR, layerNum);
-      for (auto xIdx = startIdx.x(); xIdx < endIdx.x(); ++xIdx) {
-        for (auto yIdx = startIdx.y(); yIdx < endIdx.y(); ++yIdx) {
-          if (gridGraph.hasDRCCost(xIdx, yIdx, bpIdx.z(), frDirEnum::E) ||
-              gridGraph.hasDRCCost(xIdx, yIdx, bpIdx.z(), frDirEnum::N)) {
-            isLeftClean = false;
-            break;
-          }
-        }
-      }
-    }
-    // add patch if clean
-    if (isLeftClean) {
-      frPoint patchLL(origin.x() - patchLength, origin.y() - patchWidth / 2);
-      frPoint patchUR(origin.x(), origin.y() + patchWidth / 2);
-      auto tmpPatch = make_unique<drPatchWire>();
-      tmpPatch->setLayerNum(layerNum);
-      tmpPatch->setOrigin(origin);
-      // tmpPatch->setBBox(frBox(patchLL, patchUR));
-      tmpPatch->setOffsetBox(frBox(-patchLength, -patchWidth / 2, 0, patchWidth / 2));
-      tmpPatch->addToNet(net);
-      unique_ptr<drConnFig> tmp(std::move(tmpPatch));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-    }
-  } else {
-    gridGraph.getPoint(origin, bpIdx.x(), bpIdx.y());
-    frPoint patchEnd(origin.x(), origin.y() - patchLength);
-    if (!getRouteBox().contains(patchEnd)) {
-      isLeftClean = false;
-    } else {
-      frPoint patchLL(origin.x() - patchWidth / 2, origin.y() - patchLength);
-      frPoint patchUR(origin.x() + patchWidth / 2, origin.y());
-      FlexMazeIdx startIdx, endIdx;
-      gridGraph.getMazeIdx(startIdx, patchLL, layerNum);
-      gridGraph.getMazeIdx(endIdx, patchUR, layerNum);
-      for (auto xIdx = startIdx.x(); xIdx < endIdx.x(); ++xIdx) {
-        for (auto yIdx = startIdx.y(); yIdx < endIdx.y(); ++yIdx) {
-          if (gridGraph.hasDRCCost(xIdx, yIdx, bpIdx.z(), frDirEnum::E) ||
-              gridGraph.hasDRCCost(xIdx, yIdx, bpIdx.z(), frDirEnum::N)) {
-            isLeftClean = false;
-            break;
-          }
-        }
-      }
-    }
-    // add patch if clean
-    if (isLeftClean) {
-      frPoint patchLL(origin.x() - patchWidth / 2, origin.y() - patchLength);
-      frPoint patchUR(origin.x() + patchWidth / 2, origin.y());
-      auto tmpPatch = make_unique<drPatchWire>();
-      tmpPatch->setLayerNum(layerNum);
-      tmpPatch->setOrigin(origin);
-      // tmpPatch->setBBox(frBox(patchLL, patchUR));
-      tmpPatch->setOffsetBox(frBox(-patchWidth / 2, -patchLength, patchWidth / 2, 0));
-      tmpPatch->addToNet(net);
-      unique_ptr<drConnFig> tmp(std::move(tmpPatch));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-    }
-  }
-  // use top / right option if bottom / left is not usable
-  if (!isLeftClean) {
-    gridGraph.getPoint(origin, epIdx.x(), epIdx.y());
-    if (isPatchHorz) {
-      frPoint patchLL(origin.x(), origin.y() - patchWidth / 2);
-      frPoint patchUR(origin.x() + patchLength, origin.y() + patchWidth / 2);
-
-      auto tmpPatch = make_unique<drPatchWire>();
-      tmpPatch->setLayerNum(layerNum);
-      tmpPatch->setOrigin(origin);
-      // tmpPatch->setBBox(frBox(patchLL, patchUR));
-      tmpPatch->setOffsetBox(frBox(0, -patchWidth / 2, patchLength, patchWidth / 2));
-      tmpPatch->addToNet(net);
-      unique_ptr<drConnFig> tmp(std::move(tmpPatch));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-    } else {
-      frPoint patchLL(origin.x() - patchWidth / 2, origin.y());
-      frPoint patchUR(origin.x() + patchWidth / 2, origin.y() + patchLength);
-
-      auto tmpPatch = make_unique<drPatchWire>();
-      tmpPatch->setLayerNum(layerNum);
-      tmpPatch->setOrigin(origin);
-      // tmpPatch->setBBox(frBox(patchLL, patchUR));
-      tmpPatch->setOffsetBox(frBox(-patchWidth / 2, 0, patchWidth / 2, patchLength));
-      tmpPatch->addToNet(net);
-      unique_ptr<drConnFig> tmp(std::move(tmpPatch));
-      workerRegionQuery.add(tmp.get());
-      net->addRoute(tmp);
-    }
-  }
-
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_rq.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_rq.cpp
deleted file mode 100644
index 4b100cb..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexDR_rq.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexDR.h"
-
-using namespace std;
-using namespace fr;
-
-frDesign* FlexDRWorkerRegionQuery::getDesign() const {
-  return drWorker->getDesign();
-}
-
-void FlexDRWorkerRegionQuery::add(drConnFig* connFig) {
-  frBox frb;
-  box_t boostb;
-  if (connFig->typeId() == drcPathSeg || connFig->typeId() == frcRect || connFig->typeId() == drcPatchWire) {
-    auto obj = static_cast<drShape*>(connFig);
-    obj->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    shapes.at(obj->getLayerNum()).insert(make_pair(boostb, obj));
-  } else if (connFig->typeId() == drcVia) {
-    auto via = static_cast<drVia*>(connFig);
-    frTransform xform;
-    frPoint origin;
-    via->getOrigin(origin);
-    xform.set(origin);
-    for (auto &uShape: via->getViaDef()->getLayer1Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getLayer1Num()).insert(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getLayer2Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getLayer2Num()).insert(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getCutFigs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-
-
-void FlexDRWorkerRegionQuery::add(drConnFig* connFig, vector<vector<rq_rptr_value_t<drConnFig> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  if (connFig->typeId() == drcPathSeg || connFig->typeId() == frcRect || connFig->typeId() == drcPatchWire) {
-    auto obj = static_cast<drShape*>(connFig);
-    obj->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    allShapes.at(obj->getLayerNum()).push_back(make_pair(boostb, obj));
-  } else if (connFig->typeId() == drcVia) {
-    auto via = static_cast<drVia*>(connFig);
-    frTransform xform;
-    frPoint origin;
-    via->getOrigin(origin);
-    xform.set(origin);
-    for (auto &uShape: via->getViaDef()->getLayer1Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        allShapes.at(via->getViaDef()->getLayer1Num()).push_back(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getLayer2Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        allShapes.at(via->getViaDef()->getLayer2Num()).push_back(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getCutFigs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        allShapes.at(via->getViaDef()->getCutLayerNum()).push_back(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void FlexDRWorkerRegionQuery::remove(drConnFig* connFig) {
-  frBox frb;
-  box_t boostb;
-  if (connFig->typeId() == drcPathSeg || connFig->typeId() == frcRect || connFig->typeId() == drcPatchWire) {
-    auto obj = static_cast<drShape*>(connFig);
-    obj->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    shapes.at(obj->getLayerNum()).remove(make_pair(boostb, obj));
-  } else if (connFig->typeId() == drcVia) {
-    auto via = static_cast<drVia*>(connFig);
-    frTransform xform;
-    frPoint origin;
-    via->getOrigin(origin);
-    xform.set(origin);
-    for (auto &uShape: via->getViaDef()->getLayer1Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getLayer1Num()).remove(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query remove" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getLayer2Figs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getLayer2Num()).remove(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query remove" <<endl;
-      }
-    }
-    for (auto &uShape: via->getViaDef()->getCutFigs()) {
-      auto shape = uShape.get();
-      if (shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(via->getViaDef()->getCutLayerNum()).remove(make_pair(boostb, via));
-      } else {
-        cout <<"Error: unsupported region query remove" <<endl;
-      }
-    }
-  } else {
-    cout <<"Error: unsupported region query remove" <<endl;
-  }
-}
-
-void FlexDRWorkerRegionQuery::query(const frBox &box, frLayerNum layerNum, vector<drConnFig*> &result) {
-  vector<rq_rptr_value_t<drConnFig> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  shapes.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexDRWorkerRegionQuery::init() {
-  int numLayers = getDesign()->getTech()->getLayers().size();
-  shapes.clear();
-  shapes.resize(numLayers);
-  vector<vector<rq_rptr_value_t<drConnFig> > > allShapes(numLayers);
-  for (auto &net: getDRWorker()->getNets()) {
-    for (auto &connFig: net->getRouteConnFigs()) {
-      add(connFig.get(), allShapes);
-    }
-    for (auto &connFig: net->getExtConnFigs()) {
-      add(connFig.get(), allShapes);
-    }
-  }
-  for (auto i = 0; i < numLayers; i++) {
-    shapes.at(i) = boost::move(bgi::rtree<rq_rptr_value_t<drConnFig>, bgi::quadratic<16> >(allShapes.at(i)));
-    allShapes.at(i).clear();
-    allShapes.at(i).shrink_to_fit();
-    //if (VERBOSE > 0) {
-    //  cout <<"  complete " <<design->getTech()->getLayer(i)->getName() <<endl;
-    //}
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.cpp
deleted file mode 100644
index 3591e32..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.cpp
+++ /dev/null
@@ -1,526 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexGridGraph.h"
-#include <iostream>
-#include <map>
-#include <fstream>
-
-using namespace std;
-using namespace fr;
-
-//void FlexGridGraph::resetCost(frMIdx x, frMIdx y, frMIdx z) {
-//  resetGridCostE(x, y, z);
-//  resetGridCostN(x, y, z);
-//  resetGridCostU(x, y, z);
-//  resetShapePlanar(x, y, z);
-//  resetShapeVia(x, y, z);
-//  resetDRCCostPlanar(x, y, z);
-//  resetDRCCostVia(x, y, z);
-//  resetMarkerCostPlanar(x, y, z);
-//  resetMarkerCostVia(x, y, z);
-//}
-
-void FlexGridGraph::initGrids(const map<frCoord, map<frLayerNum, frTrackPattern* > > &xMap,
-                              const map<frCoord, map<frLayerNum, frTrackPattern* > > &yMap,
-                              const map<frLayerNum, frPrefRoutingDirEnum> &zMap) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  // initialize coord vectors
-  xCoords.clear();
-  yCoords.clear();
-  zCoords.clear();
-  zHeights.clear();
-  zDirs.clear();
-  halfViaEncArea.clear();
-  for (auto &[k, v]: xMap) {
-    xCoords.push_back(k);
-  }
-  for (auto &[k, v]: yMap) {
-    yCoords.push_back(k);
-  }
-  frCoord zHeight = 0;
-  for (auto &[k, v]: zMap) {
-    zCoords.push_back(k);
-    zHeight += getTech()->getLayer(k)->getPitch() * VIACOST;
-    zHeights.push_back(zHeight);
-    zDirs.push_back((v == frPrefRoutingDirEnum::frcHorzPrefRoutingDir));
-    if (k + 1 <= getTech()->getTopLayerNum() && getTech()->getLayer(k + 1)->getType() == frLayerTypeEnum::CUT) {
-      auto viaDef = getTech()->getLayer(k + 1)->getDefaultViaDef();
-      frVia via(viaDef);
-      frBox layer1Box;
-      frBox layer2Box;
-      via.getLayer1BBox(layer1Box);
-      via.getLayer2BBox(layer2Box);
-      auto layer1HalfArea = layer1Box.width() * layer1Box.length() / 2;
-      auto layer2HalfArea = layer2Box.width() * layer2Box.length() / 2;
-      // cout <<"z = " <<zCoords.size() <<" " <<"layer1/2HalfArea = " <<layer1HalfArea <<"/" <<layer2HalfArea <<endl;
-      halfViaEncArea.push_back(make_pair(layer1HalfArea, layer2HalfArea));
-    } else {
-      halfViaEncArea.push_back(make_pair(0,0));
-    }
-  }
-  // initialize all grids
-  frMIdx xDim, yDim, zDim;
-  getDim(xDim, yDim, zDim);
-  bits.clear();
-  bits.resize(xDim*yDim*zDim, 0);
-  // new
-  prevDirs.clear();
-  srcs.clear();
-  dsts.clear();
-  prevDirs.resize(xDim*yDim*zDim*3, 0);
-  srcs.resize(xDim*yDim*zDim, 0);
-  dsts.resize(xDim*yDim*zDim, 0);
-
-  //for (int k = 0; k < (int)zDim; k++) {
-  //  for (int j = 0; j < (int)yDim; j++) {
-  //    for (int i = 0; i < (int)xDim; i++) {
-  //      resetCost(i, j, k);
-  //    }
-  //  }
-  //}
-  if (enableOutput) {
-    cout <<"x ";
-    for (auto &k: xCoords) {
-      cout <<" " <<k;
-    }
-    cout <<endl;
-    cout <<"y ";   
-    for (auto &k: yCoords) {
-      cout <<" " <<k;
-    }
-    cout <<endl;
-    cout <<"z ";   
-    for (auto &k: zCoords) {
-      cout <<" " <<k;
-    }
-    cout <<endl;
-    cout <<"z height ";   
-    for (auto &k: zHeights) {
-      cout <<" " <<k;
-    }
-    cout <<endl;
-  }
-}
-
-void FlexGridGraph::initEdges(const map<frCoord, map<frLayerNum, frTrackPattern* > > &xMap,
-                              const map<frCoord, map<frLayerNum, frTrackPattern* > > &yMap,
-                              const map<frLayerNum, frPrefRoutingDirEnum> &zMap,
-                              const frBox &bbox, bool initDR) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  frMIdx xDim, yDim, zDim;
-  getDim(xDim, yDim, zDim);
-  // initialize grid graph
-  frMIdx xIdx = 0, yIdx = 0, zIdx = 0;
-  bool flag = false;
-
-  // add cost to out-of-die edge
-  //frBox blockBox;
-  //getDesign()->getTopBlock()->getBoundaryBBox(blockBox);
-  //frBox viaBox, planarBox;
-  //frVia dVia(nullptr);
-  //dVia.setOrigin(frPoint(0,0));
-  //frCoord halfWidth = 0;
-  //frTransform xform;
-
-  for (auto &[layerNum, dir]: zMap) {
-    frLayerNum nonPrefLayerNum;
-    //viaBox.set(0,0,0,0);
-    //halfWidth = getDesign()->getTech()->getLayer(layerNum)->getWidth() / 2;
-    //planarBox.set(-halfWidth, -halfWidth, halfWidth, halfWidth);
-    if (layerNum + 2 <= getTech()->getTopLayerNum()) {
-      nonPrefLayerNum = layerNum + 2;
-      //dVia.setViaDef(getDesign()->getTech()->getLayer(layerNum + 1)->getDefaultViaDef());
-      //dVia.getBBox(viaBox);
-    } else if (layerNum - 2 >= getTech()->getBottomLayerNum()) {
-      nonPrefLayerNum = layerNum - 2;
-    } else {
-      nonPrefLayerNum = layerNum;
-    }
-    yIdx = 0;
-    for (auto &[yCoord, ySubMap]: yMap) {
-      auto yIt  = ySubMap.find(layerNum);
-      auto yIt2 = ySubMap.find(layerNum+2);
-      auto yIt3 = ySubMap.find(nonPrefLayerNum);
-      bool yFound  = (yIt != ySubMap.end());
-      bool yFound2 = (yIt2 != ySubMap.end());
-      bool yFound3 = (yIt3 != ySubMap.end());
-      xIdx = 0;
-      for (auto &[xCoord, xSubMap]: xMap) {
-        auto xIt  = xSubMap.find(layerNum);
-        auto xIt2 = xSubMap.find(layerNum+2);
-        auto xIt3 = xSubMap.find(nonPrefLayerNum);
-        bool xFound  = (xIt != xSubMap.end());
-        bool xFound2 = (xIt2 != xSubMap.end());
-        bool xFound3 = (xIt3 != xSubMap.end());
-
-        // add cost to out-of-die edge
-        //xform.set(frPoint(xCoord, yCoord));
-        //viaBox.transform(xform);
-        //planarBox.transform(xform);
-        //bool outOfDiePlanar = !blockBox.contains(planarBox);
-        //bool outOfDieVia    = !blockBox.contains(viaBox);
-        bool outOfDiePlanar = false;
-        bool outOfDieVia    = false;
-      //for (auto &[layerNum, dir]: zMap) {
-        // add edge for preferred direction
-        if (dir == frcHorzPrefRoutingDir && yFound) {
-          if (layerNum >= BOTTOM_ROUTING_LAYER) {
-            if (enableOutput) {
-              if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::E)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) already set" <<endl;
-              }
-            }
-            flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::E, bbox, initDR);
-            if (yIt->second == nullptr || outOfDiePlanar) {
-              setGridCostE(xIdx, yIdx, zIdx);
-            }
-            if (enableOutput) {
-              if (!flag) {
-                cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E)" <<endl;
-              } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::E)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) not set" <<endl;
-              } else {
-                if (hasGridCostE(xIdx, yIdx, zIdx) != ((yIt->second || outOfDiePlanar) ? false : true)) {
-                  cout <<"check edge cost failed (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) != 1" <<endl;
-                }
-                cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E)" <<endl;
-              }
-            }
-          }
-          // via to upper layer
-          if (xFound2) {
-            if (enableOutput) {
-              if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::U)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U) already set" <<endl;
-              }
-            }
-            flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::U, bbox, initDR);
-            bool condition = (yIt->second == nullptr || xIt2->second == nullptr);
-            if (condition || outOfDieVia) {
-              setGridCostU(xIdx, yIdx, zIdx);
-            }
-            if (enableOutput) {
-              if (!flag) {
-                cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U)" <<endl;
-              } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::U)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U) not set" <<endl;
-              } else {
-                cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U)" <<endl;
-              }
-            }
-          }
-        } else if (dir == frcVertPrefRoutingDir && xFound) {
-          if (layerNum >= BOTTOM_ROUTING_LAYER) {
-            if (enableOutput) {
-              if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::N)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) already set" <<endl;
-              }
-            }
-            flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::N, bbox, initDR);
-            if (xIt->second == nullptr || outOfDiePlanar) {
-              setGridCostN(xIdx, yIdx, zIdx);
-            }
-            if (enableOutput) {
-              if (!flag) {
-                cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N)" <<endl;
-              } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::N)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) not set" <<endl;
-              } else {
-                if (hasGridCostN(xIdx, yIdx, zIdx) != ((xIt->second || outOfDiePlanar) ? false : true)) {
-                  cout <<"check edge cost failed (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) != 1" <<endl;
-                }
-                cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N)" <<endl;
-
-              }
-            }
-          }
-          // via to upper layer
-          if (yFound2) {
-            if (enableOutput) {
-              if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::U)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U) already set" <<endl;
-              }
-            }
-            flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::U, bbox, initDR);
-            bool condition = (yIt2->second == nullptr || xIt->second == nullptr);
-            if (condition || outOfDieVia) {
-              setGridCostU(xIdx, yIdx, zIdx);
-            }
-            if (enableOutput) {
-              if (!flag) {
-                cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U)" <<endl;
-              } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::U)) {
-                cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U) not set" <<endl;
-              } else {
-                cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U)" <<endl;
-              }
-            }
-          }
-        }
-        // get non pref track layer --> use upper layer pref dir track if possible
-        if (USENONPREFTRACKS) {
-          // add edge for non-preferred direction
-          // vertical non-pref track
-          if (dir == frcHorzPrefRoutingDir && xFound3) {
-            if (layerNum >= BOTTOM_ROUTING_LAYER) {
-              if (enableOutput) {
-                if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::N)) {
-                  cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) already set" <<endl;
-                }
-              }
-              flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::N, bbox, initDR);
-              setGridCostN(xIdx, yIdx, zIdx);
-              if (enableOutput) {
-                if (!flag) {
-                  cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N)" <<endl;
-                } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::N)) {
-                  cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) not set" <<endl;
-                } else {
-                  if (!hasGridCostN(xIdx, yIdx, zIdx)) {
-                    cout <<"check edge cost failed (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) != 1" <<endl;
-                  }
-                  cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N)" <<endl;
-                }
-              }
-            }
-          // horizontal non-pref track
-          } else if (dir == frcVertPrefRoutingDir && yFound3) {
-            if (layerNum >= BOTTOM_ROUTING_LAYER) {
-              if (enableOutput) {
-                if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::E)) {
-                  cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) already set" <<endl;
-                }
-              }
-              flag = addEdge(xIdx, yIdx, zIdx, frDirEnum::E, bbox, initDR);
-              setGridCostE(xIdx, yIdx, zIdx);
-              if (enableOutput) {
-                if (!flag) {
-                  cout <<"edge out of bound (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E)" <<endl;
-                } else if (!hasEdge(xIdx, yIdx, zIdx, frDirEnum::E)) {
-                  cout <<"Error: (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) not set" <<endl;
-                } else {
-                  if (!hasGridCostE(xIdx, yIdx, zIdx)) {
-                    cout <<"check edge cost failed (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) != 1" <<endl;
-                  }
-                  cout <<"add edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E)" <<endl;
-                }
-              }
-            }
-          }
-        }
-        ++xIdx;
-      }
-      ++yIdx;
-    }
-    ++zIdx;
-  }
-}
-
-
-// initialization: update grid graph topology, does not assign edge cost
-void FlexGridGraph::init(const frBox &routeBBox, const frBox &extBBox,
-                         map<frCoord, map<frLayerNum, frTrackPattern* > > &xMap,
-                         map<frCoord, map<frLayerNum, frTrackPattern* > > &yMap,
-                         bool initDR) {
-  bool enableOutput = false;
-  // get tracks intersecting with the Maze bbox
-  map<frLayerNum, frPrefRoutingDirEnum> zMap;
-  initTracks(xMap, yMap, zMap, extBBox);
-  initGrids(xMap, yMap, zMap); // buildGridGraph
-  initEdges(xMap, yMap, zMap, routeBBox, initDR); // add edges and edgeCost
-  if (enableOutput) {
-    for(int i = 0; i < (int)xCoords.size(); i++) {
-      for(int j = 0; j < (int)yCoords.size(); j++) {
-        for(int k = 0; k < (int)zCoords.size(); k++) {
-          cout <<"test x/y/z/E/N/U = "  <<i <<" " <<j <<" " <<k <<" "
-               <<hasGridCostE(i, j, k) <<" "
-               <<hasGridCostN(i, j, k) <<" "
-               <<"0" <<" " <<endl;
-        }
-      }
-    }
-  }
-}
-
-// initialization helpers
-// get all tracks inetersecting with the Maze bbox, left/bottom are inclusive
-void FlexGridGraph::initTracks(map<frCoord, map<frLayerNum, frTrackPattern* > > &xMap,
-                               map<frCoord, map<frLayerNum, frTrackPattern* > > &yMap,
-                               map<frLayerNum, frPrefRoutingDirEnum> &zMap,
-                               const frBox &bbox) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  for (auto &layer: getTech()->getLayers()) {
-    if (layer->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    if (enableOutput) {
-      cout <<"initTracks: " <<layer->getName() <<endl <<flush;
-    }
-    frLayerNum currLayerNum = layer->getLayerNum();
-    frPrefRoutingDirEnum currPrefRouteDir = layer->getDir();
-    //bool hasTrack = false;
-    for (auto &tp: getDesign()->getTopBlock()->getTrackPatterns(currLayerNum)) {
-      bool flag = USENONPREFTRACKS ? 
-                  (tp->isHorizontal()  && currPrefRouteDir == frcVertPrefRoutingDir ||
-                  !tp->isHorizontal() && currPrefRouteDir == frcHorzPrefRoutingDir) : 
-                  true;
-      if (flag) {
-        //cout <<"checkPoint 1" <<endl <<flush;
-        int trackNum = ((tp->isHorizontal() ? bbox.left() : bbox.bottom()) - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (trackNum < 0) {
-          trackNum = 0;
-        }
-        if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < (tp->isHorizontal() ? bbox.left() : bbox.bottom())) {
-          ++trackNum;
-        }
-        for (; 
-             trackNum < (int)tp->getNumTracks() && 
-             trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < (tp->isHorizontal() ? bbox.right() : bbox.top()); 
-             ++trackNum) {
-          frCoord trackLoc = trackNum * tp->getTrackSpacing() + tp->getStartCoord();
-          //cout <<"checkPoint 2" <<endl <<flush;
-          //hasTrack = true;
-          if (tp->isHorizontal()) {
-            xMap[trackLoc][currLayerNum] = tp.get();
-          } else {
-            yMap[trackLoc][currLayerNum] = tp.get();
-          }
-        }
-      }
-    }
-    //if (hasTrack) {
-      //cout <<"checkPoint 3" <<endl <<flush;
-      zMap[currLayerNum] = currPrefRouteDir;
-    //}
-  }
-  if (enableOutput) {
-    cout <<"finish initTracks" <<endl <<flush;
-  }
-}
-
-void FlexGridGraph::resetStatus() {
-  //frMIdx xDim, yDim, zDim;
-  //getDim(xDim, yDim, zDim);
-  //for (frMIdx z = 0; z < zDim; z++) {
-  //  for (frMIdx y = 0; y < yDim; y++) {
-  //    for (frMIdx x = 0; x < xDim; x++) {
-  //      //resetSrc(x, y, z);
-  //      //resetDst(x, y, z);
-  //      setPrevAstarNodeDir(x, y, z, frDirEnum::UNKNOWN);
-  //    }
-  //  }
-  //}
-  resetSrc();
-  resetDst();
-  resetPrevNodeDir();
-}
-
-void FlexGridGraph::resetSrc() {
-  srcs.assign(srcs.size(), 0);
-}
-
-void FlexGridGraph::resetDst() {
-  dsts.assign(dsts.size(), 0);
-}
-
-void FlexGridGraph::resetPrevNodeDir() {
-  //frMIdx xDim, yDim, zDim;
-  //getDim(xDim, yDim, zDim);
-  //for (frMIdx z = 0; z < zDim; z++) {
-  //  for (frMIdx y = 0; y < yDim; y++) {
-  //    for (frMIdx x = 0; x < xDim; x++) {
-  //      setPrevAstarNodeDir(x, y, z, frDirEnum::UNKNOWN);
-  //    }
-  //  }
-  //}
-  prevDirs.assign(prevDirs.size(), 0);
-}
-
-// print the grid graph with edge and vertex for debug purpose
-void FlexGridGraph::print() {
-  ofstream mazeLog(OUT_MAZE_FILE.c_str());
-  if (mazeLog.is_open()) {
-    // print edges
-    frBox gridBBox;
-    getBBox(gridBBox);
-    mazeLog << "printing Maze grid (" << gridBBox.left()  << ", " << gridBBox.bottom() << ") -- (" 
-                                      << gridBBox.right() << ", " << gridBBox.top()    << ")\n";
-    frMIdx xDim, yDim, zDim;
-    getDim(xDim, yDim, zDim);
-
-    if (xDim == 0 || yDim == 0 || zDim == 0) {
-      cout << "Error: dimension == 0\n";
-      return;
-    } else {
-      cout << "(xDim, yDim, zDim) = (" << xDim << ", " << yDim << ", " << zDim << ")\n";
-    }
-
-    // mazeLog << "xDim = " << xDim << ", yDim = " << yDim << ", zDim = " << zDim << "\n";
-
-    frPoint p;
-    for (frMIdx xIdx = 0; xIdx < xDim; ++xIdx) {
-      // mazeLog << "xxxIdx = " << xIdx << "\n" << std::flush;
-      for (frMIdx yIdx = 0; yIdx < yDim; ++yIdx) {
-        for (frMIdx zIdx = 0; zIdx < zDim; ++zIdx) {
-          // mazeLog << "xIdx = " << xIdx << ", yIdx = " << yIdx << ", zIdx = " << zIdx << "\n" << std::flush;
-          if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::N)) {
-            if (yIdx + 1 >= yDim) {
-              cout <<"Error: no edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", N) " <<yDim <<endl;
-              continue;
-            } 
-            mazeLog << "Edge: " << getPoint(p, xIdx, yIdx).x()   << " " << getPoint(p, xIdx, yIdx).y()   << " " << zIdx
-                    << " "      << getPoint(p, xIdx, yIdx+1).x() << " " << getPoint(p, xIdx, yIdx+1).y() << " " << zIdx << "\n";
-          }
-          if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::E)) {
-            if (xIdx + 1 >= xDim) {
-              cout <<"Error: no edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", E) " << xDim <<endl;
-              continue;
-            }
-            mazeLog << "Edge: " << getPoint(p, xIdx, yIdx).x()   << " " << getPoint(p, xIdx, yIdx).y()   << " " << zIdx
-                    << " "      << getPoint(p, xIdx+1, yIdx).x() << " " << getPoint(p, xIdx+1, yIdx).y() << " " << zIdx << "\n";
-          }
-          if (hasEdge(xIdx, yIdx, zIdx, frDirEnum::U)) {
-            if (zIdx + 1 >= zDim) {
-              cout <<"Error: no edge (" <<xIdx <<", " <<yIdx <<", " <<zIdx <<", U) " <<zDim <<endl;
-              continue;
-            }
-            mazeLog << "Edge: " << getPoint(p, xIdx, yIdx).x() << " " << getPoint(p, xIdx, yIdx).y() << " " << zIdx
-                    << " "      << getPoint(p, xIdx, yIdx).x() << " " << getPoint(p, xIdx, yIdx).y() << " " << zIdx + 1 << "\n";
-          }
-        }
-      }
-    }
-  } else {
-    cout << "Error: Fail to open maze log\n";
-  }
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.h b/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.h
deleted file mode 100644
index 089e7b4..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph.h
+++ /dev/null
@@ -1,700 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEX_GRID_GRAPH_H
-#define _FLEX_GRID_GRAPH_H
-
-#define GRIDGRAPHDRCCOSTSIZE 8
-
-#include "frBaseTypes.h"
-#include "FlexMazeTypes.h"
-#include "frDesign.h"
-#include "db/drObj/drPin.h"
-#include "dr/FlexWavefront.h"
-//#include <memory>
-#include <map>
-#include <iostream>
-
-
-namespace fr {
-  class FlexGridGraph {
-  public:
-    // constructors
-    //FlexGridGraph() {}
-    FlexGridGraph(frDesign* designIn): design(designIn)/*, routeBox()*/, bits(), /*mazeMarkers(),*/
-                                       xCoords(), yCoords(), zCoords(), zHeights() {}
-    // getters
-    frTechObject* getTech() const {
-      return design->getTech();
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    // getters
-    // unsafe access, no check
-    bool isAstarVisited(frMIdx x, frMIdx y, frMIdx z) const {
-      return (getPrevAstarNodeDir(x, y, z) == frDirEnum::UNKNOWN);
-    }
-    // unsafe access, no check
-    frDirEnum getPrevAstarNodeDir(frMIdx x, frMIdx y, frMIdx z) const {
-      auto baseIdx = 3 * getIdx(x, y, z);
-      return (frDirEnum)(((unsigned short)(prevDirs[baseIdx]    ) << 2) + 
-                         ((unsigned short)(prevDirs[baseIdx + 1]) << 1) + 
-                         ((unsigned short)(prevDirs[baseIdx + 2]) << 0));
-    }
-    // unsafe access, no check
-    bool isSrc(frMIdx x, frMIdx y, frMIdx z) const {
-      return srcs[getIdx(x, y, z)];
-    }
-    // unsafe access, no check
-    bool isDst(frMIdx x, frMIdx y, frMIdx z) const {
-      return dsts[getIdx(x, y, z)];
-    }
-    // unsafe access, no check
-    //bool isBlocked(frMIdx x, frMIdx y, frMIdx z) const {
-    //  return getBit(getIdx(x, y, z), 5);
-    //}
-    // unsafe access, no check
-    bool isSVia(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 9);
-    }
-    // unsafe access, no check
-    bool hasShapePlanar(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 10);
-    }
-    // unsafe access, no check
-    bool hasShapeVia(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 11);
-    }
-    // unsafe access, no check
-    bool hasGridCostE(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 12);
-    }
-    // unsafe access, no check
-    bool hasGridCostN(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 13);
-    }
-    // unsafe access, no check
-    bool hasGridCostU(frMIdx x, frMIdx y, frMIdx z) const {
-      return getBit(getIdx(x, y, z), 14);
-    }
-
-    //const frBox& getRouteBox() const {
-    //  return routeBox;
-    //}
-    void getBBox(frBox &in) const {
-      if (xCoords.size() && yCoords.size()) {
-        in.set(xCoords.front(), yCoords.front(), xCoords.back(), yCoords.back());
-      }
-    }
-    void getDim(frMIdx &xDim, frMIdx &yDim, frMIdx &zDim) const {
-      xDim = xCoords.size();
-      yDim = yCoords.size();
-      zDim = zCoords.size();
-    }
-    // unsafe access
-    frPoint& getPoint(frPoint &in, frMIdx x, frMIdx y) const {
-      in.set(xCoords[x], yCoords[y]);
-      return in;
-    }
-    // unsafe access
-    frLayerNum getLayerNum(frMIdx z) const {
-      return zCoords[z];
-    }
-    bool hasMazeXIdx(frCoord in) const {
-      return std::binary_search(xCoords.begin(), xCoords.end(), in);
-    }
-    bool hasMazeYIdx(frCoord in) const {
-      return std::binary_search(yCoords.begin(), yCoords.end(), in);
-    }
-    bool hasMazeZIdx(frLayerNum in) const {
-      return std::binary_search(zCoords.begin(), zCoords.end(), in);
-    }
-    bool hasIdx(const frPoint &p, frLayerNum lNum) const {
-      return (hasMazeXIdx(p.x()) && hasMazeYIdx(p.y()) && hasMazeZIdx(lNum));
-    }
-    bool hasMazeIdx(const frPoint &p, frLayerNum lNum) const {
-      return (hasMazeXIdx(p.x()) && hasMazeYIdx(p.y()) && hasMazeZIdx(lNum));
-    }
-    frMIdx getMazeXIdx(frCoord in) const {
-      auto it = std::lower_bound(xCoords.begin(), xCoords.end(), in);
-      return it - xCoords.begin();
-    }
-    frMIdx getMazeYIdx(frCoord in) const {
-      auto it = std::lower_bound(yCoords.begin(), yCoords.end(), in);
-      return it - yCoords.begin();
-    }
-    frMIdx getMazeZIdx(frLayerNum in) const {
-      auto it = std::lower_bound(zCoords.begin(), zCoords.end(), in);
-      return it - zCoords.begin();
-    }
-    FlexMazeIdx& getMazeIdx(FlexMazeIdx &mIdx, const frPoint &p, frLayerNum layerNum) const {
-      mIdx.set(getMazeXIdx(p.x()), getMazeYIdx(p.y()), getMazeZIdx(layerNum));
-      return mIdx;
-    }
-    // unsafe access, z always = 0
-    void getIdxBox(FlexMazeIdx &mIdx1, FlexMazeIdx &mIdx2, const frBox &box) const {
-      mIdx1.set(std::lower_bound(xCoords.begin(), xCoords.end(), box.left()  ) - xCoords.begin(),
-                std::lower_bound(yCoords.begin(), yCoords.end(), box.bottom()) - yCoords.begin(),
-                mIdx1.z());
-      mIdx2.set(frMIdx(std::upper_bound(xCoords.begin(), xCoords.end(), box.right() ) - xCoords.begin()) - 1,
-                frMIdx(std::upper_bound(yCoords.begin(), yCoords.end(), box.top()   ) - yCoords.begin()) - 1,
-                mIdx2.z());
-    }
-    frCoord getZHeight(frMIdx in) const {
-      return zHeights[in];
-    }
-    bool getZDir(frMIdx in) const {
-      return zDirs[in];
-    }
-    bool hasEdge(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) const {
-      correct(x, y, z, dir);
-      if (isValid(x, y, z)) {
-        auto idx = getIdx(x, y, z);
-        switch (dir) {
-          case frDirEnum::E:
-            return getBit(idx, 0);
-          case frDirEnum::N:
-            return getBit(idx, 1);
-          case frDirEnum::U:
-            return getBit(idx, 2);
-          default:
-            return false;
-        }
-      } else {
-        return false;
-      }
-    }
-    bool hasGridCost(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      bool sol = false;
-      correct(x, y, z, dir);
-      switch(dir) {
-        case frDirEnum::E: 
-          sol = hasGridCostE(x, y, z);
-          break;
-        case frDirEnum::N:
-          sol = hasGridCostN(x, y, z);
-          break;
-        default: 
-          sol = hasGridCostU(x, y, z);
-      }
-      return sol;
-    }
-    bool hasShapeCost(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      bool sol = false;
-      if (dir != frDirEnum::D && dir != frDirEnum::U) {
-        reverse(x, y, z, dir);
-        sol = hasShapePlanar(x, y, z);
-      } else {
-        correctU(x, y, z, dir);
-        sol = hasShapeVia(x, y, z);
-      }
-      return sol;
-    }
-    bool hasDRCCost(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      frUInt4 sol = 0;
-      if (dir != frDirEnum::D && dir != frDirEnum::U) {
-        reverse(x, y, z, dir);
-        auto idx = getIdx(x, y, z);
-        sol = (getBits(idx, 16, GRIDGRAPHDRCCOSTSIZE));
-      } else {
-        correctU(x, y, z, dir);
-        auto idx = getIdx(x, y, z);
-        sol = (getBits(idx, 24, GRIDGRAPHDRCCOSTSIZE));
-      }
-      return (sol);
-    }
-    bool hasMarkerCost(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      frUInt4 sol = 0;
-      if (dir != frDirEnum::D && dir != frDirEnum::U) {
-        reverse(x, y, z, dir);
-        auto idx = getIdx(x, y, z);
-        sol = (getBits(idx, 32, GRIDGRAPHDRCCOSTSIZE));
-      } else {
-        correctU(x, y, z, dir);
-        auto idx = getIdx(x, y, z);
-        sol = (getBits(idx, 40, GRIDGRAPHDRCCOSTSIZE));
-      }
-      return (sol);
-    }
-    // unsafe access
-    frCoord getEdgeLength(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      frCoord sol = 0;
-      correct(x, y, z, dir);
-      //if (isValid(x, y, z, dir)) {
-        switch (dir) {
-          case frDirEnum::E:
-            sol = xCoords[x+1] - xCoords[x];
-            break;
-          case frDirEnum::N:
-            sol = yCoords[y+1] - yCoords[y];
-            break;
-          case frDirEnum::U:
-            sol = zHeights[z+1] - zHeights[z];
-            break;
-          default:
-            ;
-        }
-      //}
-      return sol;
-    }
-    bool isEdgeInBox(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir, const frBox &box, bool initDR) {
-      bool sol = false;
-      correct(x, y, z, dir);
-      if (isValid(x, y, z, dir)) {
-        auto x1 = x;
-        auto y1 = y;
-        auto z1 = z;
-        reverse(x1, y1, z1, dir);
-        frPoint pt, pt1;
-        getPoint(pt, x, y);
-        getPoint(pt1, x1, y1);
-        if (box.contains(pt) && box.contains(pt1)) {
-          // initDR must not use top and rightmost track
-          if (initDR && 
-              ((box.right() == pt.x() && box.right() == pt1.x()) ||
-               (box.top()   == pt.y() && box.top()   == pt1.y()))) {
-            sol = false;
-          } else {
-            sol = true;
-          }
-        } else {
-          sol = false;
-        }
-      } else {
-        sol = false;
-      }
-      return sol;
-    }
-    // setters
-    bool addEdge(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir, const frBox &box, bool initDR) {
-      bool sol = false;
-      if (!isEdgeInBox(x, y, z, dir, box, initDR)) {
-        sol = false;
-      } else {
-        //cout <<"orig edge (" <<x <<", " <<y <<", " <<z <<", " <<int(dir) <<")" <<endl;
-        correct(x, y, z, dir);
-        //cout <<"corr edge (" <<x <<", " <<y <<", " <<z <<", " <<int(dir) <<")" <<endl;
-        if (isValid(x, y, z, dir)) {
-          auto idx = getIdx(x, y, z);
-          switch (dir) {
-            case frDirEnum::E:
-              setBit(idx, 0);
-              sol = true;
-              break;
-            case frDirEnum::N:
-              setBit(idx, 1);
-              sol = true;
-              break;
-            case frDirEnum::U:
-              setBit(idx, 2);
-              sol = true;
-              break;
-            default:
-              ;
-          }
-        } else {
-          //cout <<"not valid edge";
-        }
-      }
-      return sol;
-    }
-    bool removeEdge(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      bool sol = false;
-      correct(x, y, z, dir);
-      if (isValid(x, y, z, dir)) {
-        auto idx = getIdx(x, y, z);
-        switch (dir) {
-          case frDirEnum::E:
-            resetBit(idx, 0);
-            sol = true;
-            break;
-          case frDirEnum::N:
-            resetBit(idx, 1);
-            sol = true;
-            break;
-          case frDirEnum::U:
-            resetBit(idx, 2);
-            sol = true;
-            break;
-          default:
-            ;
-        }
-      }
-      return sol;
-    }
-    void addDRCCostPlanar(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      addToBits(idx, 16, GRIDGRAPHDRCCOSTSIZE, 1);
-    }
-    void addDRCCostVia(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      addToBits(idx, 24, GRIDGRAPHDRCCOSTSIZE, 1);
-    }
-    void subDRCCostPlanar(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      subToBits(idx, 16, GRIDGRAPHDRCCOSTSIZE, 1);
-    }
-    void subDRCCostVia(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      subToBits(idx, 24, GRIDGRAPHDRCCOSTSIZE, 1);
-    }
-    void resetDRCCostPlanar(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      setBits(idx, 16, GRIDGRAPHDRCCOSTSIZE, 0);
-    }
-    void resetDRCCostVia(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      setBits(idx, 24, GRIDGRAPHDRCCOSTSIZE, 0);
-    }
-    void addMarkerCostPlanar(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      addToBits(idx, 32, GRIDGRAPHDRCCOSTSIZE, 10);
-    }
-    void addMarkerCostVia(frMIdx x, frMIdx y, frMIdx z) {
-      auto idx = getIdx(x, y, z);
-      addToBits(idx, 40, GRIDGRAPHDRCCOSTSIZE, 10);
-    }
-    bool decayMarkerCostPlanar(frMIdx x, frMIdx y, frMIdx z, float d) {
-      auto idx = getIdx(x, y, z);
-      int currCost = (getBits(idx, 32, GRIDGRAPHDRCCOSTSIZE));
-      currCost *= d;
-      currCost = std::max(0, currCost);
-      setBits(idx, 32, GRIDGRAPHDRCCOSTSIZE, currCost);
-      return (currCost == 0);
-    }
-    bool decayMarkerCostVia(frMIdx x, frMIdx y, frMIdx z, float d) {
-      auto idx = getIdx(x, y, z);
-      int currCost = (getBits(idx, 40, GRIDGRAPHDRCCOSTSIZE));
-      currCost *= d;
-      currCost = std::max(0, currCost);
-      setBits(idx, 40, GRIDGRAPHDRCCOSTSIZE, currCost);
-      return (currCost == 0);
-    }
-    //void resetMarkerCostPlanar(frMIdx x, frMIdx y, frMIdx z) {
-    //  auto idx = getIdx(x, y, z);
-    //  setBits(idx, 32, GRIDGRAPHDRCCOSTSIZE, 0);
-    //}
-    //void resetMarkerCostVia(frMIdx x, frMIdx y, frMIdx z) {
-    //  auto idx = getIdx(x, y, z);
-    //  setBits(idx, 40, GRIDGRAPHDRCCOSTSIZE, 0);
-    //}
-    //void resetCost(frMIdx x, frMIdx y, frMIdx z);
-
-    // unsafe access, no idx check
-    void setPrevAstarNodeDir(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) {
-      auto baseIdx = 3 * getIdx(x, y, z);
-      prevDirs[baseIdx]     = ((unsigned short)dir >> 2) & 1;
-      prevDirs[baseIdx + 1] = ((unsigned short)dir >> 1) & 1;
-      prevDirs[baseIdx + 2] = ((unsigned short)dir     ) & 1;
-    }
-    // unsafe access, no idx check
-    void setSrc(frMIdx x, frMIdx y, frMIdx z) {
-      srcs[getIdx(x, y, z)] = 1;
-    }
-    void setSrc(const FlexMazeIdx &mi) {
-      srcs[getIdx(mi.x(), mi.y(), mi.z())] = 1;
-    }
-    // unsafe access, no idx check
-    void setDst(frMIdx x, frMIdx y, frMIdx z) {
-      dsts[getIdx(x, y, z)] = 1;
-    }
-    void setDst(const FlexMazeIdx &mi) {
-      dsts[getIdx(mi.x(), mi.y(), mi.z())] = 1;
-    }
-    // unsafe access, no idx check
-    //void setBlocked(frMIdx x, frMIdx y, frMIdx z) {
-    //  setBit(getIdx(x, y, z), 5);
-    //}
-    // unsafe access
-    void setSVia(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 9);
-    }
-    void setShapePlanar(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 10);
-    }
-    void setShapeVia(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 11);
-    }
-    void setGridCostE(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 12);
-    }
-    void setGridCostN(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 13);
-    }
-    void setGridCostU(frMIdx x, frMIdx y, frMIdx z) {
-      setBit(getIdx(x, y, z), 14);
-    }
-    // unsafe access, no idx check
-    void resetSrc(frMIdx x, frMIdx y, frMIdx z) {
-      srcs[getIdx(x, y, z)] = 0;
-    }
-    void resetSrc(const FlexMazeIdx &mi) {
-      srcs[getIdx(mi.x(), mi.y(), mi.z())] = 0;
-    }
-    // unsafe access, no idx check
-    void resetDst(frMIdx x, frMIdx y, frMIdx z) {
-      dsts[getIdx(x, y, z)] = 0;
-    }
-    void resetDst(const FlexMazeIdx &mi) {
-      dsts[getIdx(mi.x(), mi.y(), mi.z())] = 0;
-    }
-    // unsafe access, no idx check
-    //void resetBlocked(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 5);
-    //}
-    // unsafe access
-    //void resetSVia(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 9);
-    //}
-    //void resetShapePlanar(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 10);
-    //}
-    void resetShapeVia(frMIdx x, frMIdx y, frMIdx z) {
-      resetBit(getIdx(x, y, z), 11);
-    }
-    //void resetGridCostE(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 12);
-    //}
-    //void resetGridCostN(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 13);
-    //}
-    //void resetGridCostU(frMIdx x, frMIdx y, frMIdx z) {
-    //  resetBit(getIdx(x, y, z), 14);
-    //}
-
-    //void setRouteBox(const frBox &in) const {
-    //  routeBox.set(in);
-    //}
-
-    // functions
-    void init(const frBox &routeBBox, const frBox &extBBox,
-              std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &xMap,
-              std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &yMap,
-              bool initDR);
-    void print();
-    void resetStatus();
-    void resetPrevNodeDir();
-    void resetSrc();
-    void resetDst();
-    bool search(std::vector<FlexMazeIdx> &connComps, drPin* nextPin, std::vector<FlexMazeIdx> &path,
-                FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2);
-    void setCost(frUInt4 drcCostIn, frUInt4 markerCostIn) {
-      ggDRCCost    = drcCostIn;
-      ggMarkerCost = markerCostIn;
-    }
-    frCoord getHalfViaEncArea(frMIdx z, bool isLayer1) const {
-      return (isLayer1 ? halfViaEncArea[z].first: halfViaEncArea[z].second);
-    }
-
-  protected:
-    frDesign* design;
-    //frBox     routeBox;
-    // new
-    // [0] hasEEdge; [1] hasNEdge; [2] hasUpEdge
-    // [3] empty;    [4] empty;    [5] empty
-    // [6] empty;    [7] empty;    [8] empty
-    // [9] hasSpecialVia
-    // [10] shape X cost; [11] shape U cost; 
-    // [12] is W/E on grid; [13] is N/S on grid; [14] is U on grid
-    // [23-16] quick drc X cost; [31-24] quick drc U cost
-    // [39-32] markerdrc X cost; [47-40] markerdrc U cost
-    //frVector<unsigned long long>      bits;
-    frVector<unsigned long long>               bits;
-    std::vector<bool>                          prevDirs;
-    std::vector<bool>                          srcs;
-    std::vector<bool>                          dsts;
-    //std::vector<bool>                          gridsE;
-    //std::vector<bool>                          gridsN;
-    frVector<frCoord>                          xCoords;
-    frVector<frCoord>                          yCoords;
-    frVector<frLayerNum>                       zCoords;
-    frVector<frCoord>                          zHeights; // accumulated Z diff
-    std::vector<bool>                          zDirs; // is horz dir
-    frUInt4                                    ggDRCCost;
-    frUInt4                                    ggMarkerCost;
-    // temporary variables
-    FlexWavefront                              wavefront;
-    std::vector<std::pair<frCoord, frCoord> >  halfViaEncArea; // std::pair<layer1area, layer2area>
-
-    // internal getters
-    bool getBit(frMIdx idx, frMIdx pos) const {
-      return (bits[idx] >> pos ) & 1;
-    }
-    frUInt4 getBits(frMIdx idx, frMIdx pos, frUInt4 length) const {
-      auto tmp = bits[idx] & (((1ull << length) - 1) << pos); // mask
-      //auto tmp = bits[idx] & (((1u << length) - 1) << pos); // mask
-      return tmp >> pos;
-    }
-    frMIdx getIdx(frMIdx xIdx, frMIdx yIdx, frMIdx zIdx) const {
-      ////auto sol = xIdx + yIdx * xCoords.size() + zIdx * xCoords.size() * yCoords.size();
-      ////if (sol >= 0 && sol < bits.size()) {
-      //  return xIdx + yIdx * xCoords.size() + zIdx * xCoords.size() * yCoords.size();
-      ////} else {
-      ////  std::cout <<"Error: currIdx x/y/z " <<xIdx <<"/" <<yIdx <<"/" <<zIdx <<" " <<sol <<" is illegal" <<std::endl <<std::flush;
-      ////  throw std::runtime_error("error");
-      ////}
-      
-      //      (isZDir == H)     
-      return (getZDir(zIdx)) ? (xIdx + yIdx * xCoords.size() + zIdx * xCoords.size() * yCoords.size()): 
-                               (yIdx + xIdx * yCoords.size() + zIdx * xCoords.size() * yCoords.size());
-    }
-    // internal setters
-    void setBit(frMIdx idx, frMIdx pos) {
-      bits[idx] |= 1 << pos;
-    }
-    void resetBit(frMIdx idx, frMIdx pos) {
-      bits[idx] &= ~(1 << pos);
-    }
-    void addToBits(frMIdx idx, frMIdx pos, frUInt4 length, frUInt4 val) {
-      auto tmp = getBits(idx, pos, length) + val;
-      tmp = (tmp > (1u << length)) ? (1u << length) : tmp;
-      setBits(idx, pos, length, tmp);
-    }
-    void subToBits(frMIdx idx, frMIdx pos, frUInt4 length, frUInt4 val) {
-      int tmp = (int)getBits(idx, pos, length) - (int)val;
-      tmp = (tmp < 0) ? 0 : tmp;
-      setBits(idx, pos, length, tmp);
-    }
-    void setBits(frMIdx idx, frMIdx pos, frUInt4 length, frUInt4 val) {
-      //std::cout <<"setBits (idx/pos/len/val) " <<idx <<" " <<pos <<" " <<length <<" " <<val <<std::endl;
-      bits[idx] &= ~(((1ull << length) - 1) << pos); // clear related bits to 0
-      bits[idx] |= ((unsigned long long)val & ((1ull << length) - 1)) << pos; // only get last length bits of val
-      //bits[idx] &= ~(((1u << length) - 1) << pos); // clear related bits to 0
-      //bits[idx] |= (val & ((1u << length) - 1)) << pos; // only get last length bits of val
-    }
-
-    // internal utility
-    void correct(frMIdx &x, frMIdx &y, frMIdx &z, frDirEnum &dir) const {
-      switch (dir) {
-        case frDirEnum::W:
-          x--;
-          dir = frDirEnum::E;
-          break;
-        case frDirEnum::S:
-          y--;
-          dir = frDirEnum::N;
-          break;
-        case frDirEnum::D:
-          z--;
-          dir = frDirEnum::U;
-          break;
-        default:
-          ;
-      }
-      return;
-    }
-    void correctU(frMIdx &x, frMIdx &y, frMIdx &z, frDirEnum &dir) const {
-      switch (dir) {
-        case frDirEnum::D:
-          z--;
-          dir = frDirEnum::U;
-          break;
-        default:
-          ;
-      }
-      return;
-    }
-    void reverse(frMIdx &x, frMIdx &y, frMIdx &z, frDirEnum &dir) const {
-      switch (dir) {
-        case frDirEnum::E:
-          x++;
-          dir = frDirEnum::W;
-          break;
-        case frDirEnum::S:
-          y--;
-          dir = frDirEnum::N;
-          break;
-        case frDirEnum::W:
-          x--;
-          dir = frDirEnum::E;
-          break;
-        case frDirEnum::N:
-          y++;
-          dir = frDirEnum::S;
-          break;
-        case frDirEnum::U:
-          z++;
-          dir = frDirEnum::D;
-          break;
-        case frDirEnum::D:
-          z--;
-          dir = frDirEnum::U;
-          break;
-        default:
-          ;
-      }
-      return;
-    }
-    void getPrevGrid(frMIdx &gridX, frMIdx &gridY, frMIdx &gridZ, const frDirEnum dir) const;
-    void getNextGrid(frMIdx &gridX, frMIdx &gridY, frMIdx &gridZ, const frDirEnum dir);
-    bool isValid(frMIdx x, frMIdx y, frMIdx z) const {
-      if (x < 0 || y < 0 || z < 0 ||
-          x >= (frMIdx)xCoords.size() || y >= (frMIdx)yCoords.size() || z >= (frMIdx)zCoords.size()) {
-        return false;
-      } else {
-        return true;
-      }
-    }
-    bool isValid(frMIdx x, frMIdx y, frMIdx z, frDirEnum dir) const {
-      auto sol = isValid(x, y, z);
-      reverse(x, y, z, dir);
-      return sol && isValid(x, y, z);
-    }
-    //bool isOpposite(const frDirEnum &dir1, const frDirEnum &dir2) const {
-    //  return ((int)dir1 + (int)dir2 == OPPOSITEDIR);
-    //}
-    // internal init utility
-    void initTracks(std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &horLoc2TrackPatterns,
-                    std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &vertLoc2TrackPatterns,
-                    std::map<frLayerNum, frPrefRoutingDirEnum> &layerNum2PreRouteDir,
-                    const frBox &bbox);
-    void initGrids(const std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &xMap,
-                   const std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &yMap,
-                   const std::map<frLayerNum, frPrefRoutingDirEnum> &zMap);
-    void initEdges(const std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &xMap,
-                   const std::map<frCoord, std::map<frLayerNum, frTrackPattern* > > &yMap,
-                   const std::map<frLayerNum, frPrefRoutingDirEnum> &zMap,
-                   const frBox &bbox, bool initDR);
-    frCost getEstCost(const FlexMazeIdx &src, const FlexMazeIdx &dstMazeIdx1, const FlexMazeIdx &dstMazeIdx2, const frDirEnum &dir);
-    frCost getNextPathCost(const FlexWavefrontGrid &currGrid, const frDirEnum &dir);
-    frDirEnum getLastDir(const std::bitset<WAVEFRONTBITSIZE> &buffer);
-    void traceBackPath(const FlexWavefrontGrid &currGrid, std::vector<FlexMazeIdx> &path, 
-                       std::vector<FlexMazeIdx> &root, FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2);
-    void expandWavefront(FlexWavefrontGrid &currGrid, const FlexMazeIdx &dstMazeIdx1, const FlexMazeIdx &dstMazeIdx2);
-    bool isExpandable(const FlexWavefrontGrid &currGrid, frDirEnum dir);
-    //bool isOpposite(const frDirEnum &dir1, const frDirEnum &dir2);
-    FlexMazeIdx getTailIdx(const FlexMazeIdx &currIdx, const FlexWavefrontGrid &currGrid);
-    void expand(FlexWavefrontGrid &currGrid, const frDirEnum &dir, const FlexMazeIdx &dstMazeIdx1, const FlexMazeIdx &dstMazeIdx2);
-  };
-}
-
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph_maze.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph_maze.cpp
deleted file mode 100644
index 65c22bc..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexGridGraph_maze.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexGridGraph.h"
-
-using namespace std;
-using namespace fr;
-
-/*inline*/ void FlexGridGraph::expand(FlexWavefrontGrid &currGrid, const frDirEnum &dir, 
-                          const FlexMazeIdx &dstMazeIdx1, const FlexMazeIdx &dstMazeIdx2) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  frCost nextEstCost, nextPathCost;
-  int gridX = currGrid.x();
-  int gridY = currGrid.y();
-  int gridZ = currGrid.z();
-
-  getNextGrid(gridX, gridY, gridZ, dir);
-  
-  FlexMazeIdx nextIdx(gridX, gridY, gridZ);
-  // get cost
-  nextEstCost = getEstCost(nextIdx, dstMazeIdx1, dstMazeIdx2, dir);
-  nextPathCost = getNextPathCost(currGrid, dir);  
-  if (enableOutput) {
-    std::cout << "  expanding from (" << currGrid.x() << ", " << currGrid.y() << ", " << currGrid.z() 
-              << ") [pathCost / totalCost = " << currGrid.getPathCost() << " / " << currGrid.getCost() << "] to "
-              << "(" << gridX << ", " << gridY << ", " << gridZ << ") [pathCost / totalCost = " 
-              << nextPathCost << " / " << nextPathCost + nextEstCost << "]\n";
-  }
-  //FlexWavefrontGrid nextWavefrontGrid(gridX, gridY, gridZ, nextPathCost, nextPathCost + nextEstCost, currGrid.getBackTraceBuffer());
-  auto lNum = getLayerNum(currGrid.z());
-  auto pathWidth = getDesign()->getTech()->getLayer(lNum)->getWidth();
-  FlexWavefrontGrid nextWavefrontGrid(gridX, gridY, gridZ, 
-                                      currGrid.getLayerPathArea() + 
-                                      getEdgeLength(currGrid.x(), currGrid.y(), currGrid.z(), dir) * pathWidth, 
-                                      nextPathCost, nextPathCost + nextEstCost, currGrid.getBackTraceBuffer());
-  if (dir == frDirEnum::U || dir == frDirEnum::D) {
-    nextWavefrontGrid.resetLayerPathArea();
-    nextWavefrontGrid.addLayerPathArea((dir == frDirEnum::U) ? getHalfViaEncArea(currGrid.z(), false) : getHalfViaEncArea(gridZ, true));
-  }
-  // update wavefront buffer
-  auto tailDir = nextWavefrontGrid.shiftAddBuffer(dir);
-  // commit grid prev direction if needed
-  auto tailIdx = getTailIdx(nextIdx, nextWavefrontGrid);
-  if (tailDir != frDirEnum::UNKNOWN) {
-    if (getPrevAstarNodeDir(tailIdx.x(), tailIdx.y(), tailIdx.z()) == frDirEnum::UNKNOWN ||
-        getPrevAstarNodeDir(tailIdx.x(), tailIdx.y(), tailIdx.z()) == tailDir) {
-      setPrevAstarNodeDir(tailIdx.x(), tailIdx.y(), tailIdx.z(), tailDir);
-      wavefront.push(nextWavefrontGrid);
-      if (enableOutput) {
-        std::cout << "    commit (" << tailIdx.x() << ", " << tailIdx.y() << ", " << tailIdx.z() << ") prev accessing dir = " << (int)tailDir << "\n";
-      }
-    }
-  } else {  
-    // add to wavefront
-    wavefront.push(nextWavefrontGrid);
-  }
-  return;
-}
-
-/*inline*/ void FlexGridGraph::expandWavefront(FlexWavefrontGrid &currGrid, 
-                                   const FlexMazeIdx &dstMazeIdx1, const FlexMazeIdx &dstMazeIdx2) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (enableOutput) {
-    cout << "start expand from (" << currGrid.x() << ", " << currGrid.y() << ", " << currGrid.z() << ")\n";
-  }
-  //if (currGrid.y() == 19 && currGrid.z() == 0) {
-  //  cout <<"is expandable (" <<currGrid.x() <<", " <<currGrid.y() <<", " <<currGrid.z() <<") NESWUD "
-  //       <<isExpandable(currGrid, frDirEnum::N)
-  //       <<isExpandable(currGrid, frDirEnum::E)
-  //       <<isExpandable(currGrid, frDirEnum::S)
-  //       <<isExpandable(currGrid, frDirEnum::W)
-  //       <<isExpandable(currGrid, frDirEnum::U)
-  //       <<isExpandable(currGrid, frDirEnum::D)
-  //       <<endl;
-  //  cout <<"has edge " 
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::N)
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::E)
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::S)
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::W)
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::U)
-  //       <<gridGraph.hasEdge(currGrid.x(), currGrid.y(), currGrid.z(), frDirEnum::D)
-  //       <<endl;
-  //  int gridX = currGrid.x();
-  //  int gridY = currGrid.y();
-  //  int gridZ = currGrid.z();
-  //  if (!gridGraph.hasEdge(gridX, gridY, gridZ, frDirEnum::E)) {
-  //    ;
-  //  } else {
-  //    getNextGrid(gridX, gridY, gridZ, frDirEnum::E);
-  //    if (gridGraph.isBlocked(gridX, gridY, gridZ)) {
-  //      cout <<"blocked" <<endl;
-  //    } else if (gridGraph.isSrc(gridX, gridY, gridZ)) {
-  //      cout <<"src" <<endl;
-  //    } else if (gridGraph.getPrevAstarNodeDir(gridX, gridY, gridZ) != frDirEnum::UNKNOWN) {
-  //      cout <<"visited" <<endl;
-  //    } else {
-  //      ;
-  //    }
-  //  }
-  //}
-  //auto tmpGrid = currWavefrontGrid;
-  //// commit grid prev direction if needed
-  //auto tailIdx = getTailIdx(nextIdx, nextWavefrontGrid);
-  //if (tailDir != frDirEnum::UNKNOWN) {
-  //  if (getPrevAstarNodeDir(tailIdx.x(), tailIdx.y(), tailIdx.z()) == frDirEnum::UNKNOWN) {
-  //    ;
-  //  }
-  //}
-  // N
-  if (isExpandable(currGrid, frDirEnum::N)) {
-    expand(currGrid, frDirEnum::N, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no N" <<endl;
-  // }
-  // E
-  if (isExpandable(currGrid, frDirEnum::E)) {
-    expand(currGrid, frDirEnum::E, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no E" <<endl;
-  // }
-  // S
-  if (isExpandable(currGrid, frDirEnum::S)) {
-    expand(currGrid, frDirEnum::S, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no S" <<endl;
-  // }
-  // W
-  if (isExpandable(currGrid, frDirEnum::W)) {
-    expand(currGrid, frDirEnum::W, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no W" <<endl;
-  // }
-  // U
-  if (isExpandable(currGrid, frDirEnum::U)) {
-    expand(currGrid, frDirEnum::U, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no U" <<endl;
-  // }
-  // D
-  if (isExpandable(currGrid, frDirEnum::D)) {
-    expand(currGrid, frDirEnum::D, dstMazeIdx1, dstMazeIdx2);
-  }
-  // else {
-  //   std::cout <<"no D" <<endl;
-  // }
-}
-
-/*inline*/ frCost FlexGridGraph::getEstCost(const FlexMazeIdx &src, const FlexMazeIdx &dstMazeIdx1,
-                                const FlexMazeIdx &dstMazeIdx2, const frDirEnum &dir) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<"est from (" <<src.x() <<", " <<src.y() <<", " <<src.z() <<") "
-         <<"to ("       <<dstMazeIdx1.x() <<", " <<dstMazeIdx1.y() <<", " <<dstMazeIdx1.z() <<") ("
-                        <<dstMazeIdx2.x() <<", " <<dstMazeIdx2.y() <<", " <<dstMazeIdx2.z() <<")";
-  }
-  // bend cost
-  int bendCnt = 0;
-  frPoint srcPoint, dstPoint1, dstPoint2;
-  getPoint(srcPoint, src.x(), src.y());
-  getPoint(dstPoint1, dstMazeIdx1.x(), dstMazeIdx1.y());
-  getPoint(dstPoint2, dstMazeIdx2.x(), dstMazeIdx2.y());
-  //auto minCostX = std::abs(srcPoint.x() - dstPoint.x()) * 1;
-  //auto minCostY = std::abs(srcPoint.y() - dstPoint.y()) * 1;
-  //auto minCostZ = std::abs(gridGraph.getZHeight(src.z()) - gridGraph.getZHeight(dst.z())) * VIACOST;
-  frCoord minCostX = max(max(dstPoint1.x() - srcPoint.x(), srcPoint.x() - dstPoint2.x()), 0) * 1;
-  frCoord minCostY = max(max(dstPoint1.y() - srcPoint.y(), srcPoint.y() - dstPoint2.y()), 0) * 1;
-  frCoord minCostZ = max(max(getZHeight(dstMazeIdx1.z()) - getZHeight(src.z()), 
-                       getZHeight(src.z()) - getZHeight(dstMazeIdx2.z())), 0) * 1;
-  if (enableOutput) {
-    cout <<" x/y/z min cost = (" <<minCostX <<", " <<minCostY <<", " <<minCostZ <<") " <<endl;
-  }
-
-  bendCnt += (minCostX && dir != frDirEnum::UNKNOWN && dir != frDirEnum::E && dir != frDirEnum::W) ? 1 : 0;
-  bendCnt += (minCostY && dir != frDirEnum::UNKNOWN && dir != frDirEnum::S && dir != frDirEnum::N) ? 1 : 0;
-  bendCnt += (minCostZ && dir != frDirEnum::UNKNOWN && dir != frDirEnum::U && dir != frDirEnum::D) ? 1 : 0;
-  //bendCnt -= bendCnt ? 1 : 0;
-  // return (deltaX + deltaY + VIACOST * deltaZ + ((deltaX && deltaY) ? 1 : 0));
-  if (enableOutput) {
-    cout << "  est cost = " << minCostX + minCostY + minCostZ + bendCnt << endl;
-  }
-  return (minCostX + minCostY + minCostZ + bendCnt);
-
-}
-
-/*inline*/ frDirEnum FlexGridGraph::getLastDir(const std::bitset<WAVEFRONTBITSIZE> &buffer) {
-  auto currDirVal = buffer.to_ulong() & 0b111u;
-  return static_cast<frDirEnum>(currDirVal);
-}
-
-void FlexGridGraph::getNextGrid(frMIdx &gridX, frMIdx &gridY, frMIdx &gridZ, const frDirEnum dir) {
-  switch(dir) {
-    case frDirEnum::E:
-      ++gridX;
-      break;
-    case frDirEnum::S:
-      --gridY;
-      break;
-    case frDirEnum::W:
-      --gridX;
-      break;
-    case frDirEnum::N:
-      ++gridY;
-      break;
-    case frDirEnum::U:
-      ++gridZ;
-      break;
-    case frDirEnum::D:
-      --gridZ;
-      break;
-    default:
-      ;
-  }
-  return;
-}
-
-void FlexGridGraph::getPrevGrid(frMIdx &gridX, frMIdx &gridY, frMIdx &gridZ, const frDirEnum dir) const {
-  switch(dir) {
-    case frDirEnum::E:
-      --gridX;
-      break;
-    case frDirEnum::S:
-      ++gridY;
-      break;
-    case frDirEnum::W:
-      ++gridX;
-      break;
-    case frDirEnum::N:
-      --gridY;
-      break;
-    case frDirEnum::U:
-      --gridZ;
-      break;
-    case frDirEnum::D:
-      ++gridZ;
-      break;
-    default:
-      ;
-  }
-  return;
-}
-
-/*inline*/ frCost FlexGridGraph::getNextPathCost(const FlexWavefrontGrid &currGrid, const frDirEnum &dir) {
-  // bool enableOutput = true;
-  bool enableOutput = false;
-  frMIdx gridX = currGrid.x();
-  frMIdx gridY = currGrid.y();
-  frMIdx gridZ = currGrid.z();
-  frCost nextPathCost = currGrid.getPathCost();
-  // bending cost
-  //auto currDir = getLastDir(currGrid.getBackTraceBuffer());
-  auto currDir = currGrid.getLastDir();
-  // std::cout << "(currDir = " << (int)currDir << ") ";
-  // if (currDir != dir && (int)currDir >= 1 && (int)currDir <= 4 &&
-  //                       (int)dir     >= 1 && (int)dir     <= 4) {
-  //   ++nextPathCost;
-  // }
-  if (currDir != dir && currDir != frDirEnum::UNKNOWN) {
-    ++nextPathCost;
-  }
-  // // attempt to resolve minArea
-  auto lNum = getLayerNum(currGrid.z());
-  auto pathWidth = getDesign()->getTech()->getLayer(lNum)->getWidth();
-  //frCoord currArea = (currGrid.getLayerPathLength() + pathWidth) * pathWidth; 
-  frCoord currArea = currGrid.getLayerPathArea();
-  if (dir == frDirEnum::U) {
-    currArea += getHalfViaEncArea(currGrid.z(), true);
-  } else if (dir == frDirEnum::D) {
-    currArea += getHalfViaEncArea(currGrid.z() - 1, false);
-  }
-  auto minAreaConstraint = getDesign()->getTech()->getLayer(lNum)->getAreaConstraint();
-  if (minAreaConstraint && (dir == frDirEnum::U || dir == frDirEnum::D) && currArea < minAreaConstraint->getMinArea()) {
-    nextPathCost += ggDRCCost * minAreaConstraint->getMinArea() / pathWidth;
-    //nextPathCost += ggDRCCost * pathWidth;
-    // if (TEST) {
-    //   std::cout << "@@@MAR (" <<currGrid.x() <<", " <<currGrid.y() <<", " <<currGrid.z() <<") dir = " << (int)dir << "\n";
-    // }
-  }
-  //frMIdx nextGridX = gridX;
-  //frMIdx nextGridY = gridY;
-  //frMIdx nextGridZ = gridZ;
-  //getNextGrid(nextGridX, nextGridY, nextGridZ, dir);
-  //nextPathCost += gridGraph.getEdgeCost(gridX, gridY, gridZ, dir) * gridGraph.getEdgeLength(gridX, gridY, gridZ, dir);
-  bool gridCost   = hasGridCost(gridX, gridY, gridZ, dir);
-  bool drcCost    = hasDRCCost(gridX, gridY, gridZ, dir);
-  bool markerCost = hasMarkerCost(gridX, gridY, gridZ, dir);
-  bool shapeCost  = hasShapeCost(gridX, gridY, gridZ, dir);
-
-  nextPathCost += getEdgeLength(gridX, gridY, gridZ, dir)
-                  + (gridCost   ? GRIDCOST         * getEdgeLength(gridX, gridY, gridZ, dir) : 0)
-                  + (drcCost    ? ggDRCCost        * getEdgeLength(gridX, gridY, gridZ, dir) : 0)
-                  + (markerCost ? ggMarkerCost     * getEdgeLength(gridX, gridY, gridZ, dir) : 0)
-                  + (shapeCost  ? SHAPECOST        * getEdgeLength(gridX, gridY, gridZ, dir) : 0);
-  if (enableOutput) {
-    cout <<"edge grid/shape/drc/marker/length = " 
-         <<hasGridCost(gridX, gridY, gridZ, dir)   <<"/"
-         <<hasShapeCost(gridX, gridY, gridZ, dir)  <<"/"
-         <<hasDRCCost(gridX, gridY, gridZ, dir)    <<"/"
-         <<hasMarkerCost(gridX, gridY, gridZ, dir) <<"/"
-         <<getEdgeLength(gridX, gridY, gridZ, dir) <<endl;
-  }
-  return nextPathCost;
-
-}
-
-/*inline*/ FlexMazeIdx FlexGridGraph::getTailIdx(const FlexMazeIdx &currIdx, const FlexWavefrontGrid &currGrid) {
-  int gridX = currIdx.x();
-  int gridY = currIdx.y();
-  int gridZ = currIdx.z();
-  auto backTraceBuffer = currGrid.getBackTraceBuffer();
-  for (int i = 0; i < WAVEFRONTBUFFERSIZE; ++i) {
-    int currDirVal = backTraceBuffer.to_ulong() - ((backTraceBuffer.to_ulong() >> DIRBITSIZE) << DIRBITSIZE);
-    frDirEnum currDir = static_cast<frDirEnum>(currDirVal);
-    backTraceBuffer >>= DIRBITSIZE;
-    getPrevGrid(gridX, gridY, gridZ, currDir);
-  }
-  return FlexMazeIdx(gridX, gridY, gridZ);
-}
-
-/*inline*/ bool FlexGridGraph::isExpandable(const FlexWavefrontGrid &currGrid, frDirEnum dir) {
-  frMIdx gridX = currGrid.x();
-  frMIdx gridY = currGrid.y();
-  frMIdx gridZ = currGrid.z();
-  reverse(gridX, gridY, gridZ, dir);
-  if (!hasEdge(gridX, gridY, gridZ, dir) || 
-      isSrc(gridX, gridY, gridZ) || 
-      getPrevAstarNodeDir(gridX, gridY, gridZ) != frDirEnum::UNKNOWN ||
-      currGrid.getLastDir() == dir) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-void FlexGridGraph::traceBackPath(const FlexWavefrontGrid &currGrid, vector<FlexMazeIdx> &path, vector<FlexMazeIdx> &root,
-                                  FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout << "    start traceBackPath...\n";
-  }
-  frDirEnum prevDir = frDirEnum::UNKNOWN, currDir;
-  int currX = currGrid.x(), currY = currGrid.y(), currZ = currGrid.z();
-  // pop content in buffer
-  auto backTraceBuffer = currGrid.getBackTraceBuffer();
-  for (int i = 0; i < WAVEFRONTBUFFERSIZE; ++i) {
-    // current grid is src
-    if (isSrc(currX, currY, currZ)) {
-      break;
-    }
-    // get last direction
-    currDir = getLastDir(backTraceBuffer);
-    backTraceBuffer >>= DIRBITSIZE;
-    if (currDir == frDirEnum::UNKNOWN) {
-      cout << "Warning: unexpected direction in tracBackPath\n";
-      break;
-    }
-    // add to root
-    root.push_back(FlexMazeIdx(currX, currY, currZ));
-    // push point to path
-    if (currDir != prevDir) {
-      path.push_back(FlexMazeIdx(currX, currY, currZ));
-      if (enableOutput) {
-        cout <<" -- (" <<currX <<", " <<currY <<", " <<currZ <<")";
-      }
-    }
-    getPrevGrid(currX, currY, currZ, currDir);
-    prevDir = currDir;
-  }
-  // trace back according to grid prev dir
-  while (isSrc(currX, currY, currZ) == false) {
-    // add to root
-    root.push_back(FlexMazeIdx(currX, currY, currZ));
-    // get last direction
-    currDir = getPrevAstarNodeDir(currX, currY, currZ);
-    if (currDir == frDirEnum::UNKNOWN) {
-      cout << "Warning: unexpected direction in tracBackPath\n";
-      break;
-    }
-    if (currDir != prevDir) {
-      path.push_back(FlexMazeIdx(currX, currY, currZ));
-      if (enableOutput) {
-        cout <<" -- (" <<currX <<", " <<currY <<", " <<currZ <<")";
-      }
-    }
-    getPrevGrid(currX, currY, currZ, currDir);
-    prevDir = currDir;
-  }
-  // add final path to src, only add when path exists; no path exists (src = dst)
-  if (!path.empty()) {
-    path.push_back(FlexMazeIdx(currX, currY, currZ));
-    if (enableOutput) {
-      cout <<" -- (" <<currX <<", " <<currY <<", " <<currZ <<")";
-    }
-  }
-  for (auto &mi: path) {
-    ccMazeIdx1.set(min(ccMazeIdx1.x(), mi.x()),
-                   min(ccMazeIdx1.y(), mi.y()),
-                   min(ccMazeIdx1.z(), mi.z()));
-    ccMazeIdx2.set(max(ccMazeIdx2.x(), mi.x()),
-                   max(ccMazeIdx2.y(), mi.y()),
-                   max(ccMazeIdx2.z(), mi.z()));
-  }
-  if (enableOutput) {
-    cout <<endl;
-  }
-
-}
-
-bool FlexGridGraph::search(vector<FlexMazeIdx> &connComps, drPin* nextPin, vector<FlexMazeIdx> &path,FlexMazeIdx &ccMazeIdx1, FlexMazeIdx &ccMazeIdx2) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  int stepCnt = 0;
-
-  // prep nextPinBox
-  frMIdx xDim, yDim, zDim;
-  getDim(xDim, yDim, zDim);
-  FlexMazeIdx dstMazeIdx1(xDim - 1, yDim - 1, zDim - 1);
-  FlexMazeIdx dstMazeIdx2(0, 0, 0);
-  FlexMazeIdx mi;
-  for (auto &ap: nextPin->getAccessPatterns()) {
-    ap->getMazeIdx(mi);
-    dstMazeIdx1.set(min(dstMazeIdx1.x(), mi.x()),
-                    min(dstMazeIdx1.y(), mi.y()),
-                    min(dstMazeIdx1.z(), mi.z()));
-    dstMazeIdx2.set(max(dstMazeIdx2.x(), mi.x()),
-                    max(dstMazeIdx2.y(), mi.y()),
-                    max(dstMazeIdx2.z(), mi.z()));
-  }
-
-  // std::cout << "start astarSearch\n";
-  wavefront = FlexWavefront();
-  // init wavefront
-  for (auto &idx: connComps) {
-    if (isDst(idx.x(), idx.y(), idx.z())) {
-      if (enableOutput) {
-        cout <<"message: astarSearch dst covered (" <<idx.x() <<", " <<idx.y() <<", " <<idx.z() <<")" <<endl;
-      }
-      path.push_back(FlexMazeIdx(idx.x(), idx.y(), idx.z()));
-      return true;
-    }
-    // get min area min length
-    auto lNum = getLayerNum(idx.z());
-    //auto pathWidth = getDesign()->getTech()->getLayer(lNum)->getWidth();
-    auto minAreaConstraint = getDesign()->getTech()->getLayer(lNum)->getAreaConstraint();
-    frCoord fakeArea = minAreaConstraint->getMinArea();
-
-    FlexWavefrontGrid currGrid(idx.x(), idx.y(), idx.z(), fakeArea, 0, getEstCost(idx, dstMazeIdx1, dstMazeIdx2, frDirEnum::UNKNOWN));
-    wavefront.push(currGrid);
-    if (enableOutput) {
-      cout <<"src add to wavefront (" <<idx.x() <<", " <<idx.y() <<", " <<idx.z() <<")" <<endl;
-    }
-  }
-  while(!wavefront.empty()) {
-    // std::cout << "here1\n";
-    auto currGrid = wavefront.top();
-    wavefront.pop();
-    if (getPrevAstarNodeDir(currGrid.x(), currGrid.y(), currGrid.z()) != frDirEnum::UNKNOWN) {
-      continue;
-    }
-    // test
-    if (enableOutput) {
-      ++stepCnt;
-    }
-    // if (stepCnt % 100000 == 0) {
-    //   std::cout << "wavefront size = " << wavefront.size() << " at step = " << stepCnt << "\n";
-    // }
-    if (isDst(currGrid.x(), currGrid.y(), currGrid.z())) {
-      traceBackPath(currGrid, path, connComps, ccMazeIdx1, ccMazeIdx2);
-      if (enableOutput) {
-        cout << "path found. stepCnt = " << stepCnt << "\n";
-      }
-      return true;
-    } else {
-      // expand and update wavefront
-      expandWavefront(currGrid, dstMazeIdx1, dstMazeIdx2);
-    }
-    
-  }
-  return false;
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexMazeTypes.h b/scripts/pdn/src/PdnPinDumper/src/dr/FlexMazeTypes.h
deleted file mode 100644
index 806e59f..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexMazeTypes.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEX_MAZE_TYPES_H_
-#define _FLEX_MAZE_TYPES_H_
-
-namespace fr {
-  class FlexMazeIdx {
-  public:
-    FlexMazeIdx(): xIdx(-1), yIdx(-1), zIdx(-1) {}
-    FlexMazeIdx(frMIdx xIn, frMIdx yIn, frMIdx zIn): xIdx(xIn), yIdx(yIn), zIdx(zIn) {}
-    // getters
-    frMIdx x() const {
-      return xIdx;
-    }
-    frMIdx y() const {
-      return yIdx;
-    }
-    frMIdx z() const {
-      return zIdx;
-    }
-    bool empty() const {
-      return (xIdx == -1 && yIdx == -1 && zIdx == -1);
-    }
-    // setters
-    void set(frMIdx xIn, frMIdx yIn, frMIdx zIn) {
-      xIdx = xIn;
-      yIdx = yIn;
-      zIdx = zIn;
-    }
-    void set(const FlexMazeIdx &in) {
-      xIdx = in.x();
-      yIdx = in.y();
-      zIdx = in.z();
-    }
-    // others
-    bool operator<(const FlexMazeIdx &rhs) const {
-      if (this->xIdx != rhs.x()) {
-        return this->xIdx < rhs.x();
-      } else if (this->yIdx != rhs.y()) {
-        return this->yIdx < rhs.y();
-      } else {
-        return this->zIdx < rhs.z();
-      }
-    }
-    bool operator==(const FlexMazeIdx &rhs) const {
-      return (xIdx == rhs.xIdx && yIdx == rhs.yIdx && zIdx == rhs.zIdx);
-    }
-
-    friend std::ostream& operator<<(std::ostream& os, const FlexMazeIdx &mIdx) {
-      os <<"(" <<mIdx.x() <<", " <<mIdx.y() <<", " <<mIdx.z() <<")";
-      return os;
-    }
-
-  protected:
-    frMIdx xIdx;
-    frMIdx yIdx;
-    frMIdx zIdx;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.cpp b/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.cpp
deleted file mode 100644
index 6e91aad..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "dr/FlexRegionQuery.h"
-using namespace std;
-using namespace fr;
-
-void FlexRegionQuery::add(frListIter<frPathSeg> &pathSeg) {
-  frBox frb;
-  pathSeg->getBBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //frListIter<int> test;
-  //int* ptr = new int(3);
-  //shared_ptr<frConnFig> ptr = nullptr;
-  //pathsegs.at(pathSeg->getLayerNum()).insert(make_pair(boostb, ptr));
-  //unique_lock lock(mutex_pathsegs.at(pathSeg->getLayerNum()));
-  //unique_lock lock(m);
-  pathsegs.at(pathSeg->getLayerNum()).insert(make_pair(boostb, pathSeg));
-}
-
-void FlexRegionQuery::add(frListIter<frVia> &via) {
-  frBox frb;
-  via->getLayer1BBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock1(mutex_vias.at(vias->getViaDef()->getLayer1Num()));
-  vias.at(via->getViaDef()->getLayer1Num()).insert(make_pair(boostb, via));
-  //lock1.unlock();
-
-  via->getLayer2BBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock2(mutex_vias.at(vias->getViaDef()->getLayer2Num()));
-  vias.at(via->getViaDef()->getLayer2Num()).insert(make_pair(boostb, via));
-  //lock2.unlock();
-
-  via->getCutBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock3(mutex_vias.at(vias->getViaDef()->getCutLayerNum()));
-  vias.at(via->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, via));
-  //lock3.unlock();
-}
-
-void FlexRegionQuery::add(frListIter<FlexAccessPattern> &ap) {
-  frPoint beginPoint, endPoint;
-  ap->getPoints(beginPoint, endPoint);
-  box_t boostb = box_t(point_t(endPoint.x(), endPoint.y()), point_t(endPoint.x(), endPoint.y()));
-  aps.at(ap->getEndLayerNum()).insert(make_pair(boostb, ap));
-}
-
-void FlexRegionQuery::add(frShape* shape) {
-  frBox frb;
-  shape->getBBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(shape->getLayerNum()).insert(make_pair(boostb, shape));
-}
-
-void FlexRegionQuery::add(frVia *via) {
-  frBox frb;
-  via->getLayer1BBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getLayer1Num()).insert(make_pair(boostb, via));
-
-  via->getLayer2BBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getLayer2Num()).insert(make_pair(boostb, via));
-
-  via->getCutBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, via));
-}
-
-void FlexRegionQuery::remove(frListIter<frPathSeg> &pathSeg) {
-  frBox frb;
-  pathSeg->getBBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock(mutex_pathsegs.at(pathSeg->getLayerNum()));
-  pathsegs.at(pathSeg->getLayerNum()).remove(make_pair(boostb, pathSeg));
-}
-
-void FlexRegionQuery::remove(frListIter<frVia> &via) {
-  frBox frb;
-  via->getLayer1BBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock1(mutex_vias.at(vias->getViaDef()->getLayer1Num()));
-  vias.at(via->getViaDef()->getLayer1Num()).remove(make_pair(boostb, via));
-  //lock1.unlock();
-
-  via->getLayer2BBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock2(mutex_vias.at(vias->getViaDef()->getLayer2Num()));
-  vias.at(via->getViaDef()->getLayer2Num()).remove(make_pair(boostb, via));
-  //lock2.unlock();
-
-  via->getCutBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  //unique_lock lock3(mutex_vias.at(vias->getViaDef()->getCutLayerNum()));
-  vias.at(via->getViaDef()->getCutLayerNum()).remove(make_pair(boostb, via));
-  //lock3.unlock();
-}
-
-void FlexRegionQuery::remove(frListIter<FlexAccessPattern> &ap) {
-  frPoint beginPoint, endPoint;
-  ap->getPoints(beginPoint, endPoint);
-  box_t boostb = box_t(point_t(endPoint.x(), endPoint.y()), point_t(endPoint.x(), endPoint.y()));
-  aps.at(ap->getEndLayerNum()).remove(make_pair(boostb, ap));
-}
-
-void FlexRegionQuery::remove(frShape* shape) {
-  frBox frb;
-  shape->getBBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(shape->getLayerNum()).remove(make_pair(boostb, shape));
-}
-
-void FlexRegionQuery::remove(frVia *via) {
-  frBox frb;
-  via->getLayer1BBox(frb);
-  box_t boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getLayer1Num()).remove(make_pair(boostb, via));
-
-  via->getLayer2BBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getLayer2Num()).remove(make_pair(boostb, via));
-
-  via->getCutBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  shapes.at(via->getViaDef()->getCutLayerNum()).remove(make_pair(boostb, via));
-}
-
-void FlexRegionQuery::query(const frBox &box, frLayerNum layerNum, frVector<frListIter<frPathSeg> > &result) {
-  vector<rq_iter_value_t<frPathSeg> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  pathsegs.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frVector<frListIter<frPathSeg> > &result) {
-  vector<rq_iter_value_t<frPathSeg> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: pathsegs) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frLayerNum layerNum, frVector<frListIter<frVia> > &result) {
-  vector<rq_iter_value_t<frVia> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  vias.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frVector<frListIter<frVia> > &result) {
-  vector<rq_iter_value_t<frVia> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: vias) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frLayerNum layerNum, frVector<frListIter<FlexAccessPattern> > &result) {
-  vector<rq_iter_value_t<FlexAccessPattern> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  aps.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frVector<frListIter<FlexAccessPattern> > &result) {
-  vector<rq_iter_value_t<FlexAccessPattern> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: aps) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frLayerNum layerNum, frVector<frPinFig*> &result) {
-  vector<rq_rptr_value_t<frPinFig> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  shapes.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::query(const frBox &box, frVector<frPinFig*> &result) {
-  vector<rq_rptr_value_t<frPinFig> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: shapes) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void FlexRegionQuery::init(frLayerNum numLayers) {
-  pathsegs.clear();
-  vias.clear();
-  aps.clear();
-  shapes.clear();
-  pathsegs.resize(numLayers);
-  vias.resize(numLayers);
-  aps.resize(numLayers);
-  shapes.resize(numLayers);
-}
-
-void FlexRegionQuery::print() {
-  cout <<endl;
-  for (int i = 0; i < (int)getTech()->getLayers().size(); i++) {
-    frString layerName;
-    getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" pathseg region query size = " <<pathsegs.at(i).size() <<endl <<flush;
-  }
-  cout <<endl;
-  for (int i = 0; i < (int)getTech()->getLayers().size(); i++) {
-    frString layerName;
-    getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" via region query size = " <<vias.at(i).size() <<endl <<flush;
-  }
-  cout <<endl;
-  for (int i = 0; i < (int)getTech()->getLayers().size(); i++) {
-    frString layerName;
-    getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" ap region query size = " <<aps.at(i).size() <<endl <<flush;
-  }
-  cout <<endl;
-  for (int i = 0; i < (int)getTech()->getLayers().size(); i++) {
-    frString layerName;
-    getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" shape region query size = " <<shapes.at(i).size() <<endl <<flush;
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.h b/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.h
deleted file mode 100644
index eca9f75..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexRegionQuery.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEX_REGIONQUERY_H_
-#define _FLEX_REGIONQUERY_H_
-
-//#include <mutex>
-//#include <shared_mutex>
-#include "frBaseTypes.h"
-#include "frDesign.h"
-#include "db/obj/frShape.h"
-#include "db/obj/frVia.h"
-#include "FlexAccessPattern.h"
-
-namespace fr {
-  class FlexRegionQuery {
-  public:
-    //FlexRegionQuery(): tech(std::make_shared<frTechObject>()), design(std::make_shared<frDesign>()) {};
-    FlexRegionQuery(const std::shared_ptr<frTechObject> &techIn, const std::shared_ptr<frDesign> &designIn): 
-                tech(techIn), design(designIn) {};
-    // getters
-    std::shared_ptr<frTechObject> getTech() const {
-      return tech.lock();
-    }
-    std::shared_ptr<frDesign> getDesign() const {
-      return design.lock();
-    }
-    // setters
-    void add(frListIter<frPathSeg> &pathSeg);
-    void add(frListIter<frVia> &via);
-    void add(frListIter<FlexAccessPattern> &ap);
-    void add(frShape* shape);
-    void add(frVia* shape);
-    void remove(frListIter<frPathSeg> &pathSeg);
-    void remove(frListIter<frVia> &via);
-    void remove(frListIter<FlexAccessPattern> &ap);
-    void remove(frShape* shape);
-    void remove(frVia* shape);
-    void query(const frBox &box, frLayerNum layerNum, frVector<frListIter<frPathSeg> > &result);
-    void query(const frBox &box, frLayerNum layerNum, frVector<frListIter<frVia> > &result);
-    void query(const frBox &box, frLayerNum layerNum, frVector<frListIter<FlexAccessPattern> > &result);
-    void query(const frBox &box, frLayerNum layerNum, frVector<frPinFig*> &result);
-    void query(const frBox &box, frVector<frListIter<frPathSeg> > &result);
-    void query(const frBox &box, frVector<frListIter<frVia> > &result);
-    void query(const frBox &box, frVector<frListIter<FlexAccessPattern> > &result);
-    void query(const frBox &box, frVector<frPinFig*> &result);
-    // others
-    void init(frLayerNum numLayers);
-    void print();
-    
-  protected:
-    std::weak_ptr<frTechObject>     tech;
-    std::weak_ptr<frDesign>         design;
-    std::vector< bgi::rtree< rq_iter_value_t<frPathSeg>,          bgi::quadratic<16> > > pathsegs;
-    std::vector< bgi::rtree< rq_iter_value_t<frVia>,              bgi::quadratic<16> > > vias;
-    std::vector< bgi::rtree< rq_iter_value_t<FlexAccessPattern>,  bgi::quadratic<16> > > aps;
-    std::vector< bgi::rtree< rq_rptr_value_t<frPinFig>,           bgi::quadratic<16> > > shapes;
-    //mutable std::shared_mutex m;
-    //std::vector< mutable std::shared_mutex > mutex_pathsegs;
-    //std::vector< mutable std::shared_mutex > mutex_vias;
-    //std::vector< mutable std::shared_mutex > mutex_shapes;
-  };
-}
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/FlexWavefront.h b/scripts/pdn/src/PdnPinDumper/src/dr/FlexWavefront.h
deleted file mode 100644
index 1db1101..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/FlexWavefront.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FLEX_WF_H
-#define _FLEX_WF_H
-
-#include <queue>
-#include <bitset>
-#include <vector>
-#include "frBaseTypes.h"
-#include "dr/FlexMazeTypes.h"
-#include <memory>
-#include "global.h"
-
-namespace fr {
-  class FlexWavefrontGrid {
-  public:
-    FlexWavefrontGrid(): xIdx(-1), yIdx(-1), zIdx(-1), pathCost(0), cost(0), layerPathArea(0), backTraceBuffer() {}
-    //FlexWavefrontGrid(int xIn, int yIn, int zIn, frCost pathCostIn, frCost costIn, std::bitset<WAVEFRONTBITSIZE> backTraceBufferIn): 
-    //                  xIdx(xIn), yIdx(yIn), zIdx(zIn), pathCost(pathCostIn), cost(costIn), layerPathLength(0), backTraceBuffer(backTraceBufferIn) {}
-    FlexWavefrontGrid(int xIn, int yIn, int zIn, frCoord layerPathAreaIn, frCost pathCostIn, frCost costIn): 
-                      xIdx(xIn), yIdx(yIn), zIdx(zIn), pathCost(pathCostIn), cost(costIn), layerPathArea(layerPathAreaIn), backTraceBuffer() {}
-    FlexWavefrontGrid(int xIn, int yIn, int zIn, frCoord layerPathAreaIn, frCost pathCostIn, frCost costIn, std::bitset<WAVEFRONTBITSIZE> backTraceBufferIn): 
-                      xIdx(xIn), yIdx(yIn), zIdx(zIn), pathCost(pathCostIn), cost(costIn), layerPathArea(layerPathAreaIn), backTraceBuffer(backTraceBufferIn) {}
-    // bool operator<(const FlexWavefrontGrid &b) const {
-    //   return this->cost > b.cost;
-    // }
-    bool operator<(const FlexWavefrontGrid &b) const {
-      if (this->cost != b.cost) {
-        return this->cost > b.cost;
-      } else {
-        return this->pathCost < b.pathCost;
-      }
-    }
-    frMIdx x() const {
-      return xIdx;
-    }
-    frMIdx y() const {
-      return yIdx;
-    }
-    frMIdx z() const {
-      return zIdx;
-    }
-    frCost getPathCost() const {
-      return pathCost;
-    }
-    frCost getCost() const {
-      return cost;
-    }
-    std::bitset<WAVEFRONTBITSIZE> getBackTraceBuffer() const {
-      return backTraceBuffer;
-    }
-    frCoord getLayerPathArea() const {
-      return layerPathArea;
-    }
-    void resetLayerPathArea() {
-      layerPathArea = 0;
-    }
-    void addLayerPathArea(frCoord in) {
-      layerPathArea += in;
-    }
-    frDirEnum getLastDir() const {
-      auto currDirVal = backTraceBuffer.to_ulong() & 0b111u;
-      return static_cast<frDirEnum>(currDirVal);
-    }
-    bool isBufferFull() const {
-      std::bitset<WAVEFRONTBITSIZE> mask = WAVEFRONTBUFFERHIGHMASK;
-      return (mask & backTraceBuffer).any();
-    }
-    //std::bitset<DIRBITSIZE> shiftAddBuffer(const frDirEnum &dir) {
-    frDirEnum shiftAddBuffer(const frDirEnum &dir) {
-      //std::bitset<WAVEFRONTBITSIZE> mask = WAVEFRONTBUFFERHIGHMASK;
-      //std::bitset<DIRBITSIZE> retBS = (int)((mask & backTraceBuffer) >> (WAVEFRONTBITSIZE - DIRBITSIZE)).to_ulong();
-      auto retBS = static_cast<frDirEnum>((backTraceBuffer >> (WAVEFRONTBITSIZE - DIRBITSIZE)).to_ulong());
-      backTraceBuffer <<= DIRBITSIZE;
-      std::bitset<WAVEFRONTBITSIZE> newBS = (unsigned)dir;
-      backTraceBuffer |= newBS;
-      return retBS;
-    }
-  protected:
-    frMIdx xIdx, yIdx, zIdx;
-    frCost pathCost; // path cost
-    frCost cost; // path + est cost
-    frCoord layerPathArea;
-    std::bitset<WAVEFRONTBITSIZE> backTraceBuffer;
-  };
-
-
-  class FlexWavefront {
-  public:
-    // void init(std::shared_ptr<FlexMazePin> rootPin);
-    bool empty() const {
-      return wavefrontPQ.empty();
-    }
-    const FlexWavefrontGrid& top() const {
-      return wavefrontPQ.top();
-    }
-    void pop() {
-      wavefrontPQ.pop();
-    }
-    void push(const FlexWavefrontGrid &in) {
-      wavefrontPQ.push(in);
-    }
-    unsigned int size() const {
-      return wavefrontPQ.size();
-    }
-  protected:
-    std::priority_queue<FlexWavefrontGrid> wavefrontPQ;
-  };
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/dr/Makefile b/scripts/pdn/src/PdnPinDumper/src/dr/Makefile
deleted file mode 100644
index 4c54705..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/dr/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= FlexDR.o FlexGridGraph.o FlexDR_init.o FlexDR_maze.o FlexDR_end.o FlexDR_conn.o FlexDR_rq.o FlexGridGraph_maze.o
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/Makefile b/scripts/pdn/src/PdnPinDumper/src/drc/Makefile
deleted file mode 100644
index 32dc7dd..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= frDRC_init.o frDRC_setup.o  frDRC_main.o  frDRC_util.o
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC.h b/scripts/pdn/src/PdnPinDumper/src/drc/frDRC.h
deleted file mode 100644
index fae60cd..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_DRC_H_
-#define _FR_DRC_H_
-
-#include "frBaseTypes.h"
-#include "frDesign.h"
-#include "db/tech/frConstraint.h"
-#include "db/obj/frMarker.h"
-#include <boost/icl/interval_set.hpp>
-#include "db/drObj/drNet.h"
-
-namespace fr {
-  enum class drcEdgeTypeEnum {
-    UNKNOWN = 0,
-    FIXED = 1,
-    ROUTE = 2
-  };
-
-  enum class drcSpecialNetIdEnum {
-    OBS = 0,
-    FLOATPOWER = 1,
-    FLOATGROUND = 2,
-    FLOATSIGNAL = 3
-  };
-
-  class DRCNet;
-  class DRCEdge;
-  // class drConnFig;
-  // class drNet;
-  // class drVia;
-  // class drPathSeg;
-
-  class DRCWorker {
-  public:
-    // constructor
-    DRCWorker() {}
-    DRCWorker(frDesign* designIn, frVector<frBlockObject*> objsIn): design(designIn), objs(objsIn), target(nullptr) {}
-    // getters
-    frVector<frMarker>& getViolations() {
-      return markers;
-    }
-    // setters
-
-    // functions
-    void init();
-    void addDRNets(const std::vector<std::unique_ptr<drNet> > &nets);
-    void setTarget(frBlockObject* in) {
-      target = in;
-    }
-    void setup();
-    void main();
-    void report();
-
-  protected:
-    frDesign* design;
-    // constraints
-    std::map<frLayerNum, frVector<frConstraint*> > layer2Constraints;
-    // objects
-    frVector<frBlockObject*> objs; // all objects that the DRCWorker sees intiially. Sort later
-    frBlockObject* target;
-    frVector<drConnFig*> drConnFigs;
-    frVector<frBlockObject*> terms; // including terms and instTerms
-    frVector<frConnFig*> connFigs; // including wire and via
-    frVector<frBlockObject*> blockages; 
-    // internal information
-    int netCnt = 4;
-    int targetNetId = -1;
-    std::map<frNet*, int> net2Id; // OBS's netId == 0, floating power net Id == 1, 
-                                  // floating ground net Id == 2, floating signal net == 3
-    std::map<frTerm*, int> term2Id; 
-    frVector<std::unique_ptr<DRCNet> > drcNets;
-    std::map<frLayerNum, bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > > layer2EdgeRTree; // segment to Edge
-    std::map<frLayerNum, bgi::rtree<std::pair<box_t, int>, bgi::quadratic<16> > > layer2FixedRTree, layer2MergedRTree; // max rectangle to netId
-    
-    // output
-    frVector<frMarker> markers;
-
-    // functions
-    void populateLayerConstraints();
-    void initNetRects();
-    void initSpecialNets();
-    void initNetRects_terms();
-    void initNetRects_connFigs();
-    void initNetRects_blockages();
-    void initNetRects_drConnFigs();
-    void sortObj();
-    void setupEdgeRTree();
-    void setupEdgeRTree_net(DRCNet* net);
-    void setupMaxRectRTree();
-    void setupMaxRectRTree_net(DRCNet* net);
-    void updateMaxRectRtree(int netId, 
-                            const std::map<frLayerNum, PolygonSet> &layer2PolySet, 
-                            std::map<frLayerNum, bgi::rtree<std::pair<box_t, int>, bgi::quadratic<16> > > &maxRectRTree);
-    
-
-    // rule check related
-    void checkMetalShort();
-    void checkMetalSpacingRules();
-    void checkMetalSpacingTablePrlRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,  
-                                       frSpacingTablePrlConstraint* constraint);
-    void checkMetalSpacingEndOfLineRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,  
-                                        frSpacingEndOfLineConstraint* constraint);
-    void checkCutSpacingRules();
-    void checkCutSpacingRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,
-                             frCutSpacingConstraint* constraint);
-    void checkMinWidthRule();
-    void checkMinWidthRule_net(DRCNet* drcNet);
-    void checkMetalMinAreaRule();
-    void checkMetalMinAreaRule_net(DRCNet* drcNet);
-    void checkMetalMinStepRule();
-    void checkMetalMinStepRule_net(DRCNet* drcNet);
-    
-
-    // utility
-    void addDRConnFig(drConnFig* in);
-    void getSpacingTableTestBox(const segment_t &seg, DRCEdge* prlEdge, frCoord maxSpacingVal, box_t &testBox);
-    bool isOppositeDir(frDirEnum dir1, frDirEnum dir2);
-    void getEdgeSpanBox(const segment_t &seg, const frDirEnum &dir, const frCoord &span, box_t &edgeSpanBox);
-    void getEdgeSpanRect(const segment_t &seg, const frDirEnum &dir, const frCoord &span, Rectangle &edgeSpanRect);
-    void getEOLTestBox(const segment_t &seg, DRCEdge* eolEdge, const frCoord &eolSpace, const frCoord &eolWithin, box_t &testBox);
-    void getParallelEdgeBoxs(const segment_t &seg,
-                              DRCEdge *eolEdge, 
-                              const frCoord &parSpace,
-                              const frCoord &parWithin,
-                              const frCoord &eolWithin,
-                              box_t &parallelEdgeBoxLeft,
-                              box_t &parallelEdgeBoxRight);
-    bool isEolEdge(DRCEdge* edge);
-    frDirEnum leftEdgeDir(const frDirEnum &dirIn);
-    frDirEnum rightEdgeDir(const frDirEnum &dirIn);
-    void printEdgeRTree();
-    bool covered_by(const boost::icl::discrete_interval<frCoord, std::less> &intv,
-                    const boost::icl::interval_set<frCoord> &intvSet);
-    frCoord rectDiagLength(const Rectangle &rect);
-
-  };
-  
-  class DRCNet {
-  public:
-    // constructor
-    DRCNet() {}
-    DRCNet(int netIdIn): id(netIdIn), src(nullptr) {}
-    // getters
-    int getId() {
-      return id;
-    }
-    // frNet* getNet() {
-    //   return dbNet;
-    // }
-    frBlockObject* getSrc() {
-      return src;
-    }
-    frVector<std::pair<frLayerNum, Rectangle> >& getFixedRects() {
-      return fixedRects;
-    }
-    frVector<std::pair<frLayerNum, Rectangle> >& getRouteRects() {
-      return routeRects;
-    }
-    std::map<frLayerNum, PolygonSet>& getLayer2FixedPolySet() {
-      return layer2FixedPolySet;
-    }
-    std::map<frLayerNum, PolygonSet>& getLayer2RoutePolySet() {
-      return layer2RoutePolySet;
-    }
-    std::map<frLayerNum, std::map<Segment, DRCEdge*> >& getLayerSegEdgeMap() {
-      return layer2Seg2Edge;
-    }
-
-    // setters
-    void setId(int idIn) {
-      id = idIn;
-    }
-    // void setNet(frNet* netIn) {
-    //   dbNet = netIn;
-    // }
-    void setSrc(frBlockObject *srcIn) {
-      src = srcIn;
-    }
-    void addFixedRect(const std::pair<frLayerNum, Rectangle> &layerRectIn) {
-      fixedRects.push_back(layerRectIn);
-    }
-    void addRouteRect(const std::pair<frLayerNum, Rectangle> &layerRectIn) {
-      routeRects.push_back(layerRectIn);
-    }
-    void addFixedLayerPoly(const frLayerNum &layerNumIn, const Polygon &polyIn) {
-      using namespace boost::polygon::operators;
-      layer2FixedPolySet[layerNumIn] += polyIn;
-    }
-    void addFixedLayerRect(const frLayerNum &layerNumIn, const Rectangle &rectIn) {
-      using namespace boost::polygon::operators;
-      layer2FixedPolySet[layerNumIn] += rectIn;
-    }
-    void addRouteLayerPoly(const frLayerNum &layerNumIn, const Polygon &polyIn) {
-      using namespace boost::polygon::operators;
-      layer2RoutePolySet[layerNumIn] += polyIn;
-    }
-    void addRouteLayerRect(const frLayerNum &layerNumIn, const Rectangle &rectIn) {
-      using namespace boost::polygon::operators;
-      layer2RoutePolySet[layerNumIn] += rectIn;
-    }
-    DRCEdge* addDRCEdge() {
-      drcEdges.push_back(std::make_unique<DRCEdge>());
-      return (drcEdges.back().get());
-    }
-    void addToLayerSegEdgeMap(const frLayerNum &layerNumIn, const Segment &segIn, DRCEdge* edgeIn) {
-      layer2Seg2Edge[layerNumIn][segIn] = edgeIn;
-    }
-
-  protected:
-    int id;
-    // frNet* dbNet;
-    // frInstTerm *dbInstTerm;
-    // frTerm *dbTerm;
-    frBlockObject *src;
-    frVector<std::pair<frLayerNum, Rectangle> > fixedRects, routeRects;
-    std::map<frLayerNum, PolygonSet> layer2FixedPolySet, layer2RoutePolySet;
-    std::vector<std::unique_ptr<DRCEdge> > drcEdges;
-    std::map<frLayerNum, std::map<Segment, DRCEdge*> > layer2Seg2Edge;
-  };
-
-  class DRCEdge {
-  public:
-    // constructor
-    DRCEdge() : netId(-1), type(drcEdgeTypeEnum::UNKNOWN), dir(frDirEnum::UNKNOWN), prev(nullptr), next(nullptr), span(-1), width(-1) {}
-    // getters
-    int getNetId() {
-      return netId;
-    }
-    frLayerNum getLayerNum() {
-      return layerNum;
-    }
-    Segment getSegment() {
-      return seg;
-    }
-    drcEdgeTypeEnum getType() {
-      return type;
-    }
-    frDirEnum getDir() {
-      return dir;
-    }
-    DRCEdge* getPrevEdge() {
-      return prev;
-    }
-    DRCEdge* getNextEdge() {
-      return next;
-    }
-    frCoord getSpan() {
-      return span;
-    }
-    frCoord getWidth() {
-      return width;
-    }
-    boost::polygon::direction_1d getWinding() {
-      return winding;
-    }
-
-    // setters
-    void setId(const int &netIdIn) {
-      netId = netIdIn;
-    }
-    void setLayerNum(const frLayerNum &layerNumIn) {
-      layerNum = layerNumIn;
-    }
-    void setSegment(const Segment &segIn) {
-      seg = segIn;
-    }
-    void setType(const drcEdgeTypeEnum &typeIn) {
-      type = typeIn;
-    }
-    void setDir(const frDirEnum &dirIn) {
-      dir = dirIn;
-    }
-    void setPrev(DRCEdge* prevIn) {
-      prev = prevIn;
-    }
-    void setNext(DRCEdge* nextIn) {
-      next = nextIn;
-    }
-    void setSpan(const frCoord &spanIn) {
-      span = spanIn;
-    }
-    void setWidth(const frCoord &widthIn) {
-      width = widthIn;
-    }
-    void setWinding(const boost::polygon::direction_1d &in) {
-      winding = in;
-    }
-    
-    
-  protected:
-    int netId;
-    Segment seg;
-    frLayerNum layerNum;
-    drcEdgeTypeEnum type;
-    frDirEnum dir; // the direction perpendicular to the edge and towards outside of polygon
-    DRCEdge *prev, *next; // clockwise linked list of edges for minstep checking, eol checking
-    frCoord span, width;
-    boost::polygon::direction_1d winding;
-  };
-
-}
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_init.cpp b/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_init.cpp
deleted file mode 100644
index 51abee3..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_init.cpp
+++ /dev/null
@@ -1,692 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "drc/frDRC.h"
-#include "io/frShapeUtil.h"
-#include <memory>
-#include <iterator>
-#include <iostream>
-#include <math.h>
-#include <fstream>
-#include <chrono>
-
-using namespace std::chrono;
-
-void fr::DRCWorker::init() {
-  bool enableOutput = false;
-  // populateLayerConstraints();
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  sortObj();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  initNetRects();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  // general setup is done
-  if (enableOutput) {
-    duration<double> time_span0 = duration_cast<duration<double>>(t1 - t0);
-    duration<double> time_span1 = duration_cast<duration<double>>(t2 - t1);
-    std::stringstream ss;
-    ss   <<"time (SORTOBJ/INITNETRECTS) " <<time_span0.count() <<" " 
-                                     <<time_span1.count() <<" "
-                                     << std::endl;
-    std::cout <<ss.str() << std::flush;
-  }
-}
-
-// void fr::DRCWorker::populateLayerConstraints() {
-//   for (auto &layer: design->getTech()->getLayers()) {
-//     frLayerNum currLayerNum = layer->getLayerNum();
-//     for (auto &constraint: layer->getConstraints()) {
-//       layer2Constraints[currLayerNum].push_back(constraint.get());
-//     }
-//   }
-// }
-
-void fr::DRCWorker::initNetRects() {
-  initSpecialNets();
-  initNetRects_terms();
-  initNetRects_connFigs();
-  initNetRects_drConnFigs();
-  initNetRects_blockages();
-}
-
-void fr::DRCWorker::initNetRects_drConnFigs() {
-  // double dbu = design->getTech()->getDBUPerUU();
-  for (auto obj: drConnFigs) {
-    DRCNet* drcNet = nullptr;
-    switch (obj->typeId()) {
-      case drcPathSeg:
-      {
-        int netId = -1;
-        drPathSeg* pathSeg = static_cast<drPathSeg*>(obj);
-        // get netId
-        if (pathSeg->hasNet()) {
-          if (net2Id.find(pathSeg->getNet()->getFrNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(pathSeg->getNet()->getFrNet())) {
-              targetNetId = netId;
-            }
-            (drcNets.back())->setSrc(pathSeg->getNet()->getFrNet());
-            net2Id[pathSeg->getNet()->getFrNet()] = netId;
-          } else {
-            netId = net2Id[pathSeg->getNet()->getFrNet()];
-          }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-        
-        frLayerNum layerNum = pathSeg->getLayerNum();
-        frBox bbox;
-        pathSeg->getBBox(bbox);
-        Rectangle pathSegRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-        // std::cout << "  add pathseg bbox (" << bbox.left() / dbu<< ", " << bbox.bottom() / dbu
-        //           << ") -- (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ") from net " << netId << "\n";
-        drcNet->addRouteLayerRect(layerNum, pathSegRect);
-        // std::cout << "  added pathSeg\n" << std::flush;
-
-        break;
-      }
-      case drcVia:
-      {
-        int netId = -1;
-        drVia* via = static_cast<drVia*>(obj);
-        // get netId
-        if (via->hasNet()) {
-          if (net2Id.find(via->getNet()->getFrNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(via->getNet()->getFrNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(via->getNet());
-            (drcNets.back())->setSrc(via->getNet()->getFrNet());
-            net2Id[via->getNet()->getFrNet()] = netId;
-          } else {
-            netId = net2Id[via->getNet()->getFrNet()];
-          }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape. TODO: handle cut layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-
-        // push layer1 rect
-        // double dbu = design->getTech()->getDBUPerUU();
-        frLayerNum layerNum1 = via->getViaDef()->getLayer1Num();
-        frTransform xform;
-        via->getTransform(xform);
-        for (auto &fig: via->getViaDef()->getLayer1Figs()) {
-          
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          // std::cout << "  add to net" << netId << " layer " << layerNum1 << " (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu
-          //           << ") - (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-          drcNet->addRouteLayerRect(layerNum1, bboxRect);
-        }
-
-        // push cut layer rect
-        frLayerNum cutLayerNum = via->getViaDef()->getCutLayerNum();
-        for (auto &fig: via->getViaDef()->getCutFigs()) {
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          drcNet->addRouteLayerRect(cutLayerNum, bboxRect);
-        }
-
-        // push layer2 rect
-        frLayerNum layerNum2 = via->getViaDef()->getLayer2Num();
-        for (auto &fig: via->getViaDef()->getLayer2Figs()) {
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          // std::cout << "  add to net" << netId << " layer " << layerNum2 << " (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu
-          //           << ") - (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-          drcNet->addRouteLayerRect(layerNum2, bboxRect);
-        }
-        break;
-      }
-      case drcPatchWire:
-      {
-        int netId = -1;
-        drPatchWire* pwire = static_cast<drPatchWire*>(obj);
-        // get netId
-        if (pwire->hasNet()) {
-          if (net2Id.find(pwire->getNet()->getFrNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(pwire->getNet()->getFrNet())) {
-              targetNetId = netId;
-            }
-            (drcNets.back())->setSrc(pwire->getNet()->getFrNet());
-            net2Id[pwire->getNet()->getFrNet()] = netId;
-          } else {
-            netId = net2Id[pwire->getNet()->getFrNet()];
-          }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-        
-        frLayerNum layerNum = pwire->getLayerNum();
-        frBox bbox;
-        pwire->getBBox(bbox);
-        Rectangle patchWireRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-        // std::cout << "  add pathseg bbox (" << bbox.left() / dbu<< ", " << bbox.bottom() / dbu
-        //           << ") -- (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ") from net " << netId << "\n";
-        drcNet->addRouteLayerRect(layerNum, patchWireRect);
-        // std::cout << "  added pwire\n" << std::flush;
-
-        break;
-      }
-
-      default:
-        std::cout << "Warning: unsupported connFig type in initNetRects_connFigs, skipped...\n";
-    }
-  }
-}
-
-
-void fr::DRCWorker::initSpecialNets() {
-  for (int i = 0; i < netCnt; ++i) {
-    drcNets.push_back(std::make_unique<DRCNet>(i));
-  }
-}
-
-void fr::DRCWorker::initNetRects_terms() {
-  for (auto obj: terms) {
-    DRCNet* drcNet = nullptr;
-    switch (obj->typeId()) {
-      case frcInstTerm:
-      {
-        int netId = -1;
-        frInstTerm *instTerm = static_cast<frInstTerm*>(obj);
-        frInst* inst = instTerm->getInst();
-        frBox mbox;
-        frTransform xform;
-        inst->getUpdatedXform(xform);
-        auto term = instTerm->getTerm();
-        // get netId
-        if (instTerm->hasNet()) {
-          if (net2Id.find(instTerm->getNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(instTerm->getNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(instTerm->getNet());
-            (drcNets.back())->setSrc(instTerm->getNet());
-            net2Id[instTerm->getNet()] = netId;
-          } else {
-            netId = net2Id[instTerm->getNet()];
-          }
-        } else {
-          if (term->getType() == frTermEnum::frcNormalTerm || 
-              term->getType() == frTermEnum::frcClockTerm) {
-            // netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(instTerm)) {
-              targetNetId = netId;
-            }
-            (drcNets.back())->setSrc(instTerm);
-            term2Id[term] = netId;
-          } else if (term->getType() == frTermEnum::frcPowerTerm) {
-            netId = static_cast<int>(drcSpecialNetIdEnum::FLOATPOWER);
-          } else if (term->getType() == frTermEnum::frcGroundTerm) {
-            netId = static_cast<int>(drcSpecialNetIdEnum::FLOATGROUND);
-          }
-        }
-
-        // push layer shapes
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_terms\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-
-        for (auto &pin: term->getPins()) {
-          auto pinLayer2PolySet = pin->getLayer2PolySet();
-          for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-            auto &layerNum = layerIt->first;
-            auto &polySet = layerIt->second;
-            for (auto &poly: polySet) {
-              std::vector<Point> transformedPoints;
-              for (auto it = begin_points(poly); it != end_points(poly); ++it) {
-                frPoint tmpPt((*it).x(), (*it).y());
-                tmpPt.transform(xform);
-                transformedPoints.push_back(Point(tmpPt.x(), tmpPt.y()));
-              }
-              Polygon tmpPoly;
-              set_points(tmpPoly, transformedPoints.begin(), transformedPoints.end());
-              drcNet->addFixedLayerPoly(layerNum, tmpPoly);
-            }
-          }
-        }
-        break;
-      }
-      case frcTerm:
-      {
-        int netId = -1;
-        frTerm* term = static_cast<frTerm*>(obj);
-        // get netId
-        if (term->hasNet()) {
-          if (net2Id.find(term->getNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(term->getNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(term->getNet());
-            (drcNets.back())->setSrc(term->getNet());
-            net2Id[term->getNet()] = netId;
-          } else {
-            netId = net2Id[term->getNet()];
-          }
-        } else {
-          if (term->getType() == frTermEnum::frcNormalTerm || 
-              term->getType() == frTermEnum::frcClockTerm) {
-            // netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(term)) {
-              targetNetId = netId;
-            }
-            (drcNets.back())->setSrc(term);
-            term2Id[term] = netId;
-          } else if (term->getType() == frTermEnum::frcPowerTerm) {
-            netId = static_cast<int>(drcSpecialNetIdEnum::FLOATPOWER);
-          } else if (term->getType() == frTermEnum::frcGroundTerm) {
-            netId = static_cast<int>(drcSpecialNetIdEnum::FLOATGROUND);
-          }
-        }
-
-        // push layer shapes
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_terms\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-
-        for (auto &pin: term->getPins()) {
-          auto pinLayer2PolySet = pin->getLayer2PolySet();
-          for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-            auto &layerNum = layerIt->first;
-            auto &polySet = layerIt->second;
-            for (auto &poly: polySet) {
-              drcNet->addFixedLayerPoly(layerNum, poly);
-            }
-          }
-        }
-        break;
-      }
-      default:
-        std::cout << "Error: unexpected type in initNetRects_terms\n";
-    }
-  }
-}
-
-void fr::DRCWorker::initNetRects_connFigs() {
-  // double dbu = design->getTech()->getDBUPerUU();
-  for (auto obj: connFigs) {
-    DRCNet* drcNet = nullptr;
-    switch (obj->typeId()) {
-      case frcPathSeg:
-      {
-        int netId = -1;
-        frPathSeg* pathSeg = static_cast<frPathSeg*>(obj);
-        // get netId
-        if (pathSeg->hasNet()) {
-          if (net2Id.find(pathSeg->getNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(pathSeg->getNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(pathSeg->getNet());
-            (drcNets.back())->setSrc(pathSeg->getNet());
-            net2Id[pathSeg->getNet()] = netId;
-          } else {
-            netId = net2Id[pathSeg->getNet()];
-          }
-        } else if (pathSeg->hasPin()) {
-          for (auto mapIt = term2Id.begin(); mapIt != term2Id.end(); ++mapIt) {
-            if (netId != -1) {
-              break;
-            }
-            auto term = mapIt->first;
-            for (auto &pin: term->getPins()) {
-              auto pinPtr = pin.get();
-              if (pinPtr == pathSeg->getPin()) {
-                netId = mapIt->second;
-                break;
-              }
-            }
-          }
-          // if (netId == -1) {
-          //   netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-          // }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-        
-        frLayerNum layerNum = pathSeg->getLayerNum();
-        frBox bbox;
-        pathSeg->getBBox(bbox);
-        Rectangle pathSegRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-        // std::cout << "  add pathseg bbox (" << bbox.left() / dbu<< ", " << bbox.bottom() / dbu
-        //           << ") -- (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ") from net " << netId << "\n";
-        drcNet->addRouteLayerRect(layerNum, pathSegRect);
-        // std::cout << "  added pathSeg\n" << std::flush;
-
-        break;
-      }
-      case frcVia:
-      {
-        int netId = -1;
-        frVia* via = static_cast<frVia*>(obj);
-        // get netId
-        if (via->hasNet()) {
-          if (net2Id.find(via->getNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(via->getNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(via->getNet());
-            (drcNets.back())->setSrc(via->getNet());
-            net2Id[via->getNet()] = netId;
-          } else {
-            netId = net2Id[via->getNet()];
-          }
-        } else if (via->hasPin()) {
-          for (auto mapIt = term2Id.begin(); mapIt != term2Id.end(); ++mapIt) {
-            if (netId != -1) {
-              break;
-            }
-            auto term = mapIt->first;
-            for (auto &pin: term->getPins()) {
-              auto pinPtr = pin.get();
-              if (pinPtr == via->getPin()) {
-                netId = mapIt->second;
-                break;
-              }
-            }
-          }
-          if (netId == -1) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            auto term = via->getPin()->getTerm();
-            term2Id[term] = netId;
-          }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape. TODO: handle cut layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-
-        // push layer1 rect
-        // double dbu = design->getTech()->getDBUPerUU();
-        frLayerNum layerNum1 = via->getViaDef()->getLayer1Num();
-        frTransform xform;
-        via->getTransform(xform);
-        for (auto &fig: via->getViaDef()->getLayer1Figs()) {
-          
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          // std::cout << "  add to net" << netId << " layer " << layerNum1 << " (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu
-          //           << ") - (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-          drcNet->addRouteLayerRect(layerNum1, bboxRect);
-        }
-
-        // push cut layer rect
-        frLayerNum cutLayerNum = via->getViaDef()->getCutLayerNum();
-        for (auto &fig: via->getViaDef()->getCutFigs()) {
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          drcNet->addRouteLayerRect(cutLayerNum, bboxRect);
-        }
-
-        // push layer2 rect
-        frLayerNum layerNum2 = via->getViaDef()->getLayer2Num();
-        for (auto &fig: via->getViaDef()->getLayer2Figs()) {
-          frBox bbox;
-          fig->getBBox(bbox);
-          bbox.transform(xform);
-          Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-          // std::cout << "  add to net" << netId << " layer " << layerNum2 << " (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu
-          //           << ") - (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-          drcNet->addRouteLayerRect(layerNum2, bboxRect);
-        }
-        break;
-      }
-      case frcPatchWire:
-      {
-        int netId = -1;
-        frPatchWire* pwire = static_cast<frPatchWire*>(obj);
-        // get netId
-        if (pwire->hasNet()) {
-          if (net2Id.find(pwire->getNet()) == net2Id.end()) {
-            netId = drcNets.size();
-            drcNets.push_back(std::make_unique<DRCNet>(netId));
-            if (target && target == static_cast<frBlockObject*>(pwire->getNet())) {
-              targetNetId = netId;
-            }
-            // (drcNets.back())->setNet(pwire->getNet());
-            (drcNets.back())->setSrc(pwire->getNet());
-            net2Id[pwire->getNet()] = netId;
-          } else {
-            netId = net2Id[pwire->getNet()];
-          }
-        } else if (pwire->hasPin()) {
-          for (auto mapIt = term2Id.begin(); mapIt != term2Id.end(); ++mapIt) {
-            if (netId != -1) {
-              break;
-            }
-            auto term = mapIt->first;
-            for (auto &pin: term->getPins()) {
-              auto pinPtr = pin.get();
-              if (pinPtr == pwire->getPin()) {
-                netId = mapIt->second;
-                break;
-              }
-            }
-          }
-          // if (netId == -1) {
-          //   netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-          // }
-        } else {
-          netId = static_cast<int>(drcSpecialNetIdEnum::FLOATSIGNAL);
-        }
-        // push layer shape
-        if (netId == -1) {
-          std::cout << "Error: unexpected netId in initNetRects_connFigs\n";
-          continue;
-        }
-        drcNet = drcNets[netId].get();
-        
-        frLayerNum layerNum = pwire->getLayerNum();
-        frBox bbox;
-        pwire->getBBox(bbox);
-        Rectangle patchWireRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-        // std::cout << "  add pathseg bbox (" << bbox.left() / dbu<< ", " << bbox.bottom() / dbu
-        //           << ") -- (" << bbox.right() / dbu << ", " << bbox.top() / dbu << ") from net " << netId << "\n";
-        drcNet->addRouteLayerRect(layerNum, patchWireRect);
-        // std::cout << "  added pwire\n" << std::flush;
-
-        break;
-      }
-      default:
-        std::cout << "Warning: unsupported connFig type in initNetRects_connFigs, skipped...\n";
-    }
-  }
-}
-
-void fr::DRCWorker::initNetRects_blockages() {
-  for (auto obj: blockages) {
-    DRCNet *drcNet = nullptr;
-    switch (obj->typeId()) {
-      case frcLayerBlockage:
-      {
-        frLayerBlockage* layerBlockage = static_cast<frLayerBlockage*>(obj);
-        int netId = static_cast<int>(drcSpecialNetIdEnum::OBS);
-        // push layer shapes
-        drcNet = drcNets[netId].get();
-        frLayerNum layerNum = layerBlockage->getLayerNum();
-        auto blockageFrPoints = layerBlockage->getPoints();
-        std::vector<Point> blockagePoints;
-        for (auto pt: blockageFrPoints) {
-          blockagePoints.push_back(Point(pt.x(), pt.y()));
-        }
-        Polygon blockagePoly;
-        set_points(blockagePoly, blockagePoints.begin(), blockagePoints.end());
-        drcNet->addFixedLayerPoly(layerNum, blockagePoly);
-
-        break;
-      }
-      case frcInstBlockage:
-      {
-        // std::cout << "adding frInstBlockage\n";
-        frBlockage* blockage = (static_cast<frInstBlockage*>(obj))->getBlockage();
-        if (blockage->typeId() != frcLayerBlockage) {
-          std::cout << "Error: unexpected blockage type in initNetRects_blockages\n";
-          break;
-        }
-        frInst* inst = (static_cast<frInstBlockage*>(obj))->getInst();
-        frTransform xform;
-        inst->getUpdatedXform(xform);
-        frLayerBlockage* layerBlockage = static_cast<frLayerBlockage*>(blockage);
-        int netId = static_cast<int>(drcSpecialNetIdEnum::OBS);
-        // push layer shapes
-        drcNet = drcNets[netId].get();
-        frLayerNum layerNum = layerBlockage->getLayerNum();
-        auto blockageFrPoints = layerBlockage->getPoints();
-        std::vector<Point> blockagePoints;
-        for (auto pt: blockageFrPoints) {
-          frPoint tmpPt = pt;
-          tmpPt.transform(xform);
-          blockagePoints.push_back(Point(tmpPt.x(), tmpPt.y()));
-        }
-        Polygon blockagePoly;
-        set_points(blockagePoly, blockagePoints.begin(), blockagePoints.end());
-        drcNet->addFixedLayerPoly(layerNum, blockagePoly);
-
-        break;
-      }
-      default:
-        std::cout << "Warning: unsupported blockage type in initNetRects_blockages, skipped...\n";
-    }
-  }
-}
-
-void fr::DRCWorker::sortObj() {
-  for (auto obj: objs) {
-    switch (obj->typeId()) {
-      case frcTerm:
-        terms.push_back(obj);
-        break;
-      case frcInstTerm:
-        terms.push_back(obj);
-        break;
-      case frcVia:
-        connFigs.push_back(static_cast<frConnFig*>(obj));
-        break;
-      case frcPathSeg:
-        connFigs.push_back(static_cast<frConnFig*>(obj));
-        break;
-      case frcPatchWire:
-        connFigs.push_back(static_cast<frConnFig*>(obj));
-        break;
-      case frcLayerBlockage:
-        blockages.push_back(static_cast<frBlockage*>(obj));
-      case frcInstBlockage:
-        blockages.push_back(static_cast<frInstBlockage*>(obj));
-      default:
-        continue;
-    }
-  }
-}
-
-void fr::DRCWorker::addDRNets(const std::vector<std::unique_ptr<drNet> > &nets) {
-  for (auto &net: nets) {
-    for (auto &conn: net->getExtConnFigs()) {
-      addDRConnFig(conn.get());
-    }
-    for (auto &conn: net->getRouteConnFigs()) {
-      addDRConnFig(conn.get());
-    }
-  }
-}
-
-void fr::DRCWorker::addDRConnFig(drConnFig* in) {
-  switch (in->typeId()) {
-    case drcVia:
-      drConnFigs.push_back(static_cast<drVia*>(in));
-      break;
-    case drcPathSeg:
-      drConnFigs.push_back(static_cast<drPathSeg*>(in));
-      break;
-    case drcPatchWire:
-      drConnFigs.push_back(static_cast<drPatchWire*>(in));
-      break;
-    default:
-      std::cout << "Error: unexpected in addDRConnFig\n";
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_main.cpp b/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_main.cpp
deleted file mode 100644
index 9bb4ce2..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_main.cpp
+++ /dev/null
@@ -1,990 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "drc/frDRC.h"
-#include "io/frShapeUtil.h"
-#include <memory>
-#include <iterator>
-#include <iostream>
-#include <math.h>
-#include <fstream>
-#include <chrono>
-#include <set>
-
-using namespace std::chrono;
-using namespace boost::polygon::operators;
-
-
-
-void fr::DRCWorker::main() {
-  checkMetalShort();
-  checkMetalSpacingRules();
-  // checkMetalMinAreaRule();
-  checkMetalMinStepRule();
-  checkMinWidthRule();
-  checkCutSpacingRules();
-}
-
-void fr::DRCWorker::checkMetalMinAreaRule() {
-  for (auto &drcNet: drcNets) {
-    checkMetalMinAreaRule_net(drcNet.get());
-  }
-}
-
-void fr::DRCWorker::checkMetalMinAreaRule_net(DRCNet* drcNet) {
-  std::set<frLayerNum> layerNums;
-  auto &layer2FixedPolySet = drcNet->getLayer2FixedPolySet();
-  auto &layer2RoutePolySet = drcNet->getLayer2RoutePolySet();
-  // std::map<frLayerNum, PolygonSet> layer2MergedPolySet;
-  for (auto layerIt = layer2FixedPolySet.begin(); layerIt != layer2FixedPolySet.end(); ++layerIt) {
-    layerNums.insert(layerIt->first);
-  }
-  for (auto layerIt = layer2RoutePolySet.begin(); layerIt != layer2RoutePolySet.end(); ++layerIt) {
-    layerNums.insert(layerIt->first);
-  }
-  for (auto layerNum: layerNums) {
-    auto minAreaConstraint = design->getTech()->getLayer(layerNum)->getAreaConstraint();
-    frCoord layerMinArea = minAreaConstraint->getMinArea();
-    PolygonSet mergedPS;
-    mergedPS += layer2FixedPolySet[layerNum];
-    mergedPS += layer2RoutePolySet[layerNum];
-
-    // check if minArea is violated
-
-    for (auto &poly: mergedPS) {
-      if (area(poly) < layerMinArea) {
-        std::vector<Rectangle> maxRects;
-        PolygonSet tempPS;
-        tempPS += poly;
-        bool isCoveredByFixed = true;
-        get_max_rectangles(maxRects, tempPS);
-        Rectangle minMaxRect;
-        frCoord minMaxRectArea = -1;
-        for (auto &maxRect: maxRects) {
-          frCoord tempMinMaxRectArea = area(maxRect);
-          if (minMaxRectArea == -1 || tempMinMaxRectArea < minMaxRectArea) {
-            minMaxRectArea = tempMinMaxRectArea;
-            minMaxRect = maxRect;
-          }
-          if (isCoveredByFixed) {
-            box_t maxBox(point_t(xl(maxRect), yl(maxRect)), point_t(xh(maxRect), yh(maxRect)));
-            std::vector<std::pair<box_t, int> > fixedQueryResult;
-            layer2FixedRTree[layerNum].query(bgi::intersects(maxBox), back_inserter(fixedQueryResult));
-            bool isMaxRectCoveredByFixed = false;
-            for (auto &fixedPair: fixedQueryResult) {
-              auto fixedPairNetId = fixedPair.second;
-              auto &fixedBox = fixedPair.first;
-              if (fixedPairNetId != drcNet->getId()) {
-                continue;
-              }
-              if (bg::covered_by(maxBox, fixedBox)) {
-                isMaxRectCoveredByFixed = true;
-                break;
-              }
-            }
-            if (!isMaxRectCoveredByFixed) {
-              isCoveredByFixed = false;
-            }
-          } else {
-            continue;
-          }
-
-        }
-        // if not covered by fixed, then it is a violation
-        if (!isCoveredByFixed) {
-          // push to violation
-          frMarker minAreaMarker;
-          frBox minAreaBBox(xl(minMaxRect), yl(minMaxRect), xh(minMaxRect), yh(minMaxRect));
-          minAreaMarker.setConstraint(minAreaConstraint);
-          minAreaMarker.setBBox(minAreaBBox);
-          minAreaMarker.setLayerNum(layerNum);
-          minAreaMarker.addSrc(drcNet->getSrc());
-
-          markers.push_back(minAreaMarker);
-        }
-
-      }
-    }
-
-  }
-
-
-
-}
-
-void fr::DRCWorker::checkMetalMinStepRule() {
-  // std::cout << "checkMetalMinStepRule\n";
-  for (auto &drcNet: drcNets) {
-    // std::cout << "  check " << drcNet->getId() << "\n";
-    if (targetNetId != -1 && drcNet.get()->getId() != targetNetId) {
-      continue;
-    }
-    checkMetalMinStepRule_net(drcNet.get());
-  }
-}
-
-void fr::DRCWorker::checkMetalMinStepRule_net(DRCNet* drcNet) {
-  auto layer2Seg2Edge = drcNet->getLayerSegEdgeMap();
-  for (auto layerIt = layer2Seg2Edge.begin(); layerIt != layer2Seg2Edge.end(); ++layerIt) {
-    frLayerNum layerNum = layerIt->first;
-    // std::cout << "    check layer " << layerNum << "\n"; 
-    auto &seg2Edge = layerIt->second;
-    auto constraint = design->getTech()->getLayer(layerNum)->getMinStepConstraint();
-    // if (!constraint) {
-    //   std::cout << "layer " << layerNum << " does not have minStep\n";
-    // }
-    if (constraint) {
-      // std::cout << "check minStep" << constraint->hasInsideCorner() << " " << constraint->hasOutsideCorner()
-      //           << " " << constraint->hasStep() << "\n";
-      frCoord minStepLength = constraint->getMinStepLength();
-      // std::cout << "minStepLength = " << minStepLength << "\n";
-      // // prevent check same segment for multiple times or non-poly-outline edge being checked
-      // std::map<Segment, bool> isPolySegVisited;
-      // for (auto segIt = seg2Edge.begin(); segIt != seg2Edge.end(); ++segIt) {
-      //   if (segIt->second->getPrevEdge() == nullptr || segIt->second->getNextEdge() == nullptr) {
-      //     isPolySegVisited[segIt->first] = true;
-      //   } else {
-      //     isPolySegVisited[segIt->first] = false;
-      //   }
-      // }
-      // begin check
-      for (auto segIt = seg2Edge.begin(); segIt != seg2Edge.end(); ++segIt) {
-        if (segIt->second->getNextEdge() == nullptr || segIt->second->getPrevEdge() == nullptr) {
-          continue;
-        }
-        // minStep check starts with an edge longer than minStepLength
-        if (length(segIt->first) < minStepLength) {
-          continue;
-        }
-        // std::cout << "here0\n";
-        // skip if next edge is also longer than minStepLength
-        if (length(segIt->second->getNextEdge()->getSegment()) >= minStepLength) {
-          continue;
-        }
-        // std::cout << "here1\n";
-        // push potential violating edges into a queue and find next non-violating edge
-        frVector<Segment> segs;
-        frVector<DRCEdge*> edges;
-        frCoord sumLength = 0;
-        auto edgePtr = segIt->second;
-        // std::cout << "here2\n";
-        while (length(edgePtr->getNextEdge()->getSegment()) < minStepLength) {
-          segs.push_back(edgePtr->getNextEdge()->getSegment());
-          edges.push_back(edgePtr->getNextEdge());
-          sumLength += length(edgePtr->getNextEdge()->getSegment());
-          edgePtr = edgePtr->getNextEdge();
-        }
-        edgePtr = edgePtr->getNextEdge();
-        // edgePtr points to the last edge
-        // skip if there is only one edge longer than minStepLength
-        if (edgePtr->getNextEdge() == segIt->second) {
-          // std::cout << "single edge skip\n";
-          continue;
-        }
-        // std::cout << "here3\n";
-        bool checkMinStep = false;
-        auto startSeg = segIt->second->getSegment();
-        auto endSeg = edgePtr->getSegment();
-        if (constraint->hasInsideCorner() || constraint->hasOutsideCorner()) {
-          // parallel continue
-          if (orientation(startSeg, endSeg) == 0) {
-            // std::cout << "parallel skip\n";
-            continue;
-          }
-          if (constraint->hasInsideCorner()) {
-            for (int i = 0; i < (int)segs.size() - 1; ++i) {
-              if (orientation(segs[i], segs[i+1]) == -1 && edges[i]->getWinding() == boost::polygon::HIGH) {
-                checkMinStep = true;
-              }
-            }
-          } else {
-            for (int i = 0; i < (int)segs.size() - 1; ++i) {
-              if (orientation(segs[i], segs[i+1]) == 1 && edges[i]->getWinding() == boost::polygon::LOW) {
-                checkMinStep = true;
-              }
-            }
-          }
-        } else {
-          if (orientation(segIt->first, edgePtr->getSegment()) != 0) {
-            continue;
-          }
-        }
-        if (!checkMinStep) {
-          continue;
-        }
-        // check maxEdges
-        if (constraint->hasMaxEdges() && (int)segs.size() <= constraint->getMaxEdges()) {
-          // std::cout << "maxEdges skip\n";
-          continue;
-        }
-        // check maxLength
-        if (constraint->hasMaxLength() && constraint->getMaxLength() >= sumLength) {
-          // std::cout << "maxLength skip\n";
-          continue;
-        }
-        // potential violation, a real violation contains at least one non-fixed edge
-        bool hasNonFixed = false;
-        for (auto currEdgePtr = segIt->second; currEdgePtr->getPrevEdge() != edgePtr; currEdgePtr = currEdgePtr->getNextEdge()) {
-          if (currEdgePtr->getType() == drcEdgeTypeEnum::ROUTE) {
-            hasNonFixed = true;
-            break;
-          }
-        }
-        if (hasNonFixed) {
-          // push violation
-          frMarker minStepMarker;
-          Point lowPt = std::min(high(startSeg), low(endSeg));
-          Point highPt = std::max(high(startSeg), low(endSeg));
-          frBox minStepBBox(x(lowPt), y(lowPt), x(highPt), y(highPt));
-          minStepMarker.setConstraint(constraint);
-          minStepMarker.setBBox(minStepBBox);
-          minStepMarker.setLayerNum(layerNum);
-          minStepMarker.addSrc(drcNet->getSrc());
-
-          markers.push_back(minStepMarker);
-          // std::cout << "start seg: (" << x(low(startSeg)) / 2000.0 << ", " << y(low(startSeg)) / 2000.0 << ") -- ("
-          //           << x(high(startSeg)) / 2000.0 << ", " << y(high(startSeg)) / 2000.0 
-          //           << ", end seg (" << x(low(endSeg)) / 2000.0 << ", " << y(low(endSeg)) / 2000.0 << ") -- ("
-          //           << x(high(endSeg)) / 2000.0 << ", " << y(high(endSeg)) / 2000.0 << ")\n";
-        } else {
-          // std::cout << "fixed error, skipped\n";
-        }
-      }
-    }
-  }
-}
-
-
-void fr::DRCWorker::checkMinWidthRule() {
-  for (auto &drcNet: drcNets) {
-    if (targetNetId != -1 && targetNetId != drcNet.get()->getId()) {
-      continue;
-    } 
-    checkMinWidthRule_net(drcNet.get());
-  }
-}
-
-// this assumes minWidth violation only happens to overlap between
-void fr::DRCWorker::checkMinWidthRule_net(DRCNet* drcNet) {
-  std::set<frLayerNum> fixedLayers, routeLayers;
-  std::vector<frLayerNum> commonLayers;
-  auto &layer2FixedPolySet = drcNet->getLayer2FixedPolySet();
-  auto &layer2RoutePolySet = drcNet->getLayer2RoutePolySet();
-  for (auto layerIt = layer2FixedPolySet.begin(); layerIt != layer2FixedPolySet.end(); ++layerIt) {
-    fixedLayers.insert(layerIt->first);
-  }
-  for (auto layerIt = layer2RoutePolySet.begin(); layerIt != layer2RoutePolySet.end(); ++layerIt) {
-    routeLayers.insert(layerIt->first);
-  }
-  std::set_intersection(fixedLayers.begin(), fixedLayers.end(), routeLayers.begin(), routeLayers.end(), std::back_inserter(commonLayers));
-  for (auto &layerNum: commonLayers) {
-    frCoord minWidth = design->getTech()->getLayer(layerNum)->getMinWidth();
-    auto minWidthConstraint = design->getTech()->getLayer(layerNum)->getMinWidthConstraint();
-    // PolygonSet ovlpPS;
-    auto &fixedPolySet = layer2FixedPolySet[layerNum];
-    auto &routePolySet = layer2RoutePolySet[layerNum];
-    auto ovlpPS = fixedPolySet & routePolySet;
-    std::vector<Rectangle> maxRects;
-    get_max_rectangles(maxRects, ovlpPS);
-    for (auto &rect: maxRects) {
-      auto actWidth = rectDiagLength(rect);
-      if (actWidth < minWidth) {
-        frMarker minWidthMarker;
-        frBox minWidthVioBox(xl(rect), yl(rect), xh(rect), yh(rect));
-        minWidthMarker.setConstraint(minWidthConstraint);
-        minWidthMarker.setBBox(minWidthVioBox);
-        minWidthMarker.addSrc(drcNet->getSrc());
-        markers.push_back(minWidthMarker);
-      }
-    }
-
-  }
-}
-
-void fr::DRCWorker::checkMetalShort() {
-  // double dbu = design->getTech()->getDBUPerUU();
-  for (auto layerIt = layer2MergedRTree.begin(); layerIt != layer2MergedRTree.end(); ++layerIt) {
-    frLayerNum layerNum = layerIt->first;
-    if (design->getTech()->getLayer(layerNum)->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-
-    frShortConstraint* shortConstraint = design->getTech()->getLayer(layerNum)->getShortConstraint();
-
-    if (shortConstraint == nullptr) {
-      std::cout << "Error: short constraint is not defined on layer " << layerNum << "\n";
-      continue;
-    }
-    // std::cout << "check short on layer" << layerNum <<"\n";
-    auto &mergedRTree = layerIt->second;
-    for (auto it = mergedRTree.begin(); it != mergedRTree.end(); ++it) {
-      box_t objBox = it->first;
-      int objNetId = it->second;
-      if (targetNetId != -1 && targetNetId != objNetId) {
-        continue;
-      }
-      // std::cout << "check maxRect (" << objBox.min_corner().get<0>() / dbu << ", " << objBox.min_corner().get<1>() / dbu 
-      //           << ") -- (" << objBox.max_corner().get<0>() / dbu << ", " << objBox.max_corner().get<1>() / dbu << ") net " << objNetId << "\n";
-      std::vector<std::pair<box_t, int> > queryResult;
-      mergedRTree.query(bgi::intersects(objBox), back_inserter(queryResult));
-      for (auto &shortPair: queryResult) {
-        // skip same net
-        if (shortPair.second == objNetId) {
-          continue;
-        }
-        // std::cout << "  against diffnet maxRect" << shortPair.first.min_corner().get<0>() / dbu << ", " << shortPair.first.min_corner().get<1>() / dbu 
-        //         << ") -- (" << shortPair.first.max_corner().get<0>() / dbu << ", " << shortPair.first.max_corner().get<1>() / dbu << ") net " << shortPair.second << "\n";
-        int shortNetId = shortPair.second;
-        // just to remove compile warning
-        box_t shortArea = box_t();
-        bg::intersection(objBox, shortPair.first, shortArea);
-        std::vector<std::pair<box_t, int> > fixedQueryResult;
-        layer2FixedRTree[layerNum].query(bgi::intersects(shortArea), back_inserter(fixedQueryResult));
-        bool inFixedObj1 = false, inFixedObj2 = false;
-        for (auto &fixedPair: fixedQueryResult) {
-          auto fixedPairNetId = fixedPair.second;
-          if (!inFixedObj1 && fixedPairNetId == objNetId && bg::covered_by(shortArea, fixedPair.first)) {
-            inFixedObj1 = true;
-          }
-          if (!inFixedObj2 && fixedPairNetId == shortNetId && bg::covered_by(shortArea, fixedPair.first)) {
-            inFixedObj2 = true;
-          }
-          if (inFixedObj1 && inFixedObj2) {
-            break;
-          }
-        }
-        if (!(inFixedObj1 && inFixedObj2)) {
-          // push to violation
-          frMarker shortMarker;
-          frBox shortBBox(shortArea.min_corner().get<0>(), 
-                          shortArea.min_corner().get<1>(), 
-                          shortArea.max_corner().get<0>(), 
-                          shortArea.max_corner().get<1>());
-          shortMarker.setConstraint(shortConstraint);
-          shortMarker.setBBox(shortBBox);
-          shortMarker.setLayerNum(layerNum);
-          // shortMarker.addNet(drcNets[objNetId]->getNet());
-          // shortMarker.addNet(drcNets[shortNetId]->getNet());
-          shortMarker.addSrc(drcNets[objNetId]->getSrc());
-          shortMarker.addSrc(drcNets[shortNetId]->getSrc());
-
-          markers.push_back(shortMarker);
-
-        }
-        else {
-          // std::cout << "shortArea completely in fixed shape\n";
-        }
-      }
-      // end for shortPair
-    }
-    // end for mergedRTree element
-  }
-}
-
-
-void fr::DRCWorker::checkCutSpacingRules() {
-  for (auto layerIt = layer2EdgeRTree.begin(); layerIt != layer2EdgeRTree.end(); ++layerIt) {
-    frLayerNum layerNum = layerIt->first;
-    auto currLayer = design->getTech()->getLayer(layerNum);
-    if (currLayer->getType() != frLayerTypeEnum::CUT) {
-      continue;
-    }
-    // conventional cut spacing rule
-    if (currLayer->hasCutSpacing()) {
-      for (auto constraint: currLayer->getCutConstraint()) {
-        if (constraint->getCenterToCenter()) {
-          std::cout << "Warning: center-to-center to be implemented\n";
-          continue;
-        }
-
-        checkCutSpacingRule(layer2EdgeRTree[layerNum], constraint);
-
-
-      }
-    }
-  }
-}
-
-void fr::DRCWorker::checkCutSpacingRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,
-                                        frCutSpacingConstraint* constraint) {
-  // double dbu = design->getTech()->getDBUPerUU();
-  frCoord spacingVal = constraint->getCutSpacing();
-  for (auto segEdgeIt = edgeRTree.begin(); segEdgeIt != edgeRTree.end(); ++segEdgeIt) {
-    auto &seg = segEdgeIt->first;
-    Rectangle segSpanRect;
-    auto &edge = segEdgeIt->second;
-    auto edgeDir = edge->getDir();
-    box_t testBox;
-    getSpacingTableTestBox(seg, edge, spacingVal, testBox);
-    std::vector<std::pair<segment_t, DRCEdge*> > edgeQueryResult;
-    getEdgeSpanRect(seg, edgeDir, edge->getSpan(), segSpanRect);
-    if (edge->getPrevEdge() == nullptr || edge->getNextEdge() == nullptr) {
-      continue;
-    }
-    // skip if triggering condition is not met
-    // adjacent cuts
-    if (constraint->getAdjacentCuts() != -1) {
-      int adjCutCnt = -1;
-      frCoord cutWithin = constraint->getCutWithin();
-      Rectangle adjCutQueryRect = segSpanRect;
-      adjCutQueryRect = bloat(adjCutQueryRect, cutWithin);
-      box_t adjCutQueryBox = box_t(point_t(xl(adjCutQueryRect), yl(adjCutQueryRect)), point_t(xh(adjCutQueryRect), yh(adjCutQueryRect)));
-      box_t adjCutBox = box_t(point_t(xl(segSpanRect), yl(segSpanRect)), point_t(xh(segSpanRect), yh(segSpanRect)));
-      std::vector<std::pair<box_t, int> > adjCutQueryResult;
-      layer2MergedRTree[edge->getLayerNum()].query(bgi::intersects(adjCutQueryBox), back_inserter(adjCutQueryResult));
-
-      for (auto &adjCutBoxPair: adjCutQueryResult) {
-        auto boxDist = frBox2BoxDist(adjCutBoxPair.first, adjCutBox);
-        if (boxDist < cutWithin) {
-          ++adjCutCnt;
-        }
-      }
-
-      if (adjCutCnt < constraint->getAdjacentCuts()) {
-        continue;
-      }
-    }
-    // second layer
-    if (constraint->getSecondLayerName().empty()) {
-      edgeRTree.query(bgi::intersects(testBox), back_inserter(edgeQueryResult));
-    } else {
-      auto secondLayer = design->getTech()->getLayer(constraint->getSecondLayerName());
-      if (secondLayer == nullptr) {
-        std::cout << "Error: second layer not found\n";
-        return;
-      }
-      layer2EdgeRTree[secondLayer->getLayerNum()].query(bgi::intersects(testBox), back_inserter(edgeQueryResult));
-    }    
-    // get potential violation
-    for (auto &querySegEdge: edgeQueryResult) {
-      auto &querySeg = querySegEdge.first;
-      auto &queryEdge = querySegEdge.second;
-      int netId1 = edge->getNetId();
-      int netId2 = queryEdge->getNetId();
-      if (targetNetId != -1 && netId1 != targetNetId && netId2 != targetNetId) {
-        continue;
-      }
-      // only check polygon edge
-      if (queryEdge->getPrevEdge() == nullptr || queryEdge->getNextEdge() == nullptr) {
-        continue;
-      }
-      // only opposite-dir edges are counted as spacing violation
-      if (!isOppositeDir(edgeDir, queryEdge->getDir())) {
-        continue;
-      }
-      Rectangle queryEdgeSpanRect;
-      getEdgeSpanRect(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanRect);
-      bool isHorizontal = (edgeDir == frDirEnum::N || edgeDir == frDirEnum::S);
-      frCoord prl = -1;
-      frCoord actSpacing;
-      Interval segIntv, querySegIntv;
-      // Rectangle tmpSegSpanRect = segSpanRect;
-      Rectangle tmpQueryEdgeSpanRect = queryEdgeSpanRect;
-      Rectangle gapRect = generalized_intersect(tmpQueryEdgeSpanRect, segSpanRect);
-      if (isHorizontal) {
-        segIntv = horizontal(segSpanRect);
-        querySegIntv = horizontal(queryEdgeSpanRect);
-      } else {
-        segIntv = vertical(segSpanRect);
-        querySegIntv = vertical(queryEdgeSpanRect);
-      }
-      // std::cout << "   segIntv: " << low(segIntv) << " -- " << high(segIntv) << "\n";
-      // std::cout << "   querySegIntv: " << low(querySegIntv) << " -- " << high(querySegIntv) << "\n";
-      if (intersects(segIntv, querySegIntv)) {
-        prl = delta(generalized_intersect(querySegIntv, segIntv));
-        if (isHorizontal) {
-          actSpacing = (yh(gapRect) - yl(gapRect));
-        } else {
-          actSpacing = (xh(gapRect) - xl(gapRect));
-        }
-      } else {
-        prl = -delta(generalized_intersect(querySegIntv, segIntv));
-        actSpacing = rectDiagLength(gapRect);
-      }
-      // skip if PARALLELOVERLAP specified but not met
-      if (constraint->getParallelOverlap()) {
-        // negative / zero prl does not trigger
-        if (prl <= 0) {
-          continue;
-        }
-        // enclosure
-        frCoord bboxLlx, bboxLly, bboxUrx, bboxUry;
-        bboxLlx = std::min(xl(segSpanRect), xl(queryEdgeSpanRect));
-        bboxLly = std::min(yl(segSpanRect), yl(queryEdgeSpanRect));
-        bboxUrx = std::max(xh(segSpanRect), xh(queryEdgeSpanRect));
-        bboxUry = std::max(yh(segSpanRect), yh(queryEdgeSpanRect));
-        box_t cutBboxQueryBox(point_t(bboxLlx, bboxLly), point_t(bboxUrx, bboxUry));
-        std::vector<std::pair<box_t, int> > adjCutQueryResultLower, adjCutQueryResultUpper;
-        bool cutCovered = false;
-        layer2MergedRTree[edge->getLayerNum() - 1].query(bgi::intersects(cutBboxQueryBox), back_inserter(adjCutQueryResultLower));
-        for (auto &metalPair: adjCutQueryResultLower) {
-          if (bg::covered_by(cutBboxQueryBox, metalPair.first)) {
-            cutCovered = true;
-            break;
-          }
-        }
-        layer2MergedRTree[edge->getLayerNum() + 1].query(bgi::intersects(cutBboxQueryBox), back_inserter(adjCutQueryResultUpper));
-        for (auto &metalPair: adjCutQueryResultUpper) {
-          if (bg::covered_by(cutBboxQueryBox, metalPair.first)) {
-            cutCovered = true;
-            break;
-          }
-        }
-        if (cutCovered) {
-          continue;
-        }
-
-      }
-      frCoord reqSpacing = constraint->getCutSpacing();
-      if (actSpacing < reqSpacing) {
-        // skip on violation with both edge fixed
-        if (edge->getType() == drcEdgeTypeEnum::FIXED && queryEdge->getType() == drcEdgeTypeEnum::FIXED) {
-        
-        } else {
-          bool isVio = true;
-
-          // if the violation box is completely covered by rect of either involved net, then it is not considered as a violation
-          box_t cutVioQueryBox(point_t(xl(gapRect), yl(gapRect)), point_t(xh(gapRect), yh(gapRect)));
-          std::vector<std::pair<box_t, int> > cutQueryResult;
-          auto &mergedRTree = layer2MergedRTree[edge->getLayerNum()];
-          mergedRTree.query(bgi::intersects(cutVioQueryBox), back_inserter(cutQueryResult));
-          int netId1 = edge->getNetId();
-          int netId2 = queryEdge->getNetId();
-
-          for (auto &cutVioPair: cutQueryResult) {
-            if (cutVioPair.second != netId1 && cutVioPair.second != netId2) {
-              continue;
-            }
-            if (bg::covered_by(cutVioQueryBox, cutVioPair.first)) {
-              isVio = false;
-              break;
-            }
-          }
-          if (isVio) {
-            frMarker cutVioMarker;
-            frBox cutVioBox(xl(gapRect), yl(gapRect), xh(gapRect), yh(gapRect));
-            cutVioMarker.setConstraint(constraint);
-            cutVioMarker.setBBox(cutVioBox);
-            cutVioMarker.setLayerNum(edge->getLayerNum());
-            cutVioMarker.addSrc(drcNets[edge->getNetId()]->getSrc());
-            cutVioMarker.addSrc(drcNets[queryEdge->getNetId()]->getSrc());
-
-            markers.push_back(cutVioMarker);
-          }
-
-        }
-      }
-
-    }
-
-
-  }
-}
-
-
-void fr::DRCWorker::checkMetalSpacingRules() {
-  for (auto layerIt = layer2EdgeRTree.begin(); layerIt != layer2EdgeRTree.end(); ++layerIt) {
-    frLayerNum layerNum = layerIt->first;
-    auto currLayer = design->getTech()->getLayer(layerNum);
-    if (currLayer->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    // for (auto constraint: design->getTech()->getLayer(layerNum)->getConstraints()) {
-    //   switch (constraint->typeId()) {
-    //     case frConstraintTypeEnum::frcSpacingTableConstraint:
-    //       checkMetalSpacingTableRule(layer2EdgeRTree[layerNum], (std::static_pointer_cast<frSpacingTableConstraint>(constraint)).get());
-    //       break;
-    //     case frConstraintTypeEnum::frcSpacingEndOfLineConstraint:
-    //       checkMetalSpacingEndOfLineRule(layer2EdgeRTree[layerNum], (std::static_pointer_cast<frSpacingEndOfLineConstraint>(constraint)).get());
-    //       break;
-    //     default:
-    //       continue;
-    //   }
-    // }
-
-    // min spacing rule
-    if (currLayer->hasMinSpacing()) {
-      auto constraint = currLayer->getMinSpacing();
-      switch (constraint->typeId()) {
-        case frConstraintTypeEnum::frcSpacingTablePrlConstraint:
-          // std::cout << "check prl spacing\n";
-          checkMetalSpacingTablePrlRule(layer2EdgeRTree[layerNum], static_cast<frSpacingTablePrlConstraint*>(constraint));
-          break;
-        default:
-          std::cout << "Warning: Unsupported MinSpacing rule\n";
-      }
-    }
-    if (currLayer->hasEolSpacing()) {
-      for (auto constraint: currLayer->getEolSpacing()) {
-        // std::cout << "check eol spacing\n";
-        switch (constraint->typeId()) {
-          case frConstraintTypeEnum::frcSpacingEndOfLineConstraint:
-            checkMetalSpacingEndOfLineRule(layer2EdgeRTree[layerNum], static_cast<frSpacingEndOfLineConstraint*>(constraint));
-            break;
-          default:
-            std::cout << "Warning: Unsupported EOL rule\n";
-        }
-      }
-    }
-  }
-}
-
-void fr::DRCWorker::checkMetalSpacingTablePrlRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,  
-                                                  frSpacingTablePrlConstraint* constraint) {
-  // double dbu = design->getTech()->getDBUPerUU();
-  auto prlConstraint = constraint->getLookupTbl();
-  frCoord maxSpacingVal = prlConstraint.find(prlConstraint.getRows().back(), prlConstraint.getCols().back());
-  for (auto segEdgeIt = edgeRTree.begin(); segEdgeIt != edgeRTree.end(); ++segEdgeIt) {
-    auto &seg = segEdgeIt->first;
-    Rectangle segSpanRect;
-    auto &edge = segEdgeIt->second;
-    auto edgeDir = edge->getDir();
-    box_t testBox;
-    getSpacingTableTestBox(seg, edge, maxSpacingVal, testBox);
-    std::vector<std::pair<segment_t, DRCEdge*> > edgeQueryResult;
-    edgeRTree.query(bgi::intersects(testBox), back_inserter(edgeQueryResult));
-    getEdgeSpanRect(seg, edgeDir, edge->getSpan(), segSpanRect);
-    // std::cout << "  check edge (" << bg::get<0,0>(seg) / dbu << ", " << bg::get<0,1>(seg) / dbu
-    //             << ") -- (" << bg::get<1,0>(seg) / dbu << ", " << bg::get<1,1>(seg) / dbu
-    //             << ") (" << int(edge->getDir()) << "), type = " << (int)edge->getType() << ", queryBox = (" 
-    //             << bg::get<bg::min_corner, 0>(testBox) / dbu << ", " << bg::get<bg::min_corner, 1>(testBox) / dbu << ") -- ("
-    //             << bg::get<bg::max_corner, 0>(testBox) / dbu << ", " << bg::get<bg::max_corner, 1>(testBox) / dbu << ")\n";
-    for (auto &querySegEdge: edgeQueryResult) {
-      auto &querySeg = querySegEdge.first;
-      auto &queryEdge = querySegEdge.second;
-      int netId1 = edge->getNetId();
-      int netId2 = queryEdge->getNetId();
-      if (targetNetId != -1 && targetNetId != netId1 && targetNetId != netId2) {
-        continue;
-      }
-      // only opposite-dir edges are counted as prl violation
-      if (!isOppositeDir(edgeDir, queryEdge->getDir())) {
-        continue;
-      }
-      box_t queryEdgeSpanBox;
-      getEdgeSpanBox(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanBox);
-      // std::cout << "    against edge (" << bg::get<0,0>(querySeg) / dbu << ", " << bg::get<0,1>(querySeg) / dbu
-      //           << ") -- (" << bg::get<1,0>(querySeg) / dbu << ", " << bg::get<1,1>(querySeg) / dbu
-      //           << ") (" << int(edge->getDir()) << "), type = " << (int)queryEdge->getType() << ", spanBox = (" 
-      //           << bg::get<bg::min_corner, 0>(queryEdgeSpanBox) / dbu << ", " << bg::get<bg::min_corner, 1>(queryEdgeSpanBox) / dbu << ") -- ("
-      //           << bg::get<bg::max_corner, 0>(queryEdgeSpanBox) / dbu << ", " << bg::get<bg::max_corner, 1>(queryEdgeSpanBox) / dbu << ")\n";
-      if (!bg::intersects(queryEdgeSpanBox, testBox)) {
-        continue;
-      } else {
-        box_t overlapBox;
-        bg::intersection(queryEdgeSpanBox, testBox, overlapBox);
-        if (bg::area(overlapBox) == 0) {
-          continue;
-        }
-      }
-      // there might be violation, do exact check
-      // frCoord effWidth = std::max(std::min(frCoord(bg::length(querySeg)), queryEdge->getSpan()), std::min(frCoord(bg::length(seg)), edge->getSpan()));
-      frCoord queryEdgeWidth = queryEdge->getWidth();
-      frCoord edgeWidth = edge->getWidth();
-      // minspacing obs
-      if (USEMINSPACING_OBS && queryEdge->getNetId() == int(drcSpecialNetIdEnum::OBS)) {
-        queryEdgeWidth = design->getTech()->getLayer(queryEdge->getLayerNum())->getWidth();
-      }
-      if (USEMINSPACING_OBS && edge->getNetId() == int(drcSpecialNetIdEnum::OBS)) {
-        edgeWidth = design->getTech()->getLayer(edge->getLayerNum())->getWidth();
-      }
-
-      // frCoord effWidth = std::max(queryEdge->getWidth(), edge->getWidth());
-      frCoord effWidth = std::max(queryEdgeWidth, edgeWidth);
-      Rectangle queryEdgeSpanRect;
-      getEdgeSpanRect(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanRect);
-      // std::cout << "     double-check " << xl(queryEdgeSpanRect) << " " << yl(queryEdgeSpanRect) << " " << xh(queryEdgeSpanRect) << " " << yh(queryEdgeSpanRect) << "\n";
-      bool isHorizontal = (edgeDir == frDirEnum::N || edgeDir == frDirEnum::S);
-      frCoord prl = -1;
-      frCoord actSpacing;
-      Interval segIntv, querySegIntv;
-      // Rectangle tmpSegSpanRect = segSpanRect;
-      Rectangle tmpQueryEdgeSpanRect = queryEdgeSpanRect;
-      Rectangle gapRect = generalized_intersect(tmpQueryEdgeSpanRect, segSpanRect);
-      if (isHorizontal) {
-        segIntv = horizontal(segSpanRect);
-        querySegIntv = horizontal(queryEdgeSpanRect);
-      } else {
-        segIntv = vertical(segSpanRect);
-        querySegIntv = vertical(queryEdgeSpanRect);
-      }
-      // std::cout << "   segIntv: " << low(segIntv) << " -- " << high(segIntv) << "\n";
-      // std::cout << "   querySegIntv: " << low(querySegIntv) << " -- " << high(querySegIntv) << "\n";
-      if (intersects(segIntv, querySegIntv)) {
-        prl = delta(generalized_intersect(querySegIntv, segIntv));
-        if (isHorizontal) {
-          actSpacing = (yh(gapRect) - yl(gapRect));
-        } else {
-          actSpacing = (xh(gapRect) - xl(gapRect));
-        }
-      } else {
-        prl = -delta(generalized_intersect(querySegIntv, segIntv));
-        actSpacing = rectDiagLength(gapRect);
-      }
-      // Rectangle gapRect = generalized_intersect(queryEdgeSpanRect, segSpanRect);
-      // frCoord prl = (edgeDir == frDirEnum::N || edgeDir == frDirEnum::S) ? (xh(gapRect) - xl(gapRect)) : (yh(gapRect) - yl(gapRect));
-      // frCoord actSpacing = (edgeDir == frDirEnum::N || edgeDir == frDirEnum::S) ? (yh(gapRect) - yl(gapRect)) : (xh(gapRect) - xl(gapRect));
-      frCoord reqSpacing = prlConstraint.find(effWidth, prl);
-      
-      // std::cout << "  checking between edge (" << bg::get<0,0>(seg) / dbu << ", " << bg::get<0,1>(seg) / dbu
-      //           << ") -- (" << bg::get<1,0>(seg) / dbu << ", " << bg::get<1,1>(seg) / dbu
-      //           << ") (" << int(edge->getDir()) << ") and edge (" << bg::get<0,0>(querySeg) / dbu << ", " << bg::get<0,1>(querySeg) / dbu
-      //           << ") -- (" << bg::get<1,0>(querySeg) / dbu << ", " << bg::get<1,1>(querySeg) / dbu << ") (" << int(queryEdge->getDir()) << "), "
-      //           << "reqSpacing = " << reqSpacing << ", actSpacing = " << actSpacing <<"\n";
-          
-
-
-
-      // there is a violation
-
-      if (actSpacing < reqSpacing) {
-        // skip on violation with both edge fixed
-        if (edge->getType() == drcEdgeTypeEnum::FIXED && queryEdge->getType() == drcEdgeTypeEnum::FIXED) {
-        
-        } else {
-          bool isVio = true;
-          // std::cout << "      violation\n";
-          // std::cout << "prl violation between edge (" << bg::get<0,0>(seg) / dbu << ", " << bg::get<0,1>(seg) / dbu
-          //           << ") -- (" << bg::get<1,0>(seg) / dbu << ", " << bg::get<1,1>(seg) / dbu
-          //           << ") (" << int(edge->getDir()) << ") and edge (" << bg::get<0,0>(querySeg) / dbu << ", " << bg::get<0,1>(querySeg) / dbu
-          //           << ") -- (" << bg::get<1,0>(querySeg) / dbu << ", " << bg::get<1,1>(querySeg) / dbu << ") (" << int(queryEdge->getDir()) << ")\n";
-          // std::cout << "  prl = " << prl << ", width = " << effWidth << ", actSpacing = " << actSpacing << ", reqSpacing = " << reqSpacing << "\n";          
-          // std::cout << "    segSpan = " << edge->getSpan() / dbu << ", queryEdgeSpan = " << queryEdge->getSpan() / dbu << "\n";
-          // std::cout << "    segSpanRect = (" << xl(segSpanRect) / dbu << ", " << yl(segSpanRect) / dbu << ") -- (" << xh(segSpanRect) / dbu << ", " << yh(segSpanRect) / dbu << ")\n";
-          // std::cout << "    queryEdgeSpanRect = (" << xl(queryEdgeSpanRect) / dbu << ", " << yl(queryEdgeSpanRect) / dbu << ") -- (" << xh(queryEdgeSpanRect) / dbu << ", " << yh(queryEdgeSpanRect) / dbu << ")\n";
-          
-          // if the violation box is completely covered by rect of either involved net, then it is not considered as a violation
-          box_t prlVioQueryBox(point_t(xl(gapRect), yl(gapRect)), point_t(xh(gapRect), yh(gapRect)));
-          std::vector<std::pair<box_t, int> > prlQueryResult;
-          auto &mergedRTree = layer2MergedRTree[edge->getLayerNum()];
-          mergedRTree.query(bgi::intersects(prlVioQueryBox), back_inserter(prlQueryResult));
-          int netId1 = edge->getNetId();
-          int netId2 = queryEdge->getNetId();
-
-          for (auto &prlVioPair: prlQueryResult) {
-            if (prlVioPair.second != netId1 && prlVioPair.second != netId2) {
-              continue;
-            }
-            if (bg::covered_by(prlVioQueryBox, prlVioPair.first)) {
-              isVio = false;
-              break;
-            }
-          }
-
-          if (isVio) {
-            frMarker prlVioMarker;
-            frBox prlVioBox(xl(gapRect), yl(gapRect), xh(gapRect), yh(gapRect));
-            prlVioMarker.setConstraint(constraint);
-            prlVioMarker.setBBox(prlVioBox);
-            prlVioMarker.setLayerNum(edge->getLayerNum());
-            // prlVioMarker.addNet(drcNets[edge->getNetId()]->getNet());
-            // prlVioMarker.addNet(drcNets[queryEdge->getNetId()]->getNet());
-            prlVioMarker.addSrc(drcNets[edge->getNetId()]->getSrc());
-            prlVioMarker.addSrc(drcNets[queryEdge->getNetId()]->getSrc());
-
-            markers.push_back(prlVioMarker);
-          }
-        }
-          
-      }
-    }
-  }
-}
-
-void fr::DRCWorker::checkMetalSpacingEndOfLineRule(const bgi::rtree<std::pair<segment_t, DRCEdge*>, bgi::quadratic<16> > &edgeRTree,  
-                                                   frSpacingEndOfLineConstraint* constraint) {
-  // double dbu = design->getTech()->getDBUPerUU();
-  // frSpacingEndOfLineParallelEdgeConstraint* eolParallelEdgeConstraint = (constraint->hasParallelEdge()) ? constraint->getParallelEdge().get() : nullptr;
-  for (auto segEdgeIt = edgeRTree.begin(); segEdgeIt != edgeRTree.end(); ++segEdgeIt) {
-    bool isTriggered = !constraint->hasParallelEdge(); // if no parallel edge, always triggered
-    auto &seg = segEdgeIt->first;
-    auto eolWithin = constraint->getEolWithin();
-    auto eolWidth = constraint->getEolWidth();
-    auto eolSpace = constraint->getMinSpacing();
-    Rectangle segSpanRect;
-    auto &edge = segEdgeIt->second;
-    auto edgeDir = edge->getDir();
-    box_t testBox, trigBox1, trigBox2; // left / bottom trigger box and right / top trigger box
-    // skip if not eol edge
-    if (!isEolEdge(edge)) {
-      continue;
-    }
-    // skip if eolWidth not satisfied
-    if (frCoord(bg::length(seg)) >= eolWidth) {
-      continue;
-    }
-    getEdgeSpanRect(seg, edgeDir, edge->getSpan(), segSpanRect);    
-    // get trigger box if specified
-    if (constraint->hasParallelEdge()) {
-      bool isLeftTriggered = false, isRightTriggered = false;
-      getParallelEdgeBoxs(seg, edge, constraint->getParSpace(), constraint->getParWithin(), eolWithin, trigBox1, trigBox2);
-      std::vector<std::pair<segment_t, DRCEdge*> > trigBox1QueryResult, trigBox2QueryResult;
-      edgeRTree.query(bgi::intersects(trigBox1), back_inserter(trigBox1QueryResult));
-      edgeRTree.query(bgi::intersects(trigBox2), back_inserter(trigBox2QueryResult));
-      // check left
-      for (auto &querySegEdge: trigBox1QueryResult) {
-        auto &querySeg = querySegEdge.first;
-        auto &queryEdge = querySegEdge.second;
-        // only opposite-dir edges are counted as prl violation
-        if (!isOppositeDir(leftEdgeDir(edgeDir), queryEdge->getDir())) {
-          continue;
-        }
-        box_t queryEdgeSpanBox;
-        getEdgeSpanBox(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanBox);
-        if (!bg::intersects(queryEdgeSpanBox, trigBox1)) {
-          continue;
-        } else {
-          box_t overlapBox;
-          bg::intersection(queryEdgeSpanBox, trigBox1, overlapBox);
-          if (bg::area(overlapBox) == 0) {
-            continue;
-          }
-        }
-        // left is triggered
-        isLeftTriggered = true;
-        break;
-      }
-      // check right
-      for (auto &querySegEdge: trigBox2QueryResult) {
-        auto &querySeg = querySegEdge.first;
-        auto &queryEdge = querySegEdge.second;
-        // only opposite-dir edges are counted as prl violation
-        if (!isOppositeDir(rightEdgeDir(edgeDir), queryEdge->getDir())) {
-          continue;
-        }
-        box_t queryEdgeSpanBox;
-        getEdgeSpanBox(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanBox);
-        if (!bg::intersects(queryEdgeSpanBox, trigBox2)) {
-          continue;
-        } else {
-          box_t overlapBox;
-          bg::intersection(queryEdgeSpanBox, trigBox2, overlapBox);
-          if (bg::area(overlapBox) == 0) {
-            continue;
-          }
-        }
-        // left is triggered
-        isRightTriggered = true;
-        break;
-      }
-      if ((constraint->hasTwoEdges() && (isRightTriggered && isLeftTriggered)) ||
-          (!constraint->hasTwoEdges() && (isRightTriggered || isLeftTriggered)) ) {
-        isTriggered = true;
-      }
-    }
-
-    // check eol spacing if it is triggered
-    if (isTriggered) {
-      getEOLTestBox(seg, edge, eolSpace, eolWithin, testBox);
-      std::vector<std::pair<segment_t, DRCEdge*> > edgeQueryResult;
-      edgeRTree.query(bgi::intersects(testBox), back_inserter(edgeQueryResult));
-      // std::cout << "  check edge (" << bg::get<0,0>(seg) / dbu << ", " << bg::get<0,1>(seg) / dbu
-      //             << ") -- (" << bg::get<1,0>(seg) / dbu << ", " << bg::get<1,1>(seg) / dbu
-      //             << ") (" << int(edge->getDir()) << "), type = " << (int)edge->getType() << ", queryBox = (" 
-      //             << bg::get<bg::min_corner, 0>(testBox) / dbu << ", " << bg::get<bg::min_corner, 1>(testBox) / dbu << ") -- ("
-      //             << bg::get<bg::max_corner, 0>(testBox) / dbu << ", " << bg::get<bg::max_corner, 1>(testBox) / dbu << ")\n"; 
-      for (auto &querySegEdge: edgeQueryResult) {
-        auto &querySeg = querySegEdge.first;
-        auto &queryEdge = querySegEdge.second;
-        int netId1 = edge->getNetId();
-        int netId2 = queryEdge->getNetId();
-        if (targetNetId != -1 && targetNetId != netId1 && targetNetId != netId2) {
-          continue;
-        }
-        // only opposite-dir edges are counted as eol violation
-        if (!isOppositeDir(edgeDir, queryEdge->getDir())) {
-          continue;
-        }
-        box_t queryEdgeSpanBox;
-        getEdgeSpanBox(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanBox);
-        // std::cout << "    against edge (" << bg::get<0,0>(querySeg) / dbu << ", " << bg::get<0,1>(querySeg) / dbu
-        //           << ") -- (" << bg::get<1,0>(querySeg) / dbu << ", " << bg::get<1,1>(querySeg) / dbu
-        //           << ") (" << int(edge->getDir()) << "), type = " << (int)queryEdge->getType() << ", spanBox = (" 
-        //           << bg::get<bg::min_corner, 0>(queryEdgeSpanBox) / dbu << ", " << bg::get<bg::min_corner, 1>(queryEdgeSpanBox) / dbu << ") -- ("
-        //           << bg::get<bg::max_corner, 0>(queryEdgeSpanBox) / dbu << ", " << bg::get<bg::max_corner, 1>(queryEdgeSpanBox) / dbu << ")\n";
-        if (!bg::intersects(queryEdgeSpanBox, testBox)) {
-          continue;
-        } else {
-          box_t overlapBox;
-          bg::intersection(queryEdgeSpanBox, testBox, overlapBox);
-          if (bg::area(overlapBox) == 0) {
-            continue;
-          }
-        }
-        // it is a violation
-        if (edge->getType() == drcEdgeTypeEnum::FIXED && queryEdge->getType() == drcEdgeTypeEnum::FIXED) {
-          continue;
-        }
-        // std::cout << "eol violation between edge (" << bg::get<0,0>(seg) / dbu << ", " << bg::get<0,1>(seg) / dbu
-        //           << ") -- (" << bg::get<1,0>(seg) / dbu << ", " << bg::get<1,1>(seg) / dbu
-        //           << ") and edge (" << bg::get<0,0>(querySeg) / dbu << ", " << bg::get<0,1>(querySeg) / dbu
-        //           << ") -- (" << bg::get<1,0>(querySeg) / dbu << ", " << bg::get<1,1>(querySeg) / dbu << ")\n";
-        Rectangle queryEdgeSpanRect;
-        getEdgeSpanRect(querySeg, queryEdge->getDir(), queryEdge->getSpan(), queryEdgeSpanRect);
-        Rectangle gapRect = generalized_intersect(queryEdgeSpanRect, segSpanRect);
-        
-        bool isVio = true;
-
-        box_t eolVioQueryBox(point_t(xl(gapRect), yl(gapRect)), point_t(xh(gapRect), yh(gapRect)));
-        std::vector<std::pair<box_t, int> > eolQueryResult;
-        auto &mergedRTree = layer2MergedRTree[edge->getLayerNum()];
-        mergedRTree.query(bgi::intersects(eolVioQueryBox), back_inserter(eolQueryResult));
-        
-
-        for (auto &eolVioPair: eolQueryResult) {
-          if (eolVioPair.second != netId1 && eolVioPair.second != netId2) {
-            continue;
-          }
-          if (bg::covered_by(eolVioQueryBox, eolVioPair.first)) {
-            isVio = false;
-            break;
-          }
-        }
-
-        if (isVio) {
-          frMarker eolVioMarker;
-          frBox eolVioBox(xl(gapRect), yl(gapRect), xh(gapRect), yh(gapRect));
-          eolVioMarker.setConstraint(constraint);
-          eolVioMarker.setBBox(eolVioBox);
-          eolVioMarker.setLayerNum(edge->getLayerNum());
-          // eolVioMarker.addNet(drcNets[edge->getNetId()]->getNet());
-          // eolVioMarker.addNet(drcNets[queryEdge->getNetId()]->getNet());
-          eolVioMarker.addSrc(drcNets[edge->getNetId()]->getSrc());
-          eolVioMarker.addSrc(drcNets[queryEdge->getNetId()]->getSrc());
-
-          markers.push_back(eolVioMarker);
-        }
-      }
-    }
-
-
-  }
-
-
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_setup.cpp b/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_setup.cpp
deleted file mode 100644
index 215eb47..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_setup.cpp
+++ /dev/null
@@ -1,492 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "drc/frDRC.h"
-#include "io/frShapeUtil.h"
-#include <memory>
-#include <iterator>
-#include <iostream>
-#include <math.h>
-#include <fstream>
-#include <chrono>
-
-using namespace std::chrono;
-using namespace boost::polygon::operators;
-
-
-void fr::DRCWorker::setup() {
-  setupEdgeRTree();
-  // printEdgeRTree();
-  setupMaxRectRTree();
-}
-
-void fr::DRCWorker::setupEdgeRTree() {
-  for (auto &drcNet: drcNets) {
-    setupEdgeRTree_net(drcNet.get());
-  }
-}
-
-void fr::DRCWorker::setupEdgeRTree_net(DRCNet* net) {
-  // double dbu = design->getTech()->getDBUPerUU();
-  int netId = net->getId();
-  std::map<frLayerNum, std::map<frCoord, boost::icl::interval_set<frCoord> > > layer2HorzEdgeIntvSet, layer2VertEdgeIntvSet; // HorzEdge: mapped from yLoc
-  std::map<frLayerNum, std::map<frCoord, boost::icl::interval_set<frCoord> > > layer2MergedHorzEdgeIntvSet, layer2MergedVertEdgeIntvSet; // HorzEdge: mapped from yLoc
-  std::set<frLayerNum> layerNums;
-  std::map<frLayerNum, PolygonSet> layer2MergedPolySet;
-  auto &layer2FixedPolySet = net->getLayer2FixedPolySet();
-  auto &layer2RoutePolySet = net->getLayer2RoutePolySet();
-  auto &layer2Seg2Edge = net->getLayerSegEdgeMap();
-
-  // get set of merged layerNums
-  for (auto it = layer2FixedPolySet.begin(); it != layer2FixedPolySet.end(); ++it) {
-    layerNums.insert(it->first);
-  }
-  for (auto it = layer2RoutePolySet.begin(); it != layer2RoutePolySet.end(); ++it) {
-    layerNums.insert(it->first);
-  }
-
-  // build fixed edge intv set
-  for (auto it = layer2FixedPolySet.begin(); it != layer2FixedPolySet.end(); ++it) {
-    frLayerNum layerNum = it->first;
-    for (auto &origPoly: it->second) {
-      std::vector<Polygon> polys;
-      getPolyWithHole(origPoly, polys);
-      if (!polys.empty() && winding(polys.back()) != boost::polygon::LOW) {
-        std::cout << "Error: outline poly must be clockwise\n";
-      }
-      for (auto &poly:polys) {
-        frVector<Point> vertices;
-        for (auto ptIt = begin_points(poly); ptIt != end_points(poly); ++ptIt) {
-          vertices.push_back(*ptIt);
-        }
-        for (int i = 0; i < (int)vertices.size(); ++i) {
-          auto pt1 = vertices[i];
-          auto pt2 = ((i + 1) == (int)vertices.size()) ? vertices[0] : vertices[i + 1];
-          // always from smaller pt to larger pt
-          if (pt1 > pt2) {
-            auto tmpPt = pt2;
-            pt2 = pt1;
-            pt1 = tmpPt;
-          }
-          // insert to intv set
-          if (pt1.x() == pt2.x()) {
-            // vertical intv
-            auto edgeIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.y(), pt2.y());
-            layer2VertEdgeIntvSet[layerNum][pt1.x()].insert(edgeIntv);
-          } else if (pt1.y() == pt2.y()) {
-            // horizontal intv
-            auto edgeIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.x(), pt2.x());
-            layer2HorzEdgeIntvSet[layerNum][pt1.y()].insert(edgeIntv);
-          } else {
-            std::cout << "Error: non-colinear pts in setupEdgeRTree_net, skipped\n";
-            continue;
-          }
-        }
-      }
-    }
-  }
-
-  // get layer2MergedPolySet
-  for (auto layerNum: layerNums) {
-    if (layer2FixedPolySet.find(layerNum) != layer2FixedPolySet.end()) {
-      layer2MergedPolySet[layerNum] += layer2FixedPolySet[layerNum];
-    }
-    if (layer2RoutePolySet.find(layerNum) != layer2RoutePolySet.end()) {
-      layer2MergedPolySet[layerNum] += layer2RoutePolySet[layerNum];
-    }
-  }
-
-  // build merged edge intv set
-  for (auto it = layer2MergedPolySet.begin(); it != layer2MergedPolySet.end(); ++it) {
-    frLayerNum layerNum = it->first;
-    for (auto &origPoly: it->second) {
-      std::vector<Polygon> polys;
-      getPolyWithHole(origPoly, polys);
-      if (!polys.empty() && winding(polys.back()) != boost::polygon::LOW) {
-        std::cout << "Error: outline poly must be clockwise\n";
-      }
-      for (auto &poly: polys) {
-        frVector<Point> vertices;
-        for (auto ptIt = begin_points(poly); ptIt != end_points(poly); ++ptIt) {
-          vertices.push_back(*ptIt);
-        }
-        for (int i = 0; i < (int)vertices.size(); ++i) {
-          auto pt1 = vertices[i];
-          auto pt2 = ((i + 1) == (int)vertices.size()) ? vertices[0] : vertices[i + 1];
-          // always from smaller pt to larger pt
-          if (pt1 > pt2) {
-            auto tmpPt = pt2;
-            pt2 = pt1;
-            pt1 = tmpPt;
-          }
-          // insert to intv set
-          if (pt1.x() == pt2.x()) {
-            // vertical intv
-            auto edgeIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.y(), pt2.y());
-            layer2MergedVertEdgeIntvSet[layerNum][pt1.x()].insert(edgeIntv);
-          } else if (pt1.y() == pt2.y()) {
-            // horizontal intv
-            auto edgeIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.x(), pt2.x());
-            layer2MergedHorzEdgeIntvSet[layerNum][pt1.y()].insert(edgeIntv);
-          } else {
-            std::cout << "Error: non-colinear pts in setupEdgeRTree_net, skipped\n";
-            continue;
-          }
-        }
-      }
-    }
-  }
-
-
-  // build edges 
-  for (auto it = layer2MergedPolySet.begin(); it != layer2MergedPolySet.end(); ++it) {
-    frLayerNum layerNum = it->first;
-    auto &polySet = it->second;
-    // the poly may have hole, need to call getPolyWithHole
-    for (auto &origPoly: polySet) {
-      std::vector<Polygon> polys;
-      getPolyWithHole(origPoly, polys);
-      if (!polys.empty() && winding(polys.back()) != boost::polygon::LOW) {
-        std::cout << "Error: outline poly must be clockwise\n";
-      }
-      // the last one is outline and the others are holes
-      for (auto &poly: polys) {
-        // build edge based on polygon
-        // std::cout << "@@@ new poly@@@\n";
-        frVector<Point> vertices;
-        frVector<Segment> segments;
-        for (auto ptIt = begin_points(poly); ptIt != end_points(poly); ++ptIt) {
-          vertices.push_back(*ptIt);
-        }
-        for (int i = 0; i < (int)vertices.size(); ++i) {
-          auto pt1 = vertices[i];
-          // std::cout << "@@@debug@@@: visit vertex (" << pt1.x() / dbu << ", " << pt1.y() / dbu << ")\n";
-          auto pt2 = ((i + 1) == (int)vertices.size()) ? vertices[0] : vertices[i + 1];
-          Segment directedEdgeSeg(pt1, pt2);
-          // always from smaller pt to larger pt
-          if (pt1 > pt2) {
-            auto tmpPt = pt2;
-            pt2 = pt1;
-            pt1 = tmpPt;
-          }
-          // create new edges
-          bool isFixed = false;
-          bool isHorizontal = (pt1.y() == pt2.y());
-          DRCEdge *drcEdge = net->addDRCEdge();
-          Segment drcEdgeSeg(pt1, pt2);
-          segments.push_back(drcEdgeSeg);
-          // std::cout << "@@@debug@@@: add edge (" << pt1.x() / dbu << ", " << pt1.y() / dbu 
-          //           << ") -- (" << pt2.x() / dbu << ", " << pt2.y() / dbu << ")\n";
-          layer2Seg2Edge[layerNum][drcEdgeSeg] = drcEdge;
-          drcEdge->setId(netId);
-          drcEdge->setSegment(directedEdgeSeg);
-          drcEdge->setLayerNum(layerNum);
-          drcEdge->setWinding(winding(poly));
-          // check whether this is fixed edge
-          if (isHorizontal) {
-            auto tempIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.x(), pt2.x());
-            if (layer2HorzEdgeIntvSet.find(layerNum) == layer2HorzEdgeIntvSet.end() ||
-                layer2HorzEdgeIntvSet[layerNum].find(pt1.y()) == layer2HorzEdgeIntvSet[layerNum].end() ||
-                (!boost::icl::contains(layer2HorzEdgeIntvSet[layerNum][pt1.y()], tempIntv))) {
-              isFixed = false;
-            } else {
-              isFixed = true;
-            }
-          } else {
-            auto tempIntv = boost::icl::interval<frCoord>::interval_type::right_open(pt1.y(), pt2.y());
-            if (layer2VertEdgeIntvSet.find(layerNum) == layer2VertEdgeIntvSet.end() ||
-                layer2VertEdgeIntvSet[layerNum].find(pt1.x()) == layer2VertEdgeIntvSet[layerNum].end() ||
-                (!boost::icl::contains(layer2VertEdgeIntvSet[layerNum][pt1.x()], tempIntv))) {
-              isFixed = false;
-            } else {
-              isFixed = true;
-            }
-          }
-
-          if (isFixed) {
-            drcEdge->setType(drcEdgeTypeEnum::FIXED);
-          } else {
-            drcEdge->setType(drcEdgeTypeEnum::ROUTE);
-          }
-          // dir, prev, next, span will be set later
-        }
-        // set prev next pointer
-        for (int i = 0; i < (int)segments.size(); ++i) {
-          DRCEdge* drcEdge = layer2Seg2Edge[layerNum][segments[i]];
-          DRCEdge *nextDRCEdge, *prevDRCEdge;
-          // if (winding(poly) == boost::polygon::LOW) {
-            nextDRCEdge = layer2Seg2Edge[layerNum][segments[(i+1) % ((int)segments.size())]];
-            prevDRCEdge = layer2Seg2Edge[layerNum][segments[(i-1+(int)segments.size()) % ((int)segments.size())]];
-          // } else {
-          //   nextDRCEdge = layer2Seg2Edge[layerNum][segments[(i-1+(int)segments.size()) % ((int)segments.size())]];
-          //   prevDRCEdge = layer2Seg2Edge[layerNum][segments[(i+1) % ((int)segments.size())]];
-          // }
-          drcEdge->setNext(nextDRCEdge);
-          drcEdge->setPrev(prevDRCEdge);
-        }
-      }
-
-      // build edge based max rectangles
-      std::vector<Rectangle> maxRects;
-      PolygonSet tmpPolySet;
-      tmpPolySet += origPoly;
-      get_max_rectangles(maxRects, tmpPolySet);
-      for (auto rect: maxRects) {
-        frCoord horzSpan = xh(rect) - xl(rect);
-        frCoord vertSpan = yh(rect) - yl(rect);
-        // left side
-        Segment leftSeg(ll(rect), ul(rect));
-        auto leftIntv = boost::icl::interval<frCoord>::interval_type::right_open(yl(rect), yh(rect));
-        auto intvItResLeft = layer2MergedVertEdgeIntvSet[layerNum][xl(rect)].equal_range(leftIntv);
-        for (auto intvIt = intvItResLeft.first; intvIt != intvItResLeft.second; ++intvIt) {
-          auto &segIntv = *intvIt;
-          // update existing edge
-          if (boost::icl::contains(leftIntv, segIntv)) {
-            Segment drcEdgeSeg(Point(xl(rect), intvIt->lower()), Point(xl(rect), intvIt->upper()));
-            DRCEdge* drcEdge = layer2Seg2Edge[layerNum][drcEdgeSeg];
-            drcEdge->setDir(frDirEnum::W);
-            if (drcEdge->getSpan() < horzSpan) {
-              drcEdge->setSpan(horzSpan);
-            }
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            if (drcEdge->getWidth() < tmpWidth) {
-              drcEdge->setWidth(tmpWidth);
-            }
-          }
-          // add new edge if any
-          else {
-            DRCEdge *drcEdge = net->addDRCEdge();
-            auto ovlpIntv = boost::icl::interval<frCoord>::interval_type::right_open(std::max(intvIt->lower(), leftIntv.lower()), std::min(intvIt->upper(), leftIntv.upper()));
-            Segment ovlpEdgeSeg(Point(xl(rect), ovlpIntv.lower()),Point(xl(rect), ovlpIntv.upper()));
-            layer2Seg2Edge[layerNum][ovlpEdgeSeg] = drcEdge;
-            drcEdge->setId(netId);
-            drcEdge->setSegment(ovlpEdgeSeg);
-            drcEdge->setLayerNum(layerNum);
-            if (boost::icl::contains(layer2VertEdgeIntvSet[layerNum][xl(rect)], ovlpIntv)) {
-              drcEdge->setType(drcEdgeTypeEnum::FIXED);
-            } else {
-              drcEdge->setType(drcEdgeTypeEnum::ROUTE);
-            }
-            drcEdge->setDir(frDirEnum::W);
-            drcEdge->setSpan(horzSpan);
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            drcEdge->setWidth(tmpWidth);
-          }
-        }
-
-        // bottom side
-        Segment bottomSeg(ll(rect), lr(rect));
-        auto bottomIntv = boost::icl::interval<frCoord>::interval_type::right_open(xl(rect), xh(rect));
-        auto intvItResBottom = layer2MergedHorzEdgeIntvSet[layerNum][yl(rect)].equal_range(bottomIntv);
-        for (auto intvIt = intvItResBottom.first; intvIt != intvItResBottom.second; ++intvIt) {
-          auto &segIntv = *intvIt;
-          // update existing edge
-          if (boost::icl::contains(bottomIntv, segIntv)) {
-            Segment drcEdgeSeg(Point(intvIt->lower(), yl(rect)), Point(intvIt->upper(), yl(rect)));
-            DRCEdge* drcEdge = layer2Seg2Edge[layerNum][drcEdgeSeg];
-            drcEdge->setDir(frDirEnum::S);
-            if (drcEdge->getSpan() < vertSpan) {
-              drcEdge->setSpan(vertSpan);
-            }
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            if (drcEdge->getWidth() < tmpWidth) {
-              drcEdge->setWidth(tmpWidth);
-            }
-          }
-          // add new edge if any
-          else {
-            DRCEdge *drcEdge = net->addDRCEdge();
-            auto ovlpIntv = boost::icl::interval<frCoord>::interval_type::right_open(std::max(intvIt->lower(), bottomIntv.lower()), std::min(intvIt->upper(), bottomIntv.upper()));
-            Segment ovlpEdgeSeg(Point(ovlpIntv.lower(), yl(rect)),Point(ovlpIntv.upper(), yl(rect)));
-            layer2Seg2Edge[layerNum][ovlpEdgeSeg] = drcEdge;
-            drcEdge->setId(netId);
-            drcEdge->setSegment(ovlpEdgeSeg);
-            drcEdge->setLayerNum(layerNum);
-            if (boost::icl::contains(layer2HorzEdgeIntvSet[layerNum][yl(rect)], ovlpIntv)) {
-              drcEdge->setType(drcEdgeTypeEnum::FIXED);
-            } else {
-              drcEdge->setType(drcEdgeTypeEnum::ROUTE);
-            }
-            drcEdge->setDir(frDirEnum::S);
-            drcEdge->setSpan(vertSpan);
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            drcEdge->setWidth(tmpWidth);
-          }
-        }
-
-
-        // right side
-        Segment rightSeg(lr(rect), ur(rect));
-        auto rightIntv = boost::icl::interval<frCoord>::interval_type::right_open(yl(rect), yh(rect));
-        auto intvItResRight = layer2MergedVertEdgeIntvSet[layerNum][xh(rect)].equal_range(rightIntv);
-        for (auto intvIt = intvItResRight.first; intvIt != intvItResRight.second; ++intvIt) {
-          auto &segIntv = *intvIt;
-          // update existing edge
-          if (boost::icl::contains(rightIntv, segIntv)) {
-            Segment drcEdgeSeg(Point(xh(rect), intvIt->lower()), Point(xh(rect), intvIt->upper()));
-            DRCEdge* drcEdge = layer2Seg2Edge[layerNum][drcEdgeSeg];
-            drcEdge->setDir(frDirEnum::E);
-            if (drcEdge->getSpan() < horzSpan) {
-              drcEdge->setSpan(horzSpan);
-            }
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            if (drcEdge->getWidth() < tmpWidth) {
-              drcEdge->setWidth(tmpWidth);
-            }
-          }
-          // add new edge if any
-          else {
-            DRCEdge *drcEdge = net->addDRCEdge();
-            auto ovlpIntv = boost::icl::interval<frCoord>::interval_type::right_open(std::max(intvIt->lower(), rightIntv.lower()), std::min(intvIt->upper(), rightIntv.upper()));
-            Segment ovlpEdgeSeg(Point(xh(rect), ovlpIntv.lower()),Point(xh(rect), ovlpIntv.upper()));
-            layer2Seg2Edge[layerNum][ovlpEdgeSeg] = drcEdge;
-            drcEdge->setId(netId);
-            drcEdge->setSegment(ovlpEdgeSeg);
-            drcEdge->setLayerNum(layerNum);
-            if (boost::icl::contains(layer2VertEdgeIntvSet[layerNum][xh(rect)], ovlpIntv)) {
-              drcEdge->setType(drcEdgeTypeEnum::FIXED);
-            } else {
-              drcEdge->setType(drcEdgeTypeEnum::ROUTE);
-            }
-            drcEdge->setDir(frDirEnum::E);
-            drcEdge->setSpan(horzSpan);
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            drcEdge->setWidth(tmpWidth);
-          }
-        }
-
-
-        // top side
-        Segment topSeg(ul(rect), ur(rect));
-        auto topIntv = boost::icl::interval<frCoord>::interval_type::right_open(xl(rect), xh(rect));
-        auto intvItResTop = layer2MergedHorzEdgeIntvSet[layerNum][yh(rect)].equal_range(topIntv);
-        for (auto intvIt = intvItResTop.first; intvIt != intvItResTop.second; ++intvIt) {
-          auto &segIntv = *intvIt;
-          // update existing edge
-          if (boost::icl::contains(topIntv, segIntv)) {
-            Segment drcEdgeSeg(Point(intvIt->lower(), yh(rect)), Point(intvIt->upper(), yh(rect)));
-            DRCEdge* drcEdge = layer2Seg2Edge[layerNum][drcEdgeSeg];
-            drcEdge->setDir(frDirEnum::N);
-            if (drcEdge->getSpan() < vertSpan) {
-              drcEdge->setSpan(vertSpan);
-            }
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            if (drcEdge->getWidth() < tmpWidth) {
-              drcEdge->setWidth(tmpWidth);
-            }
-          }
-          // add new edge if any
-          else {
-            DRCEdge *drcEdge = net->addDRCEdge();
-            auto ovlpIntv = boost::icl::interval<frCoord>::interval_type::right_open(std::max(intvIt->lower(), topIntv.lower()), std::min(intvIt->upper(), topIntv.upper()));
-            Segment ovlpEdgeSeg(Point(ovlpIntv.lower(), yh(rect)),Point(ovlpIntv.upper(), yh(rect)));
-            layer2Seg2Edge[layerNum][ovlpEdgeSeg] = drcEdge;
-            drcEdge->setId(netId);
-            drcEdge->setSegment(ovlpEdgeSeg);
-            drcEdge->setLayerNum(layerNum);
-            if (boost::icl::contains(layer2HorzEdgeIntvSet[layerNum][yh(rect)], ovlpIntv)) {
-              drcEdge->setType(drcEdgeTypeEnum::FIXED);
-            } else {
-              drcEdge->setType(drcEdgeTypeEnum::ROUTE);
-            }
-            drcEdge->setDir(frDirEnum::N);
-            drcEdge->setSpan(vertSpan);
-            frCoord tmpWidth = std::min(vertSpan, horzSpan);
-            drcEdge->setWidth(tmpWidth);
-          }
-        }
-
-
-      }
-    }
-  }
-
-  // push edges to RTree
-  for (auto layerIt = layer2Seg2Edge.begin(); layerIt != layer2Seg2Edge.end(); ++layerIt) {
-    frLayerNum layerNum = layerIt->first;
-    auto &seg2Edge = layerIt->second;
-    for (auto segIt = seg2Edge.begin(); segIt != seg2Edge.end(); ++segIt) {
-      auto &edgeSeg = segIt->first;
-      segment_t rtreeSeg(point_t(low(edgeSeg).x(), low(edgeSeg).y()), point_t(high(edgeSeg).x(), high(edgeSeg).y()));
-      layer2EdgeRTree[layerNum].insert(std::make_pair(rtreeSeg, segIt->second));
-    }
-  }
-}
-
-void fr::DRCWorker::setupMaxRectRTree() {
-  for (auto &drcNet: drcNets) {
-    setupMaxRectRTree_net(drcNet.get());
-  }
-}
-
-void fr::DRCWorker::setupMaxRectRTree_net(DRCNet* net) {
-  int netId = net->getId();
-  std::set<frLayerNum> layerNums;
-  std::map<frLayerNum, PolygonSet> layer2MergedPolySet;
-  auto &layer2FixedPolySet = net->getLayer2FixedPolySet();
-  auto &layer2RoutePolySet = net->getLayer2RoutePolySet();
-  
-  // build fixedRTree
-  updateMaxRectRtree(netId, layer2FixedPolySet, layer2FixedRTree);
-
-  // build mergedRTree
-
-  // get set of merged layerNums
-  for (auto it = layer2FixedPolySet.begin(); it != layer2FixedPolySet.end(); ++it) {
-    layerNums.insert(it->first);
-  }
-  for (auto it = layer2RoutePolySet.begin(); it != layer2RoutePolySet.end(); ++it) {
-    layerNums.insert(it->first);
-  }
-
-  for (auto layerNum: layerNums) {
-    if (layer2FixedPolySet.find(layerNum) != layer2FixedPolySet.end()) {
-      layer2MergedPolySet[layerNum] += layer2FixedPolySet[layerNum];
-    }
-    if (layer2RoutePolySet.find(layerNum) != layer2RoutePolySet.end()) {
-      layer2MergedPolySet[layerNum] += layer2RoutePolySet[layerNum];
-    }
-  }
-  updateMaxRectRtree(netId, layer2MergedPolySet, layer2MergedRTree);
-
-}
-
-void fr::DRCWorker::updateMaxRectRtree(int netId, 
-                                       const std::map<frLayerNum, PolygonSet> &layer2PolySet, 
-                                       std::map<frLayerNum, bgi::rtree<std::pair<box_t, int>, bgi::quadratic<16> > > &maxRectRTree) {
-  for (auto it = layer2PolySet.begin(); it != layer2PolySet.end(); ++it) {
-    frLayerNum layerNum = it->first;
-    auto &polySet = it->second;
-    std::vector<Rectangle> maxRects;
-    get_max_rectangles(maxRects, polySet);
-    for (auto &maxRect: maxRects) {
-      box_t boostb = box_t(point_t(xl(maxRect), yl(maxRect)), point_t(xh(maxRect), yh(maxRect)));
-      maxRectRTree[layerNum].insert(std::make_pair(boostb, netId));
-    }
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_util.cpp b/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_util.cpp
deleted file mode 100644
index d751246..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/drc/frDRC_util.cpp
+++ /dev/null
@@ -1,452 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "drc/frDRC.h"
-#include "io/frShapeUtil.h"
-#include <memory>
-#include <iterator>
-#include <iostream>
-#include <math.h>
-#include <fstream>
-#include <chrono>
-
-using namespace std::chrono;
-
-void fr::DRCWorker::printEdgeRTree() {
-  double dbu = design->getTech()->getDBUPerUU();
-  for (auto mapIt = layer2EdgeRTree.begin(); mapIt != layer2EdgeRTree.end(); ++mapIt) {
-    // frLayerNum layerNum = mapIt->first;
-    // std::cout << "  layerNum = " << layerNum << "\n";
-    auto &edgeRTree = mapIt->second;
-    for (auto rtreeIt = edgeRTree.begin(); rtreeIt != edgeRTree.end(); ++rtreeIt) {
-      segment_t seg = rtreeIt->first;
-      auto edge = rtreeIt->second;
-      point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-      point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-      point_t leftPt, rightPt;
-      if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-        leftPt = pt2;
-        rightPt = pt1;
-      } else {
-        leftPt = pt1;
-        rightPt = pt2;
-      }
-      frCoord llx = 0, lly = 0, urx = 0, ury = 0;
-      llx = bg::get<0>(leftPt);
-      urx = bg::get<0>(rightPt);
-      lly = bg::get<1>(leftPt);
-      ury = bg::get<1>(rightPt);
-      std::cout << "    net " << edge->getNetId() << " (" << llx / dbu << ", " << lly / dbu
-                << ") - (" << urx / dbu << ", " << ury / dbu << "), dir = " << (int)edge->getDir() 
-                << ", edgeType = " << (int)edge->getType() << "\n";
-    }
-  }
-}
-
-
-
-void fr::DRCWorker::getEdgeSpanRect(const segment_t &seg, const frDirEnum &dir, const frCoord &span, Rectangle &edgeSpanRect) {
-  // double dbu = design->getTech()->getDBUPerUU();
-  point_t leftPt, rightPt; // left is the smaller one, right is the larger one, true for vertical as well
-  point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-  point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-  if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-    leftPt = pt2;
-    rightPt = pt1;
-  } else {
-    leftPt = pt1;
-    rightPt = pt2;
-  }
-  // std::cout << "  getEdgeSpanRect: from (" << bg::get<0>(leftPt) / dbu<< ", " << bg::get<1>(leftPt) / dbu<< ") to "
-  //           << "(" << bg::get<0>(rightPt) / dbu << ", " << bg::get<1>(rightPt) / dbu << ")\n";
-  frCoord llx = -1, lly = -1, urx = -1, ury = -1;
-  if (dir == frDirEnum::E) {
-    urx = bg::get<0>(rightPt);
-    llx = urx - span;
-    lly = bg::get<1>(leftPt);
-    ury = bg::get<1>(rightPt);
-  } else if (dir == frDirEnum::S) {
-    llx = bg::get<0>(leftPt);
-    urx = bg::get<0>(rightPt);
-    lly = bg::get<1>(leftPt);
-    ury = lly + span;
-  } else if (dir == frDirEnum::W) {
-    llx = bg::get<0>(leftPt);
-    urx = llx + span;
-    lly = bg::get<1>(leftPt);
-    ury = bg::get<1>(rightPt);
-  } else if (dir == frDirEnum::N) {
-    llx = bg::get<0>(leftPt);
-    urx = bg::get<0>(rightPt);
-    ury = bg::get<1>(leftPt);
-    lly = ury - span;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getEdgeSpanRect\n";
-  }
-  // std::cout << "   " << llx << " " << lly << " " << urx << " " << ury << "\n";
-  edgeSpanRect = Rectangle(llx, lly, urx, ury);
-}
-
-void fr::DRCWorker::getEdgeSpanBox(const segment_t &seg, const frDirEnum &dir, const frCoord &span, box_t &edgeSpanBox) {
-  point_t leftPt, rightPt; // left is the smaller one, right is the larger one, true for vertical as well
-  point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-  point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-  if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-    leftPt = pt2;
-    rightPt = pt1;
-  } else {
-    leftPt = pt1;
-    rightPt = pt2;
-  }
-  frCoord llx = 0, lly = 0, urx = 0, ury = 0;
-  if (dir == frDirEnum::E) {
-    urx = bg::get<0>(leftPt);
-    llx = urx - span;
-    lly = bg::get<1>(leftPt);
-    ury = bg::get<1>(rightPt);
-  } else if (dir == frDirEnum::S) {
-    llx = bg::get<0>(leftPt);
-    urx = bg::get<0>(rightPt);
-    lly = bg::get<1>(leftPt);
-    ury = lly + span;
-  } else if (dir == frDirEnum::W) {
-    llx = bg::get<0>(leftPt);
-    urx = llx + span;
-    lly = bg::get<1>(leftPt);
-    ury = bg::get<1>(rightPt);
-  } else if (dir == frDirEnum::N) {
-    llx = bg::get<0>(leftPt);
-    urx = bg::get<0>(rightPt);
-    ury = bg::get<1>(leftPt);
-    lly = ury - span;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getEdgeSpanBox\n";
-  }
-
-  edgeSpanBox = box_t(point_t(llx, lly), point_t(urx, ury));
-}
-
-bool fr::DRCWorker::isOppositeDir(frDirEnum dir1, frDirEnum dir2) {
-  if (dir1 == frDirEnum::E && dir2 == frDirEnum::W || 
-      dir1 == frDirEnum::S && dir2 == frDirEnum::N || 
-      dir1 == frDirEnum::W && dir2 == frDirEnum::E || 
-      dir1 == frDirEnum::N && dir2 == frDirEnum::S) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-void fr::DRCWorker::getSpacingTableTestBox(const segment_t &seg, DRCEdge* prlEdge, frCoord maxSpacingVal, box_t &testBox) {
-  auto dir = prlEdge->getDir();
-  point_t leftPt, rightPt; // left is the smaller one, right is the larger one, true for vertical as well
-  point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-  point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-  if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-    leftPt = pt2;
-    rightPt = pt1;
-  } else {
-    leftPt = pt1;
-    rightPt = pt2;
-  }
-  frCoord llx = 0, lly = 0, urx = 0, ury = 0;
-  if (dir == frDirEnum::E) {
-    llx = bg::get<0>(leftPt);
-    urx = llx + maxSpacingVal;
-    lly = bg::get<1>(leftPt) - maxSpacingVal;
-    ury = bg::get<1>(rightPt) + maxSpacingVal;
-  } else if (dir == frDirEnum::S) {
-    llx = bg::get<0>(leftPt) - maxSpacingVal;
-    urx = bg::get<0>(rightPt) + maxSpacingVal;
-    ury = bg::get<1>(leftPt);
-    lly = ury - maxSpacingVal;
-  } else if (dir == frDirEnum::W) {
-    urx = bg::get<0>(leftPt);
-    llx = urx - maxSpacingVal;
-    lly = bg::get<1>(leftPt) - maxSpacingVal;
-    ury = bg::get<1>(rightPt) + maxSpacingVal;
-  } else if (dir == frDirEnum::N) {
-    llx = bg::get<0>(leftPt) - maxSpacingVal;
-    urx = bg::get<0>(rightPt) + maxSpacingVal;
-    lly = bg::get<1>(leftPt);
-    ury = lly + maxSpacingVal;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getSpacingTableTestBox\n";
-  }
-  testBox = box_t(point_t(llx, lly), point_t(urx, ury));
-
-}
-
-// left or bottom direction
-fr::frDirEnum fr::DRCWorker::leftEdgeDir(const frDirEnum &dirIn) {
-  if (dirIn == frDirEnum::N || dirIn == frDirEnum::S) {
-    return frDirEnum::W;
-  } else {
-    return frDirEnum::S;
-  }
-}
-
-fr::frDirEnum fr::DRCWorker::rightEdgeDir(const frDirEnum &dirIn) {
-  if (dirIn == frDirEnum::N || dirIn == frDirEnum::S) {
-    return frDirEnum::E;
-  } else {
-    return frDirEnum::N;
-  }
-}
-
-bool fr::DRCWorker::isEolEdge(DRCEdge* edge) {
-  // if not polygon edge, return false
-  if (edge->getPrevEdge() == nullptr || edge->getNextEdge() == nullptr) {
-    return false;
-  }
-  auto prevEdge = edge->getPrevEdge();
-  auto nextEdge = edge->getNextEdge();
-  // return true iff one of the following is true
-  if ((prevEdge->getDir() == frDirEnum::W && edge->getDir() == frDirEnum::N && nextEdge->getDir() == frDirEnum::E) ||
-      (prevEdge->getDir() == frDirEnum::S && edge->getDir() == frDirEnum::W && nextEdge->getDir() == frDirEnum::N) || 
-      (prevEdge->getDir() == frDirEnum::E && edge->getDir() == frDirEnum::S && nextEdge->getDir() == frDirEnum::W) ||
-      (prevEdge->getDir() == frDirEnum::N && edge->getDir() == frDirEnum::E && nextEdge->getDir() == frDirEnum::S)) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-// bool fr::DRCWorker::isConvecEdge(DRCEdge* edge) {
-//   // if not polygon edge, return false
-//   if (edge->getPrevEdge() == nullptr || edge->getNextEdge() == nullptr) {
-//     return false;
-//   }
-//   auto prevEdge = edge->getPrevEdge();
-//   auto nextEdge = edge->getNextEdge();
-//   // return true iff one of the following is true
-//   if ((prevEdge->getDir() == frDirEnum::W && edge->getDir() == frDirEnum::N && nextEdge->getDir() == frDirEnum::E) ||
-//       (prevEdge->getDir() == frDirEnum::S && edge->getDir() == frDirEnum::W && nextEdge->getDir() == frDirEnum::N) || 
-//       (prevEdge->getDir() == frDirEnum::E && edge->getDir() == frDirEnum::S && nextEdge->getDir() == frDirEnum::W) ||
-//       (prevEdge->getDir() == frDirEnum::N && edge->getDir() == frDirEnum::E && nextEdge->getDir() == frDirEnum::S)) {
-//     return true;
-//   } else {
-//     return false;
-//   }
-// }
-
-// bool fr::DRCWorker::isConcaveEdge(DRCEdge* edge) {
-//   // if not polygon edge, return false
-//   if (edge->getPrevEdge() == nullptr || edge->getNextEdge() == nullptr) {
-//     return false;
-//   }
-//   auto prevEdge = edge->getPrevEdge();
-//   auto nextEdge = edge->getNextEdge();
-//   // return true iff one of the following is true
-//   if ((prevEdge->getDir() == frDirEnum::E && edge->getDir() == frDirEnum::N && nextEdge->getDir() == frDirEnum::W) ||
-//       (prevEdge->getDir() == frDirEnum::N && edge->getDir() == frDirEnum::W && nextEdge->getDir() == frDirEnum::S) || 
-//       (prevEdge->getDir() == frDirEnum::W && edge->getDir() == frDirEnum::S && nextEdge->getDir() == frDirEnum::E) ||
-//       (prevEdge->getDir() == frDirEnum::S && edge->getDir() == frDirEnum::E && nextEdge->getDir() == frDirEnum::N)) {
-//     return true;
-//   } else {
-//     return false;
-//   }
-// }
-
-void fr::DRCWorker::getEOLTestBox(const segment_t &seg, DRCEdge* eolEdge, const frCoord &eolSpace, const frCoord &eolWithin, box_t &testBox) {
-  auto dir = eolEdge->getDir();
-  point_t leftPt, rightPt; // left is the smaller one, right is the larger one, true for vertical as well
-  point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-  point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-  if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-    leftPt = pt2;
-    rightPt = pt1;
-  } else {
-    leftPt = pt1;
-    rightPt = pt2;
-  }
-  frCoord llx = 0, lly = 0, urx = 0, ury = 0;
-  if (dir == frDirEnum::E) {
-    llx = bg::get<0>(leftPt);
-    urx = llx + eolSpace;
-    lly = bg::get<1>(leftPt) - eolWithin;
-    ury = bg::get<1>(rightPt) + eolWithin;
-  } else if (dir == frDirEnum::S) {
-    llx = bg::get<0>(leftPt) - eolWithin;
-    urx = bg::get<0>(rightPt) + eolWithin;
-    ury = bg::get<1>(leftPt);
-    lly = ury - eolSpace;
-  } else if (dir == frDirEnum::W) {
-    urx = bg::get<0>(leftPt);
-    llx = urx - eolSpace;
-    lly = bg::get<1>(leftPt) - eolWithin;
-    ury = bg::get<1>(rightPt) + eolWithin;
-  } else if (dir == frDirEnum::N) {
-    llx = bg::get<0>(leftPt) - eolWithin;
-    urx = bg::get<0>(rightPt) + eolWithin;
-    lly = bg::get<1>(leftPt);
-    ury = lly + eolSpace;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getSpacingTableTestBox\n";
-  }
-  testBox = box_t(point_t(llx, lly), point_t(urx, ury));
-}
-
-void fr::DRCWorker::getParallelEdgeBoxs(const segment_t &seg,
-                                         DRCEdge *eolEdge, 
-                                         const frCoord &parSpace,
-                                         const frCoord &parWithin,
-                                         const frCoord &eolWithin,
-                                         box_t &parallelEdgeBoxLeft,
-                                         box_t &parallelEdgeBoxRight) {
-  auto dir = eolEdge->getDir();
-  point_t leftPt, rightPt;
-  point_t pt1(bg::get<0,0>(seg), bg::get<0,1>(seg));
-  point_t pt2(bg::get<1,0>(seg), bg::get<1,1>(seg));
-  if (bg::get<0>(pt1) > bg::get<0>(pt2) || bg::get<1>(pt1) > bg::get<1>(pt2)) {
-    leftPt = pt2;
-    rightPt = pt1;
-  } else {
-    leftPt = pt1;
-    rightPt = pt2;
-  }
-  frCoord llx = 0, lly = 0, urx = 0, ury = 0;
-  // left / bottom parallelEdge rect
-  if (dir == frDirEnum::E) {
-    ury = bg::get<1>(leftPt);
-    lly = ury - parSpace;
-    llx = bg::get<0>(leftPt) - parWithin;
-    urx = bg::get<0>(leftPt) + eolWithin;
-  } else if (dir == frDirEnum::S) {
-    urx = bg::get<0>(leftPt);
-    llx = urx - parSpace;
-    ury = bg::get<1>(leftPt) + parWithin;
-    lly = bg::get<1>(leftPt) - eolWithin;
-  } else if (dir == frDirEnum::W) {
-    ury = bg::get<1>(leftPt);
-    lly = ury - parSpace;
-    llx = bg::get<0>(leftPt) - eolWithin;
-    urx = bg::get<0>(leftPt) + parWithin;
-  } else if (dir == frDirEnum::N) {
-    urx = bg::get<0>(leftPt);
-    llx = urx - parSpace;
-    ury = bg::get<1>(leftPt) + eolWithin;
-    lly = bg::get<1>(leftPt) - parWithin;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getParallelEdgeRect\n";
-  }
-  parallelEdgeBoxLeft =  box_t(point_t(llx, lly), point_t(urx, ury));
-  // right / top parallelEddge rect
-  if (dir == frDirEnum::E) {
-    lly = bg::get<1>(rightPt);
-    ury = lly + parSpace;
-    llx = bg::get<0>(rightPt) - parWithin;
-    urx = bg::get<0>(rightPt) + eolWithin;
-  } else if (dir == frDirEnum::S) {
-    llx = bg::get<0>(rightPt);
-    urx = llx + parSpace;
-    ury = bg::get<1>(rightPt) + parWithin;
-    lly = bg::get<1>(rightPt) - eolWithin;
-  } else if (dir == frDirEnum::W) {
-    lly = bg::get<1>(rightPt);
-    ury = lly + parSpace;
-    llx = bg::get<0>(rightPt) - eolWithin;
-    urx = bg::get<0>(rightPt) + parWithin;
-  } else if (dir == frDirEnum::N) {
-    llx = bg::get<0>(rightPt);
-    urx = llx + parSpace;
-    ury = bg::get<1>(rightPt) + eolWithin;
-    lly = bg::get<1>(rightPt) - parWithin;
-  } else {
-    std::cout << "Error: UNKNOWN edge direction in getParallelEdgeRect\n";
-  }
-  parallelEdgeBoxRight = box_t(point_t(llx, lly), point_t(urx, ury));
-  return;
-}
-
-
-bool fr::DRCWorker::covered_by(const boost::icl::discrete_interval<frCoord, std::less> &intv,
-                               const boost::icl::interval_set<frCoord> &intvSet) {
-  auto intvItRes = intvSet.equal_range(intv);
-  for (auto intvIt = intvItRes.first; intvIt != intvItRes.second; ++intvIt) {
-    return (boost::icl::contains(*intvIt, intv));
-  }
-  return false;
-}
-
-fr::frCoord fr::DRCWorker::rectDiagLength(const Rectangle &rect) {
-  frCoord deltaX = (xh(rect) - xl(rect));
-  frCoord deltaY = (yh(rect) - yl(rect));
-  return frCoord(sqrt(deltaX * deltaX + deltaY * deltaY));
-}
-
-
-
-void fr::DRCWorker::report() {
-  double dbu = design->getTech()->getDBUPerUU();
-  std::cout << DRC_RPT_FILE << "\n";
-  if (DRC_RPT_FILE != std::string("")) {
-    std::ofstream drcRpt(DRC_RPT_FILE.c_str());
-    if (drcRpt.is_open()) {
-      for (auto &marker: markers) {
-        drcRpt << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        // get source(s) of violation
-        drcRpt << "    srcs: ";
-        for (auto src: marker.getSrcs()) {
-          if (src) {
-            switch (src->typeId()) {
-              case frcNet:
-                drcRpt << (static_cast<frNet*>(src))->getName() << " ";
-                break;
-              case frcInstTerm: {
-                frInstTerm* instTerm = (static_cast<frInstTerm*>(src));
-                // drcRpt << instTerm->getInst()->getName() 
-                       // << "/" << instTerm->getTerm()->getName() << " ";
-                drcRpt << "Pin of Cell " << instTerm->getInst()->getName() << " ";
-                break;
-              }
-              case frcTerm: {
-                frTerm* term = (static_cast<frTerm*>(src));
-                drcRpt << term->getName() << " ";
-                break;
-              }
-              default:
-                std::cout << "Error: unexpected src type in marker\n";
-            }
-          }
-        }
-        drcRpt << "\n";
-        // get violation bbox
-        frBox bbox;
-        marker.getBBox(bbox);
-        drcRpt << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-               << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    } else {
-      std::cout << "Error: Fail to open DRC report file\n";
-    }
-  } else {
-    std::cout << "Error: DRC report file is not specified\n";
-  }
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/frBaseTypes.h b/scripts/pdn/src/PdnPinDumper/src/frBaseTypes.h
deleted file mode 100644
index 5c65e1b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/frBaseTypes.h
+++ /dev/null
@@ -1,319 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_BASE_TYPES_H_
-#define _FR_BASE_TYPES_H_
-
-#include <vector>
-#include <list>
-#include <map>
-#include <string>
-#include <utility>
-
-//#include <boost/property_map/property_map.hpp>
-#include <boost/graph/adjacency_list.hpp>
-//#include <boost/graph/connected_components.hpp>
-
-#include <boost/geometry.hpp>
-#include <boost/polygon/polygon.hpp>
-//#include <boost/geometry/geometries/point.hpp>
-//#include <boost/geometry/geometries/box.hpp>
-//#include <boost/geometry/index/rtree.hpp>
-
-namespace fr {
-  using frLayerNum = int;
-  using frCoord = int;
-  using frUInt4 = unsigned int;
-  using frDist  = double;
-  using frString = std::string;
-  using frCost = unsigned int;
-  using frMIdx = int; // negative value expected 
-  template <typename T>
-  using frCollection = std::vector<T>;
-  template <typename T>
-  using frVector     = std::vector<T>;
-  template <typename T>
-  using frList       = std::list<T>;
-  template <typename T>
-  using frListIter   = typename std::list<T>::iterator;
-  //template <typename T>
-  //bool frListIterComp (const frListIter<T>& a, const frListIter<T>& b) {
-  //  return &(*a) < &(*b);
-  //};
-  enum frOrientEnum {
-      frcR0       = 0, // N
-      frcR90      = 1, // W
-      frcR180     = 2, // S
-      frcR270     = 3, // E
-      frcMY       = 4, // FN
-      frcMXR90    = 5, // FW
-      frcMX       = 6, // FS
-      frcMYR90    = 7  // FE
-  };
-  enum frEndStyleEnum {
-      frcTruncateEndStyle = 0, // ext = 0
-      frcExtendEndStyle   = 1, // ext = half width
-      frcVariableEndStyle = 2  // ext = variable
-  };
-  enum frPrefRoutingDirEnum {
-      frcNotApplicablePrefRoutingDir = 0,
-      frcNonePrefRoutingDir          = 1,
-      frcHorzPrefRoutingDir          = 2,
-      frcVertPrefRoutingDir          = 3 
-  };
-  enum frBlockObjectEnum {
-      frcBlockObject   = -1,
-      frcNet           = 0,
-      frcTerm          = 1,
-      frcInst          = 2,
-      frcFig           = 3,
-      frcConnFig       = 4,
-      frcPinFig        = 5,
-      frcShape         = 6,
-      frcRef           = 7,
-      frcVia           = 8,
-      frcPin           = 9,
-      frcInstTerm      = 10,
-      frcRect          = 11,
-      frcPolygon       = 12,
-      frcSteiner       = 13,
-      frcRoute         = 14,
-      frcPathSeg       = 15,
-      frcGuide         = 16,
-      frcBlockage      = 17,
-      frcLayerBlockage = 18,
-      frcBlock         = 19,
-      frcBoundary      = 20,
-      frcFlexPathSeg   = 21,
-      frcFlexVia       = 22,
-      frcInstBlockage  = 23,
-      frcAccessPattern = 24,
-      frcMarker        = 25,
-      frcPatchWire     = 26,
-      drcBlockObject,
-      drcNet,
-      drcPin,
-      drcAccessPattern,
-      drcPathSeg,
-      drcVia,
-      drcMazeMarker,
-      drcFig,
-      drcConnFig,
-      drcRef,
-      drcPinFig,
-      drcPatchWire,
-      tacBlockObject,
-      tacTrack,
-      tacPin,
-      tacPathSeg,
-      tacVia
-  };
-  //enum class drBlockObjectEnum {
-  //  drcBlockObject = 0,
-  //  drcNet,
-  //  drcPin,
-  //  drcAccessPattern,
-  //  drcPathSeg,
-  //  drcVia
-  //};
-  enum class frGuideEnum {
-      frcGuideX,
-      frcGuideGlobal,
-      frcGuideTrunk,
-      frcGuideShortConn
-  };
-  enum class frTermEnum {
-    frcNormalTerm,
-    frcClockTerm,
-    frcPowerTerm,
-    frcGroundTerm
-  };
-  enum class frNetEnum {
-    frcNormalNet,
-    frcClockNet,
-    frcPowerNet,
-    frcGroundNet
-  };
-  //enum class frLef58CutSpacingTableTypeEnum {
-  //  frcCenterSpacing,
-  //  frcOrthogonal,
-  //  frcOther,
-  //};
-
-  enum class frConstraintTypeEnum {
-    frcShortConstraint = 0,
-    frcAreaConstraint = 1,
-    frcMinWidthConstraint = 2,
-    frcSpacingConstraint = 3,
-    frcSpacingEndOfLineConstraint = 4,
-    frcSpacingEndOfLineParallelEdgeConstraint = 5,
-    frcSpacingTableConstraint = 6,
-    frcSpacingTablePrlConstraint = 7,
-    frcSpacingTableTwConstraint = 8,
-    frcLef58SpacingTableConstraint = 9,
-    frcLef58CutSpacingTableConstraint = 10,
-    frcLef58CutSpacingTablePrlConstraint = 11,
-    frcLef58CutSpacingTableLayerConstraint = 12,
-    frcLef58CutSpacingConstraint = 13,
-    frcLef58CutSpacingParallelWithinConstraint = 14,
-    frcLef58CutSpacingAdjacentCutsConstraint = 15,
-    frcLef58CutSpacingLayerConstraint = 16,
-    frcCutSpacingConstraint = 17,
-    frcMinStepConstraint,
-    frcLef58CornerSpacingConstraint,
-    frcLef58CornerSpacingConcaveCornerConstraint,
-    frcLef58CornerSpacingConvexCornerConstraint,
-    frcLef58CornerSpacingSpacingConstraint,
-    frcLef58CornerSpacingSpacing1DConstraint,
-    frcLef58CornerSpacingSpacing2DConstraint,
-    frcLef58SpacingEndOfLineConstraint,
-    frcLef58SpacingEndOfLineWithinConstraint,
-    frcLef58SpacingEndOfLineWithinEndToEndConstraint,
-    frcLef58SpacingEndOfLineWithinParallelEdgeConstraint,
-    frcLef58SpacingEndOfLineWithinMaxMinLengthConstraint,
-    frcLef58CutClassConstraint
-  };
-
-  //enum class frDirEnum { UNKNOWN = 0, E = 1, S = 2, W = 3, N = 4, U = 5, D = 6 };
-  //enum class frDirEnum { UNKNOWN = 0, E = 4, S = 2, W = 3, N = 1, U = 6, D = 5 };
-  #define OPPOSITEDIR 7
-  enum class frDirEnum { UNKNOWN = 0, D = 1, S = 2, W = 3, E = 4, N = 5, U = 6 };
-
-  enum class frLayerTypeEnum {
-    CUT,
-    ROUTING,
-    IMPLANT
-  };
-
-
-  enum class AccessPointTypeEnum {
-    Ideal,
-    Good,
-    Offgrid,
-    None
-  };
-
-  enum class MacroClassEnum {
-    UNKNOWN,
-    CORE,
-    CORE_TIEHIGH,
-    CORE_TIELOW,
-    CORE_WELLTAP,
-    CORE_SPACER,
-    CORE_ANTENNACELL,
-    ENDCAP_PRE,
-    BLOCK
-  };
-
-  //enum frShapeEnum {
-  //    frcRect    = 0,
-  //    frcPolygon = 1
-  //};
-  class frBlockObject;
-  struct vertex_properties_t {
-    frBlockObject* objPtr;
-    //int index;
-    //boost::default_color_type color;
-    //frString name;
-  };
-  //class frRoute;
-  class frConnFig;
-  class frInstTerm;
-  class frTerm;
-  class frInst;
-  class frBlockage;
-  struct edge_properties_t {
-    //std::shared_ptr<frBlockObject> objPtr;
-    //std::shared_ptr<frRoute> objPtr;
-    std::shared_ptr<frConnFig> objPtr;
-    //frString name;
-  };
-  // boost graph
-  typedef boost::adjacency_list< boost::listS, boost::listS, boost::undirectedS, vertex_properties_t, edge_properties_t > graph_t;
-  //typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, vertex_properties_t, edge_properties_t > graph_t;
-  // descriptor
-  typedef boost::graph_traits<graph_t>::vertex_descriptor   vertex_descriptor_t;
-  typedef boost::graph_traits<graph_t>::edge_descriptor     edge_descriptor_t;
-  // iterator
-  typedef boost::graph_traits<graph_t>::vertex_iterator     vertex_iterator_t;
-  typedef boost::graph_traits<graph_t>::edge_iterator       edge_iterator_t;
-  typedef boost::graph_traits<graph_t>::out_edge_iterator   out_edge_iterator_t;
-  typedef boost::graph_traits<graph_t>::adjacency_iterator  adjacency_iterator_t;
-
-  typedef std::map<vertex_descriptor_t, std::size_t>        vertex_descriptor_map_t;
-  //typedef boost::property_map<graph_t, &vertex_properties_t::objPtr>::type           tempPM;
-  namespace bg  = boost::geometry;
-  namespace bgi = boost::geometry::index;
-
-  //typedef bg::model::point<int, 2, bg::cs::cartesian> boostPoint;
-  typedef bg::model::d2::point_xy<frCoord, bg::cs::cartesian> boostPoint;
-  typedef bg::model::box<boostPoint> boostBox;
-  typedef bg::model::polygon<boostPoint> boostPolygon;
-  typedef bg::model::segment<boostPoint> boostSegment;
-
-
-
-  //typedef boost::geometry::model::point<frCoord, 2, boost::geometry::cs::cartesian>   point_t;
-  typedef bg::model::d2::point_xy<frCoord, bg::cs::cartesian>                         point_t;
-  typedef bg::model::box<point_t>                                                     box_t;
-  typedef bg::model::segment<point_t>                                                 segment_t;
-  class frConnFig;
-  typedef std::pair<box_t, std::shared_ptr<frConnFig> >                               rtree_frConnFig_value_t;
-  //typedef std::pair<box_t, int* >                                                     rtree_test_t;
-  typedef std::pair<box_t, std::shared_ptr<frInst> > rtree_frInst_value_t;
-  typedef std::pair<box_t, std::shared_ptr<frTerm> > rtree_frTerm_value_t;
-  typedef std::pair<box_t, std::pair<std::shared_ptr<frTerm>, std::shared_ptr<frInstTerm> > > rtree_frTerm_frInstTerm_value_t;
-  typedef std::pair<box_t, std::shared_ptr<frBlockage> > rtree_frBlockage_value_t;
-  //typedef std::pair<box_t, std::string >                                              rtree_value_t;
-  template <typename T>
-  using rq_iter_value_t = std::pair<box_t, frListIter<T> >;
-  template <typename T>
-  using rq_ptr_value_t  = std::pair<box_t, std::shared_ptr<T> >;
-  template <typename T>
-  using rq_rptr_value_t = std::pair<box_t, T* >;
-  template <typename T>
-  using rq_generic_value_t = std::pair<box_t, T>;
-
-  // KMB data types
-  typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS, vertex_properties_t, boost::property < boost::edge_weight_t, double > > KMBGraph; 
-  // typedef std::pair<int, int> KMBEdge;
-
-  // DRC check types
-  typedef std::pair<boostPoint, boostPoint> boostEdge;
-
-
-  // BoostPolygon
-  typedef boost::polygon::rectangle_data<int>  Rectangle;
-  typedef boost::polygon::polygon_90_data<int> Polygon;
-  typedef std::vector<boost::polygon::polygon_90_data<int> > PolygonSet;
-  typedef boost::polygon::point_data<int> Point;
-  typedef boost::polygon::interval_data<int> Interval;
-  typedef boost::polygon::segment_data<int> Segment;
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/frDesign.h b/scripts/pdn/src/PdnPinDumper/src/frDesign.h
deleted file mode 100644
index f123987..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/frDesign.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_DESIGN_H_
-#define _FR_DESIGN_H_
-
-#include <memory>
-#include "global.h"
-#include "frBaseTypes.h"
-#include "db/obj/frBlock.h"
-#include "db/tech/frTechObject.h"
-#include "frRegionQuery.h"
-
-namespace fr {
-  namespace io {
-    class Parser;
-  }
-  class frDesign {
-  public:
-    // constructors
-    frDesign(): topBlock(nullptr), tech(std::make_unique<frTechObject>()), 
-                rq(std::make_unique<frRegionQuery>(this)) {}
-    // getters
-    frBlock* getTopBlock() const {
-      return topBlock.get();
-    }
-    frTechObject* getTech() const {
-      return tech.get();
-    }
-    frRegionQuery* getRegionQuery() const {
-      return rq.get();
-    }
-    std::vector<std::unique_ptr<frBlock> >& getRefBlocks() {
-      return refBlocks;
-    }
-    const std::vector<std::unique_ptr<frBlock> >& getRefBlocks() const {
-      return refBlocks;
-    }
-    // setters
-    void setTopBlock(std::unique_ptr<frBlock> &in) {
-      topBlock = std::move(in);
-    }
-    void addRefBlock(std::unique_ptr<frBlock> &in) {
-      name2refBlock[in->getName()] = in.get();
-      refBlocks.push_back(std::move(in));
-    }
-    // others
-    void printAllMacros();
-    void printAllComps();
-    void printAllTerms();
-    void printCMap();
-    friend class io::Parser;
-  protected:
-    std::unique_ptr<frBlock>                      topBlock;
-    std::map<frString, frBlock*>                  name2refBlock;
-    std::vector<std::unique_ptr<frBlock> >        refBlocks;
-    std::unique_ptr<frTechObject>                 tech;
-    std::unique_ptr<frRegionQuery>                rq;
-  };
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.cpp b/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.cpp
deleted file mode 100644
index f4b44f8..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.cpp
+++ /dev/null
@@ -1,712 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include "global.h"
-#include "frDesign.h"
-#include "frRegionQuery.h"
-using namespace std;
-using namespace fr;
-
-void frRegionQuery::add(frShape* shape) {
-  frBox frb;
-  box_t boostb;
-  if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-    shape->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    shapes.at(shape->getLayerNum()).insert(make_pair(boostb, shape));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-inline void frRegionQuery::add(frShape* shape, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-    shape->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    allShapes.at(shape->getLayerNum()).push_back(make_pair(boostb, shape));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void frRegionQuery::addDRObj(frShape* shape) {
-  frBox frb;
-  box_t boostb;
-  if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect || shape->typeId() == frcPatchWire) {
-    shape->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    drObjs.at(shape->getLayerNum()).insert(make_pair(boostb, shape));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void frRegionQuery::addMarker(frMarker* in) {
-  frBox frb;
-  box_t boostb;
-  in->getBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  markers.at(in->getLayerNum()).insert(make_pair(boostb, in));
-}
-
-inline void frRegionQuery::addDRObj(frShape* shape, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect || shape->typeId() == frcPatchWire) {
-    shape->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    allShapes.at(shape->getLayerNum()).push_back(make_pair(boostb, shape));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void frRegionQuery::removeDRObj(frShape* shape) {
-  frBox frb;
-  box_t boostb;
-  if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect || shape->typeId() == frcPatchWire) {
-    shape->getBBox(frb);
-    boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-    drObjs.at(shape->getLayerNum()).remove(make_pair(boostb, shape));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void frRegionQuery::removeMarker(frMarker* in) {
-  frBox frb;
-  box_t boostb;
-  in->getBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  markers.at(in->getLayerNum()).remove(make_pair(boostb, in));
-}
-
-void frRegionQuery::add(frVia* via) {
-  frBox frb;
-  frTransform xform;
-  frPoint origin;
-  via->getOrigin(origin);
-  xform.set(origin);
-  box_t boostb;
-  for (auto &uShape: via->getViaDef()->getLayer1Figs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      shapes.at(via->getViaDef()->getLayer1Num()).insert(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-  for (auto &uShape: via->getViaDef()->getLayer2Figs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      shapes.at(via->getViaDef()->getLayer2Num()).insert(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-  for (auto &uShape: via->getViaDef()->getCutFigs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      shapes.at(via->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-}
-
-inline void frRegionQuery::add(frVia* via, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  frTransform xform;
-  frPoint origin;
-  via->getOrigin(origin);
-  xform.set(origin);
-  box_t boostb;
-  for (auto &uShape: via->getViaDef()->getLayer1Figs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      allShapes.at(via->getViaDef()->getLayer1Num()).push_back(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-  for (auto &uShape: via->getViaDef()->getLayer2Figs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      allShapes.at(via->getViaDef()->getLayer2Num()).push_back(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-  for (auto &uShape: via->getViaDef()->getCutFigs()) {
-    auto shape = uShape.get();
-    if (shape->typeId() == frcRect) {
-      shape->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      allShapes.at(via->getViaDef()->getCutLayerNum()).push_back(make_pair(boostb, via));
-    } else {
-      cout <<"Error: unsupported region query add" <<endl;
-    }
-  }
-}
-
-void frRegionQuery::addDRObj(frVia* via) {
-  frBox frb;
-  via->getBBox(frb);
-  box_t boostb(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  drObjs.at(via->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, via));
-}
-
-inline void frRegionQuery::addDRObj(frVia* via, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  via->getBBox(frb);
-  box_t boostb(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  allShapes.at(via->getViaDef()->getCutLayerNum()).push_back(make_pair(boostb, via));
-}
-
-void frRegionQuery::removeDRObj(frVia* via) {
-  frBox frb;
-  via->getBBox(frb);
-  box_t boostb(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  drObjs.at(via->getViaDef()->getCutLayerNum()).remove(make_pair(boostb, via));
-}
-
-void frRegionQuery::add(frInstTerm* instTerm) {
-  frBox frb;
-  box_t boostb;
-
-  //frTransform xform;
-  //instTerm->getInst()->getTransform(xform);
-
-  //frBox mbox;
-  //instTerm->getInst()->getRefBlock()->getBoundaryBBox(mbox);
-  //// add origin
-  //xform.set(xform.xOffset() + mbox.left(), xform.yOffset() + mbox.bottom());
-  //frPoint size(mbox.right(), mbox.top());
-  //xform.updateXform(size);
-  frTransform xform;
-  instTerm->getInst()->getUpdatedXform(xform);
-
-  for (auto &pin: instTerm->getTerm()->getPins()) {
-    for (auto &uFig: pin->getFigs()) {
-      auto shape = uFig.get();
-      if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(static_cast<frShape*>(shape)->getLayerNum()).insert(make_pair(boostb, instTerm));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  }
-}
-
-inline void frRegionQuery::add(frInstTerm* instTerm, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-
-  //frTransform xform;
-  //instTerm->getInst()->getTransform(xform);
-
-  //instTerm->getInst()->getRefBlock()->getBoundaryBBox(frb);
-  //xform.updateXform(frb.upperRight());
-  frTransform xform;
-  instTerm->getInst()->getUpdatedXform(xform);
-
-  for (auto &pin: instTerm->getTerm()->getPins()) {
-    for (auto &uFig: pin->getFigs()) {
-      auto shape = uFig.get();
-      if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        frb.transform(xform);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        allShapes.at(static_cast<frShape*>(shape)->getLayerNum()).push_back(make_pair(boostb, instTerm));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  }
-}
-
-void frRegionQuery::add(frTerm* term) {
-  frBox frb;
-  box_t boostb;
-  for (auto &pin: term->getPins()) {
-    for (auto &uFig: pin->getFigs()) {
-      auto shape = uFig.get();
-      if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        shapes.at(static_cast<frShape*>(shape)->getLayerNum()).insert(make_pair(boostb, term));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  }
-}
-
-inline void frRegionQuery::add(frTerm* term, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  for (auto &pin: term->getPins()) {
-    for (auto &uFig: pin->getFigs()) {
-      auto shape = uFig.get();
-      if (shape->typeId() == frcPathSeg || shape->typeId() == frcRect) {
-        shape->getBBox(frb);
-        boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-        allShapes.at(static_cast<frShape*>(shape)->getLayerNum()).push_back(make_pair(boostb, term));
-      } else {
-        cout <<"Error: unsupported region query add" <<endl;
-      }
-    }
-  }
-}
-
-void frRegionQuery::add(frInstBlockage* instBlk) {
-  frBox frb;
-  box_t boostb;
-
-  //frTransform xform;
-  //instBlk->getInst()->getTransform(xform);
-
-  //instBlk->getInst()->getRefBlock()->getBoundaryBBox(frb);
-  //xform.updateXform(frb.upperRight());
-  frTransform xform;
-  instBlk->getInst()->getUpdatedXform(xform);
-  auto blk = instBlk->getBlockage();
-  if (blk->getNumPoints() != 4) {
-    cout <<"Error: unsupported blockage type" <<endl;
-  } else {
-    if (blk->typeId() == frcLayerBlockage) {
-      blk->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      shapes.at(static_cast<frLayerBlockage*>(blk)->getLayerNum()).insert(make_pair(boostb, instBlk));
-    } else {
-      cout <<"Error: unsupported blockage type" <<endl;
-    }
-  }
-}
-
-inline void frRegionQuery::add(frInstBlockage* instBlk, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-
-  //frTransform xform;
-  //instBlk->getInst()->getTransform(xform);
-
-  //instBlk->getInst()->getRefBlock()->getBoundaryBBox(frb);
-  //xform.updateXform(frb.upperRight());
-  frTransform xform;
-  instBlk->getInst()->getUpdatedXform(xform);
-  auto blk = instBlk->getBlockage();
-  if (blk->getNumPoints() != 4) {
-    cout <<"Error: unsupported blockage type" <<endl;
-  } else {
-    if (blk->typeId() == frcLayerBlockage) {
-      blk->getBBox(frb);
-      frb.transform(xform);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      allShapes.at(static_cast<frLayerBlockage*>(blk)->getLayerNum()).push_back(make_pair(boostb, instBlk));
-    } else {
-      cout <<"Error: unsupported blockage type" <<endl;
-    }
-  }
-}
-
-void frRegionQuery::add(frBlockage* blk) {
-  frBox frb;
-  box_t boostb;
-  if (blk->getNumPoints() != 4) {
-    cout <<"Error: unsupported blockage type" <<endl;
-  } else {
-    blk->getBBox(frb);
-    if (blk->typeId() == frcLayerBlockage) {
-      blk->getBBox(frb);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      shapes.at(static_cast<frLayerBlockage*>(blk)->getLayerNum()).insert(make_pair(boostb, blk));
-    } else {
-      cout <<"Error: unsupported blockage type" <<endl;
-    }
-  }
-}
-
-inline void frRegionQuery::add(frBlockage* blk, vector<vector<rq_rptr_value_t<frBlockObject> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  if (blk->getNumPoints() != 4) {
-    cout <<"Error: unsupported blockage type" <<endl;
-  } else {
-    blk->getBBox(frb);
-    if (blk->typeId() == frcLayerBlockage) {
-      blk->getBBox(frb);
-      boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-      allShapes.at(static_cast<frLayerBlockage*>(blk)->getLayerNum()).push_back(make_pair(boostb, blk));
-    } else {
-      cout <<"Error: unsupported blockage type" <<endl;
-    }
-  }
-}
-
-void frRegionQuery::addGuide(frGuide* guide) {
-  frBox frb;
-  box_t boostb;
-  guide->getBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  for (int i = guide->getBeginLayerNum(); i <= guide->getEndLayerNum(); i++) {
-    shapes.at(i).insert(make_pair(boostb, guide));
-  }
-}
-
-inline void frRegionQuery::addGuide(frGuide* guide, vector<vector<rq_rptr_value_t<frGuide> > > &allShapes) {
-  frBox frb;
-  box_t boostb;
-  guide->getBBox(frb);
-  boostb = box_t(point_t(frb.left(), frb.bottom()), point_t(frb.right(), frb.top()));
-  for (int i = guide->getBeginLayerNum(); i <= guide->getEndLayerNum(); i++) {
-    allShapes.at(i).push_back(make_pair(boostb, guide));
-  }
-}
-void frRegionQuery::query(const frBox &box, frLayerNum layerNum, vector<rq_rptr_value_t<frBlockObject> > &result) {
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  shapes.at(layerNum).query(bgi::intersects(boostb), back_inserter(result));
-  //transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryGuide(const frBox &box, frLayerNum layerNum, vector<rq_rptr_value_t<frGuide> > &result) {
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  guides.at(layerNum).query(bgi::intersects(boostb), back_inserter(result));
-  //transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-void frRegionQuery::queryGuide(const frBox &box, frLayerNum layerNum, vector<frGuide*> &result) {
-  vector<rq_rptr_value_t<frGuide> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  guides.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryGuide(const frBox &box, vector<frGuide*> &result) {
-  vector<rq_rptr_value_t<frGuide> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: guides) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryGRPin(const frBox &box, vector<frBlockObject*> &result) {
-  vector<rq_rptr_value_t<frBlockObject> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  grPins.query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryDRObj(const frBox &box, frLayerNum layerNum, vector<frBlockObject*> &result) {
-  vector<rq_rptr_value_t<frBlockObject> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  drObjs.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryDRObj(const frBox &box, vector<frBlockObject*> &result) {
-  vector<rq_rptr_value_t<frBlockObject> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: drObjs) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryMarker(const frBox &box, frLayerNum layerNum, vector<frMarker*> &result) {
-  vector<rq_rptr_value_t<frMarker> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  markers.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-void frRegionQuery::queryMarker(const frBox &box, vector<frMarker*> &result) {
-  vector<rq_rptr_value_t<frMarker> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  for (auto &m: markers) {
-    m.query(bgi::intersects(boostb), back_inserter(temp));
-  }
-  transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-}
-
-//void frRegionQuery::query(const frBox &box, vector<rq_rptr_value_t<frBlockObject> > &result) {
-//  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-//  for (auto &m: shapes) {
-//    m.query(bgi::intersects(boostb), back_inserter(result));
-//  }
-//  //transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second;});
-//}
-
-void frRegionQuery::init(frLayerNum numLayers) {
-  shapes.clear();
-  shapes.resize(numLayers);
-
-  markers.clear();
-  markers.resize(numLayers);
-
-  vector<vector<rq_rptr_value_t<frBlockObject> > > allShapes(numLayers);
-
-  int cnt = 0;
-  for (auto &inst: design->getTopBlock()->getInsts()) {
-    for (auto &instTerm: inst->getInstTerms()) {
-      add(instTerm.get(), allShapes);
-    }
-    for (auto &instBlk: inst->getInstBlockages()) {
-      add(instBlk.get(), allShapes);
-    }
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt < 100000) {
-        if (cnt % 10000 == 0) {
-          cout <<"  complete " <<cnt <<" insts" <<endl;
-        }
-      } else {
-        if (cnt % 100000 == 0) {
-          cout <<"  complete " <<cnt <<" insts" <<endl;
-        }
-      }
-    }
-  }
-  cnt = 0;
-  for (auto &term: design->getTopBlock()->getTerms()) {
-    add(term.get(), allShapes);
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt < 100000) {
-        if (cnt % 10000 == 0) {
-          cout <<"  complete " <<cnt <<" terms" <<endl;
-        }
-      } else {
-        if (cnt % 100000 == 0) {
-          cout <<"  complete " <<cnt <<" terms" <<endl;
-        }
-      }
-    }
-  }
-  /*
-  cnt = 0;
-  for (auto &net: design->getTopBlock()->getNets()) {
-    for (auto &shape: net->getShapes()) {
-      add(shape.get(), allShapes);
-    }
-    for (auto &via: net->getVias()) {
-      add(via.get(), allShapes);
-    }
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt % 10000 == 0) {
-        cout <<"  complete " <<cnt <<" nets" <<endl;
-      }
-    }
-  }
-  */
-  cnt = 0;
-  for (auto &net: design->getTopBlock()->getSNets()) {
-    for (auto &shape: net->getShapes()) {
-      add(shape.get(), allShapes);
-    }
-    for (auto &via: net->getVias()) {
-      add(via.get(), allShapes);
-    }
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt % 10000 == 0) {
-        cout <<"  complete " <<cnt <<" snets" <<endl;
-      }
-    }
-  }
-
-  cnt = 0;
-  for (auto &blk: design->getTopBlock()->getBlockages()) {
-    add(blk.get(), allShapes);
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt % 10000 == 0) {
-        cout <<"  complete " <<cnt <<" blockages" <<endl;
-      }
-    }
-  }
-
-  for (auto i = 0; i < numLayers; i++) {
-    shapes.at(i) = boost::move(bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> >(allShapes.at(i)));
-    allShapes.at(i).clear();
-    allShapes.at(i).shrink_to_fit();
-    if (VERBOSE > 0) {
-      cout <<"  complete " <<design->getTech()->getLayer(i)->getName() <<endl;
-    }
-  }
-
-}
-
-void frRegionQuery::initGuide(frLayerNum numLayers) {
-  // guides
-  //if (VERBOSE > 0) {
-  //  ;
-  //}
-  guides.clear();
-  guides.resize(numLayers);
-  vector<vector<rq_rptr_value_t<frGuide> > > allGuides(numLayers);
-
-  int cnt = 0;
-  for (auto &net: design->getTopBlock()->getNets()) {
-    for (auto &guide: net->getGuides()) {
-      addGuide(guide.get(), allGuides);
-    }
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt < 100000) {
-        if (cnt % 10000 == 0) {
-          cout <<"  complete " <<cnt <<" nets (guide)" <<endl;
-        }
-      } else {
-        if (cnt % 100000 == 0) {
-          cout <<"  complete " <<cnt <<" nets (guide)" <<endl;
-        }
-      }
-    }
-  }
-  for (auto i = 0; i < numLayers; i++) {
-    guides.at(i) = boost::move(bgi::rtree<rq_rptr_value_t<frGuide>, bgi::quadratic<16> >(allGuides.at(i)));
-    allGuides.at(i).clear();
-    allGuides.at(i).shrink_to_fit();
-    if (VERBOSE > 0) {
-      cout <<"  complete " <<design->getTech()->getLayer(i)->getName() <<" (guide)"<<endl;
-    }
-  }
-}
-
-void frRegionQuery::initGRPin(vector<pair<frBlockObject*, frPoint> > &in) {
-  grPins.clear();
-  vector<rq_rptr_value_t<frBlockObject> > allGRPins;
-  box_t boostb;
-  for (auto &[obj, pt]: in) {
-    boostb = box_t(point_t(pt.x(), pt.y()), point_t(pt.x(), pt.y()));
-    allGRPins.push_back(make_pair(boostb, obj));
-  }
-  in.clear();
-  in.shrink_to_fit();
-  grPins = boost::move(bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> >(allGRPins));
-}
-
-void frRegionQuery::initDRObj(frLayerNum numLayers) {
-  drObjs.clear();
-  drObjs.resize(numLayers);
-
-  vector<vector<rq_rptr_value_t<frBlockObject> > > allShapes(numLayers);
-
-  int cnt = 0;
-  for (auto &net: design->getTopBlock()->getNets()) {
-    for (auto &shape: net->getShapes()) {
-      addDRObj(shape.get(), allShapes);
-    }
-    for (auto &via: net->getVias()) {
-      addDRObj(via.get(), allShapes);
-    }
-    cnt++;
-    //if (VERBOSE > 0) {
-    //  if (cnt < 100000) {
-    //    if (cnt % 10000 == 0) {
-    //      cout <<"  complete " <<cnt <<" nets" <<endl;
-    //    }
-    //  } else {
-    //    if (cnt % 100000 == 0) {
-    //      cout <<"  complete " <<cnt <<" nets" <<endl;
-    //    }
-    //  }
-    //}
-  }
-
-  for (auto i = 0; i < numLayers; i++) {
-    drObjs.at(i) = boost::move(bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> >(allShapes.at(i)));
-    allShapes.at(i).clear();
-    allShapes.at(i).shrink_to_fit();
-    //if (VERBOSE > 0) {
-    //  cout <<"  complete " <<design->getTech()->getLayer(i)->getName() <<endl;
-    //}
-  }
-
-}
-
-
-
-
-void frRegionQuery::print() {
-  cout <<endl;
-  for (int i = 0; i < (int)(design->getTech()->getLayers().size()); i++) {
-    frString layerName;
-    design->getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" shape region query size = " <<shapes.at(i).size() <<endl <<flush;
-  }
-}
-
-void frRegionQuery::printGuide() {
-  cout <<endl;
-  for (int i = 0; i < (int)(design->getTech()->getLayers().size()); i++) {
-    frString layerName;
-    design->getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" guide region query size = " <<guides.at(i).size() <<endl <<flush;
-  }
-}
-
-void frRegionQuery::printDRObj() {
-  cout <<endl;
-  for (int i = 0; i < (int)(design->getTech()->getLayers().size()); i++) {
-    frString layerName;
-    design->getTech()->getLayers().at(i)->getName(layerName);
-    cout <<layerName <<" drObj region query size = " <<drObjs.at(i).size() <<endl <<flush;
-  }
-}
-
-void frRegionQuery::clearGuides() {
-  for (auto &m: guides) {
-    m.clear();
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.h b/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.h
deleted file mode 100644
index ced30b7..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/frRegionQuery.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_REGIONQUERY_H_
-#define _FR_REGIONQUERY_H_
-
-#include "frBaseTypes.h"
-
-namespace fr {
-  class frDesign;
-  class frRegionQuery {
-  public:
-    frRegionQuery(frDesign* designIn): design(designIn) {}
-    // getters
-    frDesign* getDesign() const {
-      return design;
-    }
-    // setters
-    void add(frShape* in);
-    void add(frVia* in);
-    void add(frInstTerm* in);
-    void add(frTerm* in);
-    void add(frBlockage* in);
-    void add(frInstBlockage* in);
-    void addGuide(frGuide* in);
-    //void addGRPin(frBlockObject* in);
-    void addDRObj(frShape* in);
-    void addDRObj(frVia* in);
-    void addMarker(frMarker* in);
-    void add(frShape* in,    std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void add(frVia* in,      std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void add(frInstTerm* in, std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void add(frTerm* in,     std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void add(frBlockage* in, std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void add(frInstBlockage* in, std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void addGuide(frGuide* in, std::vector<std::vector<rq_rptr_value_t<frGuide> > > &allShapes);
-    void addDRObj(frShape* in, std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void addDRObj(frVia* in,   std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    //void addGRPin(frBlockObject* in, const frPoint &pt, std::vector<std::vector<rq_rptr_value_t<frBlockObject> > > &allShapes);
-    void query(const frBox &box, frLayerNum layerNum, std::vector<rq_rptr_value_t<frBlockObject> > &result);
-    void queryGuide(const frBox &box, frLayerNum layerNum, std::vector<rq_rptr_value_t<frGuide> > &result);
-    void queryGuide(const frBox &box, frLayerNum layerNum, std::vector<frGuide*> &result);
-    void queryGuide(const frBox &box, std::vector<frGuide*> &result);
-    void queryGRPin(const frBox &box, std::vector<frBlockObject*> &result);
-    void queryDRObj(const frBox &box, frLayerNum layerNum, std::vector<frBlockObject*> &result);
-    void queryDRObj(const frBox &box, std::vector<frBlockObject*> &result);
-    void queryMarker(const frBox &box, frLayerNum layerNum, std::vector<frMarker*> &result);
-    void queryMarker(const frBox &box, std::vector<frMarker*> &result);
-
-    //void query(const frBox &box, std::vector<rq_rptr_value_t<frBlockObject> > &result);
-    
-    void clearGuides();
-    void removeDRObj(frShape* in);
-    void removeDRObj(frVia*   in);
-    void removeMarker(frMarker* in);
-
-    // init
-    void init(frLayerNum numLayers);
-    void initGuide(frLayerNum numLayers);
-    void initGRPin(std::vector<std::pair<frBlockObject*, frPoint> > &in);
-    void initDRObj(frLayerNum numLayers);
-    
-    // utility
-    void print();
-    void printGuide();
-    void printDRObj();
-
-  protected:
-    frDesign*         design;
-    std::vector<bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> > > shapes; // only for pin shapes, obs and snet
-    std::vector<bgi::rtree<rq_rptr_value_t<frGuide>, bgi::quadratic<16> > >       guides;
-    bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> >               grPins;
-    std::vector<bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> > > drObjs; // only for dr objs, via only in via layer
-    std::vector<bgi::rtree<rq_rptr_value_t<frMarker>, bgi::quadratic<16> > >      markers; // use init()
-  };
-}
-
-#endif
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/global.cpp b/scripts/pdn/src/PdnPinDumper/src/global.cpp
deleted file mode 100644
index 457263c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/global.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include "global.h"
-
-using namespace std;
-using namespace fr;
-
-string DEF_FILE;
-string GUIDE_FILE;
-string OUTGUIDE_FILE;
-string LEF_FILE;
-string OUTTA_FILE;
-string OUT_FILE;
-string OUT_MAZE_FILE;
-string DRC_RPT_FILE;
-//string DBPROCESSNODE = "N16_11m_2xa1xd3xe2y2r_utrdl";
-string DBPROCESSNODE = "";
-int    MAX_THREADS   = 8;
-int    VERBOSE       = 0;
-int    BOTTOM_ROUTING_LAYER = 0;
-bool   ALLOW_PIN_AS_FEEDTHROUGH = false;
-bool   USENONPREFTRACKS = true;
-bool   USEMINSPACING_OBS = true;
-bool   RESERVE_VIA_ACCESS = true;
-
-int END_ITERATION = 1;
-
-frUInt4 TAVIACOST       = 1;
-frUInt4 TAPINCOST       = 4;
-frUInt4 TAALIGNCOST     = 4;
-frUInt4 TADRCCOST       = 32;
-float   TASHAPEBLOATWIDTH = 1.5;
-
-frUInt4 VIACOST         = 2;
-// new cost used
-frUInt4 GRIDCOST        = 2;
-frUInt4 SHAPECOST       = 8;
-frUInt4 DRCCOST         = 4;
-frUInt4 MARKERCOST      = 4;
-float   MARKERDECAY     = 0.5;
-float   SHAPEBLOATWIDTH = 3;
-
-ostream& operator<< (ostream& os, const frPoint &pIn) {
-  os <<"( " <<pIn.x() <<" " <<pIn.y() <<" )";
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frRect &pinFigIn) {
-  if (pinFigIn.getPin()) {
-    os <<"PINFIG (PINNAME/LAYER) " <<pinFigIn.getPin()->getTerm()->getName() <<" " <<pinFigIn.getLayerNum() <<endl;
-  }
-  frBox tmpBox;
-  pinFigIn.getBBox(tmpBox);
-  os <<"  RECT " <<tmpBox.left() <<" " <<tmpBox.bottom() <<" " <<tmpBox.right() <<" " <<tmpBox.top();
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frPolygon &pinFigIn) {
-  if (pinFigIn.getPin()) {
-    os <<"PINFIG (NAME/LAYER) " <<pinFigIn.getPin()->getTerm()->getName() <<" " <<pinFigIn.getLayerNum() <<endl;
-  }
-  os <<"  POLYGON";
-  for (auto &m: pinFigIn.getPoints()) {
-    os <<" ( " <<m.x() <<" " <<m.y() <<" )";
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frPin &pinIn) {
-  os <<"PIN (NAME) " <<pinIn.getTerm()->getName();
-  for (auto &m: pinIn.getFigs()) {
-    if (m->typeId() == frcRect) {
-      os <<endl <<*(static_cast<frRect*>(m.get()));
-    } else if (m->typeId() == frcPolygon) {
-      os <<endl <<*(static_cast<frPolygon*>(m.get()));
-    } else {
-      os <<endl <<"Unsupported pinFig object!";
-    }
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frTerm &termIn) {
-  frString name;
-  frString netName;
-  name = termIn.getName();
-  if (termIn.getNet()) {
-    netName = termIn.getNet()->getName();
-  }
-  os <<"TERM (NAME/NET) " <<name <<" " <<netName;
-  for (auto &m: termIn.getPins()){
-    os <<endl <<*m;
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frInstTerm &instTermIn) {
-  frString name;
-  frString cellName;
-  frString termName;
-  frString netName;
-  name = instTermIn.getInst()->getName();
-  cellName = instTermIn.getInst()->getRefBlock()->getName();
-  termName = instTermIn.getTerm()->getName();
-  if (instTermIn.getNet()) {
-    netName = instTermIn.getNet()->getName();
-  } 
-  os <<"INSTTERM (NAME/CELL/TERM/NET) " <<name <<" " <<cellName <<" " <<termName <<" " <<netName <<endl;
-  os <<*instTermIn.getTerm();
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frViaDef &viaDefIn) {
-  frString name;
-  name = viaDefIn.getName();
-  os <<"VIA " <<name;
-  if (viaDefIn.getDefault()) {
-    os <<" DEFAULT";
-  }
-  for (auto &m: viaDefIn.getLayer1Figs()) {
-    if (m->typeId() == frcRect) {
-      os <<endl <<*(static_cast<frRect*>(m.get()));
-    } else if (m->typeId() == frcPolygon) {
-      os <<endl <<*(static_cast<frPolygon*>(m.get()));
-    } else {
-      os <<endl <<"Unsupported pinFig object!";
-    }
-  }
-  for (auto &m: viaDefIn.getCutFigs()) {
-    if (m->typeId() == frcRect) {
-      os <<endl <<*(static_cast<frRect*>(m.get()));
-    } else if (m->typeId() == frcPolygon) {
-      os <<endl <<*(static_cast<frPolygon*>(m.get()));
-    } else {
-      os <<endl <<"Unsupported pinFig object!";
-    }
-  }
-  for (auto &m: viaDefIn.getLayer2Figs()) {
-    if (m->typeId() == frcRect) {
-      os <<endl <<*(static_cast<frRect*>(m.get()));
-    } else if (m->typeId() == frcPolygon) {
-      os <<endl <<*(static_cast<frPolygon*>(m.get()));
-    } else {
-      os <<endl <<"Unsupported pinFig object!";
-    }
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frLayerBlockage &blkIn) {
-  os <<"BLK (LAYER) " <<blkIn.getLayerNum();
-  for (auto &point: blkIn.getPoints()) {
-    os <<endl <<"  " <<point.x() <<" " <<point.y();
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frBlock &blockIn) {
-  frBox box;
-  blockIn.getBBox(box);
-  os <<"MACRO "    <<blockIn.getName() <<endl
-       <<"  ORIGIN " <<box.left()  <<" " <<box.bottom() <<endl
-       <<"  SIZE "   <<box.right() <<" " <<box.top();
-  for (auto &m: blockIn.getTerms()) {
-    os <<endl <<*m;
-  }
-  for (auto &m: blockIn.getBlockages()) {
-    if (m->typeId() == frcLayerBlockage) {
-      os <<endl <<*(static_cast<frLayerBlockage*>(m.get()));
-    } else {
-      os <<endl <<"Unsupported macro blockage!";
-    }
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frInst &instIn) {
-  frPoint tmpPoint;
-  frString tmpString;
-  frString tmpName;
-  instIn.getOrigin(tmpPoint);
-  auto tmpOrient = instIn.getOrient();
-  tmpName = instIn.getName();
-  tmpString = instIn.getRefBlock()->getName();
-  os <<"- " <<tmpName <<" " <<tmpString <<" + STATUS + ( "
-       <<tmpPoint.x() <<" " <<tmpPoint.y() <<" ) " <<tmpOrient.getName() <<endl;
-  for (auto &m: instIn.getInstTerms()) {
-    os <<endl <<*m;
-  }
-  return os;
-}
-
-ostream& operator<< (ostream& os, const frBox &box) {
-  os <<"( " <<box.left() <<" " <<box.bottom() <<" ) ( " <<box.right() <<" " <<box.top() <<" )";
-  return os;
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/global.h b/scripts/pdn/src/PdnPinDumper/src/global.h
deleted file mode 100644
index e6cdaa9..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/global.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**************************************************************************
- * Copyright(c) 2018 Regents of the University of California
- *              Andrew B. Kahng, Lutong Wang and Bangqi Xu
- * Contact      abk@cs.ucsd.edu, luw002@ucsd.edu and bax002@ucsd.edu
- * Affiliation: Computer Science and Engineering Department, UC San Diego,
- *              La Jolla, CA 92093-0404, USA
- *
- *************************************************************************/
-
-#ifndef _GLOBAL_H_
-#define _GLOBAL_H_
-
-#include <iostream>
-#include <memory>
-#include <string>
-#include "frDesign.h"
-#include "db/obj/frBlock.h"
-
-extern std::string DEF_FILE;
-extern std::string GUIDE_FILE;
-extern std::string OUTGUIDE_FILE;
-extern std::string LEF_FILE;
-extern std::string OUTTA_FILE;
-extern std::string OUT_FILE;
-extern std::string DBPROCESSNODE;
-extern std::string OUT_MAZE_FILE;
-extern std::string DRC_RPT_FILE;
-extern int MAX_THREADS ;
-extern int VERBOSE     ;
-extern int BOTTOM_ROUTING_LAYER;
-extern bool ALLOW_PIN_AS_FEEDTHROUGH;
-extern bool USENONPREFTRACKS;
-//extern int TEST;
-
-extern int END_ITERATION;
-
-extern fr::frUInt4 TAVIACOST;
-extern fr::frUInt4 TAPINCOST;
-extern fr::frUInt4 TAALIGNCOST;
-extern fr::frUInt4 TADRCCOST;
-extern float       TASHAPEBLOATWIDTH;
-
-extern fr::frUInt4 VIACOST;
-extern bool USEMINSPACING_OBS;
-extern bool RESERVE_VIA_ACCESS;
-
-extern fr::frUInt4 GRIDCOST;
-extern fr::frUInt4 SHAPECOST;
-extern fr::frUInt4 DRCCOST;
-extern fr::frUInt4 MARKERCOST;
-extern float       MARKERDECAY;
-extern float       SHAPEBLOATWIDTH;
-
-#define DIRBITSIZE 3
-#define WAVEFRONTBUFFERSIZE 2
-#define WAVEFRONTBITSIZE (WAVEFRONTBUFFERSIZE * DIRBITSIZE)
-#define WAVEFRONTBUFFERHIGHMASK (111 << ((WAVEFRONTBUFFERSIZE - 1) * DIRBITSIZE))
-
-namespace fr {
-  extern frCoord getGCELLGRIDX();
-  extern frCoord getGCELLGRIDY();
-  extern frCoord getGCELLOFFSETX();
-  extern frCoord getGCELLOFFSETY();
-}
-
-extern std::ostream& operator<< (std::ostream& os, const fr::frViaDef &viaDefIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frBlock &blockIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frInst &instIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frInstTerm &instTermIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frTerm &termIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frPin &pinIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frRect &pinFig);
-extern std::ostream& operator<< (std::ostream& os, const fr::frPolygon &pinFig);
-extern std::ostream& operator<< (std::ostream& os, const fr::frNet &net);
-extern std::ostream& operator<< (std::ostream& os, const fr::frLayerBlockage &blk);
-
-extern std::ostream& operator<< (std::ostream& os, const fr::frPoint &pIn);
-extern std::ostream& operator<< (std::ostream& os, const fr::frBox &box);
-
-//extern size_t getPeakRSS();
-//extern size_t getCurrentRSS();
-
-//extern void printAllMacros(const std::shared_ptr<fr::frDesign> &design);
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/Makefile b/scripts/pdn/src/PdnPinDumper/src/io/Makefile
deleted file mode 100644
index df8ac23..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-#OBJECTS	= io.o io_parser_helper.o defw.o frGuidePrep.o frPinPrep.o frShapeUtil.o frUtil.o
-OBJECTS	= io.o io_parser_helper.o defw.o io_guide.o frPinPrep.o frShapeUtil.o io_pin.o frAPG.o
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/defw.cpp b/scripts/pdn/src/PdnPinDumper/src/io/defw.cpp
deleted file mode 100644
index 89e9c38..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/defw.cpp
+++ /dev/null
@@ -1,3533 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-// #include <fstream>
-#ifndef WIN32
-#   include <unistd.h>
-#endif /* not WIN32 */
-#include "defrReader.hpp"
-#include "defiAlias.hpp"
-#include "io/io.h"
-#include "global.h"
-#include "frBaseTypes.h"
-#include "db/obj/frShape.h"
-#include "db/obj/frVia.h"
-
-#pragma GCC diagnostic push
-// turn off the specific warning. Can also use "-Wall"
-#pragma GCC diagnostic ignored "-Wformat="
-#pragma GCC diagnostic ignored "-Wformat-extra-args"
-// turn the warnings back on
-
-//using namespace std;
-using namespace fr;
-
-char defaultName[64];
-char defaultOut[64];
-
-// Global variables
-FILE* fout;
-io::Writer* userData;
-int numObjs;
-int isSumSet;      // to keep track if within SUM
-int isProp = 0;    // for PROPERTYDEFINITIONS
-int begOperand;    // to keep track for constraint, to print - as the 1st char
-static double curVer = 0;
-static int setSNetWireCbk = 0;
-static int isSessionless = 0;
-static int ignoreRowNames = 0;
-static int ignoreViaNames = 0;
-static int testDebugPrint = 0;  // test for ccr1488696
-
-// TX_DIR:TRANSLATION ON
-
-void myLogFunction(const char* errMsg){
-   fprintf(fout, "ERROR: found error: %s\n", errMsg);
-}
-
-void myWarningLogFunction(const char* errMsg){
-   fprintf(fout, "WARNING: found error: %s\n", errMsg);
-}
-
-void dataError() {
-  fprintf(fout, "ERROR: returned user data is not correct!\n");
-}
-
-void checkType(defrCallbackType_e c) {
-  if (c >= 0 && c <= defrDesignEndCbkType) {
-    // OK
-  } else {
-    fprintf(fout, "ERROR: callback type is out of bounds!\n");
-  }
-}
-
-
-int done(defrCallbackType_e c, void*, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "END DESIGN\n");
-  return 0;
-}
-
-int endfunc(defrCallbackType_e c, void*, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c == defrSNetEndCbkType) {
-    fprintf(fout, "END SPECIALNETS\n");
-  } else if (c == defrPinEndCbkType) {
-    fprintf(fout, "END PINS\n");
-  } else if (c == defrNetEndCbkType) {
-    fprintf(fout, "END NETS\n");
-  }
-  return 0;
-}
-
-
-char* orientStr(int orient) {
-  switch (orient) {
-      case 0: return ((char*)"N");
-      case 1: return ((char*)"W");
-      case 2: return ((char*)"S");
-      case 3: return ((char*)"E");
-      case 4: return ((char*)"FN");
-      case 5: return ((char*)"FW");
-      case 6: return ((char*)"FS");
-      case 7: return ((char*)"FE");
-  };
-  return ((char*)"BOGUS");
-}
-
-int compMSL(defrCallbackType_e c, defiComponentMaskShiftLayer* co, defiUserData ud) {
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-
-    if (co->numMaskShiftLayers()) {
-  fprintf(fout, "\nCOMPONENTMASKSHIFT ");
-  
-  for (i = 0; i < co->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", co->maskShiftLayer(i));
-  }
-  fprintf(fout, ";\n");
-    }
-
-  return 0;
-}
-
-int compf(defrCallbackType_e c, defiComponent* co, defiUserData ud) {
-  if (testDebugPrint) {
-      co->print(fout);
-  } else {
-      int i;
-
-      checkType(c);
-      if (ud != userData) dataError();
-    //  missing GENERATE, FOREIGN
-        fprintf(fout, "- %s %s ", co->id(),
-                co->name());
-    //    co->changeIdAndName("idName", "modelName");
-    //    fprintf(fout, "%s %s ", co->id(),
-    //            co->name());
-        if (co->hasNets()) {
-            for (i = 0; i < co->numNets(); i++)
-                 fprintf(fout, "%s ", co->net(i));
-        }
-        if (co->hasSource())
-            fprintf(fout, "+ SOURCE %s ", co->source());
-        if (co->isFixed()) 
-            fprintf(fout, "+ FIXED ( %d %d ) %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    //orientStr(co->placementOrient()));
-                    co->placementOrientStr());
-        if (co->isCover()) 
-            fprintf(fout, "+ COVER %d %d %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    orientStr(co->placementOrient()));
-        if (co->isPlaced()) 
-            fprintf(fout,"+ PLACED ( %d %d ) %s ",
-                    co->placementX(),
-                    co->placementY(),
-                    orientStr(co->placementOrient()));
-        if (co->isUnplaced()) {
-            fprintf(fout,"+ UNPLACED ");
-            if ((co->placementX() != -1) ||
-                (co->placementY() != -1))
-               fprintf(fout,"%d %d %s ",
-                       co->placementX(),
-                       co->placementY(),
-                       orientStr(co->placementOrient()));
-        }
-        if (co->hasGenerate()) {
-            fprintf(fout, "+ GENERATE %s ", co->generateName());
-            if (co->macroName() &&
-                *(co->macroName()))
-               fprintf(fout, "%s ", co->macroName());
-        }
-        if (co->hasWeight())
-            fprintf(fout, "+ WEIGHT %d ", co->weight());
-        if (co->hasEEQ())
-            fprintf(fout, "+ EEQMASTER %s ", co->EEQ());
-        if (co->hasRegionName())
-            fprintf(fout, "+ REGION %s ", co->regionName());
-        if (co->hasRegionBounds()) {
-            int *xl, *yl, *xh, *yh;
-            int size;
-            co->regionBounds(&size, &xl, &yl, &xh, &yh);
-            for (i = 0; i < size; i++) { 
-                fprintf(fout, "+ REGION %d %d %d %d \n",
-                        xl[i], yl[i], xh[i], yh[i]);
-            }
-        }
-        if (co->maskShiftSize()) {
-            fprintf(fout, "+ MASKSHIFT ");
-
-            for (int i = co->maskShiftSize()-1; i >= 0; i--) {
-                fprintf(fout, "%d", co->maskShift(i));
-            }
-            fprintf(fout, "\n");
-        }
-        if (co->hasHalo()) {
-            int left, bottom, right, top;
-            (void) co->haloEdges(&left, &bottom, &right, &top);
-            fprintf(fout, "+ HALO ");
-            if (co->hasHaloSoft())
-               fprintf(fout, "SOFT ");
-            fprintf(fout, "%d %d %d %d\n", left, bottom, right, top);
-        }
-        if (co->hasRouteHalo()) {
-            fprintf(fout, "+ ROUTEHALO %d %s %s\n", co->haloDist(),
-                    co->minLayer(), co->maxLayer());
-        }
-        if (co->hasForeignName()) {
-            fprintf(fout, "+ FOREIGN %s %d %d %s %d ",
-                    co->foreignName(), co->foreignX(),
-                    co->foreignY(), co->foreignOri(),
-                    co->foreignOrient());
-        }
-        if (co->numProps()) {
-            for (i = 0; i < co->numProps(); i++) {
-                fprintf(fout, "+ PROPERTY %s %s ", co->propName(i),
-                        co->propValue(i));
-                // BX 180910 DEF read issue
-                switch (co->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-        }
-        fprintf(fout, ";\n");
-        --numObjs;
-        if (numObjs <= 0)
-            fprintf(fout, "END COMPONENTS\n");
-    }
-
-    return 0;
-}
-
-
-int netpath(defrCallbackType_e, defiNet*, defiUserData) {
-  fprintf(fout, "\n");
-
-  fprintf (fout, "Callback of partial path for net\n");
-
-  return 0;
-}
-
-
-int netNamef(defrCallbackType_e c, const char* netName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    fprintf(fout, "- %s ", netName);
-  return 0;
-}
-
-int subnetNamef(defrCallbackType_e c, const char* subnetName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    if (curVer >= 5.6)
-      fprintf(fout, "   + SUBNET CBK %s ", subnetName);
-  return 0;
-}
-
-int nondefRulef(defrCallbackType_e c, const char* ruleName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-    if (curVer >= 5.6)
-      fprintf(fout, "   + NONDEFAULTRULE CBK %s ", ruleName);
-  return 0;
-}
-
-int netf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int        i, j, k, w, x, y, z, count, newLayer;
-  defiPath*  p;
-  defiSubnet *s;
-  int        path;
-  defiVpin   *vpin;
-  // defiShield *noShield;
-  defiWire   *wire;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-  if (net->pinIsMustJoin(0))
-      fprintf(fout, "- MUSTJOIN ");
-// 5/6/2004 - don't need since I have a callback for the name
-//  else
-//      fprintf(fout, "- %s ", net->name());
- 
-//  net->changeNetName("newNetName");
-//  fprintf(fout, "%s ", net->name());
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < net->numConnections(); i++) {
-      // set the limit of only 5 items per line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf(fout, "( %s %s ) ", net->instance(i),
-              net->pin(i));
-//      net->changeInstance("newInstance", i);
-//      net->changePin("newPin", i);
-//      fprintf(fout, "( %s %s ) ", net->instance(i),
-//              net->pin(i));
-      if (net->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  // fprintf(fout, "abc\n");
-  // print routed wire segment
-  int cnt = 0;
-  fprintf(fout, "\n");
-
-  if (true) {
-    if (userData->connFigs.find(net->name()) == userData->connFigs.end()) {
-      //std::cout <<"Warning: no routes for " <<net->name() <<std::endl;
-    } else {
-      for (auto &connFig: userData->connFigs.at(net->name())) {
-        if (cnt == 0) {
-          fprintf(fout, "  + ROUTED ");
-        } else {
-          fprintf(fout, "    NEW ");
-        }
-        if (connFig->typeId() == frcPathSeg) {
-          //std::cout <<"here" <<std::endl;
-          auto pathSeg = std::dynamic_pointer_cast<frPathSeg>(connFig);
-          auto layerName = userData->getTech()->getLayer(pathSeg->getLayerNum())->getName();
-          //frCoord defaultWidth = userData->getTech()->getLayer(pathSeg->getLayerNum())->getWidth();
-          fprintf(fout, "%s", layerName.c_str());
-          frPoint begin, end;
-          frSegStyle segStyle;
-          pathSeg->getPoints(begin, end);
-          // vertical rect
-          //if (begin.x() == end.x() && end.y() - begin.y() < defaultWidth) {
-          //  fprintf(fout, " ( %d %d ) RECT ( %d %d %d %d )", begin.x(), begin.y(),
-          //      -defaultWidth/2, -defaultWidth/2, defaultWidth/2, defaultWidth/2 + end.y() - begin.y());
-          //  //std::cout <<"here1" <<std::endl;
-          //// horizontal rect
-          //} else if (begin.y() == end.y() && end.x() - begin.x() < defaultWidth) {
-          //  fprintf(fout, " ( %d %d ) RECT ( %d %d %d %d )", begin.x(), begin.y(),
-          //      -defaultWidth/2, -defaultWidth/2, defaultWidth/2 + end.x() - begin.x(), defaultWidth/2);
-          //  //std::cout <<"here2" <<std::endl;
-          //} else {
-            //std::cout <<"here3" <<std::endl;
-            pathSeg->getStyle(segStyle);
-            if (segStyle.getBeginStyle() == frEndStyle(frcExtendEndStyle)) {
-              fprintf(fout, " ( %d %d )", begin.x(), begin.y());
-            } else if (segStyle.getBeginStyle() == frEndStyle(frcTruncateEndStyle)) {
-              fprintf(fout, " ( %d %d 0 )", begin.x(), begin.y());
-            } else if (segStyle.getBeginStyle() == frEndStyle(frcVariableEndStyle)) {
-              fprintf(fout, " ( %d %d %d )", begin.x(), begin.y(), segStyle.getBeginExt());
-            } else {
-              ;
-            }
-            if (segStyle.getEndStyle() == frEndStyle(frcExtendEndStyle)) {
-              fprintf(fout, " ( %d %d )", end.x(), end.y());
-            } else if (segStyle.getEndStyle() == frEndStyle(frcTruncateEndStyle)) {
-              fprintf(fout, " ( %d %d 0 )", end.x(), end.y());
-            } else if (segStyle.getEndStyle() == frEndStyle(frcVariableEndStyle)) {
-              fprintf(fout, " ( %d %d %d )", end.x(), end.y(), segStyle.getEndExt());
-            } else {
-              ;
-            }
-          //}
-          fprintf(fout, "\n");
-        } else if (connFig->typeId() == frcVia) {
-          auto via = std::dynamic_pointer_cast<frVia>(connFig);
-          auto layerName = userData->getTech()->getLayer(via->getViaDef()->getLayer1Num())->getName();
-          auto viaName = via->getViaDef()->getName();
-          frPoint origin;
-          via->getOrigin(origin);
-          fprintf(fout, "%s ( %d %d ) %s\n", 
-                  layerName.c_str(), 
-                  origin.x(), origin.y(), viaName.c_str());
-        } else if (connFig->typeId() == frcPatchWire) {
-          auto pwire = std::dynamic_pointer_cast<frPatchWire>(connFig);
-          auto layerName = userData->getTech()->getLayer(pwire->getLayerNum())->getName();
-          frPoint origin;
-          frBox offsetBox;
-          pwire->getOrigin(origin);
-          pwire->getOffsetBox(offsetBox);
-          fprintf(fout, "%s ( %d %d ) RECT ( %d %d %d %d )\n",
-                  layerName.c_str(),
-                  origin.x(), origin.y(),
-                  offsetBox.left(), offsetBox.bottom(), offsetBox.right(), offsetBox.top());
-        } else {
-          std::cout <<"Error: unknown drt type" <<std::endl;
-          exit(2);
-        }
-        cnt++;
-      }
-    }
-  }
-
-  if (net->hasNonDefaultRule())
-      fprintf(fout, "+ NONDEFAULTRULE %s\n", net->nonDefaultRule());
-
-  for (i = 0; i < net->numVpins(); i++) {
-      vpin = net->vpin(i);
-      fprintf(fout, "  + %s", vpin->name());
-      if (vpin->layer()) 
-          fprintf(fout, " %s", vpin->layer());
-      fprintf(fout, " %d %d %d %d", vpin->xl(), vpin->yl(), vpin->xh(),
-              vpin->yh());
-      if (vpin->status() != ' ') {
-          fprintf(fout, " %c", vpin->status());
-          fprintf(fout, " %d %d", vpin->xLoc(), vpin->yLoc());
-          if (vpin->orient() != -1)
-              fprintf(fout, " %s", orientStr(vpin->orient()));
-      }
-      fprintf(fout, "\n");
-  }
-
-  // regularWiring
-  // 180903 BX
-  
-  if (false) {
-  // if (net->numWires()) {
-  // if (curNet->isPreRouted == true && net->numWires() > 0) {
-     for (i = 0; i < net->numWires(); i++) {
-        newLayer = 0;
-        wire = net->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        count = 0;
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              } 
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "\n    NEW %s ", p->getLayer());
-                     break;
-              case DEFIPATH_MASK:
-                   fprintf(fout, "MASK %d ", p->getMask());
-                               break;
-                          case DEFIPATH_VIAMASK:
-                               fprintf(fout, "MASK %d%d%d ", 
-                                       p->getViaTopMask(), 
-                                       p->getViaCutMask(),
-                                       p->getViaBottomMask());
-                               break;
-                          case DEFIPATH_VIA:
-                               fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                               break;
-                          case DEFIPATH_VIAROTATION:
-                               fprintf(fout, "%s ", 
-                                       orientStr(p->getViaRotation()));
-                               break;
-              case DEFIPATH_RECT:
-                   p->getViaRect(&w, &x, &y, &z);
-                               fprintf(fout, "RECT ( %d %d %d %d ) ", w, x, y, z);
-                               break;
-              case DEFIPATH_VIRTUALPOINT:
-                   p->getVirtualPoint(&x, &y);
-                   fprintf(fout, "VIRTUAL ( %d %d ) ", x, y);
-                               break;
-                          case DEFIPATH_WIDTH:
-                               fprintf(fout, "%d ", p->getWidth());
-                               break;
-                          case DEFIPATH_POINT:
-                               p->getPoint(&x, &y);
-                               fprintf(fout, "( %d %d ) ", x, y);
-                               break;
-                          case DEFIPATH_FLUSHPOINT:
-                               p->getFlushPoint(&x, &y, &z);
-                               fprintf(fout, "( %d %d %d ) ", x, y, z);
-                               break;
-                          case DEFIPATH_TAPER:
-                               fprintf(fout, "TAPER ");
-                               break;
-                          case DEFIPATH_TAPERRULE:
-                               fprintf(fout, "TAPERRULE %s ",p->getTaperRule());
-                               break;
-                          case DEFIPATH_STYLE:
-                               fprintf(fout, "STYLE %d ",p->getStyle());
-                               break;
-                        }
-                     }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-  
-
-  // SHIELDNET
-  if (net->numShieldNets()) {
-     for (i = 0; i < net->numShieldNets(); i++) 
-         fprintf(fout, "\n  + SHIELDNET %s", net->shieldNet(i));
-  }
-  /* obsolete in 5.4
-  if (net->numNoShields()) {
-     for (i = 0; i < net->numNoShields(); i++) { 
-         noShield = net->noShield(i); 
-         fprintf(fout, "\n  + NOSHIELD ");
-         newLayer = 0;
-         for (j = 0; j < noShield->numPaths(); j++) {
-            p = noShield->path(j);
-            p->initTraverse();
-            while ((path = (int)p->next()) != DEFIPATH_DONE) {
-               count++;
-               // Don't want the line to be too long
-               if (count >= 5) {
-                   fprintf(fout, "\n");
-                   count = 0;
-               }
-               switch (path) {
-                 case DEFIPATH_LAYER:
-                      if (newLayer == 0) {
-                          fprintf(fout, "%s ", p->getLayer());
-                          newLayer = 1;
-                      } else
-                          fprintf(fout, "NEW %s ", p->getLayer());
-                      break;
-                 case DEFIPATH_VIA:
-                      fprintf(fout, "%s ", p->getVia());
-                      break;
-                 case DEFIPATH_VIAROTATION:
-                      fprintf(fout, "%s ", 
-                             orientStr(p->getViaRotation()));
-                      break;
-                 case DEFIPATH_WIDTH:
-                      fprintf(fout, "%d ", p->getWidth());
-                      break;
-                 case DEFIPATH_POINT:
-                      p->getPoint(&x, &y);
-                      fprintf(fout, "( %d %d ) ", x, y);
-                      break;
-                 case DEFIPATH_FLUSHPOINT:
-                      p->getFlushPoint(&x, &y, &z);
-                      fprintf(fout, "( %d %d %d ) ", x, y, z);
-                      break;
-                 case DEFIPATH_TAPER:
-                      fprintf(fout, "TAPER ");
-                      break;
-                 case DEFIPATH_TAPERRULE:
-                      fprintf(fout, "TAPERRULE %s ",
-                              p->getTaperRule());
-                      break;
-               }
-            }
-         }
-     }
-  }
-*/
-
-  if (net->hasSubnets()) {
-     for (i = 0; i < net->numSubnets(); i++) {
-        s = net->subnet(i);
-        fprintf(fout, "\n");
- 
-        if (s->numConnections()) {
-           if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-           else
-              fprintf(fout, "  + SUBNET %s ", s->name());
-           for (j = 0; j < s->numConnections(); j++)
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-
-           // regularWiring
-           if (s->numWires()) {
-              for (k = 0; k < s->numWires(); k++) {
-                 newLayer = 0;
-                 wire = s->wire(k);
-                 fprintf(fout, "  %s ", wire->wireType());
-                 count = 0;
-                 for (j = 0; j < wire->numPaths(); j++) {
-                    p = wire->path(j);
-                    p->initTraverse();
-                    while ((path = (int)p->next()) != DEFIPATH_DONE) {
-                       count++;
-                       // Don't want the line to be too long
-                       if (count >= 5) {
-                           fprintf(fout, "\n");
-                           count = 0;
-                       } 
-                       switch (path) {
-                         case DEFIPATH_LAYER:
-                              if (newLayer == 0) {
-                                  fprintf(fout, "%s ", p->getLayer());
-                                  newLayer = 1;
-                              } else
-                                  fprintf(fout, "NEW %s ",
-                                          p->getLayer());
-                              break;
-                         case DEFIPATH_VIA:
-                              fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                              break;
-                         case DEFIPATH_VIAROTATION:
-                              fprintf(fout, "%s ",
-                                      p->getViaRotationStr());
-                              break;
-                         case DEFIPATH_WIDTH:
-                              fprintf(fout, "%d ", p->getWidth());
-                              break;
-                         case DEFIPATH_POINT:
-                              p->getPoint(&x, &y);
-                              fprintf(fout, "( %d %d ) ", x, y);
-                              break;
-                         case DEFIPATH_FLUSHPOINT:
-                              p->getFlushPoint(&x, &y, &z);
-                              fprintf(fout, "( %d %d %d ) ", x, y, z);
-                              break;
-                         case DEFIPATH_TAPER:
-                              fprintf(fout, "TAPER ");
-                              break;
-                         case DEFIPATH_TAPERRULE:
-                              fprintf(fout, "TAPERRULE  %s ",
-                                      p->getTaperRule());
-                              break;
-                         case DEFIPATH_STYLE:
-                              fprintf(fout, "STYLE  %d ",
-                                      p->getStyle());
-                              break;
-                       }
-                    }
-                 }
-              }
-           }
-         }
-      }
-   }
-
-  if (net->numProps()) {
-    for (i = 0; i < net->numProps(); i++) {
-        fprintf(fout, "  + PROPERTY %s ", net->propName(i));
-        switch (net->propType(i)) {
-           // case 'R': fprintf(fout, "%g REAL ", net->propNumber(i));
-                     // break;
-           case 'R': fprintf(fout, "%g ", net->propNumber(i));
-                     break;
-           case 'I': fprintf(fout, "%g INTEGER ", net->propNumber(i));
-                     break;
-           case 'S': fprintf(fout, "%s STRING ", net->propValue(i));
-                     break;
-           case 'Q': fprintf(fout, "%s QUOTESTRING ", net->propValue(i));
-                     break;
-           case 'N': fprintf(fout, "%g NUMBER ", net->propNumber(i));
-                     break;
-        }
-        fprintf(fout, "\n");
-    }
-  }
-
-  if (net->hasWeight())
-    fprintf(fout, "+ WEIGHT %d ", net->weight());
-  if (net->hasCap())
-    fprintf(fout, "+ ESTCAP %g ", net->cap());
-  if (net->hasSource())
-    fprintf(fout, "+ SOURCE %s ", net->source());
-  if (net->hasFixedbump())
-    fprintf(fout, "+ FIXEDBUMP ");
-  if (net->hasFrequency())
-    fprintf(fout, "+ FREQUENCY %g ", net->frequency());
-  if (net->hasPattern())
-    fprintf(fout, "+ PATTERN %s ", net->pattern());
-  if (net->hasOriginal())
-    fprintf(fout, "+ ORIGINAL %s ", net->original());
-  if (net->hasUse())
-    fprintf(fout, "+ USE %s ", net->use());
-
-  fprintf (fout, ";\n");
-  --numObjs;
-  //if (numObjs <= 0)
-  //    fprintf(fout, "END NETS\n");
-  return 0;
-}
-
-
-int snetpath(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
-  int         i, j, x, y, z, count, newLayer;
-  char*       layerName;
-  double      dist, left, right;
-  defiPath*   p;
-  defiSubnet  *s;
-  int         path;
-  defiShield* shield;
-  defiWire*   wire;
-  int         numX, numY, stepX, stepY;
-
-  if (c != defrSNetPartialPathCbkType)
-      return 1;
-  if (ud != userData) dataError();
-
-  fprintf (fout, "SPECIALNET partial data\n");
-
-  fprintf(fout, "- %s ", ppath->name());
-
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < ppath->numConnections(); i++) {
-      // set the limit of only 5 items print out in one line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf (fout, "( %s %s ) ", ppath->instance(i),
-               ppath->pin(i));
-      if (ppath->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  // specialWiring
-  // POLYGON
-  if (ppath->numPolygons()) {
-     struct defiPoints points;
-    for (i = 0; i < ppath->numPolygons(); i++) {
-      fprintf(fout, "\n  + POLYGON %s ", ppath->polygonName(i));
-      points = ppath->getPolygon(i);
-      for (j = 0; j < points.numPoints; j++)
-        fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-    }
-  }
-  // RECT
-  if (ppath->numRectangles()) {
-     for (i = 0; i < ppath->numRectangles(); i++) {
-       fprintf(fout, "\n  + RECT %s %d %d %d %d", ppath->rectName(i),
-               ppath->xl(i), ppath->yl(i),
-               ppath->xh(i), ppath->yh(i));
-     }
-  }
-
-  // COVER, FIXED, ROUTED or SHIELD
-  if (ppath->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < ppath->numWires(); i++) {
-        newLayer = 0;
-        wire = ppath->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              }
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "NEW %s ", p->getLayer());
-                     break;
-                case DEFIPATH_VIA:
-                     fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, "%s ",
-                             orientStr(p->getViaRotation()));
-                     break;
-                case DEFIPATH_VIADATA:
-                     p->getViaData(&numX, &numY, &stepX, &stepY);
-                     fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                             stepX, stepY);
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, "%d ", p->getWidth());
-                     break;
-                case DEFIPATH_MASK:
-                     fprintf(fout, "MASK %d ", p->getMask());
-                     break;
-                case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                    break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     fprintf(fout, "( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, "TAPER ");
-                     break;
-                case DEFIPATH_SHAPE:
-                     fprintf(fout, "+ SHAPE %s ", p->getShape());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, "+ STYLE %d ", p->getStyle());
-                     break;
-              }
-           }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-
-  if (ppath->hasSubnets()) {
-    for (i = 0; i < ppath->numSubnets(); i++) {
-      s = ppath->subnet(i);
-      if (s->numConnections()) {
-          if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-          else
-              fprintf(fout, "- %s ", s->name());
-          for (j = 0; j < s->numConnections(); j++) {
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-        }
-      }
-
-      // regularWiring
-      if (s->numWires()) {
-         for (i = 0; i < s->numWires(); i++) {
-            wire = s->wire(i);
-            fprintf(fout, "  + %s ", wire->wireType());
-            for (j = 0; j < wire->numPaths(); j++) {
-              p = wire->path(j);
-              p->print(fout);
-            }
-         }
-      }
-    }
-  }
-
-  if (ppath->numProps()) {
-    for (i = 0; i < ppath->numProps(); i++) {
-        if (ppath->propIsString(i))
-           fprintf(fout, "  + PROPERTY %s %s ", ppath->propName(i),
-                   ppath->propValue(i));
-        if (ppath->propIsNumber(i))
-           fprintf(fout, "  + PROPERTY %s %g ", ppath->propName(i),
-                   ppath->propNumber(i));
-        // BX 180910 read LEF issue (no help)
-        switch (ppath->propType(i)) {
-           case 'R': fprintf(fout, "REAL ");
-                     break;
-           case 'I': fprintf(fout, "INTEGER ");
-                     break;
-           case 'S': fprintf(fout, "STRING ");
-                     break;
-           case 'Q': fprintf(fout, "QUOTESTRING ");
-                     break;
-           case 'N': fprintf(fout, "NUMBER ");
-                     break;
-        }
-        fprintf(fout, "\n");
-    }
-  }
-
-  // SHIELD
-  count = 0;
-  // testing the SHIELD for 5.3, obsolete in 5.4
-  if (ppath->numShields()) {
-    for (i = 0; i < ppath->numShields(); i++) {
-       shield = ppath->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             }
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    if (newLayer)
-                       fprintf(fout, "%s ",
-                               orientStr(p->getViaRotation()));
-                    else
-                       fprintf(fout, "Str %s ",
-                               p->getViaRotationStr());
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-         case DEFIPATH_MASK:
-        fprintf(fout, "MASK %d ", p->getMask());
-        break;
-               case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                    break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-             }
-          }
-       }
-    }
-  }
-
-  // layerName width
-  if (ppath->hasWidthRules()) {
-    for (i = 0; i < ppath->numWidthRules(); i++) {
-        ppath->widthRule(i, &layerName, &dist);
-        fprintf (fout, "\n  + WIDTH %s %g ", layerName, dist);
-    }
-  }
-
-  // layerName spacing
-  if (ppath->hasSpacingRules()) {
-    for (i = 0; i < ppath->numSpacingRules(); i++) {
-        ppath->spacingRule(i, &layerName, &dist, &left, &right);
-        if (left == right)
-            fprintf (fout, "\n  + SPACING %s %g ", layerName, dist);
-        else
-            fprintf (fout, "\n  + SPACING %s %g RANGE %g %g ",
-                     layerName, dist, left, right);
-    }
-  }
-
-  if (ppath->hasFixedbump())
-    fprintf(fout, "\n  + FIXEDBUMP ");
-  if (ppath->hasFrequency())
-    fprintf(fout, "\n  + FREQUENCY %g ", ppath->frequency());
-  if (ppath->hasVoltage())
-    fprintf(fout, "\n  + VOLTAGE %g ", ppath->voltage());
-  if (ppath->hasWeight())
-    fprintf(fout, "\n  + WEIGHT %d ", ppath->weight());
-  if (ppath->hasCap())
-    fprintf(fout, "\n  + ESTCAP %g ", ppath->cap());
-  if (ppath->hasSource())
-    fprintf(fout, "\n  + SOURCE %s ", ppath->source());
-  if (ppath->hasPattern())
-    fprintf(fout, "\n  + PATTERN %s ", ppath->pattern());
-  if (ppath->hasOriginal())
-    fprintf(fout, "\n  + ORIGINAL %s ", ppath->original());
-  if (ppath->hasUse())
-    fprintf(fout, "\n  + USE %s ", ppath->use());
-
-  fprintf(fout, "\n");
-
-  return 0;
-}
-
-
-int snetwire(defrCallbackType_e c, defiNet* ppath, defiUserData ud) {
-  int         i, j, x, y, z, count = 0, newLayer;
-  defiPath*   p;
-  int         path;
-  defiWire*   wire;
-  defiShield* shield;
-  int         numX, numY, stepX, stepY;
-
-  if (c != defrSNetWireCbkType)
-      return 1;
-  if (ud != userData) dataError();
-
-  // LW block
-  //fprintf (fout, "SPECIALNET wire data\n");
-
-  fprintf(fout, "- %s ", ppath->name());
-
-  // POLYGON
-  if (ppath->numPolygons()) {
-  struct defiPoints points;
-  for (i = 0; i < ppath->numPolygons(); i++) {
-      fprintf(fout, "\n  + POLYGON %s ", ppath->polygonName(i));
-
-      points = ppath->getPolygon(i);
-
-      for (j = 0; j < points.numPoints; j++) {
-    fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-      }
-  }
-  // RECT
-  } 
-  if (ppath->numRectangles()) {
-  for (i = 0; i < ppath->numRectangles(); i++) {
-      fprintf(fout, "\n  + RECT %s %d %d %d %d", ppath->rectName(i),
-            ppath->xl(i), ppath->yl(i),
-            ppath->xh(i), ppath->yh(i));
-  }
-  }
-  // VIA
-  if (ppath->numViaSpecs()) {
-  for (i = 0; i < ppath->numViaSpecs(); i++) {
-      fprintf(fout, "\n  + VIA %s ", ppath->viaName(i)),
-      fprintf(fout, " %s", ppath->viaOrientStr(i));
-
-      defiPoints points = ppath->getViaPts(i);
-
-      for (int j = 0; j < points.numPoints; j++) {
-    fprintf(fout, " %d %d", points.x[j], points.y[j]);
-      }
-  }
-  }
-
-  // specialWiring
-  if (ppath->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < ppath->numWires(); i++) {
-        newLayer = 0;
-        wire = ppath->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-           p = wire->path(j);
-           p->initTraverse();
-           while ((path = (int)p->next()) != DEFIPATH_DONE) {
-              count++;
-              // Don't want the line to be too long
-              if (count >= 5) {
-                  fprintf(fout, "\n");
-                  count = 0;
-              }
-              switch (path) {
-                case DEFIPATH_LAYER:
-                     if (newLayer == 0) {
-                         fprintf(fout, "%s ", p->getLayer());
-                         newLayer = 1;
-                     } else
-                         fprintf(fout, "NEW %s ", p->getLayer());
-                     break;
-                case DEFIPATH_VIA:
-                     fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                     break;
-                case DEFIPATH_VIAROTATION:
-                     fprintf(fout, "%s ",
-                             orientStr(p->getViaRotation()));
-                     break;
-                case DEFIPATH_VIADATA:
-                     p->getViaData(&numX, &numY, &stepX, &stepY);
-                     fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                             stepX, stepY);
-                     break;
-                case DEFIPATH_WIDTH:
-                     fprintf(fout, "%d ", p->getWidth());
-                     break;
-    case DEFIPATH_MASK:
-         fprintf(fout, "MASK %d ", p->getMask());
-         break;
-                case DEFIPATH_VIAMASK:
-                     fprintf(fout, "MASK %d%d%d ", 
-                             p->getViaTopMask(), 
-                             p->getViaCutMask(),
-                             p->getViaBottomMask());
-                    break;
-                case DEFIPATH_POINT:
-                     p->getPoint(&x, &y);
-                     fprintf(fout, "( %d %d ) ", x, y);
-                     break;
-                case DEFIPATH_FLUSHPOINT:
-                     p->getFlushPoint(&x, &y, &z);
-                     fprintf(fout, "( %d %d %d ) ", x, y, z);
-                     break;
-                case DEFIPATH_TAPER:
-                     fprintf(fout, "TAPER ");
-                     break;
-                case DEFIPATH_SHAPE:
-                     fprintf(fout, "+ SHAPE %s ", p->getShape());
-                     break;
-                case DEFIPATH_STYLE:
-                     fprintf(fout, "+ STYLE %d ", p->getStyle());
-                     break;
-              }
-           }
-        }
-        fprintf(fout, "\n");
-        count = 0;
-     }
-  } else if (ppath->numShields()) {
-    for (i = 0; i < ppath->numShields(); i++) {
-       shield = ppath->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             } 
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    fprintf(fout, "%s ", 
-                            orientStr(p->getViaRotation()));
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-         case DEFIPATH_MASK:
-        fprintf(fout, "MASK %d ", p->getMask());
-        break;
-               case DEFIPATH_VIAMASK:
-                   fprintf(fout, "MASK %d%d%d ", 
-                           p->getViaTopMask(), 
-                           p->getViaCutMask(),
-                           p->getViaBottomMask());
-                   break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-                    break;
-             }
-          }
-       }
-    } 
-  }
-
-  fprintf(fout, "\n");
-
-  return 0;
-}
-
-int snetf(defrCallbackType_e c, defiNet* net, defiUserData ud) {
-  // For net and special net.
-  int         i, j, x, y, z, count, newLayer;
-  char*       layerName;
-  double      dist, left, right;
-  defiPath*   p;
-  defiSubnet  *s;
-  int         path;
-  defiShield* shield;
-  defiWire*   wire;
-  int         numX, numY, stepX, stepY;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrSNetCbkType)
-      fprintf(fout, "BOGUS NET TYPE  ");
-
-// 5/6/2004 - don't need since I have a callback for the name
-//  fprintf(fout, "- %s ", net->name());
-
-  count = 0;
-  // compName & pinName
-  for (i = 0; i < net->numConnections(); i++) {
-      // set the limit of only 5 items print out in one line
-      count++;
-      if (count >= 5) {
-          fprintf(fout, "\n");
-          count = 0;
-      }
-      fprintf (fout, "( %s %s ) ", net->instance(i),
-               net->pin(i));
-      if (net->pinIsSynthesized(i))
-          fprintf(fout, "+ SYNTHESIZED ");
-  }
-
-  // specialWiring
-  if (net->numWires()) {
-     newLayer = 0;
-     for (i = 0; i < net->numWires(); i++) {
-        newLayer = 0;
-        wire = net->wire(i);
-        fprintf(fout, "\n  + %s ", wire->wireType());
-        if (strcmp (wire->wireType(), "SHIELD") == 0)
-           fprintf(fout, "%s ", wire->wireShieldNetName());
-        for (j = 0; j < wire->numPaths(); j++) {
-            p = wire->path(j);
-            p->initTraverse();
-            if (testDebugPrint) {
-                p->print(fout);
-            } else {
-                while ((path = (int)p->next()) != DEFIPATH_DONE) {
-                  count++;
-                  // Don't want the line to be too long
-                  //if (count >= 5) {
-                  //    fprintf(fout, "\n");
-                  //    count = 0;
-                  //}
-                  switch (path) {
-                    case DEFIPATH_LAYER:
-                         if (newLayer == 0) {
-                             fprintf(fout, "%s ", p->getLayer());
-                             newLayer = 1;
-                         } else
-                             // LW mod
-                             //fprintf(fout, "NEW %s ", p->getLayer());
-                             fprintf(fout, "\n    NEW %s ", p->getLayer());
-                         break;
-                    case DEFIPATH_VIA:
-                         fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                         break;
-                    case DEFIPATH_VIAROTATION:
-                         fprintf(fout, "%s ", 
-                                 orientStr(p->getViaRotation()));
-                         break;
-                    case DEFIPATH_VIADATA:
-                         p->getViaData(&numX, &numY, &stepX, &stepY);
-                         fprintf(fout, "DO %d BY %d STEP %d %d ", numX, numY,
-                                 stepX, stepY);
-                         break;
-                    case DEFIPATH_WIDTH:
-                         fprintf(fout, "%d ", p->getWidth());
-                         break;
-                    case DEFIPATH_MASK:
-                         fprintf(fout, "MASK %d ", p->getMask());
-                         break;
-                    case DEFIPATH_VIAMASK:
-                         fprintf(fout, "MASK %d%d%d ", 
-                                 p->getViaTopMask(), 
-                                 p->getViaCutMask(),
-                                 p->getViaBottomMask());
-                        break;
-                    case DEFIPATH_POINT:
-                         p->getPoint(&x, &y);
-                         fprintf(fout, "( %d %d ) ", x, y);
-                         break;
-                    case DEFIPATH_FLUSHPOINT:
-                         p->getFlushPoint(&x, &y, &z);
-                         fprintf(fout, "( %d %d %d ) ", x, y, z);
-                         break;
-                    case DEFIPATH_TAPER:
-                         fprintf(fout, "TAPER ");
-                         break;
-                    case DEFIPATH_SHAPE:
-                         fprintf(fout, "+ SHAPE %s ", p->getShape());
-                         break;
-                    case DEFIPATH_STYLE:
-                         fprintf(fout, "+ STYLE %d ", p->getStyle());
-                         break;
-                    }
-                }
-            }
-        }
-        //fprintf(fout, "\n");
-        count = 0;
-     }
-  }
-
-  // POLYGON
-  if (net->numPolygons()) {
-    struct defiPoints points;
-
-    for (i = 0; i < net->numPolygons(); i++) {
-      if (curVer >= 5.8 ) {
-   if (strcmp(net->polyRouteStatus(i), "") != 0) {
-     fprintf(fout, "\n  + %s ", net->polyRouteStatus(i));
-     if (strcmp(net->polyRouteStatus(i), "SHIELD") == 0) {
-        fprintf(fout, "\n  + %s ", net->polyRouteStatusShieldName(i));
-     }
-         }
-         if (strcmp(net->polyShapeType(i), "") != 0) {
-     fprintf(fout, "\n  + SHAPE %s ", net->polyShapeType(i));
-         }
-      }
-      if (net->polyMask(i)) {
-    fprintf(fout, "\n  + MASK %d + POLYGON % s ", net->polyMask(i),
-      net->polygonName(i));
-      } else {
-          fprintf(fout, "\n  + POLYGON %s ", net->polygonName(i));
-      }
-      points = net->getPolygon(i);
-      for (j = 0; j < points.numPoints; j++)
-        fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-    }
-  }
-  // RECT
-  if (net->numRectangles()) {
-    for (i = 0; i < net->numRectangles(); i++) {
-      if (curVer >= 5.8 ) {
-        if (strcmp(net->rectRouteStatus(i), "") != 0) {
-          fprintf(fout, "\n  + %s ", net->rectRouteStatus(i));
-          if (strcmp(net->rectRouteStatus(i), "SHIELD") == 0) {
-            fprintf(fout, "\n  + %s ", net->rectRouteStatusShieldName(i));
-          }
-        }
-        if (strcmp(net->rectShapeType(i), "") != 0) {
-          fprintf(fout, "\n  + SHAPE %s ", net->rectShapeType(i));
-        }
-      }
-      if (net->rectMask(i)) {
-        fprintf(fout, "\n  + MASK %d + RECT %s %d %d %d %d", 
-                net->rectMask(i), net->rectName(i), net->xl(i), 
-                net->yl(i), net->xh(i), net->yh(i));
-      } else {
-        fprintf(fout, "\n  + RECT %s %d %d %d %d", 
-                net->rectName(i), net->xl(i), 
-                net->yl(i), 
-                net->xh(i),
-                net->yh(i));
-      }
-    }
-  }
-  // VIA
-  if (curVer >= 5.8 && net->numViaSpecs()) {
-    for (i = 0; i < net->numViaSpecs(); i++) {
-      if (strcmp(net->viaRouteStatus(i), "") != 0) {
-        fprintf(fout, "\n  + %s ", net->viaRouteStatus(i));
-        if (strcmp(net->viaRouteStatus(i), "SHIELD") == 0) {
-          fprintf(fout, "\n  + %s ", net->viaRouteStatusShieldName(i));
-        }
-      }
-      if (strcmp(net->viaShapeType(i), "") != 0) {
-        fprintf(fout, "\n  + SHAPE %s ", net->viaShapeType(i));
-      }
-      if (net->topMaskNum(i) || net->cutMaskNum(i) || net->bottomMaskNum(i)) {
-        fprintf(fout, "\n  + MASK %d%d%d + VIA %s ", net->topMaskNum(i), 
-                net->cutMaskNum(i),
-                net->bottomMaskNum(i),
-                net->viaName(i));
-      } else {
-        fprintf(fout, "\n  + VIA %s ", net->viaName(i));
-      }
-      fprintf(fout, " %s", net->viaOrientStr(i));
-      
-      defiPoints points = net->getViaPts(i);
-
-      for (int j = 0; j < points.numPoints; j++) {
-        fprintf(fout, " %d %d", points.x[j], points.y[j]);
-      }
-      fprintf(fout, ";\n"); 
-    }
-  }
-
-  if (net->hasSubnets()) {
-    for (i = 0; i < net->numSubnets(); i++) {
-      s = net->subnet(i);
-      if (s->numConnections()) {
-          if (s->pinIsMustJoin(0))
-              fprintf(fout, "- MUSTJOIN ");
-          else
-              fprintf(fout, "- %s ", s->name());
-          for (j = 0; j < s->numConnections(); j++) {
-              fprintf(fout, " ( %s %s )\n", s->instance(j),
-                      s->pin(j));
-        }
-      }
- 
-      // regularWiring
-      if (s->numWires()) {
-         for (i = 0; i < s->numWires(); i++) {
-            wire = s->wire(i);
-            fprintf(fout, "  + %s ", wire->wireType());
-            for (j = 0; j < wire->numPaths(); j++) {
-              p = wire->path(j);
-              p->print(fout);
-            }
-         }
-      }
-    }
-  }
-
-  if (net->numProps()) {
-    for (i = 0; i < net->numProps(); i++) {
-        if (net->propIsString(i))
-           fprintf(fout, "  + PROPERTY %s %s ", net->propName(i),
-                   net->propValue(i));
-        if (net->propIsNumber(i))
-           fprintf(fout, "  + PROPERTY %s %g ", net->propName(i),
-                   net->propNumber(i));
-        // switch (net->propType(i)) {
-        //    case 'R': fprintf(fout, "REAL ");
-        //              break;
-        //    case 'I': fprintf(fout, "INTEGER ");
-        //              break;
-        //    case 'S': fprintf(fout, "STRING ");
-        //              break;
-        //    case 'Q': fprintf(fout, "QUOTESTRING ");
-        //              break;
-        //    case 'N': fprintf(fout, "NUMBER ");
-        //              break;
-        // }
-        fprintf(fout, "\n");
-    }
-  }
-
-  // SHIELD
-  count = 0;
-  // testing the SHIELD for 5.3, obsolete in 5.4
-  if (net->numShields()) {
-    for (i = 0; i < net->numShields(); i++) {
-       shield = net->shield(i);
-       fprintf(fout, "\n  + SHIELD %s ", shield->shieldName());
-       newLayer = 0;
-       for (j = 0; j < shield->numPaths(); j++) {
-          p = shield->path(j);
-          p->initTraverse();
-          while ((path = (int)p->next()) != DEFIPATH_DONE) {
-             count++;
-             // Don't want the line to be too long
-             if (count >= 5) {
-                 fprintf(fout, "\n");
-                 count = 0;
-             } 
-             switch (path) {
-               case DEFIPATH_LAYER:
-                    if (newLayer == 0) {
-                        fprintf(fout, "%s ", p->getLayer());
-                        newLayer = 1;
-                    } else
-                        fprintf(fout, "NEW %s ", p->getLayer());
-                    break;
-               case DEFIPATH_VIA:
-                    fprintf(fout, "%s ", ignoreViaNames ? "XXX" : p->getVia());
-                    break;
-               case DEFIPATH_VIAROTATION:
-                    fprintf(fout, "%s ", 
-                            orientStr(p->getViaRotation()));
-                    break;
-               case DEFIPATH_WIDTH:
-                    fprintf(fout, "%d ", p->getWidth());
-                    break;
-         case DEFIPATH_MASK:
-        fprintf(fout, "MASK %d ", p->getMask());
-        break;
-               case DEFIPATH_VIAMASK:
-                    fprintf(fout, "MASK %d%d%d ", 
-                            p->getViaTopMask(), 
-                            p->getViaCutMask(),
-                            p->getViaBottomMask());
-                   break;
-               case DEFIPATH_POINT:
-                    p->getPoint(&x, &y);
-                    fprintf(fout, "( %d %d ) ", x, y);
-                    break;
-               case DEFIPATH_FLUSHPOINT:
-                    p->getFlushPoint(&x, &y, &z);
-                    fprintf(fout, "( %d %d %d ) ", x, y, z);
-                    break;
-               case DEFIPATH_TAPER:
-                    fprintf(fout, "TAPER ");
-                    break;
-               case DEFIPATH_SHAPE:
-                    fprintf(fout, "+ SHAPE %s ", p->getShape());
-                    break;
-               case DEFIPATH_STYLE:
-                    fprintf(fout, "+ STYLE %d ", p->getStyle());
-                    break;
-             }
-          }
-       }
-    }
-  }
-
-  // layerName width
-  if (net->hasWidthRules()) {
-    for (i = 0; i < net->numWidthRules(); i++) {
-        net->widthRule(i, &layerName, &dist);
-        fprintf (fout, "\n  + WIDTH %s %g ", layerName, dist);
-    }
-  }
-
-  // layerName spacing
-  if (net->hasSpacingRules()) {
-    for (i = 0; i < net->numSpacingRules(); i++) {
-        net->spacingRule(i, &layerName, &dist, &left, &right);
-        if (left == right)
-            fprintf (fout, "\n  + SPACING %s %g ", layerName, dist);
-        else
-            fprintf (fout, "\n  + SPACING %s %g RANGE %g %g ",
-                     layerName, dist, left, right);
-    }
-  }
-
-  if (net->hasFixedbump())
-    fprintf(fout, "\n  + FIXEDBUMP ");
-  if (net->hasFrequency())
-    fprintf(fout, "\n  + FREQUENCY %g ", net->frequency());
-  if (net->hasVoltage())
-    fprintf(fout, "\n  + VOLTAGE %g ", net->voltage());
-  if (net->hasWeight())
-    fprintf(fout, "\n  + WEIGHT %d ", net->weight());
-  if (net->hasCap())
-    fprintf(fout, "\n  + ESTCAP %g ", net->cap());
-  if (net->hasSource())
-    fprintf(fout, "\n  + SOURCE %s ", net->source());
-  if (net->hasPattern())
-    fprintf(fout, "\n  + PATTERN %s ", net->pattern());
-  if (net->hasOriginal())
-    fprintf(fout, "\n  + ORIGINAL %s ", net->original());
-  if (net->hasUse())
-    fprintf(fout, "\n  + USE %s ", net->use());
-
-  fprintf (fout, ";\n");
-  --numObjs;
-  //if (numObjs <= 0)
-  //    fprintf(fout, "END SPECIALNETS\n");
-  return 0;
-}
-
-
-int ndr(defrCallbackType_e c, defiNonDefault* nd, defiUserData ud) {
-  // For nondefaultrule
-  int i;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c != defrNonDefaultCbkType)
-      fprintf(fout, "BOGUS NONDEFAULTRULE TYPE  ");
-  fprintf(fout, "- %s\n", nd->name());
-  if (nd->hasHardspacing())
-      fprintf(fout, "   + HARDSPACING\n");
-  for (i = 0; i < nd->numLayers(); i++) {
-    fprintf(fout, "   + LAYER %s", nd->layerName(i));
-    fprintf(fout, " WIDTH %d", nd->layerWidthVal(i));
-    if (nd->hasLayerDiagWidth(i)) 
-      fprintf(fout, " DIAGWIDTH %d",
-              nd->layerDiagWidthVal(i));
-    if (nd->hasLayerSpacing(i)) 
-      fprintf(fout, " SPACING %d", nd->layerSpacingVal(i));
-    if (nd->hasLayerWireExt(i)) 
-      fprintf(fout, " WIREEXT %d", nd->layerWireExtVal(i));
-    fprintf(fout, "\n");
-  }
-  for (i = 0; i < nd->numVias(); i++)
-    fprintf(fout, "   + VIA %s\n", nd->viaName(i));
-  for (i = 0; i < nd->numViaRules(); i++)
-    fprintf(fout, "   + VIARULE %s\n", ignoreViaNames ? "XXX" : nd->viaRuleName(i));
-  for (i = 0; i < nd->numMinCuts(); i++)
-    fprintf(fout, "   + MINCUTS %s %d\n", nd->cutLayerName(i),
-            nd->numCuts(i));
-  for (i = 0; i < nd->numProps(); i++) {
-    fprintf(fout, "   + PROPERTY %s %s ", nd->propName(i),
-            nd->propValue(i));
-    switch (nd->propType(i)) {
-      case 'R': fprintf(fout, "REAL\n");
-                break;
-      case 'I': fprintf(fout, "INTEGER\n");
-                break;
-      case 'S': fprintf(fout, "STRING\n");
-                break;
-      case 'Q': fprintf(fout, "QUOTESTRING\n");
-                break;
-      case 'N': fprintf(fout, "NUMBER\n");
-                break;
-    }
-  }
-  --numObjs;
-  if (numObjs <= 0)
-    fprintf(fout, "END NONDEFAULTRULES\n");
-  return 0;
-}
-
-int tname(defrCallbackType_e c, const char* string, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "TECHNOLOGY %s ;\n", string);
-  return 0;
-}
-
-int dname(defrCallbackType_e c, const char* string, defiUserData data) {
-  // std::cout << "dname1\n";
-  // checkType(c);
-  // if (ud != userData) dataError();
-  fprintf(fout, "DESIGN %s ;\n", string);
-  // std::cout << "dname2\n";
-  return 0;
-}
-
-
-char* address(const char* in) {
-  return ((char*)in);
-}
-
-int cs(defrCallbackType_e c, int num, defiUserData ud) {
-  char* name;
-
-  checkType(c);
-
-  if (ud != userData) dataError();
-
-  switch (c) {
-  case defrComponentStartCbkType : name = address("COMPONENTS"); break;
-  case defrNetStartCbkType : name = address("NETS"); break;
-  case defrStartPinsCbkType : name = address("PINS"); break;
-  case defrViaStartCbkType : name = address("VIAS"); break;
-  case defrRegionStartCbkType : name = address("REGIONS"); break;
-  case defrSNetStartCbkType : name = address("SPECIALNETS"); break;
-  case defrGroupsStartCbkType : name = address("GROUPS"); break;
-  case defrScanchainsStartCbkType : name = address("SCANCHAINS"); break;
-  case defrIOTimingsStartCbkType : name = address("IOTIMINGS"); break;
-  case defrFPCStartCbkType : name = address("FLOORPLANCONSTRAINTS"); break;
-  case defrTimingDisablesStartCbkType : name = address("TIMING DISABLES"); break;
-  case defrPartitionsStartCbkType : name = address("PARTITIONS"); break;
-  case defrPinPropStartCbkType : name = address("PINPROPERTIES"); break;
-  case defrBlockageStartCbkType : name = address("BLOCKAGES"); break;
-  case defrSlotStartCbkType : name = address("SLOTS"); break;
-  case defrFillStartCbkType : name = address("FILLS"); break;
-  case defrNonDefaultStartCbkType : name = address("NONDEFAULTRULES"); break;
-  case defrStylesStartCbkType : name = address("STYLES"); break;
-  default : name = address("BOGUS"); return 1;
-  }
-  fprintf(fout, "\n%s %d ;\n", name, num);
-  numObjs = num;
-  return 0;
-}
-
-int constraintst(defrCallbackType_e c, int num, defiUserData ud) {
-  // Handles both constraints and assertions
-  checkType(c);
-  if (ud != userData) dataError();
-  if (c == defrConstraintsStartCbkType)
-      fprintf(fout, "\nCONSTRAINTS %d ;\n\n", num);
-  else
-      fprintf(fout, "\nASSERTIONS %d ;\n\n", num);
-  numObjs = num;
-  return 0;
-}
-
-void operand(defrCallbackType_e c, defiAssertion* a, int ind) {
-  int i, first = 1;
-  char* netName;
-  char* fromInst, * fromPin, * toInst, * toPin;
-
-  if (a->isSum()) {
-      // Sum in operand, recursively call operand
-      fprintf(fout, "- SUM ( ");
-      a->unsetSum();
-      isSumSet = 1;
-      begOperand = 0;
-      operand (c, a, ind);
-      fprintf(fout, ") ");
-  } else {
-      // operand
-      if (ind >= a->numItems()) {
-          fprintf(fout, "ERROR: when writing out SUM in Constraints.\n");
-          return;
-       }
-      if (begOperand) {
-         fprintf(fout, "- ");
-         begOperand = 0;
-      }
-      for (i = ind; i < a->numItems(); i++) {
-          if (a->isNet(i)) {
-              a->net(i, &netName);
-              if (!first)
-                  fprintf(fout, ", "); // print , as separator
-              fprintf(fout, "NET %s ", netName); 
-          } else if (a->isPath(i)) {
-              a->path(i, &fromInst, &fromPin, &toInst,
-                                     &toPin);
-              if (!first)
-                  fprintf(fout, ", ");
-              fprintf(fout, "PATH %s %s %s %s ", fromInst, fromPin, toInst,
-                      toPin);
-          } else if (isSumSet) {
-              // SUM within SUM, reset the flag
-              a->setSum();
-              operand(c, a, i);
-          }
-          first = 0;
-      } 
-      
-  }
-}
-
-int constraint(defrCallbackType_e c, defiAssertion* a, defiUserData ud) {
-  // Handles both constraints and assertions
-
-  checkType(c);
-  if (ud != userData) dataError();
-  if (a->isWiredlogic())
-      // Wirelogic
-      fprintf(fout, "- WIREDLOGIC %s + MAXDIST %g ;\n",
-// Wiredlogic dist is also store in fallMax
-//              a->netName(), a->distance());
-              a->netName(), a->fallMax());
-  else {
-      // Call the operand function
-      isSumSet = 0;    // reset the global variable
-      begOperand = 1;
-      operand (c, a, 0);
-      // Get the Rise and Fall
-      if (a->hasRiseMax())
-          fprintf(fout, "+ RISEMAX %g ", a->riseMax());
-      if (a->hasFallMax())
-          fprintf(fout, "+ FALLMAX %g ", a->fallMax());
-      if (a->hasRiseMin())
-          fprintf(fout, "+ RISEMIN %g ", a->riseMin());
-      if (a->hasFallMin())
-          fprintf(fout, "+ FALLMIN %g ", a->fallMin());
-      fprintf(fout, ";\n");
-  }
-  --numObjs;
-  if (numObjs <= 0) {
-      if (c == defrConstraintCbkType)
-          fprintf(fout, "END CONSTRAINTS\n");
-      else 
-          fprintf(fout, "END ASSERTIONS\n");
-  }
-  return 0;
-}
-
-
-int propstart(defrCallbackType_e c, void*, defiUserData) {
-  checkType(c);
-  fprintf(fout, "\nPROPERTYDEFINITIONS\n");
-  isProp = 1;
-
-  return 0;
-}
-
-
-int prop(defrCallbackType_e c, defiProp* p, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (strcmp(p->propType(), "design") == 0)
-      fprintf(fout, "DESIGN %s ", p->propName());
-  else if (strcmp(p->propType(), "net") == 0)
-      fprintf(fout, "NET %s ", p->propName());
-  else if (strcmp(p->propType(), "component") == 0)
-      fprintf(fout, "COMPONENT %s ", p->propName());
-  else if (strcmp(p->propType(), "specialnet") == 0)
-      fprintf(fout, "SPECIALNET %s ", p->propName());
-  else if (strcmp(p->propType(), "group") == 0)
-      fprintf(fout, "GROUP %s ", p->propName());
-  else if (strcmp(p->propType(), "row") == 0)
-      fprintf(fout, "ROW %s ", p->propName());
-  else if (strcmp(p->propType(), "componentpin") == 0)
-      fprintf(fout, "COMPONENTPIN %s ", p->propName());
-  else if (strcmp(p->propType(), "region") == 0)
-      fprintf(fout, "REGION %s ", p->propName());
-  else if (strcmp(p->propType(), "nondefaultrule") == 0)
-      fprintf(fout, "NONDEFAULTRULE %s ", p->propName());
-  if (p->dataType() == 'I')
-      fprintf(fout, "INTEGER ");
-  if (p->dataType() == 'R')
-      fprintf(fout, "REAL ");
-  if (p->dataType() == 'S')
-      fprintf(fout, "STRING ");
-  if (p->dataType() == 'Q')
-      fprintf(fout, "STRING ");
-  if (p->hasRange()) {
-      fprintf(fout, "RANGE %g %g ", p->left(),
-              p->right());
-  }
-  if (p->hasNumber())
-      fprintf(fout, "%g ", p->number());
-  if (p->hasString())
-      fprintf(fout, "\"%s\" ", p->string());
-  fprintf(fout, ";\n");
-
-  return 0;
-}
-
-
-int propend(defrCallbackType_e c, void*, defiUserData) {
-  checkType(c);
-  if (isProp) {
-      fprintf(fout, "END PROPERTYDEFINITIONS\n\n");
-      isProp = 0;
-  }
-
-  return 0;
-}
-
-
-int hist(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  defrSetCaseSensitivity(0);
-  if (ud != userData) dataError();
-  fprintf(fout, "HISTORY %s ;\n", h);
-  defrSetCaseSensitivity(1);
-  return 0;
-}
-
-
-int an(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "ARRAY %s ;\n", h);
-  return 0;
-}
-
-
-int fn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "FLOORPLAN %s ;\n", h);
-  return 0;
-}
-
-
-int bbn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "BUSBITCHARS \"%s\" ;\n", h);
-  return 0;
-}
-
-
-int vers(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) 
-      dataError();
-  fprintf(fout, "VERSION %g ;\n", d);  
-  curVer = d;
-
-  fprintf(fout, "ALIAS alias1 aliasValue1 1 ;\n");
-  fprintf(fout, "ALIAS alias2 aliasValue2 0 ;\n");
-
-  return 0;
-}
-
-
-int versStr(defrCallbackType_e c, const char* versionName, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  //fprintf(fout, "VERSION %s ;\n", versionName);
-  fprintf(fout, "VERSION 5.8 ;\n");
-  return 0;
-}
-
-
-int unitsFn(defrCallbackType_e c, double d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "UNITS DISTANCE MICRONS %g ;\n\n", d);
-  return 0;
-}
-
-
-int casesens(defrCallbackType_e c, int d, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  if (d == 1)
-     fprintf(fout, "NAMESCASESENSITIVE ON ;\n", d);
-  else
-     fprintf(fout, "NAMESCASESENSITIVE OFF ;\n", d);
-  return 0;
-}
-
-
-int cls(defrCallbackType_e c, void* cl, defiUserData ud) {
-  defiSite* site;  // Site and Canplace and CannotOccupy
-  defiBox* box;  // DieArea and 
-  defiPinCap* pc;
-  defiPin* pin;
-  int i, j, k;
-  defiRow* row;
-  defiTrack* track;
-  defiGcellGrid* gcg;
-  defiVia* via;
-  defiRegion* re;
-  defiGroup* group;
-  defiComponentMaskShiftLayer* maskShiftLayer = NULL;
-  defiScanchain* sc;
-  defiIOTiming* iot;
-  defiFPC* fpc;
-  defiTimingDisable* td;
-  defiPartition* part;
-  defiPinProp* pprop;
-  defiBlockage* block;
-  defiSlot* slots;
-  defiFill* fills;
-  defiStyles* styles;
-  int xl, yl, xh, yh;
-  char *name, *a1, *b1;
-  char **inst, **inPin, **outPin;
-  int  *bits;
-  int  size;
-  int corner, typ;
-  const char *itemT;
-  char dir;
-  defiPinAntennaModel* aModel;
-  struct defiPoints points;
-
-  checkType(c);
-  if (ud != userData) dataError();
-  switch (c) {
-
-  case defrSiteCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "SITE %s %g %g %s ", site->name(),
-                 site->x_orig(), site->y_orig(),
-                 orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrCanplaceCbkType :
-         site = (defiSite*)cl;
-         fprintf(fout, "CANPLACE %s %g %g %s ", site->name(),
-                 site->x_orig(), site->y_orig(),
-                 orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrCannotOccupyCbkType : 
-         site = (defiSite*)cl;
-         fprintf(fout, "CANNOTOCCUPY %s %g %g %s ",
-                 site->name(), site->x_orig(),
-                 site->y_orig(), orientStr(site->orient()));
-         fprintf(fout, "DO %g BY %g STEP %g %g ;\n",
-                 site->x_num(), site->y_num(),
-                 site->x_step(), site->y_step());
-         break;
-  case defrDieAreaCbkType :
-         box = (defiBox*)cl;
-         fprintf(fout, "DIEAREA ( %d %d ) ( %d %d ) ;\n\n",
-                 box->xl(), box->yl(), box->xh(),
-                 box->yh());
-         /*
-         fprintf(fout, "DIEAREA ");
-         points = box->getPoint();
-         for (i = 0; i < points.numPoints; i++)
-           fprintf(fout, "%d %d ", points.x[i], points.y[i]);
-         fprintf(fout, ";\n");*/
-         break;
-  case defrPinCapCbkType :
-         pc = (defiPinCap*)cl;
-         if (testDebugPrint) {
-             pc->print(fout);
-         } else {
-             fprintf(fout, "MINPINS %d WIRECAP %g ;\n",
-                     pc->pin(), pc->cap());
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END DEFAULTCAP\n");
-         }
-         break;
-  case defrPinCbkType :
-         pin = (defiPin*)cl;
-         if (testDebugPrint) {
-             pin->print(fout);
-         } else {
-             fprintf(fout, "- %s + NET %s ", pin->pinName(),
-                     pin->netName());
-    //         pin->changePinName("pinName");
-    //         fprintf(fout, "%s ", pin->pinName());
-             if (pin->hasDirection())
-                 fprintf(fout, "+ DIRECTION %s ", pin->direction());
-             if (pin->hasUse())
-                 fprintf(fout, "+ USE %s ", pin->use());
-             if (pin->hasNetExpr())
-                 fprintf(fout, "+ NETEXPR \"%s\" ", pin->netExpr());
-             if (pin->hasSupplySensitivity())
-                 fprintf(fout, "+ SUPPLYSENSITIVITY %s ",
-                         pin->supplySensitivity());
-             if (pin->hasGroundSensitivity())
-                 fprintf(fout, "+ GROUNDSENSITIVITY %s ",
-                         pin->groundSensitivity());
-             if (pin->hasLayer()) {
-                 struct defiPoints points;
-                 for (i = 0; i < pin->numLayer(); i++) {
-                    fprintf(fout, "\n  + LAYER %s ", pin->layer(i));
-                    if (pin->layerMask(i)) 
-                        fprintf(fout, "MASK %d ",
-                        pin->layerMask(i));
-                    if (pin->hasLayerSpacing(i))
-                      fprintf(fout, "SPACING %d ",
-                             pin->layerSpacing(i));
-                    if (pin->hasLayerDesignRuleWidth(i))
-                      fprintf(fout, "DESIGNRULEWIDTH %d ",
-                             pin->layerDesignRuleWidth(i));
-                    pin->bounds(i, &xl, &yl, &xh, &yh);
-                    fprintf(fout, "( %d %d ) ( %d %d )", xl, yl, xh, yh);
-                 }
-                 for (i = 0; i < pin->numPolygons(); i++) {
-                    fprintf(fout, "\n  + POLYGON %s ",
-                            pin->polygonName(i));
-                    if (pin->polygonMask(i))
-                      fprintf(fout, "MASK %d ",
-                              pin->polygonMask(i));
-                    if (pin->hasPolygonSpacing(i))
-                      fprintf(fout, "SPACING %d ",
-                             pin->polygonSpacing(i));
-                    if (pin->hasPolygonDesignRuleWidth(i))
-                      fprintf(fout, "DESIGNRULEWIDTH %d ",
-                             pin->polygonDesignRuleWidth(i));
-                    points = pin->getPolygon(i);
-                    for (j = 0; j < points.numPoints; j++)
-                      fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                 }
-                 for (i = 0; i < pin->numVias(); i++) {
-                     if (pin->viaTopMask(i) || pin->viaCutMask(i) || pin->viaBottomMask(i)) {
-                         fprintf(fout, "\n  + VIA %s MASK %d%d%d %d %d ", 
-                             pin->viaName(i),
-                             pin->viaTopMask(i),
-                             pin->viaCutMask(i),
-                             pin->viaBottomMask(i),
-                             pin->viaPtX(i), 
-                             pin->viaPtY(i));
-                     } else {
-                         fprintf(fout, "\n  + VIA %s %d %d ", pin->viaName(i),
-                                 pin->viaPtX(i), pin->viaPtY(i));
-                     }
-                 }
-             }
-             if (pin->hasPort()) {
-                 struct defiPoints points;
-                 defiPinPort* port;
-                 for (j = 0; j < pin->numPorts(); j++) {
-                    port = pin->pinPort(j);
-                    fprintf(fout, "\n  + PORT");
-                    for (i = 0; i < port->numLayer(); i++) {
-                       fprintf(fout, "\n     + LAYER %s ",
-                               port->layer(i));
-                       if (port->layerMask(i))
-                           fprintf(fout, "MASK %d ",
-                                   port->layerMask(i));
-                       if (port->hasLayerSpacing(i))
-                         fprintf(fout, "SPACING %d ",
-                                 port->layerSpacing(i));
-                       if (port->hasLayerDesignRuleWidth(i))
-                         fprintf(fout, "DESIGNRULEWIDTH %d ",
-                                 port->layerDesignRuleWidth(i));
-                       port->bounds(i, &xl, &yl, &xh, &yh);
-                       fprintf(fout, "%d %d %d %d ", xl, yl, xh, yh);
-                    }
-                    for (i = 0; i < port->numPolygons(); i++) {
-                       fprintf(fout, "\n     + POLYGON %s ",
-                               port->polygonName(i));
-                       if (port->polygonMask(i))
-                         fprintf(fout, "MASK %d ",
-                                 port->polygonMask(i));
-                       if (port->hasPolygonSpacing(i))
-                         fprintf(fout, "SPACING %d ",
-                                port->polygonSpacing(i));
-                       if (port->hasPolygonDesignRuleWidth(i))
-                         fprintf(fout, "DESIGNRULEWIDTH %d ",
-                                port->polygonDesignRuleWidth(i));
-                       points = port->getPolygon(i);
-                       for (k = 0; k < points.numPoints; k++)
-                         fprintf(fout, "( %d %d ) ", points.x[k], points.y[k]);
-                    }
-                    for (i = 0; i < port->numVias(); i++) {
-                        if (port->viaTopMask(i) || port->viaCutMask(i) 
-                            || port->viaBottomMask(i)) {
-                            fprintf(fout, "\n     + VIA %s MASK %d%d%d ( %d %d ) ",
-                                port->viaName(i),
-                                port->viaTopMask(i),
-                                port->viaCutMask(i),
-                                port->viaBottomMask(i),
-                                port->viaPtX(i),
-                                port->viaPtY(i));
-                        } else {
-                            fprintf(fout, "\n     + VIA %s ( %d %d ) ",
-                               port->viaName(i),
-                               port->viaPtX(i),
-                               port->viaPtY(i));
-                        }
-                    }
-                    if (port->hasPlacement()) {
-                       if (port->isPlaced()) {
-                          fprintf(fout, "\n     + PLACED ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                       if (port->isCover()) {
-                          fprintf(fout, "\n     + COVER ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                       if (port->isFixed()) {
-                          fprintf(fout, "\n     + FIXED ");
-                          fprintf(fout, "( %d %d ) %s ",
-                             port->placementX(),
-                             port->placementY(),
-                             orientStr(port->orient()));
-                       }
-                    }
-                }
-             }
-             if (pin->hasPlacement()) {
-                 if (pin->isPlaced()) {
-                     fprintf(fout, "\n  + PLACED ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                }
-                 if (pin->isCover()) {
-                     fprintf(fout, "\n  + COVER ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                 }
-                 if (pin->isFixed()) {
-                     fprintf(fout, "\n  + FIXED ");
-                     fprintf(fout, "( %d %d ) %s ", pin->placementX(),
-                         pin->placementY(), 
-                         orientStr(pin->orient()));
-                 }
-                 if (pin->isUnplaced())
-                     fprintf(fout, "\n  + UNPLACED ");
-             }
-             if (pin->hasSpecial()) {
-                 fprintf(fout, "+ SPECIAL ");
-             }
-             if (pin->hasAPinPartialMetalArea()) {
-                 for (i = 0; i < pin->numAPinPartialMetalArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALMETALAREA %d",
-                            pin->APinPartialMetalArea(i));
-                    if (*(pin->APinPartialMetalAreaLayer(i)))
-                        fprintf(fout, " LAYER %s",
-                                pin->APinPartialMetalAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinPartialMetalSideArea()) {
-                 for (i = 0; i < pin->numAPinPartialMetalSideArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALMETALSIDEAREA %d",
-                            pin->APinPartialMetalSideArea(i));
-                    if (*(pin->APinPartialMetalSideAreaLayer(i)))
-                        fprintf(fout, " LAYER %s",
-                            pin->APinPartialMetalSideAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinDiffArea()) {
-                 for (i = 0; i < pin->numAPinDiffArea(); i++) {
-                    fprintf(fout, "ANTENNAPINDIFFAREA %d", pin->APinDiffArea(i));
-                    if (*(pin->APinDiffAreaLayer(i)))
-                        fprintf(fout, " LAYER %s", pin->APinDiffAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-             if (pin->hasAPinPartialCutArea()) {
-                 for (i = 0; i < pin->numAPinPartialCutArea(); i++) {
-                    fprintf(fout, "ANTENNAPINPARTIALCUTAREA %d",
-                            pin->APinPartialCutArea(i));
-                    if (*(pin->APinPartialCutAreaLayer(i)))
-                        fprintf(fout, " LAYER %s", pin->APinPartialCutAreaLayer(i));
-                    fprintf(fout, "\n");
-                 }
-             }
-
-             for (j = 0; j < pin->numAntennaModel(); j++) {
-                aModel = pin->antennaModel(j);
- 
-                fprintf(fout, "ANTENNAMODEL %s\n",
-                        aModel->antennaOxide()); 
- 
-                if (aModel->hasAPinGateArea()) {
-                    for (i = 0; i < aModel->numAPinGateArea();
-                       i++) {
-                       fprintf(fout, "ANTENNAPINGATEAREA %d",
-                               aModel->APinGateArea(i));
-                       if (aModel->hasAPinGateAreaLayer(i))
-                           fprintf(fout, " LAYER %s", aModel->APinGateAreaLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxAreaCar()) {
-                    for (i = 0;
-                       i < aModel->numAPinMaxAreaCar(); i++) {
-                       fprintf(fout, "ANTENNAPINMAXAREACAR %d",
-                               aModel->APinMaxAreaCar(i));
-                       if (aModel->hasAPinMaxAreaCarLayer(i))
-                           fprintf(fout,
-                               " LAYER %s", aModel->APinMaxAreaCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxSideAreaCar()) {
-                    for (i = 0;
-                         i < aModel->numAPinMaxSideAreaCar(); 
-                         i++) {
-                       fprintf(fout, "ANTENNAPINMAXSIDEAREACAR %d",
-                               aModel->APinMaxSideAreaCar(i));
-                       if (aModel->hasAPinMaxSideAreaCarLayer(i))
-                           fprintf(fout,
-                               " LAYER %s", aModel->APinMaxSideAreaCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-                if (aModel->hasAPinMaxCutCar()) {
-                    for (i = 0; i < aModel->numAPinMaxCutCar();
-                       i++) {
-                       fprintf(fout, "ANTENNAPINMAXCUTCAR %d",
-                           aModel->APinMaxCutCar(i));
-                       if (aModel->hasAPinMaxCutCarLayer(i))
-                           fprintf(fout, " LAYER %s",
-                           aModel->APinMaxCutCarLayer(i));
-                       fprintf(fout, "\n");
-                    }
-                }
-             }
-             fprintf(fout, ";\n");
-             --numObjs;
-             //if (numObjs <= 0)
-             //    fprintf(fout, "END PINS\n");
-         }
-         break;
-  case defrDefaultCapCbkType :
-         i = (long)cl;
-         fprintf(fout, "DEFAULTCAP %d\n", i);
-         numObjs = i;
-         break;
-  case defrRowCbkType :
-         row = (defiRow*)cl;
-         fprintf(fout, "ROW %s %s %.0f %.0f %s ", ignoreRowNames ? "XXX" : row->name(),
-                 row->macro(), row->x(), row->y(),
-                 orientStr(row->orient()));
-         if (row->hasDo()) {
-             fprintf(fout, "DO %g BY %g ",
-                     row->xNum(), row->yNum());
-             if (row->hasDoStep())
-                 fprintf(fout, "STEP %g %g\n ;\n",
-                         row->xStep(), row->yStep());
-             else
-                 fprintf(fout, "\n ;\n");
-         } else
-            fprintf(fout, "\n ;\n");
-         if (row->numProps() > 0) {
-            for (i = 0; i < row->numProps(); i++) {
-                fprintf(fout, "  + PROPERTY %s %s ",
-                        row->propName(i),
-                        row->propValue(i));
-                // BX 180910 DEF read issue (turned out not here)
-                switch (row->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-            fprintf(fout, "\n ;\n");
-         }
-         break;
-  case defrTrackCbkType :
-         track = (defiTrack*)cl;
-   if (track->firstTrackMask()) {
-      if (track->sameMask()) {
-    fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d SAMEMASK LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-           track->firstTrackMask());
-      } else {
-    fprintf(fout, "TRACKS %s %g DO %g STEP %g MASK %d LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep(),
-           track->firstTrackMask());
-      }
-   } else {
-      fprintf(fout, "TRACKS %s %g DO %g STEP %g LAYER ",
-                 track->macro(), track->x(),
-                 track->xNum(), track->xStep());
-   }
-         for (i = 0; i < track->numLayers(); i++)
-            fprintf(fout, "%s ", track->layer(i));
-         fprintf(fout, ";\n"); 
-         break;
-  case defrGcellGridCbkType :
-         gcg = (defiGcellGrid*)cl;
-         fprintf(fout, "GCELLGRID %s %d DO %d STEP %g ;\n",
-                 gcg->macro(), gcg->x(),
-                 gcg->xNum(), gcg->xStep());
-         break;
-  case defrViaCbkType :
-         via = (defiVia*)cl;
-         if (testDebugPrint) {
-             via->print(fout);
-         } else {
-             fprintf(fout, "- %s \n", via->name());
-             if (via->hasPattern())
-                 fprintf(fout, "+ PATTERNNAME %s ", via->pattern());
-             for (i = 0; i < via->numLayers(); i++) {
-                 via->layer(i, &name, &xl, &yl, &xh, &yh);
-                 int rectMask = via->rectMask(i);
-
-                 if (rectMask) {
-                     fprintf(fout, "+ RECT %s + MASK %d ( %d %d ) ( %d %d ) \n",
-                             name, rectMask, xl, yl, xh, yh);
-                 } else {
-                     fprintf(fout, "+ RECT %s ( %d %d ) ( %d %d ) \n",
-                             name, xl, yl, xh, yh);
-                 }
-             }
-             // POLYGON
-             if (via->numPolygons()) {
-                 struct defiPoints points;
-                 for (i = 0; i < via->numPolygons(); i++) {
-                     int polyMask = via->polyMask(i);
-
-                     if (polyMask) {
-                         fprintf(fout, "\n  + POLYGON %s + MASK %d ", 
-                                 via->polygonName(i), polyMask);
-                     } else {
-                         fprintf(fout, "\n  + POLYGON %s ", via->polygonName(i));
-                     }
-                     points = via->getPolygon(i);
-                     for (j = 0; j < points.numPoints; j++)
-                         fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                 }
-             }
-             fprintf(fout, " \n");
-             if (via->hasViaRule()) {
-                 char *vrn, *bl, *cl, *tl;
-                 int xs, ys, xcs, ycs, xbe, ybe, xte, yte;
-                 int cr, cc, xo, yo, xbo, ybo, xto, yto;
-                 (void)via->viaRule(&vrn, &xs, &ys, &bl, &cl, &tl, &xcs,
-                                             &ycs, &xbe, &ybe, &xte, &yte);
-                 fprintf(fout, "+ VIARULE %s\n", ignoreViaNames ? "XXX" : vrn);
-                 fprintf(fout, "  + CUTSIZE %d %d\n", xs, ys);
-                 fprintf(fout, "  + LAYERS %s %s %s\n", bl, cl, tl);
-                 fprintf(fout, "  + CUTSPACING %d %d\n", xcs, ycs);
-                 fprintf(fout, "  + ENCLOSURE %d %d %d %d\n", xbe, ybe, xte, yte);
-                 if (via->hasRowCol()) {
-                    (void)via->rowCol(&cr, &cc);
-                    fprintf(fout, "  + ROWCOL %d %d\n", cr, cc);
-                 }
-                 if (via->hasOrigin()) {
-                    (void)via->origin(&xo, &yo);
-                    fprintf(fout, "  + ORIGIN %d %d\n", xo, yo);
-                 }
-                 if (via->hasOffset()) {
-                    (void)via->offset(&xbo, &ybo, &xto, &yto);
-                    fprintf(fout, "  + OFFSET %d %d %d %d\n", xbo, ybo, xto, yto);
-                 }
-                 if (via->hasCutPattern())
-                    fprintf(fout, "  + PATTERN '%s'\n", via->cutPattern());
-             }
-             fprintf(fout, " ;\n");
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END VIAS\n");
-         }
-         break;
-  case defrRegionCbkType :
-         re = (defiRegion*)cl;
-         fprintf(fout, "- %s ", re->name());
-         for (i = 0; i < re->numRectangles(); i++)
-             fprintf(fout, "%d %d %d %d \n", re->xl(i),
-                     re->yl(i), re->xh(i),
-                     re->yh(i));
-         if (re->hasType())
-             fprintf(fout, "+ TYPE %s\n", re->type());
-         if (re->numProps()) {
-             for (i = 0; i < re->numProps(); i++) {
-                 fprintf(fout, "+ PROPERTY %s %s ", re->propName(i),
-                         re->propValue(i));
-                  // BX 180910 DEF read issue (not here)
-                  switch (re->propType(i)) {
-                    case 'R': fprintf(fout, "REAL ");
-                              break;
-                    case 'I': fprintf(fout, "INTEGER ");
-                              break;
-                    case 'S': fprintf(fout, "STRING ");
-                              break;
-                    case 'Q': fprintf(fout, "QUOTESTRING ");
-                              break;
-                    case 'N': fprintf(fout, "NUMBER ");
-                              break;
-                 }
-             }
-         }
-         fprintf(fout, ";\n"); 
-         --numObjs;
-         if (numObjs <= 0) {
-             fprintf(fout, "END REGIONS\n");
-         }
-         break;
-  case defrGroupNameCbkType :
-         if ((char*)cl) {
-             fprintf(fout, "- %s", (char*)cl);
-         }
-         break;
-  case defrGroupMemberCbkType :
-         if ((char*)cl) {
-             fprintf(fout, " %s", (char*)cl);
-         }
-         break;
-  case defrComponentMaskShiftLayerCbkType :
-   fprintf(fout, "COMPONENTMASKSHIFT ");
-        
-        for (i = 0; i < maskShiftLayer->numMaskShiftLayers(); i++) {
-           fprintf(fout, "%s ", maskShiftLayer->maskShiftLayer(i));
-        } 
-        fprintf(fout, ";\n");
-   break;
-  case defrGroupCbkType :
-         group = (defiGroup*)cl;
-         if (group->hasMaxX() | group->hasMaxY()
-             | group->hasPerim()) {
-             fprintf(fout, "\n  + SOFT ");
-             if (group->hasPerim()) 
-                 fprintf(fout, "MAXHALFPERIMETER %d ",
-                         group->perim());
-             if (group->hasMaxX())
-                 fprintf(fout, "MAXX %d ", group->maxX());
-             if (group->hasMaxY()) 
-                 fprintf(fout, "MAXY %d ", group->maxY());
-         } 
-         if (group->hasRegionName())
-             fprintf(fout, "\n  + REGION %s ", group->regionName());
-         if (group->hasRegionBox()) {
-             int *gxl, *gyl, *gxh, *gyh;
-             int size;
-             group->regionRects(&size, &gxl, &gyl, &gxh, &gyh);
-             for (i = 0; i < size; i++)
-                 fprintf(fout, "REGION %d %d %d %d ", gxl[i], gyl[i],
-                         gxh[i], gyh[i]);
-         }
-         if (group->numProps()) {
-             for (i = 0; i < group->numProps(); i++) {
-                 fprintf(fout, "\n  + PROPERTY %s %s ",
-                         group->propName(i),
-                         group->propValue(i));
-                 switch (group->propType(i)) {
-                    case 'R': fprintf(fout, "REAL ");
-                              break;
-                    case 'I': fprintf(fout, "INTEGER ");
-                              break;
-                    case 'S': fprintf(fout, "STRING ");
-                              break;
-                    case 'Q': fprintf(fout, "QUOTESTRING ");
-                              break;
-                    case 'N': fprintf(fout, "NUMBER ");
-                              break;
-                 }
-             }
-         }
-         fprintf(fout, " ;\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END GROUPS\n");
-         break;
-  case defrScanchainCbkType :
-         sc = (defiScanchain*)cl;
-         fprintf(fout, "- %s\n", sc->name());
-         if (sc->hasStart()) {
-             sc->start(&a1, &b1);
-             fprintf(fout, "  + START %s %s\n", a1, b1);
-         }
-         if (sc->hasStop()) {
-             sc->stop(&a1, &b1);
-             fprintf(fout, "  + STOP %s %s\n", a1, b1);
-         }
-         if (sc->hasCommonInPin() ||
-             sc->hasCommonOutPin()) {
-             fprintf(fout, "  + COMMONSCANPINS ");
-             if (sc->hasCommonInPin())
-                fprintf(fout, " ( IN %s ) ", sc->commonInPin());
-             if (sc->hasCommonOutPin())
-                fprintf(fout, " ( OUT %s ) ",sc->commonOutPin());
-             fprintf(fout, "\n");
-         }
-         if (sc->hasFloating()) {
-            sc->floating(&size, &inst, &inPin, &outPin, &bits);
-            if (size > 0)
-                fprintf(fout, "  + FLOATING\n");
-            for (i = 0; i < size; i++) {
-                fprintf(fout, "    %s ", inst[i]);
-                if (inPin[i])
-                   fprintf(fout, "( IN %s ) ", inPin[i]);
-                if (outPin[i])
-                   fprintf(fout, "( OUT %s ) ", outPin[i]);
-                if (bits[i] != -1)
-                   fprintf(fout, "( BITS %d ) ", bits[i]);
-                fprintf(fout, "\n");
-            }
-         }
-
-         if (sc->hasOrdered()) {
-            for (i = 0; i < sc->numOrderedLists(); i++) {
-                sc->ordered(i, &size, &inst, &inPin, &outPin,
-                                           &bits);
-                if (size > 0)
-                    fprintf(fout, "  + ORDERED\n");
-                for (j = 0; j < size; j++) {
-                    fprintf(fout, "    %s ", inst[j]); 
-                    if (inPin[j])
-                       fprintf(fout, "( IN %s ) ", inPin[j]);
-                    if (outPin[j])
-                       fprintf(fout, "( OUT %s ) ", outPin[j]);
-                    if (bits[j] != -1)
-                       fprintf(fout, "( BITS %d ) ", bits[j]);
-                    fprintf(fout, "\n");
-                }
-            }
-         }
-
-         if (sc->hasPartition()) {
-            fprintf(fout, "  + PARTITION %s ",
-                    sc->partitionName());
-            if (sc->hasPartitionMaxBits())
-              fprintf(fout, "MAXBITS %d ",
-                      sc->partitionMaxBits());
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END SCANCHAINS\n");
-         break;
-  case defrIOTimingCbkType :
-         iot = (defiIOTiming*)cl;
-         fprintf(fout, "- ( %s %s )\n", iot->inst(),
-                 iot->pin());
-         if (iot->hasSlewRise())
-             fprintf(fout, "  + RISE SLEWRATE %g %g\n",
-                     iot->slewRiseMin(),
-                     iot->slewRiseMax());
-         if (iot->hasSlewFall())
-             fprintf(fout, "  + FALL SLEWRATE %g %g\n",
-                     iot->slewFallMin(),
-                     iot->slewFallMax());
-         if (iot->hasVariableRise())
-             fprintf(fout, "  + RISE VARIABLE %g %g\n",
-                     iot->variableRiseMin(),
-                     iot->variableRiseMax());
-         if (iot->hasVariableFall())
-             fprintf(fout, "  + FALL VARIABLE %g %g\n",
-                     iot->variableFallMin(),
-                     iot->variableFallMax());
-         if (iot->hasCapacitance())
-             fprintf(fout, "  + CAPACITANCE %g\n",
-                     iot->capacitance());
-         if (iot->hasDriveCell()) {
-             fprintf(fout, "  + DRIVECELL %s ",
-                     iot->driveCell());
-             if (iot->hasFrom())
-                 fprintf(fout, "  FROMPIN %s ",
-                         iot->from());
-             if (iot->hasTo())
-                 fprintf(fout, "  TOPIN %s ",
-                         iot->to());
-             if (iot->hasParallel())
-                 fprintf(fout, "PARALLEL %g",
-                         iot->parallel());
-             fprintf(fout, "\n");
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END IOTIMINGS\n");
-         break;
-  case defrFPCCbkType :
-         fpc = (defiFPC*)cl;
-         fprintf(fout, "- %s ", fpc->name());
-         if (fpc->isVertical())
-             fprintf(fout, "VERTICAL ");
-         if (fpc->isHorizontal())
-             fprintf(fout, "HORIZONTAL ");
-         if (fpc->hasAlign())
-             fprintf(fout, "ALIGN ");
-         if (fpc->hasMax())
-             fprintf(fout, "%g ", fpc->alignMax());
-         if (fpc->hasMin())
-             fprintf(fout, "%g ", fpc->alignMin());
-         if (fpc->hasEqual())
-             fprintf(fout, "%g ", fpc->equal());
-         for (i = 0; i < fpc->numParts(); i++) {
-             fpc->getPart(i, &corner, &typ, &name);
-             if (corner == 'B')
-                 fprintf(fout, "BOTTOMLEFT ");
-             else
-                 fprintf(fout, "TOPRIGHT ");
-             if (typ == 'R')
-                 fprintf(fout, "ROWS %s ", name);
-             else
-                 fprintf(fout, "COMPS %s ", name);
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END FLOORPLANCONSTRAINTS\n");
-         break;
-  case defrTimingDisableCbkType :
-         td = (defiTimingDisable*)cl;
-         if (td->hasFromTo())
-             fprintf(fout, "- FROMPIN %s %s ",
-                     td->fromInst(),
-                     td->fromPin(),
-                     td->toInst(),
-                     td->toPin());
-         if (td->hasThru())
-             fprintf(fout, "- THRUPIN %s %s ",
-                     td->thruInst(),
-                     td->thruPin());
-         if (td->hasMacroFromTo())
-             fprintf(fout, "- MACRO %s FROMPIN %s %s ",
-                     td->macroName(),
-                     td->fromPin(),
-                     td->toPin());
-         if (td->hasMacroThru())
-             fprintf(fout, "- MACRO %s THRUPIN %s %s ",
-                     td->macroName(),
-                     td->fromPin());
-         fprintf(fout, ";\n");
-         break;
-  case defrPartitionCbkType :
-         part = (defiPartition*)cl;
-         fprintf(fout, "- %s ", part->name());
-         if (part->isSetupRise() |
-             part->isSetupFall() |
-             part->isHoldRise() |
-             part->isHoldFall()) {
-             // has turnoff 
-             fprintf(fout, "TURNOFF "); 
-             if (part->isSetupRise())
-                 fprintf(fout, "SETUPRISE "); 
-             if (part->isSetupFall())
-                 fprintf(fout, "SETUPFALL "); 
-             if (part->isHoldRise())
-                 fprintf(fout, "HOLDRISE "); 
-             if (part->isHoldFall())
-                 fprintf(fout, "HOLDFALL "); 
-         }
-         itemT = part->itemType();
-         dir = part->direction();
-         if (strcmp(itemT, "CLOCK") == 0) {
-             if (dir == 'T')    // toclockpin
-                 fprintf(fout, "+ TOCLOCKPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromclockpin
-                 fprintf(fout, "+ FROMCLOCKPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (part->hasMin())
-                 fprintf(fout, "MIN %g %g ",
-                         part->partitionMin(),
-                         part->partitionMax());
-             if (part->hasMax())
-                 fprintf(fout, "MAX %g %g ",
-                         part->partitionMin(),
-                         part->partitionMax());
-             fprintf(fout, "PINS ");
-             for (i = 0; i < part->numPins(); i++)
-                  fprintf(fout, "%s ", part->pin(i));
-         } else if (strcmp(itemT, "IO") == 0) {
-             if (dir == 'T')    // toiopin
-                 fprintf(fout, "+ TOIOPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromiopin
-                 fprintf(fout, "+ FROMIOPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-         } else if (strcmp(itemT, "COMP") == 0) {
-             if (dir == 'T')    // tocomppin
-                 fprintf(fout, "+ TOCOMPPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-             if (dir == 'F')    // fromcomppin
-                 fprintf(fout, "+ FROMCOMPPIN %s %s ",
-                         part->instName(),
-                         part->pinName());
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END PARTITIONS\n");
-         break;
-
-  case defrPinPropCbkType :
-         pprop = (defiPinProp*)cl;
-         if (pprop->isPin())
-            fprintf(fout, "- PIN %s ", pprop->pinName());
-         else 
-            fprintf(fout, "- %s %s ",
-                    pprop->instName(),
-                    pprop->pinName());
-         fprintf(fout, ";\n");
-         if (pprop->numProps() > 0) {
-            for (i = 0; i < pprop->numProps(); i++) {
-                fprintf(fout, "  + PROPERTY %s %s ",
-                        pprop->propName(i),
-                        pprop->propValue(i));
-                // BX 180910 DEF read issue (not this..)
-                switch (pprop->propType(i)) {
-                   case 'R': fprintf(fout, "REAL ");
-                             break;
-                   case 'I': fprintf(fout, "INTEGER ");
-                             break;
-                   case 'S': fprintf(fout, "STRING ");
-                             break;
-                   case 'Q': fprintf(fout, "QUOTESTRING ");
-                             break;
-                   case 'N': fprintf(fout, "NUMBER ");
-                             break;
-                }
-            }
-            fprintf(fout, ";\n");
-         }
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END PINPROPERTIES\n");
-         break;
-  case defrBlockageCbkType :
-         block = (defiBlockage*)cl;
-         if (testDebugPrint) {
-             block->print(fout);
-         } else {
-             if (block->hasLayer()) {
-                fprintf(fout, "- LAYER %s\n", block->layerName());
-                if (block->hasComponent())
-                   fprintf(fout, "   + COMPONENT %s\n",
-                           block->layerComponentName());
-                if (block->hasSlots())
-                   fprintf(fout, "   + SLOTS\n");
-                if (block->hasFills())
-                   fprintf(fout, "   + FILLS\n");
-                if (block->hasPushdown())
-                   fprintf(fout, "   + PUSHDOWN\n");
-                if (block->hasExceptpgnet())
-                   fprintf(fout, "   + EXCEPTPGNET\n");
-                if (block->hasMask())
-                   fprintf(fout, "   + MASK %d\n", block->mask());
-                if (block->hasSpacing())
-                   fprintf(fout, "   + SPACING %d\n",
-                           block->minSpacing());
-                if (block->hasDesignRuleWidth())
-                   fprintf(fout, "   + DESIGNRULEWIDTH %d\n",
-                           block->designRuleWidth());
-             }
-             else if (block->hasPlacement()) {
-                fprintf(fout, "- PLACEMENT\n");
-                if (block->hasSoft())
-                   fprintf(fout, "   + SOFT\n");
-                if (block->hasPartial())
-                   fprintf(fout, "   + PARTIAL %g\n",
-                           block->placementMaxDensity());
-                if (block->hasComponent())
-                   fprintf(fout, "   + COMPONENT %s\n",
-                           block->placementComponentName());
-                if (block->hasPushdown())
-                   fprintf(fout, "   + PUSHDOWN\n");
-             }
-
-             for (i = 0; i < block->numRectangles(); i++) {
-                fprintf(fout, "   RECT %d %d %d %d\n", 
-                        block->xl(i), block->yl(i),
-                        block->xh(i), block->yh(i));
-             } 
-
-             for (i = 0; i < block->numPolygons(); i++) {
-                fprintf(fout, "   POLYGON ");
-                points = block->getPolygon(i);
-                for (j = 0; j < points.numPoints; j++)
-                   fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                fprintf(fout, "\n");
-             }
-             fprintf(fout, ";\n");
-             --numObjs;
-             if (numObjs <= 0)
-                 fprintf(fout, "END BLOCKAGES\n");
-         }
-         break;
-  case defrSlotCbkType :
-         slots = (defiSlot*)cl;
-         if (slots->hasLayer())
-            fprintf(fout, "- LAYER %s\n", slots->layerName());
-
-         for (i = 0; i < slots->numRectangles(); i++) {
-            fprintf(fout, "   RECT %d %d %d %d\n", 
-                    slots->xl(i), slots->yl(i),
-                    slots->xh(i), slots->yh(i));
-         } 
-         for (i = 0; i < slots->numPolygons(); i++) {
-            fprintf(fout, "   POLYGON ");
-            points = slots->getPolygon(i);
-            for (j = 0; j < points.numPoints; j++)
-              fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-            fprintf(fout, ";\n");
-         }
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END SLOTS\n");
-         break;
-  case defrFillCbkType :
-         fills = (defiFill*)cl;
-         if (testDebugPrint) {
-              fills->print(fout);
-         } else {
-             if (fills->hasLayer()) {
-                fprintf(fout, "- LAYER %s", fills->layerName());
-                if (fills->layerMask()) {
-                    fprintf(fout, " + MASK %d", fills->layerMask());
-                }
-                if (fills->hasLayerOpc())
-                   fprintf(fout, " + OPC");
-                fprintf(fout, "\n");
-
-                for (i = 0; i < fills->numRectangles(); i++) {
-                   fprintf(fout, "   RECT %d %d %d %d\n", 
-                           fills->xl(i), fills->yl(i),
-                           fills->xh(i), fills->yh(i));
-                } 
-                for (i = 0; i < fills->numPolygons(); i++) {
-                   fprintf(fout, "   POLYGON "); 
-                   points = fills->getPolygon(i);
-                   for (j = 0; j < points.numPoints; j++)
-                     fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-                   fprintf(fout, ";\n");
-                } 
-                fprintf(fout, ";\n");
-             }
-             --numObjs;
-             if (fills->hasVia()) {
-                fprintf(fout, "- VIA %s", fills->viaName());
-                if (fills->viaTopMask() || fills->viaCutMask()
-                    || fills->viaBottomMask()) {
-                    fprintf(fout, " + MASK %d%d%d", 
-                    fills->viaTopMask(),
-                           fills->viaCutMask(),
-                           fills->viaBottomMask());
-                }
-                if (fills->hasViaOpc())
-                   fprintf(fout, " + OPC");
-                fprintf(fout, "\n");
-
-                for (i = 0; i < fills->numViaPts(); i++) {
-                   points = fills->getViaPts(i);
-                   for (j = 0; j < points.numPoints; j++)
-                      fprintf(fout, " %d %d", points.x[j], points.y[j]);
-                   fprintf(fout, ";\n"); 
-                }
-                fprintf(fout, ";\n");
-             }
-             if (numObjs <= 0)
-                 fprintf(fout, "END FILLS\n");
-         }
-         break;
-  case defrStylesCbkType :
-         struct defiPoints points;
-         styles = (defiStyles*)cl;
-         fprintf(fout, "- STYLE %d ", styles->style());
-         points = styles->getPolygon();
-         for (j = 0; j < points.numPoints; j++)
-            fprintf(fout, "%d %d ", points.x[j], points.y[j]);
-         fprintf(fout, ";\n");
-         --numObjs;
-         if (numObjs <= 0)
-             fprintf(fout, "END STYLES\n");
-         break;
-
-  default: fprintf(fout, "BOGUS callback to cls.\n"); return 1;
-  }
-  return 0;
-}
-
-
-int dn(defrCallbackType_e c, const char* h, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "DIVIDERCHAR \"%s\" ;\n",h);
-  return 0;
-}
-
-
-int ext(defrCallbackType_e t, const char* c, defiUserData ud) {
-  char* name;
-
-  checkType(t);
-  if (ud != userData) dataError();
-
-  switch (t) {
-  case defrNetExtCbkType : name = address("net"); break;
-  case defrComponentExtCbkType : name = address("component"); break;
-  case defrPinExtCbkType : name = address("pin"); break;
-  case defrViaExtCbkType : name = address("via"); break;
-  case defrNetConnectionExtCbkType : name = address("net connection"); break;
-  case defrGroupExtCbkType : name = address("group"); break;
-  case defrScanChainExtCbkType : name = address("scanchain"); break;
-  case defrIoTimingsExtCbkType : name = address("io timing"); break;
-  case defrPartitionsExtCbkType : name = address("partition"); break;
-  default: name = address("BOGUS"); return 1;
-  }
-  fprintf(fout, "  %s extension %s\n", name, c);
-  return 0;
-}
-
-int extension(defrCallbackType_e c, const char* extsn, defiUserData ud) {
-  checkType(c);
-  if (ud != userData) dataError();
-  fprintf(fout, "BEGINEXT %s\n", extsn);
-  return 0;
-}
-
-void* mallocCB(size_t size) {
-  return malloc(size);
-}
-
-void* reallocCB(void* name, size_t size) {
-  return realloc(name, size);
-}
-
-void freeCB(void* name) {
-  free(name);
-  return;
-}
-
-
-BEGIN_LEFDEF_PARSER_NAMESPACE
-extern long long nlines;
-END_LEFDEF_PARSER_NAMESPACE
-static int ccr1131444 = 0;
-
-void lineNumberCB(long long lineNo) {
-
-    // The CCR 1131444 tests ability of the DEF parser to count 
-    // input line numbers out of 32-bit int range. On the first callback 
-    // call 10G lines will be added to line counter. It should be 
-    // reflected in output.
-    if (ccr1131444) {
-        lineNo += 10000000000LL;
-        defrSetNLines(lineNo);
-        ccr1131444 = 0;
-    }
-
-#ifdef _WIN32
-  // fprintf(fout, "Parsed %I64d number of lines!!\n", lineNo);
-#else 
-  // fprintf(fout, "Parsed %lld number of lines!!\n", lineNo);
-#endif
-}
-
-int unUsedCB(defrCallbackType_e, void*, defiUserData) {
-  fprintf(fout, "This callback is not used.\n");
-  return 0;
-}
-
-void printWarning(const char *str)
-{
-    fprintf(stderr, "%s\n", str);
-}
-
-int io::Writer::writeDef(bool isTA, const std::string &str) {
-  //int num = 99;
-  char* inFile[6];
-  //char* outFile;
-  FILE* f;
-  int res;
-  int noCalls = 0;
-//  long start_mem;
-  //int retStr = 0;
-  int numInFile = 0;
-  int fileCt = 0;
-  int test1 = 0;
-  int test2 = 0;
-  int noNetCb = 0;
-  int ccr749853 = 0;
-  int line_num_print_interval = 50;
-
-#ifdef WIN32
-    // Enable two-digit exponent format
-    _set_output_format(_TWO_DIGIT_EXPONENT);
-#endif
-
-//  start_mem = (long)sbrk(0);
-
-  // inFile[0] = defaultName;
-  char *cstr = new char[DEF_FILE.length() + 1];
-  strcpy(cstr, DEF_FILE.c_str());
-  inFile[numInFile++] = cstr;
-  // std::cout << inFile[0] << std::endl;
-  //outFile = defaultOut;
-  // fout = stdout;
-  if (isTA) {
-    fout = fopen(OUTTA_FILE.c_str(), "w");
-  } else {
-    fout = fopen((OUT_FILE+str).c_str(), "w");
-  }
-  userData = this;
-
-  // while (argc--) {
-  //   if (strcmp(*argv, "-d") == 0) {
-  //     argv++;
-  //     argc--;
-  //     sscanf(*argv, "%d", &num);
-  //     defiSetDebug(num, 1);
-  //   } else if (strcmp(*argv, "-nc") == 0) {
-  //     noCalls = 1;
-  //   } else if (strcmp(*argv, "-o") == 0) {
-  //     argv++;
-  //     argc--;
-  //     outFile = *argv;
-  //     if ((fout = fopen(outFile, "w")) == 0) {
-  //         fprintf(stderr, "ERROR: could not open output file\n");
-  //         return 2;
-  //       }
-  //   } else if (strcmp(*argv, "-verStr") == 0) {
-  //       /* New to set the version callback routine to return a string    */
-  //       /* instead of double.                                            */
-  //       retStr = 1;
-  //   } else if (strcmp(*argv, "-i") == 0) {
-  //       argv++;
-  //       argc--;
-  //       line_num_print_interval = atoi(*argv);
-  //   } else if (strcmp(*argv, "-test1") == 0) {
-  //     test1 = 1;
-  //   } else if (strcmp(*argv, "-test2") == 0) {
-  //     test2 = 1;
-  //   } else if (strcmp(*argv, "-noNet") == 0) {
-  //     noNetCb = 1;
-  //   } else if (strcmp(*argv, "-ccr749853") == 0) {
-  //     ccr749853 = 1;
-  //   } else if (strcmp(*argv, "-ccr1131444") == 0) {
-  //       ccr1131444 = 1;
-  //   } else if (strcmp(*argv, "-testDebugPrint") == 0) {
-  //       testDebugPrint = 1;
-  //   } else if (strcmp(*argv, "-sessionless") == 0) {
-  //       isSessionless = 1;
-  //   } else if (strcmp(*argv, "-ignoreRowNames") == 0) {
-  //       ignoreRowNames = 1;
-  //   } else if (strcmp(*argv, "-ignoreViaNames") == 0) {
-  //         ignoreViaNames = 1;
-  //   } else if (argv[0][0] != '-') {
-  //     if (numInFile >= 6) {
-  //       fprintf(stderr, "ERROR: too many input files, max = 6.\n");
-  //       return 2;
-  //     }
-  //     inFile[numInFile++] = *argv;
-  //   } else if ((strcmp(*argv, "-h") == 0) || (strcmp(*argv, "--help") == 0)) {
-  //     fprintf(stderr, "Usage: defrw (<option>|<file>)* \n");
-  //     fprintf(stderr, "Files:\n");
-  //     fprintf(stderr, "\tupto 6 DEF files many be supplied.\n");
-  //     fprintf(stderr, "\tif <defFileName> is set to 'STDIN' - takes data from stdin.\n");
-  //     fprintf(stderr, "Options:\n");
-  //     fprintf(stderr, "\t-i <num_lines> -- sets processing msg interval (default: 50 lines).\n");
-  //     fprintf(stderr, "\t-nc            -- no functional callbacks will be called.\n");
-  //     fprintf(stderr, "\t-o <out_file>  -- write output to the file.\n");
-  //     fprintf(stderr, "\t-ignoreRowNames   -- don't output row names.\n");
-  //     fprintf(stderr, "\t-ignoreViaNames   -- don't output via names.\n");
-  //     return 2;
-  //   } else if (strcmp(*argv, "-setSNetWireCbk") == 0) {
-  //     setSNetWireCbk = 1;
-  //   } else {
-  //     fprintf(stderr, "ERROR: Illegal command line option: '%s'\n", *argv);
-  //     return 2;
-  //   }
-
-  //   argv++;
-  // }
-
-
-
-  //defrSetLogFunction(myLogFunction);
-  //defrSetWarningLogFunction(myWarningLogFunction);
-  // std::cout << "1\n";
-  if (isSessionless) {
-      defrInitSession(0);
-    defrSetLongLineNumberFunction(lineNumberCB);
-    defrSetDeltaNumberLines(line_num_print_interval);
-  }
-
-  // defrInitSession(isSessionless ? 0 : 1);
-  defrInitSession(1);
-  // std::cout << "2\n";
-  if (noCalls == 0) {
-    // std::cout << "3\n";
-    // fprintf(fout, "xxx\n");
-    defrSetWarningLogFunction(printWarning);
-
-
-    defrSetUserData((lefiUserData)this);
-    // std::cout << "3.5 \n";
-    defrSetDesignCbk(dname);
-    // std::cout << "4\n";
-    defrSetTechnologyCbk(tname);
-    defrSetExtensionCbk(extension);
-    defrSetDesignEndCbk(done);
-    defrSetPropDefStartCbk(propstart);
-    defrSetPropCbk(prop);
-    defrSetPropDefEndCbk(propend);
-    /* Test for CCR 766289*/
-    if (!noNetCb)
-      defrSetNetCbk(netf);
-    defrSetNetNameCbk(netNamef);
-    defrSetNetNonDefaultRuleCbk(nondefRulef);
-    defrSetNetSubnetNameCbk(subnetNamef);
-    defrSetNetPartialPathCbk(netpath);
-    defrSetSNetCbk(snetf);
-    // std::cout << "5\n";
-    //defrSetSNetPartialPathCbk(snetpath);
-    if (setSNetWireCbk)
-      defrSetSNetWireCbk(snetwire);
-    defrSetComponentMaskShiftLayerCbk(compMSL);
-    defrSetComponentCbk(compf);
-    defrSetAddPathToNet();
-    defrSetHistoryCbk(hist);
-    defrSetConstraintCbk(constraint);
-    defrSetAssertionCbk(constraint);
-    defrSetArrayNameCbk(an);
-    // std::cout << "6\n";
-    defrSetFloorPlanNameCbk(fn);
-    defrSetDividerCbk(dn);
-    defrSetBusBitCbk(bbn);
-    defrSetNonDefaultCbk(ndr);
-
-    defrSetAssertionsStartCbk(constraintst);
-    defrSetConstraintsStartCbk(constraintst);
-    defrSetComponentStartCbk(cs);
-    defrSetPinPropStartCbk(cs);
-    defrSetNetStartCbk(cs);
-    defrSetStartPinsCbk(cs);
-    defrSetViaStartCbk(cs);
-    defrSetRegionStartCbk(cs);
-    defrSetSNetStartCbk(cs);
-    // std::cout << "7\n";
-    defrSetGroupsStartCbk(cs);
-    defrSetScanchainsStartCbk(cs);
-    defrSetIOTimingsStartCbk(cs);
-    defrSetFPCStartCbk(cs);
-    defrSetTimingDisablesStartCbk(cs);
-    defrSetPartitionsStartCbk(cs);
-    defrSetBlockageStartCbk(cs);
-    defrSetSlotStartCbk(cs);
-    defrSetFillStartCbk(cs);
-    defrSetNonDefaultStartCbk(cs);
-    defrSetStylesStartCbk(cs);
-
-    // All of the extensions point to the same function.
-    defrSetNetExtCbk(ext);
-    defrSetComponentExtCbk(ext);
-    defrSetPinExtCbk(ext);
-    defrSetViaExtCbk(ext);
-    // std::cout << "8\n";
-    defrSetNetConnectionExtCbk(ext);
-    defrSetGroupExtCbk(ext);
-    defrSetScanChainExtCbk(ext);
-    defrSetIoTimingsExtCbk(ext);
-    defrSetPartitionsExtCbk(ext);
-
-    defrSetUnitsCbk(unitsFn);
-    //if (!retStr)
-    //   defrSetVersionCbk(vers);
-    //else
-       defrSetVersionStrCbk(versStr);
-    defrSetCaseSensitiveCbk(casesens);
-
-    // The following calls are an example of using one function "cls"
-    // to be the callback for many DIFFERENT types of constructs.
-    // We have to cast the function type to meet the requirements
-    // of each different set function.
-    defrSetSiteCbk((defrSiteCbkFnType)cls);
-    defrSetCanplaceCbk((defrSiteCbkFnType)cls);
-    defrSetCannotOccupyCbk((defrSiteCbkFnType)cls);
-    defrSetDieAreaCbk((defrBoxCbkFnType)cls);
-    defrSetPinCapCbk((defrPinCapCbkFnType)cls);
-    defrSetPinCbk((defrPinCbkFnType)cls);
-    defrSetPinPropCbk((defrPinPropCbkFnType)cls);
-    defrSetDefaultCapCbk((defrIntegerCbkFnType)cls);
-    defrSetRowCbk((defrRowCbkFnType)cls);
-    defrSetTrackCbk((defrTrackCbkFnType)cls);
-    defrSetGcellGridCbk((defrGcellGridCbkFnType)cls);
-    defrSetViaCbk((defrViaCbkFnType)cls);
-    defrSetRegionCbk((defrRegionCbkFnType)cls);
-    defrSetGroupNameCbk((defrStringCbkFnType)cls);
-    defrSetGroupMemberCbk((defrStringCbkFnType)cls);
-    defrSetGroupCbk((defrGroupCbkFnType)cls);
-    defrSetScanchainCbk((defrScanchainCbkFnType)cls);
-    defrSetIOTimingCbk((defrIOTimingCbkFnType)cls);
-    defrSetFPCCbk((defrFPCCbkFnType)cls);
-    defrSetTimingDisableCbk((defrTimingDisableCbkFnType)cls);
-    defrSetPartitionCbk((defrPartitionCbkFnType)cls);
-    defrSetBlockageCbk((defrBlockageCbkFnType)cls);
-    defrSetSlotCbk((defrSlotCbkFnType)cls);
-    defrSetFillCbk((defrFillCbkFnType)cls);
-    defrSetStylesCbk((defrStylesCbkFnType)cls);
-
-    defrSetAssertionsEndCbk(endfunc);
-    defrSetComponentEndCbk(endfunc);
-    defrSetConstraintsEndCbk(endfunc);
-    defrSetNetEndCbk(endfunc);
-    defrSetFPCEndCbk(endfunc);
-    defrSetFPCEndCbk(endfunc);
-    defrSetGroupsEndCbk(endfunc);
-    defrSetIOTimingsEndCbk(endfunc);
-    defrSetNetEndCbk(endfunc);
-    defrSetPartitionsEndCbk(endfunc);
-    defrSetRegionEndCbk(endfunc);
-    defrSetSNetEndCbk(endfunc);
-    defrSetScanchainsEndCbk(endfunc);
-    defrSetPinEndCbk(endfunc);
-    defrSetTimingDisablesEndCbk(endfunc);
-    defrSetViaEndCbk(endfunc);
-    defrSetPinPropEndCbk(endfunc);
-    defrSetBlockageEndCbk(endfunc);
-    defrSetSlotEndCbk(endfunc);
-    defrSetFillEndCbk(endfunc);
-    defrSetNonDefaultEndCbk(endfunc);
-    defrSetStylesEndCbk(endfunc);
-
-    defrSetMallocFunction(mallocCB);
-    defrSetReallocFunction(reallocCB);
-    defrSetFreeFunction(freeCB);
-
-    //defrSetRegisterUnusedCallbacks();
-
-    // Testing to set the number of warnings
-    defrSetAssertionWarnings(3);
-    defrSetBlockageWarnings(3);
-    defrSetCaseSensitiveWarnings(3);
-    defrSetComponentWarnings(3);
-    defrSetConstraintWarnings(0);
-    defrSetDefaultCapWarnings(3);
-    defrSetGcellGridWarnings(3);
-    defrSetIOTimingWarnings(3);
-    defrSetNetWarnings(3);
-    defrSetNonDefaultWarnings(3);
-    defrSetPinExtWarnings(3);
-    defrSetPinWarnings(3);
-    defrSetRegionWarnings(3);
-    defrSetRowWarnings(3);
-    defrSetScanchainWarnings(3);
-    defrSetSNetWarnings(3);
-    defrSetStylesWarnings(3);
-    defrSetTrackWarnings(3);
-    defrSetUnitsWarnings(3);
-    defrSetVersionWarnings(3);
-    defrSetViaWarnings(3);
-  }
-
-  if (! isSessionless) {
-    defrSetLongLineNumberFunction(lineNumberCB);
-    defrSetDeltaNumberLines(line_num_print_interval);
-  }
-
-  (void) defrSetOpenLogFileAppend();
-
-  if (ccr749853) {
-    defrSetTotalMsgLimit (5);
-    defrSetLimitPerMsg (6008, 2);
-
-  } 
-
-  if (test1) {  // for special tests
-     for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if ((f = fopen(inFile[fileCt],"r")) == 0) {
-         fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-         return(2);
-       }
-       // Set case sensitive to 0 to start with, in History & PropertyDefinition
-       // reset it to 1.
-       res = defrRead(f, inFile[fileCt], userData, 1);
-
-       if (res)
-          fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-       (void)defrUnsetNonDefaultCbk(); 
-       (void)defrUnsetNonDefaultStartCbk(); 
-       (void)defrUnsetNonDefaultEndCbk(); 
-     }
-  }
-  else if (test2) {  // for special tests
-    // this test is design to test the 3 APIs, defrDisableParserMsgs,
-    // defrEnableParserMsgs & defrEnableAllMsgs
-    // It uses the file ccr523879.def.  This file will parser 3 times
-    // 1st it will have defrDisableParserMsgs set to both 7010 & 7016
-    // 2nd will enable 7016 by calling defrEnableParserMsgs
-    // 3rd enable all msgs by call defrEnableAllMsgs
-
-    //int nMsgs = 2;
-    int dMsgs[2];
-
-    for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if (fileCt == 0) {
-          dMsgs[0] = 7010;
-          dMsgs[1] = 7016;
-          defrDisableParserMsgs (2, (int*)dMsgs);
-       } else if (fileCt == 1) {
-          dMsgs[0] = 7016;
-          defrEnableParserMsgs (1, (int*)dMsgs);
-       } else
-          defrEnableAllMsgs();
- 
-       if ((f = fopen(inFile[fileCt],"r")) == 0) {
-         fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-         return(2);
-       }
- 
-       res = defrRead(f, inFile[fileCt], userData, 1);
- 
-       if (res)
-          fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
- 
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-       (void)defrUnsetNonDefaultCbk();
-       (void)defrUnsetNonDefaultStartCbk();
-       (void)defrUnsetNonDefaultEndCbk();
-    }
-  } else {
-     for (fileCt = 0; fileCt < numInFile; fileCt++) {
-       if (strcmp(inFile[fileCt], "STDIN") == 0) {
-            f = stdin;
-       } else if ((f = fopen(inFile[fileCt],"r")) == 0) {
-             fprintf(stderr,"Couldn't open input file '%s'\n", inFile[fileCt]);
-             return(2);
-       }
-       // Set case sensitive to 0 to start with, in History & PropertyDefinition
-       // reset it to 1.
-
-       res = defrRead(f, inFile[fileCt], userData, 1);
-
-       if (res)
-           fprintf(stderr, "Reader returns bad status.\n", inFile[fileCt]);
-
-       // Testing the aliases API.
-       //defrAddAlias ("alias1", "aliasValue1", 1);
-
-       //defiAlias_itr aliasStore;
-       //const char    *alias1Value = NULL;
-
-       //while (aliasStore.Next()) {
-       //    if (strcmp(aliasStore.Key(), "alias1") == 0) {
-       //         alias1Value = aliasStore.Data();
-       //    }
-       //} 
-
-       //if (!alias1Value || strcmp(alias1Value, "aliasValue1")) {
-       //      fprintf(stderr, "ERROR: Aliases don't work\n");
-       //}
-
-       (void)defrPrintUnusedCallbacks(fout);
-       (void)defrReleaseNResetMemory();
-       // LW 18/02/06
-       (void)defrUnsetNonDefaultCbk();
-       (void)defrUnsetNonDefaultStartCbk();
-       (void)defrUnsetNonDefaultEndCbk();
-    }
-    (void)defrUnsetCallbacks();
-    (void)defrSetUnusedCallbacks(unUsedCB);
-  }
-
-  // Unset all the callbacks
-  defrUnsetArrayNameCbk ();
-  defrUnsetAssertionCbk ();
-  defrUnsetAssertionsStartCbk ();
-  defrUnsetAssertionsEndCbk ();
-  defrUnsetBlockageCbk ();
-  defrUnsetBlockageStartCbk ();
-  defrUnsetBlockageEndCbk ();
-  defrUnsetBusBitCbk ();
-  defrUnsetCannotOccupyCbk ();
-  defrUnsetCanplaceCbk ();
-  defrUnsetCaseSensitiveCbk ();
-  defrUnsetComponentCbk ();
-  defrUnsetComponentExtCbk ();
-  defrUnsetComponentStartCbk ();
-  defrUnsetComponentEndCbk ();
-  defrUnsetConstraintCbk ();
-  defrUnsetConstraintsStartCbk ();
-  defrUnsetConstraintsEndCbk ();
-  defrUnsetDefaultCapCbk ();
-  defrUnsetDesignCbk ();
-  defrUnsetDesignEndCbk ();
-  defrUnsetDieAreaCbk ();
-  defrUnsetDividerCbk ();
-  defrUnsetExtensionCbk ();
-  defrUnsetFillCbk ();
-  defrUnsetFillStartCbk ();
-  defrUnsetFillEndCbk ();
-  defrUnsetFPCCbk ();
-  defrUnsetFPCStartCbk ();
-  defrUnsetFPCEndCbk ();
-  defrUnsetFloorPlanNameCbk ();
-  defrUnsetGcellGridCbk ();
-  defrUnsetGroupCbk ();
-  defrUnsetGroupExtCbk ();
-  defrUnsetGroupMemberCbk ();
-  defrUnsetComponentMaskShiftLayerCbk ();
-  defrUnsetGroupNameCbk ();
-  defrUnsetGroupsStartCbk ();
-  defrUnsetGroupsEndCbk ();
-  defrUnsetHistoryCbk ();
-  defrUnsetIOTimingCbk ();
-  defrUnsetIOTimingsStartCbk ();
-  defrUnsetIOTimingsEndCbk ();
-  defrUnsetIOTimingsExtCbk ();
-  defrUnsetNetCbk ();
-  defrUnsetNetNameCbk ();
-  defrUnsetNetNonDefaultRuleCbk ();
-  defrUnsetNetConnectionExtCbk ();
-  defrUnsetNetExtCbk ();
-  defrUnsetNetPartialPathCbk ();
-  defrUnsetNetSubnetNameCbk ();
-  defrUnsetNetStartCbk ();
-  defrUnsetNetEndCbk ();
-  defrUnsetNonDefaultCbk ();
-  defrUnsetNonDefaultStartCbk ();
-  defrUnsetNonDefaultEndCbk ();
-  defrUnsetPartitionCbk ();
-  defrUnsetPartitionsExtCbk ();
-  defrUnsetPartitionsStartCbk ();
-  defrUnsetPartitionsEndCbk ();
-  defrUnsetPathCbk ();
-  defrUnsetPinCapCbk ();
-  defrUnsetPinCbk ();
-  defrUnsetPinEndCbk ();
-  defrUnsetPinExtCbk ();
-  defrUnsetPinPropCbk ();
-  defrUnsetPinPropStartCbk ();
-  defrUnsetPinPropEndCbk ();
-  defrUnsetPropCbk ();
-  defrUnsetPropDefEndCbk ();
-  defrUnsetPropDefStartCbk ();
-  defrUnsetRegionCbk ();
-  defrUnsetRegionStartCbk ();
-  defrUnsetRegionEndCbk ();
-  defrUnsetRowCbk ();
-  defrUnsetScanChainExtCbk ();
-  defrUnsetScanchainCbk ();
-  defrUnsetScanchainsStartCbk ();
-  defrUnsetScanchainsEndCbk ();
-  defrUnsetSiteCbk ();
-  defrUnsetSlotCbk ();
-  defrUnsetSlotStartCbk ();
-  defrUnsetSlotEndCbk ();
-  defrUnsetSNetWireCbk ();
-  defrUnsetSNetCbk ();
-  defrUnsetSNetStartCbk ();
-  defrUnsetSNetEndCbk ();
-  defrUnsetSNetPartialPathCbk ();
-  defrUnsetStartPinsCbk ();
-  defrUnsetStylesCbk ();
-  defrUnsetStylesStartCbk ();
-  defrUnsetStylesEndCbk ();
-  defrUnsetTechnologyCbk ();
-  defrUnsetTimingDisableCbk ();
-  defrUnsetTimingDisablesStartCbk ();
-  defrUnsetTimingDisablesEndCbk ();
-  defrUnsetTrackCbk ();
-  defrUnsetUnitsCbk ();
-  defrUnsetVersionCbk ();
-  defrUnsetVersionStrCbk ();
-  defrUnsetViaCbk ();
-  defrUnsetViaExtCbk ();
-  defrUnsetViaStartCbk ();
-  defrUnsetViaEndCbk ();
-
-  fclose(fout);
-
-  // Release allocated singleton data.
-  defrClear();
-  delete[] cstr;
-
-  return res;
-}
-
-#pragma GCC diagnostic pop
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frAPG.cpp b/scripts/pdn/src/PdnPinDumper/src/io/frAPG.cpp
deleted file mode 100644
index 8ad8fb5..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frAPG.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "io/frAPG.h"
-
-void fr::APGWorker::init() {
-  bool enableOutput = true;
-  for (auto &uinstTerm: inst->getInstTerms()) {
-    frInstTerm* instTerm = uinstTerm.get();
-    auto instTermType = instTerm->getTerm()->getType();
-    if (instTermType != frTermEnum::frcNormalTerm && instTermType != frTermEnum::frcClockTerm) {
-      continue;
-    }
-    // pupulate map and rtree
-    for (auto &upin: instTerm->getTerm()->getPins()) {
-      bool hasViaAccess = false;
-      frPin* pin = upin.get();
-      // unConnectedPins.push_back(pin);
-      frTransform instXform; 
-      inst->getUpdatedXform(instXform);
-      for (auto &uap: pin->getAccessPatterns(instXform.orient())) {
-        FlexAccessPattern *ap = uap.get();
-        if (!(ap->hasInst(inst))) {
-          continue;
-        }
-        if (!ap->getAccessViaDef(frDirEnum::U).empty()) {
-          // std::cout << "empty\n";
-          hasViaAccess = true;
-          pin2APs[pin].push_back(ap);
-          frPoint bp, ep;
-          ap->getPoints(bp, ep);
-          layer2APRTree[ap->getBeginLayerNum()].insert(std::make_pair(point_t(bp.x(), bp.y()), ap));
-          // std::cout << "  " << pin->getTerm()->getName() << " insert ap at (" << bp.x() / 2000.0 << ", " << bp.y() / 2000.0 << ") on layer " << ap->getBeginLayerNum() << "\n";
-        }
-      }
-      if (hasViaAccess == false) {
-        if (enableOutput) {
-          std::cout << "Warning: " << inst->getName() << "/" << pin->getTerm()->getName() 
-                    << " has no via access found during APG. Not considered for APG\n";
-        }
-      } else {
-        unConnectedPins.insert(pin);
-      }
-    }
-  }
-  // 
-
-}
-
-// get the pin order
-void fr::APGWorker::setup() {
-  //bool enableOutput = true;
-  auto unProcessedLayer2APRtree = layer2APRTree;
-  // first sort the unconnected pins to get the start pin
-  std::set<std::pair<frCoord, frPin*> > areaPinPairs;
-  for (auto &pin: unConnectedPins) {
-    frCoord pinArea = 0;
-    auto &layer2PolySet = pin->getLayer2PolySet();
-    for (auto layerIt = layer2PolySet.begin(); layerIt != layer2PolySet.end(); ++layerIt) {
-      pinArea += area(layerIt->second);
-    }
-    areaPinPairs.insert(std::make_pair(pinArea, pin));
-  }
-  // get the order of pins for AP expansion
-  // start from the smallest pin, gradually expand to find the 
-  // "bottleneck" of conflicting pins
-  frPin* currPin = areaPinPairs.begin()->second;
-  // std::cout << "  " << currPin->getTerm()->getName() << "\n";
-  pinOrder.push_back(currPin);
-  if (unConnectedPins.find(currPin) == unConnectedPins.end()) {
-    std::cout << "Error: not found in unConnectedPins\n";
-  }
-  unConnectedPins.erase(currPin);
-  frPoint bp, ep;
-  pin2APs[currPin].front()->getPoints(bp, ep);
-  Point apOrigin(bp.x(), bp.y());
-  boost::polygon::set_points(apBBoxRect, apOrigin, apOrigin);
-  for (auto layerIt = unProcessedLayer2APRtree.begin(); layerIt != unProcessedLayer2APRtree.end(); ++layerIt) {
-    auto &apRTree = layerIt->second;
-    std::vector<std::pair<point_t, FlexAccessPattern*> > removeBuffer;
-    for (auto rtreeIt = apRTree.begin(); rtreeIt != apRTree.end(); ++rtreeIt) {
-      auto loc = rtreeIt->first;
-      auto ap = rtreeIt->second;
-      // remove the ap from rtree if ap has the same pin as the currPin
-      if (ap->getPin() == currPin) {
-        // apRTree.remove(std::make_pair(loc, ap));
-        removeBuffer.push_back(std::make_pair(loc, ap));
-        // std::cout << "    removed ap from rtree\n";
-      }
-    }
-    for (auto &element: removeBuffer) {
-      apRTree.remove(element);
-    }
-  }
-  // remaining pins
-  // std::cout << "  start from second pin\n";
-  while (!unConnectedPins.empty()) {
-    box_t apBBox(point_t(xl(apBBoxRect), yl(apBBoxRect)), point_t(xh(apBBoxRect), yh(apBBoxRect)));
-    frCoord minDist = std::numeric_limits<int>::max();
-    Point nextAPLoc;
-    // find next pin to add to order
-    for (auto layerIt = unProcessedLayer2APRtree.begin(); layerIt != unProcessedLayer2APRtree.end(); ++layerIt) {
-      auto &apRTree = layerIt->second;
-      if (apRTree.empty()) {
-        continue;
-      }
-      std::vector<std::pair<point_t, FlexAccessPattern*> > qq;
-      apRTree.query(bgi::nearest(apBBox, 1), std::back_inserter(qq));
-      for (auto &apPair: qq) {
-        auto tmpDist = bg::distance(apBBox, apPair.first);
-        if (tmpDist < minDist) {
-          minDist = tmpDist;
-          currPin = (apPair.second)->getPin();
-          nextAPLoc = Point(apPair.first.x(), apPair.first.y());
-        }
-      }
-    }
-    // std::cout << "  " << currPin->getTerm()->getName() << "\n";
-
-    // add the closest pin to order and update unconnected info
-    pinOrder.push_back(currPin);
-    unConnectedPins.erase(currPin);
-    boost::polygon::encompass(apBBoxRect, nextAPLoc);
-    for (auto layerIt = unProcessedLayer2APRtree.begin(); layerIt != unProcessedLayer2APRtree.end(); ++layerIt) {
-      auto &apRTree = layerIt->second;
-      if (apRTree.empty()) {
-        continue;
-      }
-      std::vector<std::pair<point_t, FlexAccessPattern*> > removeBuffer;
-      for (auto rtreeIt = apRTree.begin(); rtreeIt != apRTree.end(); ++rtreeIt) {
-        auto loc = rtreeIt->first;
-        auto ap = rtreeIt->second;
-        // remove the ap from rtree if ap has the same pin as the currPin
-        if (ap->getPin() == currPin) {
-          // apRTree.remove(std::make_pair(loc, ap));
-          removeBuffer.push_back(std::make_pair(loc, ap));
-          // std::cout << "    removed ap from rtree\n";
-        }
-      }
-      for (auto &element: removeBuffer) {
-        apRTree.remove(element);
-      }
-    }
-    // 
-
-  }
-
-}
-
-// according to pin order, find the best AP combination and find other usable AP (regarding to best combination)
-void fr::APGWorker::main() {
-  //bool enableOutput = true;
-  auto unProcessedLayer2APRtree = layer2APRTree;
-  frVector<FlexAccessPattern*> currBestAPComb;
-  frVector<frPoint> apBps;
-  std::vector<std::unique_ptr<frVia> > currObjs;
-  std::set<FlexAccessPattern*> currValidAPs;
-  FlexAccessPattern* bestAP;
-  // boost::polygon::center(prevAPLoc, apBBoxRect);
-  // get best APC
-  for (auto &currPin: pinOrder) {
-    int bestVioCnt = -1;
-    std::map<FlexAccessPattern*, frCoord> ap2MinDist;
-    if (apBps.empty()) {
-      Point apBBoxRectCenter;
-      boost::polygon::center(apBBoxRectCenter, apBBoxRect);
-      for (auto &ap: pin2APs[currPin]) {
-        frPoint bp, ep;
-        ap->getPoints(bp, ep);
-        Point apBp(bp.x(), bp.y());
-        frCoord tmpDist = boost::polygon::euclidean_distance(apBp, apBBoxRectCenter);
-        ap2MinDist[ap] = tmpDist;
-      }
-    } else {
-      for (auto &ap: pin2APs[currPin]) {
-        for (auto &bap: currBestAPComb) {
-          frPoint bp, ep, bbp, bep;
-          ap->getPoints(bp, ep);
-          bap->getPoints(bbp, bep);
-          Point apBp(bp.x(), bp.y());
-          Point bapBp(bbp.x(), bbp.y());
-          frCoord tmpDist = boost::polygon::euclidean_distance(apBp, bapBp);
-          if (ap2MinDist.find(ap) == ap2MinDist.end() || tmpDist < ap2MinDist[ap]) {
-            ap2MinDist[ap] = tmpDist;
-          }
-        }
-      }
-    }
-    //
-    std::vector<std::pair<frCoord, FlexAccessPattern*> > distAPs;
-    for (auto it = ap2MinDist.begin(); it != ap2MinDist.end(); ++it) {
-      distAPs.push_back(std::make_pair(it->second, it->first));
-    }
-    std::sort(distAPs.begin(), distAPs.end());
-    // greedily start check from the nearest one, find the one with smallest cost and proceed
-    // for (auto &distAP: distAPs) {
-    for (int i = 0; i < (int)distAPs.size(); ++i) {
-      auto &ap = distAPs[i].second;
-      std::vector<frBlockObject*> tmpObjs;
-      for (auto &obj: currObjs) {
-        tmpObjs.push_back(obj.get());
-      }
-      std::unique_ptr<frVia> tmpVia = std::make_unique<frVia>((ap->getAccessViaDef(frDirEnum::U).front()));
-      frPoint bp, ep;
-      ap->getPoints(bp, ep);
-      tmpVia->setOrigin(bp);
-      frTransform viaXform(bp);
-      tmpVia->setTransform(viaXform);
-      tmpVia->addToPin(currPin);
-      tmpObjs.push_back(tmpVia.get());
-      DRCWorker drcWorker(design, tmpObjs);
-      drcWorker.init();
-      drcWorker.setup();
-      drcWorker.main();
-      if (drcWorker.getViolations().empty()) {
-        bestVioCnt = 0;
-        bestAP = ap;
-      } else {
-        int numVio = drcWorker.getViolations().size();
-        if (bestVioCnt == -1 || numVio < bestVioCnt) {
-          bestVioCnt = numVio;
-          bestAP = ap;
-        }
-      }
-      // update if clean ap found or all ap visited
-      if (bestVioCnt == 0 || (i + 1) == (int)distAPs.size()) {
-        apBps.push_back(bp);
-        currBestAPComb.push_back(bestAP);
-        currObjs.push_back(std::move(tmpVia));
-        break;
-      }
-
-    }
-
-  }
-
-  for (auto &ap: currBestAPComb) {
-    frPoint bp, ep;
-    ap->getPoints(bp, ep);
-    ap->setPreferred(true);
-    std::cout << "  ap in bestAPComb: (" << bp.x() / 2000.0 << ", " << bp.y() / 2000.0 << ")\n";
-    currValidAPs.insert(ap);
-  }
-
-  // find all other APs which are not conflicting with best APC
-  for (auto it = pin2APs.begin(); it != pin2APs.end(); ++it) {
-    auto &pin = it->first;
-    auto &aps = it->second;
-    std::vector<frBlockObject*> otherObjs;
-    // get the aps in APC except the current one
-    for (auto &via: currObjs) {
-      if (via->hasPin() && via->getPin() != pin) {
-        otherObjs.push_back(via.get());
-      }
-    }
-    // check ap of the current pin one by one
-    for (auto &ap: aps) {
-      auto tmpObjs = otherObjs;
-      std::unique_ptr<frVia> tmpVia = std::make_unique<frVia>(*(ap->getAccessViaDef(frDirEnum::U).begin()));
-      frPoint bp, ep;
-      ap->getPoints(bp, ep);
-      tmpVia->setOrigin(bp);
-      frTransform viaXform(bp);
-      tmpVia->setTransform(viaXform);
-      tmpVia->addToPin(pin);
-      tmpObjs.push_back(tmpVia.get());
-      DRCWorker drcWorker(design, tmpObjs);
-      drcWorker.init();
-      drcWorker.setup();
-      drcWorker.main();
-      if (drcWorker.getViolations().empty()) {
-        currValidAPs.insert(ap);
-      }
-    }
-  }
-
-  bestAPComb = currBestAPComb;
-  validAPs = currValidAPs;
-
-  updateAPStatus();
-
-}
-
-void fr::APGWorker::updateAPStatus() {
-  for (auto it = pin2APs.begin(); it != pin2APs.end(); ++it) {
-    auto &aps = it->second;
-    for (auto &ap: aps) {
-      if (validAPs.find(ap) != validAPs.end()) {
-        ap->setConflict(false);
-      }
-    }
-  }
-}
-
-void fr::APGWorker::end() {
-  for (auto &uinstTerm: inst->getInstTerms()) {
-    frInstTerm* instTerm = uinstTerm.get();
-    auto instTermType = instTerm->getTerm()->getType();
-    if (instTermType != frTermEnum::frcNormalTerm && instTermType != frTermEnum::frcClockTerm) {
-      continue;
-    }
-    for (auto &upin: instTerm->getTerm()->getPins()) {
-      frPin* pin = upin.get();
-      frTransform instXform; 
-      inst->getUpdatedXform(instXform);
-      auto &aps = pin->getAccessPatterns(instXform.orient());
-      std::sort(aps.begin(), aps.end(), APComp());
-    }
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frAPG.h b/scripts/pdn/src/PdnPinDumper/src/io/frAPG.h
deleted file mode 100644
index ad1ae37..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frAPG.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_APG_H_
-#define _FR_APG_H_
-
-#include "frBaseTypes.h"
-#include "frDesign.h"
-#include "db/tech/frConstraint.h"
-#include "drc/frDRC.h"
-
-namespace fr {
-  class APGWorker {
-  public:
-    APGWorker() {}
-    APGWorker(frDesign* designIn, frInst* instIn): design(designIn), inst(instIn) {
-
-    }
-
-    void init();
-    void setup();
-    void main();
-    void end();
-
-
-
-  protected:
-    frDesign* design;
-    frInst* inst;
-    // frVector<frAccessPattern*> aps;
-    std::set<frPin*> unConnectedPins;
-    frVector<frPin*> pinOrder;
-    std::set<FlexAccessPattern*> validAPs;
-    frVector<FlexAccessPattern*> bestAPComb;
-    std::map<frPin*, std::vector<FlexAccessPattern*> > pin2APs;
-    std::map<frLayerNum, bgi::rtree<std::pair<point_t, FlexAccessPattern*>, bgi::quadratic<16> > > layer2APRTree;
-    Rectangle apBBoxRect;
-
-    // functions
-    void updateAPStatus();
-  };
-}
-
-
-
-#endif
\ No newline at end of file
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.cpp b/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.cpp
deleted file mode 100644
index 98bb456..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.cpp
+++ /dev/null
@@ -1,1352 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <algorithm>
-#include <iterator>
-#include <iostream>
-#include <map>
-#include <boost/graph/connected_components.hpp>
-#include "global.h"
-#include "io/frGuidePrep.h"
-#include "io/frShapeUtil.h"
-#include "io/frUtil.h"
-#include "db/obj/frRoute.h"
-//#include <typeinfo>
-
-
-namespace fr {
-  frCoord GCELLGRIDX = -1;
-  frCoord GCELLGRIDY = -1;
-  frCoord GCELLOFFSETX = -1;
-  frCoord GCELLOFFSETY = -1;
-  std::vector<std::shared_ptr<fr::frLayer> > *designLayers;
-
-  frCoord getGCELLGRIDX() {
-    return GCELLGRIDX;
-  }
-
-  frCoord getGCELLGRIDY() {
-    return GCELLGRIDY;
-  }
-
-  frCoord getGCELLOFFSETX() {
-    return GCELLOFFSETX;
-  }
-
-  frCoord getGCELLOFFSETY() {
-    return GCELLOFFSETY;
-  }
-
-  
-  void setGCELLGRIDX(frCoord &gCellGridXIn) {
-    GCELLGRIDX = gCellGridXIn;
-  }
-  void setGCELLGRIDY(frCoord &gCellGridYIn) {
-    GCELLGRIDY = gCellGridYIn;
-  }
-  void setGCELLOFFSETX(frCoord &gCellOffsetXIn) {
-    GCELLOFFSETX = gCellOffsetXIn;
-  }
-  void setGCELLOFFSETY(frCoord &gCellOffsetYIn) {
-    GCELLOFFSETY = gCellOffsetYIn;
-  }
-
-  void getGCellParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers) {
-    getGCellSizeParam(rawGuide, vlayers);
-    getGCellOffsetParam(rawGuide, vlayers);
-  }
-
-  void getGCellSizeParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers) {
-    std::map<frCoord, int> guideGridXMap, guideGridYMap;
-    // get GCell size information loop
-    for (auto guideIt = rawGuide.begin(); guideIt != rawGuide.end(); ++guideIt) {
-      std::string netName = guideIt->first;
-      auto &rects = guideIt->second;
-      for (auto &rect: rects) {
-        frLayerNum layerNum = rect.getLayerNum();
-        frBox guideBBox;
-        rect.getBBox(guideBBox);
-
-        // get GCell width
-        frCoord guideWidth = -1;
-        if (vlayers[layerNum]->getDir() == frcHorzPrefRoutingDir) {
-          guideWidth = guideBBox.top() - guideBBox.bottom();
-        } else if (vlayers[layerNum]->getDir() == frcVertPrefRoutingDir) {
-          guideWidth = guideBBox.right() - guideBBox.left();
-        }
-
-        // update GCell size info
-        if (guideWidth == -1) {
-          continue;
-        } else {
-          if (vlayers[layerNum]->getDir() == frcHorzPrefRoutingDir) {
-            if (guideGridYMap.find(guideWidth) == guideGridYMap.end()) {
-              guideGridYMap[guideWidth] = 0;
-            }
-            guideGridYMap[guideWidth]++;
-          } else if (vlayers[layerNum]->getDir() == frcVertPrefRoutingDir) {
-            if (guideGridXMap.find(guideWidth) == guideGridXMap.end()) {
-              guideGridXMap[guideWidth] = 0;
-            }
-            guideGridXMap[guideWidth]++;
-          }
-        }
-
-      }
-
-    }
-
-    frCoord tmpGCELLGRIDX = -1, tmpGCELLGRIDY = -1;
-    int tmpGCELLGRIDXCnt = -1, tmpGCELLGRIDYCnt = -1;
-    for (auto mapIt = guideGridXMap.begin(); mapIt != guideGridXMap.end(); ++mapIt) {
-      auto cnt = mapIt->second;
-      if (cnt > tmpGCELLGRIDXCnt) {
-        tmpGCELLGRIDXCnt = cnt;
-        tmpGCELLGRIDX = mapIt->first;
-      }
-    }
-
-    for (auto mapIt = guideGridYMap.begin(); mapIt != guideGridYMap.end(); ++mapIt) {
-      auto cnt = mapIt->second;
-      if (cnt > tmpGCELLGRIDYCnt) {
-        tmpGCELLGRIDYCnt = cnt;
-        tmpGCELLGRIDY = mapIt->first;
-      }
-    }
-
-    if (tmpGCELLGRIDX != -1) {
-      setGCELLGRIDX(tmpGCELLGRIDX);
-    }
-    if (tmpGCELLGRIDY != -1) {
-      setGCELLGRIDY(tmpGCELLGRIDY);
-    }
-
-  }
-  
-
-
-  void getGCellOffsetParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers) {
-    std::map<frCoord, int> guideOffsetXMap, guideOffsetYMap;
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-
-    // get GCell offset information loop
-    for (auto guideIt = rawGuide.begin(); guideIt != rawGuide.end(); ++guideIt) {
-      std::string netName = guideIt->first;
-      auto &rects = guideIt->second;
-      for (auto &rect: rects) {
-        frLayerNum layerNum = rect.getLayerNum();
-        frBox guideBBox;
-        rect.getBBox(guideBBox);
-
-        // get GCell width
-        frCoord guideOffset = -1;
-        if (vlayers[layerNum]->getDir() == frcHorzPrefRoutingDir) {
-          guideOffset = guideBBox.left() % GCELLGRIDX;
-        } else if (vlayers[layerNum]->getDir() == frcVertPrefRoutingDir) {
-          guideOffset = guideBBox.bottom() % GCELLGRIDY;
-        }
-
-        // update GCell size info
-        if (guideOffset == -1) {
-          continue;
-        } else {
-          if (vlayers[layerNum]->getDir() == frcHorzPrefRoutingDir) {
-            if (guideOffsetXMap.find(guideOffset) == guideOffsetXMap.end()) {
-              guideOffsetXMap[guideOffset] = 0;
-            }
-            guideOffsetXMap[guideOffset]++;
-          } else if (vlayers[layerNum]->getDir() == frcVertPrefRoutingDir) {
-            if (guideOffsetYMap.find(guideOffset) == guideOffsetYMap.end()) {
-              guideOffsetYMap[guideOffset] = 0;
-            }
-            guideOffsetYMap[guideOffset]++;
-          }
-        }
-
-      }
-
-    }
-    frCoord tmpGCELLOFFSETX = -1, tmpGCELLOFFSETY = -1;
-    int tmpGCELLOFFSETXCnt = -1, tmpGCELLOFFSETYCnt = -1;
-    for (auto mapIt = guideOffsetXMap.begin(); mapIt != guideOffsetXMap.end(); ++mapIt) {
-      auto cnt = mapIt->second;
-      if (cnt > tmpGCELLOFFSETXCnt) {
-        tmpGCELLOFFSETXCnt = cnt;
-        tmpGCELLOFFSETX = mapIt->first;
-      }
-    }
-
-    for (auto mapIt = guideOffsetYMap.begin(); mapIt != guideOffsetYMap.end(); ++mapIt) {
-      auto cnt = mapIt->second;
-      if (cnt > tmpGCELLOFFSETYCnt) {
-        tmpGCELLOFFSETYCnt = cnt;
-        tmpGCELLOFFSETY = mapIt->first;
-      }
-    }
-
-    if (tmpGCELLOFFSETX != -1) {
-      setGCELLOFFSETX(tmpGCELLOFFSETX);
-    }
-    if (tmpGCELLOFFSETY != -1) {
-      setGCELLOFFSETY(tmpGCELLOFFSETY);
-    }
-
-  }
-
-  void genGCell2PinMap(std::map<std::string, std::shared_ptr<fr::frBlock> > &macros,
-                       std::map<std::string, std::shared_ptr<fr::frNet> > &nets,
-                       std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, frLayerNum> > > > &gCell2PinMap) {
-    //bool debugMode = false;
-    //frCoord GCELLGRIDX = getGCELLGRIDX();
-    //frCoord GCELLGRIDY = getGCELLGRIDY();
-    //frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    //frCoord GCELLOFFSETY = getGCELLOFFSETY();
-    if (VERBOSE > 0) {
-      std::cout <<std::endl <<"gen gcell to pin map ..." <<std::endl;
-    }
-    int cnt = 0;
-    for (auto netIt = nets.begin(); netIt != nets.end(); ++netIt) {
-      auto netName = netIt->first;
-      auto &net = netIt->second;
-      // std::cout << "net: " << netName << std::endl;
-      // update for inst term
-      for (auto &instTerm: net->getInstTerms()) {
-        frString cellName;
-        frTransform xform;
-        frBox   mbox;
-        instTerm->getInst()->getTransform(xform);
-        instTerm->getInst()->getRefName(cellName);
-        macros[cellName]->getBBox(mbox);
-        frPoint size(mbox.right(), mbox.top());
-        updateXform(xform, size);
-        auto absInstTerm = std::make_shared<frInstTerm>(*instTerm, xform);
-
-        frString termName, instName;
-        auto term = absInstTerm->getTerm();
-        updateGCell2PinMap(static_cast<frBlockObject*>(instTerm.get()), term, netName, gCell2PinMap);
-      }
-      // update for term
-      for (auto term: net->getTerms()) {
-        updateGCell2PinMap(static_cast<frBlockObject*>(term), term, netName, gCell2PinMap);
-      }
-      cnt++;
-      if (VERBOSE > 0) {
-        if (cnt % 10000 == 0) {
-          std::cout <<"  complete " <<cnt <<" nets" <<std::endl;
-        }
-      }
-    }
-
-  }
-
-  // update GCell2PinMap based on whether the term is intersecting with any GCell
-  void updateGCell2PinMap(frBlockObject* blockObj,
-                          frTerm *term,
-                          std::string netName,
-                          std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, frLayerNum> > > > &gCell2PinMap) {
-    bool debugMode = false;
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    frCoord GCELLOFFSETY = getGCELLOFFSETY();
-    frLayerNum layerNum;
-
-    for (auto &pin: term->getPins()) {
-      //std::cout << term->getName() << "\n"; 
-      for (auto &uPinFig: pin->getFigs()) {
-        auto pinFig = uPinFig.get();
-        boostPolygon pinFigPoly;
-        frCoord llx, lly, urx, ury;
-        frCoord gCellMinX, gCellMinY, gCellMaxX, gCellMaxY;
-        
-        // get the exact pinFigPoly
-        // get the GCells which the BBox of the pinFig is intersecting with
-        frBox pinFigBBox;
-        pinFig->getBBox(pinFigBBox);
-        llx = pinFigBBox.left();
-        lly = pinFigBBox.bottom();
-        urx = pinFigBBox.right();
-        ury = pinFigBBox.top();
-        // get min/max GCell center x y
-        gCellMinX = (llx - GCELLOFFSETX) / GCELLGRIDX * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2;
-        gCellMinY = (lly - GCELLOFFSETY) / GCELLGRIDY * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2;
-        gCellMaxX = (urx - GCELLOFFSETX) / GCELLGRIDX * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2;
-        gCellMaxY = (ury - GCELLOFFSETY) / GCELLGRIDY * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2;
-        // get exact pin shape
-        switch(pinFig->typeId()) {
-          case frcRect:
-            frRect2Poly(*(static_cast<frRect*>(pinFig)), pinFigPoly);
-            layerNum = (static_cast<frRect*>(pinFig))->getLayerNum();
-            break;
-          case frcPolygon:
-            frPolygon2Poly(*(static_cast<frPolygon*>(pinFig)), pinFigPoly);
-            layerNum = (static_cast<frPolygon*>(pinFig))->getLayerNum();
-            break;
-          default:
-            continue;
-            break;
-        }
-        // get exact overlappping between pin and gcells
-        for (frCoord gCellLocX = gCellMinX; gCellLocX <= gCellMaxX; gCellLocX += GCELLGRIDX) {
-          for (frCoord gCellLocY = gCellMinY; gCellLocY <= gCellMaxY; gCellLocY += GCELLGRIDY) {
-            frPoint gCellCenter(gCellLocX, gCellLocY);
-            frBox gCellBox = point2GCellBox(gCellCenter);
-            boostPolygon gCellPoly;
-            frBox2Poly(gCellBox, gCellPoly);
-            if (boost::geometry::intersects(gCellPoly, pinFigPoly)) {
-              if (debugMode) {
-                std::cout << "  GCell: (" << gCellBox.left() << ", " << gCellBox.bottom()
-                          << ")--(" << gCellBox.right() << ", " << gCellBox.top()
-                          << ") intersecting with Term/InstTerm on layer " << layerNum << std::endl;
-              }
-              if (gCell2PinMap.find(netName) == gCell2PinMap.end()) {
-                gCell2PinMap[netName] = std::map<frPoint, std::set<std::pair<frBlockObject*, frLayerNum> > >();
-              }
-              if (gCell2PinMap[netName].find(gCellCenter) == gCell2PinMap[netName].end()) {
-                gCell2PinMap[netName][gCellCenter] = std::set<std::pair<frBlockObject*, frLayerNum> >();
-              }
-              gCell2PinMap[netName][gCellCenter].insert(std::make_pair(blockObj, layerNum));
-            }
-          }
-        }
-      }
-    }
-  }
-
-  frBox point2GCellBox(frPoint &pointIn) {
-    
-    frCoord llx, lly, urx, ury;
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    frCoord GCELLOFFSETY = getGCELLOFFSETY();
-
-    llx = (pointIn.x() - GCELLOFFSETX) / GCELLGRIDX * GCELLGRIDX + GCELLOFFSETX;
-    urx = llx + GCELLGRIDX;
-    lly = (pointIn.y() - GCELLOFFSETY) / GCELLGRIDY * GCELLGRIDY + GCELLOFFSETY;
-    ury = lly + GCELLGRIDY;
-
-    frBox gCellBox(llx, lly, urx, ury);
-    return gCellBox;
-
-  }
-
-  void updateXform(frTransform &xform, frPoint &size) {
-    switch(xform.orient()) {
-      //case frcR0: == default
-      case frcR90:
-        xform.set(xform.xOffset() + size.y(), xform.yOffset()           );
-        break;
-      case frcR180: // verified
-        xform.set(xform.xOffset() + size.x(), xform.yOffset() + size.y());
-        break;
-      case frcR270:
-        xform.set(xform.xOffset(),            xform.yOffset() + size.x());
-        break;
-      case frcMY: // verified
-        xform.set(xform.xOffset() + size.x(), xform.yOffset()           );
-        break;
-      case frcMXR90:
-        xform.set(xform.xOffset(),            xform.yOffset()           );
-        break;
-      case frcMX: // verified
-        xform.set(xform.xOffset(),            xform.yOffset() + size.y());
-        break;
-      case frcMYR90:
-        xform.set(xform.xOffset() + size.y(), xform.yOffset() + size.x());
-        break;
-      default      : // verified
-        xform.set(xform.xOffset(),            xform.yOffset()           );
-        break;
-    }
-  }
-
-  // standardize guide to unit gcell width / height
-  // void getStandardGuide(frCollection<frRect> &guidesIn,
-  //                       frCollection<frRect> &guidesOut,
-  //                       std::vector<std::shared_ptr<fr::frLayer> > layers) {
-  //   std::map<frLayerNum, frCollection<frBox> > layer2BoxMap;
-    
-  //   frCoord GCELLGRIDX = getGCELLGRIDX();
-  //   frCoord GCELLGRIDY = getGCELLGRIDY();
-  //   frCoord GCELLOFFSETX = getGCELLOFFSETX();
-  //   frCoord GCELLOFFSETY = getGCELLOFFSETY();
-
-  //   // gen guide by layer map
-  //   for (auto &guide: guidesIn) {
-  //     frLayerNum layerNum = guide.getLayerNum();
-  //     if (layer2BoxMap.find(layerNum) == layer2BoxMap.end()) {
-  //       layer2BoxMap[layerNum] = frCollection<frBox>();
-  //     }
-  //     frBox guideBBox;
-  //     guide.getBBox(guideBBox);
-  //     layer2BoxMap[layerNum].push_back(guideBBox);
-  //   }
-
-
-  //   // process initial guide layer by layer
-  //   for (auto mapIt = layer2BoxMap.begin(); mapIt != layer2BoxMap.end(); ++mapIt) {
-
-  //   }
-
-  // }
-
-  void getStandardGuide(std::map<std::string, fr::frCollection<fr::frRect> > &tmpGuides,
-                        std::vector<std::shared_ptr<fr::frLayer> > &vlayers,
-                        std::map<std::string, std::shared_ptr<fr::frNet> > &nets,
-                        std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, fr::frLayerNum> > > > &gCell2PinMap) {
-    bool debugMode = false;
-    // debug
-    // std::cout << "*************\n";
-    // boostSegment seg1, seg2;
-    // seg1 = boostSegment(boostPoint(28600, 415500), boostPoint(142600, 415500));
-    // seg2 = boostSegment(boostPoint(115600, 406500), boostPoint(115600, 520500));
-    // boost::geometry::correct(seg1);
-    // boost::geometry::correct(seg2);
-    // frCollection<boostPoint> intersectPoints;
-    // bg::intersection(seg1, seg2, intersectPoints);
-    // for (auto intersectPoint: intersectPoints) {
-    //   frPoint tmpSteiner;
-    //   tmpSteiner.set(bg::get<0>(intersectPoint), bg::get<1>(intersectPoint));
-    //   std::cout << "(" << tmpSteiner.x() << ", " << tmpSteiner.y() << ")\n";
-    // }
-
-    // exit(0);
-    if (VERBOSE > 0) {
-      std::cout <<std::endl <<"get standard guide ..." <<std::endl;
-    }
-    int cnt = 0;
-    for (auto guideIt = tmpGuides.begin(); guideIt != tmpGuides.end(); ++guideIt) {
-      auto &netName = guideIt->first;
-      auto &guides = guideIt->second;
-      if (debugMode) {
-        std::cout << "===============" << netName << "===============" << std::endl;
-      }
-      getStandardGuide(guides, vlayers, nets[netName], gCell2PinMap[netName]);
-      cnt++;
-      if (VERBOSE > 0) {
-        if (cnt % 10000 == 0) {
-          std::cout <<"  complete " <<cnt <<" nets" <<std::endl;
-        }
-      }
-    }
-
-    
-  }
-
-  void getStandardGuide(frCollection<frRect> &guideRects,
-                        std::vector<std::shared_ptr<fr::frLayer> > &vlayers,
-                        std::shared_ptr<fr::frNet> &net,
-                        std::map<frPoint, std::set<std::pair<frBlockObject*, fr::frLayerNum> > > &gCell2PinMap) {
-    bool enableOutput = false;
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    frCoord GCELLOFFSETY = getGCELLOFFSETY();
-    frLayerNum layerNum;
-    frPrefRoutingDir dir;
-    std::map<frLayerNum, std::map<frCoord, boost::icl::interval_set<frCoord> > > layerGCell2IntvSet;
-    // frCollection<set<int> > indexCluster;
-    // frCollection<bool> visited(guideRects.size(), false);
-    frString netName;
-    net->getName(netName);
-    //std::cout << netName << "\n";
-    // get interval set per layer per GCell row
-    for (int i = 0; i < (int)guideRects.size(); ++i) {
-      frPoint ll, ur;
-      frCoord llx, lly, urx, ury;
-      layerNum = guideRects[i].getLayerNum();
-      dir = vlayers[layerNum]->getDir();
-      //if (layerGCell2IntvSet.find(layerNum) == layerGCell2IntvSet.end()) {
-      //  layerGCell2IntvSet[layerNum] = std::map<frCoord, boost::icl::interval_set<int> >();
-      //}
-      // get lowerLeft and upperRight GCell centers
-      frBox guideBox;
-      guideRects[i].getBBox(guideBox);
-      ll = getGCellCenter(frPoint(guideBox.left(), guideBox.bottom()));
-      ur = getGCellCenter(frPoint(guideBox.right(), guideBox.top()));
-      // modify if ur are on boundary
-      if ((guideBox.right() - GCELLOFFSETX) % GCELLGRIDX == 0) {
-        ur.set(ur.x() - GCELLGRIDX, ur.y());
-      }
-      if ((guideBox.top() - GCELLOFFSETY) % GCELLGRIDY == 0) {
-        ur.set(ur.x(), ur.y() - GCELLGRIDY);
-      }
-      // insert interval map 
-      llx = ll.x();
-      lly = ll.y();
-      urx = ur.x();
-      ury = ur.y();
-      if (enableOutput) {
-        std::cout << "guideRectCenter (" << llx << ", " << lly << ") - (" << urx << ", " << ury << ") " << vlayers[layerNum]->getName() << "\n";
-      }
-      if (dir == frcHorzPrefRoutingDir) {
-        for (frCoord gCellRowCenter = lly; gCellRowCenter <= ury; gCellRowCenter += GCELLGRIDY) {
-          //if (layerGCell2IntvSet[layerNum].find(gCellRowCenter) == layerGCell2IntvSet[layerNum].end()) {
-          //  layerGCell2IntvSet[layerNum][gCellRowCenter] = boost::icl::interval_set<int>();
-          //}
-          layerGCell2IntvSet[layerNum][gCellRowCenter].insert(boost::icl::interval_set<frCoord>::interval_type::closed(llx, urx));
-        }
-      } else if (dir == frcVertPrefRoutingDir) {
-        for (frCoord gCellRowCenter = llx; gCellRowCenter <= urx; gCellRowCenter += GCELLGRIDX) {
-          //if (layerGCell2IntvSet[layerNum].find(gCellRowCenter) == layerGCell2IntvSet[layerNum].end()) {
-          //  layerGCell2IntvSet[layerNum][gCellRowCenter] = boost::icl::interval_set<int>();
-          //}
-          layerGCell2IntvSet[layerNum][gCellRowCenter].insert(boost::icl::interval_set<frCoord>::interval_type::closed(lly, ury));
-        }
-      }
-    }
-
-    appendTouchingGuideIntv(layerGCell2IntvSet, vlayers);
-
-
-    if (enableOutput) {
-      std::cout <<"layerGCell2IntvSet " <<std::endl;
-      for (auto layerIt = layerGCell2IntvSet.begin(); layerIt != layerGCell2IntvSet.end(); ++layerIt) {
-        auto layerNum = layerIt->first;
-        auto &gCell2RowMap = layerIt->second;
-        std::cout << "  layerNum = " << layerNum << std::endl;
-        for (auto rowIt = gCell2RowMap.begin(); rowIt != gCell2RowMap.end(); ++rowIt) {
-          auto gCellRowCenter = rowIt->first;
-          auto &intvSet = rowIt->second;
-          std::cout << "    gCellRowCenter = " << gCellRowCenter << std::endl;
-          // std::cout << "      ";
-          for (auto intvSetIt = intvSet.begin(); intvSetIt != intvSet.end(); ++intvSetIt) {
-            std::cout << "      (" << intvSetIt->lower() << ", " << intvSetIt->upper() << ")\n";
-          }
-        }
-      }
-    }
-    // collect steiner point / pin (vertex) to be created in the graph
-    // along with the corresponding edges
-    std::set<std::pair<frPoint, frLayerNum> > steinerSet;
-    // std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> >, guideSteinerCmp> steinerEdgeSet;
-    std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > > steinerEdgeSet;
-    std::map<std::pair<frPoint, frLayerNum>, frBlockObject*> steiner2Ptr;
-
-    // layerGCell2IntvSet is layerNum --> (trackCoord --> intv set)
-    for (auto layerIt = layerGCell2IntvSet.begin(); layerIt != layerGCell2IntvSet.end(); ++layerIt) {
-      auto layerNum = layerIt->first;
-      auto &gCell2RowMap = layerIt->second; // trackCoord --> intv set
-      // auto layers = getLayers();
-      // std::cout << layers->size() << std::endl;
-      // auto dir = layers->at(layerNum)->getDir();
-      auto dir = vlayers[layerNum]->getDir();
-      for (auto rowIt = gCell2RowMap.begin(); rowIt != gCell2RowMap.end(); ++rowIt) {
-        auto &gCellRowCenter = rowIt->first; // track Coord
-        auto &intvSet = rowIt->second;
-        boostSegment currBoostSeg;
-        // iterate current layer gseg
-        for (auto currIntvSetIt = intvSet.begin(); currIntvSetIt != intvSet.end(); ++currIntvSetIt) {
-          if (dir == frcHorzPrefRoutingDir) {
-            currBoostSeg = boostSegment(boostPoint(currIntvSetIt->lower(), gCellRowCenter), 
-                                        boostPoint(currIntvSetIt->upper(), gCellRowCenter));
-          } else if (dir == frcVertPrefRoutingDir) {
-            currBoostSeg = boostSegment(boostPoint(gCellRowCenter, currIntvSetIt->lower()), 
-                                        boostPoint(gCellRowCenter, currIntvSetIt->upper()));
-          }
-          // iterate lower layer gseg
-          std::set<frPoint> lowerSteiners;
-          frLayerNum lowerLayerNum = layerNum - 2;
-          frLayerNum upperLayerNum = layerNum + 2;
-          // std::map<frCoord, boost::icl::interval_set<frCoord> > lowerGCell2RowMap;
-          // if (netName == "net107211" && lowerLayerNum == 4) {
-          //   std::cout << "  debug1: currGCellRowCenter = " << gCellRowCenter << " (" 
-          //             << currIntvSetIt->lower() << ", " << currIntvSetIt->upper() << ")\n";
-          // }
-
-          if (layerGCell2IntvSet.find(lowerLayerNum) != layerGCell2IntvSet.end()) {
-            // if (netName == "net107211" && lowerLayerNum == 4) {
-            //   for (auto setIt = layerGCell2IntvSet[lowerLayerNum].begin(); setIt != layerGCell2IntvSet[lowerLayerNum].end(); ++setIt) {
-            //     std::cout << "    debug:\n";
-            //     std::cout << "      lowerGCellRowCenter = " << setIt->first << std::endl;
-            //     for (auto it = setIt->second.begin(); it != setIt->second.end(); ++it) {
-            //       std::cout << "         (" << it->lower() << ", " << it->upper() << ")\n";
-            //     }
-            //   }
-            // }
-            getGSegSteiner(currBoostSeg, dir, layerGCell2IntvSet[lowerLayerNum], lowerSteiners);
-          }
-          // if (debugMode) {
-          // if (netName == "net107211") {
-          //   for (auto setIt = lowerSteiners.begin(); setIt != lowerSteiners.end(); ++setIt) {
-          //     std::cout << "    lower steiner on layer " << layerNum << " at (" << setIt->x() << ", " << setIt->y() << ")\n";
-          //   }
-          // }
-          for (auto setIt = lowerSteiners.begin(); setIt != lowerSteiners.end(); ++setIt) {
-            getInterLayerSteinerEdge(*setIt, lowerLayerNum, layerNum, steinerSet, steinerEdgeSet);
-          }
-
-          // iterate upper layer gseg
-          std::set<frPoint> upperSteiners;
-          if (layerGCell2IntvSet.find(upperLayerNum) != layerGCell2IntvSet.end()) {
-            getGSegSteiner(currBoostSeg, dir, layerGCell2IntvSet[upperLayerNum], upperSteiners);
-          }
-          // if (debugMode) {
-          // if (netName == "net107211") {
-          //   for (auto setIt = upperSteiners.begin(); setIt != upperSteiners.end(); ++setIt) {
-          //     std::cout << "    upper steiner on layer " << layerNum << " at (" << setIt->x() << ", " << setIt->y() << ")\n";
-          //   }
-          // }
-          for (auto setIt = upperSteiners.begin(); setIt != upperSteiners.end(); ++setIt) {
-            getInterLayerSteinerEdge(*setIt, layerNum, upperLayerNum, steinerSet, steinerEdgeSet);
-          }
-
-
-          // seg steiners
-          std::set<frPoint> segSteiners;
-          segSteiners.insert(lowerSteiners.begin(), lowerSteiners.end());
-          segSteiners.insert(upperSteiners.begin(), upperSteiners.end());
-          
-          frPoint start, end;
-          if (dir == frcHorzPrefRoutingDir) {
-            start = frPoint(currIntvSetIt->lower(), gCellRowCenter);
-            end = frPoint(currIntvSetIt->upper(), gCellRowCenter);
-          } else if (dir == frcVertPrefRoutingDir) {
-            start = frPoint(gCellRowCenter, currIntvSetIt->lower());
-            end = frPoint(gCellRowCenter, currIntvSetIt->upper());
-          }
-          // fix for term at segment endpoint gcells
-          steinerSet.insert(std::make_pair(start, layerNum));
-          steinerSet.insert(std::make_pair(end, layerNum));
-          segSteiners.insert(start);
-          segSteiners.insert(end);
-          if (enableOutput) {
-          
-          // if (netName == "net107211") {
-
-            std::cout << "Curr Seg: (" << start.x() << ", " << start.y() << ") -- ("
-                      << end.x() << ", " << end.y() << ") layer " << layerNum << "\n";
-            std::cout << "Steiners:\n";
-            for (auto setIt = segSteiners.begin(); setIt != segSteiners.end(); ++setIt) {
-              std::cout << "  (" << setIt->x() << ", " << setIt->y() << ")\n";
-              // if (dir == frcHorzPrefRoutingDir) { 
-              //   std::cout << "  (" << *setIt << ", " << gCellRowCenter <<")\n";
-              // } else if (dir == frcVertPrefRoutingDir) {
-              //   std::cout << "  (" << gCellRowCenter << ", " << *setIt <<")\n";
-              // }
-            }
-          }
-
-          // add current layer 
-          if (!segSteiners.empty()) {
-            for (auto setIt = segSteiners.begin(); std::next(setIt) != segSteiners.end(); ++setIt) {
-              steinerEdgeSet.insert(std::make_pair(std::make_pair(*setIt, layerNum), std::make_pair(*(std::next(setIt)), layerNum)) );
-            }
-          }
-
-        }
-        
-      }
-    }
-
-    // add steiner vertex 
-    for (auto steinerIt = steinerSet.begin(); steinerIt != steinerSet.end(); ++steinerIt) {
-
-      std::unique_ptr<frSteiner> steiner = std::make_unique<frSteiner>();
-      steiner->setPoint(steinerIt->first);
-      steiner->setLayerNum(steinerIt->second);
-      steiner->addToNet(net);
-      auto rptr = steiner.get();
-      steiner2Ptr[*steinerIt] = rptr;
-      net->addSteiner(steiner);
-      net->addVertex(rptr);
-      //std::cout << "Steiner: " << steinerIt->first << ", layer " << steinerIt->second << "\n";
-    }
-    // add edge between steiners
-    for (auto edgeIt = steinerEdgeSet.begin(); edgeIt != steinerEdgeSet.end(); ++edgeIt) {
-      auto &startSteiner = edgeIt->first;
-      auto &endSteiner = edgeIt->second;
-      std::shared_ptr<frGuideGlobal> edge = std::make_shared<frGuideGlobal>();
-      edge->setPoints(startSteiner.first, endSteiner.first);
-      edge->setBeginLayerNum(startSteiner.second);
-      edge->setEndLayerNum(endSteiner.second);
-      edge->addToNet(net);
-      // TODO: may need to chagne from frRoute to frGuide
-      // std::shared_ptr<frRoute> route = std::make_shared<frRoute>();
-      // frCollection<std::shared_ptr<frConnFig> > tmpObjs;
-      // tmpObjs.push_back(edge);
-      // route->setObjects(tmpObjs);
-      // route->addToNet(net);
-      // std::cout << "edge: (" << startSteiner.first.x() << ", " << startSteiner.first.y() << ", " << startSteiner.second
-      //           << "), ("    << endSteiner.first.x() << ", " << endSteiner.first.y() << ", " << endSteiner.second << "\n";
-      //net->addEdge(steiner2Ptr[startSteiner], steiner2Ptr[endSteiner], route);
-      net->addEdge(steiner2Ptr[startSteiner], steiner2Ptr[endSteiner], edge);
-
-    }
-
-    // temp solution: add pin Obj as vertex
-    std::set<frBlockObject*> termInstTermSet;
-
-    // add edge between steiner and term/instTerm
-    for (auto pinGCellIt = gCell2PinMap.begin(); pinGCellIt != gCell2PinMap.end(); ++pinGCellIt) {
-      auto &gCellCenter = pinGCellIt->first;
-      for (auto setIt = pinGCellIt->second.begin(); setIt != pinGCellIt->second.end(); ++setIt) {
-        auto pinObj = setIt->first;
-        auto pinLayer = setIt->second;
-        auto pinSteiner = std::make_pair(gCellCenter, pinLayer);
-        if (steiner2Ptr.find(pinSteiner) != steiner2Ptr.end()) {
-          //auto steinerPtr = steiner2Ptr[pinSteiner];
-          std::shared_ptr<frGuideShortConn> edge = std::make_shared<frGuideShortConn>();
-          edge->setPoints(pinSteiner.first, pinSteiner.first);
-          edge->setBeginLayerNum(pinLayer);
-          edge->setEndLayerNum(pinLayer);
-          edge->addToNet(net);
-          // TODO: may need to chagne from frRoute to frGuide
-          // std::shared_ptr<frRoute> route = std::make_shared<frRoute>();
-          // frCollection<std::shared_ptr<frConnFig> > tmpObjs;
-          // tmpObjs.push_back(edge);
-          // route->setObjects(tmpObjs);
-          // route->addToNet(net);
-          
-          // temp solution: add pin Obj as vertex
-          if (termInstTermSet.find(pinObj) == termInstTermSet.end()) {
-            net->addVertex(pinObj);
-            termInstTermSet.insert(pinObj);
-          }
-
-          //net->addEdge(pinObj, steiner2Ptr[pinSteiner], edge);
-          net->addEdge(steiner2Ptr[pinSteiner], pinObj, edge);
-
-        } else {
-          // TODO: may need to append route guide
-          // std::cout << "Warning: Part of pin not covered by GR solution.\n";
-        }
-      }
-
-
-    }
-
-
-  }
-
-  void getInterLayerSteinerEdge(frPoint steiner, 
-                      frLayerNum lowerLayerNum, 
-                      frLayerNum upperLayerNum,
-                      std::set<std::pair<frPoint, frLayerNum> > &steinerSet,
-                      // std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> >, guideSteinerCmp> &steinerEdgeSet) {
-                      std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > > &steinerEdgeSet) {
-    std::pair<frPoint, frLayerNum> upperSteiner, lowerSteiner;
-    lowerSteiner = std::make_pair(steiner, lowerLayerNum);
-    upperSteiner = std::make_pair(steiner, upperLayerNum);
-    steinerSet.insert(lowerSteiner);
-    steinerSet.insert(upperSteiner);
-    auto steinerEdge = std::make_pair(lowerSteiner, upperSteiner);
-    steinerEdgeSet.insert(steinerEdge);
-  }
-
-  void getGSegSteiner(boostSegment &currGSeg,
-                          frPrefRoutingDir &currDir,
-                          std::map<frCoord, boost::icl::interval_set<frCoord> > &neighborGCell2RowMap,
-                          std::set<frPoint> &steiners) {
-    boostSegment neighborGSeg;
-    for (auto rowIt = neighborGCell2RowMap.begin(); rowIt != neighborGCell2RowMap.end(); ++rowIt) {
-      auto &neighborGCellRowCenter = rowIt->first;
-      auto &neightborIntvSet = rowIt->second;
-      for (auto neightborIntvSetIt = neightborIntvSet.begin(); neightborIntvSetIt != neightborIntvSet.end(); ++neightborIntvSetIt) {
-        if (currDir == frcHorzPrefRoutingDir) {
-          neighborGSeg = boostSegment(boostPoint(neighborGCellRowCenter, neightborIntvSetIt->lower()),
-                                      boostPoint(neighborGCellRowCenter, neightborIntvSetIt->upper()));
-        } else if (currDir == frcVertPrefRoutingDir) {
-          neighborGSeg = boostSegment(boostPoint(neightborIntvSetIt->lower(), neighborGCellRowCenter),
-                                      boostPoint(neightborIntvSetIt->upper(), neighborGCellRowCenter));
-        }
-        // if (neighborGCellRowCenter == 115600) {
-        //   std::cout << neighborGCellRowCenter << "\n";
-        // }
-        // TODO: not sure whether intersects is buggy or not
-        if (bg::intersects(currGSeg, neighborGSeg)) {
-          // BOOST INTERSECTION IS BUGGY!!!
-          frCollection<boostPoint> intersectPoints;
-          bg::intersection(currGSeg, neighborGSeg, intersectPoints);
-          // for (auto intersectPoint: intersectPoints) {
-          //   frPoint tmpSteiner;
-          //   tmpSteiner.set(bg::get<0>(intersectPoint), bg::get<1>(intersectPoint));
-          //   steiners.insert(tmpSteiner);
-          // }
-          frPoint boostSteiner;
-          boostSteiner.set(bg::get<0>(intersectPoints[0]), bg::get<1>(intersectPoints[0]));
-          frPoint tmpSteiner;
-          if (currDir == frcHorzPrefRoutingDir) {
-            tmpSteiner.set(neighborGCellRowCenter, bg::get<0,1>(currGSeg));
-          } else if (currDir == frcVertPrefRoutingDir) {
-            tmpSteiner.set(bg::get<0,0>(currGSeg), neighborGCellRowCenter);
-          }
-          // if (tmpSteiner.x() != boostSteiner.x() || tmpSteiner.y() != boostSteiner.y()) {
-          //   std::cout << "Warning: inconsistent restlt from Boost\n";
-          //   std::cout << "Boost (" << boostSteiner.x() << ", " << boostSteiner.y() 
-          //             << ") and our (" << tmpSteiner.x() << ", " << tmpSteiner.y() << ")\n";
-          // }
-          steiners.insert(tmpSteiner);
-
-        }
-      }
-    }
-  }
-
-  void appendTouchingGuideIntv(std::map<frLayerNum, std::map<frCoord, boost::icl::interval_set<frCoord> > > &layerGCell2IntvSet,
-                               std::vector<std::shared_ptr<fr::frLayer> > &vlayers) {
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    //frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    //frCoord GCELLOFFSETY = getGCELLOFFSETY();
-
-    for (auto layerIt = layerGCell2IntvSet.begin(); layerIt != layerGCell2IntvSet.end(); ++layerIt) {
-      auto currLayer = layerIt->first;
-      auto currDir = vlayers[currLayer]->getDir();
-      auto &gCell2IntvSet = layerIt->second;
-      frLayerNum nextLayer = -1;
-      if ((currLayer + 2) < (int)vlayers.size()) {
-        nextLayer = currLayer + 2;
-      } else if ((currLayer - 2) >= 0) {
-        nextLayer = currLayer - 2;
-      }
-      if (nextLayer == -1) {
-        continue;
-      }
-      frCoord gCellTrackPitch = (currDir == frcHorzPrefRoutingDir) ? GCELLGRIDY : GCELLGRIDX;
-      //frCoord gCellTrackPitchNext = (currDir == frcHorzPrefRoutingDir) ? GCELLGRIDX : GCELLGRIDY;
-      // std::cout << "gCellTrackPitchNext = " << gCellTrackPitchNext << ", gCellTrackPitch = " << gCellTrackPitch << "\n";
-      if (gCell2IntvSet.empty()) {
-        continue;
-      } else {
-        for (auto gCellRowIt = gCell2IntvSet.begin(); std::next(gCellRowIt) != gCell2IntvSet.end(); ++gCellRowIt) {
-          frCoord currRow = gCellRowIt->first;
-          frCoord nextRow = (std::next(gCellRowIt))->first;
-          auto &currIntvSet = gCellRowIt->second;
-          auto &nextIntvSet = (std::next(gCellRowIt))->second;
-          if ((nextRow - currRow) != gCellTrackPitch) {
-            continue;
-          }
-
-          // check and get append guide intv;
-          auto overlapIntvSet = currIntvSet & nextIntvSet;
-          // std::cout << "overlapped intvSet size = " << overlapIntvSet.size() << std::endl;
-          for (auto overlapIntvSetIt = overlapIntvSet.begin(); overlapIntvSetIt != overlapIntvSet.end(); ++overlapIntvSetIt) {
-            bool needBridge = true;
-            auto nextLayerStartRow = overlapIntvSetIt->lower();
-            auto nextLayerEndRow = overlapIntvSetIt->upper();
-            // std::cout << nextLayerStartRow << " " << nextLayerEndRow << "\n";
-            // if (nextLayerStartRow != nextLayerEndRow) {
-            //   std::cout << "Warning: parallel touching guide acrossing " << (nextLayerEndRow - nextLayerStartRow) / gCellTrackPitchNext + 1 << " gcells\n";
-
-            // }
-            // for (auto nextLayerRow = nextLayerStartRow; nextLayerRow <= nextLayerEndRow; nextLayerRow += gCellTrackPitchNext) {
-            //   layerGCell2IntvSet[nextLayer][nextLayerRow].insert(boost::icl::interval_set<frCoord>::interval_type::closed(currRow, nextRow));
-            // }
-
-            // check if bridge already exists
-            for (auto nextLayerRow = nextLayerStartRow; nextLayerRow <= nextLayerEndRow; ++nextLayerRow) {
-              if (currLayer + 2 < (int)vlayers.size()) {
-                frLayerNum tmpNextLayer = currLayer + 2;
-                if (layerGCell2IntvSet.find(tmpNextLayer) != layerGCell2IntvSet.end()) {
-                  if (layerGCell2IntvSet[tmpNextLayer].find(nextLayerRow) != layerGCell2IntvSet[tmpNextLayer].end()) {
-                    // std::cout << "here\n";
-                    auto bridgeIntv = boost::icl::interval_set<frCoord>::interval_type::closed(currRow, nextRow);
-                    boost::icl::interval_set<frCoord> bridgeIntvSet;
-                    bridgeIntvSet.insert(bridgeIntv);
-                    auto bridgeIntersectIntvSet = bridgeIntvSet & layerGCell2IntvSet[tmpNextLayer][nextLayerRow];
-                    for (auto it = bridgeIntersectIntvSet.begin(); it != bridgeIntersectIntvSet.end(); ++it) {
-                      if (*it == bridgeIntv) {
-                        needBridge = false;
-                        // std::cout << "existing upper bridge\n";
-                        break;
-                      }
-                    }
-                    // if (!bridgeIntersectIntvSet.empty() && bridgeIntersectIntvSet.size() == 1 && *(bridgeIntersectIntvSet.begin()) == bridgeIntv) {
-                    //   std::cout << "bridge exists\n";
-                    //   needBridge = false;
-                    //   break;
-                    // }
-                  }
-                }
-                
-
-              }
-              if (currLayer - 2 >= 0) {
-                frLayerNum tmpNextLayer = currLayer - 2;
-
-                if (layerGCell2IntvSet.find(tmpNextLayer) != layerGCell2IntvSet.end()) {
-                  if (layerGCell2IntvSet[tmpNextLayer].find(nextLayerRow) != layerGCell2IntvSet[tmpNextLayer].end()) {
-                    auto bridgeIntv = boost::icl::interval_set<frCoord>::interval_type::closed(currRow, nextRow);
-                    boost::icl::interval_set<frCoord> bridgeIntvSet;
-                    bridgeIntvSet.insert(bridgeIntv);
-                    auto bridgeIntersectIntvSet = bridgeIntvSet & layerGCell2IntvSet[tmpNextLayer][nextLayerRow];
-                    for (auto it = bridgeIntersectIntvSet.begin(); it != bridgeIntersectIntvSet.end(); ++it) {
-                      if (*it == bridgeIntv) {
-                        needBridge = false;
-                        // std::cout << "existing lower bridge\n";
-                        break;
-                      }
-                    }
-                    // if (!bridgeIntersectIntvSet.empty() && bridgeIntersectIntvSet.size() == 1 && *(bridgeIntersectIntvSet.begin()) == bridgeIntv) {
-                    //   needBridge = false;
-                    //   std::cout << "bridge exists\n";
-                    //   break;
-                    // }
-                  }
-                }
-
-              }   
-            }
-
-            if (needBridge) {
-              layerGCell2IntvSet[nextLayer][nextLayerStartRow].insert(boost::icl::interval_set<frCoord>::interval_type::closed(currRow, nextRow));
-            }
-
-          }
-        }
-      }
-    }
-  }
-
-
-  void checkGRConnectivity(std::map<std::string, std::shared_ptr<fr::frNet> > &nets) {
-    bool enableOutput = false;
-    std::cout << "Checking GR connectivity\n";
-    for (auto &net: nets) {
-      frString netName;
-      net.second->getName(netName);
-      
-      vertex_descriptor_map_t idxMap;
-      boost::associative_property_map<vertex_descriptor_map_t> indexMap(idxMap);
-      vertex_iterator_t di, dj;
-      boost::tie(di, dj) = boost::vertices(net.second->g);
-      for(int i = 0; di != dj; ++di,++i){
-          boost::put(indexMap, (*di), i);
-      }
-      std::map<vertex_descriptor_t, size_t> compMap;
-      boost::associative_property_map<vertex_descriptor_map_t> componentMap(compMap);            
-      auto num_comps = boost::connected_components(net.second->g, componentMap, boost::vertex_index_map(indexMap)); 
-      
-      // std::cout << netName << std::endl;
-      if (enableOutput) {
-        std::cout << netName << ": graph info: num_v = " <<boost::num_vertices(net.second->g) 
-             <<", num_e = " <<boost::num_edges(net.second->g) 
-             <<", num_parts = " <<num_comps << std::endl;
-      }
-      // if (boost::num_vertices(net.second->g) == 0) {
-      //   std::cout <<"Warning: " <<netName <<" has no wires" << std::endl;
-      // }
-      // if (boost::num_vertices(net.second->g) > 0 && 
-      //     boost::num_vertices(net.second->g) - boost::num_edges(net.second->g) != 1) {
-      //   std::cout <<"Warning: " <<netName <<" has redundant wires" << std::endl;
-      // }
-      if (boost::num_vertices(net.second->g) > 0 && num_comps != 1) {
-        std::cout <<"Warning: " <<netName <<" is open and it has " << num_comps << " parts" << std::endl;
-        std::map<size_t, int> ccCnt;
-        for (auto mapIt = compMap.begin(); mapIt != compMap.end(); ++mapIt) {
-          auto ccIdx = mapIt->second;
-          if (ccCnt.find(ccIdx) == ccCnt.end()) {
-            ccCnt[ccIdx] = 0;
-          }
-          ccCnt[ccIdx]++;
-        }
-
-        for (auto setIt = ccCnt.begin(); setIt != ccCnt.end(); ++setIt) {
-          std::cout << "  ccIdx = " << setIt->first << ", count = " << setIt->second << "\n";
-        }
-
-        // debug
-        //if (netName == "net107211") {
-        //  std::map<size_t, std::set<vertex_descriptor_t> > ccVertex;
-        //  for (auto mapIt = compMap.begin(); mapIt != compMap.end(); ++mapIt) {
-        //    auto ccIdx = mapIt->second;
-        //    ccVertex[ccIdx].insert(mapIt->first);
-        //  }
-
-        //  for (auto mapIt = ccVertex.begin(); mapIt != ccVertex.end(); ++mapIt) {
-        //    auto ccIdx = mapIt->first;
-        //    std::cout << "====CCIdx " << ccIdx << "====\n";
-        //    int tmpCnt = 0;
-        //    for (auto vertexIt = mapIt->second.begin(); vertexIt != mapIt->second.end(); ++vertexIt) {
-        //      auto vertexPtr = net.second->g[*vertexIt].objPtr;
-        //      std::cout << "location " << tmpCnt << ": ";
-        //      if (vertexPtr->typeId() == frcInstTerm) {
-        //        auto pins = std::dynamic_pointer_cast<frInstTerm>(vertexPtr)->getTerm()->getPins();
-        //        auto pinFigs = pins[0]->getFigs();
-        //        frString instName;
-        //        std::dynamic_pointer_cast<frInstTerm>(vertexPtr)->getInst()->getName(instName);
-        //        frBox pinBox;
-        //        pinFigs[0]->getBBox(pinBox);
-        //        std::cout << "(" << pinBox.left() << ", " << pinBox.bottom() << ") of inst " << instName << "\n";
-        //      } else if (vertexPtr->typeId() == frcTerm) {
-        //        auto pins = std::dynamic_pointer_cast<frTerm>(vertexPtr)->getPins();
-        //        auto pinFigs = pins[0]->getFigs();
-        //        frBox pinBox;
-        //        pinFigs[0]->getBBox(pinBox);
-        //        std::cout << "(" << pinBox.left() << ", " << pinBox.bottom() << ")\n";
-        //      } else if (vertexPtr->typeId() == frcSteiner) {
-        //        auto steiner = std::dynamic_pointer_cast<frSteiner>(vertexPtr);
-        //        frBox steinerBox;
-        //        steiner->getBBox(steinerBox);
-        //        std::cout << "(" << steinerBox.left() << ", " << steinerBox.bottom() << ", " << steiner->getLayerNum() << ")\n";
-        //      }
-        //      tmpCnt++;
-
-        //    }
-        //  }
-
-        //}
-
-      }
-
-    }
-  }
-
-  frPoint getGCellCenter(frPoint pointIn) {
-    frCoord centerX, centerY;
-    frPoint pointOut;
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    frCoord GCELLOFFSETY = getGCELLOFFSETY();
-
-    centerX = (pointIn.x() - GCELLOFFSETX) / GCELLGRIDX * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2;
-    centerY = (pointIn.y() - GCELLOFFSETY) / GCELLGRIDY * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2;
-    pointOut.set(centerX, centerY);
-    return pointOut;
-
-
-  }
-
-  void printGCellInfo() {
-    std::cout << "GCELLGRIDX = " << getGCELLGRIDX() << std::endl;
-    std::cout << "GCELLGRIDY = " << getGCELLGRIDY() << std::endl;
-    std::cout << "GCELLOFFSETX = " << getGCELLOFFSETX() << std::endl;
-    std::cout << "GCELLOFFSETY = " << getGCELLOFFSETY() << std::endl;
-
-  }
-
-  void getLocalNetStats(const std::map<std::string, std::map<frPoint, std::set<std::pair<std::shared_ptr<frBlockObject>, frLayerNum> > > > &gCell2PinMap) {
-    std::cout << "Getting local net stats...\n";
-    std::set<std::string> netNames;
-    std::set<frPoint> gCellCenters;
-    int totLocalNetCnt = 0;
-    for (auto netIt = gCell2PinMap.begin(); netIt != gCell2PinMap.end(); ++netIt) {
-      auto netName = netIt->first;
-      netNames.insert(netName);
-      auto &gCellMap = netIt->second;
-      for (auto gCellIt = gCellMap.begin(); gCellIt != gCellMap.end(); ++gCellIt) {
-        auto gCellCenter = gCellIt->first;
-        auto &pins = gCellIt->second;
-        gCellCenters.insert(gCellCenter);
-        if (pins.size() >= 2) {
-          totLocalNetCnt++;
-        }
-
-      }
-    }
-
-    std::cout << "#local net = " << totLocalNetCnt 
-              << ", among #total net = " << netNames.size() 
-              << ", in #non-empty gcell = " << gCellCenters.size() << "\n"; 
-    
-  }
-
-
-  void KMBTermSteinerTree(frNet &net,
-                          graph_t &netG,
-                          const std::shared_ptr<frCMap> &cMap,
-                          std::set<std::shared_ptr<frConnFig> > &routes) {
-    bool enableOutput = false;
-    if (enableOutput) {
-      std::cout << "net: " << net.getName() << std::endl << std::flush;
-    }
-    //if (net.getName() == "rtr/rof_0__bmrb/fifo_data[201]") {
-    // return;
-    //}
-    //if (net.getName() == "rtr/rof_0__bmrb/fifo_data[217]") {
-    // return;
-    //}
-
-    vertex_descriptor_map_t idxMap;
-    boost::associative_property_map<vertex_descriptor_map_t> indexMap(idxMap);
-    vertex_iterator_t di, dj;
-    // boost::tie(di, dj) = boost::vertices(net.g);
-    boost::tie(di, dj) = boost::vertices(netG);
-    for(int i = 0; di != dj; ++di,++i){
-      boost::put(indexMap, (*di), i);
-    }
-    std::map<vertex_descriptor_t, size_t> compMap;
-    boost::associative_property_map<vertex_descriptor_map_t> componentMap(compMap);            
-    // auto num_comps = boost::connected_components(net.g, componentMap, boost::vertex_index_map(indexMap)); 
-    auto num_comps = boost::connected_components(netG, componentMap, boost::vertex_index_map(indexMap)); 
-    if (num_comps != 1) {
-      return;
-    }
-    
-    
-    int numVertex = boost::num_vertices(netG);
-    double LARGEDOUBLE = std::numeric_limits<double>::max() / numVertex;
-    std::vector<std::pair<boost::graph_traits<KMBGraph>::vertex_descriptor, boost::graph_traits<KMBGraph>::vertex_descriptor > > pathEdges;
-    std::vector<double> pathWeights;
-    KMBGraph g;
-    boost::property_map<KMBGraph, boost::edge_weight_t>::type weightmap = boost::get(boost::edge_weight, g);
-    vertex_iterator_t v, v_end;
-    std::map<frBlockObject*, boost::graph_traits<KMBGraph>::vertex_descriptor> iteratorMap;
-    if (numVertex <= 1) {
-      return;
-    }
-
-    // add vertex
-    for (boost::tie(v, v_end) = boost::vertices(netG); v != v_end; ++v) {
-      auto tmpV = boost::add_vertex(g);
-      g[tmpV].objPtr = netG[*v].objPtr;
-      iteratorMap[netG[*v].objPtr] = tmpV;
-    }
-    // add edge
-    for (boost::tie(v, v_end) = boost::vertices(netG); v != v_end; ++v) {
-      adjacency_iterator_t adj_v, adj_v_end;
-      for (tie(adj_v, adj_v_end) = boost::adjacent_vertices(*v, netG); adj_v != adj_v_end; ++adj_v) {
-        double edgeWeight = getKMBEdgeWeight(netG[*v].objPtr, netG[*adj_v].objPtr, cMap);
-        boost::add_edge( (iteratorMap[netG[*v].objPtr]), (iteratorMap[netG[*adj_v].objPtr]), edgeWeight, g);
-      } 
-    }
-    // KMB initialization
-    std::vector<boost::graph_traits < KMBGraph >::vertex_descriptor> predecessors(num_vertices(g));
-    std::vector<double> distances(num_vertices(g));
-    std::vector<std::vector<boost::graph_traits < KMBGraph >::vertex_descriptor> > paths;
-    std::map<std::pair<boost::graph_traits<KMBGraph>::vertex_descriptor, boost::graph_traits<KMBGraph>::vertex_descriptor >, int > gEdge2PathIdxMap;
-    // shortest path from each terminal to others
-    boost::graph_traits< KMBGraph >::vertex_iterator term_v, term_v_end;
-    int terminalCnt = 0;
-    for (boost::tie(term_v, term_v_end) = boost::vertices(g); term_v != term_v_end; ++term_v) {
-      if ((g[*term_v].objPtr)->typeId() == frcSteiner) {
-        continue;
-      } else {
-        terminalCnt++;
-        boost::dijkstra_shortest_paths(g, *term_v,
-                                       boost::predecessor_map(boost::make_iterator_property_map(predecessors.begin(), boost::get(boost::vertex_index, g))).
-                                       distance_map(boost::make_iterator_property_map(distances.begin(), boost::get(boost::vertex_index, g))));
-        boost::graph_traits < KMBGraph >::vertex_iterator vi, vend;
-        for (boost::tie(vi, vend) = boost::vertices(g); vi != vend; ++vi) {
-          if (*vi == *term_v || (g[*vi].objPtr)->typeId() == frcSteiner) {
-            continue;
-          }
-          std::vector< boost::graph_traits<KMBGraph>::vertex_descriptor > path;
-          boost::graph_traits<KMBGraph>::vertex_descriptor current, end;
-          double pathWeight = distances[*vi];
-          end = *vi;
-          current = end;
-          while (current != *term_v) {
-            //std::cout << "here1\n" << std::flush;
-            path.push_back(current);
-            current = predecessors[current];
-          }
-          path.push_back(current);
-          pathEdges.push_back(std::make_pair(path.front(), path.back()));
-          pathWeights.push_back(pathWeight);
-          gEdge2PathIdxMap[std::make_pair(std::min(path.front(), path.back()), std::max(path.front(), path.back()))] = (int)paths.size();
-          paths.push_back(path);
-        }
-      }
-    }
-
-    // generate pathgraph
-    KMBGraph pathG(pathEdges.begin(), pathEdges.end(), pathWeights.begin(), terminalCnt);
-    // std::vector<boost::graph_traits<KMBGraph>::vertex_descriptor> pathP(num_vertices(pathG));
-    // std::vector<double> pathD(num_vertices(pathG));
-    // std::vector<std::vector< boost::graph_traits< KMBGraph >::vertex_descriptor > > pathPaths;
-    std::vector<boost::graph_traits < KMBGraph >::edge_descriptor> spanning_tree;
-    std::set<std::pair<boost::graph_traits<KMBGraph>::vertex_descriptor, boost::graph_traits<KMBGraph>::vertex_descriptor > > mstEdgeSet;
-    // generate mst from pathGraph
-    boost::kruskal_minimum_spanning_tree(pathG, back_inserter(spanning_tree));
-    for (auto ei = spanning_tree.begin(); ei != spanning_tree.end(); ++ei) {
-      auto u = source(*ei, pathG);
-      auto v = target(*ei, pathG);
-      std::pair<boost::graph_traits<KMBGraph>::vertex_descriptor, boost::graph_traits<KMBGraph>::vertex_descriptor >  tempEdge = std::make_pair(std::min(u, v), std::max(u, v));
-      for (int i = 0; i < (int)paths[gEdge2PathIdxMap[tempEdge]].size() - 1; i++) {
-        auto u = paths[gEdge2PathIdxMap[tempEdge]][i];
-        auto v = paths[gEdge2PathIdxMap[tempEdge]][i + 1];
-        mstEdgeSet.insert(std::make_pair(std::min(u, v), std::max(u, v)));
-      }
-    }
-    // Iterate all edges in the original graph, set weight to infinity if 
-    // it is not in msgEdgeSet
-    auto es = boost::edges(g);
-    for (auto eit = es.first; eit != es.second; eit++) {
-      auto u = source(*eit, g);
-      auto v = target(*eit, g);
-      auto tempEdge = std::make_pair(std::min(u,v), std::max(u,v));
-      if (mstEdgeSet.find(tempEdge) == mstEdgeSet.end()) {
-        weightmap[*eit] = LARGEDOUBLE;
-      }
-    }
-    // generate mst in updated graph
-    //boost::graph_traits<KMBGraph>::vertex_descriptor firstTermVertex;
-    //boost::graph_traits<KMBGraph>::vertex_descriptor firstVertex;
-
-    //boost::graph_traits < KMBGraph >::vertex_iterator vi, vend;
-    //for (boost::tie(vi, vend) = boost::vertices(g); vi != vend; ++vi) {
-    //  if (std::dynamic_pointer_cast<frSteiner>(g[*vi].objPtr)) {
-    //    continue;
-    //  }
-    //  firstTermVertex = *vi;
-    //  break;
-    //}
-    //for (boost::tie(vi, vend) = boost::vertices(g); vi != vend; ++vi) {
-    //  firstVertex = *vi;
-    //  break;
-    //}
-
-    // std::vector<boost::graph_traits < KMBGraph >::vertex_descriptor> resultPred(num_vertices(g));
-    std::vector<boost::graph_traits < KMBGraph >::edge_descriptor> result_spanning_tree;
-    boost::kruskal_minimum_spanning_tree(g, back_inserter(result_spanning_tree));
-    // std::cout << "result\n";
-    for (auto ei = result_spanning_tree.begin(); ei != result_spanning_tree.end(); ++ei) {
-      auto u = source(*ei, g);
-      auto v = target(*ei, g);
-      // for (int i = 0; i < (int)paths[gEdge2PathIdxMap[tempEdge]].size() - 1; i++) {
-        // auto u = paths[gEdge2PathIdxMap[tempEdge]][i];
-        // auto v = paths[gEdge2PathIdxMap[tempEdge]][i + 1];
-        // mstEdgeSet.insert(std::make_pair(std::min(u, v), std::max(u, v)));
-      // std::cout << "  " << u << ", " << v << "\n";
-      // }
-      auto edge = boost::edge(u, v, g).first;
-      if (weightmap[edge] != LARGEDOUBLE) {
-        auto netG_u = (g[u].objPtr)->getVertexDescriptor();
-        auto netG_v = (g[v].objPtr)->getVertexDescriptor();
-        if (boost::edge(netG_u, netG_v, netG).second == true) {
-          edge_descriptor_t routeEdge = (boost::edge(netG_u, netG_v, netG).first);
-          routes.insert(netG[routeEdge].objPtr);
-        }
-      }
-    }
-
-
-  }
-
-  double getKMBEdgeWeight(frBlockObject* start,
-                          frBlockObject* end,
-                          const std::shared_ptr<frCMap> &cMap) {
-    //return 1;
-
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    //frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    //frCoord GCELLOFFSETY = getGCELLOFFSETY();
-    double weight = 0.0;
-    double LARGEWEIGHT = 99;
-    double SMALLWEIGHT = 1;
-    double VIAWEIGHT = 10;
-    frLayerNum startLayerNum, endLayerNum;
-    // Since every terminal has to be connected, so set distance 
-    // from edge to them to zero assuming each term is connected
-    // to the steiner of the GCell that the terminal belongs to
-    // p.s., potentially a pin can have access point on different 
-    // layers, prefer access point on higher layer than lower layer
-    if (start->typeId() == frcInstTerm ||
-        start->typeId() == frcTerm || 
-        end->typeId() == frcInstTerm || 
-        end->typeId() == frcTerm) {
-      weight = SMALLWEIGHT;
-      return weight;
-    }
-
-    // for steiner to steiner, get the summation of track utilization 
-    // along the direct edge
-    frPoint startPoint, endPoint;
-    if (start->typeId() == frcSteiner) {
-      static_cast<frSteiner*>(start)->getPoint(startPoint);
-      startLayerNum = static_cast<frSteiner*>(start)->getLayerNum();
-    } else {
-      // frBlockObject is none of Term, InstTerm or Steiner
-      return LARGEWEIGHT;
-    }
-    if (end->typeId() == frcSteiner) {
-      static_cast<frSteiner*>(end)->getPoint(endPoint);
-      endLayerNum = static_cast<frSteiner*>(end)->getLayerNum();
-    } else {
-      return LARGEWEIGHT;
-    }
-
-    if (startPoint.x() != endPoint.x() && startPoint.y() != endPoint.y()) {
-      return LARGEWEIGHT;
-    }
-
-    // start sum up the congestion along the line;
-    // via guide
-    if (startPoint.x() == endPoint.x() && startPoint.y() == endPoint.y()) {
-      if (startLayerNum == endLayerNum) {
-        return SMALLWEIGHT;
-      } else {
-        return VIAWEIGHT;
-      }
-    } else {
-      // assuming that both startPoint and endPoint are center of gcell
-      if (startPoint.x() == endPoint.x()) {
-        auto startY = std::min(startPoint.y(), endPoint.y());
-        auto endY = std::max(startPoint.y(), endPoint.y());
-        for (auto yCoord = startY; yCoord <= endY; yCoord += GCELLGRIDY) {
-          weight += getGCellCongestionScore(frPoint(startPoint.x(), yCoord), startLayerNum, cMap);
-        }
-      } else if (startPoint.y() == endPoint.y()) {
-        auto startX = std::min(startPoint.x(), endPoint.x());
-        auto endX = std::max(startPoint.x(), endPoint.x());
-        for (auto xCoord = startX; xCoord <= endX; xCoord += GCELLGRIDX) {
-          weight += getGCellCongestionScore(frPoint(xCoord, startPoint.y()), startLayerNum, cMap);
-        }
-      }
-    }
-
-    return weight;
-
-
-    // return 1.0;
-  }
-
-  double getGCellCongestionScore(frPoint point, frLayerNum &layerNum, const std::shared_ptr<frCMap> &cMap) {
-    double congestionScore = 0.0;
-
-    frCoord GCELLGRIDX = getGCELLGRIDX();
-    frCoord GCELLGRIDY = getGCELLGRIDY();
-    frCoord GCELLOFFSETX = getGCELLOFFSETX();
-    frCoord GCELLOFFSETY = getGCELLOFFSETY();
-
-    int xIndex = (point.x() - GCELLOFFSETX) / GCELLGRIDX;
-    xIndex = (xIndex > (int)cMap->getNumX()) ? cMap->getNumX() : xIndex;
-    int yIndex = (point.y() - GCELLOFFSETY) / GCELLGRIDY;
-    yIndex = (yIndex > (int)cMap->getNumY()) ? cMap->getNumY() : yIndex;
-
-    auto supply = cMap->getSupply(xIndex, yIndex, layerNum);
-    auto edge1Demand = cMap->getEdge1Demand(xIndex, yIndex, layerNum);
-    auto edge2Demand = cMap->getEdge2Demand(xIndex, yIndex, layerNum);
-    auto localDemand = cMap->getLocalDemand(xIndex, yIndex, layerNum);
-    auto throughDemand = cMap->getThroughDemand(xIndex, yIndex, layerNum);
-
-    congestionScore = 1.0 * (throughDemand + (edge1Demand + edge2Demand) / 2.0 + localDemand) / supply;
-
-    return congestionScore;
-
-
-  }
-
-}
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.h b/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.h
deleted file mode 100644
index 8e412b0..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frGuidePrep.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_GUIDE_PREP_H_
-#define _FR_GUIDE_PREP_H_
-
-#include "frBaseTypes.h"
-#include <map>
-#include <utility>
-#include <tuple>
-#include "db/tech/frLayer.h"
-#include "db/obj/frBlock.h"
-//#include "frMacro.h"
-#include <memory>
-#include <string>
-#include <set>
-#include <boost/icl/interval_set.hpp>
-#include <boost/icl/interval_map.hpp>
-#include <boost/graph/connected_components.hpp>
-#include <boost/pending/disjoint_sets.hpp>
-#include <boost/icl/split_interval_map.hpp>
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/kruskal_min_spanning_tree.hpp>
-#include <boost/graph/dijkstra_shortest_paths.hpp>
-#include <boost/graph/prim_minimum_spanning_tree.hpp>
-
-
-namespace fr {
-
-
-  frCoord getGCELLGRIDX();
-  frCoord getGCELLGRIDY();
-  frCoord getGCELLOFFSETX();
-  frCoord getGCELLOFFSETY();
-  
-  void setGCELLGRIDX(frCoord &);
-  void setGCELLGRIDY(frCoord &);
-  void setGCELLOFFSETX(frCoord &);
-  void setGCELLOFFSETY(frCoord &);
-
-  struct guideSteinerCmp {
-    bool operator()(const std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > &lhs,
-                    const std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > &rhs) {
-      if (lhs.first == rhs.first) {
-        return (lhs.second > rhs.second);
-      } else {
-        return (lhs.first > rhs.first);
-      }
-    }
-  };
-
-  void getGCellParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers);
-  void getGCellSizeParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers);
-  void getGCellOffsetParam(std::map<std::string, fr::frCollection<fr::frRect> > &rawGuide, std::vector<std::shared_ptr<fr::frLayer> > &vlayers);
-  void printGCellInfo();
-
-  void updateXform(frTransform &xform, frPoint &size);
-  frBox point2GCellBox(frPoint &pointIn);
-  void genGCell2PinMap(std::map<std::string, std::shared_ptr<fr::frBlock> > &macros,
-                       std::map<std::string, std::shared_ptr<fr::frNet> > &nets,
-                       std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, frLayerNum> > > > &gCell2PinMap);
-  // update GCell2PinMap based on whether the term is intersecting with any GCell
-  void updateGCell2PinMap(frBlockObject* blockObj,
-                          frTerm* term,
-                          std::string netName,
-                          std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, frLayerNum> > > > &gCell2PinMap);
-  // void getStandardGuide(frCollection<frRect> &guidesIn,
-  //                       frCollection<frRect> &guidesOut,
-  //                       std::vector<std::shared_ptr<fr::frLayer> > layers);
-  void getStandardGuide(std::map<std::string, fr::frCollection<fr::frRect> > &tmpGuides,
-                        std::vector<std::shared_ptr<fr::frLayer> > &vlayers,
-                        std::map<std::string, std::shared_ptr<fr::frNet> > &nets,
-                        std::map<std::string, std::map<frPoint, std::set<std::pair<frBlockObject*, fr::frLayerNum> > > > &gCell2PinMap);
-  void getStandardGuide(frCollection<frRect> &guideRects,
-                        std::vector<std::shared_ptr<fr::frLayer> > &vlayers,
-                        std::shared_ptr<fr::frNet> &net,
-                        std::map<frPoint, std::set<std::pair<frBlockObject*, fr::frLayerNum> > > &gCell2PinMap);
-  // frCollection<std::set<int> > getGuideCluster(frCollection<frRect> &guideBoxes);
-  frPoint getGCellCenter(frPoint pointIn);
-  frCollection<frLayerNum> getPinLayerNum(std::shared_ptr<frBlockObject> &termIn);
-  
-  void getGSegSteiner(boostSegment &currGSeg,
-                          frPrefRoutingDir &currDir,
-                          std::map<frCoord, boost::icl::interval_set<frCoord> > &neighborGCell2RowMap,
-                          std::set<frPoint> &steiners);
-  void getInterLayerSteinerEdge(frPoint steiner, 
-                                frLayerNum lowerLayerNum, 
-                                frLayerNum upperLayerNum,
-                                std::set<std::pair<frPoint, frLayerNum> > &steinerSet,
-                                // std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> >, guideSteinerCmp> &steinerEdgeSet);
-                                std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > > &steinerEdgeSet);
-  
-  void checkGRConnectivity(std::map<std::string, std::shared_ptr<fr::frNet> > &nets);
-
-  void appendTouchingGuideIntv(std::map<frLayerNum, std::map<frCoord, boost::icl::interval_set<frCoord> > > &layerGCell2IntvSet,
-                               std::vector<std::shared_ptr<fr::frLayer> > &vlayers);
-  void getLocalNetStats(const std::map<std::string, std::map<frPoint, std::set<std::pair<std::shared_ptr<frBlockObject>, frLayerNum> > > > &gCell2PinMap);
-  
-  void KMBTermSteinerTree(frNet &net,
-                          graph_t &netG,
-                          const std::shared_ptr<frCMap> &cMap,
-                          std::set<std::shared_ptr<frConnFig> > &routes);
-  double getKMBEdgeWeight(frBlockObject* start,
-                          frBlockObject* end,
-                          const std::shared_ptr<frCMap> &cMap);
-  double getGCellCongestionScore(frPoint point, frLayerNum &layerNum, const std::shared_ptr<frCMap> &cMap);
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.cpp b/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.cpp
deleted file mode 100644
index 47caf3c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.cpp
+++ /dev/null
@@ -1,2055 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "global.h"
-#include "io/frPinPrep.h"
-#include "db/obj/frNet.h"
-#include <iostream>
-#include "ta/FlexTA.h"
-#include <boost/polygon/polygon.hpp>
-#include "io/frShapeUtil.h"
-#include "FlexAccessPattern.h"
-#include <iterator>
-#include <chrono>
-#include "drc/frDRC.h"
-#include "io/frAPG.h"
-
-using namespace boost::polygon::operators;
-using namespace std;
-using namespace fr;
-using namespace std::chrono;
-
-void FlexPinPrep::reportPinLoc() {
-  std::cout << "Printing Macro Pin Bbox(s)...\n";
-  for (auto &inst: design->getTopBlock()->getInsts()) {
-    if (inst->getRefBlock()->getMacroClass() != MacroClassEnum::BLOCK) {
-      continue;
-    }
-    
-    for (auto &uinstTerm: inst->getInstTerms()) {
-      frInstTerm *instTerm = uinstTerm.get();
-      auto instTermType = instTerm->getTerm()->getType();
-      //if (instTermType != frTermEnum::frcNormalTerm && instTermType != frTermEnum::frcClockTerm) {
-      //  continue;
-      //}
-      std::cout << "instName: " << inst->getName() << "; ";
-      std::cout << inst->getRefBlock()->getName() << "/" << instTerm->getTerm()->getName() << ":\n";
-      std::cout << "Locations(s):\n";
-      frTransform xform;
-      frBox mbox;
-      inst->getTransform(xform);
-      inst->getRefBlock()->getBoundaryBBox(mbox);
-      frPoint size(mbox.right(), mbox.top());
-      xform.updateXform(size);
-
-      for (auto &pin: instTerm->getTerm()->getPins()) {
-        auto pinPtr = pin.get();
-        map<frLayerNum, PolygonSet> layerNum2PS;
-        mergePinShapes(pinPtr, xform, layerNum2PS);
-        for (auto layerIt = layerNum2PS.begin(); layerIt != layerNum2PS.end(); ++layerIt) {
-          auto layerNum = layerIt->first;
-          auto &layerPS = layerIt->second;
-          std::vector<Rectangle> maxRects;
-          get_max_rectangles(maxRects, layerPS);
-          for (auto &rect: maxRects) {
-            std::cout << "  (" << xl(rect) << ", " << yl(rect) << ") - ("
-                      << xh(rect) << ", " << yh(rect) << ") " 
-                      << design->getTech()->getLayer(layerNum)->getName() << "\n";
-          }
-        }
-      }
-    }
-  }
-}
-
-void FlexPinPrep::init() {
-  for (auto layerNum = design->getTech()->getBottomLayerNum(); layerNum <= design->getTech()->getTopLayerNum(); ++layerNum) {
-    for (auto &viaDef: design->getTech()->getLayer(layerNum)->getViaDefs()) {
-      int cutNum = int(viaDef->getCutFigs().size());
-      viaRawPriorityTuple priority;
-      getViaRawPriority(viaDef, priority);
-      layerNum2ViaDefs[layerNum][cutNum][priority] = viaDef;
-    }
-  }
-}
-
-void FlexPinPrep::getViaRawPriority(frViaDef* viaDef, viaRawPriorityTuple &priority) {
-  bool isNotDefaultVia = !(viaDef->getDefault());
-  bool isNotUpperAlign = false;
-  // bool isNotLowerAlign = false;
-  PolygonSet viaLayerPS1;
-
-  for (auto &fig: viaDef->getLayer1Figs()) {
-    frBox bbox;
-    fig->getBBox(bbox);
-    Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-    viaLayerPS1 += bboxRect;
-  }
-  // Rectangle layer1Rect;
-  // extents(layer1Rect, viaLayerPS1);
-  // bool isLayer1Horz = (xh(layer1Rect) - xl(layer1Rect)) > (yh(layer1Rect) - yl(layer1Rect));
-  // isNotLowerAlign = (isLayer1Horz != (getTech()->getLayer(viaDef->getLayer1Num())->getDir() == frcHorzPrefRoutingDir));
-
-  PolygonSet viaLayerPS2;
-  for (auto &fig: viaDef->getLayer2Figs()) {
-    frBox bbox;
-    fig->getBBox(bbox);
-    Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-    viaLayerPS2 += bboxRect;
-  }
-  Rectangle layer2Rect;
-  extents(layer2Rect, viaLayerPS2);
-  bool isLayer2Horz = (xh(layer2Rect) - xl(layer2Rect)) > (yh(layer2Rect) - yl(layer2Rect));
-  isNotUpperAlign = (isLayer2Horz != (getTech()->getLayer(viaDef->getLayer2Num())->getDir() == frcHorzPrefRoutingDir));
-
-  frCoord layer1Area = area(viaLayerPS1);
-  frCoord layer2Area = area(viaLayerPS2);
-
-  priority = std::make_tuple(isNotDefaultVia, isNotUpperAlign, layer2Area, layer1Area);
-}
-
-int FlexPinPrep::main() {
-  if (VERBOSE > 0) {
-    cout <<endl <<"start pin prep ..." <<endl;
-  }
-  // bool enableOutput = true;
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  pinPrep();  // Maze rely on this
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
-  if (VERBOSE > 0) {
-    cout <<endl <<"PinPrep runtime taken (hrt): " << time_span.count()    <<endl;
-    cout <<"accuSpan0: " << accuSpan0.count() << endl;
-    cout <<"accuSpan1: " << accuSpan1.count() << endl;
-    cout <<"accuSpan2: " << accuSpan2.count() << endl;
-    cout <<"drcSpan0: " << drcSpan0.count() << endl;
-    cout <<"drcSpan1: " << drcSpan1.count() << endl;
-    cout <<"drcSpan2: " << drcSpan2.count() << endl;
-  }
-  return 0;
-}
-
-
-void FlexPinPrep::pinPrep() {
-  // int cnt = 0;
-  int instTermCnt = 0;
-  int ioTermCnt = 0;
-  // pin prep for inst terms
-  for (auto blockIt = trackOffsetMap.begin(); blockIt != trackOffsetMap.end(); ++blockIt) {
-    auto &orientMap = blockIt->second;
-    for (auto orientIt = orientMap.begin(); orientIt != orientMap.end(); ++orientIt) {
-      // auto orient = orientIt->first;
-      auto &offsets2Inst = orientIt->second;
-      for (auto offsetsIt = offsets2Inst.begin(); offsetsIt != offsets2Inst.end(); ++offsetsIt) {
-        // auto &offsets = offsetsIt->first;
-        auto instPtr = *(offsetsIt->second.begin());
-        for (auto &uinstTerm: instPtr->getInstTerms()) {
-          frInstTerm *instTerm = uinstTerm.get();
-          auto instTermType = instTerm->getTerm()->getType();
-          if (instTermType != frTermEnum::frcNormalTerm && instTermType != frTermEnum::frcClockTerm) {
-            continue;
-          }
-          ++instTermCnt;
-          instTermPinPrep(instTerm, offsetsIt->second);
-          if (instTermCnt % 100 == 0) {
-            cout <<" complete " <<instTermCnt <<" instTerms" <<endl;
-          }
-        }
-        // update ap priority
-        // updateAPCost(instPtr);
-
-        // generate APC
-        if (instPtr->getRefBlock()->getMacroClass() == MacroClassEnum::CORE ||
-            instPtr->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIEHIGH ||
-            instPtr->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIELOW ||
-            instPtr->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_ANTENNACELL) {
-          std::cout << instPtr->getName() << "(" << instPtr->getRefBlock()->getName() << "):\n";
-          APGWorker apgWorker(getDesign(), instPtr);
-          apgWorker.init();
-          apgWorker.setup();
-          apgWorker.main();
-          apgWorker.end();
-        }
-
-      }
-    }
-  }
-  // pin prep for terms
-  for (auto &term: design->getTopBlock()->getTerms()) {
-    ++ioTermCnt;
-    termPinPrep(term.get());
-    if (ioTermCnt % 100 == 0) {
-      cout <<" complete " <<ioTermCnt <<" ioTerms" <<endl;
-    }
-  }
-
-  std::cout << "instTermCnt = " << instTermCnt << "\n";
-  std::cout << "ioTermCnt = " << ioTermCnt << "\n";
-  std::cout << "APCnt = " << APCnt << "\n";
-}
-
-void FlexPinPrep::updateAPCost(frInst *inst) {
-  std::map<frTerm*, std::vector<FlexAccessPattern*> > term2APs;
-  std::map<frLayerNum, bgi::rtree<std::pair<point_t, FlexAccessPattern*>, bgi::quadratic<16> > > layer2APRTree;
-  for (auto &uinstTerm: inst->getInstTerms()) {
-    frInstTerm *instTerm = uinstTerm.get();
-    auto instTermType = instTerm->getTerm()->getType();
-    if (instTermType != frTermEnum::frcNormalTerm && instTermType != frTermEnum::frcClockTerm) {
-      continue;
-    }
-    // populate map and rtree
-    for (auto &upin: instTerm->getTerm()->getPins()) {
-      frPin* pin = upin.get();
-      for (auto &uap: pin->getAccessPatterns()) {
-        FlexAccessPattern* ap = uap.get();
-        if (ap->hasValidAccess(frDirEnum::U)) {
-          term2APs[instTerm->getTerm()].push_back(ap);
-          frPoint bp, ep;
-          ap->getPoints(bp, ep);
-          layer2APRTree[ap->getBeginLayerNum() + 2].insert(std::make_pair(point_t(bp.x(), bp.y()), ap));
-        }
-      }
-    }
-  }
-  // setNearest AP distance (the further the better)
-  for (auto layerIt = layer2APRTree.begin(); layerIt != layer2APRTree.end(); ++layerIt) {
-    //frLayerNum layerNum = layerIt->first;
-    auto &apRTree = layerIt->second;
-    for (auto apIt = apRTree.begin(); apIt != apRTree.end(); ++apIt) {
-      auto loc = apIt->first;
-      auto ap = apIt->second;
-      // get nearest aps to query queue
-      std::vector<std::pair<point_t, FlexAccessPattern*> > qq;
-      apRTree.query(bgi::nearest(loc, term2APs[ap->getPin()->getTerm()].size() + 1), std::back_inserter(qq));
-      frCoord maxDist = 0;
-      for (auto &apPair: qq) {
-        // auto deltaX = loc.x() - apPair.first.x();
-        // auto deltaY = loc.y() - apPair.first.y();
-        // auto tmpDist = deltaX * deltaX + deltaY * deltaY;
-        auto tmpDist = bg::distance(loc, apPair.first);
-        if (tmpDist > maxDist) {
-          maxDist = tmpDist;
-        }
-      }
-      ap->setNearestAPDist(maxDist);
-    }
-  }
-
-}
-
-void FlexPinPrep::instTermPinPrep(frInstTerm *instTerm, const std::set<frInst*, frBlockObjectComp> &instsIn) {
-  bool enableOutput = false;
-  int instTermAPCnt = 0;
-  //bool enableOutput = true;
-  // bool isPhysical = true;
-  if (enableOutput) {
-    cout << "instTermPinPrep\n";
-  }
-  frInst* inst = instTerm->getInst();
-  bool isMacro = inst->getRefBlock()->getMacroClass() == MacroClassEnum::BLOCK;
-  frBox mbox;
-  frTransform xform, termXForm, revertCellXForm;
-
-  std::set<frInst*> insts;
-  insts.insert(instsIn.begin(), instsIn.end());
-
-
-
-  // debug
-  // if (instTerm->getInst()->getRefBlock()->getName() != "OR4X2") {
-  //   return;
-  // } 
-
-  inst->getTransform(xform);
-  inst->getRefBlock()->getBoundaryBBox(mbox);
-  frPoint size(mbox.right(), mbox.top());
-  termXForm.set(xform.orient());
-  termXForm.updateXform(size);
-  // xform.revert(revertCellXForm);
-  revertCellXForm.set(-xform.xOffset(), -xform.yOffset());
-  // std::cout << xform.xOffset() << " " << xform.yOffset() << "\n";
-  // std::cout << revertCellXForm.xOffset() << " " << revertCellXForm.yOffset() << "\n";
-  revertCellXForm.set(frcR0);
-  xform.updateXform(size);
-  // xform.revert(revertXForm);
-  
-
-  // 
-  double dbu = getTech()->getDBUPerUU();
-  frBox instBBox;
-  inst->getBBox(instBBox);
-  box_t instQueryBox(point_t(instBBox.left(), instBBox.bottom()), point_t(instBBox.right(), instBBox.top()));
-  /*
-  std::vector<frBlockObject*> instObjs;
-  std::set<frBlockObject*> instObjSet;
-  // std::map<frLayerNum, PolygonSet> layer2OBS; 
-  // std::cout << "inst bbox = (" << instBBox.left() / dbu << ", " << instBBox.bottom() / dbu
-  //           << ") - (" << instBBox.right() / dbu << ", " << instBBox.top() / dbu << ")\n";
-  for (auto layerNum = design->getTech()->getBottomLayerNum(); layerNum <= design->getTech()->getTopLayerNum(); ++layerNum) {
-    auto regionQuery = design->getRegionQuery();
-    std::vector<rq_rptr_value_t<frBlockObject> > queryResult;
-    regionQuery->query(instQueryBox, layerNum, queryResult);
-    for (auto &objPair: queryResult) {
-      instObjSet.insert(objPair.second);
-    }
-  }
-  for (auto instObj:instObjSet) {
-    if ((instObj->typeId() == frcInstTerm && (static_cast<frInstTerm*>(instObj))->getInst() == inst) || 
-        (instObj->typeId() == frcInstBlockage)) {
-      // if (instObj->typeId() == frcInstBlockage) {
-      //   std::cout << "frcInstBlockage found\n";
-      // }
-      instObjs.push_back(instObj);
-    }
-    // // attempt to speedup macro processing
-    // if (instObj->typeId() == frcInstBlockage) {
-    //   frBlockage* blockage = (static_cast<frInstBlockage*>(instObj))->getBlockage();
-    //   if (blockage->typeId() != frcLayerBlockage) {
-    //     std::cout << "Error: unexpected blockage type in initNetRects_blockages\n";
-    //   } else {
-    //     frTransform xform;
-    //     inst->getUpdatedXform(xform);
-    //     frLayerBlockage* layerBlockage = static_cast<frLayerBlockage*>(blockage);
-    //     frLayerNum layerNum = layerBlockage->getLayerNum();
-    //     auto blockageFrPoints = layerBlockage->getPoints();
-    //     std::vector<Point> blockagePoints;
-    //     for (auto pt: blockageFrPoints) {
-    //       frPoint tmpPt = pt;
-    //       tmpPt.transform(xform);
-    //       blockagePoints.push_back(Point(tmpPt.x(), tmpPt.y()));
-    //     }
-    //     Polygon blockagePoly;
-    //     set_points(blockagePoly, blockagePoints.begin(), blockagePoints.end());
-    //     layer2OBS[layerNum] += blockagePoly;
-    //   }
-    // }
-  }
-  // all cell objects are read in
-  */
-  if (enableOutput) {
-  //if (true) {
-    std::cout << "cell / cell master / orient / instTerm: " 
-              << instTerm->getInst()->getName() << " / "
-              << instTerm->getInst()->getRefBlock()->getName() << " / " 
-              << xform.orient() << " / " 
-              << instTerm->getTerm()->getName() << "\n" << std::flush;
-  }
-  // std::cout << "here-1\n";
-  bool hasValidAP = false;
-  for (auto &pin: instTerm->getTerm()->getPins()) {
-    // map<frPoint, int> endPoint2Cost;
-    // map<frPoint, pair<frOrient, FlexAccessPattern> > endPiont2AP;
-    auto pinPtr = pin.get();
-    map<frLayerNum, PolygonSet> layerNum2PS;
-    // map<frLayerNum, Rectangle> layerNum2BBox;
-    // int numLayers = int(design->getTech()->getLayers().size());
-    // frLayerNum minPinLayerNum = numLayers, maxPinLayerNum = 0;
-    high_resolution_clock::time_point t1 = high_resolution_clock::now();
-    mergePinShapes(pinPtr, xform, layerNum2PS);
-    high_resolution_clock::time_point t2 = high_resolution_clock::now();
-    accuSpan0 += duration_cast<duration<double>>(t2 - t1);
-    
-    std::vector<frBlockObject*> pinObjs;
-    std::set<frBlockObject*> pinObjSet;
-    std::vector<Rectangle> maxRects;
-    Rectangle pinBBoxRect, pinBloatBBoxRect;
-    PolygonSet pinPS;
-    frCoord maxPitch = 0;
-    for (auto layerIt = layerNum2PS.begin(); layerIt != layerNum2PS.end(); ++layerIt) {
-      pinPS += layerIt->second;
-      auto currLayerPitch = getTech()->getLayer(layerIt->first)->getPitch();
-      if (currLayerPitch > maxPitch) {
-        maxPitch = currLayerPitch;
-      }
-    }
-    // extents(pinBBoxRect, pinPS);
-    // pinBloatBBoxRect = bloat(pinBBoxRect, maxPitch);
-    // box_t pinBloatBBox(point_t(xl(pinBloatBBoxRect), yl(pinBloatBBoxRect)), point_t(xh(pinBloatBBoxRect), yh(pinBloatBBoxRect)));
-    // for (auto layerNum = design->getTech()->getBottomLayerNum(); layerNum <= design->getTech()->getTopLayerNum(); ++layerNum) {
-    //   auto regionQuery = design->getRegionQuery();
-    //   std::vector<rq_rptr_value_t<frBlockObject> > queryResult;
-    //   regionQuery->query(pinBloatBBox, layerNum, queryResult);
-    //   for (auto &objPair: queryResult) {
-    //     pinObjSet.insert(objPair.second);
-    //   }
-    // }
-
-    get_max_rectangles(maxRects, pinPS);
-    for (auto maxRect: maxRects) {
-      pinBloatBBoxRect = bloat(maxRect, maxPitch);
-      box_t pinBloatBBox(point_t(xl(pinBloatBBoxRect), yl(pinBloatBBoxRect)), point_t(xh(pinBloatBBoxRect), yh(pinBloatBBoxRect)));
-      for (auto layerNum = design->getTech()->getBottomLayerNum(); layerNum <= design->getTech()->getTopLayerNum(); ++layerNum) {
-        auto regionQuery = design->getRegionQuery();
-        std::vector<rq_rptr_value_t<frBlockObject> > queryResult;
-        regionQuery->query(pinBloatBBox, layerNum, queryResult);
-        for (auto &objPair: queryResult) {
-          pinObjSet.insert(objPair.second);
-        }
-      }
-    }
-    for (auto pinObj:pinObjSet) {
-      if ((pinObj->typeId() == frcInstTerm && (static_cast<frInstTerm*>(pinObj))->getInst() == inst) || 
-          (pinObj->typeId() == frcInstBlockage)) {
-        pinObjs.push_back(pinObj);
-      }
-    }
-
-    // if (enableOutput) {
-    //   for (auto it = layerNum2PS.begin(); it != layerNum2PS.end(); ++it) {
-    //     auto layerNum = it->first;
-    //     auto &polySet = it->second;
-    //     std::cout << " layerNum = " << layerNum << "\n";
-    //     for (auto &poly: polySet) {
-    //       std::cout << "  poly: ";
-    //       for (auto ptIt = boost::polygon::begin_points(poly); ptIt != boost::polygon::end_points(poly); ++ptIt) {
-    //         frPoint tmpPt((*ptIt).x(), (*ptIt).y());
-    //         std::cout << "(" << tmpPt.x() / 2000.0 << "," << tmpPt.y() / 2000.0 << ") -- ";
-    //       }
-    //       std::cout << "\n";
-    //     }
-    //   }
-    // }
-    // std::cout << "here0\n";
-    // getPinLayerBBox(layerNum2PS, layerNum2BBox);
-    for (auto layerIt = layerNum2PS.begin(); layerIt != layerNum2PS.end(); ++layerIt) {
-      bool hasPinLayerAP = false;
-      map<frCoord, map<frLayerNum, frTrackPattern*> > xLoc2TrackPatterns; // track xCoord
-      map<frCoord, map<frLayerNum, frTrackPattern*> > yLoc2TrackPatterns; // track yCoord
-      frLayerNum currLayerNum = layerIt->first;
-      PolygonSet layerPS = layerNum2PS[currLayerNum];
-      map<frPoint, int> startPoints; // startPoint with cost, lower is more preferrable
-      // set<pair<frLayerNum, frPoint> > endPoints;
-      // Rectangle layerBBox = layerNum2BBox[currLayerNum];
-      high_resolution_clock::time_point t1 = high_resolution_clock::now();
-      getPinLayerBBoxTrackPatterns(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns);
-      getPinLayerAPStartPoints(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns, startPoints);
-      high_resolution_clock::time_point t2 = high_resolution_clock::now();
-      // getPinLayerAPEndPoints(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns, endPoints);
-      // if (enableOutput) {
-      //   double dbu = getTech()->getDBUPerUU();
-      //   for (auto &startPoint: startPoints) {
-      //     if (!isPhysical) {
-      //       std::cout << "  startPoint: " << "(" << startPoint.first.x() << ", " << startPoint.first.y() << ", " << currLayerNum << ")\n";
-      //     } else {
-      //       std::cout << "  startPoint: " << "(" << startPoint.first.x() / dbu << ", " << startPoint.first.y() / dbu << ", " << currLayerNum << ")\n";
-      //     }
-      //   }
-      //   for (auto &endPoint: endPoints) {
-      //     if (!isPhysical) {
-      //       std::cout << "  endPoint: (" << endPoint.second.x() << ", " << endPoint.second.y() << ", " << endPoint.first << ")\n";
-      //     } else {
-      //       std::cout << "  endPoint: (" << endPoint.second.x() / dbu << ", " << endPoint.second.y() / dbu << ", " << endPoint.first << ")\n";
-      //     }
-      //   }
-      // }
-
-      // get access pattern based on start point only
-      for (auto &startPoint: startPoints) {
-        auto &startPt = startPoint.first;
-        frPoint apStartPt = startPt;
-        apStartPt.transform(revertCellXForm);
-        auto &startLayerNum = currLayerNum;
-        FlexAccessPattern ap;
-        ap.setPoints(apStartPt, apStartPt);
-        ap.setBeginLayerNum(startLayerNum);
-        ap.addToPin(pin.get());
-        if (inst->getRefBlock()->getMacroClass() == MacroClassEnum::BLOCK) {
-          ap.setConflict(false);
-        }
-        //ap.setEndLayerNum(startLayerNum);
-        //ap.setCost(1);
-        
-
-
-        frPoint endPt;
-        // check planar access
-        if (enableOutput) {
-          std::cout << "\nstartPt (" << startPt.x() / dbu << ", " << startPt.y() / dbu << ")\n";
-        }
-        // E
-        bool skipE = false;
-        getPlanarEP(startLayerNum, startPt, frDirEnum::E, endPt);
-        if (enableOutput) {
-          std::cout << "  E endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-        //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-        //     skipE = true;
-        //     break;
-        //   }
-        // }
-        if (!skipE) {
-          if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-            ap.setValidAccess(frDirEnum::E, true);
-            ++APCnt;
-            ++instTermAPCnt;
-          } else {
-            ap.setValidAccess(frDirEnum::E, false);
-          }
-        }
-        // S
-        bool skipS = false;
-        getPlanarEP(startLayerNum, startPt, frDirEnum::S, endPt);
-        if (enableOutput) {
-          std::cout << "  S endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-        //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-        //     skipS = true;
-        //     break;
-        //   }
-        // }
-        if (!skipS) {
-          if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-            ap.setValidAccess(frDirEnum::S, true);
-            ++APCnt;
-            ++instTermAPCnt;
-          } else {
-            ap.setValidAccess(frDirEnum::S, false);
-          }
-        }
-        // W
-        bool skipW = false;
-        getPlanarEP(startLayerNum, startPt, frDirEnum::W, endPt);
-        if (enableOutput) {
-          std::cout << "  W endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-        //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-        //     skipW = true;
-        //     break;
-        //   }
-        // }
-        if (!skipW) {
-          if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-            ap.setValidAccess(frDirEnum::W, true);
-            ++APCnt;
-            ++instTermAPCnt;
-          } else {
-            ap.setValidAccess(frDirEnum::W, false);
-          }
-        }
-        // N
-        bool skipN = false;
-        getPlanarEP(startLayerNum, startPt, frDirEnum::N, endPt);
-        if (enableOutput) {
-          std::cout << "  N endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-        //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-        //     skipN = true;
-        //     break;
-        //   }
-        // }
-        if (!skipN) {
-          if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-            ap.setValidAccess(frDirEnum::N, true);
-            ++APCnt;
-            ++instTermAPCnt;
-          } else {
-            ap.setValidAccess(frDirEnum::N, false);
-          }
-        }
-
-
-        // U
-        if (enableOutput) {
-          std::cout << "  U\n";
-        }
-        
-        if (inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE ||
-            inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIEHIGH ||
-            inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIELOW ||
-            inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_ANTENNACELL) {
-          // get via accesses
-          std::map<viaPriorityTuple, frViaDef*> priority2ViaDef;
-          auto upperViaDef = getTech()->getLayer(startLayerNum + 1)->getDefaultViaDef();
-          viaPriorityTuple priority;
-          if (isValidViaAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, upperViaDef, priority)) {
-            ap.setValidAccess(frDirEnum::U, true);
-            ++APCnt;
-            ++instTermAPCnt;
-            // ap.addAccessViaDef(frDirEnum::U, upperViaDef);
-            priority2ViaDef[priority] = upperViaDef;
-          }
-
-          for (auto layerIt = layerNum2ViaDefs.begin(); layerIt != layerNum2ViaDefs.end(); ++layerIt) {
-            auto currLayerNum = layerIt->first;
-            if (currLayerNum != startLayerNum + 1) {
-              continue;
-            }
-            auto &numCut2ViaDefs = layerIt->second;
-            int numCut = -1;
-            for (auto numCutIt = numCut2ViaDefs.begin(); numCutIt != numCut2ViaDefs.end(); ++numCutIt) {
-              if (numCut != -1) {
-                break;
-              }
-              numCut = numCutIt->first;
-              auto &viaRawPriority2ViaDefs = numCutIt->second;
-              int attemptCnt = 0;
-              if (ap.hasValidAccess(frDirEnum::U)) {
-                ++attemptCnt;
-              }
-              for (auto viaDefIt = viaRawPriority2ViaDefs.begin(); viaDefIt != viaRawPriority2ViaDefs.end(); ++viaDefIt) {
-                if (attemptCnt >= maxViaAttemptLimit) {
-                  break;
-                }
-                auto viaDef = viaDefIt->second;
-                if (!viaDef->getDefault() || viaDef == upperViaDef) {
-                  continue;
-                }
-                if (isValidViaAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, viaDef, priority)) {
-                  ap.setValidAccess(frDirEnum::U, true);
-                  ++APCnt;
-                  ++instTermAPCnt;
-                  ++attemptCnt;
-                  priority2ViaDef[priority] = viaDef;
-                }
-              }
-            }
-          }
-          for (auto mapIt = priority2ViaDef.begin(); mapIt != priority2ViaDef.end(); ++mapIt) {
-            ap.addAccessViaDef(frDirEnum::U, mapIt->second);
-          }
-        }
-
-        if (ap.hasValidAccess()) {
-          hasValidAP = true;
-          hasPinLayerAP = true;
-          ap.addInsts(insts);
-          pinPtr->addAccessPattern(xform.orient(), ap);
-        }
-
-      }
-      high_resolution_clock::time_point t3 = high_resolution_clock::now();
-      accuSpan1 += duration_cast<duration<double>>(t2 - t1);
-      accuSpan2 += duration_cast<duration<double>>(t3 - t2);
-      if (!hasPinLayerAP) {
-        // if (enableOutput) {
-        if (true) {
-          std::cout << "Warning: " << instTerm->getInst()->getName() << "/" << instTerm->getTerm()->getName() 
-                    << " has no valid AP on layer " << currLayerNum << ". Checking shape-center along pref-dir option\n";
-        }
-        startPoints.clear();
-        high_resolution_clock::time_point t1 = high_resolution_clock::now();
-        getPinLayerAPStartPoints_shapeCenter(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns, startPoints);
-        high_resolution_clock::time_point t2 = high_resolution_clock::now();
-        accuSpan1 += duration_cast<duration<double>>(t2 - t1);
-        
-        for (auto &startPoint: startPoints) {
-          auto &startPt = startPoint.first;
-          frPoint apStartPt = startPt;
-          apStartPt.transform(revertCellXForm);
-          auto &startLayerNum = currLayerNum;
-          FlexAccessPattern ap;
-          ap.setPoints(apStartPt, apStartPt);
-          ap.setBeginLayerNum(startLayerNum);
-          ap.addToPin(pin.get());
-          //ap.setEndLayerNum(startLayerNum);
-          //ap.setCost(1);
-          
-
-
-          frPoint endPt;
-          // check planar access
-          if (enableOutput) {
-            std::cout << "\nstartPt (" << startPt.x() / dbu << ", " << startPt.y() / dbu << ")\n";
-          }
-          // E
-          bool skipE = false;
-          getPlanarEP(startLayerNum, startPt, frDirEnum::E, endPt);
-          if (enableOutput) {
-            std::cout << "  E endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-          }
-          // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-          //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-          //     skipE = true;
-          //     break;
-          //   }
-          // }
-          if (!skipE) {
-            if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-              ap.setValidAccess(frDirEnum::E, true);
-              ++APCnt;
-              ++instTermAPCnt;
-            } else {
-              ap.setValidAccess(frDirEnum::E, false);
-            }
-          }
-          // S
-          bool skipS = false;
-          getPlanarEP(startLayerNum, startPt, frDirEnum::S, endPt);
-          if (enableOutput) {
-            std::cout << "  S endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-          }
-          // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-          //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-          //     skipS = true;
-          //     break;
-          //   }
-          // }
-          if (!skipS) {
-            if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-              ap.setValidAccess(frDirEnum::S, true);
-              ++APCnt;
-              ++instTermAPCnt;
-            } else {
-              ap.setValidAccess(frDirEnum::S, false);
-            }
-          }
-          // W
-          bool skipW = false;
-          getPlanarEP(startLayerNum, startPt, frDirEnum::W, endPt);
-          if (enableOutput) {
-            std::cout << "  W endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-          }
-          // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-          //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-          //     skipW = true;
-          //     break;
-          //   }
-          // }
-          if (!skipW) {
-            if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-              ap.setValidAccess(frDirEnum::W, true);
-              ++APCnt;
-              ++instTermAPCnt;
-            } else {
-              ap.setValidAccess(frDirEnum::W, false);
-            }
-          }
-          // N
-          bool skipN = false;
-          getPlanarEP(startLayerNum, startPt, frDirEnum::N, endPt);
-          if (enableOutput) {
-            std::cout << "  N endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-          }
-          // for (auto &obsPoly: layer2OBS[startLayerNum]) {
-          //   if (contains(obsPoly, Point(endPt.x(), endPt.y()))) {
-          //     skipN = true;
-          //     break;
-          //   }
-          // }
-          if (!skipN) {
-            if (isMacro || isValidPlanarAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, endPt, layerPS)) {
-              ap.setValidAccess(frDirEnum::N, true);
-              ++APCnt;
-              ++instTermAPCnt;
-            } else {
-              ap.setValidAccess(frDirEnum::N, false);
-            }
-          }
-          // U
-          if (enableOutput) {
-            std::cout << "  U\n";
-          }
-          
-          if (inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE ||
-              inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIEHIGH ||
-              inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_TIELOW ||
-              inst->getRefBlock()->getMacroClass() == MacroClassEnum::CORE_ANTENNACELL) {
-            // get via accesses
-            std::map<viaPriorityTuple, frViaDef*> priority2ViaDef;
-            auto upperViaDef = getTech()->getLayer(startLayerNum + 1)->getDefaultViaDef();
-            viaPriorityTuple priority;
-            if (isValidViaAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, upperViaDef, priority)) {
-              ap.setValidAccess(frDirEnum::U, true);
-              ++APCnt;
-              ++instTermAPCnt;
-              // ap.addAccessViaDef(frDirEnum::U, upperViaDef);
-              priority2ViaDef[priority] = upperViaDef;
-            }
-
-            for (auto layerIt = layerNum2ViaDefs.begin(); layerIt != layerNum2ViaDefs.end(); ++layerIt) {
-              auto currLayerNum = layerIt->first;
-              if (currLayerNum != startLayerNum + 1) {
-                continue;
-              }
-              auto &numCut2ViaDefs = layerIt->second;
-              int numCut = -1;
-              for (auto numCutIt = numCut2ViaDefs.begin(); numCutIt != numCut2ViaDefs.end(); ++numCutIt) {
-                if (numCut != -1) {
-                  break;
-                }
-                numCut = numCutIt->first;
-                auto &viaRawPriority2ViaDefs = numCutIt->second;
-                int attemptCnt = 0;
-                for (auto viaDefIt = viaRawPriority2ViaDefs.begin(); viaDefIt != viaRawPriority2ViaDefs.end(); ++viaDefIt) {
-                  if (attemptCnt >= maxViaAttemptLimit) {
-                    break;
-                  }
-                  auto viaDef = viaDefIt->second;
-                  if (!viaDef->getDefault() || viaDef == upperViaDef) {
-                    continue;
-                  }
-                  if (isValidViaAccess(pinPtr, instTerm, pinObjs, startLayerNum, startPt, viaDef, priority)) {
-                    ap.setValidAccess(frDirEnum::U, true);
-                    ++APCnt;
-                    ++instTermAPCnt;
-                    ++attemptCnt;
-                    priority2ViaDef[priority] = viaDef;
-                  }
-                }
-              }
-            }
-
-            for (auto mapIt = priority2ViaDef.begin(); mapIt != priority2ViaDef.end(); ++mapIt) {
-              ap.addAccessViaDef(frDirEnum::U, mapIt->second);
-            }
-          }
-
-          if (ap.hasValidAccess()) {
-            hasValidAP = true;
-            hasPinLayerAP = true;
-            ap.addInsts(insts);
-            pinPtr->addAccessPattern(xform.orient(), ap);
-          }
-
-        }
-        high_resolution_clock::time_point t3 = high_resolution_clock::now();
-        accuSpan2 += duration_cast<duration<double>>(t3 - t2);
-      }
-
-      if (!hasPinLayerAP) {
-        std::cout << "Warning: " << instTerm->getInst()->getName() << "/" << instTerm->getTerm()->getName() 
-                    << " has no valid AP on layer " << currLayerNum << ". Need shape-center option\n";
-      }
-
-    }
-
-  }
-  if (!hasValidAP) {
-    std::cout << instTerm->getInst()->getName() << "/" << instTerm->getTerm()->getName() << " has no valid AP\n";
-  }
-}
-
-void FlexPinPrep::termPinPrep(frTerm *term) {
-  bool enableOutput = false;
-  // bool enableOutput = true;
-  // bool isPhysical = true;
-  if (enableOutput) {
-    cout << "termPinPrep\n";
-  }
-
-  double dbu = getTech()->getDBUPerUU();
-  std::vector<frBlockObject*> instObjs;
-  std::set<frBlockObject*> instObjSet;
-  
-  for (auto &pin: term->getPins()) {
-    auto pinPtr = pin.get();
-    map<frLayerNum, PolygonSet> layerNum2PS = pinPtr->getLayer2PolySet();
-
-    for (auto layerIt = layerNum2PS.begin(); layerIt != layerNum2PS.end(); ++layerIt) {
-      frLayerNum currLayerNum = layerIt->first;
-      PolygonSet layerPS = layerIt->second;
-      Rectangle layerBBox;
-      extents(layerBBox, layerPS);
-      box_t layerQueryBox(point_t(xl(layerBBox), yl(layerBBox)), point_t(xh(layerBBox), yh(layerBBox)));
-      auto regionQuery = design->getRegionQuery();
-      std::vector<rq_rptr_value_t<frBlockObject> > queryResult;
-      regionQuery->query(layerQueryBox, currLayerNum, queryResult);
-      for (auto &objPair: queryResult) {
-        instObjSet.insert(objPair.second);
-      }
-    }
-    for (auto instObj:instObjSet) {
-      if (instObj->typeId() == frcTerm) {
-        instObjs.push_back(instObj);
-      }
-    }
-  }
-
-
-  
-  for (auto &pin: term->getPins()) {
-    auto pinPtr = pin.get();
-    map<frLayerNum, PolygonSet> layerNum2PS = pinPtr->getLayer2PolySet();
-    for (auto layerIt = layerNum2PS.begin(); layerIt != layerNum2PS.end(); ++layerIt) {
-      map<frCoord, map<frLayerNum, frTrackPattern*> > xLoc2TrackPatterns; // track xCoord
-      map<frCoord, map<frLayerNum, frTrackPattern*> > yLoc2TrackPatterns; // track yCoord
-      frLayerNum currLayerNum = layerIt->first;
-      PolygonSet layerPS = layerNum2PS[currLayerNum];
-      map<frPoint, int> startPoints; // startPoint with cost, lower is more preferrable
-      // set<pair<frLayerNum, frPoint> > endPoints;
-      // Rectangle layerBBox = layerNum2BBox[currLayerNum];
-      getPinLayerBBoxTrackPatterns(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns);
-      getPinLayerAPStartPoints(currLayerNum, layerPS, xLoc2TrackPatterns, yLoc2TrackPatterns, startPoints);
-      // get access pattern based on start/end point pair
-      for (auto &startPoint: startPoints) {
-        auto &startPt = startPoint.first;
-        auto startLayerNum = currLayerNum;
-        FlexAccessPattern ap;
-        ap.setPoints(startPt, startPt);
-        ap.setBeginLayerNum(startLayerNum);
-        ap.setConflict(false);
-        //ap.setEndLayerNum(startLayerNum);
-        //ap.setCost(1);
-        // ap.addInsts(insts);
-
-        frPoint endPt;
-
-        // check planar access
-        if (enableOutput) {
-          std::cout << "\nstartPt (" << startPt.x() / dbu << ", " << startPt.y() / dbu << ")\n";
-        }
-        // E
-        
-        getPlanarEP(startLayerNum, startPt, frDirEnum::E, endPt);
-        if (enableOutput) {
-          std::cout << "  E endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        if (isValidPlanarAccess(pinPtr, term, instObjs, startLayerNum, startPt, endPt, layerPS)) {
-          ap.setValidAccess(frDirEnum::E, true);
-          ++APCnt;
-        } else {
-          ap.setValidAccess(frDirEnum::E, false);
-        }
-        // S
-        getPlanarEP(startLayerNum, startPt, frDirEnum::S, endPt);
-        if (enableOutput) {
-          std::cout << "  S endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        if (isValidPlanarAccess(pinPtr, term, instObjs, startLayerNum, startPt, endPt, layerPS)) {
-          ap.setValidAccess(frDirEnum::S, true);
-          ++APCnt;
-        } else {
-          ap.setValidAccess(frDirEnum::S, false);
-        }
-        // W
-        getPlanarEP(startLayerNum, startPt, frDirEnum::W, endPt);
-        if (enableOutput) {
-          std::cout << "  W endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        if (isValidPlanarAccess(pinPtr, term, instObjs, startLayerNum, startPt, endPt, layerPS)) {
-          ap.setValidAccess(frDirEnum::W, true);
-          ++APCnt;
-        } else {
-          ap.setValidAccess(frDirEnum::W, false);
-        }
-        // N
-        getPlanarEP(startLayerNum, startPt, frDirEnum::N, endPt);
-        if (enableOutput) {
-          std::cout << "  N endPt at (" << endPt.x() / dbu << ", " << endPt.y() / dbu << ")\n";
-        }
-        if (isValidPlanarAccess(pinPtr, term, instObjs, startLayerNum, startPt, endPt, layerPS)) {
-          ap.setValidAccess(frDirEnum::N, true);
-          ++APCnt;
-        } else {
-          ap.setValidAccess(frDirEnum::N, false);
-        }
-        if (ap.hasValidAccess()) {
-          pinPtr->addAccessPattern(frOrient(frcR0), ap);
-        }
-
-      }
-    }
-  }
-}
-
-void FlexPinPrep::getPinLayerAPStartPoints(const frLayerNum &currLayerNum,
-                                           const PolygonSet &currLayerPS,
-                                           map<frCoord, map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                           map<frCoord, map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns,
-                                           map<frPoint, int> &startPoints) {
-  // bool enableOutput = true;
-  map<frCoord, int> xLoc2Cost, yLoc2Cost;
-  // initialize loc cost
-  // xcost
-  for (auto xLocIt = xLoc2TrackPatterns.begin(); xLocIt != xLoc2TrackPatterns.end(); ++xLocIt) {
-    xLoc2Cost[xLocIt->first] = 1;
-  }
-
-  // ycost
-  for (auto yLocIt = yLoc2TrackPatterns.begin(); yLocIt != yLoc2TrackPatterns.end(); ++yLocIt) {
-    yLoc2Cost[yLocIt->first] = 1;
-  }
-
-  if (getTech()->getLayer(currLayerNum)->getDir() == frcVertPrefRoutingDir) {
-    // if there is on grid start, then return
-    for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-      for (auto yLocIt = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-        Point tempPt(xLocIt->first, yLocIt->first);
-        for (auto &poly: currLayerPS) {
-          if (contains(poly, tempPt)) {
-            startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-            break;
-          }
-        }
-      }
-    }
-
-    if (!startPoints.empty()) {
-      return;
-    }
-
-
-    // add half pitch if possible
-    if (xLoc2Cost.size() > 1) {
-      // x
-      auto xLoc2CostTemp = xLoc2Cost;
-      auto xLocNextIt = xLoc2CostTemp.begin();
-      ++xLocNextIt;
-      for (auto xLocIt = xLoc2CostTemp.begin(); xLocNextIt != xLoc2CostTemp.end(); ++xLocNextIt) {
-        xLoc2Cost[(xLocIt->first + xLocNextIt->first) / 2] = xLocIt->second + xLocNextIt->second;
-        ++xLocIt;
-      }
-    }
-
-    // get lower center coord
-    vector<Rectangle> rects;
-    get_max_rectangles(rects, currLayerPS);
-    for (auto &rect: rects) {
-      Point centerPt;
-      boost::polygon::center(centerPt, rect);
-      if (xLoc2Cost.find(centerPt.x()) == xLoc2Cost.end()) {
-        xLoc2Cost[centerPt.x()] = 2;
-      }
-    }
-
-    for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-      for (auto yLocIt = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-        Point tempPt(xLocIt->first, yLocIt->first);
-        for (auto &poly: currLayerPS) {
-          if (contains(poly, tempPt)) {
-            startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-            break;
-          }
-        }
-      }
-    }
-
-    if (startPoints.empty()) {
-      if (yLoc2Cost.size() > 1) {
-        // y
-        auto yLoc2CostTemp = yLoc2Cost;
-        auto yLocNextIt = yLoc2CostTemp.begin();
-        ++yLocNextIt;
-        for (auto yLocIt = yLoc2CostTemp.begin(); yLocNextIt != yLoc2CostTemp.end(); ++yLocNextIt) {
-          yLoc2Cost[(yLocIt->first + yLocNextIt->first) / 2] = yLocIt->second + yLocNextIt->second;
-          ++yLocIt;
-        }
-      }
-
-      // get upper center coord
-      for (auto &rect: rects) {
-        Point centerPt;
-        boost::polygon::center(centerPt, rect);
-        if (yLoc2Cost.find(centerPt.y()) == yLoc2Cost.end()) {
-          yLoc2Cost[centerPt.y()] = 2;
-        }
-      }
-
-      for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-        for (auto yLocIt  = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-          Point tempPt(xLocIt->first, yLocIt->first);
-          for (auto &poly: currLayerPS) {
-            if (contains(poly, tempPt)) {
-              startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-              break;
-            }
-          }
-        }
-      }
-
-    }
-  } else if (getTech()->getLayer(currLayerNum)->getDir() == frcHorzPrefRoutingDir) {
-    // if there is on grid start, then return
-    for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-      for (auto yLocIt = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-        Point tempPt(xLocIt->first, yLocIt->first);
-        for (auto &poly: currLayerPS) {
-          if (contains(poly, tempPt)) {
-            startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-            break;
-          }
-        }
-      }
-    }
-
-    if (!startPoints.empty()) {
-      return;
-    }
-
-    // add half pitch if possible
-    if (yLoc2Cost.size() > 1) {
-      // y
-      auto yLoc2CostTemp = yLoc2Cost;
-      auto yLocNextIt = yLoc2CostTemp.begin();
-      ++yLocNextIt;
-      for (auto yLocIt = yLoc2CostTemp.begin(); yLocNextIt != yLoc2CostTemp.end(); ++yLocNextIt) {
-        yLoc2Cost[(yLocIt->first + yLocNextIt->first) / 2] = yLocIt->second + yLocNextIt->second;
-        ++yLocIt;
-      }
-    }
-
-    // get lower center coord
-    vector<Rectangle> rects;
-    get_max_rectangles(rects, currLayerPS);
-    for (auto &rect: rects) {
-      Point centerPt;
-      boost::polygon::center(centerPt, rect);
-      if (yLoc2Cost.find(centerPt.y()) == yLoc2Cost.end()) {
-        yLoc2Cost[centerPt.y()] = 2;
-      }
-    }
-
-    for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-      for (auto yLocIt = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-        Point tempPt(xLocIt->first, yLocIt->first);
-        for (auto &poly: currLayerPS) {
-          if (contains(poly, tempPt)) {
-            startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-            break;
-          }
-        }
-      }
-    }
-
-    if (startPoints.empty()) {
-      if (yLoc2Cost.size() > 1) {
-        // x
-        auto xLoc2CostTemp = xLoc2Cost;
-        auto xLocNextIt = xLoc2CostTemp.begin();
-        ++xLocNextIt;
-        for (auto xLocIt = xLoc2CostTemp.begin(); xLocNextIt != xLoc2CostTemp.end(); ++xLocNextIt) {
-          xLoc2Cost[(xLocIt->first + xLocNextIt->first) / 2] = xLocIt->second + xLocNextIt->second;
-          ++xLocIt;
-        }
-      }
-
-      // get upper center coord
-      for (auto &rect: rects) {
-        Point centerPt;
-        boost::polygon::center(centerPt, rect);
-        if (xLoc2Cost.find(centerPt.x()) == xLoc2Cost.end()) {
-          xLoc2Cost[centerPt.x()] = 2;
-        }
-      }
-
-      for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-        for (auto yLocIt  = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-          Point tempPt(xLocIt->first, yLocIt->first);
-          for (auto &poly: currLayerPS) {
-            if (contains(poly, tempPt)) {
-              startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-              break;
-            }
-          }
-        }
-      }
-    }
-  }
-
-  if (startPoints.empty()) {
-    std::cout << "Error: no start point generated\n";
-  }
-  return;
-}
-
-void FlexPinPrep::getPinLayerAPStartPoints_shapeCenter(const frLayerNum &currLayerNum,
-                                                       const PolygonSet &currLayerPS,
-                                                       map<frCoord, map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                                       map<frCoord, map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns,
-                                                       map<frPoint, int> &startPoints) {
-  frPrefRoutingDirEnum currDir = getTech()->getLayer(currLayerNum)->getDir();
-  // bool enableOutput = true;
-  map<frCoord, int> xLoc2Cost, yLoc2Cost;
-  // initialize loc cost
-  std::vector<Rectangle> rects;
-  get_max_rectangles(rects, currLayerPS);
-  // xcost
-  if (currDir == frcHorzPrefRoutingDir) {
-    for (auto xLocIt = xLoc2TrackPatterns.begin(); xLocIt != xLoc2TrackPatterns.end(); ++xLocIt) {
-      xLoc2Cost[xLocIt->first] = 1;
-    }
-    // shape center
-    for (auto &rect: rects) {
-      Point centerPt;
-      center(centerPt, rect);
-      yLoc2Cost[centerPt.y()] = 1;
-    }
-  }
-
-  // ycost
-  if (currDir == frcVertPrefRoutingDir) {
-    for (auto yLocIt = yLoc2TrackPatterns.begin(); yLocIt != yLoc2TrackPatterns.end(); ++yLocIt) {
-      yLoc2Cost[yLocIt->first] = 1;
-    }
-    // shape center
-    for (auto &rect: rects) {
-      Point centerPt;
-      center(centerPt, rect);
-      xLoc2Cost[centerPt.x()] = 1;
-    }
-  }
-
-  for (auto xLocIt = xLoc2Cost.begin(); xLocIt != xLoc2Cost.end(); ++xLocIt) {
-    for (auto yLocIt = yLoc2Cost.begin(); yLocIt != yLoc2Cost.end(); ++yLocIt) {
-      Point tempPt(xLocIt->first, yLocIt->first);
-      for (auto &poly: currLayerPS) {
-        if (contains(poly, tempPt)) {
-          startPoints[frPoint(tempPt.x(), tempPt.y())] = 2;
-          break;
-        }
-      }
-    }
-  }
-
-  if (startPoints.empty()) {
-    std::cout << "Error: no start point generated\n";
-  }
-  return;
-}
-
-void FlexPinPrep::getPinLayerBBoxTrackPatterns(const frLayerNum &currLayerNum,
-                                               const PolygonSet &currLayerPS,
-                                               map<frCoord, map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                               map<frCoord, map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns) {
-  map<frLayerNum, set<frCoord> > layerNum2TrackLocs;
-  frLayerNum nextLayerNum = -1;
-  if (currLayerNum + 2 < int(getTech()->getLayers().size())) {
-    nextLayerNum = currLayerNum + 2;
-  } else if (currLayerNum - 2 >= 0) {
-    nextLayerNum = currLayerNum - 2;
-  } else {
-    cout << "Error: Current Design has only one metal layer in getPinLayerBBoxTrackPatterns\n";
-    return;
-  }
-  // cout << " getPinLayerBBoxTrackPatterns " << currLayerNum << " " << nextLayerNum << "\n";
-  auto currLayer = getTech()->getLayer(currLayerNum);
-  auto nextLayer = getTech()->getLayer(nextLayerNum);
-  // cout << " xxx0\n";
-  frPrefRoutingDirEnum currPrefRouteDir = currLayer->getDir();
-  frPrefRoutingDirEnum nextPrefRouteDir = nextLayer->getDir();
-  // cout << " xxx1\n";
-  auto currLayerPitch = currLayer->getPitch();
-  auto nextLayerPitch = nextLayer->getPitch();
-  // cout << " xxx2\n";
-  Rectangle bloatBBox;
-  extents(bloatBBox, currLayerPS);
-  // bloatBBox = bloat(bloatBBox, currLayerPitch);
-  frBox bbox(xl(bloatBBox), yl(bloatBBox), xh(bloatBBox), yh(bloatBBox));
-  // get pref dir tracks 
-  while (layerNum2TrackLocs.find(currLayerNum) == layerNum2TrackLocs.end()) {
-    for (auto &tp: getDesign()->getTopBlock()->getTrackPatterns(currLayerNum)) {
-      if (tp->isHorizontal()  && currPrefRouteDir == frcVertPrefRoutingDir ||
-          !tp->isHorizontal() && currPrefRouteDir == frcHorzPrefRoutingDir) {
-        int minTrackNum, maxTrackNum;
-        frCoord lowerCoord = (tp->isHorizontal() ? bbox.left() : bbox.bottom());
-        frCoord upperCoord = (tp->isHorizontal() ? bbox.right() : bbox.top());
-        minTrackNum = (lowerCoord - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (minTrackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < lowerCoord) {
-          ++minTrackNum;
-        }
-        maxTrackNum = (upperCoord - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (maxTrackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() > upperCoord) {
-          --maxTrackNum;
-        }
-        // cout << "minTrackNum / maxTrackNum = " << minTrackNum << " / " << maxTrackNum << "\n";
-
-
-        for (int trackNum = minTrackNum; trackNum <= maxTrackNum; ++trackNum) {
-          frCoord trackLoc = trackNum * tp->getTrackSpacing() + tp->getStartCoord();
-          if (tp->isHorizontal()) {
-            xLoc2TrackPatterns[trackLoc][currLayerNum] = tp.get();
-          } else {
-            yLoc2TrackPatterns[trackLoc][currLayerNum] = tp.get();
-          }
-          layerNum2TrackLocs[currLayerNum].insert(trackLoc);
-        }
-      }
-    }
-    // bloat the bbox if there is no track found in the current bbox;
-    bloatBBox = bloat(bloatBBox, currLayerPitch);
-    bbox = frBox(xl(bloatBBox), yl(bloatBBox), xh(bloatBBox), yh(bloatBBox));
-  }
-
-  extents(bloatBBox, currLayerPS);
-  // bloatBBox = bloat(bloatBBox, nextLayerPitch);
-  bbox = frBox(xl(bloatBBox), yl(bloatBBox), xh(bloatBBox), yh(bloatBBox));
-  while (layerNum2TrackLocs.find(nextLayerNum) == layerNum2TrackLocs.end()) {
-    for (auto &tp: getDesign()->getTopBlock()->getTrackPatterns(nextLayerNum)) {
-      if (tp->isHorizontal()  && nextPrefRouteDir == frcVertPrefRoutingDir ||
-          !tp->isHorizontal() && nextPrefRouteDir == frcHorzPrefRoutingDir) {
-        int minTrackNum, maxTrackNum;
-        frCoord lowerCoord = (tp->isHorizontal() ? bbox.left() : bbox.bottom());
-        frCoord upperCoord = (tp->isHorizontal() ? bbox.right() : bbox.top());
-        minTrackNum = (lowerCoord - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (minTrackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < lowerCoord) {
-          ++minTrackNum;
-        }
-        maxTrackNum = (upperCoord - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (maxTrackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() > upperCoord) {
-          --maxTrackNum;
-        }
-
-
-        for (int trackNum = minTrackNum; trackNum <= maxTrackNum; ++trackNum) {
-          frCoord trackLoc = trackNum * tp->getTrackSpacing() + tp->getStartCoord();
-          if (tp->isHorizontal()) {
-            xLoc2TrackPatterns[trackLoc][nextLayerNum] = tp.get();
-          } else {
-            yLoc2TrackPatterns[trackLoc][nextLayerNum] = tp.get();
-          }
-          layerNum2TrackLocs[nextLayerNum].insert(trackLoc);
-        }
-      }
-    }
-    // bloat the bbox if there is no track found in the current bbox;
-    bloatBBox = bloat(bloatBBox, nextLayerPitch);
-    bbox = frBox(xl(bloatBBox), yl(bloatBBox), xh(bloatBBox), yh(bloatBBox));
-  }
-
-}
-
-
-void FlexPinPrep::getPinLayerBBox(const map<frLayerNum, PolygonSet> &layerNum2PS, 
-                                  map<frLayerNum, Rectangle> &layerNum2BBox) {
-  for (auto mapIt = layerNum2PS.begin(); mapIt != layerNum2PS.end(); ++mapIt) {
-    auto currLayerNum = mapIt->first;
-    Rectangle layerBBox;
-    if (extents(layerBBox, mapIt->second)) {
-      layerNum2BBox[currLayerNum] = layerBBox;
-    }
-  }
-}
-
-void FlexPinPrep::mergePinShapes(frPin* pin, frTransform &xform, map<frLayerNum, PolygonSet> &layerNum2PS) {
-  auto pinLayer2PolySet = pin->getLayer2PolySet();
-  for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-    auto &layerNum = layerIt->first;
-    auto &polySet = layerIt->second;
-    for (auto &poly: polySet) {
-      std::vector<Point> transformedPoints;
-      for (auto it = boost::polygon::begin_points(poly); it != boost::polygon::end_points(poly); ++it) {
-        frPoint tmpPt((*it).x(), (*it).y());
-        tmpPt.transform(xform);
-        transformedPoints.push_back(Point(tmpPt.x(), tmpPt.y()));
-        // std::cout << "(" << tmpPt.x() << ", " << tmpPt.y() << ")\n";
-      }
-      Polygon tmpPoly;
-      boost::polygon::set_points(tmpPoly, transformedPoints.begin(), transformedPoints.end());
-      layerNum2PS[layerNum] += tmpPoly;
-    }
-  }
-}
-
-void FlexPinPrep::mergePinShapes(frPin* pin, map<frLayerNum, PolygonSet> &layerNum2PS) {
-  auto pinLayer2PolySet = pin->getLayer2PolySet();
-  for (auto layerIt = pinLayer2PolySet.begin(); layerIt != pinLayer2PolySet.end(); ++layerIt) {
-    auto &layerNum = layerIt->first;
-    auto &polySet = layerIt->second;
-    for (auto &poly: polySet) {
-      std::vector<Point> transformedPoints;
-      for (auto it = boost::polygon::begin_points(poly); it != boost::polygon::end_points(poly); ++it) {
-        frPoint tmpPt((*it).x(), (*it).y());
-        // tmpPt.transform(xform);
-        transformedPoints.push_back(Point(tmpPt.x(), tmpPt.y()));
-        // std::cout << "(" << tmpPt.x() << ", " << tmpPt.y() << ")\n";
-      }
-      Polygon tmpPoly;
-      boost::polygon::set_points(tmpPoly, transformedPoints.begin(), transformedPoints.end());
-      layerNum2PS[layerNum] += tmpPoly;
-    }
-  }
-}
-
-
-void FlexPinPrep::mergePinShapes(const shared_ptr<frPin> &pin, map<frLayerNum, PolygonSet> &layerNum2PS) {
-  // cout << "mergePinShapes\n";
-  for (auto &uPinFig: pin->getFigs()) {
-    auto pinFig = uPinFig.get();
-    if (pinFig->typeId() == frcRect) {
-      auto rectIn = static_cast<frRect*>(pinFig);
-      auto currLayerNum = rectIn->getLayerNum();
-      // cout << "currLayerNum = " << currLayerNum << "\n" << flush;
-      // cout << "total layerNum = " << getTech()->getLayers().size() << "\n";
-      if (getTech()->getLayer(currLayerNum)->getType() != frLayerTypeEnum::ROUTING) {
-        continue;
-      }
-      // cout << "here " << currLayerNum << "\n" << flush;
-      Rectangle rectOut;
-      frRect2Rectangle(*rectIn, rectOut);
-      layerNum2PS[currLayerNum] += rectOut;
-    } else if (pinFig->typeId() == frcPolygon) {
-      cout << "Warning: TODO: support polygon in mergePinShapes\n";
-    } else {
-      cout << "Warning: unsupported shape in mergePinShapes\n";
-      continue;
-    }
-  }
-}
-
-// get endpoint of planar access given a direction
-void FlexPinPrep::getPlanarEP(const frLayerNum &layerNum, const frPoint &startPt, const frDirEnum &dir, frPoint &endPt) {
-  frCoord endX = startPt.x(), endY = startPt.y();
-  frCoord stepSize = getTech()->getLayer(layerNum)->getPitch();
-  if (getTech()->getTopLayerNum() >= layerNum + 2) {
-    stepSize = getTech()->getLayer(layerNum + 2)->getPitch();
-  }
-  switch (dir) {
-    case (frDirEnum::E):
-      endX += stepSize;
-      break;
-    case (frDirEnum::S):
-      endY -= stepSize;
-      break;
-    case (frDirEnum::W):
-      endX -= stepSize;
-      break;
-    case (frDirEnum::N):
-      endY += stepSize;
-      break;
-    default:
-      std::cout << "unexpected direction in getPlanarEP\n";
-  }
-  endPt.set(endX, endY);
-}
-
-
-bool FlexPinPrep::isValidViaAccess(frPin *pinPtr,
-                                   frInstTerm *instTerm,
-                                   const std::vector<frBlockObject*> instObjs,
-                                   const frLayerNum &layerNum,
-                                   const frPoint &startPt,
-                                   frViaDef* viaDef,
-                                   viaPriorityTuple &priority) {
-  bool enableOutput = false;
-  bool isNotDefaultVia, isNotUpperAlign, isNotLowerAlign;
-  frCoord nonEnclosedArea = 0, upperArea = 0, lowerArea = 0;
-  
-  
-
-  double dbu = getTech()->getDBUPerUU();
-  frInst* inst = instTerm->getInst();
-  frBox mbox;
-  frTransform xform, revertCellXForm;
-
-  
-
-  // inst->getTransform(xform);
-  // inst->getRefBlock()->getBoundaryBBox(mbox);
-  // frPoint size(mbox.right(), mbox.top());
-  // termXForm.set(xform.orient());
-  // termXForm.updateXform(size);
-  inst->getUpdatedXform(xform);
-  // xform.revert(revertCellXForm);
-  revertCellXForm.set(-xform.xOffset(), -xform.yOffset());
-  // std::cout << xform.xOffset() << " " << xform.yOffset() << "\n";
-  // std::cout << revertCellXForm.xOffset() << " " << revertCellXForm.yOffset() << "\n";
-  revertCellXForm.set(frcR0);
-
-  auto cellObjs = instObjs;
-  std::unique_ptr<frVia> via = std::make_unique<frVia>(viaDef);
-  via->setOrigin(startPt);
-  frTransform viaXform(startPt);
-  via->setTransform(viaXform);
-  if (instTerm->hasNet()) {
-    via->addToNet(instTerm->getNet());
-  } else {
-    via->addToPin(pinPtr);
-  }
-  cellObjs.push_back(via.get());
-  DRCWorker drcWorker(design, cellObjs);
-  if (instTerm->hasNet()) {
-    drcWorker.setTarget(instTerm->getNet());
-  } else {
-    drcWorker.setTarget(instTerm);
-  }
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  drcWorker.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  drcWorker.setup();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  drcWorker.main();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  drcSpan0 += duration_cast<duration<double>>(t1 - t0);
-  drcSpan1 += duration_cast<duration<double>>(t2 - t1);
-  drcSpan2 += duration_cast<duration<double>>(t3 - t2);
-  // drcWorker.report();
-
-  // get priority information
-  // isNotDefaultVia = (getTech()->getLayer(viaDef->getCutLayerNum())->getDefaultViaDef() != viaDef);
-  isNotDefaultVia = !(viaDef->getDefault());
-  frCoord ovlpArea;
-  PolygonSet viaLayerPS1;
-  for (auto &fig: via->getViaDef()->getLayer1Figs()) {
-    frBox bbox;
-    fig->getBBox(bbox);
-    bbox.transform(viaXform);
-    Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-    // std::cout << bbox.left() << " " << bbox.bottom() << " " << bbox.right() << " " << bbox.top() << "\n";
-    viaLayerPS1 += bboxRect;
-  }
-  lowerArea = area(viaLayerPS1);
-
-  Rectangle layer1Rect;
-  extents(layer1Rect, viaLayerPS1);
-  bool isLayer1Horz = (xh(layer1Rect) - xl(layer1Rect)) > (yh(layer1Rect) - yl(layer1Rect));
-  isNotLowerAlign = (isLayer1Horz != (getTech()->getLayer(viaDef->getLayer1Num())->getDir() == frcHorzPrefRoutingDir));
-
-  PolygonSet viaLayerPS2;
-  for (auto &fig: via->getViaDef()->getLayer2Figs()) {
-    frBox bbox;
-    fig->getBBox(bbox);
-    Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-    viaLayerPS2 += bboxRect;
-  }
-
-  Rectangle layer2Rect;
-  extents(layer2Rect, viaLayerPS2);
-  bool isLayer2Horz = (xh(layer2Rect) - xl(layer2Rect)) > (yh(layer2Rect) - yl(layer2Rect));
-  isNotUpperAlign = (isLayer2Horz != (getTech()->getLayer(viaDef->getLayer2Num())->getDir() == frcHorzPrefRoutingDir));
-
-
-
-  for (auto &pin: instTerm->getTerm()->getPins()) {
-    auto pinLayer2PolySet = pin->getLayer2PolySet();
-    if (pinLayer2PolySet.find(viaDef->getLayer1Num()) != pinLayer2PolySet.end()) {
-      PolygonSet pinLayer1PS;
-      auto &polySet = pinLayer2PolySet[viaDef->getLayer1Num()];
-      for (auto &poly: polySet) {
-        std::vector<Point> transformedPts;
-        for (auto it = boost::polygon::begin_points(poly); it != boost::polygon::end_points(poly); ++it) {
-          frPoint tmpPt((*it).x(), (*it).y());
-          tmpPt.transform(xform);
-          transformedPts.push_back(Point(tmpPt.x(), tmpPt.y()));
-        }
-        Polygon tmpPoly;
-        boost::polygon::set_points(tmpPoly, transformedPts.begin(), transformedPts.end());
-        pinLayer1PS += tmpPoly;
-      }
-      ovlpArea = area(viaLayerPS1 & pinLayer1PS);
-    } else {
-      ovlpArea = 0;
-    }
-    nonEnclosedArea += (area(viaLayerPS1) - ovlpArea);
-  }
-
-  // priority = make_tuple(isNotDefaultVia, nonEnclosedArea, isNotUpperAlign, isNotLowerAlign, upperArea, lowerArea);
-  priority = make_tuple(isNotDefaultVia, isNotUpperAlign, nonEnclosedArea, isNotLowerAlign, upperArea, lowerArea);
-
-  if (drcWorker.getViolations().empty()) {
-    if (enableOutput) {
-      std::cout << "  @@@clean via access\n";
-    }
-    // output for via access check script
-    if (enableOutput) {
-      frPoint transformedSP = startPt;
-      transformedSP.transform(revertCellXForm);
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                           {frcR90, "R90"}, 
-                                           {frcR180, "R180"}, 
-                                           {frcR270, "R270"}, 
-                                           {frcMY, "MY"}, 
-                                           {frcMXR90, "MX90"},
-                                           {frcMX, "MX"},
-                                           {frcMYR90, "MY90"}};
-      std::cout << "libPrepOutViaClean " << instTerm->getInst()->getRefBlock()->getName() << " "
-                << instTerm->getTerm()->getName() << " " << viaDef->getName() << " "
-                << transformedSP.x() << " " << transformedSP.y() 
-                << " " << orient2Name[instTerm->getInst()->getOrient()] << " " << nonEnclosedArea << "\n";
-    }
-    return true;
-  } else {
-    if (enableOutput) {
-      std::cout << "  @@@dirty via access\n";
-      frPoint transformedSP = startPt;
-      transformedSP.transform(revertCellXForm);
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                           {frcR90, "R90"}, 
-                                           {frcR180, "R180"}, 
-                                           {frcR270, "R270"}, 
-                                           {frcMY, "MY"}, 
-                                           {frcMXR90, "MX90"},
-                                           {frcMX, "MX"},
-                                           {frcMYR90, "MY90"}};
-      std::cout << "libPrepOutViaDirty " << instTerm->getInst()->getRefBlock()->getName() << " "
-                << instTerm->getTerm()->getName() << " " << viaDef->getName() << " "
-                << transformedSP.x() << " " << transformedSP.y() 
-                << " " << orient2Name[instTerm->getInst()->getOrient()] << "\n";
-      auto violations = drcWorker.getViolations();
-      for (auto &marker: violations) {
-        // std::cout << "  #marker = " << violations.size() << "\n";
-        frBox bbox;
-        marker.getBBox(bbox);
-        std::cout << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        std::cout << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-                  << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    }
-    return false;
-  }
-}
-
-bool FlexPinPrep::isValidViaAccess(frPin *pinPtr,
-                                   frTerm *term,
-                                   const std::vector<frBlockObject*> instObjs,
-                                   const frLayerNum &layerNum,
-                                   const frPoint &startPt,
-                                   frViaDef* viaDef,
-                                   viaPriorityTuple &priority) {
-  bool enableOutput = false;
-  bool isNotDefaultVia, isNotUpperAlign, isNotLowerAlign;
-  frCoord nonEnclosedArea = 0, upperArea = 0, lowerArea = 0;
-
-  double dbu = getTech()->getDBUPerUU();
-
-  auto cellObjs = instObjs;
-  std::unique_ptr<frVia> via = std::make_unique<frVia>(viaDef);
-  via->setOrigin(startPt);
-  frTransform viaXform(startPt);
-  via->setTransform(viaXform);
-  if (term->hasNet()) {
-    via->addToNet(term->getNet());
-  } else {
-    via->addToPin(pinPtr);
-  }
-  cellObjs.push_back(via.get());
-  DRCWorker drcWorker(design, cellObjs);
-  if (term->hasNet()) {
-    drcWorker.setTarget(term->getNet());
-  } else {
-    drcWorker.setTarget(term);
-  }
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  drcWorker.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  drcWorker.setup();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  drcWorker.main();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  drcSpan0 += duration_cast<duration<double>>(t1 - t0);
-  drcSpan1 += duration_cast<duration<double>>(t2 - t1);
-  drcSpan2 += duration_cast<duration<double>>(t3 - t2);
-
-  // get priority information
-  // isNotDefaultVia = (getTech()->getLayer(viaDef->getCutLayerNum())->getDefaultViaDef() != viaDef); 
-  isNotDefaultVia = !(viaDef->getDefault());
-  frCoord ovlpArea;
-  // std::unique_ptr<frVia> origVia = std::make_unique<frVia>(viaDef);
-  // frPoint transformedSP = startPt;
-  // origVia->setOrigin(transformedSP);
-  // frTransform transformedViaXform(startPt);
-  // origVia->setTransform(transformedViaXform);
-  for (auto &pin: term->getPins()) {
-    auto pinLayer2PolySet = pin->getLayer2PolySet();
-    PolygonSet viaLayerPS1;
-    for (auto &fig: via->getViaDef()->getLayer1Figs()) {
-      frBox bbox;
-      fig->getBBox(bbox);
-      bbox.transform(viaXform);
-      Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-      viaLayerPS1 += bboxRect;
-    }
-    lowerArea = area(viaLayerPS1);
-    if (pinLayer2PolySet.find(viaDef->getLayer1Num()) != pinLayer2PolySet.end()) {
-      PolygonSet pinLayer1PS;
-      auto &polySet = pinLayer2PolySet[viaDef->getLayer1Num()];
-      for (auto &poly: polySet) {
-        std::vector<Point> transformedPts;
-        for (auto it = boost::polygon::begin_points(poly); it != boost::polygon::end_points(poly); ++it) {
-          frPoint tmpPt((*it).x(), (*it).y());
-          // tmpPt.transform(xform);
-          transformedPts.push_back(Point(tmpPt.x(), tmpPt.y()));
-        }
-        Polygon tmpPoly;
-        boost::polygon::set_points(tmpPoly, transformedPts.begin(), transformedPts.end());
-        pinLayer1PS += tmpPoly;
-      }
-      ovlpArea = area(viaLayerPS1 & pinLayer1PS);
-    } else {
-      ovlpArea = 0;
-    }
-    nonEnclosedArea += (area(viaLayerPS1) - ovlpArea);
-
-    Rectangle layer1Rect;
-    extents(layer1Rect, viaLayerPS1);
-    bool isLayer1Horz = (xh(layer1Rect) - xl(layer1Rect)) > (yh(layer1Rect) - yl(layer1Rect));
-    isNotLowerAlign = (isLayer1Horz != (getTech()->getLayer(viaDef->getLayer1Num())->getDir() == frcHorzPrefRoutingDir));
-
-    PolygonSet viaLayerPS2;
-    for (auto &fig: via->getViaDef()->getLayer2Figs()) {
-      frBox bbox;
-      fig->getBBox(bbox);
-      Rectangle bboxRect(bbox.left(), bbox.bottom(), bbox.right(), bbox.top());
-      viaLayerPS2 += bboxRect;
-    }
-    // upperArea = area(viaLayerPS2);
-    // if (pinLayer2PolySet.find(viaDef->getLayer2Num()) != pinLayer2PolySet.end()) {
-    //   ovlpArea = area(viaLayerPS2 & pinLayer2PolySet[viaDef->getLayer2Num()]);
-    // } else {
-    //   ovlpArea = 0;
-    // }
-    // nonEnclosedArea += (area(viaLayerPS2) - ovlpArea);
-
-    Rectangle layer2Rect;
-    extents(layer2Rect, viaLayerPS2);
-    bool isLayer2Horz = (xh(layer2Rect) - xl(layer2Rect)) > (yh(layer2Rect) - yl(layer2Rect));
-    isNotUpperAlign = (isLayer2Horz != (getTech()->getLayer(viaDef->getLayer2Num())->getDir() == frcHorzPrefRoutingDir));
-
-
-  }
-
-  // priority = make_tuple(isNotDefaultVia, nonEnclosedArea, isNotUpperAlign, isNotLowerAlign, upperArea, lowerArea);
-  priority = make_tuple(isNotDefaultVia, isNotUpperAlign, nonEnclosedArea, isNotLowerAlign, upperArea, lowerArea);
-
-
-
-
-
-  if (drcWorker.getViolations().empty()) {
-    if (enableOutput) {
-      std::cout << "  @@@clean via access\n";
-      // output for via access check script
-      frPoint transformedSP = startPt;
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                           {frcR90, "R90"}, 
-                                           {frcR180, "R180"}, 
-                                           {frcR270, "R270"}, 
-                                           {frcMY, "MY"}, 
-                                           {frcMXR90, "MX90"},
-                                           {frcMX, "MX"},
-                                           {frcMYR90, "MY90"}};
-      std::cout << "termPrepOutViaClean " << term->getName() << " " << viaDef->getName() << " "
-                << transformedSP.x() << " " << transformedSP.y() << "\n";
-    }
-    return true;
-  } else {
-    if (enableOutput) {
-      std::cout << "  @@@dirty via access\n";
-      frPoint transformedSP = startPt;
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                           {frcR90, "R90"}, 
-                                           {frcR180, "R180"}, 
-                                           {frcR270, "R270"}, 
-                                           {frcMY, "MY"}, 
-                                           {frcMXR90, "MX90"},
-                                           {frcMX, "MX"},
-                                           {frcMYR90, "MY90"}};
-      std::cout << "libPrepOutViaDirty " << term->getName() << " " << viaDef->getName() << " "
-                << transformedSP.x() << " " << transformedSP.y() << "\n";
-      auto violations = drcWorker.getViolations();
-      for (auto &marker: violations) {
-        // std::cout << "  #marker = " << violations.size() << "\n";
-        frBox bbox;
-        marker.getBBox(bbox);
-        std::cout << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        std::cout << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-                  << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    }
-    return false;
-  }
-}
-
-bool FlexPinPrep::isValidPlanarAccess(frPin* pinPtr,
-                                      frInstTerm *instTerm,
-                                      const std::vector<frBlockObject*> instObjs,
-                                      const frLayerNum &layerNum,
-                                      const frPoint &startPt,
-                                      const frPoint &endPt,
-                                      const PolygonSet &layerPS) {
-  bool enableOutput = false;
-  double dbu = getTech()->getDBUPerUU();
-  
-  for (auto &poly: layerPS) {
-    if (contains(poly, Point(endPt.x(), endPt.y()))) {
-      return false;
-    }
-  }
-
-  frInst* inst = instTerm->getInst();
-  frBox mbox;
-  frTransform xform, termXForm, revertCellXForm;
-
-  
-
-  inst->getTransform(xform);
-  inst->getRefBlock()->getBoundaryBBox(mbox);
-  frPoint size(mbox.right(), mbox.top());
-  termXForm.set(xform.orient());
-  termXForm.updateXform(size);
-  // xform.revert(revertCellXForm);
-  revertCellXForm.set(-xform.xOffset(), -xform.yOffset());
-  // std::cout << xform.xOffset() << " " << xform.yOffset() << "\n";
-  // std::cout << revertCellXForm.xOffset() << " " << revertCellXForm.yOffset() << "\n";
-  revertCellXForm.set(frcR0);
-  // xform.updateXform(size);
-  // xform.revert(revertXForm);
-
-
-  auto cellObjs = instObjs;
-
-  // instantiate a wire and check DRC
-  std::unique_ptr<frPathSeg> apSeg = std::make_unique<frPathSeg>() ;
-  apSeg->setLayerNum(layerNum);
-  if (startPt < endPt) {
-    apSeg->setPoints(startPt, endPt);
-  } else {
-    apSeg->setPoints(endPt, startPt);
-  }
-  apSeg->setStyle(getTech()->getLayer(layerNum)->getDefaultSegStyle());
-  if (instTerm->hasNet()) {
-    apSeg->addToNet(instTerm->getNet());
-  } else {
-    apSeg->addToPin(pinPtr);
-  }
-  cellObjs.push_back(apSeg.get());
-  DRCWorker drcWorker(design, cellObjs);
-  if (instTerm->hasNet()) {
-    drcWorker.setTarget(instTerm->getNet());
-  } else {
-    drcWorker.setTarget(instTerm);
-  }
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  drcWorker.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  drcWorker.setup();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  drcWorker.main();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  drcSpan0 += duration_cast<duration<double>>(t1 - t0);
-  drcSpan1 += duration_cast<duration<double>>(t2 - t1);
-  drcSpan2 += duration_cast<duration<double>>(t3 - t2);
-
-  frCoord layerWidth = getTech()->getLayer(layerNum)->getWidth();
-
-  if (drcWorker.getViolations().empty()) {
-    if (enableOutput) {
-      std::cout << "  @@@clean planar access\n";
-      frPoint transSP, transEP;
-      if (startPt < endPt) {
-        transSP = startPt;
-        transEP = endPt;
-      } else {
-        transSP = endPt;
-        transEP = startPt;
-      }
-      transSP.transform(revertCellXForm);
-      transEP.transform(revertCellXForm);
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                                       {frcR90, "R90"}, 
-                                                       {frcR180, "R180"}, 
-                                                       {frcR270, "R270"}, 
-                                                       {frcMY, "MY"}, 
-                                                       {frcMXR90, "MX90"},
-                                                       {frcMX, "MX"},
-                                                       {frcMYR90, "MY90"}};
-      if (transSP.x() == transEP.x()) {
-        std::cout << "libPrepOutSegClean " << instTerm->getInst()->getRefBlock()->getName() << " "
-                  << instTerm->getTerm()->getName() << " "
-                 << transSP.x() << " " << transSP.y() - layerWidth / 2 << " "
-                 << transEP.x() << " " << transEP.y() + layerWidth / 2 << " "
-                 << " " << orient2Name[instTerm->getInst()->getOrient()] << "\n";
-      } else {
-        std::cout << "libPrepOutSegClean " << instTerm->getInst()->getRefBlock()->getName() << " "
-                  << instTerm->getTerm()->getName() << " "
-                 << transSP.x() - layerWidth / 2 << " " << transSP.y() << " "
-                 << transEP.x() + layerWidth / 2 << " " << transEP.y() << " "
-                 << " " << orient2Name[instTerm->getInst()->getOrient()] << "\n";
-      }
-    }
-    return true;
-  } else {
-    if (enableOutput) {
-      std::cout << "  @@@dirty planar access\n";
-      frPoint transSP, transEP;
-      if (startPt < endPt) {
-        transSP = startPt;
-        transEP = endPt;
-      } else {
-        transSP = endPt;
-        transEP = startPt;
-      }
-      transSP.transform(revertCellXForm);
-      transEP.transform(revertCellXForm);
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                                       {frcR90, "R90"}, 
-                                                       {frcR180, "R180"}, 
-                                                       {frcR270, "R270"}, 
-                                                       {frcMY, "MY"}, 
-                                                       {frcMXR90, "MX90"},
-                                                       {frcMX, "MX"},
-                                                       {frcMYR90, "MY90"}};
-      if (transSP.x() == transEP.x()) {
-        std::cout << "libPrepOutSegDirty " << instTerm->getInst()->getRefBlock()->getName() << " "
-                  << instTerm->getTerm()->getName() << " "
-                 << transSP.x() << " " << transSP.y() - layerWidth / 2 << " "
-                 << transEP.x() << " " << transEP.y() + layerWidth / 2 << " "
-                 << " " << orient2Name[instTerm->getInst()->getOrient()] << "\n";
-      } else {
-        std::cout << "libPrepOutSegDirty " << instTerm->getInst()->getRefBlock()->getName() << " "
-                  << instTerm->getTerm()->getName() << " "
-                 << transSP.x() - layerWidth / 2 << " " << transSP.y() << " "
-                 << transEP.x() + layerWidth / 2 << " " << transEP.y() << " "
-                 << " " << orient2Name[instTerm->getInst()->getOrient()] << "\n";
-      }
-      auto violations = drcWorker.getViolations();
-      for (auto &marker: violations) {
-        // std::cout << "  #marker = " << violations.size() << "\n";
-        frBox bbox;
-        marker.getBBox(bbox);
-        std::cout << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        std::cout << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-                  << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    }
-
-    return false;
-
-  }
-
-}
-
-
-bool FlexPinPrep::isValidPlanarAccess(frPin* pinPtr,
-                                      frTerm *term,
-                                      const std::vector<frBlockObject*> instObjs,
-                                      const frLayerNum &layerNum,
-                                      const frPoint &startPt,
-                                      const frPoint &endPt,
-                                      const PolygonSet &layerPS) {
-  bool enableOutput = false;
-  double dbu = getTech()->getDBUPerUU();
-
-  auto cellObjs = instObjs;
-  for (auto &poly: layerPS) {
-    if (contains(poly, Point(endPt.x(), endPt.y()))) {
-      return false;
-    }
-  }
-
-  // instantiate a wire and check DRC
-  std::unique_ptr<frPathSeg> apSeg = std::make_unique<frPathSeg>() ;
-  apSeg->setLayerNum(layerNum);
-  if (startPt < endPt) {
-    apSeg->setPoints(startPt, endPt);
-  } else {
-    apSeg->setPoints(endPt, startPt);
-  }
-  apSeg->setStyle(getTech()->getLayer(layerNum)->getDefaultSegStyle());
-  if (term->hasNet()) {
-    apSeg->addToNet(term->getNet());
-  } else {
-    apSeg->addToPin(pinPtr);
-  }
-  cellObjs.push_back(apSeg.get());
-  DRCWorker drcWorker(design, cellObjs);
-  if (term->hasNet()) {
-    drcWorker.setTarget(term->getNet());
-  } else {
-    drcWorker.setTarget(term);
-  }
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  drcWorker.init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  drcWorker.setup();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  drcWorker.main();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-  drcSpan0 += duration_cast<duration<double>>(t1 - t0);
-  drcSpan1 += duration_cast<duration<double>>(t2 - t1);
-  drcSpan2 += duration_cast<duration<double>>(t3 - t2);
-
-  frCoord layerWidth = getTech()->getLayer(layerNum)->getWidth();
-
-  if (drcWorker.getViolations().empty()) {
-    if (enableOutput) {
-      std::cout << "  @@@clean planar access\n";
-      frPoint transSP, transEP;
-      if (startPt < endPt) {
-        transSP = startPt;
-        transEP = endPt;
-      } else {
-        transSP = endPt;
-        transEP = startPt;
-      }
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                                       {frcR90, "R90"}, 
-                                                       {frcR180, "R180"}, 
-                                                       {frcR270, "R270"}, 
-                                                       {frcMY, "MY"}, 
-                                                       {frcMXR90, "MX90"},
-                                                       {frcMX, "MX"},
-                                                       {frcMYR90, "MY90"}};
-      if (transSP.x() == transEP.x()) {
-        std::cout << "termPrepOutSegClean " << term->getName() << " "
-                 << transSP.x() << " " << transSP.y() - layerWidth / 2 << " "
-                 << transEP.x() << " " << transEP.y() + layerWidth / 2 << " " << "\n";
-      } else {
-        std::cout << "termPrepOutSegClean " << term->getName() << " "
-                 << transSP.x() - layerWidth / 2 << " " << transSP.y() << " "
-                 << transEP.x() + layerWidth / 2 << " " << transEP.y() << " " << "\n";
-      }
-    }
-    return true;
-  } else {
-    if (enableOutput) {
-      std::cout << "  @@@dirty planar access\n";
-      frPoint transSP, transEP;
-      if (startPt < endPt) {
-        transSP = startPt;
-        transEP = endPt;
-      } else {
-        transSP = endPt;
-        transEP = startPt;
-      }
-      std::map<frOrientEnum, std::string> orient2Name = {{frcR0, "R0"}, 
-                                                       {frcR90, "R90"}, 
-                                                       {frcR180, "R180"}, 
-                                                       {frcR270, "R270"}, 
-                                                       {frcMY, "MY"}, 
-                                                       {frcMXR90, "MX90"},
-                                                       {frcMX, "MX"},
-                                                       {frcMYR90, "MY90"}};
-      if (transSP.x() == transEP.x()) {
-        std::cout << "termPrepOutSegDirty " << term->getName() << " "
-                 << transSP.x() << " " << transSP.y() - layerWidth / 2 << " "
-                 << transEP.x() << " " << transEP.y() + layerWidth / 2 << " " << "\n";
-      } else {
-        std::cout << "libPrepOutSegDirty " << term->getName() << " "
-                 << transSP.x() - layerWidth / 2 << " " << transSP.y() << " "
-                 << transEP.x() + layerWidth / 2 << " " << transEP.y() << " " << "\n";
-      }
-      auto violations = drcWorker.getViolations();
-      for (auto &marker: violations) {
-        // std::cout << "  #marker = " << violations.size() << "\n";
-        frBox bbox;
-        marker.getBBox(bbox);
-        std::cout << "  violation type: " << int(marker.getConstraint()->typeId()) << "\n";
-        std::cout << "    bbox = (" << bbox.left() / dbu << ", " << bbox.bottom() / dbu << ") - ("
-                  << bbox.right() / dbu << ", " << bbox.top() / dbu << ")\n";
-      }
-    }
-
-    return false;
-
-  }
-
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.h b/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.h
deleted file mode 100644
index a706c87..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frPinPrep.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_PIN_PREP_H
-#define _FR_PIN_PREP_H
-
-#include <memory>
-#include "frDesign.h"
-#include "frBaseTypes.h"
-#include <map>
-#include <set>
-#include <memory>
-#include <tuple>
-#include <chrono>
-
-namespace fr {
-  class frNet;
-  class FlexTrack;
-  // not default via, not align upper layer, non-enclosed area, not align lower layer,
-  // upper layer area, lower layer area
-  typedef std::tuple<bool, bool, frCoord, bool, frCoord, frCoord> viaPriorityTuple;
-  // not default via, not align upper layer,
-  // upper layer area, lower layer area
-  typedef std::tuple<bool, bool, frCoord, frCoord> viaRawPriorityTuple;
-
-  class FlexPinPrep {
-  public:
-    // constructor
-    FlexPinPrep(frTechObject* techIn,
-                frDesign* designIn,
-                std::vector<frTrackPattern*> &prefTrackPatternsIn,
-                std::map<frBlock*, std::map<frOrient, std::map<std::vector<frCoord>, std::set<frInst*, frBlockObjectComp> > >, frBlockObjectComp> &trackOffsetMapIn):
-                tech(techIn), design(designIn), prefTrackPatterns(prefTrackPatternsIn), trackOffsetMap(trackOffsetMapIn) {};
-
-    // getters
-    // std::shared_ptr<frTechObject> getTech() const {
-    //   return tech.lock();
-    // }
-    // std::shared_ptr<frDesign> getDesign() const {
-    //   return design.lock();
-    // }
-    frTechObject* getTech() const {
-      return tech;
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    // others
-    void init();
-    int main();
-    void reportPinLoc();
-    
-
-    void pinPrep();
-    void netPinPrep(const std::shared_ptr<frNet> &net);
-    void mergePinShapes(const std::shared_ptr<frPin> &pin, std::map<frLayerNum, PolygonSet> &layerNum2PS);
-    void mergePinShapes(frPin* pin, frTransform &xform, std::map<frLayerNum, PolygonSet> &layerNum2PS);
-    void mergePinShapes(frPin* pin, std::map<frLayerNum, PolygonSet> &layerNum2PS);
-    void getPinLayerBBox(const std::map<frLayerNum, PolygonSet> &layerNum2PS, 
-                         std::map<frLayerNum, Rectangle> &layerNum2BBox);
-    void getPinTrackPatterns(const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                             std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &xLoc2TrackPatterns,
-                             std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &yLoc2TrackPatterns,
-                             std::map<frLayerNum, frPrefRoutingDirEnum> &layerNum2PrefRouteDir);
-    void getLayerOnGridPoints(const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                              const std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &xLoc2TrackPatterns,
-                              const std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &yLoc2TrackPatterns,
-                              std::map<frLayerNum, frPrefRoutingDirEnum> layerNum2PrefRouteDir,
-                              std::map<frLayerNum, std::set<frPoint> > &layerNum2OnGridPoints);
-    void filterOnGridAccessPoint(const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                                 std::map<frLayerNum, std::set<frPoint> > &layerNum2OnGridPoints,
-                                 std::map<frLayerNum, std::set<frPoint> > &layerNum2OnGridAccessPoints);
-
-    void getPinGCellSpan(const std::shared_ptr<frPin> &pin,
-                         const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                         std::map<frPoint, std::set<frLayerNum> > &ovlpGCell2Layer);
-    void genAndPopulateLayer2APRtree(const std::shared_ptr<frNet> &net,
-                                     const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                                     const std::map<frLayerNum, std::set<frPoint> > &layerNum2OnGridPoints,
-                                     std::map<frLayerNum, bgi::rtree< rq_iter_value_t<FlexAccessPattern>, bgi::quadratic<16> > > &layer2APs,
-                                     std::shared_ptr<frPin> &pin);
-    void addOffGridPinAccessPattern(const std::shared_ptr<frNet> &net,
-                                    const std::map<frLayerNum, PolygonSet> &layerNum2PS,
-                                    const std::map<frPoint, std::set<frLayerNum> > &ovlpGCell2Layer,
-                                    std::map<frLayerNum, bgi::rtree< rq_iter_value_t<FlexAccessPattern>, bgi::quadratic<16> > > &layer2APs,
-                                    std::shared_ptr<frPin> &pin);
-    // bool instTermPinPrep(frInstTerm *instTerm,
-    //                      std::map<frPin*, std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > > > &pin2APEPs);
-    void instTermPinPrep(frInstTerm* instTerm, const std::set<frInst*, frBlockObjectComp> &instsIn);
-    // void termPinPrep(frTerm* term,
-    //                  std::map<frPin*, std::set<std::pair<std::pair<frPoint, frLayerNum>, std::pair<frPoint, frLayerNum> > > > &pin2APEPs);
-    void termPinPrep(frTerm *term);
-    void getPinBBoxTrackPatterns(const std::map<frLayerNum, Rectangle> &layerNum2BBox,
-                                 std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &xLoc2TrackPatterns,
-                                 std::map<frCoord, std::map<frLayerNum, std::shared_ptr<frTrackPattern> > > &yLoc2TrackPatterns,
-                                 std::map<frLayerNum, frPrefRoutingDirEnum> &layerNum2PrefRouteDir);
-    void getPinLayerBBoxTrackPatterns(const frLayerNum &currLayerNum,
-                                      const PolygonSet &currLayerPS,
-                                      std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                      std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns);
-    void getPinLayerAPStartPoints(const frLayerNum &currLayerNum,
-                                  const PolygonSet &currLayerPS,
-                                  std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                  std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns,
-                                  std::map<frPoint, int> &startPoints);
-    void getPinLayerAPStartPoints_shapeCenter(const frLayerNum &currLayerNum,
-                                              const PolygonSet &currLayerPS,
-                                              std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                              std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns,
-                                              std::map<frPoint, int> &startPoints);
-    void getPinLayerAPEndPoints(const frLayerNum &currLayerNum,
-                                const PolygonSet &currLayerPS,
-                                std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &xLoc2TrackPatterns,
-                                std::map<frCoord, std::map<frLayerNum, frTrackPattern*> > &yLoc2TrackPatterns,
-                                std::set<std::pair<frLayerNum, frPoint> > &endPoints);
-    void getAccessPattern(const frPoint &startPoint, 
-                          const frLayerNum &startLayerNum,
-                          const frPoint &endPoint,
-                          const frLayerNum &endLayerNum,
-                          FlexAccessPattern &ap);
-    
-    void getPlanarEP(const frLayerNum &layerNum, const frPoint &startPt, const frDirEnum &dir, frPoint &endPt);
-
-    bool isValidViaAccess(frPin *pinPtr,
-                          frInstTerm *instTerm,
-                          const std::vector<frBlockObject*> instObjs,
-                          const frLayerNum &layerNum,
-                          const frPoint &startPt,
-                          frViaDef* viaDef,
-                          viaPriorityTuple &priority);
-    bool isValidViaAccess(frPin *pinPtr,
-                          frTerm *term,
-                          const std::vector<frBlockObject*> instObjs,
-                          const frLayerNum &layerNum,
-                          const frPoint &startPt,
-                          frViaDef* viaDef,
-                          viaPriorityTuple &priority);
-    bool isValidPlanarAccess(frPin* pinPtr,
-                             frInstTerm *instTerm,
-                             const std::vector<frBlockObject*> instObjs,
-                             const frLayerNum &layerNum,
-                             const frPoint &startPt,
-                             const frPoint &endPt,
-                             const PolygonSet &layerPS);
-    bool isValidPlanarAccess(frPin* pinPtr,
-                             frTerm *term,
-                             const std::vector<frBlockObject*> instObjs,
-                             const frLayerNum &layerNum,
-                             const frPoint &startPt,
-                             const frPoint &endPt,
-                             const PolygonSet &layerPS);
-    void updateAPCost(frInst *inst);
-    void getViaRawPriority(frViaDef* viaDef, viaRawPriorityTuple &priority);
-  protected:
-    frTechObject *tech;
-    frDesign *design;
-    int APCnt = 0;
-    std::vector<frTrackPattern*> prefTrackPatterns;
-    std::map<frBlock*, std::map<frOrient, std::map<std::vector<frCoord>, std::set<frInst*, frBlockObjectComp> > >, frBlockObjectComp> trackOffsetMap;
-    std::map<frLayerNum, std::map<int, std::map<viaRawPriorityTuple, frViaDef*> > > layerNum2ViaDefs;
-    int maxViaAttemptLimit = 3;
-    std::chrono::duration<double> accuSpan0, accuSpan1, accuSpan2;
-    std::chrono::duration<double> drcSpan0, drcSpan1, drcSpan2;
-  };
-}
-
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.cpp b/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.cpp
deleted file mode 100644
index 84de719..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.cpp
+++ /dev/null
@@ -1,801 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "io/frShapeUtil.h"
-#include <boost/icl/interval_map.hpp>
-
-namespace fr {
-  void frRect2Poly(frRect &rectIn, boostPolygon &polyOut) {
-    frBox tmpBox;
-    rectIn.getBBox(tmpBox);
-    polyOut = boostPolygon();
-    bg::append(polyOut, boostPoint(tmpBox.left(), tmpBox.bottom()));
-    bg::append(polyOut, boostPoint(tmpBox.left(), tmpBox.top()));
-    bg::append(polyOut, boostPoint(tmpBox.right(), tmpBox.top()));
-    bg::append(polyOut, boostPoint(tmpBox.right(), tmpBox.bottom()));
-    bg::append(polyOut, boostPoint(tmpBox.left(), tmpBox.bottom()));
-  }
-
-  void frPolygon2Poly(frPolygon &polygonIn, boostPolygon &polyOut) {
-    polyOut = boostPolygon();
-    auto polyPoints = polygonIn.getPoints();
-    for (auto &point: polyPoints) {
-      bg::append(polyOut, boostPoint((int)point.x(), (int)point.y()));
-    }
-  }
-
-  void frBox2Poly(frBox &boxIn, boostPolygon &polyOut) {
-    polyOut = boostPolygon();
-    bg::append(polyOut, boostPoint(boxIn.left(), boxIn.bottom()));
-    bg::append(polyOut, boostPoint(boxIn.left(), boxIn.top()));
-    bg::append(polyOut, boostPoint(boxIn.right(), boxIn.top()));
-    bg::append(polyOut, boostPoint(boxIn.right(), boxIn.bottom()));
-    bg::append(polyOut, boostPoint(boxIn.left(), boxIn.bottom()));
-  }
-
-  void frBox2Rectangle(frBox &boxIn, Rectangle &rectOut) {
-    rectOut = Rectangle(boxIn.left(), boxIn.bottom(), boxIn.right(), boxIn.top());
-  }
-
-  void frRect2Rectangle(frRect &rectIn, Rectangle &rectOut) {
-    frBox rectInBox;
-    rectIn.getBBox(rectInBox);
-    rectOut = Rectangle(rectInBox.left(), rectInBox.bottom(), rectInBox.right(), rectInBox.top());
-  }
-
-  void frBlockage2Poly(frBlockage &blockageIn, boostPolygon &polyOut) {
-    auto points = blockageIn.getPoints();
-    polyOut = boostPolygon();
-    for (auto point: points) {
-      bg::append(polyOut, boostPoint(point.x(), point.y()));
-    }
-  }
-
-  // Use before checking overlapping
-  double frBox2BoxDist(frBox &box1, frBox &box2) {
-    frCoord xDist = std::max(0, std::max(box1.left(), box2.left()) - std::min(box1.right(), box2.right()) );
-    frCoord yDist = std::max(0, std::max(box1.bottom(), box2.bottom()) - std::min(box1.top(), box2.top()));
-    return std::sqrt(xDist * xDist + yDist * yDist);
-  }
-
-  double frBox2BoxDist(box_t &box1, box_t &box2) {
-    frCoord llx1, lly1, urx1, ury1, llx2, lly2, urx2, ury2;
-    llx1 = bg::get<bg::min_corner, 0>(box1);
-    lly1 = bg::get<bg::min_corner, 1>(box1);
-    urx1 = bg::get<bg::max_corner, 0>(box1);
-    ury1 = bg::get<bg::max_corner, 1>(box1);
-    llx2 = bg::get<bg::min_corner, 0>(box2);
-    lly2 = bg::get<bg::min_corner, 1>(box2);
-    urx2 = bg::get<bg::max_corner, 0>(box2);
-    ury2 = bg::get<bg::max_corner, 1>(box2);
-    frCoord xDist = std::max(0, std::max(llx1, llx2) - std::min(urx1, urx2));
-    frCoord yDist = std::max(0, std::max(lly1, lly2) - std::min(ury1, ury2));
-    return std::sqrt(xDist * xDist + yDist * yDist);
-  }
-
-  bool isSamePoint(boostPoint &pt1, boostPoint &pt2) {
-    auto x1 = bg::get<0>(pt1);
-    auto y1 = bg::get<1>(pt1);
-    auto x2 = bg::get<0>(pt2);
-    auto y2 = bg::get<1>(pt2);
-    return (x1 == x2 && y1 == y2);
-  }
-
-  frCoord getEdgeWidth(boostEdge &edge) {
-    auto point1 = edge.first;
-    auto point2 = edge.second;
-    auto pt1X = bg::get<0>(point1);
-    auto pt1Y = bg::get<1>(point1);
-    auto pt2X = bg::get<0>(point2);
-    auto pt2Y = bg::get<1>(point2);
-
-    if (pt1X == pt2X) {
-      return (std::abs(pt2Y - pt1Y));
-    } else if (pt1Y == pt2Y) {
-      return (std::abs(pt2X - pt1X));
-    } else {
-      std::cout << "Warning: edge is not orthogonal\n";
-      return 0;
-    }
-
-  }
-
-  void polyCovering(boostPolygon &polygon, frCollection<frRect> &rects) {
-    // debug 
-    // std::cout << "  start polyCovering\n" << std::flush; 
-    frCollection<frCoord> x, y;
-    frCollection<boostPoint> points;
-    std::set<frCoord> xIntv, yIntv;
-    std::vector<frCoord> xTick, yTick;
-    std::set<std::pair<int,int> > HSliceStart, VSliceStart;
-    std::vector<std::vector<bool> > isOccupied;
-    std::set<std::pair<int, int> > maxHSlice, maxVSlice;
-    std::set<std::tuple<int, int, int, int> > maxRectSet;
-    std::pair<int, int> tmpPoint;
-
-
-
-    
-    // exterior ring
-    auto ring = bg::exterior_ring(polygon);
-    for (auto it = ring.begin(); it != ring.end(); ++it) {
-      points.push_back(*it);
-    }
-    // interior rings
-    BOOST_FOREACH(auto & ring, bg::interior_rings(polygon)) {
-      for (auto it = ring.begin(); it != ring.end(); ++it) {
-        points.push_back(*it);
-      }
-    }
-
-    // push_back to x and y 
-    for (auto &point: points) {
-      x.push_back(point.get<0>());
-      y.push_back(point.get<1>());
-    }
-    xIntv = std::set<frCoord>(x.begin(), x.end());
-    yIntv = std::set<frCoord>(y.begin(), y.end());
-
-    std::copy(xIntv.begin(), xIntv.end(), std::back_inserter(xTick));
-    std::copy(yIntv.begin(), yIntv.end(), std::back_inserter(yTick));
-
-    // std::cout << "    polyCovering: num points = " << points.size() << std::endl;
-    // std::cout << "    polyCovering: |xTick| = " << xTick.size() << ", |yTick| = " << yTick.size() << std::endl;
-
-    isOccupied = std::vector<std::vector<bool> >(xTick.size() - 1, std::vector<bool>(yTick.size() - 1, false));
-
-    // debug 
-    // std::cout << "    start building k-map\n" << std::flush; 
-    // build k-map
-    for (int i = 0; i < (int)xTick.size() - 1; i++) {
-      for (int j = 0; j < (int)yTick.size() - 1; j++) {
-        frCoord tempX = (xTick.at(i) + xTick.at(i + 1)) / 2;
-        frCoord tempY = (yTick.at(j) + yTick.at(j + 1)) / 2;
-        boostPoint tempPt(tempX, tempY);
-        if (bg::covered_by(tempPt, polygon)) {
-          isOccupied[i][j] = true;
-        }
-      }
-    }
-
-    // printBoolMatrix(isOccupied);
-
-    // debug 
-    // std::cout << "    start building slices\n" << std::flush; 
-    // build slices
-    for (int i = 0; i < (int)isOccupied.size(); i++) {
-      for (int j = 0; j < (int)isOccupied[i].size(); j++) {
-        if (isOccupied[i][j] == false) {
-          continue;
-        } else {
-          // horizontal
-          // debug
-          // std::cout << "      H slices\n" << std::flush;
-          if (getMaxHSlice(i, j, isOccupied, maxHSlice, tmpPoint)) {
-            // std::cout << "        getting max H rect\n" << std::flush;
-            // std::cout << "          starting point = (" << tmpPoint.first << ", " << tmpPoint.second << ")\n";
-            getMaxHRect(tmpPoint, isOccupied, maxHSlice, maxRectSet);
-            // std::cout << "        finish getting max H rect\n" << std::flush;
-          }
-          // vertical
-          // debug
-          // std::cout << "      V slices\n" << std::flush;
-          if (getMaxVSlice(i, j, isOccupied, maxVSlice, tmpPoint)) {
-            // std::cout << "        getting max V rect\n" << std::flush;
-            // std::cout << "          starting point = (" << tmpPoint.first << ", " << tmpPoint.second << ")\n";
-            getMaxVRect(tmpPoint, isOccupied, maxVSlice, maxRectSet);
-            // std::cout << "        finish getting max V rect\n" << std::flush;
-          }
-        }
-      }
-    }
-
-    // debug 
-    // std::cout << "    start outputing result\n" << std::flush; 
-    // std::cout << "      num rects = " << maxRectSet.size() << std::endl;
-    for (auto it = maxRectSet.begin(); it != maxRectSet.end(); ++it) {
-      auto &tmpTuple = *it;
-      // std::cout << "       (" << get<0>(tmpTuple) << ", " << get<1>(tmpTuple) << ") -- (" 
-      //           << get<2>(tmpTuple) << ", " << get<3>(tmpTuple) << ")" << std::endl;
-      frBox tmpBox;
-      frRect tmpRect;
-      tmpBox.set(xTick[get<0>(tmpTuple)], yTick[get<1>(tmpTuple)], xTick[get<2>(tmpTuple) + 1], yTick[get<3>(tmpTuple) + 1]);
-      tmpRect.setBBox(tmpBox);
-      rects.push_back(tmpRect);
-    }
-
-  }
-
-  // every rect in maxRectSet is maximum among all rects seen so far
-  void maintainMaxRects(std::tuple<int, int, int, int> &newRect, std::set<std::tuple<int, int, int, int> > &maxRectSet) {
-    // std::cout << "processNewRect of (" << std::get<0>(newRect) << ", " << std::get<1>(newRect) << ") -- (" 
-    //           << std::get<2>(newRect) << ", " << std::get<3>(newRect) << ")" << std::endl;
-
-    boostBox tmpNewRect(boostPoint(std::get<0>(newRect), std::get<1>(newRect)), boostPoint(std::get<2>(newRect), std::get<3>(newRect)));
-    
-    if (maxRectSet.size() == 0) {
-      // std::cout << "@@@debug@@@: insert (" << std::get<0>(newRect) << ", " << std::get<1>(newRect) 
-      //           << ") -- (" << std::get<2>(newRect) << "," << std::get<3>(newRect) << ")\n";
-      
-      maxRectSet.insert(newRect);
-      return;
-    }
-
-    if (maxRectSet.find(newRect) != maxRectSet.end()) {
-      return;
-    }
-    
-    std::vector<std::tuple<int, int, int, int> > coveredRects;
-    // isSkip = false;
-    for (auto it = maxRectSet.begin(); it != maxRectSet.end(); it++) {
-      boostBox tmpRect(boostPoint(std::get<0>(*it), std::get<1>(*it)), boostPoint(std::get<2>(*it), std::get<3>(*it)));
-      // std::cout << "    checking against (" << std::get<0>(*it) << ", " << std::get<1>(*it) << ") -- (" 
-            // << std::get<2>(*it) << ", " << std::get<3>(*it) << ")" << std::endl;
-      if (bg::covered_by(tmpNewRect, tmpRect)) {
-        // std::cout << "@@@debug@@@: covered_by (" << std::get<0>(*it) << ", " << std::get<1>(*it) 
-        //           << ") -- (" << std::get<2>(*it) << "," << std::get<3>(*it) << ")\n";
-      
-        // newRect is strictly within some existing Rect
-        return;
-      } else if (bg::covered_by(tmpRect, tmpNewRect)) {
-        coveredRects.push_back(*it);
-        // maxRectSet.erase(it);
-        // maxRectSet.insert(newRect);
-        // break;
-      }
-    }
-
-    if (!coveredRects.empty()) {
-      for (int i = 0; i < (int)coveredRects.size(); i++) {
-        auto it = maxRectSet.find(coveredRects[i]);
-        // std::cout << "@@@debug@@@: erase (" << std::get<0>(coveredRects[i]) << ", " << std::get<1>(coveredRects[i]) 
-        //         << ") -- (" << std::get<2>(coveredRects[i]) << "," << std::get<3>(coveredRects[i]) << ")\n";
-      
-        maxRectSet.erase(it);
-      }
-      
-    }
-    // std::cout << "@@@debug@@@: insert (" << std::get<0>(newRect) << ", " << std::get<1>(newRect) 
-    //             << ") -- (" << std::get<2>(newRect) << "," << std::get<3>(newRect) << ")\n";
-      
-    maxRectSet.insert(newRect);
-    return;
-  }
-
-  bool processNewRect(std::tuple<int, int, int, int> &newRect, std::set<std::tuple<int, int, int, int> > &maxRectSet) {
-    // std::cout << "processNewRect of (" << std::get<0>(newRect) << ", " << std::get<1>(newRect) << ") -- (" 
-    //           << std::get<2>(newRect) << ", " << std::get<3>(newRect) << ")" << std::endl;
-
-    boostBox tmpNewRect(boostPoint(std::get<0>(newRect), std::get<1>(newRect)), boostPoint(std::get<2>(newRect), std::get<3>(newRect)));
-    bool isChanged = true;
-    if (maxRectSet.find(newRect) != maxRectSet.end()) {
-      return false;
-    }
-    if (maxRectSet.size() == 0) {
-      // std::cout << "@@@debug@@@: insert (" << std::get<0>(newRect) << ", " << std::get<1>(newRect) 
-      //           << ") -- (" << std::get<2>(newRect) << "," << std::get<3>(newRect) << ")\n";
-      maxRectSet.insert(newRect);
-
-      return true;
-    }
-    
-    isChanged = false;
-    std::vector<std::tuple<int, int, int, int> > coveredRects;
-    // isSkip = false;
-    for (auto it = maxRectSet.begin(); it != maxRectSet.end(); it++) {
-      boostBox tmpRect(boostPoint(std::get<0>(*it), std::get<1>(*it)), boostPoint(std::get<2>(*it), std::get<3>(*it)));
-      // std::cout << "    checking against (" << std::get<0>(*it) << ", " << std::get<1>(*it) << ") -- (" 
-            // << std::get<2>(*it) << ", " << std::get<3>(*it) << ")" << std::endl;
-      if (bg::covered_by(tmpNewRect, tmpRect)) {
-        // newRect is strictly within some existing Rect
-        return false;
-      } else if (bg::covered_by(tmpRect, tmpNewRect)) {
-        coveredRects.push_back(*it);
-        // maxRectSet.erase(it);
-        // maxRectSet.insert(newRect);
-        isChanged = true;
-        break;
-      }
-    }
-    if (isChanged == true) {
-      for (int i = 0; i < (int)coveredRects.size(); i++) {
-        auto it = maxRectSet.find(coveredRects[i]);
-        maxRectSet.erase(it);
-      }
-      return true;
-    }
-
-    return false;
-  }
-
-  bool getMaxHSlice(int xIdx, int yIdx, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::pair<int, int> &retPt) {
-    // std::cout << "getMaxHSlice" << std::endl;
-    int xl, xh;
-    xl = xh = xIdx;
-    while (xl - 1 >= 0 && isOccupied[xl - 1][yIdx] == true) {
-      xl--;
-    }
-    while (xh + 1 < (int)isOccupied.size() && isOccupied[xh + 1][yIdx] == true) {
-      xh++;
-    }
-    std::pair<int, int> tmpPt = std::make_pair(xl, yIdx);
-    retPt = tmpPt;
-    if (sliceSet.find(tmpPt) != sliceSet.end()) {
-      return false;
-    } else {
-      sliceSet.insert(tmpPt);
-      return true;
-    }
-  }
-
-
-
-  bool getMaxVSlice(int xIdx, int yIdx, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::pair<int, int> &retPt) {
-    // std::cout << "getMaxVSlice" << std::endl;
-    int yl, yh;
-    yl = yh = yIdx;
-    while (yl - 1 >= 0 && isOccupied[xIdx][yl - 1] == true) {
-      yl--;
-    }
-    while (yh + 1 < (int)isOccupied[xIdx].size() && isOccupied[xIdx][yh + 1] == true) {
-      yh++;
-    }
-    std::pair<int, int> tmpPt = std::make_pair(xIdx, yl);
-    retPt = tmpPt;
-    if (sliceSet.find(tmpPt) != sliceSet.end()) {
-      return false;
-    } else {
-      sliceSet.insert(tmpPt);
-      return true;
-    }
-  }
-
-
-  void getMaxHRect(std::pair<int, int> startPt, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::set<std::tuple<int, int, int, int> > &maxRectSet) {
-    // std::cout << "getMaxHRect start pnt = (" << startPt.first << ", " << startPt.second << ")" << std::endl;
-    int xl, xh, yl, yh;
-    xl = xh = startPt.first;
-    yl = yh = startPt.second;
-    while (xh + 1 < (int)isOccupied.size() && isOccupied[xh + 1][startPt.second] == true) {
-      xh++;
-    }
-    
-
-    // upward
-    bool flag = true;
-    while (flag) {
-      // std::cout << "      upward\n" << std::flush;
-      if (yh + 1 < (int)isOccupied[xl].size()) {
-        for (int tempX = xl; tempX <= xh; tempX++) {
-          if (isOccupied[tempX][yh + 1] == false) {
-            flag = false;
-            break;
-          }
-        }
-        if (flag == true) {
-          yh++;
-        }
-      } else {
-        flag = false;
-        break;
-      }
-    }
-
-    // downward
-    flag = true;
-    while (flag) {
-      // std::cout << "      downward\n" << std::flush;
-      if (yl - 1 >= 0) {
-        // yl--;
-        for (int tempX = xl; tempX <= xh; tempX++) {
-          if (isOccupied[tempX][yl - 1] == false) {
-            flag = false;
-            break;
-          }
-        }
-        if (flag == true) {
-          yl--;
-        }
-      } else {
-        flag = false;
-        break;
-      }
-    }
-    // std::cout << "xl = " << xl << ", " << "xh = " << xh << std::endl;
-    // std::cout << "yl = " << yl << ", yh = " << yh << std::endl;
-    std::tuple<int, int, int, int> tmpTuple = std::make_tuple(xl, yl, xh, yh);
-    // printRect(tmpTuple);
-    maintainMaxRects(tmpTuple, maxRectSet);
-    // return (maintainRects(tmpTuple, maxRectSet));
-
-  }
-
-
-  void getMaxVRect(std::pair<int, int> startPt, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::set<std::tuple<int, int, int, int> > &maxRectSet) {
-    // std::cout << "getMaxVRect start pnt = (" << startPt.first << ", " << startPt.second << ")" << std::endl;
-    int xl, xh, yl, yh;
-    xl = xh = startPt.first;
-    yl = yh = startPt.second;
-    while (yh + 1 < (int)isOccupied[startPt.first].size() && isOccupied[startPt.first][yh + 1]) {
-      yh++;
-    }
-
-    // upward
-    bool flag = true;
-    while (flag) {
-      if (xh + 1 < (int)isOccupied.size()) {
-        // xh++;
-        for (int tempY = yl; tempY <= yh; tempY++) {
-          if (isOccupied[xh + 1][tempY] == false) {
-            flag = false;
-            break;
-          }
-        }
-        if (flag == true) {
-          xh++;
-        }
-      } else {
-        flag = false;
-      }
-    }
-    // downward
-    flag = true;
-    while (flag) {
-      if (xl - 1 >= 0) {
-        // xl--;
-        for (int tempY = yl; tempY <= yh; tempY++) {
-          if (isOccupied[xl - 1][tempY] == false) {
-            flag = false;
-            break;
-          }
-        }
-        if (flag == true) {
-          xl--;
-        }
-      } else {
-        flag = false;
-      }
-    }
-    
-    // std::cout << "xl = " << xl << ", " << "xh = " << xh << std::endl;
-    // std::cout << "yl = " << yl << ", " << "yh = " << yh << std::endl;
-    std::tuple<int, int, int, int> tmpTuple = std::make_tuple(xl, yl, xh, yh);
-    maintainMaxRects(tmpTuple, maxRectSet);
-    // return (processNewRect(tmpTuple, maxRectSet));
-
-  }
-
-  void getPolyWithHole(const std::vector<Point> &vertices, Polygon &outline, std::vector<Polygon> &holes) {
-    typedef boost::icl::interval_map<int, int> IntvMap;
-    std::vector<Polygon> polys;
-    std::vector<std::pair<Point, Point> > edges;
-    std::vector<bool> validEdges;
-    std::map<int, IntvMap> horzIntv2Edge, vertIntv2Edge;
-    for (int i = 0; i < (int)vertices.size(); ++i) {
-      Point currPt = vertices[i];
-      Point nextPt = vertices[(i + 1) % vertices.size()];
-      edges.push_back(std::make_pair(currPt, nextPt));
-      validEdges.push_back(true);
-
-      int edgeIdx = -1;
-      bool isHorizontal = true;
-      auto itResHorz = horzIntv2Edge[nextPt.y()].equal_range(boost::icl::interval<int>::closed(nextPt.x(), nextPt.x()));
-      int horzCnt = 0;
-      for (auto it = itResHorz.first; it != itResHorz.second; ++it) {
-        if (horzCnt > 0) {
-          std::cout << "Error: more than one interval found\n";
-          break;
-        }
-        if ((it->second - 1) > edgeIdx && validEdges[(it->second  - 1)] == true) {
-          edgeIdx = it->second - 1;
-          isHorizontal = true;
-        }
-        horzCnt++;
-      }
-      // vert
-      auto itResVert = vertIntv2Edge[nextPt.x()].equal_range(boost::icl::interval<int>::closed(nextPt.y(), nextPt.y()));
-      int vertCnt = 0;
-      for (auto it = itResVert.first; it != itResVert.second; ++it) {
-        if (vertCnt > 0) {
-          std::cout << "Error: more than one interval found\n";
-          break;
-        }
-        if ((it->second  - 1) > edgeIdx && validEdges[(it->second  - 1)] == true) {
-          edgeIdx = it->second - 1;
-          isHorizontal = false;
-        }
-        vertCnt++;
-      }
-      // get poly
-      if (edgeIdx == -1) {
-        ;
-      } else if ((i - edgeIdx) > 2) {
-        std::vector<Point> vertices;
-        int edgeCnt = 0;
-        for (int currEdgeIdx = edgeIdx; currEdgeIdx <= i; ++currEdgeIdx) {
-          if (validEdges[currEdgeIdx] == false) {
-            continue;
-          }
-          edgeCnt++;
-          vertices.push_back(edges[currEdgeIdx].second);
-          if (currEdgeIdx == edgeIdx) {
-            if (nextPt == edges[currEdgeIdx].first) {
-              // cout << "  invalidate " << currEdgeIdx << endl;
-              validEdges[currEdgeIdx] = false;
-            } else {
-              Point tmpEndPoint = edges[currEdgeIdx].second;
-              edges[currEdgeIdx].second = nextPt;
-              if (isHorizontal) {
-                horzIntv2Edge[nextPt.y()] -= std::make_pair(boost::icl::interval<int>::right_open(std::min(tmpEndPoint.x(), nextPt.x()), std::max(tmpEndPoint.x(), nextPt.x())), edgeIdx);
-                // cout << "  erase y = " << nextPt.y() << ", x = [" << min(tmpEndPoint.x(), nextPt.x()) << ", " << max(tmpEndPoint.x(), nextPt.x()) << "] edgeIdx = " << edgeIdx << "\n";
-              } else {
-                vertIntv2Edge[nextPt.x()] -= std::make_pair(boost::icl::interval<int>::right_open(std::min(tmpEndPoint.y(), nextPt.y()), std::max(tmpEndPoint.y(), nextPt.y())), edgeIdx);
-                // cout << "  erase x = " << nextPt.x() << ", x = [" << min(tmpEndPoint.y(), nextPt.y()) << ", " << max(tmpEndPoint.y(), nextPt.y()) << "] edgeIdx = " << edgeIdx << "\n";
-              }
-            }
-          } else {
-            // cout << "  invalidate " << currEdgeIdx << endl;
-            validEdges[currEdgeIdx] = false;
-          }
-        }
-        if (edgeCnt > 2) {
-          // cout << "poly startIdx = " << edgeIdx << ", endIdx = " << i << endl;
-          Polygon tmpPoly;
-          Point pt1, pt2, pt3;
-          pt1 = vertices.back();
-          pt2 = vertices.front();
-          pt3 = vertices[vertices.size() - 2];
-          // cout << "xxx2\n";
-
-          if ((pt1.x() == pt2.x() && pt2.x() == pt3.x()) ||
-              (pt1.y() == pt2.y() && pt2.y() == pt3.y())) {
-            vertices.pop_back();
-          }
-          set_points(tmpPoly, vertices.begin(), vertices.end());
-          polys.push_back(tmpPoly);
-        }
-      } else {
-        // cout << "erase startIdx = " << edgeIdx << ", endIdx = " << i << endl;
-        for (int currEdgeIdx = edgeIdx; currEdgeIdx <= i; ++currEdgeIdx) {
-          if (validEdges[currEdgeIdx] == false) {
-            continue;
-          }
-          if (currEdgeIdx == edgeIdx) {
-            if (nextPt == edges[currEdgeIdx].first) {
-              validEdges[currEdgeIdx] = false;
-            } else {
-              edges[currEdgeIdx].second = nextPt;
-            }
-          } else {
-            validEdges[currEdgeIdx] = false;
-          }
-        }
-      }
-
-      // insert to interval map
-      if (edgeIdx == -1) {
-        if (currPt.x() == nextPt.x()) {
-          auto edgeIntv = boost::icl::interval<int>::closed(std::min(currPt.y(), nextPt.y()), std::max(currPt.y(), nextPt.y()));
-          vertIntv2Edge[nextPt.x()] += std::make_pair(edgeIntv, i + 1);
-          // cout << "add x = " << currPt.x() << ", y = [" << edgeIntv.lower() << ", " << edgeIntv.upper() << "]\n";
-        } 
-        if (currPt.y() == nextPt.y()) {
-          auto edgeIntv = boost::icl::interval<int>::closed(std::min(currPt.x(), nextPt.x()), std::max(currPt.x(), nextPt.x()));
-          horzIntv2Edge[nextPt.y()] += std::make_pair(edgeIntv, i + 1);
-          // cout << "add y = " << currPt.y() << ", x = [" << edgeIntv.lower() << ", " << edgeIntv.upper() << "]\n";
-        }
-      }
-
-    }
-    
-    std::vector<Point> tmpPts;
-    for (int currEdgeIdx = 0; currEdgeIdx < int(edges.size()); ++currEdgeIdx) {
-      if (validEdges[currEdgeIdx] == false) {
-        continue;
-      }
-      tmpPts.push_back(edges[currEdgeIdx].second);
-      // std::cout << "pushing (" << tmpPts.back().x() << ", " << tmpPts.back().y() << "\n";
-    }
-
-    for (int i = 0; i < (int)polys.size() - 1; ++i) {
-      holes.push_back(polys[i]);
-    }
-    if (polys.size() > 0) {
-      outline = polys.back();
-    }
-
-
-  }
-
-  bool isColinear(const Point &pt1, const Point &pt2, const Point &pt3) {
-    return ((pt1.x() == pt2.x() && pt2.x() == pt3.x()) ||
-            (pt1.y() == pt2.y() && pt2.y() == pt3.y()));
-  }
-
-  void getPolyWithHole(const Polygon &polyIn, std::vector<Polygon> &polys) {
-    typedef boost::icl::interval_map<int, int> IntvMap;
-    std::vector<Point> vertices;
-    for (auto ptIt = begin_points(polyIn); ptIt != end_points(polyIn); ++ptIt) {
-      vertices.push_back(*ptIt);
-    }
-
-    std::vector<std::pair<Point, Point> > edges;
-    std::vector<bool> validEdges;
-    std::map<int, IntvMap> horzIntv2Edge, vertIntv2Edge;
-    for (int i = 0; i < (int)vertices.size(); ++i) {
-      Point currPt = vertices[i];
-      Point nextPt = vertices[(i + 1) % vertices.size()];
-      edges.push_back(std::make_pair(currPt, nextPt));
-      validEdges.push_back(true);
-
-      int edgeIdx = -1;
-      bool isHorizontal = true;
-      auto itResHorz = horzIntv2Edge[nextPt.y()].equal_range(boost::icl::interval<int>::closed(nextPt.x(), nextPt.x()));
-      int horzCnt = 0;
-      for (auto it = itResHorz.first; it != itResHorz.second; ++it) {
-        if (horzCnt > 0) {
-          std::cout << "Error: more than one interval found\n";
-          break;
-        }
-        if ((it->second - 1) > edgeIdx && validEdges[(it->second  - 1)] == true) {
-          edgeIdx = it->second - 1;
-          isHorizontal = true;
-        }
-        horzCnt++;
-      }
-      // vert
-      auto itResVert = vertIntv2Edge[nextPt.x()].equal_range(boost::icl::interval<int>::closed(nextPt.y(), nextPt.y()));
-      int vertCnt = 0;
-      for (auto it = itResVert.first; it != itResVert.second; ++it) {
-        if (vertCnt > 0) {
-          std::cout << "Error: more than one interval found\n";
-          break;
-        }
-        if ((it->second  - 1) > edgeIdx && validEdges[(it->second  - 1)] == true) {
-          edgeIdx = it->second - 1;
-          isHorizontal = false;
-        }
-        vertCnt++;
-      }
-      // get poly
-      if (edgeIdx == -1) {
-        ;
-      } else if ((i - edgeIdx) > 2) {
-        // std::cout << "push new poly\n";
-        std::vector<Point> vertices;
-        int edgeCnt = 0;
-        for (int currEdgeIdx = edgeIdx; currEdgeIdx <= i; ++currEdgeIdx) {
-          if (validEdges[currEdgeIdx] == false) {
-            continue;
-          }
-          if (vertices.size() < 2) {
-            edgeCnt++;
-            vertices.push_back(edges[currEdgeIdx].second);
-            // std::cout << "pushing (" << vertices.back().x() / 2000.0 << ", " << vertices.back().y() / 2000.0 << ")\n";
-          } else if (!isColinear(vertices.back(), vertices[vertices.size() - 2], edges[currEdgeIdx].second)) {
-            edgeCnt++;
-            vertices.push_back(edges[currEdgeIdx].second);
-            // std::cout << "pushing (" << vertices.back().x() / 2000.0 << ", " << vertices.back().y() / 2000.0 << ")\n";
-          } else {
-            // std::cout << "pop (" << vertices.back().x() / 2000.0 << ", " << vertices.back().y() / 2000.0 << ")\n";
-            vertices.pop_back();
-            vertices.push_back(edges[currEdgeIdx].second);
-            // std::cout << "push (" << vertices.back().x() / 2000.0 << ", " << vertices.back().y() / 2000.0 << ")\n";
-          }
-          if (currEdgeIdx == edgeIdx) {
-            if (nextPt == edges[currEdgeIdx].first) {
-              // cout << "  invalidate " << currEdgeIdx << endl;
-              validEdges[currEdgeIdx] = false;
-            } else {
-              Point tmpEndPoint = edges[currEdgeIdx].second;
-              edges[currEdgeIdx].second = nextPt;
-              if (isHorizontal) {
-                horzIntv2Edge[nextPt.y()] -= std::make_pair(boost::icl::interval<int>::right_open(std::min(tmpEndPoint.x(), nextPt.x()), std::max(tmpEndPoint.x(), nextPt.x())), edgeIdx);
-                // cout << "  erase y = " << nextPt.y() << ", x = [" << min(tmpEndPoint.x(), nextPt.x()) << ", " << max(tmpEndPoint.x(), nextPt.x()) << "] edgeIdx = " << edgeIdx << "\n";
-              } else {
-                vertIntv2Edge[nextPt.x()] -= std::make_pair(boost::icl::interval<int>::right_open(std::min(tmpEndPoint.y(), nextPt.y()), std::max(tmpEndPoint.y(), nextPt.y())), edgeIdx);
-                // cout << "  erase x = " << nextPt.x() << ", x = [" << min(tmpEndPoint.y(), nextPt.y()) << ", " << max(tmpEndPoint.y(), nextPt.y()) << "] edgeIdx = " << edgeIdx << "\n";
-              }
-            }
-          } else {
-            // cout << "  invalidate " << currEdgeIdx << endl;
-            validEdges[currEdgeIdx] = false;
-          }
-        }
-        if (edgeCnt > 2) {
-          // cout << "poly startIdx = " << edgeIdx << ", endIdx = " << i << endl;
-          Polygon tmpPoly;
-          Point pt1, pt2, pt3;
-          pt1 = vertices.back();
-          pt2 = vertices.front();
-          pt3 = vertices[vertices.size() - 2];
-          // cout << "xxx2\n";
-
-          if ((pt1.x() == pt2.x() && pt2.x() == pt3.x()) ||
-              (pt1.y() == pt2.y() && pt2.y() == pt3.y())) {
-            vertices.pop_back();
-          }
-          set_points(tmpPoly, vertices.begin(), vertices.end());
-          polys.push_back(tmpPoly);
-        }
-      } else {
-        // cout << "erase startIdx = " << edgeIdx << ", endIdx = " << i << endl;
-        for (int currEdgeIdx = edgeIdx; currEdgeIdx <= i; ++currEdgeIdx) {
-          if (validEdges[currEdgeIdx] == false) {
-            continue;
-          }
-          if (currEdgeIdx == edgeIdx) {
-            if (nextPt == edges[currEdgeIdx].first) {
-              validEdges[currEdgeIdx] = false;
-            } else {
-              edges[currEdgeIdx].second = nextPt;
-            }
-          } else {
-            validEdges[currEdgeIdx] = false;
-          }
-        }
-      }
-
-      // insert to interval map
-      if (edgeIdx == -1) {
-        if (currPt.x() == nextPt.x()) {
-          auto edgeIntv = boost::icl::interval<int>::closed(std::min(currPt.y(), nextPt.y()), std::max(currPt.y(), nextPt.y()));
-          vertIntv2Edge[nextPt.x()] += std::make_pair(edgeIntv, i + 1);
-          // cout << "add x = " << currPt.x() << ", y = [" << edgeIntv.lower() << ", " << edgeIntv.upper() << "]\n";
-        } 
-        if (currPt.y() == nextPt.y()) {
-          auto edgeIntv = boost::icl::interval<int>::closed(std::min(currPt.x(), nextPt.x()), std::max(currPt.x(), nextPt.x()));
-          horzIntv2Edge[nextPt.y()] += std::make_pair(edgeIntv, i + 1);
-          // cout << "add y = " << currPt.y() << ", x = [" << edgeIntv.lower() << ", " << edgeIntv.upper() << "]\n";
-        }
-      }
-
-    }
-    
-    // std::vector<Point> tmpPts;
-    // for (int currEdgeIdx = 0; currEdgeIdx < edges.size(); ++currEdgeIdx) {
-    //   if (validEdges[currEdgeIdx] == false) {
-    //     continue;
-    //   }
-    //   tmpPts.push_back(edges[currEdgeIdx].second);
-    //   // std::cout << "pushing (" << tmpPts.back().x() << ", " << tmpPts.back().y() << "\n";
-    // }
-
-    // for (int i = 0; i < (int)polys.size() - 1; ++i) {
-    //   holes.push_back(polys[i]);
-    // }
-    // if (polys.size() > 0) {
-    //   outline = polys.back();
-    // }
-
-
-  }
-
-}
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.h b/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.h
deleted file mode 100644
index a79fe88..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frShapeUtil.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "frBaseTypes.h"
-#include "db/obj/frShape.h"
-#include <algorithm>
-#include "db/obj/frBlockage.h"
-#include <boost/geometry.hpp>
-#include <boost/geometry/geometries/point_xy.hpp>
-#include <boost/geometry/geometries/polygon.hpp>
-#include <boost/geometry/geometries/adapted/boost_tuple.hpp> 
-#include <boost/foreach.hpp>
-#include <tuple>
-#include <iostream>
-
-namespace fr {
-  void frRect2Poly(frRect &rectIn, boostPolygon &polyOut);
-  void frPolygon2Poly(frPolygon &polygonIn, boostPolygon &polyOut);
-  void frBox2Poly(frBox &boxIn, boostPolygon &polyOut);
-  void frBox2Rectangle(frBox &boxIn, Rectangle &rectOut);
-  void frRect2Rectangle(frRect &rectIn, Rectangle &rectOut);
-  double frBox2BoxDist(frBox &box1, frBox &box2);
-  double frBox2BoxDist(box_t &box1, box_t &box2);
-  void frBlockage2Poly(frBlockage &blockageIn, boostPolygon &polyOut);
-  bool isSamePoint(boostPoint &pt1, boostPoint &pt2);
-  void polyCovering(boostPolygon &polygon, frCollection<frRect> &rects);
-  void maintainMaxRects(std::tuple<int, int, int, int> &newRect, std::set<std::tuple<int, int, int, int> > &maxRectSet);
-  bool processNewRect(std::tuple<int, int, int, int> &newRect, std::set<std::tuple<int, int, int, int> > &maxRectSet);
-  bool getMaxHSlice(int xIdx, int yIdx, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::pair<int, int> &retPt);
-  bool getMaxVSlice(int xIdx, int yIdx, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::pair<int, int> &retPt);
-  void getMaxHRect(std::pair<int, int> startPt, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::set<std::tuple<int, int, int, int> > &maxRectSet);
-  void getMaxVRect(std::pair<int, int> startPt, std::vector<std::vector<bool> > &isOccupied, std::set<std::pair<int, int> > &sliceSet, std::set<std::tuple<int, int, int, int> > &maxRectSet);
-  frCoord getEdgeWidth(boostEdge &edge);
-  void getPolyWithHole(const std::vector<Point> &vertices, Polygon &outline, std::vector<Polygon> &holes);
-  void getPolyWithHole(const std::vector<Point> &vertices, std::vector<Polygon> &polys);
-  void getPolyWithHole(const Polygon &polyIn, std::vector<Polygon> &polys);
-  bool isColinear(const Point &pt1, const Point &pt2, const Point &pt3);
-
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frUtil.cpp b/scripts/pdn/src/PdnPinDumper/src/io/frUtil.cpp
deleted file mode 100644
index 188d994..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frUtil.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "io/frUtil.h"
-
-namespace fr {
-  extern std::vector<std::shared_ptr<frLayer> > *designLayers;
-  void setLayers(std::vector<std::shared_ptr<frLayer> > *vlayers) {
-    designLayers = vlayers;
-  }
-  std::vector<std::shared_ptr<fr::frLayer> >* getLayers() {
-    return designLayers;
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/frUtil.h b/scripts/pdn/src/PdnPinDumper/src/io/frUtil.h
deleted file mode 100644
index e842671..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/frUtil.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_UTIL_H_
-#define _FR_UTIL_H_
-
-#include "frBaseTypes.h"
-#include <memory>
-#include "db/tech/frLayer.h"
-
-namespace fr {
-  void setLayers(std::vector<std::shared_ptr<fr::frLayer> > *vlayers);
-  std::vector<std::shared_ptr<fr::frLayer> >* getLayers();
-}
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/io.cpp b/scripts/pdn/src/PdnPinDumper/src/io/io.cpp
deleted file mode 100644
index 9823b6c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/io.cpp
+++ /dev/null
@@ -1,5005 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include <fstream>
-#include <sstream>
-
-#include "global.h"
-#include "io/io.h"
-#include "db/tech/frConstraint.h"
-
-//#include <boost/polygon/polygon.hpp>
-
-using namespace std;
-using namespace fr;
-//using namespace boost::polygon::operators;
-
-int io::Parser::getDefVias(defrCallbackType_e type, defiVia* via, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type != defrViaCbkType)) {
-    cout <<"Type is not defrViaCbkType!" <<endl;
-    exit(1);
-  }
-
-  if (enableOutput) {
-    cout <<"- " <<via->name() <<endl;
-    //cout <<"  numLayers = " <<via->numLayers() <<endl;
-  }
-  // viaRule defined via
-  if (via->hasViaRule()) {
-    char* viaRuleName;
-    char* botLayer;
-    char* cutLayer;
-    char* topLayer;
-    int xSize, ySize, xCutSpacing, yCutSpacing, xBotEnc, yBotEnc, xTopEnc, yTopEnc;
-    via->viaRule(&viaRuleName, &xSize, &ySize, &botLayer, &cutLayer, &topLayer,
-                 &xCutSpacing, &yCutSpacing, &xBotEnc, &yBotEnc, &xTopEnc, &yTopEnc);
-    int xOffset = 0;
-    int yOffset = 0;
-    if (via->hasOrigin()) {
-      via->origin(&xOffset, &yOffset);
-    }
-    int xBotOffset = 0;
-    int yBotOffset = 0;
-    int xTopOffset = 0;
-    int yTopOffset = 0;
-    if (via->hasOffset()) {
-      via->offset(&xBotOffset, &yBotOffset, &xTopOffset, &yTopOffset);
-    }
-    int numCutRows = 1;
-    int numCutCols = 1;
-    if (via->hasRowCol()) {
-      via->rowCol(&numCutRows, &numCutCols);
-    }
-    if (enableOutput) {
-      cout <<" + VIARULE "    <<viaRuleName <<endl;
-      //cout <<" + CUTSIZE " <<xSize * 1.0 / ((io::Parser*)data)->tmpBlock->getDBUPerUU() <<" " 
-      //                     <<ySize * 1.0 / ((io::Parser*)data)->tmpBlock->getDBUPerUU() <<endl;
-      cout <<" + CUTSIZE "    <<xSize       <<" " <<ySize       <<endl;
-      cout <<" + LAYERS "     <<botLayer    <<" " <<cutLayer    <<" "   <<topLayer <<endl;
-      cout <<" + CUTSPACING " <<xCutSpacing <<" " <<yCutSpacing <<endl;
-      cout <<" + ENCLOSURE "  <<xBotEnc     <<" " <<yBotEnc     <<" "
-                              <<xTopEnc     <<" " <<yTopEnc     <<endl;
-      if (via->hasRowCol()) {
-        cout <<" + ROWCOL " <<numCutRows <<" " <<numCutCols <<endl;
-      }
-      if (via->hasOrigin()) {
-        cout <<" + ORIGIN " <<xOffset <<" " <<yOffset <<endl;
-      }
-      if (via->hasOffset()) {
-        cout <<" + OFFSET " <<xBotOffset <<" " <<yBotOffset <<" " <<xTopOffset <<" " <<yTopOffset <<endl;
-      }
-      cout <<" ;" <<endl;
-
-    }
-
-    // create cut figs
-    frLayerNum cutLayerNum = 0;
-    if (((io::Parser*)data)->tech->name2layer.find(cutLayer) == ((io::Parser*)data)->tech->name2layer.end()) {
-      cout <<"Error: cannot find cut layer" <<endl;
-      exit(1);
-    } else {
-      cutLayerNum = ((io::Parser*)data)->tech->name2layer.find(cutLayer)->second->getLayerNum();
-    }
-    frLayerNum botLayerNum = 0;
-    if (((io::Parser*)data)->tech->name2layer.find(botLayer) == ((io::Parser*)data)->tech->name2layer.end()) {
-      cout <<"Error: cannot find bot layer" <<endl;
-      exit(1);
-    } else {
-      botLayerNum = ((io::Parser*)data)->tech->name2layer.find(botLayer)->second->getLayerNum();
-    }
-    // create cut figs
-    frLayerNum topLayerNum = 0;
-    if (((io::Parser*)data)->tech->name2layer.find(topLayer) == ((io::Parser*)data)->tech->name2layer.end()) {
-      cout <<"Error: cannot find top layer" <<endl;
-      exit(1);
-    } else {
-      topLayerNum = ((io::Parser*)data)->tech->name2layer.find(topLayer)->second->getLayerNum();
-    }
-
-    frCoord currX = 0;
-    frCoord currY = 0;
-    vector<unique_ptr<frShape> > cutFigs;
-    for (int i = 0; i < numCutRows; i++) {
-      currX = 0;
-      for (int j = 0; j < numCutCols; j++) {
-        auto rect = make_unique<frRect>();
-        frBox tmpBox(currX, currY, currX + xSize, currY + ySize);
-        rect->setBBox(tmpBox);
-        rect->setLayerNum(cutLayerNum);
-        //cout <<"cutFig (" <<currX <<", " <<currY <<") (" <<currX+xSize <<"," <<currY+ySize <<") " <<cutLayer <<endl;
-
-        unique_ptr<frShape> tmp(std::move(rect));
-        cutFigs.push_back(std::move(tmp));
-
-        currX += xSize + xCutSpacing;
-      }
-      currY += ySize + yCutSpacing;
-    }
-    currX -= xCutSpacing; // max cut X
-    currY -= yCutSpacing; // max cut Y
-    //cout <<"max x/y " <<currX <<" " <<currY <<endl;
-
-    frTransform cutXform(-currX / 2 + xOffset, -currY / 2 + yOffset);
-    for (auto &uShape: cutFigs) {
-      auto rect = static_cast<frRect*>(uShape.get());
-      //cout <<"orig " <<*rect <<endl;
-      rect->move(cutXform);
-      //cout <<"move " <<*rect <<endl;
-    }
-
-    unique_ptr<frShape> uBotFig = make_unique<frRect>();
-    auto botFig = static_cast<frRect*>(uBotFig.get());
-    unique_ptr<frShape> uTopFig = make_unique<frRect>();
-    auto topFig = static_cast<frRect*>(uTopFig.get());
-
-    frBox botBox(0 - xBotEnc, 0 - yBotEnc, currX + xBotEnc, currY + yBotEnc);
-    frBox topBox(0 - xTopEnc, 0 - yTopEnc, currX + xTopEnc, currY + yTopEnc);
-
-    frTransform botXform(-currX / 2 + xOffset + xBotOffset, -currY / 2 + yOffset + yBotOffset);
-    frTransform topXform(-currX / 2 + xOffset + xTopOffset, -currY / 2 + yOffset + yTopOffset);
-    botBox.transform(botXform);
-    topBox.transform(topXform);
-
-    botFig->setBBox(botBox);
-    topFig->setBBox(topBox);
-    botFig->setLayerNum(botLayerNum);
-    topFig->setLayerNum(topLayerNum);
-
-    // create via
-    auto viaDef = make_unique<frViaDef>(via->name());
-    viaDef->addLayer1Fig(uBotFig);
-    viaDef->addLayer2Fig(uTopFig);
-    for (auto &uShape: cutFigs) {
-      viaDef->addCutFig(uShape);
-    }
-    ((io::Parser*)data)->tech->addVia(viaDef);
-  // RECT defined via
-  } else {
-    if (via->numPolygons()) {
-      cout <<"Error: unsupport polygon in def via" <<endl;
-      exit(1);
-    }
-    char* layerName;
-    int xl;
-    int yl;
-    int xh;
-    int yh;
-    map<frLayerNum, set<int> > lNum2Int;
-    for (int i = 0; i < via->numLayers(); ++i) {
-      via->layer(i, &layerName, &xl, &yl, &xh, &yh);
-      if (((io::Parser*)data)->tech->name2layer.find(layerName) == ((io::Parser*)data)->tech->name2layer.end()) {
-        if (VERBOSE > -1) {
-          cout <<"Warning: layer " <<layerName <<" is skipiped for " <<via->name() <<endl;
-        }
-        return 0;
-      }
-      auto layerNum = ((io::Parser*)data)->tech->name2layer.at(layerName)->getLayerNum();
-      lNum2Int[layerNum].insert(i);
-      //cout <<"layerNum " <<layerNum <<" i " <<i <<endl;
-    }
-    if ((int)lNum2Int.size() != 3) {
-      if (VERBOSE > -1) {
-        cout <<"Error: unsupported via" <<endl;
-      }
-      exit(1);
-    }
-    if (lNum2Int.begin()->first + 2 != (--lNum2Int.end())->first) {
-      if (VERBOSE > -1) {
-        cout <<"Error: non-consecutive layers" <<endl;
-      }
-      exit(1);
-    }
-    auto viaDef = make_unique<frViaDef>(via->name());
-    int cnt = 0;
-    for (auto &[layerNum, intS]: lNum2Int) {
-      for (auto i: intS) {
-        via->layer(i, &layerName, &xl, &yl, &xh, &yh);
-        if (enableOutput) {
-          cout <<" + RECT " <<layerName <<" ( " <<xl <<" " <<yl <<" ) ( " <<xh <<" " <<yh <<" )" <<endl;
-        }
-        unique_ptr<frRect> pinFig = make_unique<frRect>();
-        pinFig->setBBox(frBox(xl, yl, xh, yh));
-        pinFig->setLayerNum(layerNum);
-        unique_ptr<frShape> tmp(std::move(pinFig));
-        switch(cnt) {
-          case 0 :
-            viaDef->addLayer1Fig(tmp);
-            break;
-          case 1 :
-            viaDef->addCutFig(tmp);
-            break;
-          default:
-            viaDef->addLayer2Fig(tmp);
-            break;
-        }
-      }
-      //for (int j = 0; j < via->numPolygons(i); ++j) {
-      //  if (enableOutput) {
-      //    cout <<"    POLYGON"; 
-      //  }
-      //  vector<frPoint> tmpPoints;
-      //  for (int k = 0; k < via->getPolygon(i, j).numPoints; k++) {
-      //    frCoord x = round(via->getPolygon(i, j).x[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-      //    frCoord y = round(via->getPolygon(i, j).y[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-      //    tmpPoints.push_back(frPoint(x, y));
-      //    if (enableOutput) {
-      //       cout <<" " <<x * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-      //                  <<y * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-      //    }
-      //  }
-      //  unique_ptr<frPolygon> pinFig = make_unique<frPolygon>();
-      //  pinFig->setPoints(tmpPoints);
-      //  pinFig->setLayerNum(layerNum);
-      //  unique_ptr<frShape> tmp(std::move(pinFig));
-      //  if (enableOutput) {
-      //    cout <<" ;" <<endl;
-      //  }
-      //  switch(cnt) {
-      //    case 0 :
-      //      viaDef->addLayer1Fig(tmp);
-      //      break;
-      //    case 1 :
-      //      viaDef->addCutFig(tmp);
-      //      break;
-      //    default:
-      //      viaDef->addLayer2Fig(tmp);
-      //      break;
-      //  }
-      //}
-      cnt++;
-    }
-    if (enableOutput) {
-      cout <<" ;" <<endl;
-    }
-    ((io::Parser*)data)->tech->addVia(viaDef);
-  }
-
-  return 0;
-}
-
-int io::Parser::getDefComponents(defrCallbackType_e type, defiComponent* comp, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type != defrComponentCbkType)) {
-    cout <<"Type is not defrComponentCbkType!" <<endl;
-    exit(1);
-  }
-
-  if (((io::Parser*)data)->design->name2refBlock.find(comp->name()) == ((io::Parser*)data)->design->name2refBlock.end()) {
-    if (VERBOSE > -1) {
-      cout <<"Error: library cell not found!" <<endl;
-    }
-    exit(1);
-  }
-  
-  if (enableOutput) {
-    cout <<"- " <<comp->id() <<" " <<comp->name() <<" + STATUS ( " <<comp->placementX()
-         <<" " <<comp->placementY() <<" ) " <<comp->placementOrient() <<endl;
-  }
-
-  
-  auto uInst = make_unique<frInst>();
-  auto tmpInst = uInst.get();
-  tmpInst->setId(((io::Parser*)data)->numInsts);
-  ((io::Parser*)data)->numInsts++;
-  tmpInst->setName(comp->id());
-  tmpInst->setOrigin(frPoint(comp->placementX(), comp->placementY()));
-  tmpInst->setOrient(frOrientEnum(comp->placementOrient()));
-  tmpInst->setRefBlock(((io::Parser*)data)->design->name2refBlock.at(comp->name()));
-  for (auto &uTerm: tmpInst->getRefBlock()->getTerms()) {
-    auto term = uTerm.get();
-    unique_ptr<frInstTerm> instTerm = make_unique<frInstTerm>();
-    instTerm->setId(((io::Parser*)data)->numTerms);
-    ((io::Parser*)data)->numTerms++;
-    instTerm->addToInst(tmpInst);
-    instTerm->addTerm(term);
-    tmpInst->addInstTerm(instTerm);
-  }
-  for (auto &uBlk: tmpInst->getRefBlock()->getBlockages()) {
-    auto blk = uBlk.get();
-    unique_ptr<frInstBlockage> instBlk = make_unique<frInstBlockage>();
-    instBlk->setId(((io::Parser*)data)->numBlockages);
-    ((io::Parser*)data)->numBlockages++;
-    instBlk->addToInst(tmpInst);
-    instBlk->addBlockage(blk);
-    tmpInst->addInstBlockage(instBlk);
-  }
-
-  if (((io::Parser*)data)->tmpBlock->name2inst.find(comp->id()) != ((io::Parser*)data)->tmpBlock->name2inst.end()) {
-    if (VERBOSE > -1) {
-      cout <<"Error: same cell name!" <<endl;
-    }
-    exit(1);
-  }
-  ((io::Parser*)data)->tmpBlock->addInst(uInst);
-  if (((io::Parser*)data)->tmpBlock->insts.size() < 100000) {
-    if (((io::Parser*)data)->tmpBlock->insts.size() % 10000 == 0) {
-      cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->insts.size() <<" components" <<endl;
-    }
-  } else {
-    if (((io::Parser*)data)->tmpBlock->insts.size() % 100000 == 0) {
-      cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->insts.size() <<" components" <<endl;
-    }
-  }
-
-  return 0;
-}
-
-int io::Parser::getDefString(defrCallbackType_e type, const char* str, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type == defrDesignStartCbkType)) {
-    auto &tmpBlock = ((io::Parser*)data)->tmpBlock;
-    tmpBlock = make_unique<frBlock>();
-    tmpBlock->setName(string(str));
-    tmpBlock->trackPatterns.clear();
-    tmpBlock->trackPatterns.resize(((io::Parser*)data)->tech->layers.size());
-    if (enableOutput) {
-      cout <<"DESIGN " <<tmpBlock->getName() <<" ;" <<endl;
-    }
-  }
-  return 0;
-}
-
-int io::Parser::getDefVoid(defrCallbackType_e type, void* variable, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type == defrDesignEndCbkType)) {
-    ((io::Parser*)data)->tmpBlock->setId(0);
-    ((io::Parser*)data)->design->setTopBlock(((io::Parser*)data)->tmpBlock);
-    if (enableOutput) {
-      cout <<"END DESIGN" <<endl;
-    }
-  }
-  return 0;
-}
-
-int io::Parser::getDefDieArea(defrCallbackType_e type, defiBox* box, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type != defrDieAreaCbkType)) {
-    cout <<"Type is not defrDieAreaCbkType!" <<endl;
-    exit(1);
-  }
-  //((io::Parser*)data)->tmpBlock->setBBox(frBox(box->xl(), box->yl(), box->xh(), box->yh()));
-  vector<frBoundary> bounds;
-  frBoundary bound;
-  vector<frPoint> points;
-  points.push_back(frPoint(box->xl(), box->yl()));
-  points.push_back(frPoint(box->xh(), box->yl()));
-  points.push_back(frPoint(box->xh(), box->yh()));
-  points.push_back(frPoint(box->xl(), box->yh()));
-  bound.setPoints(points);
-  bounds.push_back(bound);
-  ((io::Parser*)data)->tmpBlock->setBoundaries(bounds);
-  if (enableOutput) {
-    cout <<"DIEAREA ( " <<box->xl() <<" " <<box->yl() <<" ) ( " <<box->xh() <<" " <<box->yh() <<" ) ;" <<endl;
-  }
-  return 0;
-}
-
-//int FlexRoute::getDefInteger(defrCallbackType_e type, int number, defiUserData data) {
-//  if (type == defrComponentStartCbkType) {
-//    ((FlexRoute*)data)->comps = vector<Component>(((FlexRoute*)data)->numComps);
-//  }
-//  if (type == defrNetStartCbkType) {
-//    ((FlexRoute*)data)->numNets = number;
-//    ((FlexRoute*)data)->nets = vector<Net>(((FlexRoute*)data)->numNets);
-//  }
-//  if (type == defrSNetStartCbkType) {
-//    cout << "special net count = " << number << endl;
-//    ((FlexRoute*)data)->numSNets = number;
-//    // ((FlexRoute*)data)->snets = vector<SNet>(number);
-//  }
-//  return 0;
-//}
-
-int io::Parser::getDefNets(defrCallbackType_e type, defiNet* net, defiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  bool isSNet = false;
-
-  if (type != defrNetCbkType && type != defrSNetCbkType) {
-    cout <<"Type is not defr(S)NetCbkType!" <<endl;
-    exit(1);
-  }
-
-  if (type == defrSNetCbkType) {
-    //cout <<"Type is Special Net: " <<net->name() <<endl;
-    //exit(1);
-    isSNet = true;
-  }
-
-  unique_ptr<frNet> uNetIn = make_unique<frNet>(net->name());
-  auto netIn = uNetIn.get();
-  netIn->setId(((io::Parser*)data)->numNets);
-  ((io::Parser*)data)->numNets++;
-  if (enableOutput) {
-    cout <<"- " <<net->name();
-  }
-  for (int i = 0; i < net->numConnections(); i++) {
-    if (enableOutput) {
-      if (i % 4 == 0) {
-        cout <<endl <<" ";
-      }
-      cout <<" ( " <<net->instance(i) <<" " <<net->pin(i) <<" )";
-    }
-    
-    if (!strcmp(net->instance(i), "PIN")) {
-      // IOs
-      if (((io::Parser*)data)->tmpBlock->name2term.find(net->pin(i)) == ((io::Parser*)data)->tmpBlock->name2term.end()) {
-        if (VERBOSE > -1) {
-          cout <<"Error: term not found!" <<endl;
-        }
-        exit(1);
-      }
-      auto term = ((io::Parser*)data)->tmpBlock->name2term[net->pin(i)]; // frTerm*
-      term->addToNet(netIn);
-      netIn->addTerm(term);
-      // add physical, absolute coordinate pins
-      //for (auto &pin: term->getPins()) {
-      //  shared_ptr<frPin> newPin = make_shared<frPin>(*pin);
-      //  for (auto &pinFig: newPin->getFigs()) {
-      //    if (pinFig->typeId() == frcRect || pinFig->typeId() == frcPolygon) {
-      //      pinFig->addToNet(netIn);
-      //    } else {
-      //      cout <<"Error: currently only support rect and polygon with net" <<endl;
-      //    }
-      //  }
-      //  //newPin->addToNet(netIn); // currently only support rect and polygon
-      //  netIn->addPin(newPin);
-      //}
-    } else {
-      // Instances
-      if (!strcmp(net->instance(i), "*")) {
-        for (auto &inst: ((io::Parser*)data)->tmpBlock->getInsts()) {
-          for (auto &uInstTerm: inst->getInstTerms()) {
-            auto instTerm = uInstTerm.get();
-            auto name = instTerm->getTerm()->getName();
-            if (name == frString(net->pin(i))) {
-              instTerm->addToNet(netIn);
-              netIn->addInstTerm(instTerm);
-              break;
-            }
-          }
-        }
-      } else {
-        if (((io::Parser*)data)->tmpBlock->name2inst.find(net->instance(i)) == ((io::Parser*)data)->tmpBlock->name2inst.end()) {
-          if (VERBOSE > -1) {
-            cout <<"Error: component not found!" <<endl;
-          }
-          exit(1);
-        }
-        auto inst = ((io::Parser*)data)->tmpBlock->name2inst[net->instance(i)]; //frInst*
-        bool flag =   false;
-        for (auto &uInstTerm: inst->getInstTerms()) {
-          auto instTerm = uInstTerm.get();
-          auto name = instTerm->getTerm()->getName();
-          if (name == frString(net->pin(i))) {
-            flag = true;
-            instTerm->addToNet(netIn);
-            netIn->addInstTerm(instTerm);
-            // add physical, absolute coordinate pins
-            //frBox mbox;
-            //inst->getRefBlock()->getBoundaryBBox(mbox);
-            //frTransform xform;
-            //inst->getTransform(xform);
-            //frPoint size(mbox.right(), mbox.top());
-            //xform.updateXform(size);
-            //for (auto &pin: instTerm->getTerm()->getPins()) {
-            //  shared_ptr<frPin> newPin = make_shared<frPin>(*pin, xform);
-            //  for (auto &pinFig: newPin->getFigs()) {
-            //    if (pinFig->typeId() == frcRect || pinFig->typeId() == frcPolygon) {
-            //      pinFig->addToNet(netIn);
-            //    } else {
-            //      cout <<"Error: currently only support rect and polygon with net" <<endl;
-            //    }
-            //  }
-            //  //newPin->addToNet(netIn); // currently only support rect and polygon
-            //  netIn->addPin(newPin);
-            //}
-
-            break;
-          }
-        }
-        if (!flag) {
-          if (VERBOSE > -1) {
-            cout <<"Error: component pin not found!" <<endl;
-          }
-          exit(1);
-        }
-      }
-    }
-  }
-  // read pre-route
-  //cout << "Net " << net->name() << " has " << net->numWires() << " wires\n";
-  //cout << "Net " << net->name() << " has " << net->numPaths() << " paths\n"; // no paths
-  //cout << "Net " << net->name() << " has " << net->numVpins() << " vpins\n"; // no vpins
-  
-  // initialize
-  string layerName   = "";
-  string viaName     = "";
-  string shape       = "";
-  bool hasBeginPoint = false;
-  bool hasEndPoint   = false;
-  frCoord beginX     = -1;
-  frCoord beginY     = -1;
-  frCoord beginExt   = -1;
-  frCoord endX       = -1;
-  frCoord endY       = -1;
-  frCoord endExt     = -1;
-  bool hasRect       = false;
-  frCoord left       = -1;
-  frCoord bottom     = -1;
-  frCoord right      = -1;
-  frCoord top        = -1;
-  frCoord width      = 0;
-  for (int i = 0; i < (int)net->numWires(); i++) {
-    defiWire* tmpWire = net->wire(i);
-    //cout << "Wire " << i << "\n";
-    //cout << "  Type: " << tmpWire->wireType() << endl;
-    //cout << "  has " << tmpWire->numPaths() << " paths\n";
-    
-    if (enableOutput) {
-       cout <<endl <<"  + " <<tmpWire->wireType();
-    }
-    // each path is a def line
-    for (int j = 0; j < (int)tmpWire->numPaths(); j++) {
-      defiPath* path     = tmpWire->path(j);
-      path->initTraverse();
-      // initialize
-      layerName     = "";
-      viaName       = "";
-      shape         = "";
-      hasBeginPoint = false;
-      hasEndPoint   = false;
-      beginX        = -1;
-      beginY        = -1;
-      beginExt      = -1;
-      endX          = -1;
-      endY          = -1;
-      endExt        = -1;
-      hasRect       = false;
-      left          = -1;
-      bottom        = -1;
-      right         = -1;
-      top           = -1;
-      width         = 0;
-      //cout <<"path here" <<endl;
-      
-      int pathId;
-      while ((pathId = path->next()) != DEFIPATH_DONE) {
-        //cout << "  pathId = " << pathId << endl;
-        switch(pathId) {
-          case DEFIPATH_LAYER:
-            layerName = string(path->getLayer());
-            if (((io::Parser*)data)->tech->name2layer.find(layerName) == ((io::Parser*)data)->tech->name2layer.end()) {
-              if (VERBOSE > -1) {
-                cout <<"Error: unsupported layer: " <<layerName <<endl;
-              }
-              //continue;
-              exit(1);
-            }
-            if (enableOutput) {
-              if (!j) {
-                cout <<" " <<layerName;
-              } else {
-                cout <<endl <<"    NEW " <<layerName;
-              }
-            }
-            break;
-          case DEFIPATH_VIA:
-            viaName = string(path->getVia());
-            if (enableOutput) {
-              cout <<" " <<viaName;
-            }
-            break;
-          case DEFIPATH_WIDTH:
-            width = path->getWidth();
-            if (enableOutput) {
-              cout <<" " <<width;
-            }
-            break;
-          case DEFIPATH_POINT:
-            if (!hasBeginPoint) {
-              path->getPoint(&beginX, &beginY);
-              if (enableOutput) {
-                cout <<" ( " <<beginX <<" " <<beginY <<" )";
-              }
-              hasBeginPoint = true;
-            } else {
-              path->getPoint(&endX, &endY);
-              if (enableOutput) {
-                cout <<" ( " <<endX <<" " <<endY <<" )";
-              }
-              hasEndPoint = true;
-            }
-            break;
-          case DEFIPATH_FLUSHPOINT:
-            if (!hasBeginPoint) {
-              path->getFlushPoint(&beginX, &beginY, &beginExt);
-              if (enableOutput) {
-                cout <<" ( " <<beginX <<" " <<beginY <<" " <<beginExt <<" )";
-              }
-              hasBeginPoint = true;
-            } else {
-              path->getFlushPoint(&endX, &endY, &endExt);
-              if (enableOutput) {
-                cout <<" ( " <<endX <<" " <<endY <<" " <<endExt <<" )";
-              }
-              hasEndPoint = true;
-            }
-            break;
-          case DEFIPATH_SHAPE:
-            shape = path->getShape();
-            if (enableOutput) {
-              cout <<" + SHAPE " <<shape;
-            }
-            break;
-          case DEFIPATH_RECT:
-            path->getViaRect(&left, &bottom, &right, &top);
-            if (enableOutput) {
-              cout <<" RECT ( " <<left <<" " <<bottom <<" " <<right <<" " <<top <<" )";
-            }
-            hasRect = true;
-            break;
-          case DEFIPATH_VIRTUALPOINT:
-            if (!hasBeginPoint) {
-              path->getVirtualPoint(&beginX, &beginY);
-              if (enableOutput) {
-                cout <<" ( " <<beginX <<" " <<beginY <<" )";
-              }
-              hasBeginPoint = true;
-            } else {
-              path->getVirtualPoint(&endX, &endY);
-              if (enableOutput) {
-                cout <<" ( " <<endX <<" " <<endY <<" )";
-              }
-              hasEndPoint = true;
-            }
-            break;
-          default : cout <<" net " <<net->name() <<" unknown pathId " <<pathId <<endl; break;
-        }
-      }
-
-
-      auto layerNum = ((io::Parser*)data)->tech->name2layer[layerName]->getLayerNum();
-      // add rect
-      if (hasRect) {
-        //shared_ptr<frBlockObject> rect = make_shared<frRect>(); // incomplete
-        // end steiner = frRect
-        continue;
-      }
-
-      // add wire, currently do not consider extension
-      if (hasEndPoint) {
-        // route
-        auto tmpP = make_unique<frPathSeg>();
-
-        // avoid begin > end case
-        if (beginX > endX || beginY > endY) {
-          tmpP->setPoints(frPoint(endX, endY), frPoint(beginX, beginY));
-          swap(beginExt, endExt);
-        } else {
-          tmpP->setPoints(frPoint(beginX, beginY), frPoint(endX, endY));
-        }
-        tmpP->addToNet(netIn);
-        tmpP->setLayerNum(layerNum);
-
-        width = (width) ? width : ((io::Parser*)data)->tech->name2layer[layerName]->getWidth();
-        auto defaultBeginExt = width / 2;
-        auto defaultEndExt   = width / 2;
-
-        frEndStyleEnum tmpBeginEnum;
-        if (beginExt == -1) {
-          tmpBeginEnum = frcExtendEndStyle;
-        } else if (beginExt == 0) {
-          tmpBeginEnum = frcTruncateEndStyle;
-        } else {
-          tmpBeginEnum = frcVariableEndStyle;
-        }
-        frEndStyle tmpBeginStyle(tmpBeginEnum);
-
-        frEndStyleEnum tmpEndEnum;
-        if (endExt == -1) {
-          tmpEndEnum = frcExtendEndStyle;
-        } else if (endExt == 0) {
-          tmpEndEnum = frcTruncateEndStyle;
-        } else {
-          tmpEndEnum = frcVariableEndStyle;
-        }
-        frEndStyle tmpEndStyle(tmpEndEnum);
-
-        frSegStyle tmpSegStyle;
-        tmpSegStyle.setWidth(width);
-        tmpSegStyle.setBeginStyle(tmpBeginStyle, tmpBeginEnum == frcExtendEndStyle ? defaultBeginExt : beginExt);
-        tmpSegStyle.setEndStyle(tmpEndStyle, tmpEndEnum == frcExtendEndStyle ? defaultEndExt : endExt);
-        tmpP->setStyle(tmpSegStyle);
-        unique_ptr<frShape> tmpS(std::move(tmpP));
-        netIn->addShape(tmpS);
-      }
-
-      // add via
-      if (viaName != "") {
-        if (((io::Parser*)data)->tech->name2via.find(viaName) == ((io::Parser*)data)->tech->name2via.end()) {
-          if (VERBOSE > -1) {
-            cout <<"Error: unsupported via: " <<viaName <<endl;
-          }
-        } else {
-          frPoint p;
-          if (hasEndPoint) {
-            p.set(endX, endY);
-          } else {
-            p.set(beginX, beginY);
-          }
-          auto viaDef = ((io::Parser*)data)->tech->name2via[viaName];
-          auto tmpP = make_unique<frVia>(viaDef);
-          tmpP->setOrigin(p);
-          tmpP->addToNet(netIn);
-          netIn->addVia(tmpP);
-        }
-      }
-    } // end path
-  } // end wire
- 
-  frNetEnum netType = frNetEnum::frcNormalNet;
-  if (net->hasUse()) {
-    string str(net->use());
-    if (str == "SIGNAL") {
-      ;
-    } else if (str == "CLOCK") {
-      netType = frNetEnum::frcClockNet;
-    } else if (str == "POWER") {
-      netType = frNetEnum::frcPowerNet;
-    } else if (str == "GROUND") {
-      netType = frNetEnum::frcGroundNet;
-    } else {
-      cout <<"Error: unsupported NET USE in def" <<endl;
-      exit(1);
-    }
-    if (enableOutput) {
-      cout <<" + USE " <<str <<endl;
-    }
-  }
-  netIn->setType(netType);
-
-  if (enableOutput) {
-    cout <<endl <<" ;" <<endl;
-  }
-
-  //if (enableOutput) {
-  //  cout <<net->name() <<endl;
-  ////cout <<"numRect " <<net->numRectangles() <<endl; // rect always 0
-  //}
-
-
-  if (isSNet) {
-    ((io::Parser*)data)->tmpBlock->addSNet(uNetIn); 
-    if (((io::Parser*)data)->tmpBlock->snets.size() < 100000) {
-      if (((io::Parser*)data)->tmpBlock->snets.size() % 10000 == 0) {
-        cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->snets.size() <<" snets" <<endl;
-      }
-    } else {
-      if (((io::Parser*)data)->tmpBlock->snets.size() % 10000 == 0) {
-        cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->snets.size() <<" snets" <<endl;
-      }
-    }
-  } else {
-    ((io::Parser*)data)->tmpBlock->addNet(uNetIn); 
-    if (((io::Parser*)data)->tmpBlock->nets.size() < 100000) {
-      if (((io::Parser*)data)->tmpBlock->nets.size() % 10000 == 0) {
-        cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->nets.size() <<" nets" <<endl;
-      }
-    } else {
-      if (((io::Parser*)data)->tmpBlock->nets.size() % 100000 == 0) {
-        cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->nets.size() <<" nets" <<endl;
-      }
-    }
-  }
-
-  return 0;
-}
-
-int io::Parser::getDefTerminals(defrCallbackType_e type, defiPin* term, defiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (type != defrPinCbkType) {
-    cout <<"Type is not defrPinCbkType!" <<endl;
-    exit(1);
-  }
-
-  frTermEnum termType = frTermEnum::frcNormalTerm;
-
-  if (term->hasUse()) {
-    string str(term->use());
-    if (str == "SIGNAL") {
-      ;
-    } else if (str == "CLOCK") {
-      termType = frTermEnum::frcClockTerm;
-    } else if (str == "POWER") {
-      termType = frTermEnum::frcPowerTerm;
-    } else if (str == "GROUND") {
-      termType = frTermEnum::frcGroundTerm;
-    } else {
-      cout <<"Error: unsupported PIN USE in lef" <<endl;
-      exit(1);
-    }
-    if (enableOutput) {
-      cout <<"    USE " <<str <<" ;" <<endl;
-    }
-  }
-
-  if (term->hasPort()) {
-    cout <<"Error: multiple pin ports existing in DEF" <<endl;
-    exit(1);
-  } else {
-    //cout <<"  pinName  = " <<term->pinName() <<endl;
-    //cout <<"  hasLayer = " <<term->hasLayer() <<endl;
-    //cout <<"  numLayer = " <<term->numLayer() <<endl;
-    //cout <<"  numPolys = " <<term->numPolygons() <<endl;
-    //cout <<"  numPorts = " <<term->numPorts() <<endl;
-
-    // term
-    auto uTermIn = make_unique<frTerm>(term->pinName());
-    auto termIn = uTermIn.get();
-    termIn->setId(((io::Parser*)data)->numTerms);
-    ((io::Parser*)data)->numTerms++;
-    termIn->setType(termType);
-    // term should add pin
-    // pin
-    auto pinIn  = make_unique<frPin>();
-    pinIn->setId(0);
-    //pinIn->setTerm(termIn);
-    // pin should add pinFigs
-    // term
-    //frOrientEnum orient = frOrientEnum(term->orient());
-    for (int i = 0; i < term->numLayer(); ++i) {
-      //cout <<"  layerName= " <<term->layer(i) <<endl;
-      string layer = term->layer(i);
-      if (((io::Parser*)data)->tech->name2layer.find(layer) == ((io::Parser*)data)->tech->name2layer.end()) {
-        if (VERBOSE > -1) {
-          cout <<"Error: unsupported layer: " <<layer <<endl;
-        }
-        //continue;
-        exit(1);
-      }
-
-      frLayerNum layerNum = ((io::Parser*)data)->tech->name2layer[layer]->getLayerNum();
-      frCoord xl = 0;
-      frCoord yl = 0;
-      frCoord xh = 0;
-      frCoord yh = 0;
-      term->bounds(i, &xl, &yl, &xh, &yh);
-      // pinFig
-      unique_ptr<frRect> pinFig = make_unique<frRect>();
-      pinFig->setBBox(frBox(xl, yl, xh, yh));
-      pinFig->addToPin(pinIn.get());
-      pinFig->setLayerNum(layerNum);
-      pinFig->move(frTransform(term->placementX(), term->placementY(), frOrientEnum(term->orient())));
-      //cout <<"move" <<endl;
-      frBox transformedBBox;
-      pinFig->getBBox(transformedBBox);
-      // pinFig completed
-      // pin
-      unique_ptr<frPinFig> uptr(std::move(pinFig));
-      pinIn->addPinFig(uptr);
-      // Rectangle pinFigRect(xl, yl, xh, yh);
-      // std::cout << "Rect" << transformedBBox.left() << ", " << transformedBBox.bottom() << ", " << transformedBBox.right() << ", " << transformedBBox.top() << "\n";
-      Rectangle pinFigRect(transformedBBox.left(), transformedBBox.bottom(), transformedBBox.right(), transformedBBox.top());
-      pinIn->addLayerShape(layerNum, pinFigRect);
-      // pin completed
-    }
-    // polygon
-    for (int i = 0; i < term->numPolygons(); ++i) {
-      //cout <<"  polyName= " <<term->polygonName(i) <<endl;
-      string layer = term->polygonName(i);
-      if (((io::Parser*)data)->tech->name2layer.find(layer) == ((io::Parser*)data)->tech->name2layer.end()) {
-        if (VERBOSE > -1) {
-          cout <<"Error: unsupported layer: " <<layer <<endl;
-        }
-        //continue;
-        exit(1);
-      }
-
-      frLayerNum layerNum = ((io::Parser*)data)->tech->name2layer[layer]->getLayerNum();
-      auto polyPoints = term->getPolygon(i);
-      frCollection<frPoint> tmpPoints;
-      for (int j = 0; j < polyPoints.numPoints; j++) {
-        tmpPoints.push_back(frPoint((polyPoints.x)[j], (polyPoints.y)[j]));
-      }
-
-      // pinFig
-      unique_ptr<frPolygon> pinFig = make_unique<frPolygon>();
-      pinFig->setPoints(tmpPoints);
-      pinFig->addToPin(pinIn.get());
-      pinFig->setLayerNum(layerNum);
-      pinFig->move(frTransform(term->placementX(), term->placementY(), frOrientEnum(term->orient())));
-      // pinFig completed
-      // pin
-      unique_ptr<frPinFig> uptr(std::move(pinFig));
-      pinIn->addPinFig(uptr);
-      Polygon pinFigPoly;
-      frVector<Point> boostPolyPoints;
-      frTransform tmpXform(term->placementX(), term->placementY(), frOrientEnum(term->orient()));
-      for (auto &pt: tmpPoints) {
-        pt.transform(tmpXform);
-        boostPolyPoints.push_back(Point(pt.x(), pt.y()));
-        // std::cout << pt.x() << " " << pt.y() << "\n";
-      }
-      boost::polygon::set_points(pinFigPoly, boostPolyPoints.begin(), boostPolyPoints.end());
-      pinIn->addLayerShape(layerNum, pinFigPoly);
-      // pin completed
-    }
-    termIn->addPin(pinIn);
-    //cout <<"  placeXY  = (" <<term->placementX() <<"," <<term->placementY() <<")" <<endl;
-    ((io::Parser*)data)->tmpBlock->addTerm(uTermIn);
-  }
-
-  if (((io::Parser*)data)->tmpBlock->terms.size() % 1000 == 0) {
-    cout <<"defIn read " <<((io::Parser*)data)->tmpBlock->terms.size() <<" pins" <<endl;
-  }
-
-  return 0;
-
-}
-
-int io::Parser::getDefTracks(defrCallbackType_e type, defiTrack* track, defiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if ((type != defrTrackCbkType)) {
-    cout <<"Type is not defrTrackCbkType!" <<endl;
-    exit(1);
-  }
-
-  if (enableOutput) {
-    cout <<"TRACKS " <<track->macro() <<" " <<track->x() 
-         <<" DO " <<track->xNum() <<" STEP " <<track->xStep() 
-         <<" LAYER " <<track->layer(0) <<endl;
-  }
-
-  unique_ptr<frTrackPattern> tmpTrackPattern = make_unique<frTrackPattern>();
-  if (((io::Parser*)data)->tech->name2layer.find(track->layer(0)) == ((io::Parser*)data)->tech->name2layer.end()) {
-    cout <<"Error: cannot find layer: " <<track->layer(0) <<endl;
-    exit(2);
-  }
-  tmpTrackPattern->setLayerNum(((io::Parser*)data)->tech->name2layer.at(track->layer(0))->getLayerNum());
-  if (!strcmp(track->macro(), "X")) {
-    tmpTrackPattern->setHorizontal(true);
-  } else if (!strcmp(track->macro(), "Y")) {
-    tmpTrackPattern->setHorizontal(false);
-  } else {
-    cout <<"Error: unsupporterd direction: " <<track->macro() <<endl;
-    exit(2);
-  }
-  tmpTrackPattern->setStartCoord(track->x());
-  tmpTrackPattern->setNumTracks(track->xNum());
-  tmpTrackPattern->setTrackSpacing(track->xStep());
-  ((io::Parser*)data)->tmpBlock->trackPatterns.at(tmpTrackPattern->getLayerNum()).push_back(std::move(tmpTrackPattern));
-  //cout <<"here" <<endl;
-
-  return 0;
-}
-
-int io::Parser::getDefUnits(defrCallbackType_e type, double number, defiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  ((io::Parser*)data)->tmpBlock->setDBUPerUU(static_cast<frUInt4>(number));
-  if (enableOutput) {
-    cout <<"UNITS DISTANCE MICRONS " <<((io::Parser*)data)->tmpBlock->getDBUPerUU() <<" ;" <<endl;
-  }
-  return 0;
-}
-
-void io::Parser::readDef() {
-  FILE* f;
-  int res;
-  
-  defrInit();
-  defrReset();
-
-  defrInitSession(1);
-  
-  defrSetUserData((defiUserData)this);
-
-  defrSetDesignCbk(getDefString);
-  defrSetDesignEndCbk(getDefVoid);
-  defrSetDieAreaCbk(getDefDieArea);
-  defrSetUnitsCbk(getDefUnits);
-  defrSetTrackCbk(getDefTracks);
-  defrSetComponentCbk(getDefComponents);
-  defrSetPinCbk(getDefTerminals);
-  //defrSetSNetStartCbk(getDefInteger);
-  defrSetSNetCbk(getDefNets);
-  defrSetNetCbk(getDefNets);
-  defrSetAddPathToNet();
-  defrSetViaCbk(getDefVias);
-
-  // debug
-  // exit(1);
-
-  if ((f = fopen(DEF_FILE.c_str(),"r")) == 0) {
-    cout <<"Couldn't open def file" <<endl;
-    exit(2);
-  }
-
-  res = defrRead(f, DEF_FILE.c_str(), (defiUserData)this, 1);
-  if (res != 0) {
-    cout <<"DEF parser returns an error!" <<endl;
-    exit(2);
-  }
-  fclose(f);
-
-  //numPins = readPinCnt;
-
-  defrClear();
-}
-
-int io::Parser::getLef58SpacingTable_parallelRunLength(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  SPACINGTABLE" <<endl;
-    cout <<"  PARALLELRUNLENGTH";
-  }
-
-  bool    isWrongDirection    = false;
-  bool    isSameMask          = false;
-
-  bool    exceptEol           = false;
-  frCoord eolWidth            = 0;
-
-  //bool    hasExcludeSpacing   = false; // per WIDTH
-  frCoord lowExcludeSpacing   = 0;
-  frCoord highExcludeSpacing  = 0;
-
-  // 2d spacing table
-  frCollection<frCoord> rowVals, colVals;
-  frCollection<frCollection<frCoord> > tblVals;
-  frCollection<frCoord> tblRowVals;
-  
-  // except within
-  map<frCoord, pair<frCoord, frCoord> > ewVals;
-
-  int stage = 0;
-
-  istringstream istr(sIn);
-  string word;
-  while (istr >> word) {
-    if (word == string("WRONGDIRECTION")) {
-      //isWrongDirection = true;
-      if (enableOutput) {
-        cout <<" WRONGDIRECTION";
-      }
-    } else if (word == string("SAMEMASK")) {
-      isSameMask = true;
-      if (enableOutput) {
-        cout <<" SAMEMASK";
-      }
-    } else if (word == string("EXCEPTEOL")) {
-      //exceptEol = true;
-      double tmp;
-      if (istr >> tmp) {
-        //eolWidth = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" EXCEPTEOL " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58SpacingTable_parallelRunLength" <<endl;
-      }
-    } else if (word == string("EXCEPTWITHIN")) {
-      //hasExcludeSpacing = true;
-      if (enableOutput) {
-        cout <<" EXCEPTWITHIN";
-      }
-      double tmp;
-      if (istr >> tmp) {
-        lowExcludeSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58SpacingTable_parallelRunLength" <<endl;
-      }
-      if (istr >> tmp) {
-        highExcludeSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58SpacingTable_parallelRunLength" <<endl;
-      }
-      ewVals[rowVals.size()-1] = make_pair(lowExcludeSpacing, highExcludeSpacing);
-    } else if (word == string("WIDTH")) {
-      if (tblRowVals.size()) {
-        tblVals.push_back(tblRowVals);
-        tblRowVals.clear();
-      }
-      //hasExcludeSpacing   = false;
-      stage = 1;
-      double tmp;
-      if (istr >> tmp) {
-        rowVals.push_back(frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU())));
-        if (enableOutput) {
-          cout <<endl <<"  WIDTH " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58SpacingTable_parallelRunLength" <<endl;
-      }
-    } else if (word == string(";")) {
-      if (stage == 1 && tblRowVals.size()) {
-        tblVals.push_back(tblRowVals);
-        tblRowVals.clear();
-      }
-      if (enableOutput) {
-        cout <<" ;";
-      }
-    } else {
-      // get length
-      if (stage == 0) {
-        colVals.push_back(frCoord(round(stod(word) * ((io::Parser*)data)->tech->getDBUPerUU())));
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-      }
-      if (stage == 1) {
-        tblRowVals.push_back(frCoord(round(stod(word) * ((io::Parser*)data)->tech->getDBUPerUU())));
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-      }
-      //if (stage == 0) {
-      //  rowVals.push_back(frCoord(round(stod(word) * ((io::Parser*)data)->tech->getDBUPerUU())));
-      //  cout <<"pushed back row value " <<word <<endl;
-      //}
-    }
-  }
-
-  string rowName("WIDTH");
-  string colName("PARALLELRUNLENGTH");
-  shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > prlTbl = make_shared<
-    fr2DLookupTbl<frCoord, frCoord, frCoord> >(rowName, rowVals, colName, colVals, tblVals);
-  shared_ptr<frLef58SpacingTableConstraint> spacingTableConstraint = make_shared<frLef58SpacingTableConstraint>(prlTbl, ewVals);
-  spacingTableConstraint->setWrongDirection(isWrongDirection);
-  spacingTableConstraint->setSameMask(isSameMask);
-  if (exceptEol) {
-    spacingTableConstraint->setEolWidth(eolWidth);
-  }
-  
-  ((io::Parser*)data)->tech->addConstraint(spacingTableConstraint);
-  tmpLayer->addConstraint(spacingTableConstraint);
-
-  //if (enableOutput) {
-  //  cout <<endl;
-  //}
-
-
-  //cout <<"tblVals " <<endl;
-  //for (auto &v1: tblVals) {
-  //  for (auto &v2: v1) {
-  //    cout <<" " <<v2;
-  //  }
-  //  cout <<endl;
-  //}
-  //cout <<"ewVals " <<endl;
-  //for (auto &it: ewVals) {
-  //  cout <<"idx = " <<it.first <<", " <<"l/h = " <<it.second.first <<"/" <<it.second.second <<endl;
-  //}
-
-
-  //cout <<sIn <<endl;
-  return 0;
-}
-
-int io::Parser::getLef58SpacingTable(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  PROPERTY LEF58_SPACINGTABLE \"";
-  }
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-
-  string keyword;
-  while (istr >> word) {
-    if (word == string("SPACINGTABLE")) {
-      ss.str("");
-    } else if (word == string("PARALLELRUNLENGTH")) {
-      //cout <<"found PARALLELRUNLENGTH" <<endl;
-      keyword = "PARALLELRUNLENGTH";
-    } else if (word == string(";")) {
-      ss <<" " <<word;
-      if (keyword == string("PARALLELRUNLENGTH")) {
-        getLef58SpacingTable_parallelRunLength(data, tmpLayer, ss.str());
-      }
-      //cout <<"found ;" <<endl;
-    } else {
-      //cout <<"found " <<word <<endl;
-      ss <<" " <<word;
-    }
-  }
-  //cout <<ss.str() <<endl;
-  if (enableOutput) {
-    cout <<"\" ;" <<endl;
-  }
-
-  return 0;
-}
-
-
-int io::Parser::getLef58Spacing_endOfLineWithin(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //cout <<endl <<"xxx " <<sIn <<endl;
-  //if (enableOutput) {
-  //  cout <<endl <<"  SPACING";
-  //}
-  //cout <<"test: " <<sIn <<endl;
-  // minspacing
-  frCoord eolSpace           = 0;
-  frCoord eolWidth           = 0;
-
-  bool    hasExactWidth      = false;
-
-  bool    hasWrongDirSpacing = false;
-  frCoord wrongDirSpace      = 0;
-
-  bool    hasOppositeWidth   = false;
-  frCoord oppositeWidth      = 0;
-
-  frCoord eolWithin          = 0;
-
-  bool    hasWrongDirWithin  = false;
-  frCoord wrongDirWithin     = 0;
-
-  bool    hasSameMask        = false;
-
-  // ENDTOEND
-  bool    hasEndToEnd          = false;
-  frCoord endToEndSpace        = 0;
-  bool    hasCutSpace          = false;
-  frCoord oneCutSpace          = 0;
-  frCoord twoCutSpace          = 0;
-  bool    hasExtension         = false;
-  frCoord extension            = 0;
-  bool    hasWrongDirExtension = false;
-  frCoord wrongDirExtension    = 0;
-  bool    hasOtherEndWidth     = false;
-  frCoord otherEndWidth        = 0;
-  
-  // MINLENGTH/MAXLENGTH
-  bool    hasLength          = false;
-  bool    isMax              = false;
-  frCoord length             = 0;
-  bool    hasTwoSides        = false;
-
-  // PARALLELEDGE
-  bool    hasParallelEdge          = false;
-  bool    hasSubtractEolWidth      = false;
-  frCoord parSpace                 = 0;
-  frCoord parWithin                = 0;
-  bool    hasPrl                   = false;
-  frCoord prl                      = 0;
-  bool    hasParallelEdgeMinLength = false;
-  frCoord parallelEdgeMinLength    = 0;
-  bool    hasTwoEdges              = false;
-  bool    hasSameMetal             = false;
-  bool    hasNonEolCornerOnly      = false;
-  bool    hasParallelSameMask      = false;
-
-  bool    skip = false;
-  //string stage = "";
-
-  istringstream istr(sIn);
-  string word;
-  int stage = 0;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      double tmp;
-      if (istr >> tmp) {
-        eolSpace = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<endl <<"  SPACING " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (word == string("ENDOFLINE")) {
-      double tmp;
-      if (istr >> tmp) {
-        eolWidth = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" ENDOFLINE " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (word == string("EXACTWIDTH")) {
-      hasExactWidth = true;
-      if (enableOutput) {
-        cout <<" EXACTWIDTH";
-      }
-      stage = 0;
-    } else if (word == string("WRONGDIRSPACING")) {
-      hasWrongDirSpacing = true;
-      double tmp;
-      if (istr >> tmp) {
-        wrongDirSpace = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" WRONGDIRSPACING " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (word == string("OPPOSITEWIDTH")) {
-      hasOppositeWidth = true;
-      double tmp;
-      if (istr >> tmp) {
-        oppositeWidth = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" OPPOSITEWIDTH " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (word == string("WITHIN")) {
-      double tmp;
-      if (istr >> tmp) {
-        eolWithin = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" WITHIN " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 1;
-    } else if (word == string("SAMEMASK")) {
-      hasSameMask = true;
-      if (enableOutput) {
-        cout <<" SAMEMASK";
-      }
-      stage = 0;
-    } else if (word == string("EXCEPTEXACTWIDTH")) {
-      if (enableOutput) {
-        cout <<" EXCEPTEXACTWIDTH(SKIP)";
-      }
-      stage = 0;
-      skip = true;
-    } else if (word == string("FILLCONCAVECORNER")) {
-      if (enableOutput) {
-        cout <<" FILLCONCAVECORNER(SKIP)";
-      }
-      stage = 0;
-      skip = true;
-    } else if (word == string("WITHCUT")) {
-      if (enableOutput) {
-        cout <<" WITHCUT(SKIP)";
-      }
-      stage = 0;
-    } else if (word == string("ENDPRLSPACING")) {
-      if (enableOutput) {
-        cout <<" ENDPRLSPACING(SKIP)";
-      }
-      stage = 0;
-      skip = true;
-    } else if (word == string("ENDTOEND")) {
-      hasEndToEnd = true;
-      double tmp;
-      if (istr >> tmp) {
-        endToEndSpace = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" ENDTOEND " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 2;
-    } else if (word == string("MAXLENGTH")) {
-      hasLength = true;
-      isMax     = true;
-      double tmp;
-      if (istr >> tmp) {
-        length = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" MAXLENGTH " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (stage != 3 && word == string("MINLENGTH")) {
-      hasLength = true;
-      isMax     = false;
-      double tmp;
-      if (istr >> tmp) {
-        length = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" MINLENGTH " <<tmp;
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      stage = 0;
-    } else if (word == string("TWOSIDES")) {
-      hasTwoSides = true;
-      if (enableOutput) {
-        cout <<" TWOSIDES";
-      }
-      stage = 0;
-    } else if (word == string("EQUALRECTWIDTH")) {
-      if (enableOutput) {
-        cout <<" EQUALRECTWIDTH(SKIP)";
-      }
-      stage = 0;
-      skip = true;
-    } else if (word == string("PARALLELEDGE")) {
-      hasParallelEdge = true;
-      string tmp;
-      // read to parSpace
-      if (istr >> tmp) {
-        if (tmp == string("SUBTRACTEOLWIDTH")) {
-          hasSubtractEolWidth = true;
-          double tmp2;
-          if (istr >> tmp2) {
-            parSpace = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" PARALLELEDGE SUBTRACTEOLWIDTH " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        } else {
-          parSpace = frCoord(round(stod(tmp) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          if (enableOutput) {
-            cout <<" PARALLELEDGE " <<tmp;
-          }
-        }
-      } else {
-        cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-      }
-      // read to parWithin
-      if (istr >> tmp) {
-        if (tmp == string("WITHIN")) {
-          double tmp2;
-          if (istr >> tmp2) {
-            parWithin = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" (PE)WITHIN " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        } else {
-          cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-        }
-      }
-      stage = 3;
-    } else if (word == string("ENCLOSECUT")) {
-      if (enableOutput) {
-        cout <<" ENCLOSECUT(SKIP)";
-      }
-      stage = 0;
-      skip = true;
-    } else if (word == string(";")) {
-      if (enableOutput) {
-        cout <<" ;";
-      }
-      stage = 0;
-    } else {
-      // stage = 1, read wrongDirWithin
-      if (stage == 1) {
-        hasWrongDirWithin = true;
-        cout <<flush;
-        wrongDirWithin = frCoord(round(stod(word) * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-        stage = 0;
-      // stage = 2, read end to end from onecutspace
-      } else if (stage == 2) {
-        auto tmp = word;
-        if (tmp == string("EXTENSION")) {
-          hasExtension = true;
-          double tmp2;
-          if (istr >> tmp2) {
-            extension = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" EXTENSION " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-          stage = 20;
-        } else if (tmp == string("OTHERENDWIDTH")) {
-          hasOtherEndWidth = true;
-          double tmp2;
-          if (istr >> tmp2) {
-            otherEndWidth = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" OTHERENDWIDTH " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        } else {
-          hasCutSpace = true;
-          oneCutSpace = frCoord(round(stod(tmp) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          if (enableOutput) {
-            cout <<" " <<tmp;
-          }
-          double tmp2;
-          if (istr >> tmp2) {
-            twoCutSpace = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        }
-      // stage = 20, read end to end wrongDirExtension
-      } else if (stage == 20) {
-        hasWrongDirExtension = true;
-        wrongDirExtension = frCoord(round(stod(word) * ((io::Parser*)data)->tech->getDBUPerUU()));
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-        stage = 2;
-      // stage = 3, read paralleledge from prl
-      } else if (stage == 3) {
-        if (word == string("PRL")) {
-          hasPrl = true;
-          double tmp2;
-          if (istr >> tmp2) {
-            prl = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" PRL " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        } else if (word == string("MINLENGTH")) {
-          hasParallelEdgeMinLength = true;
-          double tmp2;
-          if (istr >> tmp2) {
-            parallelEdgeMinLength = frCoord(round(tmp2 * ((io::Parser*)data)->tech->getDBUPerUU()));
-            if (enableOutput) {
-              cout <<" (PE)MINLENGTH " <<tmp2;
-            }
-          } else {
-            cout <<"Error: getLef58Spacing_eolSpace" <<endl;
-          }
-        } else if (word == string("TWOEDGES")) {
-          hasTwoEdges = true;
-        } else if (word == string("SAMEMETAL")) {
-          hasSameMetal = true;
-        } else if (word == string("NONEOLCORNERONLY")) {
-          hasNonEolCornerOnly = true;
-        } else if (word == string("PARALLELSAMEMASK")) {
-          hasParallelSameMask = true;
-        } else {
-          ;
-        }
-      } else {
-        ;
-      }
-    }
-  }
-
-  if (skip) {
-    ;
-  } else {
-    auto con = make_shared<frLef58SpacingEndOfLineConstraint>();
-    con->setEol(eolSpace, eolWidth, hasExactWidth);
-    if (hasWrongDirSpacing) {
-      con->setWrongDirSpace(wrongDirSpace);
-    }
-
-    auto within = make_shared<frLef58SpacingEndOfLineWithinConstraint>();
-    con->setWithinConstraint(within);
-    if (hasOppositeWidth) {
-      within->setOppositeWidth(oppositeWidth);
-    }
-    within->setEolWithin(eolWithin);
-    if (hasWrongDirWithin) {
-      within->setWrongDirWithin(wrongDirWithin);
-    }
-    if (hasSameMask) {
-      within->setSameMask(hasSameMask);
-    }
-    if (hasEndToEnd) {
-      auto endToEnd = make_shared<frLef58SpacingEndOfLineWithinEndToEndConstraint>();
-      within->setEndToEndConstraint(endToEnd);
-      endToEnd->setEndToEndSpace(endToEndSpace);
-      if (hasCutSpace) {
-        endToEnd->setCutSpace(oneCutSpace, twoCutSpace);
-      }
-      if (hasExtension) {
-        if (hasWrongDirExtension) {
-          endToEnd->setExtension(extension, wrongDirExtension);
-        } else {
-          endToEnd->setExtension(extension);
-        }
-      }
-      if (hasOtherEndWidth) {
-        endToEnd->setOtherEndWidth(otherEndWidth);
-      }
-    }
-    if (hasParallelEdge) {
-      auto parallelEdge = make_shared<frLef58SpacingEndOfLineWithinParallelEdgeConstraint>();
-      within->setParallelEdgeConstraint(parallelEdge);
-      if (hasSubtractEolWidth) {
-        parallelEdge->setSubtractEolWidth(hasSubtractEolWidth);
-      }
-      parallelEdge->setPar(parSpace, parWithin);
-      if (hasPrl) {
-        parallelEdge->setPrl(prl);
-      }
-      if (hasParallelEdgeMinLength) {
-        parallelEdge->setMinLength(parallelEdgeMinLength);
-      }
-      if (hasTwoEdges) {
-        parallelEdge->setTwoEdges(hasTwoEdges);
-      }
-      if (hasSameMetal) {
-        parallelEdge->setSameMetal(hasSameMetal);
-      }
-      if (hasNonEolCornerOnly) {
-        parallelEdge->setNonEolCornerOnly(hasNonEolCornerOnly);
-      }
-      if (hasParallelSameMask) {
-        parallelEdge->setParallelSameMask(hasParallelSameMask);
-      }
-    }
-    if (hasLength) {
-      auto len = make_shared<frLef58SpacingEndOfLineWithinMaxMinLengthConstraint>();
-      within->setMaxMinLengthConstraint(len);
-      len->setLength(isMax, length, hasTwoSides);
-    }
-
-    ((io::Parser*)data)->tech->addConstraint(con);
-    //tmpLayer->addConstraint(con);
-    tmpLayer->lef58SpacingEndOfLineConstraints.push_back(con);
-  }
-
-  //if (enableOutput) {
-  //  cout <<endl;
-  //}
-
-  return 0;
-}
-
-
-int io::Parser::getLef58Spacing(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  PROPERTY LEF58_SPACING \"";
-  }
-  //cout <<sIn <<endl;
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-
-  string keyword;
-  string keyword2;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      ss.str("");
-      //ss.str(string("SPACING"));
-      //ss.clear();
-      //ss.str("");
-      ss <<word;
-      //cout <<"xxx " <<ss.str() <<endl;
-      keyword = "";
-    } else if (word == string("EOLPERPENDICULAR")) {
-      keyword = "EOLPERPENDICULAR";
-      ss <<" " <<word;
-    } else if (word == string("AREA")) {
-      keyword = "AREA";
-      ss <<" " <<word;
-    } else if (word == string("LAYER")) {
-      keyword = "LAYER";
-      ss <<" " <<word;
-    } else if (word == string("NOTCHLENGTH")) {
-      keyword = "NOTCHLENGTH";
-      ss <<" " <<word;
-    } else if (word == string("NOTCHSPAN")) {
-      keyword = "NOTCHSPAN";
-      ss <<" " <<word;
-    } else if (word == string("ENDOFLINE")) {
-      keyword = "ENDOFLINE";
-      ss <<" " <<word;
-    } else if (word == string("CONVEXCORNERS")) {
-      keyword = "CONVEXCORNERS";
-      ss <<" " <<word;
-    } else if (word == string("TOCONCAVECORNER")) {
-      keyword2 = "TOCONCAVECORNER";
-      ss <<" " <<word;
-    } else if (word == string("TONOTCHLENGTH")) {
-      keyword2 = "TONOTCHLENGTH";
-      ss <<" " <<word;
-    } else if (word == string(";")) {
-      ss <<" " <<word;
-      if (keyword == string("ENDOFLINE")) {
-        if (keyword2 == string("")) {
-          getLef58Spacing_endOfLineWithin(data, tmpLayer, ss.str());
-        } else if (keyword2 == string("TOCONCAVECORNER")) {
-          ;
-        } else if (keyword2 == string("TONOTCHLENGTH")) {
-          ;
-        } else {
-          ;
-        }
-      } else {
-        ; // has keyword, or SAMEMASK, or WRONGDIRECTION, or nothing
-      }
-    } else {
-      ss <<" " <<word;
-    }
-  }
-  if (enableOutput) {
-    cout <<"\" ;" <<endl;
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutClass(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  PROPERTY LEF58_CUTCLASS \"";
-  }
-  istringstream istr(sIn);
-  string word;
-
-  string  name       = "";
-  frCoord viaWidth   = 0;
-  bool    hViaLength = false;
-  frCoord viaLength  = 0;
-  bool    hNumCut    = false;
-  frUInt4 numCut     = 0;
-
-  auto lef58CutClassCon = make_shared<frLef58CutClassConstraint>();
-  if (tmpLayer->lef58CutClassConstraint.lock()) {
-    cout <<"Warning: PROPERTY LEF58_CUTCLASS already exists" <<endl;
-  }
-  tmpLayer->lef58CutClassConstraint = lef58CutClassCon;
-  ((io::Parser*)data)->tech->addConstraint(lef58CutClassCon);
-
-  while (istr >> word) {
-    if (word == string("CUTCLASS")) {
-      // initialization
-      name       = "";
-      viaWidth   = 0;
-      hViaLength = false;
-      viaLength  = 0;
-      hNumCut    = false;
-      numCut     = 0;
-      if (istr >> name) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutClass" <<endl;
-      }
-      if (enableOutput) {
-        cout <<endl <<"  CUTCLASS " <<name;
-      }
-    } else if (word == "WIDTH") {
-      double tmp;
-      if (istr >> tmp) {
-        viaWidth = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutClass" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" WIDTH " <<tmp;
-      }
-    } else if (word == "LENGTH") {
-      double tmp;
-      if (istr >> tmp) {
-        hViaLength = true;
-        viaLength = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutClass" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" LENGTH " <<tmp;
-      }
-    } else if (word == "CUTS") {
-      if (istr >> numCut) {
-        hNumCut = true;
-      } else {
-        cout <<"Error: getLef58CutClass" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" CUTS " <<numCut;
-      }
-    } else if (word == ";") {
-      if (enableOutput) {
-        cout <<" ;";
-      }
-      // push rule here;
-      auto con = make_shared<frLef58CutClass>();
-      con->setName(name);
-      con->setViaWidth(viaWidth);
-      if (hViaLength) {
-        con->setViaLength(viaLength);
-      } else {
-        con->setViaLength(viaWidth);
-      }
-      if (hNumCut) {
-        con->setNumCut(numCut);
-      } else {
-        con->setNumCut(1);
-      }
-      lef58CutClassCon->addToCutClass(con);
-    }
-  }
-  if (enableOutput) {
-    cout <<"\" ;" <<endl;
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacing_helper(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  //bool enableOutput = false;
-
-  string keyword = "";
-
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      keyword = "";
-      ss.str("");
-      ss <<word;
-    } else if (keyword == "" && word == string("SAMEMASK")) {
-      keyword = "SAMEMASK";
-      ss <<" " <<word;
-    } else if (word == string("MAXXY")) {
-      keyword = "MAXXY";
-      ss <<" " <<word;
-    } else if (word == string("LAYER")) {
-      keyword = "LAYER";
-      ss <<" " <<word;
-    } else if (word == string("ADJACENTCUTS")) {
-      keyword = "ADJACENTCUTS";
-      ss <<" " <<word;
-    } else if (word == string("PARALLELOVERLAP")) {
-      keyword = "PARALLELOVERLAP";
-      ss <<" " <<word;
-    } else if (word == string("PARALLELWITHIN")) {
-      keyword = "PARALLELWITHIN";
-      ss <<" " <<word;
-    } else if (word == string("SAMEMETALSHAREDEDGE")) {
-      keyword = "SAMEMETALSHAREDEDGE";
-      ss <<" " <<word;
-    } else if (word == string("AREA")) {
-      keyword = "AREA";
-      ss <<" " <<word;
-    } else {
-      ss <<" " <<word;
-    }
-  }
-
-  if (keyword == "LAYER") {
-    getLef58CutSpacing_layer(data, tmpLayer, ss.str());
-  } else if (keyword == "ADJACENTCUTS") {
-    getLef58CutSpacing_adjacentCuts(data, tmpLayer, ss.str());
-  } else if (keyword == "PARALLELWITHIN") {
-    getLef58CutSpacing_parallelWithin(data, tmpLayer, ss.str());
-  } else {
-    ; //skip unsupported rules
-  }
-  
-  return 0;
-
-}
-
-int io::Parser::getLef58CutSpacing(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  PROPERTY LEF58_SPACING \"";
-  }
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      ss.str("");
-      ss <<word;
-    } else if (word == ";") {
-      ss <<" " <<word;
-      getLef58CutSpacing_helper(data, tmpLayer, ss.str());
-    } else {
-      ss <<" " <<word;
-    }
-  }
-  if (enableOutput) {
-    cout <<"\" ;" <<endl;
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacing_layer(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-
-  frCoord  cutSpacing        = 0;
-
-  bool     skip              = false;
-  //frLayerNum secondLayerNum  = 0;
-  frString secondLayerName   = "";
-  // cutclass
-  frString className         = "";
-  bool     hasAboveWidth     = false;
-  frCoord  aboveWidth        = 0;
-  bool     hasEnc            = false;
-  frCoord  enclosure         = 0;
-
-  istringstream istr(sIn);
-  string word;
-
-  string keyword = "";
-  //int stage = 0;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      double tmp;
-      if (istr >> tmp) {
-        cutSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<endl <<"  SPACING " <<tmp;
-      }
-    } else if (word == string("LAYER")) {
-      if (istr >> secondLayerName) {
-        //if (((io::Parser*)data)->tech->layers.find(layerName) == ((io::Parser*)data)->tech->layers.end()) {
-        //  skip = true; // skip for via0
-        //} else {
-        //  secondLayerNum = ((io::Parser*)data)->tech->layers.at(layerName)->getLayerNum();
-        //}
-        
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" LAYER " <<secondLayerName;
-      }
-    } else if (word == string("CUTCLASS")) {
-      if (istr >> className) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" CUTCLASS " <<className;
-      }
-    } else if (word == string("SHORTEDGEONLY")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" SHORTEDGEONLY(SKIP)";
-      }
-    } else if (word == string("PRL")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" PRL(SKIP) " <<tmp;
-      }
-    } else if (word == string("CONCAVECORNER")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" CONCAVECORNER(SKIP)";
-      }
-    } else if (word == string("WIDTH")) {
-      skip = true;
-      string tmpS;
-      double tmpD;
-      if (istr >> tmpD) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" WIDTH(SKIP) " <<tmpD;
-      }
-      if (istr >> tmpS) {
-        ; // ENCLOSURE
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (istr >> tmpD) {
-        ; // enclosure
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE " <<tmpD;
-      }
-      if (istr >> tmpS) {
-        ; // EDGELENGTH
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (istr >> tmpD) {
-        ; // edgeLength
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" EDGELENGTH " <<tmpD;
-      }
-    } else if (word == string("PARALLEL")) {
-      skip = true;
-      string tmpS;
-      double tmpD;
-      if (istr >> tmpD) {
-        ; // parLength
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" PARALLEL(SKIP) " <<tmpD;
-      }
-      if (istr >> tmpS) {
-        ; // WITHIN
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (istr >> tmpD) {
-        ; // parWithin
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" WITHIN " <<tmpD;
-      }
-      if (istr >> tmpS) {
-        ; // ENCLOSURE
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (istr >> tmpD) {
-        ; // enclosure
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE " <<tmpD;
-      }
-    } else if (word == string("EDGELENGTH")) {
-      skip = true;
-      string tmpS;
-      double tmpD;
-      if (istr >> tmpD) {
-        ; // edgeLength
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" EDGELENGTH(SKIP) " <<tmpD;
-      }
-      if (istr >> tmpS) {
-        ; // ENCLOSURE
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (istr >> tmpD) {
-        ; // edgeEnclosure
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE " <<tmpD;
-      }
-      if (istr >> tmpD) {
-        ; // adjEnclosure
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" " <<tmpD;
-      }
-    } else if (word == string("EXTENSION")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" EXTENSION(SKIP) " <<tmp;
-      }
-    } else if (word == string("NONEOLCONVEXCORNER")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" NONEOLCONVEXCORNER " <<tmp;
-      }
-    } else if (word == string("MINLENGTH")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" MINLENGTH(SKIP) " <<tmp;
-      }
-    } else if (word == string("ABOVEWIDTH")) {
-      hasAboveWidth = true;
-      double tmp;
-      if (istr >> tmp) {
-        aboveWidth = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ABOVEWIDTH " <<tmp;
-      }
-    } else if (word == string("ENCLOSURE")) {
-      hasEnc = true;
-      double tmp;
-      if (istr >> tmp) {
-        enclosure = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE " <<tmp;
-      }
-    } else if (word == string("MASKOVERLAP")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" MASKOVERLAP(SKIP)";
-      }
-    } else if (word == string("WRONGDIRECTION")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" WRONGDIRECTION(SKIP)";
-      }
-    } else if (word == string(";")) {
-      if (enableOutput) {
-        cout <<" ;";
-      }
-    } else {
-      ;
-    }
-  }
-
-  if (skip) {
-    ;
-  } else {
-    auto lr = make_shared<frLef58CutSpacingLayerConstraint>();
-    //lr->setSecondLayerNum(secondLayerNum);
-    lr->setSecondLayerName(secondLayerName);
-    if (!(className == "")) {
-      lr->setCutClass(className);
-      if (hasAboveWidth) {
-        lr->setAboveWidth(aboveWidth);
-        if (hasEnc) {
-          lr->setEnclosure(enclosure);
-        }
-      }
-    }
-
-    auto con = make_shared<frLef58CutSpacingConstraint>();
-    con->setCutSpacing(cutSpacing);
-    con->setLayerConstraint(lr);
-    tmpLayer->lef58CutSpacingConstraints.push_back(con);
-    ((io::Parser*)data)->tech->addConstraint(con);
-  }
-  return 0;
-}
-// lefdef ref spacing
-int io::Parser::getLef58CutSpacing_adjacentCuts(void *data, frLayer* tmpLayer, const string &sIn) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-
-  bool     skip              = false;
-
-  frCoord  cutSpacing        = 0;
-  frUInt4  numAdjCuts        = 0;
-  // two cuts
-  bool     hasTwoCuts        = false;
-  frUInt4  twoCuts           = 0;
-  bool     hasTwoCutsSpacing = false;
-  frCoord  twoCutsSpacing    = 0;
-  bool     hasSameCut        = false;
-  // within
-  frCoord  cutWithin1        = 0;
-  frCoord  cutWithin2        = 0;
-  // cutclass
-  frString className         = "";
-  bool     hasToAll          = false;
-
-  istringstream istr(sIn);
-  string word;
-
-  string keyword = "";
-  int stage = 0;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      double tmp;
-      if (istr >> tmp) {
-        cutSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<endl <<"  SPACING " <<tmp;
-      }
-    } else if (word == string("ADJACENTCUTS")) {
-      if (istr >> numAdjCuts) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ADJACENTCUTS " <<numAdjCuts;
-      }
-    } else if (word == string("EXACTALIGNED")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        //cutSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" EXACTALIGNED(SKIP)";
-      }
-    } else if (word == string("TWOCUTS")) {
-      hasTwoCuts = true;
-      if (istr >> twoCuts) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" TWOCUTS " <<twoCuts;
-      }
-    } else if (word == string("TWOCUTSSPACING")) {
-      hasTwoCutsSpacing = true;
-      double tmp;
-      if (istr >> tmp) {
-        twoCutsSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" TWOCUTSSPACING " <<tmp;
-      }
-    } else if (word == string("SAMECUT")) {
-      hasSameCut = true;
-      if (enableOutput) {
-        cout <<" SAMECUT";
-      }
-    } else if (word == string("WITHIN")) {
-      stage = 1;
-      double tmp;
-      if (istr >> tmp) {
-        cutWithin1 = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        cutWithin2 = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" WITHIN " <<tmp;
-      }
-    } else if (word == string("EXCEPTSAMEPGNET")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" EXCEPTSAMEPGNET(SKIP)";
-      }
-    } else if (word == string("EXCEPTALLWITHIN")) {
-      skip = true;
-      double tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" EXCEPTALLWITHIN(SKIP) " <<tmp;
-      }
-    } else if (word == string("ENCLOSURE")) {
-      skip = true;
-      string tmp;
-      if (istr >> tmp) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE(SKIP) " <<tmp;
-      }
-      double tmpD;
-      if (istr >> tmpD) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" " <<tmpD;
-      }
-    } else if (word == string("CUTCLASS")) {
-      if (istr >> className) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" CUTCLASS " <<className;
-      }
-    } else if (word == string("TO")) {
-      hasToAll = true;
-      string tmp;
-      if (istr >> tmp) {
-        if (tmp == "ALL") {
-          ;
-        } else {
-          cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-        }
-      } else {
-        cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" TO ALL";
-      }
-    } else if (word == string("NOPRL")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" NOPRL(SKIP)";
-      }
-    } else if (word == string("SIDEPARALLELOVERLAP")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" SIDEPARALLELOVERLAP(SKIP)";
-      }
-    } else if (word == string("SAMEMASK")) {
-      skip = true;
-      if (enableOutput) {
-        cout <<" SAMEMASK(SKIP)";
-      }
-    } else if (word == string(";")) {
-      if (enableOutput) {
-        cout <<" ;";
-      }
-    } else {
-      if (stage == 1) {
-        double tmp;
-        if (istr >> tmp) {
-          cutWithin2 = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-        } else {
-          cout <<"Error: getLef58CutSpacing_adjacentCuts" <<endl;
-        }
-        if (enableOutput) {
-          cout <<" " <<tmp;
-        }
-        stage = 0;
-      } else {
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-      }
-    }
-  }
-
-  if (skip) {
-    ;
-  } else{
-    auto ac = make_shared<frLef58CutSpacingAdjacentCutsConstraint>();
-    ac->setNumAdjCuts(numAdjCuts);
-    if (hasTwoCuts) {
-      if (hasTwoCutsSpacing) {
-        ac->setTwoCuts(twoCuts, twoCutsSpacing, hasSameCut);
-      } else {
-        ac->setTwoCuts(twoCuts, hasSameCut);
-      }
-    }
-    ac->setWithin(cutWithin1, cutWithin2);
-    if (!(className == "")) {
-      ac->setCutClass(className, hasToAll);
-    }
-
-    auto con = make_shared<frLef58CutSpacingConstraint>();
-    con->setCutSpacing(cutSpacing);
-    con->setAdjacentCutsConstraint(ac);
-    tmpLayer->lef58CutSpacingConstraints.push_back(con);
-    ((io::Parser*)data)->tech->addConstraint(con);
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacing_parallelWithin(void *data, frLayer* tmpLayer, const string &sIn) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-
-  bool     skip             = false;
-  frCoord  cutSpacing       = 0;
-  frCoord  within           = 0;
-  bool     hasExceptSameNet = false;
-  bool     hasCutClass      = false;
-  frString className        = "";
-  bool     hasLongEdgeOnly  = false;
-  //bool     hasEnc           = false;
-  frCoord  enclosure        = 0;
-  bool     isAbove          = false;
-  //bool     hasParallel      = false;
-  frCoord  parLength        = 0;
-  frCoord  parWithin        = 0;
-
-  istringstream istr(sIn);
-  string word;
-
-  string keyword = "";
-  int stage = 0;
-  while (istr >> word) {
-    if (word == string("SPACING")) {
-      double tmp;
-      if (istr >> tmp) {
-        cutSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<endl <<"  SPACING " <<tmp;
-      }
-    } else if (word == string("PARALLELWITHIN")) {
-      double tmp;
-      if (istr >> tmp) {
-        within = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" PARALLELWITHIN " <<tmp;
-      }
-    } else if (word == string("EXCEPTSAMENET")) {
-      hasExceptSameNet = true;
-      if (enableOutput) {
-        cout <<" EXCEPTSAMENET";
-      }
-    } else if (word == string("CUTCLASS")) {
-      hasCutClass = true;
-      if (istr >> className) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" CUTCLASS " <<className;
-      }
-    } else if (word == string("LONGEDGEONLY")) {
-      hasLongEdgeOnly = true;
-      if (enableOutput) {
-        cout <<" LONGEDGEONLY";
-      }
-    } else if (word == string("ENCLOSURE")) {
-      //hasEnc = true;
-      double tmp;
-      if (istr >> tmp) {
-        enclosure = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" ENCLOSURE " <<tmp;
-      }
-    } else if (word == string("ABOVE")) {
-      isAbove = true;
-      if (enableOutput) {
-        cout <<" ABOVE";
-      }
-    } else if (word == string("BELOW")) {
-      isAbove = false;
-      if (enableOutput) {
-        cout <<" BELOW";
-      }
-    } else if (word == string("PARALLEL")) {
-      //hasParallel = true;
-      double tmp;
-      if (istr >> tmp) {
-        parLength = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" PARALLEL " <<tmp;
-      }
-      stage = 1;
-    } else if (stage == 1 && word == string("WITHIN")) {
-      double tmp;
-      if (istr >> tmp) {
-        parWithin = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacing_parallelWithin" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" WITHIN " <<tmp;
-      }
-    } else {
-      if (enableOutput) {
-        cout <<" " <<word;
-      }
-    }
-  }
-
-  if (skip) {
-    ;
-  } else {
-    auto pw = make_shared<frLef58CutSpacingParallelWithinConstraint>();
-    pw->setParallelWithin(within, hasExceptSameNet);
-    if (hasCutClass) {
-      pw->setClassName(className);
-      pw->setLongEdgeOnly(hasLongEdgeOnly);
-      pw->setEnclosure(enclosure, isAbove);
-      pw->setParallel(parLength, parWithin);
-    }
-
-    auto con = make_shared<frLef58CutSpacingConstraint>();
-    con->setCutSpacing(cutSpacing);
-    con->setParallelWithinConstraint(pw);
-    tmpLayer->lef58CutSpacingConstraints.push_back(con);
-    ((io::Parser*)data)->tech->addConstraint(con);
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacingTable(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    cout <<endl <<"  PROPERTY LEF58_SPACINGTABLE \"";
-  }
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-  while (istr >> word) {
-    if (word == string("SPACINGTABLE")) {
-      ss.str("");
-      ss <<word;
-    } else if (word == ";") {
-      ss <<" " <<word;
-      getLef58CutSpacingTable_helper(data, tmpLayer, ss.str());
-    } else {
-      ss <<" " <<word;
-    }
-  }
-  if (enableOutput) {
-    cout <<"\" ;" <<endl;
-  }
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacingTable_helper(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  //bool enableOutput = false;
-  //if (enableOutput) {
-  //  cout <<endl <<"  PROPERTY LEF58_SPACINGTABLE \"" <<endl;
-  //}
-
-  string keyword = "";
-
-  istringstream istr(sIn);
-  string word;
-  stringstream ss;
-  while (istr >> word) {
-    if (word == string("SPACINGTABLE")) {
-      keyword = "";
-      ss.str("");
-      ss <<word;
-      //if (enableOutput) {
-      //  cout <<"  SPACINGTABLE";
-      //}
-    } else if (word == string("CENTERSPACING")) {
-      //if (enableOutput) {
-      //  cout <<" CENTERSPACING";
-      //}
-      keyword = "CENTERSPACING";
-      ss <<" " <<word;
-    } else if (word == string("ORTHOGONAL")) {
-      //if (enableOutput) {
-      //  cout <<" CENTERSPACING";
-      //}
-      keyword = "ORTHOGONAL";
-      ss <<" " <<word;
-    } else {
-      ss <<" " <<word;
-    }
-  }
-
-  if (keyword == "CENTERSPACING") {
-    ; //skip center spacing rules
-  } else if (keyword == "ORTHOGONAL") {
-    ; //skip orthogonal rules
-  } else {
-    getLef58CutSpacingTable_others(data, tmpLayer, ss.str());
-  }
-  
-  //if (enableOutput) {
-  //  cout <<"\" ;" <<endl;
-  //}
-
-  return 0;
-
-}
-
-int io::Parser::getLef58CutSpacingTable_default(void *data, frLayer* tmpLayer, const string &sIn, 
-    const shared_ptr<frLef58CutSpacingTableConstraint> &con) {
-  //cout <<sIn <<endl;
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  
-  frCoord defaultCutSpacing = 0;
-
-  istringstream istr(sIn);
-  string word;
-
-  while (istr >> word) {
-    if (word == string("DEFAULT")) {
-      double tmp;
-      if (istr >> tmp) {
-        defaultCutSpacing = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacingTable_default" <<endl;
-      }
-      if (enableOutput) {
-        cout <<endl <<"  DEFAULT " <<tmp;
-      }
-    } else {
-      ; // skip unknown rules
-    }
-  }
-
-  con->setDefaultCutSpacing(defaultCutSpacing);
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacingTable_prl(void *data, frLayer* tmpLayer, const string &sIn, 
-    const shared_ptr<frLef58CutSpacingTableConstraint> &con) {
-  //cout <<sIn <<endl;
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  
-  frCoord prl          = 0;
-  bool    isHorizontal = false;
-  bool    isVertical   = false;
-  bool    isMaxXY      = false;
-
-  istringstream istr(sIn);
-  string word;
-
-  while (istr >> word) {
-    if (word == string("PRL")) {
-      double tmp;
-      if (istr >> tmp) {
-        prl = frCoord(round(tmp * ((io::Parser*)data)->tech->getDBUPerUU()));
-      } else {
-        cout <<"Error: getLef58CutSpacingTable_prl" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" PRL " <<tmp;
-      }
-    } else if (word == string("HORIZONTAL")) {
-      isHorizontal = true;
-      if (enableOutput) {
-        cout <<" HORIZONTAL";
-      }
-    } else if (word == string("VERTICAL")) {
-      isVertical = true;
-      if (enableOutput) {
-        cout <<" VERTICAL";
-      }
-    } else if (word == string("MAXXY")) {
-      isMaxXY = true;
-      if (enableOutput) {
-        cout <<" MAXXY";
-      }
-    } else {
-      ; // skip unknown rules
-    }
-  }
-
-  auto ptr = make_shared<frLef58CutSpacingTablePrlConstraint>();
-  ptr->setPrl(prl);
-  ptr->setHorizontal(isHorizontal);
-  ptr->setVertical(isVertical);
-  ptr->setMaxXY(isMaxXY);
-  con->setPrlConstraint(ptr);
-
-  return 0;
-}
-
-int io::Parser::getLef58CutSpacingTable_layer(void *data, frLayer* tmpLayer, const string &sIn, 
-    const shared_ptr<frLef58CutSpacingTableConstraint> &con, frLayerNum &secondLayerNum) {
-
-  //bool enableOutput = true;
-  bool enableOutput = false;
-
-  frString secondLayerName    = "";
-  bool     isNonZeroEnclosure = false;
-
-  istringstream istr(sIn);
-  string word;
-
-  while (istr >> word) {
-    if (word == string("LAYER")) {
-      if (istr >> secondLayerName) {
-        ;
-      } else {
-        cout <<"Error: getLef58CutSpacingTable_layer" <<endl;
-      }
-      if (enableOutput) {
-        cout <<" LAYER " <<secondLayerName;
-      }
-    } else if (word == string("NONZEROENCLOSURE")) {
-      isNonZeroEnclosure = true;
-      if (enableOutput) {
-        cout <<endl <<"  NONZEROENCLOSURE";
-      }
-    } else {
-      ; // skip unknown rules
-    }
-  }
-
-  auto ptr = make_shared<frLef58CutSpacingTableLayerConstraint>();
-  //cout <<secondLayerName <<endl <<flush;
-  secondLayerNum = ((io::Parser*)data)->tech->name2layer.at(secondLayerName)->getLayerNum();
-  ptr->setSecondLayerNum(secondLayerNum);
-  ptr->setNonZeroEnc(isNonZeroEnclosure);
-  con->setLayerConstraint(ptr);
-
-  return 0;
-}
-
-
-int io::Parser::getLef58CutSpacingTable_cutClass(void *data, frLayer* tmpLayer, const string &sIn, 
-    const shared_ptr<frLef58CutSpacingTableConstraint> &con, bool hasSecondLayer, frLayerNum secondLayerNum) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-
-  auto defaultCutSpacing = con->getDefaultCutSpacing();
-  // 2d spacing table
-  //frCollection<frString> rowVals, colVals;
-  frCollection<frCollection<pair<frCoord, frCoord> > > tblVals;
-  //frCollection<pair<frCoord, frCoord> > tblRowVals;
-
-  //cout <<endl <<sIn <<endl;
-  // check numRows and numCols
-  istringstream istr1(sIn);
-  string word;
-  int numCols = 0;
-  int numRows = 0;
-  bool isPrevNum   = false;
-  while (istr1 >> word) {
-    // "-" is treated as number 0
-    if (word == "-") {
-      word = "0";
-    }
-    stringstream tmpss(word);
-    double tmpd;
-    // is a number
-    if (tmpss >> tmpd) {
-      isPrevNum = true;
-      numCols++;
-    // is a string
-    } else {
-      if (word == ";") {
-        numRows++;
-      } else if (isPrevNum) {
-        numRows++;
-        numCols = 0;
-      }
-      isPrevNum = false;
-    }
-  }
-
-  numCols /= 2;
-  //cout <<endl <<"#rows/cols = " <<numRows <<"/" <<numCols <<endl;
-  
-  vector<frString> colNames;
-  vector<int>      dupColNames; //duplicate side and all
-  
-  vector<frString> rowNames;
-  vector<int>      dupRowNames; //duplicate side and all
-  
-  vector<vector<pair<frCoord, frCoord> > > tmpTbl;
-  vector<pair<frCoord, frCoord> > tmpTblRow;
-  
-  istringstream istr2(sIn);
-  word = "";
-  int stage = 0; // 0 = read columns; 1 = read rows
-  int readNum = 0; // numbers read in a row
-  while (istr2 >> word) {
-    // "-" is treated as number 0
-    //if (word == ";") {
-    //  cout <<"found ;" <<endl;
-    //}
-    if (word == "-") {
-      word = to_string(defaultCutSpacing * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU());
-    }
-    if (word == "CUTCLASS") {
-      if (enableOutput) {
-        cout <<endl <<"  CUTCLASS";
-      }
-    // read numCols times
-    } else if ((int)colNames.size() < numCols) {
-      if (word == "SIDE" || word == "END") {
-        *(--colNames.end()) = *(--colNames.end()) + word;
-        *(--dupColNames.end()) = 1;
-      } else {
-        colNames.push_back(word);
-        dupColNames.push_back(2);
-      }
-      if (enableOutput) {
-        cout <<" " <<word;
-      }
-      //cout <<"testX" <<endl;
-    } else if (stage == 0 && (int)colNames.size() == numCols) {
-      // last word of column
-      if (word == "SIDE" || word == "END") {
-        *(--colNames.end()) = *(--colNames.end()) + word;
-        *(--dupColNames.end()) = 1;
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-      // first word of row
-      } else {
-        rowNames.push_back(word);
-        dupRowNames.push_back(2);
-        if (enableOutput) {
-          cout <<endl <<"  " <<word;
-        }
-      }
-      stage = 1;
-      //cout <<"testXX" <<endl;
-    } else if (word == ";") {
-      if (enableOutput) {
-        cout <<" ;";
-      }
-      tmpTbl.push_back(tmpTblRow);
-      //cout <<"testXXX" <<endl;
-    } else if (stage == 1) {
-      if (word == "SIDE" || word == "END") {
-        *(--rowNames.end()) = *(--rowNames.end()) + word;
-        *(--dupRowNames.end()) = 1;
-        if (enableOutput) {
-          cout <<" " <<word;
-        }
-      } else {
-        stringstream ss(word);
-        double firstNum;
-        //cout <<"test: " <<word <<endl;
-        // number
-        if (ss >> firstNum) {
-          frCoord val1 = frCoord(round(firstNum * ((io::Parser*)data)->tech->getDBUPerUU()));
-          string tmpS;
-          if (istr2 >> tmpS) {
-            ;
-          } else {
-            cout <<"Error: getLef58CutSpacingTable_cutClass" <<endl;
-          }
-          stringstream tmpSS(tmpS);
-          double secondNum;
-          if (tmpSS >> secondNum) {
-            frCoord val2 = frCoord(round(secondNum * ((io::Parser*)data)->tech->getDBUPerUU()));
-            tmpTblRow.push_back(make_pair(val1, val2));
-            if (enableOutput) {
-              cout <<" " <<firstNum <<" " <<secondNum;
-            }
-          } else {
-            // the number is "-", use default spacing
-            frCoord val2 = defaultCutSpacing;
-            tmpTblRow.push_back(make_pair(val1, val2));
-            if (enableOutput) {
-              cout <<" " <<firstNum <<" " <<defaultCutSpacing * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-            }
-          }
-          readNum += 1;
-        // first word
-        } else {
-          rowNames.push_back(word);
-          dupRowNames.push_back(2);
-          if (enableOutput) {
-            cout <<endl <<"  " <<word;
-          }
-          if (readNum) {
-            tmpTbl.push_back(tmpTblRow);
-            tmpTblRow.clear();
-          }
-          readNum = 0;
-        }
-      }
-      //cout <<"testXXXX" <<endl;
-    }
-  }
-
-  //cout <<endl <<"column:";
-  //for (auto &str: colNames) {
-  //  cout <<" " <<str;
-  //}
-  //
-  //cout <<endl <<"row:";
-  //for (auto &str: rowNames) {
-  //  cout <<" " <<str;
-  //}
-
-  //cout <<endl <<"table: ";
-  //for (auto &v1: tmpTbl) {
-  //  cout <<"test here";
-  //  cout <<endl <<"    ";
-  //  for (auto &v2: v1) {
-  //    cout <<"test here";
-  //    cout <<" " <<v2.first <<" " <<v2.second;
-  //  }
-  //}
-  //cout <<flush;
-
-  vector<frString> expColNames;
-  //cout <<endl <<"new expand column:";
-  for (int i = 0; i < (int)colNames.size(); i++) {
-    if (dupColNames.at(i) == 2) {
-      string name1 = colNames.at(i) + "SIDE";
-      string name2 = colNames.at(i) + "END";
-      expColNames.push_back(name1);
-      expColNames.push_back(name2);
-      //cout <<" " <<name1 <<" " <<name2;
-    } else {
-      string name = colNames.at(i);
-      expColNames.push_back(name);
-      //cout <<" " <<name;
-    };
-  }
-  
-  vector<frString> expRowNames;
-  //cout <<endl <<"new expand rows:";
-  for (int i = 0; i < (int)rowNames.size(); i++) {
-    if (dupRowNames.at(i) == 2) {
-      string name1 = rowNames.at(i) + "SIDE";
-      string name2 = rowNames.at(i) + "END";
-      expRowNames.push_back(name1);
-      expRowNames.push_back(name2);
-      //cout <<" " <<name1 <<" " <<name2;
-    } else {
-      string name = rowNames.at(i);
-      expRowNames.push_back(name);
-      //cout <<" " <<name;
-    };
-  }
-
-  vector<vector<pair<frCoord, frCoord> > > expTmpTbl;
-  for (int i = 0; i < (int)rowNames.size(); i++) {
-    vector<pair<frCoord, frCoord> > expTmpTblRow;
-    for (int j = 0; j < (int)colNames.size(); j++) {
-      expTmpTblRow.push_back(tmpTbl.at(i).at(j));
-      if (dupColNames.at(j) == 2) {
-        expTmpTblRow.push_back(tmpTbl.at(i).at(j));
-      }
-    }
-    expTmpTbl.push_back(expTmpTblRow);
-    if (dupRowNames.at(i) == 2) {
-      expTmpTbl.push_back(expTmpTblRow);
-    }
-  }
-  //cout <<"new expand table: ";
-  //for (auto &v1: expTmpTbl) {
-  //  cout <<endl <<"    ";
-  //  for (auto &v2: v1) {
-  //    cout <<" " <<v2.first <<" " <<v2.second;
-  //  }
-  //}
-
-  vector<pair<frString, int> > expColNames_helper;
-  for (int i = 0; i < (int)expColNames.size(); i++) {
-    expColNames_helper.push_back(make_pair(expColNames.at(i), i));
-  }
-  sort(expColNames_helper.begin(), expColNames_helper.end(), 
-       [](const pair<frString, int> &a, const pair<frString, int> &b) 
-       {return a.first < b.first;});
-  sort(expColNames.begin(), expColNames.end());
-
-  //cout <<endl <<"sorted expand column:";
-  //for (auto &it: expColNames_helper) {
-  //  cout <<" " <<it.first;
-  //}
-
-  vector<pair<frString, int> > expRowNames_helper;
-  for (int i = 0; i < (int)expRowNames.size(); i++) {
-    expRowNames_helper.push_back(make_pair(expRowNames.at(i), i));
-  }
-  sort(expRowNames_helper.begin(), expRowNames_helper.end(), 
-       [](const pair<frString, int> &a, const pair<frString, int> &b) 
-       {return a.first < b.first;});
-  sort(expRowNames.begin(), expRowNames.end());
-
-  //cout <<endl <<"sorted expand row:";
-  //for (auto &it: expRowNames_helper) {
-  //  cout <<" " <<it.first;
-  //}
-
-  tblVals = expTmpTbl;
-  //cout <<endl <<"sorted tbl:";
-  for (int i = 0; i < (int)expRowNames_helper.size(); i++) {
-    //cout <<endl;
-    for (int j = 0; j < (int)expColNames_helper.size(); j++) {
-      int orig_i = expRowNames_helper.at(i).second;
-      int orig_j = expColNames_helper.at(j).second;
-      tblVals.at(i).at(j) = expTmpTbl.at(orig_i).at(orig_j);
-      //cout <<" " <<tblVals.at(i).at(j).first <<" " <<tblVals.at(i).at(j).second;
-    }
-  }
-
-  string rowName("CUTCLASS");
-  string colName("CUTCLASS");
-  auto ptr = make_shared<fr2DLookupTbl<frString, frString, pair<frCoord, frCoord> > >(rowName, 
-      expRowNames, colName, expColNames, tblVals);
-  con->setCutClassTbl(ptr);
-
-  return 0;
-}
-
-// lefdef ref 2nd spacing table, no orthogonal case
-int io::Parser::getLef58CutSpacingTable_others(void *data, frLayer* tmpLayer, const string &sIn) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-
-  istringstream istr(sIn);
-  string word;
-
-  stringstream ssDefault;
-  stringstream ssLayer;    
-  stringstream ssPrl;
-  stringstream ssCutClass; 
-  
-  string keyword = "";
-  while (istr >> word) {
-    if (word == string("SPACINGTABLE")) {
-      if (enableOutput) {
-        cout <<endl <<"  SPACINGTABLE";
-      }
-    } else if (word == string("DEFAULT")) {
-      keyword = "DEFAULT";
-      ssDefault <<word;
-    } else if (word == string("SAMEMASK")) {
-      keyword = "SAMEMASK";
-    } else if (word == string("SAMENET") || word == string("SAMEMETAL") || word == string("SAMEVIA")) {
-      keyword = "SAMENETMETALVIA";
-    } else if (word == string("LAYER")) {
-      keyword = "LAYER";
-      ssLayer <<word;
-    } else if (word == string("CENTERTOCENTER")) {
-      keyword = "CENTERTOCENTER";
-    } else if (word == string("CENTERANDEDGE")) {
-      keyword = "CENTERANDEDGE";
-    } else if (word == string("PRL")) {
-      keyword = "PRL";
-      ssPrl <<"PRL";
-    } else if (word == string("PRLTWOSIDES")) {
-      keyword = "PRLTWOSIDES";
-    } else if (word == string("ENDEXTENSION")) {
-      keyword = "ENDEXTENSION";
-    } else if (word == string("EXACTALIGNEDSPACING")) {
-      keyword = "EXACTALIGNEDSPACING";
-    } else if (word == string("NONOPPOSITEENCLOSURESPACING")) {
-      keyword = "NONOPPOSITEENCLOSURESPACING";
-    } else if (word == string("OPPOSITEENCLOSURERESIZESPACING")) {
-      keyword = "OPPOSITEENCLOSURERESIZESPACING";
-    } else if (word == string("CUTCLASS")) {
-      keyword = "CUTCLASS";
-      ssCutClass <<word;
-    } else {
-      if (keyword == "DEFAULT") {
-        ssDefault <<" " <<word;
-      } else if (keyword == "CUTCLASS") {
-        ssCutClass <<" " <<word;
-      } else if (keyword == "PRL") {
-        ssPrl <<" " <<word;
-      } else if (keyword == "LAYER") {
-        ssLayer <<" " <<word;
-      } else {
-        ;
-      }
-    }
-  }
-
-  auto con = make_shared<frLef58CutSpacingTableConstraint>();
-
-  bool hasSecondLayer       = false;
-  frLayerNum secondLayerNum = 0;
-
-  bool isFirstViaLayerHavingSecondLayerNum = false;
-
-  if (ssDefault.str() != "") {
-    getLef58CutSpacingTable_default(data, tmpLayer, ssDefault.str(), con);
-  }
-  if (ssPrl.str() != "") {
-    getLef58CutSpacingTable_prl(data, tmpLayer, ssPrl.str(), con);
-  }
-  if (ssLayer.str() != "") {
-    if (tmpLayer->getLayerNum() == 1) {
-      isFirstViaLayerHavingSecondLayerNum = true;
-    } else {
-      getLef58CutSpacingTable_layer(data, tmpLayer, ssLayer.str(), con, secondLayerNum);
-    }
-  }
-  if (ssCutClass.str() != "" && !isFirstViaLayerHavingSecondLayerNum) {
-    getLef58CutSpacingTable_cutClass(data, tmpLayer, ssCutClass.str(), con, hasSecondLayer, secondLayerNum);
-  }
-
-  if (isFirstViaLayerHavingSecondLayerNum) {
-    ;
-  } else {
-    tmpLayer->lef58CutSpacingTableConstraints.push_back(con);
-    ((io::Parser*)data)->tech->addConstraint(con);
-
-    //if (ssLayer.str() == "") {
-    //  if (tmpLayer->getLayerNum() == 3) {
-    //    auto result = con->getCutClassTbl()->find(string("VxaSIDE"), string("VxaEND"));
-    //    cout <<"VxaSIDE/VxaEND " <<result.first <<" " <<result.second <<endl;
-    //    result = con->getCutClassTbl()->find(string("VxaLRGEND"), string("VxaRECTSIDE"));
-    //    cout <<"VxaLRGEND/VxaRECTSIDE " <<result.first <<" " <<result.second <<endl;
-    //  }
-    //}
-
-  }
-
-  return 0;
-}
-
-////int FlexRoute::getLef58CornerSpacing(void *data, const string &stringIn) {
-////  istringstream istr(stringIn);
-////  string word;
-////  bool hasCornerSpacing = false;
-////
-////  bool hasConvexCorner  = false;
-////  bool hasSameMask      = false;
-////  bool hasCornerOnly    = false;
-////  frUInt4 within        = 0;
-////  bool hasExceptEol     = false;
-////  frUInt4 eolWidth      = 0;
-////
-////  bool hasConcaveCorner = false;
-////  bool hasMinLength     = false;
-////  frUInt4 minLength     = 0;
-////  bool hasExceptNotch   = false;
-////  frUInt4 notchLength   = 0;
-////
-////  bool exceptSameNet   = false;
-////  bool exceptSameMetal = false;
-////
-////  bool hasWidthSpacing = false;
-////  frCollection< frCollection<frUInt4> > widthSpacing;
-////  frCollection<frUInt4> tmpWidthSpacing;
-////
-////  bool doCornerSpacing = false;
-////  bool doConvexCorner  = false;
-////  bool doConcaveCorner = false;
-////  bool doWidthSpacing  = false;
-////
-////  while (istr >> word) {
-////    //cout <<" " <<word;
-////
-////    if (word == ";") {
-////      doCornerSpacing = false;
-////      doConvexCorner  = false;
-////      doConcaveCorner = false;
-////      doWidthSpacing  = false;
-////      continue;
-////    }
-////
-////    if (!doCornerSpacing && word == "CORNERSPACING") {
-////      doCornerSpacing = true;
-////      hasCornerSpacing = true;
-////      cout <<"CORNERSPACING";
-////      continue;
-////    }
-////    if (doCornerSpacing &&  word == "CONVEXCORNER") {
-////      doConvexCorner  = true;
-////      hasConvexCorner = true;
-////      doConcaveCorner = false;
-////      doWidthSpacing  = false;
-////      cout <<endl <<"  CONVEXCORNER";
-////      continue;
-////    }
-////    if (doCornerSpacing &&  word == "CONCAVECORNER") {
-////      doConvexCorner  = false;
-////      doConcaveCorner = true;
-////      hasConcaveCorner = true;
-////      doWidthSpacing  = false;
-////      cout <<endl <<"  CONCAVECORNER";
-////      continue;
-////    }
-////
-////    if (doCornerSpacing &&  word == "EXCEPTSAMENET") {
-////      doConvexCorner  = false;
-////      doConcaveCorner = false;
-////      doWidthSpacing  = false;
-////      exceptSameNet   = true;
-////      cout <<endl <<"  EXCEPTSAMENET";
-////      continue;
-////    }
-////    
-////    if (doCornerSpacing &&  word == "EXCEPTSAMEMETAL") {
-////      doConvexCorner  = false;
-////      doConcaveCorner = false;
-////      doWidthSpacing  = false;
-////      exceptSameMetal = true;
-////      cout <<endl <<"  EXCEPTSAMEMETAL";
-////      continue;
-////    }
-////
-////    if (doCornerSpacing &&  word == "WIDTH") {
-////      doConvexCorner  = false;
-////      doConcaveCorner = false;
-////      doWidthSpacing  = true;
-////      hasWidthSpacing = true;
-////      if (!tmpWidthSpacing.empty()) {
-////        widthSpacing.push_back(tmpWidthSpacing);
-////      }
-////      tmpWidthSpacing.clear();
-////      cout <<endl <<"  WIDTH";
-////      continue;
-////    }
-////    
-////    if (doConvexCorner && word == "SAMEMASK") {
-////      hasSameMask = true;
-////      cout <<" SAMEMASK";
-////    }
-////    if (doConvexCorner && word == "CORNERONLY") {
-////      hasCornerOnly = true;
-////      double tmpWithin;
-////      istr >> tmpWithin;
-////      within = round(tmpWithin * ((FlexRoute*)data)->units);
-////      cout <<endl <<"    CORNERONLY " <<within * 1.0 / ((FlexRoute*)data)->units;
-////    }
-////    // currently do not support EXCEPTJOGLENGTH
-////    if (doConvexCorner && word == "EXCEPTEOL") {
-////      hasExceptEol = true;
-////      double tmpEolWidth;
-////      istr >> tmpEolWidth;
-////      eolWidth = round(tmpEolWidth * ((FlexRoute*)data)->units);
-////      cout <<endl <<"    EXCEPTEOL " <<eolWidth * 1.0 / ((FlexRoute*)data)->units;
-////    }
-////    
-////    if (doConcaveCorner && word == "MINLENGTH") {
-////      hasMinLength = true;
-////      double tmpMinLength;
-////      istr >> tmpMinLength;
-////      minLength = round(tmpMinLength * ((FlexRoute*)data)->units);
-////      cout <<endl <<"    MINLENGTH " <<minLength * 1.0 / ((FlexRoute*)data)->units;
-////    }
-////    if (doConcaveCorner && word == "EXCEPTNOTCH") {
-////      hasExceptNotch = true;
-////      double tmpNotchLength;
-////      istr >> tmpNotchLength;
-////      notchLength = round(tmpNotchLength * ((FlexRoute*)data)->units);
-////      cout <<endl <<"    EXCEPTNOTCH " <<notchLength * 1.0 / ((FlexRoute*)data)->units;
-////    }
-////
-////    if (doWidthSpacing &&  word == "SPACING") {
-////      cout <<" SPACING";
-////      continue;
-////    }
-////
-////    if (doWidthSpacing &&  word != "SPACING") {
-////      frUInt4 tmp = round(stod(word) * ((FlexRoute*)data)->units);
-////      tmpWidthSpacing.push_back(tmp);
-////      cout <<" " <<tmp * 1.0 / ((FlexRoute*)data)->units;
-////      continue;
-////    }
-////
-////  }
-////
-////  if (!tmpWidthSpacing.empty()) {
-////    widthSpacing.push_back(tmpWidthSpacing);
-////  }
-////
-////  cout <<endl;
-////  return 0;
-////}
-
-int io::Parser::getLefLayers(lefrCallbackType_e type, lefiLayer* layer, lefiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //bool enableDoubleCheck = true;
-  //bool enableDoubleCheck = false;
-  if (type != lefrLayerCbkType) {
-    cout <<"Type is not lefrLayerCbkType!" <<endl;
-    exit(1);
-  }
-  unique_ptr<frLayer> uLayer = make_unique<frLayer>();
-  auto tmpLayer = uLayer.get();
-
-  if (!strcmp(layer->type(), "ROUTING")) {
-    if (enableOutput) {
-      cout <<"LAYER "       <<layer->name() <<endl;
-      cout <<"  TYPE      " <<layer->type() <<endl;
-      cout <<"  DIRECTION " <<layer->direction() <<endl;
-      //cout <<"  MINWIDTH  " <<layer->minwidth() <<endl;
-      cout <<"  AREA      " <<layer->area() <<endl;
-      cout <<"  WIDTH     " <<layer->width() <<endl;
-    }
-    tmpLayer->setLayerNum(((io::Parser*)data)->readLayerCnt++);
-    tmpLayer->setName(layer->name());
-    tmpLayer->setWidth(round(layer->width() * ((io::Parser*)data)->tech->getDBUPerUU()));
-    if (layer->hasMinwidth()) {
-      tmpLayer->setMinWidth(round(layer->minwidth() * ((io::Parser*)data)->tech->getDBUPerUU()));
-    } else {
-      tmpLayer->setMinWidth(tmpLayer->getWidth());
-    }
-    // add minWidth constraint
-    auto minWidthConstraint = make_unique<frMinWidthConstraint>(tmpLayer->getMinWidth());
-    tmpLayer->setMinWidthConstraint(minWidthConstraint.get());
-    unique_ptr<frConstraint> minWidthTempPtr = std::move(minWidthConstraint);
-    ((io::Parser*)data)->tech->addUConstraint(minWidthTempPtr);
-    //tmpLayer->addConstraint(minWidthConstraint);
-
-    tmpLayer->setType(frLayerTypeEnum::ROUTING);
-    //tmpLayer.idx        = ((FlexRoute*)data)->readLayerCnt;
-    //tmpLayer.layerName  = layer->name();
-    //tmpLayer.type       = layer->type();
-    if (!strcmp(layer->direction(), "HORIZONTAL")) {
-      tmpLayer->setDir(frcHorzPrefRoutingDir);
-    } else if (!strcmp(layer->direction(), "VERTICAL")) {
-      tmpLayer->setDir(frcVertPrefRoutingDir);
-    }
-    tmpLayer->setPitch(round(layer->pitch() * ((io::Parser*)data)->tech->getDBUPerUU()));
-
-    // Add short rule for every layer
-    auto shortConstraint = make_unique<frShortConstraint>();
-    tmpLayer->setShortConstraint(shortConstraint.get());
-    unique_ptr<frConstraint> shortTempPtr = std::move(shortConstraint);
-    //std::cout << "add shortConstraint to layer " <<tmpLayer->getName() << "\n";
-    ((io::Parser*)data)->tech->addUConstraint(shortTempPtr);
-    //tmpLayer->addConstraint(shortConstraint);
-
-
-    //cout <<"number of props " <<layer->numProps() <<endl;
-    for (int i = 0; i < layer->numProps(); i++) {
-      if (string(layer->propName(i)) == string("LEF58_PROTRUSIONWIDTH") ||
-          string(layer->propName(i)) == string("LEF58_MINSTEP") ||
-          string(layer->propName(i)) == string("LEF58_ENCLOSURESPACING") ||
-          string(layer->propName(i)) == string("LEF58_VOLTAGESPACING") ||
-          string(layer->propName(i)) == string("LEF58_ANTENNAGATEPLUSDIFF") ||
-          string(layer->propName(i)) == string("LEF58_ANTENNAGATEPWL") ||
-          string(layer->propName(i)) == string("LEF58_ANTENNAGATEPWL") ||
-          string(layer->propName(i)) == string("LEF58_FORBIDDENSPACING") 
-         ) {
-        ;
-      } else {
-        //cout <<"name:     " <<layer->propName(i) <<endl;
-        //cout <<"value:    " <<layer->propValue(i) <<endl;
-        //cout <<"number:   " <<layer->propNumber(i) <<endl;
-        //cout <<"type:     " <<layer->propType(i) <<endl;
-        //cout <<"isNumber: " <<layer->propIsNumber(i) <<endl;
-        //cout <<"isString: " <<layer->propIsString(i) <<endl;
-        //if (!strcmp(layer->propName(i), "LEF58_CORNERSPACING") && layer->propIsString(i)) {
-        //  //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-        //  getLef58CornerSpacing(data, layer->propValue(i));
-        //}
-        if (!strcmp(layer->propName(i), "LEF58_SPACING") && layer->propIsString(i)) {
-          //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-          //cout <<"name:     " <<layer->propName(i) <<endl;
-          //cout <<"value:    " <<layer->propValue(i) <<endl;
-          getLef58Spacing(data, tmpLayer, layer->propValue(i));
-        } else if (!strcmp(layer->propName(i), "LEF57_SPACING") && layer->propIsString(i)) {
-          getLef58Spacing(data, tmpLayer, layer->propValue(i));
-        } else if (!strcmp(layer->propName(i), "LEF58_SPACINGTABLE") && layer->propIsString(i)) {
-          //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-          //cout <<"name:     " <<layer->propName(i) <<endl;
-          //cout <<"value:    " <<layer->propValue(i) <<endl;
-          getLef58SpacingTable(data, tmpLayer, layer->propValue(i));
-        } else {
-          //cout <<"  name:     " <<layer->propName(i) <<endl;
-        }
-      }
-    }
-
-    // read minArea rule
-    if (layer->hasArea()) {
-      frCoord minArea = frCoord(round(layer->area() * ((io::Parser*)data)->tech->getDBUPerUU() * ((io::Parser*)data)->tech->getDBUPerUU()));
-      unique_ptr<frConstraint> uCon = make_unique<frAreaConstraint>(minArea);
-      auto rptr = static_cast<frAreaConstraint*>(uCon.get());
-      ((io::Parser*)data)->tech->addUConstraint(uCon);
-      //std::cout << "Add minArea constraint to " << tmpLayer->getName() << "\n";
-      tmpLayer->setAreaConstraint(rptr);
-    }
-
-    if (layer->hasMinstep()) {
-      if (layer->numMinstep() > 1) {
-        std::cout << "ERROR: only one minStep rule should be defined for a given layer. Only the last one is checked\n";
-      }
-      for (int i = 0; i < layer->numMinstep(); ++i) {
-        unique_ptr<frConstraint> uCon = make_unique<frMinStepConstraint>();
-        auto rptr = static_cast<frMinStepConstraint*>(uCon.get());
-        if (layer->hasMinstepType(i)) {
-          if (strcmp(layer->minstepType(i), "INSIDECORNER") == 0) {
-            rptr->setInsideCorner(true);
-            rptr->setOutsideCorner(false);
-            rptr->setStep(false);
-          } else if (strcmp(layer->minstepType(i), "OUTSIDECORNER") == 0) {
-            rptr->setInsideCorner(false);
-            rptr->setOutsideCorner(true);
-            rptr->setStep(false);
-          } else if (strcmp(layer->minstepType(i), "STEP") == 0) {
-            rptr->setInsideCorner(false);
-            rptr->setOutsideCorner(false);
-            rptr->setStep(true);
-          }
-        }
-        if (layer->hasMinstepLengthsum(i)) {
-          rptr->setMaxLength(frCoord(layer->minstepLengthsum(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-        }
-        if (layer->hasMinstepMaxedges(i)) {
-          rptr->setMaxEdges(layer->minstepMaxedges(i));
-        }
-        rptr->setMinStepLength(layer->minstep(i) * ((io::Parser*)data)->tech->getDBUPerUU());
-        ((io::Parser*)data)->tech->addUConstraint(uCon);
-        //std::cout << "Add minStep constraint to " << tmpLayer->getName() << "\n";
-        tmpLayer->setMinStepConstraint(rptr);
-      }
-    }
-
-    // read spacing rule
-    for (int i = 0; i < layer->numSpacing(); ++i) {
-      //std::shared_ptr<frSpacingConstraint> minSpacingCosntraint;
-      frCoord minSpacing = frCoord(round(layer->spacing(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-      // minSpacingCosntraint = make_shared<frMinSpacingConstraint>(minSpacing);
-      if (layer->hasSpacingRange(i)) {
-        cout <<" WARNING: hasSpacing Range unsupported" <<endl;
-      } else if (layer->hasSpacingLengthThreshold(i)) {
-        cout <<" WARNING: hasSpacingLengthThreshold unsupported" <<endl;
-      } else if (layer->hasSpacingEndOfLine(i)) {
-        // new
-        unique_ptr<frConstraint> uCon = make_unique<frSpacingEndOfLineConstraint>();
-        auto rptr = static_cast<frSpacingEndOfLineConstraint*>(uCon.get());
-        if (enableOutput) {
-          cout <<"  SPACING " <<layer->spacing(i) <<" ENDOFLINE " <<layer->spacingEolWidth(i)
-               <<" WITHIN " <<layer->spacingEolWithin(i);
-        }
-        frCoord eolWidth = frCoord(round(layer->spacingEolWidth(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-        frCoord eolWithin = frCoord(round(layer->spacingEolWithin(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-        rptr->setMinSpacing(minSpacing);
-        rptr->setEolWidth(eolWidth);
-        rptr->setEolWithin(eolWithin);
-        if (layer->hasSpacingParellelEdge(i)) {
-          if (enableOutput) {
-            cout <<" PARALLELEDGE " <<layer->spacingParSpace(i) <<" WITHIN " <<layer->spacingParWithin(i);
-            if (layer->hasSpacingTwoEdges(i)) {
-              cout <<" TWOEDGES";
-            }
-          }
-          frCoord parSpace = frCoord(round(layer->spacingParSpace(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          frCoord parWithin = frCoord(round(layer->spacingParWithin(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          rptr->setParSpace(parSpace);
-          rptr->setParWithin(parWithin);
-          rptr->setTwoEdges(layer->hasSpacingTwoEdges(i));
-        }
-        if (enableOutput) {
-          cout <<" ;" <<endl;
-        }
-        ((io::Parser*)data)->tech->addUConstraint(uCon);
-        tmpLayer->addEolSpacing(rptr);
-        
-        // double check
-        //if (enableDoubleCheck) {
-        //  cout <<"@ SPACING " <<minSpacing <<" ENDOFLINE " <<eolWidth <<" WITHIN " <<eolWithin;
-        //  if (rptr->hasParallelEdge()) {
-        //    cout <<" PARALLELEDGE " <<rptr->getParSpace();
-        //    cout <<" WITHIN " <<rptr->getParSpace();
-        //    if (rptr->hasTwoEdges()) {
-        //      cout <<" TWOEDGES";
-        //    }
-        //  }
-        //  cout <<" ;" <<endl;
-        //  cout <<"eol size = " <<tmpLayer->getEolSpacing().size() <<endl;
-        //}
-      } else if (layer->hasSpacingSamenet(i)) {
-        cout <<" WARNING: hasSpacingSamenet unsupported" <<endl;
-      } else if (layer->hasSpacingNotchLength(i)) {
-        cout <<" WARNING: hasSpacingNotchLength unsupported" <<endl;
-      } else if (layer->hasSpacingEndOfNotchWidth(i)) {
-        cout <<" WARNING: hasSpacingEndOfNotchWidth unsupported" <<endl;
-      } else { // min spacing
-        // old
-        if (enableOutput) {
-          cout <<"  SPACING " <<layer->spacing(i) <<" ;" <<endl;
-        }
-        //auto spacingConstraint = make_shared<frSpacingConstraint>(minSpacing);
-        //((io::Parser*)data)->tech->addConstraint(spacingConstraint);
-        //tmpLayer->addConstraint(spacingConstraint);
-        // new
-        unique_ptr<frConstraint> uCon = make_unique<frSpacingConstraint>(minSpacing);
-        auto rptr = uCon.get();
-        ((io::Parser*)data)->tech->addUConstraint(uCon);
-        tmpLayer->setMinSpacing(rptr);
-      }
-    }
-
-    // read spacingTable
-    for (int i = 0; i < layer->numSpacingTable(); ++i) {
-      // old
-      std::shared_ptr<frSpacingTableConstraint> spacingTableConstraint;
-      auto spTable = layer->spacingTable(i);
-      if (spTable->isInfluence()) {
-        cout <<" WARNING: SPACINGTABLE INFLUENCE unsupported" <<endl;
-      } else if (spTable->isParallel()) {
-        // old
-        shared_ptr<fr2DLookupTbl<frCoord, frCoord, frCoord> > prlTbl;
-        auto parallel = spTable->parallel();
-        frCollection<frCoord> rowVals, colVals;
-        frCollection<frCollection<frCoord> > tblVals;
-        frCollection<frCoord> tblRowVals;
-        frString rowName("WIDTH"), colName("PARALLELRUNLENGTH");
-        if (enableOutput) {
-          cout <<"  SPACINGTABLE" <<endl;
-          cout <<"  PARALLELRUNLENGTH";
-        }
-        for (int j = 0; j < parallel->numLength(); ++j) {
-          frCoord prl = frCoord(round(parallel->length(j) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          if (enableOutput) {
-            cout <<" " <<prl * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-          }
-          colVals.push_back(prl);
-        }
-        for (int j = 0; j < parallel->numWidth(); ++j) {
-          frCoord width = frCoord(round(parallel->width(j) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          rowVals.push_back(width);
-          if (enableOutput) {
-            cout <<endl <<"  WIDTH " <<width * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-          }
-          tblRowVals.clear();
-          for (int k = 0; k < parallel->numLength(); ++k) {
-            //frCoord prl = frCoord(round(parallel->length(k) * ((io::Parser*)data)->tech->getDBUPerUU()));
-            frCoord spacing = frCoord(round(parallel->widthSpacing(j, k) * ((io::Parser*)data)->tech->getDBUPerUU()));
-            tblRowVals.push_back(spacing);
-            if (enableOutput) {
-              cout <<" " <<spacing * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-            }
-          }
-          tblVals.push_back(tblRowVals);
-        }
-        if (enableOutput) {
-          cout <<" ;" <<endl;
-        }
-        // old
-        prlTbl = make_shared<fr2DLookupTbl<frCoord, frCoord, frCoord> >(rowName, rowVals, colName, colVals, tblVals);
-        spacingTableConstraint = make_shared<frSpacingTableConstraint>(prlTbl);
-        ((io::Parser*)data)->tech->addConstraint(spacingTableConstraint);
-        tmpLayer->addConstraint(spacingTableConstraint);
-        //if (tmpLayer->getLayerNum() == 2) {
-        //  prlTbl->printTbl();
-        //  cout <<"should crash here" <<flush <<prlTbl->find(140, 160) <<flush <<endl;
-        //  exit(0);
-        //}
-
-        // new
-        unique_ptr<frConstraint> uCon = make_unique<frSpacingTablePrlConstraint>(fr2DLookupTbl(rowName, rowVals, colName, colVals, tblVals));
-        auto rptr = static_cast<frSpacingTablePrlConstraint*>(uCon.get());
-        //cout <<"@test " <<rptr->find(0.47*2000, 0.47*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.47*2000, 0.48*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.46*2000, 0.48*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.47*2000, 0.46*2000) / 2000.0 <<endl;
-        ((io::Parser*)data)->tech->addUConstraint(uCon);
-        tmpLayer->setMinSpacing(rptr);
-      } else { // two width spacing rule
-        auto tw = spTable->twoWidths();
-        //bool hasPrl = false;
-        frCoord defaultPrl = -abs(frCoord(round(tw->widthSpacing(0,0) * ((io::Parser*)data)->tech->getDBUPerUU())));
-        //cout <<"default prl: " <<defaultPrl <<endl;
-        frCollection<frSpacingTableTwRowType> rowVals, colVals;
-        frCollection<frCollection<frCoord> > tblVals;
-        frCollection<frCoord> tblRowVals;
-        frString rowName("WIDTH1PRL"), colName("WIDTH2PRL");
-        if (enableOutput) {
-          cout <<"  SPACINGTABLE TWOWIDTHS";
-        }
-        for (int j = 0; j < tw->numWidth(); ++j) {
-          frCoord width = frCoord(round(tw->width(j) * ((io::Parser*)data)->tech->getDBUPerUU()));
-          frCoord prl   = defaultPrl;
-          if (enableOutput) {
-            cout <<endl <<"    WIDTH " <<tw->width(j);
-          }
-          if (tw->hasWidthPRL(j)) {
-            if (enableOutput) {
-              cout <<" PRL " <<tw->widthPRL(j);
-            }
-            prl = frCoord(round(tw->widthPRL(j) * ((io::Parser*)data)->tech->getDBUPerUU()));
-            defaultPrl = prl;
-            //hasPrl = true;
-          } else {
-            //if (!hasPrl) {
-            //  defaultPrl = -abs(frCoord(round(tw->widthSpacing(j,0) * ((io::Parser*)data)->tech->getDBUPerUU())));
-            //  prl = defaultPrl;
-            //}
-          }
-          colVals.push_back(frSpacingTableTwRowType(width, prl));
-          rowVals.push_back(frSpacingTableTwRowType(width, prl));
-          tblRowVals.clear();
-          for (int k = 0; k < tw->numWidthSpacing(j); k++) {
-            if (enableOutput) {
-              cout <<" " <<tw->widthSpacing(j, k);
-            }
-            frCoord spacing = frCoord(round(tw->widthSpacing(j, k) * ((io::Parser*)data)->tech->getDBUPerUU()));
-            tblRowVals.push_back(spacing);
-          }
-          tblVals.push_back(tblRowVals);
-        }
-        if (enableOutput) {
-          cout <<" ;" <<endl;
-        }
-        unique_ptr<frConstraint> uCon = make_unique<frSpacingTableTwConstraint>(fr2DLookupTbl(rowName, rowVals, colName, colVals, tblVals));
-        auto rptr = static_cast<frSpacingTableTwConstraint*>(uCon.get());
-        //cout <<"@test " <<rptr->find(0.156*2000, 0.072*2000, 0.000*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.156*2000, 0.156*2000, 0.000*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.209*2000, 0.072*2000, 0.300*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.209*2000, 0.156*2000, 0.300*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.000*2000, 0.000*2000, -0.001*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.000*2000, 0.000*2000, 0.000*2000) / 2000.0 <<endl;
-        //cout <<"@test " <<rptr->find(0.000*2000, 0.000*2000, 0.300*2000) / 2000.0 <<endl;
-        ((io::Parser*)data)->tech->addUConstraint(uCon);
-        tmpLayer->setMinSpacing(rptr);
-        //vector<int> tttttest = {0,1,2,3,4,5,6,7};
-        //auto it1 = upper_bound(tttttest.begin(), tttttest.end(), -1);
-        //--it1;
-        //auto it2 = upper_bound(tttttest.begin(), tttttest.end(), 3);
-        //--it2;
-        //cout <<"dist1: " <<distance(tttttest.begin(), it1) <<endl;
-        //cout <<"dist2: " <<distance(tttttest.begin(), it2) <<endl;
-
-      }
-    }
-    
-
-    ((io::Parser*)data)->tech->addLayer(uLayer);
-  } else if (strcmp(layer->type(), "CUT") == 0 && ((io::Parser*)data)->readLayerCnt > 0) {
-    //cout <<"LAYER " <<layer->name() <<endl <<flush;
-    if (enableOutput) {
-      cout <<"LAYER "       <<layer->name() <<endl;
-      cout <<"  TYPE      " <<layer->type() <<endl;
-    }
-    tmpLayer->setLayerNum(((io::Parser*)data)->readLayerCnt++);
-    tmpLayer->setName(layer->name());
-    tmpLayer->setType(frLayerTypeEnum::CUT);
-    //tmpLayer.idx        = ((FlexRoute*)data)->readLayerCnt;
-    //tmpLayer.layerName  = layer->name();
-    //tmpLayer.type       = layer->type();
-    //if (layer->numSpacing() > 1) {
-    //  cout << "NumSpacing = " << layer->numSpacing() << endl;
-    //  tmpLayer.minSpacing = 0;
-    //  // cout <<"Unsupported CUT spacing!!!" <<endl;
-    //  // exit(2);
-    //}
-    //// TODO: need to handle multiple spacing rules
-    //for (int i = 0; i < layer->numSpacing(); ++i) {
-    //  if (layer->hasSpacingAdjacent(i)) {
-    //    cout <<"  SPACING " <<layer->spacing(i) <<" ADJACENTCUTS " <<layer->spacingAdjacentCuts(i)
-    //         <<" WITHIN " <<layer->spacingAdjacentWithin(i) <<endl;
-    //  } else {
-    //    tmpLayer.minSpacing = max(tmpLayer.minSpacing, loc_t(round(layer->spacing(i)* ((FlexRoute*)data)->units)));
-    //    cout <<"  SPACING " <<layer->spacing(i) <<endl;
-    //  }
-    //}
-    //((FlexRoute*)data)->layers.push_back(tmpLayer);
-    //
-    //((FlexRoute*)data)->layer2Idx[tmpLayer.layerName] = tmpLayer.idx;
-    //
-    //++(((FlexRoute*)data)->readLayerCnt);
-
-    auto shortConstraint = make_shared<frShortConstraint>();
-    std::cout << "add shortConstraint to layer " <<tmpLayer->getName() << "\n";
-    ((io::Parser*)data)->tech->addConstraint(shortConstraint);
-    tmpLayer->addConstraint(shortConstraint);
-    tmpLayer->setShortConstraint(shortConstraint.get());
-
-    // read spacing constraint
-    for (int i = 0; i < layer->numSpacing(); ++i) {
-      std::shared_ptr<frCutSpacingConstraint> cutSpacingConstraint;
-      frCoord cutArea = frCoord(round(layer->spacingArea(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-      frCoord cutSpacing = frCoord(round(layer->spacing(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-      bool centerToCenter = layer->hasSpacingCenterToCenter(i);
-      bool sameNet = layer->hasSpacingSamenet(i);
-      bool stack = layer->hasSpacingLayerStack(i);
-      bool exceptSamePGNet = layer->hasSpacingSamenetPGonly(i);
-      bool parallelOverlap = layer->hasSpacingParallelOverlap(i);
-      frString secondLayerName;
-      int adjacentCuts = layer->spacingAdjacentCuts(i);
-      frCoord cutWithin = frCoord(round(layer->spacingAdjacentWithin(i) * ((io::Parser*)data)->tech->getDBUPerUU()));
-
-      // std::cout << cutSpacing << " " << centerToCenter << " " << sameNet << " " << stack << " " << exceptSamePGNet 
-      //           << " " << parallelOverlap << " " << secondLayerName << " " << adjacentCuts << " " << cutWithin << "\n";
-
-      // std::cout << "raw cutArea = " << layer->spacingArea(i) << "\n";
-      // std::cout << "cutArea = " << cutArea << "\n";
-      // initialize for invalid variables
-      cutArea = (cutArea == 0) ? -1 : cutArea;
-      cutWithin = (cutWithin == 0) ? -1 : cutWithin;
-      adjacentCuts = (adjacentCuts == 0) ? -1 : adjacentCuts;
-      // std::cout << "cutArea = " << cutArea << "\n";
-
-
-      // if (layer->hasSpacingAdjacent(i)) {
-
-      // } else {
-
-      // }
-
-      cutSpacingConstraint = make_shared<frCutSpacingConstraint>(cutSpacing,
-                                                              centerToCenter, 
-                                                              sameNet, 
-                                                              secondLayerName, 
-                                                              stack,
-                                                              adjacentCuts,
-                                                              cutWithin,
-                                                              exceptSamePGNet,
-                                                              parallelOverlap,
-                                                              cutArea);
-
-      ((io::Parser*)data)->tech->addConstraint(cutSpacingConstraint);
-      tmpLayer->addConstraint(cutSpacingConstraint);
-      tmpLayer->addCutConstraint(cutSpacingConstraint.get());
-
-    }
-
-    // lef58
-    //cout <<"number of props " <<layer->numProps() <<endl;
-    for (int i = 0; i < layer->numProps(); i++) {
-      if (string(layer->propName(i)) == string("LEF58_ENCLOSUREEDGE") ||
-          string(layer->propName(i)) == string("LEF58_ENCLOSURE") ||
-          string(layer->propName(i)) == string("LEF58_ENCLOSURETABLE")
-         ) {
-        ;
-      } else {
-        //cout <<"name:     " <<layer->propName(i) <<endl;
-        //cout <<"value:    " <<layer->propValue(i) <<endl;
-        //cout <<"number:   " <<layer->propNumber(i) <<endl;
-        //cout <<"type:     " <<layer->propType(i) <<endl;
-        //cout <<"isNumber: " <<layer->propIsNumber(i) <<endl;
-        //cout <<"isString: " <<layer->propIsString(i) <<endl;
-        //if (!strcmp(layer->propName(i), "LEF58_CORNERSPACING") && layer->propIsString(i)) {
-        //  //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-        //  getLef58CornerSpacing(data, layer->propValue(i));
-        //}
-        if (!strcmp(layer->propName(i), "LEF58_CUTCLASS") && layer->propIsString(i)) {
-          //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-          //cout <<"name:     " <<layer->propName(i) <<endl;
-          //cout <<"value:    " <<layer->propValue(i) <<endl;
-          getLef58CutClass(data, tmpLayer, layer->propValue(i));
-        } else if (!strcmp(layer->propName(i), "LEF58_SPACING") && layer->propIsString(i)) {
-          //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-          //cout <<"name:     " <<layer->propName(i) <<endl;
-          //cout <<"value:    " <<layer->propValue(i) <<endl;
-          getLef58CutSpacing(data, tmpLayer, layer->propValue(i));
-        } else if (!strcmp(layer->propName(i), "LEF58_SPACINGTABLE") && layer->propIsString(i)) {
-          //cout <<"start parsing LEF58_CORNERSPACING" <<endl;
-          //cout <<"name:     " <<layer->propName(i) <<endl;
-          //cout <<"value:    " <<layer->propValue(i) <<endl;
-          getLef58CutSpacingTable(data, tmpLayer, layer->propValue(i));
-        } else {
-          cout <<"  name:     " <<layer->propName(i) <<endl;
-        }
-      }
-    }
-    ((io::Parser*)data)->tech->addLayer(uLayer);
-  } else {
-    ;
-  }
-
-  return 0;
-}
-
-int io::Parser::getLefMacros(lefrCallbackType_e type, lefiMacro* macro, lefiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if ((type != lefrMacroCbkType)) {
-    cout <<"Type is not lefrMacroCbkType!" <<endl;
-    exit(2);
-  }
-
-  frCoord originX = round(macro->originX() * ((io::Parser*)data)->tech->getDBUPerUU()); 
-  frCoord originY = round(macro->originY() * ((io::Parser*)data)->tech->getDBUPerUU());
-  frCoord sizeX   = round(macro->sizeX()   * ((io::Parser*)data)->tech->getDBUPerUU());
-  frCoord sizeY   = round(macro->sizeY()   * ((io::Parser*)data)->tech->getDBUPerUU());
-  if (enableOutput) {
-    cout <<"  ORIGIN " <<originX * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                       <<originY * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" ;" <<endl;
-    cout <<"  SIZE   " <<sizeX   * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                       <<sizeY   * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" ;" <<endl;
-  }
-  vector<frBoundary> bounds;
-  frBoundary bound;
-  vector<frPoint> points;
-  points.push_back(frPoint(originX, originY));
-  points.push_back(frPoint(sizeX,   originY));
-  points.push_back(frPoint(sizeX,   sizeY));
-  points.push_back(frPoint(originX, sizeY));
-  bound.setPoints(points);
-  bounds.push_back(bound);
-  //((io::Parser*)data)->tmpBlock->setBBox(frBox(originX, originY, sizeX, sizeY));
-  ((io::Parser*)data)->tmpBlock->setBoundaries(bounds);
-
-  if (enableOutput) {
-    if (macro->hasClass()) {
-      std::cout << macro->macroClass() << "\n";
-    }
-  }
-  if (macro->hasClass()) {
-    if (strcmp(macro->macroClass(), "CORE") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE);
-    } else if (strcmp(macro->macroClass(), "CORE TIEHIGH") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE_TIEHIGH);
-    } else if (strcmp(macro->macroClass(), "CORE TIELOW") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE_TIELOW);
-    } else if (strcmp(macro->macroClass(), "CORE WELLTAP") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE_WELLTAP);
-    } else if (strcmp(macro->macroClass(), "CORE SPACER") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE_SPACER);
-    } else if (strcmp(macro->macroClass(), "CORE ANTENNACELL") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::CORE_ANTENNACELL);
-    } else if (strcmp(macro->macroClass(), "ENDCAP PRE") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::ENDCAP_PRE);
-    } else if (strcmp(macro->macroClass(), "BLOCK") == 0) {
-      ((io::Parser*)data)->tmpBlock->setMacroClass(MacroClassEnum::BLOCK);
-    } else {
-      cout << "Warning: unknown macroClass " << macro->macroClass() << ", skipped macroClass property\n"; 
-    }
-  }
-
-
-  return 0;
-}
-
-int io::Parser::getLefPins(lefrCallbackType_e type, lefiPin* pin, lefiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (type != lefrPinCbkType) {
-    cout <<"Type is not lefrPinCbkType!" <<endl;
-    exit(1);
-  }
-
-  // term
-  unique_ptr<frTerm>         uTerm = make_unique<frTerm>(pin->name());
-  auto term = uTerm.get();
-  term->setId(((io::Parser*)data)->numTerms);
-  ((io::Parser*)data)->numTerms++;
-  // term should add pin
-  // instTerm
-  //shared_ptr<frInstTerm> instTerm = make_shared<frInstTerm>();
-  //instTerm->addToInst(((FlexRoute*)data)->tmpMacro);
-  //instTerm->addTerm(term);
-  // instTerm creation completed
-
-  // inst 
-  ((io::Parser*)data)->tmpBlock->addTerm(uTerm);
-  // inst completed
-
-  
-  if (enableOutput) {
-    cout <<"  PIN " <<pin->name() <<endl;
-  }
-  
-  frTermEnum termType = frTermEnum::frcNormalTerm;
-  if (pin->hasUse()) {
-    string str(pin->use());
-    if (str == "SIGNAL") {
-      ;
-    } else if (str == "CLOCK") {
-      termType = frTermEnum::frcClockTerm;
-    } else if (str == "POWER") {
-      termType = frTermEnum::frcPowerTerm;
-    } else if (str == "GROUND") {
-      termType = frTermEnum::frcGroundTerm;
-    } else {
-      cout <<"Error: unsupported PIN USE in lef" <<endl;
-      exit(1);
-    }
-    if (enableOutput) {
-      cout <<"    USE " <<str <<" ;" <<endl;
-    }
-  }
-  term->setType(termType);
-
-  int numPorts = pin->numPorts();
-  int numItems = 0;
-  int itemType = 0;
-  // cout <<"pin->numPorts: " <<numPorts <<endl;
-  for (int i = 0; i < numPorts; ++i) {
-    numItems = pin->port(i)->numItems();
-    // cout <<"pin->ports(" <<i <<")->numItems: " <<numItems <<endl;
-    if (enableOutput) {
-      cout <<"    PORT" <<endl;
-    }
-
-    // pin
-    auto pinIn = make_unique<frPin>();
-    pinIn->setId(i);
-    //pinIn->setTerm(term);
-    // pin should add pinFigs
-
-    // term
-
-    frLayerNum layerNum = 0;
-    for (int j = 0; j < numItems; ++j) {
-      itemType = pin->port(i)->itemType(j);
-      if (itemType == 1) {
-        string layer = pin->port(i)->getLayer(j);
-        if (((io::Parser*)data)->tech->name2layer.find(layer) == ((io::Parser*)data)->tech->name2layer.end()) {
-          if (VERBOSE > -1) {
-            cout <<"Warning: layer " <<layer <<" is skipped for " <<((io::Parser*)data)->tmpBlock->getName() <<"/" <<pin->name() <<endl;
-          }
-          continue;
-        }
-
-        layerNum = ((io::Parser*)data)->tech->name2layer.at(layer)->getLayerNum();
-        //cout <<"  layer: " <<pin->port(i)->getLayer(j) <<endl;
-        if (enableOutput) {
-          cout <<"    LAYER " <<layer <<" ;" <<endl;
-        }
-        //cout <<"    LAYERNUM " <<layerNum <<" ;" <<endl;
-      } else if (itemType == 8) {
-        frCoord xl = round(pin->port(i)->getRect(j)->xl * ((io::Parser*)data)->tech->getDBUPerUU());
-        frCoord yl = round(pin->port(i)->getRect(j)->yl * ((io::Parser*)data)->tech->getDBUPerUU());
-        frCoord xh = round(pin->port(i)->getRect(j)->xh * ((io::Parser*)data)->tech->getDBUPerUU());
-        frCoord yh = round(pin->port(i)->getRect(j)->yh * ((io::Parser*)data)->tech->getDBUPerUU());
-
-        // pinFig
-        //shared_ptr<frPinFig> pinFig = make_shared<frRect>();
-        unique_ptr<frRect> pinFig = make_unique<frRect>();
-        pinFig->setBBox(frBox(xl, yl, xh, yh));
-        pinFig->addToPin(pinIn.get());
-        pinFig->setLayerNum(layerNum);
-        // pinFig completed
-        // pin
-        unique_ptr<frPinFig> uptr(std::move(pinFig));
-        pinIn->addPinFig(uptr);
-        Rectangle pinFigRect(xl, yl, xh, yh);
-        // std::cout << "(" << xl << ", " << yl << ") -- (" << xh << ", " << yh << ")\n";
-        pinIn->addLayerShape(layerNum, pinFigRect);
-        // pin completed
-
-        if (enableOutput) {
-          cout <<"      RECT " <<xl * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                               <<yl * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                               <<xh * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                               <<yh * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" ;" <<endl;
-        }
-             
-      } else if (itemType == 10) {
-        //Polygon polygon;
-        if (enableOutput) {
-          cout <<"      POLYGON"; 
-        }
-        frCollection<frPoint> tmpPoints;
-        for (int k = 0; k < pin->port(i)->getPolygon(j)->numPoints; k++) {
-          frCoord x = round(pin->port(i)->getPolygon(j)->x[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-          frCoord y = round(pin->port(i)->getPolygon(j)->y[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-          tmpPoints.push_back(frPoint(x, y));
-          if (enableOutput) {
-             cout <<" " <<x * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                        <<y * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-          }
-        }
-        // pinFig
-        unique_ptr<frPolygon> pinFig = make_unique<frPolygon>();
-        pinFig->setPoints(tmpPoints);
-        pinFig->addToPin(pinIn.get());
-        pinFig->setLayerNum(layerNum);
-        // pinFig completed
-        // pin
-        unique_ptr<frPinFig> uptr(std::move(pinFig));
-        pinIn->addPinFig(uptr);
-        Polygon pinFigPoly;
-        frVector<Point> boostPolyPoints;
-        for (auto &pt: tmpPoints) {
-          boostPolyPoints.push_back(Point(pt.x(), pt.y()));
-          // std::cout << pt.x() << " " << pt.y() << "\n";
-        }
-        boost::polygon::set_points(pinFigPoly, boostPolyPoints.begin(), boostPolyPoints.end());
-        pinIn->addLayerShape(layerNum, pinFigPoly);
-        // pin completed
-
-        if (enableOutput) {
-          cout <<" ;" <<endl;
-        }
-      } else {
-        if (VERBOSE > -1) {
-          cout <<"unsupported lefiGeometries!" <<endl;
-        }
-        continue;
-        // exit(2);
-      }
-      //cout <<"  enum: " <<pin->port(i)->itemType(j) <<endl;
-    }
-    term->addPin(pinIn);
-    // term completed
-    if (enableOutput) {
-      cout <<"    END" <<endl;
-    }
-  }
-  if (enableOutput) {
-    cout <<"  END " <<pin->name() <<endl;
-  }
-
-  return 0;
-}
-
-
-int io::Parser::getLefObs(lefrCallbackType_e type, lefiObstruction* obs, lefiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-
-  if (type != lefrObstructionCbkType) {
-    cout <<"Type is not lefrObstructionCbkType!" <<endl;
-    exit(1);
-  }
-
-  vector<unique_ptr<frBlockage> > blks;
-
-  if (enableOutput) {
-    cout <<"  OBS" <<endl;
-  }
-  
-  auto geometry = obs->geometries();
-  int numItems  = geometry->numItems();
-  
-  string layer = "";
-  frLayerNum layerNum = 0;
-  for (int i = 0; i < numItems; ++i) {
-    if (geometry->itemType(i) == lefiGeomLayerE) {
-      layer = geometry->getLayer(i);
-      if (((io::Parser*)data)->tech->name2layer.find(layer) != ((io::Parser*)data)->tech->name2layer.end()) {
-        layerNum = ((io::Parser*)data)->tech->name2layer[layer]->getLayerNum();
-      } else {
-        if (VERBOSE > 2) {
-          cout <<"Warning: layer " <<geometry->getLayer(i) <<" is skipped for " <<((io::Parser*)data)->tmpBlock->getName() <<"/OBS" <<endl;
-          continue;
-        }
-      }
-      if (enableOutput) {
-        cout <<"    LAYER " <<layer <<" ;" <<endl;
-      }
-    } else if (geometry->itemType(i) == lefiGeomRectE) {
-      auto rect = geometry->getRect(i);
-      frCoord xl = round(rect->xl * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yl = round(rect->yl * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord xh = round(rect->xh * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yh = round(rect->yh * ((io::Parser*)data)->tech->getDBUPerUU());
-      frBox box(xl, yl, xh, yh);
-      xl = box.left();
-      yl = box.bottom();
-      xh = box.right();
-      yh = box.top();
-      vector<frPoint> points;
-      points.push_back(frPoint(xl,yl));
-      points.push_back(frPoint(xh,yl));
-      points.push_back(frPoint(xh,yh));
-      points.push_back(frPoint(xl,yh));
-      auto blk = make_unique<frLayerBlockage>();
-      blk->setId(((io::Parser*)data)->numBlockages);
-      ((io::Parser*)data)->numBlockages++;
-      blk->setLayerNum(layerNum);
-      blk->setPoints(points);
-      blks.push_back(std::move(blk));
-      if (enableOutput) {
-        cout <<"      RECT " <<rect->xl <<" " <<rect->yl <<" " <<rect->xh <<" " <<rect->yh <<" ;" <<endl;
-      }
-    } else {
-      if (VERBOSE > 2) {
-        cout <<"Warning: unsupported OBS" <<endl;
-      }
-      continue;
-    }
-  }
-  ((io::Parser*)data)->tmpBlock->setBlockages(blks);
-  return 0;
-}
-
-int io::Parser::getLefString(lefrCallbackType_e type, const char* str, lefiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (type == lefrMacroBeginCbkType) {
-    auto &tmpBlock = ((io::Parser*)data)->tmpBlock;
-    tmpBlock = make_unique<frBlock>();
-    tmpBlock->setName(string(str));
-    if (enableOutput) {
-      cout <<"MACRO " <<tmpBlock->getName() <<endl;
-    }
-  } else if (type == lefrMacroEndCbkType) {
-    auto &tmpBlock = ((io::Parser*)data)->tmpBlock;
-    tmpBlock->setId(((io::Parser*)data)->numRefBlocks + 1);
-    if (enableOutput) {
-      cout <<"END " <<tmpBlock->getName() <<" " <<((io::Parser*)data)->numRefBlocks + 1 <<endl;
-    }
-    ((io::Parser*)data)->design->addRefBlock(((io::Parser*)data)->tmpBlock);
-    ((io::Parser*)data)->numRefBlocks++;
-    ((io::Parser*)data)->numTerms     = 0;
-    ((io::Parser*)data)->numBlockages = 0;
-  } else {
-    cout <<"Type is not supported!" <<endl;
-    // exit(2);
-  }
-  return 0;
-}
-
-int io::Parser::getLefUnits(lefrCallbackType_e type, lefiUnits* units, lefiUserData data) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  ((io::Parser*)data)->tech->setDBUPerUU(frUInt4(units->databaseNumber()));
-  if (enableOutput) {
-    cout <<"DATABASE MICRONS " <<((io::Parser*)data)->tech->getDBUPerUU() <<endl;
-  }
-  return 0;
-}
-
-int io::Parser::getLefVias(lefrCallbackType_e type, lefiVia* via, lefiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (type != lefrViaCbkType) {
-    cout <<"Type is not lefrViaCbkType!" <<endl;
-    // exit(1);
-  }
-  if (enableOutput) {
-    cout <<"VIA " <<via->name();
-    if (via->hasDefault()) {
-      cout <<" DEFAULT";
-    }
-    cout <<endl;
-  }
-  if (via->numLayers() != 3) {
-    if (VERBOSE > -1) {
-      cout <<"Error: unsupported via" <<endl;
-    }
-    exit(1);
-  }
-  map<frLayerNum, int> lNum2Int;
-  for (int i = 0; i < via->numLayers(); ++i) {
-    if (((io::Parser*)data)->tech->name2layer.find(via->layerName(i)) == ((io::Parser*)data)->tech->name2layer.end()) {
-      if (VERBOSE > -1) {
-        cout <<"Warning: layer " <<via->layerName(i) <<" is skipiped for " <<via->name() <<endl;
-      }
-      return 0;
-    }
-    lNum2Int[((io::Parser*)data)->tech->name2layer.at(via->layerName(i))->getLayerNum()] = i;
-  }
-  //for (auto &m: lNum2Int) {
-  //  cout <<"print " <<m.first <<" " <<m.second <<endl;
-  //}
-  if (lNum2Int.begin()->first + 2 != (--lNum2Int.end())->first) {
-    if (VERBOSE > -1) {
-      cout <<"Error: non-consecutive layers" <<endl;
-    }
-    exit(1);
-  }
-
-  auto viaDef = make_unique<frViaDef>(via->name());
-  if (via->hasDefault()) {
-    viaDef->setDefault(1);
-  }
-  int cnt = 0;
-  for (auto &m: lNum2Int) {
-    int i = m.second;
-    if (enableOutput) {
-      cout <<"  LAYER " <<via->layerName(i) <<" ;" <<endl;
-    }
-    //auto layerNum = ((FlexRoute*)data)->layers[via->layerName(i)]->getLayerNum();
-    auto layerNum = m.first;
-    for (int j = 0; j < via->numRects(i); ++j) {
-      frCoord xl = round(via->xl(i, j) * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yl = round(via->yl(i, j) * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord xh = round(via->xh(i, j) * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yh = round(via->yh(i, j) * ((io::Parser*)data)->tech->getDBUPerUU());
-      unique_ptr<frRect> pinFig = make_unique<frRect>();
-      pinFig->setBBox(frBox(xl, yl, xh, yh));
-      pinFig->setLayerNum(layerNum);
-      unique_ptr<frShape> tmp(std::move(pinFig));
-      if (enableOutput) {
-        cout <<"    RECT "   <<xl * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                             <<yl * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                             <<xh * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                             <<yh * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" ;" <<endl;
-      }
-      switch(cnt) {
-        case 0 :
-          viaDef->addLayer1Fig(tmp);
-          break;
-        case 1 :
-          viaDef->addCutFig(tmp);
-          break;
-        default:
-          viaDef->addLayer2Fig(tmp);
-          break;
-      }
-    }
-    for (int j = 0; j < via->numPolygons(i); ++j) {
-      if (enableOutput) {
-        cout <<"    POLYGON"; 
-      }
-      vector<frPoint> tmpPoints;
-      for (int k = 0; k < via->getPolygon(i, j).numPoints; k++) {
-        frCoord x = round(via->getPolygon(i, j).x[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-        frCoord y = round(via->getPolygon(i, j).y[k] * ((io::Parser*)data)->tech->getDBUPerUU());
-        tmpPoints.push_back(frPoint(x, y));
-        if (enableOutput) {
-           cout <<" " <<x * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU() <<" " 
-                      <<y * 1.0 / ((io::Parser*)data)->tech->getDBUPerUU();
-        }
-      }
-      unique_ptr<frPolygon> pinFig = make_unique<frPolygon>();
-      pinFig->setPoints(tmpPoints);
-      pinFig->setLayerNum(layerNum);
-      unique_ptr<frShape> tmp(std::move(pinFig));
-      if (enableOutput) {
-        cout <<" ;" <<endl;
-      }
-      switch(cnt) {
-        case 0 :
-          viaDef->addLayer1Fig(tmp);
-          break;
-        case 1 :
-          viaDef->addCutFig(tmp);
-          break;
-        default:
-          viaDef->addLayer2Fig(tmp);
-          break;
-      }
-    }
-    cnt++;
-  }
-  if (enableOutput) {
-    cout <<"END " <<via->name() <<endl;
-  }
-
-  // add via class information
-  auto cutLayerNum = viaDef->getCutLayerNum();
-  auto cutLayer    = ((io::Parser*)data)->tech->getLayer(cutLayerNum);
-  if (cutLayer->hasLef58CutClassConstraint()) {
-    bool getCutClass = false;
-    for (auto &cutClass: cutLayer->getLef58CutClassConstraint()->getCutClasses()) {
-      //int  numCut = 0;
-      bool flag   = true;
-      for (auto &cutFig: viaDef->getCutFigs()) {
-        if (cutFig->typeId() == frcRect) {
-          frBox box;
-          cutFig->getBBox(box);
-          auto width  = box.right() - box.left();
-          auto height = box.top() - box.bottom();
-          if (min(width, height) != cutClass->getViaWidth()) {
-            flag = false;
-            //break;
-          } else if (max(width, height) != cutClass->getViaLength()) {
-            flag = false;
-            //break;
-          }
-        } else {
-          flag = false;
-          cout <<"Warning: cut shape is not a rectable / does not have a cut class" <<endl;
-          //break;
-        }
-        //numCut++;
-      }
-      //if (flag && numCut == (int)cutClass->getNumCut()) {
-      if (flag) {
-        viaDef->setCutClass(cutClass);
-        //cout <<"CUTCLASS " <<cutClass->getName() <<endl;
-        getCutClass = true;
-      }
-    }
-    if (!getCutClass) {
-      cout <<"Warning: no cut class available for via " <<viaDef->getName() <<endl;
-    }
-  }
-
-  ((io::Parser*)data)->tech->addVia(viaDef);
-  return 0;
-}
-
-int io::Parser::getLefViaRules(lefrCallbackType_e type, lefiViaRule* viaRule, lefiUserData data) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (type != lefrViaRuleCbkType) {
-    cout <<"Type is not lefrViaRuleCbkType!" <<endl;
-    // exit(1);
-  }
-  if (enableOutput) {
-    cout <<"VIARULE " <<viaRule->name();
-    if (viaRule->hasGenerate()) {
-      cout <<" GENERATE";
-    } else {
-      cout <<"Error: getLefViaRules does not support non-generate rules" <<endl;
-      exit(1);
-    }
-    if (viaRule->hasDefault()) {
-      cout <<" DEFAULT";
-    }
-    cout <<endl;
-  }
-  if (viaRule->numLayers() != 3) {
-    if (VERBOSE > -1) {
-      cout <<"Error: unsupported via" <<endl;
-    }
-    exit(1);
-  }
-  map<frLayerNum, int> lNum2Int;
-  for (int i = 0; i < viaRule->numLayers(); ++i) {
-    auto viaRuleLayer = viaRule->layer(i);
-    if (((io::Parser*)data)->tech->name2layer.find(viaRuleLayer->name()) == ((io::Parser*)data)->tech->name2layer.end()) {
-      if (VERBOSE > -1) {
-        cout <<"Warning: layer " <<viaRuleLayer->name() <<" is skipiped for " <<viaRule->name() <<endl;
-      }
-      return 0;
-    }
-    lNum2Int[((io::Parser*)data)->tech->name2layer.at(viaRuleLayer->name())->getLayerNum()] = i;
-  }
-  if (lNum2Int.begin()->first + 2!= (--lNum2Int.end())->first) {
-    if (VERBOSE > -1) {
-      cout <<"Error: non-consecutive layers" <<endl;
-    }
-    exit(1);
-  }
-
-  if (!viaRule->hasGenerate()) {
-    cout <<"Error: getLefViaRules does not support non-generate rules" <<endl;
-    exit(1);
-  }
-  auto viaRuleGen = make_unique<frViaRuleGenerate>(viaRule->name());
-  if (viaRule->hasDefault()) {
-    viaRuleGen->setDefault(1);
-  }
-  int cnt = 0;
-  for (auto &[lNum, i]: lNum2Int) {
-    auto viaRuleLayer = viaRule->layer(i);
-    if (enableOutput) {
-      cout <<"  LAYER " <<viaRuleLayer->name() <<" ;" <<endl;
-    }
-    if (viaRuleLayer->hasEnclosure()) {
-      frCoord x = round(viaRuleLayer->enclosureOverhang1() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord y = round(viaRuleLayer->enclosureOverhang2() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frPoint enc(x, y);
-      switch(cnt) {
-        case 0:
-          viaRuleGen->setLayer1Enc(enc);
-          break;
-        case 1:
-          cout <<"Error: getViaRuleGenerates cutLayer cannot have overhands" <<endl;
-          break;
-        default:
-          viaRuleGen->setLayer2Enc(enc);
-          break;
-      }
-      if (enableOutput) {
-        cout <<"    ENCLOSURE " <<viaRuleLayer->enclosureOverhang1() <<" " <<viaRuleLayer->enclosureOverhang1() <<" ;" <<endl;
-      }
-    }
-    if (viaRuleLayer->hasRect()) {
-      frCoord xl = round(viaRuleLayer->xl() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yl = round(viaRuleLayer->yl() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord xh = round(viaRuleLayer->xh() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord yh = round(viaRuleLayer->yh() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frBox box(xl, yl, xh, yh);
-      switch(cnt) {
-        case 0:
-          cout <<"Error: getViaRuleGenerates botLayer cannot have rect" <<endl;
-          break;
-        case 1:
-          viaRuleGen->setCutRect(box);
-          break;
-        default:
-          cout <<"Error: getViaRuleGenerates topLayer cannot have rect" <<endl;
-          break;
-      }
-      if (enableOutput) {
-        cout <<"    RECT " <<viaRuleLayer->xl() <<" " 
-                           <<viaRuleLayer->yl() <<" " 
-                           <<viaRuleLayer->xh() <<" " 
-                           <<viaRuleLayer->yh() 
-                           <<" ;" <<endl;
-      }
-    }
-    if (viaRuleLayer->hasSpacing()) {
-      frCoord x = round(viaRuleLayer->spacingStepX() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frCoord y = round(viaRuleLayer->spacingStepY() * ((io::Parser*)data)->tech->getDBUPerUU());
-      frPoint pt(x, y);
-      switch(cnt) {
-        case 0:
-          cout <<"Error: getViaRuleGenerates botLayer cannot have spacing" <<endl;
-          break;
-        case 1:
-          viaRuleGen->setCutSpacing(pt);
-          break;
-        default:
-          cout <<"Error: getViaRuleGenerates topLayer cannot have spacing" <<endl;
-          break;
-      }
-      if (enableOutput) {
-        cout <<"    SPACING " <<viaRuleLayer->spacingStepX() <<" BY " <<viaRuleLayer->spacingStepY() <<" ;" <<endl;
-      }
-    }
-    cnt++;
-  }
-
-  ((io::Parser*)data)->tech->addViaRuleGenerate(viaRuleGen);
-  return 0;
-}
-
-void io::Parser::readLef() {
-  FILE* f;
-  int res;
-
-  lefrInitSession(1);
-
-  lefrSetUserData ((lefiUserData)this);
-
-  lefrSetMacroCbk(getLefMacros);
-  lefrSetMacroBeginCbk(getLefString);
-  lefrSetMacroEndCbk(getLefString);
-  lefrSetUnitsCbk(getLefUnits);
-  lefrSetPinCbk(getLefPins);
-  lefrSetObstructionCbk(getLefObs);
-  lefrSetLayerCbk(getLefLayers);
-  lefrSetViaCbk(getLefVias);
-  lefrSetViaRuleCbk(getLefViaRules);
-
-  if ((f = fopen(LEF_FILE.c_str(),"r")) == 0) {
-    cout <<"Couldn't open lef file" <<endl;
-    exit(2);
-  }
-
-  res = lefrRead(f, LEF_FILE.c_str(), (lefiUserData)this);
-  if (res != 0) {
-    cout <<"LEF parser returns an error!" <<endl;
-    exit(2);
-  }
-  fclose(f);
-
-  lefrClear();
-}
-
-void io::Parser::readLefDef() {
-  //bool enableOutput = false;
-  bool enableOutput = true;
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"reading lef ..." <<endl;
-  }
-
-  readLef();
-
-  if (VERBOSE > 0) {
-    cout <<endl;
-    cout <<"units:       " <<tech->getDBUPerUU()      <<endl;
-    cout <<"#layers:     " <<tech->layers.size()      <<endl;
-    cout <<"#macros:     " <<design->refBlocks.size() <<endl;
-    cout <<"#vias:       " <<tech->vias.size()        <<endl;
-    cout <<"#viarulegen: " <<tech->viaRuleGenerates.size() <<endl;
-  }
-  //exit(1);
-  auto numLefVia = tech->vias.size();
-
-  //tech->printAllConstraints();
-  
-  if (enableOutput) {
-    //design->printAllMacros();
-    // printAllLayers();
-    //tech->printAllVias();
-    //printLayerMaps();
-  }
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"reading def ..." <<endl;
-  }
-
-  readDef();
-
-  if (VERBOSE > 0) {
-    cout <<endl;
-    frBox dieBox;
-    design->getTopBlock()->getBoundaryBBox(dieBox);
-    cout <<"design:      " <<design->getTopBlock()->getName()    <<endl;
-    cout <<"die area:    " <<dieBox                              <<endl;
-    cout <<"trackPts:    " <<design->getTopBlock()->getTrackPatterns().size() <<endl;
-    cout <<"defvias:     " <<tech->vias.size() - numLefVia       <<endl;
-    cout <<"#components: " <<design->getTopBlock()->insts.size() <<endl;
-    cout <<"#terminals:  " <<design->getTopBlock()->terms.size() <<endl;
-    cout <<"#snets:      " <<design->getTopBlock()->snets.size() <<endl;
-    cout <<"#nets:       " <<design->getTopBlock()->nets.size()  <<endl;
-    //cout <<"#pins:       " <<numPins <<endl;
-  }
-  //cout <<flush;
-
-  if (enableOutput) {
-    //tech->printAllVias();
-    //design->printAllComps();
-    //printCompMaps();
-    //design->printAllTerms();
-    //printTermMaps();
-    //printAllNets();
-    //printAllTrackGens();
-    //printAllTrackPatterns();
-  }
-  //exit(1);
-
-}
-
-void io::Parser::readGuide() {
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"reading guide ..." <<endl;
-  }
-
-  int numGuides = 0;
-
-  string netName = "";
-  frNet* net = nullptr;
-
-  ifstream fin(GUIDE_FILE.c_str());
-  string line;
-  frBox  box;
-  frLayerNum layerNum;
-
-  if (fin.is_open()){
-    while (fin.good()) {
-      getline(fin, line);
-      //cout <<line <<endl <<line.size() <<endl;
-      if (line == "(" || line == "") continue;
-      if (line == ")") {
-        continue;
-      }
-
-      stringstream ss(line);
-      string word = "";
-      vector<string> vLine;
-      while (!ss.eof()) {
-        ss >>word;
-        vLine.push_back(word);
-        //cout <<word <<" ";
-      }
-      //cout <<endl;
-
-      if (vLine.size() == 0) {
-        cout <<"Error: reading guide file!" <<endl;
-        exit(2);
-      } else if (vLine.size() == 1) {
-        netName = vLine[0];
-        if (design->topBlock->name2net.find(vLine[0]) == design->topBlock->name2net.end()) {
-          cout <<"Error: cannot find net: " <<vLine[0] <<endl;
-          exit(2);
-        }
-        net = design->topBlock->name2net[netName]; 
-      } else if (vLine.size() == 5) {
-        if (tech->name2layer.find(vLine[4]) == tech->name2layer.end()) {
-          cout <<"Error: cannot find layer: " <<vLine[4] <<endl;
-          exit(2);
-        }
-        layerNum = tech->name2layer[vLine[4]]->getLayerNum();
-        box.set(stoi(vLine[0]), stoi(vLine[1]), stoi(vLine[2]), stoi(vLine[3]));
-        frRect rect;
-        rect.setBBox(box);
-        rect.setLayerNum(layerNum);
-        //tmpGuides[netName].push_back(rect);
-        tmpGuides[net].push_back(rect);
-        ++numGuides;
-        if (numGuides < 1000000) {
-          if (numGuides % 100000 == 0) {
-            cout <<"guideIn read " <<numGuides <<" guides" <<endl;
-          }
-        } else {
-          if (numGuides % 1000000 == 0) {
-            cout <<"guideIn read " <<numGuides <<" guides" <<endl;
-          }
-        }
-
-      } else {
-        cout <<"Error: reading guide file!" <<endl;
-        exit(2);
-      }
-    }
-    fin.close();
-  } else {
-    cout <<"Error: failed to open guide file" <<endl;
-    exit(2);
-  }
-
-
-  if (VERBOSE > 0) {
-    cout <<endl;
-    cout <<"#guides:     " <<numGuides <<endl;
-  }
-
-}
-
-void io::Writer::fillConnFigs_net(frNet* net, bool isTA) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  auto netName = net->getName();
-  if (isTA) {
-    for (auto &uGuide: net->getGuides()) {
-      //cout <<"find guide" <<endl;
-      for (auto &uConnFig: uGuide->getRoutes()) {
-        auto connFig = uConnFig.get();
-        if (connFig->typeId() == frcPathSeg) {
-          connFigs[netName].push_back(make_shared<frPathSeg>(*static_cast<frPathSeg*>(connFig)));
-        } else if (connFig->typeId() == frcVia) {
-          connFigs[netName].push_back(make_shared<frVia>(*static_cast<frVia*>(connFig)));
-          //frPoint bp, ep;
-          //static_pointer_cast<frGuide>(objPtr)->getPoints(bp, ep);
-          //cout <<"fillConnFigs_net found via in guide " <<bp <<" " <<ep <<" "
-          //     <<static_pointer_cast<frGuide>(objPtr)->getBeginLayerNum() <<" " 
-          //     <<static_pointer_cast<frGuide>(objPtr)->getEndLayerNum() <<endl;
-        } else {
-          cout <<"Error: io::Writer::filliConnFigs does not support this type" <<endl;
-        }
-      }
-    }
-  } else {
-    if (enableOutput) {
-      cout << netName << ":\n";
-    }
-    for (auto &shape: net->getShapes()) {
-      if (shape->typeId() == frcPathSeg) {
-        auto pathSeg = *static_cast<frPathSeg*>(shape.get());
-        frPoint start, end;
-        pathSeg.getPoints(start, end);
-
-        if (enableOutput) {
-          frLayerNum currLayerNum = pathSeg.getLayerNum();
-          cout << "  connfig pathseg (" << start.x() / 2000.0<< ", " << start.y() / 2000.0 
-               << ") - (" << end.x() / 2000.0 << ", " << end.y() / 2000.0 << ") " << currLayerNum  <<"\n"; 
-        }
-        connFigs[netName].push_back(make_shared<frPathSeg>(pathSeg));
-      }
-    }
-    for (auto &via: net->getVias()) {
-      connFigs[netName].push_back(make_shared<frVia>(*via));
-    }
-    for (auto &shape: net->getPatchWires()) {
-      auto pwire = static_cast<frPatchWire*>(shape.get());
-      connFigs[netName].push_back(make_shared<frPatchWire>(*pwire));
-    }
-  }
-}
-
-void io::Writer::splitVia_helper(frLayerNum layerNum, int isH, frCoord trackLoc, frCoord x, frCoord y, 
-  vector< vector< map<frCoord, vector<shared_ptr<frPathSeg> > > > > &mergedPathSegs) {
-  if (layerNum >= 0 && layerNum < (int)(getTech()->getLayers().size()) &&
-      mergedPathSegs.at(layerNum).at(isH).find(trackLoc) != mergedPathSegs.at(layerNum).at(isH).end()) {
-    for (auto &pathSeg: mergedPathSegs.at(layerNum).at(isH).at(trackLoc)) {
-      frPoint begin, end;
-      pathSeg->getPoints(begin, end);
-      if ((isH == 0 && (begin.x() < x) && (end.x() > x)) ||
-          (isH == 1 && (begin.y() < y) && (end.y() > y))) {
-        frSegStyle style1, style2, style_default;
-        pathSeg->getStyle(style1);
-        pathSeg->getStyle(style2);
-        style_default = getTech()->getLayer(layerNum)->getDefaultSegStyle();
-        shared_ptr<frPathSeg> newPathSeg = make_shared<frPathSeg>(*pathSeg);
-        pathSeg->setPoints(begin, frPoint(x,y));
-        style1.setEndStyle(style_default.getEndStyle(), style_default.getEndExt());
-        pathSeg->setStyle(style1);
-        newPathSeg->setPoints(frPoint(x,y), end);
-        style2.setBeginStyle(style_default.getBeginStyle(), style_default.getBeginExt());
-        newPathSeg->setStyle(style2);
-        mergedPathSegs.at(layerNum).at(isH).at(trackLoc).push_back(newPathSeg);
-        // via can only intersect at most one merged pathseg on one track
-        break;
-      }
-    }
-  }
-}
-
-
-
-
-// merge pathseg, delete redundant via
-void io::Writer::mergeSplitConnFigs(list<shared_ptr<frConnFig> > &connFigs) {
-  //if (VERBOSE > 0) {
-  //  cout <<endl <<"merge and split ..." <<endl;
-  //}
-  // initialzie pathseg and via map
-  //map< tuple<layerNum, isHorizontal, trackLoc>,
-  //     map<frCoord, vector< tuple<shared_ptr<frPathSeg>, isBegin> > > 
-  //   > map;
-  map < tuple<frLayerNum, bool, frCoord>,
-        map<frCoord, vector< tuple<shared_ptr<frPathSeg>, bool> > 
-           >
-      > pathSegMergeMap;
-  map < tuple<frCoord, frCoord, frLayerNum>, shared_ptr<frVia> > viaMergeMap;
-  for (auto &connFig: connFigs) {
-    if (connFig->typeId() == frcPathSeg) {
-      auto pathSeg = dynamic_pointer_cast<frPathSeg>(connFig);
-      frPoint begin, end;
-      pathSeg->getPoints(begin, end);
-      frLayerNum layerNum = pathSeg->getLayerNum();
-      if (begin == end) {
-        // std::cout << "Warning: 0 length connfig\n";
-        continue; // if segment length = 0, ignore
-      } else {
-        // std::cout << "xxx\n";
-        bool isH = (begin.x() == end.x()) ? false : true;
-        frCoord trackLoc   = isH ? begin.y() : begin.x();
-        frCoord beginCoord = isH ? begin.x() : begin.y();
-        frCoord endCoord   = isH ? end.x()   : end.y();
-        pathSegMergeMap[make_tuple(layerNum, isH, trackLoc)][beginCoord].push_back(make_tuple(pathSeg, true));
-        pathSegMergeMap[make_tuple(layerNum, isH, trackLoc)][endCoord].push_back(make_tuple(pathSeg, false));
-      }
-    } else if (connFig->typeId() == frcVia) {
-      auto via = dynamic_pointer_cast<frVia>(connFig);
-      auto cutLayerNum = via->getViaDef()->getCutLayerNum();
-      //auto layer1Num = via->getLayer1Num();
-      //auto layer2Num = via->getLayer2Num();
-      frPoint viaPoint;
-      via->getOrigin(viaPoint);
-      viaMergeMap[make_tuple(viaPoint.x(), viaPoint.y(), cutLayerNum)] = via;
-      //cout <<"found via" <<endl;
-    } else {
-      ;
-    }
-  }
-
-  // merge pathSeg
-  map<frCoord, vector<shared_ptr<frPathSeg> > > tmp1;
-  vector< map<frCoord, vector<shared_ptr<frPathSeg> > > > tmp2(2, tmp1);
-  // mergedPathSegs[layerNum][isHorizontal] is a map<trackLoc, vector<shared_ptr<frPathSeg> > >
-  vector< vector< map<frCoord, vector<shared_ptr<frPathSeg> > > > > mergedPathSegs(getTech()->getLayers().size(), tmp2);
-
-  for (auto &it1: pathSegMergeMap) {
-    auto layerNum = get<0>(it1.first);
-    int  isH = get<1>(it1.first);
-    auto trackLoc = get<2>(it1.first);
-    bool hasSeg = false;
-    int cnt = 0;
-    shared_ptr<frPathSeg> newPathSeg;
-    frSegStyle style;
-    frPoint begin, end;
-    for (auto &it2: it1.second) {
-      //auto coord = it2.first;
-      //cout <<"coord " <<coord <<endl;
-      for (auto &pathSegTuple: it2.second) {
-        cnt += get<1>(pathSegTuple)? 1 : -1;
-      }
-      // newPathSeg begin
-      if (!hasSeg && cnt > 0) {
-        style.setBeginStyle(frcTruncateEndStyle, 0);
-        style.setEndStyle(frcTruncateEndStyle, 0);
-        newPathSeg = make_shared<frPathSeg>(*(get<0>(*(it2.second.begin()))));
-        for (auto &pathSegTuple: it2.second) {
-          auto pathSeg = get<0>(pathSegTuple);
-          auto isBegin = get<1>(pathSegTuple);
-          if (isBegin) {
-            pathSeg->getPoints(begin, end);
-            frSegStyle tmpStyle;
-            pathSeg->getStyle(tmpStyle);
-            if (tmpStyle.getBeginExt() > style.getBeginExt()) {
-              style.setBeginStyle(tmpStyle.getBeginStyle(), tmpStyle.getBeginExt());
-            }
-          }
-        }
-        newPathSeg->setStyle(style);
-        hasSeg = true;
-      // newPathSeg end
-      } else if (hasSeg && cnt == 0) {
-        newPathSeg->getPoints(begin, end);
-        for (auto &pathSegTuple: it2.second) {
-          auto pathSeg = get<0>(pathSegTuple);
-          auto isBegin = get<1>(pathSegTuple);
-          if (!isBegin) {
-            frPoint tmp;
-            pathSeg->getPoints(tmp, end);
-            frSegStyle tmpStyle;
-            pathSeg->getStyle(tmpStyle);
-            if (tmpStyle.getEndExt() > style.getEndExt()) {
-              style.setEndStyle(tmpStyle.getEndStyle(), tmpStyle.getEndExt());
-            }
-          }
-        }
-        newPathSeg->setPoints(begin, end);
-        newPathSeg->setStyle(style);
-        hasSeg = false;
-        (mergedPathSegs.at(layerNum).at(isH))[trackLoc].push_back(newPathSeg);
-      }
-    }
-  }
-
-  // split pathseg from via
-  // mergedPathSegs[layerNum][isHorizontal] is a map<frCoord, vector<shared_ptr<frPathSeg> > >
-  //map < tuple<frCoord, frCoord, frLayerNum>, shared_ptr<frVia> > viaMergeMap;
-  for (auto &it1: viaMergeMap) {
-    auto x           = get<0>(it1.first);
-    auto y           = get<1>(it1.first);
-    auto cutLayerNum = get<2>(it1.first);
-    frCoord trackLoc;
-
-    auto layerNum = cutLayerNum - 1;
-    int  isH      = 1;
-    trackLoc = (isH == 1) ? y : x;
-    splitVia_helper(layerNum, isH, trackLoc, x, y, mergedPathSegs);
-
-    layerNum = cutLayerNum - 1;
-    isH = 0;
-    trackLoc = (isH == 1) ? y : x;
-    splitVia_helper(layerNum, isH, trackLoc, x, y, mergedPathSegs);
-
-    layerNum = cutLayerNum + 1;
-    trackLoc = (isH == 1) ? y : x;
-    splitVia_helper(layerNum, isH, trackLoc, x, y, mergedPathSegs);
-
-    layerNum = cutLayerNum + 1;
-    isH = 0;
-    trackLoc = (isH == 1) ? y : x;
-    splitVia_helper(layerNum, isH, trackLoc, x, y, mergedPathSegs);
-  }
-
-  // split intersecting pathSegs
-  for (auto &it1: mergedPathSegs) {
-    // vertical for mapIt1
-    for (auto &mapIt1: it1.at(0)) {
-      // horizontal for mapIt2
-      for (auto &mapIt2: it1.at(1)) {
-        // at most split once
-        // seg1 is vertical
-        for (auto &seg1: mapIt1.second) {
-          bool skip = false;
-          // seg2 is horizontal
-          frPoint seg1Begin, seg1End;
-          seg1->getPoints(seg1Begin, seg1End);
-          for (auto &seg2: mapIt2.second) {
-            frPoint seg2Begin, seg2End;
-            seg2->getPoints(seg2Begin, seg2End);
-            bool pushNewSeg1 = false;
-            bool pushNewSeg2 = false;
-            shared_ptr<frPathSeg> newSeg1;
-            shared_ptr<frPathSeg> newSeg2;
-            // check whether seg1 needs to be split, break seg1
-            if (seg2Begin.y() > seg1Begin.y() && seg2Begin.y() < seg1End.y()) {
-              pushNewSeg1 = true;
-              newSeg1 = make_shared<frPathSeg>(*seg1);
-              // modify seg1
-              seg1->setPoints(seg1Begin, frPoint(seg1End.x(), seg2End.y()));
-              // modify newSeg1
-              newSeg1->setPoints(frPoint(seg1End.x(), seg2Begin.y()), seg1End);
-              // modify endstyle
-              auto layerNum = seg1->getLayerNum();
-              frSegStyle tmpStyle1;
-              frSegStyle tmpStyle2;
-              frSegStyle style_default;
-              seg1->getStyle(tmpStyle1);
-              seg1->getStyle(tmpStyle2);
-              style_default = getTech()->getLayer(layerNum)->getDefaultSegStyle();
-              tmpStyle1.setEndStyle(frcExtendEndStyle, style_default.getEndExt());
-              seg1->setStyle(tmpStyle1);
-              tmpStyle2.setBeginStyle(frcExtendEndStyle, style_default.getBeginExt());
-              newSeg1->setStyle(tmpStyle2);
-            }
-            // check whether seg2 needs to be split, break seg2
-            if (seg1Begin.x() > seg2Begin.x() && seg1Begin.x() < seg2End.x()) {
-              pushNewSeg2 = true;
-              newSeg2 = make_shared<frPathSeg>(*seg1);
-              // modify seg2
-              seg2->setPoints(seg2Begin, frPoint(seg1End.x(), seg2End.y()));
-              // modify newSeg2
-              newSeg2->setPoints(frPoint(seg1End.x(), seg2Begin.y()), seg2End);
-              // modify endstyle
-              auto layerNum = seg2->getLayerNum();
-              frSegStyle tmpStyle1;
-              frSegStyle tmpStyle2;
-              frSegStyle style_default;
-              seg2->getStyle(tmpStyle1);
-              seg2->getStyle(tmpStyle2);
-              style_default = getTech()->getLayer(layerNum)->getDefaultSegStyle();
-              tmpStyle1.setEndStyle(frcExtendEndStyle, style_default.getEndExt());
-              seg2->setStyle(tmpStyle1);
-              tmpStyle2.setBeginStyle(frcExtendEndStyle, style_default.getBeginExt());
-              newSeg2->setStyle(tmpStyle2);
-            }
-            if (pushNewSeg1) {
-              mapIt1.second.push_back(newSeg1);
-            }
-            if (pushNewSeg2) {
-              mapIt2.second.push_back(newSeg2);
-            }
-            if (pushNewSeg1 || pushNewSeg2) {
-              skip = true;
-              break;
-            }
-            //cout <<"found" <<endl;
-          }
-          if (skip) break;
-        }
-      }
-    }
-  }
-
-
-  // write back pathseg
-  connFigs.clear();
-  for (auto &it1: mergedPathSegs) {
-    for (auto &it2: it1) {
-      for (auto &it3: it2) {
-        for (auto &it4: it3.second) {
-          connFigs.push_back(it4);
-        }
-      }
-    }
-  }
-
-  // write back via
-  //map < tuple<frCoord, frCoord, frLayerNum>, shared_ptr<frVia> > viaMergeMap;
-  for (auto &it: viaMergeMap) {
-    connFigs.push_back(it.second);
-  }
-
-}
-
-void io::Writer::fillConnFigs(bool isTA) {
-  connFigs.clear();
-  if (VERBOSE > 0) {
-    cout <<endl <<"post processing ..." <<endl;
-  }
-  for (auto &net: getDesign()->getTopBlock()->getNets()) {
-    fillConnFigs_net(net.get(), isTA);
-  }
-  if (isTA) {
-    for (auto &it: connFigs) {
-      mergeSplitConnFigs(it.second);
-    }
-  }
-}
-
-void io::Writer::writeFromTA() {
-  fillConnFigs(true);
-  writeDef(true);
-}
-
-void io::Writer::writeFromDR(const string &str) {
-  fillConnFigs(false);
-  writeDef(false, str);
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/io.h b/scripts/pdn/src/PdnPinDumper/src/io/io.h
deleted file mode 100644
index 5ab575c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/io.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_IO_H_
-#define _FR_IO_H_
-
-#include <memory>
-#include <list>
-#include <boost/icl/interval_set.hpp>
-#include "frDesign.h"
-
-#include "defrReader.hpp"
-#include "defwWriter.hpp"
-#include "lefrReader.hpp"
-
-namespace fr {
-  namespace io {
-    class Parser {
-    public:
-      // constructors
-      Parser(frDesign* designIn): design(designIn), tech(design->getTech()), tmpBlock(nullptr), readLayerCnt(0),
-                                  tmpGuides(), tmpGRPins(), trackOffsetMap(), prefTrackPatterns(), numRefBlocks(0),
-                                  numInsts(0), numTerms(0), numNets(0), numBlockages(0) {}
-      // others
-      void readLefDef();
-      void readGuide();
-      void postProcess();
-      void postProcessGuide();
-      // rtree init
-      //void buildRtree4Routes();
-      //void buildRtree4Insts();
-      std::map<frBlock*, std::map<frOrient, std::map<std::vector<frCoord>, std::set<frInst*, frBlockObjectComp> > >, frBlockObjectComp> &getTrackOffsetMap() {
-        return trackOffsetMap;
-      }
-      std::vector<frTrackPattern*> &getPrefTrackPatterns() {
-        return prefTrackPatterns;
-      }
-
-    protected:
-      void readLef();
-      void readDef();
-
-      frDesign*       design;
-      frTechObject*   tech;
-
-      std::unique_ptr<frBlock>        tmpBlock;
-      // temporary variables
-      int                             readLayerCnt;
-      std::map<frNet*, std::vector<frRect>, frBlockObjectComp> tmpGuides;
-      std::vector<std::pair<frBlockObject*, frPoint> > tmpGRPins;
-      std::map<frBlock*, 
-               std::map<frOrient, std::map<std::vector<frCoord>, std::set<frInst*, frBlockObjectComp> > >,
-               frBlockObjectComp> trackOffsetMap;
-      std::vector<frTrackPattern*> prefTrackPatterns;
-      int numRefBlocks;
-      int numInsts;
-      int numTerms;     // including instterm and term
-      int numNets;      // including snet and net
-      int numBlockages; // including instBlockage and blockage
-
-      // LEF/DEF parser helper
-      static int getDefDieArea(defrCallbackType_e type, defiBox* box, defiUserData data);
-      static int getDefTracks(defrCallbackType_e type, defiTrack* track, defiUserData data);
-      static int getDefVias(defrCallbackType_e type, defiVia* comp, defiUserData data);
-      static int getDefComponents(defrCallbackType_e type, defiComponent* comp, defiUserData data);
-      static int getDefTerminals(defrCallbackType_e type, defiPin* term, defiUserData data);
-      static int getDefNets(defrCallbackType_e type, defiNet* net, defiUserData data);
-      static int getDefInteger(defrCallbackType_e type, int number, defiUserData data);
-      static int getDefString(defrCallbackType_e type, const char* str, defiUserData data);
-      static int getDefVoid(defrCallbackType_e type, void* variable, defiUserData data);
-      static int getDefUnits(defrCallbackType_e type, double number, defiUserData data);
-      static int getLefMacros(lefrCallbackType_e type, lefiMacro* macro, lefiUserData data);
-      static int getLefPins(lefrCallbackType_e type, lefiPin* pin, lefiUserData data);
-      static int getLefObs(lefrCallbackType_e type, lefiObstruction* obs, lefiUserData data);
-      static int getLefString(lefrCallbackType_e type, const char* string, lefiUserData data);
-      static int getLefUnits(lefrCallbackType_e type, lefiUnits* units, lefiUserData data);
-      static int getLefLayers(lefrCallbackType_e type, lefiLayer* layer, lefiUserData data);
-      static int getLefVias(lefrCallbackType_e type, lefiVia* via, lefiUserData data);
-      static int getLefViaRules(lefrCallbackType_e type, lefiViaRule* via, lefiUserData data);
-      
-      static int getLef58CornerSpacing(void *data, const std::string &sIn);
-      static int getLef58SpacingTable(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58SpacingTable_parallelRunLength(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58Spacing(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58Spacing_endOfLineWithin(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutClass(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacing(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacing_helper(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacing_parallelWithin(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacing_adjacentCuts(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacing_layer(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacingTable(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacingTable_helper(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacingTable_others(void *data, frLayer* tmpLayer, const std::string &sIn);
-      static int getLef58CutSpacingTable_prl(void *data, frLayer* tmpLayer, const std::string &sIn, 
-                                             const std::shared_ptr<frLef58CutSpacingTableConstraint> &con);
-      static int getLef58CutSpacingTable_default(void *data, frLayer* tmpLayer, const std::string &sIn, 
-                                             const std::shared_ptr<frLef58CutSpacingTableConstraint> &con);
-      static int getLef58CutSpacingTable_layer(void *data, frLayer* tmpLayer, const std::string &sIn, 
-                                               const std::shared_ptr<frLef58CutSpacingTableConstraint> &con,
-                                               frLayerNum &secondLayerNum);
-      static int getLef58CutSpacingTable_cutClass(void *data, frLayer* tmpLayer, const std::string &sIn, 
-                                                  const std::shared_ptr<frLef58CutSpacingTableConstraint> &con,
-                                                  bool hasSecondLayer, frLayerNum secondLayerNum);
-
-      // postProcess functions
-      void buildCMap();
-      void buildGCellPatterns();
-      void buildGCellPatterns_helper(frCoord &GCELLGRIDX, frCoord &GCELLGRIDY, frCoord &GCELLOFFSETX, frCoord &GCELLOFFSETY);
-      void buildGCellPatterns_getWidth(frCoord &GCELLGRIDX, frCoord &GCELLGRIDY);
-      void buildGCellPatterns_getOffset(frCoord GCELLGRIDX, frCoord GCELLGRIDY, frCoord &GCELLOFFSETX, frCoord &GCELLOFFSETY);
-      void initDefaultVias();
-      void initDefaultVias_N16(const std::string &in);
-
-      // instance analysis
-      void instAnalysis();
-
-      // postProcessGuide functions
-      void genGuides(frNet* net, std::vector<frRect> &rects);
-      void genGuides_merge(std::vector<frRect> &rects, std::vector<std::map<frCoord, boost::icl::interval_set<frCoord> > > &intvs);
-      void genGuides_split(std::vector<frRect> &rects, std::vector<std::map<frCoord, boost::icl::interval_set<frCoord> > > &intvs,
-                           std::map<std::pair<frPoint, frLayerNum>, std::set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap,
-                           std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap,
-                           bool isRetry);
-      void genGuides_gCell2PinMap(frNet* net, std::map<std::pair<frPoint, frLayerNum>, std::set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap,
-                                  std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap);
-      void genGuides_gCell2TermMap(std::map<std::pair<frPoint, frLayerNum>, std::set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap, 
-                                   std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap,
-                                   frTerm* term, frBlockObject* origTerm);
-      void genGuides_initPin2GCellMap(frNet* net, std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap);
-      void genGuides_buildNodeMap(std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap, int &gCnt, int &nCnt,
-                                  std::vector<frRect> &rects, std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap);
-      bool genGuides_astar(frNet *net,
-                           std::vector<bool> &adjVisited, std::vector<int> &adjPrevIdx, 
-                           std::map<std::pair<frPoint, frLayerNum>, std::set<int> > &nodeMap, int &gCnt, int &nCnt, bool forceFeedThrough, bool retry);
-      void genGuides_final(frNet *net, std::vector<frRect> &rects, std::vector<bool> &adjVisited, std::vector<int> &adjPrevIdx, int gCnt, int nCnt,
-                           std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap);
-
-      // write guide
-      void writeGuideFile();
-    };
-    class Writer {
-    public:
-      // constructors
-      //Writer(): tech(std::make_shared<frTechObject>()), design(std::make_shared<frDesign>()) {};
-      Writer(frDesign* designIn): tech(designIn->getTech()), design(designIn) {}
-      // getters
-      frTechObject* getTech() const {
-        return tech;
-      }
-      frDesign* getDesign() const {
-        return design;
-      }
-      // others
-      void writeFromTA();
-      void writeFromDR(const std::string &str = "");
-      std::map< frString, std::list<std::shared_ptr<frConnFig> > > connFigs; // all connFigs ready to def
-    protected:
-      frTechObject*                                  tech;
-      frDesign*                                      design;
-      //std::list< // temp for merge and split
-      
-
-      void fillConnFigs(bool isTA);
-      void fillConnFigs_net(frNet* net, bool isTA);
-      void mergeSplitConnFigs(std::list<std::shared_ptr<frConnFig> > &connFigs);
-      void splitVia_helper(frLayerNum layerNum, int isH, frCoord trackLoc, frCoord x, frCoord y, 
-                           std::vector< std::vector< std::map<frCoord, std::vector<std::shared_ptr<frPathSeg> > > > > &mergedPathSegs);
-      int writeDef(bool isTA, const std::string &str = "");
-    };
-  }
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/io_guide.cpp b/scripts/pdn/src/PdnPinDumper/src/io/io_guide.cpp
deleted file mode 100644
index cfb41ad..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/io_guide.cpp
+++ /dev/null
@@ -1,969 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#include <chrono>
-#include "io/io.h"
-
-using namespace std;
-using namespace fr;
-/* note: M1 guide special treatment. search "no M1 cross-gcell routing allowed" */
-
-void io::Parser::genGuides_merge(vector<frRect> &rects, vector<map<frCoord, boost::icl::interval_set<frCoord> > > &intvs) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //auto &gp = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gp[0];
-  //auto &ygp = gp[1];
-  // use frCoord to prevent negative problems
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  //frCoord GCELLOFFSETX = xgp.getStartCoord();
-  //frCoord GCELLOFFSETY = ygp.getStartCoord();
-  //frCoord GCELLCNTX    = xgp.getCount();
-  //frCoord GCELLCNTY    = ygp.getCount();
-
-  for (auto &rect: rects) {
-    frBox box;
-    rect.getBBox(box);
-    //frCoord x1 = (box.lowerLeft().x()  - GCELLOFFSETX)     / GCELLGRIDX;
-    //frCoord y1 = (box.lowerLeft().y()  - GCELLOFFSETY)     / GCELLGRIDY;
-    frPoint idx;
-    frPoint pt(box.lowerLeft());
-    design->getTopBlock()->getGCellIdx(pt, idx);
-    frCoord x1 = idx.x();
-    frCoord y1 = idx.y();
-    //frCoord x2 = (box.upperRight().x() - GCELLOFFSETX - 1) / GCELLGRIDX;
-    //frCoord y2 = (box.upperRight().y() - GCELLOFFSETY - 1) / GCELLGRIDY;
-    pt.set(box.right() - 1, box.top() - 1);
-    design->getTopBlock()->getGCellIdx(pt, idx);
-    frCoord x2 = idx.x();
-    frCoord y2 = idx.y();
-    if (enableOutput) {
-      cout << " rect " << rect << " " << x1 << " " << y1 << " " << x2 << " " << y2 << "\n";
-    }
-    auto layerNum = rect.getLayerNum();
-    //if (x1 > x2 || y1 > y2) {
-    //  cout <<"Error: genGuides start > end" <<endl;
-    //  exit(1);
-    //}
-    //if (x1 >= (int)GCELLCNTX) {
-    //  x1 = (int)GCELLCNTX - 1;
-    //}
-    //if (y1 >= (int)GCELLCNTY) {
-    //  y1 = (int)GCELLCNTY - 1;
-    //}
-    //if (x2 >= (int)GCELLCNTX) {
-    //  x2 = (int)GCELLCNTX - 1;
-    //}
-    //if (y2 >= (int)GCELLCNTY) {
-    //  y2 = (int)GCELLCNTY - 1;
-    //}
-    if (tech->getLayer(layerNum)->getDir() == frcHorzPrefRoutingDir) {
-      for (auto i = y1; i <= y2; i++) {
-        intvs[layerNum][i].insert(boost::icl::interval<frCoord>::closed(x1, x2));
-        if (enableOutput) {
-          cout <<"push " <<layerNum <<" " <<i <<" " <<x1 <<" " <<x2 <<endl;
-        }
-      }
-    } else {
-      for (auto i = x1; i <= x2; i++) {
-        intvs[layerNum][i].insert(boost::icl::interval<frCoord>::closed(y1, y2));
-        if (enableOutput) {
-          cout <<"push " <<layerNum <<" " <<i <<" " <<y1 <<" " <<y2 <<endl;
-        }
-      }
-    }
-  }
-  // trackIdx, beginIdx, endIdx, layerNum
-  vector<tuple<frCoord, frCoord, frCoord, frLayerNum> > touchGuides;
-  // append touching edges
-  for (int lNum = 0; lNum < (int)intvs.size(); lNum++) {
-    auto &m = intvs[lNum];
-    int prevTrackIdx = -2;
-    for (auto &[trackIdx, intvS]: m) {
-      if (trackIdx == prevTrackIdx + 1) {
-        auto &prevIntvS = m[prevTrackIdx];
-        auto newIntv = intvS & prevIntvS;
-        for (auto it = newIntv.begin(); it != newIntv.end(); it++) {
-          auto beginIdx = it->lower();
-          auto endIdx   = it->upper();
-          bool haveLU = false;
-          // lower layer intersection
-          if (lNum - 2 >= 0) {
-            auto nbrLayerNum = lNum - 2;
-            for (auto it2 = intvs[nbrLayerNum].lower_bound(beginIdx); 
-                      it2 != intvs[nbrLayerNum].end() && it2->first <= endIdx; it2++) {
-              if (boost::icl::contains(it2->second, trackIdx) &&
-                  boost::icl::contains(it2->second, prevTrackIdx)) {
-                haveLU = true;
-                break;
-              }
-            }
-          }
-          if (lNum + 2 < (int)intvs.size() && !haveLU) {
-            auto nbrLayerNum = lNum + 2;
-            for (auto it2 = intvs[nbrLayerNum].lower_bound(beginIdx); 
-                      it2 != intvs[nbrLayerNum].end() && it2->first <= endIdx; it2++) {
-              if (boost::icl::contains(it2->second, trackIdx) &&
-                  boost::icl::contains(it2->second, prevTrackIdx)) {
-                haveLU = true;
-                break;
-              }
-            }
-          }
-          if (!haveLU) {
-            // add touching guide;
-            //cout <<"found touching guide" <<endl;
-            if (lNum + 2 < (int)intvs.size()) {
-              touchGuides.push_back(make_tuple(beginIdx, prevTrackIdx, trackIdx, lNum + 2));
-            } else if (lNum - 2 >= 0) {
-              touchGuides.push_back(make_tuple(beginIdx, prevTrackIdx, trackIdx, lNum - 2));
-            } else {
-              cout <<"Error: genGuides_merge cannot find touching layer" <<endl;
-              exit(1);
-            }
-          }
-        }
-      }
-      prevTrackIdx = trackIdx;
-    }
-  }
-
-  for (auto &[trackIdx, beginIdx, endIdx, lNum]: touchGuides) {
-    intvs[lNum][trackIdx].insert(boost::icl::interval<frCoord>::closed(beginIdx, endIdx));
-  }
-  if (enableOutput) {
-    if (touchGuides.size()) {
-      cout <<"found " <<touchGuides.size() <<" touching guides" <<endl;
-    }
-  }
-
-}
-
-void io::Parser::genGuides_split(vector<frRect> &rects, vector<map<frCoord, boost::icl::interval_set<frCoord> > > &intvs,
-                                 map<pair<frPoint, frLayerNum>, set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap,
-                                 map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap,
-                                 bool retry) {
-
-  rects.clear();
-  //layerNum->trackIdx->beginIdx->set of obj
-  vector<map<frCoord, map<frCoord, set<frBlockObject*, frBlockObjectComp> > > > pin_helper(design->getTech()->getLayers().size());
-  for (auto &[pr, objS]: gCell2PinMap) {
-    auto &point = pr.first;
-    auto &lNum  = pr.second;
-    if (design->getTech()->getLayer(lNum)->getDir() == frcHorzPrefRoutingDir) {
-      pin_helper[lNum][point.y()][point.x()] = objS;
-    } else {
-      pin_helper[lNum][point.x()][point.y()] = objS;
-    }
-  }
-
-  for (int layerNum = 0; layerNum < (int)intvs.size(); layerNum++) {
-    auto dir = design->getTech()->getLayer(layerNum)->getDir();
-    for (auto &[trackIdx, curr_intvs]: intvs[layerNum]) {
-      // split by lower/upper seg
-      for (auto it = curr_intvs.begin(); it != curr_intvs.end(); it++) {
-        set<frCoord> lineIdx;
-        auto beginIdx = it->lower();
-        auto endIdx   = it->upper();
-        // hardcode layerNum == 0 not used for GR
-        if (!retry && layerNum == 0) {
-          // split by pin
-          if (pin_helper[layerNum].find(trackIdx) != pin_helper[layerNum].end()) {
-            auto &pin_helper_map = pin_helper[layerNum][trackIdx];
-            for (auto it2 = pin_helper_map.lower_bound(beginIdx); 
-                 it2 != pin_helper_map.end() && it2->first <= endIdx; it2++) {
-              //add pin2GCellmap
-              for (auto obj: it2->second) {
-                if (dir == frcHorzPrefRoutingDir) {
-                  pin2GCellMap[obj].insert(make_pair(frPoint(it2->first, trackIdx), layerNum));
-                } else {
-                  pin2GCellMap[obj].insert(make_pair(frPoint(trackIdx, it2->first), layerNum));
-                }
-              }
-              //cout <<"pin split" <<endl;
-            }
-          }
-          for (int x = beginIdx; x <= endIdx; x++) {
-            frRect tmpRect;
-            if (dir == frcHorzPrefRoutingDir) {
-              tmpRect.setBBox(frBox(x, trackIdx, x, trackIdx));
-            } else {
-              tmpRect.setBBox(frBox(trackIdx, x, trackIdx, x));
-            }
-            tmpRect.setLayerNum(layerNum);
-            rects.push_back(tmpRect);
-          }
-        } else {
-          //lineIdx.insert(beginIdx);
-          //lineIdx.insert(endIdx);
-          // lower layer intersection
-          if (layerNum - 2 >= 0) {
-            auto nbrLayerNum = layerNum - 2;
-            for (auto it2 = intvs[nbrLayerNum].lower_bound(beginIdx); 
-                      it2 != intvs[nbrLayerNum].end() && it2->first <= endIdx; it2++) {
-              if (boost::icl::contains(it2->second, trackIdx)) {
-                lineIdx.insert(it2->first); //it2->first is intersection frCoord
-                //cout <<"found split point" <<endl;
-              }
-            }
-          }
-          if (layerNum + 2 < (int)intvs.size()) {
-            auto nbrLayerNum = layerNum + 2;
-            for (auto it2 = intvs[nbrLayerNum].lower_bound(beginIdx); 
-                      it2 != intvs[nbrLayerNum].end() && it2->first <= endIdx; it2++) {
-              if (boost::icl::contains(it2->second, trackIdx)) {
-                lineIdx.insert(it2->first);
-                //cout <<"found split point" <<endl;
-              }
-            }
-          }
-          // split by pin
-          if (pin_helper[layerNum].find(trackIdx) != pin_helper[layerNum].end()) {
-            auto &pin_helper_map = pin_helper[layerNum][trackIdx];
-            for (auto it2 = pin_helper_map.lower_bound(beginIdx); 
-                 it2 != pin_helper_map.end() && it2->first <= endIdx; it2++) {
-              lineIdx.insert(it2->first);
-              //add pin2GCellmap
-              for (auto obj: it2->second) {
-                if (dir == frcHorzPrefRoutingDir) {
-                  pin2GCellMap[obj].insert(make_pair(frPoint(it2->first, trackIdx), layerNum));
-                } else {
-                  pin2GCellMap[obj].insert(make_pair(frPoint(trackIdx, it2->first), layerNum));
-                }
-              }
-              //cout <<"pin split" <<endl;
-            }
-          }
-          // add rect
-          if (lineIdx.empty()) {
-            cout <<"Error: genGuides_split lineIdx is empty" <<endl;
-            exit(1);
-          } else if (lineIdx.size() == 1) {
-            auto x = *(lineIdx.begin());
-            frRect tmpRect;
-            if (dir == frcHorzPrefRoutingDir) {
-              tmpRect.setBBox(frBox(x, trackIdx, x, trackIdx));
-            } else {
-              tmpRect.setBBox(frBox(trackIdx, x, trackIdx, x));
-            }
-            tmpRect.setLayerNum(layerNum);
-            rects.push_back(tmpRect);
-          } else {
-            auto prevIt = lineIdx.begin();
-            for (auto currIt = (++(lineIdx.begin())); currIt != lineIdx.end(); currIt++) {
-              frRect tmpRect;
-              if (dir == frcHorzPrefRoutingDir) {
-                tmpRect.setBBox(frBox(*prevIt, trackIdx, *currIt, trackIdx));
-              } else {
-                tmpRect.setBBox(frBox(trackIdx, *prevIt, trackIdx, *currIt));
-              }
-              tmpRect.setLayerNum(layerNum);
-              prevIt = currIt;
-              rects.push_back(tmpRect);
-            }
-          }
-        }
-      }
-    }
-  }
-  rects.shrink_to_fit();
-}
-
-
-void io::Parser::genGuides_gCell2TermMap(map<pair<frPoint, frLayerNum>, set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap, 
-                                         map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap, 
-                                         frTerm* term, frBlockObject* origTerm) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  //auto &gp = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gp[0];
-  //auto &ygp = gp[1];
-  // frCoord to prevent negative problems
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  //frCoord GCELLOFFSETX = xgp.getStartCoord();
-  //frCoord GCELLOFFSETY = ygp.getStartCoord();
-  //frCoord GCELLCNTX    = xgp.getCount();
-  //frCoord GCELLCNTY    = ygp.getCount();
-
-  for (auto &uPin: term->getPins()) {
-    for (auto &uFig: uPin->getFigs()) {
-      auto fig = uFig.get();
-      if (fig->typeId() == frcRect) {
-        auto shape = static_cast<frRect*>(fig);
-        auto lNum  = shape->getLayerNum();
-        frBox box;
-        shape->getBBox(box);
-        if (enableOutput) {
-          cout <<"  box " <<box <<endl;
-        }
-        //frCoord x1 = (box.lowerLeft().x() - 1  - GCELLOFFSETX) / GCELLGRIDX;
-        //frCoord y1 = (box.lowerLeft().y() - 1  - GCELLOFFSETY) / GCELLGRIDY;
-        frPoint idx;
-        frPoint pt(box.left() - 1, box.bottom() - 1);
-        design->getTopBlock()->getGCellIdx(pt, idx);
-        frCoord x1 = idx.x();
-        frCoord y1 = idx.y();
-        //frCoord x2 = (box.upperRight().x()     - GCELLOFFSETX) / GCELLGRIDX;
-        //frCoord y2 = (box.upperRight().y()     - GCELLOFFSETY) / GCELLGRIDY;
-        pt.set(box.upperRight());
-        design->getTopBlock()->getGCellIdx(pt, idx);
-        frCoord x2 = idx.x();
-        frCoord y2 = idx.y();
-        // ispd18_test4 and ispd18_test5 have zero overlap guide
-        // excludes double-zero overlap area on the upper-right corner due to initDR requirements
-        bool condition2 = false; // upper right corner has zero-length overlapped with gcell
-        frBox gcellBox;
-        frPoint tmpIdx;
-        design->getTopBlock()->getGCellIdx(box.lowerLeft(), tmpIdx);
-        design->getTopBlock()->getGCellBox(tmpIdx, gcellBox);
-        if (box.lowerLeft() == gcellBox.lowerLeft()) {
-          condition2 = true;
-        }
-        //if ((box.lowerLeft().x() == (x1 + 1) * (int)GCELLGRIDX + (int)GCELLOFFSETX) &&
-        //    (box.lowerLeft().y() == (y1 + 1) * (int)GCELLGRIDY + (int)GCELLOFFSETY)) {
-        //  condition2 = true;
-        //}
-        //if (x1 < 0) {
-        //  cout <<"Warning: genGuides x1 < 0, automatically set to 0" <<endl;
-        //  //exit(1);
-        //  x1 = 0;
-        //}
-        //if (y1 < 0) {
-        //  cout <<"Warning: genGuides y1 < 0, automatically set to 0" <<endl;
-        //  //exit(1);
-        //  y1 = 0;
-        //}
-        //if (x1 > x2 || y1 > y2) {
-        //  cout <<"Error: genGuides_gCell2TermMap start > end" <<endl;
-        //  cout <<"  x1/x2, y1/y2 = " <<x1 <<" " <<x2 <<" " <<y1 <<" " <<y2 <<endl;
-        //  exit(1);
-        //}
-        //if (x1 >= (int)GCELLCNTX) {
-        //  x1 = GCELLCNTX - 1;
-        //}
-        //if (x2 >= (int)GCELLCNTX) {
-        //  //cout <<"Warning: genGuides x2 >= GCELLCNTX, automatically set to GCELLCNTX" <<endl;
-        //  //cout <<"  bbox " <<box <<" " <<lNum <<endl;
-        //  //exit(1);
-        //  x2 = GCELLCNTX - 1;
-        //}
-        //if (y1 >= (int)GCELLCNTY) {
-        //  y1 = GCELLCNTY - 1;
-        //}
-        //if (y2 >= (int)GCELLCNTY) {
-        //  //cout <<"Warning: genGuides y2 >= GCELLCNTY, automatically set to GCELLCNTY" <<endl;
-        //  //cout <<"  bbox " <<box <<" " <<lNum <<endl;
-        //  //exit(1);
-        //  y2 = GCELLCNTY - 1;
-        //}
-        for (int x = x1; x <= x2; x++) {
-          for (int y = y1; y <= y2; y++) {
-            if (condition2 && x == tmpIdx.x() - 1 && y == tmpIdx.y() - 1) {
-              if (VERBOSE > 0) {
-                cout <<"Warning: genGuides_gCell2TermMap avoid condition2, may result in guide open" <<endl;
-              }
-            } else {
-              gCell2PinMap[make_pair(frPoint(x, y), lNum)].insert(origTerm);
-              if (enableOutput) {
-                cout <<" (x,y,lNum) = (" <<x <<", " <<y <<", " <<lNum <<")" <<endl;
-              }
-            }
-            //pin2GCellMap[origTerm].insert(make_pair(frPoint(x,y), lNum));
-          }
-        }
-      } else {
-        cout <<"Error: genGuides_gCell2TermMap unsupoprted pinfig" <<endl;
-        exit(1);
-      }
-    }
-  }
-}
-
-void io::Parser::genGuides_gCell2PinMap(frNet* net, map<pair<frPoint, frLayerNum>, set<frBlockObject*, frBlockObjectComp> > &gCell2PinMap,
-    map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  for (auto &instTerm: net->getInstTerms()) {
-    if (enableOutput) {
-      cout <<"instTerm " <<instTerm->getInst()->getName() <<"/" <<instTerm->getTerm()->getName() <<endl;
-    }
-    //frTransform xform;
-    //instTerm->getInst()->getTransform(xform);
-    //frBox   mbox;
-    //instTerm->getInst()->getRefBlock()->getBoundaryBBox(mbox);
-    //frPoint size(mbox.right(), mbox.top());
-    //xform.updateXform(size);
-    frTransform xform;
-    instTerm->getInst()->getUpdatedXform(xform);
-    auto origTerm = instTerm->getTerm();
-    auto uTerm = make_unique<frTerm>(*origTerm, xform);
-    auto term = uTerm.get();
-    genGuides_gCell2TermMap(gCell2PinMap, pin2GCellMap, term, instTerm);
-    //if (pin2GCellMap.find(origTerm) == pin2GCellMap.end() || pin2GCellMap[origTerm].empty()) {
-    //  cout <<"Error: gcell not cover " <<instTerm->getInst()->getName() <<"/" <<origTerm->getName() <<endl;
-    //  exit(1);
-    //}
-  }
-  for (auto &term: net->getTerms()) {
-    if (enableOutput) {
-      cout <<"    term PIN/" <<term->getName() <<endl;
-    }
-    genGuides_gCell2TermMap(gCell2PinMap, pin2GCellMap, term, term);
-    //if (pin2GCellMap.find(term) == pin2GCellMap.end() || pin2GCellMap[term].empty()) {
-    //  cout <<"Error: gcell not cover PIN/" <<term->getName() <<endl;
-    //  exit(1);
-    //}
-  }
-}
-
-void io::Parser::genGuides_initPin2GCellMap(frNet* net, std::map<frBlockObject*, std::set<std::pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap) {
-  for (auto &instTerm: net->getInstTerms()) {
-    pin2GCellMap[instTerm];
-  }
-  for (auto &term: net->getTerms()) {
-    pin2GCellMap[term];
-  }
-}
-
-void io::Parser::genGuides(frNet *net, vector<frRect> &rects) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //cout <<"net " <<net->getName() <<endl <<flush;
-  vector<map<frCoord, boost::icl::interval_set<frCoord> > > intvs(tech->getLayers().size());
-  genGuides_merge(rects, intvs); // merge and add touching guide
-  //cout <<"merge done" <<endl <<flush;
-  
-  // gcell to pin map
-  map<pair<frPoint, frLayerNum>, set<frBlockObject*, frBlockObjectComp> > gCell2PinMap;
-  map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> pin2GCellMap; 
-  genGuides_gCell2PinMap(net, gCell2PinMap, pin2GCellMap);
-  //cout <<"gcell2pin map done" <<endl <<flush;
-  genGuides_initPin2GCellMap(net, pin2GCellMap);
-  //cout <<"init pin2gcell done" <<endl <<flush;
-
-  bool retry = false;
-  while(1) {
-    genGuides_split(rects, intvs, gCell2PinMap, pin2GCellMap, retry); //split on LU intersecting guides and pins
-    //cout <<"split done" <<endl <<flush;
-
-    // filter pin2GCellMap with aps
-    
-    if (enableOutput) {
-      for (auto &[gcell, objS]: gCell2PinMap) {
-        cout <<"gcell (" <<gcell.first.x() <<", " <<gcell.first.y() <<") " <<gcell.second <<endl;
-        for (auto obj: objS) {
-          if (obj->typeId() == frcInstTerm) {
-            auto ptr = static_cast<frInstTerm*>(obj);
-            cout <<"  pin " <<ptr->getInst()->getName() <<"/" <<ptr->getTerm()->getName() <<endl; 
-          } else if (obj->typeId() == frcTerm) {
-            auto ptr = static_cast<frTerm*>(obj);
-            cout <<"  pin PIN/" <<ptr->getName() <<endl; 
-          } else {
-            cout <<"Error: genGuides unknown type" <<endl; 
-          }
-        }
-      }
-      for (auto &[obj, locS]: pin2GCellMap) {
-        if (obj->typeId() == frcInstTerm) {
-          auto ptr = static_cast<frInstTerm*>(obj);
-          cout <<"pin " <<ptr->getInst()->getName() <<"/" <<ptr->getTerm()->getName() <<endl; 
-        } else if (obj->typeId() == frcTerm) {
-          auto ptr = static_cast<frTerm*>(obj);
-          cout <<"pin PIN/" <<ptr->getName() <<endl; 
-        } else {
-          cout <<"Error: genGuides unknown type" <<endl; 
-        }
-        for (auto &[pt, lNum]: locS) {
-          cout <<"  gcell (" <<pt.x() <<", " <<pt.y() <<") " <<lNum <<endl;
-        }
-      }
-      int i = 0;
-      for (auto &rect: rects) {
-        frBox box;
-        rect.getBBox(box);
-        cout <<"guide ms " <<i <<" " <<box <<" " <<design->getTech()->getLayer(rect.getLayerNum())->getName() <<endl;
-        i++;
-      }
-    }
-    
-
-    if (pin2GCellMap.empty()) {
-      cout <<"Error: genGuides empty pin2GCellMap" <<endl; 
-      cout <<" gcell2pin.size() = " <<gCell2PinMap.size() <<endl;
-    }
-    for (auto &[obj, locS]: pin2GCellMap) {
-      if (locS.empty()) {
-        if (obj->typeId() == frcInstTerm) {
-          auto ptr = static_cast<frInstTerm*>(obj);
-          cout <<"Error: pin " <<ptr->getInst()->getName() <<"/" <<ptr->getTerm()->getName() <<" not covered by guide" <<endl; 
-        } else if (obj->typeId() == frcTerm) {
-          auto ptr = static_cast<frTerm*>(obj);
-          cout <<"Error: pin PIN/" <<ptr->getName() <<" not covered by guide" <<endl; 
-        } else {
-          cout <<"Error: genGuides unknown type" <<endl; 
-        }
-      }
-    }
-
-    // steiner (i.e., gcell end and pin gcell idx) to guide idx (pin idx)
-    map<pair<frPoint, frLayerNum>, set<int> > nodeMap;
-    int gCnt = 0;
-    int nCnt = 0;
-    genGuides_buildNodeMap(nodeMap, gCnt, nCnt, rects, pin2GCellMap);
-    //cout <<"build node map done" <<endl <<flush;
-
-    vector<bool> adjVisited;
-    vector<int>  adjPrevIdx;
-    if (genGuides_astar(net, adjVisited, adjPrevIdx, nodeMap, gCnt, nCnt, false, retry)) {
-      //cout <<"astar done" <<endl <<flush;
-      genGuides_final(net, rects, adjVisited, adjPrevIdx, gCnt, nCnt, pin2GCellMap);
-      break;
-    } else {
-      if (retry) {
-        if (!ALLOW_PIN_AS_FEEDTHROUGH) {
-          if (genGuides_astar(net, adjVisited, adjPrevIdx, nodeMap, gCnt, nCnt, true, retry)) {
-            genGuides_final(net, rects, adjVisited, adjPrevIdx, gCnt, nCnt, pin2GCellMap);
-            break;
-          } else {
-            cout <<"Error: critical error guide not connected, exit now 1!" <<endl;
-            exit(1);
-          }
-        } else {
-          cout <<"Error: critical error guide not connected, exit now 2!" <<endl;
-          exit(1);
-        }
-      } else {
-        retry = true;
-      }
-    }
-    //build guide
-    //map<int, int> pinGuideResidency;
-    //genGuides_final(net, rects, adjVisited, adjPrevIdx, gCnt, nCnt, pin2GCellMap);
-    //cout <<"final done" <<endl <<flush;
-    //break;
-  }
-}
-
-void io::Parser::genGuides_final(frNet *net, vector<frRect> &rects, vector<bool> &adjVisited, vector<int> &adjPrevIdx, int gCnt, int nCnt,
-                                 map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  vector<frBlockObject*> pin2ptr;
-  for (auto &[obj, idxS]: pin2GCellMap) {
-    pin2ptr.push_back(obj);
-  }
-  // find pin in which guide
-  //vector<vector<int> > pinIdx2Guides(nCnt - gCnt);
-  vector<vector<pair<frPoint, frLayerNum> > > pinIdx2GCellUpdated(nCnt - gCnt);
-  vector<vector<int> > guideIdx2Pins(gCnt);
-  for (int i = 0; i < (int)adjPrevIdx.size(); i++) {
-    if (!adjVisited[i]) {
-      continue;
-    }
-    if (i < gCnt && adjPrevIdx[i] >= gCnt) {
-      // pin idx = adjPrevIdx[i] - gCnt
-      // guide idx = i
-      //pinInGuides[adjPrevIdx[i] - gCnt].push_back(i);
-      auto pinIdx = adjPrevIdx[i] - gCnt;
-      auto guideIdx = i;
-      frBox box;
-      auto &rect = rects[guideIdx];
-      rect.getBBox(box);
-      auto lNum = rect.getLayerNum();
-      auto obj = pin2ptr[pinIdx];
-      //cout <<" pin1 id " <<adjPrevIdx[i] <<" prev " <<i <<endl;
-      if (pin2GCellMap[obj].find(make_pair(box.lowerLeft(), lNum)) != pin2GCellMap[obj].end()) {
-        pinIdx2GCellUpdated[pinIdx].push_back(make_pair(box.lowerLeft(), lNum));
-      } else if (pin2GCellMap[obj].find(make_pair(box.upperRight(), lNum)) != pin2GCellMap[obj].end()) {
-        pinIdx2GCellUpdated[pinIdx].push_back(make_pair(box.upperRight(), lNum));
-      } else {
-        cout <<"Error: genGuides_final error 1" <<endl;
-      }
-      guideIdx2Pins[guideIdx].push_back(pinIdx);
-    } else if (i >= gCnt && adjPrevIdx[i] >= 0 && adjPrevIdx[i] < gCnt) {
-      // pin idx = i
-      // guide idx = adjPrevIdx[i]
-      //pinInGuides[i - gCnt].push_back(adjPrevIdx[i]);
-      auto pinIdx = i - gCnt;
-      auto guideIdx = adjPrevIdx[i];
-      frBox box;
-      auto &rect = rects[guideIdx];
-      rect.getBBox(box);
-      auto lNum = rect.getLayerNum();
-      auto obj = pin2ptr[pinIdx];
-      //cout <<" pin2 id " <<i <<" prev " <<adjPrevIdx[i] <<endl;
-      if (pin2GCellMap[obj].find(make_pair(box.lowerLeft(), lNum)) != pin2GCellMap[obj].end()) {
-        pinIdx2GCellUpdated[pinIdx].push_back(make_pair(box.lowerLeft(), lNum));
-      } else if (pin2GCellMap[obj].find(make_pair(box.upperRight(), lNum)) != pin2GCellMap[obj].end()) {
-        pinIdx2GCellUpdated[pinIdx].push_back(make_pair(box.upperRight(), lNum));
-      } else {
-        cout <<"Error: genGuides_final error 2" <<endl;
-      }
-      guideIdx2Pins[guideIdx].push_back(pinIdx);
-    }
-  }
-  for (auto &guides: pinIdx2GCellUpdated) {
-    if (guides.empty()) {
-      cout <<"Error: genGuides_final pin not in any guide" <<endl;
-    }
-  }
-  
-  //auto &gp = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gp[0];
-  //auto &ygp = gp[1];
-  //// use frCoord to prevent negative problems
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  //frCoord GCELLOFFSETX = xgp.getStartCoord();
-  //frCoord GCELLOFFSETY = ygp.getStartCoord();
-  //frCoord GCELLCNTX    = xgp.getCount();
-  //frCoord GCELLCNTY    = ygp.getCount();
-   
-  map<pair<frPoint, frLayerNum>, set<int> > updatedNodeMap;
-  // pinIdx2GCellUpdated tells pin residency in gcell
-  for (int i = 0; i < nCnt - gCnt; i++) {
-    auto obj = pin2ptr[i];
-    for (auto &[pt, lNum]: pinIdx2GCellUpdated[i]) {
-      //frPoint absPt(pt.x() * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2,
-      //              pt.y() * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2);
-      frPoint absPt;
-      design->getTopBlock()->getGCellCenter(pt, absPt);
-      tmpGRPins.push_back(make_pair(obj, absPt));
-      updatedNodeMap[make_pair(pt, lNum)].insert(i + gCnt);
-      if (enableOutput) {
-        cout <<"pin   final " <<i + gCnt <<" " <<pt <<" " <<design->getTech()->getLayer(lNum)->getName() <<endl;
-      }
-    }
-  }
-  for (int i = 0; i < gCnt; i++) {
-    if (!adjVisited[i]) {
-      continue;
-    }
-    auto &rect = rects[i];
-    frBox box;
-    rect.getBBox(box);
-    updatedNodeMap[make_pair(frPoint(box.left(),  box.bottom()), rect.getLayerNum())].insert(i);
-    updatedNodeMap[make_pair(frPoint(box.right(), box.top()),    rect.getLayerNum())].insert(i);
-    //cout <<"add guide " <<i <<" to " <<frPoint(box.left(),  box.bottom()) <<" " <<rect.getLayerNum() <<endl;
-    //cout <<"add guide " <<i <<" to " <<frPoint(box.right(), box.top())    <<" " <<rect.getLayerNum() <<endl;
-  }
-  for (auto &[pr, idxS]: updatedNodeMap) {
-    auto &[pt, lNum] = pr;
-    if ((int)idxS.size() == 1) {
-      auto idx = *(idxS.begin());
-      if (idx < gCnt) {
-        // no upper/lower guide
-        if (updatedNodeMap.find(make_pair(pt, lNum + 2)) == updatedNodeMap.end() &&
-            updatedNodeMap.find(make_pair(pt, lNum - 2)) == updatedNodeMap.end()) {
-          auto &rect = rects[idx];
-          frBox box;
-          rect.getBBox(box);
-          if (box.lowerLeft() == pt) {
-            rect.setBBox(frBox(box.right(), box.top(), box.right(), box.top()));
-          } else {
-            rect.setBBox(frBox(box.left(), box.bottom(), box.left(), box.bottom()));
-          }
-        }
-      } else {
-        cout <<"Error: pin dangling id " <<idx <<" " <<pt <<" " <<lNum <<endl;
-        exit(1);
-      }
-    }
-  }
-  // guideIdx2Pins enables fiding from guide to pin
-  // adjVisited tells guide to write back
-  for (int i = 0; i < gCnt; i++) {
-    if (!adjVisited[i]) {
-      continue;
-    }
-    auto &rect = rects[i];
-    frBox box;
-    rect.getBBox(box);
-    if (enableOutput) {
-      cout <<"guide final " <<i <<" " <<box <<" " <<design->getTech()->getLayer(rect.getLayerNum())->getName() <<endl;
-    }
-    auto guide = make_unique<frGuide>();
-    frPoint begin, end;
-    //begin.set(box.left()   * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2, 
-    //          box.bottom() * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2);
-    design->getTopBlock()->getGCellCenter(box.lowerLeft(), begin);
-    //end.set(box.right() * GCELLGRIDX + GCELLOFFSETX + GCELLGRIDX / 2, 
-    //        box.top()   * GCELLGRIDY + GCELLOFFSETY + GCELLGRIDY / 2);
-    design->getTopBlock()->getGCellCenter(box.upperRight(), end);
-    guide->setPoints(begin, end);
-    guide->setBeginLayerNum(rect.getLayerNum());
-    guide->setEndLayerNum(rect.getLayerNum());
-    guide->addToNet(net);
-    net->addGuide(guide);
-    //cout <<"add guide " <<begin <<" " <<end <<" " <<rect.getLayerNum() <<endl;
-  }
-}
-
-void io::Parser::genGuides_buildNodeMap(map<pair<frPoint, frLayerNum>, set<int> > &nodeMap, int &gCnt, int &nCnt,
-                                        vector<frRect> &rects, map<frBlockObject*, set<pair<frPoint, frLayerNum> >, frBlockObjectComp> &pin2GCellMap) {
-  bool enableOutput = false;
-  // guideIdx
-  //map<pair<frPoint, frLayerNum>, set<int> > nodeMap;
-  for (int i = 0; i < (int)rects.size(); i++) {
-    auto &rect = rects[i];
-    frBox box;
-    rect.getBBox(box);
-    nodeMap[make_pair(box.lowerLeft(), rect.getLayerNum())].insert(i);
-    nodeMap[make_pair(box.upperRight(), rect.getLayerNum())].insert(i);
-  }
-  gCnt = rects.size(); // total guide cnt
-  int nodeIdx = rects.size();
-  for (auto &[obj, locS]: pin2GCellMap) {
-    if (enableOutput) {
-      if (obj->typeId() == frcInstTerm) {
-        auto instTerm = static_cast<frInstTerm*>(obj);
-        cout <<"instTerm " <<nodeIdx <<" " <<instTerm->getInst()->getName() <<"/" <<instTerm->getTerm()->getName();
-      } else if (obj->typeId() == frcTerm) {
-        auto term = static_cast<frTerm*>(obj);
-        cout <<"term " <<nodeIdx <<" PIN/" <<term->getName();
-      }
-    }
-    for (auto &loc: locS) {
-      nodeMap[loc].insert(nodeIdx);
-      if (enableOutput) {
-        cout <<" " <<loc.first <<" " <<design->getTech()->getLayer(loc.second)->getName();
-      }
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-    nodeIdx++;
-  }
-  nCnt = nodeIdx; // total node cnt
-}
-
-
-
-bool io::Parser::genGuides_astar(frNet* net, vector<bool> &adjVisited, vector<int> &adjPrevIdx, 
-                                 map<pair<frPoint, frLayerNum>, set<int> > &nodeMap, int &gCnt, int &nCnt,
-                                 bool forceFeedThrough, bool retry) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  // a star search
-
-  // node index, node visited
-  vector<vector<int> > adjVec(nCnt, vector<int>());
-  vector<bool> onPathIdx(nCnt, false);
-  adjVisited.clear();
-  adjPrevIdx.clear();
-  adjVisited.resize(nCnt, false);
-  adjPrevIdx.resize(nCnt, -1);
-  //vector<bool> adjVisited(nCnt, false);
-  //vector<int>  adjPrevIdx(nCnt, -1);
-  for (auto &[pr, idxS]: nodeMap) {
-    auto &[pt, lNum] = pr;
-    for (auto it1 = idxS.begin(); it1 != idxS.end(); it1++) {
-      auto it2 = it1;
-      it2++;
-      auto idx1 = *it1;
-      for (; it2 != idxS.end(); it2++) {
-        auto idx2 = *it2;
-        // two pins, no edge
-        if (idx1 >= gCnt && idx2 >= gCnt) {
-          continue;
-        // two gcells, has edge
-        } else if (idx1 < gCnt && idx2 < gCnt) {
-          // no M1 cross-gcell routing allowed
-          if (lNum != 0) {
-            adjVec[idx1].push_back(idx2);
-            adjVec[idx2].push_back(idx1);
-          }
-          //cout <<"add edge1 " <<idx1 <<" " <<idx2 <<endl;
-        // one pin, one gcell
-        } else {
-          auto gIdx = min(idx1, idx2);
-          auto pIdx = max(idx1, idx2);
-          // only out edge
-          if (ALLOW_PIN_AS_FEEDTHROUGH || forceFeedThrough) {
-            adjVec[pIdx].push_back(gIdx);
-            adjVec[gIdx].push_back(pIdx);
-          } else {
-            if (pIdx == gCnt) {
-              adjVec[pIdx].push_back(gIdx);
-              //cout <<"add edge2 " <<pIdx <<" " <<gIdx <<endl;
-            // only in edge
-            } else {
-              adjVec[gIdx].push_back(pIdx);
-              //cout <<"add edge3 " <<gIdx <<" " <<pIdx <<endl;
-            }
-          }
-        }
-      }
-      // add intersecting guide2guide edge excludes pin
-      if (idx1 < gCnt && nodeMap.find(make_pair(pt, lNum + 2)) != nodeMap.end()) {
-        for (auto nbrIdx: nodeMap[make_pair(pt, lNum + 2)]) {
-          if (nbrIdx < gCnt) {
-            adjVec[idx1].push_back(nbrIdx);
-            adjVec[nbrIdx].push_back(idx1);
-            //cout <<"add edge4 " <<idx1 <<" " <<nbrIdx <<endl;
-            //cout <<"add edge5 " <<nbrIdx <<" " <<idx1 <<endl;
-          }
-        }
-      }
-    }
-  }
-
-  struct wf {
-    int nodeIdx;
-    int prevIdx;
-    int cost;
-    bool operator<(const wf &b) const {
-      if (cost == b.cost) {
-        return nodeIdx > b.nodeIdx;
-      } else {
-        return cost > b.cost;
-      }
-    }
-  };
-  for (int findNode = gCnt; findNode < nCnt - 1; findNode++) {
-    //adjVisited = onPathIdx;
-    //cout <<"finished " <<findNode <<" nodes" <<endl;
-    priority_queue<wf> pq;
-    if (enableOutput) {
-      //cout <<"visit";
-    }
-    if (findNode == gCnt) {
-      // push only first pin into pq
-      pq.push({gCnt, -1, 0});
-    } else {
-      // push every visited node into pq
-      for (int i = 0; i < nCnt; i++) {
-        //if (adjVisited[i]) {
-        if (onPathIdx[i]) {
-          // penalize feedthrough in normal mode
-          if (ALLOW_PIN_AS_FEEDTHROUGH && i >= gCnt) {
-            pq.push({i, adjPrevIdx[i], 2});
-          // penalize feedthrough in fallback mode
-          } else if (forceFeedThrough && i >= gCnt) {
-            pq.push({i, adjPrevIdx[i], 10});
-          } else {
-            pq.push({i, adjPrevIdx[i], 0});
-          }
-        }
-      }
-    }
-    int lastNodeIdx = -1;
-    while (!pq.empty()) {
-      auto wfront = pq.top();
-      pq.pop();
-      if (!onPathIdx[wfront.nodeIdx] && adjVisited[wfront.nodeIdx]) {
-        continue;
-      }
-      if (wfront.nodeIdx > gCnt && wfront.nodeIdx < nCnt && adjVisited[wfront.nodeIdx] == false) {
-        adjVisited[wfront.nodeIdx] = true;
-        adjPrevIdx[wfront.nodeIdx] = wfront.prevIdx;
-        if (enableOutput) {
-          //cout <<" " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<" exit" <<endl;
-          cout <<"visit " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<" exit" <<endl;
-        }
-        lastNodeIdx = wfront.nodeIdx;
-        break;
-      }
-      adjVisited[wfront.nodeIdx] = true;
-      adjPrevIdx[wfront.nodeIdx] = wfront.prevIdx;
-      if (enableOutput) {
-        //cout <<" " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")";
-        cout <<"visit " <<wfront.nodeIdx <<" (" <<wfront.cost <<"," <<wfront.prevIdx <<")" <<endl;
-      }
-      // visit other nodes
-      for (auto nbrIdx: adjVec[wfront.nodeIdx]) {
-        if (!adjVisited[nbrIdx]) {
-          pq.push({nbrIdx, wfront.nodeIdx, wfront.cost + 1});
-          if (enableOutput) {
-            cout <<"push " <<nbrIdx <<endl;
-          }
-        }
-      }
-    }
-    // trace back path
-    if (enableOutput) {
-      cout <<"trace back id";
-    }
-    while ((lastNodeIdx != -1) && (!onPathIdx[lastNodeIdx])) {
-      onPathIdx[lastNodeIdx] = true;
-      if (enableOutput) {
-        cout <<" " <<lastNodeIdx <<" (" <<adjPrevIdx[lastNodeIdx] <<")";
-      }
-      lastNodeIdx = adjPrevIdx[lastNodeIdx];
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-    adjVisited = onPathIdx;
-  }
-  if (enableOutput) {
-  cout <<"stat: " <<net->getName() <<" #guide/#pin/#unused = " <<gCnt <<"/" <<nCnt - gCnt <<"/" 
-       <<nCnt - count(adjVisited.begin(), adjVisited.end(), true) <<endl;
-  }
-  int pinVisited = count(adjVisited.begin() + gCnt, adjVisited.end(), true);
-  // true error when allowing feedthrough
-  if (pinVisited != nCnt - gCnt && (ALLOW_PIN_AS_FEEDTHROUGH || forceFeedThrough) && retry) {
-    cout <<"Error: " <<net->getName() <<" " <<nCnt - gCnt - pinVisited <<" pin not visited #guides = " <<gCnt <<endl;
-    if (enableOutput) {
-      for (int i = gCnt; i < nCnt; i++) {
-        if (!adjVisited[i]) {
-          cout <<"  pin id = " <<i <<endl;
-        }
-      }
-    }
-  }
-  // fallback to feedthrough in next iter
-  if (pinVisited != nCnt - gCnt && !ALLOW_PIN_AS_FEEDTHROUGH && !forceFeedThrough && retry) {
-    cout <<"Warning: " <<net->getName() <<" " <<nCnt - gCnt - pinVisited <<" pin not visited, fall back to feedrough mode" <<endl;
-    //if (enableOutput) {
-    //  for (int i = gCnt; i < nCnt; i++) {
-    //    if (!adjVisited[i]) {
-    //      cout <<"  pin id = " <<i <<endl;
-    //    }
-    //  }
-    //}
-  }
-  // fallback to feedthrough in next iter
-  //if (pinVisited != nCnt - gCnt && !retry) {
-  //  cout <<"Warning: " <<net->getName() <<" " <<nCnt - gCnt - pinVisited <<" pin not visited, fall back to retry mode" <<endl;
-  //  //if (enableOutput) {
-  //  //  for (int i = gCnt; i < nCnt; i++) {
-  //  //    if (!adjVisited[i]) {
-  //  //      cout <<"  pin id = " <<i <<endl;
-  //  //    }
-  //  //  }
-  //  //}
-  //}
-  if (pinVisited == nCnt - gCnt) {
-    return true;
-  } else {
-    return false;
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/io_parser_helper.cpp b/scripts/pdn/src/PdnPinDumper/src/io/io_parser_helper.cpp
deleted file mode 100644
index 47e6a4d..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/io_parser_helper.cpp
+++ /dev/null
@@ -1,782 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <chrono>
-#include <iostream>
-#include <boost/graph/connected_components.hpp>
-//#include <boost/property_map/property_map.hpp>
-#include "global.h"
-#include "io/io.h"
-#include "frBaseTypes.h"
-#include <fstream>
-
-#include "frGuidePrep.h"
-using namespace std;
-using namespace fr;
-
-void io::Parser::initDefaultVias() {
-  for (int layerNum = 1; layerNum < (int)tech->getLayers().size(); layerNum += 2) {
-    map<frViaDef*, bool>    isWithinLayer1;
-    map<frViaDef*, bool>    isWithinLayer2;
-    map<frViaDef*, frCoord> layer1Area;
-    map<frViaDef*, frCoord> layer2Area;
-    map<frViaDef*, int>     numCuts;
-    for (auto &uViaDef: tech->getVias()) {
-      auto viaDef = uViaDef.get();
-      if (viaDef->getCutLayerNum() == layerNum && viaDef->getDefault()) {
-        std::cout << "add " << viaDef->getName() << " to layer " << layerNum << "\n";
-        tech->getLayer(layerNum)->addViaDef(viaDef);
-        numCuts[viaDef] = viaDef->getCutFigs().size();
-        isWithinLayer1[viaDef] = true;
-        isWithinLayer2[viaDef] = true;
-        layer1Area[viaDef]     = 0;
-        layer2Area[viaDef]     = 0;
-        for (auto &pinFig: viaDef->getLayer1Figs()) {
-          if (pinFig->typeId() == frcRect) {
-            auto routeLayerNum = viaDef->getLayer1Num();
-            frBox box;
-            pinFig->getBBox(box);
-            layer1Area[viaDef] += (box.right() - box.left()) * (box.top() - box.bottom());
-            if (tech->getLayers().at(routeLayerNum)->getDir() == frcHorzPrefRoutingDir) {
-              if (frCoord(tech->getLayers().at(routeLayerNum)->getWidth()) <= box.top() - box.bottom()) {
-                isWithinLayer1[viaDef] = false;
-              }
-            } else {
-              if (frCoord(tech->getLayers().at(routeLayerNum)->getWidth()) <= box.right() - box.left()) {
-                isWithinLayer1[viaDef] = false;
-              }
-            }
-          } else if (pinFig->typeId() == frcPolygon) {
-            cout <<"Error: initDefaultVias does not support polygons" <<endl;
-            exit(0);
-          } else {
-            cout <<"Error: initDefaultVias cannot find rect or poly shapes" <<endl;
-            exit(0);
-          }
-        }
-        for (auto &pinFig: viaDef->getLayer2Figs()) {
-          if (pinFig->typeId() == frcRect) {
-            auto routeLayerNum = viaDef->getLayer2Num();
-            frBox box;
-            pinFig->getBBox(box);
-            layer2Area[viaDef] += (box.right() - box.left()) * (box.top() - box.bottom());
-            if (tech->getLayers().at(routeLayerNum)->getDir() == frcHorzPrefRoutingDir) {
-              if (frCoord(tech->getLayers().at(routeLayerNum)->getWidth()) <= box.top() - box.bottom()) {
-                isWithinLayer2[viaDef] = false;
-              }
-            } else {
-              if (frCoord(tech->getLayers().at(routeLayerNum)->getWidth()) <= box.right() - box.left()) {
-                isWithinLayer2[viaDef] = false;
-              }
-            }
-          } else if (pinFig->typeId() == frcPolygon) {
-            cout <<"Error: initDefaultVias does not support polygons" <<endl;
-            exit(0);
-          } else {
-            cout <<"Error: initDefaultVias cannot find rect or poly shapes" <<endl;
-            exit(0);
-          }
-        }
-      } else {
-        continue;
-      }
-    }
-      
-    // single-cut only
-    frViaDef* defaultSingleCutVia = nullptr;
-    for (auto &it: numCuts) {
-      auto viaDef = it.first;
-      if (numCuts[viaDef] == 1) {
-        if (isWithinLayer1[viaDef] && isWithinLayer2[viaDef]) {
-          if (defaultSingleCutVia) {
-            auto defaultViaArea = layer1Area[defaultSingleCutVia] + layer2Area[defaultSingleCutVia];
-            auto currentViaArea = layer1Area[viaDef] + layer2Area[viaDef];
-            if (currentViaArea < defaultViaArea) {
-              defaultSingleCutVia = viaDef;
-            }
-          } else {
-            defaultSingleCutVia = viaDef;
-          }
-        }
-      }
-    }
-    if (!defaultSingleCutVia) {
-      for (auto &it: numCuts) {
-        auto viaDef = it.first;
-        if (numCuts[viaDef] == 1) {
-          if (isWithinLayer1[viaDef] || isWithinLayer2[viaDef]) {
-            if (defaultSingleCutVia) {
-              auto defaultViaArea = layer1Area[defaultSingleCutVia] + layer2Area[defaultSingleCutVia];
-              auto currentViaArea = layer1Area[viaDef] + layer2Area[viaDef];
-              if (currentViaArea < defaultViaArea) {
-                defaultSingleCutVia = viaDef;
-              }
-            } else {
-              defaultSingleCutVia = viaDef;
-            }
-          }
-        }
-      }
-    }
-    if (!defaultSingleCutVia) {
-      for (auto &it: numCuts) {
-        auto viaDef = it.first;
-        if (numCuts[viaDef] == 1) {
-            if (defaultSingleCutVia) {
-              auto defaultViaArea = layer1Area[defaultSingleCutVia] + layer2Area[defaultSingleCutVia];
-              auto currentViaArea = layer1Area[viaDef] + layer2Area[viaDef];
-              if (currentViaArea < defaultViaArea) {
-                defaultSingleCutVia = viaDef;
-              }
-            } else {
-              defaultSingleCutVia = viaDef;
-            }
-        }
-      }
-    }
-
-    if (defaultSingleCutVia) {
-      tech->getLayer(layerNum)->setDefaultViaDef(defaultSingleCutVia);
-    } else {
-      cout <<"Error: no default single-cut via available!" <<endl;
-      exit(0);
-    }
-  }
-}
-
-// 11m_2xa1xd3xe2y2r
-void io::Parser::initDefaultVias_N16(const string &node) {
-  for (int layerNum = 1; layerNum < (int)tech->getLayers().size(); layerNum += 2) {
-    for (auto &uViaDef: tech->getVias()) {
-      auto viaDef = uViaDef.get();
-      if (viaDef->getCutLayerNum() == layerNum && node == "N16_11m_2xa1xd3xe2y2r_utrdl") {
-        switch(layerNum) {
-          case 1 : // VIA1
-                   if (viaDef->getName() == "NR_VIA1_PH") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 3 : // VIA2
-                   if (viaDef->getName() == "VIA2_0_25_3_32_HV_Vxa") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 5 : // VIA3
-                   if (viaDef->getName() == "VIA3_3_34_4_35_VH_Vxd") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 7 : // VIA4
-                   if (viaDef->getName() == "VIA4_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 9 : // VIA5
-                   if (viaDef->getName() == "VIA5_0_50_0_50_VH_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 11: // VIA6
-                   if (viaDef->getName() == "VIA6_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 13: // VIA7
-                   if (viaDef->getName() == "NR_VIA7_VH") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 15: // VIA8
-                   if (viaDef->getName() == "VIA8_0_27_0_27_HV_Vy") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 17: // VIA9
-                   if (viaDef->getName() == "VIA9_18_72_18_72_VH_Vr") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 19: // VIA10
-                   if (viaDef->getName() == "VIA10_18_72_18_72_HV_Vr") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          default: ;
-        }
-      } else if (viaDef->getCutLayerNum() == layerNum && node == "N16_9m_2xa1xd4xe1z_utrdl") {
-        switch(layerNum) {
-          case 1 : // VIA1
-                   if (viaDef->getName() == "NR_VIA1_PH") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 3 : // VIA2
-                   if (viaDef->getName() == "VIA2_0_25_3_32_HV_Vxa") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 5 : // VIA3
-                   if (viaDef->getName() == "VIA3_3_34_4_35_VH_Vxd") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 7 : // VIA4
-                   if (viaDef->getName() == "VIA4_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 9 : // VIA5
-                   if (viaDef->getName() == "VIA5_0_50_0_50_VH_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 11: // VIA6
-                   if (viaDef->getName() == "VIA6_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 13: // VIA7
-                   if (viaDef->getName() == "VIA7_0_50_0_50_VH_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 15: // VIA8
-                   if (viaDef->getName() == "VIA8_18_72_18_72_HV_Vz") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 17: // VIA9
-                   if (viaDef->getName() == "RV_450_450_450_450_XX_RV") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          default: ;
-        }
-      } else if (viaDef->getCutLayerNum() == layerNum && node == "N16_9m_2xa1xd3xe2z_utrdl") {
-        switch(layerNum) {
-          case 1 : // VIA1
-                   if (viaDef->getName() == "NR_VIA1_PH") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 3 : // VIA2
-                   if (viaDef->getName() == "VIA2_0_25_3_32_HV_Vxa") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 5 : // VIA3
-                   if (viaDef->getName() == "VIA3_3_34_4_35_VH_Vxd") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 7 : // VIA4
-                   if (viaDef->getName() == "VIA4_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 9 : // VIA5
-                   if (viaDef->getName() == "VIA5_0_50_0_50_VH_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 11: // VIA6
-                   if (viaDef->getName() == "VIA6_0_50_0_50_HV_Vxe") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 13: // VIA7
-                   if (viaDef->getName() == "VIA7_18_72_18_72_VH_Vz") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 15: // VIA8
-                   if (viaDef->getName() == "VIA8_18_72_18_72_HV_Vz") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          case 17: // VIA9
-                   if (viaDef->getName() == "RV_450_450_450_450_XX_RV") {
-                     tech->getLayer(layerNum)->setDefaultViaDef(viaDef);
-                   }
-                   break;
-          default: ;
-        }
-      }
-    }
-  }
-}
-
-void io::Parser::postProcess() {
-  if (DBPROCESSNODE == "N16_11m_2xa1xd3xe2y2r_utrdl") {
-    initDefaultVias_N16(DBPROCESSNODE);
-  } else {
-    initDefaultVias();
-  }
-  tech->printDefaultVias();
-
-
-  instAnalysis();
-
-  // init region query
-  cout <<endl <<"init region query ..." <<endl;
-  design->getRegionQuery()->init(design->getTech()->getLayers().size());
-  design->getRegionQuery()->print();
-  // test
-  /*
-  frBox box(372500, 1765500, 375500, 1768500);
-  for (frLayerNum i = 0; i < (int)design->getTech()->getLayers().size(); i++) {
-    vector<rq_rptr_value_t<frBlockObject> > result;
-    design->getRegionQuery()->query(box, i, result);
-    for (auto &[bBox, rptr]: result) {
-      cout <<"bBox (" <<bg::get<bg::min_corner, 0>(bBox) * 1.0 / design->getTopBlock()->getDBUPerUU() <<", "
-                      <<bg::get<bg::min_corner, 1>(bBox) * 1.0 / design->getTopBlock()->getDBUPerUU() <<") ("
-                      <<bg::get<bg::max_corner, 0>(bBox) * 1.0 / design->getTopBlock()->getDBUPerUU() <<", "
-                      <<bg::get<bg::max_corner, 1>(bBox) * 1.0 / design->getTopBlock()->getDBUPerUU() <<") "
-                      <<design->getTech()->getLayer(i)->getName() <<endl;
-      if (rptr->typeId() == frcInstTerm) {
-        cout <<" instTerm " <<static_cast<frInstTerm*>(rptr)->getInst()->getName() <<"/"
-             <<static_cast<frInstTerm*>(rptr)->getTerm()->getName() <<endl;
-      } else if (rptr->typeId() == frcTerm) {
-        cout <<"     term PIN/" <<static_cast<frTerm*>(rptr)->getName() <<endl;
-      } else if (rptr->typeId() == frcLayerBlockage) {
-        cout <<"     lblk" <<endl;
-      } else if (rptr->typeId() == frcPathSeg) {
-        cout <<"     pseg ";
-        if (static_cast<frPathSeg*>(rptr)->hasNet()) {
-          cout <<static_cast<frPathSeg*>(rptr)->getNet()->getName();
-        }
-        cout <<endl;
-      } else if (rptr->typeId() == frcVia) {
-        cout <<"      via ";
-        if (static_cast<frVia*>(rptr)->hasNet()) {
-          cout <<static_cast<frVia*>(rptr)->getNet()->getName();
-        }
-        cout <<endl;
-      } else {
-        cout <<"Error: unknown type in rq test" <<endl;
-      }
-    }
-  }*/
-}
-
-void io::Parser::postProcessGuide() {
-  if (VERBOSE > 0) {
-    cout <<endl <<"post process guides ..." <<endl;
-  }
-  buildGCellPatterns();
-  
-  int cnt = 0;
-  //for (auto &[netName, rects]:tmpGuides) {
-  //  if (design->getTopBlock()->name2net.find(netName) == design->getTopBlock()->name2net.end()) {
-  //    cout <<"Error: postProcessGuide cannot find net" <<endl;
-  //    exit(1);
-  //  }
-  //  auto net = design->getTopBlock()->name2net[netName];
-  for (auto &[net, rects]:tmpGuides) {
-    genGuides(net, rects);
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt < 100000) {
-        if (cnt % 10000 == 0) {
-          cout <<"  complete " <<cnt <<" nets" <<endl;
-        }
-      } else {
-        if (cnt % 100000 == 0) {
-          cout <<"  complete " <<cnt <<" nets" <<endl;
-        }
-      }
-    }
-  }
-
-  // global unique id for guides
-  int currId = 0;
-  for (auto &net: design->getTopBlock()->getNets()) {
-    for (auto &guide: net->getGuides()) {
-      guide->setId(currId);
-      currId++;
-    }
-  }
-
-  buildCMap();
-  
-  cout <<endl <<"init guide query ..." <<endl;
-  design->getRegionQuery()->initGuide(design->getTech()->getLayers().size());
-  design->getRegionQuery()->printGuide();
-  cout <<endl <<"init gr pin query ..." <<endl;
-  design->getRegionQuery()->initGRPin(tmpGRPins);
-
-  if (OUTGUIDE_FILE == string("")) {
-    ;
-  } else {
-    writeGuideFile();
-  }
-
-}
-
-void io::Parser::buildGCellPatterns_helper(frCoord &GCELLGRIDX, frCoord &GCELLGRIDY,
-                                           frCoord &GCELLOFFSETX, frCoord &GCELLOFFSETY) {
-  buildGCellPatterns_getWidth(GCELLGRIDX, GCELLGRIDY);
-  buildGCellPatterns_getOffset(GCELLGRIDX, GCELLGRIDY, GCELLOFFSETX, GCELLOFFSETY);
-}
-
-void io::Parser::buildGCellPatterns_getWidth(frCoord &GCELLGRIDX, frCoord &GCELLGRIDY) {
-  map<frCoord, int> guideGridXMap, guideGridYMap;
-  // get GCell size information loop
-  for (auto &[netName, rects]: tmpGuides) {
-    for (auto &rect: rects) {
-      frLayerNum layerNum = rect.getLayerNum();
-      frBox guideBBox;
-      rect.getBBox(guideBBox);
-      frCoord guideWidth = (tech->getLayer(layerNum)->getDir() == frcHorzPrefRoutingDir) ?
-                           (guideBBox.top() - guideBBox.bottom()):
-                           (guideBBox.right() - guideBBox.left());
-      if (tech->getLayer(layerNum)->getDir() == frcHorzPrefRoutingDir) {
-        if (guideGridYMap.find(guideWidth) == guideGridYMap.end()) {
-          guideGridYMap[guideWidth] = 0;
-        }
-        guideGridYMap[guideWidth]++;
-      } else if (tech->getLayer(layerNum)->getDir() == frcVertPrefRoutingDir) {
-        if (guideGridXMap.find(guideWidth) == guideGridXMap.end()) {
-          guideGridXMap[guideWidth] = 0;
-        }
-        guideGridXMap[guideWidth]++;
-      }
-    }
-  }
-  frCoord tmpGCELLGRIDX = -1, tmpGCELLGRIDY = -1;
-  int tmpGCELLGRIDXCnt = -1, tmpGCELLGRIDYCnt = -1;
-  for (auto mapIt = guideGridXMap.begin(); mapIt != guideGridXMap.end(); ++mapIt) {
-    auto cnt = mapIt->second;
-    if (cnt > tmpGCELLGRIDXCnt) {
-      tmpGCELLGRIDXCnt = cnt;
-      tmpGCELLGRIDX = mapIt->first;
-    }
-    //cout <<"X width=" <<mapIt->first <<"/" <<mapIt->second <<endl;
-  }
-  for (auto mapIt = guideGridYMap.begin(); mapIt != guideGridYMap.end(); ++mapIt) {
-    auto cnt = mapIt->second;
-    if (cnt > tmpGCELLGRIDYCnt) {
-      tmpGCELLGRIDYCnt = cnt;
-      tmpGCELLGRIDY = mapIt->first;
-    }
-    //cout <<"Y width=" <<mapIt->first <<"/" <<mapIt->second <<endl;
-  }
-  if (tmpGCELLGRIDX != -1) {
-    GCELLGRIDX = tmpGCELLGRIDX;
-  } else {
-    cout <<"Error: no GCELLGRIDX" <<endl;
-    exit(1);
-  }
-  if (tmpGCELLGRIDY != -1) {
-    GCELLGRIDY = tmpGCELLGRIDY;
-  } else {
-    cout <<"Error: no GCELLGRIDY" <<endl;
-    exit(1);
-  }
-}
-
-void io::Parser::buildGCellPatterns_getOffset(frCoord GCELLGRIDX, frCoord GCELLGRIDY,
-                                              frCoord &GCELLOFFSETX, frCoord &GCELLOFFSETY) {
-  std::map<frCoord, int> guideOffsetXMap, guideOffsetYMap;
-  // get GCell offset information loop
-  for (auto &[netName, rects]: tmpGuides) {
-    for (auto &rect: rects) {
-      //frLayerNum layerNum = rect.getLayerNum();
-      frBox guideBBox;
-      rect.getBBox(guideBBox);
-      frCoord guideXOffset = guideBBox.left() % GCELLGRIDX;
-      frCoord guideYOffset = guideBBox.bottom() % GCELLGRIDY;
-      if (guideXOffset < 0) {
-        guideXOffset = GCELLGRIDX - guideXOffset;
-      }
-      if (guideYOffset < 0) {
-        guideYOffset = GCELLGRIDY - guideYOffset;
-      }
-      if (guideOffsetXMap.find(guideXOffset) == guideOffsetXMap.end()) {
-        guideOffsetXMap[guideXOffset] = 0;
-      }
-      guideOffsetXMap[guideXOffset]++;
-      if (guideOffsetYMap.find(guideYOffset) == guideOffsetYMap.end()) {
-        guideOffsetYMap[guideYOffset] = 0;
-      }
-      guideOffsetYMap[guideYOffset]++;
-    }
-  }
-  frCoord tmpGCELLOFFSETX = -1, tmpGCELLOFFSETY = -1;
-  int tmpGCELLOFFSETXCnt = -1, tmpGCELLOFFSETYCnt = -1;
-  for (auto mapIt = guideOffsetXMap.begin(); mapIt != guideOffsetXMap.end(); ++mapIt) {
-    auto cnt = mapIt->second;
-    if (cnt > tmpGCELLOFFSETXCnt) {
-      tmpGCELLOFFSETXCnt = cnt;
-      tmpGCELLOFFSETX = mapIt->first;
-    }
-  }
-  for (auto mapIt = guideOffsetYMap.begin(); mapIt != guideOffsetYMap.end(); ++mapIt) {
-    auto cnt = mapIt->second;
-    if (cnt > tmpGCELLOFFSETYCnt) {
-      tmpGCELLOFFSETYCnt = cnt;
-      tmpGCELLOFFSETY = mapIt->first;
-    }
-  }
-  if (tmpGCELLOFFSETX != -1) {
-    GCELLOFFSETX = tmpGCELLOFFSETX;
-  } else {
-    cout <<"Error: no GCELLGRIDX" <<endl;
-    exit(1);
-  } 
-  if (tmpGCELLOFFSETY != -1) {
-    GCELLOFFSETY = tmpGCELLOFFSETY;
-  } else {
-    cout <<"Error: no GCELLGRIDX" <<endl;
-    exit(1);
-  }
-}
-
-void io::Parser::buildGCellPatterns() {
-  // horizontal = false is gcell lines along y direction (x-grid)
-  frBox dieBox;
-  design->getTopBlock()->getBoundaryBBox(dieBox);
-
-  frCoord GCELLOFFSETX, GCELLOFFSETY, GCELLGRIDX, GCELLGRIDY;
-  buildGCellPatterns_helper(GCELLGRIDX, GCELLGRIDY, GCELLOFFSETX, GCELLOFFSETY);
-
-  frGCellPattern xgp;
-  xgp.setHorizontal(false);
-  // find first coord >= dieBox.left()
-  frCoord startCoordX = dieBox.left() / (frCoord)GCELLGRIDX * (frCoord)GCELLGRIDX;
-  //cout <<"here " <<dieBox.left() <<" " <<GCELLGRIDX <<endl;
-  if (startCoordX < dieBox.left()) {
-    startCoordX += (frCoord)GCELLGRIDX;
-  }
-  xgp.setStartCoord(startCoordX);
-  //xgp.setStartCoord(GCELLOFFSETX);
-  xgp.setSpacing(GCELLGRIDX);
-  if ((dieBox.right() - (frCoord)GCELLOFFSETX) / (frCoord)GCELLGRIDX < 1) {
-    cout <<"Error: gcell cnt < 1" <<endl;
-    exit(1);
-  }
-  //xgp.setCount((dieBox.right() - GCELLOFFSETX) / GCELLGRIDX + 1);
-  xgp.setCount((dieBox.right() - (frCoord)startCoordX) / (frCoord)GCELLGRIDX);
-  
-  frGCellPattern ygp;
-  ygp.setHorizontal(true);
-  // find first coord >= dieBox.bottom()
-  frCoord startCoordY = dieBox.bottom() / (frCoord)GCELLGRIDY * (frCoord)GCELLGRIDY;
-  if (startCoordY < dieBox.bottom()) {
-    startCoordY += (frCoord)GCELLGRIDY;
-  }
-  ygp.setStartCoord(startCoordY);
-  //ygp.setStartCoord(GCELLOFFSETY);
-  ygp.setSpacing(GCELLGRIDY);
-  if ((dieBox.top() - (frCoord)GCELLOFFSETY) / (frCoord)GCELLGRIDY < 1) {
-    cout <<"Error: gcell cnt < 1" <<endl;
-    exit(1);
-  }
-  //ygp.setCount((dieBox.top() - GCELLOFFSETY) / GCELLGRIDY + 1);
-  ygp.setCount((dieBox.top() - startCoordY) / (frCoord)GCELLGRIDY);
-
-  if (VERBOSE > 0) {
-    cout <<"GCELLGRID X " <<ygp.getStartCoord() <<" DO " <<ygp.getCount() <<" STEP " <<ygp.getSpacing() <<" ;" <<endl;
-    cout <<"GCELLGRID Y " <<xgp.getStartCoord() <<" DO " <<xgp.getCount() <<" STEP " <<xgp.getSpacing() <<" ;" <<endl;
-  }
-
-  design->getTopBlock()->setGCellPatterns({xgp, ygp});
-
-  auto &cmap = design->getTopBlock()->getCMap();
-  cmap.init(xgp.getCount(), ygp.getCount(), tech->layers.size());
-
-  for (int layerNum = 0; layerNum <= (int)tech->getLayers().size(); layerNum += 2) {
-    for (int i = 0; i < (int)xgp.getCount(); i++) {
-      for (int j = 0; j < (int)ygp.getCount(); j++) {
-        frBox gcellBox;
-        design->getTopBlock()->getGCellBox(frPoint(i, j), gcellBox);
-        bool isH = (tech->getLayers().at(layerNum)->getDir() == frcHorzPrefRoutingDir);
-        frCoord gcLow  = isH ? gcellBox.bottom() : gcellBox.right();
-        frCoord gcHigh = isH ? gcellBox.top()    : gcellBox.left();
-        //if (isH) {
-        //  if (j == (int)ygp.getCount() - 1) {
-        //    gcHigh = dieBox.top();
-        //  }
-        //} else {
-        //  if (i == (int)xgp.getCount() - 1) {
-        //    gcHigh = dieBox.right();
-        //  }
-        //}
-        int trackCnt = 0;
-        for (auto &tp: design->getTopBlock()->getTrackPatterns(layerNum)) {
-          if ((tech->getLayer(layerNum)->getDir() == frcHorzPrefRoutingDir &&
-               tp->isHorizontal() == false) ||
-              (tech->getLayer(layerNum)->getDir() == frcVertPrefRoutingDir &&
-               tp->isHorizontal() == true)) {
-            int trackNum = (gcLow - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-            if (trackNum < 0) {
-              trackNum = 0;
-            }
-            if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < gcLow) {
-              trackNum++;
-            }
-            for (; trackNum < (int)tp->getNumTracks() && trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < gcHigh; trackNum++) {
-              trackCnt++;
-            }
-
-          }
-        }
-        cmap.setSupply(i,j,layerNum, trackCnt);
-      }
-    }
-  }
-  //design->getTopBlock()->setCMap(cmap);
-}
-
-void io::Parser::buildCMap() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (VERBOSE > 0) {
-    cout <<endl <<"building cmap ... " <<endl;
-  }
-
-  auto guides = design->getTopBlock()->getGuides();
-  if (enableOutput) {
-    cout <<"all guides = " <<guides.size() <<endl;
-  }
-  //auto &gCellPatterns = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gCellPatterns.at(0);
-  //auto &ygp = gCellPatterns.at(1);
-  auto &cmap = design->getTopBlock()->getCMap();
-
-  frPoint begin, end;
-  frUInt4 xIndex1   = 0;
-  frUInt4 yIndex1   = 0;
-  frUInt4 layerNum1 = 0;
-  frUInt4 xIndex2   = 0;
-  frUInt4 yIndex2   = 0;
-  frUInt4 layerNum2 = 0;
-  for (auto &guide: guides) {
-    guide->getPoints(begin, end);
-    //xIndex1 = (begin.x() - xgp.getStartCoord()) / xgp.getSpacing();
-    //yIndex1 = (begin.y() - ygp.getStartCoord()) / ygp.getSpacing();
-    //xIndex2 = (end.x()   - xgp.getStartCoord()) / xgp.getSpacing();
-    //yIndex2 = (end.y()   - ygp.getStartCoord()) / ygp.getSpacing();
-    
-    //xIndex1 = (xIndex1 >= xgp.getCount()) ? xgp.getCount() - 1 : xIndex1;
-    //xIndex2 = (xIndex2 >= xgp.getCount()) ? xgp.getCount() - 1 : xIndex2;
-    //yIndex1 = (yIndex1 >= ygp.getCount()) ? ygp.getCount() - 1 : yIndex1;
-    //yIndex2 = (yIndex2 >= ygp.getCount()) ? ygp.getCount() - 1 : yIndex2;
-    frPoint idx;
-    design->getTopBlock()->getGCellIdx(begin, idx);
-    xIndex1 = idx.x();
-    yIndex1 = idx.y();
-    design->getTopBlock()->getGCellIdx(end, idx);
-    xIndex2 = idx.x();
-    yIndex2 = idx.y();
-
-    layerNum1 = guide->getBeginLayerNum();
-    layerNum2 = guide->getEndLayerNum();
-    bool isHLine = (xIndex1 == xIndex2) ? false : true;
-    bool isVia   = (layerNum1 == layerNum2) ? false : true;
-    bool isLocal = (xIndex1 == xIndex2 && yIndex1 == yIndex2) ? true : false;
-
-    if (isVia) {
-      cmap.setUpDemand(xIndex1, yIndex1, layerNum1, cmap.getUpDemand(xIndex1, yIndex1, layerNum1) + 1);
-    } else {
-      if (isLocal) {
-        cmap.setLocalDemand(xIndex1, yIndex1, layerNum1, cmap.getLocalDemand(xIndex1, yIndex1, layerNum1) + 1);
-      } else {
-        cmap.setEdge2Demand(xIndex1, yIndex1, layerNum1, cmap.getEdge2Demand(xIndex1, yIndex1, layerNum1) + 1);
-        cmap.setEdge1Demand(xIndex2, yIndex2, layerNum2, cmap.getEdge1Demand(xIndex2, yIndex2, layerNum2) + 1);
-        if (isHLine) {
-          for (auto i = xIndex1 + 1; i < xIndex2; i++) {
-            cmap.setThroughDemand(i, yIndex1, layerNum1, cmap.getThroughDemand(i, yIndex1, layerNum1) + 1);
-          }
-        } else {
-          for (auto i = yIndex1 + 1; i < yIndex2; i++) {
-            cmap.setThroughDemand(xIndex1, i, layerNum1, cmap.getThroughDemand(xIndex1, i, layerNum1) + 1);
-          }
-        }
-      }
-    }
-  }
-
-  
-  //if (VERBOSE > 0) {
-  //  cout <<endl <<"end building cmap" <<endl;
-  //}
-
-  if (enableOutput) {
-    design->printCMap();
-  }
-
-}
-
-void io::Parser::writeGuideFile() {
-  //auto &gp = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gp[0];
-  //auto &ygp = gp[1];
-  // use frCoord to prevent negative problems
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  ofstream outputGuide(OUTGUIDE_FILE.c_str());
-  if (outputGuide.is_open()) {
-    for (auto &net: design->topBlock->getNets()) {
-      auto netName = net->getName();
-      outputGuide << netName << endl;
-      outputGuide << "(\n"; 
-      for (auto &guide: net->getGuides()) {
-        frPoint bp, ep;
-        guide->getPoints(bp, ep);
-        frPoint bpIdx, epIdx;
-        design->getTopBlock()->getGCellIdx(bp, bpIdx);
-        design->getTopBlock()->getGCellIdx(ep, epIdx);
-        frBox bbox, ebox;
-        design->getTopBlock()->getGCellBox(bpIdx, bbox);
-        design->getTopBlock()->getGCellBox(epIdx, ebox);
-        frLayerNum bNum = guide->getBeginLayerNum();
-        frLayerNum eNum = guide->getEndLayerNum();
-        // append unit guide in case of stacked via
-        if (bNum != eNum) {
-          auto startLayerName = tech->getLayer(bNum)->getName();
-          //outputGuide << bp.x() - GCELLGRIDX / 2 << " " << bp.y() - GCELLGRIDY / 2 << " "
-          //            << bp.x() + GCELLGRIDX / 2 << " " << bp.y() + GCELLGRIDY / 2 << " "
-          //            << startLayerName <<".5" << endl;
-          outputGuide << bbox.left()  << " " << bbox.bottom() << " "
-                      << bbox.right() << " " << bbox.top()    << " "
-                      << startLayerName <<".5" << endl;
-        } else {
-          auto layerName = tech->getLayer(bNum)->getName();
-          //outputGuide << bp.x() - GCELLGRIDX / 2 << " " << bp.y() - GCELLGRIDY / 2 << " "
-          //            << ep.x() + GCELLGRIDX / 2 << " " << ep.y() + GCELLGRIDY / 2 << " "
-          //            << layerName << endl;
-          outputGuide << bbox.left()  << " " << bbox.bottom() << " "
-                      << ebox.right() << " " << ebox.top()    << " "
-                      << layerName << endl;
-        }
-      }
-      outputGuide << ")\n";
-    }
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/io/io_pin.cpp b/scripts/pdn/src/PdnPinDumper/src/io/io_pin.cpp
deleted file mode 100644
index ed679c8..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/io/io_pin.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "io.h"
-
-using namespace std;
-using namespace fr;
-
-void io::Parser::instAnalysis() {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  if (VERBOSE > 0) {
-    cout <<endl <<"libcell analysis ..." <<endl;
-  }
-  trackOffsetMap.clear();
-  prefTrackPatterns.clear();
-  //vector<frTrackPattern*> prefTrackPatterns;
-  for (auto &trackPattern: design->getTopBlock()->getTrackPatterns()) {
-    auto isVerticalTrack = trackPattern->isHorizontal(); // yes = vertical track
-    if (design->getTech()->getLayer(trackPattern->getLayerNum())->getDir() == frcHorzPrefRoutingDir) {
-      if (!isVerticalTrack) {
-        prefTrackPatterns.push_back(trackPattern);
-      }
-    } else {
-      if (isVerticalTrack) {
-        prefTrackPatterns.push_back(trackPattern);
-      }
-    }
-  }
-
-  int numLayers = design->getTech()->getLayers().size();
-  map<frBlock*, tuple<frLayerNum, frLayerNum>, frBlockObjectComp> refBlockPinLayerRange;
-  for (auto &uRefBlock: design->getRefBlocks()) {
-    auto refBlock = uRefBlock.get();
-    frLayerNum minLayerNum = numLayers;
-    frLayerNum maxLayerNum = 0;
-    for (auto &uTerm: refBlock->getTerms()) {
-      for (auto &uPin: uTerm->getPins()) {
-        for (auto &uPinFig: uPin->getFigs()) {
-          auto pinFig = uPinFig.get();
-          if (pinFig->typeId() == frcRect) {
-            auto lNum = static_cast<frRect*>(pinFig)->getLayerNum();
-            minLayerNum = min(minLayerNum, lNum);
-            maxLayerNum = max(maxLayerNum, lNum);
-          } else {
-            cout <<"Error: instAnalysis unsupported pinFig" <<endl;
-          }
-        }
-      }
-    }
-    maxLayerNum = min(maxLayerNum + 2, numLayers);
-    refBlockPinLayerRange[refBlock] = make_tuple(minLayerNum, maxLayerNum);
-    if (enableOutput) {
-      cout <<"  " <<refBlock->getName() <<" PIN layer ("
-           <<design->getTech()->getLayer(minLayerNum)->getName() <<", "
-           <<design->getTech()->getLayer(maxLayerNum)->getName() <<")" <<endl;
-    }
-  }
-  //cout <<"  refBlock pin layer range done" <<endl;
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"instance analysis ..." <<endl;
-  }
-  //map<frBlock*, map<frOrient, map<vector<frCoord>, frInst*> > > trackOffsetMap;
-  vector<frCoord> offset;
-  int cnt = 0;
-  for (auto &inst: design->getTopBlock()->getInsts()) {
-    frPoint origin;
-    inst->getOrigin(origin);
-    auto orient = inst->getOrient();
-    auto [minLayerNum, maxLayerNum] = refBlockPinLayerRange[inst->getRefBlock()];
-    offset.clear();
-    for (auto &tp: prefTrackPatterns) {
-      if (tp->getLayerNum() >= minLayerNum && tp->getLayerNum() <= maxLayerNum) {
-        // vertical track
-        if (tp->isHorizontal()) {
-          offset.push_back(origin.x() % tp->getTrackSpacing());
-          //cout <<"inst/offset/layer " <<inst->getName() <<" " <<origin.y() % tp->getTrackSpacing() 
-          //     <<" " <<design->getTech()->getLayer(tp->getLayerNum())->getName() <<endl;
-        } else {
-          offset.push_back(origin.y() % tp->getTrackSpacing());
-          //cout <<"inst/offset/layer " <<inst->getName() <<" " <<origin.x() % tp->getTrackSpacing()
-          //     <<" " <<design->getTech()->getLayer(tp->getLayerNum())->getName() <<endl;
-        }
-      }
-    }
-    // trackOffsetMap[inst->getRefBlock()][orient][offset] = inst.get();
-    trackOffsetMap[inst->getRefBlock()][orient][offset].insert(inst.get());
-    cnt++;
-    if (VERBOSE > 0) {
-      if (cnt < 100000) {
-        if (cnt % 10000 == 0) {
-          cout <<"  complete " <<cnt <<" instances" <<endl;
-        }
-      } else {
-        if (cnt % 100000 == 0) {
-          cout <<"  complete " <<cnt <<" instances" <<endl;
-        }
-      }
-    }
-  }
-
-  if (enableOutput) {
-    cout <<endl <<"summary: " <<endl;
-  }
-  cnt = 0;
-  frString orientName;
-  for (auto &[refBlock, orientMap]: trackOffsetMap) {
-    if (enableOutput) {
-      cout <<"  " <<refBlock->getName() <<" (ORIENT/#diff patterns)";
-    }
-    for (auto &[orient, offsetMap]: orientMap) {
-      cnt += offsetMap.size();
-      if (enableOutput) {
-        orient.getName(orientName);
-        cout <<" (" <<orientName <<", " <<offsetMap.size() <<")";
-        for (auto &[vec, inst]: offsetMap) {
-          cout <<" " <<(*inst.begin())->getName();
-        }
-      }
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-  }
-  if (VERBOSE > 0) {
-    cout <<"#unique instances = " <<cnt <<endl;
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/main.cpp b/scripts/pdn/src/PdnPinDumper/src/main.cpp
deleted file mode 100644
index aea92e9..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/main.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <cstring>
-#include <string>
-#include <chrono>
-#include "FlexRoute.h"
-
-using namespace std;
-using namespace fr;
-
-int readParams(const string &fileName) {
-  int readParamCnt = 0;
-  fstream fin(fileName.c_str());
-  string line;
-  if (fin.is_open()){
-    while (fin.good()){
-      getline(fin, line);
-      if (line[0] != '#'){
-        char delimiter=':';
-        int pos = line.find(delimiter);
-        string field = line.substr(0, pos);
-        string value = line.substr(pos + 1);
-        stringstream ss(value);
-        if (field == "lef")           { LEF_FILE = value; ++readParamCnt;}
-        else if (field == "def")      { DEF_FILE = value; ++readParamCnt;}
-        else if (field == "guide")    { GUIDE_FILE = value; ++readParamCnt;}
-        else if (field == "outputTA") { OUTTA_FILE = value; ++readParamCnt;}
-        else if (field == "output")   { OUT_FILE = value; ++readParamCnt;}
-        else if (field == "outputguide") { OUTGUIDE_FILE = value; ++readParamCnt;}
-        else if (field == "outputMaze") { OUT_MAZE_FILE = value; ++readParamCnt;}
-        else if (field == "outputDRC") { DRC_RPT_FILE = value; ++readParamCnt;}
-        else if (field == "threads")  { MAX_THREADS = atoi(value.c_str()); ++readParamCnt;}
-        else if (field == "verbose")    VERBOSE = atoi(value.c_str());
-        else if (field == "dbProcessNode") { DBPROCESSNODE = value; ++readParamCnt;}
-      }
-    }
-    fin.close();
-  }
-  if (readParamCnt < 5) {
-    return 2;
-  } else {
-    return 0;
-  }
-}
-
-int main(int argc, char** argv) {
-
-  //cout <<CPX_MIN <<endl;
-  //return 0;
-  using namespace std::chrono;
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  //double startTime = omp_get_wtime();
-
-  //std::ios::sync_with_stdio(false);
-  cout << "Team number: 21\n";
-  cout << "Team name: UCSD ABKGROUP\n";
-  cout << "Member: Andrew B. Kahng, Lutong Wang, Bangqi Xu\n";
-  cout << "Affiliation: University of California, San Diego\n";
-  if (argc == 1) {
-    cout <<"Error: type '--help' for the help." <<endl;
-    return 2;
-  }
-
-  if (argc == 2) {
-    int readSuccess = readParams(string(argv[1]));
-    if (readSuccess) {
-      cout <<"Error reading param file!!!" <<endl;
-      return 2;
-    }
-  } else {
-    argv++;
-    argc--;
-    while (argc--) {
-      if (strcmp(*argv, "-lef") == 0) {
-        argv++;
-        argc--;
-        LEF_FILE = *argv;
-        //cout <<"lef: " <<LEF_FILE <<endl;
-      } else if (strcmp(*argv, "-def") == 0) {
-        argv++;
-        argc--;
-        DEF_FILE = *argv;
-        //cout <<"def: " <<DEF_FILE <<endl;
-      } else if (strcmp(*argv, "-guide") == 0) {
-        argv++;
-        argc--;
-        GUIDE_FILE = *argv;
-        //cout <<"guide: " <<GUIDE_FILE <<endl;
-      } else if (strcmp(*argv, "-threads") == 0) {
-        argv++;
-        argc--;
-        sscanf(*argv, "%d", &MAX_THREADS);
-        //cout <<"thread: " <<MAX_THREADS <<endl;
-      } else if (strcmp(*argv, "-output") == 0) {
-        argv++;
-        argc--;
-        OUT_FILE = *argv;
-        //cout <<"output: " <<OUT_FILE <<endl;
-      } else if (strcmp(*argv, "-verbose") == 0) {
-        argv++;
-        argc--;
-        VERBOSE = atoi(*argv);
-        //cout <<"output: " <<OUT_FILE <<endl;
-      } else {
-        cout <<"ERROR: Illegal command line option: " <<*argv <<endl;
-        return 2;
-      }
-      argv++;
-    }
-  }
-  
-  FlexRoute router;
-  router.main();
-  
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
-  if (VERBOSE > 0) {
-    cout <<endl <<"Runtime taken (hrt): " << time_span.count()    <<endl;
-  }
-  return 0;
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.cpp b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.cpp
deleted file mode 100644
index c3d3ace..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.cpp
+++ /dev/null
@@ -1,874 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <iostream>
-#include <sstream>
-#include <chrono>
-#include "global.h"
-#include "FlexTA.h"
-#include "db/infra/frTime.h"
-#include <algorithm>
-//#include <omp.h>
-
-using namespace std;
-using namespace fr;
-using namespace boost::polygon::operators;
-
-int FlexTAWorker::main() {
-  using namespace std::chrono;
-  high_resolution_clock::time_point t0 = high_resolution_clock::now();
-  if (VERBOSE > 1) {
-    stringstream ss;
-    //cout <<endl <<"start TA worker (BOX/LAYER) " <<routeBox <<" " <<layerNum <<endl;
-    ss <<endl <<"start TA worker (BOX) ("
-       <<routeBox.left()   * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-       <<routeBox.bottom() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") ("
-       <<routeBox.right()  * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-       <<routeBox.top()    * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") ";
-    if (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir) {
-      ss <<"H";
-    } else {
-      ss <<"V";
-    }
-    ss <<endl;
-    cout <<ss.str();
-  }
-
-
-  //assignIroutes();
-  //reassignIroutes();
-  //saveToGuides();
-  //reportCosts();
-  init();
-  high_resolution_clock::time_point t1 = high_resolution_clock::now();
-  assign();
-  high_resolution_clock::time_point t2 = high_resolution_clock::now();
-  end();
-  high_resolution_clock::time_point t3 = high_resolution_clock::now();
-
-  duration<double> time_span0 = duration_cast<duration<double>>(t1 - t0);
-  duration<double> time_span1 = duration_cast<duration<double>>(t2 - t1);
-  duration<double> time_span2 = duration_cast<duration<double>>(t3 - t2);
-
-  if (VERBOSE > 1) {
-    stringstream ss;
-    ss   <<"time (INIT/ASSIGN/POST) " <<time_span0.count() <<" " 
-                                      <<time_span1.count() <<" "
-                                      <<time_span2.count() <<" "
-                                      <<endl;
-    cout <<ss.str() <<flush;
-  }
-  return 0;
-}
-
-int FlexTA::initTA_helper(int iter, int size, int offset, bool isH, int &numPanels) {
-  //frBox dieBox;
-  //getDesign()->getTopBlock()->getBoundaryBBox(dieBox);
-
-  auto gCellPatterns = getDesign()->getTopBlock()->getGCellPatterns();
-  auto &xgp = gCellPatterns.at(0);
-  auto &ygp = gCellPatterns.at(1);
-  int sol = 0;
-  numPanels = 0;
-  if (isH) {
-    for (int i = offset; i < (int)ygp.getCount(); i += size) {
-      FlexTAWorker worker(getDesign());
-      frBox beginBox, endBox;
-      getDesign()->getTopBlock()->getGCellBox(frPoint(0, i), beginBox);
-      getDesign()->getTopBlock()->getGCellBox(frPoint((int)xgp.getCount() - 1, 
-                                                      min(i + size - 1, (int)ygp.getCount() - 1)), endBox);
-      frBox routeBox(beginBox.left(), beginBox.bottom(), endBox.right(), endBox.top());
-      frBox extBox;
-      routeBox.bloat(ygp.getSpacing() / 2, extBox);
-      worker.setRouteBox(routeBox);
-      worker.setExtBox(extBox);
-      worker.setDir(frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-      worker.setTAIter(iter);
-      worker.main();
-      //int numAssigned = worker.getNumAssigned();
-      sol += worker.getNumAssigned();
-      numPanels++;
-      //if (VERBOSE > 0) {
-      //  cout <<"Done with " <<numAssigned <<"horizontal wires";
-      //}
-    }
-  } else {
-    for (int i = offset; i < (int)xgp.getCount(); i += size) {
-      FlexTAWorker worker(getDesign());
-      frBox beginBox, endBox;
-      getDesign()->getTopBlock()->getGCellBox(frPoint(i, 0),                       beginBox);
-      getDesign()->getTopBlock()->getGCellBox(frPoint(min(i + size - 1, (int)xgp.getCount() - 1),
-                                                      (int)ygp.getCount() - 1), endBox);
-      frBox routeBox(beginBox.left(), beginBox.bottom(), endBox.right(), endBox.top());
-      frBox extBox;
-      routeBox.bloat(xgp.getSpacing() / 2, extBox);
-      worker.setRouteBox(routeBox);
-      worker.setExtBox(extBox);
-      worker.setDir(frPrefRoutingDirEnum::frcVertPrefRoutingDir);
-      worker.setTAIter(iter);
-      worker.main();
-      //int numAssigned = worker.getNumAssigned();
-      sol += worker.getNumAssigned();
-      numPanels++;
-      //if (VERBOSE > 0) {
-      //  cout <<"Done with " <<numAssigned <<"vertical wires";
-      //}
-    }
-  }
-  return sol;
-}
-
-void FlexTA::initTA(int size) {
-  frTime t;
-
-  if (VERBOSE > 1) {
-    cout <<endl <<"start initial track assignment ..." <<endl;
-  }
-
-  auto bottomLNum = getDesign()->getTech()->getBottomLayerNum();
-  auto bottomLayer = getDesign()->getTech()->getLayer(bottomLNum);
-  if (bottomLayer->getType() != frLayerTypeEnum::ROUTING) {
-    bottomLNum++;
-    bottomLayer = getDesign()->getTech()->getLayer(bottomLNum);
-  }
-  bool isBottomLayerH = (bottomLayer->getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-
-  int numAssigned = 0;
-  int numPanels = 0;
-
-  // H first
-  if (isBottomLayerH) {
-    numAssigned = initTA_helper(0, size, 0, true, numPanels);
-    if (VERBOSE > 0) {
-      cout <<"Done with " <<numAssigned <<" horizontal wires in " <<numPanels <<" frboxes and ";
-    }
-    initTA_helper(0, size, 0, false, numPanels);
-    if (VERBOSE > 0) {
-      cout <<numAssigned <<" vertical wires in " <<numPanels <<" frboxes." <<endl;
-    }
-  // V first
-  } else {
-    initTA_helper(0, size, 0, false, numPanels);
-    if (VERBOSE > 0) {
-      cout <<"Done with " <<numAssigned <<" vertical wires in " <<numPanels <<" frboxes and ";
-    }
-    initTA_helper(0, size, 0, true, numPanels);
-    if (VERBOSE > 0) {
-      cout <<numAssigned <<" horizontal wires in " <<numPanels <<" frboxes." <<endl;
-    }
-  }
-}
-
-void FlexTA::searchRepair(int iter, int size, int offset) {
-  frTime t;
-
-  if (VERBOSE > 1) {
-    if (iter == -1) {
-      cout <<endl <<"start polishing ..." <<endl;
-    } else {
-      cout <<endl <<"start " <<iter;
-      string suffix;
-      if (iter == 1 || (iter > 20 && iter % 10 == 1)) {
-        suffix = "st";
-      } else if (iter == 2 || (iter > 20 && iter % 10 == 2)) {
-        suffix = "nd";
-      } else if (iter == 3 || (iter > 20 && iter % 10 == 3)) {
-        suffix = "rd";
-      } else {
-        suffix = "th";
-      }
-      cout <<suffix <<" optimization iteration ..." <<endl;
-    }
-  }
-  auto bottomLNum = getDesign()->getTech()->getBottomLayerNum();
-  auto bottomLayer = getDesign()->getTech()->getLayer(bottomLNum);
-  if (bottomLayer->getType() != frLayerTypeEnum::ROUTING) {
-    bottomLNum++;
-    bottomLayer = getDesign()->getTech()->getLayer(bottomLNum);
-  }
-  bool isBottomLayerH = (bottomLayer->getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-
-  //int sol = 0;
-  int numAssigned = 0;
-  int numPanels = 0;
-  // H first
-  if (isBottomLayerH) {
-    numAssigned = initTA_helper(iter, size, offset, true, numPanels);
-    if (VERBOSE > 0) {
-      cout <<"Done with " <<numAssigned <<" horizontal wires in " <<numPanels <<" frboxes and ";
-    }
-    numAssigned = initTA_helper(iter, size, offset, false, numPanels);
-    if (VERBOSE > 0) {
-      cout <<numAssigned <<" vertical wires in " <<numPanels <<" frboxes." <<endl;
-    }
-  // V first
-  } else {
-    numAssigned = initTA_helper(iter, size, offset, false, numPanels);
-    if (VERBOSE > 0) {
-      cout <<"Done with " <<numAssigned <<" vertical wires in " <<numPanels <<" frboxes and ";
-    }
-    numAssigned = initTA_helper(iter, size, offset, true, numPanels);
-    if (VERBOSE > 0) {
-      cout <<numAssigned <<" horizontal wires in " <<numPanels <<" frboxes." <<endl;
-    }
-  }
-}
-
-int FlexTA::main() {
-  frTime t;
-  if (VERBOSE > 0) {
-    cout <<endl <<endl <<"start track assignment" <<endl;
-  }
-  initTA(50);
-  searchRepair(1, 50, 0);
-  //searchRepair(2, 50, 0);
-  //searchRepair(-1, 50, 0);
-
-  if (VERBOSE > 0) {
-    cout <<endl <<"complete track assignment";
-    //end();
-  }
-  if (VERBOSE > 0) {
-    cout <<endl;
-    t.print();
-    cout <<endl;
-  }
-  return 0;
-}
-
-/*
-void FlexTAWorker::getAllGuides() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  vector<rq_rptr_value_t<frGuide> > result1;
-  getDesign()->getRegionQuery()->queryGuide(routeBox, layerNum, result1);
-  //cout <<endl <<"query1:" <<endl;
-  for (auto &[boostb, guide]: result1) {
-    frPoint pt1, pt2;
-    guide->getPoints(pt1, pt2);
-    if (enableOutput) {
-      cout <<"found guide (" 
-           <<pt1.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-           <<pt1.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") (" 
-           <<pt2.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-           <<pt2.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") " 
-           <<guide->getNet()->getName() << "\n";
-    }
-    guides.push_back(guide);
-    //cout <<endl;
-  }
-  sort(guides.begin(), guides.end(), [](const frGuide *a, const frGuide *b) {return *a < *b;});
-}
-*/
-
-/*
-void FlexTAWorker::getAllTracks() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  // uPtr for tp
-  for (auto &tp: getDesign()->getTopBlock()->getTrackPatterns(layerNum)) {
-    if ((getTech()->getLayers().at(layerNum)->getDir() == frcHorzPrefRoutingDir &&
-         tp->isHorizontal() == false) ||
-        (getTech()->getLayers().at(layerNum)->getDir() == frcVertPrefRoutingDir &&
-         tp->isHorizontal() == true)) {
-      if (enableOutput) {
-        cout <<"TRACKS " <<(tp->isHorizontal() ? string("X ") : string("Y "))
-             <<tp->getStartCoord() <<" DO " <<tp->getNumTracks() <<" STEP "
-             <<tp->getTrackSpacing() <<" LAYER " <<tp->getLayerNum() 
-             <<" ;" <<endl;
-      }
-      if (getTech()->getLayers().at(layerNum)->getDir() == frcHorzPrefRoutingDir) {
-        int trackNum = (routeBox.bottom() - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (trackNum < 0) {
-          trackNum = 0;
-        }
-        if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < routeBox.bottom()) {
-          trackNum++;
-        }
-        for (; trackNum < (int)tp->getNumTracks() && trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < routeBox.top(); trackNum++) {
-          unique_ptr<FlexTrack> ft = make_unique<FlexTrack>();
-          ft->setTrackPattern(tp.get());
-          ft->setTrackLoc(trackNum * tp->getTrackSpacing() + tp->getStartCoord());
-          tracks.push_back(std::move(ft));
-        }
-      } else {
-        int trackNum = (routeBox.left() - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (trackNum < 0) {
-          trackNum = 0;
-        }
-        if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < routeBox.left()) {
-          trackNum++;
-        }
-        for (; trackNum < (int)tp->getNumTracks() && trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < routeBox.right(); trackNum++) {
-          unique_ptr<FlexTrack> ft = make_unique<FlexTrack>();
-          ft->setTrackPattern(tp.get());
-          ft->setTrackLoc(trackNum * tp->getTrackSpacing() + tp->getStartCoord());
-          tracks.push_back(std::move(ft));
-        }
-      }
-
-    }
-  }
-  if (enableOutput) {
-    for (auto &t: tracks) {
-      cout <<"TRACKLOC " <<t->getTrackLoc() <<endl;
-    }
-  }
-}
-*/
-
-// return_val = 0: left set, right set
-// return_val = 1: left set, right not set
-// return_val = 2: left not set, right set
-// return_val = 3: left not set, right not set
-/*
-void FlexTAWorker::genIroutes_setBeginEnd(FlexIroute* iroute, bool isH) {
-  auto guide = iroute->getGuide();
-  auto net   = guide->getNet();
-  if (guide) {
-    ;
-  } else {
-    cout <<"Error: genIroutes_setBeginEnd cannot lock guide" <<endl;
-    exit(1);
-  }
-  bool    hasMaxBegin = false;
-  bool    hasMinEnd   = false;
-  frCoord maxBegin    = 0;
-  frCoord minEnd      = 0;
-  frPoint segBegin, segEnd;
-  
-  frPoint bp, ep;
-  guide->getPoints(bp, ep);
-  frPoint cp;
-  // layerNum in FlexTAWorker
-  vector<frGuide*> nbrGuides;
-  auto rq = getDesign()->getRegionQuery();
-  int wlen = 0;
-  frBox box;
-  for (int i = 0; i < 2; i++) {
-    nbrGuides.clear();
-    // check left
-    if (i == 0) {
-      box.set(bp, bp);
-      cp = bp;
-    // check right
-    } else {
-      box.set(ep, ep);
-      cp = ep;
-    }
-    if (layerNum - 2 >= 0) {
-      rq->queryGuide(box, layerNum - 2, nbrGuides);
-    } 
-    if (layerNum + 2 < (int)design->getTech()->getLayers().size()) {
-      rq->queryGuide(box, layerNum + 2, nbrGuides);
-    } 
-    for (auto &guide: nbrGuides) {
-      if (guide->getNet() == net) {
-        for (auto &connFig: guide->getRoutes()) {
-          if (connFig->typeId() == frcPathSeg) {
-            static_cast<frPathSeg*>(connFig.get())->getPoints(segBegin, segEnd);
-            if (i == 0) {
-              if (hasMaxBegin) {
-                maxBegin = max(maxBegin, (isH ? segBegin.x() : segBegin.y()));
-              } else {
-                maxBegin = (isH ? segBegin.x() : segBegin.y());
-                hasMaxBegin = true;
-              }
-            } else {
-              if (hasMinEnd) {
-                minEnd = min(minEnd, (isH ? segBegin.x() : segBegin.y()));
-              } else {
-                minEnd = (isH ? segBegin.x() : segBegin.y());
-                hasMinEnd = true;
-              }
-            }
-          }
-        }
-        frPoint nbrBp, nbrEp;
-        if (cp == nbrEp) {
-          wlen -= 1;
-        } else {
-          wlen += 1;
-        }
-      }
-    }
-  }
-
-  frPoint guideBegin, guideEnd;
-  guide->getPoints(guideBegin, guideEnd);
-  if (!hasMaxBegin) {
-    maxBegin = (isH ? guideBegin.x() : guideBegin.y());
-  }
-  if (!hasMinEnd) {
-    minEnd = (isH ? guideEnd.x() : guideEnd.y());
-  }
-  if (maxBegin > minEnd) {
-    swap(maxBegin, minEnd);
-  }
-  if (maxBegin == minEnd) {
-    minEnd += 1;
-  }
-
-  iroute->setBegin(maxBegin);
-  iroute->setEnd(minEnd);
-  iroute->setWlenHelper(wlen);
-
-}
-*/
-
-/*
-void FlexTAWorker::genIroutes() {
-  unique_ptr<FlexIroute> iroute;
-  bool isH = (getDir() == frcHorzPrefRoutingDir) ? true : false;
-  for (auto guide: guides) {
-    if (guide) {
-      ;
-    } else {
-      continue;
-    }
-    iroute = make_unique<FlexIroute>();
-    iroute->setGuide(guide);
-    genIroutes_setBeginEnd(iroute.get(), isH);
-    iroutes.push_back(std::move(iroute));
-  }
-  sort(iroutes.begin(), iroutes.end(), 
-       [](const unique_ptr<FlexIroute> &a, const unique_ptr<FlexIroute> &b) {
-         if (a->getEnd() - a->getBegin() == b->getEnd() - b->getBegin()) {
-           return *(a->getGuide()) < *(b->getGuide());
-         } else {
-           return (a->getEnd() - a->getBegin()) > (b->getEnd() - b->getBegin());
-         }
-       }
-      );
-}
-*/
-/*
-void FlexTAWorker::init() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  getAllGuides();
-  //if (enableOutput) {
-  //  stringstream ss;
-  //  ss <<"#guidess = " <<guides.size() <<endl;
-  //  cout <<ss.str() <<flush;
-  //}
-  //sort(guides.begin(), guides.end(), 
-  //     [](const weak_ptr<frGuide> &a, const weak_ptr<frGuide> &b) {
-  //       frBegin
-
-  //       return a.lock()->getTrackLoc() > b->getTrackLoc();
-  //     }
-  //    );
-
-  genIroutes();
-
-  if (enableOutput) {
-    stringstream ss;
-    ss <<"#guides = " <<guides.size() <<endl;
-    cout <<ss.str() <<flush;
-  }
-  getAllTracks();
-  sort(tracks.begin(), tracks.end(), 
-       [](const unique_ptr<FlexTrack> &a, const unique_ptr<FlexTrack> &b) {
-         return a->getTrackLoc() > b->getTrackLoc();
-       }
-      );
-  auto last = unique(tracks.begin(), tracks.end(), 
-                     [](const unique_ptr<FlexTrack> &a, const unique_ptr<FlexTrack> &b) {
-                       return a->getTrackLoc() == b->getTrackLoc();
-                      }
-                     );
-  tracks.erase(last, tracks.end());
-
-}
-*/
-
-//bool FlexTAWorker::isViaOnPathSeg(const shared_ptr<frPathSeg> &pathSeg, const shared_ptr<frVia> &via) {
-//  frPoint begin, end, viaPoint;
-//  pathSeg->getPoints(begin, end);
-//  via->getOrigin(viaPoint);
-//  // vertical seg
-//  if (begin.x() == end.x() && begin.x() == viaPoint.x() && begin.y() <= viaPoint.y() && end.y() >= viaPoint.y()) {
-//    return true;
-//  }
-//  // horizontal seg
-//  if (begin.y() == end.y() && begin.y() == viaPoint.y() && begin.x() <= viaPoint.x() && end.x() >= viaPoint.x()) {
-//    return true;
-//  }
-//  return false;
-//}
-
-//bool FlexTAWorker::isViaOnTrack(const shared_ptr<FlexTrack> &track, const shared_ptr<frVia> &via) {
-//  frPoint viaPoint;
-//  via->getOrigin(viaPoint);
-//  bool isVerticalLayer = track->getTrackPattern()->isHorizontal();
-//  return ((isVerticalLayer ? viaPoint.x() : viaPoint.y()) == track->getTrackLoc());
-//}
-
-//bool FlexTAWorker::isPathSegOnTrack(const shared_ptr<FlexTrack> &track, const shared_ptr<frPathSeg> &pathSeg) {
-//  frPoint begin, end;
-//  pathSeg->getPoints(begin, end);
-//  bool isVerticalLayer = track->getTrackPattern()->isHorizontal();
-//  if (isVerticalLayer) {
-//    if (begin.x() == end.x() && begin.x() == track->getTrackLoc()) {
-//      return true;
-//    } else {
-//      return false;
-//    }
-//  } else {
-//    if (begin.y() == end.y() && begin.y() == track->getTrackLoc()) {
-//      return true;
-//    } else {
-//      return false;
-//    }
-//  }
-//}
-
-//bool FlexTAWorker::hasPathSegLimit(const shared_ptr<frGuide> &guide, const shared_ptr<frPathSeg> &pathSeg, 
-//                                   bool checkLowerLayer, bool checkUpperLayer) {
-//  bool init = false;
-//  frCoord limit = 0;
-//
-//  auto v = guide->getBeginConn();
-//  getPathSegLimit_helper(guide, pathSeg, checkLowerLayer, checkUpperLayer, true, v, init, limit);
-//  v = guide->getEndConn();
-//  getPathSegLimit_helper(guide, pathSeg, checkLowerLayer, checkUpperLayer, true, v, init, limit);
-//  return init;
-//}
-
-// onlu used for upper/lower layer, keep existing same-layer connection
-//void FlexTAWorker::getPathSegLimit_helper(const shared_ptr<frGuide> &guide, const shared_ptr<frPathSeg> &pathSeg, 
-//  bool checkLowerLayer, bool checkUpperLayer, bool isBegin, const shared_ptr<frBlockObject> &v, bool &init, 
-//  frCoord &limit) {
-//
-//  auto net   = guide->getNet();
-//
-//  frPoint begin, end, viaPoint;
-//  pathSeg->getPoints(begin, end);
-//  //auto pathSegLayerNum = pathSeg->getLayerNum();
-//  
-//  frCollection<shared_ptr<frGuide> > connGuides;
-//  if (v->typeId() == frcSteiner) {
-//    static_pointer_cast<frSteiner>(v)->getConnGuides(connGuides);
-//  } else {
-//    return;
-//  }
-//
-//  auto nbrGuide = connGuides.at(2);
-//  if (nbrGuide && checkLowerLayer && nbrGuide->hasRoutes()) {
-//    for (auto &connFig: nbrGuide->getRoutes()) {
-//      if (connFig->typeId() == frcVia) {
-//        auto via = static_pointer_cast<frVia>(connFig);
-//        if (isViaOnPathSeg(pathSeg, via)) {
-//          via->getOrigin(viaPoint);
-//          // assumes always preferred-direction routing
-//          if (getTech()->getLayer(pathSeg->getLayerNum())->getDir() == frcHorzPrefRoutingDir) {
-//            if (init) {
-//              limit = isBegin ? min(limit, viaPoint.x()) : max(limit, viaPoint.x());
-//            } else {
-//              limit = viaPoint.x();
-//              init = true;
-//            }
-//          } else {
-//            if (init) {
-//              limit = isBegin ? min(limit, viaPoint.y()) : max(limit, viaPoint.y());
-//            } else {
-//              limit = viaPoint.y();
-//              init = true;
-//            }
-//          }
-//        }
-//      }
-//    }
-//  }
-//  nbrGuide = connGuides.at(3);
-//  if (nbrGuide && checkUpperLayer && nbrGuide->hasRoutes()) {
-//    for (auto &connFig: nbrGuide->getRoutes()) {
-//      if (connFig->typeId() == frcVia) {
-//        auto via = static_pointer_cast<frVia>(connFig);
-//        if (isViaOnPathSeg(pathSeg, via)) {
-//          via->getOrigin(viaPoint);
-//          // assumes always preferred-direction routing
-//          if (getTech()->getLayer(pathSeg->getLayerNum())->getDir() == frcHorzPrefRoutingDir) {
-//            if (init) {
-//              limit = isBegin ? min(limit, viaPoint.x()) : max(limit, viaPoint.x());
-//            } else {
-//              limit = viaPoint.x();
-//              init = true;
-//            }
-//          } else {
-//            if (init) {
-//              limit = isBegin ? min(limit, viaPoint.y()) : max(limit, viaPoint.y());
-//            } else {
-//              limit = viaPoint.y();
-//              init = true;
-//            }
-//          }
-//        }
-//      }
-//    }
-//  }
-//
-//}
-
-
-//frCoord FlexTAWorker::getPathSegLimit(const shared_ptr<frGuide> &guide, const shared_ptr<frPathSeg> &pathSeg, 
-//                                      bool checkLowerLayer, bool checkUpperLayer, bool isBegin) {
-//  bool init = false;
-//  frCoord limit = 0;
-//
-//  auto v = guide->getBeginConn();
-//  getPathSegLimit_helper(guide, pathSeg, checkLowerLayer, checkUpperLayer, isBegin, v, init, limit);
-//  v = guide->getEndConn();
-//  getPathSegLimit_helper(guide, pathSeg, checkLowerLayer, checkUpperLayer, isBegin, v, init, limit);
-//  return limit;
-//}
-
-// left and bottom can equal
-//bool FlexTAWorker::isTrackInGuide(const shared_ptr<frGuide> &guide, const shared_ptr<FlexTrack> &track) {
-//  auto trackLoc = track->getTrackLoc();
-//  frPoint begin, end;
-//  guide->getPoints(begin, end);
-//  // isHorizontal == 1 means vertical layer !!!
-//  bool isVerticalLayer = track->getTrackPattern()->isHorizontal();
-//  auto guideLoc  = isVerticalLayer ? begin.x() : begin.y();
-//  auto guideLow  = guideLoc - (isVerticalLayer ? getGCELLGRIDX() / 2 : getGCELLGRIDY() / 2);
-//  auto guideHigh = guideLoc + (isVerticalLayer ? getGCELLGRIDX() / 2 : getGCELLGRIDY() / 2);
-//  return (trackLoc >= guideLow && trackLoc < guideHigh);
-//}
-
-//int FlexTAWorker::getWlenCost_helper(const shared_ptr<FlexIroute> &iroute) {
-//  auto guide = iroute->getGuide();
-//  if (guide && guide->isGlobal()) {
-//    ;
-//  } else {
-//    return 0;
-//  }
-//  frCollection<shared_ptr<frGuide> > connGuides;
-//  frCollection<shared_ptr<frGuide> > connGuides2;
-//  shared_ptr<frSteiner> steiner;
-//  shared_ptr<frSteiner> steiner2;
-//  int wlen = 0;
-//  // left and right steiners
-//  for (int i = 0; i < 2; i++) {
-//    if (i == 0) {
-//      steiner = static_pointer_cast<frSteiner>(guide->getBeginConn());
-//    } else {
-//      steiner = static_pointer_cast<frSteiner>(guide->getEndConn());
-//    }
-//    steiner->getConnGuides(connGuides);
-//    // down and up vias
-//    for (int j = 2; j < 4; j++) {
-//      if (connGuides.at(j)) {
-//        if (j == 2) {
-//          steiner2 = static_pointer_cast<frSteiner>(connGuides.at(j)->getBeginConn());
-//        } else {
-//          steiner2 = static_pointer_cast<frSteiner>(connGuides.at(j)->getEndConn());
-//        }
-//        steiner2->getConnGuides(connGuides2);
-//        if (connGuides2.at(0) && connGuides2.at(0)->isGlobal()) {
-//          wlen -= 1;
-//        }
-//        if (connGuides2.at(1) && connGuides2.at(1)->isGlobal()) {
-//          wlen += 1;
-//        }
-//      }
-//    }
-//  }
-//  return wlen;
-//}
-
-/*
-frUInt4 FlexTAWorker::getWlenCost(FlexIroute* iroute, FlexTrack* track, 
-                                  bool isH, int wlen_helper) {
-
-  //auto &gp = design->getTopBlock()->getGCellPatterns();
-  //auto &xgp = gp[0];
-  //auto &ygp = gp[1];
-  // use frCoord to prevent negative problems
-  //frCoord GCELLGRIDX   = xgp.getSpacing();
-  //frCoord GCELLGRIDY   = ygp.getSpacing();
-  //frCoord GCELLOFFSETX = xgp.getStartCoord();
-  //frCoord GCELLOFFSETY = ygp.getStartCoord();
-  //frCoord GCELLCNTX    = xgp.getCount();
-  //frCoord GCELLCNTY    = ygp.getCount();
-  auto guide = iroute->getGuide();
-  //if (guide && guide->isGlobal()) {
-  //  ;
-  //} else {
-  //  return 0;
-  //}
-  frPoint begin, end;
-  guide->getPoints(begin, end);
-  frBox endBox;
-  frPoint idx;
-  getDesign()->getTopBlock()->getGCellIdx(end, idx);
-  getDesign()->getTopBlock()->getGCellBox(idx, endBox);
-  int wlen = 0;
-  if (wlen_helper <= 0) {
-    if (isH) {
-      wlen = abs(wlen_helper) * (track->getTrackLoc() - endBox.bottom());
-    } else {
-      wlen = abs(wlen_helper) * (track->getTrackLoc() - endBox.left());
-    }
-  } else {
-    if (isH) {
-      wlen = abs(wlen_helper) * (endBox.top() - track->getTrackLoc());
-    } else {
-      wlen = abs(wlen_helper) * (endBox.right() - track->getTrackLoc());
-    }
-  }
-  if (wlen < 0) {
-    cout <<"Error: getWlenCost has wlenCost < 0" <<endl;
-    cout <<"  trackLoc " <<track->getTrackLoc() <<" box " <<endBox <<endl;
-    return (frUInt4)0;
-  } else {
-    return (frUInt4)wlen;
-  }
-}
-*/
-
-/*
-void FlexTAWorker::assignIroutes() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  bool isH = (getDir() == frcHorzPrefRoutingDir) ? true : false;
-  for(auto &uIroute: iroutes) {
-    auto iroute = uIroute.get();
-    int bestTrack = -1;
-    frUInt4 bestCost = UINT_MAX;
-    //int wlen_helper  = getWlenCost_helper(iroute);
-    int wlen_helper  = iroute->getWlenHelper();
-    for (int i = 0; i < (int)tracks.size(); i++) {
-      frUInt4 currCost = 0;
-      auto track = tracks.at(i).get();
-      currCost += 100*track->getOverlapCost(iroute->getBegin(), iroute->getEnd());
-      currCost += getWlenCost(iroute, track, isH, wlen_helper);
-      if (currCost < bestCost) {
-        bestTrack = i;
-        bestCost = currCost;
-      }
-    }
-    if (bestTrack == -1) {
-      cout <<"Error: cannot find a track" <<endl;
-      exit(1);
-    } else {
-      iroute->setTrack(tracks.at(bestTrack).get());
-      tracks.at(bestTrack)->addToOverlapCost(iroute->getBegin(), iroute->getEnd());
-      if (enableOutput) {
-        auto dbu = getDesign()->getTopBlock()->getDBUPerUU();
-        auto layerName = getTech()->getLayer(layerNum)->getName();
-        stringstream ss;
-        if (isH) {
-          ss   <<"assigned ( " 
-               <<iroute->getBegin()                * 1.0 / dbu <<" "
-               <<iroute->getTrack()->getTrackLoc() * 1.0 / dbu <<" ) ( "
-               <<iroute->getEnd()                  * 1.0 / dbu <<" "
-               <<iroute->getTrack()->getTrackLoc() * 1.0 / dbu <<" ) "
-               <<layerName <<endl;
-        } else {
-          ss   <<"assigned ( " 
-               <<iroute->getTrack()->getTrackLoc() * 1.0 / dbu <<" "
-               <<iroute->getBegin()                * 1.0 / dbu <<" ) ( "
-               <<iroute->getTrack()->getTrackLoc() * 1.0 / dbu <<" "
-               <<iroute->getEnd()                  * 1.0 / dbu <<" ) "
-               <<layerName <<endl;
-        }
-        cout <<ss.str();
-      }
-    }
-  }
-}
-*/
-
-/*
-void FlexTAWorker::reassignIroutes() {
-  ;
-}
-*/
-
-/*
-void FlexTAWorker::saveToGuides() {
-  bool isH = (getDir() == frcHorzPrefRoutingDir) ? true : false;
-  auto defaultSegStyle = getTech()->getLayer(layerNum)->getDefaultSegStyle();
-  frPoint begin, end;
-  for (auto &iroute: iroutes) {
-    if (iroute->getTrack()) {
-      unique_ptr<frPathSeg> pathSeg = make_unique<frPathSeg>();
-      if (isH) {
-        begin.set(iroute->getBegin(), iroute->getTrack()->getTrackLoc());
-        end.set(iroute->getEnd(), iroute->getTrack()->getTrackLoc());
-      } else {
-        begin.set(iroute->getTrack()->getTrackLoc(), iroute->getBegin());
-        end.set(iroute->getTrack()->getTrackLoc(), iroute->getEnd());
-      }
-      pathSeg->setPoints(begin, end);
-      pathSeg->setLayerNum(layerNum);
-      pathSeg->addToNet(iroute->getGuide()->getNet());
-      pathSeg->setStyle(defaultSegStyle);
-      auto guide = iroute->getGuide();
-      if (guide) {
-        vector<unique_ptr<frConnFig> > tmp;
-        tmp.push_back(std::move(pathSeg));
-        guide->setRoutes(tmp);
-      }
-      // modify upper/lower segs
-      // upper/lower seg will have longest wirelength
-    }
-  }
-}
-*/
-
-/*
-void FlexTAWorker::reportCosts() {
-  bool isH = (getDir() == frcHorzPrefRoutingDir) ? true : false;
-  frCoord begin, end;
-  if (isH) {
-    begin = routeBox.left();
-    end   = routeBox.right();
-  } else {
-    begin = routeBox.bottom();
-    end   = routeBox.top();
-  }
-  frCoord wlen = 0;
-  for (auto &iroute: iroutes) {
-    wlen += iroute->getEnd() - iroute->getBegin();
-  }
-  frUInt4 overlapCost = 0;
-  for (auto &track: tracks) {
-    overlapCost += track->reportOverlapCost(begin, end);
-  }
-  if (VERBOSE > 1) {
-    stringstream ss;
-    ss <<"wlen/ovlp = " <<wlen <<"/" <<overlapCost <<endl; 
-    cout <<ss.str();
-  }
-}
-*/
-
-
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.h b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.h
deleted file mode 100644
index a5ea78b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _FR_FLEXTA_H_
-#define _FR_FLEXTA_H_
-
-#include <memory>
-//#include "db/tech/frTechObject.h"
-#include "frDesign.h"
-//#include "db/obj/frGuide.h"
-//#include "db/obj/frVia.h"
-//#include "db/taObj/taTrack.h"
-#include "db/taObj/taPin.h"
-#include <set>
-
-//#include <boost/icl/interval_map.hpp>
-//#include <boost/pool/pool_alloc.hpp>
-
-namespace fr {
-  //class FlexIroute {
-  //public:
-  //  FlexIroute(): guide(), track(), begin(0), end(0), wlen_helper(0) {};
-  //  // getters
-  //  frCoord getBegin() const {
-  //    return begin;
-  //  }
-  //  frCoord getEnd() const {
-  //    return end;
-  //  }
-  //  frGuide* getGuide() const {
-  //    return guide;
-  //  }
-  //  FlexTrack* getTrack() const {
-  //    return track;
-  //  }
-  //  int getWlenHelper() const {
-  //    return wlen_helper;
-  //  }
-  //  // setters
-  //  void setGuide(frGuide* in) {
-  //    guide = in;
-  //  }
-  //  void setTrack(FlexTrack* in) {
-  //    track = in;
-  //  }
-  //  void setBegin(frCoord in) {
-  //    begin = in;
-  //  }
-  //  void setEnd(frCoord in) {
-  //    end = in;
-  //  }
-  //  void setWlenHelper(int in) {
-  //    wlen_helper = in;
-  //  }
-  //protected:
-  //  frGuide*   guide;
-  //  FlexTrack* track;
-  //  frCoord    begin;
-  //  frCoord    end;
-  //  int        wlen_helper;
-  //};
-
-
-  class FlexTA {
-  public:
-    // constructors
-    //FlexTA(): tech(std::make_shared<frTechObject>()), design(std::make_shared<frDesign>()) {};
-    FlexTA(frDesign* in): tech(in->getTech()), design(in) {};
-    // getters
-    frTechObject* getTech() const {
-      return tech;
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    // others
-    int main();
-  protected:
-    frTechObject*   tech;
-    frDesign*       design;
-    // others
-    void main_helper(frLayerNum lNum, int maxOffsetIter, int panelWidth);
-    void initTA(int size);
-    void searchRepair(int iter, int size, int offset);
-    int  initTA_helper(int iter, int size, int offset, bool isH, int &numPanels);
-  };
-
-
-  class FlexTAWorker;
-  class FlexTAWorkerRegionQuery {
-  public:
-    FlexTAWorkerRegionQuery(FlexTAWorker* in): taWorker(in) {}
-    frDesign* getDesign() const;
-    FlexTAWorker* getTAWorker() const {
-      return taWorker;
-    }
-    
-    void add(taPinFig* fig);
-    void remove(taPinFig* fig);
-    //void query(const frBox &box, frLayerNum layerNum, std::vector<rq_rptr_value_t<taConnFig> > &result);
-    void query(const frBox &box, frLayerNum layerNum, std::set<taPin*, frBlockObjectComp> &result);
-
-    void addCost(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con);
-    void removeCost(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con);
-    void queryCost(const frBox &box, frLayerNum layerNum, std::vector<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> > > &result);
-    
-    //void addAP(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con);
-    //void removeAP(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con);
-    //void queryAP(const frBox &box, frLayerNum layerNum, std::vector<rq_rptr_value_t<frBlockObject> > &result);
-    
-    void init();
-  protected:
-    FlexTAWorker* taWorker;
-    std::vector<bgi::rtree<rq_rptr_value_t<taPinFig>, 
-                           bgi::quadratic<16>/*, 
-                           bgi::indexable<rq_rptr_value_t<taPinFig> >,
-                           bgi::equal_to<rq_rptr_value_t<taPinFig> >,
-                           boost::pool_allocator<rq_rptr_value_t<taPinFig> > */
-                          >
-               > shapes; // resource map
-    // fixed objs, owner:: nullptr or net, con = short 
-    std::vector<bgi::rtree<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> >, 
-                           bgi::quadratic<16>/*,
-                           bgi::indexable<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> > >,
-                           bgi::equal_to<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> > >,
-                           boost::pool_allocator<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> > > */
-                          > 
-               > costs;
-    // ap, owner:net
-    //std::vector<bgi::rtree<rq_rptr_value_t<frBlockObject>, bgi::quadratic<16> > > aps;
-    
-    void modCost(taPinFig* fig, bool isAddCost);
-  };
-
-  //class FlexTAWorkerSort {
-  //public:
-  //  FlexTAWorkerSort(std::vector<iroute> *in): ptr(in) {}
-  //  bool operator()(const taIroute &lhs, const taIroute &rhs) const {
-  //    return ptr
-  //protected:
-  //  std::vector<iroutes> *ptr;
-  //}
-
-
-  class FlexTAWorker {
-  public:
-    // constructors
-    FlexTAWorker(frDesign* designIn): design(designIn), rq(this), numAssigned(0), totCost(0), maxRetry(1)/*, totDrcCost(0)*/ {};
-    // setters
-    void setRouteBox(const frBox &boxIn) {
-      routeBox.set(boxIn);
-    }
-    void setExtBox(const frBox &boxIn) {
-      extBox.set(boxIn);
-    }
-    void setDir(frPrefRoutingDirEnum in) {
-      dir = in;
-    }
-    void setTAIter(int in) {
-      taIter = in;
-    }
-    void addIroute(std::unique_ptr<taPin> &in, bool isExt = false) {
-      in->setId(iroutes.size() + extIroutes.size());
-      if (isExt) {
-        extIroutes.push_back(std::move(in));
-      } else {
-        iroutes.push_back(std::move(in));
-      }
-    }
-    void addToReassignIroutes(taPin* in) {
-      reassignIroutes.insert(in);
-    }
-    void removeFromReassignIroutes(taPin* in) {
-      auto it = reassignIroutes.find(in);
-      if (it != reassignIroutes.end()) {
-        reassignIroutes.erase(it);
-      }
-    }
-    taPin* popFromReassignIroutes() {
-      taPin *sol = nullptr;
-      if (!reassignIroutes.empty()) {
-        sol = *reassignIroutes.begin();
-        reassignIroutes.erase(reassignIroutes.begin());
-      }
-      return sol;
-    }
-    // getters
-    frTechObject* getTech() const {
-      return design->getTech();
-    }
-    frDesign* getDesign() const {
-      return design;
-    }
-    const frBox& getRouteBox() const {
-      return routeBox;
-    }
-    const frBox& getExtBox() const {
-      return extBox;
-    }
-    frPrefRoutingDirEnum getDir() const {
-      return dir;
-    }
-    int getTAIter() const {
-      return taIter;
-    }
-    bool isInitTA() const {
-      return (taIter == 0);
-    }
-    frRegionQuery* getRegionQuery() const {
-      return design->getRegionQuery();
-    }
-    void getTrackIdx(frCoord loc1, frCoord loc2, frLayerNum lNum, int &idx1, int &idx2) const {
-      idx1 = int(std::lower_bound(trackLocs[lNum].begin(), trackLocs[lNum].end(), loc1) - trackLocs[lNum].begin());
-      idx2 = int(std::upper_bound(trackLocs[lNum].begin(), trackLocs[lNum].end(), loc2) - trackLocs[lNum].begin()) - 1;
-    }
-    const std::vector<frCoord>& getTrackLocs(frLayerNum in) const {
-      return trackLocs[in];
-    }
-    //const std::vector<taTrack>& getTracks(frLayerNum in) const {
-    //  return tracks[in];
-    //}
-    //std::vector<taTrack>& getTracks(frLayerNum in) {
-    //  return tracks[in];
-    //}
-    const FlexTAWorkerRegionQuery& getWorkerRegionQuery() const {
-      return rq;
-    }
-    FlexTAWorkerRegionQuery& getWorkerRegionQuery() {
-      return rq;
-    }
-    int getNumAssigned() const {
-      return numAssigned;
-    }
-    // others
-    int main();
-    
-  protected:
-    frTechObject*                      tech;
-    frDesign*                          design;
-    frBox                              routeBox;
-    frBox                              extBox;
-    frPrefRoutingDirEnum               dir;
-    int                                taIter;
-    FlexTAWorkerRegionQuery            rq;
-
-    //std::vector<frGuide*>            guides;
-    std::vector<std::unique_ptr<taPin> > iroutes; // unsorterd iroutes
-    std::vector<std::unique_ptr<taPin> > extIroutes;
-    std::vector<std::vector<frCoord> >   trackLocs;
-    //std::vector<std::vector<taTrack> >   tracks;
-    //std::priority_queue<taIroute*, std::vector<taIroute*>, taIrouteComp> pq;
-    std::set<taPin*, taPinComp>  reassignIroutes; // iroutes to be assigned in sorted order
-
-    int                                numAssigned;
-    int                                totCost;
-    int                                maxRetry;
-    //frUInt4                            totDrcCost;
-    
-    //// others
-    void init();
-    void initFixedObjs();
-    void initFixedObjs_helper(const frBox &box, frCoord bloatDist, frLayerNum lNum, frNet* net);
-    void initTracks();
-    void initIroutes();
-    void initIroute(frGuide *in);
-    void initIroute_helper(frGuide* guide, frCoord &maxBegin, frCoord &minEnd, 
-                           std::set<frCoord> &downViaCoordSet, std::set<frCoord> &upViaCoordSet, int &wlen, frCoord &wlen2);
-    void initIroute_helper_generic(frGuide* guide, frCoord &maxBegin, frCoord &minEnd, 
-                                   std::set<frCoord> &downViaCoordSet, std::set<frCoord> &upViaCoordSet, int &wlen, frCoord &wlen2);
-    void initIroute_helper_generic_helper(frGuide* guide, frCoord &wlen2);
-    bool initIroute_helper_pin(frGuide* guide, frCoord &maxBegin, frCoord &minEnd, 
-                               std::set<frCoord> &downViaCoordSet, std::set<frCoord> &upViaCoordSet, int &wlen, frCoord &wlen2);
-    void initCosts();
-    void sortIroutes();
-
-    // quick drc
-    inline frCoord box2boxDistSquare(const frBox &box1, const frBox &box2, frCoord &dx, frCoord &dy);
-    void addCost(taPinFig* fig, std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-    void subCost(taPinFig* fig, std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-    void modCost(taPinFig* fig, bool isAddCost, std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-    void modMinSpacingCostPlanar(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, 
-                                 std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-    void modMinSpacingCostVia(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, bool isUpperVia, 
-                              bool isCurrPs, std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-    void modCutSpacingCost(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, std::set<taPin*, frBlockObjectComp> *pinS = nullptr);
-
-    // initTA
-    void assign();
-    void assignIroute(taPin* iroute);
-    void assignIroute_init(taPin* iroute, std::set<taPin*, frBlockObjectComp> *pinS);
-    void assignIroute_availTracks(taPin* iroute, frLayerNum &lNum, int &idx1, int &idx2);
-    int  assignIroute_bestTrack(taPin* iroute, frLayerNum lNum, int idx1, int idx2);
-    void assignIroute_bestTrack_helper(taPin* iroute, frLayerNum lNum, int trackIdx, frUInt4 &bestCost, 
-                                       frCoord &bestTrackLoc, int &bestTrackIdx, frUInt4 &drcCost);
-    frUInt4 assignIroute_getCost(taPin *iroute, frCoord trackLoc, frUInt4 &drcCost);
-    frUInt4 assignIroute_getWlenCost(taPin *iroute, frCoord trackLoc);
-    frUInt4 assignIroute_getPinCost(taPin* iroute, frCoord trackLoc);
-    frUInt4 assignIroute_getAlignCost(taPin* iroute, frCoord trackLoc);
-    frUInt4 assignIroute_getDRCCost(taPin *iroute, frCoord trackLoc);
-    frUInt4 assignIroute_getDRCCost_helper(taPin* iroute, const frBox &box, frLayerNum lNum);
-    void assignIroute_updateIroute(taPin* iroute, frCoord bestTrackLoc, std::set<taPin*, frBlockObjectComp> *pinS);
-    void assignIroute_updateOthers(std::set<taPin*, frBlockObjectComp> &pinS);
-
-    // end
-    void end();
-    void saveToGuides();
-
-    //frCost getCost();
-    //void getAllGuides();
-    //void getAllTracks();
-
-    //void genIroutes();
-    //void genIroutes_setBeginEnd(FlexIroute* iroute, bool isH);
-    //void assignIroutes();
-    ////int getWlenCost_helper(FlexIroute* iroute);
-    //frUInt4 getWlenCost(FlexIroute* iroute, FlexTrack* track, 
-    //                    bool isH, int wlen_helper);
-    //void reassignIroutes();
-    //void saveToGuides();
-    //void reportCosts();
-
-
-
-    //bool isTrackInGuide(const std::shared_ptr<frGuide> &guide, const std::shared_ptr<FlexTrack> &track);
-
-    /* assumption
-     * layer direction is always alternative
-     * in track assignment, only do nets with guides only, no physical wires and vias
-     * each track has one candidate
-     * each global or local guide has 0<=x<=1 pathseg, pathsegonly
-     * each via guide has >=0 physical vias, via only
-     */
-    //bool isViaOnPathSeg(const std::shared_ptr<frPathSeg> &pathSeg, const std::shared_ptr<frVia> &via);
-    //bool isViaOnTrack(const std::shared_ptr<FlexTrack> &track, const std::shared_ptr<frVia> &via);
-    //bool isPathSegOnTrack(const std::shared_ptr<FlexTrack> &track, const std::shared_ptr<frPathSeg> &pathSeg);
-    // check whether nbr pathSeg length is bounded by non-current-layer segments
-    //bool hasPathSegLimit(const std::shared_ptr<frGuide> &guide, const std::shared_ptr<frPathSeg> &pathSeg, 
-    //                     bool checkLowerLayer, bool checkUpperLayer);
-    //frCoord getPathSegLimit(const std::shared_ptr<frGuide> &guide, const std::shared_ptr<frPathSeg> &pathSeg, 
-    //                        bool checkLowerLayer, bool checkUpperLayer, bool isBegin);
-    //void getPathSegLimit_helper(const std::shared_ptr<frGuide> &guide, 
-    //                            const std::shared_ptr<frPathSeg> &pathSeg, 
-    //                            bool checkLowerLayer, bool checkUpperLayer, bool isBegin, 
-    //                            const std::shared_ptr<frBlockObject> &v, 
-    //                            bool &init, frCoord &limit); // init and limit must be reference
-  };
-
-}
-
-
-#endif
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_assign.cpp b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_assign.cpp
deleted file mode 100644
index 45d393e..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_assign.cpp
+++ /dev/null
@@ -1,1148 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <cmath>
-#include "ta/FlexTA.h"
-
-using namespace std;
-using namespace fr;
-
-inline frCoord FlexTAWorker::box2boxDistSquare(const frBox &box1, const frBox &box2, frCoord &dx, frCoord &dy) {
-  dx = max(max(box1.left(), box2.left())     - min(box1.right(), box2.right()), 0);
-  dy = max(max(box1.bottom(), box2.bottom()) - min(box1.top(), box2.top()),     0);
-  return dx * dx + dy * dy;
-}
-
-// must be current TA layer
-void FlexTAWorker::modMinSpacingCostPlanar(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, set<taPin*, frBlockObjectComp> *pinS) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  // obj1 = curr obj
-  frCoord width1  = box.width();
-  frCoord length1 = box.length();
-  // obj2 = other obj
-  // layer default width
-  frCoord width2     = getDesign()->getTech()->getLayer(lNum)->getWidth();
-  frCoord halfwidth2 = width2 / 2;
-  // spacing value needed
-  frCoord bloatDist = 0;
-  auto con = getDesign()->getTech()->getLayer(lNum)->getMinSpacing();
-  if (con) {
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      bloatDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      bloatDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), length1);
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      bloatDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, length1);
-    } else {
-      cout <<"Warning: min spacing rule not supporterd" <<endl;
-      return;
-    }
-  } else {
-    cout <<"Warning: no min spacing rule" <<endl;
-    return;
-  }
-  frCoord bloatDistSquare = bloatDist * bloatDist;
-
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-
-  // now assume track in H direction
-  frCoord boxLow  = isH ? box.bottom() : box.left();
-  frCoord boxHigh = isH ? box.top()    : box.right();
-  frCoord boxLeft = isH ? box.left()   : box.bottom();
-  frCoord boxRight= isH ? box.right()  : box.top();
-  frBox box1(boxLeft, boxLow, boxRight, boxHigh);
-
-  int idx1, idx2;
-  getTrackIdx(boxLow - bloatDist - halfwidth2 + 1, boxHigh + bloatDist + halfwidth2 - 1, lNum, idx1, idx2);
-
-  frBox box2(-halfwidth2, -halfwidth2, halfwidth2, halfwidth2);
-  frTransform xform;
-  frCoord dx, dy;
-  auto &trackLocs = getTrackLocs(lNum);
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  for (int i = idx1; i <= idx2; i++) {
-    //cout <<"@@@ " <<i <<endl <<flush;
-    auto trackLoc = trackLocs[i];
-    xform.set(frPoint(boxLeft, trackLoc));
-    box2.transform(xform);
-    box2boxDistSquare(box1, box2, dx, dy);
-    frCoord maxX = (frCoord)(sqrt(1.0 * bloatDistSquare - 1.0 * dy * dy));
-    if (maxX * maxX + dy * dy == bloatDistSquare) {
-      maxX = max(0, maxX - 1);
-    }
-    frCoord blockLeft  = boxLeft  - maxX - halfwidth2;
-    frCoord blockRight = boxRight + maxX + halfwidth2;
-    frBox tmpBox;
-    if (isH) {
-      tmpBox.set(blockLeft, trackLoc, blockRight, trackLoc);
-    } else {
-      tmpBox.set(trackLoc, blockLeft, trackLoc, blockRight);
-    }
-    if (isAddCost) {
-      workerRegionQuery.addCost(tmpBox, lNum, fig, con);
-      if (pinS) {
-        workerRegionQuery.query(tmpBox, lNum, *pinS);
-      }
-      if (enableOutput) {
-        cout <<"  add minSpc planar@("
-             <<tmpBox.left()  / dbu <<", " <<tmpBox.bottom() / dbu <<") (" 
-             <<tmpBox.right() / dbu <<", " <<tmpBox.top()    / dbu <<") " 
-             <<getDesign()->getTech()->getLayer(lNum)->getName() <<endl <<flush;
-      }
-    } else {
-      workerRegionQuery.removeCost(tmpBox, lNum, fig, con);
-      if (pinS) {
-        workerRegionQuery.query(tmpBox, lNum, *pinS);
-      }
-      if (enableOutput) {
-        cout <<"  sub minSpc planar@(" 
-             <<tmpBox.left()  / dbu <<", " <<tmpBox.bottom() / dbu <<") (" 
-             <<tmpBox.right() / dbu <<", " <<tmpBox.top()    / dbu <<") " 
-             <<getDesign()->getTech()->getLayer(lNum)->getName() <<endl <<flush;
-      }
-    }
-  }
-}
-
-// given a shape on any routing layer n, block via @(n+1) if isUpperVia is true
-void FlexTAWorker::modMinSpacingCostVia(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, bool isUpperVia, bool isCurrPs, 
-                                        set<taPin*, frBlockObjectComp> *pinS) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  // obj1 = curr obj
-  frCoord width1  = box.width();
-  frCoord length1 = box.length();
-  // obj2 = other obj
-  // default via dimension
-  frViaDef* viaDef = nullptr;
-  frLayerNum cutLNum = 0;
-  if (isUpperVia) {
-    viaDef = (lNum < getDesign()->getTech()->getTopLayerNum()) ? 
-             getDesign()->getTech()->getLayer(lNum+1)->getDefaultViaDef() : 
-             nullptr;
-    cutLNum = lNum + 1;
-  } else {
-    viaDef = (lNum > getDesign()->getTech()->getBottomLayerNum()) ? 
-             getDesign()->getTech()->getLayer(lNum-1)->getDefaultViaDef() : 
-             nullptr;
-    cutLNum = lNum - 1;
-  }
-  if (viaDef == nullptr) {
-    return;
-  }
-  frVia via(viaDef);
-  frBox viaBox(0,0,0,0);
-  if (isUpperVia) {
-    via.getLayer1BBox(viaBox);
-  } else {
-    via.getLayer2BBox(viaBox);
-  }
-  frCoord width2  = viaBox.width();
-  frCoord length2 = viaBox.length();
-
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frLayerNum followTrackLNum = (int)getDesign()->getTech()->getBottomLayerNum() - 1;
-  if (cutLNum - 1 >= getDesign()->getTech()->getBottomLayerNum() && 
-      getDesign()->getTech()->getLayer(cutLNum - 1)->getType() == frLayerTypeEnum::ROUTING &&
-      getDesign()->getTech()->getLayer(cutLNum - 1)->getDir() == getDir()) {
-    followTrackLNum = cutLNum - 1;
-  } else if (cutLNum + 1 <= getDesign()->getTech()->getTopLayerNum() && 
-             getDesign()->getTech()->getLayer(cutLNum + 1)->getType() == frLayerTypeEnum::ROUTING &&
-             getDesign()->getTech()->getLayer(cutLNum + 1)->getDir() == getDir()) {
-    followTrackLNum = cutLNum + 1;
-  } else {
-    cout <<"Warning: via layer connected to non-routing layer, skipped in modMinSpacingCostVia" <<endl;
-    return;
-  }
-
-  // spacing value needed
-  frCoord bloatDist = 0;
-  auto con = getDesign()->getTech()->getLayer(lNum)->getMinSpacing();
-  if (con) {
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      bloatDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      bloatDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), isCurrPs ? length2 : min(length1, length2));
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      bloatDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, isCurrPs ? length2 : min(length1, length2));
-    } else {
-      cout <<"Warning: min spacing rule not supporterd" <<endl;
-      return;
-    }
-  } else {
-    cout <<"Warning: no min spacing rule" <<endl;
-    return;
-  }
-  // other obj eol spc to curr obj
-  // no need to bloat eolWithin because eolWithin always < minSpacing
-  //frCoord bloatDistEolX = 0;
-  //frCoord bloatDistEolY = 0;
-  //for (auto con: getDesign()->getTech()->getLayer(lNum)->getEolSpacing()) {
-  //  auto eolSpace  = con->getMinSpacing();
-  //  auto eolWidth  = con->getEolWidth();
-  //  // eol up and down
-  //  if (viaBox.right() - viaBox.left() < eolWidth) {
-  //    bloatDistEolY = max(bloatDistEolY, eolSpace);
-  //  } 
-  //  // eol left and right
-  //  if (viaBox.top() - viaBox.bottom() < eolWidth) {
-  //    bloatDistEolX = max(bloatDistEolX, eolSpace);
-  //  }
-  //}
-  //frCoord bloatDistSquare = bloatDist * bloatDist;
-
-  int idx1, idx2;
-  if (isH) {
-    getTrackIdx(box.bottom() - bloatDist - (viaBox.top() - 0) + 1, 
-                box.top()    + bloatDist + (0 - viaBox.bottom()) - 1,
-                followTrackLNum, idx1, idx2);
-  } else {
-    getTrackIdx(box.left()   - bloatDist - (viaBox.right() - 0) + 1, 
-                box.right()  + bloatDist + (0 - viaBox.left()) - 1,
-                followTrackLNum, idx1, idx2);
-  }
-
-  auto &trackLocs = getTrackLocs(followTrackLNum);
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  frBox tmpBx;
-  frTransform xform;
-  frCoord dx, dy, prl;
-  //frCoord distSquare;
-  frCoord reqDist = 0;
-  frCoord maxX, blockLeft, blockRight;
-  frBox blockBox;
-  for (int i = idx1; i <= idx2; i++) {
-    //cout <<"@@@ " <<i <<endl <<flush;
-    auto trackLoc = trackLocs[i];
-    if (isH) {
-      xform.set(frPoint(box.left(), trackLoc));
-    } else {
-      xform.set(frPoint(trackLoc, box.bottom()));
-    }
-    tmpBx.set(viaBox);
-    tmpBx.transform(xform);
-    //distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-    box2boxDistSquare(box, tmpBx, dx, dy);
-    if (isH) { // track is horizontal
-      if (dy > 0) { // via at the bottom of box
-        if (isCurrPs) { // prl maxed out to be viaBox
-          prl = viaBox.right() - viaBox.left();
-        } else { // prl maxed out to be smaller of box and viaBox
-          prl = min(box.right() - box.left(), viaBox.right() - viaBox.left());
-        }
-      // via at the side of box
-      } else {
-        if (isCurrPs) { // prl maxed out to be viaBox
-          prl = viaBox.top() - viaBox.bottom();
-        } else { // prl maxed out to be smaller of box and viaBox
-          prl = min(box.top() - box.bottom(), viaBox.top() - viaBox.bottom());
-        }
-      }
-    } else { // track is vertical
-      if (dx > 0) { // via at the bottom of box
-        if (isCurrPs) { // prl maxed out to be viaBox
-          prl = viaBox.top() - viaBox.bottom();
-        } else { // prl maxed out to be smaller of box and viaBox
-          prl = min(box.top() - box.bottom(), viaBox.top() - viaBox.bottom());
-        }
-      // via at the side of box
-      } else {
-        if (isCurrPs) { // prl maxed out to be viaBox
-          prl = viaBox.right() - viaBox.left();
-        } else { // prl maxed out to be smaller of box and viaBox
-          prl = min(box.right() - box.left(), viaBox.right() - viaBox.left());
-        }
-      }
-    }
-    
-    if (con->typeId() == frConstraintTypeEnum::frcSpacingConstraint) {
-      reqDist = static_cast<frSpacingConstraint*>(con)->getMinSpacing();
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTablePrlConstraint) {
-      reqDist = static_cast<frSpacingTablePrlConstraint*>(con)->find(max(width1, width2), prl);
-    } else if (con->typeId() == frConstraintTypeEnum::frcSpacingTableTwConstraint) {
-      reqDist = static_cast<frSpacingTableTwConstraint*>(con)->find(width1, width2, prl);
-    }
-
-    if (isH) {
-      if (dy >= reqDist) {
-        continue;
-      }
-      maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * dy * dy));
-      if (maxX * maxX + dy * dy == reqDist * reqDist) {
-        maxX = max(0, maxX - 1);
-      }
-      blockLeft  = box.left()  - maxX - (viaBox.right() - 0);
-      blockRight = box.right() + maxX + (0- viaBox.left());
-
-      blockBox.set(blockLeft, trackLoc, blockRight, trackLoc);
-    } else {
-      if (dx >= reqDist) {
-        continue;
-      }
-      maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * dx * dx));
-      if (maxX * maxX + dx * dx == reqDist * reqDist) {
-        maxX = max(0, maxX - 1);
-      }
-      blockLeft  = box.bottom() - maxX - (viaBox.top() - 0);
-      blockRight = box.top()    + maxX + (0- viaBox.bottom());
-
-      blockBox.set(trackLoc, blockLeft, trackLoc, blockRight);
-    }
-
-    if (isAddCost) {
-      workerRegionQuery.addCost(blockBox, cutLNum, fig, con);
-      if (pinS) {
-        workerRegionQuery.query(blockBox, cutLNum, *pinS);
-      }
-      if (enableOutput) {
-        cout <<"  add minSpc via@("
-             <<blockBox.left()  / dbu <<", " <<blockBox.bottom() / dbu <<") (" 
-             <<blockBox.right() / dbu <<", " <<blockBox.top()    / dbu <<") " 
-             <<getDesign()->getTech()->getLayer(cutLNum)->getName() <<endl <<flush;
-      }
-    } else {
-      workerRegionQuery.removeCost(blockBox, cutLNum, fig, con);
-      if (pinS) {
-        workerRegionQuery.query(blockBox, cutLNum, *pinS);
-      }
-      if (enableOutput) {
-        cout <<"  sub minSpc via@(" 
-             <<blockBox.left()  / dbu <<", " <<blockBox.bottom() / dbu <<") (" 
-             <<blockBox.right() / dbu <<", " <<blockBox.top()    / dbu <<") " 
-             <<getDesign()->getTech()->getLayer(cutLNum)->getName() <<endl <<flush;
-      }
-    }
-  }
-
-}
-
-void FlexTAWorker::modCutSpacingCost(const frBox &box, frLayerNum lNum, taPinFig* fig, bool isAddCost, set<taPin*, frBlockObjectComp> *pinS) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  if (!getDesign()->getTech()->getLayer(lNum)->hasCutSpacing()) {
-    return;
-  }
-  // obj1 = curr obj
-  // obj2 = other obj
-  // default via dimension
-  frViaDef* viaDef = getDesign()->getTech()->getLayer(lNum)->getDefaultViaDef();
-  frVia via(viaDef);
-  frBox viaBox(0,0,0,0);
-  via.getCutBBox(viaBox);
-
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frLayerNum followTrackLNum = (int)getDesign()->getTech()->getBottomLayerNum() - 1;
-  if (lNum - 1 >= getDesign()->getTech()->getBottomLayerNum() && 
-      getDesign()->getTech()->getLayer(lNum - 1)->getType() == frLayerTypeEnum::ROUTING &&
-      getDesign()->getTech()->getLayer(lNum - 1)->getDir() == getDir()) {
-    followTrackLNum = lNum - 1;
-  } else if (lNum + 1 <= getDesign()->getTech()->getTopLayerNum() && 
-             getDesign()->getTech()->getLayer(lNum + 1)->getType() == frLayerTypeEnum::ROUTING &&
-             getDesign()->getTech()->getLayer(lNum + 1)->getDir() == getDir()) {
-    followTrackLNum = lNum + 1;
-  } else {
-    cout <<"Warning: via layer connected to non-routing layer, skipped in modMinSpacingCostVia" <<endl;
-    return;
-  }
-
-  // spacing value needed
-  frCoord bloatDist = 0;
-  for (auto con: getDesign()->getTech()->getLayer(lNum)->getCutSpacing()) {
-    bloatDist = max(bloatDist, con->getCutSpacing());
-  }
-
-  int idx1, idx2;
-  if (isH) {
-    getTrackIdx(box.bottom() - bloatDist - (viaBox.top() - 0) + 1, 
-                box.top()    + bloatDist + (0 - viaBox.bottom()) - 1,
-                followTrackLNum, idx1, idx2);
-  } else {
-    getTrackIdx(box.left()   - bloatDist - (viaBox.right() - 0) + 1, 
-                box.right()  + bloatDist + (0 - viaBox.left()) - 1,
-                followTrackLNum, idx1, idx2);
-  }
-
-  auto &trackLocs = getTrackLocs(followTrackLNum);
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  frBox tmpBx;
-  frTransform xform;
-  frCoord dx, dy, c2ctrackdist;
-  //frCoord distSquare;
-  frCoord reqDist = 0;
-  frCoord maxX, blockLeft, blockRight;
-  frBox blockBox;
-  frPoint boxCenter, tmpBxCenter;
-  boxCenter.set((box.left() + box.right()) / 2, (box.bottom() + box.top()) / 2);
-  bool hasViol = false;
-  for (int i = idx1; i <= idx2; i++) {
-    auto trackLoc = trackLocs[i];
-    //cout <<"@@@" <<trackLoc <<endl;
-    if (isH) {
-      xform.set(frPoint(box.left(), trackLoc));
-    } else {
-      xform.set(frPoint(trackLoc, box.bottom()));
-    }
-    tmpBx.set(viaBox);
-    tmpBx.transform(xform);
-    //distSquare = box2boxDistSquare(box, tmpBx, dx, dy);
-    box2boxDistSquare(box, tmpBx, dx, dy);
-
-    for (auto con: getDesign()->getTech()->getLayer(lNum)->getCutSpacing()) {
-      hasViol       = false;
-      reqDist       = con->getCutSpacing();
-      bool isC2C = con->hasCenterToCenter();
-      if (isH) {
-        c2ctrackdist = abs(boxCenter.y() - trackLoc);
-      } else {
-        c2ctrackdist = abs(boxCenter.x() - trackLoc);
-      }
-
-      if (isH) {
-        if (isC2C) {
-          if (c2ctrackdist >= reqDist) {
-            continue;
-          }
-        } else {
-          if (dy >= reqDist) {
-            continue;
-          }
-        }
-        //cout <<"@@@@" <<trackLoc <<endl;
-        if (isC2C) {
-          maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * c2ctrackdist * c2ctrackdist));
-        } else {
-          maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * dy * dy));
-        }
-        if (maxX * maxX + dy * dy == reqDist * reqDist) {
-          maxX = max(0, maxX - 1);
-        }
-        if (isC2C) {
-          blockLeft  = boxCenter.x() - maxX;
-          blockRight = boxCenter.x() + maxX;
-        } else {
-          blockLeft  = box.left()  - maxX - (viaBox.right() - 0);
-          blockRight = box.right() + maxX + (0- viaBox.left());
-        }
-        blockBox.set(blockLeft, trackLoc, blockRight, trackLoc);
-      } else {
-        if (isC2C) {
-          if (c2ctrackdist >= reqDist) {
-            continue;
-          }
-        } else {
-          if (dx >= reqDist) {
-            continue;
-          }
-        }
-        //cout <<"@@@@" <<trackLoc <<endl;
-        if (isC2C) {
-          maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * c2ctrackdist * c2ctrackdist));
-        } else {
-          maxX = (frCoord)(sqrt(1.0 * reqDist * reqDist - 1.0 * dx * dx));
-        }
-        if (maxX * maxX + dx * dx == reqDist * reqDist) {
-          maxX = max(0, maxX - 1);
-        }
-        if (isC2C) {
-          blockLeft  = boxCenter.y() - maxX;
-          blockRight = boxCenter.y() + maxX;
-        } else {
-          blockLeft  = box.bottom()  - maxX - (viaBox.top() - 0);
-          blockRight = box.top()     + maxX + (0- viaBox.bottom());
-        }
-
-        blockBox.set(trackLoc, blockLeft, trackLoc, blockRight);
-      }
-      if (con->hasSameNet()) {
-        continue;
-      }
-      if (con->isLayer()) {
-        ;
-      } else if (con->isAdjacentCuts()) {
-        hasViol = true;
-        // should disable hasViol and modify this part to new grid graph
-      } else if (con->isParallelOverlap()) {
-        if (isH) {
-          if (dy > 0) {
-            blockBox.set(max(box.left()  - (viaBox.right() - 0) + 1, blockLeft), trackLoc, 
-                         min(box.right() + (0 - viaBox.left())  - 1, blockRight), trackLoc);
-          }
-        } else {
-          if (dx > 0) {
-            blockBox.set(trackLoc, max(box.bottom() - (viaBox.top() - 0)     + 1, blockLeft), 
-                         trackLoc, min(box.top()    + (0 - viaBox.bottom())  - 1, blockRight));
-          }
-        }
-        if (blockBox.left() <= blockBox.right() && blockBox.bottom() <= blockBox.top()) {
-          hasViol = true;
-        }
-      } else if (con->isArea()) {
-        auto currArea = max(box.length() * box.width(), tmpBx.length() * tmpBx.width());
-        if (currArea >= con->getCutArea()) {
-          hasViol = true;
-        }
-      } else {
-        hasViol = true;
-      }
-      if (hasViol) {
-        if (isAddCost) {
-          workerRegionQuery.addCost(blockBox, lNum, fig, con);
-          if (pinS) {
-            workerRegionQuery.query(blockBox, lNum, *pinS);
-          }
-          if (enableOutput) {
-            cout <<"  add cutSpc via@("
-                 <<blockBox.left()  / dbu <<", " <<blockBox.bottom() / dbu <<") (" 
-                 <<blockBox.right() / dbu <<", " <<blockBox.top()    / dbu <<") " 
-                 <<getDesign()->getTech()->getLayer(lNum)->getName() <<endl <<flush;
-          }
-        } else {
-          workerRegionQuery.removeCost(blockBox, lNum, fig, con);
-          if (pinS) {
-            workerRegionQuery.query(blockBox, lNum, *pinS);
-          }
-          if (enableOutput) {
-            cout <<"  sub cutSpc via@(" 
-                 <<blockBox.left()  / dbu <<", " <<blockBox.bottom() / dbu <<") (" 
-                 <<blockBox.right() / dbu <<", " <<blockBox.top()    / dbu <<") " 
-                 <<getDesign()->getTech()->getLayer(lNum)->getName() <<endl <<flush;
-          }
-        }
-      }
-    }
-  }
-}
-
-void FlexTAWorker::addCost(taPinFig* fig, set<taPin*, frBlockObjectComp> *pinS) {
-  modCost(fig, true, pinS);
-}
-
-void FlexTAWorker::subCost(taPinFig* fig, set<taPin*, frBlockObjectComp> *pinS) {
-  modCost(fig, false, pinS);
-}
-
-void FlexTAWorker::modCost(taPinFig* fig, bool isAddCost, set<taPin*, frBlockObjectComp> *pinS) {
-  if (fig->typeId() == tacPathSeg) {
-    auto obj = static_cast<taPathSeg*>(fig);
-    auto layerNum = obj->getLayerNum();
-    frBox box;
-    obj->getBBox(box);
-    modMinSpacingCostPlanar(box, layerNum, obj, isAddCost, pinS); // must be current TA layer
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, true, true, pinS);
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, false, true, pinS);
-  } else if (fig->typeId() == tacVia) {
-    auto obj = static_cast<taVia*>(fig);
-    frBox box;
-    obj->getLayer1BBox(box); // assumes enclosure for via is always rectangle
-    auto layerNum = obj->getViaDef()->getLayer1Num();
-    // current TA layer
-    if (getDir() == getDesign()->getTech()->getLayer(layerNum)->getDir()) {
-      modMinSpacingCostPlanar(box, layerNum, obj, isAddCost, pinS);
-    }
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, true, false, pinS);
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, false, false, pinS);
-
-    obj->getLayer2BBox(box); // assumes enclosure for via is always rectangle
-    layerNum = obj->getViaDef()->getLayer2Num();
-    // current TA layer
-    if (getDir() == getDesign()->getTech()->getLayer(layerNum)->getDir()) {
-      modMinSpacingCostPlanar(box, layerNum, obj, isAddCost, pinS);
-    }
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, true, false, pinS);
-    modMinSpacingCostVia(box, layerNum, obj, isAddCost, false, false, pinS);
-
-    frTransform xform;
-    frPoint pt;
-    obj->getOrigin(pt);
-    xform.set(pt);
-    for (auto &uFig: obj->getViaDef()->getCutFigs()) {
-      auto rect = static_cast<frRect*>(uFig.get());
-      rect->getBBox(box);
-      box.transform(xform);
-      layerNum = obj->getViaDef()->getCutLayerNum();
-      modCutSpacingCost(box, layerNum, obj, isAddCost, pinS);
-    }
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void FlexTAWorker::assignIroute_availTracks(taPin* iroute, frLayerNum &lNum, int &idx1, int &idx2) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  lNum = iroute->getGuide()->getBeginLayerNum();
-  frPoint gbp, gep, gIdx;
-  frBox gBox;
-  iroute->getGuide()->getPoints(gbp, gep);
-  getDesign()->getTopBlock()->getGCellIdx(gbp, gIdx);
-  getDesign()->getTopBlock()->getGCellBox(gIdx, gBox);
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frCoord coordLow  = isH ? gBox.bottom() : gBox.left();
-  frCoord coordHigh = isH ? gBox.top()    : gBox.right();
-  coordHigh--; // to avoid higher track == guide top/right
-  getTrackIdx(coordLow, coordHigh, lNum, idx1, idx2);
-  if (enableOutput) {
-    double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-    cout <<" min/max track@" <<getTrackLocs(lNum)[idx1] / dbu;
-    if (idx2 > idx1) {
-      cout <<"/" <<getTrackLocs(lNum)[idx2] / dbu;
-    }
-    cout <<endl;
-  }
-}
-
-frUInt4 FlexTAWorker::assignIroute_getWlenCost(taPin* iroute, frCoord trackLoc) {
-  auto guide = iroute->getGuide();
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frPoint begin, end;
-  guide->getPoints(begin, end);
-  frBox endBox;
-  frPoint idx;
-  getDesign()->getTopBlock()->getGCellIdx(end, idx);
-  getDesign()->getTopBlock()->getGCellBox(idx, endBox);
-  int wlen = 0;
-  auto wlen_helper = iroute->getWlenHelper();
-  if (wlen_helper <= 0) {
-    if (isH) {
-      wlen = abs(wlen_helper) * (trackLoc - endBox.bottom());
-    } else {
-      wlen = abs(wlen_helper) * (trackLoc - endBox.left());
-    }
-  } else {
-    if (isH) {
-      wlen = abs(wlen_helper) * (endBox.top()   - trackLoc);
-    } else {
-      wlen = abs(wlen_helper) * (endBox.right() - trackLoc);
-    }
-  }
-  if (wlen < 0) {
-    double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-    cout <<"Error: getWlenCost has wlenCost < 0" <<", trackLoc@" <<trackLoc / dbu <<" box (" 
-         <<endBox.left()  / dbu  <<", " <<endBox.bottom() / dbu <<") (" 
-         <<endBox.right() / dbu  <<", " <<endBox.top()    / dbu <<")" <<endl;
-    return (frUInt4)0;
-  } else {
-    return (frUInt4)wlen;
-  }
-}
-
-frUInt4 FlexTAWorker::assignIroute_getPinCost(taPin* iroute, frCoord trackLoc) {
-  frUInt4 sol = 0;
-  if (iroute->hasWlenHelper2()) {
-    sol = abs(trackLoc - iroute->getWlenHelper2());
-  }
-  return sol;
-}
-
-frUInt4 FlexTAWorker::assignIroute_getDRCCost_helper(taPin* iroute, const frBox &box, frLayerNum lNum) {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  vector<rq_generic_value_t<std::pair<frBlockObject*, frConstraint*> > > result;
-  int overlap = 0;
-  workerRegionQuery.queryCost(box, lNum, result);
-  bool isCut = false;
-  for (auto &[boostb, pr]: result) {
-    auto &[obj, con] = pr;
-    frCoord tmpOvlp = - max(box.left(),   boostb.min_corner().x()) + min(box.right(),  boostb.max_corner().x()) 
-                      - max(box.bottom(), boostb.min_corner().y()) + min(box.top(),    boostb.max_corner().y()) + 1;
-    if (tmpOvlp <= 0) {
-      cout <<"Error: assignIroute_getDRCCost_helper overlap < 0" <<endl;
-      exit(1);
-    }
-    // unknown obj, always add cost
-    if (obj == nullptr) {
-      overlap += tmpOvlp;
-    // only add cost for diff-net
-    } else if (obj->typeId() == frcNet) {
-      if (iroute->getGuide()->getNet() != obj) {
-        overlap += tmpOvlp;
-      }
-    // two taObjs
-    } else if (obj->typeId() == tacPathSeg || obj->typeId() == tacVia) {
-      auto taObj = static_cast<taPinFig*>(obj);
-      // can exclude same iroute objs also
-      if (taObj->getPin() == iroute) {
-        continue;
-      }
-      if (iroute->getGuide()->getNet() != taObj->getPin()->getGuide()->getNet()) {
-        overlap += tmpOvlp;
-      }
-    } else {
-      cout <<"Warning: assignIroute_getDRCCost_helper unsupported type" <<endl;
-    }
-  }
-  frCoord pitch = 0;
-  if (getDesign()->getTech()->getLayer(lNum)->getType() == frLayerTypeEnum::ROUTING) {
-    pitch = getDesign()->getTech()->getLayer(lNum)->getPitch();
-    isCut = false;
-  } else if (getDesign()->getTech()->getTopLayerNum() >= lNum + 1 && getDesign()->getTech()->getLayer(lNum + 1)->getType() == frLayerTypeEnum::ROUTING) {
-    pitch = getDesign()->getTech()->getLayer(lNum + 1)->getPitch();
-    isCut = true;
-  } else if (getDesign()->getTech()->getBottomLayerNum() <= lNum - 1 && getDesign()->getTech()->getLayer(lNum - 1)->getType() == frLayerTypeEnum::ROUTING) {
-    pitch = getDesign()->getTech()->getLayer(lNum - 1)->getPitch();
-    isCut = true;
-  } else {
-    cout <<"Error: assignIroute_getDRCCost_helper unknown layer type" <<endl;
-    exit(1);
-  }
-  // always penalize two pitch per cut, regardless of cnts
-  return (overlap == 0) ? 0 : (isCut ? pitch * 2: max(pitch * 2, overlap));
-}
-
-frUInt4 FlexTAWorker::assignIroute_getDRCCost(taPin* iroute, frCoord trackLoc) {
-  frUInt4 cost = 0;
-  frPoint bp, ep;
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  for (auto &uPinFig: iroute->getFigs()) {
-    if (uPinFig->typeId() == tacPathSeg) {
-      auto obj = static_cast<taPathSeg*>(uPinFig.get());
-      obj->getPoints(bp, ep);
-      if (isH) {
-        bp.set(bp.x(), trackLoc);
-        ep.set(ep.x(), trackLoc);
-      } else {
-        bp.set(trackLoc, bp.y());
-        ep.set(trackLoc, ep.y());
-      }
-      frUInt4 wireCost = assignIroute_getDRCCost_helper(iroute, frBox(bp, ep), obj->getLayerNum());
-      //if (!isInitTA()) {
-      //  cout <<"wireCost@" <<wireCost <<endl;
-      //}
-      cost += wireCost;
-    } else if (uPinFig->typeId() == tacVia) {
-      auto obj = static_cast<taVia*>(uPinFig.get());
-      obj->getOrigin(bp);
-      if (isH) {
-        bp.set(bp.x(), trackLoc);
-      } else {
-        bp.set(trackLoc, bp.y());
-      }
-      //cost += TAVIACOST * assignIroute_getDRCCost_helper(iroute, frBox(bp, bp), obj->getViaDef()->getCutLayerNum());
-      frUInt4 viaCost = assignIroute_getDRCCost_helper(iroute, frBox(bp, bp), obj->getViaDef()->getCutLayerNum());
-      //if (!isInitTA()) {
-      //  cout <<"viaCost@" <<viaCost <<endl;
-      //}
-      cost += viaCost;
-    } else {
-      cout <<"Error: assignIroute_updateIroute unsupported pinFig" <<endl;
-      exit(1);
-    }
-  }
-  return cost;
-}
-
-frUInt4 FlexTAWorker::assignIroute_getAlignCost(taPin* iroute, frCoord trackLoc) {
-  frUInt4 sol = 0;
-  frCoord pitch = 0;
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  for (auto &uPinFig: iroute->getFigs()) {
-    if (uPinFig->typeId() == tacPathSeg) {
-      auto obj=  static_cast<taPathSeg*>(uPinFig.get());
-      frPoint bp, ep;
-      obj->getPoints(bp, ep);
-      auto lNum = obj->getLayerNum();
-      pitch = getDesign()->getTech()->getLayer(lNum)->getPitch();
-      auto &workerRegionQuery = getWorkerRegionQuery();
-      set<taPin*, frBlockObjectComp> result;
-      frBox box;
-      if (isH) {
-        box.set(bp.x(), trackLoc, ep.x(), trackLoc);
-      } else {
-        box.set(trackLoc, bp.y(), trackLoc, ep.y());
-      }
-      workerRegionQuery.query(box, lNum, result);
-      for (auto &iroute2: result) {
-        if (iroute2->getGuide()->getNet() == iroute->getGuide()->getNet()) {
-          sol = 1;
-          break;
-        }
-      }
-    }
-    if (sol == 1) {
-      break;
-    }
-  }
-  return pitch * sol;
-}
-
-frUInt4 FlexTAWorker::assignIroute_getCost(taPin* iroute, frCoord trackLoc, frUInt4 &outDrcCost) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  outDrcCost     = assignIroute_getDRCCost(iroute, trackLoc);
-  int drcCost    = TADRCCOST * outDrcCost;
-  int wlenCost   = assignIroute_getWlenCost(iroute, trackLoc);
-  int pinCost    = TAPINCOST * assignIroute_getPinCost(iroute, trackLoc);
-  int alignCost  = TAALIGNCOST * assignIroute_getAlignCost(iroute, trackLoc);
-  if (enableOutput) {
-    cout <<"    drc/wlen/pin/align cost = " <<drcCost <<"/" <<wlenCost <<"/" <<pinCost <<"/" <<alignCost <<endl;
-  }
-  return max(drcCost + wlenCost + pinCost - alignCost, 0);
-}
-
-void FlexTAWorker::assignIroute_bestTrack_helper(taPin* iroute, frLayerNum lNum, int trackIdx, frUInt4 &bestCost, 
-                                                 frCoord &bestTrackLoc, int &bestTrackIdx, frUInt4 &drcCost) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  auto trackLoc = getTrackLocs(lNum)[trackIdx];
-  auto currCost = assignIroute_getCost(iroute, trackLoc, drcCost);
-  if (isInitTA()) {
-    if (currCost < bestCost) {
-      bestCost = currCost;
-      bestTrackLoc = trackLoc;
-      bestTrackIdx = trackIdx;
-    }
-  } else {
-    if (drcCost < bestCost) {
-      bestCost = drcCost;
-      bestTrackLoc = trackLoc;
-      bestTrackIdx = trackIdx;
-    }
-  }
-  if (enableOutput) {
-    cout <<"  try track@" <<trackLoc / dbu <<", cost/drc=" <<currCost <<"/" <<drcCost <<endl;
-  }
-}
-
-int FlexTAWorker::assignIroute_bestTrack(taPin* iroute, frLayerNum lNum, int idx1, int idx2) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  double  dbu = getDesign()->getTopBlock()->getDBUPerUU();
-  frCoord bestTrackLoc = 0;
-  int     bestTrackIdx = -1;
-  frUInt4 bestCost = std::numeric_limits<frUInt4>::max();
-  frUInt4 drcCost = 0;
-  //while (1) {
-  // if wlen2, then try from  wlen2
-  // else try from wlen1 dir
-  if (iroute->hasWlenHelper2()) {
-    frCoord wlen2coord = iroute->getWlenHelper2();
-    if (iroute->getWlenHelper() > 0) {
-      if (enableOutput) {
-        cout <<" use wlen2@" <<wlen2coord / dbu <<", wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      int startTrackIdx = int(std::lower_bound(trackLocs[lNum].begin(), trackLocs[lNum].end(), wlen2coord) - trackLocs[lNum].begin());
-      startTrackIdx = min(startTrackIdx, idx2);
-      startTrackIdx = max(startTrackIdx, idx1);
-      for (int i = startTrackIdx; i <= idx2; i++) {
-        assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        if (!drcCost) {
-          break;
-        }
-      }
-      if (drcCost) {
-        for (int i = startTrackIdx - 1; i >= idx1; i--) {
-          assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-          if (!drcCost) {
-            break;
-          }
-        }
-      }
-    } else if (iroute->getWlenHelper() == 0) {
-      if (enableOutput) {
-        cout <<" use wlen2@" <<wlen2coord / dbu <<", wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      int startTrackIdx = int(std::lower_bound(trackLocs[lNum].begin(), trackLocs[lNum].end(), wlen2coord) - trackLocs[lNum].begin());
-      startTrackIdx = min(startTrackIdx, idx2);
-      startTrackIdx = max(startTrackIdx, idx1);
-      for (int i = 0; i < idx2 - idx1; i++) {
-        int currTrackIdx = startTrackIdx + i;
-        if (currTrackIdx >= idx1 && currTrackIdx <= idx2) {
-          assignIroute_bestTrack_helper(iroute, lNum, currTrackIdx, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        }
-        if (!drcCost) {
-          break;
-        }
-        currTrackIdx = startTrackIdx - i - 1;
-        if (currTrackIdx >= idx1 && currTrackIdx <= idx2) {
-          assignIroute_bestTrack_helper(iroute, lNum, currTrackIdx, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        }
-        if (!drcCost) {
-          break;
-        }
-      }
-    } else {
-      if (enableOutput) {
-        cout <<" use wlen2@" <<wlen2coord / dbu <<", wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      int startTrackIdx = int(std::lower_bound(trackLocs[lNum].begin(), trackLocs[lNum].end(), wlen2coord) - trackLocs[lNum].begin());
-      startTrackIdx = min(startTrackIdx, idx2);
-      startTrackIdx = max(startTrackIdx, idx1);
-      for (int i = startTrackIdx; i >= idx1; i--) {
-        assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        if (!drcCost) {
-          break;
-        }
-      }
-      if (drcCost) {
-        for (int i = startTrackIdx + 1; i <= idx2; i++) {
-          assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-          if (!drcCost) {
-            break;
-          }
-        }
-      }
-    }
-  } else {
-    if (iroute->getWlenHelper() > 0) {
-      if (enableOutput) {
-        cout <<" use wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      for (int i = idx2; i >= idx1; i--) {
-        assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        if (!drcCost) {
-          break;
-        }
-      }
-    } else if (iroute->getWlenHelper() == 0) {
-      if (enableOutput) {
-        cout <<" use wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      for (int i = (idx1 + idx2) / 2; i <= idx2; i++) {
-        assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        if (!drcCost) {
-          break;
-        }
-      }
-      if (drcCost) {
-        for (int i = (idx1 + idx2) / 2 - 1; i >= idx1; i--) {
-          assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-          if (!drcCost) {
-            break;
-          }
-        }
-      }
-    } else {
-      if (enableOutput) {
-        cout <<" use wlen@" <<iroute->getWlenHelper() <<endl;
-      }
-      for (int i = idx1; i <= idx2; i++) {
-        assignIroute_bestTrack_helper(iroute, lNum, i, bestCost, bestTrackLoc, bestTrackIdx, drcCost);
-        if (!drcCost) {
-          break;
-        }
-      }
-    }
-  }
-  if (bestTrackIdx == -1) {
-    cout <<"Error: assignIroute_bestTrack select no track" <<endl;
-    exit(1);
-  }
-  if (enableOutput) {
-  //if (true) {
-    cout <<"  select track@" <<bestTrackLoc / dbu <<", cost=" <<bestCost <<endl;
-  }
-  //totCost    -= iroute->getCost();
-  //totDrcCost -= iroute->getDrcCost();
-  totCost    += drcCost;
-  iroute->setCost(drcCost);
-  //totDrcCost += drcCost;
-  return bestTrackLoc;
-}
-  
-void FlexTAWorker::assignIroute_updateIroute(taPin* iroute, frCoord bestTrackLoc, set<taPin*, frBlockObjectComp> *pinS) {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frPoint bp, ep;
-
-  // update coord
-  for (auto &uPinFig: iroute->getFigs()) {
-    if (uPinFig->typeId() == tacPathSeg) {
-      auto obj = static_cast<taPathSeg*>(uPinFig.get());
-      obj->getPoints(bp, ep);
-      if (isH) {
-        bp.set(bp.x(), bestTrackLoc);
-        ep.set(ep.x(), bestTrackLoc);
-      } else {
-        bp.set(bestTrackLoc, bp.y());
-        ep.set(bestTrackLoc, ep.y());
-      }
-      obj->setPoints(bp, ep);
-    } else if (uPinFig->typeId() == tacVia) {
-      auto obj = static_cast<taVia*>(uPinFig.get());
-      obj->getOrigin(bp);
-      if (isH) {
-        bp.set(bp.x(), bestTrackLoc);
-      } else {
-        bp.set(bestTrackLoc, bp.y());
-      }
-      obj->setOrigin(bp);
-    } else {
-      cout <<"Error: assignIroute_updateIroute unsupported pinFig" <<endl;
-      exit(1);
-    }
-  }
-  // addCost
-  for (auto &uPinFig: iroute->getFigs()) {
-    addCost(uPinFig.get(), isInitTA() ? nullptr : pinS);
-    workerRegionQuery.add(uPinFig.get());
-  }
-  iroute->addNumAssigned();
-}
-
-void FlexTAWorker::assignIroute_init(taPin* iroute, set<taPin*, frBlockObjectComp> *pinS) {
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  // subCost
-  if (!isInitTA()) {
-    for (auto &uPinFig: iroute->getFigs()) {
-      workerRegionQuery.remove(uPinFig.get());
-      subCost(uPinFig.get(), pinS);
-    }
-    totCost    -= iroute->getCost();
-    //totDrcCost -= iroute->getDrcCost();
-  }
-}
-
-void FlexTAWorker::assignIroute_updateOthers(set<taPin*, frBlockObjectComp> &pinS) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frPoint bp, ep;
-  if (isInitTA()) {
-    return;
-  }
-  for (auto &iroute: pinS) {
-    removeFromReassignIroutes(iroute);
-    // recalculate cost
-    frUInt4 drcCost = 0;
-    frCoord trackLoc = std::numeric_limits<frCoord>::max();
-    for (auto &uPinFig: iroute->getFigs()) {
-      if (uPinFig->typeId() == tacPathSeg) {
-        static_cast<taPathSeg*>(uPinFig.get())->getPoints(bp, ep);
-        if (isH) {
-          trackLoc = bp.y();
-        } else {
-          trackLoc = bp.x();
-        }
-        break;
-      }
-    }
-    if (trackLoc == std::numeric_limits<frCoord>::max()) {
-      cout <<"Error: FlexTAWorker::assignIroute_updateOthers does not find trackLoc" <<endl;
-      exit(1);
-    }
-    totCost    -= iroute->getCost();
-    //totDrcCost -= iroute->getDrcCost();
-    //auto tmpCost = assignIroute_getCost(iroute, trackLoc, drcCost);
-    assignIroute_getCost(iroute, trackLoc, drcCost);
-    iroute->setCost(drcCost);
-    //iroute->setCost(tmpCost);
-    //iroute->setDrcCost(drcCost);
-    //totCost    += iroute->getCost();
-    //totDrcCost += iroute->getDrcCost();
-    totCost    += iroute->getCost();
-    if (drcCost && iroute->getNumAssigned() < maxRetry) {
-      addToReassignIroutes(iroute);
-    }
-  }
-  if (enableOutput && pinS.size()) {
-    cout <<"updated " <<pinS.size() <<" iroutes" <<endl;
-  }
-}
-
-void FlexTAWorker::assignIroute(taPin* iroute) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (enableOutput) {
-    bool   isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-    double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-    frPoint bp, ep;
-    frCoord bc, ec, trackLoc;
-    cout <<"assigning " <<iroute->getId() <<" " <<iroute->getGuide()->getNet()->getName();
-    auto guideLNum = iroute->getGuide()->getBeginLayerNum();
-    for (auto &uPinFig: iroute->getFigs()) {
-      if (uPinFig->typeId() == tacPathSeg) {
-        auto obj = static_cast<taPathSeg*>(uPinFig.get());
-        obj->getPoints(bp, ep);
-        bc = isH ? bp.x() : bp.y();
-        ec = isH ? ep.x() : ep.y();
-        trackLoc = isH ? bp.y() : bp.x();
-        cout <<" (" <<bc / dbu <<"-->" <<ec / dbu <<"), len@" <<(ec - bc) / dbu <<", track@" <<trackLoc / dbu
-             <<", " <<getDesign()->getTech()->getLayer(iroute->getGuide()->getBeginLayerNum())->getName();
-      } else if (uPinFig->typeId() == tacVia) {
-        auto obj = static_cast<taVia*>(uPinFig.get());
-        auto cutLNum = obj->getViaDef()->getCutLayerNum();
-        obj->getOrigin(bp);
-        bc = isH ? bp.x() : bp.y();
-        cout <<string((cutLNum > guideLNum) ? ", U@" : ", D@") <<bc / dbu;
-      }
-    }
-    cout <<", wlen_h@" <<iroute->getWlenHelper() <<", cost@" <<iroute->getCost() <<endl;
-  }
-
-  set<taPin*, frBlockObjectComp> pinS;
-  assignIroute_init(iroute, &pinS);
-  frLayerNum lNum;
-  int idx1, idx2;
-  assignIroute_availTracks(iroute, lNum, idx1, idx2);
-  auto bestTrackLoc = assignIroute_bestTrack(iroute, lNum, idx1, idx2);
-
-  assignIroute_updateIroute(iroute, bestTrackLoc, &pinS);
-  assignIroute_updateOthers(pinS);
-}
-
-void FlexTAWorker::assign() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  if (getTAIter() == -1) {
-    return;
-  }
-  //if (isInitTA()) {
-    int maxBufferSize = 20;
-    vector<taPin*> buffers(maxBufferSize, nullptr);
-    int currBufferIdx = 0;
-    auto iroute = popFromReassignIroutes();
-    while (iroute != nullptr) {
-      auto it = find(buffers.begin(), buffers.end(), iroute);
-      // in the buffer, skip
-      if (it != buffers.end() || iroute->getNumAssigned() >= maxRetry) {
-        ;
-      // not in the buffer, re-assign
-      } else {
-        assignIroute(iroute);
-        // re add last buffer item to reassigniroutes if drccost > 0
-        //if (buffers[currBufferIdx]) {
-        //  if (buffers[currBufferIdx]->getDrcCost()) {
-        //    addToReassignIroutes(buffers[currBufferIdx]);
-        //  }
-        //}
-        buffers[currBufferIdx] = iroute;
-        currBufferIdx = (currBufferIdx + 1) % maxBufferSize;
-        if (enableOutput && !isInitTA()) {
-          //cout <<"totCost@" <<totCost <<"/" <<totDrcCost <<endl;
-          cout <<"totCost@" <<totCost <<endl;
-        }
-        numAssigned++;
-      }
-      iroute = popFromReassignIroutes();
-    }
-  //}
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_end.cpp b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_end.cpp
deleted file mode 100644
index 3c0c4d2..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_end.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "ta/FlexTA.h"
-
-using namespace std;
-using namespace fr;
-
-void FlexTAWorker::saveToGuides() {
-  for (auto &iroute: iroutes) {
-    for (auto &uPinFig: iroute->getFigs()) {
-      if (uPinFig->typeId() == tacPathSeg) {
-        unique_ptr<frPathSeg> pathSeg = make_unique<frPathSeg>(*static_cast<taPathSeg*>(uPinFig.get()));
-        pathSeg->addToNet(iroute->getGuide()->getNet());
-        auto guide = iroute->getGuide();
-        vector<unique_ptr<frConnFig> > tmp;
-        tmp.push_back(std::move(pathSeg));
-        guide->setRoutes(tmp);
-      }
-      // modify upper/lower segs
-      // upper/lower seg will have longest wirelength
-    }
-  }
-}
-
-
-void FlexTAWorker::end() {
-  //if (getTAIter() <= 0) {
-    saveToGuides();
-  //}
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_init.cpp b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_init.cpp
deleted file mode 100644
index 1aca2a3..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_init.cpp
+++ /dev/null
@@ -1,787 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "ta/FlexTA.h"
-
-using namespace std;
-using namespace fr;
-
-void FlexTAWorker::initTracks() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  //tracks.clear();
-  //tracks.resize(getDesign()->getTech()->getLayers().size());
-  trackLocs.clear();
-  trackLocs.resize(getDesign()->getTech()->getLayers().size());
-  vector<set<frCoord> > trackCoordSets(getDesign()->getTech()->getLayers().size());
-  // uPtr for tp
-  for (int lNum = 0; lNum < (int)getDesign()->getTech()->getLayers().size(); lNum++) {
-    auto layer = getDesign()->getTech()->getLayer(lNum);
-    if (layer->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    if (layer->getDir() != getDir()) {
-      continue;
-    }
-    for (auto &tp: getDesign()->getTopBlock()->getTrackPatterns(lNum)) {
-      if ((getDir() == frcHorzPrefRoutingDir && tp->isHorizontal() == false) ||
-          (getDir() == frcVertPrefRoutingDir && tp->isHorizontal() == true)) {
-        if (enableOutput) {
-          cout <<"TRACKS " <<(tp->isHorizontal() ? string("X ") : string("Y "))
-               <<tp->getStartCoord() <<" DO " <<tp->getNumTracks() <<" STEP "
-               <<tp->getTrackSpacing() <<" LAYER " <<tp->getLayerNum() 
-               <<" ;" <<endl;
-        }
-        bool isH = (getDir() == frcHorzPrefRoutingDir);
-        frCoord tempCoord1 = (isH ? getRouteBox().bottom() : getRouteBox().left());
-        frCoord tempCoord2 = (isH ? getRouteBox().top()    : getRouteBox().right());
-        int trackNum = (tempCoord1 - tp->getStartCoord()) / (int)tp->getTrackSpacing();
-        if (trackNum < 0) {
-          trackNum = 0;
-        }
-        if (trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < tempCoord1) {
-          trackNum++;
-        }
-        for (; trackNum < (int)tp->getNumTracks() && trackNum * (int)tp->getTrackSpacing() + tp->getStartCoord() < tempCoord2; trackNum++) {
-          frCoord trackCoord = trackNum * tp->getTrackSpacing() + tp->getStartCoord();
-          //cout <<"TRACKLOC " <<trackCoord * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<endl;
-          trackCoordSets[lNum].insert(trackCoord);
-        }
-      }
-    }
-  }
-  for (int i = 0; i < (int)trackCoordSets.size(); i++) {
-    if (enableOutput) {
-      cout <<"lNum " <<i <<":";
-    }
-    for (auto coord: trackCoordSets[i]) {
-      if (enableOutput) {
-        cout <<" " <<coord * 1.0 / getDesign()->getTopBlock()->getDBUPerUU();
-      }
-      //taTrack t;
-      //t.setTrackLoc(coord);
-      //tracks[i].push_back(std::move(t));
-      trackLocs[i].push_back(coord);
-    }
-    if (enableOutput) {
-      cout <<endl;
-    }
-  }
-}
-
-bool FlexTAWorker::initIroute_helper_pin(frGuide* guide, frCoord &maxBegin, frCoord &minEnd, 
-                                         set<frCoord> &downViaCoordSet, set<frCoord> &upViaCoordSet,
-                                         int &wlen, frCoord &wlen2) {
-  bool enableOutput = false;
-  frPoint bp, ep;
-  guide->getPoints(bp, ep);
-  if (!(bp == ep)) {
-    return false;
-  }
-
-  auto net      = guide->getNet();
-  auto layerNum = guide->getBeginLayerNum();
-  bool isH      = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  bool hasDown  = false;
-  bool hasUp    = false;
-
-  vector<frGuide*> nbrGuides;
-  auto rq = getRegionQuery();
-  frBox box;
-  box.set(bp, bp);
-  nbrGuides.clear();
-  if (layerNum - 2 >= 0) {
-    rq->queryGuide(box, layerNum - 2, nbrGuides);
-    for (auto &nbrGuide: nbrGuides) {
-      if (nbrGuide->getNet() == net) {
-        hasDown = true;
-        break;
-      }
-    }
-  } 
-  nbrGuides.clear();
-  if (layerNum + 2 < (int)design->getTech()->getLayers().size()) {
-    rq->queryGuide(box, layerNum + 2, nbrGuides);
-    for (auto &nbrGuide: nbrGuides) {
-      if (nbrGuide->getNet() == net) {
-        hasUp = true;
-        break;
-      }
-    }
-  } 
-
-  vector<frBlockObject*> result;
-  box.set(bp, bp);
-  rq->queryGRPin(box, result);
-  frTransform instXform; // (0,0), frcR0
-  frTransform shiftXform;
-  frTerm* trueTerm = nullptr;
-  //string  name;
-  for (auto &term: result) {
-    bool hasInst = false;
-    frInst* inst = nullptr;
-    if (term->typeId() == frcInstTerm) {
-      if (static_cast<frInstTerm*>(term)->getNet() != net) {
-        continue;
-      }
-      hasInst = true;
-      inst = static_cast<frInstTerm*>(term)->getInst();
-      inst->getTransform(shiftXform);
-      shiftXform.set(frOrient(frcR0));
-      inst->getUpdatedXform(instXform);
-      trueTerm = static_cast<frInstTerm*>(term)->getTerm();
-    } else if (term->typeId() == frcTerm) {
-      if (static_cast<frTerm*>(term)->getNet() != net) {
-        continue;
-      }
-      trueTerm = static_cast<frTerm*>(term);
-    }
-    if (trueTerm) {
-      for (auto &pin: trueTerm->getPins()) {
-        for (auto &ap: pin->getAccessPatterns(instXform.orient())) {
-          if (hasInst && !(ap->hasInst(inst))) {
-            continue;
-          }
-          frPoint apBp, apEp;
-          ap->getPoints(apBp, apEp);
-          if (enableOutput) {
-            cout <<" (" <<apBp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                        <<apBp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") origin";
-          }
-          auto bNum = ap->getBeginLayerNum();
-          apBp.transform(shiftXform);
-          if (layerNum == bNum && getRouteBox().contains(apBp)) {
-            wlen2 = isH ? apBp.y() : apBp.x();
-            maxBegin = isH ? apBp.x() : apBp.y();
-            minEnd   = isH ? apBp.x() : apBp.y();
-            wlen = 0;
-            if (hasDown) {
-              downViaCoordSet.insert(maxBegin);
-            }
-            if (hasUp) {
-              upViaCoordSet.insert(maxBegin);
-            }
-            return true;
-          }
-        }
-      }
-    }
-  }
-  
-  return false;
-}
-
-void FlexTAWorker::initIroute_helper(frGuide* guide, frCoord &maxBegin, frCoord &minEnd, 
-                                     set<frCoord> &downViaCoordSet, set<frCoord> &upViaCoordSet,
-                                     int &wlen, frCoord &wlen2) {
-  if (!initIroute_helper_pin(guide, maxBegin, minEnd, downViaCoordSet, upViaCoordSet, wlen, wlen2)) {
-    initIroute_helper_generic(guide, maxBegin, minEnd, downViaCoordSet, upViaCoordSet, wlen, wlen2);
-  }
-}
-
-
-void FlexTAWorker::initIroute_helper_generic_helper(frGuide* guide, frCoord &wlen2) {
-  bool enableOutput = false;
-
-  frPoint bp, ep;
-  guide->getPoints(bp, ep);
-  auto net = guide->getNet();
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-
-  auto rq = getRegionQuery();
-  vector<frBlockObject*> result;
-
-  frBox box;
-  box.set(bp, bp);
-  rq->queryGRPin(box, result);
-  if (!(ep == bp)) {
-    box.set(ep, ep);
-    rq->queryGRPin(box, result);
-  }
-  frTransform instXform; // (0,0), frcR0
-  frTransform shiftXform;
-  frTerm* trueTerm = nullptr;
-  //string  name;
-  for (auto &term: result) {
-    bool hasInst = false;
-    frInst* inst = nullptr;
-    if (term->typeId() == frcInstTerm) {
-      if (static_cast<frInstTerm*>(term)->getNet() != net) {
-        continue;
-      }
-      hasInst = true;
-      inst = static_cast<frInstTerm*>(term)->getInst();
-      inst->getTransform(shiftXform);
-      shiftXform.set(frOrient(frcR0));
-      inst->getUpdatedXform(instXform);
-      trueTerm = static_cast<frInstTerm*>(term)->getTerm();
-    } else if (term->typeId() == frcTerm) {
-      if (static_cast<frTerm*>(term)->getNet() != net) {
-        continue;
-      }
-      trueTerm = static_cast<frTerm*>(term);
-    }
-    if (trueTerm) {
-      for (auto &pin: trueTerm->getPins()) {
-        for (auto &ap: pin->getAccessPatterns(instXform.orient())) {
-          if (hasInst && !(ap->hasInst(inst))) {
-            continue;
-          }
-          frPoint apBp, apEp;
-          ap->getPoints(apBp, apEp);
-          if (enableOutput) {
-            cout <<" (" <<apBp.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", "
-                        <<apBp.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") origin";
-          }
-          apBp.transform(shiftXform);
-          if (getRouteBox().contains(apBp)) {
-            wlen2 = isH ? apBp.y() : apBp.x();
-            return;
-          }
-        }
-      }
-    }
-  }
-}
-
-void FlexTAWorker::initIroute_helper_generic(frGuide* guide, frCoord &minBegin, frCoord &maxEnd, 
-                                             set<frCoord> &downViaCoordSet, set<frCoord> &upViaCoordSet,
-                                             int &wlen, frCoord &wlen2) {
-  auto    net         = guide->getNet();
-  auto    layerNum    = guide->getBeginLayerNum();
-  bool    hasMinBegin = false;
-  bool    hasMaxEnd   = false;
-          minBegin    = std::numeric_limits<frCoord>::max();
-          maxEnd      = std::numeric_limits<frCoord>::min();
-          wlen        = 0;
-          //wlen2       = std::numeric_limits<frCoord>::max();
-  bool    isH         = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  downViaCoordSet.clear();
-  upViaCoordSet.clear();
-  frPoint nbrBp, nbrEp;
-  frPoint nbrSegBegin, nbrSegEnd;
-  
-  frPoint bp, ep;
-  guide->getPoints(bp, ep);
-  frPoint cp;
-  // layerNum in FlexTAWorker
-  vector<frGuide*> nbrGuides;
-  auto rq = getRegionQuery();
-  frBox box;
-  for (int i = 0; i < 2; i++) {
-    nbrGuides.clear();
-    // check left
-    if (i == 0) {
-      box.set(bp, bp);
-      cp = bp;
-    // check right
-    } else {
-      box.set(ep, ep);
-      cp = ep;
-    }
-    if (layerNum - 2 >= 0) {
-      rq->queryGuide(box, layerNum - 2, nbrGuides);
-    } 
-    if (layerNum + 2 < (int)design->getTech()->getLayers().size()) {
-      rq->queryGuide(box, layerNum + 2, nbrGuides);
-    } 
-    for (auto &nbrGuide: nbrGuides) {
-      if (nbrGuide->getNet() == net) {
-        nbrGuide->getPoints(nbrBp, nbrEp);
-        if (!nbrGuide->hasRoutes()) {
-          // via location assumed in center
-          auto psLNum = nbrGuide->getBeginLayerNum();
-          if (psLNum == layerNum - 2) {
-            downViaCoordSet.insert((isH ? nbrBp.x() : nbrBp.y()));
-          } else {
-            upViaCoordSet.insert((isH ? nbrBp.x() : nbrBp.y()));
-          }
-        } else {
-          for (auto &connFig: nbrGuide->getRoutes()) {
-            if (connFig->typeId() == frcPathSeg) {
-              auto obj = static_cast<frPathSeg*>(connFig.get());
-              obj->getPoints(nbrSegBegin, nbrSegEnd);
-              auto psLNum = obj->getLayerNum();
-              if (i == 0) {
-                minBegin = min(minBegin, (isH ? nbrSegBegin.x() : nbrSegBegin.y()));
-                hasMinBegin = true;
-              } else {
-                maxEnd = max(maxEnd, (isH ? nbrSegBegin.x() : nbrSegBegin.y()));
-                hasMaxEnd = true;
-              }
-              //if (nbrBp == nbrEp) {
-              //  wlen2 = isH ? ((nbrSegBegin.y() + nbrSegEnd().y()) / 2) : ((nbrSegBegin.x() + nbrSegEnd().x()) / 2)
-              //}
-              if (psLNum == layerNum - 2) {
-                downViaCoordSet.insert((isH ? nbrSegBegin.x() : nbrSegBegin.y()));
-              } else {
-                upViaCoordSet.insert((isH ? nbrSegBegin.x() : nbrSegBegin.y()));
-              }
-            }
-          }
-        }
-        if (cp == nbrEp) {
-          wlen -= 1;
-        }
-        if (cp == nbrBp) {
-          wlen += 1;
-        }
-      }
-    }
-  }
-
-  if (!hasMinBegin) {
-    minBegin = (isH ? bp.x() : bp.y());
-  }
-  if (!hasMaxEnd) {
-    maxEnd = (isH ? ep.x() : ep.y());
-  }
-  if (minBegin > maxEnd) {
-    swap(minBegin, maxEnd);
-  }
-  if (minBegin == maxEnd) {
-    maxEnd += 1;
-  }
-
-  // wlen2 purely depends on ap regardless of track
-  initIroute_helper_generic_helper(guide, wlen2);
-}
-
-void FlexTAWorker::initIroute(frGuide *guide) {
-  bool enableOutput = false;
-  //bool enableOutput = true;
-  auto iroute = make_unique<taPin>();
-  iroute->setGuide(guide);
-  frBox guideBox;
-  guide->getBBox(guideBox);
-  auto layerNum = guide->getBeginLayerNum();
-  bool isExt = !(getRouteBox().contains(guideBox));
-  if (isExt) {
-    // extIroute empty, skip
-    if (guide->getRoutes().empty()) {
-      return;
-    }
-    if (enableOutput) {
-      double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-      cout <<"ext@(" <<guideBox.left() / dbu  <<", " <<guideBox.bottom() / dbu <<") ("
-                     <<guideBox.right() / dbu <<", " <<guideBox.top()    / dbu <<")" <<endl;
-    }
-  }
-  
-  frCoord maxBegin, minEnd;
-  set<frCoord> downViaCoordSet, upViaCoordSet;
-  int wlen = 0;
-  frCoord wlen2 = std::numeric_limits<frCoord>::max();
-  initIroute_helper(guide, maxBegin, minEnd, downViaCoordSet, upViaCoordSet, wlen, wlen2);
-
-  frCoord trackLoc = 0;
-  frPoint segBegin, segEnd;
-  bool    isH         = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  // set trackIdx
-  if (!isInitTA()) {
-    for (auto &connFig: guide->getRoutes()) {
-      if (connFig->typeId() == frcPathSeg) {
-        auto obj = static_cast<frPathSeg*>(connFig.get());
-        obj->getPoints(segBegin, segEnd);
-        trackLoc = (isH ? segBegin.y() : segBegin.x());
-        //auto psLNum = obj->getLayerNum();
-        //int idx1 = 0;
-        //int idx2 = 0;
-        //getTrackIdx(trackLoc, psLNum, idx1, idx2);
-        //iroute.setTrackIdx(idx1);
-      }
-    }
-  } else {
-    trackLoc = 0;
-  }
-
-  unique_ptr<taPinFig> ps = make_unique<taPathSeg>();
-  auto rptr = static_cast<taPathSeg*>(ps.get());
-  if (isH) {
-    rptr->setPoints(frPoint(maxBegin, trackLoc), frPoint(minEnd, trackLoc));
-  } else {
-    rptr->setPoints(frPoint(trackLoc, maxBegin), frPoint(trackLoc, minEnd));
-  }
-  rptr->setLayerNum(layerNum);
-  rptr->setStyle(getDesign()->getTech()->getLayer(layerNum)->getDefaultSegStyle());
-  // owner set when add to taPin
-  iroute->addPinFig(ps);
-
-  //iroute.setCoords(maxBegin, minEnd);
-  //for (auto coord: upViaCoordSet) {
-  //  iroute.addViaCoords(coord, true);
-  //}
-  //for (auto coord: downViaCoordSet) {
-  //  iroute.addViaCoords(coord, false);
-  //}
-  for (auto coord: upViaCoordSet) {
-    unique_ptr<taPinFig> via = make_unique<taVia>(getDesign()->getTech()->getLayer(layerNum + 1)->getDefaultViaDef());
-    auto rViaPtr = static_cast<taVia*>(via.get());
-    rViaPtr->setOrigin(isH ? frPoint(coord, trackLoc) : frPoint(trackLoc, coord));
-    iroute->addPinFig(via);
-  }
-  for (auto coord: downViaCoordSet) {
-    unique_ptr<taPinFig> via = make_unique<taVia>(getDesign()->getTech()->getLayer(layerNum - 1)->getDefaultViaDef());
-    auto rViaPtr = static_cast<taVia*>(via.get());
-    rViaPtr->setOrigin(isH ? frPoint(coord, trackLoc) : frPoint(trackLoc, coord));
-    iroute->addPinFig(via);
-  }
-  iroute->setWlenHelper(wlen);
-  if (wlen2 < std::numeric_limits<frCoord>::max()) {
-    iroute->setWlenHelper2(wlen2);
-  }
-  addIroute(iroute, isExt);
-  //iroute.setId(iroutes.size()); // set id
-  //iroutes.push_back(iroute);
-}
-
-
-
-void FlexTAWorker::initIroutes() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  vector<rq_rptr_value_t<frGuide> > result;
-  auto regionQuery = getRegionQuery();
-  for (int lNum = 0; lNum < (int)getDesign()->getTech()->getLayers().size(); lNum++) {
-    auto layer = getDesign()->getTech()->getLayer(lNum);
-    if (layer->getType() != frLayerTypeEnum::ROUTING) {
-      continue;
-    }
-    if (layer->getDir() != getDir()) {
-      continue;
-    }
-    result.clear();
-    regionQuery->queryGuide(getExtBox(), lNum, result);
-    //cout <<endl <<"query1:" <<endl;
-    for (auto &[boostb, guide]: result) {
-      frPoint pt1, pt2;
-      guide->getPoints(pt1, pt2);
-      //if (enableOutput) {
-      //  cout <<"found guide (" 
-      //       <<pt1.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-      //       <<pt1.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") (" 
-      //       <<pt2.x() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<", " 
-      //       <<pt2.y() * 1.0 / getDesign()->getTopBlock()->getDBUPerUU() <<") " 
-      //       <<guide->getNet()->getName() << "\n";
-      //}
-      //guides.push_back(guide);
-      //cout <<endl;
-      initIroute(guide);
-    }
-    //sort(guides.begin(), guides.end(), [](const frGuide *a, const frGuide *b) {return *a < *b;});
-  }
-
-  if (enableOutput) {
-    bool   isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-    double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-    for (auto &iroute: iroutes) {
-      frPoint bp, ep;
-      frCoord bc, ec, trackLoc;
-      cout <<iroute->getId() <<" " <<iroute->getGuide()->getNet()->getName();
-      auto guideLNum = iroute->getGuide()->getBeginLayerNum();
-      for (auto &uPinFig: iroute->getFigs()) {
-        if (uPinFig->typeId() == tacPathSeg) {
-          auto obj = static_cast<taPathSeg*>(uPinFig.get());
-          obj->getPoints(bp, ep);
-          bc = isH ? bp.x() : bp.y();
-          ec = isH ? ep.x() : ep.y();
-          trackLoc = isH ? bp.y() : bp.x();
-          cout <<" (" <<bc / dbu <<"-->" <<ec / dbu <<"), len@" <<(ec - bc) / dbu <<", track@" <<trackLoc / dbu
-               <<", " <<getDesign()->getTech()->getLayer(iroute->getGuide()->getBeginLayerNum())->getName();
-        } else if (uPinFig->typeId() == tacVia) {
-          auto obj = static_cast<taVia*>(uPinFig.get());
-          auto cutLNum = obj->getViaDef()->getCutLayerNum();
-          obj->getOrigin(bp);
-          bc = isH ? bp.x() : bp.y();
-          cout <<string((cutLNum > guideLNum) ? ", U@" : ", D@") <<bc / dbu;
-        }
-      }
-      cout <<", wlen_h@" <<iroute->getWlenHelper() <<endl;
-    }
-  }
-}
-
-
-
-void FlexTAWorker::initCosts() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  frPoint bp, ep;
-  frCoord bc, ec;
-  // init cost
-  if (isInitTA()) {
-    for (auto &iroute: iroutes) {
-      auto pitch = getDesign()->getTech()->getLayer(iroute->getGuide()->getBeginLayerNum())->getPitch();
-      for (auto &uPinFig: iroute->getFigs()) {
-        if (uPinFig->typeId() == tacPathSeg) {
-          auto obj = static_cast<taPathSeg*>(uPinFig.get());
-          obj->getPoints(bp, ep);
-          bc = isH ? bp.x() : bp.y();
-          ec = isH ? ep.x() : ep.y();
-          iroute->setCost(ec - bc + iroute->hasWlenHelper2() * pitch * 1000);
-        }
-      }
-    }
-  } else {
-    auto &workerRegionQuery = getWorkerRegionQuery();
-    // update worker rq
-    for (auto &iroute: iroutes) {
-      for (auto &uPinFig: iroute->getFigs()) {
-        workerRegionQuery.add(uPinFig.get());
-        addCost(uPinFig.get());
-      }
-    }
-    for (auto &iroute: extIroutes) {
-      for (auto &uPinFig: iroute->getFigs()) {
-        workerRegionQuery.add(uPinFig.get());
-        addCost(uPinFig.get());
-      }
-    }
-    // update iroute cost
-    for (auto &iroute: iroutes) {
-      frUInt4 drcCost = 0;
-      frCoord trackLoc = std::numeric_limits<frCoord>::max();
-      for (auto &uPinFig: iroute->getFigs()) {
-        if (uPinFig->typeId() == tacPathSeg) {
-          static_cast<taPathSeg*>(uPinFig.get())->getPoints(bp, ep);
-          if (isH) {
-            trackLoc = bp.y();
-          } else {
-            trackLoc = bp.x();
-          }
-          break;
-        }
-      }
-      if (trackLoc == std::numeric_limits<frCoord>::max()) {
-        cout <<"Error: FlexTAWorker::initCosts does not find trackLoc" <<endl;
-        exit(1);
-      }
-      //auto tmpCost = assignIroute_getCost(iroute.get(), trackLoc, drcCost);
-      assignIroute_getCost(iroute.get(), trackLoc, drcCost);
-      iroute->setCost(drcCost);
-      totCost += drcCost;
-      //iroute->setDrcCost(drcCost);
-      //totDrcCost += drcCost;
-      if (enableOutput && !isInitTA()) {
-        bool   isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-        double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-        frPoint bp, ep;
-        frCoord bc, ec, trackLoc;
-        cout <<iroute->getId() <<" " <<iroute->getGuide()->getNet()->getName();
-        auto guideLNum = iroute->getGuide()->getBeginLayerNum();
-        for (auto &uPinFig: iroute->getFigs()) {
-          if (uPinFig->typeId() == tacPathSeg) {
-            auto obj = static_cast<taPathSeg*>(uPinFig.get());
-            obj->getPoints(bp, ep);
-            bc = isH ? bp.x() : bp.y();
-            ec = isH ? ep.x() : ep.y();
-            trackLoc = isH ? bp.y() : bp.x();
-            cout <<" (" <<bc / dbu <<"-->" <<ec / dbu <<"), len@" <<(ec - bc) / dbu <<", track@" <<trackLoc / dbu
-                 <<", " <<getDesign()->getTech()->getLayer(iroute->getGuide()->getBeginLayerNum())->getName();
-          } else if (uPinFig->typeId() == tacVia) {
-            auto obj = static_cast<taVia*>(uPinFig.get());
-            auto cutLNum = obj->getViaDef()->getCutLayerNum();
-            obj->getOrigin(bp);
-            bc = isH ? bp.x() : bp.y();
-            cout <<string((cutLNum > guideLNum) ? ", U@" : ", D@") <<bc / dbu;
-          }
-        }
-        //cout <<", wlen_h@" <<iroute->getWlenHelper() <<", cost@" <<iroute->getCost() <<", drcCost@" <<iroute->getDrcCost() <<endl;
-        cout <<", wlen_h@" <<iroute->getWlenHelper() <<", cost@" <<iroute->getCost() <<endl;
-      }
-    }
-  }
-}
-
-void FlexTAWorker::sortIroutes() {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  // init cost
-  if (isInitTA()) {
-    for (auto &iroute: iroutes) {
-      addToReassignIroutes(iroute.get());
-    }
-  } else {
-    for (auto &iroute: iroutes) {
-      if (iroute->getCost()) {
-        addToReassignIroutes(iroute.get());
-      }
-    }
-  }
-  if (enableOutput && !isInitTA()) {
-    bool   isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-    double dbu = getDesign()->getTopBlock()->getDBUPerUU();
-    for (auto &iroute: reassignIroutes) {
-      frPoint bp, ep;
-      frCoord bc, ec, trackLoc;
-      cout <<iroute->getId() <<" " <<iroute->getGuide()->getNet()->getName();
-      auto guideLNum = iroute->getGuide()->getBeginLayerNum();
-      for (auto &uPinFig: iroute->getFigs()) {
-        if (uPinFig->typeId() == tacPathSeg) {
-          auto obj = static_cast<taPathSeg*>(uPinFig.get());
-          obj->getPoints(bp, ep);
-          bc = isH ? bp.x() : bp.y();
-          ec = isH ? ep.x() : ep.y();
-          trackLoc = isH ? bp.y() : bp.x();
-          cout <<" (" <<bc / dbu <<"-->" <<ec / dbu <<"), len@" <<(ec - bc) / dbu <<", track@" <<trackLoc / dbu
-               <<", " <<getDesign()->getTech()->getLayer(iroute->getGuide()->getBeginLayerNum())->getName();
-        } else if (uPinFig->typeId() == tacVia) {
-          auto obj = static_cast<taVia*>(uPinFig.get());
-          auto cutLNum = obj->getViaDef()->getCutLayerNum();
-          obj->getOrigin(bp);
-          bc = isH ? bp.x() : bp.y();
-          cout <<string((cutLNum > guideLNum) ? ", U@" : ", D@") <<bc / dbu;
-        }
-      }
-      //cout <<", wlen_h@" <<iroute->getWlenHelper() <<", cost@" <<iroute->getCost() <<", drcCost@" <<iroute->getDrcCost() <<endl;
-      cout <<", wlen_h@" <<iroute->getWlenHelper() <<", cost@" <<iroute->getCost() <<endl;
-    }
-  }
-}
-
-void FlexTAWorker::initFixedObjs_helper(const frBox &box, frCoord bloatDist, frLayerNum lNum, frNet* net) {
-  //bool enableOutput = true;
-  bool enableOutput = false;
-  double dbu = getTech()->getDBUPerUU();
-  frBox bloatBox;
-  box.bloat(bloatDist, bloatBox);
-  auto con = getDesign()->getTech()->getLayer(lNum)->getShortConstraint();
-  bool isH = (getDir() == frPrefRoutingDirEnum::frcHorzPrefRoutingDir);
-  int idx1, idx2;
-  //frCoord x1, x2;
-  if (isH) {
-    getTrackIdx(bloatBox.bottom(), bloatBox.top(),   lNum, idx1, idx2);
-    //x1 = bloatBox.bottom();
-    //x2 = bloatBox.top();
-  } else {
-    getTrackIdx(bloatBox.left(),   bloatBox.right(), lNum, idx1, idx2);
-    //x1 = bloatBox.left();
-    //x2 = bloatBox.right();
-  }
-  auto &trackLocs = getTrackLocs(lNum);
-  //auto &tracks = getTracks(lNum);
-  auto &workerRegionQuery = getWorkerRegionQuery();
-  for (int i = idx1; i <= idx2; i++) {
-    // new
-    //auto &track = tracks[i];
-    //track.addToCost(net, x1, x2, 0);
-    //track.addToCost(net, x1, x2, 1);
-    //track.addToCost(net, x1, x2, 2);
-    // old
-    auto trackLoc = trackLocs[i];
-    frBox tmpBox;
-    if (isH) {
-      tmpBox.set(bloatBox.left(), trackLoc, bloatBox.right(), trackLoc);
-    } else {
-      tmpBox.set(trackLoc, bloatBox.bottom(), trackLoc, bloatBox.top());
-    }
-    workerRegionQuery.addCost(tmpBox, lNum, net, con);
-    if (enableOutput) {
-      cout <<"  add fixed obj cost ("
-           <<tmpBox.left()  / dbu <<", " <<tmpBox.bottom() / dbu <<") (" 
-           <<tmpBox.right() / dbu <<", " <<tmpBox.top()    / dbu <<") " 
-           <<getDesign()->getTech()->getLayer(lNum)->getName();
-      if (net != nullptr) {
-        cout <<" " <<net->getName();
-      }
-      cout <<endl <<flush;
-    }
-  }
-}
-
-
-void FlexTAWorker::initFixedObjs() {
-  //bool enableOutput = false;
-  ////bool enableOutput = true;
-  //double dbu = getTech()->getDBUPerUU();
-  vector<rq_rptr_value_t<frBlockObject> > result;
-  frBox box;
-  frCoord width = 0;
-  frCoord bloatDist = 0;
-  for (auto layerNum = getTech()->getBottomLayerNum(); layerNum <= getTech()->getTopLayerNum(); ++layerNum) {
-    result.clear();
-    if (getTech()->getLayer(layerNum)->getType() != frLayerTypeEnum::ROUTING ||
-        getTech()->getLayer(layerNum)->getDir()  != getDir()) {
-      continue;
-    }
-    width = getTech()->getLayer(layerNum)->getWidth();
-    getRegionQuery()->query(getExtBox(), layerNum, result);
-    for (auto &[boostb, obj]: result) {
-      // instterm term
-      if (obj->typeId() == frcTerm || obj->typeId() == frcInstTerm) {
-        box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-        bloatDist = TASHAPEBLOATWIDTH * width;
-        frNet* netPtr = nullptr;
-        if (obj->typeId() == frcTerm) {
-          netPtr = static_cast<frTerm*>(obj)->getNet();
-        } else {
-          netPtr = static_cast<frInstTerm*>(obj)->getNet();
-        }
-        initFixedObjs_helper(box, bloatDist, layerNum, netPtr);
-      // snet
-      } else if (obj->typeId() == frcPathSeg || obj->typeId() == frcVia) {
-        box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-        bloatDist = TASHAPEBLOATWIDTH * width;
-        frNet* netPtr = nullptr;
-        if (obj->typeId() == frcPathSeg) {
-          netPtr = static_cast<frPathSeg*>(obj)->getNet();
-        } else {
-          netPtr = static_cast<frVia*>(obj)->getNet();
-        }
-        initFixedObjs_helper(box, bloatDist, layerNum, netPtr);
-      } else if (obj->typeId() == frcBlockage || obj->typeId() == frcInstBlockage) {
-        if (USEMINSPACING_OBS) {
-          box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-          bloatDist = TASHAPEBLOATWIDTH * width;
-          initFixedObjs_helper(box, bloatDist, layerNum, nullptr);
-        } else {
-          box.set(boostb.min_corner().x()+1, boostb.min_corner().y()+1, boostb.max_corner().x()-1, boostb.max_corner().y()-1);
-          bloatDist = TASHAPEBLOATWIDTH * width;
-          initFixedObjs_helper(box, bloatDist, layerNum, nullptr);
-        }
-      } else {
-        cout <<"Warning: unsupported type in initFixedObjs" <<endl;
-      }
-    }
-  }
-}
-
-
-void FlexTAWorker::init() {
-  rq.init();
-  initTracks();
-  if (getTAIter() != -1) {
-    initFixedObjs();
-  }
-  initIroutes();
-  if (getTAIter() != -1) {
-    initCosts();
-    sortIroutes();
-  }
-}
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_rq.cpp b/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_rq.cpp
deleted file mode 100644
index 3fadb4b..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/FlexTA_rq.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "ta/FlexTA.h"
-
-using namespace std;
-using namespace fr;
-
-frDesign* FlexTAWorkerRegionQuery::getDesign() const {
-  return taWorker->getDesign();
-}
-
-void FlexTAWorkerRegionQuery::add(taPinFig* fig) {
-  box_t boostb;
-  frPoint bp, ep;
-  if (fig->typeId() == tacPathSeg) {
-    auto obj = static_cast<taPathSeg*>(fig);
-    obj->getPoints(bp, ep);
-    boostb = box_t(point_t(bp.x(), bp.y()), point_t(ep.x(), ep.y()));
-    shapes.at(obj->getLayerNum()).insert(make_pair(boostb, obj));
-  } else if (fig->typeId() == tacVia) {
-    auto obj = static_cast<taVia*>(fig);
-    obj->getOrigin(bp);
-    boostb = box_t(point_t(bp.x(), bp.y()), point_t(bp.x(), bp.y()));
-    shapes.at(obj->getViaDef()->getCutLayerNum()).insert(make_pair(boostb, obj));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void FlexTAWorkerRegionQuery::remove(taPinFig* fig) {
-  box_t boostb;
-  frPoint bp, ep;
-  if (fig->typeId() == tacPathSeg) {
-    auto obj = static_cast<taPathSeg*>(fig);
-    obj->getPoints(bp, ep);
-    boostb = box_t(point_t(bp.x(), bp.y()), point_t(ep.x(), ep.y()));
-    shapes.at(obj->getLayerNum()).remove(make_pair(boostb, obj));
-  } else if (fig->typeId() == tacVia) {
-    auto obj = static_cast<taVia*>(fig);
-    obj->getOrigin(bp);
-    boostb = box_t(point_t(bp.x(), bp.y()), point_t(bp.x(), bp.y()));
-    shapes.at(obj->getViaDef()->getCutLayerNum()).remove(make_pair(boostb, obj));
-  } else {
-    cout <<"Error: unsupported region query add" <<endl;
-  }
-}
-
-void FlexTAWorkerRegionQuery::query(const frBox &box, frLayerNum layerNum, set<taPin*, frBlockObjectComp> &result) {
-  vector<rq_rptr_value_t<taPinFig> > temp;
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  shapes.at(layerNum).query(bgi::intersects(boostb), back_inserter(temp));
-  //transform(temp.begin(), temp.end(), back_inserter(result), [](auto &kv) {return kv.second->getPin();});
-  for (auto &[boostb, rptr]: temp) {
-    result.insert(rptr->getPin());
-  }
-}
-
-void FlexTAWorkerRegionQuery::init() {
-  int numLayers = getDesign()->getTech()->getLayers().size();
-  shapes.clear();
-  shapes.resize(numLayers);
-  costs.clear();
-  costs.resize(numLayers);
-  //aps.clear();
-  //aps.resize(numLayers);
-  //vector<vector<rq_rptr_value_t<drConnFig> > > allShapes(numLayers);
-  //for (auto &net: getDRWorker()->getNets()) {
-  //  for (auto &connFig: net->getRouteConnFigs()) {
-  //    add(connFig.get(), allShapes);
-  //  }
-  //  for (auto &connFig: net->getExtConnFigs()) {
-  //    add(connFig.get(), allShapes);
-  //  }
-  //}
-  //for (auto i = 0; i < numLayers; i++) {
-  //  shapes.at(i) = boost::move(bgi::rtree<rq_rptr_value_t<drConnFig>, bgi::quadratic<16> >(allShapes.at(i)));
-  //  allShapes.at(i).clear();
-  //  allShapes.at(i).shrink_to_fit();
-  //  //if (VERBOSE > 0) {
-  //  //  cout <<"  complete " <<design->getTech()->getLayer(i)->getName() <<endl;
-  //  //}
-  //}
-}
-
-void FlexTAWorkerRegionQuery::addCost(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con) {
-  costs.at(layerNum).insert(make_pair(box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top())), make_pair(obj, con)));
-}
-
-void FlexTAWorkerRegionQuery::removeCost(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con) {
-  costs.at(layerNum).remove(make_pair(box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top())), make_pair(obj, con)));
-}
-
-void FlexTAWorkerRegionQuery::queryCost(const frBox &box, frLayerNum layerNum, vector<rq_generic_value_t<pair<frBlockObject*, frConstraint*> > > &result) {
-  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-  costs.at(layerNum).query(bgi::intersects(boostb), back_inserter(result));
-}
-
-//void FlexTAWorkerRegionQuery::addAP(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con) {
-//  aps.at(layerNum).insert(make_pair(box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top())), obj));
-//}
-//
-//void FlexTAWorkerRegionQuery::removeAP(const frBox &box, frLayerNum layerNum, frBlockObject* obj, frConstraint* con) {
-//  aps.at(layerNum).remove(make_pair(box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top())), obj));
-//}
-//
-//void FlexTAWorkerRegionQuery::queryAP(const frBox &box, frLayerNum layerNum, vector<rq_rptr_value_t<frBlockObject> > &result) {
-//  box_t boostb = box_t(point_t(box.left(), box.bottom()), point_t(box.right(), box.top()));
-//  aps.at(layerNum).query(bgi::intersects(boostb), back_inserter(result));
-//}
diff --git a/scripts/pdn/src/PdnPinDumper/src/ta/Makefile b/scripts/pdn/src/PdnPinDumper/src/ta/Makefile
deleted file mode 100644
index bd1e12c..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/ta/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# subdir and objects in current dir
-SUBDIRS	= 
-OBJECTS	= FlexTA.o FlexTA_init.o FlexTA_assign.o FlexTA_end.o FlexTA_rq.o
-
-
-all:subdirs ${OBJECTS}
-
-	
-clean:cleansubdirs
-	rm -f ${OBJECTS}
-	
-include ${MAKEINCLUDE}
diff --git a/scripts/pdn/src/PdnPinDumper/src/utility.cpp b/scripts/pdn/src/PdnPinDumper/src/utility.cpp
deleted file mode 100644
index 4887cd4..0000000
--- a/scripts/pdn/src/PdnPinDumper/src/utility.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Authors: Lutong Wang and Bangqi Xu */
-/*
- * Copyright (c) 2019, The Regents of the University of California
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-//#include "FlexRoute.h"
-#include <iostream>
-#include <fstream>
-#include "global.h"
-#include "frDesign.h"
-using namespace std;
-using namespace fr;
-
-void frDesign::printAllComps() {
-  cout <<endl <<"print all components: ";
-  for (auto &m: topBlock->getInsts()) {
-    cout <<endl <<*m <<endl;
-  }
-}
-
-void frDesign::printAllMacros() {
-  cout <<endl;
-  cout <<"print all macros: " <<endl;
-  for (auto &m: refBlocks) {
-    cout <<endl <<*(m) <<endl;
-  }
-}
-
-////void FlexRoute::printAllNets() {
-////  cout <<endl;
-////  cout <<"print all nets: " <<endl;
-////  for (auto &m: nets) {
-////    cout <<endl <<*(m.second) <<endl;
-////  }
-////}
-
-void frDesign::printAllTerms() {
-  cout <<endl <<"print all terminals: ";
-  for (auto &m: topBlock->getTerms()) {
-    cout <<endl <<*m <<endl;
-  }
-}
-
-void frTechObject::printAllVias() {
-  cout <<endl <<"print all vias: " <<endl;
-  for (auto &m: vias) {
-    cout <<endl <<*(m) <<endl;
-  }
-}
-
-void frDesign::printCMap() {
-  cout <<endl <<"print cmap: ";
-  int xCnt = 0;
-  int yCnt = 0;
-  for (auto &gcp: topBlock->getGCellPatterns()) {
-    if (gcp.isHorizontal()) {
-      yCnt = gcp.getCount();
-    } else {
-      xCnt = gcp.getCount();
-    }
-  }
-  cout <<"x/y = " <<xCnt <<" " <<yCnt <<endl;
-  auto &cmap = topBlock->getCMap();
-  for (int lNum = 0; lNum <= (int)getTech()->getLayers().size(); lNum += 2) {
-    for (int i = 0; i < xCnt; i++) {
-      for (int j = 0; j < yCnt; j++) {
-        cout <<"x/y/z/s/t/l/e1/e2/u = " 
-             <<i <<" " <<j <<" " <<lNum <<" "
-             <<cmap.getSupply(i,j,lNum) <<" "
-             <<cmap.getThroughDemand(i,j,lNum) <<" "
-             <<cmap.getLocalDemand(i,j,lNum) <<" "
-             <<cmap.getEdge1Demand(i,j,lNum) <<" "
-             <<cmap.getEdge2Demand(i,j,lNum) <<" "
-             <<cmap.getUpDemand(i,j,lNum) <<" ";
-        if (cmap.getThroughDemand(i,j,lNum) + cmap.getLocalDemand(i,j,lNum) +
-            cmap.getEdge1Demand(i,j,lNum)   > cmap.getSupply(i,j,lNum) ||
-            cmap.getThroughDemand(i,j,lNum) + cmap.getLocalDemand(i,j,lNum) +
-            cmap.getEdge2Demand(i,j,lNum)   > cmap.getSupply(i,j,lNum)) {
-          cout <<"GCell overflow";
-        }
-        cout <<endl;
-      }
-    }
-  }
-}
diff --git a/scripts/pdn/src/scripts/PdnPinDumper b/scripts/pdn/src/scripts/PdnPinDumper
deleted file mode 100755
index eef501a..0000000
--- a/scripts/pdn/src/scripts/PdnPinDumper
+++ /dev/null
Binary files differ
diff --git a/scripts/pdn/src/scripts/apply_pdn b/scripts/pdn/src/scripts/apply_pdn
deleted file mode 100755
index a4f8b35..0000000
--- a/scripts/pdn/src/scripts/apply_pdn
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-# the next line restarts using tclsh \
-exec tclsh "$0" ${1+"$@"}
-
-package require Tcl 8.5
-package require pdn
-
-# not available in 8.5:
-proc lmap args {
-    set body [lindex $args end]
-    set args [lrange $args 0 end-1]
-    set n 0
-    set pairs [list]
-    foreach {varnames listval} $args {
-        set varlist [list]
-        foreach varname $varnames {
-            upvar 1 $varname var$n
-            lappend varlist var$n
-            incr n
-        }
-        lappend pairs $varlist $listval
-    }
-    set temp [list]
-    foreach {*}$pairs {
-        lappend temp [uplevel 1 $body]
-    }
-    set temp
-}
-
-# Input = Macro-packed DEF (currently from innovus)
-# Output = Def with PDN
-
-set ::start_time [clock clicks -milliseconds]
-
-pdn init [lindex $argv 0]
-
-puts "Total walltime till PDN setup = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
-
-puts "##Power Delivery Network Generator: Generating PDN DEF"
-set ::start_time [clock clicks -milliseconds]
-
-pdn power_grid
-pdn output_def
-
-puts "Total walltime to generate PDN DEF = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
-
-
-puts "Macro-packed input def is $FpOutDef"
-puts "##TASK 8 Final DEF generation with PDN : Stitching macro-packed DEF with SPECIAL NETS"
-
-set cmd "exec def_gen $::FpOutDef [pdn get config def_output] $::design ${::design}_post_T8.def"
-eval $cmd
-
-puts "Total walltime till final DEF stitching = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
-
diff --git a/scripts/pdn/src/scripts/create_pg_grid.tcl b/scripts/pdn/src/scripts/create_pg_grid.tcl
index 0997bad..6803d4e 100755
--- a/scripts/pdn/src/scripts/create_pg_grid.tcl
+++ b/scripts/pdn/src/scripts/create_pg_grid.tcl
@@ -26,8 +26,22 @@
 ##############################################################################
 
 namespace eval ::pdn {
+    variable block
+    variable tech
+    variable libs
     variable design_data {}
+    variable default_grid_data {}
     variable def_output
+    variable widths
+    variable pitches
+    variable loffset
+    variable boffset
+    variable site
+    variable site_width
+    variable site_name
+    variable row_height
+    variable metal_layers {}
+    variable metal_layers_dir {}
     
     ## procedure for file existence check, returns 0 if file does not exist or file exists, but empty
     proc -s {filename} {
@@ -39,166 +53,200 @@
         
         return [dict get $design_data {*}$args]
     }
+    proc get_macro_power_pins {inst_name} {
+        set specification [select_instance_specification $inst_name]
+        if {[dict exists $specification power_pins]} {
+            return [dict get $specification power_pins]
+        }
+        return "VDDPE VDDCE"
+    }
+    proc get_macro_ground_pins {inst_name} {
+        set specification [select_instance_specification $inst_name]
+        if {[dict exists $specification ground_pins]} {
+            return [dict get $specification ground_pins]
+        }
+        return "VSSE"
+    }
+    
+    proc transform_box {xmin ymin xmax ymax origin orientation} {
+        switch -exact $orientation {
+            R0    {set new_box [list $xmin $ymin $xmax $ymax]}
+            R90   {set new_box [list [expr -1 * $ymax] $xmin [expr -1 * $ymin] $xmax]}
+            R180  {set new_box [list [expr -1 * $xmax] [expr -1 * $ymax] [expr -1 * $xmin] [expr -1 * $ymin]]}
+            R270  {set new_box [list $ymin [expr -1 * $xmax] $ymax [expr -1 * $xmin]]}
+            MX    {set new_box [list $xmin [expr -1 * $ymax] $xmax [expr -1 * $ymin]]}
+            MY    {set new_box [list [expr -1 * $xmax] $ymin [expr -1 * $xmin] $ymax]}
+            MXR90 {set new_box [list $ymin $xmin $ymax $xmax]}
+            MYR90 {set new_box [list [expr -1 * $ymax] [expr -1 * $xmax] [expr -1 * $ymin] [expr -1 * $xmin]]}
+            default {error "Illegal orientation $orientation specified"}
+        }
+        return [list \
+            [expr [lindex $new_box 0] + [lindex $origin 0]] \
+            [expr [lindex $new_box 1] + [lindex $origin 1]] \
+            [expr [lindex $new_box 2] + [lindex $origin 0]] \
+            [expr [lindex $new_box 3] + [lindex $origin 1]] \
+        ]
+    }
     
     proc get_memory_instance_pg_pins {} {
-        ########################################
-        # Creating run.param file for PdnPinDumper
-        #
-        #
-        ########################################
+        variable block
+        variable orig_stripe_locs
 
-        set OP1 [open run.param w]
+        foreach inst [$block getInsts] {
+            set inst_name [$inst getName]
+            set master [$inst getMaster]
 
-        set cmd "exec touch dummy.guide"
-        catch {eval $cmd}
+            if {[$master getType] == "CORE"} {continue}
+            if {[$master getType] == "IO"} {continue}
+            if {[$master getType] == "PAD"} {continue}
+            if {[$master getType] == "PAD_SPACER"} {continue}
+            if {[$master getType] == "SPACER"} {continue}
+            if {[$master getType] == "NONE"} {continue}
+            if {[$master getType] == "ENDCAP_PRE"} {continue}
+            if {[$master getType] == "ENDCAP_BOTTOMLEFT"} {continue}
+            if {[$master getType] == "ENDCAP_BOTTOMRIGHT"} {continue}
+            if {[$master getType] == "ENDCAP_TOPLEFT"} {continue}
+            if {[$master getType] == "ENDCAP_TOPRIGHT"} {continue}
+            if {[$master getType] == "ENDCAP"} {continue}
+            if {[$master getType] == "ENDCAP"} {continue}
+            if {[$master getType] == "ENDCAP"} {continue}
+            if {[$master getType] == "ENDCAP"} {continue}
+            if {[$master getType] == "CORE_SPACER"} {continue}
+            if {[$master getType] == "CORE_TIEHIGH"} {continue}
+            if {[$master getType] == "CORE_TIELOW"} {continue}
 
-        if {[-s $::FpOutDef]} {
-          puts "MACRO Packed DEF File $::FpOutDef  exists and not empty.."
-        } else {
-          puts "File $::FpOutDef does not exist, or exists but empty"
-          exit
-        }
+            foreach term_name [concat [get_macro_power_pins $inst_name] [get_macro_ground_pins $inst_name]] {
+                set inst_term [$inst findITerm $term_name]
+                if {$inst_term == "NULL"} {continue}
+                
+                set mterm [$inst_term getMTerm]
+                set type [$mterm getSigType]
 
+                foreach mPin [$mterm getMPins] {
+                    foreach geom [$mPin getGeometry] {
+                        set layer [[$geom getTechLayer] getName]
+                        set box [transform_box [$geom xMin] [$geom yMin] [$geom xMax] [$geom yMax] [$inst getOrigin] [$inst getOrient]]
 
-        if {[-s ${::flatLef}]} {
-          puts "Flat LEF File ${::flatLef}  exists and not empty.."
-        } else {
-          puts "File ${::flatLef} does not exist, or exists but empty. Please check PDN.cfg"
-          exit
-        }
-        pdn write_macrocell_list "macrocell.list"
+                        set width  [expr abs([lindex $box 2] - [lindex $box 0])]
+                        set height [expr abs([lindex $box 3] - [lindex $box 1])]
 
-        puts $OP1 "lef:${::flatLef}"
-        puts $OP1 "def:${::FpOutDef}"
-        puts $OP1 "guide:dummy.guide"
-        puts $OP1 "output:dummy.def"
-        puts $OP1 "macroList:macrocell.list"
-        puts $OP1 "threads:16"
-        puts $OP1 "cpxthreads:8"
-        puts $OP1 "verbose:2"
-        puts $OP1 "gap:0"
-        puts $OP1 "timeout:2400"
-        close $OP1
-
-        puts "Total walltime till macro pin geometry creation = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
-
-        puts "##Power Delivery Network Generator: Generating inputs for PDN Gen"
-
-
-        #set cmd "exec ${wd}/scripts/pdn_input_gen $design"
-        #eval $cmd
-        #exec "PdnPinDumper run.param > pin.loc"
-        #set ch [open "pin.loc"]
-        set ch [open "|PdnPinDumper run.param | tee pin_dumper.log"]
-
-        set mem_pins_vdd_hor {}
-        set mem_pins_vdd_ver {}
-        set mem_pins_vss_hor {}
-        set mem_pins_vss_ver {}
-
-        if {[info vars ::macro_power_pins] == ""} {
-             set ::macro_power_pins "VDDPE VDDCE"
-        }
-        if {[info vars ::macro_ground_pins] == ""} {
-            set ::macro_ground_pins "VSSE"
-        }
-        
-        while {![eof $ch]} {
-            set line [gets $ch]
-            set line [regsub -all {[\(\)\-\,]} $line {}]
-
-            if {[regexp {^instName.*/([^/]*):} $line - pin_name]} {
-                if {[lsearch $::macro_power_pins $pin_name] != -1} {
-                    set net vdd
-                } elseif {[lsearch $::macro_ground_pins $pin_name] != -1} {
-                    set net vss
-                } else {
-                    if {[info vars net] != ""} {
-                        unset net
+                        if {$width > $height} {
+                            set xl [lindex $box 0]
+                            set xu [lindex $box 2]
+                            set y  [expr ([lindex $box 1] + [lindex $box 3])/2]
+                            set width [expr abs([lindex $box 3] - [lindex $box 1])]
+                            lappend orig_stripe_locs(${layer}_PIN_hor,$type) [list $xl $y $xu $width]
+                        } else {
+                            set x  [expr ([lindex $box 0] + [lindex $box 2])/2]
+                            set yl [lindex $box 1]
+                            set yu [lindex $box 3]
+                            set width [expr abs([lindex $box 2] - [lindex $box 0])]
+                            lappend orig_stripe_locs(${layer}_PIN_ver,$type) [list $x $yl $yu $width]
+                        }
                     }
                 }
-            }
-
-            if {[info vars net] != "" && [llength $line] == 5} {
-                set width  [expr abs([lindex $line 2] - [lindex $line 0])]
-                set height [expr abs([lindex $line 3] - [lindex $line 1])]
-
-                if {$width > $height} {
-                   lappend mem_pins_${net}_hor $line
-                } else {
-                   lappend mem_pins_${net}_ver $line
-                }
             }    
         }
-
-        if {[catch {close $ch} msg]} {
-            puts "ERROR: PdnPinDumper failed - check pin_dumper.log"
-            puts $msg
-            exit
-        }
-
-        foreach pin $mem_pins_vdd_hor {
-            set xl [lindex $pin 0]
-            set xu [lindex $pin 2]
-            set y  [expr ([lindex $pin 1] + [lindex $pin 3])/2]
-            lappend ::orig_stripe_locs([lindex $pin 4]_PIN_hor,POWER) [list $xl $y $xu]
-        }
-
-        foreach pin $mem_pins_vdd_ver {
-            set x  [expr ([lindex $pin 0] + [lindex $pin 2])/2]
-            set yl [lindex $pin 1]
-            set yu [lindex $pin 3]
-            lappend ::orig_stripe_locs([lindex $pin 4]_PIN_ver,POWER) [list $x $yl $yu]
-        }
-
-        foreach pin $mem_pins_vss_hor {
-            set xl [lindex $pin 0]
-            set xu [lindex $pin 2]
-            set y  [expr ([lindex $pin 1] + [lindex $pin 3])/2]
-            lappend ::orig_stripe_locs([lindex $pin 4]_PIN_hor,GROUND) [list $xl $y $xu]
-        }
-
-        foreach pin $mem_pins_vss_ver {
-            set x  [expr ([lindex $pin 0] + [lindex $pin 2])/2]
-            set yl [lindex $pin 1]
-            set yu [lindex $pin 3]
-            lappend ::orig_stripe_locs([lindex $pin 4]_PIN_ver,GROUND) [list $x $yl $yu]
-        }
+#        puts "Total walltime till macro pin geometry creation = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
     }
 
-    proc init {PDN_cfg} {
+    proc set_core_area {xmin ymin xmax ymax} {
+        variable design_data
+
+        dict set design_data config core_area [list $xmin $ymin $xmax $ymax]
+    }
+
+    proc init {opendb_block {PDN_cfg "PDN.cfg"}} {
+        variable db
+        variable block
+        variable tech
+        variable libs
         variable design_data
         variable def_output
-
-        if {[-s $PDN_cfg]} {
-          puts "File $PDN_cfg exists and not empty.."
-        } else {
+        variable default_grid_data
+        variable stripe_locs
+        variable design_name
+        variable site
+        variable row_height
+        variable site_width
+        variable site_name
+        variable metal_layers
+        variable def_units
+        variable stripes_start_with
+        variable rails_start_with
+        
+#        set ::start_time [clock clicks -milliseconds]
+        if {![-s $PDN_cfg]} {
           puts "File $PDN_cfg does not exist, or exists but empty"
-          exit
+          exit 1
         }
 
         source $PDN_cfg
 
-        puts "Design Name is $::design"
-        set def_output "${::design}_pdn.def"
+        set block $opendb_block
+        set def_units [$block getDefUnits]
+        set design_name [$block getName]
+        set db [$block getDataBase]
+        set tech [$db getTech]
+        set libs [$db getLibs]
+
+        init_metal_layers
+        init_via_tech
         
-        # Sourcing user inputs file
-        #
-        set ::row_height [expr {$::def_units * $::row_height}]
-
-        ##### Get information from BEOL LEF
-        puts -nonewline "Reading BEOL LEF and gathering information ..."
-        ##get_info_from_techlef
-        puts " DONE \[Total elapsed walltime = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds\]"
-
-        ##puts -nonewline "Doing sanity checks, gathering information and creating DEF headers ..."
-        ##### Basic sanity checks to see if inputs are given correctly
-        if {[lsearch $::met_layer_list $::rails_mlayer] < 0} {
-	        puts "ERROR: Layer specified for std. cell rails not in list of layers. EXITING....."
-	        exit
+        set die_area [$block getDieArea]
+        puts "Design Name is $design_name"
+        set def_output "${design_name}_pdn.def"
+        
+        if {[info vars ::power_nets] == ""} {
+            set ::power_nets "VDD"
+        }
+        
+        if {[info vars ::ground_nets] == ""} {
+            set ::ground_nets "VSS"
         }
 
-        set ::vias {}
+        if {[info vars ::stripes_start_with] == ""} {
+            set stripes_start_with "GROUND"
+        } else {
+            set stripes_start_with $::stripes_start_with
+        }
+        
+        if {[info vars ::rails_start_with] == ""} {
+            set rails_start_with "GROUND"
+        } else {
+            set rails_start_with $::rails_start_with
+        }
+        
+        dict set design_data power_nets $::power_nets
+        dict set design_data ground_nets $::ground_nets
+
+        # Sourcing user inputs file
+        #
+        set sites {}
+        foreach lib $libs {
+            set sites [concat $sites [$lib getSites]]
+        }
+        set site [lindex $sites 0]
+
+        set site_name [$site getName]
+        set site_width [$site getWidth] 
+        
+        set row_height [$site getHeight]
+
+        ##### Get information from BEOL LEF
+        puts "Reading BEOL LEF and gathering information ..."
+
+#        puts " DONE \[Total elapsed walltime = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds\]"
+
+        if {[info vars ::layers] != ""} {
+            foreach layer $::layers {
+                if {[dict exists $::layers $layer widthtable]} {
+                    dict set ::layers $layer widthtable [lmap x [dict get $::layers $layer widthtable] {expr $x * $def_units}]
+                }
+            }
+            set_layer_info $::layers
+        }
+
         if {[info vars ::halo] != ""} {
             if {[llength $::halo] == 1} {
                 set default_halo "$::halo $::halo $::halo $::halo"
@@ -207,130 +255,300 @@
             } elseif {[llength $::halo] == 4} {
                 set default_halo $::halo
 	    } else {
-                puts "ERROR: Illegal number of elements defined for ::halo \"$::halo\""
-                exit
+                error "ERROR: Illegal number of elements defined for ::halo \"$::halo\""
             }
         } else {
             set default_halo "0 0 0 0"
         }
 
-        dict set design_data config [list \
-            def_output   $def_output \
-            design       $::design \
-            def_units    $::def_units \
-            core_area    [list $::core_area_llx $::core_area_lly $::core_area_urx $::core_area_ury] \
-            die_area     [list $::die_area_llx  $::die_area_lly  $::die_area_urx  $::die_area_ury] \
-            default_halo [lmap x $default_halo {expr $x * $::def_units}] \
-        ]
+        dict set design_data config def_output   $def_output
+        dict set design_data config design       $design_name
+        dict set design_data config die_area     [list [$die_area xMin]  [$die_area yMin] [$die_area xMax] [$die_area yMax]]
+        dict set design_data config default_halo [lmap x $default_halo {expr $x * $def_units}]
                    
-        foreach lay $::met_layer_list { 
-	    set ::stripe_locs($lay,POWER) ""
-	    set ::stripe_locs($lay,GROUND) ""
-	    set ::stripe_locs_blk($lay,POWER) ""
-	    set ::stripe_locs_blk($lay,GROUND) ""	
+        if {[info vars ::core_area_llx] != "" && [info vars ::core_area_lly] != "" && [info vars ::core_area_urx] != "" && [info vars ::core_area_ury] != ""} {
+             set_core_area [expr $::core_area_llx * $def_units] [expr $::core_area_lly * $def_units] [expr $::core_area_urx * $def_units] [expr $::core_area_ury * $def_units]
+        }
+        
+        foreach lay $metal_layers { 
+	    set stripe_locs($lay,POWER) ""
+	    set stripe_locs($lay,GROUND) ""
+        }
+
+        ########################################
+        # Remove existing rows
+        #######################################
+        foreach row [$block getRows] {
+            dbRow_destroy $row
+        }
+
+        ########################################
+        # Remove existing power/ground nets
+        #######################################
+        foreach pg_net [concat [dict get $design_data power_nets] [dict get $design_data ground_nets]] {
+            set net [$block findNet $pg_net]
+            if {$net != "NULL"} {
+                dbNet_destroy $net
+            }
         }
 
         ########################################
         # Creating blockages based on macro locations
         #######################################
-        pdn read_macro_boundaries $::FpOutDef $::cellLef
+        pdn read_macro_boundaries
 
         pdn get_memory_instance_pg_pins
 
+        if {$default_grid_data == {}} {
+            set default_grid_data [lindex [dict get $design_data grid stdcell] 0]
+        }
+
+        ##### Basic sanity checks to see if inputs are given correctly
+        if {[lsearch $metal_layers [get_rails_layer]] < 0} {
+	    error "ERROR: Layer specified for std. cell rails not in list of layers."
+        }
+
+#        puts "Total walltime till PDN setup = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
+
         return $design_data
     }
     
     proc specify_grid {type specification} {
         variable design_data
-        
-        set specification [list $specification]
+
+        set specifications {}
         if {[dict exists $design_data grid $type]} {
-            set specification [concat [dict get $design_data grid $type] $specification]
+            set specifications [dict get $design_data grid $type]
         }
-        dict set design_data grid $type $specification
+        lappend specifications $specification
+        
+        dict set design_data grid $type $specifications
     }
     
     proc add_grid {grid_data} {
         variable design_data
-
+        variable def_units
+        variable widths
+        variable pitches
+        variable loffset
+        variable boffset
+        
         ##### Creating maps for directions, widths and pitches
-        set def_units [dict get $design_data config def_units]
         set area [dict get $grid_data area]
 
-        set idx 0
-        foreach lay [dict get $grid_data layers] { 
-	        set ::dir($lay) [lindex [dict get $grid_data dir] $idx]
-	        set ::widths($lay) [expr [lindex [dict get $grid_data widths] $idx] * $def_units] 
-	        set ::pitches($lay) [expr [lindex [dict get $grid_data pitches] $idx] * $def_units]
-	        set ::liooffset($lay) [expr ([lindex [dict get $grid_data loffset] $idx] * $def_units)]
-	        set ::biooffset($lay) [expr ([lindex [dict get $grid_data boffset] $idx] * $def_units)]
-	        set ::loffset($lay) [expr ([lindex [dict get $grid_data loffset] $idx]) * $def_units]
-	        set ::boffset($lay) [expr ([lindex [dict get $grid_data boffset] $idx]) * $def_units]
-	        incr idx
-	        ##puts "OFFSET: layer is $lay, $::biooffset($lay), $::liooffset($lay)"
+        foreach lay [dict keys [dict get $grid_data layers]] { 
+	    set widths($lay)    [expr round([dict get $grid_data layers $lay width] * $def_units)] 
+	    set pitches($lay)   [expr round([dict get $grid_data layers $lay pitch] * $def_units)]
+	    set loffset($lay)   [expr round([dict get $grid_data layers $lay offset] * $def_units)]
+	    set boffset($lay)   [expr round([dict get $grid_data layers $lay offset] * $def_units)]
         }
 
         ## Power nets
-        set ::row_index 1
-        foreach pwr_net $::power_nets {
-	        set tag "POWER"
-	        generate_stripes_vias $tag $pwr_net $grid_data
+        ## puts "Power straps"
+        foreach pwr_net [dict get $design_data power_nets] {
+	    set tag "POWER"
+	    generate_stripes_vias $tag $pwr_net $grid_data
         }
         ## Ground nets
-        foreach gnd_net $::ground_nets {
-	        set tag "GROUND"
-	        generate_stripes_vias $tag $gnd_net $grid_data
+        ## puts "Ground straps"
+        foreach gnd_net [dict get $design_data ground_nets] {
+	    set tag "GROUND"
+	    generate_stripes_vias $tag $gnd_net $grid_data
         }
 
     }
 
-    proc power_grid {} {
+    proc select_instance_specification {instance} {
         variable design_data
         variable instances
+
+        set macro_specifications [dict get $design_data grid macro]
         
+        # If there is a specifcation that matches this instance name, use that
+        foreach specification $macro_specifications {
+            if {![dict exists $specification instance]} {continue}
+            if {[dict get $specification instance] == $instance} {
+                return $specification
+            }
+        }
+        
+        # If there is a specification that matches this macro name, use that
+        if {[dict exists $instances $instance]} {
+            set instance_macro [dict get $instances $instance macro]
+
+            # If there are orientation based specifcations for this macro, use the appropriate one if available
+            foreach spec $macro_specifications {
+                if {!([dict exists $spec macro] && [dict get $spec orient] && [dict get $spec macro] == $instance_macro)} {continue}
+                if {[lsearch [dict get $spec orient] [dict get $instances $instance orient]] != -1} {
+                    return $spec
+                }
+            }
+        
+            # There should only be one macro specific spec that doesnt have an orientation qualifier
+            foreach spec $macro_specifications {
+                if {!([dict exists $spec macro] && [dict get $spec macro] == $instance_macro)} {continue}
+                if {[lsearch [dict get $spec orient] [dict get $instances $instance orient]] != -1} {
+                    return $spec
+                }
+            }
+
+            # If there are orientation based specifcations, use the appropriate one if available
+            foreach spec $macro_specifications {
+                if {!(![dict exists $spec macro] && ![dict exists $spec instance] && [dict exists $spec orient])} {continue}
+                if {[lsearch [dict get $spec orient] [dict get $instances $instance orient]] != -1} {
+                    return $spec
+                }
+            }
+        }
+
+        # There should only be one macro specific spec that doesnt have an orientation qualifier
+        foreach spec $macro_specifications {
+            if {!(![dict exists $spec macro] && ![dict exists $spec instance])} {continue}
+            return $spec
+        }
+
+        error "Error: no matching grid specification found for $instance"
+    }
+    
+    proc get_instance_specification {instance} {
+        variable instances
+
+        set specification [select_instance_specification $instance]
+
+        if {![dict exists $specification blockage]} {
+            dict set specification blockage {}
+        }
+        dict set specification area [dict get $instances $instance macro_boundary]
+        
+        return $specification
+    }
+    
+    proc init_metal_layers {} {
+        variable tech
+        variable metal_layers
+        variable metal_layers_dir
+
+        set metal_layers {}        
+        set metal_layers_dir {}
+        
+        foreach layer [$tech getLayers] {
+            if {[$layer getType] == "ROUTING"} {
+                lappend metal_layers [$layer getName]
+                lappend metal_layers_dir [$layer getDirection]
+            }
+        }
+    }
+
+    proc get_instance_llx {instance} {
+        variable instances
+        return [lindex [dict get $instances $instance halo_boundary] 0]
+    }
+    
+    proc get_instance_lly {instance} {
+        variable instances
+        return [lindex [dict get $instances $instance halo_boundary] 1]
+    }
+    
+    proc get_instance_urx {instance} {
+        variable instances
+        return [lindex [dict get $instances $instance halo_boundary] 2]
+    }
+    
+    proc get_instance_ury {instance} {
+        variable instances
+        return [lindex [dict get $instances $instance halo_boundary] 3]
+    }
+    
+    proc get_macro_blockage_layers {instance} {
+        variable metal_layers
+        
+        set specification [select_instance_specification $instance]
+        if {[dict exists $specification blockage]} {
+            return [dict get $specification blockage]
+        }
+        return [lrange $metal_layers 0 3]
+    }
+    
+    proc print_strategy {type specification} {
+        puts "Type: $type"
+        if {[dict exists $specification rails]} {
+            puts "    Follow Pins Layer: [dict get $specification rails]"
+        }
+        if {[dict exists $specification instance]} {
+            puts "    Instance: [dict get $specification orient]"
+        }
+        if {[dict exists $specification macro]} {
+            puts "    Macro: [dict get $specification orient]"
+        }
+        if {[dict exists $specification orient]} {
+            puts "    Macro orientation: [dict get $specification orient]"
+        }
+        dict for {layer_name layer} [dict get $specification layers] {
+            puts [format "    Layer: %s, Width: %f Pitch: %f Offset: %f" $layer_name [dict get $layer width]  [dict get $layer pitch] [dict get $layer offset]]
+        }
+        puts "    Connect: [dict get $specification connect]"
+    }
+    
+    proc plan_grid {} {
+        variable design_data
+        variable instances
+        variable default_grid_data
+        variable def_units
+
         ################################## Main Code #################################
 
-        set def_units [dict get $design_data config def_units]
         puts "****** INFO ******"
+        foreach specification [dict get $design_data grid stdcell] {
+            print_strategy stdcell $specification
+        }
+        foreach specification [dict get $design_data grid macro] {
+            print_strategy macro $specification
+        }
         puts "**** END INFO ****"
 
         foreach specification [dict get $design_data grid stdcell] {
-            dict set specification blockage [get_macro_halo_boundaries]
+            if {[dict exists $specification name]} {
+                puts "Inserting stdcell grid - [dict get $specification name]"
+            } else {
+                puts "Inserting stdcell grid"
+            }
+            dict set specification blockage [dict keys $instances]
             if {![dict exists $specification area]} {
-                dict set specification area [lmap x [list $::core_area_llx $::core_area_lly $::core_area_urx $::core_area_ury] {expr $x * $::def_units}]
+                dict set specification area [dict get $design_data config core_area]
             }
             pdn add_grid $specification
         }
         
-        foreach instance [dict keys $instances] {
-            foreach specification [dict get $design_data grid macro] {
-                if {![dict exists $specification blockage]} {
-                    dict set specification blockage {}
-                }
-                if {[dict exists $specification instance]} {
-                    if {$instance == [dict get $specification instance]} {
-                        dict set specification area [lmap x [dict get $instances $instance macro_boundary] {expr $x * $::def_units}]
-                        pdn add_grid $specification
-                        break
-                    }
-                } elseif {[dict exists $specification macro]} {
-                    if {[dict get $instances $instance macro] == [dict get $specification macro]} {
-                        dict set specification area [lmap x [dict get $instances $instance macro_boundary] {expr $x * $::def_units}]
-                        pdn add_grid $specification
-                        break
-                    }
-                } else {
-                    dict set specification area [lmap x [dict get $instances $instance macro_boundary] {expr $x * $::def_units}]
-                    pdn add_grid $specification
-                    break
-                }
+        if {[llength [dict keys $instances]] > 0} {
+            puts "Inserting macro grid for [llength [dict keys $instances]] macros"
+            foreach instance [dict keys $instances] {
+                pdn add_grid [get_instance_specification $instance]
             }
         }
     }
     
-    namespace export init get_memory_instance_pg_pins 
-    namespace export specify_grid power_grid add_grid get
+    proc opendb_update_grid {} {
+        puts "Writing to database"
+        write_opendb_vias
+        write_opendb_specialnets
+        write_opendb_rows
+    }
+        
+    proc apply {block config} {
+        pdn init $block $config
+
+        puts "##Power Delivery Network Generator: Generating PDN DEF"
+#         set ::start_time [clock clicks -milliseconds]
+
+        pdn plan_grid
+        opendb_update_grid
+
+#        puts "Total walltime to generate PDN DEF = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
+    }
+
+    namespace export init apply get_memory_instance_pg_pins opendb_update_grid set_core_area
+    namespace export specify_grid plan_grid add_grid get
     namespace ensemble create
 }
 
-package provide pdn 0.1.0
+package provide pdn 0.3.0
diff --git a/scripts/pdn/src/scripts/def_gen b/scripts/pdn/src/scripts/def_gen
deleted file mode 100755
index b876274..0000000
--- a/scripts/pdn/src/scripts/def_gen
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/usr/bin/perl
-use Cwd;
-$pre_def = $ARGV[0];
-$pdn_def = $ARGV[1];
-$design = $ARGV[2];
-$output_def = $ARGV[3];
-$wd = cwd;
-
-print "Input DEF file is $pre_def\n";
-print "PDN special nets DEF file is $pdn_def\n";
-print "Output merged DEF file in current work dir is $output_def\n";
-
-if (-e $pre_def) {
-
-    open(FP1,$pre_def);
-    open(FP3,$pdn_def);
-    
-
-    
-    open(OP1,">$output_def");
-    $flag = 0;
-    $vflag = 0;
-    @slines = ();
-    @slines = ();
-    @rlines = ();
-
-    ## to get rows, special nets and vias
-    while(<FP3>) {
-        if ($_ =~m/^VIAS/) {
-            $vflag = 1;
-
-        }
-
-        if ($vflag == 1) {
-            push(@vlines,$_);
-            ##print "$_";
-        }
-
-        if ($_ =~m/^END VIAS/) {
-            $vflag = 0;
-
-        }
-
-
-        if ($_ =~m/^SPECIALNETS/) {
-            $flag = 1;
-
-        }
-
-
-        if ($flag == 1) {
-            if ($_ !~m/^$/) {
-                push (@slines,$_);
-            }
-
-        }
-
-        if ($_ =~m/^END SPECIALNETS/) {
-            $flag = 0;
-
-        }
-
-        if ($_ =~m/^ROW/) {
-            $rflag = 1;
-
-        }
-        if ($_ =~m/^END DESIGN/) {
-            $rflag = 0;
-
-        }   
-
-        if ($rflag == 1) {
-            if ($_ !~m/^$/) {
-                push (@rlines,$_);
-            }
-
-        }
-    }
-    close(FP3);
-
-    $comp = 0;
-    $net = 0;
-    $n_flag = 0;
-    while(<FP1>) {
-        ##print "@macro_array\n";
-        if ($_ !~m/^$/ ) {
-            ##print "$_";
-            @cur = split(/\s+/,$_);
-            $temp = $cur[2];
-            ##print "Third element is $cur[2] and macro hash is $macro_hash{$cur[2]} \n";
-            if ($_ =~m/^ROW/) {
-                ##printf OP1 "$_";
-                $n_flag = 1;
-                ##print "Does not match ----- \n";
-            }
-
-            if ($n_flag == 0) {
-                      printf OP1 "$_";
-              #print "$_";
-            }
-
-
-            if ($n_flag ==  1 && $_ =~m/ ;/) {
-              #next;
-              $n_flag = 0;
-            }
-        }
-
-        if ($_ =~m/^DIEAREA/) {
-            ##printf OP1 "@vlines";
-            foreach $elem0 (@vlines) {
-                printf OP1 "$elem0";
-            }
-            foreach $elem3 (@rlines) {
-                printf OP1 "$elem3";
-            }
-        }
-
-        if ($_ =~m/^END PINS/) {
-            $net = 1;
-        }
-
-        if ($net == 1) {
-            ##printf OP1 "@slines";
-            foreach $elem2 (@slines) {
-                printf OP1 "$elem2";
-            }
-
-            $net = 0;
-        }
-    }
-
-    close(FP1);
-    close(OP1); 
-
-}
-
-
diff --git a/scripts/pdn/src/scripts/def_writer.tcl b/scripts/pdn/src/scripts/def_writer.tcl
deleted file mode 100755
index a164276..0000000
--- a/scripts/pdn/src/scripts/def_writer.tcl
+++ /dev/null
@@ -1,315 +0,0 @@
-namespace eval ::pdn {
-    variable defOut
-    
-    proc open_def {file_name} {
-        variable defOut
-        set defOut [open $file_name w]
-    }
-    
-    proc close_def {} {
-        variable defOut
-        close $defOut
-    }
-    
-    proc def_out {args} {
-        variable defOut
-        
-        if {[llength $args] == 2} {
-            puts [lindex $args 0] $defOut [lindex $args 1]
-        } else {
-            puts $defOut [lindex $args 0]
-        }
-    }
-    
-    proc def_header {config} {
-        set def_units [dict get $config def_units]
-        
-        def_out "###############################################################"
-        def_out "# Created by apply_pdn script"
-        def_out "# Created on: [clock format [clock seconds] -format {%A, the %d of %B, %Y}]"
-        def_out "###############################################################"
-
-        def_out "VERSION 5.8 ;"
-        def_out "DIVIDERCHAR \"/\" ;"
-        def_out "BUSBITCHARS \"\[\]\" ;"
-        def_out "DESIGN [dict get $config design] ;"
-        def_out "UNITS DISTANCE MICRONS $def_units ;"
-        def_out ""
-
-        set die_area_llx [expr [lindex [dict get $config die_area] 0] * $def_units]
-        set die_area_lly [expr [lindex [dict get $config die_area] 1] * $def_units]
-        set die_area_urx [expr [lindex [dict get $config die_area] 2] * $def_units]
-        set die_area_ury [expr [lindex [dict get $config die_area] 3] * $def_units]
-
-        def_out "PROPERTYDEFINITIONS 
-            DESIGN FE_CORE_BOX_LL_X REAL [lindex [dict get $config core_area] 0] ;
-            DESIGN FE_CORE_BOX_UR_X REAL [lindex [dict get $config core_area] 1] ;
-            DESIGN FE_CORE_BOX_LL_Y REAL [lindex [dict get $config core_area] 2] ;
-            DESIGN FE_CORE_BOX_UR_Y REAL [lindex [dict get $config core_area] 3] ;
-        END PROPERTYDEFINITIONS"
-
-        def_out ""
-        def_out "DIEAREA ( [expr round($die_area_llx)] [expr round($die_area_lly)] ) ( [expr round($die_area_urx)] [expr round($die_area_ury)] ) ;"
-
-        ##### Generating via rules
-        generate_viarules
-    }
-    
-    proc write_vias {net_name} {
-        foreach via $::vias {
-            if {[dict get $via net_name] == $net_name} {
-                set connect [dict get $via connections]
-                set i1 [dict get $connect layer1]
-                set i2 [dict get $connect layer2]
-                set viarules [dict get $connect rules]
-                
-                set intersections [dict get $connect intersections]
-
-                set layer1 [dict get $connect layer1]
-                regexp {(.*)_PIN} [dict get $connect layer1] - layer1 
-
-                set layer2 [dict get $connect layer2]
-                set i1 [lsearch $::met_layer_list $layer1]
-                set i2 [lsearch $::met_layer_list $layer2]
-                if {$i1 == -1} {puts "Layer1 [dict get $connect layer1], Layer2 $layer2"; exit -1}
-                if {$i2 == -1} {puts "Layer1 [dict get $connect layer1], Layer2 $layer2"; exit -1}
-	        # For each layer between l1 and l2, add vias at the intersection
-	        for {set i $i1} {$i < $i2} {incr i} {
-		    set lay [lindex $::met_layer_list $i]
-		    set rule [lindex $viarules $i]
-		    foreach loc $intersections {
-		        def_out "    NEW $lay 0 + SHAPE STRIPE ( [expr round([lindex $loc 0])] [expr round([lindex $loc 1])] ) $rule"
-		    }
-	        }
-            }
-        }
-    }
-
-    ##proc to create fragments rows based on macros (blockages)
-
-    proc init_orientation {height} {
-        variable lowest_rail
-        variable orient_rows
-        
-        set lowest_rail $height
-        if {$::rails_start_with == "GROUND"} {
-            set orient_rows {0 "N" 1 "FS"}
-        } else {
-            set orient_rows {0 "FS" 1 "N"}
-        }
-    }
-
-    proc orientation {height} {
-        variable lowest_rail
-        variable orient_rows
-        
-        set row_line [expr int(($height - $lowest_rail) / $::row_height)]
-        return [dict get $orient_rows [expr $row_line % 2]]
-    }
-        
-    proc write_row {height start end} {
-        set start  [expr int($start)]
-        set height [expr int($height)]
-        set end    [expr int($end)]
-
-        if {$start == $end} {return}
-	set site_width [expr {int(round($::site_width * $::def_units))}]
-	if {[expr { int($start - ($::core_area_llx * $::def_units)) % $site_width}] == 0} {
-		set x $start
-
-	} else {
-		set offset [expr { int($start - ($::core_area_llx * $::def_units)) % $site_width}]
-		set x [expr {$start + $site_width - $offset}]
-
-	}
-
-	set num  [expr {($end - $x)/$site_width}]
-        def_out "ROW ROW_$::row_index $::site_name $x $height [orientation $height] DO $num BY 1 STEP $site_width 0 ;"
-        
-        incr ::row_index
-    }
-
-    proc write_rows {} {
-        set stripes [concat $::stripe_locs($::rails_mlayer,POWER) $::stripe_locs($::rails_mlayer,GROUND)]
-        set stripes [lmap x $stripes {expr {[lindex $x 0] == [lindex $x 2] ? [continue] : $x}}]
-        set stripes [lsort -real -index 1 $stripes]
-        set heights [lsort -unique -real [lmap x $stripes {lindex $x 1}]]
-
-        init_orientation [lindex $heights 0]
-
-	foreach height [lrange $heights 0 end-1] {
-            set lower_rails [lsort -real -index 2 [lmap x $stripes {expr {[lindex $x 1] == $height ? $x : [continue] }}]]
-            set lower_rails [lmap x $lower_rails {expr {[lindex $x 0] == [lindex $x 2] ? [continue] : $x}}]
-            set upper_rails [lsort -real -index 2 [lmap x $stripes {expr {[lindex $x 1] == $height + $::row_height ? $x : [continue] }}]]
-            set upper_rails [lmap x $upper_rails {expr {[lindex $x 0] == [lindex $x 2] ? [continue] : $x}}]
-            set upper_extents [concat {*}[lmap x $upper_rails {list [lindex $x 0] [lindex $x 2]}]]
-
-            foreach lrail $lower_rails {
-                set idx 0
-                set start [lindex $lrail 0]
-                set end   [lindex $lrail 2]
-
-                # Find index of first number that is greater than the start position of this rail
-                while {$idx < [llength $upper_extents]} {
-                    if {[lindex $upper_extents $idx] > $start} {
-                        break
-                    }
-                    incr idx
-                }
-
-                if {[lindex $upper_extents $idx] <= $start} {
-                    continue
-                }
-
-                if {$idx % 2 == 0} {
-                    # If the index is even, then the start of the rail has no matching rail above it
-                    set row_start [lindex $upper_extents $idx]
-                    incr idx
-                } else {
-                    # If the index is odd, then the start of the rail has matchin rail above it
-                    set row_start $start
-                }
-
-                if {$end <= [lindex $upper_extents $idx]} {
-                    write_row $height $row_start $end
-                    
-                }
-
-                while {$idx < [llength $upper_extents] && $end > [lindex $upper_extents [expr $idx + 1]]} {
-                    write_row $height $row_start [lindex $upper_extents $idx]
-                    set row_start [lindex $upper_extents [expr $idx + 1]]
-                    set idx [expr $idx + 2]
-                }
-            }
-        }
-    }
-
-    #proc to write special nets in the output def file, for each layer and each domains, 
-    proc write_def {lay tag} {
-        set dir [get_dir $lay]
-        
-	    if {$dir == "hor"} {
-		    foreach l_str $::stripe_locs($lay,$tag) {
-			    set l1 [expr round([lindex $l_str 0])]
-			    set l2 [expr round([lindex $l_str 1])]
-			    set l3 [expr round([lindex $l_str 2])]
-                            if {$l1 == $l3} {continue}
-			    if {$lay == $::rails_mlayer} {
-				    if {$::seg_count == 1 } {
-					    def_out "    $lay [expr round($::widths($lay))] + SHAPE FOLLOWPIN ( $l1 $l2 ) ( $l3 * )"
-					    set ::seg_count 2
-				    } else {
-					    def_out "    NEW $lay [expr round($::widths($lay))] + SHAPE FOLLOWPIN ( $l1 $l2 ) ( $l3 * )"
-					    set ::seg_count 2
-				    }
-			    } else {
-				    if {$::seg_count == 1 } {
-					    def_out "    $lay [expr round($::widths($lay))] + SHAPE STRIPE ( $l1 $l2 ) ( $l3 * )"
-					    set ::seg_count 2
-				    } else {
-					    def_out "    NEW $lay [expr round($::widths($lay))] + SHAPE STRIPE ( $l1 $l2 ) ( $l3 * )"
-					    set ::seg_count 2
-				    }
-			    }
-
-		    }
-
-	    } elseif {$dir == "ver"} {
-		    foreach l_str $::stripe_locs($lay,$tag) {
-			    set l1 [expr round([lindex $l_str 0])]
-			    set l2 [expr round([lindex $l_str 1])]
-			    set l3 [expr round([lindex $l_str 2])]
-                            if {$l2 == $l3} {continue}
-			    if {$lay == $::rails_mlayer} {
-				    if {$::seg_count == 1 } {
-					    def_out "    $lay [expr round($::widths($lay))] + SHAPE FOLLOWPIN ( $l1 $l2 ) ( * $l3 )"
-					    set ::seg_count 2
-				    } else {
-					    def_out "    NEW $lay [expr round($::widths($lay))] + SHAPE FOLLOWPIN ( $l1 $l2 ) ( * $l3 )"	
-					    set ::seg_count 2
-				    }
-			    } else {
-				    if {$::seg_count == 1 } {
-					    def_out "    $lay [expr round($::widths($lay))] + SHAPE STRIPE ( $l1 $l2 ) ( * $l3 )"
-					    set ::seg_count 2
-				    } else {
-					    def_out "    NEW $lay [expr round($::widths($lay))] + SHAPE STRIPE ( $l1 $l2 ) ( * $l3 )"
-					    set ::seg_count 2
-				    }
-			    }
-		    }		
-
-	    }
-
-
-    }
-
-
-
-    proc output_def {} {
-        variable design_data
-        
-        #####
-        # Start writing to the DEF file
-        open_def [dict get $design_data config def_output]
-
-        def_header [dict get $design_data config]
-
-        ##### Generating the SPECIALNETS header
-
-        set size_of_pg_nets [expr {[llength $::power_nets] + [llength $::ground_nets]}]
-        def_out "\nSPECIALNETS $size_of_pg_nets ;"
-        foreach net_name $::power_nets {
-            set tag "POWER"
-            def_out -nonewline "- $net_name  ( * $net_name )"
-            foreach pin_name $::macro_power_pins {
-                def_out -nonewline " ( * $pin_name )"
-            }
-            def_out ""
-            
-            def_out -nonewline "  + ROUTED " 
-
-            set ::seg_count 1
-            foreach lay $::met_layer_list {
-                write_def $lay $tag	
-            }
-            write_vias $net_name
-            def_out "  + USE $tag\n ;"
-        }
-
-        foreach net_name $::ground_nets {
-            set tag "GROUND"
-            def_out -nonewline "- $net_name  ( * $net_name )"
-            foreach pin_name $::macro_ground_pins {
-                def_out -nonewline " ( * $pin_name )"
-            }
-            def_out ""
-            def_out -nonewline "  + ROUTED " 
-
-            set ::seg_count 1
-            foreach lay $::met_layer_list {
-                write_def $lay $tag	
-            }
-            write_vias $net_name
-            def_out "  + USE $tag\n ;"
-        }
-        def_out "\nEND SPECIALNETS"
-
-        write_rows
-        def_out "\nEND DESIGN"
-
-        close_def
-
-        puts "Total walltime = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds"
-        puts [dict get $design_data config def_output]
-        if {[catch {glob [dict get $design_data config def_output]}]} {
-          puts "ERROR: Could not generate PDN DEF ..."
-          puts "Exiting..."
-          exit
-        } else {
-          puts "###PASSED PDN DEF creation ....."
-        }
-    }
-    
-    namespace export output_def def_out
-}
diff --git a/scripts/pdn/src/scripts/gen_blockage.tcl b/scripts/pdn/src/scripts/gen_blockage.tcl
old mode 100755
new mode 100644
index b6927f4..9c06e0b
--- a/scripts/pdn/src/scripts/gen_blockage.tcl
+++ b/scripts/pdn/src/scripts/gen_blockage.tcl
@@ -2,16 +2,6 @@
     variable macros {}
     variable instances {}
     
-    proc write_macrocell_list {file_name} {
-        variable macros
-        
-        set ch [open $file_name "w"]
-        foreach macro_name [dict keys $macros] {
-            puts $ch $macro_name
-        }
-        close $ch
-    }
-    
     proc get_macro_boundaries {} {
         variable instances
 
@@ -34,114 +24,89 @@
         return $boundaries
     }
     
-    proc read_macro_boundaries {def lef_files} {
+    proc read_macro_boundaries {} {
+        variable libs
         variable macros
         variable instances
-        
-        foreach file $lef_files {
-            set ch [open $file]
 
-            while {![eof $ch]} {
-                set line [gets $ch]
+        foreach lib $libs {
+            foreach cell [$lib getMasters] {
+                if {[$cell getType] == "CORE"} {continue}
+                if {[$cell getType] == "IO"} {continue}
+                if {[$cell getType] == "PAD"} {continue}
+                if {[$cell getType] == "PAD_SPACER"} {continue}
+                if {[$cell getType] == "SPACER"} {continue}
+                if {[$cell getType] == "NONE"} {continue}
+                if {[$cell getType] == "ENDCAP_PRE"} {continue}
+                if {[$cell getType] == "ENDCAP_BOTTOMLEFT"} {continue}
+                if {[$cell getType] == "ENDCAP_BOTTOMRIGHT"} {continue}
+                if {[$cell getType] == "ENDCAP_TOPLEFT"} {continue}
+                if {[$cell getType] == "ENDCAP_TOPRIGHT"} {continue}
+                if {[$cell getType] == "ENDCAP"} {continue}
+                if {[$cell getType] == "CORE_SPACER"} {continue}
+                if {[$cell getType] == "CORE_TIEHIGH"} {continue}
+                if {[$cell getType] == "CORE_TIELOW"} {continue}
 
-                if {[regexp {^s*MACRO ([^\s]*)} $line - macro_name]} {
-                    set reject 0
-                    while {![eof $ch]} {
-                        set line [gets $ch]
-                        if {[regexp "END $macro_name" $line]} {
-                            break
-                        }
-                        if {[regexp {^\s*CLASS CORE} $line]} {set reject 1}
-                        if {[regexp {^\s*CLASS IO} $line]} {set reject 1}
-                        if {[regexp {^\s*CLASS ENDCAP} $line]} {set reject 1}
-                        if {$reject == 1} {break}
-
-                        regexp {^\s*SIZE ([0-9\.]*) BY ([0-9\.]*)} $line - width height
-                    }
-                    if {$reject == 0} {
-                        dict set macros $macro_name [list width $width height $height]
-                    }
-                }
-            }
-            close $ch
-        }
-
-        set ch [open $def]
-        while {![eof $ch]} {
-            set line [gets $ch]
-
-            regexp {UNITS DISTANCE MICRONS ([0-9]*)} $line - dbu
-
-            if {[regexp {^COMPONENTS [0-9]*} $line]} {
-                set instances [read_def_components $ch [dict keys $macros]]
+                dict set macros [$cell getName] [list \
+                    width  [$cell getWidth] \
+                    height [$cell getHeight] \
+                ]
             }
         }
-        close $ch
 
-        set macro_boundaries {}
+        set instances [read_def_components [dict keys $macros]]
+
         foreach instance [dict keys $instances] {
             set macro_name [dict get $instances $instance macro]
-            set width  [expr [dict get $macros $macro_name width] * $dbu]
-            set height [expr [dict get $macros $macro_name height] *$dbu]
 
-            set llx [dict get $instances $instance x]
-            set lly [dict get $instances $instance y]
+            set llx [dict get $instances $instance xmin]
+            set lly [dict get $instances $instance ymin]
+            set urx [dict get $instances $instance xmax]
+            set ury [dict get $instances $instance ymax]
 
-            set orient [dict get $instances $instance orient]    
-            if {$orient == "N" || $orient == "FN" || $orient == "S" || $orient == "FS"} { 
-                set urx [expr $llx + $width]
-                set ury [expr $lly + $height]
-            } elseif {$orient == "W" || $orient == "FW" || $orient == "E" || $orient == "FE"} { 
-                set urx [expr $llx + $height]
-                set ury [expr $lly + $width]
-            }
-
-            dict set instances $instance macro_boundary [lmap x [list $llx $lly $urx $ury] {expr $x * 1.0 / $dbu}]
+            dict set instances $instance macro_boundary [list $llx $lly $urx $ury]
 
             set halo [dict get $instances $instance halo]
-            set llx [expr $llx - [lindex $halo 0]]
-            set lly [expr $lly - [lindex $halo 1]]
-            set urx [expr $urx + [lindex $halo 2]]
-            set ury [expr $ury + [lindex $halo 3]]
+            set llx [expr round($llx - [lindex $halo 0])]
+            set lly [expr round($lly - [lindex $halo 1])]
+            set urx [expr round($urx + [lindex $halo 2])]
+            set ury [expr round($ury + [lindex $halo 3])]
 
-            dict set instances $instance halo_boundary [lmap x [list $llx $lly $urx $ury] {expr $x * 1.0 / $dbu}]
+            dict set instances $instance halo_boundary [list $llx $lly $urx $ury]
         }
-
-        return $macro_boundaries
     }
 
-    proc read_def_components {ch macros} {
+    proc read_def_components {macros} {
         variable design_data
+        variable block
         set instances {}
 
-        while {![eof $ch]} {
-            set line [gets $ch]
-
-            if {[regexp {END COMPONENTS} $line]} {
-                return $instances
-            }
-
-            while {![regexp {;} $line]} {
-                set line "$line [gets $ch]"
-            }
-
-            set macro_name [lindex $line 2]
+        foreach inst [$block getInsts] {
+            set macro_name [[$inst getMaster] getName]
             if {[lsearch $macros $macro_name] != -1} {
                 set data {}
-                if {[set idx [lsearch $line "FIXED"]] != -1} {
-                    dict set data macro $macro_name
-                    dict set data x [lindex $line [expr $idx + 2]]
-                    dict set data y [lindex $line [expr $idx + 3]]
-                    dict set data orient [lindex $line [expr $idx + 5]]
-                }
+                dict set data name [$inst getName]
+                dict set data macro $macro_name
+                dict set data x [lindex [$inst getOrigin] 0]
+                dict set data y [lindex [$inst getOrigin] 1]
+                dict set data xmin [[$inst getBBox] xMin]
+                dict set data ymin [[$inst getBBox] yMin]
+                dict set data xmax [[$inst getBBox] xMax]
+                dict set data ymax [[$inst getBBox] yMax]
+                dict set data orient [$inst getOrient]
 
-                if {[set idx [lsearch $line "HALO"]] != -1} {
-                    dict set data halo [lrange $line [expr $idx + 1] [expr $idx + 4]]
+                if {[$inst getHalo] != "NULL"} {
+                    dict set data halo [list \
+                        [[$inst getHalo] xMin] \
+                        [[$inst getHalo] yMin] \
+                        [[$inst getHalo] xMax] \
+                        [[$inst getHalo] yMax] \
+                    ]
                 } else {
                     dict set data halo [dict get $design_data config default_halo]
                 }
 
-                dict set instances [lindex $line 1] $data
+                dict set instances [$inst getName] $data
             }
         }
 
diff --git a/scripts/pdn/src/scripts/opendb_writer.tcl b/scripts/pdn/src/scripts/opendb_writer.tcl
new file mode 100644
index 0000000..8f5b691
--- /dev/null
+++ b/scripts/pdn/src/scripts/opendb_writer.tcl
@@ -0,0 +1,277 @@
+namespace eval ::pdn {
+    variable global_connections {
+        VDD {
+            {inst_name .* pin_name VDD}
+            {inst_name .* pin_name VDDPE}
+            {inst_name .* pin_name VDDCE}
+        }
+        VSS {
+            {inst_name .* pin_name VSS}
+            {inst_name .* pin_name VSSE}
+        }
+    }
+    
+    proc write_opendb_vias {} {
+        variable physical_viarules
+        variable block
+        variable tech
+
+        dict for {name rule} $physical_viarules {
+            set via [dbVia_create $block $name]
+            $via setViaGenerateRule [$tech findViaGenerateRule [dict get $rule rule]]
+            set params [$via getViaParams]
+            $params setBottomLayer [$tech findLayer [lindex [dict get $rule layers] 0]]
+            $params setCutLayer [$tech findLayer [lindex [dict get $rule layers] 2]]
+            $params setTopLayer [$tech findLayer [lindex [dict get $rule layers] 1]]
+            $params setXCutSize [lindex [dict get $rule cutsize] 0]
+            $params setYCutSize [lindex [dict get $rule cutsize] 1]
+            $params setXCutSpacing [lindex [dict get $rule cutspacing] 0]
+            $params setYCutSpacing [lindex [dict get $rule cutspacing] 1]
+            $params setXBottomEnclosure [lindex [dict get $rule enclosure] 0]
+            $params setYBottomEnclosure [lindex [dict get $rule enclosure] 1]
+            $params setXTopEnclosure [lindex [dict get $rule enclosure] 2]
+            $params setYTopEnclosure [lindex [dict get $rule enclosure] 3]
+            $params setNumCutRows [lindex [dict get $rule rowcol] 0]
+            $params setNumCutCols [lindex [dict get $rule rowcol] 1]
+
+            $via setViaParams $params
+        }
+    }
+
+    proc write_opendb_specialnet {net_name signal_type} {
+        variable block
+        variable instances
+        variable metal_layers
+        variable tech 
+        variable stripe_locs
+        variable widths
+        variable global_connections
+        
+        set net [$block findNet $net_name]
+        if {$net == "NULL"} {
+            set net [dbNet_create $block $net_name]
+        }
+        $net setSpecial
+        $net setSigType $signal_type
+
+        foreach inst [$block getInsts] {
+            set master [$inst getMaster]
+            foreach mterm [$master getMTerms] {
+                if {[$mterm getSigType] == $signal_type} {
+                    foreach pattern [dict get $global_connections $net_name] {
+                        if {[regexp [dict get $pattern inst_name] [$inst getName]] &&
+                            [regexp [dict get $pattern pin_name] [$mterm getName]]} {
+                            dbITerm_connect $inst $net $mterm
+                        }
+                    }
+                }
+            }
+            foreach iterm [$inst getITerms] {
+                if {[$iterm getNet] != "NULL" && [[$iterm getNet] getName] == $net_name} {
+                    $iterm setSpecial
+                }
+            }
+        }
+        $net setWildConnected
+        set swire [dbSWire_create $net "ROUTED"]
+
+        foreach lay $metal_layers {
+            set layer [$tech findLayer $lay]
+
+            set dir [get_dir $lay]
+            if {$dir == "hor"} {
+                foreach l_str $stripe_locs($lay,$signal_type) {
+                    set l1 [lindex $l_str 0]
+                    set l2 [lindex $l_str 1]
+                    set l3 [lindex $l_str 2]
+                    if {$l1 == $l3} {continue}
+                    if {$lay == [get_rails_layer]} {
+                        dbSBox_create $swire $layer [expr round($l1)] [expr round($l2 - ($widths($lay)/2))] [expr round($l3)] [expr round($l2 + ($widths($lay)/2))] "FOLLOWPIN"
+                    } else {
+                        dbSBox_create $swire $layer [expr round($l1)] [expr round($l2 - ($widths($lay)/2))] [expr round($l3)] [expr round($l2 + ($widths($lay)/2))] "STRIPE"
+                    }
+
+                }
+            } elseif {$dir == "ver"} {
+                foreach l_str $stripe_locs($lay,$signal_type) {
+                    set l1 [lindex $l_str 0]
+                    set l2 [lindex $l_str 1]
+                    set l3 [lindex $l_str 2]
+                    if {$l2 == $l3} {continue}
+                    if {$lay == [get_rails_layer]} {
+                        dbSBox_create $swire $layer [expr round($l1 - ($widths($lay)/2))] [expr round($l2)] [expr round($l1 + ($widths($lay)/2))] [expr round($l3)] "FOLLOWPIN"
+                    } else {
+                        dbSBox_create $swire $layer [expr round($l1 - ($widths($lay)/2))] [expr round($l2)] [expr round($l1 + ($widths($lay)/2))] [expr round($l3)] "STRIPE"
+                    }
+                }               
+            }
+        }
+
+        variable vias
+        foreach via $vias {
+            if {[dict get $via net_name] == $net_name} {
+	        # For each layer between l1 and l2, add vias at the intersection
+                foreach via_inst [dict get $via connections] {
+                    set via_name [dict get $via_inst name]
+                    set x        [dict get $via_inst x]
+                    set y        [dict get $via_inst y]
+                    set lay      [dict get $via_inst lower_layer]
+                    regexp {(.*)_PIN} $lay - lay
+                    set layer [$tech findLayer $lay]
+                    dbSBox_create $swire [$block findVia $via_name] $x $y "STRIPE"
+	        }
+            }
+        }
+    }
+        
+    proc write_opendb_specialnets {} {
+        variable block
+        variable design_data
+        
+        foreach net_name [dict get $design_data power_nets] {
+            write_opendb_specialnet "VDD" "POWER"
+        }
+
+        foreach net_name [dict get $design_data ground_nets] {
+            write_opendb_specialnet "VSS" "GROUND"
+        }
+        
+    }
+    
+    proc init_orientation {height} {
+        variable lowest_rail
+        variable orient_rows
+        variable rails_start_with
+
+        set lowest_rail $height
+        if {$rails_start_with == "GROUND"} {
+            set orient_rows {0 "R0" 1 "MX"}
+        } else {
+            set orient_rows {0 "MX" 1 "R0"}
+        }
+    }
+
+    proc orientation {height} {
+        variable lowest_rail
+        variable orient_rows
+        variable row_height
+        
+        set row_line [expr int(($height - $lowest_rail) / $row_height)]
+        return [dict get $orient_rows [expr $row_line % 2]]
+    }
+        
+    proc write_opendb_row {height start end} {
+        variable row_index
+        variable block
+        variable site
+        variable site_width
+        variable def_units
+        variable design_data
+        
+        set start  [expr int($start)]
+        set height [expr int($height)]
+        set end    [expr int($end)]
+
+        if {$start == $end} {return}
+        
+        set llx [lindex [dict get $design_data config core_area] 0]
+	if {[expr { int($start - $llx) % $site_width}] == 0} {
+		set x $start
+	} else {
+		set offset [expr { int($start - $llx) % $site_width}]
+		set x [expr {$start + $site_width - $offset}]
+	}
+
+	set num  [expr {($end - $x)/$site_width}]
+        
+        dbRow_create $block ROW_$row_index $site $x $height [orientation $height] "HORIZONTAL" $num $site_width
+        incr row_index
+    }
+
+    proc write_opendb_rows {} {
+        variable stripe_locs
+        variable row_height
+        variable row_index
+
+        set row_index 1
+        
+        set stripes [concat $stripe_locs([get_rails_layer],POWER) $stripe_locs([get_rails_layer],GROUND)]
+        set new_stripes {}
+        foreach stripe $stripes {
+            if {[lindex $stripe 0] != [lindex $stripe 2]} {
+                lappend new_stripes $stripe
+            }
+        }
+        set stripes $new_stripes
+        set stripes [lsort -real -index 1 $stripes]
+        set heights {}
+        foreach stripe $stripes {
+            lappend heights [lindex $stripe 1]
+        }
+        set heights [lsort -unique -real $heights]
+
+        init_orientation [lindex $heights 0]
+
+	foreach height [lrange $heights 0 end-1] {
+            set rails {}
+            foreach stripe $stripes {
+                if {[lindex $stripe 1] == $height} {
+                    lappend rails $stripe
+                }
+            }
+            set lower_rails [lsort -real -index 2 $rails]
+            set rails {}
+            foreach stripe $stripes {
+                if {[lindex $stripe 1] == ($height + $row_height)} {
+                    lappend rails $stripe
+                }
+            }
+            set upper_rails [lsort -real -index 2 $rails]
+            set upper_extents {}
+            foreach upper_rail $upper_rails {
+                lappend upper_extents [lindex $upper_rail 0]
+                lappend upper_extents [lindex $upper_rail 2]
+            }
+
+            foreach lrail $lower_rails {
+                set idx 0
+                set start [lindex $lrail 0]
+                set end   [lindex $lrail 2]
+
+                # Find index of first number that is greater than the start position of this rail
+                while {$idx < [llength $upper_extents]} {
+                    if {[lindex $upper_extents $idx] > $start} {
+                        break
+                    }
+                    incr idx
+                }
+
+                if {[lindex $upper_extents $idx] <= $start} {
+                    continue
+                }
+
+                if {$idx % 2 == 0} {
+                    # If the index is even, then the start of the rail has no matching rail above it
+                    set row_start [lindex $upper_extents $idx]
+                    incr idx
+                } else {
+                    # If the index is odd, then the start of the rail has matchin rail above it
+                    set row_start $start
+                }
+
+                if {$end <= [lindex $upper_extents $idx]} {
+                    write_opendb_row $height $row_start $end
+                    
+                } else {
+                    while {$idx < [llength $upper_extents] && $end > [lindex $upper_extents [expr $idx + 1]]} {
+                        write_opendb_row $height $row_start [lindex $upper_extents $idx]
+                        set row_start [lindex $upper_extents [expr $idx + 1]]
+                        set idx [expr $idx + 2]
+                    }
+                }
+            }
+        }
+    }
+
+    namespace export write_opendb_vias write_opendb_specialnets write_opendb_rows    
+}
diff --git a/scripts/pdn/src/scripts/pg_grid_procs.tcl b/scripts/pdn/src/scripts/pg_grid_procs.tcl
index 9676e7f..2769250 100755
--- a/scripts/pdn/src/scripts/pg_grid_procs.tcl
+++ b/scripts/pdn/src/scripts/pg_grid_procs.tcl
@@ -1,14 +1,319 @@
 namespace eval ::pdn {
 
+    variable logical_viarules {}
+    variable physical_viarules {}
+    variable vias {}
+    variable stripe_locs
+    variable orig_stripe_locs
+    variable layers {}
+    
 #This file contains procedures that are used for PDN generation
 
-proc get_dir {layer_name} {
-    set idx [lsearch $::met_layer_list $layer_name]
-    return [lindex $::met_layer_dir $idx]
-}
+    proc get_dir {layer_name} {
+        variable metal_layers 
+        variable metal_layers_dir 
+        if {[regexp {.*_PIN_(hor|ver)} $layer_name - dir]} {
+            return $dir
+        }
+        
+        set idx [lsearch $metal_layers $layer_name]
+        if {[lindex $metal_layers_dir $idx] == "HORIZONTAL"} {
+            return "hor"
+        } else {
+            return "ver"
+        }
+    }
+    
+    proc get_rails_layer {} {
+        variable default_grid_data
+        
+        return [dict get $default_grid_data rails]
+    }
+
+    proc init_via_tech {} {
+        variable tech
+        variable def_via_tech
+        
+        set def_via_tech {}
+        foreach via_rule [$tech getViaGenerateRules] {
+            set lower [$via_rule getViaLayerRule 0]
+            set upper [$via_rule getViaLayerRule 1]
+            set cut   [$via_rule getViaLayerRule 2]
+
+	    dict set def_via_tech [$via_rule getName] [list \
+                lower [list layer [[$lower getLayer] getName] enclosure [$lower getEnclosure]] \
+                upper [list layer [[$upper getLayer] getName] enclosure [$upper getEnclosure]] \
+                cut   [list layer [[$cut getLayer] getName] spacing [$cut getSpacing] size [list [[$cut getRect] dx] [[$cut getRect] dy]]] \
+            ]
+        }
+    }
+    
+    proc select_viainfo {lower} {
+        variable def_via_tech
+
+        set layer_name $lower
+        regexp {(.*)_PIN} $lower - layer_name
+        
+        return [dict filter $def_via_tech script {rule_name rule} {expr {[dict get $rule lower layer] == $layer_name}}]
+    }
+    
+    proc set_layer_info {layer_info} {
+        variable layers
+        
+        set layers $layer_info
+    }
+    
+    proc get_layer_info {} {
+        variable layers 
+        
+        return $layers
+    }
+    
+    # Layers that have a widthtable will only support some width values, the widthtable defines the 
+    # set of widths that are allowed, or any width greater than or equal to the last value in the
+    # table
+    proc get_adjusted_width {layer width} {
+        set layers [get_layer_info]
+        
+        if {[dict exists $layers $layer] && [dict exists $layers $layer widthtable]} {
+            set widthtable [dict get $layers $layer widthtable]
+            if {[lsearch $widthtable $width] > 0} {
+                return $width
+            } elseif {$width > [lindex $widthtable end]} {
+                return $width
+            } else {
+                foreach value $widthtable {
+                    if {$value > $width} {
+                        return $value
+                    }
+                }
+            }
+        }
+        
+        return $width
+    }
+    
+    # Given the via rule expressed in via_info, what is the via with the largest cut area that we can make
+    proc get_via_option {lower_dir rule_name via_info x y width height} {
+        set cut_width  [lindex [dict get $via_info cut size] 0]
+        set cut_height [lindex [dict get $via_info cut size] 1]
+
+        # Adjust the width and height values to the next largest allowed value if necessary
+        set lower_width  [get_adjusted_width [dict get $via_info lower layer] $width]
+        set lower_height [get_adjusted_width [dict get $via_info lower layer] $height]
+        set upper_width  [get_adjusted_width [dict get $via_info upper layer] $width]
+        set upper_height [get_adjusted_width [dict get $via_info upper layer] $height]
+        
+        set lower_enclosure [lindex [dict get $via_info lower enclosure] 0]
+        set max_lower_enclosure [lindex [dict get $via_info lower enclosure] 1]
+        
+        if {$max_lower_enclosure < $lower_enclosure} {
+            set swap $lower_enclosure
+            set lower_enclosure $max_lower_enclosure
+            set max_lower_enclosure $swap
+        }
+
+        set upper_enclosure [lindex [dict get $via_info upper enclosure] 0]
+        set max_upper_enclosure [lindex [dict get $via_info upper enclosure] 1]
+
+        if {$max_upper_enclosure < $upper_enclosure} {
+            set swap $upper_enclosure
+            set upper_enclosure $max_upper_enclosure
+            set max_upper_enclosure $swap
+        }
+        
+        # What are the maximum number of rows and columns that we can fit in this space?
+        set i 0
+        set via_width_lower 0
+        set via_width_upper 0
+        while {$via_width_lower < $lower_width && $via_width_upper < $upper_width} {
+            incr i
+            set xcut_pitch [lindex [dict get $via_info cut spacing] 0]
+            set via_width_lower [expr $cut_width + $xcut_pitch * ($i - 1) + 2 * $lower_enclosure]
+            set via_width_upper [expr $cut_width + $xcut_pitch * ($i - 1) + 2 * $upper_enclosure]
+        }
+        set xcut_spacing [expr $xcut_pitch - $cut_width]
+        set columns [expr $i - 1]
+
+        set i 0
+        set via_height_lower 0
+        set via_height_upper 0
+        while {$via_height_lower < $lower_height && $via_height_upper < $upper_height} {
+            incr i
+            set ycut_pitch [lindex [dict get $via_info cut spacing] 1]
+            set via_height_lower [expr $cut_height + $ycut_pitch * ($i - 1) + 2 * $lower_enclosure]
+            set via_height_upper [expr $cut_height + $ycut_pitch * ($i - 1) + 2 * $upper_enclosure]
+        }
+        set ycut_spacing [expr $ycut_pitch - $cut_height]
+        set rows [expr $i - 1]
+
+	set lower_enc_width  [expr round(($lower_width  - ($cut_width   + $xcut_pitch * ($columns - 1))) / 2)]
+	set lower_enc_height [expr round(($lower_height - ($cut_height  + $ycut_pitch * ($rows    - 1))) / 2)]
+	set upper_enc_width  [expr round(($upper_width  - ($cut_width   + $xcut_pitch * ($columns - 1))) / 2)]
+	set upper_enc_height [expr round(($upper_height - ($cut_height  + $ycut_pitch * ($rows    - 1))) / 2)]
+
+        # Adjust calculated via width values to ensure that an allowed size is generated
+        set lower_size_max_enclosure [get_adjusted_width [dict get $via_info lower layer] [expr round(($cut_width   + $xcut_pitch * ($columns - 1) + $max_lower_enclosure * 2))]]
+        set upper_size_max_enclosure [get_adjusted_width [dict get $via_info upper layer] [expr round(($cut_width   + $xcut_pitch * ($columns - 1) + $max_upper_enclosure * 2))]]
+        
+        set max_lower_enclosure [expr round(($lower_size_max_enclosure  - ($cut_width   + $xcut_pitch * ($columns - 1))) / 2)]
+        set max_upper_enclosure [expr round(($upper_size_max_enclosure  - ($cut_width   + $xcut_pitch * ($columns - 1))) / 2)]
+
+        # Use the largest value of enclosure in the direction of the layer
+        # Use the smallest value of enclosure perpendicular to direction of the layer
+	if {$lower_dir == "hor"} {
+            if {$lower_enc_height < $max_lower_enclosure} {
+                set xBotEnc $max_lower_enclosure
+                if {$lower_enc_width > $xBotEnc} {
+                    set xBotEnc $lower_enc_width
+                }
+            } else {
+                set xBotEnc $lower_enc_width
+            }
+            set yBotEnc $lower_enc_height
+        } else {
+            set xBotEnc $lower_enc_width
+            if {$lower_enc_width < $max_lower_enclosure} {
+                set yBotEnc $max_lower_enclosure
+                if {$lower_enc_height > $yBotEnc} {
+                    set yBotEnc $lower_enc_height
+                }
+            } else {
+                set yBotEnc $lower_enc_height
+            }
+        }
+
+        # Use the largest value of enclosure in the direction of the layer
+        # Use the smallest value of enclosure perpendicular to direction of the layer
+	if {[get_dir [dict get $via_info upper layer]] == "hor"} {
+            if {$upper_enc_height < $max_upper_enclosure} {
+                set xTopEnc $max_upper_enclosure
+                if {$upper_enc_width > $xTopEnc} {
+                    set xTopEnc $upper_enc_width
+                }
+            } else {
+                set xTopEnc $upper_enc_width
+            }
+            set yTopEnc $upper_enc_height
+        } else {
+            set xTopEnc $upper_enc_width
+            if {$upper_enc_width < $max_upper_enclosure} {
+                set yTopEnc $max_upper_enclosure
+                if {$upper_enc_height > $yTopEnc} {
+                    set yTopEnc $upper_enc_height
+                }
+            } else {
+                set yTopEnc $upper_enc_height
+            }
+        }
+        
+        set rule [list \
+            rule $rule_name \
+            cutsize [dict get $via_info cut size] \
+            layers [list [dict get $via_info lower layer] [dict get $via_info cut layer] [dict get $via_info upper layer]] \
+            cutspacing [list \
+                [expr [lindex [dict get $via_info cut spacing] 0] - [lindex [dict get $via_info cut size] 0]] \
+                [expr [lindex [dict get $via_info cut spacing] 1] - [lindex [dict get $via_info cut size] 1]] \
+            ] \
+            rowcol [list $rows $columns] \
+            enclosure [list $xBotEnc $yBotEnc $xTopEnc $yTopEnc] \
+        ]
+        
+        return $rule
+    }
+    
+    proc get_viarule_name {lower x y width height} {
+        set rules [select_viainfo $lower]
+        set first_key [lindex [dict keys $rules] 0]
+        set cut_layer [dict get $rules $first_key cut layer]
+
+        return ${cut_layer}_${width}x${height}
+    }
+    
+    proc get_cut_area {rule} {
+        return [expr [lindex [dict get $rule rowcol] 0] * [lindex [dict get $rule rowcol] 0] * [lindex [dict get $rule cutsize] 0] * [lindex [dict get $rule cutsize] 1]]
+    }
+    
+    proc select_rule {rule1 rule2} {
+        if {[get_cut_area $rule2] > [get_cut_area $rule1]} {
+            return $rule2
+        }
+        return $rule1
+    }
+    
+    proc get_via {lower x y width height} {
+        # First cur will assume that all crossing points (x y) are on grid for both lower and upper layers
+        # TODO: Refine the algorithm to cope with offgrid intersection points
+        variable physical_viarules
+        
+        set rule_name [get_viarule_name $lower $x $y $width $height]
+
+        if {![dict exists $physical_viarules $rule_name]} {
+            set selected_rule {}
+
+            dict for {name rule} [select_viainfo $lower] {
+                set result [get_via_option [get_dir $lower] $name $rule $x $y $width $height]
+                if {$selected_rule == {}} {
+                    set selected_rule $result
+                } else {
+                    # Choose the best between selected rule and current result, the winner becomes the new selected rule
+                    set selected_rule [select_rule $selected_rule $result]
+                }
+            }
+
+            dict set physical_viarules $rule_name $selected_rule
+        }        
+        
+        return $rule_name
+    }
+    
+    proc generate_vias {layer1 layer2 intersections} {
+        variable logical_viarules
+        variable physical_viarules
+        variable metal_layers
+
+        set vias {}
+        set layer1_name $layer1
+        set layer2_name $layer2
+        regexp {(.*)_PIN_(hor|ver)} $layer1 - layer1_name layer1_direction
+        
+        set i1 [lsearch $metal_layers $layer1_name]
+        set i2 [lsearch $metal_layers $layer2_name]
+        if {$i1 == -1} {puts "Layer1 [dict get $connect layer1], Layer2 $layer2"; exit -1}
+        if {$i2 == -1} {puts "Layer1 [dict get $connect layer1], Layer2 $layer2"; exit -1}
+
+	# For each layer between l1 and l2, add vias at the intersection
+        foreach intersection $intersections {
+            if {![dict exists $logical_viarules [dict get $intersection rule]]} {
+                puts "Missing key [dict get $intersection rule]"
+                puts "Available keys [dict keys $logical_viarules]"
+                exit -1
+            }
+            set logical_rule [dict get $logical_viarules [dict get $intersection rule]]
+
+            set x [dict get $intersection x]
+            set y [dict get $intersection y]
+            set width  [dict get $logical_rule width]
+            set height  [dict get $logical_rule height]
+            
+            set connection_layers [list $layer1 {*}[lrange $metal_layers [expr $i1 + 1] [expr $i2 - 1]]]
+	    foreach lay $connection_layers {
+                set via_name [get_via $lay $x $y $width $height]
+
+                lappend vias [list name $via_name lower_layer $lay x [expr round([dict get $intersection x])] y [expr round([dict get $intersection y])]]
+	    }
+	}
+                
+        return $vias
+    }
 
 ## Proc to generate via locations, both for a normal via and stacked via
 proc generate_via_stacks {l1 l2 tag grid_data} {
+    variable logical_viarules
+    variable default_grid_data
+    variable orig_stripe_locs
+    variable def_units
+    
     set blockage [dict get $grid_data blockage]
     set area [dict get $grid_data area]
     
@@ -17,145 +322,202 @@
     set intersections ""
     #check if layer pair is orthogonal, case 1
     set layer1 $l1
-    if {[lsearch $::met_layer_list $layer1] != -1} {
+    if {[dict exists $grid_data layers $layer1]} {
         set layer1_direction [get_dir $layer1]
+        set layer1_width [dict get $grid_data layers $layer1 width]
+        set layer1_width [expr round($layer1_width * $def_units)]
     } elseif {[regexp {(.*)_PIN_(hor|ver)} $l1 - layer1 layer1_direction]} {
         #
     } else {
         puts "Invalid direction for layer $l1"
     }
+    
+    set layer2 $l2
+    if {[dict exists $grid_data layers $layer2]} {
+        set layer2_width [dict get $grid_data layers $layer2 width]
+        set layer2_width [expr round($layer2_width * $def_units)]
+    } elseif {[dict exists $default_grid_data layers $layer2]} {
+        set layer2_width [dict get $default_grid_data layers $layer2 width]
+        set layer2_width [expr round($layer2_width * $def_units)]
+    } else {
+        puts "No width information available for layer $layer2"
+    }
+    
     set ignore_count 0
     
     if {$layer1_direction == "hor" && [get_dir $l2] == "ver"} {
 
-        #loop over each stripe of layer 1 and layer 2 
-	foreach l1_str $::orig_stripe_locs($l1,$tag) {
-	    set a1  [expr {[lindex $l1_str 1]}]
+        if {[array names orig_stripe_locs "$l1,$tag"] != ""} {
+            ## puts "Checking [llength $orig_stripe_locs($l1,$tag)] horizontal stripes on $l1, $tag"
+            ## puts "  versus [llength $orig_stripe_locs($l2,$tag)] vertical   stripes on $l2, $tag"
+            ## puts "     and [llength $blockage] blockages"
+            #loop over each stripe of layer 1 and layer 2 
+	    foreach l1_str $orig_stripe_locs($l1,$tag) {
+	        set a1  [expr {[lindex $l1_str 1]}]
 
-	    foreach l2_str $::orig_stripe_locs($l2,$tag) {
-		set flag 1
-		set a2	[expr {[lindex $l2_str 0]}]
+	        foreach l2_str $orig_stripe_locs($l2,$tag) {
+		    set flag 1
+		    set a2	[expr {[lindex $l2_str 0]}]
 
-                # Ignore if outside the area
-                if {!($a2 >= [lindex $area 0] && $a2 <= [lindex $area 2] && $a1 >= [lindex $area 1] && $a1 <= [lindex $area 3])} {continue}
-	        if {$a2 > [lindex $l1_str 2] || $a2 < [lindex $l1_str 0]} {continue}
-	        if {$a1 > [lindex $l2_str 2] || $a1 < [lindex $l2_str 1]} {continue}
+                    # Ignore if outside the area
+                    if {!($a2 >= [lindex $area 0] && $a2 <= [lindex $area 2] && $a1 >= [lindex $area 1] && $a1 <= [lindex $area 3])} {continue}
+	            if {$a2 > [lindex $l1_str 2] || $a2 < [lindex $l1_str 0]} {continue}
+	            if {$a1 > [lindex $l2_str 2] || $a1 < [lindex $l2_str 1]} {continue}
 
-                if {[lindex $l2_str 1] == [lindex $area 3]} {continue}
-                if {[lindex $l2_str 2] == [lindex $area 1]} {continue}
+                    if {[lindex $l2_str 1] == [lindex $area 3]} {continue}
+                    if {[lindex $l2_str 2] == [lindex $area 1]} {continue}
 
-                #loop over each blockage geometry (macros are blockages)
-		foreach blk1 $blockage {
-		    set b1 [expr {[lindex $blk1 0] * $::def_units }]
-		    set b2 [expr {[lindex $blk1 1] * $::def_units }]
-		    set b3 [expr {[lindex $blk1 2] * $::def_units }]
-		    set b4 [expr {[lindex $blk1 3] * $::def_units }]
-		    ## Check if stripes are to be blocked on these blockages (blockages are specific to each layer). If yes, do not drop vias
-		    if {  [lsearch $::macro_blockage_layer_list $l1] >= 0 || [lsearch $::macro_blockage_layer_list $l2] >= 0 } {
-			if {($a2 > $b1 && $a2 < $b3 && $a1 > $b2 && $a1 < $b4 ) } {
-			    set flag 0
-			} 
-			if {$a2 > $b1 && $a2 < $b3 && $a1 == $b2 && $a1 == [lindex $area 1]} {
-			    set flag 0
-			} 
-			if {$a2 > $b1 && $a2 < $b3 && $a1 == $b4 && $a1 == [lindex $area 3]} {
-			    set flag 0
-			} 
+                    #loop over each blockage geometry (macros are blockages)
+		    foreach blk1 $blockage {
+		        set b1 [get_instance_llx $blk1]
+		        set b2 [get_instance_lly $blk1]
+		        set b3 [get_instance_urx $blk1]
+		        set b4 [get_instance_ury $blk1]
+		        ## Check if stripes are to be blocked on these blockages (blockages are specific to each layer). If yes, do not drop vias
+		        if {  [lsearch [get_macro_blockage_layers $blk1] $l1] >= 0 || [lsearch [get_macro_blockage_layers $blk1] $l2] >= 0 } {
+			    if {($a2 > $b1 && $a2 < $b3 && $a1 > $b2 && $a1 < $b4 ) } {
+			        set flag 0
+                                break
+			    } 
+			    if {$a2 > $b1 && $a2 < $b3 && $a1 == $b2 && $a1 == [lindex $area 1]} {
+			        set flag 0
+                                break
+			    } 
+			    if {$a2 > $b1 && $a2 < $b3 && $a1 == $b4 && $a1 == [lindex $area 3]} {
+			        set flag 0
+                                break
+			    } 
+		        }
 		    }
-		}
 
-		if {$flag == 1} {
-                    ## if no blockage restriction, append intersecting points to this "intersections"
-		    lappend intersections "$a2 $a1"
-		}
-	    }
+		    if {$flag == 1} {
+                        ## if no blockage restriction, append intersecting points to this "intersections"
+                        if {[regexp {.*_PIN_(hor|ver)} $l1 - dir]} {
+                            set layer1_width [lindex $l1_str 3] ; # Already in def units
+                        }
+                        set rule_name ${l1}${layer2}_${layer2_width}x${layer1_width}
+                        if {![dict exists $logical_viarules $rule_name]} {
+                            dict set logical_viarules $rule_name [list lower $l1 upper $layer2 width ${layer2_width} height ${layer1_width}]
+                        }
+		        lappend intersections "rule $rule_name x $a2 y $a1"
+		    }
+	        }
+            }
         }
 
     } elseif {$layer1_direction == "ver" && [get_dir $l2] == "hor"} {
         ##Second case of orthogonal intersection, similar criteria as above, but just flip of coordinates to find intersections
-	foreach l1_str $::orig_stripe_locs($l1,$tag) {
-	    set n1  [expr {[lindex $l1_str 0]}]
-            
-	    foreach l2_str $::orig_stripe_locs($l2,$tag) {
-		set flag 1
-		set n2	[expr {[lindex $l2_str 1]}]
-                # Ignore if outside the area
-                if {!($n1 >= [lindex $area 0] && $n1 <= [lindex $area 2] && $n2 >= [lindex $area 1] && $n2 <= [lindex $area 3])} {continue}
-	        if {$n2 > [lindex $l1_str 2] || $n2 < [lindex $l1_str 1]} {continue}
-	        if {$n1 > [lindex $l2_str 2] || $n1 < [lindex $l2_str 0]} {continue}
-			
-		foreach blk1 $blockage {
-			set b1 [expr {[lindex $blk1 0] * $::def_units }]
-			set b2 [expr {[lindex $blk1 1] * $::def_units }]
-			set b3 [expr {[lindex $blk1 2] * $::def_units }]
-			set b4 [expr {[lindex $blk1 3] * $::def_units }]
-			if {  [lsearch $::macro_blockage_layer_list $l1] >= 0 || [lsearch $::macro_blockage_layer_list $l2] >= 0 } {
-				if {($n1 >= $b1 && $n1 <= $b3 && $n2 >= $b2 && $n2 <= $b4)} {
-					set flag 0	
-				}
-			}
-		}
+        if {[array names orig_stripe_locs "$l1,$tag"] != ""} {
+            ## puts "Checking [llength $orig_stripe_locs($l1,$tag)] vertical   stripes on $l1, $tag"
+            ## puts "  versus [llength $orig_stripe_locs($l2,$tag)] horizontal stripes on $l2, $tag"
+            ## puts "     and [llength $blockage] blockages"
+	    foreach l1_str $orig_stripe_locs($l1,$tag) {
+	        set n1  [expr {[lindex $l1_str 0]}]
 
-		if {$flag == 1} {
-			lappend intersections "$n1 $n2"
-		}
+	        foreach l2_str $orig_stripe_locs($l2,$tag) {
+		    set flag 1
+		    set n2	[expr {[lindex $l2_str 1]}]
+
+                    # Ignore if outside the area
+                    if {!($n1 >= [lindex $area 0] && $n1 <= [lindex $area 2] && $n2 >= [lindex $area 1] && $n2 <= [lindex $area 3])} {continue}
+	            if {$n2 > [lindex $l1_str 2] || $n2 < [lindex $l1_str 1]} {continue}
+	            if {$n1 > [lindex $l2_str 2] || $n1 < [lindex $l2_str 0]} {continue}
+
+		    foreach blk1 $blockage {
+			    set b1 [get_instance_llx $blk1]
+			    set b2 [get_instance_lly $blk1]
+			    set b3 [get_instance_urx $blk1]
+			    set b4 [get_instance_ury $blk1]
+			    if {  [lsearch [get_macro_blockage_layers $blk1] $l1] >= 0 || [lsearch [get_macro_blockage_layers $blk1] $l2] >= 0 } {
+				    if {($n1 >= $b1 && $n1 <= $b3 && $n2 >= $b2 && $n2 <= $b4)} {
+					    set flag 0	
+				    }
+			    }
+		    }
+
+		    if {$flag == 1} {
+                            ## if no blockage restriction, append intersecting points to this "intersections"
+                            if {[regexp {.*_PIN_(hor|ver)} $l1 - dir]} {
+                                set layer1_width [lindex $l1_str 3] ; # Already in def units
+                            }
+                            set rule_name ${l1}${layer2}_${layer1_width}x${layer2_width}
+                            if {![dict exists $logical_viarules $rule_name]} {
+                                dict set logical_viarules $rule_name [list lower $l1 upper $layer2 width ${layer1_width} height ${layer2_width}]
+                            }
+			    lappend intersections "rule $rule_name x $n1 y $n2"
+		    }
 
 
-	    }
+	        }
+            }
         }
     } else { 
 	#Check if stripes have orthogonal intersections. If not, exit
-	puts "ERROR: Adding vias between same direction layers is not supported yet. EXITING....."
+	puts "ERROR: Adding vias between same direction layers is not supported yet."
+        puts "Layer: $l1, Direction: $layer1_direction"
+        puts "Layer: $l2, Direction: [get_dir $l2]"
 	exit
     }
 
-    return [list layer1 $l1 layer2 $l2 rules [dict get $grid_data vias] intersections $intersections]
+    return [generate_vias $l1 $l2 $intersections]
 }
 
 # proc to generate follow pin layers or standard cell rails
 
 proc generate_lower_metal_followpin_rails {tag area} {
-	#Assumes horizontal stripes
-	set lay $::rails_mlayer
+    variable orig_stripe_locs
+    variable stripe_locs
+    variable row_height
+    variable rails_start_with
 
-	if {$tag == $::rails_start_with} { ;#If starting from bottom with this net, 
+	#Assumes horizontal stripes
+	set lay [get_rails_layer]
+
+	if {$tag == $rails_start_with} { ;#If starting from bottom with this net, 
 		set lly [lindex $area 1]
 	} else {
-		set lly [expr {[lindex $area 1] + $::row_height}]
+		set lly [expr {[lindex $area 1] + $row_height}]
 	}
-	lappend ::stripe_locs($lay,$tag) "[lindex $area 0] $lly [lindex $area 2]"
-	lappend ::orig_stripe_locs($lay,$tag) "[lindex $area 0] $lly [lindex $area 2]"
+	lappend stripe_locs($lay,$tag) "[lindex $area 0] $lly [lindex $area 2]"
+	lappend orig_stripe_locs($lay,$tag) "[lindex $area 0] $lly [lindex $area 2]"
 
 
 	#Rail every alternate rows - Assuming horizontal rows and full width rails
-	for {set y [expr {$lly + (2 * $::row_height)}]} {$y <= [lindex $area 3]} {set y [expr {$y + (2 * $::row_height)}]} {
-	    lappend ::stripe_locs($lay,$tag) "[lindex $area 0] $y [lindex $area 2]"
-	    lappend ::orig_stripe_locs($lay,$tag) "[lindex $area 0] $y [lindex $area 2]"
+	for {set y [expr {$lly + (2 * $row_height)}]} {$y <= [lindex $area 3]} {set y [expr {$y + (2 * $row_height)}]} {
+	    lappend stripe_locs($lay,$tag) "[lindex $area 0] $y [lindex $area 2]"
+	    lappend orig_stripe_locs($lay,$tag) "[lindex $area 0] $y [lindex $area 2]"
 	}
 }
 
 
 # proc for creating pdn mesh for upper metal layers
 proc generate_upper_metal_mesh_stripes {tag layer area} {
+    variable widths
+    variable pitches
+    variable loffset
+    variable boffset
+    variable orig_stripe_locs
+    variable stripe_locs
+    variable stripes_start_with
+    
 	if {[get_dir $layer] == "hor"} {
-		set offset [expr [lindex $area 1] + $::boffset($layer)]
-		if {$tag != $::stripes_start_with} { ;#If not starting from bottom with this net, 
-			set offset [expr {$offset + ($::pitches($layer) / 2)}]
+		set offset [expr [lindex $area 1] + $boffset($layer)]
+		if {$tag != $stripes_start_with} { ;#If not starting from bottom with this net, 
+			set offset [expr {$offset + ($pitches($layer) / 2)}]
 		}
-		for {set y $offset} {$y < [expr {[lindex $area 3] - $::widths($layer)}]} {set y [expr {$::pitches($layer) + $y}]} {
-			lappend ::stripe_locs($layer,$tag) "[lindex $area 0] $y [lindex $area 2]"
-			lappend ::orig_stripe_locs($layer,$tag) "[lindex $area 0] $y [lindex $area 2]"
-		
+		for {set y $offset} {$y < [expr {[lindex $area 3] - $widths($layer)}]} {set y [expr {$pitches($layer) + $y}]} {
+			lappend stripe_locs($layer,$tag) "[lindex $area 0] $y [lindex $area 2]"
+			lappend orig_stripe_locs($layer,$tag) "[lindex $area 0] $y [lindex $area 2]"
 		}
 	} elseif {[get_dir $layer] == "ver"} {
-		set offset [expr [lindex $area 0] + $::loffset($layer)]
+		set offset [expr [lindex $area 0] + $loffset($layer)]
 
-		if {$tag != $::stripes_start_with} { ;#If not starting from bottom with this net, 
-			set offset [expr {$offset + ($::pitches($layer) / 2)}]
+		if {$tag != $stripes_start_with} { ;#If not starting from bottom with this net, 
+			set offset [expr {$offset + ($pitches($layer) / 2)}]
 		}
-		for {set x $offset} {$x < [expr {[lindex $area 2] - $::widths($layer)}]} {set x [expr {$::pitches($layer) + $x}]} {
-			lappend ::stripe_locs($layer,$tag) "$x [lindex $area 1] [lindex $area 3]"
-			lappend ::orig_stripe_locs($layer,$tag) "$x [lindex $area 1] [lindex $area 3]"
+		for {set x $offset} {$x < [expr {[lindex $area 2] - $widths($layer)}]} {set x [expr {$pitches($layer) + $x}]} {
+			lappend stripe_locs($layer,$tag) "$x [lindex $area 1] [lindex $area 3]"
+			lappend orig_stripe_locs($layer,$tag) "$x [lindex $area 1] [lindex $area 3]"
 		}
 	} else {
 		puts "ERROR: Invalid direction \"[get_dir $layer]\" for metal layer ${layer}. Should be either \"hor\" or \"ver\". EXITING....."
@@ -167,21 +529,25 @@
 # inputs to this proc are layer name, domain (tag), and blockage bbox cooridnates
 
 proc generate_metal_with_blockage {layer area tag b1 b2 b3 b4} {
-	set ::temp_locs($layer,$tag) ""
-	set ::temp_locs($layer,$tag) $::stripe_locs($layer,$tag)
-	set ::stripe_locs($layer,$tag) ""
-	foreach l_str $::temp_locs($layer,$tag) {
+    variable stripe_locs
+	set temp_locs($layer,$tag) ""
+	set temp_locs($layer,$tag) $stripe_locs($layer,$tag)
+	set stripe_locs($layer,$tag) ""
+	foreach l_str $temp_locs($layer,$tag) {
 		set loc1 [lindex $l_str 0]
 		set loc2 [lindex $l_str 1]
 		set loc3 [lindex $l_str 2]
 		location_stripe_blockage $loc1 $loc2 $loc3 $layer $area $tag $b1 $b2 $b3 $b4
 	}
 		
-        set ::stripe_locs($layer,$tag) [lsort -unique $::stripe_locs($layer,$tag)]
+        set stripe_locs($layer,$tag) [lsort -unique $stripe_locs($layer,$tag)]
 }
 
 # sub proc called from previous proc
 proc location_stripe_blockage {loc1 loc2 loc3 lay area tag b1 b2 b3 b4} {
+    variable widths
+    variable stripe_locs
+
         set area_llx [lindex $area 0]
         set area_lly [lindex $area 1]
         set area_urx [lindex $area 2]
@@ -191,9 +557,17 @@
 		##Check if stripe is passing through blockage
 		##puts "HORIZONTAL BLOCKAGE "
 		set x1 $loc1
-		set y1 [expr max($loc2 - $::widths($lay)/2, [lindex $area 1])]
+                set y1 [expr $loc2 - $widths($lay)/2]
+                if {[lindex $area 1] > $y1} {
+                    set y1 [lindex $area 1]
+                }
+		set y1 [expr $loc2 - $widths($lay)/2]
 		set x2 $loc3
-		set y2 [expr min($y1 +  $::widths($lay),[lindex $area 3])]
+                set y2 [expr $y1 +  $widths($lay)]
+                if {[lindex $area 3] < $y2} {
+                    set y2 [lindex $area 3]
+                }
+
                 #puts "segment:  [format {%9.1f %9.1f} $loc1 $loc3]"              
                 #puts "blockage: [format {%9.1f %9.1f} $b1 $b3]"
 		if {  ($y1 >= $b2) && ($y2 <= $b4) && ( ($x1 <= $b3 && $x2 >= $b3) || ($x1 <= $b1 && $x2 >= $b1)  || ($x1 <= $b1 && $x2 >= $b3) || ($x1 <= $b3 && $x2 >= $b1) )  } {
@@ -202,57 +576,54 @@
 				#puts "  CASE3 of blockage in between left and right edge of core, cut the stripe into two segments"
                                 #puts "    $x1 $loc2 $b1"
                                 #puts "    $b3 $loc2 $x2"
-				lappend ::stripe_locs($lay,$tag) "$x1 $loc2 $b1"
-				lappend ::stripe_locs($lay,$tag) "$b3 $loc2 $x2"	
+				lappend stripe_locs($lay,$tag) "$x1 $loc2 $b1"
+				lappend stripe_locs($lay,$tag) "$b3 $loc2 $x2"	
 			} elseif {$x1 <= $b3 && $x2 >= $b3} {	
 				#puts "  CASE3 of blockage in between left and right edge of core, but stripe extending out only in one side (right)"
                                 #puts "    $b3 $loc2 $x2"
-				lappend ::stripe_locs($lay,$tag) "$b3 $loc2 $x2"	
+				lappend stripe_locs($lay,$tag) "$b3 $loc2 $x2"	
 			} elseif {$x1 <= $b1 && $x2 >= $b1} {	
 				#puts "  CASE3 of blockage in between left and right edge of core, but stripe extending out only in one side (left)"
                                 #puts "    $x1 $loc2 $b1"
-				lappend ::stripe_locs($lay,$tag) "$x1 $loc2 $b1"
+				lappend stripe_locs($lay,$tag) "$x1 $loc2 $b1"
 			} else {
                             #puts "  CASE5 no match - eliminated segment"
                             #puts "    $loc1 $loc2 $loc3"
                         }
- 
 		} else {
-			lappend ::stripe_locs($lay,$tag) "$x1 $loc2 $x2"
+			lappend stripe_locs($lay,$tag) "$x1 $loc2 $x2"
 			#puts "stripe does not pass thru any layer blockage --- CASE 4 (do not change the stripe location)"
 		}
 	}
 
 	if {[get_dir $lay] == "ver"} {
 		##Check if veritcal stripe is passing through blockage, same strategy as above
-		set x1 $loc1
+		set x1 $loc1 ;# [expr max($loc1 -  $widths($lay)/2, [lindex $area 0])]
 		set y1 $loc2
+		set x2 $loc1 ;# [expr min($loc1 +  $widths($lay)/2, [lindex $area 2])]
 		set y2 $loc3
-		set x2 [expr { $x1 +  $::widths($lay) }]
-		if { ($x1 >= $b1)   && ($x2 <= $b3) && ( ($y1 <= $b2 && $y2 >= $b2) || ($y1 <= $b4 && $y2 >= $b4)  || ($y1 <= $b2 && $y2 >= $b4) || ($y1 <= $b4 && $y2 >= $b2)   ) } {
+
+		if {$x2 > $b1 && $x1 < $b3} {
 
 			if {$y1 <= $b2 && $y2 >= $b4} {	
 				##puts "CASE3 of blockage in between top and bottom edge of core, cut the stripe into two segments
-				lappend ::stripe_locs($lay,$tag) "$x1 $y1 $b2"
-				lappend ::stripe_locs($lay,$tag) "$x1 $b4 $y2"	
-			}
-			if {$y1 <= $b4 && $y2 >= $b4} {	
+				lappend stripe_locs($lay,$tag) "$loc1 $y1 $b2"
+				lappend stripe_locs($lay,$tag) "$loc1 $b4 $y2"	
+			} elseif {$y1 <= $b4 && $y2 >= $b4} {	
 				##puts "CASE3 of blockage in between top and bottom edge of core, but stripe extending out only in one side (right)"
-				lappend ::stripe_locs($lay,$tag) "$x1 $b4 $y2"	
-			}
-			if {$y1 <= $b2 && $y2 >= $b2} {	
+				lappend stripe_locs($lay,$tag) "$loc1 $b4 $y2"	
+			} elseif {$y1 <= $b2 && $y2 >= $b2} {	
 				##puts "CASE3 of blockage in between top and bottom edge of core, but stripe extending out only in one side (left)"
-				lappend ::stripe_locs($lay,$tag) "$x1 $y1 $b2"
+				lappend stripe_locs($lay,$tag) "$loc1 $y1 $b2"
+			} elseif {$y1 <= $b4 && $y1 >= $b2 && $y2 >= $b2 && $y2 <= $b4} {	
+                                ##completely enclosed - remove segment
 			} else {
-                            #puts "  CASE5 no match - eliminated segment"
+                            #puts "  CASE5 no match"
                             #puts "    $loc1 $loc2 $loc3"
+			    lappend stripe_locs($lay,$tag) "$loc1 $y1 $y2"
                         }
-
-
-
- 
 		} else {
-			lappend ::stripe_locs($lay,$tag) "$x1 $y1 $y2"
+			lappend stripe_locs($lay,$tag) "$loc1 $y1 $y2"
 		}
 	}
 }
@@ -260,37 +631,37 @@
 
 ## this is a top-level proc to generate PDN stripes and insert vias between these stripes
 proc generate_stripes_vias {tag net_name grid_data} {
-
+        variable vias
+        
         set area [dict get $grid_data area]
         set blockage [dict get $grid_data blockage]
-        
-	##puts -nonewline "Adding stripes for $net_name ..."
-	foreach lay [dict get $grid_data layers] {
 
-	    if {$lay == $::rails_mlayer} {
+	## puts "Adding stripes for $net_name ..."
+	foreach lay [dict keys [dict get $grid_data layers]] {
+	    ## puts "    Layer $lay ..."
+
+	    if {$lay == [get_rails_layer]} {
 	        #Std. cell rails
 	        generate_lower_metal_followpin_rails $tag $area
 
 	        foreach blk1 $blockage {
-		        set b1 [expr {[lindex $blk1 0] * $::def_units }]
-		        set b2 [expr {[lindex $blk1 1] * $::def_units }]
-		        set b3 [expr {[lindex $blk1 2] * $::def_units }]
-		        set b4 [expr {[lindex $blk1 3] * $::def_units }]
-		        generate_metal_with_blockage $::rails_mlayer $area $tag $b1 $b2 $b3 $b4
+		        set b1 [get_instance_llx $blk1]
+		        set b2 [get_instance_lly $blk1]
+		        set b3 [get_instance_urx $blk1]
+		        set b4 [get_instance_ury $blk1]
+		        generate_metal_with_blockage [get_rails_layer] $area $tag $b1 $b2 $b3 $b4
 	        }
 
             } else {
 	        #Upper layer stripes
-		if {$::widths($lay) != [expr {-1 * $::def_units}] || $::pitches($lay) != [expr {-1 * $::def_units}]} {
-			generate_upper_metal_mesh_stripes $tag $lay $area
-		}
+		generate_upper_metal_mesh_stripes $tag $lay $area
 
-		if {  [lsearch $::macro_blockage_layer_list $lay] >= 0 } {
-			foreach blk2 $blockage {
-				set c1 [expr {[lindex $blk2 0] * $::def_units }]
-				set c2 [expr {[lindex $blk2 1] * $::def_units }]
-				set c3 [expr {[lindex $blk2 2] * $::def_units }]
-				set c4 [expr {[lindex $blk2 3] * $::def_units }]
+		foreach blk2 $blockage {
+		        if {  [lsearch [get_macro_blockage_layers $blk2] $lay] >= 0 } {
+				set c1 [get_instance_llx $blk2]
+				set c2 [get_instance_lly $blk2]
+				set c3 [get_instance_urx $blk2]
+				set c4 [get_instance_ury $blk2]
 
 				generate_metal_with_blockage $lay $area $tag $c1 $c2 $c3 $c4
 			}
@@ -299,16 +670,14 @@
 	}
 
 	#Via stacks
-	##puts -nonewline "Adding vias for $net_name ..."
+	## puts "Adding vias for $net_name ([llength [dict get $grid_data connect]] connections)..."
 	foreach tuple [dict get $grid_data connect] {
 		set l1 [lindex $tuple 0]
 		set l2 [lindex $tuple 1]
-
+                ## puts "    $l1 to $l2"
                 set connections [generate_via_stacks $l1 $l2 $tag $grid_data]
-		lappend ::vias [list net_name $net_name connections $connections]
+		lappend vias [list net_name $net_name connections $connections]
 	}
-	##puts " DONE \[Total elapsed walltime = [expr {[expr {[clock clicks -milliseconds] - $::start_time}]/1000.0}] seconds\]"
-
 }
 
     namespace export write_def write_vias
diff --git a/scripts/pdn/src/scripts/pkgIndex.tcl b/scripts/pdn/src/scripts/pkgIndex.tcl
old mode 100755
new mode 100644
index e44152e..48e8062
--- a/scripts/pdn/src/scripts/pkgIndex.tcl
+++ b/scripts/pdn/src/scripts/pkgIndex.tcl
@@ -9,10 +9,13 @@
 # full path name of this file's directory.
 
 proc source_pdn {dir} {
+    if {[package vcompare [package present Tcl] 8.6] == -1} {
+        source [file join $dir tcl8p5.tcl]
+    }
     source [file join $dir pg_grid_procs.tcl]
     source [file join $dir gen_blockage.tcl]
-    source [file join $dir def_writer.tcl]
+    source [file join $dir opendb_writer.tcl]
     source [file join $dir create_pg_grid.tcl]
 }
 
-package ifneeded pdn 0.1.0 [list source_pdn $dir]
+package ifneeded pdn 0.3.0 [list source_pdn $dir]
diff --git a/scripts/pdn/src/scripts/tcl8p5.tcl b/scripts/pdn/src/scripts/tcl8p5.tcl
new file mode 100644
index 0000000..d9f1f3e
--- /dev/null
+++ b/scripts/pdn/src/scripts/tcl8p5.tcl
@@ -0,0 +1,11 @@
+if {[package vcompare [package present Tcl] 8.6] == -1} {
+    proc lmap {args} {
+        set result {}
+        set var [lindex $args 0]
+        foreach item [lindex $args 1] {
+            uplevel 1 "set $var $item"
+            lappend result [uplevel 1 [lindex $args end]]
+        }
+        return $result
+    }
+}
diff --git a/scripts/replace_gp.tcl b/scripts/replace_gp.tcl
index 28bff16..b9c1c5b 100755
--- a/scripts/replace_gp.tcl
+++ b/scripts/replace_gp.tcl
@@ -5,7 +5,7 @@
 rep set_density $::env(PL_TARGET_DENSITY)
 
 rep import_lef $::env(MERGED_LEF)
-rep import_def $::env(tapcell_result_file_tag).def
+rep import_def $::env(pdn_result_file_tag).def
 rep set_output $::env(replaceio_tmp_file_tag)
 
 if { $::env(PL_TIME_DRIVEN) } {