init gds version
diff --git a/scripts/AAG Version/drc-gds-sky130A.sh b/scripts/AAG Version/drc-gds-sky130A.sh new file mode 100644 index 0000000..7a4d474 --- /dev/null +++ b/scripts/AAG Version/drc-gds-sky130A.sh
@@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2020 Efabless Corporation +# +# 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. + +# To call: ./run_drc_checks.sh <target_path> <design_name> <pdk-path> [<output_path> default is <target_path>/results/] + +export TARGET_DIR=$1 +export DESIGN_NAME=$2 +export PDKPATH=$3 +export OUT_DIR=${4:-$TARGET_DIR/results/} + +if ! [[ -d "$OUT_DIR" ]] +then + mkdir $OUT_DIR +fi +bash ./magic-drc.sh $TARGET_DIR $DESIGN_NAME $PDKPATH "gds" "sky130A" $OUT_DIR
diff --git a/scripts/AAG Version/magic-drc.sh b/scripts/AAG Version/magic-drc.sh new file mode 100644 index 0000000..e1f6a6c --- /dev/null +++ b/scripts/AAG Version/magic-drc.sh
@@ -0,0 +1,56 @@ +#!/bin/bash +# Copyright 2020 Efabless Corporation +# +# 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. + +# To call: ./run_drc_checks.sh <target_path> <design_name> <pdk-path> <target-type> <output_path> + +export TARGET_DIR=$1 +export DESIGN_NAME=$2 +export PDKPATH=$3 +export TARGET_TYPE=$4 +export PDK=$5 +export OUT_DIR=${6:-$TARGET_DIR/results/} + +if ! [[ -d "$OUT_DIR" ]] +then + mkdir $OUT_DIR +fi +echo "Running Magic..." +export MAGIC_MAGICRC=$PDKPATH/$PDK/libs.tech/magic/sky130A.magicrc + +magic \ + -noconsole \ + -dnull \ + -rcfile $MAGIC_MAGICRC \ + $(pwd)/magic-drc.tcl \ + </dev/null \ + |& tee $OUT_DIR/magic_drc.log + +TEST=$OUT_DIR/$DESIGN_NAME.magic.drc + +crashSignal=$(find $TEST) +if ! [[ $crashSignal ]]; then echo "DRC Check FAILED"; exit -1; fi + + +Test_Magic_violations=$(grep "COUNT: " $TEST -s | tail -1 | sed -r 's/[^0-9]*//g') +if ! [[ $Test_Magic_violations ]]; then Test_Magic_violations=-1; fi +if [ $Test_Magic_violations -ne -1 ]; then Test_Magic_violations=$(((Test_Magic_violations+3)/4)); fi + +echo "Test # of DRC Violations:" +echo $Test_Magic_violations + +if [ 0 -ne $Test_Magic_violations ]; then echo "DRC Check FAILED"; exit -1; fi + +echo "DRC Check Passed" +exit 0
diff --git a/scripts/AAG Version/magic-drc.tcl b/scripts/AAG Version/magic-drc.tcl new file mode 100755 index 0000000..82ba470 --- /dev/null +++ b/scripts/AAG Version/magic-drc.tcl
@@ -0,0 +1,74 @@ +# Copyright 2020 Efabless Corporation +# +# 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. + +if { $::env(TARGET_TYPE) == "gds"} { + gds read $::env(TARGET_DIR)/$::env(DESIGN_NAME).gds +} else { + if { $::env(TARGET_TYPE) == "mag" } { + load $::env(TARGET_DIR)/$::env(DESIGN_NAME).mag + } else { + lef read $::env(TECH_LEF) + def read $::env(TARGET_DIR)/$::env(DESIGN_NAME).def + } +} + +set fout [open $::env(OUT_DIR)/$::env(DESIGN_NAME).magic.drc w] +set oscale [cif scale out] +set cell_name $::env(DESIGN_NAME) +magic::suspendall +puts stdout "\[INFO\]: Loading $cell_name\n" +flush stdout +load $cell_name +select top cell +drc euclidean on +drc style drc(full) +drc check +set drcresult [drc listall why] + + +set count 0 +puts $fout "$cell_name" +puts $fout "----------------------------------------" +foreach {errtype coordlist} $drcresult { + puts $fout $errtype + puts $fout "----------------------------------------" + foreach coord $coordlist { + set bllx [expr {$oscale * [lindex $coord 0]}] + set blly [expr {$oscale * [lindex $coord 1]}] + set burx [expr {$oscale * [lindex $coord 2]}] + set bury [expr {$oscale * [lindex $coord 3]}] + set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury] + puts $fout "$coords" + set count [expr {$count + 1} ] + } + puts $fout "----------------------------------------" +} + +puts $fout "\[INFO\]: COUNT: $count" +puts $fout "\[INFO\]: Should be divided by 3 or 4" + +puts $fout "" +close $fout + +puts stdout "\[INFO\]: COUNT: $count" +puts stdout "\[INFO\]: Should be divided by 3 or 4" +puts stdout "\[INFO\]: DRC Checking DONE ($::env(OUT_DIR)/$::env(DESIGN_NAME).magic.drc)" +flush stdout + +puts stdout "\[INFO\]: Saving mag view with DRC errors($::env(OUT_DIR)/$::env(DESIGN_NAME).magic.drc.mag)" +# WARNING: changes the name of the cell; keep as last step +save $::env(OUT_DIR)/$::env(DESIGN_NAME).magic.drc.mag +puts stdout "\[INFO\]: Saved" + +exit 0