origen_testers 0.5.0 → 0.5.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
  SHA1:
3
- metadata.gz: 6023b80a1b6acff09fb009dfe06653086cde1101
4
- data.tar.gz: 7983d124ed3453e03611bbe18c311e1478d4d837
3
+ metadata.gz: 2ede4a79072352c2cd7d6acaa9fb865179f17316
4
+ data.tar.gz: 7af62afb233b4363fac108e8ddcbf64f862e33a4
5
5
  SHA512:
6
- metadata.gz: 7048fcf4fa639db5f22bfc616e4bab64168dbd551ea44f079b624245c9d1b23929d53548eebea074b9a6eece440753584b312a7be776ce34087cfe55742219bd
7
- data.tar.gz: 60e493228741d4c898014d1c85a91957f2a2c32fe42319a87665283d84d912c419aba44ef226f03e837b3977d3b7aa23126b96428541a2bedd64c870453b90cc
6
+ metadata.gz: 65ef5f42b2f18f4d7b6f5218af23f762eb3d3b1687b635e4e39866e2da8e0d03ac99c5e104c71f9a885e92732fa9cf589462eba8fb00eff6d6c1c2d8643d3e98
7
+ data.tar.gz: a2086e85641e434028486e4313b01ad4efa37959a36cbda1ff4b00c5aea2017e3ef931e4cde098506994471082bb73dd9a875d84f3fa7b37009cff107d9592ab
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenTesters
2
2
  MAJOR = 0
3
3
  MINOR = 5
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -43,13 +43,41 @@ module OrigenTesters
43
43
  end
44
44
 
45
45
  def assign_dc_instr_pins(dc_pins)
46
- @dc_pins = dc_pins
46
+ if !dc_pins.is_a?(Array)
47
+ @dc_pins = [] << dc_pins
48
+ else
49
+ @dc_pins = dc_pins
50
+ end
51
+ end
52
+
53
+ def assign_digsrc_pins(digsrc_pins)
54
+ if !digsrc_pins.is_a?(Array)
55
+ @digsrc_pins = [] << digsrc_pins
56
+ else
57
+ @digsrc_pins = digsrc_pins
58
+ end
59
+ end
60
+
61
+ def assign_digcap_pins(digcap_pins)
62
+ if !digcap_pins.is_a?(Array)
63
+ @digcap_pins = [] << digcap_pins
64
+ else
65
+ @digcap_pins = digcap_pins
66
+ end
47
67
  end
48
68
 
49
69
  def get_dc_instr_pins
50
70
  @dc_pins
51
71
  end
52
72
 
73
+ def get_digsrc_pins
74
+ @digsrc_pins
75
+ end
76
+
77
+ def get_digcap_pins
78
+ @digcap_pins
79
+ end
80
+
53
81
  def flows
54
82
  parser.flows
55
83
  end
@@ -489,11 +517,15 @@ module OrigenTesters
489
517
  # Take care of any instruments
490
518
  if options[:instruments].length > 0
491
519
  microcode 'instruments = {'
492
- options[:instruments].each do |instrument, setting|
493
- if "#{setting}" == 'nil'
520
+ options[:instruments].each do |pins, instrument|
521
+ if "#{pins}" == 'nil'
494
522
  microcode " #{instrument};"
523
+ elsif instrument == 'digsrc'
524
+ microcode " #{pins}:#{instrument} #{options[:digsrc_width]}:#{options[:digsrc_bit_order]}:#{options[:digsrc_mode]}:format=#{options[:digsrc_format]}:#{options[:digsrc_site_uniqueness]}:#{options[:digsrc_auto_cond]};"
525
+ elsif instrument == 'digcap'
526
+ microcode " #{pins}:#{instrument} #{options[:digcap_width]}:#{options[:digcap_bit_order]}:#{options[:digcap_mode]}:format=#{options[:digcap_format]}:data_type=#{options[:digcap_data_type]}:#{options[:digcap_auto_cond]}:#{options[:digcap_auto_trig_enable]}:#{options[:digcap_store_stv]}:#{options[:digcap_receive_data]};"
495
527
  else
496
- microcode " #{instrument}:#{setting};"
528
+ microcode " #{pins}:#{instrument};"
497
529
  end
498
530
  end
499
531
  microcode '}'
@@ -635,6 +667,90 @@ module OrigenTesters
635
667
  end
636
668
  end
637
669
 
670
+ # Call this method at the start of any digsrc overlay operations, this method
671
+ # takes care of all the microcodes and delays that's needed for digsrc overlay
672
+ # Required arguments:
673
+ # pins
674
+ # Optionsal arguments:
675
+ # options[:dssc_mode] = :single or :dual, anything else wil be
676
+ # treated as if it's operating in :quad mode
677
+ def digsrc_start(pins, options = {})
678
+ options = {
679
+ dssc_mode: :single # defaults dssc_mode to single mode
680
+ }.merge(options)
681
+ if pins.size > 1
682
+ microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = Start)"
683
+ else
684
+ microcode "((#{pin}):DigSrc = Start)"
685
+ end
686
+ if options[:dssc_mode] == :single
687
+ $tester.cycle(repeat: 145) # minimum of 144 cycles, adding 1 for safey measures
688
+ elsif options[:dssc_mode] == :dual
689
+ $tester.cycle(repeat: 289) # minimum of 288 cycles, adding 1 for safety measures
690
+ else
691
+ $tester.cycle(repeat: 577) # minimum of 577 cycles, adding 1 for safety measures
692
+ end
693
+ end
694
+
695
+ # Call this method at the end of each digscr overlay operation to clear the pattern
696
+ # memory pipeline, so that the pattern is ready to do the next digsrc overlay operation.
697
+ # Required arguments:
698
+ # pins
699
+ def digsrc_stop(pins, options = {})
700
+ if pins.size > 1
701
+ microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = Stop)"
702
+ else
703
+ microcode "((#{pins}):DigSrc = Stop)"
704
+ end
705
+ end
706
+
707
+ # Call this method before each tester cycle to insert the digsrc overlay microcode
708
+ def digsrc_send(pins)
709
+ microcode "((#{format_multiple_instrument_pins(pins)}):DigSrc = SEND)"
710
+ end
711
+
712
+ # Call this method before each tester cycle to inser the digcap overlay microcode
713
+ def digcap_store(pins)
714
+ microcode "((#{format_multiple_instrument_pins(pins)}):DigCap = STORE)"
715
+ end
716
+
717
+ def apply_digsrc_settings(options = {})
718
+ options.merge!(digsrc_width: 1) if options[:digsrc_width].nil? # default to digsrc 1
719
+ options.merge!(digsrc_bit_order: :lsb) if options[:digsrc_bit_order].nil? # default to lsb
720
+ options.merge!(digsrc_mode: :serial) if options[:digsrc_mode].nil? # default to serial mode
721
+ options.merge!(digsrc_format: :binary) if options[:digsrc_format].nil? # default to binary
722
+ options.merge!(digsrc_site_uniqueness: :unique_sites) if options[:digsrc_site_uniqueness].nil? # default to unique sites
723
+ options.merge!(digsrc_data_type: :default) if options[:digsrc_data_type].nil? # default to default
724
+ options.merge!(digsrc_auto_cond: :auto_cond_disable) if options[:digsrc_auto_cond].nil? # default to disable
725
+ @digsrc_settings = options
726
+ end
727
+
728
+ def apply_digcap_settings(options = {})
729
+ options.merge!(digcap_width: 8) if options[:digcap_width].nil? # default to digcap 8
730
+ options.merge!(digcap_bit_order: :lsb) if options[:digcap_bit_order].nil? # default to lsb
731
+ options.merge!(digcap_mode: :serial) if options[:digcap_mode].nil? # default to serial mode
732
+ options.merge!(digcap_site_uniqueness: :unique_sites) if options[:digcap_site_uniqueness].nil? # default to unique sites
733
+ options.merge!(digcap_format: :binary) if options[:digcap_format].nil? # default to binary
734
+ options.merge!(digcap_data_type: :default) if options[:digcap_data_type].nil? # default to default
735
+ options.merge!(digcap_auto_cond: :auto_cond_disable) if options[:digcap_auto_cond].nil? # default to disable
736
+ options.merge!(digcap_auto_trig_enable: :auto_trig_disable) if options[:digcap_auto_trig_enable].nil? # default to disable
737
+ options.merge!(digcap_store_stv: :store_stv_disable) if options[:digcap_store_stv].nil? # default to disable
738
+ options.merge!(digcap_receive_data: :store_stv_disable) if options[:digcap_receive_data].nil? # default to logic
739
+ @digcap_settings = options
740
+ end
741
+
742
+ # Call this method if there are more than one pin/pin groups used with an instrument,
743
+ # this method will format an array of pins into the correct format required by igxl
744
+ # pattern microcodes.
745
+ def format_multiple_instrument_pins(pins, options = {})
746
+ return_value = ''
747
+ pins.each do |pin|
748
+ return_value += "#{pin}"
749
+ return_value += ',' unless pins.last == pin
750
+ end
751
+ return_value
752
+ end
753
+
638
754
  def mask_fails(setclr)
639
755
  @mask_vector = setclr
640
756
  end
@@ -187,6 +187,8 @@ module OrigenTesters
187
187
 
188
188
  options[:memory_test] = memory_test_en
189
189
  options[:dc_pins] = get_dc_instr_pins
190
+ options[:digsrc_pins] = get_digsrc_pins
191
+ options[:digcap_pins] = get_digcap_pins
190
192
 
191
193
  if options[:dc_pins]
192
194
  options[:dc_pins].each do |pin|
@@ -194,9 +196,39 @@ module OrigenTesters
194
196
  end
195
197
  end
196
198
 
199
+ # Syntax for Digital Source
200
+ # instruments = {
201
+ # pin-item:digsrc instrument-width: bit-order: instrument-mode:
202
+ # site-uniqueness: format: auto_cond;
203
+ # }
204
+
205
+ if options[:digsrc_pins]
206
+ @digsrc_settings.each do |setting_name, setting|
207
+ options.merge!(setting_name => setting) if options[setting_name].nil?
208
+ end
209
+ options[:digsrc_pins].each do |pin|
210
+ options[:instruments].merge!(pin => 'digsrc')
211
+ end
212
+ end
213
+
214
+ # Syntax for Digital Capture
215
+ # instruments = {
216
+ # pin-item:digcap instrument-width: bit-order: instrument-mode:
217
+ # format: data-type: auto_cond: auto_trig_enable: store_stv: receive_data;
218
+ # }
219
+
220
+ if options[:digcap_pins]
221
+ @digcap_settings.each do |setting_name, setting|
222
+ options.merge!(setting_name => setting) if options[setting_name].nil?
223
+ end
224
+ options[:digcap_pins].each do |pin|
225
+ options[:instruments].merge!(pin => 'digcap')
226
+ end
227
+ end
228
+
197
229
  # If memory test, then add to instruments hash
198
230
  if options[:memory_test]
199
- options[:instruments].merge!('mto' => 'nil')
231
+ options[:instruments].merge!('nil' => 'mto')
200
232
  end
201
233
 
202
234
  super(options.merge(digital_inst: @digital_instrument,
@@ -28,13 +28,16 @@ module OrigenTesters
28
28
 
29
29
  # Compile a template file
30
30
  def compile(file, options = {})
31
+ # Any options passed in from an interface will be passed to the compiler and to
32
+ # the templates being compiled
33
+ options[:initial_options] = options
31
34
  Origen.file_handler.preserve_state do
32
35
  begin
33
36
  file = Origen.file_handler.clean_path_to_template(file)
34
- Origen.generator.compile_file_or_directory(file, initial_options: options)
37
+ Origen.generator.compile_file_or_directory(file, options)
35
38
  rescue
36
39
  file = Origen.file_handler.clean_path_to(file)
37
- Origen.generator.compile_file_or_directory(file, initial_options: options)
40
+ Origen.generator.compile_file_or_directory(file, options)
38
41
  end
39
42
  end
40
43
  end
@@ -28,7 +28,7 @@ module OrigenTesters
28
28
  # run entry in the flow.
29
29
  def test(test_suite, options = {})
30
30
  sbin = options[:sbin] || options[:softbin] || options[:soft_bin]
31
- if options[:bin] || sbin
31
+ if (options[:bin] || sbin) && !options[:continue]
32
32
  node = run_and_branch(test_suite, options)
33
33
  options.delete(:id)
34
34
  # Only pass options to configure the bin, don't pass flow control options, those apply to the main
@@ -2,7 +2,7 @@ module OrigenTesters
2
2
  module SmartestBasedTester
3
3
  class Base
4
4
  class TestMethod
5
- FORMAT_TYPES = [:current, :voltage, :time, :string, :integer]
5
+ FORMAT_TYPES = [:current, :voltage, :time, :string, :integer, :double]
6
6
 
7
7
  # Returns the object representing the test method library that the
8
8
  # given test method is defined in
@@ -100,7 +100,7 @@ module OrigenTesters
100
100
  "#{val}[s]"
101
101
  when :frequency
102
102
  "#{val}[Hz]"
103
- when :string, :integer
103
+ when :string, :integer, :double
104
104
  val.to_s
105
105
  else
106
106
  fail "Unknown type for attribute #{attr}: #{type}"
@@ -5,20 +5,32 @@ module OrigenTesters
5
5
  class Limits
6
6
  attr_reader :test_method
7
7
  attr_accessor :lo_limit, :hi_limit
8
+ attr_accessor :unit
8
9
 
9
10
  def initialize(test_method)
10
11
  @test_method = test_method
11
12
  end
12
13
 
14
+ def unit=(val)
15
+ case val.to_s.downcase
16
+ when 'v', 'volts'
17
+ @unit = 'V'
18
+ when 'a', 'amps'
19
+ @unit = 'A'
20
+ else
21
+ fail "Limit unit of #{val} not implemented yet!"
22
+ end
23
+ end
24
+
13
25
  def to_s
14
26
  if !lo_limit && !hi_limit
15
27
  "\"#{test_name}\"" + ' = "":"NA":"":"NA":"":"":""'
16
28
  elsif !lo_limit
17
- "\"#{test_name}\"" + " = \"\":\"NA\":\"#{hi_limit}\":\"LE\":\"\":\"\":\"0\""
29
+ "\"#{test_name}\"" + " = \"\":\"NA\":\"#{hi_limit}\":\"LE\":\"#{unit}\":\"\":\"0\""
18
30
  elsif !hi_limit
19
- "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"\":\"NA\":\"\":\"\":\"0\""
31
+ "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"\":\"NA\":\"#{unit}\":\"\":\"0\""
20
32
  else
21
- "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"#{hi_limit}\":\"LE\":\"\":\"\":\"0\""
33
+ "\"#{test_name}\"" + " = \"#{lo_limit}\":\"GE\":\"#{hi_limit}\":\"LE\":\"#{unit}\":\"\":\"0\""
22
34
  end
23
35
  end
24
36
 
@@ -84,17 +84,22 @@ module OrigenTesters
84
84
  end
85
85
 
86
86
  def initialize(name, attrs = {})
87
- self.name = name
87
+ @name = name
88
88
  # Set the defaults
89
89
  DEFAULTS.each do |k, v|
90
90
  send("#{k}=", v)
91
91
  end
92
92
  # Then the values that have been supplied
93
93
  attrs.each do |k, v|
94
- send("#{k}=", v) if respond_to?("#{k}=")
94
+ send("#{k}=", v) if respond_to?("#{k}=") && k.to_sym != :name
95
95
  end
96
96
  end
97
97
 
98
+ # The name is immutable once the test_suite is created, this will raise an error when called
99
+ def name=(val, options = {})
100
+ fail 'Once assigned the name of a test suite cannot be changed!'
101
+ end
102
+
98
103
  def lines
99
104
  l = []
100
105
  l << ' override = 1;'
@@ -116,16 +116,19 @@ module OrigenTesters
116
116
  end
117
117
  end
118
118
 
119
+ # Add the test methods from the given flow to this flow
119
120
  def add_test_methods(flow)
120
121
  flow.testmethods.each do |id, tm|
122
+ # If this flow already contains a test method with the current ID
121
123
  if testmethods[id]
122
124
  nid = "tm_#{tm_ix}"
123
125
  testmethods[nid] = tm
124
126
  testmethodparameters[nid] = flow.testmethodparameters[id]
125
127
  testmethodlimits[nid] = flow.testmethodlimits[id]
126
128
  flow.test_suites.each do |tsid, ts|
127
- if ts['override_testf'] == "#{id};"
129
+ if ts['override_testf'] == "#{id};" && !ts[:new_id]
128
130
  ts['override_testf'] = "#{nid};"
131
+ ts[:new_id] = true
129
132
  end
130
133
  end
131
134
  else
@@ -134,10 +137,15 @@ module OrigenTesters
134
137
  testmethodlimits[id] = flow.testmethodlimits[id]
135
138
  end
136
139
  end
140
+ # Remove this temporary flag to prevent it rendering to the output file
141
+ flow.test_suites.each do |tsid, ts|
142
+ ts.delete(:new_id)
143
+ end
137
144
  end
138
145
 
139
146
  def add_test_suites(flow)
140
147
  flow.test_suites.each do |id, ts|
148
+ # If this flow already contains a test suite with the current ID
141
149
  if test_suites[id]
142
150
  i = 1
143
151
  nid = id
@@ -147,8 +155,9 @@ module OrigenTesters
147
155
  end
148
156
  test_suites[nid] = ts
149
157
  flow.test_flow.map! do |line|
150
- if line =~ /(run|run_and_branch)\(#{id}\)/
151
- line.sub(id, nid)
158
+ if line =~ /(run|run_and_branch)\(#{id}\)/ && line !~ /--NEW_ID--/
159
+ line = line.sub(id, nid)
160
+ line += '--NEW_ID--'
152
161
  else
153
162
  line
154
163
  end
@@ -157,6 +166,9 @@ module OrigenTesters
157
166
  test_suites[id] = ts
158
167
  end
159
168
  end
169
+ flow.test_flow.map! do |line|
170
+ line.sub('--NEW_ID--', '')
171
+ end
160
172
  end
161
173
 
162
174
  def tm_ix
@@ -6,6 +6,10 @@ module OrigenTesters
6
6
  attr_accessor :blocks
7
7
  attr_accessor :hv_supply_pin
8
8
  attr_accessor :lv_supply_pin
9
+ attr_accessor :digsrc_pins
10
+ attr_accessor :digcap_pins
11
+ attr_accessor :digsrc_settings
12
+ attr_accessor :digcap_settings
9
13
 
10
14
  include OrigenARMDebug
11
15
  include Origen::TopLevel
@@ -25,6 +29,10 @@ module OrigenTesters
25
29
  end
26
30
  @hv_supply_pin = 'VDDHV'
27
31
  @lv_supply_pin = 'VDDLV'
32
+ @digsrc_pins = [:tdi, :tms]
33
+ @digsrc_settings = { digsrc_mode: :parallel, digsrc_bit_order: :msb }
34
+ @digcap_pins = :tdo
35
+ @digcap_settings = { digcap_format: :twos_complement }
28
36
  @blocks = [Block.new(0, self), Block.new(1, self), Block.new(2, self)]
29
37
  end
30
38
 
@@ -154,6 +162,46 @@ module OrigenTesters
154
162
  end
155
163
  end
156
164
 
165
+ def digsrc_overlay(options = {})
166
+ options = { define: false, # whether to define subr or call it
167
+ subr_name: false, # default use match type as subr name
168
+ digsrc_pins: @digsrc_pins, # defaults to what's defined in $dut
169
+ overlay_reg: nil, # defaults to testme32 register
170
+ overlay_cycle_num: 32, # Only needed if overlay_reg is NOT nil, this specificies how many clk cycles to overlay.
171
+ }.merge(options)
172
+ if options[:define]
173
+ $tester.start_subroutine(options[:subr_name]) # Start subroutine
174
+ digsrc_pins = $tester.assign_digsrc_pins(options[:digsrc_pins])
175
+ $tester.digsrc_start(digsrc_pins, dssc_mode: :single)
176
+ original_pin_states = {}
177
+ digsrc_pins.each do |pin|
178
+ original_pin_states.merge!(pin => pin(pin).data)
179
+ pin(pin).drive_mem
180
+ end
181
+ if options[:overlay_reg].nil?
182
+ options[:overlay_cycle_num].times do
183
+ $tester.digsrc_send(digsrc_pins)
184
+ $tester.cycle
185
+ end
186
+ else
187
+ $tester.dont_compress = true
188
+ options[:overlay_reg].size.times do
189
+ $tester.digsrc_send(digsrc_pins)
190
+ $tester.cycle
191
+ end
192
+ end
193
+ original_pin_states.each do |pin, state|
194
+ pin(pin).drive(state)
195
+ end
196
+ $tester.digsrc_stop(digsrc_pins)
197
+ $tester.cycle
198
+ $tester.end_subroutine # end subroutine
199
+ else
200
+ $tester.cycle
201
+ $tester.call_subroutine(options[:subr_name])
202
+ end
203
+ end
204
+
157
205
  def memory_test(options = {})
158
206
  options = {
159
207
  }.merge(options)
@@ -33,6 +33,13 @@ unless $tester.v93k?
33
33
  # Define handshake subr
34
34
  $dut.handshake(:define => true)
35
35
 
36
+ if $tester.ultraflex?
37
+ # Define digsrc_overlay_testme32 subr
38
+ $dut.digsrc_overlay(:subr_name => 'digsrc_overlay_testme32', :define => true, overlay_reg: :testme32)
39
+
40
+ # Define digsrc_overlay subr
41
+ $dut.digsrc_overlay(:subr_name => 'digsrc_overlay', :define => true, overlay_cycle_num: 64)
42
+ end
36
43
  end
37
44
  end
38
45
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_testers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.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: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.2'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 0.2.6
19
+ version: 0.4.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '0.2'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
- version: 0.2.6
26
+ version: 0.4.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: require_all
35
29
  requirement: !ruby/object:Gem::Requirement