• 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

Decompilation

Decompiling, Adding Pins, & Executing


OrigenTesters includes the OrigenTesters::Decompiler mixin. In addition to decompiling, this mixin provides some shorthand methods for adding pins and executing

A quick summary:

# Decompile a pattern source from a file
OrigenTesters.decompile('path/to/src')

OrigenTesters.add_pins('path/to_src')
  #=> Queries the pattern's pins and adds any missing pins to the DUT

OrigenTesters.execute('path/to/src')
  #=> Executes the pattern source in its entirety.
Neither #add_pins nor #execute support input as a direct source. Use #decompile_text to get decompiled pattern, then call #add_pins or #execute on that, as shown in the example.

Decompiling

Decompiling the pattern source is the first step to working with it in Origen. The #decompile method, when called on the Decompiler API, will do two things:

  1. Using the pattern’s extension, attempt to match the pattern source to the applicable decompiler.
  2. Decompile the source, returning the decompiled pattern object.

For example, any input ending with .atp routes to the IGXLBasedTester decompiler and input ending with .avc routes to the SmartestBasedTester decompiler.

pat = OrigenTesters.decompile('path/to/src.atp')
  #=> OrigenTesters::IGXLBasedTester::Pattern
pat.decompiled?
  #=> true

pat = OrigenTesters.decompile('path/to/src.avc')
  #=> OrigenTesters::SmartestBasedTester::Pattern
pat.decompiled?
  #=> true

You can also a get a pre-decompiled pattern object using #decompiled_pattern:

pat = OrigenTesters.decompiled_pattern('path/to/src.atp')
  #=> OrigenTesters::IGXLBasedTester::Pattern
pat.decompiled?
  #=> false

pat = OrigenTesters.decompiled_pattern('path/to/src.avc')
  #=> OrigenTesters::SmartestBasedTester::Pattern
pat.decompiled?
  #=> false

If either method cannot find an applicable decompiler given the extension, an exception is raised:

pat = OrigenTesters.decompiled_pattern('path/to/src.blah')
  #=> OrigenTesters::Decompiler::NoSuitableDecompiler
  #=> Fail in origen_testers: Cannot find a suitable decompiler for pattern source 'pat.blah' ('.blah')

If you want to decompile a source from a String object directly, use #decompile_text. You’ll need to provide the applicable decompiler, as the Decompiler API is not able to map a text source to the appropriate decompiler:

pat = OrigenTesters.decompile_text("src as string", decompiler: OrigenTesters::IGXLBasedTester::Pattern)
  #=> OrigenTesters::SmartestBasedTester::Pattern
pat.decompiled?
  #=> true

Discerning Platform Decompilers

Platforms can register themselves as an available decompiler during bootup. Discerning the appropriate decompiler boils down to asking each registered decompiler if it is available to decompile the given source. Each decompiler will respond yes or no and on the first yes, that decompiler will be selected. If no decompilers respond yes, a OrigenTesters::Decompiler::NoSuitableDecompiler exception is raised.

As a user of the decompiler, simply inputting an appropriately named source should trigger the correct decompiler, but the methods used underneath are available as well:

### See the registered decompilers

OrigenTesters.registered_decompilers
  #=> [OrigenTesters::IGXLBasedTester, OrigenTesters::SmartestBasedTester]

### See if an applicable decompiler exists for the pattern source

OrigenTesters.decompiler_for?("pat.atp")
  #=> true

OrigenTesters.decompiler_for?("pat.blah")
  #=> false

### Given the pattern source, select the appropriate decompiler, or return nil

OrigenTesters.select_decompiler("pat.atp")
  #=> OrigenTesters::IGXLBasedTester::Pattern

OrigenTesters.select_decompiler("pat.blah")
  #=> nil

### Given the pattern source, select the appropriate decompiler or raise and exception
### (Notice the '!')

OrigenTesters.select_decompiler!("pat.atp")
  #=> OrigenTesters::IGXLBasedTester::Pattern

OrigenTesters.select_decompiler!("pat.blah")
  #=> OrigenTesters::Decompiler::NoSuitableDecompiler
  #=> Fail in origen_testers: Cannot find a suitable decompiler for pattern source 'pat.blah' ('.blah')

### See if the given module provides a decompiler

OrigenTesters.registered_decompiler?(OrigenTesters::IGXLBasedTester)
  #=> true

OrigenTesters.registered_decompiler?(Origen)
  #=> false

Shorthand Methods

The Decompiler API supports some short-hand calls to common methods. The calls here are equivalent to calling #decompile, then the corresponding method on that decompiled pattern.

Adding Pins

Recall that #add_pins compares the available pins between the pattern source and the DUT and adds any missing pins from the pattern source to the DUT, returning any pins that it added. The Decompiler API has a shorthand method to perform this operation: OrigenTesters.add_pins('path/to/src'). This will:

  1. Decompile the source, using the corresponding platform decompiler.
  2. Add any missing pins to the DUT.
OrigenTesters.add_pins('pat.atp')
  # Decompiles the pattern using the .atp decompiler
  # Adds the pins to the DUT
  # Returns any pins added to the DUT
  #=> Array

Executing

Recall that #execute will actually execute the decompiled pattern in the context of the current DUT.

Assuming the current DUT has been instantiated and all timesets are defined, calling OrigenTesters.execeute('path/to/src') will:

  1. Decompile the source, using the corresponding platform decompiler.
  2. Add any missing pins to the DUT.
  3. Execute the pattern.
OrigenTesters.execute('pattern.atp')
  # Decompiles the pattern using the .atp decompiler
  # Adds the pins to the DUT
  # Execute the pattern source
  # Returns the decompiled pattern object
  #=> OrigenTesters::IGXLBasedTesters::Pattern

Comments

Generated with the Origen Semiconductor Developer's Kit

Origen is released under the terms of the MIT license