origen_std_lib 0.9.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +5 -5
  2. data/config/application.rb +7 -19
  3. data/config/commands.rb +9 -0
  4. data/config/version.rb +1 -2
  5. data/lib/origen_std_lib/v93k.rb +17 -1
  6. data/{stdlib/v93k → src/advantest/smt7}/origen/.cproject +0 -0
  7. data/{stdlib/v93k → src/advantest/smt7}/origen/.project +0 -0
  8. data/src/advantest/smt7/origen/origen.cpp +18 -0
  9. data/{stdlib/v93k → src/advantest/smt7}/origen/origen.hpp +3 -3
  10. data/{stdlib/v93k → src/advantest/smt7}/origen/origen/helpers.hpp +25 -8
  11. data/src/advantest/smt7/origen/origen/helpers/console.cpp +94 -0
  12. data/src/advantest/smt7/origen/origen/helpers/misc.cpp +456 -0
  13. data/src/advantest/smt7/origen/origen/helpers/time.cpp +64 -0
  14. data/src/advantest/smt7/origen/origen/site.cpp +237 -0
  15. data/src/advantest/smt7/origen/origen/site.hpp +49 -0
  16. data/{stdlib/v93k → src/advantest/smt7}/origen/origen/test_method.hpp +1 -3
  17. data/src/advantest/smt7/origen/origen/test_method/base.cpp +231 -0
  18. data/src/advantest/smt7/origen/origen/test_method/base.hpp +155 -0
  19. data/src/advantest/smt7/origen/origen/test_method/dc_measurement.cpp +266 -0
  20. data/src/advantest/smt7/origen/origen/test_method/dc_measurement.hpp +58 -0
  21. data/src/advantest/smt7/origen/origen/test_method/empty.cpp +13 -0
  22. data/src/advantest/smt7/origen/origen/test_method/empty.hpp +24 -0
  23. data/src/advantest/smt7/origen/origen/test_method/frequency_measurement.cpp +133 -0
  24. data/src/advantest/smt7/origen/origen/test_method/frequency_measurement.hpp +46 -0
  25. data/src/advantest/smt7/origen/origen/test_method/functional_test.cpp +168 -0
  26. data/src/advantest/smt7/origen/origen/test_method/functional_test.hpp +53 -0
  27. data/{stdlib/v93k → src/advantest/smt7}/origen/origen/utils.hpp +1 -3
  28. data/src/advantest/smt7/origen/origen/utils/version.cpp +72 -0
  29. data/{stdlib/v93k → src/advantest/smt7}/origen/origen/utils/version.hpp +20 -21
  30. data/src/advantest/smt7/origen/test_methods/ApplyBin.cpp +37 -0
  31. data/src/advantest/smt7/origen/test_methods/DCMeasurement.cpp +90 -0
  32. data/src/advantest/smt7/origen/test_methods/FrequencyMeasurement.cpp +50 -0
  33. data/src/advantest/smt7/origen/test_methods/FunctionalTest.cpp +24 -0
  34. data/src/advantest/smt7/origen/test_methods/RecordBin.cpp +39 -0
  35. data/src/advantest/smt8/origen/common/Origen.java +334 -0
  36. data/src/advantest/smt8/origen/common/OrigenData.java +391 -0
  37. data/src/advantest/smt8/origen/common/OrigenHelpers.java +170 -0
  38. data/src/advantest/smt8/origen/test_methods/Base.java +265 -0
  39. data/src/advantest/smt8/origen/test_methods/DC_Measurement.java +302 -0
  40. data/src/advantest/smt8/origen/test_methods/Empty.java +12 -0
  41. data/src/advantest/smt8/origen/test_methods/Functional_test.java +474 -0
  42. data/templates/web/faq.md.erb +1 -52
  43. data/templates/web/guides/intro.md.erb +8 -0
  44. data/templates/web/guides/{v93k/intro.md.erb → v93ksmt7/capture.md.erb} +0 -2
  45. data/templates/web/guides/v93ksmt7/complete.md.erb +68 -0
  46. data/templates/web/guides/v93ksmt7/customizable.md.erb +139 -0
  47. data/templates/web/guides/v93ksmt7/helpers.md.erb +3 -0
  48. data/templates/web/guides/{v93k → v93ksmt7}/install.md.erb +1 -1
  49. data/templates/web/guides/v93ksmt7/integration.md.erb +3 -0
  50. data/templates/web/guides/v93ksmt7/intro.md.erb +8 -0
  51. data/templates/web/guides/v93ksmt7/patching.md.erb +3 -0
  52. data/templates/web/guides/v93ksmt8/intro.md.erb +9 -0
  53. data/templates/web/index.md.erb +23 -6
  54. data/templates/web/layouts/_guides.html.erb +15 -3
  55. data/templates/web/partials/_common_args.md.erb +13 -0
  56. data/templates/web/partials/_navbar.html.erb +2 -2
  57. metadata +52 -33
  58. data/stdlib/v93k/origen/origen.cpp +0 -22
  59. data/stdlib/v93k/origen/origen/helpers/console.cpp +0 -105
  60. data/stdlib/v93k/origen/origen/helpers/misc.cpp +0 -311
  61. data/stdlib/v93k/origen/origen/site.cpp +0 -220
  62. data/stdlib/v93k/origen/origen/site.hpp +0 -51
  63. data/stdlib/v93k/origen/origen/test_method/base.hpp +0 -156
  64. data/stdlib/v93k/origen/origen/test_method/dc_measurement.cpp +0 -182
  65. data/stdlib/v93k/origen/origen/test_method/dc_measurement.hpp +0 -59
  66. data/stdlib/v93k/origen/origen/test_method/frequency_measurement.cpp +0 -107
  67. data/stdlib/v93k/origen/origen/test_method/frequency_measurement.hpp +0 -48
  68. data/stdlib/v93k/origen/origen/test_method/functional_test.cpp +0 -118
  69. data/stdlib/v93k/origen/origen/test_method/functional_test.hpp +0 -51
  70. data/stdlib/v93k/origen/origen/utils/version.cpp +0 -79
  71. data/stdlib/v93k/origen/test_methods/ApplyBin.cpp +0 -41
  72. data/stdlib/v93k/origen/test_methods/DCMeasurement.cpp +0 -129
  73. data/stdlib/v93k/origen/test_methods/FrequencyMeasurement.cpp +0 -93
  74. data/stdlib/v93k/origen/test_methods/FunctionalTest.cpp +0 -94
  75. data/stdlib/v93k/origen/test_methods/RecordBin.cpp +0 -48
@@ -1,22 +0,0 @@
1
- /** @file */
2
- #include "origen.hpp"
3
-
4
- namespace Origen {
5
-
6
- Utils::Version version() {
7
- Utils::Version v(ORIGEN_VERSION);
8
- return v;
9
- }
10
-
11
- vector<Site> Sites;
12
-
13
-
14
- Site& site() {
15
- return Sites[CURRENT_SITE_NUMBER()];
16
- }
17
-
18
- Site& site(int site) {
19
- return Sites[site];
20
- }
21
-
22
- }
@@ -1,105 +0,0 @@
1
- /** @file */
2
- #include "../helpers.hpp"
3
- #include <cerrno>
4
- #include <stdlib.h>
5
- #include "../../origen.hpp"
6
-
7
- using namespace std;
8
-
9
- namespace Origen {
10
-
11
- /// Prints the result of a parametric test to the console
12
- void logParametricTest(string name, int site, double result, LIMIT limits, string pin) {
13
-
14
- cout << site << " ";
15
- if (isPass(result, limits))
16
- cout << " ";
17
- else
18
- cout << "FAIL ";
19
- cout << left << setw(65) << setfill(' ') << name << " ";
20
- cout << left << setw(20) << setfill(' ') << loStr(limits) << " ";
21
- cout << left << setw(20) << setfill(' ') << result;
22
- cout << left << setw(20) << setfill(' ') << hiStr(limits);
23
- cout << pin << endl;
24
-
25
- }
26
-
27
- /// Returns a LIMIT object with no limits enabled
28
- LIMIT noLimits() {
29
- return LIMIT(TM::NA, 0, TM::NA, 0);
30
- }
31
-
32
- /// Prints the result of a functional test to the console
33
- void logFunctionalTest(string name, int site, bool passed, string pattern) {
34
- cout << site << " ";
35
- if (passed)
36
- cout << " ";
37
- else
38
- cout << "FAIL ";
39
- cout << left << setw(65) << setfill(' ') << name << " ";
40
- cout << pattern << endl;
41
- }
42
-
43
- /// Converts the low limit in the given LIMIT object into a string, where an empty string will be returned if the limit is not enabled
44
- string loStr(LIMIT limits) {
45
- double lo = 0.0;
46
- double * plo = &lo;
47
- TM::COMPARE clo;
48
-
49
- clo = limits.getLow(plo);
50
-
51
- if (clo == TM::NA) {
52
- return "";
53
- } else {
54
- stringstream val;
55
- val << lo;
56
- return val.str();
57
- }
58
- }
59
-
60
- /// Converts the high limit in the given LIMIT object into a string, where an empty string will be returned if the limit is not enabled
61
- string hiStr(LIMIT limits) {
62
- double hi = 0.0;
63
- double * phi = &hi;
64
- TM::COMPARE chi;
65
-
66
- chi = limits.getHigh(phi);
67
-
68
- if (chi == TM::NA) {
69
- return "";
70
- } else {
71
- stringstream val;
72
- val << hi;
73
- return val.str();
74
- }
75
- }
76
- /// Returns true if the result is within the given limits
77
- bool isPass(double val, LIMIT limits) {
78
- double lo = 0.0;
79
- double hi = 0.0;
80
- double * plo = &lo;
81
- double * phi = &hi;
82
- TM::COMPARE clo, chi;
83
- bool result;
84
-
85
- clo = limits.getLow(plo);
86
- chi = limits.getHigh(phi);
87
-
88
- result = true;
89
-
90
- if (clo != TM::NA) {
91
- if (clo == TM::GE && val < lo)
92
- result = false;
93
- if (clo == TM::GT && val <= lo)
94
- result = false;
95
- }
96
- if (chi != TM::NA) {
97
- if (chi == TM::LE && val > hi)
98
- result = false;
99
- if (chi == TM::LT && val >= hi)
100
- result = false;
101
- }
102
- return result;
103
- }
104
-
105
- }
@@ -1,311 +0,0 @@
1
- /** @file */
2
- #include "../helpers.hpp"
3
- #include <cerrno>
4
- #include <stdlib.h>
5
- #include "../../origen.hpp"
6
-
7
- using namespace std;
8
-
9
- namespace Origen {
10
-
11
-
12
- uint64_t flip(uint64_t input, int size) {
13
- uint64_t output = 0;
14
- for (int i = 0; i < size; i++) {
15
- output <<= 1;
16
- output |= input & 1;
17
- input >>= 1;
18
- }
19
- return output;
20
- }
21
-
22
-
23
- /// Split the given string by the given delimiter and return the results in a vector of strings
24
- ///
25
- /// split("AB1234-24", '-') // => ["AB1234", "24"]
26
- vector<string> split(const string &str, char delim) {
27
- vector<string> elems;
28
- split(str, delim, elems);
29
- return elems;
30
- }
31
-
32
- /// This version places the result in the supplied vector rather than returning a new one
33
- void split(const string &str, char delim, vector<string> &elems) {
34
- stringstream ss;
35
- ss.str(str);
36
- string item;
37
- while (getline(ss, item, delim)) {
38
- elems.push_back(item);
39
- }
40
- }
41
-
42
- ///
43
- string ltrim(string str, const char * remove_chars /* = " \n\t\r\f\v" */) {
44
- str.erase(0, str.find_first_not_of(remove_chars));
45
- return str;
46
- }
47
-
48
-
49
- string rtrim(string str, const char * remove_chars /* = " \n\t\r\f\v" */) {
50
- str.erase(str.find_last_not_of(remove_chars)+1);
51
- return str;
52
- }
53
-
54
-
55
- string trim(string str, const char * remove_chars /* = " \n\t\r\f\v" */) {
56
- str = rtrim(str, remove_chars);
57
- str = ltrim(str, remove_chars);
58
- return str;
59
- }
60
-
61
-
62
- /// Convert the given string to a 64-bit integer. Works for both decimal and hex strings as
63
- /// shown in the examples below.
64
- ///
65
- /// If the string is not successfully converted the site in focus will be binned out.
66
- ///
67
- /// toInt("0xFF") // => 255
68
- /// toInt("FF", 16) // => 255 (must declare base 16 if no leading 0x)
69
- /// toInt("255") // => 255
70
- int64_t toInt (string str, int base)
71
- {
72
- str = trim(str); // Remove any whitespace
73
- str = ltrim(str, "0"); // Remove any leading 0's
74
- if (str == "") {
75
- return 0;
76
- }
77
- char *end;
78
- char *cstr = const_cast<char*>(str.c_str());
79
- long long int l;
80
- errno = 0;
81
- l = strtoll(cstr, &end, base);
82
- if ((errno == ERANGE && l == LLONG_MAX) || l > LLONG_MAX) {
83
- cout << "ERROR: String conversion overflowed a 64-bit integer - " << str << endl;
84
- ERROR_EXIT(TM::EXIT_FLOW);
85
- }
86
- if ((errno == ERANGE && l == LLONG_MIN) || l < LLONG_MIN) {
87
- cout << "ERROR: String conversion underflowed a 64-bit integer - " << str << endl;
88
- ERROR_EXIT(TM::EXIT_FLOW);
89
- }
90
- if (*cstr == '\0' || *end != '\0') {
91
- cout << "ERROR: String is not convertible to a 64-bit integer - " << str << endl;
92
- ERROR_EXIT(TM::EXIT_FLOW);
93
- }
94
- return (int64_t) l;
95
- }
96
-
97
- /// See toInt, but returns an unsigned 64-bit integer
98
- uint64_t toUInt (string str, int base)
99
- {
100
- str = trim(str); // Remove any whitespace
101
- str = ltrim(str, "0"); // Remove any leading 0's
102
- if (str == "") {
103
- return 0;
104
- }
105
-
106
- char *end;
107
- char *cstr = const_cast<char*>(str.c_str());
108
- unsigned long long int l;
109
- errno = 0;
110
- l = strtoull(cstr, &end, base);
111
- if (errno == ERANGE && l == ULLONG_MAX) {
112
- cout << "ERROR: String conversion was out of the range of a UInt64 - " << str << endl;
113
- ERROR_EXIT(TM::EXIT_FLOW);
114
- }
115
- if (*cstr == '\0' || *end != '\0') {
116
- cout << "ERROR: String is not convertible to a UInt64 - " << str << endl;
117
- ERROR_EXIT(TM::EXIT_FLOW);
118
- }
119
- return (uint64_t) l;
120
- }
121
-
122
- /// Convert the given number to a hex string
123
- ///
124
- /// toHex(255); // => "ff"
125
- string toHex (const uint64_t &val)
126
- {
127
- stringstream stream;
128
- stream << hex << val;
129
- return stream.str();
130
- }
131
-
132
- /// Convert the given number to a string
133
- ///
134
- /// toStr(255); // => "255"
135
- string toStr (const uint64_t &val)
136
- {
137
- stringstream stream;
138
- stream << val;
139
- return stream.str();
140
- }
141
-
142
- /// Uppercase the given string
143
- ///
144
- /// upcase("ff"); // => "FF"
145
- string upcase(string base) {
146
- transform(base.begin(), base.end(), base.begin(), ::toupper);
147
- return base;
148
- }
149
-
150
- /// Extend the string to the given size, padding with the given character on the left
151
- ///
152
- /// lpad("FF", 4, '0'); // => "00FF"
153
- string lpad(string base, int length, char fill) {
154
- stringstream padded;
155
- padded << right << setw(length) << setfill(fill) << base;
156
- return padded.str();
157
- }
158
-
159
- /// Extend the string to the given size, padding with the given character on the right
160
- ///
161
- /// rpad("FF", 4, ' '); // => "FF "
162
- string rpad(string base, int length, char fill) {
163
- stringstream padded;
164
- padded << left << setw(length) << setfill(fill) << base;
165
- return padded.str();
166
- }
167
-
168
- /// Returns true if the given number is even
169
- bool isEven(uint64_t number) {
170
- return number % 2 == 0;
171
- }
172
-
173
- /// Returns true if the given number is odd
174
- bool isOdd(uint64_t number) {
175
- return number % 2 != 0;
176
- }
177
-
178
- /// Overlays the given data on the given pin, starting from the first vector of the given pattern
179
- void overlaySubroutine(string subroutinePattern, string pin, uint64_t data, int size) {
180
- string p = extractPinsFromGroup(pin);
181
- string pat = subroutinePattern;
182
- VEC_LABEL_EDIT ov(pat, p);
183
-
184
- // Need to use a vector here so the size can be determined at runtime
185
- vector<VECTOR_DATA> vecData(size);
186
-
187
- for(int i = 0; i < size; i++) {
188
- int val = (data & (1 << i)) >> i;
189
- VECTOR_DATA v = {i, val};
190
- vecData[i] = v;
191
- }
192
-
193
- // However the downloadUserVectors function only accepts an array, so use this trick
194
- // to create an array instance that points to the vector data
195
- VECTOR_DATA * vecDataArray = &vecData[0];
196
-
197
- ov.downloadUserVectors(vecDataArray, size);
198
- }
199
-
200
- /// Same as overlaySubroutine but the data is applied in reverse order
201
- void reverseOverlaySubroutine(string subroutinePattern, string pin, uint64_t data, int size) {
202
- string p = extractPinsFromGroup(pin);
203
- string pat = subroutinePattern;
204
- VEC_LABEL_EDIT ov(pat, p);
205
-
206
- // Need to use a vector here so the size can be determined at runtime
207
- vector<VECTOR_DATA> vecData(size);
208
-
209
- for(int i = 0; i < size; i++) {
210
- int j = size - 1 - i;
211
- int val = (data & (1 << j)) >> j;
212
- VECTOR_DATA v = {i, val};
213
- vecData[i] = v;
214
- }
215
-
216
- // However the downloadUserVectors function only accepts an array, so use this trick
217
- // to create an array instance that points to the vector data
218
- VECTOR_DATA * vecDataArray = &vecData[0];
219
-
220
- ov.downloadUserVectors(vecDataArray, size);
221
- }
222
-
223
- /// Returns the number of 1's (bits that are set) in the given 32-bit number
224
- int numberOfOnes(uint32_t i)
225
- {
226
- i = i - ((i >> 1) & 0x55555555);
227
- i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
228
- return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
229
- }
230
-
231
- /// Returns the number of 0's (bits that are not set) in the given 32-bit number
232
- int numberOfZeros(uint32_t i)
233
- {
234
- return 32 - numberOfOnes(i);
235
- }
236
-
237
-
238
- double calculateFrequency(const ARRAY_I &captureData, double periodInNs) {
239
- int iFreqCount;
240
- double dFreq_MHz;
241
-
242
- iFreqCount=0;
243
- for(int j=0; j<captureData.size()-1; j++)
244
- {
245
- if((captureData[j+1] - captureData[j]) == 1){
246
- iFreqCount++;
247
- }
248
- }
249
- dFreq_MHz = iFreqCount / ((periodInNs / 1000) * captureData.size());
250
- return dFreq_MHz * 1000000;
251
- }
252
-
253
- double calculatePeriod(const ARRAY_I &captureData, double periodInNs) {
254
- return 1 / calculateFrequency(captureData, periodInNs);
255
- }
256
-
257
- /// Call to wait for all SMC threads to complete, supply the max amount of seconds to wait
258
- void synchronize(double timeout)
259
- {
260
- bool ok;
261
- int site = CURRENT_SITE_NUMBER();
262
-
263
- if (timeout) {
264
- ok = SMC_SYNCHRONIZE(timeout s);
265
- } else {
266
- ok = SMC_SYNCHRONIZE();
267
- }
268
-
269
- if (! ok) {
270
- cout << "ERROR: All SMC threads not complete after " << timeout << " second(s) on site " << site << endl;
271
- ERROR_EXIT(TM::EXIT_FLOW);
272
- }
273
- }
274
-
275
- /// Supply a pin alias name and get the name of the physical pin returned
276
- string extractPinsFromGroup(const string& groupname)
277
- {
278
- string pinlist;
279
-
280
- try{
281
- pinlist = PinUtility.createPinListFromPinNames(PinUtility.getDigitalPinNamesFromPinList(groupname, TM::ALL_DIGITAL,true,true,PIN_UTILITY::DEFINITION_ORDER));
282
- } catch(...) {
283
- cout << "ERROR: Pingroup " << groupname << " not found." << endl;
284
- ERROR_EXIT(TM::ABORT_FLOW);
285
- }
286
-
287
- return pinlist;
288
- }
289
-
290
- // Initializes the site objects that are used to store the ECID, this should be called at
291
- // the start of the test flow if using the Origen.site API
292
- void initializeSites() {
293
- INT num_of_sites;
294
- ARRAY_I sites;
295
-
296
- ON_FIRST_INVOCATION_BEGIN();
297
-
298
- num_of_sites = GET_CONFIGURED_SITES(sites);
299
-
300
- // Leave an empty space at 0, easier then to fetch by site number (which start at 1)
301
- Origen::Sites.resize(num_of_sites + 1, Origen::Site(0));
302
-
303
- ON_FIRST_INVOCATION_END();
304
-
305
- // Instantiate a new site object and save it in the global site array
306
- Origen::Site site(CURRENT_SITE_NUMBER());
307
-
308
- Origen::Sites[CURRENT_SITE_NUMBER()] = site;
309
- }
310
-
311
- }
@@ -1,220 +0,0 @@
1
- #include "site.hpp"
2
- #include <libcicpi.h>
3
- #include <iostream>
4
- #include "helpers.hpp"
5
- using namespace std;
6
-
7
- namespace Origen {
8
-
9
- Site::Site(int number) {
10
- _number = number;
11
- lotidSet = false;
12
- waferSet = false;
13
- xSet = false;
14
- ySet = false;
15
- binSet = false;
16
- softbinSet = false;
17
- }
18
- Site::~Site() {}
19
-
20
- /// Set the lot ID to the given value, e.g. "ABC1234"
21
- void Site::lotid(string val) {
22
- lotidSet = true;
23
- _lotid = val;
24
- }
25
-
26
-
27
- /// Set the lot ID based on the integer representation returned from lotidInt
28
- void Site::lotid(uint64_t val) {
29
- string id = "";
30
-
31
- for(int i = 0; i < 8; i++) {
32
- int ch = val >> (8 * (7 - i));
33
- if (ch != 0) {
34
- id = id + (char)ch;
35
- }
36
- }
37
-
38
- lotid(id);
39
- }
40
-
41
-
42
- /// Get the lot ID. If it has not previously been set to a value it will be automatically queried from the test system.
43
- string Site::lotid() {
44
- if (!lotidSet) {
45
- char value[CI_CPI_MAX_MODL_STRING_LEN * 2];
46
- if (!GetModelfileString(const_cast<char*>("LOT_ID"), value)) {
47
- _lotid = (string) value;
48
- } else {
49
- _lotid = "Undefined";
50
- }
51
- lotidSet = true;
52
- }
53
- return _lotid;
54
- }
55
-
56
- /// Returns the lot ID as a 64-bit integer that is suitable for programming to the device.
57
- /// Each character in the lotID is converted to its ASCII code.
58
- /// An error will be raised if the length of the current lotID overflows 64-bits.
59
- uint64_t Site::lotidInt() {
60
- string id = lotid();
61
- stringstream val;
62
-
63
- // If the ID is > 8 chars then lose the upper chars, making the assuming that the lower ones are
64
- // the more significant ones for the purposes of identifying a particular lot
65
- if (id.length() > 8) {
66
- id = id.substr(id.length() - 8, 8);
67
- }
68
- if (id.length() > 0) val << toHex((int)id.at(0));
69
- if (id.length() > 1) val << toHex((int)id.at(1));
70
- if (id.length() > 2) val << toHex((int)id.at(2));
71
- if (id.length() > 3) val << toHex((int)id.at(3));
72
- if (id.length() > 4) val << toHex((int)id.at(4));
73
- if (id.length() > 5) val << toHex((int)id.at(5));
74
- if (id.length() > 6) val << toHex((int)id.at(6));
75
- if (id.length() > 7) val << toHex((int)id.at(7));
76
-
77
- return toUInt(val.str(), 16);
78
- }
79
-
80
-
81
- /// Set the wafer number to the given value
82
- void Site::wafer(int val) {
83
- waferSet = true;
84
- if (val < 0 || val > 255) {
85
- cout << "ERROR: Wafer is out of the range of a UInt8: " << val << endl;
86
- ERROR_EXIT(TM::EXIT_FLOW);
87
- }
88
- _wafer = (uint8_t)val;
89
- }
90
-
91
- /// Get the wafer number. If it has not previously been set to a value it will be automatically queried from the test system.
92
- int Site::wafer() {
93
- if (!waferSet) {
94
- char value[CI_CPI_MAX_MODL_STRING_LEN * 2];
95
-
96
- // if (!GetModelfileString(const_cast<char*>("WAFER_ID"), value)) {
97
- // Expect to return something like "AB1234-15AA", where 15 is the wafer number
98
- //wafer(toInt(split((string) value, '-')[1].substr(0, 2)));
99
- if (!GetModelfileString(const_cast<char*>("WAFER_NUMBER"), value)) {
100
- wafer(toInt((string) value));
101
- } else {
102
- wafer(0xFF);
103
- }
104
- waferSet = true;
105
- }
106
- return _wafer;
107
- }
108
-
109
-
110
- /// Set the X co-ordinate to the given value
111
- void Site::x(int val) {
112
- xSet = true;
113
- _x = val;
114
- }
115
-
116
- /// Get the X co-ord. If it has not previously been set to a value it will be automatically queried from the test system.
117
- int Site::x() {
118
- if (!xSet) {
119
- long lx, ly;
120
- GetDiePosXYOfSite(_number, &lx, &ly);
121
- if (lx < -32768 || lx > 32767) {
122
- cout << "ERROR: X is out of the range of an Int16: " << lx << endl;
123
- ERROR_EXIT(TM::EXIT_FLOW);
124
- }
125
- if (ly < -32768 || ly > 32767) {
126
- cout << "ERROR: Y is out of the range of an Int16: " << ly << endl;
127
- ERROR_EXIT(TM::EXIT_FLOW);
128
- }
129
- _x = (int) lx;
130
- _y = (int) ly;
131
- xSet = true;
132
- ySet = true;
133
- }
134
- return _x;
135
- }
136
-
137
-
138
- /// Set the Y co-ordinate to the given value
139
- void Site::y(int val) {
140
- ySet = true;
141
- _y = val;
142
- }
143
-
144
- /// Get the Y co-ord. If it has not previously been set to a value it will be automatically queried from the test system.
145
- int Site::y() {
146
- if (!ySet) {
147
- long lx, ly;
148
- GetDiePosXYOfSite(_number, &lx, &ly);
149
- if (lx < -32768 || lx > 32767) {
150
- cout << "ERROR: X is out of the range of an Int16: " << lx << endl;
151
- ERROR_EXIT(TM::EXIT_FLOW);
152
- }
153
- if (ly < -32768 || ly > 32767) {
154
- cout << "ERROR: Y is out of the range of an Int16: " << ly << endl;
155
- ERROR_EXIT(TM::EXIT_FLOW);
156
- }
157
- _x = (int) lx;
158
- _y = (int) ly;
159
- xSet = true;
160
- ySet = true;
161
- }
162
- return _y;
163
- }
164
-
165
- /// Set the site's bin to the given value, but only if a bin has not already been set.
166
- /// Note that this does not actually bin out the site but just records the bin assignment
167
- /// in a variable that can be retrieved by calling bin().
168
- void Site::bin(int val) {
169
- if (!binSet) {
170
- binSet = true;
171
- _bin = val;
172
- }
173
- }
174
-
175
- /// Set the site's bin to the given value, but only if a bin has not already been set or
176
- /// if the force argument is set to true, in which case it will overwrite any previous
177
- /// assignment.
178
- /// Note that this does not actually bin out the site but just records the bin assignment
179
- /// in a variable that can be retrieved by calling bin().
180
- void Site::bin(int val, bool force) {
181
- if (!binSet || force) {
182
- binSet = true;
183
- _bin = val;
184
- }
185
- }
186
-
187
- /// Returns the bin that has been assigned to the site by previously calling bin(int), if no
188
- /// bin has been assigned then it will return 0.
189
- int Site::bin() {
190
- return (binSet) ? _bin : 0;
191
- }
192
-
193
- /// Set the site's softbin to the given value, but only if a softbin has not already been set.
194
- /// Note that this does not actually bin out the site but just records the softbin assignment
195
- /// in a variable that can be retrieved by calling softbin().
196
- void Site::softbin(int val) {
197
- if (!softbinSet) {
198
- softbinSet = true;
199
- _softbin = val;
200
- }
201
- }
202
-
203
- /// Set the site's softbin to the given value, but only if a softbin a has not already been set or
204
- /// if the force argument is set to true, in which case it will overwrite any previous
205
- /// assignment.
206
- /// Note that this does not actually bin out the site but just records the softbin assignment
207
- /// in a variable that can be retrieved by calling softbin().
208
- void Site::softbin(int val, bool force) {
209
- if (!softbinSet || force) {
210
- softbinSet = true;
211
- _softbin = val;
212
- }
213
- }
214
-
215
- /// Returns the bin that has been assigned to the site by previously calling bin(int), if no
216
- /// bin has been assigned then it will return 0.
217
- int Site::softbin() {
218
- return (softbinSet) ? _softbin : 0;
219
- }
220
- } /* namespace Origen */