Sha256: 345820a3cd650177ac686bc3bea396ce71720357901fc568c34ea95890b3fe46

Contents?: true

Size: 1.55 KB

Versions: 23

Compression:

Stored size: 1.55 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)
      Origen.generator.compiler.render(*args, &block)
    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

23 entries across 23 versions & 1 rubygems

Version Path
origen-0.7.5 lib/origen/global_methods.rb
origen-0.7.4 lib/origen/global_methods.rb
origen-0.7.3 lib/origen/global_methods.rb
origen-0.7.2 lib/origen/global_methods.rb
origen-0.7.1 lib/origen/global_methods.rb
origen-0.7.0 lib/origen/global_methods.rb
origen-0.6.12 lib/origen/global_methods.rb
origen-0.6.11 lib/origen/global_methods.rb
origen-0.6.10 lib/origen/global_methods.rb
origen-0.6.9 lib/origen/global_methods.rb
origen-0.6.8 lib/origen/global_methods.rb
origen-0.6.7 lib/origen/global_methods.rb
origen-0.6.6 lib/origen/global_methods.rb
origen-0.6.5 lib/origen/global_methods.rb
origen-0.6.4 lib/origen/global_methods.rb
origen-0.6.3 lib/origen/global_methods.rb
origen-0.6.2 lib/origen/global_methods.rb
origen-0.6.1 lib/origen/global_methods.rb
origen-0.6.0 lib/origen/global_methods.rb
origen-0.5.11 lib/origen/global_methods.rb