origen_testers 0.19.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/config/application.rb +34 -1
  3. data/config/version.rb +1 -1
  4. data/lib/origen_testers/flow.rb +1 -0
  5. data/lib/origen_testers/interface.rb +28 -0
  6. data/lib/origen_testers/pattern_compilers/v93k.rb +3 -1
  7. data/lib/origen_testers/smartest_based_tester/base.rb +14 -1
  8. data/lib/origen_testers/smartest_based_tester/base/test_methods/ac_tml.rb +10 -10
  9. data/lib/origen_testers/test/interface.rb +3 -0
  10. data/pattern/tester_overlay.rb +12 -1
  11. data/program/_erase.rb +1 -1
  12. data/program/components/_prb1_main.rb +3 -3
  13. data/program/test.rb +2 -2
  14. data/templates/origen_guides/pattern/common.md.erb +376 -0
  15. data/templates/origen_guides/pattern/creating.md.erb +133 -0
  16. data/templates/origen_guides/pattern/custom.md.erb +5 -0
  17. data/templates/origen_guides/pattern/documenting.md.erb +431 -0
  18. data/templates/origen_guides/pattern/introduction.md.erb +38 -0
  19. data/templates/origen_guides/pattern/j750.md.erb +10 -0
  20. data/templates/origen_guides/pattern/name.md.erb +511 -0
  21. data/templates/origen_guides/pattern/pins.md.erb +125 -0
  22. data/templates/origen_guides/pattern/registers.md.erb +300 -0
  23. data/templates/origen_guides/pattern/running.md.erb +105 -0
  24. data/templates/origen_guides/pattern/timing.md.erb +281 -0
  25. data/templates/origen_guides/pattern/ultraflex.md.erb +10 -0
  26. data/templates/origen_guides/pattern/v93k.md.erb +41 -0
  27. data/templates/origen_guides/program/code.md.erb +78 -0
  28. data/templates/origen_guides/program/custom.md.erb +5 -0
  29. data/templates/origen_guides/program/doc.md.erb +402 -0
  30. data/templates/origen_guides/program/flowapi.md.erb +249 -0
  31. data/templates/origen_guides/program/flows.md.erb +429 -0
  32. data/templates/origen_guides/program/generating.md.erb +97 -0
  33. data/templates/origen_guides/program/interface.md.erb +248 -0
  34. data/templates/origen_guides/program/introduction.md.erb +56 -0
  35. data/templates/origen_guides/program/j750.md.erb +514 -0
  36. data/templates/origen_guides/program/philosophy.md.erb +99 -0
  37. data/templates/origen_guides/program/resources.md.erb +141 -0
  38. data/templates/origen_guides/program/ultraflex.md.erb +5 -0
  39. data/templates/origen_guides/program/v93k.md.erb +456 -0
  40. data/templates/web/layouts/_guides.html.erb +10 -0
  41. data/templates/web/partials/_placeholder.md.erb +10 -0
  42. metadata +33 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0f9e7b0562c602396e9cb070d57050486a854df
4
- data.tar.gz: fbde57d2fa40beae37c0443261339bb2f8c187d7
3
+ metadata.gz: 3881d822046882174c8753d75a00c744a880799a
4
+ data.tar.gz: 8fac7fb32ad1c98a8111e162d71cb1e1ec44ea48
5
5
  SHA512:
6
- metadata.gz: f58d90428732f2046cf98e8b0c175531fd1a150eb86c8771beb3e766b2ec2de483f7cd7f72d8b1d74d78edcf6c9ece7fe9a587f5945b38cb8be88e793c915e07
7
- data.tar.gz: c87af16d5020f20bdae4abcc3b6227e21f2c33d87c5e9f2d156e9d452f53840153ff1ceb1043586a0d257ebe27c30ca29f02c37ee64853e1cddbca89a7c61c48
6
+ metadata.gz: f73357e78f88dc4957f46f32fc6f567c5725d8f0376ca5654ef37c04fefc82c54d9f66518a08964c04cbabb4c3869f8004e491a0151e791001fd5f86ddb43c73
7
+ data.tar.gz: c14255719d7077016fd21d8d23de5a6d0ee10179aaef18c7c0b4682ca37fdfacb3a50ebbab44f989e0caf14c928c3139638b2fde61c5e3c57df2ec4856887b49
@@ -3,7 +3,40 @@ class OrigenTestersApplication < Origen::Application
3
3
  # for a full list of the configuration options available
4
4
 
5
5
  config.shared = {
6
- :command_launcher => "config/shared_commands.rb"
6
+ command_launcher: "config/shared_commands.rb",
7
+ origen_guides: "templates/origen_guides",
8
+ origen_guides_index: -> (index) do
9
+ index.section :pattern, heading: "Pattern Generator", after: :controllers do |section|
10
+ section.page :introduction, heading: "Introduction"
11
+ section.page :creating, heading: "Creating Patterns"
12
+ section.page :pins, heading: "Pins"
13
+ section.page :timing, heading: "Timing and Waiting"
14
+ section.page :registers, heading: "Registers"
15
+ section.page :documenting, heading: "Documenting Patterns"
16
+ section.page :name, heading: "Generating by Name"
17
+ section.page :common, heading: "Common API"
18
+ section.page :j750, heading: "J750 API"
19
+ section.page :v93k, heading: "V93K API"
20
+ section.page :ultraflex, heading: "UltraFlex API"
21
+ section.page :custom, heading: "Custom Testers"
22
+ section.page :running, heading: "Running The PatGen"
23
+ end
24
+ index.section :program, heading: "Test Program Generator", after: :pattern do |section|
25
+ section.page :introduction, heading: "Introduction"
26
+ section.page :philosophy, heading: "Philosophy"
27
+ section.page :flows, heading: "Creating Flows"
28
+ section.page :flowapi, heading: "Managing Flow Control"
29
+ section.page :interface, heading: "Creating an Interface"
30
+ section.page :resources, heading: "Additional Resources"
31
+ section.page :code, heading: "Dynamic Custom Code"
32
+ section.page :j750, heading: "J750 API"
33
+ section.page :v93k, heading: "V93K API"
34
+ section.page :ultraflex, heading: "UltraFLEX API"
35
+ section.page :doc, heading: "Documenting the Program"
36
+ section.page :custom, heading: "Creating Custom Testers"
37
+ section.page :generating, heading: "Running the ProgGen"
38
+ end
39
+ end
7
40
  }
8
41
 
9
42
  # This information is used in headers and email templates, set it specific
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
3
  MINOR = 19
4
- BUGFIX = 0
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -49,6 +49,7 @@ module OrigenTesters
49
49
  end
50
50
 
51
51
  def test(obj, options = {})
52
+ @_last_parameters_ = options.dup # Save for the interface's if_parameter_changed method
52
53
  obj.extract_atp_attributes(options) if obj.respond_to?(:extract_atp_attributes)
53
54
  super(obj, options)
54
55
  end
@@ -55,6 +55,34 @@ module OrigenTesters
55
55
  OrigenTesters::Interface.write?
56
56
  end
57
57
 
58
+ # Returns true if the test flow context (as supplied in the given options)
59
+ # has changed vs. that applied to the previous test.
60
+ # Flow context means enabled words, job, if_failed/passed, etc.
61
+ def context_changed?(options = {})
62
+ flow.context_changed?(options)
63
+ end
64
+
65
+ # Returns true if the value of the given parameter within the given options is
66
+ # different vs. the last test
67
+ # if parameter_changed?(:vdd, :vddc, options)
68
+ # # execute code if the vdd level has changed
69
+ # end
70
+ def parameter_changed?(*params)
71
+ options = params.last.is_a?(Hash) ? params.pop : {}
72
+ last = flow.instance_variable_get(:@_last_parameters_)
73
+ if last
74
+ params.any? { |p| options[p] != last[p] }
75
+ else
76
+ false
77
+ end
78
+ end
79
+
80
+ # Convenience method, equivalent of calling (context_changed? || parameter_changed?)
81
+ def context_or_parameter_changed?(*params)
82
+ options = params.last.is_a?(Hash) ? params.pop : {}
83
+ context_changed?(options) || parameter_changed?(*params, options)
84
+ end
85
+
58
86
  # Returns the value defined on if/how to make test names unique within a flow
59
87
  def unique_test_names
60
88
  @unique_test_names
@@ -313,7 +313,9 @@ module OrigenTesters
313
313
  def avc_digcap_vpf(contents)
314
314
  capture_vectors = 0
315
315
  contents.each_line do |line|
316
- capture_vectors += 1 if /#{digcap.capture_string}/.match(line)
316
+ if line[0] != "\#" # skip any comment lines
317
+ capture_vectors += 1 if /#{digcap.capture_string}/.match(line)
318
+ end
317
319
  end
318
320
  capture_vectors
319
321
  end
@@ -147,16 +147,29 @@ module OrigenTesters
147
147
  when :subroutine, :default
148
148
  subroutine_overlay(overlay_str, options)
149
149
  ovly_style = :subroutine
150
+ when :handshake
151
+ if @delayed_handshake
152
+ if @delayed_handshake != overlay_str
153
+ handshake
154
+ @delayed_handshake = overlay_str
155
+ end
156
+ else
157
+ @delayed_handshake = overlay_str
158
+ end
150
159
  else
151
160
  ovly_style = overlay_style_warn(options[:overlay][:overlay_str], options)
152
161
  end # case ovly_style
153
162
  else
163
+ handshake if @delayed_handshake
164
+ @delayed_handshake = nil
154
165
  @overlay_subr = nil
155
166
  end # of handle overlay
156
167
 
157
168
  options_overlay = options.delete(:overlay) if options.key?(:overlay)
158
169
 
159
- super(options) unless ovly_style == :subroutine
170
+ unless ovly_style == :subroutine || ovly_style == :handshake
171
+ super(options)
172
+ end
160
173
 
161
174
  unless options_overlay.nil?
162
175
  # stage = :body if ovly_style == :subroutine # always set stage back to body in case subr overlay was selected
@@ -18,16 +18,16 @@ module OrigenTesters
18
18
  output: [:string, 'None', %w(None ReportUI ShowFailOnly)]
19
19
  },
20
20
  spec_search: {
21
- max: [:string, nil],
22
- method: [:string, nil],
23
- min: [:string, nil],
24
- output: [:string, 'None', %w(None ReportUI ShowFailOnly)],
25
- resolution: [:string, ''],
26
- result_pin_list: [:string, ''],
27
- setup_pin_list: [:string, ''],
28
- spec: [:string, nil],
29
- step: [:string, nil],
30
- test_name: [:string, 'SpecSearch_Test']
21
+ max: [:string, nil],
22
+ method: [:string, nil],
23
+ min: [:string, nil],
24
+ output: [:string, 'None', %w(None ReportUI ShowFailOnly)],
25
+ resolution: [:string, ''],
26
+ result_pinlist: [:string, ''],
27
+ setup_pinlist: [:string, ''],
28
+ spec: [:string, nil],
29
+ step: [:string, nil],
30
+ test_name: [:string, 'SpecSearch_Test']
31
31
  }
32
32
  }
33
33
 
@@ -29,9 +29,11 @@ module OrigenTesters
29
29
  options = {
30
30
  duration: :static
31
31
  }.merge(options)
32
+ number = options[:number]
32
33
 
33
34
  if tester.j750? || tester.uflex?
34
35
  block_loop(name, options) do |block, i, group|
36
+ options[:number] = number + i if number && i
35
37
  ins = test_instances.functional(name)
36
38
  ins.set_wait_flags(:a) if options[:duration] == :dynamic
37
39
  ins.pin_levels = options.delete(:pin_levels) if options[:pin_levels]
@@ -56,6 +58,7 @@ module OrigenTesters
56
58
 
57
59
  elsif tester.v93k?
58
60
  block_loop(name, options) do |block, i|
61
+ options[:number] = number + i if number && i
59
62
  tm = test_methods.ac_tml.ac_test.functional_test
60
63
  ts = test_suites.run(name, options)
61
64
  ts.test_method = tm
@@ -59,4 +59,15 @@ Pattern.create(name: "test_overlay") do
59
59
  tester.cycle inline_comment: '2nd line after global label for overlay', overlay: {overlay_str: 'global_label_test', pins: dut.pin(:pa)}
60
60
  tester.cycle inline_comment: '3rd line after global label for overlay', overlay: {overlay_str: 'global_label_test', pins: dut.pin(:pa)}
61
61
  tester.cycle repeat: 20
62
- end
62
+
63
+ if tester.v93k?
64
+ ss "Now kick the tires of handshake overlay"
65
+ tester.cycle repeat: 20
66
+ tester.overlay_style = :handshake
67
+ dut.pin(:pa).drive(5)
68
+ tester.cycle inline_comment: '1st line after global label for overlay', overlay: {overlay_str: 'global_label_test', pins: dut.pin(:pa)}
69
+ tester.cycle inline_comment: '2nd line after global label for overlay', overlay: {overlay_str: 'global_label_test', pins: dut.pin(:pa)}
70
+ tester.cycle inline_comment: '3rd line after global label for overlay', overlay: {overlay_str: 'global_label_test', pins: dut.pin(:pa)}
71
+ tester.cycle repeat: 20
72
+ end
73
+ end
@@ -19,7 +19,7 @@ Flow.create do |options|
19
19
 
20
20
  options[:pulses].times do |i|
21
21
  func :erase_all, number: number
22
- number += i * 10
22
+ number += (i + 1) * 10
23
23
  end
24
24
 
25
25
  if options[:post_verify]
@@ -221,9 +221,9 @@ Flow.create do |options|
221
221
  bin 13, unless_enable: "AlarmEnabled"
222
222
  end
223
223
 
224
- 3.times do |k|
225
- cc "cc test #{k}"
226
- func "cc_test_#{k}".to_sym
224
+ 3.times do |i|
225
+ cc "cc test #{i}"
226
+ func "cc_test_#{i}".to_sym, number: 7000 + i
227
227
  end
228
228
 
229
229
  pass 1, description: "Good die!", softbin: 1
@@ -11,9 +11,9 @@ Flow.create interface: 'OrigenTesters::Test::Interface' do
11
11
  # para 'charge_pump', :high_voltage => true, :lo_limit => 5, :hi_limit => 6
12
12
 
13
13
  if tester.v93k? && tester.create_limits_file
14
- func :program_ckbd, :number => 1000, :bin => 100, :soft_bin => 1100
14
+ func :program_ckbd, bin: 100, soft_bin: 1100, number: 40000
15
15
  end
16
- meas :read_pump, tnum: 1050, bin: 119, soft_bin: 2, lo_limit: 35, number: 40000
16
+ meas :read_pump, tnum: 1050, bin: 119, soft_bin: 2, lo_limit: 35, number: 40005
17
17
  meas :read_pump, tnum: 1060, bin: 119, soft_bin: 2, hi_limit: 45, number: 40010
18
18
  meas :read_pump, tnum: 1070, bin: 119, soft_bin: 2, hi_limit: 45, lo_limit: 35, number: 40020
19
19
  meas :read_pump, tnum: 1080, bin: 119, soft_bin: 2, hi_limit: 45, lo_limit: 35, number: 40030
@@ -0,0 +1,376 @@
1
+ % render "layouts/guides.html" do
2
+
3
+ All tester drivers support the common API described in this guide. By building your patterns
4
+ using this API your will be able to generate them for any ATE that is supported by Origen.
5
+
6
+ Some tester drivers may expose additional methods to leverage some key features of
7
+ the given ATE which do not have direct equivalents on other systems. You may or may not
8
+ choose to use these in your application. If you do, then be aware that you are introducing
9
+ some logic which cannot be automatically translated to other ATEs. In that case you will have to implement
10
+ the alternative implementation for other platforms on the application side,
11
+ something like this:
12
+
13
+ ~~~ruby
14
+ if $tester.uflex?
15
+ # An implementation that uses a method that only exists on the UltraFLEX driver,
16
+ # this will make the test run more efficiently on that platform
17
+ else
18
+ # Conventional implementation using the common API for all other platforms
19
+ end
20
+ ~~~
21
+
22
+ Of course some applications may only ever wish to target a specific ATE, in that case you
23
+ can freely pick from the common and ATE-specific APIs.
24
+
25
+ This API is currently provided by the [Origen Testers plugin](http://origen-sdk.org/testers). In addition
26
+ to the primary methods discussed below, all tester drivers support the methods described in the following
27
+ API docs:
28
+
29
+ * [OrigenTesters::VectorGenerator](http://origen-sdk.org/testers/api/OrigenTesters/VectorGenerator.html)
30
+ * [OrigenTesters::Timing](http://origen-sdk.org/testers/api/OrigenTesters/Timing.html)
31
+ * [OrigenTesters::API](http://origen-sdk.org/testers/api/OrigenTesters/API.html)
32
+
33
+ ### API Methods
34
+
35
+ Here are each of the main methods supported by the common API.
36
+
37
+ #### Generating Cycles
38
+
39
+ These are the basic methods for generating vectors.
40
+
41
+ ##### cycle(options = {})
42
+
43
+ Generate a tester cycle or cycles:
44
+
45
+ ~~~ruby
46
+ $tester.cycle
47
+ $tester.cycle repeat: 1000
48
+ ~~~
49
+
50
+ As this is such a commonly used method, there are some convenience methods available, this is
51
+ equivalent to the above example:
52
+
53
+ ~~~ruby
54
+ 1.cycle
55
+ 1000.cycles
56
+ ~~~
57
+
58
+ A very common pattern when working at this level is to setup some pin states and
59
+ then trigger a cycle:
60
+
61
+ ~~~ruby
62
+ pin(:tdi).drive(1)
63
+ $tester.cycle
64
+ pin(:tdi).drive(0)
65
+ $tester.cycle
66
+ ~~~
67
+
68
+ All of the pin state methods support a bang (<code>!</code>) variant which will automatically
69
+ call a single cycle after setting the pin state, this is equivalent to the above:
70
+
71
+ ~~~ruby
72
+ pin(:tdi).drive!(1)
73
+ pin(:tdi).drive!(0)
74
+ ~~~
75
+
76
+ ##### wait(options = {})
77
+
78
+ Repeats the last vector for the specified about of time. The time can be specified in cycles
79
+ or a time, multiple arguments will be added together:
80
+
81
+ ~~~ruby
82
+ $tester.wait cycles: 1000 # Equivalent to $tester.cycle(repeat: 1000)
83
+ $tester.wait time_in_us: 1000 # Wait for 1000us
84
+ $tester.wait time_in_ms: 1 # Wait for 1ms
85
+
86
+ $tester.wait time_in_ms: 1, time_in_us: 1000, cycles: 100 # Wait for 2ms + 100 cycles
87
+ ~~~
88
+
89
+ The wait method can also be called with additional arguments to generate a dynamic wait,
90
+ i.e. a match loop.
91
+ Here for example to wait for up to 2 seconds for the done pin to go high:
92
+
93
+ ~~~ruby
94
+ $tester.wait match: true, time_in_s: 2, pin: pin(:done), state: :high
95
+ ~~~
96
+
97
+ The above API is somewhat verbose, a cleaner one is available by supplying a block to generate
98
+ the vectors which much pass for the match to resolve.
99
+ This is equivalent to the previous example:
100
+
101
+ ~~~ruby
102
+ $tester.wait match: true, time_in_s: 2 do
103
+ pin(:done).assert!(1)
104
+ end
105
+ ~~~
106
+
107
+ This block form also allows much more complex match conditions to be described, here to wait
108
+ for either the fail pin to go high, OR the done pin to go high:
109
+
110
+ ~~~ruby
111
+ $tester.wait match: true, time_in_s: 2 do |conditions, fail|
112
+ conditions.add do
113
+ pin(:done).assert!(1)
114
+ end
115
+ conditions.add do
116
+ pin(:fail).assert!(1)
117
+ end
118
+ end
119
+ ~~~
120
+
121
+ To AND these conditions would simply be:
122
+
123
+ ~~~ruby
124
+ $tester.wait match: true, time_in_s: 2 do
125
+ pin(:done).assert(1)
126
+ pin(:fail).assert(1)
127
+ 1.cycle
128
+ end
129
+ ~~~
130
+
131
+ ##### ignore_fails(*pins)
132
+
133
+ Ignore fails on the given pins for the duration of the given block, this
134
+ has the effect of temporarily setting the states of the given pins to
135
+ don't care.
136
+
137
+ ~~~ruby
138
+ # Temporarily ignore mis-compares on the fail and data pins
139
+ $tester.ignore_fails(pin(:fail), pins(:data)) do
140
+ # Any vectors generated in here will force the state of the given pins to X
141
+ end
142
+ ~~~
143
+
144
+ #### Data Capture
145
+
146
+ ##### store(*pins)
147
+
148
+ Instruct the tester to capture the data on the given pins from the vector that was generated last,
149
+ note that it does not actually generate a new vector.
150
+
151
+ Sometimes when generating vectors within a loop you may want to retrospectively capture
152
+ a previous vector, passing in an offset option will allow you to do this.
153
+
154
+ Here are some examples:
155
+
156
+ ~~~ruby
157
+ $tester.cycle # This is the vector that we want to capture
158
+ $tester.store pin(:d0), pin(:d1) # Capture the data on the d0 and d1 pins
159
+
160
+ $tester.cycle # This one gets stored
161
+ $tester.cycle
162
+ $tester.cycle
163
+ $tester.store pin(:d0), pin(:d1), offset: -2 # Just realized I need to capture that earlier vector
164
+ ~~~
165
+
166
+ Note that this API is for engineers who are writing protocol drivers, most test IP would be
167
+ written at a higher level, e.g.
168
+
169
+ ~~~ruby
170
+ atd_result.data.store! # Capture the value of the ATD result bits to the tester
171
+ ~~~
172
+
173
+ ##### store_next_cycle(*pins)
174
+
175
+ Similar to the above, this API allows driver creators to indicate that the next vector,
176
+ wherever that may be generated, should be captured:
177
+
178
+ ~~~ruby
179
+ $tester.store_next_cycle pin(:d0), pin(:d1)
180
+
181
+ # This is the vector that will be captured, in real life this could be done after returning
182
+ # to a caller
183
+ $tester.cycle
184
+ ~~~
185
+
186
+ ##### capture_style
187
+
188
+ Testers support different ways of capturing vector data. For all tester types the default
189
+ capture style is hram (history ram). For UltraFlex digcap is additionally supported. Change
190
+ from the default like this:
191
+
192
+ ~~~ruby
193
+ # change capture style
194
+ # if the digcap isn't support for the current tester, default behavior (hram) is used
195
+ tester.capture_style = :digcap
196
+
197
+ # change back to hram capture style
198
+ tester.capture_style = :hram
199
+
200
+ # temporarily change the capture style for this cycle
201
+ tester.store_next_cycle pin(:d0), capture_style: :digcap
202
+ ~~~
203
+
204
+ ##### configure capture memory
205
+
206
+ Origen will create any instrument definitions required when capture memory is used. However,
207
+ it may be desirable to alter the configuration settings. Here is an example of how to do this:
208
+
209
+ ~~~ruby
210
+ # configure TDO as a 16-bit instrument (default size is the number of pins - 1 in this case)
211
+ tester.capture_memory :digcap do |mem|
212
+ mem.pin :tdo, size: 16
213
+ end
214
+ ~~~
215
+
216
+ #### Data Source
217
+
218
+ ##### overlay
219
+ Testers support different ways of modifying vector data during run time. This practice is referred to
220
+ here as "overlay". Overlay is requested through an optional argument to cycle:
221
+
222
+ ~~~ruby
223
+ # setup overlay parameters
224
+ overlay_options = {}
225
+ # Required - what pin(s) are being overlayed?
226
+ overlay_options[:pins] = dut.pin(:tdi)
227
+ # Required - what is the overlay string? This will become a label or subroutine name
228
+ overlay_options[:overlay_str] = ovl_reg[i].overlay_str
229
+
230
+ tester.cycle overlay: overlay_options
231
+
232
+ # Generate another overlay cycle, holding the same data as the previous cycle
233
+ overlay_options[:change_data] = false
234
+ tester.cycle overlay: overlay_options
235
+
236
+ # Now a new piece of data needs to be sent
237
+ overlay_options[:change_data] = true
238
+ tester.cycle overlay: overlay_options
239
+ ~~~
240
+
241
+ ##### overlay_style
242
+
243
+ The default overlay style is subroutine (vectors that will be modified are replaced
244
+ by a call to a subroutine). Change from the default like this:
245
+
246
+ ~~~ruby
247
+ # if requested sytle is not available for the current tester it will default to :subroutine
248
+ tester.overlay_style = :digsrc
249
+ tester.overlay_style = :subroutine
250
+ tester.overlay_style = :label
251
+ tester.overlay_style = :handshake
252
+
253
+ # change the overlay style for this cycle only by adding :overlay_style to the overlay_options
254
+ overlay_options[:overlay_style] = :label
255
+ tester.cycle overlay: overlay_options
256
+ ~~~
257
+
258
+ Not all overlay styles are supported on all testers and if the requested style is not supported a warning
259
+ will be logged and it will fall back to the default style (:subroutine).
260
+
261
+ Here is a brief summary of what each type does:
262
+
263
+ digsrc
264
+ : The vectors to be modified are updated with the data value held in a tester memory.
265
+
266
+ subroutine
267
+ : The vectors to be modified are removed from the pattern and replaced by a call to a another (subroutine) pattern.
268
+
269
+ label
270
+ : A label is inserted into the pattern immediately before the vectors to be modified.
271
+
272
+ handshake
273
+ : The vectors to be modified are removed from the pattern and replaced by a handshake with the tester.
274
+
275
+
276
+ ##### configure source memory
277
+
278
+ Origen will create any necessary instruments statements. Add configuration information to source memory
279
+ like this:
280
+
281
+ ~~~ruby
282
+ tester.source_memory do |mem|
283
+ mem.pin :tdi, size: 32, format: :binary, data_type: :long
284
+ end
285
+ ~~~
286
+
287
+ #### Subroutines
288
+
289
+ ##### start_subroutine(name), end_subroutine
290
+
291
+ Use these methods to write a pattern subroutine:
292
+
293
+ ~~~ruby
294
+ $tester.start_subroutine "wait_for_done"
295
+ $tester.wait match: true, time_in_s: 2 do
296
+ pin(:done).assert!(1)
297
+ end
298
+ $tester.end_subroutine
299
+ ~~~
300
+
301
+ ##### call_subroutine(name, options = {})
302
+
303
+ Call a pattern subroutine, an offset can be given to retrospectively jump to a subroutine
304
+ from a previous vector:
305
+
306
+ ~~~ruby
307
+ $tester.call_subroutine "wait_for_done"
308
+ 1.cycle
309
+ 1.cycle # A branch will also be made after completing this vector
310
+ 1.cycle
311
+ 1.cycle
312
+ $tester.call_subroutine "wait_for_done", offset: -2
313
+ ~~~
314
+
315
+ #### Loops and Branching
316
+
317
+ ##### label(name)
318
+
319
+ Inject an arbitrary label into the pattern:
320
+
321
+ ~~~ruby
322
+ $tester.label "on_failed"
323
+ ~~~
324
+
325
+ ##### branch_to(label)
326
+
327
+ Branch to a label:
328
+
329
+ ~~~ruby
330
+ $tester.branch_to "on_failed"
331
+ ~~~
332
+
333
+ ##### loop_vectors(name, number_of_loops)
334
+
335
+ Execute the vectors generated within the given block *n* times:
336
+
337
+ ~~~ruby
338
+ $tester.loop_vectors("my_loop", 3) do # Do this 3 times...
339
+ $tester.cycle
340
+ end
341
+ ~~~
342
+
343
+ #### Miscellaneous
344
+
345
+ ##### freq_count(pin)
346
+
347
+ Setup to measure the frequency on the given pin:
348
+
349
+ ~~~ruby
350
+ $tester.freq_count pin(:clk_out)
351
+ ~~~
352
+
353
+ ##### microcode(code, options = {})
354
+
355
+ This can be used to inject arbitrary microcode into the pattern, which of course is
356
+ inherently coupling your logic to a specific test platform - so use sparingly!
357
+
358
+ An offset can be given to apply the microcode to previously generated vectors.
359
+
360
+ ~~~ruby
361
+ $tester.microcode 'set_cpu (cpuC)'
362
+ 1.cycle
363
+ 1.cycle # cpuB will be set here
364
+ 1.cycle
365
+ 1.cycle
366
+ $tester.microcode 'set_cpu (cpuB)', offset: -2
367
+ ~~~
368
+
369
+ ##### Free-Running Clock on Existing Pin
370
+
371
+ Set up a pin to be a free-running clock with the vector generation (with respect to toggling
372
+ the pin at the appropriate intervals) automatically taken care of.
373
+
374
+ See [Pin Clock Functionality](<%= path 'guides/models/pins/#Pin_Clock_Functionality' %>) for details on the API.
375
+
376
+ % end