origen_arm_debug 0.8.3 → 0.8.4

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: 856e1631d06c817c9ca0053ccd7c21e3c8c01162
4
- data.tar.gz: 933943950a63f6373e326ab7b88240d6be6bd000
3
+ metadata.gz: a4ce85678b97c90ebf41f4dff8b8fad020fe9cfa
4
+ data.tar.gz: ca74317b6cd30d1145571c337b842351ad401ef8
5
5
  SHA512:
6
- metadata.gz: 6bcf6b796b955d29b8aaed2960265cf1a07993cef4ff747018735df53c10914bf291cd3c35203cab20db21bc8c2d9ba7e8b177e13a9f9adde55913a29039def9
7
- data.tar.gz: 7dd18c6981b08f34574a6f92cc8791e57d5d3be63abdb840e6b2c7d88189c8f87ea36fbad2d8effcd6b37f8e4ad0ad8bf4446c2464f8f3369c50b22109899c7d
6
+ metadata.gz: 2579e71201e40ffb48f66196c3eac4c7cb0f94828b0a158ffbb8f62f84fb800c3f70590e9f83f4f6e6b138cc849c96a1e0e003ae733d84087e320cde771a15b7
7
+ data.tar.gz: d93cc73c36b6761ec33fd8da7f79b5ac5964d11a0b3be4f5632520f36a69fbc5edc467a2cea9bf1b3ec06bc9dbd9f9a6b77eb30cce3292bccf71237a62591104
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenARMDebug
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- BUGFIX = 3
4
+ BUGFIX = 4
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -68,9 +68,11 @@ module OrigenARMDebug
68
68
  def read_register(reg_or_val, options = {})
69
69
  if reg_or_val.respond_to?(:data)
70
70
  addr = reg_or_val.addr
71
+ rdata = reg_or_val.data
71
72
  options = { reg: reg_or_val }.merge(options)
72
73
  else
73
74
  addr = reg_or_val # if not a register, use the 'val' as target addr
75
+ rdata = 0
74
76
  end
75
77
 
76
78
  options = { size: 32 }.merge(options)
@@ -141,7 +143,7 @@ module OrigenARMDebug
141
143
  set_size(size)
142
144
  set_addr(addr)
143
145
  debug_port.read_ap(drw_reg_addr, options)
144
- rdata = get_rdata(size, addr, rdata)
146
+ rdata = get_rdata(size, addr, 0)
145
147
  increment_addr
146
148
 
147
149
  cc "MEM-AP(#{@name}): R-#{size.to_s(10)}: "\
@@ -316,11 +318,11 @@ module OrigenARMDebug
316
318
  current_csw_2_0 = @current_csw & 0x00000007
317
319
  if (current_csw_5_4 == 0b01)
318
320
  case current_csw_2_0
319
- when 0b000 then @current_tar += 1 # Increment single
320
- when 0b001 then @current_tar += 2 # Increment single
321
- when 0b010 then @current_tar += 4 # Increment single
321
+ when 0 then @current_tar += 1 # Increment single
322
+ when 1 then @current_tar += 2 # Increment single
323
+ when 2 then @current_tar += 4 # Increment single
322
324
  end
323
- elsif (current_csw_5_4 == 0b10)
325
+ elsif (current_csw_5_4 == 2)
324
326
  @current_tar += 4 # Increment packed
325
327
  end
326
328
 
@@ -330,52 +332,26 @@ module OrigenARMDebug
330
332
  end
331
333
  end
332
334
 
333
- # Create a bit-wise mask based on size, address and mask parameters.
334
- #
335
- # @param [Integer] size Size of data, supports 8-bit, 16-bit, and 32-bit
336
- # @param [Integer] addr Address of data to be read from or written to
337
- # @param [Integer] mask Mask for full data, used to create nibble mask
338
- def get_mask(size, addr, mask)
339
- addr_1_0 &= 0x00000003
340
- case size
341
- when 8
342
- case addr_1_0
343
- when 0b00 then mask &= 0x000000ff
344
- when 0b01 then mask &= 0x0000ff00
345
- when 0b10 then mask &= 0x00ff0000
346
- when 0b11 then mask &= 0xff000000
347
- end
348
- when 16
349
- case addr_1_0
350
- when 0b00 then mask &= 0x0000ffff
351
- when 0b10 then mask &= 0xffff0000
352
- end
353
- when 32
354
- mask &= 0xffffffff
355
- end
356
- mask
357
- end
358
-
359
335
  # Create a bit-wise read-data based on size, address and rdata parameters.
360
336
  #
361
337
  # @param [Integer] size Size of data, supports 8-bit, 16-bit, and 32-bit
362
338
  # @param [Integer] addr Address of data to be read from or written to
363
339
  # @param [Integer] rdata Full data for read, used to create nibble read data
364
340
  def get_rdata(size, addr, rdata)
365
- addr_1_0 &= 0x00000003
341
+ addr_1_0 = addr & 0x00000003
366
342
  case size
367
343
  when 8
368
344
  case addr_1_0
369
- when 0b00 then rdata = 0x000000ff & rdata
370
- when 0b01 then rdata = 0x000000ff & (rdata >> 8)
371
- when 0b10 then rdata = 0x000000ff & (rdata >> 16)
372
- when 0b11 then rdata = 0x000000ff & (rdata >> 24)
345
+ when 0 then rdata = 0x000000ff & rdata
346
+ when 1 then rdata = 0x000000ff & (rdata >> 8)
347
+ when 2 then rdata = 0x000000ff & (rdata >> 16)
348
+ when 3 then rdata = 0x000000ff & (rdata >> 24)
373
349
  end
374
350
  when 16
375
351
  case addr_1_0
376
- when 0b00 then rdata = 0x0000ffff & rdata
377
- when 0b10 then rdata = 0x0000ffff & (rdata >> 16)
378
- end
352
+ when 0 then rdata = 0x0000ffff & rdata
353
+ when 2 then rdata = 0x0000ffff & (rdata >> 16)
354
+ end
379
355
  when 32
380
356
  rdata = rdata
381
357
  end
@@ -388,19 +364,19 @@ module OrigenARMDebug
388
364
  # @param [Integer] addr Address of data to be read from or written to
389
365
  # @param [Integer] wdata Full data for write, used to create nibble write data
390
366
  def get_wdata(size, addr, wdata);
391
- addr_1_0 &= 0x00000003
367
+ addr_1_0 = addr & 0x00000003
392
368
  case size
393
369
  when 8
394
370
  case addr_1_0
395
- when 0b00 then wdata = 0x000000ff & wdata
396
- when 0b01 then wdata = 0x0000ff00 & (wdata << 8)
397
- when 0b10 then wdata = 0x00ff0000 & (wdata << 16)
398
- when 0b11 then wdata = 0xff000000 & (wdata << 24)
399
- end
371
+ when 0 then wdata = 0x000000ff & wdata
372
+ when 1 then wdata = 0x0000ff00 & (wdata << 8)
373
+ when 2 then wdata = 0x00ff0000 & (wdata << 16)
374
+ when 3 then wdata = 0xff000000 & (wdata << 24)
375
+ end
400
376
  when 16
401
377
  case addr_1_0
402
- when 0b00 then wdata = 0x0000ffff & wdata
403
- when 0b10 then wdata = 0xffff0000 & (wdata << 16)
378
+ when 0 then wdata = 0x0000ffff & wdata
379
+ when 2 then wdata = 0xffff0000 & (wdata << 16)
404
380
  end
405
381
  when 32
406
382
  wdata = wdata
@@ -383,7 +383,7 @@ module OrigenARMDebug
383
383
  _name = options.delete(:name)
384
384
  if !options[:r_attempts].nil?
385
385
  attempts = options[:r_attempts]
386
- elsif !options[:r_attempts].nil?
386
+ elsif !options[:w_attempts].nil?
387
387
  attempts = options[:w_attempts]
388
388
  else
389
389
  attempts = 1
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.8.3
4
+ version: 0.8.4
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-12-11 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen