Program Generation#
Test-program generation builds a tester-neutral flow AST and resource model, then renders them for a supported backend. Flows describe ordering, conditions, groups, bins, limits, and test intent. The application interface creates the native test method, suite, or instance required by each tester.
Flow Source#
A minimal flow uses the Flow context:
with Flow() as flow:
flow.add_test("opens")
flow.add_test("shorts")
flow.func("functional_reset")
flow.bin(1)
Large flows should be composed with includes and focused components instead of one monolithic file.
Application Interface#
Flows call semantic methods such as func. The application interface maps
those methods to tester resources:
def func(self, name, **options):
with tester().eq("v93k") as v93k:
method = v93k.new_test_method(
"functional_test", library="ac_tml"
)
suite = v93k.new_test_suite(name)
suite.test_method = method
self.add_test(suite, **options)
with tester().eq("igxl") as igxl:
instance = igxl.new_test_instance(
name, library="std", template="functional"
)
self.add_test(instance, **options)
Keep flow policy in flows and native resource construction in the interface.
Validation#
Before rendering, Origen validates identifiers, jobs, flags, relationships, and tester conditions. Backend processors then normalize or reject operations based on native capabilities. An unsupported flow node should fail generation rather than disappear silently.
Output And References#
Generated files are returned by the backend and written below the selected output directory. Approve representative flows for every supported tester, including pass/fail branches, limits, bins, variables, and included subflows.
Interactive Flow Visualization#
Program generation can emit an interactive diagram alongside the native tester files. The diagram is built from the processed flow AST, so it represents the conditions, result handlers, groups, subflows, bins, and test ordering that the selected tester backend receives rather than only the original Python source. V93K SMT7, V93K SMT8, and UltraFLEX outputs are currently supported.
Enabling Visualization#
Visualization is opt-in. To enable it for every test-program flow generated by
an application, add the following to config/application.toml:
[program_generation]
flow_visualization = true
The application setting is applied before any flow sources execute and remains active for every selected tester backend in that invocation. Generate flows normally:
origen generate app/flows/production.py -t dut/my_dut tester/v93k_smt7
For one-off generation tools that do not own an application configuration, the process-wide Python API remains available:
import origen_metal.prog_gen as prog_gen
prog_gen.set_flow_visualization(True)
Visualization remains enabled until the process exits or the same API is called
with False. The config/application.toml setting is preferred for normal
applications because it avoids repeating setup in individual flow files.
Viewing And Using The Output#
For each processed flow, program generation adds two files below the tester
output’s flow_visualizations directory:
output/v93ksmt7/test_program/flow_visualizations/production.flow.html
output/v93ksmt7/test_program/flow_visualizations/production.flow.json
The HTML is self-contained and can be opened directly in a browser. Groups and subflows start collapsed, so large flows render only the currently visible nodes. Select a group or subflow to expand it; the node count shows both the visible and total nodes. Search automatically expands the sections containing a match. Zoom resizes the existing graph without rebuilding it.
Selecting a test node opens its invocation, method library, template, class, configured values, defaults, parameter types, aliases, and constraints. Sections and tests support pointer and keyboard interaction. Pass, fail, and error paths have distinct labels and colors; good and bad bins are also distinguished without relying on color alone.
Third-Party Integration#
The JSON contains the same graph and test details under a versioned
schema_version. Third-party tools should consume this JSON rather than
parse the HTML. Both files are returned as ordinary generated program
artifacts, allowing external program-generation wrappers to record, publish,
or open them without scanning the output directory.
The native render_program_for binding also accepts a scoped
flow_visualization=True argument for framework and toolchain integrations.
The setting applies only to that render call and the previous setting is
restored afterward.
Visualization is disabled by default, so existing output sets and normal generation times remain unchanged.