Skip to content

Commit 017698d

Browse files
dhower-qcayosher
andauthored
Misc. fixes to generators and Xqci extensions fixes (#551)
* Xqci/Xqcibm extension: fix some representation issues, fix qc.extdur rs1 != 31 Signed-off-by: Albert Yosher <[email protected]> * Xqci: fix asciidoc formatting in description * gen:adoc fix asciidoc generation of IDL csr read * gen:ext_pdf fix implication list; improve version display * Add missing word 'CSRs' in CSR summary generation Signed-off-by: Albert Yosher <[email protected]> --------- Signed-off-by: Albert Yosher <[email protected]> Co-authored-by: Albert Yosher <[email protected]>
1 parent 563e930 commit 017698d

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

arch_overlay/qc_iu/ext/Xqci.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ versions:
242242
- Fix rs1 cannot be 31 for qc.extdu, qc.extd, qc.extdur, instructions
243243
- Fix rs1 cannot be 31 for qc.extduprh, qc.extdprh, qc.extdupr, qc.extdr qc.extdpr instructions
244244
- Fix typos in IDL code (missing ')' ) for qc.extdpr, qc.extdr instructions
245-
- Fix IDL code to look correct in PDF for qc.insbhr and qc.insbh instructions
245+
- Fix IDL code and description to look correct in PDF for qc.insbhr and qc.insbh instructions
246246
- Fix Xqci extension description to reflect correct 48-bit format field names
247247
- Fix IDL code to to match description for qc.insbr instruction
248248
- Add stack checks to qc.c.mienter, qc.c.mienter.nest, qc.c.mileaveret
@@ -330,7 +330,7 @@ description: |
330330
QC.EAI format used for 48-bit instructions that operate on 32-bit immediate argument.
331331
--
332332
333-
[%autowidth, cols="4*", options="header" }
333+
[%autowidth, cols="4*", options="header" ]
334334
|===
335335
^|Field
336336
^|Start bit
@@ -367,7 +367,7 @@ description: |
367367
QC.EI format used for 48-bit instructions that operate on 26-bit immediate argument, including loads.
368368
--
369369
370-
[%autowidth, cols="4*", options="header" }
370+
[%autowidth, cols="4*", options="header" ]
371371
|===
372372
^|Field
373373
^|Start bit
@@ -414,7 +414,7 @@ description: |
414414
QC.EB format used for 48-bit branch instructions that compare register with 16-bit immediate.
415415
--
416416
417-
[%autowidth, cols="4*", options="header" }
417+
[%autowidth, cols="4*", options="header" ]
418418
|===
419419
^|Field
420420
^|Start bit
@@ -461,7 +461,7 @@ description: |
461461
QC.EJ format used for 48-bit jump/call instructions with 32-bit immediate target address.
462462
--
463463
464-
[%autowidth, cols="4*", options="header" }
464+
[%autowidth, cols="4*", options="header" ]
465465
|===
466466
^|Field
467467
^|Start bit

arch_overlay/qc_iu/ext/Xqcibm.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ versions:
8585
- Fix rs1 cannot be 31 for qc.extdu, qc.extd, qc.extdur, instructions
8686
- Fix rs1 cannot be 31 for qc.extduprh, qc.extdprh, qc.extdupr, qc.extdr qc.extdpr instructions
8787
- Fix typos in IDL code (missing ')' ) for qc.extdpr, qc.extdr instructions
88-
- Fix IDL code to look correct in PDF for qc.insbhr and qc.insbh instructions
88+
- Fix IDL code and description to look correct in PDF for qc.insbhr and qc.insbh instructions
8989
- Fix IDL code to to match description for qc.insbr instruction
9090
requires: { name: Zca, version: ">= 1.0.0" }
9191
description: |

arch_overlay/qc_iu/inst/Xqci/qc.extdur.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ encoding:
2424
not: 0
2525
- name: rs1
2626
location: 19-15
27+
not: 31
2728
- name: rd
2829
location: 11-7
2930
not: 0

arch_overlay/qc_iu/inst/Xqci/qc.insbh.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: |
1212
higher part using QC32.INSBH.
1313
The width of the subset is determined by (`width_minus1` + 1) (1..32),
1414
and the offset of the subset is determined by `shamt`.
15-
In case when width + offset <= 32, the destination register is left unchanged.
15+
In case when width + offset < 33, the destination register is left unchanged.
1616
Instruction encoded in I instruction format.
1717
definedBy:
1818
anyOf:

arch_overlay/qc_iu/inst/Xqci/qc.insbhr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: |
1212
higher part using QC32.INSBHR.
1313
The width of the subset is determined by `rs2` bits [21:16] (0..32),
1414
and the offset of the subset is determined by `rs2` bits [4:0].
15-
In case when width + offset <= 32 or width == 0, the destination register is left unchanged.
15+
In case when width + offset < 33 or width == 0, the destination register is left unchanged.
1616
In case when `rs2` bit [21] == 1 width is enforced to 32.
1717
Instruction encoded in R instruction format.
1818
definedBy:

backends/ext_pdf_doc/templates/ext_pdf.adoc.erb

+6-3
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ This specification documents version <%= max_version.version_spec %> of <%= ext.
154154
=== Version History
155155

156156
<%- ext.versions.each do |version| -%>
157+
==== <%= version.version_spec %>
158+
157159
--
158-
Version:: <%= version.version_spec %>
159160
State:: <%= version.state %>
160161
<%- unless version.ratification_date.nil? -%>
161162
Ratification Date:: <%= version.ratification_date %>
@@ -173,7 +174,9 @@ Changes::
173174
<%- end -%>
174175
<%- unless version.implications.empty? -%>
175176
Implies::
176-
<%= version.implications.each { |i| "* #{i[:ext_ver].name} (#{i[:ext_ver].version_spec}) #{i[:cond].empty? ? '' : i[:cond].to_asciidoc(join: ', ')}" }.join("\n* ") %>
177+
178+
<%= version.implications.map { |i| " * #{i[:ext_ver].name} (#{i[:ext_ver].version_spec}) #{i[:cond].empty? ? '' : i[:cond].to_asciidoc(join: ', ')}" }.join("\n") %>
179+
177180
<%- unless version.requirement_condition.empty? -%>
178181
Requires::
179182
<%= version.requirement_condition.to_asciidoc %>
@@ -281,7 +284,7 @@ The following <%= ext.instructions.size %> instructions are affected by this ext
281284

282285
<%- csr_list = ext.csrs.select { |csr| versions.any? { |ext_ver| csr.affected_by?(ext_ver) } } -%>
283286

284-
The following <%= csr_list.size %> are affected by this extension.
287+
The following <%= csr_list.size %> CSRs are affected by this extension.
285288

286289
[%autowidth]
287290
|===

lib/idl/passes/gen_adoc.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,22 @@ def gen_adoc(indent = 0, indent_spaces: 2)
299299

300300
class CsrReadExpressionAst
301301
def gen_adoc(indent = 0, indent_spaces: 2)
302-
idx_text =
303-
if @idx.is_a?(AstNode)
304-
@idx.text_value
302+
idx =
303+
if @idx_expr.nil?
304+
@idx_text
305305
else
306-
@idx
306+
@idx_expr.gen_adoc(0)
307307
end
308308

309-
csr_text = "CSR[#{idx_text}]"
309+
csr_text = "CSR[#{idx}]"
310310
if idx_text =~ /[0-9]+/
311311
# we don't have the symtab to map this to a csr name
312312
"#{' '*indent}#{csr_text}"
313313
else
314314
if @cfg_arch.csr(csr_text).nil?
315315
"#{' '*indent}#{csr_text}"
316316
else
317-
"#{' '*indent}%%LINK%csr;#{idx_text};#{csr_text}%%"
317+
"#{' '*indent}%%LINK%csr;#{idx};#{csr_text}%%"
318318
end
319319
end
320320
end

0 commit comments

Comments
 (0)