Module: OrigenTesters::ATP::FlowAPI

Included in:
Flow, Interface
Defined in:
lib/origen_testers/atp/flow_api.rb

Instance Method Summary collapse

Instance Method Details

#atpObject



7
8
9
# File 'lib/origen_testers/atp/flow_api.rb', line 7

def atp
  @atp
end

#atp=(atp) ⇒ Object



3
4
5
# File 'lib/origen_testers/atp/flow_api.rb', line 3

def atp=(atp)
  @atp = atp
end

#hi_limit(value, options) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/origen_testers/atp/flow_api.rb', line 48

def hi_limit(value, options)
  {
    value:    value,
    rule:     options[:rule] || :lte,
    units:    options[:units],
    selector: options[:selector] || options[:test_mode]
  }
end

#limit(value, options) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/origen_testers/atp/flow_api.rb', line 57

def limit(value, options)
  unless options[:rule]
    fail 'You must supply option :rule (e.g. rule: :gt) when calling the limit helper'
  end
  {
    value:    value,
    rule:     options[:rule] || :lt,
    units:    options[:units],
    selector: options[:selector] || options[:test_mode]
  }
end

#lo_limit(value, options) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/origen_testers/atp/flow_api.rb', line 39

def lo_limit(value, options)
  {
    value:    value,
    rule:     options[:rule] || :gte,
    units:    options[:units],
    selector: options[:selector] || options[:test_mode]
  }
end

#loop(*args, &block) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/origen_testers/atp/flow_api.rb', line 26

def loop(*args, &block)
  if args.empty?
    super(&block)
  else
    options = args.pop if args.last.is_a?(Hash)
    options ||= {}
    add_meta!(options) if respond_to?(:add_meta!, true)
    add_description!(options) if respond_to?(:add_description!, true)
    args << options
    atp.send(:loop, *args, &block)
  end
end