2323 FROZEN_STATE
2424 when "development"
2525 <<~DEV_STATE
26- This document is in the http://riscv.org/spec-state[Development state].
27-
28- Change should be expected
26+ This document is in the http://riscv.org/spec-state[Development state]. + \\
27+ + \\
28+ Change should be expected + \\
2929 DEV_STATE
3030 else
3131 raise "TODO: #{ext_version["state"]} description"
3737:preface-title: Licensing and Acknowledgements
3838:colophon:
3939:appendix-caption: Appendix
40+ <%- if !ext.company.nil? && (ext.company["name"] =~ /RISCV/) -%>
4041:title-logo-image: image:risc-v_logo.png["RISC-V International Logo",pdfwidth=3.25in,align=center]
42+ :back-cover-image: image:riscv-horizontal-color.svg[opacity=25%]
43+ <%- end -%>
4144<%- unless ext_version["state"] == "ratified" -%>
4245:page-background-image: image:draft.png[opacity=20%]
4346<%- end -%>
44- :back-cover-image: image:riscv-horizontal-color.svg[opacity=25%]
4547// Settings
4648:experimental:
4749:reproducible:
@@ -121,7 +123,7 @@ endif::[]
121123== Copyright and license information
122124This document is released under the <%= ext.doc_license.nil? ? "unknown" : ext.doc_license["url"] %> [<%= ext.doc_license.nil? ? "unknown" : ext.doc_license["name"] %> ].
123125
124- Copyright <%= ext_version["ratification_date"].split("-")[0] %> by <%= ext.company.nil? ? "unknown" : ext.company["name"] %> .
126+ Copyright <%= ext_version["ratification_date"].nil? ? Date.today.year : ext_version["ratification_date"]. split("-")[0] %> by <%= ext.company.nil? ? "unknown" : ext.company["name"] %> .
125127
126128[preface]
127129== Acknowledgements
@@ -131,7 +133,8 @@ Contributors to version <%= version["version"] %> of the specification (in alpha
131133
132134<%- unless version["contributors"].nil? -%>
133135<%- version["contributors"].sort { |a, b| a["name"].split(" ").last <=> b["name"].split(" ").last }.each do |c| -%>
134- * <%= c["name"] %> <<%= c [ "email" ] %> > (<%= c [ "company" ] %> )
136+ * <%= c["name"] %> <<%= c [ "email" ] %> > (<%= c [ "company" ] %> )
137+
135138<%- end -%>
136139<%- end -%>
137140<%- end -%>
@@ -154,21 +157,69 @@ Ratification Date:: <%= version["ratification_date"] %>
154157<%- if version . key? ( "url" ) -%>
155158Design document:: <%= version [ "url" ] %>
156159<%- end -%>
157- <%- if version . key? ( "change " ) -%>
160+ <%- if version . key? ( "changes " ) -%>
158161Changes::
159162<%= version [ "changes" ] %>
160163<%- end -%>
164+ <%- unless version [ "implies" ] . nil? || version [ "implies" ] . empty? -%>
165+ Implies::
166+ * <%= version [ "implies" ] . map { |name , version | "#{ name } (#{ version } )" } . join ( "\n * " ) %>
167+ <%- end -%>
161168--
162169<%- end -%>
163170
171+
164172< < <
165173== Extension description
166174
167175<%= ext . description %>
168176
169177<%- unless ext . implies . nil? -%>
170- <%- ext . implies . each do |e | -%>
178+ === Sub-extensions
179+ The following sub-extensions are defined:
180+
181+ <%- ext . implies . each do |sub_ext | -%>
182+ ==== <%= sub_ext . name %>
183+
184+ <%= arch_def . extension ( sub_ext . name ) . description %>
185+
186+ <%- end -%>
187+ <%- end -%>
188+
189+ <%- unless ext . instructions . empty? -%>
190+ < < <
191+ == Instruction summary
192+
193+ The following <%= ext . instructions . size %> instructions are added by this extension:
194+
195+ [%autowidth]
196+ |===
197+ | RV32 | RV64 | Mnemonic | Instruction | <%= ext . versions . map { |v | "v#{ v [ "version" ] } " } . join ( " | " ) %>
198+
199+ <%- ext . instructions . each do |i | -%>
200+ | <%= i . rv32? ? "✓" : "" %>
201+ | <%= i . rv64? ? "✓" : "" %>
202+ | `<%= i . name %> <%= i . assembly . gsub ( "x" , "r" ) . strip %> `
203+ | xref:insns-<%= i . name . gsub ( '.' , '_' ) %> [<%= i . long_name %> ]
204+ | <%= ext . versions . map { |v | i . defined_by? ( ext . name , v [ "version" ] ) ? "✓" : "" } . join ( " | " ) %>
205+ <%- end -%>
206+ |===
207+
208+ <%- unless ext . implies . empty? -%>
209+ === Instructions by sub-extension
210+
211+ |===
212+ | Mnemonic | `<%= ext . name %> ` | <%= ext . implies . map { |e | "`#{ e . name } `" } . join ( " | " ) %>
213+
214+ <%- ext . instructions . each do |i | -%>
215+ | `<%= i . name %> `
216+ | ✓
217+ | <%= ext . implies . map { |e | i . defined_by? ( e . name , arch_def . extension ( e . name ) . max_version ) ? "✓" : "" } . join ( " | " ) %>
218+ <%- end -%>
219+ |===
220+
171221<%- end -%>
222+
172223<%- end -%>
173224
174225<%- unless ext . csrs . empty? -%>
@@ -327,24 +378,6 @@ This CSR may return a value that is different from what is stored in hardware.
327378<%- end -%>
328379
329380<%- unless ext . instructions . empty? -%>
330- < < <
331- == Instruction summary
332-
333- The following <%= ext . instructions . size %> instructions are added by this extension:
334-
335- [%autowidth]
336- |===
337- | RV32 | RV64 | Mnemonic | Instruction | <%= ext . versions . map { |v | "v#{ v [ "version" ] } " } . join ( " | " ) %>
338-
339- <%- ext . instructions . each do |i | -%>
340- | <%= i . rv32? ? "✓" : "" %>
341- | <%= i . rv64? ? "✓" : "" %>
342- | `<%= i . name %> <%= i . assembly . gsub ( "x" , "r" ) %> `
343- | xref:insns-<%= i . name . gsub ( '.' , '_' ) %> [<%= i . long_name %> ]
344- | <%= ext . versions . map { |v | i . defined_by? ( ext . name , v [ "version" ] ) ? "✓" : "" } . join ( " | " ) %>
345- <%- end -%>
346- |===
347-
348381< < <
349382[#insns,reftext="Instructions (in alphabetical order)"]
350383== Instructions (in alphabetical order)
@@ -387,8 +420,14 @@ RV64::
387420Description::
388421<%= i . description %>
389422
423+
390424Decode Variables::
391425
426+ <%- if i . multi_encoding? ? ( i . decode_variables ( 32 ) . empty? && i . decode_variables ( 64 ) . empty? ) : i . decode_variables ( i . base . nil? ? 64 : i . base ) . empty? -%>
427+
428+ <%= i . name %> has no decode variables.
429+
430+ <%- else -%>
392431<%- if i . multi_encoding? -%>
393432RV32::
394433+
@@ -414,7 +453,8 @@ RV64::
414453<%= d . sext? ? 'signed ' : '' %> Bits< <%= d . size %> > <%= d . name %> = <%= d . extract %> ;
415454<%- end -%>
416455----
417- <%- end -%>
456+ <%- end # if multi_encoding? -%>
457+ <%- end # if no decode variables-%>
418458
419459Operation::
420460<%- unless i.data["operation()"].nil? -%>
@@ -455,4 +495,4 @@ h| Arguments l| <%= f.arguments_list_str.join (', ') %>
455495----
456496<%- end -%>
457497
458- <%- end -%>
498+ <%- end -%>
0 commit comments