the fair gds editor MacroLogFiles

Log Files

The LayoutEditor does not create any log file on this own. But with a few lines of code a logging feature can be added to any macro. Here is an example for a drc macro with logging.

Download: drc-log-example.layout

   1 #!/usr/bin/layout
   2 #name=drc example with log file
   3 #help=example with a log file
   4 
   5 void log(string message){
   6   file f;
   7   string s="drc.log";
   8   f.filename=s;
   9   bool b=true;
  10   // read all
  11   f.open(b);
  12   s=f.read();
  13   f.close();
  14 
  15   // add message
  16   string time;
  17   time=time.setDateTime();
  18   s+=time+": "+message+"\n";
  19 
  20   //write log
  21   b=false;
  22   f.open(b);
  23   f.write(s);
  24   f.close();
  25 }
  26 
  27 int main(){
  28 log("drc started");
  29 layout->drcTool->result="DRC (LayoutEditor example) \r\n";
  30 
  31 // setup error layer
  32 layout->drawing->activeLayer=0;
  33 layout->drcTool->setErrorLayerToActiveLayer();
  34 
  35 // check for layer metal 1
  36 layout->drcTool->ruleName= "Minimum Size Metal1";
  37 layout->drcTool->minimumSize(800,6,true);
  38 log("rules \"layer metal 1\" competed");
  39 
  40 // check for layer metal 2
  41 layout->drcTool->ruleName= "Minimum Size Metal2";
  42 layout->drcTool->minimumSize(900,8,true);
  43 log("rules \"layer metal 2\" competed");
  44 
  45 // check for via1  (metal1 to metal2)
  46 layout->drcTool->ruleName= "Via in metal1";
  47 layout->drcTool->inside(50,7,6);
  48 layout->drcTool->ruleName= "Via in metal2";
  49 layout->drcTool->inside(60,7,8);
  50 log("rules \"check for via1  (metal1 to metal2)\" competed");
  51 
  52 layout->drcTool->showReport();
  53 
  54 }

See also


CategoryMacro


MacroLogFiles (last edited 2012-05-25 10:17:25 by dslb-088-064-019-020)