origen 0.7.14 → 0.7.15

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: 40391053371e047fa27346b149db5b2ff484918a
4
- data.tar.gz: 3f50782d9a9a343ed66b4a7394617f17abf0142e
3
+ metadata.gz: 5515909ec26db7a8a2f402e66f46972f79ff4d62
4
+ data.tar.gz: f338f5a5fad2f8a92ba5035e7670a692e6bda8c4
5
5
  SHA512:
6
- metadata.gz: 346f223195d1f35d701b68939c50d4af4f83e2860bc3f831a06e34f9b4c1eb1f22b5ac4b67c9fbcad545e97557c985716a5c0e8314914824bd7d64026d4184ae
7
- data.tar.gz: 25dac8be070f239281329c89a6b45ac480ca2105513c82b71fa7be66ad6f5961441e4f2da3ca7f5285544af9326e66623e57d00e2b5009743599c5eec0229746
6
+ metadata.gz: 9386d160c9873e09742484e479b5ebde00332a106e20d52a3907a5c8a93ef567ef45e9e7fe2a8c9e5fcb6431de1e52e7dd05f386c1093f53a3bb3d99857ced92
7
+ data.tar.gz: 74f6309577983523713fc70b08bacc6cd06bba02bb6b8864e803e20b0dd02892a728faec5729c1a84a9d8db3dc97eb110c0b9c3092716110355d8bf4e51bce04
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 14
4
+ BUGFIX = 15
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -96,6 +96,10 @@ module Origen
96
96
  result
97
97
  end
98
98
 
99
+ def to_json(*args)
100
+ model.to_json(*args)
101
+ end
102
+
99
103
  # Used to proxy all method and attribute requests not implemented on the controller
100
104
  # to the model.
101
105
  #
@@ -1,5 +1,6 @@
1
1
  require 'active_support/concern'
2
2
  require 'origen/memory'
3
+ require 'json'
3
4
  module Origen
4
5
  # Include this module to identify it as an SoC IP Block, this will automatically
5
6
  # include common modules such as Pin and Register support
@@ -327,6 +328,23 @@ module Origen
327
328
  end
328
329
  end
329
330
 
331
+ def to_json(*args)
332
+ JSON.pretty_generate({
333
+ name: name,
334
+ address: base_address,
335
+ path: path,
336
+ blocks: sub_blocks.map do |name, block|
337
+ {
338
+ name: name,
339
+ address: block.base_address
340
+ }
341
+ end,
342
+ registers: regs.map do |name, reg|
343
+ reg
344
+ end
345
+ }, *args)
346
+ end
347
+
330
348
  private
331
349
 
332
350
  def _initialized
@@ -254,6 +254,10 @@ module Origen
254
254
  def contains_bits?
255
255
  true
256
256
  end
257
+
258
+ def to_json(*args)
259
+ materialize.to_json(*args)
260
+ end
257
261
  end
258
262
 
259
263
  class Collector
@@ -1,3 +1,4 @@
1
+ require 'json'
1
2
  module Origen
2
3
  module Registers
3
4
  # The register class can be used to represent not only h/ware resgisters,
@@ -363,8 +364,8 @@ module Origen
363
364
  desc[0] = desc.first.sub(/\s*\*\*\s*#{escape_special_char(full_name(bitname))}\s*\*\*\s*-?\s*/, '')
364
365
  end
365
366
  end
366
- desc.shift if desc.first && desc.first.strip.empty?
367
- desc.pop if desc.last && desc.last.strip.empty?
367
+ desc.shift while desc.first && desc.first.strip.empty?
368
+ desc.pop while desc.last && desc.last.strip.empty?
368
369
  desc
369
370
  end
370
371
  alias_method :descriptions, :description
@@ -1368,6 +1369,36 @@ module Origen
1368
1369
  end
1369
1370
  end
1370
1371
 
1372
+ def to_json(*args)
1373
+ JSON.pretty_generate({
1374
+ name: name,
1375
+ full_name: full_name,
1376
+ address: address,
1377
+ offset: offset,
1378
+ size: size,
1379
+ path: path,
1380
+ reset_value: reset_value,
1381
+ description: description(include_name: false, include_bit_values: false),
1382
+ bits: named_bits.map do |name, bit|
1383
+ {
1384
+ name: name,
1385
+ full_name: bit.full_name,
1386
+ position: bit.position,
1387
+ size: bit.size,
1388
+ reset_value: bit.reset_value,
1389
+ access: bit.access,
1390
+ description: bit.description(include_name: false, include_bit_values: false),
1391
+ bit_values: bit.bit_value_descriptions.map do |val, desc|
1392
+ {
1393
+ value: val,
1394
+ description: desc
1395
+ }
1396
+ end
1397
+ }
1398
+ end
1399
+ }, *args)
1400
+ end
1401
+
1371
1402
  private
1372
1403
 
1373
1404
  def _state_desc(bits)
@@ -36,7 +36,7 @@ compile '*' do
36
36
  coderay: {css: :style}
37
37
  filter :codeblocks
38
38
  end
39
- unless ["xml", "js", "css"].include?(item[:extension]) || item[:layout] == "none" || item[:layout] == "None"
39
+ unless ["xml", "js", "css", "json"].include?(item[:extension]) || item[:layout] == "none" || item[:layout] == "None"
40
40
  item[:layout] = "bootstrap" if item[:layout] == "bootstrap3"
41
41
  filter :bootstrap
42
42
  layout item[:layout] || 'bootstrap'
@@ -53,7 +53,7 @@ end
53
53
  #end
54
54
 
55
55
  route '*' do
56
- if item.binary? || ["xml", "js", "css"].include?(item[:extension])
56
+ if item.binary? || ["xml", "js", "css", "json"].include?(item[:extension])
57
57
  # Write item with identifier /foo/ to /foo.ext
58
58
  item.identifier.chop + '.' + item[:extension]
59
59
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.14
4
+ version: 0.7.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
@@ -652,7 +652,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
652
652
  version: 1.8.11
653
653
  requirements: []
654
654
  rubyforge_project:
655
- rubygems_version: 2.6.2
655
+ rubygems_version: 2.4.5
656
656
  signing_key:
657
657
  specification_version: 4
658
658
  summary: The Semiconductor Developer's Kit