Sha256: f926264a410863d644a22c6821f2c1f72cf321736186d193ea2f4d0bcefab39f

Contents?: true

Size: 1.49 KB

Versions: 8

Compression:

Stored size: 1.49 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

    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

8 entries across 8 versions & 1 rubygems

Version Path
origen-0.5.7 lib/origen/global_methods.rb
origen-0.5.6 lib/origen/global_methods.rb
origen-0.5.5 lib/origen/global_methods.rb
origen-0.5.4 lib/origen/global_methods.rb
origen-0.5.3 lib/origen/global_methods.rb
origen-0.5.2 lib/origen/global_methods.rb
origen-0.5.1 lib/origen/global_methods.rb
origen-0.5.0 lib/origen/global_methods.rb