origen_memory_image 0.8.0 → 0.8.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
  SHA256:
3
- metadata.gz: e6d27769f59fa1a69c1852e52938f3aec79d207ffb13b72ed487e010c069e646
4
- data.tar.gz: 294557f93e03076cd83b99a9a62448e1b750a2267821ab55639f3204363552ef
3
+ metadata.gz: 90f929c547d4a00df7450faf892f6f4ebed1c56d18b64e9315d810dd7774f55c
4
+ data.tar.gz: e209715c41348a5975f549f27babdc1d4e2c0473f6e935fff12148d2f2e7a5f0
5
5
  SHA512:
6
- metadata.gz: 5b91848e556f07557ec2d73681694c138d3d4f2355487e89092f222ccbdb5df97ab2e88b084a9e0a34f86175d3848b316c9962ad3fa2d306d4db9d3a376aea8e
7
- data.tar.gz: 47c5b9122afab890109b6b4fa6f307bcf87b3e65b46ea1e6a356b57e1ac12fdd8a0f0802753a7b7bbac1a305297f45497c08c576bec428ba2d402d825ccb1963
6
+ metadata.gz: 2319ac1964ce679181d45b9b79343604a90aad3149d3015ab1e8daf3e1edaf2045bf41aaba40680f371131f6278a363187caf2407b60fd7508cb4ecdc3792cdc
7
+ data.tar.gz: c8dae0921e4490b7a108cfbbb0a1ef0d93585fe8191c8e61dd2ef3debf624bd6333771d2f7ee24de638cb265f33653729e8def0e7bcc6812eeac689470f89a90
@@ -1,8 +1,7 @@
1
1
  module OrigenMemoryImage
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
-
7
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
7
  end
@@ -8,6 +8,7 @@ module OrigenMemoryImage
8
8
  else
9
9
  @file = file
10
10
  end
11
+ @ljust_partial_data = options[:ljust_partial_data]
11
12
  end
12
13
 
13
14
  # Returns the code execution start address as an int
@@ -46,7 +46,11 @@ module OrigenMemoryImage
46
46
  end
47
47
  # If a partial word is left over
48
48
  if (remainder = data.length % (2 * options[:data_width_in_bytes])) > 0
49
- result << [@address, data[data.length - remainder..data.length].to_i(16)]
49
+ if @ljust_partial_data
50
+ result << [@address, data[data.length - remainder..data.length].ljust(options[:data_width_in_bytes] * 2, '0').to_i(16)]
51
+ else
52
+ result << [@address, data[data.length - remainder..data.length].to_i(16)]
53
+ end
50
54
  end
51
55
  end
52
56
  end
@@ -202,7 +202,11 @@ module OrigenMemoryImage
202
202
  end
203
203
  # If a partial word is left over
204
204
  if (remainder = data.length % (2 * options[:data_width_in_bytes])) > 0
205
- result << [addr, data[data.length - remainder..data.length].to_i(16)]
205
+ if @ljust_partial_data
206
+ result << [addr, data[data.length - remainder..data.length].ljust(options[:data_width_in_bytes] * 2, '0').to_i(16)]
207
+ else
208
+ result << [addr, data[data.length - remainder..data.length].to_i(16)]
209
+ end
206
210
  end
207
211
  end
208
212
  end
@@ -58,6 +58,25 @@ my_srec = OrigenMemoryImage.new("source_files/test_atd.abs.S19")
58
58
  my_hex = OrigenMemoryImage.new("source_files/math.hex")
59
59
  ~~~
60
60
 
61
+ By default any partial data words are right justified. Change this behavior to left justified like this:
62
+
63
+ ~~~ruby
64
+ my_srec = OrigenMemoryImage.new("source_files/test_atd.abs.S19", ljust_partial_data: true)
65
+ my_hex = OrigenMemoryImage.new("source_files/math.hex", ljust_partial_data: true)
66
+ ~~~
67
+
68
+ Partial data example:
69
+
70
+ ~~~
71
+ 0304FE
72
+
73
+ # Default interpretation into 32-bit word:
74
+ 0x0003_04FE
75
+
76
+ # Left justified interpretation into 32-bit word:
77
+ 0x0304_FE00
78
+ ~~~
79
+
61
80
  Memory images can also be created directly from a string:
62
81
 
63
82
  ~~~ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_memory_image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.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: 2018-12-18 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -77,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: 1.8.11
79
79
  requirements: []
80
- rubyforge_project:
81
- rubygems_version: 2.7.7
80
+ rubygems_version: 3.1.4
82
81
  signing_key:
83
82
  specification_version: 4
84
83
  summary: Provides a standard API for consuming memory image files in any format e.g.