Skip to content

Commit c3ffda1

Browse files
Created portfolio backend with common tasks.rake code between portfolios. Also created include_erb method in PortfolioDesign that invokes ERB partial templates with a standard set of locals.
1 parent 7e83edf commit c3ffda1

File tree

19 files changed

+975
-69
lines changed

19 files changed

+975
-69
lines changed

.github/workflows/pages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ jobs:
6262
- name: Create RVA20 Profile Release PDF Spec
6363
run: ./do gen:profile_release_pdf[RVA20]
6464
- name: Copy RVA20 Profile Release PDF
65-
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVA20.pdf
65+
run: cp gen/profile/pdf/RVA20.pdf _site/pdfs/RVA20.pdf
6666
- name: Create RVA22 Profile Release PDF Spec
6767
run: ./do gen:profile_release_pdf[RVA22]
6868
- name: Copy RVA22 Profile Release PDF
69-
run: cp gen/profile_doc/pdf/RVA22.pdf _site/pdfs/RVA22.pdf
69+
run: cp gen/profile/pdf/RVA22.pdf _site/pdfs/RVA22.pdf
7070
- name: Copy RVA23 Profile Release PDF
71-
run: cp gen/profile_doc/pdf/RVA23.pdf _site/pdfs/RVA23.pdf
71+
run: cp gen/profile/pdf/RVA23.pdf _site/pdfs/RVA23.pdf
7272
- name: Copy RVB23 Profile Release PDF
73-
run: cp gen/profile_doc/pdf/RVB23.pdf _site/pdfs/RVB23.pdf
73+
run: cp gen/profile/pdf/RVB23.pdf _site/pdfs/RVB23.pdf
7474
- name: Create RVI20 Profile Release PDF Spec
7575
run: ./do gen:profile_release_pdf[RVI20]
7676
- name: Copy RVI20 Profile Release PDF
77-
run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVI20.pdf
77+
run: cp gen/profile/pdf/RVA20.pdf _site/pdfs/RVI20.pdf
7878
- name: Create MC100-32 PDF Spec
7979
run: ./do gen:proc_crd_pdf[MC100-32]
8080
- name: Copy MC100-32 PDF

Rakefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ namespace :test do
324324
Rake::Task["gen:html"].invoke("generic_rv64")
325325

326326
Rake::Task["#{$root}/gen/crd/pdf/MockProcCertModel.pdf"].invoke
327-
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
327+
Rake::Task["#{$root}/gen/profile/pdf/MockProfileRelease.pdf"].invoke
328328

329329
puts
330330
puts "Regression test PASSED"
@@ -350,7 +350,7 @@ task :portfolios do
350350
portfolio_start_msg("MockProcCertModel CRD")
351351
Rake::Task["#{$root}/gen/crd/pdf/MockProcCertModel.pdf"].invoke
352352
portfolio_start_msg("MockProfileRelease CRD")
353-
Rake::Task["#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"].invoke
353+
Rake::Task["#{$root}/gen/profile/pdf/MockProfileRelease.pdf"].invoke
354354
portfolio_start_msg("MC100-32 CRD")
355355
Rake::Task["#{$root}/gen/crd/pdf/MC100-32.pdf"].invoke
356356
portfolio_start_msg("MC100-64 CRD")
@@ -364,15 +364,15 @@ task :portfolios do
364364
portfolio_start_msg("MC300-64 CRD")
365365
Rake::Task["#{$root}/gen/crd/pdf/MC300-64.pdf"].invoke
366366
portfolio_start_msg("RVI20 Profile Release")
367-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVI20.pdf"].invoke
367+
Rake::Task["#{$root}/gen/profile/pdf/RVI20.pdf"].invoke
368368
portfolio_start_msg("RVA20 Profile Release")
369-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA20.pdf"].invoke
369+
Rake::Task["#{$root}/gen/profile/pdf/RVA20.pdf"].invoke
370370
portfolio_start_msg("RVA22 Profile Release")
371-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA22.pdf"].invoke
371+
Rake::Task["#{$root}/gen/profile/pdf/RVA22.pdf"].invoke
372372
portfolio_start_msg("RVA23 Profile Release")
373-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVA23.pdf"].invoke
373+
Rake::Task["#{$root}/gen/profile/pdf/RVA23.pdf"].invoke
374374
portfolio_start_msg("RVB23 Profile Release")
375-
Rake::Task["#{$root}/gen/profile_doc/pdf/RVB23.pdf"].invoke
375+
Rake::Task["#{$root}/gen/profile/pdf/RVB23.pdf"].invoke
376376
end
377377

378378
def portfolio_start_msg(name)
@@ -391,9 +391,9 @@ task "MC200-32": "#{$root}/gen/crd/pdf/MC200-32.pdf"
391391
task "MC200-64": "#{$root}/gen/crd/pdf/MC200-64.pdf"
392392
task "MC300-32": "#{$root}/gen/crd/pdf/MC300-32.pdf"
393393
task "MC300-64": "#{$root}/gen/crd/pdf/MC300-64.pdf"
394-
task "MockProfileRelease": "#{$root}/gen/profile_doc/pdf/MockProfileRelease.pdf"
395-
task "RVI20": "#{$root}/gen/profile_doc/pdf/RVI20.pdf"
396-
task "RVA20": "#{$root}/gen/profile_doc/pdf/RVA20.pdf"
397-
task "RVA22": "#{$root}/gen/profile_doc/pdf/RVA22.pdf"
398-
task "RVA23": "#{$root}/gen/profile_doc/pdf/RVA23.pdf"
399-
task "RVB23": "#{$root}/gen/profile_doc/pdf/RVB23.pdf"
394+
task "MockProfileRelease": "#{$root}/gen/profile/pdf/MockProfileRelease.pdf"
395+
task "RVI20": "#{$root}/gen/profile/pdf/RVI20.pdf"
396+
task "RVA20": "#{$root}/gen/profile/pdf/RVA20.pdf"
397+
task "RVA22": "#{$root}/gen/profile/pdf/RVA22.pdf"
398+
task "RVA23": "#{$root}/gen/profile/pdf/RVA23.pdf"
399+
task "RVB23": "#{$root}/gen/profile/pdf/RVB23.pdf"

backends/common_templates/adoc/README.adoc

Lines changed: 0 additions & 1 deletion
This file was deleted.

backends/crd/tasks.rake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,21 @@ Dir.glob("#{$root}/arch/proc_cert_model/*.yaml") do |f|
2929
# None of these objects are provided with a Design object when created.
3030
puts "UPDATE: Creating ProcCertModel for #{model_name}"
3131
proc_cert_model = arch.proc_cert_model(model_name)
32+
proc_cert_class = proc_cert_model.proc_cert_class
3233

3334
# Create the one PortfolioDesign object required for the ERB evaluation.
3435
puts "UPDATE: Creating PortfolioDesign using processor certificate model #{model_name}"
35-
portfolio_design = PortfolioDesign.new(model_name, arch, [proc_cert_model])
36+
portfolio_design = PortfolioDesign.new(model_name, arch, [proc_cert_model], proc_cert_class)
3637

3738
# Create empty binding and then specify explicitly which variables the ERB template can access.
3839
# Seems to use this method name in stack backtraces (hence its name).
3940
def evaluate_erb
4041
binding
4142
end
4243
erb_binding = evaluate_erb
43-
erb_binding.local_variable_set(:arch, arch)
44-
erb_binding.local_variable_set(:design, portfolio_design)
45-
erb_binding.local_variable_set(:proc_cert_class, proc_cert_model.proc_cert_class)
46-
erb_binding.local_variable_set(:portfolio_class, proc_cert_model.proc_cert_class)
44+
portfolio_design.init_erb_binding(erb_binding)
4745
erb_binding.local_variable_set(:proc_cert_model, proc_cert_model)
48-
erb_binding.local_variable_set(:portfolio, proc_cert_model)
46+
erb_binding.local_variable_set(:proc_cert_class, proc_cert_class)
4947

5048
pf_create_adoc("#{CERT_DOC_DIR}/templates/crd.adoc.erb", erb_binding, t.name, portfolio_design)
5149
end

backends/ext_pdf_doc/templates/ext_pdf.adoc.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ The following <%= ext.csrs.size %> are added by this extension.
287287
<%- ext.csrs.each do |csr| -%>
288288
<<<
289289
:leveloffset: +2
290-
<%= partial "adoc/csr.adoc.erb", { csr: csr, design: design } %>
290+
<%= partial("templates/csr.adoc.erb", { csr: csr, design: design }) %>
291291
:leveloffset: -2
292292
<%- end -%>
293293

@@ -300,7 +300,7 @@ The following <%= ext.csrs.size %> are added by this extension.
300300
301301
<%- ext.instructions.each do |i| -%>
302302
:leveloffset: +2
303-
<%= partial "adoc/inst.adoc.erb", { inst: i, design: design } %>
303+
<%= partial("templates/inst.adoc.erb", { inst: i, design: design }) %>
304304
:leveloffset: -2
305305
306306
<<<

backends/portfolio/README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This portfolio backend isn't a real backend.
2+
Instead, it contains common Rake code and ERB templates shared by multiple portfolio-based backends.
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains partial ERB templates shared by multiple portfolio-based backend.

0 commit comments

Comments
 (0)