Skip to content

Fix clobbering of saturation results #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backends/ext_pdf_doc/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ rule %r{#{$root}/gen/ext_pdf_doc/.*/pdf/.*_extension\.pdf} => proc { |tname|
"-v",
"-a toc",
"-a compress",
"-a pdf-theme=#{$root}/ext/docs-resources/themes/riscv-pdf.yml",
"-a pdf-fontsdir=#{$root}/ext/docs-resources/fonts",
"-a pdf-theme=#{$root}/cfgs/qc_iu/qc_theme.yml",
"-a pdf-fontsdir=#{$root}/cfgs/qc_iu/fonts",
"-a imagesdir=#{$root}/ext/docs-resources/images",
"-r asciidoctor-diagram",
"-r #{$root}/backends/ext_pdf_doc/idl_lexer",
Expand Down
82 changes: 58 additions & 24 deletions backends/ext_pdf_doc/templates/ext_pdf.adoc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
FROZEN_STATE
when "development"
<<~DEV_STATE
This document is in the http://riscv.org/spec-state[Development state].

Change should be expected
This document is in the http://riscv.org/spec-state[Development state]. + \\
+ \\
Change should be expected + \\
DEV_STATE
else
raise "TODO: #{ext_version["state"]} description"
Expand All @@ -37,11 +37,13 @@
:preface-title: Licensing and Acknowledgements
:colophon:
:appendix-caption: Appendix
<%- if ext.company["name"] =~ /RISCV/ -%>
:title-logo-image: image:risc-v_logo.png["RISC-V International Logo",pdfwidth=3.25in,align=center]
:back-cover-image: image:riscv-horizontal-color.svg[opacity=25%]
<%- end -%>
<%- unless ext_version["state"] == "ratified" -%>
:page-background-image: image:draft.png[opacity=20%]
<%- end -%>
:back-cover-image: image:riscv-horizontal-color.svg[opacity=25%]
// Settings
:experimental:
:reproducible:
Expand Down Expand Up @@ -121,7 +123,7 @@ endif::[]
== Copyright and license information
This document is released under the <%= ext.doc_license["url"] %>[<%= ext.doc_license["name"] %>].

Copyright <%= ext_version["ratification_date"].split("-")[0] %> by <%= ext.company["name"] %>.
Copyright <%= ext_version["ratification_date"].nil? ? Date.today.year : ext_version["ratification_date"].split("-")[0] %> by <%= ext.company["name"] %>.

[preface]
== Acknowledgements
Expand Down Expand Up @@ -152,23 +154,72 @@ Ratification Date:: <%= version["ratification_date"] %>
<%- if version.key?("url") -%>
Design document:: <%= version["url"] %>
<%- end -%>
<%- if version.key?("change") -%>
<%- if version.key?("changes") -%>
Changes::
<%= version["changes"] %>
<%- end -%>
<%- unless version["implies"].nil? || version["implies"].empty? -%>
Implies::
* <%= version["implies"].map { |name, version| "#{name} (#{version})" }.join("\n* ") %>
<%- end -%>
--
<%- end -%>


<<<
== Extension description

<%= ext.description %>

<%- unless ext.implies.nil? -%>
<%- ext.implies.each do |e| -%>
=== Sub-extensions
The following sub-extensions are defined:

<%- ext.implies.each do |sub_ext| -%>
==== <%= sub_ext.name %>

<%= arch_def.extension(sub_ext.name).description %>

<%- end -%>
<%- end -%>

<%- unless ext.instructions.empty? -%>
<<<
== Instruction summary

The following <%= ext.instructions.size %> instructions are added by this extension:

[%autowidth]
|===
| RV32 | RV64 | Mnemonic | Instruction | <%= ext.versions.map { |v| "v#{v["version"]}" }.join(" | ") %>

<%- ext.instructions.each do |i| -%>
| <%= i.rv32? ? "&#x2713;" : "" %>
| <%= i.rv64? ? "&#x2713;" : "" %>
| `<%= i.name %> <%= i.assembly.gsub("x", "r").strip %>`
| xref:insns-<%= i.name.gsub('.', '_') %>[<%= i.long_name %>]
| <%= ext.versions.map { |v| i.defined_by?(ext.name, v["version"]) ? "&#x2713;" : "" }.join(" | ") %>
<%- end -%>
|===

<%- unless ext.implies.empty? -%>
=== Instructions by sub-extension

[%autowidth]
|===
| Mnemonic | `<%= ext.name %>` | <%= ext.implies.map { |e| "`#{e.name}`" }.join(" | ") %>

<%- ext.instructions.each do |i| -%>
| `<%= i.name %>`
| &#x2713;
| <%= ext.implies.map { |e| i.defined_by?(e.name, arch_def.extension(e.name).max_version) ? "&#x2713;" : "" }.join(" | ") %>
<%- end -%>
|===

<%- end -%>

<%- end -%>

<%- unless ext.csrs.empty? -%>
<<<
== CSR summary
Expand Down Expand Up @@ -325,23 +376,6 @@ This CSR may return a value that is different from what is stored in hardware.
<%- end -%>

<%- unless ext.instructions.empty? -%>
<<<
== Instruction summary

The following <%= ext.instructions.size %> instructions are added by this extension:

[%autowidth]
|===
| RV32 | RV64 | Mnemonic | Instruction | <%= ext.versions.map { |v| "v#{v["version"]}" }.join(" | ") %>

<%- ext.instructions.each do |i| -%>
| <%= i.rv32? ? "&#x2713;" : "" %>
| <%= i.rv64? ? "&#x2713;" : "" %>
| `<%= i.name %> <%= i.assembly.gsub("x", "r") %>`
| xref:insns-<%= i.name.gsub('.', '_') %>[<%= i.long_name %>]
| <%= ext.versions.map { |v| i.defined_by?(ext.name, v["version"]) ? "&#x2713;" : "" }.join(" | ") %>
<%- end -%>
|===

<<<
[#insns,reftext="Instructions (in alphabetical order)"]
Expand Down
56 changes: 56 additions & 0 deletions cfgs/qc_iu/arch_overlay/csr/Xqciu/gen_mcliciX.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

require 'erb'

pend_template = <<~YAML
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json

mclicip<%= num %>:
long_name: IRQ Pending <%= num %>
address: 0x<%= (0x7f0 + num).to_s(16) %>
length: 32
priv_mode: M
definedBy: Xqciu
description: |
Pending bits for IRQs <%= num*32 %>-<%= (num + 1)*32 - 1 %>
fields:
<%- 32.times do |i| -%>
IRQ<%= num*32 + i %>:
type: RW
reset_value: 0
location: <%= i %>
description: IRQ<%= num*32 + 1 %> pending
<%- end -%>
YAML

en_template = <<~YAML
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json

mclicie<%= num %>:
long_name: IRQ Enable <%= num %>
address: 0x<%= (0x7f0 + num).to_s(16) %>
length: 32
priv_mode: M
definedBy: Xqciu
description: |
Enable bits for IRQs <%= num*32 %>-<%= (num + 1)*32 - 1 %>
fields:
<%- 32.times do |i| -%>
IRQ<%= num*32 + i %>:
type: RW
reset_value: 0
location: <%= i %>
description: IRQ<%= num*32 + 1 %> enabled
<%- end -%>
YAML

root = File.dirname(__FILE__)

erb = ERB.new(pend_template, trim_mode: '-')
8.times do |num|
File.write("#{root}/mclicip#{num}.yaml", erb.result(binding))
end

erb = ERB.new(en_template, trim_mode: '-')
8.times do |num|
File.write("#{root}/mclicie#{num}.yaml", erb.result(binding))
end
171 changes: 171 additions & 0 deletions cfgs/qc_iu/arch_overlay/csr/Xqciu/mclicie0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json

mclicie0:
long_name: IRQ Enable 0
address: 0x7f0
length: 32
priv_mode: M
definedBy: Xqciu
description: |
Enable bits for IRQs 0-31
fields:
IRQ0:
type: RW
reset_value: 0
location: 0
description: IRQ1 enabled
IRQ1:
type: RW
reset_value: 0
location: 1
description: IRQ1 enabled
IRQ2:
type: RW
reset_value: 0
location: 2
description: IRQ1 enabled
IRQ3:
type: RW
reset_value: 0
location: 3
description: IRQ1 enabled
IRQ4:
type: RW
reset_value: 0
location: 4
description: IRQ1 enabled
IRQ5:
type: RW
reset_value: 0
location: 5
description: IRQ1 enabled
IRQ6:
type: RW
reset_value: 0
location: 6
description: IRQ1 enabled
IRQ7:
type: RW
reset_value: 0
location: 7
description: IRQ1 enabled
IRQ8:
type: RW
reset_value: 0
location: 8
description: IRQ1 enabled
IRQ9:
type: RW
reset_value: 0
location: 9
description: IRQ1 enabled
IRQ10:
type: RW
reset_value: 0
location: 10
description: IRQ1 enabled
IRQ11:
type: RW
reset_value: 0
location: 11
description: IRQ1 enabled
IRQ12:
type: RW
reset_value: 0
location: 12
description: IRQ1 enabled
IRQ13:
type: RW
reset_value: 0
location: 13
description: IRQ1 enabled
IRQ14:
type: RW
reset_value: 0
location: 14
description: IRQ1 enabled
IRQ15:
type: RW
reset_value: 0
location: 15
description: IRQ1 enabled
IRQ16:
type: RW
reset_value: 0
location: 16
description: IRQ1 enabled
IRQ17:
type: RW
reset_value: 0
location: 17
description: IRQ1 enabled
IRQ18:
type: RW
reset_value: 0
location: 18
description: IRQ1 enabled
IRQ19:
type: RW
reset_value: 0
location: 19
description: IRQ1 enabled
IRQ20:
type: RW
reset_value: 0
location: 20
description: IRQ1 enabled
IRQ21:
type: RW
reset_value: 0
location: 21
description: IRQ1 enabled
IRQ22:
type: RW
reset_value: 0
location: 22
description: IRQ1 enabled
IRQ23:
type: RW
reset_value: 0
location: 23
description: IRQ1 enabled
IRQ24:
type: RW
reset_value: 0
location: 24
description: IRQ1 enabled
IRQ25:
type: RW
reset_value: 0
location: 25
description: IRQ1 enabled
IRQ26:
type: RW
reset_value: 0
location: 26
description: IRQ1 enabled
IRQ27:
type: RW
reset_value: 0
location: 27
description: IRQ1 enabled
IRQ28:
type: RW
reset_value: 0
location: 28
description: IRQ1 enabled
IRQ29:
type: RW
reset_value: 0
location: 29
description: IRQ1 enabled
IRQ30:
type: RW
reset_value: 0
location: 30
description: IRQ1 enabled
IRQ31:
type: RW
reset_value: 0
location: 31
description: IRQ1 enabled
Loading