Class: OrigenDocHelpers::DocInterface

Inherits:
Object
  • Object
show all
Includes:
Origen::Tester::Doc::Generator
Defined in:
lib/origen_doc_helpers/doc_interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(_options = {}) ⇒ DocInterface

Returns a new instance of DocInterface.



5
6
# File 'lib/origen_doc_helpers/doc_interface.rb', line 5

def initialize(_options = {})
end

Instance Method Details

#add_flow_entry(test, options) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/origen_doc_helpers/doc_interface.rb', line 66

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

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



51
52
53
54
# File 'lib/origen_doc_helpers/doc_interface.rb', line 51

def add_pattern(name, options = {})
  options[:pattern] = pattern_name(name, options)
  options
end

#add_test(name, options) ⇒ Object



56
57
58
59
60
61
62
63
64
# File 'lib/origen_doc_helpers/doc_interface.rb', line 56

def add_test(name, options)
  options = {
  }.merge(options)
  # Delete any keys that we don't want to assign to the instance, this keeps
  # the attributes efficient, flow control keys will be screened by Origen
  [:bin, :tnum, :tname, :continue
  ].each { |k| options.delete(k) }
  tests.add(instance_name(name, options), add_pattern(name, options))
end

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



29
30
31
32
33
34
35
36
37
38
# File 'lib/origen_doc_helpers/doc_interface.rb', line 29

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

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



11
12
13
14
15
16
17
# File 'lib/origen_doc_helpers/doc_interface.rb', line 11

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

#log(_msg) ⇒ Object



8
9
# File 'lib/origen_doc_helpers/doc_interface.rb', line 8

def log(_msg)
end

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



40
41
42
43
44
45
46
47
48
49
# File 'lib/origen_doc_helpers/doc_interface.rb', line 40

def para(name, options = {})
  options = {
    vdd:  [:min, :max],
    type: :parametric
  }.merge(options)
  vdd_loop(options) do |options|
    test = add_test name, options
    add_flow_entry(test, options)
  end
end

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



19
20
21
# File 'lib/origen_doc_helpers/doc_interface.rb', line 19

def pattern_name(name, _options = {})
  name.to_s
end

#vdd_loop(options) ⇒ Object



23
24
25
26
27
# File 'lib/origen_doc_helpers/doc_interface.rb', line 23

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