#!/bin/csh -f
#how to run : csh ./auto_gds_out.csh lib cell
layoutset library = "$1"
set cell = "$2"
set layout = "$3"
#source pdk.csh
#ln -s cds.lib .
strmout -library $library -toPCell $cell -view $layout -strmFile $cell.gds -outputDir . -convertDot node -case preserve -logFile gdsout.log
if($status) then
echo strmout $cell.gds failed!
else
echo strmout $cell.gds successfully!
#run dummy fill
calibre -drc -hier -64 -turbo 64 DUMMY.cmd
#run merge gds ; merge.csh
calibredrv -shell < merge.csh
#cat merge.csh :layout filemerge -in dummy.gds -in original.gds -out final.gds -createtop TOP
#strmin to DMY lib
strmin -library 'gds_with_dummy' -strmFile 'final.gds' -topCell 'TOP' -logFile 'strmIn.log'
#run drc
cd drc
calibre -drc -hier -64 -hyper -turbo 64 ../_DRC_Cal.cmd
calibre -rve $2.drc.results &
calibre -rve TOP.drc.results &
cd ..
endif