diff --git a/backends/ext_pdf_doc/templates/ext_pdf.adoc.erb b/backends/ext_pdf_doc/templates/ext_pdf.adoc.erb index 4abd27c6c9..bcc0b93859 100644 --- a/backends/ext_pdf_doc/templates/ext_pdf.adoc.erb +++ b/backends/ext_pdf_doc/templates/ext_pdf.adoc.erb @@ -31,7 +31,7 @@ raise "TODO: #{ext_version["state"]} description" end %> -:company: <%= ext.company["name"] %> +:company: <%= ext.company.nil? ? "unknown" : ext.company["name"] %> :url-riscv: https://riscv.org :doctype: book :preface-title: Licensing and Acknowledgements @@ -119,9 +119,9 @@ endif::[] [preface] == Copyright and license information -This document is released under the <%= ext.doc_license["url"] %>[<%= ext.doc_license["name"] %>]. +This document is released under the <%= ext.doc_license.nil? ? "unknown" : ext.doc_license["url"] %>[<%= ext.doc_license.nil? ? "unknown" : ext.doc_license["name"] %>]. -Copyright <%= ext_version["ratification_date"].split("-")[0] %> by <%= ext.company["name"] %>. +Copyright <%= ext_version["ratification_date"].split("-")[0] %> by <%= ext.company.nil? ? "unknown" : ext.company["name"] %>. [preface] == Acknowledgements @@ -129,10 +129,12 @@ Copyright <%= ext_version["ratification_date"].split("-")[0] %> by <%= ext.compa <%- ext.versions.each do |version| -%> Contributors to version <%= version["version"] %> of the specification (in alphabetical order) include: + +<%- unless version["contributors"].nil? -%> <%- version["contributors"].sort { |a, b| a["name"].split(" ").last <=> b["name"].split(" ").last }.each do |c| -%> * <%= c["name"] %> <<%= c["email"] %>> (<%= c["company"] %>) <%- end -%> <%- end -%> +<%- end -%> We express our gratitude to everyone that contributed to, reviewed or improved this specification through their comments and questions. @@ -252,7 +254,7 @@ This CSR format changes dynamically. <%- csr.fields.each do |field| -%> | xref:<%=csr.name%>-<%=field.name%>-def[`<%= field.name %>`] | <%= field.location_pretty(arch_def) %> -| <%= field.type_pretty(arch_def) %> +| <%= field.type_pretty(arch_def.symtab) %> | <%= field.reset_value_pretty(arch_def) %> <%- end -%> @@ -278,7 +280,7 @@ Description:: <%= field.description %> Type:: -<%= field.type_pretty(arch_def) %> +<%= field.type_pretty(arch_def.symtab) %> Reset value:: <%= field.reset_value_pretty(arch_def) %> @@ -315,7 +317,7 @@ This CSR may return a value that is different from what is stored in hardware. [source,idl,subs="specialchars,macros"] ---- -<%= csr.sw_read_ast(arch_def.idl_compiler).gen_adoc %> +<%= csr.sw_read_ast(arch_def.symtab).gen_adoc %> ---- <%- end -%> @@ -415,22 +417,18 @@ RV64:: <%- end -%> Operation:: +<%- unless i.data["operation()"].nil? -%> [source,idl,subs="specialchars,macros"] ---- -<%= i.operation_ast(arch_def.idl_compiler).gen_adoc %> +<%= i.operation_ast(arch_def.symtab).gen_adoc %> ---- +<%- end -%> Included in:: -[%header,cols="4,2"] -|=== -|Extension -|Minimum version -<%- i.defined_by.each do |ext_req| -%> -|<%= ext_req.name %> -|<%= ext_req.version_requirement %> -<%- end -%> -|=== +<%= i.defined_by.to_asciidoc %> + + <<< <%- end -%> <%- end -%> @@ -438,7 +436,7 @@ Included in:: <<< == IDL Functions -<%- ext.reachable_functions_unevaluated.sort { |a,b| a.name <=> b.name }.each do |f| -%> +<%- ext.reachable_functions(arch_def.symtab).sort { |a,b| a.name <=> b.name }.each do |f| -%> [#<%= f.name %>-func-def] === <%= f.name %><%- if f.builtin? -%> (builtin)<%- end -%> diff --git a/lib/arch_obj_models/extension.rb b/lib/arch_obj_models/extension.rb index 994594a28e..a03c5d3f01 100644 --- a/lib/arch_obj_models/extension.rb +++ b/lib/arch_obj_models/extension.rb @@ -256,11 +256,11 @@ def reachable_functions_unevaluated funcs = [] instructions.each do |inst| - funcs += inst.operation_ast(arch_def.idl_compiler).reachable_functions_unevaluated(arch_def) + funcs += inst.operation_ast(arch_def.symtab).reachable_functions(arch_def.symtab) end csrs.each do |csr| - funcs += csr.reachable_functions_unevaluated(arch_def) + funcs += csr.reachable_functions(arch_def) end @reachable_functions_unevaluated = funcs.uniq(&:name)