Module: Origen::GlobalMethods

Defined in:
lib/origen/global_methods.rb

Constant Summary collapse

Pattern =
Origen.pattern
Flow =
Origen.flow
Resources =
Origen.resources
User =
Origen::Users::User

Instance Method Summary collapse

Instance Method Details

#annotate(msg, options = {}) ⇒ Object



4
5
6
# File 'lib/origen/global_methods.rb', line 4

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

#c1(msg, options = {}) ⇒ Object Also known as: cc



8
9
10
# File 'lib/origen/global_methods.rb', line 8

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

#c2(msg, options = {}) ⇒ Object



13
14
15
# File 'lib/origen/global_methods.rb', line 13

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

#dutObject



41
42
43
# File 'lib/origen/global_methods.rb', line 41

def dut
  Origen.top_level
end

#global_bindingObject



60
61
62
# File 'lib/origen/global_methods.rb', line 60

def global_binding
  binding
end

#optionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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.



55
56
57
58
# File 'lib/origen/global_methods.rb', line 55

def options
  $_target_options ||
    Origen.generator.compiler.options
end

#pp(*args, &block) ⇒ Object Also known as: pattern_section, ps



22
23
24
# File 'lib/origen/global_methods.rb', line 22

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

#render(*args, &block) ⇒ Object

Render an ERB template



33
34
35
36
37
38
39
# File 'lib/origen/global_methods.rb', line 33

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

#snip(*args, &block) ⇒ Object



28
29
30
# File 'lib/origen/global_methods.rb', line 28

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

#ss(*args, &block) ⇒ Object Also known as: step_comment



17
18
19
# File 'lib/origen/global_methods.rb', line 17

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

#testerObject



45
46
47
# File 'lib/origen/global_methods.rb', line 45

def tester
  Origen.tester
end

#undefinedObject



64
65
66
# File 'lib/origen/global_methods.rb', line 64

def undefined
  Origen::UndefinedClass.instance
end