Class: LinkDemo::TestProgram::Interface

Inherits:
Object
  • Object
show all
Includes:
OrigenTesters::ProgramGenerators
Defined in:
lib/origen_doc_helpers_dev/interface.rb

Instance Method Summary collapse

Instance Method Details

#add_flow_entry(test, options) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/origen_doc_helpers_dev/interface.rb', line 60

def add_flow_entry(test, options)
  options = {
    number:   options[:bin] * 1000,
    soft_bin: options[:bin]
  }.merge(options)
  flow.test test, options
end

#apply_levels(test, options) ⇒ Object



55
56
57
58
# File 'lib/origen_doc_helpers_dev/interface.rb', line 55

def apply_levels(test, options)
  test.dc_category = 'spec'
  test.dc_selector = options[:vdd] || :nom
end

#func(name, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/origen_doc_helpers_dev/interface.rb', line 24

def func(name, options = {})
  options = {
    vdd:  [:min, :max],
    type: :functional
  }.merge(options)
  vdd_loop(options) do |options|
    test = test_instances.functional(instance_name(name, options), options)
    test.pattern = pattern_name(name, options)
    apply_levels(test, options)
    add_flow_entry(test, options)
  end
end

#instance_name(name, options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/origen_doc_helpers_dev/interface.rb', line 6

def instance_name(name, options = {})
  name = pattern_name(name)
  if options[:vdd] || options[:vdd] != :nom
    name += "_#{options[:vdd]}"
  end
  name
end

#para(name, options = {}) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/origen_doc_helpers_dev/interface.rb', line 37

def para(name, options = {})
  options = {
    vdd:  [:min, :max],
    type: :parametric
  }.merge(options)
  unless options[:cz]
    vdd_loop(options) do |options|
      test = test_instances.ppmu(instance_name(name, options), options)
      test.pattern = pattern_name(name, options)
      test.lo_limit = options[:lo]
      test.hi_limit = options[:hi]
      test.force_cond = options[:force] || 0
      apply_levels(test, options)
      add_flow_entry(test, options)
    end
  end
end

#pattern_name(name, options = {}) ⇒ Object



14
15
16
# File 'lib/origen_doc_helpers_dev/interface.rb', line 14

def pattern_name(name, options = {})
  options[:pattern] || name.to_s
end

#vdd_loop(options) ⇒ Object



18
19
20
21
22
# File 'lib/origen_doc_helpers_dev/interface.rb', line 18

def vdd_loop(options)
  [options[:vdd]].flatten.each do |vdd|
    yield options.merge(vdd: vdd)
  end
end