Statistics
| Revision:

psd-data / trunk / config / pcb / hole_oar.arl @ 1

History | View | Annotate | Download (5.75 KB)

1
include "dfa_constraints.par"
2

    
3
use DFA;
4

    
5

    
6
RuleDefine
7

    
8
Rule hole_oar
9

    
10
/*  Checks related to via holes   */
11

    
12
via1 := isVia(hole1) AND
13
category := concat(SELECT_BY1) AND 
14
names := concat(VALUE1) AND
15
const := concat(CONSTRAINTS) AND
16
allowed_unit := concat(UNITS) AND
17
allowed_min_via := concat(MIN_VIA_HOLE_SIZE) AND 
18
allowed_max_via := concat(MAX_VIA_HOLE_SIZE) AND 
19
min_plated_annsize := concat(MIN_PLATED_ANNULAR_RING_SIZE) AND 
20
min_nonplated_annsize := concat(MIN_NON_PLATED_ANNULAR_RING_SIZE) AND 
21

    
22

    
23
findfirst(category,
24
              append(done,category) and
25
              curr_ind := count(done) and
26
              curr_name := nth(names,curr_ind) and
27
              matchPinOrViaCategory(via1,category,curr_name)
28
            ) and
29

    
30
valDia := convertDbToUserUnits(drillDia(via1),nth(allowed_unit,count(done))) AND   /* ignores SMT */
31

    
32
my_max_via := nth(allowed_max_via, count(done)) AND
33
if(valDia > my_max_via ,
34
   WriteDRCMarker(via1, 
35
                 "DFA / Via hole size greater than maximum allowed value of " + toString(my_max_via),
36
                  valDia) AND
37
   val_err_msg2 := "Hole size greater than maximum allowed value of " + tostring(my_max_via) + "\n",
38

    
39
   val_err_msg2 := ""
40
) AND
41

    
42
my_min_via := nth(allowed_min_via, count(done)) AND 
43
if(valDia < my_min_via ,
44
   WriteDRCMarker(via1, 
45
                 "DFA / Via hole size less than minimum allowed value of " + toString(my_min_via),
46
                  valDia) AND
47
   val_err_msg3 := "Hole size less than minimum allowed value of " + tostring(my_min_via) + "\n",
48

    
49
   val_err_msg3 := ""
50
) AND
51

    
52
my_min_plated_ann :=  nth(min_plated_annsize, count(done)) AND
53
my_min_nonplated_ann :=  nth(min_nonplated_annsize, count(done)) AND 
54

    
55
count(valAnnSize := convertDbToUserUnits(getMinAnnularRingSize(via1),nth(allowed_unit,count(done)))) AND
56
if(valAnnSize == 0.0,
57
   WriteDRCMarker(via1,"DFA / Annular ring size is 0",valAnnSize) AND
58
   val_err_msg1_2 := "\nAnnular ring size is 0",
59
   val_err_msg1_2 := ""
60
) AND
61

    
62
if(isPlated(via1) ,
63
  if(valAnnSize < my_min_plated_ann ,
64
   WriteDRCMarker(via1, 
65
                 "DFA / Annular ring size less than minimum allowed value of " + toString(my_min_plated_ann),
66
                  valAnnSize) AND
67
   val_err_msg4 :=
68
          "Pad annular ring size              : " + toString(valAnnSize) +
69
        "\nAnnular ring size less than minimum allowed value of " + toString(my_min_plated_ann) ,
70
   val_err_msg4 := ""
71
  ),
72
  if(valAnnSize < my_min_nonplated_ann ,
73
   WriteDRCMarker(via1,  
74
                 "DFA / Annular ring size less than minimum allowed value of " + toString(my_min_nonplated_ann),
75
                  valAnnSize) AND
76
   val_err_msg4 :=
77
          "Pad annular ring size              : " + toString(valAnnSize) +
78
        "\nAnnular ring size less than minimum allowed value of " + toString(my_min_nonplated_ann) ,
79
   val_err_msg4 := ""
80
  )
81
) AND
82

    
83
valConstraint := nth(concat(CONSTRAINTS), count(done)) AND
84
val_err_msg := val_err_msg1_2 + val_err_msg2 + val_err_msg3 + val_err_msg4 AND
85
val_err_msg /= ""
86

    
87
Message(ERROR, via1,
88
        "Via hole violations",
89
        "\nVia name                           : ?via1",
90
        "Hole size                          : ?valDia",
91
        "Constraint name                    : ?valConstraint",
92
        "?val_err_msg"
93
);
94

    
95

    
96

    
97
/* Checks related to pin holes  */
98

    
99
pin1 := isPin(hole1) AND
100
category := concat(SELECT_BY1) AND
101
names := concat(VALUE1) AND
102
allowed_unit := concat(UNITS) AND
103
allowed_min_via := concat(MIN_VIA_HOLE_SIZE) AND
104
allowed_max_via := concat(MAX_VIA_HOLE_SIZE) AND
105
min_plated_annsize := concat(MIN_PLATED_ANNULAR_RING_SIZE) AND
106
min_nonplated_annsize := concat(MIN_NON_PLATED_ANNULAR_RING_SIZE) AND
107

    
108
findfirst(category,
109
              append(done,category) and
110
              curr_ind := count(done) and
111
              curr_name := nth(names,curr_ind) and
112
              matchPinOrViaCategory(pin1,category,curr_name)
113
            ) and
114
 
115

    
116
valDia := convertDbToUserUnits(drillDia(pin1),nth(allowed_unit,count(done))) AND   /* ignores SMT */
117
valDia /= 0.0 AND
118

    
119
my_min_plated_ann :=  nth(min_plated_annsize, count(done)) AND
120
my_min_nonplated_ann :=  nth(min_nonplated_annsize, count(done)) AND
121

    
122
count(valAnnSize := convertDbToUserUnits(getMinAnnularRingSize(pin1),nth(allowed_unit,count(done)))) AND
123
if(valAnnSize == 0.0,
124
   WriteDRCMarker(pin1,"DFA / Annular ring size is 0",valAnnSize) AND
125
   val_err_msg1_2 := "\nAnnular ring size is 0",
126
   val_err_msg1_2 := ""
127
) AND
128

    
129
if(isPlated(pin1) ,
130
  if(valAnnSize < my_min_plated_ann ,
131
   WriteDRCMarker(pin1,
132
                 "DFA / Annular ring size less than minimum allowed value of " + toString(my_min_plated_ann),
133
                  valAnnSize) AND
134
   val_err_msg2 :=
135
          "Pad annular ring size              : " + toString(valAnnSize) +
136
        "\nAnnular ring size less than minimum allowed value of " + toString(my_min_plated_ann) ,
137
   val_err_msg2 := ""
138
  ),
139
  if(valAnnSize < my_min_nonplated_ann ,
140
   WriteDRCMarker(pin1,
141
                 "DFA / Annular ring size less than minimum allowed value of " + toString(my_min_nonplated_ann),
142
                  valAnnSize) AND
143
   val_err_msg2 :=
144
          "Pad annular ring size              : " + toString(valAnnSize) +
145
        "\nAnnular ring size less than minimum allowed value of " + toString(my_min_nonplated_ann) ,
146
   val_err_msg2 := ""
147
  )
148
) AND
149
 
150
valConstraint := nth(concat(CONSTRAINTS), count(done)) AND
151

    
152
val_err_msg := val_err_msg1_2 + val_err_msg2 AND
153
val_err_msg /= ""
154

    
155
Message(ERROR, pin1,
156
        "Pin hole violations",
157
        "\nPin name                           : ?pin1",
158
        "Hole size                          : ?valDia",
159
        "Constraint name                    : ?valConstraint",
160
        "?val_err_msg"
161
);
162

    
163

    
164
EndRule
165

    
166
EndRuleDefine