origen_doc_helpers 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc64bf452050bf339559fae81af5f84ec6a1110b7f961603c01216054544b724
|
4
|
+
data.tar.gz: 339aea6eed91ca04ae9878c588d99d5686dd0bdb7a7782648574e72cf6bf44b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fcb507a0332cdb0770b34992d4fcd21f25feafe50f44e6d96232364108edfcb98309e24a1eecb89db31450aad5503d9a14f6dddc120a77172831bfe6f19040
|
7
|
+
data.tar.gz: e88f2858f3a3d9fb6971b64a8b9afd1adf275d326f495213c5bca23d56a0253b8a6fad5c8ef785fc34d4ef78db5b6d2f82236c7e5a91f432c2d754cfec38e4ef
|
data/config/version.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
|
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
|
-
|
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 = {})
|
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.8.
|
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:
|
11
|
+
date: 2019-07-24 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
|
@@ -57,7 +56,6 @@ files:
|
|
57
56
|
- templates/model_page.md.erb
|
58
57
|
- templates/pdf/topic_wrapper.html
|
59
58
|
- templates/shared/_register.html.erb
|
60
|
-
- templates/shared/_register.html.erb~
|
61
59
|
- templates/shared/_searchable.html.erb
|
62
60
|
- templates/shared/_spec.html.erb
|
63
61
|
- templates/shared/test/_flow.md.erb
|
data/bin/fix_my_workspace
DELETED
@@ -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
|
@@ -1,368 +0,0 @@
|
|
1
|
-
% reg = options[:reg]
|
2
|
-
% order_is_lsb0 = true
|
3
|
-
% order_is_lsb0 = false if reg.bit_order == :msb0 || reg.bit_order == 'msb0'
|
4
|
-
% include_data = false
|
5
|
-
|
6
|
-
<div class="register">
|
7
|
-
<a class="anchor" name="<%= "#{reg.name}" %>"></a>
|
8
|
-
|
9
|
-
<a href='#<%= reg.name %>'>
|
10
|
-
% if options[:origen_path] && !options[:origen_path].empty?
|
11
|
-
% reg_path = options[:origen_path] + "." + reg.name.to_s
|
12
|
-
% reg_path = "#{reg.name} - #{reg_path}"
|
13
|
-
% else
|
14
|
-
% reg_path = reg.name
|
15
|
-
% end
|
16
|
-
% if reg.full_name
|
17
|
-
<h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg.full_name %> (<%= reg_path %>)</h4>
|
18
|
-
% else
|
19
|
-
<h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg_path %></h4>
|
20
|
-
% end
|
21
|
-
</a>
|
22
|
-
|
23
|
-
% if options[:current_value]
|
24
|
-
% if reg.size <= 8
|
25
|
-
<h4><font style="background-color: #66FF66">Current Value: <%= sprintf("0x%02X",reg.value) %></font></h4>
|
26
|
-
% elsif reg.size <= 16
|
27
|
-
<h4><font style="background-color: #66FF66">Current Value: <%= sprintf("0x%04X",reg.value) %></font></h4>
|
28
|
-
% elsif reg.size <= 24
|
29
|
-
<h4><font style="background-color: #66FF66">Current Value: <%= sprintf("0x%06X",reg.value) %></font></h4>
|
30
|
-
% elsif reg.size <= 32
|
31
|
-
<h4><font style="background-color: #66FF66">Current Value: <%= sprintf("0x%08X",reg.value) %></font></h4>
|
32
|
-
% end
|
33
|
-
% end
|
34
|
-
|
35
|
-
% if options[:descriptions]
|
36
|
-
<div markdown="1" style="margin: 0 0 20px 0">
|
37
|
-
|
38
|
-
% reg.description(:include_name => false).each do |line|
|
39
|
-
<%= line.gsub("\\'", "'") %>
|
40
|
-
% end
|
41
|
-
|
42
|
-
</div>
|
43
|
-
% end
|
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
|
-
|
55
|
-
% num_bytes = (reg.size / 8.0).ceil
|
56
|
-
% num_bytes.times do |byte_index|
|
57
|
-
% # Need to add support for little endian regs here?
|
58
|
-
% byte_number = num_bytes - byte_index
|
59
|
-
% max_bit = (byte_number * 8) - 1
|
60
|
-
% min_bit = max_bit - 8 + 1
|
61
|
-
% partial_byte = max_bit > (reg.size - 1)
|
62
|
-
|
63
|
-
<table class="reg table table-condensed <%= 'rjust' %><%= partial_byte ? ' partial' : '' %>" style="margin-bottom: 0; table-layout: fixed;">
|
64
|
-
<thead>
|
65
|
-
<tr class="bit-positions">
|
66
|
-
% if order_is_lsb0
|
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
|
-
|
72
|
-
% 8.times do |i|
|
73
|
-
% bit_num = (byte_number * 8) - i - 1
|
74
|
-
% if bit_num > reg.size - 1
|
75
|
-
<th class="spacer"></th>
|
76
|
-
% else
|
77
|
-
% if order_is_lsb0
|
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
|
82
|
-
% end
|
83
|
-
% end
|
84
|
-
</tr>
|
85
|
-
</thead>
|
86
|
-
<tbody>
|
87
|
-
|
88
|
-
%#############################################
|
89
|
-
%# Read Row
|
90
|
-
%#############################################
|
91
|
-
<tr class="read">
|
92
|
-
% if order_is_lsb0
|
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
|
-
|
98
|
-
% alignment_done = false
|
99
|
-
% reg.named_bits :include_spacers => true do |name, bit|
|
100
|
-
% if _bit_in_range?(bit, max_bit, min_bit)
|
101
|
-
% if max_bit > (reg.size - 1) && !alignment_done
|
102
|
-
% (max_bit - (reg.size - 1)).times do
|
103
|
-
<td class="spacer"></td>
|
104
|
-
% end
|
105
|
-
% alignment_done = true
|
106
|
-
% end
|
107
|
-
% if bit.size > 1
|
108
|
-
% if name
|
109
|
-
% if bit.readable?
|
110
|
-
% bit_name = "#{name}[#{bit.size - 1}:0]"
|
111
|
-
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">
|
112
|
-
% if options[:descriptions] && !bit.description.empty?
|
113
|
-
<span title="<%= name %>"><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span>
|
114
|
-
% else
|
115
|
-
<span title="<%= name %>"><%= bit_name %></span>
|
116
|
-
% end
|
117
|
-
</td>
|
118
|
-
% else
|
119
|
-
% if bit.access == :worz
|
120
|
-
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">
|
121
|
-
<span>0</span>
|
122
|
-
</td>
|
123
|
-
% else
|
124
|
-
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>"></td>
|
125
|
-
% end
|
126
|
-
% end
|
127
|
-
% else
|
128
|
-
% bit.shift_out_left do |bit|
|
129
|
-
% if _index_in_range?(bit.position, max_bit, min_bit)
|
130
|
-
<td>0</td>
|
131
|
-
% end
|
132
|
-
% end
|
133
|
-
% end
|
134
|
-
% else
|
135
|
-
% if name
|
136
|
-
% if bit.readable?
|
137
|
-
% if name.size > 10
|
138
|
-
% bit_name = "#{name[0..2]}...#{name[-3..-1]}"
|
139
|
-
%# bit_name = "bit#{bit.position}*"
|
140
|
-
% else
|
141
|
-
% bit_name = name
|
142
|
-
% end
|
143
|
-
% if options[:descriptions] && !bit.description.empty?
|
144
|
-
<td class="<%= _bit_rw(bit) %>"><span title="<%= name %>"><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span></td>
|
145
|
-
% else
|
146
|
-
<td class="<%= _bit_rw(bit) %>"><span title="<%= name %>"><%= bit_name %></span></td>
|
147
|
-
% end
|
148
|
-
% else
|
149
|
-
<td class="<%= _bit_rw(bit) %>"></td>
|
150
|
-
% end
|
151
|
-
% else
|
152
|
-
<td>0</td>
|
153
|
-
% end
|
154
|
-
% end
|
155
|
-
% end
|
156
|
-
% end
|
157
|
-
</tr>
|
158
|
-
|
159
|
-
%#############################################
|
160
|
-
%# Write Row
|
161
|
-
%#############################################
|
162
|
-
<tr class="write">
|
163
|
-
<td class="heading">W</td>
|
164
|
-
% alignment_done = false
|
165
|
-
% reg.named_bits :include_spacers => true do |name, bit|
|
166
|
-
% if _bit_in_range?(bit, max_bit, min_bit)
|
167
|
-
% if max_bit > (reg.size - 1) && !alignment_done
|
168
|
-
% (max_bit - (reg.size - 1)).times do
|
169
|
-
<td class="spacer"></td>
|
170
|
-
% end
|
171
|
-
% alignment_done = true
|
172
|
-
% end
|
173
|
-
% if bit.size > 1
|
174
|
-
% if name
|
175
|
-
% if !bit.readable?
|
176
|
-
% bit_name = "#{name}[#{bit.size - 1}:0]"
|
177
|
-
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">
|
178
|
-
% if options[:descriptions] && !bit.description.empty?
|
179
|
-
<span title="<%= name %>"><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span>
|
180
|
-
% else
|
181
|
-
<span title="<%= name %>"><%= bit_name %></span>
|
182
|
-
% end
|
183
|
-
</td>
|
184
|
-
% else
|
185
|
-
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>"></td>
|
186
|
-
% end
|
187
|
-
% else
|
188
|
-
% bit.shift_out_left do |bit|
|
189
|
-
% if _index_in_range?(bit.position, max_bit, min_bit)
|
190
|
-
<td class="not-writable"></td>
|
191
|
-
% end
|
192
|
-
% end
|
193
|
-
% end
|
194
|
-
% else
|
195
|
-
% if name
|
196
|
-
% if !bit.readable?
|
197
|
-
% if name.size > 10
|
198
|
-
% bit_name = "#{name[0..2]}...#{name[-3..-1]}"
|
199
|
-
%# bit_name = "bit#{bit.position}*"
|
200
|
-
% else
|
201
|
-
% bit_name = name
|
202
|
-
% end
|
203
|
-
% if options[:descriptions] && !bit.description.empty?
|
204
|
-
<td class="<%= _bit_rw(bit) %>"><span title="<%= name %>"><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span></td>
|
205
|
-
% else
|
206
|
-
<td class="<%= _bit_rw(bit) %>"><span title="<%= name %>"><%= bit_name %></span></td>
|
207
|
-
% end
|
208
|
-
% else
|
209
|
-
<td class="<%= _bit_rw(bit) %>"></td>
|
210
|
-
% end
|
211
|
-
% else
|
212
|
-
<td class="not-writable"></td>
|
213
|
-
% end
|
214
|
-
% end
|
215
|
-
% end
|
216
|
-
% end
|
217
|
-
</tr>
|
218
|
-
|
219
|
-
% if options[:current_value]
|
220
|
-
<tr class="current_value">
|
221
|
-
<td class="heading">Current Value (Hex)</td>
|
222
|
-
% alignment_done = !order_is_lsb0
|
223
|
-
% reg.named_bits :include_spacers => true do |name, bit|
|
224
|
-
% if _bit_in_range?(bit, max_bit, min_bit)
|
225
|
-
% if max_bit > (reg.size - 1) && !alignment_done
|
226
|
-
% (max_bit - (reg.size - 1)).times do
|
227
|
-
<td class="spacer"></td>
|
228
|
-
% end
|
229
|
-
% alignment_done = true
|
230
|
-
% end
|
231
|
-
% if bit.size > 1
|
232
|
-
% if name
|
233
|
-
% if bit.nvm_dep != 0 || bit.data == :memory
|
234
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">M</td>
|
235
|
-
% elsif bit.data == :undefined
|
236
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">X</td>
|
237
|
-
% else
|
238
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>"><%= bit.data[_max_bit_in_range(bit, max_bit, min_bit).._min_bit_in_range(bit, max_bit, min_bit)].to_s(16).upcase %></td>
|
239
|
-
% end
|
240
|
-
% else
|
241
|
-
% bit.shift_out_left do |bit|
|
242
|
-
% if _index_in_range?(bit.position, max_bit, min_bit)
|
243
|
-
<td></td>
|
244
|
-
% end
|
245
|
-
% end
|
246
|
-
% end
|
247
|
-
% else
|
248
|
-
% if bit.nvm_dep != 0 || bit.reset_val == :memory
|
249
|
-
<td>M</td>
|
250
|
-
% elsif bit.data == :undefined
|
251
|
-
<td>X</td>
|
252
|
-
% else
|
253
|
-
<td><%= bit.data.to_s(16).upcase %></td>
|
254
|
-
% end
|
255
|
-
% end
|
256
|
-
% end
|
257
|
-
% end
|
258
|
-
</tr>
|
259
|
-
% else
|
260
|
-
%#############################################
|
261
|
-
%# Reset Row
|
262
|
-
%#############################################
|
263
|
-
<tr class="reset">
|
264
|
-
<td class="heading">Reset</td>
|
265
|
-
% alignment_done = false
|
266
|
-
% reg.named_bits :include_spacers => true do |name, bit|
|
267
|
-
% if _bit_in_range?(bit, max_bit, min_bit)
|
268
|
-
% if max_bit > (reg.size - 1) && !alignment_done
|
269
|
-
% (max_bit - (reg.size - 1)).times do
|
270
|
-
<td class="spacer"></td>
|
271
|
-
% end
|
272
|
-
% alignment_done = true
|
273
|
-
% end
|
274
|
-
% if bit.size > 1
|
275
|
-
% if name
|
276
|
-
% if bit.nvm_dep != 0 || bit.reset_val == :memory
|
277
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">M</td>
|
278
|
-
% elsif bit.reset_val == :undefined
|
279
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">X</td>
|
280
|
-
% else
|
281
|
-
<td colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>"><%= bit.reset_val[_max_bit_in_range(bit, max_bit, min_bit).._min_bit_in_range(bit, max_bit, min_bit)].to_s(16).upcase %></td>
|
282
|
-
% end
|
283
|
-
% else
|
284
|
-
% bit.shift_out_left do |bit|
|
285
|
-
% if _index_in_range?(bit.position, max_bit, min_bit)
|
286
|
-
<td></td>
|
287
|
-
% end
|
288
|
-
% end
|
289
|
-
% end
|
290
|
-
% else
|
291
|
-
% if bit.nvm_dep != 0 || bit.reset_val == :memory
|
292
|
-
<td>M</td>
|
293
|
-
% elsif bit.reset_val == :undefined
|
294
|
-
<td>X</td>
|
295
|
-
% else
|
296
|
-
<td><%= bit.reset_val.to_s(16).upcase %></td>
|
297
|
-
% end
|
298
|
-
% end
|
299
|
-
% end
|
300
|
-
% end
|
301
|
-
</tr>
|
302
|
-
% end
|
303
|
-
</tbody>
|
304
|
-
</table>
|
305
|
-
|
306
|
-
% end # Byte index loop
|
307
|
-
|
308
|
-
% if options[:descriptions] && reg.named_bits.any? { |name, bits| !bits.description.empty? }
|
309
|
-
<table class="bit-descriptions table table-condensed table-bordered" style="margin: 20px 0 0 0">
|
310
|
-
<thead>
|
311
|
-
<tr>
|
312
|
-
<th>Bit</th>
|
313
|
-
<th>Description</th>
|
314
|
-
</tr>
|
315
|
-
</thead>
|
316
|
-
<tbody>
|
317
|
-
% reg.named_bits do |name, bits|
|
318
|
-
<tr>
|
319
|
-
<td>
|
320
|
-
<p>
|
321
|
-
<a class="anchor" name="<%= "#{reg.name}_#{name}_#{bits.position}" %>"></a>
|
322
|
-
% if bits.size == 1
|
323
|
-
<%= bits.position %><%= order_is_lsb0 ? '' : "<span class="msb0_specific" style="color:gray;"> (#{reg.size - bits.position - 1})</span>" %>
|
324
|
-
% else
|
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>" %>
|
326
|
-
% end
|
327
|
-
</p>
|
328
|
-
<p>
|
329
|
-
% if bits.size == 1
|
330
|
-
<%= name %>
|
331
|
-
% else
|
332
|
-
<%= name %>[<%= bits.size - 1 %>:0]<%= order_is_lsb0 ? '' : "<span class="msb0_specific" style="color:gray;"> ([0:#{bits.size - 1}])</span>" %>
|
333
|
-
% end
|
334
|
-
</p>
|
335
|
-
</td>
|
336
|
-
<td markdown="1">
|
337
|
-
% bit_val_str = ''
|
338
|
-
% start_bit = bits.position
|
339
|
-
% end_bit = bits.position + bits.size - 1
|
340
|
-
% (start_bit..end_bit).each do |b|
|
341
|
-
% bit_val_str << reg.bits[b].data.to_s
|
342
|
-
% end
|
343
|
-
% bit_val_str.reverse!
|
344
|
-
% bits.description.each do |line|
|
345
|
-
% if options[:current_value]
|
346
|
-
% if line =~ /^\d{#{bit_val_str.length}}/
|
347
|
-
% if line =~ /^#{bit_val_str}/
|
348
|
-
<span style="background-color: #66FF66"> <%= line.gsub("\\'", "'") %>
|
349
|
-
</span><br/>
|
350
|
-
% else
|
351
|
-
<%= line.gsub("\\'", "'") %><br/>
|
352
|
-
% end
|
353
|
-
% else
|
354
|
-
<%= line.gsub("\\'", "'") %>
|
355
|
-
% end
|
356
|
-
% else
|
357
|
-
<%= line.gsub("\\'", "'") %>
|
358
|
-
% end
|
359
|
-
% end
|
360
|
-
|
361
|
-
</td>
|
362
|
-
</tr>
|
363
|
-
% end
|
364
|
-
</tbody>
|
365
|
-
</table>
|
366
|
-
% end
|
367
|
-
|
368
|
-
</div>
|