Class: OrigenTesters::IGXLBasedTester::Base::Levelset

Inherits:
Object
  • Object
show all
Includes:
Generator
Defined in:
lib/origen_testers/igxl_based_tester/base/levelset.rb

Direct Known Subclasses

UltraFLEX::Levelset

Constant Summary collapse

OUTPUT_PREFIX =
'LV'

Instance Attribute Summary collapse

Attributes included from Generator

#output_directory

Instance Method Summary collapse

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #identity_map, #import, #inhibit_output, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Constructor Details

#initialize(options = {}) ⇒ Levelset

OUTPUT_POSTFIX = 'LV'



17
18
19
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 17

def initialize(options = {}) # :nodoc:
  @pins = {}
end

Instance Attribute Details

#ls_sheet_pinsObject

Returns the value of attribute ls_sheet_pins.



9
10
11
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 9

def ls_sheet_pins
  @ls_sheet_pins
end

#nameObject

Levelset name



12
13
14
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 12

def name
  @name
end

#pinsObject

Returns the value of attribute pins.



7
8
9
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 7

def pins
  @pins
end

#spec_sheetObject

Returns the value of attribute spec_sheet.



8
9
10
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 8

def spec_sheet
  @spec_sheet
end

Instance Method Details

#add(lsname, pin, level, options = {}) ⇒ Object

Adds a pin level to the given levelset



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 24

def add(lsname, pin, level, options = {})
  options = {
    spec_sheet: 'default'  # defines which specset sheet to put variables in (e.g. func, scan) when generating specset files
  }.merge(options)
  lsname = lsname.to_sym unless lsname.is_a? Symbol
  pin = pin.to_sym unless pin.is_a? Symbol

  add_level(pin, level)
  @name = lsname
  @spec_sheet = options[:spec_sheet]
  @ls_sheet_pins = options[:ls_sheet_pins] unless @ls_sheet_pins
end

#add_level(pin, level) ⇒ Object

Assigns a level object to the given pin for this levelset



38
39
40
41
42
43
44
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 38

def add_level(pin, level)
  if @pins.key?(pin)
    Origen.log.error "Pin #{pin} already exists in levelset"
  else
    @pins[pin] = level
  end
end

#finalize(options = {}) ⇒ Object



46
47
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 46

def finalize(options = {})
end

#format_uflex_level(data, options = {}) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 92

def format_uflex_level(data, options = {})
  options = {
  }.merge(options)

  if data !~ /^\s*$/
    data = data.gsub(/^/, '=')
  end
  data = data.gsub(/(\W)([a-zA-Z])/, '\1_\2')
  data = data.gsub(/(\*\s*)_([kmun]{0,1}[AVs]{1}\W)/, '\1\2')
  data = data.gsub(/(\*\s*)_([kmun]{0,1}[AVs]{1})$/, '\1\2')
end

#get_pin_objects(grp) ⇒ Object

Populate an array of pins based on the pin or pingroup



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 50

def get_pin_objects(grp)
  pins = []
  if Origen.top_level.pin(grp).is_a?(Origen::Pins::Pin) ||
     Origen.top_level.pin(grp).is_a?(Origen::Pins::FunctionProxy)
    pins << Origen.top_level.pin(grp)
  elsif Origen.top_level.pin(grp).is_a?(Origen::Pins::PinCollection)
    Origen.top_level.pin(grp).each do |pin|
      pins << pin
    end
  else
    Origen.log.error "Could not find pin class: #{grp}  #{Origen.top_level.pin(grp).class}"
  end
  pins
end

#gsub_levels!(level, old_val, new_val) ⇒ Object

Globally modify text within the level object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 71

def gsub_levels!(level, old_val, new_val)
  # determine if object is a power level (conatins :vmain) or a SE pin level (:vil)
  if level.respond_to?(:vmain)
    level.vmain     = level.vmain.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.valt      = level.valt.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.ifold     = level.ifold.gsub(/#{Regexp.escape(old_val)}/, new_val)
    # level.delay     = level.delay.gsub(/#{Regexp.escape(old_val)}/, new_val)
  elsif level.respond_to?(:vil)
    level.vil       = level.vil.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vih       = level.vih.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vol       = level.vol.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.voh       = level.voh.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vcl       = level.vcl.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vch       = level.vch.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vt        = level.vt.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.voutlotyp = level.voutlotyp.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.vouthityp = level.vouthityp.gsub(/#{Regexp.escape(old_val)}/, new_val)
    level.dmode     = level.dmode.gsub(/#{Regexp.escape(old_val)}/, new_val)
  end
end

#levels_eql?(level1, level2) ⇒ Boolean

Equality check to compare full contents of 2 level objects

Returns:

  • (Boolean)


66
67
68
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 66

def levels_eql?(level1, level2)
  level1 == level2
end

#platformObject



104
105
106
# File 'lib/origen_testers/igxl_based_tester/base/levelset.rb', line 104

def platform
  Origen.interface.platform
end