/
semiconductor.go
204 lines (158 loc) · 3.45 KB
/
semiconductor.go
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
package fides
import (
"errors"
"math"
)
func SemiconductorFIT(comp *Component, mission *Mission) (float64, error) {
var fit, nfit float64
vfactor := 1.0
if comp.Class == "D" && comp.Imax < 1 && !(contains(comp.Tags, "tvs") || contains(comp.Tags, "zener")) {
if comp.Vmax == 0 || math.IsNaN(comp.Vmax) {
return math.NaN(), errors.New("Vmax not set")
}
if comp.V == 0 || math.IsNaN(comp.V) {
return math.NaN(), errors.New("working V not set")
}
vfactor = PiThermal_voltageFactor(comp.V, comp.Vmax)
}
lth := Lchip_th(comp)
if lth < 0 {
return math.NaN(), errors.New("Missing data for lchip(th) calculation")
}
p := NewPackage(comp.Package)
lrh, ltc, lts, lm := p.FitBase()
if lrh < 0 || math.IsNaN(lrh) {
return math.NaN(), errors.New("Missing data for lpkg(rh,tc...) calculation")
}
cs := Cs(comp.Class, comp.Tags)
if math.IsNaN(cs) {
return math.NaN(), errors.New("Missing data for stress sensibility calculation")
}
for _, ph := range mission.Phases {
// TODO Add disipated power
tj := ph.Tamb
nfit = ph.Duration / 8760.0 * (lth*PiThermal(0.7, tj, ph.On)*vfactor +
ltc*PiTCCase(ph.NCycles, ph.Duration, ph.Tdelta, ph.Tmax) +
lts*PiTCSolder(ph.NCycles, ph.Duration, ph.CycleDuration, ph.Tdelta, ph.Tmax) +
lrh*PiRH2(0.9, ph.RH, ph.Tamb, ph.On) +
lm*PiMech(ph.Grms))
ifactor, err := PiInduced(comp, ph)
if err != nil {
return math.NaN(), err
}
nfit *= ifactor
fit += nfit
}
fit *= PiPM() * PiProcess()
return fit, nil
}
func Lchip_th(c *Component) float64 {
var base float64
nfactor := 1.0
if c.N > 1 {
nfactor = math.Sqrt(float64(c.N))
}
// ICs
if c.Class == "U" {
base = 0.086
for _, tag := range c.Tags {
switch tag {
case "opto", "optocoupler":
if contains(c.Tags, "photodiode") {
base = 0.05
} else {
base = 0.11
}
break
case "mixed", "analog": // mixed or analog asic
base = 0.123
break
case "fpga", "cpld", "pal":
base = 0.076
break
case "microprocessor", "microcontroller", "dsp", "complex": // complex asic
base = 0.075
break
case "flash", "eprom", "eeprom":
base = 0.06
break
case "sram":
base = 0.053
break
case "dram":
base = 0.047
break
case "digital": // also simple digital asic"
base = 0.021
break
}
}
// Default value is for analog, mixed, interface
return base * nfactor
}
// Transistors
if c.Class == "Q" {
for _, tag := range c.Tags {
switch tag {
case "gan":
base = 0.3033
case "gaas":
base = 0.3756
case "igbt":
base = 0.3021
if c.Pmax >= 5 {
base = 0.56
}
break
case "triac", "thyristor":
base = 0.1976
break
case "jfet":
base = 0.0143
break
case "mos", "mosfet":
if c.Pmax >= 5 {
base = 0.56
} else {
base = 0.0145
}
break
}
}
// bipolar silicon transistor
if c.Pmax >= 5 {
base = 0.0478
} else {
base = 0.0138
}
return base * nfactor
}
// Diodes
if c.Class == "D" {
if contains(c.Tags, "zener") {
if c.Pmax < 1.5 {
base = 0.008
} else {
base = 0.0954
}
} else if contains(c.Tags, "tvs") {
if c.Pmax < 3000 {
base = 0.021
} else {
base = 1.498
}
} else {
// diode, signal or rectifier
if c.Imax < 1 {
base = 0.0044
} else if c.Imax < 3 {
base = 0.01
} else {
base = 0.1574
}
}
//log.Printf("D, base=%f, nfactor=%f\n", base, nfactor)
return base * nfactor
}
return -1
}