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.7.36 lib/origen/global_methods.rb
origen-0.7.35 lib/origen/global_methods.rb
origen-0.7.34 lib/origen/global_methods.rb
origen-0.7.33 lib/origen/global_methods.rb
origen-0.7.32 lib/origen/global_methods.rb
origen-0.7.31 lib/origen/global_methods.rb
origen-0.7.30 lib/origen/global_methods.rb
origen-0.7.29 lib/origen/global_methods.rb
origen-0.7.28 lib/origen/global_methods.rb
origen-0.7.27 lib/origen/global_methods.rb
origen-0.7.26 lib/origen/global_methods.rb
origen-0.7.25 lib/origen/global_methods.rb
origen-0.7.24 lib/origen/global_methods.rb
origen-0.7.23 lib/origen/global_methods.rb
origen-0.7.22 lib/origen/global_methods.rb
origen-0.7.21 lib/origen/global_methods.rb
origen-0.7.20 lib/origen/global_methods.rb
origen-0.7.19 lib/origen/global_methods.rb
origen-0.7.18 lib/origen/global_methods.rb
origen-0.7.17 lib/origen/global_methods.rb