-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmos_abutment.il
281 lines (257 loc) · 10.5 KB
/
mos_abutment.il
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
procedure( PREFIX_mosAbut( iA iB pA pB pASide connection event @optional (group nil) ) ;_Mar 11 04 amir 183 ;;InstA, instB, PinA, PinB
let(
(
result apA apB avA avB delta
( epsilon 0.0001 ) ;;set local epsilon to 0.0001 let skill++ mode
)
cond(
( isCallable('_geIsQCell) && _geIsQCell(iA)
result = PREFIX_QCellMosAbut(iA iB pA pB pASide connection event group)
)
( isCallable('_geIsQCell) && _geIsQCell(iB)
result = PREFIX_QCellMosAbut(iB iA pB pA pASide connection event group)
)
( t
case( event
( 1 ;; compute abutment offset
result = 0.0
)
( 2 ;; adjust pcell for abutment
apA = pA~>abutParam
apB = pB~>abutParam
avA = get(get(get(iA 'master) 'parameters) apA) ;; get value of a property from list, 'parameters-->symbol
avB = get(get(get(iB 'master) 'parameters) apB)
;; save current state
dbReplaceProp( group ;; dbReplaceProp(
sprintf(nil "abutInfo_%s" iA~>name) ;; g_object
"list" ;; t_name
list( ;; t_propType
list(concat(apA) avA) ;; g_value
)) ;; )
dbReplaceProp( group ;; => d_prop / nil
sprintf(nil "abutInfo_%s" iB~>name)
"list"
list(
list(concat(apB) avB)
))
case( connection
( 1 ;; no third connection, remove both contacts
delta = pB~>gateWidth - pA~>gateWidth
cond(
( delta > epsilon
avA = 6
avB = 2
)
( delta < -epsilon
avA = 2
avB = 6
)
( t
avA = 4
avB = 4
)
) ; ** cond delta **
)
( 2 ;; third connection exists
delta = rodGetObj(pB)~>length - rodGetObj(pA)~>length
cond(
( delta > epsilon
avA = 7
avB = 1
)
( delta < -epsilon
avA = 1
avB = 7
)
( t
delta = rodGetObj(pB)~>length - pA~>gateWidth
if( delta > epsilon then
avA = 7
avB = 1
else
avA = 5
avB = 3
) ; ** if delta **
)
) ; ** cond delta **
)
) ; ** case connection **
when( PasXor(pA~>isSource == "TRUE" pB~>isSource == "TRUE")
avA = avA * -1
avB = avB * -1
)
PasSetInstParamValue(iA avA apA)
PasSetInstParamValue(iB avB apB)
result = t
)
( 3 ;; adjust pcell for unabutment
when( dbIsId(iA)
foreach( param get(group sprintf(nil "abutInfo_%s" iA~>name))
PasSetInstParamValue(iA cadr(param) car(param))
)
)
when( dbIsId(iB)
foreach( param get(group sprintf(nil "abutInfo_%s" iB~>name))
PasSetInstParamValue(iB cadr(param) car(param))
)
)
result = nil
)
) ; ** case event **
)
) ; ** cond isCallable **
result
) ; ** let **
) ; ** procedure PREFIX_mosAbut **
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure(PREFIX_QCellGetOffset(iB pB connection qCellFingerWidth) ;_Mar 16 04 amir 35
prog((epsilon grid diff dpt grid2)
epsilon = 0.0001
grid = 0.01
grid2 = grid/2
diff = pB~>gateWidth - qCellFingerWidth
dpt=PasGetDeviceProps(iB~>master)
when(connection == 1 && abs(diff) < epsilon ;;; same width
when(PasCeiling(dpt->msGate grid*2 t) > dpt->msGate
return(-grid2)
)
)
return(0.0)
) ; ** prog **
) ; ** procedure PREFIX_QCellGetOffset **
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This procedure is used to abut QCell with PREFIX template cell.
;;; iA will always be QCell, and iB always PREFIX.
procedure( PREFIX_QCellMosAbut( iA iB pA pB pASide connection event @optional (group nil) ) ;_Mar 16 04 amir 3451
let(
(
result (epsilon 0.0001 ) contactParam delta value apB avB
paramsA fingerWidth diffStretchLTV diffStretchLBV diffStretchRTV diffStretchRBV
( ContactNone 0 )
( ContactOn 1 )
( ContactShoulder 2 )
( ContactSeries 3 )
( ContactOff 4 )
)
pASide
paramsA = iA->master->parameters
fingerWidth = paramsA->fingerWidth
diffStretchLTV = paramsA->diffStretchLTV
diffStretchLBV = paramsA->diffStretchLBV
diffStretchRTV = paramsA->diffStretchRTV
diffStretchRBV = paramsA->diffStretchRBV
case(event
( 1 ;; compute abutment offset
delta = pB~>gateWidth - fingerWidth
result = PREFIX_QCellGetOffset(iB pB connection fingerWidth)
)
( 2
contactParam = pA~>contactParam
if(contactParam == "leftAbutmentState" then
when(abs(diffStretchLTV) > epsilon
dbReplaceProp(iA "diffStretchLTV" "float" 0.0)
dbReplaceProp(group
sprintf(nil "%s_diffStretchLTV" iA~>name)
"float" diffStretchLTV)
) ; ** when abs **
when(abs(diffStretchLBV) > epsilon
dbReplaceProp(iA "diffStretchLBV" "float" 0.0)
dbReplaceProp(group
sprintf(nil "%s_diffStretchLBV" iA~>name)
"float" diffStretchLBV)
) ; ** when abs **
else
when(abs(diffStretchRTV) > epsilon
dbReplaceProp(iA "diffStretchRTV" "float" 0.0)
dbReplaceProp(group
sprintf(nil "%s_diffStretchRTV" iA~>name)
"float" diffStretchRTV)
) ; ** when abs **
when(abs(diffStretchRBV) > epsilon
dbReplaceProp(group
sprintf(nil "%s_diffStretchRBV" iA~>name)
"float" diffStretchRBV)
dbReplaceProp(iA "diffStretchRBV" "float" 0.0)
) ; ** when abs **
) ; ** if contactParam **
;;; Save old status for pasMos.
apB = pB~>abutParam
avB = get(iB apB) || 0
dbReplaceProp(group sprintf(nil "abutInfo_%s" iB~>name)
"list" list(list(concat(apB) avB)))
delta = pB~>gateWidth - fingerWidth
case( connection
( 1 ;; No third connection, remove both contacts
cond(
( delta > epsilon ;;; pasMos width > qCell
avB = 2
dbReplaceProp(iA contactParam "int" ContactShoulder)
)
( delta < -epsilon ;;; pasMos width < qCell
avB = 6
dbReplaceProp(iA contactParam "int" ContactOff)
)
( t
avB = 4
dbReplaceProp(iA contactParam "int" ContactSeries)
)
) ; ** cond delta **
)
( 2 ;;; Third connection, always keep contact of large side
cond(
( delta > epsilon ;;; pasMos width > qCell
avB = 1
dbReplaceProp(iA contactParam "int" ContactShoulder)
)
( delta < -epsilon ;;; pasMos width < qCell
avB = 7
dbReplaceProp(iA contactParam "int" ContactOn)
)
( t
avB = 3
dbReplaceProp(iA contactParam "int" ContactNone)
)
) ; ** cond delta **
)
) ; ** case connection **
when(pB~>isSource == "TRUE" avB = avB * -1)
PasSetInstParamValue(iB avB apB)
dbReplaceProp(group iA~>name "string" contactParam)
result = t
)
( 3 ;; adjust pcell for unabutment
when( dbIsId(iA)
contactParam = get(group sprintf(nil "%s" iA~>name))
dbReplaceProp(iA contactParam "int" ContactOn)
if( contactParam == "leftAbutmentState" then
value = get(group sprintf(nil "%s_diffStretchLTV" iA~>name))
when(value
dbReplaceProp(iA "diffStretchLTV" "float" value)
)
value = get(group sprintf(nil "%s_diffStretchLBV" iA~>name))
when(value
dbReplaceProp(iA "diffStretchLBV" "float" value)
)
else
value = get(group sprintf(nil "%s_diffStretchRTV" iA~>name))
when(value
dbReplaceProp(iA "diffStretchRTV" "float" value)
)
value = get(group sprintf(nil "%s_diffStretchRBV" iA~>name))
when(value
dbReplaceProp(iA "diffStretchRBV" "float" value)
)
) ; ** if contactParam **
) ; ** when dbIsId **
when( dbIsId(iB)
foreach( param get(group sprintf(nil "abutInfo_%s" iB~>name))
dbReplaceProp(iB symbolToString(car(param)) "int" cadr(param))
)
) ; ** when dbIsId **
result = nil
)
) ; ** case event **
result
) ; ** let **
) ; ** procedure PREFIX_QCellMosAbut **
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;