@@ -7,6 +7,8 @@ require "asciidoctor-diagram"
77
88require_relative "#{ $lib} /idl/passes/gen_adoc"
99
10+ puts "UPDATE: Inside profile_doc tasks.rake"
11+
1012PROFILE_DOC_DIR = Pathname . new "#{ $root} /backends/profile_doc"
1113
1214Dir . glob ( "#{ $root} /arch/profile_release/*.yaml" ) do |f |
@@ -22,29 +24,8 @@ Dir.glob("#{$root}/arch/profile_release/*.yaml") do |f|
2224 profile_names = profile_release_obj [ 'profiles' ] . map { |p | File . basename ( p [ '$ref' ] . split ( "#" ) [ 0 ] , ".yaml" ) }
2325 raise "Ill-formed profile release file #{ f } : can't parse profile names" if profile_names . nil?
2426
25- # Find maximum base across all profiles in the profile release.
26- max_base = nil
27- profile_names . each do |profile_name |
28- profile_pathname = "#{ $root} /arch/profile/#{ profile_name } .yaml"
29- profile_obj = YAML . load_file ( profile_pathname , permitted_classes : [ Date ] )
30- raise "Can't parse #{ profile_name } " if profile_obj . nil?
31-
32- base = profile_obj [ "base" ]
33- raise "Missing profile base in #{ profile } " if base . nil?
34-
35- puts "UPDATE: Extracted base=#{ base } from #{ f } "
36-
37- max_base = base if ( max_base . nil? || base > max_base )
38- end
39- raise "Couldn't find max_base in the profiles #{ profile_names } " if max_base . nil?
40- puts "UPDATE: Calculated max_base=#{ max_base } across profiles in #{ profile_release_name } "
41-
4227 profile_pathnames = profile_names . map { |profile_name | "#{ $root} /arch/profile/#{ profile_name } .yaml" }
4328
44- # Just go with maximum base since it is the most inclusive.
45- base = max_base
46- base_isa_name = "rv#{ base } "
47-
4829 file "#{ $root} /gen/profile_doc/adoc/#{ profile_release_name } .adoc" => [
4930 __FILE__ ,
5031 "#{ $root} /arch/profile_class/#{ profile_class_name } .yaml" ,
@@ -55,20 +36,23 @@ Dir.glob("#{$root}/arch/profile_release/*.yaml") do |f|
5536 "#{ $root} /lib/design.rb" ,
5637 "#{ PROFILE_DOC_DIR } /templates/profile.adoc.erb"
5738 ] . concat ( profile_pathnames ) do |t |
58- # Create Architecture object. Function located in top-level Rakefile.
59- puts "UPDATE: Creating Architecture #{ base_isa_name } for #{ t } "
60- arch = arch_for ( base_isa_name , base )
39+ # Ensure that unconfigured resolved architecture called "_" exists.
40+ Rake ::Task [ "#{ $root} /.stamps/resolve-_.stamp" ] . invoke
41+
42+ # Create architecture object so we can have it create the ProcCertModel.
43+ # Use the unconfigured resolved architecture called "_".
44+ arch = Architecture . new ( "RISC-V Architecture" , $root / "gen" / "resolved_arch" / "_" )
6145
6246 # Create PortfolioRelease for specific portfolio release as specified in its arch YAML file.
6347 # The Architecture object also creates all other portfolio-related class instances from their arch YAML files.
6448 # None of these objects are provided with a Design object when created.
65- puts "UPDATE: Creating Profile Release for #{ profile_release_name } using #{ base_isa_name } "
49+ puts "UPDATE: Creating Profile Release for #{ profile_release_name } "
6650 profile_release = arch . profile_release ( profile_release_name )
6751
68- puts "UPDATE: Creating PortfolioDesign using profile release #{ profile_release_name } "
6952 # Create the one PortfolioDesign object required for the ERB evaluation.
7053 # Provide it with all the profiles in this ProfileRelease.
71- portfolio_design = portfolio_design_for ( profile_release_name , arch , base , profile_release . profiles )
54+ puts "UPDATE: Creating PortfolioDesign using profile release #{ profile_release_name } "
55+ portfolio_design = PortfolioDesign . new ( profile_release_name , arch , profile_release . profiles )
7256
7357 # Create empty binding and then specify explicitly which variables the ERB template can access.
7458 # Seems to use this method name in stack backtraces (hence its name).
0 commit comments