Skip to content

Commit 3cd657a

Browse files
move RV32 formats and extensions out of v1 ratification (#983)
This PR cleanly separates out content to be ratified now, from content to be ratified later. The different chapters are all in one of four categories: 1. Ready for freeze: put forwards for ratification _now_ (this is the default) 2. Ready for freeze: will be put forwards for ratification _next_ 3. Stable: Still need more review, prototyping or modelling work 4. Experimental: More thought or research required riscv-privileged.pdf, riscv-unprivileged.pdf and riscv-cheri.pdf all only contain extensions which we are putting forwards for ratification in the first package. riscv-cheri-full.pdf contains all extensions, including those which are ready for freeze but being put forwards in future ratification packages, which includes the RV32 formats. --------- Co-authored-by: Alex Richardson <alexrichardson@google.com>
1 parent 8dfe38c commit 3cd657a

40 files changed

Lines changed: 546 additions & 357 deletions

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,5 @@ docker-pull-latest:
237237
clean:
238238
@echo "Cleaning up generated files..."
239239
rm -rf $(BUILD_DIR)
240+
rm -rf $(CHERI_GEN_DIR)
240241
@echo "Cleanup completed."

src/c-st-ext.adoc

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ always refers to the YLEN-bit capability version of the register.
298298

299299
==== Stack-Pointer-Based Loads and Stores
300300

301-
include::images/wavedrom/c-sp-load-store.edn[]
301+
include::images/wavedrom/c-sp-load-store.adoc[]
302302
[[c-sp-load-store]]
303303
//.Stack-Pointer-Based Loads and Stores--these instructions use the CI format.
304304

@@ -331,11 +331,14 @@ expands to `fld rd, offset(x2)`.
331331
<<C_LOAD_CAP_SP>> is an {cheri_base_ext_name}-only instruction that loads a
332332
capability from memory into capability
333333
register _{cd}_. It computes its effective address by adding the
334-
_zero_-extended offset, scaled by 8 (for {cheri_base32_ext_name}),
335-
or 16 (for {cheri_base64_ext_name}) to the capability stack pointer, `{creg}2`. It
336-
expands to `{load_cap_name_lc} {creg_ref}d, offset({creg}2)`.
337-
338-
include::images/wavedrom/c-sp-load-store-css.edn[]
334+
_zero_-extended offset, scaled by
335+
ifndef::cheri_ratification_v1_only[]
336+
8 (for {cheri_base32_ext_name}), or
337+
endif::[]
338+
16 (for {cheri_base64_ext_name}) to the capability stack pointer, `{creg}2`. It
339+
expands to `{load_cap_name_lc} {creg}d, offset({creg}2)`.
340+
341+
include::images/wavedrom/c-sp-load-store-css.adoc[]
339342
[[c-sp-load-store-css]]
340343
//.Stack-Pointer-Based Loads and Stores--these instructions use the CSS format.
341344

@@ -365,8 +368,11 @@ expands to `fsd rs2, offset(x2)`.
365368
<<C_STORE_CAP_SP>> is an {cheri_base_ext_name}-only instruction that stores a
366369
capability in capability register _{cs2}_
367370
to memory. It computes an effective address by adding the
368-
_zero_-extended offset, scaled by 8 (for {cheri_base32_ext_name}),
369-
or 16 (for {cheri_base64_ext_name}), to the stack pointer, `{creg}2`. It
371+
_zero_-extended offset, scaled by
372+
ifndef::cheri_ratification_v1_only[]
373+
8 (for {cheri_base32_ext_name}), or
374+
endif::[]
375+
16 (for {cheri_base64_ext_name}), to the stack pointer, `{creg}2`. It
370376
expands to `{store_cap_name_lc} {cs2}, offset({creg}2)`.
371377

372378
[NOTE]
@@ -413,7 +419,7 @@ attain the greatest code size reduction.
413419
==== Register-Based Loads and Stores
414420

415421
[[reg-based-ldnstr]]
416-
include::images/wavedrom/reg-based-ldnstr.edn[]
422+
include::images/wavedrom/reg-based-ldnstr.adoc[]
417423
//.Compressed, register-based load and stores--these instructions use the CL format.
418424
(((compressed, register-based load and store)))
419425
These instructions use the CL format.
@@ -446,13 +452,16 @@ _zero_-extended offset, scaled by 8, to the base address in register
446452
<<C_LOAD_CAP>> is an {cheri_base_ext_name} only instruction that loads a
447453
capability from memory into register `_{cd}′_`
448454
It computes an effective address by adding the
449-
_zero_-extended offset, scaled by 8 ({cheri_base32_ext_name})
450-
or 16 ({cheri_base64_ext_name}),
455+
_zero_-extended offset, scaled by
456+
ifndef::cheri_ratification_v1_only[]
457+
8 ({cheri_base32_ext_name}) or
458+
endif::[]
459+
16 ({cheri_base64_ext_name}),
451460
to the base address in register `_{cs1}′_`. It expands to
452461
`{c_load_cap_name_lc} {cd}′, offset({cs1}′)`.
453462

454463
[[c-cs-format-ls]]
455-
include::images/wavedrom/c-cs-format-ls.edn[]
464+
include::images/wavedrom/c-cs-format-ls.adoc[]
456465
//.Compressed, CS format load and store--these instructions use the CS format.
457466
(((compressed, cs-format load and store)))
458467

@@ -486,20 +495,27 @@ register `_rs1′_`. It expands to
486495
<<C_STORE_CAP>> is an {cheri_base_ext_name} only instruction that stores a
487496
capability in register `_{cs2}′_` to memory.
488497
It computes an effective address by adding the
489-
_zero_-extended offset, scaled by 8 ({cheri_base32_ext_name})
490-
or 16 ({cheri_base64_ext_name}),
498+
_zero_-extended offset, scaled by
499+
ifndef::cheri_ratification_v1_only[]
500+
8 ({cheri_base32_ext_name}) or
501+
endif::[]
502+
16 ({cheri_base64_ext_name}),
491503
to the base address in register `_{cs1}′_`. It expands to
492504
`{c_store_cap_name_lc} {cs2}′, offset({cs1}′)`
493505

494506
==== Compressed Load and Store summary
495507

508+
ifndef::cheri_ratification_v1_only[]
509+
496510
<<insn_remapping_16bit_rv32_a>> and <<insn_remapping_16bit_rv32_b>> summarize
497511
load/store encoding mappings for RV32 architectures.
498512

499513
==== RV32I / {cheri_base32_ext_name}
500514

501515
include::cheri/rv32c_mapping_table.adoc[]
502516

517+
endif::[]
518+
503519
<<<
504520
==== RV64I / {cheri_base64_ext_name}
505521

src/cheri/app-cheri-instructions.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
include::cheri_isa_tables.adoc[]
55

6-
ifdef::cheri_standalone_spec[]
6+
ifndef::cheri_ratification_v1_only[]
77

88
=== "Zcmp", "Zcmt" ({cheri_base_ext_name})
99

10-
IMPORTANT: {not_v1_ratification_package}
10+
IMPORTANT: {not_v1_ratification_package_stable}
1111

1212
[#ZCMP_CHERI,reftext="Zcmp ({cheri_base32_ext_name})"]
1313
=== "Zcmp" Standard Extension For Code-Size Reduction
@@ -104,11 +104,9 @@ Some instructions have been added as shown in <<ISA_added_095>>.
104104
[#ISA_added_095]
105105
[width="100%",options=header,cols="2,2,2",]
106106
|==============================================================================
107-
include::generated/new_instructions_table_body.adoc[]
107+
include::{generated_dir}/new_instructions_table_body.adoc[]
108108
|==============================================================================
109109

110-
WARNING: {YSEAL} and {YUNSEAL} are not included in the v1.0 ratification package.
111-
112110
[NOTE]
113111
====
114112
@@ -125,7 +123,7 @@ WARNING: {YSEAL} and {YUNSEAL} are not included in the v1.0 ratification package
125123
[NOTE]
126124
====
127125
128-
The following changes are for forwards compatibility with {cheriot_unpriv_ext_name}:
126+
The following changes are for forwards compatibility with CHERIoT:
129127
130128
. Capability encodings and extensions are now the naming authorities for capability types (only 0/unsealed exists in the base architecture).
131129
. Capability encoding formats are now in separate base parameterizations.

src/cheri/attributes.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Sail source code
22
:sail-doc: src/cheri/generated/riscv_RV64.json
3+
:generated_dir: generated
34

4-
ifndef::cheri_standalone_spec[]
5-
:cheri_ratification_v1_only: 1
6-
endif::[]
7-
8-
:not_v1_ratification_package: pass:quotes[#This chapter is not part of the v1.0 ratification package.#]
9-
5+
:not_v1_ratification_package_freeze: pass:quotes[#This chapter is not part of the v1.0 ratification package and is ready to freeze.#]
6+
:not_v1_ratification_package_stable: pass:quotes[#This chapter is not part of the v1.0 ratification package and is stable.#]
7+
:not_v1_ratification_package_experimental: pass:quotes[#This chapter is not part of the v1.0 ratification package and is experimental.#]
108

119
///////////////////////////////////////////////////////////////////////////////
1210
// Top-level CHERI definitions

src/cheri/cheri-pte-ext.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
[#section_cheri_priv_crg_ext]
23
== "{cheri_priv_crg_ext}" Extension, Version 1.0 for {cheri_base64_ext_name}
34

src/cheri/cheri_csr_tables.adoc

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#this section includes debug CSRs#
55

6-
ifdef::cheri_ratification_v1_only[]
6+
ifndef::cheri_ratification_v1_only[]
77

88
ifndef::cheri_standalone_spec[]
99

@@ -29,14 +29,14 @@ endif::[]
2929
[#aliased_CSRs]
3030
[width="100%",options=header,cols="1,1"]
3131
|==============================================================================
32-
include::generated/csr_aliases_table_body.adoc[]
32+
include::{generated_dir}/csr_aliases_table_body.adoc[]
3333
|==============================================================================
3434

3535
.Action taken on writing to extended CSRs
3636
[#extended_CSR_writing]
3737
[width="100%",options=header,cols="1,2,2"]
3838
|==============================================================================
39-
include::generated/csr_alias_action_table_body.adoc[]
39+
include::{generated_dir}/csr_alias_action_table_body.adoc[]
4040
|==============================================================================
4141

4242
^*^ The vector range check is to ensure that vectored entry to the handler is within bounds of the capability written to `__x__tvec`.
@@ -53,7 +53,7 @@ is only possible when {cheri_default_ext_name} is implemented.
5353
[#new_cap_CSR_writing]
5454
[width="100%",options=header,cols="1,2,2"]
5555
|==============================================================================
56-
include::generated/new_csr_write_action_table_body.adoc[]
56+
include::{generated_dir}/new_csr_write_action_table_body.adoc[]
5757
|==============================================================================
5858

5959
XLEN bits of YLEN-wide CSRs added in {cheri_default_ext_name} are
@@ -69,7 +69,7 @@ NOTE: Implementations which allow misa.C to be writable need to legalize `__x__e
6969
[#CSR_exevectors]
7070
[width="100%",options=header,cols="1,1,1,1"]
7171
|==============================================================================
72-
include::generated/csr_exevectors_table_body.adoc[]
72+
include::{generated_dir}/csr_exevectors_table_body.adoc[]
7373
|==============================================================================
7474

7575
Some CSRs store code pointers or data pointers as shown in xref:CSR_exevectors[xrefstyle=short].
@@ -85,7 +85,7 @@ The tables below show all YLEN-wide CSRs.
8585
[#all_capability_CSRs]
8686
[width="100%",options=header,cols="2,1,1,2,2,4"]
8787
|==============================================================================
88-
include::generated/csr_permission_table_body.adoc[]
88+
include::{generated_dir}/csr_permission_table_body.adoc[]
8989
|==============================================================================
9090

9191
Where reset values are specified in <<all_capability_CSRs>>, they are typically a maximum possible value.
@@ -94,25 +94,29 @@ For example, a <<root-rx-cap>> as specified for <<mtvec_y>> is the maximum, the
9494
{cheri_priv_m_ext} and {cheri_priv_s_ext} extend the CSRs listed in
9595
xref:dcsrnames-renamed[xrefstyle=short],
9696
xref:mcsrnames-renamed[xrefstyle=short],
97-
xref:scsrnames-renamed[xrefstyle=short],
98-
xref:vscsrnames-renamed[xrefstyle=short] and
99-
xref:ucsrnames-renamed[xrefstyle=short] from the base RISC-V ISA and its
100-
extensions.
97+
xref:scsrnames-renamed[xrefstyle=short]
98+
ifdef::cheri_ratification_v1_only[]
99+
, and xref:vscsrnames-renamed[xrefstyle=short]
100+
endif::[]
101+
ifndef::cheri_ratification_v1_only[]
102+
, xref:vscsrnames-renamed[xrefstyle=short] and xref:ucsrnames-renamed[xrefstyle=short]
103+
endif::[]
104+
from the base RISC-V ISA and its extensions.
101105

102106
NOTE: If {cheri_default_ext_name} is supported then the <<cheri_execution_mode>> determines whether YLEN or XLEN bits are returned (see <<CSRRW_CHERI>>).
103107

104108
[[dcsrnames-renamed]]
105109
.Extended debug-mode CSRs in {cheri_base_ext_name}
106110
[%autowidth,float="center",align="center",cols="<,<,<,<,<",options="header"]
107111
|===
108-
include::generated/csr_renamed_purecap_mode_d_table_body.adoc[]
112+
include::{generated_dir}/csr_renamed_purecap_mode_d_table_body.adoc[]
109113
|===
110114

111115
[[mcsrnames-renamed]]
112116
.Extended machine-mode CSRs in {cheri_base_ext_name}
113117
[%autowidth,float="center",align="center",cols="<,<,<,<,<",options="header"]
114118
|===
115-
include::generated/csr_renamed_purecap_mode_m_table_body.adoc[]
119+
include::{generated_dir}/csr_renamed_purecap_mode_m_table_body.adoc[]
116120
|===
117121

118122
[NOTE]
@@ -128,22 +132,25 @@ from which it can derive a capability to the address in this register.
128132
.Extended supervisor-mode CSRs in {cheri_base_ext_name}
129133
[%autowidth,float="center",align="center",cols="<,<,<,<,<",options="header"]
130134
|===
131-
include::generated/csr_renamed_purecap_mode_s_table_body.adoc[]
135+
include::{generated_dir}/csr_renamed_purecap_mode_s_table_body.adoc[]
132136
|===
133137

134138
[[vscsrnames-renamed]]
135139
.Extended virtual supervisor-mode CSRs in {cheri_base_ext_name}
136140
[%autowidth,float="center",align="center",cols="<,<,<,<,<",options="header"]
137141
|===
138-
include::generated/csr_renamed_purecap_mode_vs_table_body.adoc[]
142+
include::{generated_dir}/csr_renamed_purecap_mode_vs_table_body.adoc[]
139143
|===
140144

145+
// NOTE: This table only includes jvt_y
146+
ifndef::cheri_ratification_v1_only[]
141147
[[ucsrnames-renamed]]
142148
.Extended user-mode CSRs in {cheri_base_ext_name}
143149
[%autowidth,float="center",align="center",cols="<,<,<,<,<",options="header"]
144150
|===
145-
include::generated/csr_renamed_purecap_mode_u_table_body.adoc[]
151+
include::{generated_dir}/csr_renamed_purecap_mode_u_table_body.adoc[]
146152
|===
153+
endif::[]
147154

148155
ifndef::cheri_standalone_spec[]
149156

0 commit comments

Comments
 (0)