Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue-276-retire-MC-1…
Browse files Browse the repository at this point in the history
…-Google-Doc
  • Loading branch information
james-ball-qualcomm committed Dec 20, 2024
2 parents 5304322 + 4d8b28a commit 11f8174
Show file tree
Hide file tree
Showing 26 changed files with 251 additions and 115 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ concurrency:
jobs:
pages:
runs-on: ubuntu-latest
env:
SINGULARITY: 1
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
3 changes: 2 additions & 1 deletion arch/csr/menvcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ name: menvcfg
address: 0x30A
long_name: Machine Environment Configuration
description: |
Contains bits to enable/disable extensions
Contains fields that control certain characteristics of the execution environment
for modes less privileged than M-mode.
The `menvcfg` CSR controls
certain characteristics of the execution environment for modes less
Expand Down
7 changes: 4 additions & 3 deletions arch/csr/senvcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ kind: csr
name: senvcfg
address: 0x10A
long_name: Supervisor Environment Configuration
description: Contains bits to enable/disable extensions
description: |
Contains fields that control certain characteristics of the U-mode execution environment.
priv_mode: S
length: 64
definedBy:
allOf:
- name: Sm
version: ">=1.12"
- name: S
version: ">=1.12"
- name: U
fields:
CBZE:
location: 7
Expand Down
18 changes: 12 additions & 6 deletions arch/ext/S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ name: S
type: privileged
long_name: Supervisor mode
versions:
- version: "1.12.0"
state: ratified
ratification_date: 2021-12
requires:
name: U
version: "= 1.12.0"
- version: "1.11.0"
state: ratified
ratification_date: 2019-06
requires:
name: U
version: "= 1.0.0"
- version: "1.12.0"
state: ratified
ratification_date: 2021-12
requires:
name: U
version: "= 1.0.0"
description: |
This chapter describes the RISC-V supervisor-level architecture, which
contains a common core that is used with various supervisor-level
Expand Down
1 change: 1 addition & 0 deletions arch/ext/Sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ params:
schema:
type: string
enum: [little, big, dynamic]
# TODO: Only little available in Sm 1.11
MISA_CSR_IMPLEMENTED:
description: |
Whether or not the `misa` CSR returns zero or a non-zero value.
Expand Down
4 changes: 2 additions & 2 deletions arch/ext/Sstc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
$schema: "ext_schema.json#"
kind: extension
name: Sstc
long_name: Superivisor mode timer interrupts
description: Superivisor mode timer interrupts
long_name: Supervisor-mode timer interrupts
description: Supervisor-mode timer interrupts
type: privileged
versions:
- version: "0.9.0"
Expand Down
2 changes: 1 addition & 1 deletion arch/ext/Sv32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ type: privileged
versions:
- version: "1.12.0"
state: ratified
ratification_date: unknown
ratification_date: null
url: https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf
2 changes: 1 addition & 1 deletion arch/ext/Sv39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ type: privileged
versions:
- version: "1.12.0"
state: ratified
ratification_date: unknown
ratification_date: null
url: https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf
2 changes: 1 addition & 1 deletion arch/ext/Sv48.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type: privileged
versions:
- version: "1.12.0"
state: ratified
ratification_date: unknown
ratification_date: null
url: https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf
requires:
name: Sv39
Expand Down
2 changes: 1 addition & 1 deletion arch/ext/Sv57.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type: privileged
versions:
- version: "1.12.0"
state: ratified
ratification_date: unknown
ratification_date: null
url: https://github.com/riscv/riscv-isa-manual/releases/download/Priv-v1.12/riscv-privileged-20211203.pdf
requires:
name: Sv48
Expand Down
12 changes: 7 additions & 5 deletions arch/ext/U.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
$schema: "ext_schema.json#"
kind: extension
name: U
long_name: User-level privilege mode
description: User-level privilege mode
long_name: User-mode privilege level
description: |
User-mode privilege level is supported by an implementation if the U extension is present.
Note that the RISC-V ISA doens't formally define a U extension and it is only discussed in the Privileged ISA manual.
type: privileged
versions:
- version: "1.12.0"
state: ratified
ratification_date: 2019-12
- version: "1.0.0"
state: ratified
ratification_date: 2019-12
params:
MUTABLE_MISA_U:
description: |
Expand Down
2 changes: 1 addition & 1 deletion arch/ext/Zihpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ type: unprivileged
versions:
- version: "2.0.0"
state: ratified
ratification_date: unknown
ratification_date: null
requires:
name: Smhpm
3 changes: 3 additions & 0 deletions arch/profile/MP-S-64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ extensions:
optional: transitory
version: "= 1.11"
note: Made this a transitory option
Xmock:
presence: mandatory
version: "~> 0.9.9"
extra_notes:
- presence: mandatory
text: |
Expand Down
7 changes: 7 additions & 0 deletions arch/profile/RVA20S64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ introduction: |
processors. RVA20S64 is based on privileged architecture version 1.11.
extensions:
$inherits: "profile/RVI20U64.yaml#/extensions"
U:
presence: mandatory
version: "~> 1.0"
param_constraints:
U_MODE_ENDIANESS:
schema:
const: little``
S:
presence: mandatory
version: "= 1.11"
Expand Down
12 changes: 7 additions & 5 deletions backends/certificate_doc/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ Dir.glob("#{$root}/arch/certificate_model/*.yaml") do |f|
__FILE__
] do |t|
# TODO: schema validation
cfg_arch = cfg_arch_for("rv#{base}")
cert_model = cfg_arch.cert_model(cert_model_name)
raise "No certificate model defined for #{cert_model_name}" if cert_model.nil?
base_cert_model = cfg_arch_for("rv#{base}").cert_model(cert_model_name)
raise "No certificate model named '#{cert_model_name}'" if base_cert_model.nil?

# Switch to the generated certificate arch def and set some variables available to ERB template.
# Ask base certification model to create an in-memory config arch for this model.
# XXX - Add this to profile releases
cfg_arch = cert_model.to_cfg_arch
cfg_arch = base_cert_model.to_cfg_arch

# Set globals for ERB template.
cert_model = cfg_arch.cert_model(cert_model_name)
portfolio = cert_model
cert_class = cert_model.cert_class
portfolio = cert_model
portfolio_class = cert_class

version = File.basename(t.name, '.adoc').split('-')[1..].join('-')
Expand Down
10 changes: 2 additions & 8 deletions backends/certificate_doc/templates/certificate.adoc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ See https://github.com/riscv-software-src/riscv-unified-db/issues/291 and https:
|===
| Name | Long Name

<% insts.each do |inst| -%>
<% portfolio.in_scope_instructions.each do |inst| -%>
| <%= link_to_inst(inst.name) %>
| <%= inst.long_name %>
<% end # do -%>
Expand Down Expand Up @@ -584,13 +584,7 @@ The following instructions are added by this extension:
[appendix]
== Instruction Details
<%=
# insts = portfolio.in_scope_ext_reqs.map { |ext_req| ext_req.implemented_instructions }.flatten.uniq
insts = cert_model.in_scope_extensions.map { |ext_cert_model| ext_cert_model.instructions }.flatten.uniq
insts.sort_by!(&:name)
-%>

<% insts.each do |inst| -%>
<% portfolio.in_scope_instructions.each do |inst| -%>
<<<
<%= anchor_for_inst(inst.name) %>
=== <%= inst.name %>
Expand Down
2 changes: 2 additions & 0 deletions backends/profile_doc/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ rule %r{#{$root}/gen/profile_doc/adoc/.*\.adoc} => [
portfolio = profile_release
raise ArgumentError, "No profile release named '#{profile_release_name}'" if profile_release.nil?

# Set globals for ERB template.
profile_class = profile_release.profile_class
portfolio_class = profile_class
portfolio = profile_release

template_path = Pathname.new "#{$root}/backends/profile_doc/templates/profile.adoc.erb"
erb = ERB.new(template_path.read, trim_mode: "-")
Expand Down
79 changes: 52 additions & 27 deletions backends/profile_doc/templates/profile.adoc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:description: <%= profile_release.marketing_name %> Profile
:revdate: <%= profile_release.ratification_date.nil? ? Date.today : profile_release.ratification_date %>

// XXX - Figure out what we really want here - Change percent hash to percent equals.
// TODO - Figure out what we really want here - Change percent hash to percent equals.
// :revnumber: <%# profile_release.map(&:version).sort.last %>

:revmark: "TODO: revmark"
Expand Down Expand Up @@ -311,6 +311,7 @@ optional profile extensions for a new profile might be prototyped as
non-profile extensions on an earlier profile.

// XXX - Need to create render() Ruby function.
// See https://github.com/riscv-software-src/riscv-unified-db/issues/59
// <%# render("#{$root}/backends/portfolio_doc/templates/family_intro.erb", portfolio_class: profile_class) %>

== <%= profile_class.name %> Profile Class
Expand Down Expand Up @@ -344,21 +345,6 @@ Ratification date:: <%= profile_release.ratification_date %>
--
<% end # each profile_release -%>
=== Extension Presence
The <%= profile_class.marketing_name %> Profile Class references
<%= profile_class.referenced_extensions.size %> extensions.
.Status
|===
| Extension | <%= profile_class.profiles.map(&:marketing_name).join(" | ") -%>
<% profile_class.referenced_extensions.sort_by(&:name).each do |ext| -%>
| <%= ext.name %> | <%= profile_class.profiles.map { |profile| profile.extension_presence(ext.name) }.join(" | ") -%>
<% end -%>
|===
== <%= profile_release.name %> Profile Release
<%= profile_release.introduction %>
Expand All @@ -370,8 +356,8 @@ associated implementation-defined parameters across all its defined profiles.
=== <%= profile_release.name %> Description
<%= profile_release.description %>
<% end # unless -%>
<% profile_release.profiles.each do |profile| -%>
=== <%= profile.marketing_name %> Profile
Expand Down Expand Up @@ -411,6 +397,41 @@ associated implementation-defined parameters.
<% end # each profile -%>
<<<
[appendix]
== Profile Comparisons
=== Release Comparison
The <%= profile_class.marketing_name %> Profile Class has <%= profile_class.profile_releases.size %> releases that
reference a total of <%= profile_class.referenced_extensions.size %> extensions.
.Extension Presence
|===
| Extension | <%= profile_class.profile_releases.map(&:marketing_name).join(" | ") %>
<% profile_class.referenced_extensions.sort_by(&:name).each do |ext| -%>
| <%= ext.name %> | <%= profile_class.profile_releases.map { |profile_release| profile_release.extension_presence(ext.name) }.join(" | ") %>
<% end -%>
|===
=== Profile Comparison
The <%= profile_release.marketing_name %> Profile Release has <%= profile_release.profiles.size %> profiles that
reference a total of <%= profile_release.referenced_extensions.size %> extensions.
[NOTE]
Extensions present in a profile are also present in higher-privileged profiles in the same profile release.
.Extension Presence
|===
| Extension | <%= profile_release.profiles.map(&:marketing_name).join(" | ") %>
<% profile_release.referenced_extensions.sort_by(&:name).each do |ext| -%>
| <%= ext.name %> | <%= profile_release.profiles.map { |profile| profile.extension_presence(ext.name) }.join(" | ") %>
<% end -%>
|===
<<<
[appendix]
== Extension Details
Expand All @@ -420,39 +441,43 @@ associated implementation-defined parameters.
=== <%= ext.name %> Extension
<%= ext.long_name %>
.Status
.<%= ext.name %> Extension Presence
|===
| Profile | v<%= ext.versions.map { |ext_ver| ext_ver.canonical_version.to_s }.join(" | v") %>
<% profile_release.profiles.each do |profile| -%>
| <%= profile.marketing_name %> | <%= profile.version_strongest_presence(ext.name, ext.versions).join(" | ") -%>
| <%= profile.marketing_name %> | <%= profile.version_greatest_presence(ext.name, ext.versions).join(" | ") -%>
<% end -%>
|===
<% ext.versions.each do |v| -%>
<%= v.canonical_version %>::
State:::
<%= v.state %>
<% if v.state == "ratified" -%>
Ratification date:::
<%= v.ratification_date %>
<% end # if %>
<% unless v.changes.empty? -%>
Changes:::
<% v.changes.each do |c| -%>
* <%= c %>
<% end -%>
<%- end -%>
<%- unless v.url.nil? -%>
<% end -%>
<% unless v.url.nil? -%>
Ratification document:::
<%= v.url %>
<%- end -%>
<%- unless v.implications -%>
<% end -%>
<% unless v.implications -%>
Implies:::
<%- v.implications.each do |i| -%>
<% v.implications.each do |i| -%>
* `<%= i.name %>` version <%= i.version %>
<%- end -%>
<%- end -%>
<%- end -%>
<% end -%>
<% end -%>
<% end -%>
==== Synopsis
Expand Down
3 changes: 2 additions & 1 deletion bin/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

ROOT=$(dirname $(dirname $(realpath $BASH_SOURCE[0])))
source $ROOT/bin/setup

${ROOT}/bin/bash -c "source ${ROOT}/.home/.venv/bin/activate && pre-commit $@"
$PYTHON -mpre_commit "$@"
2 changes: 1 addition & 1 deletion cfgs/generic_rv64/cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ implemented_extensions:
- [Sm, "1.12.0"]
- [Smhpm, "1.12.0"]
- [Smpmp, "1.12.0"]
- [U, "1.12.0"]
- [U, "1.0.0"]
- [V, "1.0.0"]
- [Zicntr, "2.0.0"]
- [Zicsr, "2.0.0"]
Expand Down
Loading

0 comments on commit 11f8174

Please sign in to comment.