Skip to content

Commit d7e5e65

Browse files
[dv,sram] add axi_sram verification plan and tag architecture spec
1 parent ef1370c commit d7e5e65

2 files changed

Lines changed: 474 additions & 58 deletions

File tree

doc/ref/arch.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
# Architecture
22

3-
The Mocha architecture contains two crossbars.
4-
One crossbar is 64-bit width and is meant for the main memory.
5-
The other crossbar is uncached and meant to contain the peripherals.
6-
Because most of these peripherals are imported from OpenTitan, in the first instance this bus is implemented as a TileLink Ultra-Lightweight bus with 32-bit width.
3+
The Mocha architecture contains two crossbars.<!-- ibyb3i_x -->
4+
One crossbar is 64-bit width and is meant for the main memory.<!-- iiu1i5_x -->
5+
The other crossbar is uncached and meant to contain the peripherals.<!-- e16ysv_x -->
6+
Because most of these peripherals are imported from OpenTitan, in the first instance this bus is implemented as a TileLink Ultra-Lightweight bus with 32-bit width.<!-- ch8b58_x -->
77

8-
![Mocha block diagram](../img/mocha.svg)
8+
![Mocha block diagram](../img/mocha.svg)<!-- m00a78_x -->
99

1010
## Clock domains
1111

12-
There are three clock domains in Mocha.
12+
There are three clock domains in Mocha.<!-- rfj4pd_x -->
1313

14-
1. Main: The main clock domain is the high-speed clock domain that runs the CVA6 core as well as the AXI crossbar it connects to, the AXI tag controller, debug module and the SRAM.
15-
2. IO: The IO clock drives most of the peripherals and runs at a lower speed than the main clock.
16-
It drives the TileLink bus and most of the peripherals that are connected to it like the UART and the SPI device.
17-
3. AON: The always on clock is also a low-speed clock with the difference being that it is always on.
18-
Both the main and IO clocks can be disabled and are turned off when a system reset is requested.
19-
The always on clock drives the clock, reset and power managers and allows the system to come out of reset.
14+
1. Main: The main clock domain is the high-speed clock domain that runs the CVA6 core as well as the AXI crossbar it connects to, the AXI tag controller, debug module and the SRAM.<!-- yj8kx5_x -->
15+
2. IO: The IO clock drives most of the peripherals and runs at a lower speed than the main clock.<!-- xe90jz_x -->
16+
It drives the TileLink bus and most of the peripherals that are connected to it like the UART and the SPI device.<!-- 4vkzbx_x -->
17+
3. AON: The always on clock is also a low-speed clock with the difference being that it is always on.<!-- s61dxh_x -->
18+
Both the main and IO clocks can be disabled and are turned off when a system reset is requested.<!-- 68url6_x -->
19+
The always on clock drives the clock, reset and power managers and allows the system to come out of reset.<!-- w5ylk6_x -->
2020

2121
## Memory map
2222

23-
This is the current memory map for Mocha, where the base and top addresses are inclusive, and reserved is the amount of memory reserved for this function:
23+
This is the current memory map for Mocha, where the base and top addresses are inclusive, and reserved is the amount of memory reserved for this function:<!-- mcbp27_x -->
2424

25-
![Mocha memory map](../img/memmap.svg)
25+
![Mocha memory map](../img/memmap.svg)<!-- bxskuw_x -->
2626

2727
## Top-level interface
2828

29-
The Mocha top will need a few top-level inputs.
30-
Some of these are listed here:
31-
- Clock outputs from PLLs.
32-
- Rollback counter backed by OTP.
33-
- Debug and design for test enable pins.
34-
- True random noise source to drive the entropy source.
35-
- AXI subordinate port to connect to the mailbox.
29+
The Mocha top will need a few top-level inputs.<!-- i7mqt7_x -->
30+
Some of these are listed here:<!-- 1cwb13_x -->
31+
- Clock outputs from PLLs.<!-- p4bt5a_x -->
32+
- Rollback counter backed by OTP.<!-- 7215fb_x -->
33+
- Debug and design for test enable pins.<!-- 5fh61t_x -->
34+
- True random noise source to drive the entropy source.<!-- 8u3w8m_x -->
35+
- AXI subordinate port to connect to the mailbox.<!-- fna4to_x -->
3636

37-
In terms of output, the top-level will need output signals:
38-
- Key to provide an AES engine outside of the secure enclave with the memory encryption key.
39-
- AXI manager port to interact with the rest of the chip.
37+
In terms of output, the top-level will need output signals:<!-- tvdygx_x -->
38+
- Key to provide an AES engine outside of the secure enclave with the memory encryption key.<!-- fv7l7k_x -->
39+
- AXI manager port to interact with the rest of the chip.<!-- du1glx_x -->
4040

4141
## SRAM specification
4242

43-
The static random-access memory (SRAM) in CHERI Mocha is mainly used as the stack and heap for the boot firmware that lives in the read-only memory (ROM).
44-
However, it should also be possible to execute from SRAM.
45-
Once code starts executing from dynamic random-access memory (DRAM), we don't envision using SRAM anymore.
46-
47-
The SRAM block has four ports:
48-
- Clock input
49-
- Reset input
50-
- AXI4 request input from the main SoC sub-system crossbar
51-
- AXI4 response output back to the main crossbar
52-
53-
Inside the block it translates the AXI4 requests into an SRAM interface that our primitive RAM wrappers use.
54-
It needs to support AXI4 protocol including:
55-
- Bursts, where the last signal must be indicated correctly.
56-
- Response must have the same AXI4 ID as the request
57-
- Atomic support is *excluded*.
58-
- The data width is 64 bits.
59-
- The address range and size of the SRAM are defined in the [memory map](#memory-map). Accesses outside this range must return an error, including if only part of the burst is outside the memory range.
60-
- Responses must return within a bounded amount of time that may be proportional to the length of the burst.
61-
- Only aligned 64-bit accesses are allowed.
62-
63-
There needs to be 1 CHERI tag bit per 128-bit aligned region.
64-
A tag should only be set to 1 by writing a full 128-bit aligned region.
65-
This 128-bit aligned transaction must be part of a single burst.
66-
The CHERI tag bits are communicated through a single user bit per AXI4 flit (`wuser` and `ruser` for writes and reads respectively).
67-
There should be an assertion to notify when writes occur where `wuser` is set to 1 which is not part of a full capability write.
68-
There should also be an assertion for `wuser` mismatches, where one part of the capability is marked as valid while another is invalid in the same transaction.
69-
If a portion of the 128-bit aligned region is written it must clear the tag for the whole region including when a partial write strobe is used.
70-
71-
Reads that only read part of a 64-bit value are allowed from valid capability regions, but these should have their tag cleared.
72-
Burst reads from the SRAM must have the appropriate CHERI tags set for each address, so a valid capability must have the user bits set for both of the 64-bit flits it is being sent back, and a mixture of capability and non-capability data is allowed in a burst.
73-
The SRAM is allowed to mark a capability as invalid by setting one or both of the `ruser` bits to zero, so the core must AND the two `ruser` values together to determine the validity of a capability.
74-
Tags should be stored in a separate block of memory from the data, this is to allow future optimisations where bulk-reads of tags are desired.
75-
76-
The initial value of the SRAM including the tags is undefined at start-up.
43+
The static random-access memory (SRAM) in CHERI Mocha is mainly used as the stack and heap for the boot firmware that lives in the read-only memory (ROM).<!-- 21k32t_x -->
44+
However, it should also be possible to execute from SRAM.<!-- lhjkel -->
45+
Once code starts executing from dynamic random-access memory (DRAM), we don't envision using SRAM anymore.<!-- a3l94p_x -->
46+
47+
The SRAM block has four ports:<!-- qohtih -->
48+
- Clock input<!-- 947rwh -->
49+
- Reset input<!-- rrni5j -->
50+
- AXI4 request input from the main SoC sub-system crossbar<!-- pgo845 -->
51+
- AXI4 response output back to the main crossbar<!-- n5txiq -->
52+
53+
Inside the block it translates the AXI4 requests into an SRAM interface that our primitive RAM wrappers use.<!-- vknoin -->
54+
It needs to support AXI4 protocol including:<!-- mcykq8 -->
55+
- Bursts, where the last signal must be indicated correctly.<!-- o02amt -->
56+
- Response must have the same AXI4 ID as the request<!-- 4t4cew -->
57+
- Atomic support is *excluded*.<!-- bsi4rc -->
58+
- The data width is 64 bits.<!-- jeluga -->
59+
- The address range and size of the SRAM are defined in the [memory map](#memory-map). Accesses outside this range must return an error, including if only part of the burst is outside the memory range.<!-- u0s8nt -->
60+
- Responses must return within a bounded amount of time that may be proportional to the length of the burst.<!-- 34ld5i -->
61+
- Only aligned 64-bit accesses are allowed.<!-- lfcb7q -->
62+
63+
There needs to be 1 CHERI tag bit per 128-bit aligned region.<!-- 01skcc -->
64+
A tag should only be set to 1 by writing a full 128-bit aligned region.<!-- 8rlwol -->
65+
This 128-bit aligned transaction must be part of a single burst.<!-- 35vdeg -->
66+
The CHERI tag bits are communicated through a single user bit per AXI4 flit (`wuser` and `ruser` for writes and reads respectively).<!-- u95b14 -->
67+
There should be an assertion to notify when writes occur where `wuser` is set to 1 which is not part of a full capability write.<!-- bj8we7 -->
68+
There should also be an assertion for `wuser` mismatches, where one part of the capability is marked as valid while another is invalid in the same transaction.<!-- 9a3xf6 -->
69+
If a portion of the 128-bit aligned region is written it must clear the tag for the whole region including when a partial write strobe is used.<!-- 893tz4 -->
70+
71+
Reads that only read part of a 64-bit value are allowed from valid capability regions, but these should have their tag cleared.<!-- raa5pw -->
72+
Burst reads from the SRAM must have the appropriate CHERI tags set for each address, so a valid capability must have the user bits set for both of the 64-bit flits it is being sent back, and a mixture of capability and non-capability data is allowed in a burst.<!-- kn6exz -->
73+
The SRAM is allowed to mark a capability as invalid by setting one or both of the `ruser` bits to zero, so the core must AND the two `ruser` values together to determine the validity of a capability.<!-- af8sx6 -->
74+
Tags should be stored in a separate block of memory from the data, this is to allow future optimisations where bulk-reads of tags are desired.<!-- lzoy40 -->
75+
76+
The initial value of the SRAM including the tags is undefined at start-up.<!-- hqbiau -->

0 commit comments

Comments
 (0)