• Guides
  • Videos
  • Publications
  • API
  • Github
  • Community
  • Release Notes
  • Plugins
Installing Origen
  • Introduction
  • How to Install
  • How to Install (Windows)
  • Company Customization
  • Understanding Gems
  • Invoking Considerations
  • Workspace Management
Getting Started with Origen
  • Core concepts
  • Creating a New App
  • Directory Structure
  • The Initial Commit
  • Creating New Files
  • Understanding Blocks
  • Application Architecture
Runtime Environment
  • Introduction
  • Mode
  • Environment
  • Target
  • Production Targets
  • Global Setup
  • Load Order
  • Programming
Models
  • Introduction
  • Naming
  • Definition & Hierarchy
  • Adding Attributes
  • Versioning
  • Bugs & Features
  • Package, Mode & Configuration
  • Registers
  • Pins
  • Power Domains
  • Hardware Attributes
  • Parameters
  • Specifications
  • Fuses
  • Generic Components
  • Creating Your Own Components
Compiler (Views)
  • Introduction
  • Creating Templates
  • Using Sub-Templates
  • Helpers
  • Running The Compiler
  • Inline Compiler
Controllers
  • Introduction
  • Shadow Controllers
  • Direct Controllers
Pattern Generator
  • Introduction
  • Creating Patterns
  • Pins
  • Timing and Waiting
  • Registers
  • Documenting Patterns
  • Generating by Name
  • Common API
  • J750 API
  • V93K API
  • UltraFlex API
  • STIL & Other Formats
  • Custom Testers
  • Running The PatGen
  • Concurrent Patterns
Test Program Generator
  • Introduction
  • Philosophy
  • Creating Flows
  • Managing Flow Control
  • Creating an Interface
  • Additional Resources
  • Dynamic Custom Code
  • Characterization API
  • J750 API
  • V93K Common API
  • V93K SMT7 API
  • V93K SMT8 API
  • UltraFLEX API
  • Documenting the Program
  • Creating Custom Testers
  • Running the ProgGen
Decompilation
  • Overview & Example
  • Decompiling, Adding Pins, & Executing
  • Working with Decompiled Patterns
  • Platform Specifics
Simulation
  • Introduction
  • How It Works
  • Compiling the DUT
  • AMS Support
  • Environment Setup
  • Application Setup
  • Simulating Patterns
  • Simulating Flows
  • Direct DUT Manipulation
  • Simulator Log Output
  • Artifacts
  • Debugging
Documentation Generator
  • Introduction
  • Markdown
  • Linking
  • Styling
  • Testing
  • API Generation
  • Deploying
Plugins
  • Introduction
  • Using a Plugin
  • Creating a Plugin
  • Current & Default Plugins
  • Dev Environment
  • Dev Considerations
  • Paths & Origen.root
  • Config & Origen.app
Miscellaneous
  • Revision Control
  • Origen Remotes
  • Lint Testing
  • Session Store
  • LSF API
  • Users, Emails & Maillists
  • Utilities & Helpers
  • Ruby Extensions
  • Logger
  • Adding Commands
  • Overriding Commands
  • Callbacks
  • Application Callbacks
  • Miscellaneous Topics
Advanced Topics
  • Introduction
  • Invocation Customization
  • Custom App Generators

Test Program Generator

Dynamic Custom Code


A big advantage that the Origen program generator has over other tools is that even if you need to generate a test program file that is not officially supported by the generator you can easily work around it by dropping down to a template for that specific section of the program.

A nice offshoot of this capability is that any custom code in your test program (such as custom Visual Basic or C++ code for example) can be dynamically generated via code templates.

A Dynamic VB Example

Generally using templates within the context of a test program is the same as using them in any other context and therefore the Compiler Guide should be consulted for more details on the compiler syntax that should be used.

For a tester oriented example here is a snippet of some VB code that has been marked up with Origen compiler directives:

NUM_VREGS = <%= $dut.vregs.size %>

' Now initialize DUT variables for each site
For lSite = 0 To lSiteCnt
  With oDUTData(lSite)
    Call .Clear
% $dut.vregs.each do |vreg|
    Call .AddVreg(<%= vreg.nominal_level %>)
% end
  End With
Next

So for a device with a 1.2V and a 3V regulator this would compile to:

NUM_VREGS = 2

' Now initialize DUT variables for each site
For lSite = 0 To lSiteCnt
  With oDUTData(lSite)
    Call .Clear
    Call .AddVreg(1.2)
    Call .AddVreg(3)
  End With
Next

Whereas for a device with only a single 1.2V regulator we would end up with:

NUM_VREGS = 1

' Now initialize DUT variables for each site
For lSite = 0 To lSiteCnt
  With oDUTData(lSite)
    Call .Clear
    Call .AddVreg(1.2)
  End With
Next

Building Dynamic Code

Compiling any templates that form part of your test program can be co-ordinated within a Resources file by calling the compile method. Any option arguments passed in will be available within the options hash within the template.

Resources.create do
  compile "templates/j750/vreg_funcs.bas", max_vdd: 5.V
end

Comments

Generated with the Origen Semiconductor Developer's Kit

Origen is released under the terms of the MIT license