origen_std_lib 0.10.1 → 0.11.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 +2 -3
  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 +462 -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 -32
  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 -125
  69. data/stdlib/v93k/origen/origen/test_method/functional_test.hpp +0 -52
  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
+ private static MultiSiteLong _blockCycles;
43
+ private static boolean _blockCyclesSet;
44
+
45
+ private static MultiSiteLong _pageCycles;
46
+ private static boolean _pageCyclesSet;
47
+
48
+ public static ITestContext context;
49
+ public static IMeasurement meas;
50
+
51
+ /**
52
+ * Implementing the SMT8 message system also for this non-TM class. Perhaps not the prettiest
53
+ * thing to do but it fixes the logging. The context needs to be set from a TM (like Base)
54
+ *
55
+ * @param level
56
+ * @param msg
57
+ */
58
+ @SuppressWarnings("deprecation")
59
+ public static void message(int level, String msg) {
60
+ // No longer works on SMT 8.2, should this function be removed completely?
61
+ // context.message(level,msg);
62
+ }
63
+
64
+ public Origen() {
65
+ _lotidSet = false;
66
+ _waferSet = false;
67
+ _xSet = false;
68
+ _ySet = false;
69
+ }
70
+
71
+ /**
72
+ * Returns the IPattern from the name of the pattern
73
+ *
74
+ * @param patname
75
+ * @return
76
+ */
77
+ public static IPattern getPat(String patname) {
78
+ return context.pattern(patname);
79
+ }
80
+
81
+ /**
82
+ * Patch data per site
83
+ *
84
+ * @param subroutinePattern Name of the pattern to patch
85
+ * @param pin Name of the pin to use
86
+ * @param decData The data to patch with
87
+ * @param size The amount of vectors to patch
88
+ */
89
+ public static void overlaySubroutinePerSite(
90
+ String subroutinePattern, String pin, MultiSiteLong decData, int size) {
91
+ message(Origen.LOG_METHODTRACE, "Performing patching on " + subroutinePattern);
92
+ OrigenHelpers.overlaySubroutine(
93
+ getPat(subroutinePattern),
94
+ Origen.pinFromGroup(pin),
95
+ decData,
96
+ size,
97
+ context.getActiveSites());
98
+ }
99
+
100
+ /**
101
+ * Patch the same data to all sites
102
+ *
103
+ * @param subroutinePattern Name of the pattern to patch
104
+ * @param pin Name of the pin to use
105
+ * @param decData The data to patch with
106
+ * @param size The amount of vectors to patch
107
+ */
108
+ public static void overlaySubroutineAllSites(
109
+ String subroutinePattern, String pin, long decData, int size) {
110
+ message(Origen.LOG_METHODTRACE, "Performing patching on " + subroutinePattern);
111
+ OrigenHelpers.overlaySubroutine(
112
+ getPat(subroutinePattern), Origen.pinFromGroup(pin), decData, size);
113
+ }
114
+
115
+ /**
116
+ * Get 1 pin name from a pingroup. Throws an exception if the group contains more than 1 pin
117
+ *
118
+ * @param group
119
+ * @return
120
+ */
121
+ public static String pinFromGroup(String group) {
122
+ List<ISignal> dutGroup = meas.getSignalGroup(group).getDutSignals();
123
+ if (dutGroup.size() > 1) {
124
+ throw new NumberFormatException("Can only patch one signal at a time");
125
+ }
126
+ return dutGroup.get(0).toString();
127
+ }
128
+
129
+ // /**
130
+ // * Debug function to display the STDF variables to check if they are properly setup
131
+ // */
132
+ // public static void showDieInfoFromSTDF() {
133
+ // MultiSiteLong x_coord =context.testProgram().variables().getLong("STDF.X_COORD");
134
+ // MultiSiteLong y_coord =context.testProgram().variables().getLong("STDF.Y_COORD");
135
+ // MultiSiteString wafer_id =context.testProgram().variables().getString("STDF.WAFER_ID");
136
+ // MultiSiteString lot_id =context.testProgram().variables().getString("STDF.LOT_ID");
137
+ // String sublot_id =context.testProgram().variables().getString("STDF.SBLOT_ID").get();
138
+ // message(Origen.LOG_DATA,"Wafer_id:" + wafer_id);
139
+ // message(Origen.LOG_DATA,"Lot_id:" + lot_id);
140
+ // message(Origen.LOG_DATA,"Sublot_id:" + sublot_id);
141
+ // message(Origen.LOG_DATA,"(x,y):(" + x_coord + "," + y_coord + ")");
142
+ // }
143
+
144
+ /** Set the lot ID to the given value, e.g. "ABC1234" */
145
+ public static void lotid(MultiSiteString v) {
146
+ _lotid = v;
147
+ _lotidSet = true;
148
+ }
149
+
150
+ /** Convert long value to 8 character ASCII string */
151
+ private static String toASCII(long value) {
152
+ int length = 8;
153
+ StringBuilder builder = new StringBuilder(length);
154
+ for (int i = length - 1; i >= 0; i--) {
155
+ builder.append((char) ((value >> (8 * i)) & 0xFF));
156
+ }
157
+ return builder.toString();
158
+ }
159
+
160
+ /** Set the lot ID based on the integer representation returned from lotidInt */
161
+ public static void lotid(MultiSiteLong v) {
162
+ MultiSiteString lotStr = new MultiSiteString("");
163
+ for (int site : v.getActiveSites()) {
164
+ long val = v.get(site);
165
+ lotStr.set(site, toASCII(val));
166
+ }
167
+ lotid(lotStr);
168
+ }
169
+
170
+ /* Get the lot ID. If it has not previously been set to a value it will be automatically queried
171
+ * from the test system.
172
+ */
173
+ public static MultiSiteString lotid() {
174
+ if (!_lotidSet) {
175
+ MultiSiteString lot_id =
176
+ context.testProgram().variables().getString("STDF.WAFER_ID"); // for use with prober
177
+ // MultiSiteString lot_id = new MultiSiteString("TR7T7290W25D0"); // for debug
178
+ // purpose
179
+
180
+ MultiSiteString batch_id = new MultiSiteString();
181
+ for (int site : context.getActiveSites()) {
182
+ String perSiteWID = lot_id.get(site); // per site string contains batch id & wafer number
183
+ String sBatch =
184
+ perSiteWID.substring(
185
+ 0, Math.min(perSiteWID.length(), 8)); // this will give you batch id
186
+ batch_id.set(site, sBatch);
187
+ System.out.println("Wafer batch " + sBatch);
188
+ }
189
+
190
+ _lotid = batch_id; // store the batch number
191
+ // _lotidSet = true;
192
+ }
193
+
194
+ return _lotid;
195
+ }
196
+
197
+ /**
198
+ * Returns the lot ID as a 64-bit integer that is suitable for programming to the device. Each
199
+ * character in the lotID is converted to its ASCII code. An error will be raised if the length of
200
+ * the current lotID overflows 64-bits.STDF.WAFER_ID
201
+ */
202
+ public static MultiSiteLong lotidInt() {
203
+ MultiSiteLong tempLong = new MultiSiteLong();
204
+ MultiSiteString lotid = lotid();
205
+ for (int site : lotid.getActiveSites()) {
206
+ String id = lotid.get(site);
207
+
208
+ // Convert each character to ascii using 2 hex (8 bytes)
209
+ StringBuilder sb = new StringBuilder();
210
+ char[] letters = id.toCharArray();
211
+ for (char ch : letters) {
212
+ sb.append(Long.toHexString(ch));
213
+ }
214
+ // Convert the hex string to long again
215
+ tempLong.set(site, Long.parseLong(sb.toString(), 16));
216
+ }
217
+ return tempLong;
218
+ }
219
+
220
+ /** Set the wafer number to the given value */
221
+ public static void wafer(MultiSiteLong valMSL) {
222
+ _wafer = valMSL;
223
+ _waferSet = true;
224
+ }
225
+
226
+ /**
227
+ * Get the wafer number. If it has not previously been set to a value it will be automatically
228
+ * queried from the test system.
229
+ */
230
+ public static MultiSiteLong wafer() {
231
+ if (!_waferSet) {
232
+ MultiSiteString wafer_id =
233
+ context.testProgram().variables().getString("STDF.WAFER_ID"); // for use with prober
234
+ // MultiSiteString wafer_id = new MultiSiteString("TR7T7290W55D0"); // for debug
235
+ // purpose
236
+
237
+ // Expect to return something like "TR7T7290W25D0)", where 25 is the wafer number
238
+
239
+ MultiSiteLong mslWnum = new MultiSiteLong(0);
240
+ for (int site : context.getActiveSites()) {
241
+ String perSiteWID = wafer_id.get(site); // per site string contains batch id & wafer number
242
+ String sWnum =
243
+ perSiteWID.substring(
244
+ perSiteWID.length() - 4,
245
+ perSiteWID.length() - 2); // extracted wafer number as string
246
+ Long lWnum = new Long(sWnum); // wafer number in Long
247
+ mslWnum.set(site, lWnum);
248
+ System.out.println("Wafer number " + lWnum);
249
+ }
250
+
251
+ // TBD :check for valid value
252
+ // if (lWnum < 1 || lWnum > 25) {
253
+ // throw new Error("ERROR: Wafer is out of the range : " + mslWnum);
254
+ // }
255
+
256
+ _wafer = mslWnum; // store the wafer number
257
+ // _waferSet = true;
258
+ }
259
+ return _wafer;
260
+ }
261
+
262
+ /** Query the X and Y coordinates from the test system and set them for all sites. */
263
+ public static void setXY() {
264
+ MultiSiteLong x_coord =
265
+ context.testProgram().variables().getLong("STDF.X_COORD"); // for use with probe
266
+ MultiSiteLong y_coord =
267
+ context.testProgram().variables().getLong("STDF.Y_COORD"); // for use with probe
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
+ }