Skip to content

Commit 1791292

Browse files
Merge pull request #242 from riscv-software-src/238-missing-recommendations-in-profiles-and-add-extra_notes-to-replace-excluded-extensions
238 missing recommendations in profiles and add extra notes to replace excluded extensions
2 parents 0e35289 + 5cd6e77 commit 1791292

File tree

8 files changed

+247
-192
lines changed

8 files changed

+247
-192
lines changed

arch/crd/MockCRD-1.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,18 @@ MockCRD-1:
198198
A bunch of additional requirements only that should show up for XLEN=64
199199
requirements:
200200
- name: REQ-XLEN64-001
201-
description: Can avoid adding extra CSRs with `h` suffix
201+
description: Can avoid adding extra CSRs with `h` suffix
202+
extra_notes:
203+
- presence: optional
204+
text: Here's the first extra note for the optional extensions section.
205+
- presence: mandatory
206+
text: |
207+
Here's the first extra note for the mandatory extensions section.
208+
This note is multiple lines.
209+
- presence: optional
210+
text: Here's the second extra note for the optional extensions section.
211+
recommendations:
212+
- text: |
213+
Implementations are strongly recommended to raise illegal-instruction
214+
exceptions on attempts to execute unimplemented opcodes.
215+
- text: Micky should give Pluto an extra treat

arch/profile/MockProfile-1.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ MockProfile-1:
55
mode: S
66
version: "1.0"
77
contributors:
8-
- name: Krste Asanovic
9-
email: krste@sifive.com
10-
company: SiFive
8+
- name: Micky Mouse
9+
email: micky@disney.com
10+
company: Disneyk
1111
extensions:
1212
- name: S
1313
presence: mandatory
@@ -25,4 +25,18 @@ MockProfile-1:
2525
version: "= 2.0"
2626
- name: Sv48
2727
presence: optional
28-
version: "= 1.11"
28+
version: "= 1.11"
29+
extra_notes:
30+
- presence: optional
31+
text: Here's the first extra note for the optional extensions section.
32+
- presence: mandatory
33+
text: |
34+
Here's the first extra note for the mandatory extensions section.
35+
This note is multiple lines.
36+
- presence: optional
37+
text: Here's the second extra note for the optional extensions section.
38+
recommendations:
39+
- text: |
40+
Implementations are strongly recommended to raise illegal-instruction
41+
exceptions on attempts to execute unimplemented opcodes.
42+
- text: Micky should give Pluto an extra treat

arch/profile/rva20u64.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ rva20u64:
103103
note: |
104104
The number of counters is platform-specific.
105105
extra_notes:
106-
- location: optional
107-
note: |
106+
- presence: optional
107+
text: |
108108
The rationale to not make Q an optional extension is that
109109
quad-precision floating-point is unlikely to be implemented in
110110
hardware, and so we do not require or expect A-profile software to
111111
expend effort optimizing use of Q instructions in case they are
112112
present.
113-
- location: optional
114-
note: |
113+
- presence: optional
114+
text: |
115115
Zifencei is not classed as a supported option in the user-mode
116116
profile because it is not sufficient by itself to produce the desired
117117
effect in a multiprogrammed multiprocessor environment without OS
@@ -122,13 +122,14 @@ rva20u64:
122122
instruction-cache coherence mechanisms can be used behind the OS
123123
abstraction. A separate extension is being developed for more general
124124
and efficient instruction cache coherence.
125-
- location: optional
126-
note: |
125+
- presence: optional
126+
text: |
127127
The execution environment must provide a means to synchronize writes to
128128
instruction memory with instruction fetches, the implementation of which
129129
likely relies on the Zifencei extension.
130130
For example, RISC-V Linux supplies the `__riscv_flush_icache` system call and
131131
a corresponding vDSO call.
132132
recommendations:
133-
- Implementations are strongly recommended to raise illegal-instruction
134-
exceptions on attempts to execute unimplemented opcodes.
133+
- text: |
134+
Implementations are strongly recommended to raise illegal-instruction
135+
exceptions on attempts to execute unimplemented opcodes.

arch/profile/rva22u64.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,26 @@ rva22u64:
103103
presence: optional
104104
version: "~> 1.0"
105105
extra_notes:
106-
- location: optional
107-
note: |
106+
- presence: optional
107+
text: |
108108
The scalar crypto extensions are expected to be superseded by
109109
vector crypto standards in future profiles, and the scalar extensions
110110
may be removed as supported options once vector crypto is present.
111-
- location: optional
112-
note: |
111+
- presence: optional
112+
text: |
113113
The smaller component scalar crypto extensions (Zbc, Zbkb, Zbkc,
114114
Zbkx, Zknd, Zkne, Zknh, Zksed, Zksh) are not provided as separate
115115
options in the profile. Profile implementers should provide all of
116116
the instructions in a given algorithm suite as part of the Zkn or Zks
117117
supported options.
118-
- location: optional
119-
note: |
118+
- presence: optional
119+
text: |
120120
Access to the entropy source (Zkr) in a system is usually
121121
carefully controlled. While the design supports unprivileged access
122122
to the entropy source, this is unlikely to be commonly used in an
123123
application processor, and so Zkr was not added as a profile option.
124124
This also means the roll-up Zk was not added as a profile option.
125-
- location: optional
126-
note: |
125+
- presence: optional
126+
text: |
127127
The Zfinx, Zdinx, Zhinx, Zhinxmin extensions are incompatible
128128
with the profile mandates to support the F and D extensions.

backends/crd_doc/templates/crd.adoc.erb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,26 @@ None
125125
| <%= ext_req.version_requirement %>
126126
| <%= ext_db.nil? ? "" : ext_db.long_name %>
127127
| <%= ext_req.note.nil? ? "" : ext_req.note %>
128-
<% end -%>
128+
<% end # each ext_req -%>
129129
|===
130-
<% end # if table -%>
131-
<% end # do ext_reqs -%>
130+
<% end # if empty ext_reqs -%>
131+
132+
<% crd.extra_notes_for_presence(presence)&.each do |extra_note| -%>
133+
NOTE: <%= extra_note.text %>
134+
135+
<% end # each extra_note -%>
136+
137+
<% end # each presence -%>
138+
139+
<% unless crd.recommendations.empty? -%>
140+
=== Recommendations
141+
142+
Recommendations are not strictly mandated but are included to guide implementers making design choices.
143+
144+
<% crd.recommendations.each do |recommendation| -%>
145+
<%= recommendation.text %>
146+
<% end # each recommendation -%>
147+
<% end # unless recommendations empty -%>
132148
133149
<<<
134150
== Implementation-dependencies

backends/manual/templates/instruction.adoc.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ This instruction is included in the following profiles:
1313

1414
<%- arch_def.profiles.each do |profile| -%>
1515
<%-
16-
in_profile_mandatory = profile.mandatory_extension_requirements.any? do |ext_req|
16+
in_profile_mandatory = profile.in_scope_ext_reqs("mandatory").any? do |ext_req|
1717
ext_versions = ext_req.satisfying_versions(arch_def)
1818
ext_versions.any? { |ext_ver| inst.defined_by?(ext_ver) }
1919
end
20-
in_profile_optional = profile.optional_extension_requirements.any? do |ext_req|
20+
in_profile_optional = profile.in_scope_ext_reqs("optional").any? do |ext_req|
2121
ext_versions = ext_req.satisfying_versions(arch_def)
2222
ext_versions.any? { |ext_ver| inst.defined_by?(ext_ver) }
2323
end

0 commit comments

Comments
 (0)