Sha256: 34ddf482a2160a9f66f40461a581356ea7b39a965d2d2ba58613bfddd33ed928

Contents?: true

Size: 1.68 KB

Versions: 151

Compression:

Stored size: 1.68 KB

Contents

module Origen
  module GlobalMethods
    require_relative 'encodings'
    def annotate(msg, options = {})
      Origen.app.tester.annotate(msg, options)
    end

    def c1(msg, options = {})
      Origen.app.tester.c1(msg, options)
    end
    alias_method :cc, :c1

    def c2(msg, options = {})
      Origen.app.tester.c2(msg, options)
    end

    def ss(*args, &block)
      Origen.app.tester.ss(*args, &block)
    end
    alias_method :step_comment, :ss

    def pp(*args, &block)
      Origen.app.tester.pattern_section(*args, &block)
    end
    alias_method :pattern_section, :pp
    alias_method :ps, :pp

    def snip(*args, &block)
      Origen.app.tester.snip(*args, &block)
    end

    # Render an ERB template
    def render(*args, &block)
      if $_compiler_stack && $_compiler_stack.last
        $_compiler_stack.last.render(*args, &block)
      else
        Origen.generator.compiler.render(*args, &block)
      end
    end

    def dut
      Origen.top_level
    end

    def tester
      Origen.tester
    end

    # The options passed to an ERB template. Having it
    # global like this is ugly, but it does allow a hash of options
    # to always be available in templates even if the template
    # is being rendered using a custom binding.
    #
    # @api private
    def options
      $_target_options ||
        Origen.generator.compiler.options
    end

    def global_binding
      binding
    end

    def undefined
      Origen::UndefinedClass.instance
    end

    Pattern = Origen.pattern unless defined?(Pattern)
    Flow = Origen.flow unless defined?(Flow)
    Resources = Origen.resources unless defined?(Resources)
    User = Origen::Users::User unless defined?(User)
  end
end

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
origen-0.33.0 lib/origen/global_methods.rb
origen-0.32.1 lib/origen/global_methods.rb
origen-0.32.0 lib/origen/global_methods.rb
origen-0.31.0 lib/origen/global_methods.rb
origen-0.30.0 lib/origen/global_methods.rb
origen-0.29.0 lib/origen/global_methods.rb
origen-0.28.2 lib/origen/global_methods.rb
origen-0.28.1 lib/origen/global_methods.rb
origen-0.28.0 lib/origen/global_methods.rb
origen-0.27.0 lib/origen/global_methods.rb
origen-0.26.0 lib/origen/global_methods.rb
origen-0.25.1 lib/origen/global_methods.rb
origen-0.25.0 lib/origen/global_methods.rb
origen-0.24.0 lib/origen/global_methods.rb
origen-0.23.0 lib/origen/global_methods.rb
origen-0.22.0 lib/origen/global_methods.rb
origen-0.21.0 lib/origen/global_methods.rb
origen-0.20.3 lib/origen/global_methods.rb
origen-0.20.2 lib/origen/global_methods.rb
origen-0.20.1 lib/origen/global_methods.rb