• 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

Models

Hardware Attributes


The need to model abstract hardware properties can sometimes arise, most commonly when generating a view of the models which needs to contain some detailed information about the RTL architecture - generating an IP-XACT view of the IP for use in verification would be a good example of this.

HDL Paths

For designers using Origen as the master definition of their registers and other metadata, it is always preferable to setup the Origen models to mirror the eventual hierarchy of the RTL. In that case nothing special is required to extract HDL path information and the path method available on all sub-blocks, registers and bits should do a good job:

$dut.atd.path             # => "mydut.atd"            (Where 'mydut' is the lowercased class name)
$dut.atd.reg1.path        # => "mydut.atd.reg1"  
$dut.atd.reg1.data.path   # => "mydut.atd.reg1[15:0]" (Where 'data' are some named bits in reg1)  

However in cases where that is not possible the following API exists to reconcile any differences.

For any point in the tree the default can be overridden by setting the @path instance variable within the given object, this can also be supplied at sub-block declaration time. e.g.

class MyDut
  include Origen::TopLevel

  def initialize
    sub_block :atd, class_name: "ATD", base: 0x1000_0000, path: "atds.atd0"
  end
end

$dut.atd.reg1.data.path        # => "mydut.atds.atd0.reg1[15:0]"
$dut.atd.path = "atds.atd1"
$dut.atd.reg1.data.path        # => "mydut.atds.atd1.reg1[15:0]"

Layers can be taken out of the hierarchy altogether by setting the path attribute to :hidden:

sub_block :atd, class_name: "ATD", base: 0x1000_0000, path: :hidden

$dut.atd.reg1.data.path        # => "mydut.reg1[15:0]"

Register and bit definitions can also be given a path override:

reg :reg1, 0 do |reg|
  reg.bits 31..0, :data
end

reg :reg2, 0x4, path: "reg2_reg" do |reg|
  reg.bits 31..0, :data
end

reg :reg3, 0xC, path: "reg3_reg" do |reg|
  reg.bits 31..0, :data, path: "data_reg"
end

reg1.data.path     # => "mydut.atd.reg1[15:0]"
reg2.data.path     # => "mydut.atd.reg2_reg[15:0]"
reg3.data.path     # => "mydut.atd.data_reg"

Note that in the case of the path being given to the bits it bypasses the register altogether, to include the register prefix the bit path name with a .

reg :reg3, 0xC, path: "reg3_reg" do |reg|
  reg.bits 31..0, :data, path: ".data_reg"
end

reg3.data.path     # => "mydut.atd.reg3_reg.data_reg"

Absolute Paths

Sometimes for a given node that is handled ‘unusually’ in RTL it is easier just to give an absolute path, the abs_path attribute can be set in place of the path attribute for any of the examples above.

When resolving paths from a child object the final path will be returned immediately when an absolute path is encountered, this is best shown by example:

sub_block :sub1
sub_block :sub2, path: "memory_block.ram"
sub_block :sub3, abs_path: "p2.flash"

sub1.reg1.path      # => "p1.sub1.reg1" (where p1 is the path of the parent)
sub2.reg1.path      # => "p1.memory_block.ram.reg1"
sub3.reg1.path      # => "p2.flash.reg1"

Registers and bits will also accept abs_path in place of path.


Comments

Generated with the Origen Semiconductor Developer's Kit

Origen is released under the terms of the MIT license