origen_doc_helpers 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/boot.rb +19 -0
- data/config/version.rb +1 -1
- data/lib/origen_doc_helpers.rb +21 -1
- data/lib/origen_doc_helpers/flow_page_generator.rb +110 -0
- data/lib/{helpers.rb → origen_doc_helpers/helpers.rb} +0 -0
- data/lib/origen_doc_helpers/model_page_generator.rb +151 -0
- data/templates/flow_index.md.erb +19 -0
- data/templates/flow_page.md.erb +4 -0
- data/templates/model_index.md.erb +24 -0
- data/templates/model_page.md.erb +125 -0
- data/templates/shared/_register.html.erb +51 -7
- data/templates/shared/_searchable.html.erb +1 -1
- data/templates/shared/test/_flow.md.erb +3 -230
- data/templates/web/helpers.md.erb +25 -0
- data/templates/web/{examples → helpers}/disqus.md.erb +3 -3
- data/templates/web/helpers/flow.md.erb +113 -0
- data/templates/web/helpers/model.md.erb +81 -0
- data/templates/web/{examples → helpers}/register.md.erb +5 -5
- data/templates/web/{examples → helpers}/searchable/intro.md.erb +4 -4
- data/templates/web/{examples → helpers}/searchable/page2.md.erb +0 -0
- data/templates/web/{examples → helpers}/searchable/topic1/item1.md.erb +0 -0
- data/templates/web/{examples → helpers}/searchable/topic1/item2.html.erb +0 -0
- data/templates/web/{examples → helpers}/spec.md.erb_NOT_WORKING +2 -2
- data/templates/web/{examples → helpers}/yammer.md.erb +1 -1
- data/templates/web/index.md.erb +1 -1
- data/templates/web/layouts/_doc.html.erb +2 -2
- data/templates/web/layouts/{_examples.html.erb → _helpers.html.erb} +1 -1
- data/templates/web/partials/_navbar.html.erb +1 -1
- metadata +27 -26
- data/config/development.rb +0 -16
- data/config/environment.rb +0 -32
- data/lib/origen_doc_helpers/doc_interface.rb +0 -74
- data/program/_func.rb +0 -12
- data/program/_hvst.rb +0 -12
- data/program/_para.rb +0 -26
- data/program/probe_1.rb +0 -7
- data/templates/web/examples.md.erb +0 -20
- data/templates/web/examples/test/flow.md.erb +0 -35
@@ -5,10 +5,16 @@
|
|
5
5
|
<a class="anchor" name="<%= "#{reg.name}" %>"></a>
|
6
6
|
|
7
7
|
<a href='#<%= reg.name %>'>
|
8
|
+
% if options[:origen_path] && !options[:origen_path].empty?
|
9
|
+
% reg_path = options[:origen_path] + "." + reg.name.to_s
|
10
|
+
% reg_path = "#{reg.name} - #{reg_path}"
|
11
|
+
% else
|
12
|
+
% reg_path = reg.name
|
13
|
+
% end
|
8
14
|
% if reg.full_name
|
9
|
-
<h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg.full_name %> (<%=
|
15
|
+
<h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg.full_name %> (<%= reg_path %>)</h4>
|
10
16
|
% else
|
11
|
-
<h4>0x<%= reg.address.to_s(16).upcase %> - <%=
|
17
|
+
<h4>0x<%= reg.address.to_s(16).upcase %> - <%= reg_path %></h4>
|
12
18
|
% end
|
13
19
|
</a>
|
14
20
|
|
@@ -22,10 +28,11 @@
|
|
22
28
|
</div>
|
23
29
|
% end
|
24
30
|
|
25
|
-
% (reg.size / 8).
|
31
|
+
% num_bytes = (reg.size / 8.0).ceil
|
32
|
+
% num_bytes.times do |byte_index|
|
26
33
|
% # Need to add support for little endian regs here?
|
27
|
-
% byte_number =
|
28
|
-
% max_bit =
|
34
|
+
% byte_number = num_bytes - byte_index
|
35
|
+
% max_bit = (byte_number * 8) - 1
|
29
36
|
% min_bit = max_bit - 8 + 1
|
30
37
|
|
31
38
|
<table class="reg table table-condensed" style="margin-bottom: 0; table-layout: fixed;">
|
@@ -33,7 +40,12 @@
|
|
33
40
|
<tr class="bit-positions">
|
34
41
|
<th class="spacer"></th>
|
35
42
|
% 8.times do |i|
|
36
|
-
|
43
|
+
% bit_num = (byte_number * 8) - i - 1
|
44
|
+
% if bit_num > reg.size - 1
|
45
|
+
<th class="spacer"></th>
|
46
|
+
% else
|
47
|
+
<th class="bit-position"><%= bit_num %></th>
|
48
|
+
% end
|
37
49
|
% end
|
38
50
|
</tr>
|
39
51
|
</thead>
|
@@ -46,12 +58,21 @@
|
|
46
58
|
<td class="heading">R</td>
|
47
59
|
% reg.named_bits :include_spacers => true do |name, bit|
|
48
60
|
% if _bit_in_range?(bit, max_bit, min_bit)
|
61
|
+
% if max_bit > (reg.size - 1)
|
62
|
+
% (max_bit - (reg.size - 1)).times do
|
63
|
+
<td class="spacer"></td>
|
64
|
+
% end
|
65
|
+
% end
|
49
66
|
% if bit.size > 1
|
50
67
|
% if name
|
51
68
|
% if bit.readable?
|
52
69
|
% bit_name = "#{name}[#{bit.size - 1}:0]"
|
53
70
|
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">
|
71
|
+
% if options[:descriptions] && !bit.description.empty?
|
72
|
+
<span><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span>
|
73
|
+
% else
|
54
74
|
<span><%= bit_name %></span>
|
75
|
+
% end
|
55
76
|
</td>
|
56
77
|
% else
|
57
78
|
% if bit.access == :worz
|
@@ -72,7 +93,11 @@
|
|
72
93
|
% else
|
73
94
|
% if name
|
74
95
|
% if bit.readable?
|
96
|
+
% if options[:descriptions] && !bit.description.empty?
|
97
|
+
<td class="<%= _bit_rw(bit) %>"><span><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= name %></a></span></td>
|
98
|
+
% else
|
75
99
|
<td class="<%= _bit_rw(bit) %>"><span><%= name %></span></td>
|
100
|
+
% end
|
76
101
|
% else
|
77
102
|
<td class="<%= _bit_rw(bit) %>"></td>
|
78
103
|
% end
|
@@ -91,12 +116,21 @@
|
|
91
116
|
<td class="heading">W</td>
|
92
117
|
% reg.named_bits :include_spacers => true do |name, bit|
|
93
118
|
% if _bit_in_range?(bit, max_bit, min_bit)
|
119
|
+
% if max_bit > (reg.size - 1)
|
120
|
+
% (max_bit - (reg.size - 1)).times do
|
121
|
+
<td class="spacer"></td>
|
122
|
+
% end
|
123
|
+
% end
|
94
124
|
% if bit.size > 1
|
95
125
|
% if name
|
96
126
|
% if !bit.readable?
|
97
127
|
% bit_name = "#{name}[#{bit.size - 1}:0]"
|
98
128
|
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>">
|
129
|
+
% if options[:descriptions] && !bit.description.empty?
|
130
|
+
<span><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= bit_name %></a></span>
|
131
|
+
% else
|
99
132
|
<span><%= bit_name %></span>
|
133
|
+
% end
|
100
134
|
</td>
|
101
135
|
% else
|
102
136
|
<td class="<%= _bit_rw(bit) %>" colspan="<%= _num_bits_in_range(bit, max_bit, min_bit) %>"></td>
|
@@ -111,7 +145,11 @@
|
|
111
145
|
% else
|
112
146
|
% if name
|
113
147
|
% if !bit.readable?
|
148
|
+
% if options[:descriptions] && !bit.description.empty?
|
149
|
+
<td class="<%= _bit_rw(bit) %>"><span><a href="#<%= "#{reg.name}_#{name}_#{bit.position}" %>"><%= name %></a></span></td>
|
150
|
+
% else
|
114
151
|
<td class="<%= _bit_rw(bit) %>"><span><%= name %></span></td>
|
152
|
+
% end
|
115
153
|
% else
|
116
154
|
<td class="<%= _bit_rw(bit) %>"></td>
|
117
155
|
% end
|
@@ -130,6 +168,11 @@
|
|
130
168
|
<td class="heading">Reset</td>
|
131
169
|
% reg.named_bits :include_spacers => true do |name, bit|
|
132
170
|
% if _bit_in_range?(bit, max_bit, min_bit)
|
171
|
+
% if max_bit > (reg.size - 1)
|
172
|
+
% (max_bit - (reg.size - 1)).times do
|
173
|
+
<td class="spacer"></td>
|
174
|
+
% end
|
175
|
+
% end
|
133
176
|
% if bit.size > 1
|
134
177
|
% if name
|
135
178
|
% if bit.nvm_dep != 0 || bit.reset_val == :memory
|
@@ -164,7 +207,7 @@
|
|
164
207
|
|
165
208
|
% end # Byte index loop
|
166
209
|
|
167
|
-
% if options[:descriptions]
|
210
|
+
% if options[:descriptions] && reg.named_bits.any? { |name, bits| !bits.description.empty? }
|
168
211
|
<table class="bit-descriptions table table-condensed table-bordered" style="margin: 20px 0 0 0">
|
169
212
|
<thead>
|
170
213
|
<tr>
|
@@ -177,6 +220,7 @@
|
|
177
220
|
<tr>
|
178
221
|
<td>
|
179
222
|
<p>
|
223
|
+
<a class="anchor" name="<%= "#{reg.name}_#{name}_#{bits.position}" %>"></a>
|
180
224
|
% if bits.size == 1
|
181
225
|
<%= bits.position %>
|
182
226
|
% else
|
@@ -59,7 +59,7 @@
|
|
59
59
|
%# The markdown attribute is important if you are going to include content written
|
60
60
|
%# in markdown, without this is will be included verbatim
|
61
61
|
<div class="col-md-9 nav-page-container" markdown="1">
|
62
|
-
<article markdown="1">
|
62
|
+
<article markdown="1" class="search-results">
|
63
63
|
|
64
64
|
% found = options[:index].find{ |k,v| v.has_key?(_resolve_tab(options)) }
|
65
65
|
% topic_key = found ? found[0] : nil
|
@@ -4,9 +4,8 @@
|
|
4
4
|
% flows = options[:flow] || options[:flows]
|
5
5
|
% flows = flows ? [flows].flatten : nil
|
6
6
|
|
7
|
-
%
|
8
|
-
%
|
9
|
-
% program = OrigenTesters.program
|
7
|
+
% Origen.target.temporary = options[:target]
|
8
|
+
% program = OrigenTesters.program
|
10
9
|
|
11
10
|
<style>
|
12
11
|
.clickable { cursor: pointer }
|
@@ -19,6 +18,7 @@
|
|
19
18
|
.test-overview .panel-group { margin-bottom: 0; }
|
20
19
|
h4 .test-number { font-size: 14px; }
|
21
20
|
table tr th { text-align: left !important; }
|
21
|
+
.test-overview:last-child { border-bottom: none; }
|
22
22
|
</style>
|
23
23
|
|
24
24
|
<script type="text/javascript">
|
@@ -186,230 +186,3 @@
|
|
186
186
|
</div>
|
187
187
|
</div>
|
188
188
|
</div>
|
189
|
-
|
190
|
-
% # Legacy output based on Doc tester, abandon hope all ye who enter here...
|
191
|
-
% else
|
192
|
-
|
193
|
-
<div class="row">
|
194
|
-
%# The markdown attribute is important if you are going to include content written
|
195
|
-
%# in markdown, without this is will be included verbatim
|
196
|
-
%# One downside is that html cannot be indented here, otherwise it will be parsed
|
197
|
-
%# as a code block.
|
198
|
-
<div class="col-md-12" markdown="1">
|
199
|
-
<div class="panel-group" id="test_flow">
|
200
|
-
|
201
|
-
<a href="#_" class="expandcollapse btn btn-xs pull-right btn-default" state="0"><i class='fa fa-plus'></i></a>
|
202
|
-
|
203
|
-
<h2><%= options[:heading] %> <span style="font-size: 14px">(generated for target '<%= program.target %>')</span></h2>
|
204
|
-
|
205
|
-
% program.each_in_flow(flows, :context => options[:context]) do |t|
|
206
|
-
% type = t[:type]
|
207
|
-
% instances = t[:instance]
|
208
|
-
% i = instances
|
209
|
-
% flow = t[:flow]
|
210
|
-
% f = flow
|
211
|
-
% context = t[:context]
|
212
|
-
% c = context
|
213
|
-
% description = t[:description]
|
214
|
-
|
215
|
-
% if type == :label || type == :branch
|
216
|
-
% # Need to decide how to deal with label based jumps
|
217
|
-
|
218
|
-
% elsif type == :section_start
|
219
|
-
|
220
|
-
<%= _stop_test_flow_table %>
|
221
|
-
<%= _start_accordion(description.first) %>
|
222
|
-
|
223
|
-
% description.each_with_index do |line, ix|
|
224
|
-
% unless ix == 0
|
225
|
-
<%= line %>
|
226
|
-
% end
|
227
|
-
% end
|
228
|
-
|
229
|
-
% elsif type == :section_stop
|
230
|
-
|
231
|
-
<%= _stop_test_flow_table %>
|
232
|
-
<%= _stop_accordion %>
|
233
|
-
|
234
|
-
% else
|
235
|
-
|
236
|
-
% unless flow[:name] == "power_cycle_ti"
|
237
|
-
<%= _start_test_flow_table %>
|
238
|
-
|
239
|
-
<tr>
|
240
|
-
<td class="col1">
|
241
|
-
<a class="anchor" name="<%= "#{_test_name(t)}_#{_test_number(t)}" %>"></a>
|
242
|
-
<div><%= _test_to_local_link(t) %></div>
|
243
|
-
|
244
|
-
% if f[:id]
|
245
|
-
% dependents = program.dependents_of(f[:id], flows, :context => options[:context])
|
246
|
-
% unless dependents.empty?
|
247
|
-
<div class="alert alert-info">
|
248
|
-
% if dependents[:if_failed]
|
249
|
-
<p><strong>Note</strong>
|
250
|
-
- This test does not bin out as later tests are dependent on it.
|
251
|
-
</p>
|
252
|
-
<p>These tests will run if this test FAILS:
|
253
|
-
<ul>
|
254
|
-
% dependents[:if_failed].each do |dependent|
|
255
|
-
<li><%= _test_to_local_link(dependent) %></li>
|
256
|
-
% end
|
257
|
-
</ul></p>
|
258
|
-
% end
|
259
|
-
% if dependents[:if_passed]
|
260
|
-
<p><strong>Note</strong>
|
261
|
-
- This test does not bin out as later tests are dependent on it.
|
262
|
-
</p>
|
263
|
-
<p>These tests will run if this test PASSES:
|
264
|
-
<ul>
|
265
|
-
% dependents[:if_passed].each do |dependent|
|
266
|
-
<li><%= _test_to_local_link(dependent) %></li>
|
267
|
-
% end
|
268
|
-
</ul></p>
|
269
|
-
% end
|
270
|
-
% if dependents[:if_ran]
|
271
|
-
<p><strong>Note</strong> - These tests will run if this test RUNS:
|
272
|
-
<ul>
|
273
|
-
<ul>
|
274
|
-
% dependents[:if_ran].each do |dependent|
|
275
|
-
<li><%= _test_to_local_link(dependent) %></li>
|
276
|
-
% end
|
277
|
-
</ul></p>
|
278
|
-
% end
|
279
|
-
% if dependents[:unless_ran]
|
280
|
-
<p><strong>Note</strong> - These tests will run if this test DOES NOT RUN:
|
281
|
-
<ul>
|
282
|
-
% dependents[:unless_ran].each do |dependent|
|
283
|
-
<li><%= _test_to_local_link(dependent) %></li>
|
284
|
-
% end
|
285
|
-
</ul></p>
|
286
|
-
% end
|
287
|
-
</div>
|
288
|
-
% end
|
289
|
-
% end
|
290
|
-
|
291
|
-
% if c[:if_enable]
|
292
|
-
<div class="alert alert-success">
|
293
|
-
<strong>Note</strong>
|
294
|
-
- This test will only run when '<%= c[:if_enable] %>' is enabled.
|
295
|
-
</div>
|
296
|
-
% end
|
297
|
-
|
298
|
-
% if c[:unless_enable]
|
299
|
-
<div class="alert alert-success">
|
300
|
-
<strong>Note</strong>
|
301
|
-
- This test will NOT run when '<%= c[:unless_enable] %>' is enabled.
|
302
|
-
</div>
|
303
|
-
% end
|
304
|
-
|
305
|
-
% if f[:continue]
|
306
|
-
<div class="alert alert-danger">
|
307
|
-
<strong>Warning!</strong>
|
308
|
-
- This test does not bin out when failed.
|
309
|
-
</div>
|
310
|
-
% end
|
311
|
-
|
312
|
-
% if c[:if_passed]
|
313
|
-
<div class="alert alert-success">
|
314
|
-
<p><strong>Note</strong>
|
315
|
-
- This test will only run if this test PASSED:
|
316
|
-
<ul><li><%= _test_to_local_link(program.find_by_id(c[:if_passed], flows, :context => options[:context])) %></li></ul>
|
317
|
-
</p>
|
318
|
-
</div>
|
319
|
-
% end
|
320
|
-
|
321
|
-
% if c[:if_failed]
|
322
|
-
<div class="alert alert-success">
|
323
|
-
<p><strong>Note</strong>
|
324
|
-
- This test will only run if this test FAILED:
|
325
|
-
<ul><li><%= _test_to_local_link(program.find_by_id(c[:if_failed], flows, :context => options[:context])) %></li></ul>
|
326
|
-
</p>
|
327
|
-
</div>
|
328
|
-
% end
|
329
|
-
|
330
|
-
% if c[:if_ran]
|
331
|
-
<div class="alert alert-success">
|
332
|
-
<p><strong>Note</strong>
|
333
|
-
- This test will only run if this test RAN:
|
334
|
-
<ul><li><%= _test_to_local_link(program.find_by_id(c[:if_ran], flows, :context => options[:context])) %></li></ul>
|
335
|
-
</p>
|
336
|
-
</div>
|
337
|
-
% end
|
338
|
-
|
339
|
-
% if c[:unless_ran]
|
340
|
-
<div class="alert alert-success">
|
341
|
-
<p><strong>Note</strong>
|
342
|
-
- This test will only run if this test DID NOT RUN:
|
343
|
-
<ul><li><%= _test_to_local_link(program.find_by_id(c[:unless_ran], flows, :context => options[:context])) %></li></ul>
|
344
|
-
</p>
|
345
|
-
</div>
|
346
|
-
% end
|
347
|
-
|
348
|
-
|
349
|
-
</td>
|
350
|
-
<td class="col2">#<%= _test_number(t) %></td>
|
351
|
-
<td class="col3">B<%= _bin_number(t) %></td>
|
352
|
-
<td class="col4">B<%= _sbin_number(t) %></td>
|
353
|
-
<td class="col5 attributes" markdown="1">
|
354
|
-
|
355
|
-
% instances.each_with_index do |instance, i|
|
356
|
-
% if i > 0
|
357
|
-
|
358
|
-
***
|
359
|
-
|
360
|
-
% end
|
361
|
-
% instance.each do |key, val|
|
362
|
-
% unless [:patterns, :pattern, :by_block, :name, :id].include?(key)
|
363
|
-
%# if val.is_a?(Numeric)
|
364
|
-
%# if val > 1000000
|
365
|
-
%# val =
|
366
|
-
%# if val > 1000000
|
367
|
-
%# end
|
368
|
-
* **<%= key.to_s.capitalize.gsub("_", " ") %>**: <%= val %>
|
369
|
-
% end
|
370
|
-
% end
|
371
|
-
% patterns = [instance[:pattern], instance[:patterns]].flatten.compact
|
372
|
-
% unless patterns.empty?
|
373
|
-
% if options[:link_to_pattern_docs]
|
374
|
-
|
375
|
-
<div class="pattern-links">
|
376
|
-
% patterns.each_with_index do |pattern, i|
|
377
|
-
% if patterns.size > 1
|
378
|
-
% txt = "Pattern #{i}"
|
379
|
-
% else
|
380
|
-
% txt = "Pattern"
|
381
|
-
% end
|
382
|
-
<a href="<%= path "/patterns/#{pattern}" %>" role="button" class="btn btn-primary btn-small"><%= txt %></a>
|
383
|
-
% end
|
384
|
-
</div>
|
385
|
-
% else
|
386
|
-
* **Patterns**:
|
387
|
-
% patterns.each_with_index do |pattern, i|
|
388
|
-
* <%= pattern %>
|
389
|
-
% end
|
390
|
-
|
391
|
-
% end
|
392
|
-
%
|
393
|
-
% end
|
394
|
-
% end
|
395
|
-
</td>
|
396
|
-
|
397
|
-
<td class="col6" markdown="1">
|
398
|
-
|
399
|
-
% description.each do |line|
|
400
|
-
<%= line %>
|
401
|
-
% end
|
402
|
-
|
403
|
-
</td>
|
404
|
-
</tr>
|
405
|
-
% end
|
406
|
-
% end
|
407
|
-
% end
|
408
|
-
|
409
|
-
<%= _stop_test_flow_table %>
|
410
|
-
|
411
|
-
</div>
|
412
|
-
</div>
|
413
|
-
</div>
|
414
|
-
|
415
|
-
% end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
% render "layouts/basic.html", :tab => :helpers do
|
2
|
+
|
3
|
+
# Available Helpers
|
4
|
+
|
5
|
+
These are the helpers currently provided by this plugin, click the helper of
|
6
|
+
of interest to see a live example of it and the required application code to use it.
|
7
|
+
|
8
|
+
### Complete Web Pages
|
9
|
+
|
10
|
+
These helpers will generate complete web pages for you.
|
11
|
+
|
12
|
+
[Model Documentation](<%= path "/helpers/model" %>) | Create a reference manual style set of doc pages for a given model, including full register descriptions
|
13
|
+
[Test Program Flow](<%= path "/helpers/flow" %>) | Create documentation for a test program flow that has been created using Origen Testers
|
14
|
+
|
15
|
+
### Components
|
16
|
+
|
17
|
+
The following are components that you can embed within your own web pages.
|
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)
|
20
|
+
| [Register Descriptions](<%= path "/helpers/register" %>) | Create a tabular register view, similar to that used in device reference manuals
|
21
|
+
| [Yammer Comments](<%= path "/helpers/yammer" %>) | Embed a comments section at the bottom of your page using Yammer
|
22
|
+
| [Disqus Comments](<%= path "/helpers/disqus" %>) | Embed a comments section at the bottom of your page using Disqus
|
23
|
+
|
24
|
+
|
25
|
+
% end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
% render "../layouts/
|
1
|
+
% render "../layouts/helpers.html" do
|
2
2
|
|
3
3
|
# Disqus Comments
|
4
4
|
|
5
5
|
These helpers make it easy to drop a [Disqus](https://disqus.com/) comments section at the
|
6
|
-
bottom of your pages, just like [the one below](<%= path "
|
6
|
+
bottom of your pages, just like [the one below](<%= path "helpers/disqus/#Comments" %>).
|
7
7
|
|
8
8
|
Note that such comments will be externally visible and therefore **this should not be used for
|
9
9
|
company internal applications/web pages**. For similar functionality within a company you
|
10
|
-
can use [Yammer comments](<%= path "
|
10
|
+
can use [Yammer comments](<%= path "helpers/yammer" %>) instead if your company uses the
|
11
11
|
Office 365 suite.
|
12
12
|
|
13
13
|
## Community Selection
|
@@ -0,0 +1,113 @@
|
|
1
|
+
% render "../layouts/helpers.html" do
|
2
|
+
|
3
|
+
# Test Program Flow Documentation
|
4
|
+
|
5
|
+
This helper will build a web page to document a test program flow the has been created with Origen.
|
6
|
+
|
7
|
+
[Here is an example](http://origen-sdk.org/link_demo/flows/probe_1_flow/).
|
8
|
+
|
9
|
+
Multiple flows can be supplied and an [index page like this](http://origen-sdk.org/link_demo/flows)
|
10
|
+
is generated to help locate the documentation for a given flow.
|
11
|
+
|
12
|
+
## How To Use
|
13
|
+
|
14
|
+
Call the helper from an <code>after_web_site_compile</code> callback handler in your
|
15
|
+
application's <code>config/application.rb</code> like this:
|
16
|
+
|
17
|
+
~~~ruby
|
18
|
+
def after_web_site_compile(options)
|
19
|
+
# First build the program to create a flow model
|
20
|
+
Origen.app.runner.launch action: :program, files: "program/probe1.rb"
|
21
|
+
# Then the documentation for it
|
22
|
+
OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
|
23
|
+
d.page flow: :probe1,
|
24
|
+
name: "Probe 1 Flow",
|
25
|
+
target: "default.rb"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
~~~
|
29
|
+
|
30
|
+
Pages for multiple flows can be created like this:
|
31
|
+
|
32
|
+
~~~ruby
|
33
|
+
def after_web_site_compile(options)
|
34
|
+
# First build the program to create a flow model
|
35
|
+
Origen.app.runner.launch action: :program, files: "program/production.list"
|
36
|
+
# Then the documentation for it
|
37
|
+
OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
|
38
|
+
d.page flow: :probe1,
|
39
|
+
name: "Probe 1 Flow",
|
40
|
+
target: "default.rb"
|
41
|
+
d.page flow: :probe2,
|
42
|
+
name: "Probe 2 Flow",
|
43
|
+
target: "default.rb"
|
44
|
+
d.page flow: :ft,
|
45
|
+
name: "Final Test Flow",
|
46
|
+
target: "default.rb"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
~~~
|
50
|
+
|
51
|
+
Multiple flows can be included on the one page like this:
|
52
|
+
|
53
|
+
~~~ruby
|
54
|
+
def after_web_site_compile(options)
|
55
|
+
# First build the program to create a flow model
|
56
|
+
Origen.app.runner.launch action: :program, files: "program/production.list"
|
57
|
+
# Then the documentation for it
|
58
|
+
OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
|
59
|
+
d.page flows: [:probe1_start, :probe1_middle, :probe1_end],
|
60
|
+
name: "Probe 1 Flow",
|
61
|
+
target: "default.rb"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
~~~
|
65
|
+
|
66
|
+
Or finally the same flow can be documented as generated for different targets:
|
67
|
+
|
68
|
+
~~~ruby
|
69
|
+
def after_web_site_compile(options)
|
70
|
+
# First build the program to create a flow model
|
71
|
+
Origen.target.loop targets: ["device_a", "device_b"] do
|
72
|
+
Origen.app.runner.launch action: :program, files: "program/production.list"
|
73
|
+
end
|
74
|
+
# Then the documentation for it
|
75
|
+
OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
|
76
|
+
["device_a", "device_b"].each do |target|
|
77
|
+
d.page flows: [:probe1_start, :probe1_middle, :probe1_end],
|
78
|
+
name: "Probe 1 Flow",
|
79
|
+
target: target
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
~~~
|
84
|
+
|
85
|
+
## Options
|
86
|
+
|
87
|
+
<code>OrigenDocHelpers.generate_flow_docs</code>
|
88
|
+
|
89
|
+
* <code>:layout</code> - **Required**, supply a full path to your application's layout file
|
90
|
+
* Any other options will be passed to your layout file unmodified, e.g. to set the tab in the generated
|
91
|
+
pages in the above example
|
92
|
+
|
93
|
+
<code>page</code>
|
94
|
+
|
95
|
+
* <code>:flow(s)</code> - **Required**, the ID of the flow or flows to run, this is the ID that would be referenced when running <code>origen testers:run FLOW_ID</code>
|
96
|
+
* <code>:name</code> - **Required**, the name of the given flow
|
97
|
+
* <code>:target</code> - **Required**, the name of the target that has been used to generate the program model
|
98
|
+
* <code>:group</code> - Optional, a heading to group similar flows under on the index page, e.g. "Production", "In Development"
|
99
|
+
* <code>:context</code> - Optional, a hash of flow runtime conditions, similar to that accepted by <code>origen testers:run</code>, e.g. <code>{ job: "P1" }</code>. This will determine what tests are included in the documentation.
|
100
|
+
|
101
|
+
## Website Integration
|
102
|
+
|
103
|
+
The flows index page will be generated at path <code>/flows</code> within your application, and it is common
|
104
|
+
to create a "Flows(s)" tab in your website's navigation bar to link to this.
|
105
|
+
|
106
|
+
If your application only has one flow, then the navbar link should be setup to point directly to
|
107
|
+
that flows's page.
|
108
|
+
|
109
|
+
The location of the pages for the individual flows are based on the flow name and will be unique to each application,
|
110
|
+
you can find them initially via the index page.
|
111
|
+
|
112
|
+
|
113
|
+
% end
|