Class: OrigenTesters::IGXLBasedTester::Base::Edgesets

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

Direct Known Subclasses

UltraFLEX::Edgesets

Constant Summary collapse

OUTPUT_PREFIX =
'ES'

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, #name, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #platform, #reference_file, #render, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file

Constructor Details

#initialize(options = {}) ⇒ Edgesets

OUTPUT_POSTFIX = 'ES'



14
15
16
17
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 14

def initialize(options = {}) # :nodoc:
  @es       = {}
  @ts_basic = options[:timeset_basic]
end

Instance Attribute Details

#esObject

Returns the value of attribute es.



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

def es
  @es
end

#es_sheet_pinsObject

Returns the value of attribute es_sheet_pins.



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

def es_sheet_pins
  @es_sheet_pins
end

#ts_basicObject

Returns the value of attribute ts_basic.



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

def ts_basic
  @ts_basic
end

Instance Method Details

#add(esname, pin, edge, options = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 19

def add(esname, pin, edge, options = {})
  esname = esname.to_sym unless esname.is_a? Symbol
  pin = pin.to_sym unless pin.is_a? Symbol
  @es.key?(esname) ? @es[esname].add_edge(pin, edge) : @es[esname] = platform::Edgeset.new(esname, pin, edge, options)
  @es_sheet_pins = options[:es_sheet_pins] unless @es_sheet_pins
  @es
end

#edges_eql?(edge1, edge2) ⇒ Boolean

Equality check to compare full contents of edge object

Returns:

  • (Boolean)


47
48
49
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 47

def edges_eql?(edge1, edge2)
  edge1 == edge2
end

#finalize(options = {}) ⇒ Object



27
28
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 27

def finalize(options = {})
end

#format_uflex_edge(data, line_cnt, options = {}) ⇒ Object

Prepare the edge information for ES/TS file output



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 67

def format_uflex_edge(data, line_cnt, options = {})
  options = {
    no_disable: false
  }.merge(options)

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

  case data
  when /_d0_edge|_d_on/
    data = data.gsub(/_d0_edge|_d_on/, "F#{line_cnt}")
  when /_d1_edge|_d_data/
    data = data.gsub(/_d1_edge|_d_data/, "G#{line_cnt}")
  when /_d2_edge|_dret/
    data = data.gsub(/_d2_edge|_dret/, "H#{line_cnt}")
  when /_d3_edge|_d_off/
    data = data.gsub(/_d3_edge|_d_off/, "I#{line_cnt}")
  when /_c1_edge|_c_open/
    data = data.gsub(/_c1_edge|_c_open/, "K#{line_cnt}")
  when /_c2_edge|_c_close/
    data = data.gsub(/_c2_edge|_c_close/, "L#{line_cnt}")
  when /^\s*$/
    options[:no_disable] ? data = '' : data = 'disable'
  else
    data
  end
end

#format_uflex_edge_tsb(data, line_cnt, options = {}) ⇒ Object

Prepare the edge information for TSB file output



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 98

def format_uflex_edge_tsb(data, line_cnt, options = {})
  options = {
    no_disable: false
  }.merge(options)

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

  case data
  when /_d0_edge|_d_on/
    data = data.gsub(/_d0_edge|_d_on/, "I#{line_cnt}")
  when /_d1_edge|_d_data/
    data = data.gsub(/_d1_edge|_d_data/, "J#{line_cnt}")
  when /_d2_edge|_dret/
    data = data.gsub(/_d2_edge|_dret/, "K#{line_cnt}")
  when /_d3_edge|_d_off/
    data = data.gsub(/_d3_edge|_d_off/, "L#{line_cnt}")
  when /_c1_edge|_c_open/
    data = data.gsub(/_c1_edge|_c_open/, "N#{line_cnt}")
  when /_c2_edge|_c_close/
    data = data.gsub(/_c2_edge|_c_close/, "O#{line_cnt}")
  when /^\s*$/
    options[:no_disable] ? data = '' : data = 'disable'
  else
    data
  end
end

#get_pin_objects(grp) ⇒ Object

Populate an array of pins based on the pin or pingroup



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/origen_testers/igxl_based_tester/base/edgesets.rb', line 31

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_edges!(edge, old_val, new_val) ⇒ Object

Globally modify text within the edge object



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

def gsub_edges!(edge, old_val, new_val)
  edge.d_src   = edge.d_src.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.d_fmt   = edge.d_fmt.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.d0_edge = edge.d0_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.d1_edge = edge.d1_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.d2_edge = edge.d2_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.d3_edge = edge.d3_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.c_mode  = edge.c_mode.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.c1_edge = edge.c1_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.c2_edge = edge.c2_edge.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.t_res   = edge.t_res.gsub(/#{Regexp.escape(old_val)}/, new_val)
  edge.clk_per = edge.clk_per.gsub(/#{Regexp.escape(old_val)}/, new_val)
end