| export PDK_ROOT=~/foss/pdks/open_pdks/sky130; |
| export PDKPATH=$PDK_ROOT/sky130A ; |
| $MAGIC -dnull -noconsole <<EOF |
| $MAGIC -dnull -noconsole << EOX |
| #writeall force $1.lef.mag |
| # copy GDS properties from the MAG view into the MAGLEF view |
| set gds_properties [list] |
| set mag_lines [split [read \$fp] "\n"] |
| foreach line \$mag_lines { |
| if { [string first "string GDS_" \$line] != -1 } { |
| lappend gds_properties \$line |
| set fp [open $1.lef.mag r] |
| set mag_lines [split [read \$fp] "\n"] |
| foreach line \$mag_lines { |
| if { [string first "<< end >>" \$line] != -1 } { |
| lappend new_mag_lines [join \$gds_properties "\n"] |
| lappend new_mag_lines \$line |
| set fp [open $1.lef.mag w] |
| puts \$fp [join \$new_mag_lines "\n"] |
| mv -f $1.lef.mag ../maglef/$1.mag |