% render "layouts/guides.html" do This guide covers aspects of the V93K program generator API that are unique to SmarTest 8. Be sure to also consult the [V93K Common API guide](<%= path "guides/program/v93k" %>) which is also applicable to SMT8. The SMT8 API is enabled by adding `smt_version: 8` when instantiating a V93K test environment: ~~~ruby # environment/v93k_smt8.rb OrigenTesters::V93K.new smt_version: 8 ~~~ ### Package Structure The V93K SMT8 test program generator will create a package with the following structure: ~~~text MyAppNamespace/ ├── common/ │ └── limits.ods ├── flows/ │ ├── my_flow_1/ │ │ └── MY_SUB_FLOW.flow │ ├── MY_FLOW_2.flow │ └── MY_FLOW_1.flow └── limits/ ├── Main.MY_FLOW_2_TESTS.csv └── Main.MY_FLOW_1_TESTS.csv ~~~ Here is a description of each component: ##### MyAppNamespace/ This is the name of this test program package, it should be unique and the entire directory is intended to be dropped directly into your test program's `src/` directory. By default, your Origen application's namespace is used, though this can be overridden within your V93K environment file: ~~~ruby # environment/v93k_smt8.rb OrigenTesters::V93K.new smt_version: 8, package_namespace: 'something_else' ~~~ ##### common/limits.ods Contains the limits tables for all flows. ##### flows/ A top-level test program flow file in Origen will generate a correspondingly named file in the `flows/` directory, where the name of the generated file is the upper-cased version of the source file name. If the flow imports sub-flows or contains groups, then those will be contained in a directory named after the lower-cased version of the flow name. ##### limits/ Origen generates the limts into CSV files before combining them into `common/limits.ods`. These intermediate files will not be used by the test program but they are kept around in case they are useful. ### Flow Integration The generated flow(s) should be integrated into a top-level (Main) flow like this: ~~~java flow Main { setup { flow MY_FLOW_1 calls MyAppNamespace.flows.MY_FLOW_1 {} flow MY_FLOW_2 calls MyAppNamespace.flows.MY_FLOW_2 {} } execute { MY_FLOW_1.execute(); MY_FLOW_2.execute(); } } ~~~ The `add_flow_enable:` tester option [as described in the SMT7 guide](<%= path "guides/program/v93ksmt7/#Flow_Considerations" %>) is also supported by the SMT8 generator, though it may not make as much sense to use it in that case. It generates an `ENABLE` flow parameter which could be used something like this: ~~~java flow Main { setup { flow MY_FLOW_1 calls MyAppNamespace.flows.MY_FLOW_1 {} flow MY_FLOW_2 calls MyAppNamespace.flows.MY_FLOW_2 {} } execute { // Skip FLOW_1 and run only FLOW_2 MY_FLOW_1.ENABLE = 0; MY_FLOW_2.ENABLE = 1; MY_FLOW_1.execute(); MY_FLOW_2.execute(); } } ~~~ #### Auxiliary Flows SMT8 utilizes auxiliary flows to perform recurring actions. `add_auxiliary_flow` API exists to symlink to a predefined auxiliary flow. This API does not allow variables to be passed to or from the auxiliary flow since they are stand alone flows. ~~~ruby add_auxiliary_flow :POWERDOWN, 'testflow.POWERDOWN' ~~~ ~~~java flow Main { setup { flow POWERDOWN calls testflow.POWERDOWN {} } execute { POWERDOWN.execute(); } } ~~~ #### Flow Variable Grouping Sub-flow variable passing causes variables before and after the execution call to populate the flow. If you wish to have a collapse-able block for the variables, you need to set the flow_variable_grouping variable to true. ~~~ # add this line to your origen_site_config.yml flow_variable_grouping: true ~~~ #### Built-In Shmoo Element SMT8 provides a built in shmoo element that can be used to shmoo a test suite or test flow. In order to add setup and execute code to the flow, create the shmoo_test object using `shmoo_tests.run(name, options)` and add it to the flow with `flow.test` method. Example of integrating the shmoo api in an interface: ~~~ruby def shmoo(name, targets, options = {}) if tester.v93k? && tester.smt8? targets = [targets] unless targets.is_a?(Array) st = shmoo_tests.run(name, { targets: targets }.merge(options)) flow.test st, options end end ~~~ Then in the flow, you can add the shmoo element to the flow with the following code: ~~~ruby Flow.create ... range = { start: 3.0, stop: 5.0, steps: 10 } axis = { name: :axis1, resource_type: 'specVariable', resource_name: 'vcc', range: range } shmoo :shmoo_over_ts_1D, :cc_test_0, title: 'shmooOverTest', execution_order: :horizontal, axis: axis ... end ~~~ Please see Advantest TDC Topic 253309 for details ahbout Shmoo parameters. The above code will generate the following flow code: ~~~java flow { setup { ... shmoo shmoo_over_ts_1D { target = cc_test_0; resultTitle = "shmooOverTest"; executionOrder = horizontal; axis [axis1] = { resourceType = specVariable; resourceName = "vcc"; range.start = 3.0; range.stop = 5.0; range.steps = 10; }; } ... } execute { ... shmoo_over_ts_1D.execute(); ... } } ~~~ % end