Import External DRC Results
Beside the integrated DesignRuleChecker the LayoutEditor can load and display result of an external design rule check. To load the results into the LayoutEditor a small macro is required which will do the format convertion. Attached if such a convertion macro for a common drc result format. In line 7 the result file name is defined and in line 8 the layer for the graphical display is set. Next to the graphical display the results are listed in the DRC violation list which is also used by the internal DesignRuleChecker.
Download:
DRC example data (drc.db):
topcell 1000 //topcell metal_1_spacing //rulename1 3 5 2 Jan 7 10:29:32 2009 //results results infolines Rule File Pathname: /user/myhome/drc/rules //infoline_1 Metal spacing check for matal 1 GDS layer 56 //infoline_2 e 5 1 //line # Number_of_violations 0 50000 0 20000 p 22 13 //polygon # Number_of_violations 48000 50000 40000 50000 36000 44000 36000 28000 40000 20000 48000 20000 48000 22000 42000 22000 38000 30000 38000 42000 42000 48000 48000 48000 48000 50000 e 29 3 5000 50000 10000 45000 10000 40000 10000 30000 10000 25000 5000 20000 metal_2_width //rulename2 2 4 1 Jan 7 10:30:36 2009 Rule File Pathname: /user/myhome/drc/rules e 29 1 20000 20000 20000 50000 e 32 3 25000 35000 30000 20000 30000 45000 30000 40000 25000 50000 30000 50000
DRC Import Macro:
1 #!/usr/bin/layout
2 #name=read an external drc file
3 #help=import drc error from an external ascii file
4
5 int main(){
6 file f;
7 f.filename="drc.db";
8 int errorLayer=0;
9 bool b=true;
10 f.open(b);
11 string s=f.read();
12 f.close();
13 stringList sl=s.split("\n");
14 if (sl.size()==0) return 0; //no data
15 stringList sl2=sl.at(0).split(" ");
16 if (sl2.size()==0) layout->drawing->setCell(sl.at(0));
17 else layout->drawing->setCell(sl2.at(0));
18 layout->drcTool->clearViolationView();
19 int i;
20 string rule;
21 point p1,p2,p;
22 pointArray pa;
23 int nextRules=0;
24 int nextData=0;
25 int dataType=0;
26 for( i=1;i<sl.size();i++){
27 sl2=sl.at(i).split(" ");
28 if (nextData>0) {
29 nextData--;
30 if (dataType==0) { // ignore
31 }
32 else if (dataType==1) { //line
33 if (sl2.size()>3){
34 p1.setX(sl2.at(0).toInt());
35 p1.setY(sl2.at(1).toInt());
36 p2.setX(sl2.at(2).toInt());
37 p2.setY(sl2.at(3).toInt());
38 pa.resize(0);
39 pa.attachPoint(p1);
40 pa.attachPoint(p2);
41 layout->drawing->currentCell->addPath(pa,errorLayer);
42 layout->drcTool->addViolation(rule,0 ,p1, p2);
43 }
44 }
45 else if (dataType==2) { //polygon
46 if (sl2.size()>1){
47 p.setX(sl2.at(0).toInt());
48 p.setY(sl2.at(1).toInt());
49 pa.attachPoint(p);
50 if (pa.size()==1) {p1=p;p2=p;}
51 if (p.x()<p1.x()) p1.setX(p.x());
52 if (p.x()>p2.x()) p2.setX(p.x());
53 if (p.y()<p1.y()) p1.setY(p.y());
54 if (p.y()>p2.y()) p2.setY(p.y());
55 }
56 if (nextData==0) {
57 layout->drawing->currentCell->addPolygon(pa,errorLayer);
58 layout->drcTool->addViolation(rule,0 ,p1, p2);
59 }
60 }
61 }
62 else if (nextRules>0) {
63 nextRules--;
64 if (sl2.size()>2) {
65 nextData=sl2.at(2).toInt();
66 dataType=0;
67 if (sl2.at(0)=="p") { //polygon
68 dataType=2;
69 pa.resize(0);
70 }
71 else if (sl2.at(0)=="e") { // line
72 dataType=1;
73 }
74 }
75 }
76 else { // new rule
77 rule=sl.at(i);
78 if (sl2.size()>1) rule=sl2.at(0);
79 i++;
80 if (i==sl.size()) break;
81 sl2=sl.at(i).split(" ");
82 if (sl2.size()>2) {
83 nextRules=sl2.at(0).toInt();
84 nextData=sl2.at(2).toInt();
85 dataType=0;
86 }
87 }
88 }
89 layout->drawing->scaleFull();
90 }