9 Replies Latest reply on Dec 11, 2013 4:46 PM by saunder_peng

    Reverse clear field and gdsout generation using calibredrv




      I created this little tcl script to be used with calibredrv, to reverse a clear field into a particolar layer:


      set input [lindex $argv 0]

      set LO [layout create $input -dt_expand -preservePaths -preserveTextAttributes]

      puts $LO

      puts [$LO topcell]

      set topcell [$LO topcell]

      set bboxlo [$LO bbox $topcell]

      puts [$LO bbox $topcell]

      set precision [expr int (1/([$LO units]))]

      $LO units microns $precision

      $LO gdsout temp1.gds

      set LOx [layout create temp1.gds -dt_expand -preservePaths -preserveTextAttributes]

      puts "creation of the flatten topcell"

      $LOx flatten cell MB14A_TOP_1

      puts "creation of the file temp2.gds"

      $LOx units microns $precision

      $LOx gdsout temp2.gds MB14A_TOP_1

      puts [$LOx topcell]

      set topcellx [$LOx topcell]

      puts [$LOx bbox $topcellx]

      exec rm temp1.gds

      set L6 [layout create temp2.gds -dt_expand -preservePaths -preserveTextAttributes]

      set topcell6 [$L6 topcell]

      $L6 create layer 200

      $L6 create polygon $topcell6 200 [lindex $bboxlo 0] [lindex $bboxlo 1] [lindex $bboxlo 2] [lindex $bboxlo 3]

      $L6 NOT 200 6 204

      $L6 delete layer 6

      $L6 COPY 204 6

      $L6 delete layer 204

      $L6 delete layer 200

      puts "creation of the file temporary6.gds"

      $L6 units microns $precision

      $L6 gdsout temporary6.gds $topcell6 -map 6

      puts [$L6 topcell]

      set topcelly6 [$L6 topcell]

      puts [$L6 bbox $topcelly6]

      set Lone6 [layout create temporary6.gds -dt_expand -preservePaths -preserveTextAttributes]

      set Lnew6 [layout create -dt_expand -preservePaths -preserveTextAttributes]

      $Lnew6 create cell TOP_CELL_6

      $Lnew6 create cell MB14A_TOP_1_6 $Lone6 [$Lone6 topcell]

      $Lnew6 create ref TOP_CELL_6 MB14A_TOP_1_6 0 0 0 0 1

      $Lnew6 expand ref TOP_CELL_6 MB14A_TOP_1_6 0 0 0 0 1

      $Lnew6 units microns $precision

      $Lnew6 gdsout LAY6_$input TOP_CELL_6


      My problem is that into the layout there are:

      Layer 6 and datatype 0

      Layer 6 and datatype 58


      Is it possible to reverse the field on layer 6, extracting also both datatype?

      Many thanks in advance for your help.