dump xor scripts
diff --git a/scripts/drc-def-sky130A.sh b/scripts/drc-def-sky130A.sh
index f373ffd..cc4ed28 100644
--- a/scripts/drc-def-sky130A.sh
+++ b/scripts/drc-def-sky130A.sh
@@ -25,4 +25,4 @@
then
mkdir $OUT_DIR
fi
-bash ./magic-drc.sh $TARGET_DIR $DESIGN_NAME $PDK_ROOT "mag" "sky130A" $OUT_DIR $TCL_CALL_PATH
+bash ./core_scripts/magic-drc.sh $TARGET_DIR $DESIGN_NAME $PDK_ROOT "mag" "sky130A" $OUT_DIR $TCL_CALL_PATH
diff --git a/scripts/drc-mag-sky130A.sh b/scripts/drc-mag-sky130A.sh
index b63ad08..9fedad3 100644
--- a/scripts/drc-mag-sky130A.sh
+++ b/scripts/drc-mag-sky130A.sh
@@ -25,4 +25,4 @@
then
mkdir $OUT_DIR
fi
-bash ./magic-drc.sh $TARGET_DIR $DESIGN_NAME $PDK_ROOT "mag" "sky130A" $OUT_DIR $TCL_CALL_PATH
+bash ./core_scripts/magic-drc.sh $TARGET_DIR $DESIGN_NAME $PDK_ROOT "mag" "sky130A" $OUT_DIR $TCL_CALL_PATH
diff --git a/scripts/dumped_scripts/xor.drc b/scripts/dumped_scripts/xor.drc
new file mode 100644
index 0000000..14896ee
--- /dev/null
+++ b/scripts/dumped_scripts/xor.drc
@@ -0,0 +1,42 @@
+# A general XOR script
+# (https://www.klayout.de/forum/discussion/100/xor-vs-diff-tool)
+# This script uses KLayout's DRC language to implement a generic
+# XOR between two layouts. The name of the layouts is given
+# in $a and $b.
+
+# For layout-to-layout XOR with multiple cores, run this script with
+# ./klayout -r xor.drc -rd thr=NUM_CORES -rd top_cell=TOP_CELL_NAME -rd a=a.gds -rd b=b.gds -rd ol=xor.gds -zz
+# (replace NUM_CORES by the desired number of cores to utilize
+
+# enable timing output
+verbose
+
+# set up input a
+a = source($a, $top_cell)
+
+# set up input b
+b = source($b, $top_cell)
+
+$o && report("XOR #{$a} vs. #{$b}", $o)
+$ol && target($ol, $co || "XOR")
+
+$thr && threads($thr) || threads(2)
+
+# collect all common layers
+layers = {}
+[ a.layout, b.layout ].each do |ly|
+ ly.layer_indices.each do |li|
+ i = ly.get_info(li)
+ layers[i.to_s] = i
+ end
+end
+
+# perform the XOR's
+layers.keys.sort.each do |l|
+ i = layers[l]
+ info("--- Running XOR for #{l} ---")
+ x = a.input(l) ^ b.input(l)
+ info("XOR differences: #{x.data.size}")
+ $o && x.output(l, "XOR results for layer #{l}")
+ $ol && x.output(i.layer, i.datatype, i.name)
+end
diff --git a/scripts/dumped_scripts/xor.sh b/scripts/dumped_scripts/xor.sh
new file mode 100755
index 0000000..aca6c48
--- /dev/null
+++ b/scripts/dumped_scripts/xor.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+: ${1?"Usage: $0 file1.gds file2.gds <top_level_module_name>"}
+: ${2?"Usage: $0 file1.gds file2.gds <top_level_module_name>"}
+: ${3?"Usage: $0 file1.gds file2.gds <top_level_module_name>"}
+
+klayout -r $(dirname $0)/xor.drc -rd top_cell=$3 -rd a=$1 -rd b=$2 -rd thr=$(nproc) -rd ol=xor.gds -zz