origen_testers 0.49.0 → 0.49.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d674d200f01a3d1d9b7c6162ecf527fa91c4466f5d59a5d6f5e0e33b4cd1a2d8
4
- data.tar.gz: fcfe7c097dc04374a29521dcc476e55b4aada56bbac7c060f677eed4c5c87748
3
+ metadata.gz: 75b1fa14ed70e74c6a983c7214b55a575b346563b296ef6381b0d90be0ac9383
4
+ data.tar.gz: 644ea157e1e0b4fd0586ef09360566dd6b9d9bbfa1fb216da16b9f6de3688616
5
5
  SHA512:
6
- metadata.gz: 3342964cf9787fd99bf25003963a3ff02182e325ac256161bc32eae15759f666bb7d3003ed82e63fd8e441a87b5c04bfc88d89ca54945672b9ba921adc71be02
7
- data.tar.gz: 3ed6932df2fcf98baba22cbf5ddf0f50284442b501d3f4ac0df269e4acdc7b1dcf6dc2d12f77441ae1b1fa1254ff797ac3434cbda35e15dfa7ccff65c820dc1d
6
+ metadata.gz: 67267f477fb2fa7796e92e0d742137781b8450125fee7756c8d3996f7511db6de66069b8a1564ca436295fd928318fc2a85c47a4d198155953b8126cca49f569
7
+ data.tar.gz: a9bb49fb80816c242860a099f9215c30d58080d535aae0cefd61f5f7875939968ba0a376af3b87c7839e52eef57713835b1f2fbab32b67a4e64a5aa7b92b242f
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
3
  MINOR = 49
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -583,14 +583,26 @@ module OrigenTesters::ATP
583
583
  end
584
584
 
585
585
  def loop(*args, &block)
586
- unless args[0].keys.include?(:from) && args[0].keys.include?(:to) && args[0].keys.include?(:step)
587
- fail 'Loop must specify :from, :to, :step'
586
+ unless args[0].keys.include?(:from) && args[0].keys.include?(:to)
587
+ fail 'Loop must specify :from, :to'
588
+ end
589
+ # assume 1 if :step not provided
590
+ unless args[0].keys.include?(:step)
591
+ args[0][:step] = 1
592
+ end
593
+ # assume 1 if :test_num_inc not provided
594
+ unless args[0].keys.include?(:test_num_inc)
595
+ args[0][:test_num_inc] = 1
596
+ end
597
+ # Add node for set of flag to be used for loop
598
+ unless args[0][:var].nil?
599
+ set(args[0][:var], 0)
588
600
  end
589
601
  extract_meta!(options) do
590
602
  apply_conditions(options) do
591
- # always pass 4-element array to loop node to simplify downstream parser
592
- # last element, 'var', will be nil if not specified by loop call
593
- params = [args[0][:from], args[0][:to], args[0][:step], args[0][:var]]
603
+ # always pass 5-element array to loop node to simplify downstream parser
604
+ # element, 'var', will be nil if not specified by loop call
605
+ params = [args[0][:from], args[0][:to], args[0][:step], args[0][:var], args[0][:test_num_inc]]
594
606
 
595
607
  node = n(:loop, params)
596
608
  node = append_to(node) { block.call }
@@ -603,7 +615,7 @@ module OrigenTesters::ATP
603
615
  define_method method do |*args, &block|
604
616
  options = args.pop if args.last.is_a?(Hash)
605
617
  unless args.size == 2
606
- fail "Format for relational operation must match: ':<opertor>(var1, var2)'"
618
+ fail "Format for relational operation must match: ':<operator>(var1, var2)'"
607
619
  end
608
620
  n2(method.to_sym, args[0], args[1])
609
621
  end unless method_defined?(method)
@@ -205,6 +205,8 @@ module OrigenTesters
205
205
  def active_description
206
206
  flow_file = OrigenTesters::Flow.callstack.last
207
207
  called_from = caller.find { |l| l =~ /^#{flow_file}:.*/ }
208
+ # Windows fix - prevent the drive letter in the file name from changing the index of the line_no below
209
+ called_from.gsub!(flow_file, '')
208
210
  desc = nil
209
211
  if called_from
210
212
  called_from = called_from.split(':')
@@ -257,8 +259,10 @@ module OrigenTesters
257
259
  flow_file = OrigenTesters::Flow.callstack.last
258
260
  called_from = caller.find { |l| l =~ /^#{flow_file}:.*/ }
259
261
  if called_from
262
+ # Splitting on ':' when file names are included will yield a different index for everything in Windows
263
+ called_from.gsub!(flow_file, '')
260
264
  called_from = called_from.split(':')
261
- options[:source_file] = called_from[0]
265
+ options[:source_file] = flow_file # called_from[0]
262
266
  options[:source_line_number] = called_from[1].to_i
263
267
  end
264
268
  end
@@ -462,6 +462,41 @@ module OrigenTesters
462
462
  alias_method :on_whenever_any, :on_whenever
463
463
  alias_method :on_whenever_all, :on_whenever
464
464
 
465
+ def on_loop(node, options = {})
466
+ # TODO: don't have the SMT8 way to do this yet
467
+ if smt8?
468
+ fail 'Flow loop control not yet supported for SMT8!'
469
+ end
470
+ start = node.to_a[0]
471
+ stop = node.to_a[1]
472
+ step = node.to_a[2]
473
+ if node.to_a[3].nil?
474
+ fail 'You must supply a loop variable name!'
475
+ else
476
+ var = generate_flag_name(node.to_a[3])
477
+ end
478
+ test_num_inc = node.to_a[4]
479
+ unless smt8?
480
+ var = "@#{var}"
481
+ end
482
+ num = (stop - start) / step + 1
483
+ # Handle increment/decrement
484
+ if step < 0
485
+ compare = '>'
486
+ incdec = "- #{step * -1}"
487
+ else
488
+ compare = '<'
489
+ incdec = "+ #{step}"
490
+ end
491
+ line "for #{var} = #{start}; #{var} #{compare} #{stop + step} ; #{var} = #{var} #{incdec}; do"
492
+ line "test_number_loop_increment = #{test_num_inc}"
493
+ line '{'
494
+ @indent += 1
495
+ process_all(node.children)
496
+ @indent -= 1
497
+ line '}'
498
+ end
499
+
465
500
  def generate_expr_string(node, options = {})
466
501
  return node unless node.respond_to?(:type)
467
502
  case node.type
@@ -254,7 +254,6 @@ Flow.create interface: 'OrigenTesters::Test::Interface', flow_name: "Flow Contro
254
254
  enable :nvm_minimum_ft, if_enable: "nvm_minimum_room", if_job: :fr
255
255
  enable :nvm_minimum_ft, if_enable: "nvm_minimum_cold", if_job: :fc
256
256
  disable :nvm_minimum_ft, if_enable: "nvm_minimum_hot", if_job: :fh
257
-
258
257
  log "Test enable words that wrap a lot of tests"
259
258
  if_enable :word1 do
260
259
  5.times do |i|
@@ -340,6 +339,39 @@ Flow.create interface: 'OrigenTesters::Test::Interface', flow_name: "Flow Contro
340
339
  func :test36, on_fail: { render: 'multi_bin;' }, if_flag: :my_flag, number: 51570
341
340
  end
342
341
 
342
+ if tester.v93k? && !tester.smt8?
343
+ log "Tests of flow loop"
344
+ loop from: 0, to: 5, step: 1, var: '$LOOP_VARIABLE' do
345
+ func :test_myloop, number: 56000
346
+ end
347
+
348
+ log "Tests of flow loop, no step"
349
+ loop from: 0, to: 5, var: '$LOOP_VARIABLE' do
350
+ func :test_myloop2, number: 5610
351
+ end
352
+
353
+ log "Tests of flow loop, non-default test number increment"
354
+ loop from: 0, to: 5, var: '$LOOP_VARIABLE', test_num_inc: 2 do
355
+ func :test_myloop3, number: 56200
356
+ end
357
+
358
+ log "Tests of decrementing loop"
359
+ loop from: 5, to: 2, step: -1, var: '$LOOP_VARIABLE' do
360
+ func :test_myloop4, number: 56300
361
+ end
362
+
363
+ log "Tests of nested flow loop, depth 3"
364
+ loop from: 0, to: 9, step: 2, var: '$LOOP_VARIABLE1'do
365
+ loop from: 1, to: 10, step: 1, var: '$LOOP_VARIABLE2' do
366
+ loop from: 1, to: 5, step: 1, var: '$LOOP_VARIABLE3' do
367
+ func :test_myloop5, number: 56400
368
+ end
369
+ end
370
+ end
371
+
372
+ # Test of skipping variable name not yet ready
373
+ end
374
+
343
375
  log 'An optimization test case, this should not generate a flag on V93K'
344
376
  func :test1, id: :t1a, number: 51580
345
377
 
@@ -339,4 +339,37 @@ end
339
339
  ~~~
340
340
 
341
341
 
342
+ #### Flow Loops for V93k (SMT7 only)
343
+ Use flow loop control to permit re-running tests without using additional sequence labels.
344
+
345
+ ~~~ruby
346
+ loop from: 0, to: 5, step: 1, var: '$LOOP_VARIABLE' do
347
+ func :test_myloop, number: 56000
348
+ end
349
+ ~~~
350
+
351
+ Indicating step value is optional, default is 1.
352
+
353
+ These loops can also be nested:
354
+ ~~~ruby
355
+ loop from: 0, to: 9, step: 2, var: '$LOOP_VARIABLE1'do
356
+ loop from: 1, to: 10, step: 1, var: '$LOOP_VARIABLE2' do
357
+ loop from: 1, to: 5, step: 1, var: '$LOOP_VARIABLE3' do
358
+ func :test_myloop5, number: 56400
359
+ end
360
+ end
361
+ end
362
+ ~~~
363
+
364
+ You can also indicate a test number increment if desired (default is 1):
365
+ ~~~ruby
366
+ loop from: 0, to: 5, var: '$LOOP_VARIABLE', test_num_inc: 2 do
367
+ func :test_myloop3, number: 56200
368
+ end
369
+ ~~~
370
+
371
+ Decrementing loops, having `from:` value > `to:` value and using negative `step:`, is also supported.
372
+
373
+
374
+
342
375
  % end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_testers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen