origen_testers 0.9.8 → 0.9.9

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
  SHA1:
3
- metadata.gz: 706814107f22131efb6ebf0c670169ce8bbcdfbc
4
- data.tar.gz: e6ccc22c67fd1473978afa030a6b092e2b41f26f
3
+ metadata.gz: 9a7d6f5f17bb69b966e7c3b833e91a8b593e226d
4
+ data.tar.gz: 54c251cd6238267287e6921dbe5dc32b27c56db0
5
5
  SHA512:
6
- metadata.gz: 353998902cd8c9477e5c053a0c248c7824e3cc3b942c49107e3f3b26865daea3489979fe1fe49f9a90d3621e4af8ffadfef5b8dae8caea4e9af9b5f097cc6675
7
- data.tar.gz: 1e05c58fe84a8e81ee6d35fb68043d7278e6fdf37fb5819a6065e8319fa7b26b165cb3f6103ff63c4ebb551e80cd74aaef17ac01a208f889fd956ceb083aa5a7
6
+ metadata.gz: eca1251500248c27679ccd44b438168f1e15a5c84e9f2165532490d8656945ac3c1637452df6cc2a1bbd6d7063b35c5e9e27ca577d2ea270064be5f44f1b6e94
7
+ data.tar.gz: 27388317149cb3eb64f4e4d998442b9076816a488f5d13c9954a74593efd7993c0b718a7bd6eaeeca1a3db65490f80feb105ac1230f4d61c2ebfc9966a8eb988
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
3
  MINOR = 9
4
- BUGFIX = 8
4
+ BUGFIX = 9
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
data/lib/commands/run.rb CHANGED
@@ -33,12 +33,16 @@ unless program
33
33
  exit 1
34
34
  end
35
35
 
36
- flow = ARGV.first
37
-
38
- unless flow
39
- puts 'You must supply the name of the flow to execute, the current program has these flows'
40
- puts OrigenTesters.program.flows.keys
41
- exit 1
36
+ unless ARGV.first
37
+ if OrigenTesters.program.flows.keys.size == 1
38
+ ARGV << OrigenTesters.program.flows.keys.first
39
+ else
40
+ puts 'You must supply the name of the flow to execute, the current program has these flows'
41
+ puts OrigenTesters.program.flows.keys
42
+ exit 1
43
+ end
42
44
  end
43
45
 
44
- OrigenTesters.program.flows[flow.to_sym].run(options)
46
+ ARGV.each do |flow|
47
+ OrigenTesters.program.flows[flow.to_sym].run(options)
48
+ end
@@ -60,6 +60,11 @@ module OrigenTesters
60
60
  !is_vector_based?
61
61
  end
62
62
 
63
+ def stil?
64
+ defined?(OrigenTesters::StilBasedTester::Base) &&
65
+ is_a?(OrigenTesters::StilBasedTester::Base)
66
+ end
67
+
63
68
  def j750?
64
69
  is_a?(OrigenTesters::IGXLBasedTester::J750)
65
70
  end
@@ -51,6 +51,30 @@ module OrigenTesters
51
51
  OrigenTesters::Interface.write?
52
52
  end
53
53
 
54
+ # Set to :enabled to have the current flow wrapped by an enable flow variable
55
+ # that is enabled by default (top-level flow has to disable modules it doesn't want).
56
+ #
57
+ # Set to :disabled to have the opposite, where the top-level flow has to enable all
58
+ # modules.
59
+ #
60
+ # Set to nil to have no wrapping. While this is the default, setting this to nil will
61
+ # override any setting of the attribute of the same name that has been set at
62
+ # tester-level by the target.
63
+ def add_flow_enable=(value)
64
+ return unless flow.respond_to?(:add_flow_enable=)
65
+ if value
66
+ if value == :enable || value == :enabled
67
+ flow.add_flow_enable = :enabled
68
+ elsif value == :disable || value == :disabled
69
+ flow.add_flow_enable = :disabled
70
+ else
71
+ fail "Unknown add_flow_enable value, #{value}, must be :enabled or :disabled"
72
+ end
73
+ else
74
+ flow.add_flow_enable = nil
75
+ end
76
+ end
77
+
54
78
  # This identifier will be used to make labels and other references unique to the
55
79
  # current application. This will help to avoid name duplication if a program is
56
80
  # comprised of many modules generated by Origen.
@@ -9,6 +9,8 @@ module OrigenTesters
9
9
  # Returns an array containing all runtime variables which get set by the flow
10
10
  attr_reader :set_runtime_variables
11
11
 
12
+ attr_accessor :add_flow_enable
13
+
12
14
  def var_filename
13
15
  @var_filename || 'global'
14
16
  end
@@ -39,11 +41,48 @@ module OrigenTesters
39
41
  def at_flow_end
40
42
  end
41
43
 
44
+ def flow_header
45
+ h = ['{']
46
+ if add_flow_enable
47
+ var = filename.sub(/\..*/, '').upcase
48
+ var = "#{var}_ENABLE"
49
+ if add_flow_enable == :enabled
50
+ flow_control_variables << [var, 1]
51
+ else
52
+ flow_control_variables << [var, 0]
53
+ end
54
+ h << " if @#{var} == 1 then"
55
+ h << ' {'
56
+ i = ' '
57
+ else
58
+ i = ''
59
+ end
60
+
61
+ h << i + ' {'
62
+ set_runtime_variables.each do |var|
63
+ h << i + " @#{var.to_s.upcase} = -1;"
64
+ end
65
+ h << i + ' }, open,"Init Flow Control Vars", ""'
66
+ h
67
+ end
68
+
69
+ def flow_footer
70
+ f = []
71
+ if add_flow_enable
72
+ f << ' }'
73
+ f << ' else'
74
+ f << ' {'
75
+ f << ' }'
76
+ end
77
+ f << "}, open,\"#{filename.sub(/\..*/, '').upcase}\", \"\""
78
+ f
79
+ end
80
+
42
81
  def finalize(options = {})
43
82
  super
44
83
  test_suites.finalize
45
84
  test_methods.finalize
46
- @indent = 0
85
+ @indent = add_flow_enable ? 2 : 1
47
86
  @lines = []
48
87
  @stack = { on_fail: [], on_pass: [] }
49
88
  m = Processors::IfRanCleaner.new.process(model.ast)
@@ -54,7 +93,7 @@ module OrigenTesters
54
93
  end
55
94
 
56
95
  def line(str)
57
- @lines << (' ' * @indent * 2) + str
96
+ @lines << (' ' * @indent) + str
58
97
  end
59
98
 
60
99
  # def on_flow(node)
@@ -27,6 +27,9 @@ module OrigenTesters
27
27
  # @api private
28
28
  def at_flow_start
29
29
  flow.at_flow_start
30
+ # Initialize this to the value currently set on the tester, any further setting of
31
+ # this by the interface will override
32
+ flow.add_flow_enable = tester.add_flow_enable
30
33
  @pattern_master_filename = nil
31
34
  end
32
35
 
@@ -18,8 +18,11 @@ module OrigenTesters
18
18
  end
19
19
 
20
20
  def clean_flow_control_variables
21
- # These map to user flags and can only be integers
22
- flow_control_variables.uniq.sort
21
+ flow_control_variables.uniq.sort do |x, y|
22
+ x = x[0] if x.is_a?(Array)
23
+ y = y[0] if y.is_a?(Array)
24
+ x <=> y
25
+ end
23
26
  end
24
27
 
25
28
  def clean_runtime_control_variables
@@ -6,10 +6,16 @@ module OrigenTesters
6
6
  # Disable inline (end of vector) comments, enabled by default
7
7
  attr_accessor :inline_comments
8
8
 
9
- # Returns a new J750 instance, normally there would only ever be one of these
10
- # assigned to the global variable such as $tester by your target:
11
- # $tester = J750.new
12
- def initialize
9
+ # Returns whether the tester has been configured to wrap top-level flow modules with an
10
+ # enable or not.
11
+ #
12
+ # Returns nil if not.
13
+ #
14
+ # Returns :enabled if the enable is configured to be on by default, or :disabled if it is
15
+ # configured to be off by default.
16
+ attr_reader :add_flow_enable
17
+
18
+ def initialize(options = {})
13
19
  @max_repeat_loop = 65_535
14
20
  @min_repeat_loop = 33
15
21
  @pat_extension = 'avc'
@@ -20,6 +26,26 @@ module OrigenTesters
20
26
  @comment_char = '#'
21
27
  @level_period = true
22
28
  @inline_comments = true
29
+ if options[:add_flow_enable]
30
+ self.add_flow_enable = options[:add_flow_enable]
31
+ end
32
+ end
33
+
34
+ # Set to :enabled to have all top-level flow modules wrapped by an enable flow variable
35
+ # that is enabled by default (top-level flow has to disable modules it doesn't want).
36
+ #
37
+ # Set to :disabled to have the opposite, where the top-level flow has to enable all
38
+ # modules.
39
+ #
40
+ # Note that the interface can override this setting for each flow during program generation.
41
+ def add_flow_enable=(value)
42
+ if value == :enable || value == :enabled
43
+ @add_flow_enable = :enabled
44
+ elsif value == :disable || value == :disabled
45
+ @add_flow_enable = :disabled
46
+ else
47
+ fail "Unknown add_flow_enable value, #{value}, must be :enabled or :disabled"
48
+ end
23
49
  end
24
50
 
25
51
  # Capture the pin data from a vector to the tester.
@@ -175,16 +175,15 @@ test_flow
175
175
  <%= line %>
176
176
  % end
177
177
  % else
178
- {
179
- {
180
- % set_runtime_variables.each do |var|
181
- @<%= var.to_s.upcase %> = -1;
178
+ % flow_header.each do |line|
179
+ <%= line %>
182
180
  % end
183
- }, open,"Init Flow Control Vars", ""
184
181
  % lines.each do |line|
185
- <%= line %>
182
+ <%= line %>
183
+ % end
184
+ % flow_footer.each do |line|
185
+ <%= line %>
186
186
  % end
187
- }, open,"<%= filename.sub(/\..*/, '').upcase %>", ""
188
187
  % end
189
188
  end
190
189
  -------------------------------------------------
data/program/prb2.rb CHANGED
@@ -2,6 +2,9 @@
2
2
  # a single source file
3
3
  Flow.create interface: 'OrigenTesters::Test::Interface' do
4
4
 
5
+ # Test that this can be overridden from the target at flow-level
6
+ self.add_flow_enable = :enabled
7
+
5
8
  self.resources_filename = 'prb2'
6
9
 
7
10
  func :erase_all, :duration => :dynamic
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.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-04 00:00:00.000000000 Z
11
+ date: 2017-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -343,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
343
  version: 1.8.11
344
344
  requirements: []
345
345
  rubyforge_project:
346
- rubygems_version: 2.6.7
346
+ rubygems_version: 2.5.2
347
347
  signing_key:
348
348
  specification_version: 4
349
349
  summary: This plugin provides Origen tester models to drive ATE type testers like