Class: OrigenTesters::Test::UltraFLEXInterface
- Inherits:
-
Object
- Object
- OrigenTesters::Test::UltraFLEXInterface
- Includes:
- UltraFLEX::Generator
- Defined in:
- lib/origen_testers/test/ultraflex_interface.rb
Instance Method Summary collapse
- #ac_specset(sheet_name, expression, options = {}) ⇒ Object
-
#add_ac_specs(ss, expression, options = {}) ⇒ Object
Adds new AC Spec object(s) to the given Specset.
-
#add_dc_specs(ss, expression, options = {}) ⇒ Object
Adds new DC Spec object(s) to the given Specset.
- #bin(number, options = {}) ⇒ Object
- #block_loop(name, options) ⇒ Object
-
#collect_ac_specs(ssname, edge, options = {}) ⇒ Object
Collects AC Spec object(s) from the given expression and adds them to the given Specset.
-
#collect_dc_specs(ssname, level, options = {}) ⇒ Object
Collects DC Spec object(s) from the given expression and adds them to the given Specset.
- #dc_specset(sheet_name, expression, options = {}) ⇒ Object
-
#edge(category, pin, options = {}) ⇒ Object
Assign relevant edges in preparation for edgeset/timeset sheet generation.
- #edge_collection ⇒ Object
- #edgeset(sheet_name, options = {}) ⇒ Object
- #func(name, options = {}) ⇒ Object
- #global_spec(var, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ UltraFLEXInterface
constructor
Options passed to Flow.create and Library.create will be passed in here, use as desired to configure your interface.
- #job_def(jname, options = {}) ⇒ Object
- #level_collection ⇒ Object
- #levelset(sheet_name, options = {}) ⇒ Object
- #log(msg) ⇒ Object
- #meas(name, options = {}) ⇒ Object
- #mto_memory(args) ⇒ Object
- #nop(options = {}) ⇒ Object
-
#or_ids(options = {}) ⇒ Object
OR 2 IDS together into 1 flag.
- #para(name, options = {}) ⇒ Object
-
#pin_level_se(category, options = {}) ⇒ Object
Assign relevant single-ended pin levels in preparation for levelset sheet generation.
-
#pinmap(name, options = {}) ⇒ Object
Assign relevant pins for pinmap sheet generation.
- #por(options = {}) ⇒ Object
-
#pwr_level(category, options = {}) ⇒ Object
Assign relevant power supply levels in preparation for levelset sheet generation.
- #reference(reference, options = {}) ⇒ Object
- #timeset(sheet_name, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ UltraFLEXInterface
Options passed to Flow.create and Library.create will be passed in here, use as desired to configure your interface
8 9 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 8 def initialize( = {}) end |
Instance Method Details
#ac_specset(sheet_name, expression, options = {}) ⇒ Object
190 191 192 193 194 195 196 197 198 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 190 def ac_specset(sheet_name, expression, = {}) = { specset: :default, nom: { typ: nil } }.merge() ss = ac_specsets(sheet_name) add_ac_specs(ss, expression, ) end |
#add_ac_specs(ss, expression, options = {}) ⇒ Object
Adds new AC Spec object(s) to the given Specset
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 218 def add_ac_specs(ss, expression, = {}) = { specset: :default }.merge() return unless expression.is_a? String # collect all variable names within the expression vars = expression.scan(/[a-zA-Z][\w]+/).map(&:to_sym) vars.each do |var| next if var =~ /^(d0_edge|d1_edge|d2_edge|d3_edge|c1_edge|c2_edge)$/ # The substitutions below are used for backward compatibility next if var =~ /^(d_on|d_data|d_ret|d_off|c_open|c_close)$/ next if var =~ /^(nS|uS|mS|S)$/i next if ss.ac_specsets.key?([:specset]) && ss.ac_specsets[[:specset]].include?(var) ss.add(var, ) end end |
#add_dc_specs(ss, expression, options = {}) ⇒ Object
Adds new DC Spec object(s) to the given Specset
321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 321 def add_dc_specs(ss, expression, = {}) = { specset: :default }.merge() return unless expression.is_a? String vars = expression.scan(/[a-zA-Z][\w]+/).map(&:to_sym) vars.each do |var| next if var =~ /^(nA|uA|mA|A|nV|uV|mV|V)$/i ss.add(var, ) end end |
#bin(number, options = {}) ⇒ Object
108 109 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 108 def bin(number, = {}) end |
#block_loop(name, options) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 71 def block_loop(name, ) if [:by_block] test_instances.group do |group| group.name = name $dut.blocks.each_with_index do |block, i| yield block, i, group end end else yield end end |
#collect_ac_specs(ssname, edge, options = {}) ⇒ Object
Collects AC Spec object(s) from the given expression and adds them to the given Specset
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 201 def collect_ac_specs(ssname, edge, = {}) = { nom: { typ: nil } }.merge() # Create a Specsets object from the UFlex program generator API ss = ac_specsets(ssname.to_sym) add_ac_specs(ss, edge.clk_per, ) add_ac_specs(ss, edge.d0_edge, ) add_ac_specs(ss, edge.d1_edge, ) add_ac_specs(ss, edge.d2_edge, ) add_ac_specs(ss, edge.d3_edge, ) add_ac_specs(ss, edge.c1_edge, ) add_ac_specs(ss, edge.c2_edge, ) end |
#collect_dc_specs(ssname, level, options = {}) ⇒ Object
Collects DC Spec object(s) from the given expression and adds them to the given Specset
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 294 def collect_dc_specs(ssname, level, = {}) = { nom: { typ: nil }, min: { min: nil }, max: { max: nil } }.merge() # Create a Specsets object from the UFlex program generator API ss = dc_specsets(ssname.to_sym) if level.respond_to?(:vmain) add_dc_specs(ss, level.vmain, ) add_dc_specs(ss, level.valt, ) add_dc_specs(ss, level.ifold, ) elsif level.respond_to?(:vil) add_dc_specs(ss, level.vil, ) add_dc_specs(ss, level.vih, ) add_dc_specs(ss, level.vol, ) add_dc_specs(ss, level.voh, ) add_dc_specs(ss, level.vcl, ) add_dc_specs(ss, level.vch, ) add_dc_specs(ss, level.vt, ) add_dc_specs(ss, level.voutlotyp, ) add_dc_specs(ss, level.vouthityp, ) end end |
#dc_specset(sheet_name, expression, options = {}) ⇒ Object
282 283 284 285 286 287 288 289 290 291 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 282 def dc_specset(sheet_name, expression, = {}) = { min: { min: nil }, nom: { typ: nil }, max: { max: nil } }.merge() ss = dc_specsets(sheet_name.to_sym) add_dc_specs(ss, expression, ) end |
#edge(category, pin, options = {}) ⇒ Object
Assign relevant edges in preparation for edgeset/timeset sheet generation
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 139 def edge(category, pin, = {}) = { d_src: 'PAT', # source of the channel drive data (e.g. pattern, drive_hi, drive_lo, etc.) d_fmt: 'NR', # drive data format (NR, RL, RH, etc.) d0_edge: '', # time at which the input drive is turned on d1_edge: '', # time of the initial data drive edge d2_edge: '', # time of the return format data drive edge d3_edge: '', # time at which the input drive is turned off c_mode: 'Edge', # output compare mode c1_edge: '', # time of the initial output compare edge c2_edge: '', # time of the final output compare edge (window compare) t_res: 'Machine', # timing resolution (possibly ATE-specific) clk_per: '' # clock period equation - for use with MCG }.merge() @edge_collection = edges @edge_collection.add(category, pin, ) end |
#edge_collection ⇒ Object
158 159 160 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 158 def edge_collection @edge_collection end |
#edgeset(sheet_name, options = {}) ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 162 def edgeset(sheet_name, = {}) = { edgeset: :es_default, period: 'cycle', # tester cycle period t_mode: 'Machine' # edgeset timing mode (possibly ATE-specific) }.merge() edgeset = .delete(:edgeset) pin = .delete(:pin) edge = .delete(:edge) @edgeset = edgesets(sheet_name, ) @edgeset.add(edgeset, pin, edge, ) collect_ac_specs(@edgeset.es[edgeset].spec_sheet, edge) end |
#func(name, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 15 def func(name, = {}) = { duration: :static }.merge() block_loop(name, ) do |block, i, group| ins = test_instances.functional(name) ins.set_wait_flags(:a) if [:duration] == :dynamic ins.pin_levels = .delete(:pin_levels) if [:pin_levels] if group pname = "#{name}_b#{i}_pset" patsets.add(pname, [{ pattern: "#{name}_b#{i}.PAT" }, { pattern: 'nvm_global_subs.PAT', start_label: 'subr' }]) ins.pattern = pname flow.test(group, ) if i == 0 else pname = "#{name}_pset" patsets.add(pname, [{ pattern: "#{name}.PAT" }, { pattern: 'nvm_global_subs.PAT', start_label: 'subr' }]) ins.pattern = pname if [:cz_setup] flow.cz(ins, [:cz_setup], ) else flow.test(ins, ) end end end end |
#global_spec(var, options = {}) ⇒ Object
335 336 337 338 339 340 341 342 343 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 335 def global_spec(var, = {}) = { job: nil, value: nil, comment: nil }.merge() global_specs('SpecsGlobal').add(var, job: [:job], value: [:value], comment: [:comment]) end |
#job_def(jname, options = {}) ⇒ Object
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 345 def job_def(jname, = {}) = { pinmap: pinmap_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, instances: test_instance_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, flows: flow_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, ac_specs: ac_specset_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, dc_specs: dc_specset_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, patsets: patset_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, patgroups: patgroup_sheets.map { |k, v| v.filename.gsub(/\.txt$/, '') }, bintables: [], cz: [], test_procs: [], mix_sig_timing: [], wave_defs: [], psets: [], sigs_port_map: [], fract_bus: [], comment: nil }.merge() program_jobs('Jobs').add(jname, ) end |
#level_collection ⇒ Object
269 270 271 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 269 def level_collection @level_collection end |
#levelset(sheet_name, options = {}) ⇒ Object
273 274 275 276 277 278 279 280 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 273 def levelset(sheet_name, = {}) pin = .delete(:pin) level = .delete(:level) @levelset = levelsets(sheet_name) @levelset.add(sheet_name, pin, level, ) collect_dc_specs(@levelset.spec_sheet, level) end |
#log(msg) ⇒ Object
11 12 13 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 11 def log(msg) flow.logprint(msg) end |
#meas(name, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 44 def meas(name, = {}) = { duration: :static }.merge() name = "meas_#{name}" unless name.to_s =~ /meas/ ins = test_instances.functional(name) ins.set_wait_flags(:a) if [:duration] == :dynamic ins.pin_levels = .delete(:pin_levels) if [:pin_levels] ins.lo_limit = [:lo_limit] ins.hi_limit = [:hi_limit] ins.scale = [:scale] ins.units = [:units] ins.defer_limits = [:defer_limits] pname = "#{name}_pset" patsets.add(pname, [{ pattern: "#{name}.PAT" }, { pattern: 'nvm_global_subs.PAT', start_label: 'subr' }]) ins.pattern = pname if [:cz_setup] flow.cz(ins, [:cz_setup], ) else flow.test(ins, ) end end |
#mto_memory(args) ⇒ Object
104 105 106 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 104 def mto_memory(args) # DO NOTHING, NOT YET SUPPORTED IN ULTRAFLEX end |
#nop(options = {}) ⇒ Object
100 101 102 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 100 def nop( = {}) flow.nop end |
#or_ids(options = {}) ⇒ Object
OR 2 IDS together into 1 flag
96 97 98 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 96 def or_ids( = {}) flow.or_flags([:id1], [:id2], ) end |
#para(name, options = {}) ⇒ Object
91 92 93 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 91 def para(name, = {}) print "UltraFLEX Parametric Test not yet supported for UltraFlex!\n" end |
#pin_level_se(category, options = {}) ⇒ Object
Assign relevant single-ended pin levels in preparation for levelset sheet generation
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 251 def pin_level_se(category, = {}) = { vil: 0, # Input drive low vih: 1.8, # Input drive high vol: 1.0, # Output compare low voh: 0.8, # Output compare high vcl: -1, # Voltage clamp low vch: 2.5, # Voltage clamp high vt: 0.9, # Termination voltage voutlotyp: 0, # vouthityp: 0, # dmode: 'Largeswing-VT' # Driver mode }.merge() @level_collection = levels @level_collection.add_se_pin_level(category, ) end |
#pinmap(name, options = {}) ⇒ Object
Assign relevant pins for pinmap sheet generation
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 112 def pinmap(name, = {}) pinmap = pinmaps("#{name}") Origen.top_level.add_pin_group :JTAG, :tdi, :tdo, :tms Origen.top_level.power_pin_groups.keys.each do |grp_key| pinmap.add_power_pin(grp_key, type: 'Power', comment: "# #{grp_key}") end Origen.top_level.virtual_pins.keys.each do |util_pin| upin = Origen.top_level.virtual_pins(util_pin) case upin.type when :virtual_pin pinmap.add_utility_pin(upin.name, type: 'Utility', comment: "# #{util_pin}") when :ate_ch pinmap.add_utility_pin(upin.name, type: 'I/O', comment: "# #{util_pin}") end end Origen.top_level.pin.keys.each do |pkey| pinmap.add_pin(Origen.top_level.pin(pkey).name, type: 'I/O', comment: "# #{pkey}") end Origen.top_level.pin_groups.keys.sort.each do |gkey| # Do not include pins that are aliased to themselves Origen.top_level.pin(gkey).each do |pin| pinmap.add_group_pin(gkey, Origen.top_level.pin(pin.id).name, type: 'I/O', comment: "# #{gkey}") end end end |
#por(options = {}) ⇒ Object
84 85 86 87 88 89 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 84 def por( = {}) = { instance_not_available: true }.merge() flow.test('por_ins', ) end |
#pwr_level(category, options = {}) ⇒ Object
Assign relevant power supply levels in preparation for levelset sheet generation
238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 238 def pwr_level(category, = {}) = { vmain: 1.8, # Main supply voltage valt: 1.8, # Alternate supply voltage ifold: 1, # Supply clamp current delay: 0 # Supply power-up delay }.merge() @level_collection = levels @level_collection.add_power_level(category, ) end |
#reference(reference, options = {}) ⇒ Object
368 369 370 371 372 373 374 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 368 def reference(reference, = {}) = { comment: nil }.merge() references('Refs').add(reference, ) end |
#timeset(sheet_name, options = {}) ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/origen_testers/test/ultraflex_interface.rb', line 177 def timeset(sheet_name, = {}) = { timeset: :default, master_ts: :default }.merge() timeset = .delete(:timeset) pin = .delete(:pin) eset = .delete(:eset) @timeset = timesets(sheet_name, ) @timeset.add(timeset, pin, eset, ) end |