origen_doc_helpers 0.7.1 → 0.8.3

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
- SHA1:
3
- metadata.gz: c9913b384df5e46cc7aaa1a413e4bdebf5707074
4
- data.tar.gz: 0eec0a9f93a7760a5d19a833f12d4aa88c3221bf
2
+ SHA256:
3
+ metadata.gz: 86607573815de7e69eb55f1fb1afc8798ff50ba92a4b3a230b1b6cb3627f1365
4
+ data.tar.gz: a230731ac9a2d6049c2432d496260174ff93cc448f3a9b3ed2ec4cc1abc866e0
5
5
  SHA512:
6
- metadata.gz: 201b1b79b0c2ca2b556536ca635c1602154901fd25511f43a576f14ad805c7d5bc50dc97464c3229f4eed04ea2c966b581327618aaf2c2aa214f66a87c0123fc
7
- data.tar.gz: 60ec544a89a90dfb5a3a040a2f7ca747f7d51e12ed488c58f0bcbd95187cea043243d1d9b4d1b3c47c0288f0df81647e047090c92999d33fdd2ccc4fe2306107
6
+ metadata.gz: 3c06e83e7c9aab01cb997d2845ebb6d14822ad69ffffd3c22cd7b36c5aa9cb83ecd42241b51dad2c6e3d8b2c94de931c270a94b4bb1094169abdd19aa374d8a3
7
+ data.tar.gz: ddcdb9f112688745f8503094fe83defdcf3c5fb2ca855cc48c7138cc0175e286291a8d2f936a173bba28e5a9a19b97daeaf95412e94fe47533deab2c7740c133
@@ -8,7 +8,7 @@ class OrigenDocHelpersApplication < Origen::Application
8
8
  # To enable deployment of your documentation to a web server (via the 'origen web'
9
9
  # command) fill in these attributes.
10
10
  config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/doc_helpers"
11
- config.web_domain = "http://origen-sdk.org/doc_helpers"
11
+ config.web_domain = "https://origen-sdk.org/doc_helpers"
12
12
  config.disqus_shortname = "origen-sdk"
13
13
 
14
14
  config.semantically_version = true
@@ -1,8 +1,7 @@
1
1
  module OrigenDocHelpers
2
2
  MAJOR = 0
3
- MINOR = 7
4
- BUGFIX = 1
3
+ MINOR = 8
4
+ BUGFIX = 3
5
5
  DEV = nil
6
-
7
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
7
  end
@@ -1,7 +1,7 @@
1
1
  module OrigenDocHelpers
2
2
  # Provides an API to programatically construct an index hash as used
3
3
  # by the Searchable Documents helper -
4
- # http://origen-sdk.org/doc_helpers/helpers/searchable/intro/#The_Document_Index
4
+ # https://origen-sdk.org/doc_helpers/helpers/searchable/intro/#The_Document_Index
5
5
  class GuideIndex
6
6
  def initialize
7
7
  @index = {}
@@ -272,7 +272,11 @@ END
272
272
  if options[:tab]
273
273
  options[:tab]
274
274
  else
275
- rel = options[:top_level_file].relative_path_from(_doc_root_dir(options)).sub_ext('').sub_ext('').to_s
275
+ rel = begin
276
+ options[:top_level_file].relative_path_from(_doc_root_dir(options)).sub_ext('').sub_ext('').to_s
277
+ rescue
278
+ '..'
279
+ end
276
280
  # If the file lives outside of the current app (e.g. it comes from a plugin), then the above approach
277
281
  # doesn't work, so let's just take the last dirname and the filename
278
282
  if rel =~ /\.\./
@@ -1,7 +1,11 @@
1
- require 'atp'
1
+ begin
2
+ require 'origen_testers/atp'
3
+ rescue LoadError
4
+ require 'atp'
5
+ end
2
6
  require 'kramdown'
3
7
  module OrigenDocHelpers
4
- class HtmlFlowFormatter < ATP::Formatter
8
+ class HtmlFlowFormatter < (defined?(OrigenTesters::ATP) ? OrigenTesters::ATP::Formatter : ATP::Formatter)
5
9
  include Origen::Generator::Compiler::DocHelpers::TestFlowHelpers
6
10
 
7
11
  attr_reader :html
@@ -1,6 +1,10 @@
1
- require 'atp'
1
+ begin
2
+ require 'origen_testers/atp'
3
+ rescue LoadError
4
+ require 'atp'
5
+ end
2
6
  module OrigenDocHelpers
3
- class ListFlowFormatter < ATP::Formatter
7
+ class ListFlowFormatter < (defined?(OrigenTesters::ATP) ? OrigenTesters::ATP::Formatter : ATP::Formatter)
4
8
  attr_reader :html
5
9
 
6
10
  def format(node, options = {})
@@ -78,6 +78,26 @@ module OrigenDocHelpersDev
78
78
  reg :debug_22, 0xf54, 32, bit_order: 'lsb0', ip_base_address: 0x1080000, description: '' do
79
79
  bit 31..0, :placeholder, reset: 0b0, access: :rw
80
80
  end
81
+ reg :msb0_debug, 0xf58, 32, bit_order: 'msb0', ip_base_address: 0x1080000, description: '' do
82
+ # placeholder field description
83
+ bit 31..1, :placeholder, reset: 0b0, access: :rw
84
+ # single bit
85
+ bit 0, :single_bit, reset: 1, access: :rw
86
+ end
87
+ reg :lsb0_non_byte_aligned, 0xf5c, 9, bit_order: 'lsb0', ip_base_address: 0x1080000, description: '' do
88
+ bit 8..0, :placeholder, reset: 0b0, access: :rw
89
+ end
90
+ reg :msb0_non_byte_aligned, 0xf60, 9, bit_order: :msb0, ip_base_address: 0x1080000, description: '' do
91
+ # placeholder field description
92
+ bit 8..0, :placeholder, reset: 0b0, access: :rw
93
+ end
94
+ reg :lsb0_tiny, 0xf64, 3, bit_order: :lsb0, ip_base_address: 0x1080000, description: '' do
95
+ bit 2..0, :placeholder, reset: 0b0, access: :rw
96
+ end
97
+ reg :msb0_tiny, 0xf68, 3, bit_order: :msb0, ip_base_address: 0x1080000, description: '' do
98
+ # placeholder field description
99
+ bit 2..0, :placeholder, reset: 0b0, access: :rw
100
+ end
81
101
  end
82
102
  end
83
103
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="row" style="margin-top: 10px; margin-bottom: 15px;">
5
5
  <div class="col-md-9">
6
- <img src="http://origen-sdk.org/img/origen-device.png" style="float: left; height:50px; width: 50px; margin-top: 14px;">
6
+ <img src="https://origen-sdk.org/img/origen-device.png" style="float: left; height:50px; width: 50px; margin-top: 14px;">
7
7
  <h1 style="float: left; margin-left: 10px;">Models</h1>
8
8
  </div>
9
9
  </div>
@@ -20,7 +20,7 @@
20
20
 
21
21
  <div class="row" style="margin-top: 10px; margin-bottom: 15px;">
22
22
  <div class="col-md-9">
23
- <img src="http://origen-sdk.org/img/origen-device.png" style="float: left; height:50px; width: 50px; margin-top: 14px;">
23
+ <img src="https://origen-sdk.org/img/origen-device.png" style="float: left; height:50px; width: 50px; margin-top: 14px;">
24
24
  <h1 style="float: left; margin-left: 10px;"><%= opts[:heading] %></h1>
25
25
  </div>
26
26
  % if opts[:search_box]
@@ -1,4 +1,6 @@
1
1
  % reg = options[:reg]
2
+ % order_is_lsb0 = true
3
+ % order_is_lsb0 = false if reg.bit_order == :msb0 || reg.bit_order == 'msb0'
2
4
  % include_data = false
3
5
 
4
6
  <div class="register">
@@ -17,6 +19,7 @@
17
19
  <h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg_path %></h4>
18
20
  % end
19
21
  </a>
22
+
20
23
  % if options[:current_value]
21
24
  % if reg.size <= 8
22
25
  <h4><font style="background-color: #66FF66">Current Value: <%= sprintf("0x%02X",reg.value) %></font></h4>
@@ -39,23 +42,43 @@
39
42
  </div>
40
43
  % end
41
44
 
45
+ % if !order_is_lsb0
46
+ <table class="reg table table-condensed ljust" style="margin-bottom: 0; table-layout: fixed;">
47
+ <thead>
48
+ <tr class="bit-positions">
49
+ <b><tr class = "heading"><%= reg_path%> <span class="msb0_specific" style="color:gray;">(<%= reg_path %>.with_msb0)</span></tr></b>
50
+ </tr>
51
+ </thead>
52
+ </table>
53
+ % end
54
+
42
55
  % num_bytes = (reg.size / 8.0).ceil
43
56
  % num_bytes.times do |byte_index|
44
57
  % # Need to add support for little endian regs here?
45
58
  % byte_number = num_bytes - byte_index
46
59
  % max_bit = (byte_number * 8) - 1
47
60
  % min_bit = max_bit - 8 + 1
61
+ % partial_byte = max_bit > (reg.size - 1)
48
62
 
49
- <table class="reg table table-condensed" style="margin-bottom: 0; table-layout: fixed;">
63
+ <table class="reg table table-condensed <%= 'rjust' %><%= partial_byte ? ' partial' : '' %>" style="margin-bottom: 0; table-layout: fixed;">
50
64
  <thead>
51
65
  <tr class="bit-positions">
66
+ % if order_is_lsb0
52
67
  <th class="spacer"></th>
68
+ % else
69
+ <td class="heading">LSB0<span class="msb0_specific" style="color:gray;"> (MSB0)</span></td>
70
+ % end
71
+
53
72
  % 8.times do |i|
54
73
  % bit_num = (byte_number * 8) - i - 1
55
74
  % if bit_num > reg.size - 1
56
75
  <th class="spacer"></th>
57
76
  % else
77
+ % if order_is_lsb0
58
78
  <th class="bit-position"><%= bit_num %></th>
79
+ % else
80
+ <th class="bit-position"><%= bit_num %><span class="msb0_specific" style="color:gray;"> (<%= reg.size - bit_num -1%>)</span></th>
81
+ % end
59
82
  % end
60
83
  % end
61
84
  </tr>
@@ -66,13 +89,18 @@
66
89
  %# Read Row
67
90
  %#############################################
68
91
  <tr class="read">
92
+ % if order_is_lsb0
69
93
  <td class="heading">R</td>
94
+ % else
95
+ <td class="heading"><span class="msb0_specific" style="color:gray;">[LSB0] </span>R</td>
96
+ % end
97
+
70
98
  % alignment_done = false
71
99
  % reg.named_bits :include_spacers => true do |name, bit|
72
100
  % if _bit_in_range?(bit, max_bit, min_bit)
73
101
  % if max_bit > (reg.size - 1) && !alignment_done
74
102
  % (max_bit - (reg.size - 1)).times do
75
- <td class="spacer"></td>
103
+ <td class="spacer"></td>
76
104
  % end
77
105
  % alignment_done = true
78
106
  % end
@@ -191,7 +219,7 @@
191
219
  % if options[:current_value]
192
220
  <tr class="current_value">
193
221
  <td class="heading">Current Value (Hex)</td>
194
- % alignment_done = false
222
+ % alignment_done = !order_is_lsb0
195
223
  % reg.named_bits :include_spacers => true do |name, bit|
196
224
  % if _bit_in_range?(bit, max_bit, min_bit)
197
225
  % if max_bit > (reg.size - 1) && !alignment_done
@@ -292,16 +320,16 @@
292
320
  <p>
293
321
  <a class="anchor" name="<%= "#{reg.name}_#{name}_#{bits.position}" %>"></a>
294
322
  % if bits.size == 1
295
- <%= bits.position %>
323
+ <%= bits.position %><%= order_is_lsb0 ? '' : "<span class=\"msb0_specific\" style=\"color:gray;\"> (#{reg.size - bits.position - 1})</span>" %>
296
324
  % else
297
- <%= bits.position + bits.size - 1 %>-<%= bits.position %>
325
+ <%= bits.position + bits.size - 1 %>-<%= bits.position %><%= order_is_lsb0 ? '' : "<span class=\"msb0_specific\" style=\"color:gray;\"> (#{reg.size - bits.position - bits.size}-#{reg.size - bits.position - 1})</span>" %>
298
326
  % end
299
327
  </p>
300
328
  <p>
301
329
  % if bits.size == 1
302
330
  <%= name %>
303
331
  % else
304
- <%= name %>[<%= bits.size - 1 %>:0]
332
+ <%= name %>[<%= bits.size - 1 %>:0]<%= order_is_lsb0 ? '' : "<span class=\"msb0_specific\" style=\"color:gray;\"> ([0:#{bits.size - 1}])</span>" %>
305
333
  % end
306
334
  </p>
307
335
  </td>
@@ -16,7 +16,7 @@ These helpers will generate complete web pages for you.
16
16
 
17
17
  The following are components that you can embed within your own web pages.
18
18
 
19
- | [Searchable Documents](<%= path "/helpers/searchable/intro" %>) | Provides a layout for a guides section of your website, complete with search box (the [Origen Guides](http://origen-sdk.org/guides) uses this)
19
+ | [Searchable Documents](<%= path "/helpers/searchable/intro" %>) | Provides a layout for a guides section of your website, complete with search box (the [Origen Guides](https://origen-sdk.org/guides) uses this)
20
20
  | [Register Descriptions](<%= path "/helpers/register" %>) | Create a tabular register view, similar to that used in device reference manuals
21
21
  | [Yammer Comments](<%= path "/helpers/yammer" %>) | Embed a comments section at the bottom of your page using Yammer
22
22
  | [Disqus Comments](<%= path "/helpers/disqus" %>) | Embed a comments section at the bottom of your page using Disqus
@@ -5,9 +5,9 @@
5
5
  This helper will build a collection of web pages that document a model's attributes,
6
6
  currently this includes its sub-blocks and registers.
7
7
 
8
- [Here is an example](http://origen-sdk.org/link_demo/models/linkdemo_toplevel/).
8
+ [Here is an example](https://origen-sdk.org/link_demo/models/linkdemo_toplevel/).
9
9
 
10
- Multiple models can be supplied and an [index page like this](http://origen-sdk.org/link_demo/models)
10
+ Multiple models can be supplied and an [index page like this](https://origen-sdk.org/link_demo/models)
11
11
  is generated to help locate the documentation for a given model.
12
12
 
13
13
  The collection of pages associated with a particular model is also fully searchable via
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Register Helpers
4
4
 
5
- Use the [Origen register API](http://origen-sdk.org/origen/guides/models/registers)
5
+ Use the [Origen register API](https://origen-sdk.org/origen/guides/models/registers)
6
6
  to define registers in the normal way,
7
7
  all of the examples are here are based on this register definition:
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen_doc_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.3
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-08-16 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -31,7 +31,6 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - bin/fix_my_workspace
35
34
  - config/application.rb
36
35
  - config/boot.rb
37
36
  - config/commands.rb
@@ -77,7 +76,7 @@ files:
77
76
  - templates/web/layouts/_helpers.html.erb
78
77
  - templates/web/partials/_navbar.html.erb
79
78
  - templates/web/release_notes.md.erb
80
- homepage: http://origen-sdk.org/doc_helpers
79
+ homepage: https://origen-sdk.org/doc_helpers
81
80
  licenses:
82
81
  - MIT
83
82
  metadata: {}
@@ -96,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
95
  - !ruby/object:Gem::Version
97
96
  version: 1.8.11
98
97
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.6.14.1
98
+ rubygems_version: 3.1.4
101
99
  signing_key:
102
100
  specification_version: 4
103
101
  summary: Snippets and helpers for creating Origen web documents
@@ -1,100 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- if $_fix_my_workspace_version_check
5
- $_fix_my_workspace_version = '0.7.0'
6
- else
7
- if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
8
- # If this script is being run from within an origen-core workspace, use that Origen-core,
9
- # not the system-installed origen-core version.
10
- $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11
- require 'origen'
12
- else
13
- # Use system-installed Origen (the gem in system Ruby)
14
- require 'origen'
15
- end
16
-
17
- if !Origen.site_config.gem_manage_bundler
18
- puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
19
- puts 'that I cannot make certain assumptions about how your workspace is configured.'
20
- puts 'You will need to either resolve this problem yourself, or else change the value of'
21
- puts 'gem_mange_bundler to true.'
22
- puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
23
-
24
- else
25
- ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
26
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
27
- ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
28
-
29
- # Force copy system gems to local gems
30
- if Origen.site_config.gem_use_from_system
31
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
32
- gem_dir = Pathname.new(Gem.dir)
33
-
34
- Origen.site_config.gem_use_from_system.each do |gem, version|
35
- begin
36
- # This will raise an error if the system doesn't have this gem installed, that
37
- # will be rescued below
38
- spec = Gem::Specification.find_by_name(gem, version)
39
-
40
- local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
41
- FileUtils.mkdir_p local_dir
42
- FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
43
-
44
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
45
- FileUtils.mkdir_p local_file.dirname
46
- FileUtils.cp(spec.cache_file, local_file)
47
-
48
- if spec.extension_dir && File.exist?(spec.extension_dir)
49
- local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
50
- FileUtils.mkdir_p local_dir
51
- FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
52
- end
53
-
54
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
55
- FileUtils.mkdir_p local_file.dirname
56
- FileUtils.cp(spec.spec_file, local_file)
57
-
58
- rescue Gem::LoadError
59
- # This just means that one of the gems that should be copied from the system
60
- # was not actually installed in the system, so nothing we can do about that here
61
- end
62
- end
63
- end
64
-
65
- # Delete lbin
66
- FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
67
-
68
- # Run bundler with correct switches
69
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
70
- `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
71
- `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
72
- `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
73
-
74
- # Try again, this time updating the bundle
75
- if system(cmd)
76
- fixed = true
77
- elsif system 'bundle update'
78
- fixed = true
79
- end
80
-
81
- if File.exist?(ENV['BUNDLE_BIN'])
82
- `chmod o-w #{ENV['BUNDLE_BIN']}`
83
-
84
- # Make .bat versions of all executables, Bundler should really be doing this when running
85
- # on windows
86
- if Origen.os.windows?
87
- Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
88
- unless bin =~ /.bat$/
89
- bat = "#{bin}.bat"
90
- unless File.exist?(bat)
91
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- system 'origen -v' if fixed
99
- end
100
- end