origen_arm_debug 0.4.3 → 0.6.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2c3661ce85842f7bf1355a7ca46cb69bd072f39
4
- data.tar.gz: 2e027c17b080ecd5b2b00ec12136a4c9cbb2add4
3
+ metadata.gz: 2e004df0c8d145be274dae133a25750de5d4775d
4
+ data.tar.gz: 661b0086a39ef3e4287cd97e7c551ee35f81fc01
5
5
  SHA512:
6
- metadata.gz: 0110a23e5982c9a383899dc3f8c71ccffb877cf96e6c5ef630d4dccb32eb332965268b340b54e50823decaf79bbeb67c264842adde2dba17c59250058db4facc
7
- data.tar.gz: b0cf696efdff3da903cbfec1e969ab62bd414e89a6202481a50b48868cc20855f05212a0014ee7c8cf0550d6dc5dc92f733c2be964487c8b89fb70429af2fe7a
6
+ metadata.gz: f3b76b470b1247868e15f9fafd851401fa747b504df323ffb3d9c593c18401ce8ad69da7b4b92c4f38a994b7483d78c22a1c37b6d2a81f0368ce4e327244d043
7
+ data.tar.gz: b09cb03684e736f2f7f9adc80ae8dc05f35ae03771b4bbcabca4aebfc04442daf8532a9eb4e97cb1dfca95c69466c0034317f579188cbb9690b16e652dbc8127
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenARMDebug
2
2
  MAJOR = 0
3
- MINOR = 4
4
- BUGFIX = 3
3
+ MINOR = 6
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -1,4 +1,3 @@
1
- 'include rgen'
2
1
  module OrigenARMDebug
3
2
  # Object that defines the API necessary to perform MEM-AP transactions. Requires
4
3
  # a top-level protocol be defined as well as a top-level instantiation of an
@@ -175,7 +174,7 @@ module OrigenARMDebug
175
174
  # of options[:edata]
176
175
  # @param [Hash] options Options to customize the operation
177
176
  # Returns nothing.
178
- def R(addr, rdata, options = {})
177
+ def r(addr, rdata, options = {})
179
178
  # Warn caller that this method is being deprecated
180
179
  msg = 'Use mem_ap.read(addr, options) instead of R(addr, rdata, options)'
181
180
  Origen.deprecate msg
@@ -184,6 +183,7 @@ module OrigenARMDebug
184
183
  options = { rdata: rdata }.merge(options)
185
184
  read(addr, options)
186
185
  end
186
+ alias_method :R, :r
187
187
 
188
188
  # Method to write to a mem_ap register (legacy)
189
189
  #
@@ -191,7 +191,7 @@ module OrigenARMDebug
191
191
  # @param [Integer] wdata Data to be written
192
192
  # @param [Hash] options Options to customize the operation
193
193
  # Returns nothing.
194
- def W(addr, wdata, options = {})
194
+ def w(addr, wdata, options = {})
195
195
  # Warn caller that this method is being deprecated
196
196
  msg = 'Use mem_ap.write(addr, wdata, options) instead of W(addr, wdata, options)'
197
197
  Origen.deprecate msg
@@ -199,6 +199,7 @@ module OrigenARMDebug
199
199
  # Patch arguments and send to new method
200
200
  write(addr, wdata, options)
201
201
  end
202
+ alias_method :W, :w
202
203
 
203
204
  # Method to write and then read from a mem_ap register (legacy)
204
205
  #
@@ -206,7 +207,7 @@ module OrigenARMDebug
206
207
  # @param [Integer] wdata Data to be written
207
208
  # @param [Hash] options Options to customize the operation
208
209
  # Returns nothing.
209
- def WR(addr, wdata, options = {})
210
+ def wr(addr, wdata, options = {})
210
211
  # Warn caller that this method is being deprecated
211
212
  msg = 'Use mem_ap.write_read(addr, wdata, options) instead of WR(addr, wdata, options)'
212
213
  Origen.deprecate msg
@@ -214,6 +215,7 @@ module OrigenARMDebug
214
215
  # Patch arguments and send to new method
215
216
  write_read(addr, wdata, options)
216
217
  end
218
+ alias_method :WR, :wr
217
219
 
218
220
  # -----------------------------------------------------------------------------
219
221
  # Support Code
@@ -297,6 +297,12 @@ module OrigenARMDebug
297
297
  "data=0x#{wdata.to_s(16).rjust(8, '0')}"
298
298
  end
299
299
 
300
+ # Method
301
+ #
302
+ # @param [Integer] name Name of register to be transacted
303
+ # @param [Integer] rwb Indicates read or write
304
+ # @param [Integer] wdata Value of data to be written
305
+ # @param [Hash] options Options to customize the operation
300
306
  def dpacc_access(name, rwb, wdata, options = {})
301
307
  addr = get_dp_addr(name)
302
308
 
@@ -307,6 +313,13 @@ module OrigenARMDebug
307
313
  acc_access(addr, rwb, 0, wdata, options)
308
314
  end
309
315
 
316
+ # Method
317
+ #
318
+ # @param [Integer] addr Address of register to be transacted
319
+ # @param [Integer] rwb Indicates read or write
320
+ # @param [Integer] wdata Value of data to be written
321
+ # @param [Integer] rdata Value of data to be read back
322
+ # @param [Hash] options Options to customize the operation
310
323
  def apacc_access(addr, rwb, wdata, rdata, options = {})
311
324
  set_apselect((addr & 0xFFFFFFFE) | (@current_apaddr & 1), options)
312
325
  if @imp == :swd
@@ -317,6 +330,13 @@ module OrigenARMDebug
317
330
  acc_access((addr & 0xC), rwb, 1, wdata, options)
318
331
  end
319
332
 
333
+ # Method
334
+ #
335
+ # @param [Integer] addr Address of register to be transacted
336
+ # @param [Integer] rwb Indicates read or write
337
+ # @param [Integer] ap_dp Indicates Access Port or Debug Port
338
+ # @param [Integer] wdata Value of data to be written
339
+ # @param [Hash] options Options to customize the operation
320
340
  def acc_access(addr, rwb, ap_dp, wdata, options = {})
321
341
  if @imp == :swd
322
342
  acc_access_swd(addr, rwb, ap_dp, wdata, options = {})
@@ -325,6 +345,13 @@ module OrigenARMDebug
325
345
  end
326
346
  end
327
347
 
348
+ # Method SWD-specific
349
+ #
350
+ # @param [Integer] addr Address of register to be transacted
351
+ # @param [Integer] rwb Indicates read or write
352
+ # @param [Integer] ap_dp Indicates Access Port or Debug Port
353
+ # @param [Integer] wdata Value of data to be written
354
+ # @param [Hash] options Options to customize the operation
328
355
  def acc_access_swd(addr, rwb, ap_dp, wdata, options = {})
329
356
  if (rwb == 1)
330
357
  swd.read(ap_dp, addr, options)
@@ -335,6 +362,13 @@ module OrigenARMDebug
335
362
  swd.swd_dio_to_0(options[:w_delay])
336
363
  end
337
364
 
365
+ # Method JTAG-specific
366
+ #
367
+ # @param [Integer] addr Address of register to be transacted
368
+ # @param [Integer] rwb Indicates read or write
369
+ # @param [Integer] ap_dp Indicates Access Port or Debug Port
370
+ # @param [Integer] wdata Value of data to be written
371
+ # @param [Hash] options Options to customize the operation
338
372
  def acc_access_jtag(addr, rwb, ap_dp, wdata, options = {})
339
373
  if !options[:r_attempts].nil?
340
374
  attempts = options[:r_attempts]
@@ -22,21 +22,23 @@ or if your application is a plugin add this to your <code>.gemspec</code>
22
22
  spec.add_development_dependency "origen_arm_debug", ">= <%= Origen.app.version %>"
23
23
  ~~~
24
24
 
25
- __NOTE:__ You will also need to include <code>require 'origen_arm_debug'</code> somewhere in your environment. This can be done in <code>config/environment.rb</code> for example.
25
+ __NOTE:__ You will also need to include <code>require 'origen_arm_debug'</code> somewhere in your environment
26
+ if your app is a plugin.
26
27
 
27
28
 
28
29
  ### How To Use
29
30
 
30
- Include the <code>OrigenARMDebug</code> module in your DUT class, this provides
31
- <code>read_register</code> and <code>write_register</code> methods that will
32
- be used automatically by any register read/write operations.
33
- It also provides meathods using the ARM Debug protocol including:
34
- accessing device memory, accessing core and floating point regesters (coretx M cores only),
35
- entering/exiting debug mode (coretx M cores only), setting the PC (coretx M cores only)
36
- and stepping through code (coretx M cores only).
31
+ Include the <code>OrigenARMDebug</code> module in your DUT class, then hook it up
32
+ to the Origen register API via
33
+ <code>read_register</code> and <code>write_register</code> methods.
34
+
35
+ The <code>OrigenARMDebug</code> module also provides additional methods to use the ARM Debug protocol including:
36
+ accessing device memory, accessing core and floating point registers (cortex M cores only),
37
+ entering/exiting debug mode (cortex M cores only), setting the PC (cortex M cores only)
38
+ and stepping through code (cortex M cores only).
37
39
 
38
40
  You must also include a compatible physical driver depending on what debug
39
- interface your DUT has, one of the following can be used:
41
+ interface your device has, one of the following can be used:
40
42
 
41
43
  * [JTAG](http://origen-sdk.org/jtag)
42
44
  * [Single Wire Debug](http://origen-sdk.org/swd)
@@ -46,16 +48,29 @@ class DUT
46
48
 
47
49
  include OrigenARMDebug
48
50
  include Origen::Registers
49
- # Also include the required physical driver (not shown here)
51
+ # Also include the required physical driver, JTAG in this example
52
+ include OrigenJTAG
50
53
 
51
54
  def initialize
52
- add_reg :test, 0x0012, 16, :upper_byte => {pos: 8, bits: 8},
53
- :lower_byte => {pos: 0, bits: 8}
55
+ reg :myreg, 0x0012, size: 16 do |reg|
56
+ reg.bits 15..8, :upper_byte
57
+ reg.bits 7..0, :lower_byte
58
+ end
59
+ end
60
+
61
+ # Hook the ARMDebug module into the register API, any register read
62
+ # requests will use the ARM Debug protocol by default
63
+ def read_register(reg, options={})
64
+ arm_debug.read_register(reg, options)
54
65
  end
55
66
 
67
+ # As above for write requests
68
+ def write_register(reg, options={})
69
+ arm_debug.write_register(reg, options)
70
+ end
56
71
  end
57
72
 
58
- DUT.new.reg(:test).write!(0x55AA) # => Will generate the required vectors using the ARM debug protocol
73
+ DUT.new.myreg.write!(0x55AA) # => Will generate the required vectors using the ARM debug protocol
59
74
  ~~~
60
75
 
61
76
 
@@ -69,13 +84,13 @@ object for use in the console:
69
84
  ~~~
70
85
  origen i
71
86
 
72
- > $dut.arm_debug
87
+ > dut.arm_debug
73
88
  => #<OrigenARMDebug::Driver:0x0000001ee48e78>
74
89
  ~~~
75
90
 
76
91
  Follow the instructions here if you want to make a 3rd party app
77
92
  workspace use your development copy of the OrigenARMDebug plugin:
78
- [Setting up a Plugin Development Environment](http://origen-sdk.org/origen/latest/guides/plugins)
93
+ [Setting up a Plugin Development Environment](http://origen-sdk.org/origen/guides/plugins)
79
94
 
80
95
  This plugin also contains a test suite, makes sure this passes before committing
81
96
  any changes!
@@ -14,7 +14,7 @@
14
14
  <li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
15
15
  <li class="<%= options[:tab] == :coverage ? 'active' : '' %>"><a href="<%= path "/coverage" %>">Coverage</a></li>
16
16
  <li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
17
- <li><a href="https://github.com/Origen-SDK/origen_swd">Github</a></li>
17
+ <li><a href="https://github.com/Origen-SDK/origen_arm_debug">Github</a></li>
18
18
  </ul>
19
19
  <%= import "origen/web/logo.html" %>
20
20
  </div><!--/.nav-collapse -->
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_arm_debug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronnie Lajaunie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: origen_testers
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description:
70
84
  email:
71
85
  - Ronnie.Lajaunie@freescale.com