Class: OrigenTesters::IGXLBasedTester::Parser::DCSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/igxl_based_tester/parser/dc_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, categories, options = {}) ⇒ DCSpec

Returns a new instance of DCSpec.



9
10
11
12
13
14
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 9

def initialize(name, categories, options = {})
  @parser = options[:parser]
  @name = name
  @categories = categories
  @values = {}
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



6
7
8
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 6

def categories
  @categories
end

#nameObject Also known as: symbol

Returns the value of attribute name.



6
7
8
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 6

def name
  @name
end

#parserObject

Returns the value of attribute parser.



5
6
7
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 5

def parser
  @parser
end

Instance Method Details

#add_values(components) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 16

def add_values(components)
  @categories.each_with_index do |category, i|
    @values[category] ||= {}
    @values[category]['Typ'] ||= components[5 + (i * 3) + 0]
    @values[category]['Min'] ||= components[5 + (i * 3) + 1]
    @values[category]['Max'] ||= components[5 + (i * 3) + 2]
  end
end

#lookup(category, selector) ⇒ Object



25
26
27
28
29
# File 'lib/origen_testers/igxl_based_tester/parser/dc_spec.rb', line 25

def lookup(category, selector)
  if v == @values[category]
    v[selector]
  end
end