• 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

Simulation

Direct DUT Manipulation


A number of methods exist to directly manipulate the state of the DUT during a simulation, in all cases these methods do not re-target to the ATE because they rely on being able to directly look inside and manipulate the DUT which is not possible in the physical world.

The user is responsible for ensuring that the use of these APIs is safely handled when generating for an ATE or other non-simulation target, normally via one of these constructs:

# Simply skip this unless simulating
unless tester.sim?
  tester.peek # ...
end
  
# Implement differently for ATE
if tester.sim?
  tester.poke # ...
else
  dut.do_something
end

Poke

Poking is the term commonly given to changing the value of a register or other variable, i.e. poking a new value into an existing storage element.

To use the poke method, supply the net path of the storage element to be changed and the value you want to change it to:

# Poking a register
tester.poke("dut.my_ip.user_regs.some_reg", 0x1111)

# Poking a memory
tester.poke("dut.my_ip.mem[15]", 0x1111_2222)

The poke method can be used on real variables too, in that case a float should be given as the second argument instead of an integer to indicate to Origen that a real value net is being poked. e.g. to poke the value 1 to a real value net then supply 1.0 as the value argument instead of 1.

tester.poke("dut.my_ip.my_real_var", 1.25)

Peek

Peeking allows you to read the value of an internal register or other variable.

The value returned from the peek method will be an instance of Origen::Value which can also handle X or Z values.

Normally, if you don’t care about catching Z or X cases you can simply call to_i on the value returned from peek, here are some examples:

# Peeking a register
tester.peek("dut.my_ip.user_regs.some_reg").to_i   # => 0x1111

# Peeking a memory
tester.peek("dut.my_ip.mem[15]").to_i   # => 0x1111_2222

When peeking a real number, X or Z states are not supported and a float will be returned.

You must indicate to Origen that you are peeking a real value by supplying a second argument of true, or for convenience calling peek_real instead:

tester.peek("dut.my_ip.my_real_var", true)   # => 1.25

tester.peek_real("dut.my_ip.my_real_var")    # => 1.25

Force

When poking the DUT, you are changing the value of a reg or other variable which provides drive. i.e. as soon as the poke operation is done, the responsibility for maintaining and driving the new value is down to the DUT. For this reason, you cannot just poke any net, only those which can store/drive state. In Verilog terms, you can poke a register but you can’t poke a wire.

With a force, the simulator provides infinite drive/storage of the forced value and this will override any drive produced in the DUT. So when you force a value on a net, that will persist there for the entire simulation regardless of what goes on in the DUT until the force is released.

The force method has the same arguments as the peek method:

# Forcing a register
tester.force("dut.my_ip.user_regs.some_reg", 0x1111)

# Forcing a memory
tester.force("dut.my_ip.mem[15]", 0x1111_2222)

# Forcing a real value
tester.force("dut.my_ip.my_real_var", 1.25)

A force can be released by calling the release method and supplying the net reference:

# Releasing an existing force
tester.release("dut.my_ip.user_regs.some_reg")

Comments

Generated with the Origen Semiconductor Developer's Kit

Origen is released under the terms of the MIT license