origen_std_lib 0.9.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,72 @@
1
+ #include "version.hpp"
2
+ using namespace std;
3
+
4
+ #include <sstream>
5
+
6
+ namespace Origen {
7
+ namespace Utils {
8
+
9
+ Version::Version(string ver) {
10
+ vector<int> v = parse(ver);
11
+ _major = v[0];
12
+ _minor = v[1];
13
+ _tiny = v[2];
14
+ }
15
+
16
+ int Version::major() { return _major; }
17
+ int Version::minor() { return _minor; }
18
+ int Version::tiny() { return _tiny; }
19
+
20
+ string Version::str() {
21
+ ostringstream str;
22
+ str << _major;
23
+ str << ".";
24
+ str << _minor;
25
+ str << ".";
26
+ str << _tiny;
27
+ return str.str();
28
+ }
29
+
30
+ bool Version::operator==(string rhs) {
31
+ vector<int> v = parse(rhs);
32
+ return _major == v[0] && _minor == v[1] && _tiny == v[2];
33
+ }
34
+
35
+ bool Version::operator!=(string rhs) {
36
+ vector<int> v = parse(rhs);
37
+ return _major != v[0] || _minor != v[1] || _tiny != v[2];
38
+ }
39
+
40
+ bool Version::operator<(string rhs) {
41
+ vector<int> v = parse(rhs);
42
+ return _major < v[0] || (_major == v[0] && _minor < v[1]) ||
43
+ (_major == v[0] && _minor == v[1] && _tiny < v[2]);
44
+ }
45
+
46
+ bool Version::operator<=(string rhs) {
47
+ return operator==(rhs) || operator<(rhs);
48
+ }
49
+
50
+ bool Version::operator>(string rhs) {
51
+ vector<int> v = parse(rhs);
52
+ return _major > v[0] || (_major == v[0] && _minor > v[1]) ||
53
+ (_major == v[0] && _minor == v[1] && _tiny > v[2]);
54
+ }
55
+
56
+ bool Version::operator>=(string rhs) {
57
+ return operator==(rhs) || operator>(rhs);
58
+ }
59
+
60
+ vector<int> Version::parse(string ver) {
61
+ vector<int> v(3);
62
+
63
+ istringstream parser(ver);
64
+ parser >> v[0];
65
+ for (int i = 1; i < 3; i++) {
66
+ parser.get(); // Skip dot
67
+ parser >> v[i];
68
+ }
69
+ return v;
70
+ }
71
+ }
72
+ }
@@ -3,7 +3,8 @@
3
3
 
4
4
  // GCC adds these macros by default, which clobbers our functions
5
5
  // of the same name
6
- #if (defined(__GNUC__) || defined(__GNUG__)) && !(defined(__clang__) || defined(__INTEL_COMPILER))
6
+ #if (defined(__GNUC__) || defined(__GNUG__)) && \
7
+ !(defined(__clang__) || defined(__INTEL_COMPILER))
7
8
  // Not exactly sure the version that this becomes a problem, but for
8
9
  // now this fixes the build on the V93K production system
9
10
  #if (__GNUC_MINOR__ > 1)
@@ -37,27 +38,25 @@ namespace Utils {
37
38
  // // Do something
38
39
  // }
39
40
  class Version {
40
-
41
- private:
42
- vector<int> parse(string ver);
43
- int _major;
44
- int _minor;
45
- int _tiny;
46
-
47
- public:
48
- int major();
49
- int minor();
50
- int tiny();
51
- Version(string ver);
52
- bool operator==(string rhs);
53
- bool operator!=(string rhs);
54
- bool operator<(string rhs);
55
- bool operator<=(string rhs);
56
- bool operator>(string rhs);
57
- bool operator>=(string rhs);
58
- string str();
41
+ private:
42
+ vector<int> parse(string ver);
43
+ int _major;
44
+ int _minor;
45
+ int _tiny;
46
+
47
+ public:
48
+ int major();
49
+ int minor();
50
+ int tiny();
51
+ Version(string ver);
52
+ bool operator==(string rhs);
53
+ bool operator!=(string rhs);
54
+ bool operator<(string rhs);
55
+ bool operator<=(string rhs);
56
+ bool operator>(string rhs);
57
+ bool operator>=(string rhs);
58
+ string str();
59
59
  };
60
-
61
60
  }
62
61
  }
63
62
 
@@ -0,0 +1,37 @@
1
+ #include "testmethod.hpp"
2
+
3
+ // for test method API interfaces
4
+ #include "mapi.hpp"
5
+ using namespace std;
6
+ #include "origen.hpp"
7
+
8
+ /**
9
+ * Test method class.
10
+ *
11
+ * For each testsuite using this test method, one object of this
12
+ * class is created.
13
+ */
14
+ class OrigenApplyBin : public testmethod::TestMethod {
15
+ protected:
16
+ /**
17
+ *Initialize the parameter interface to the testflow.
18
+ *This method is called just once after a testsuite is created.
19
+ */
20
+ virtual void initialize() {
21
+ // Add your initialization code here
22
+ // Note: Test Method API should not be used in this method!
23
+ }
24
+
25
+ /**
26
+ *This test is invoked per site.
27
+ */
28
+ virtual void run() {
29
+ if (Origen::site().bin() || Origen::site().softbin()) {
30
+ stringstream softbin;
31
+ softbin << Origen::site().softbin();
32
+ SET_MULTIBIN(softbin.str(), Origen::site().bin());
33
+ TESTSET().judgeAndLog_FunctionalTest(false);
34
+ }
35
+ }
36
+ };
37
+ REGISTER_TESTMETHOD("ApplyBin", OrigenApplyBin);
@@ -0,0 +1,90 @@
1
+ #include "origen/test_method/dc_measurement.hpp"
2
+
3
+ /**
4
+ * Test method class.
5
+ *
6
+ * For each testsuite using this test method, one object of this
7
+ * class is created.
8
+ */
9
+ class OrigenDCMeasurement : public Origen::TestMethod::DCMeasurement {
10
+ protected:
11
+ int mApplyShutdown;
12
+ string mShutdownPattern;
13
+ string mMeasure;
14
+ double mSettlingTime;
15
+ string mPin;
16
+ string mPort;
17
+ double mForceValue;
18
+ double mIRange;
19
+ int mCheckShutdown;
20
+ int mBadc;
21
+
22
+ protected:
23
+ /**
24
+ *Initialize the parameter interface to the testflow.
25
+ *This method is called just once after a testsuite is created.
26
+ */
27
+ virtual void init() {
28
+ // Add your initialization code here
29
+ // Note: Test Method API should not be used in this method!
30
+ addParameter("applyShutdown", "int", &mApplyShutdown,
31
+ testmethod::TM_PARAMETER_INPUT)
32
+ .setDefault("1")
33
+ .setComment("Apply a shutdown pattern after taking the measurement");
34
+ addParameter("shutdownPattern", "string", &mShutdownPattern,
35
+ testmethod::TM_PARAMETER_INPUT)
36
+ .setComment(
37
+ "The name of the shutdown pattern, by default it will be the main "
38
+ "pattern name appended with '_part1'");
39
+ addParameter("checkShutdown", "int", &mCheckShutdown,
40
+ testmethod::TM_PARAMETER_INPUT)
41
+ .setDefault("1")
42
+ .setComment("Check that the shutdown pattern passed (and fail if not)");
43
+ addParameter("measure", "string", &mMeasure, testmethod::TM_PARAMETER_INPUT)
44
+ .setDefault("VOLT")
45
+ .setComment("Measure 'CURR' or 'VOLT' (the default)");
46
+ addParameter("settlingTime", "double", &mSettlingTime,
47
+ testmethod::TM_PARAMETER_INPUT)
48
+ .setDefault("0")
49
+ .setComment(
50
+ "Time to wait between running the pattern and taking the "
51
+ "measurement, expressed in ms");
52
+ addParameter("pin", "PinString", &mPin, testmethod::TM_PARAMETER_INPUT)
53
+ .setComment("Pin to be measured");
54
+ addParameter("port", "string", &mPort, testmethod::TM_PARAMETER_INPUT)
55
+ .setDefault("")
56
+ .setComment("Port the pattern is to be executed on");
57
+ addParameter("forceValue", "double", &mForceValue,
58
+ testmethod::TM_PARAMETER_INPUT)
59
+ .setDefault("0")
60
+ .setComment("Value to be forced on the pin during the measurement");
61
+ addParameter("iRange", "double", &mIRange, testmethod::TM_PARAMETER_INPUT)
62
+ .setDefault("0")
63
+ .setComment(
64
+ "The current range to apply to the measurement (in A), will be "
65
+ "calculated if not supplied (set to 0)");
66
+ addParameter("badc", "int", &mBadc, testmethod::TM_PARAMETER_INPUT)
67
+ .setDefault("0")
68
+ .setComment(
69
+ "Perform the measurement using the Board ADC (rather than the "
70
+ "PPMU)");
71
+ }
72
+
73
+ /**
74
+ *This test is invoked per site.
75
+ */
76
+ virtual void body() {
77
+ origen.applyShutdown(mApplyShutdown)
78
+ .forceValue(mForceValue)
79
+ .shutdownPattern(mShutdownPattern)
80
+ .checkShutdown(mCheckShutdown)
81
+ .measure(mMeasure)
82
+ .settlingTime(mSettlingTime)
83
+ .pin(mPin)
84
+ .port(mPort)
85
+ .iRange(mIRange)
86
+ .badc(mBadc)
87
+ .execute();
88
+ }
89
+ };
90
+ REGISTER_TESTMETHOD("DCMeasurement", OrigenDCMeasurement);
@@ -0,0 +1,50 @@
1
+ #include "origen/test_method/frequency_measurement.hpp"
2
+
3
+ class OrigenFrequencyMeasurement
4
+ : public Origen::TestMethod::FrequencyMeasurement {
5
+ protected:
6
+ int mPeriodBased;
7
+ string mPin;
8
+ string mPort;
9
+ int mSamples;
10
+ int mPeriodInNs;
11
+
12
+ protected:
13
+ /**
14
+ *Initialize the parameter interface to the testflow.
15
+ *This method is called just once after a testsuite is created.
16
+ */
17
+ virtual void init() {
18
+ addParameter("periodBased", "int", &mPeriodBased,
19
+ testmethod::TM_PARAMETER_INPUT)
20
+ .setDefault("0")
21
+ .setComment(
22
+ "Set to 1 if the limits are expressed as a period instead of a "
23
+ "frequency (the default)");
24
+ addParameter("pin", "PinString", &mPin, testmethod::TM_PARAMETER_INPUT)
25
+ .setComment("Pin to be measured");
26
+ addParameter("port", "string", &mPort, testmethod::TM_PARAMETER_INPUT)
27
+ .setDefault("")
28
+ .setComment("Port the pattern is to be executed on");
29
+ addParameter("samples", "int", &mSamples, testmethod::TM_PARAMETER_INPUT)
30
+ .setDefault("2000")
31
+ .setComment(
32
+ "The number of captures made by the pattern, defaults to 2000");
33
+ addParameter("periodInNs", "int", &mPeriodInNs,
34
+ testmethod::TM_PARAMETER_INPUT)
35
+ .setComment("The period of the capture vectors");
36
+ }
37
+
38
+ /**
39
+ *This test is invoked per site.
40
+ */
41
+ virtual void body() {
42
+ origen.periodBased(mPeriodBased)
43
+ .pin(mPin)
44
+ .port(mPort)
45
+ .samples(mSamples)
46
+ .periodInNs(mPeriodInNs)
47
+ .execute();
48
+ }
49
+ };
50
+ REGISTER_TESTMETHOD("FrequencyMeasurement", OrigenFrequencyMeasurement);
@@ -0,0 +1,24 @@
1
+ #include "origen/test_method/functional_test.hpp"
2
+
3
+ class OrigenFunctionalTest : public Origen::TestMethod::FunctionalTest {
4
+ protected:
5
+ string mPort;
6
+
7
+ protected:
8
+ /**
9
+ *Initialize the parameter interface to the testflow.
10
+ *This method is called just once after a testsuite is created.
11
+ */
12
+ virtual void init() {
13
+ // NOTE: The capture arguments are not listed here since it makes no sense
14
+ // to use them without
15
+ // corresponding functions to handle the captured data
16
+
17
+ addParameter("port", "string", &mPort, testmethod::TM_PARAMETER_INPUT)
18
+ .setDefault("")
19
+ .setComment("Port the pattern is to be executed on");
20
+ }
21
+
22
+ virtual void body() { origen.port(mPort).execute(); }
23
+ };
24
+ REGISTER_TESTMETHOD("FunctionalTest", OrigenFunctionalTest);
@@ -0,0 +1,39 @@
1
+ #include "testmethod.hpp"
2
+
3
+ // for test method API interfaces
4
+ #include "mapi.hpp"
5
+ using namespace std;
6
+ #include "origen.hpp"
7
+
8
+ /**
9
+ * Test method class.
10
+ *
11
+ * For each testsuite using this test method, one object of this
12
+ * class is created.
13
+ */
14
+ class OrigenRecordBin : public testmethod::TestMethod {
15
+ protected:
16
+ int mBin;
17
+ int mSoftbin;
18
+
19
+ protected:
20
+ /**
21
+ *Initialize the parameter interface to the testflow.
22
+ *This method is called just once after a testsuite is created.
23
+ */
24
+ virtual void initialize() {
25
+ // Add your initialization code here
26
+ // Note: Test Method API should not be used in this method!
27
+ addParameter("bin", "int", &mBin, testmethod::TM_PARAMETER_INPUT);
28
+ addParameter("softbin", "int", &mSoftbin, testmethod::TM_PARAMETER_INPUT);
29
+ }
30
+
31
+ /**
32
+ *This test is invoked per site.
33
+ */
34
+ virtual void run() {
35
+ Origen::site().bin(mBin);
36
+ Origen::site().softbin(mSoftbin);
37
+ }
38
+ };
39
+ REGISTER_TESTMETHOD("RecordBin", OrigenRecordBin);
@@ -0,0 +1,334 @@
1
+ package origen.common;
2
+
3
+ import java.util.List;
4
+ import xoc.dta.ITestContext;
5
+ import xoc.dta.datatypes.MultiSiteLong;
6
+ import xoc.dta.datatypes.MultiSiteString;
7
+ import xoc.dta.measurement.IMeasurement;
8
+ import xoc.dta.setupaccess.IPattern;
9
+ import xoc.dta.signals.ISignal;
10
+
11
+ public class Origen {
12
+
13
+ /**
14
+ * Define the different loglevels <br>
15
+ * Internally the SMT8 logging system will be used (message()) the constants here just work as
16
+ * shorthand for default use cases
17
+ */
18
+ public static final int LOG_METHODTRACE = 9;
19
+
20
+ public static final int LOG_DATA = 10;
21
+ public static final int LOG_PARAM = 3;
22
+ public static final int LOG_FUNC = 4;
23
+ public static final int LOG_FAIL = 2;
24
+ public static final int LOG_WARNING = 1;
25
+ public static final int LOG_ERROR = 0;
26
+
27
+ // All general multisite variables
28
+ // The booleans keep track of their state, these are not multisite since we only use multisite
29
+ // assignments for the _vars
30
+ private static MultiSiteString _lotid;
31
+ private static boolean _lotidSet;
32
+
33
+ private static MultiSiteLong _wafer;
34
+ private static boolean _waferSet;
35
+
36
+ private static MultiSiteLong _x;
37
+ private static boolean _xSet;
38
+
39
+ private static MultiSiteLong _y;
40
+ private static boolean _ySet;
41
+
42
+ public static ITestContext context;
43
+ public static IMeasurement meas;
44
+
45
+ /**
46
+ * Implementing the SMT8 message system also for this non-TM class. Perhaps not the prettiest
47
+ * thing to do but it fixes the logging. The context needs to be set from a TM (like Base)
48
+ *
49
+ * @param level
50
+ * @param msg
51
+ */
52
+ public static void message(int level, String msg) {
53
+ // No longer works on SMT 8.2, should this function be removed completely?
54
+ // context.message(level,msg);
55
+ }
56
+
57
+ public Origen() {
58
+ _lotidSet = false;
59
+ _waferSet = false;
60
+ _xSet = false;
61
+ _ySet = false;
62
+ }
63
+
64
+ /**
65
+ * Returns the IPattern from the name of the pattern
66
+ *
67
+ * @param patname
68
+ * @return
69
+ */
70
+ public static IPattern getPat(String patname) {
71
+ return context.pattern(patname);
72
+ }
73
+
74
+ /**
75
+ * Patch data per site
76
+ *
77
+ * @param subroutinePattern Name of the pattern to patch
78
+ * @param pin Name of the pin to use
79
+ * @param decData The data to patch with
80
+ * @param size The amount of vectors to patch
81
+ */
82
+ public static void overlaySubroutinePerSite(
83
+ String subroutinePattern, String pin, MultiSiteLong decData, int size) {
84
+ message(Origen.LOG_METHODTRACE, "Performing patching on " + subroutinePattern);
85
+ OrigenHelpers.overlaySubroutine(
86
+ getPat(subroutinePattern),
87
+ Origen.pinFromGroup(pin),
88
+ decData,
89
+ size,
90
+ context.getActiveSites());
91
+ }
92
+
93
+ /**
94
+ * Patch the same data to all sites
95
+ *
96
+ * @param subroutinePattern Name of the pattern to patch
97
+ * @param pin Name of the pin to use
98
+ * @param decData The data to patch with
99
+ * @param size The amount of vectors to patch
100
+ */
101
+ public static void overlaySubroutineAllSites(
102
+ String subroutinePattern, String pin, long decData, int size) {
103
+ message(Origen.LOG_METHODTRACE, "Performing patching on " + subroutinePattern);
104
+ OrigenHelpers.overlaySubroutine(
105
+ getPat(subroutinePattern), Origen.pinFromGroup(pin), decData, size);
106
+ }
107
+
108
+ /**
109
+ * Get 1 pin name from a pingroup. Throws an exception if the group contains more than 1 pin
110
+ *
111
+ * @param group
112
+ * @return
113
+ */
114
+ public static String pinFromGroup(String group) {
115
+ List<ISignal> dutGroup = meas.getSignalGroup(group).getDutSignals();
116
+ if (dutGroup.size() > 1) {
117
+ throw new NumberFormatException("Can only patch one signal at a time");
118
+ }
119
+ return dutGroup.get(0).toString();
120
+ }
121
+
122
+ // /**
123
+ // * Debug function to display the STDF variables to check if they are properly setup
124
+ // */
125
+ // public static void showDieInfoFromSTDF() {
126
+ // MultiSiteLong x_coord =context.testProgram().variables().getLong("STDF.X_COORD");
127
+ // MultiSiteLong y_coord =context.testProgram().variables().getLong("STDF.Y_COORD");
128
+ // MultiSiteString wafer_id =context.testProgram().variables().getString("STDF.WAFER_ID");
129
+ // MultiSiteString lot_id =context.testProgram().variables().getString("STDF.LOT_ID");
130
+ // String sublot_id =context.testProgram().variables().getString("STDF.SBLOT_ID").get();
131
+ // message(Origen.LOG_DATA,"Wafer_id:" + wafer_id);
132
+ // message(Origen.LOG_DATA,"Lot_id:" + lot_id);
133
+ // message(Origen.LOG_DATA,"Sublot_id:" + sublot_id);
134
+ // message(Origen.LOG_DATA,"(x,y):(" + x_coord + "," + y_coord + ")");
135
+ // }
136
+
137
+ /** Set the lot ID to the given value, e.g. "ABC1234" */
138
+ public static void lotid(MultiSiteString v) {
139
+ _lotid = v;
140
+ _lotidSet = true;
141
+ }
142
+
143
+ /** Convert long value to 8 character ASCII string */
144
+ private static String toASCII(long value) {
145
+ int length = 8;
146
+ StringBuilder builder = new StringBuilder(length);
147
+ for (int i = length - 1; i >= 0; i--) {
148
+ builder.append((char) ((value >> (8 * i)) & 0xFF));
149
+ }
150
+ return builder.toString();
151
+ }
152
+
153
+ /** Set the lot ID based on the integer representation returned from lotidInt */
154
+ public static void lotid(MultiSiteLong v) {
155
+ MultiSiteString lotStr = new MultiSiteString("");
156
+ for (int site : v.getActiveSites()) {
157
+ long val = v.get(site);
158
+ lotStr.set(site, toASCII(val));
159
+ }
160
+ lotid(lotStr);
161
+ }
162
+
163
+ /* Get the lot ID. If it has not previously been set to a value it will be automatically queried
164
+ * from the test system.
165
+ */
166
+ public static MultiSiteString lotid() {
167
+ if (!_lotidSet) {
168
+
169
+ MultiSiteString lot_id = new MultiSiteString("TR7T7290W25D0");
170
+
171
+ if(!context.testProgram().variables().getString("mi8_recipe_version").get().isEmpty()) {
172
+ lot_id = context.testProgram().variables().getString("STDF.WAFER_ID"); //for use with prober
173
+ }
174
+
175
+ MultiSiteString batch_id = new MultiSiteString();
176
+ for (int site : context.getActiveSites()) {
177
+ String perSiteWID = lot_id.get(site); // per site string contains batch id & wafer number
178
+ String sBatch =
179
+ perSiteWID.substring(
180
+ 0, Math.min(perSiteWID.length(), 8)); // this will give you batch id
181
+ batch_id.set(site, sBatch);
182
+ System.out.println("Wafer batch " + sBatch);
183
+ }
184
+
185
+ _lotid = batch_id; // store the batch number
186
+ // _lotidSet = true;
187
+ }
188
+
189
+ return _lotid;
190
+ }
191
+
192
+ /**
193
+ * Returns the lot ID as a 64-bit integer that is suitable for programming to the device. Each
194
+ * character in the lotID is converted to its ASCII code. An error will be raised if the length of
195
+ * the current lotID overflows 64-bits.STDF.WAFER_ID
196
+ */
197
+ public static MultiSiteLong lotidInt() {
198
+ MultiSiteLong tempLong = new MultiSiteLong();
199
+ MultiSiteString lotid = lotid();
200
+ for (int site : lotid.getActiveSites()) {
201
+ String id = lotid.get(site);
202
+
203
+ // Convert each character to ascii using 2 hex (8 bytes)
204
+ StringBuilder sb = new StringBuilder();
205
+ char[] letters = id.toCharArray();
206
+ for (char ch : letters) {
207
+ sb.append(Long.toHexString(ch));
208
+ }
209
+ // Convert the hex string to long again
210
+ tempLong.set(site, Long.parseLong(sb.toString(), 16));
211
+ }
212
+ return tempLong;
213
+ }
214
+
215
+ /** Set the wafer number to the given value */
216
+ public static void wafer(MultiSiteLong valMSL) {
217
+ _wafer = valMSL;
218
+ _waferSet = true;
219
+ }
220
+
221
+ /**
222
+ * Get the wafer number. If it has not previously been set to a value it will be automatically
223
+ * queried from the test system.
224
+ */
225
+ public static MultiSiteLong wafer() {
226
+ if (!_waferSet) {
227
+
228
+ MultiSiteString wafer_id = new MultiSiteString("TR7T7290W55D0");
229
+
230
+ if(!context.testProgram().variables().getString("mi8_recipe_version").get().isEmpty()) {
231
+ wafer_id = context.testProgram().variables().getString("STDF.WAFER_ID"); //for use with prober
232
+ // Expect to return something like "TR7T7290W25D0)", where 25 is the wafer number
233
+ }
234
+
235
+ MultiSiteLong mslWnum = new MultiSiteLong(0);
236
+ for (int site : context.getActiveSites()) {
237
+ String perSiteWID = wafer_id.get(site); // per site string contains batch id & wafer number
238
+ String sWnum =
239
+ perSiteWID.substring(
240
+ perSiteWID.length() - 4,
241
+ perSiteWID.length() - 2); // extracted wafer number as string
242
+ Long lWnum = new Long(sWnum); // wafer number in Long
243
+ mslWnum.set(site, lWnum);
244
+ System.out.println("Wafer number " + lWnum);
245
+ }
246
+
247
+ // TBD :check for valid value
248
+ // if (lWnum < 1 || lWnum > 25) {
249
+ // throw new Error("ERROR: Wafer is out of the range : " + mslWnum);
250
+ // }
251
+
252
+ _wafer = mslWnum; // store the wafer number
253
+ // _waferSet = true;
254
+ }
255
+ return _wafer;
256
+ }
257
+
258
+ /** Query the X and Y coordinates from the test system and set them for all sites. */
259
+ public static void setXY() {
260
+
261
+ MultiSiteLong x_coord = new MultiSiteLong(90); // for debug purpose
262
+ MultiSiteLong y_coord = new MultiSiteLong(100); // for debug purpose
263
+
264
+ if(!context.testProgram().variables().getString("mi8_recipe_version").get().isEmpty()) {
265
+ x_coord =context.testProgram().variables().getLong("STDF.X_COORD"); //for use with probe
266
+ y_coord =context.testProgram().variables().getLong("STDF.Y_COORD"); //for use with probe
267
+ }
268
+
269
+ // MultiSiteLong x_coord = new MultiSiteLong(90); // for debug purpose
270
+ // MultiSiteLong y_coord = new MultiSiteLong(100); // for debug purpose
271
+
272
+ // TBD
273
+ // if (x_coord.lessThan(-32768) || x_coord.greaterThan(32767) ) {
274
+
275
+ // throw new NumberFormatException("Can only patch one signal at a time");
276
+ // cout << "ERROR: X is out of the range of an Int16: " << lx << endl;
277
+ // ERROR_EXIT(TM::EXIT_FLOW);
278
+
279
+ // }
280
+
281
+ // GetDiePosXYOfSite(_number, &lx, &ly);
282
+ // if (lx < -32768 || lx > 32767) {
283
+ // cout << "ERROR: X is out of the range of an Int16: " << lx << endl;
284
+ // ERROR_EXIT(TM::EXIT_FLOW);
285
+ // }
286
+ // if (ly < -32768 || ly > 32767) {
287
+ // cout << "ERROR: Y is out of the range of an Int16: " << ly << endl;
288
+ // ERROR_EXIT(TM::EXIT_FLOW);
289
+ // }
290
+ // _x = (int) lx;
291
+ // _y = (int) ly;
292
+
293
+ _x = x_coord;
294
+ _y = y_coord;
295
+ // _xSet = true;
296
+ // _ySet = true;
297
+ }
298
+
299
+ /**
300
+ * Get the X co-ord. If it has not previously been set to a value it will be automatically queried
301
+ * from the test system.
302
+ */
303
+ public static MultiSiteLong x() {
304
+ if (!_xSet) {
305
+ setXY();
306
+ }
307
+ return _x;
308
+ }
309
+
310
+ /**
311
+ * Get the Y co-ord. If it has not previously been set to a value it will be automatically queried
312
+ * from the test system.
313
+ *
314
+ * @return
315
+ */
316
+ public static MultiSiteLong y() {
317
+ if (!_ySet) {
318
+ setXY();
319
+ }
320
+ return _y;
321
+ }
322
+
323
+ /** Set the X co-ordinate to the given value */
324
+ public static void x(MultiSiteLong v) {
325
+ _x = v;
326
+ _xSet = true;
327
+ }
328
+
329
+ /** Set the Y co-ordinate to the given value */
330
+ public static void y(MultiSiteLong v) {
331
+ _y = v;
332
+ _ySet = true;
333
+ }
334
+ }