Skip to content

Commit 6fe8855

Browse files
committed
[rom_ctrl,doc] Update docs for drop of second S&P layer
This second S&P layer was removed in commit 803d9ae. Update the documentation to describe the design properly. While updating the block diagram, I also sort out the legends for the rdata paths. In the programmer's guide, I change the text so that it's true (talking about scrambled addresses as opposed to scrambled data), but the behaviour seen by the programmer does not change. Signed-off-by: Rupert Swarbrick <[email protected]>
1 parent a3a4ff6 commit 6fe8855

File tree

4 files changed

+23
-24
lines changed

4 files changed

+23
-24
lines changed

hw/ip/rom_ctrl/doc/interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The parameters that have an effect on the generated block are:
6060
Parameter | Default (Max) | Top Earlgrey | Description
6161
------------------|-------------------------------|----------------------------------------------------|---------------
6262
`AlertAsyncOn` | True | True | This is passed to the single `prim_alert_sender` instance and causes it to generate synchronization logic to support alert rx and tx being on different clocks.
63-
`RndCnstRomNonce` | `RND_CNST_SCR_NONCE` (define) | `top_earlgrey_rnd_cnst_pkg::RndCnstRomCtrlScrNonce`| Compile-time random default constant for scrambling nonce (used in `prim_prince` block and the two S&P blocks).
63+
`RndCnstRomNonce` | `RND_CNST_SCR_NONCE` (define) | `top_earlgrey_rnd_cnst_pkg::RndCnstRomCtrlScrNonce`| Compile-time random default constant for scrambling nonce (used in `prim_prince` block and the S&P block).
6464
`RndCnstRomKey` | `RND_CNST_SCR_KEY` (define) | `top_earlgrey_rnd_cnst_pkg::RndCnstRomCtrlScrKey` | 128-bit compile-time random default constant for scrambling key (used in `prim_prince` block).
6565
`MemSizeRom` | 64kB | 32kB | The size of the ROM itself
6666

hw/ip/rom_ctrl/doc/programmers_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The [`FATAL_ALERT_CAUSE`](registers.md#fatal_alert_cause) register might change
99

1010
To get the computed ROM digest, software can read [`DIGEST_0`](registers.md#digest) through [`DIGEST_7`](registers.md#digest).
1111
The ROM also contains an expected ROM digest.
12-
Unlike the rest of the contents of ROM, this isn't scrambled.
13-
As such, software can't read it through the standard ROM interface (which would try to unscramble it again, resulting in rubbish data that would cause a failed ECC check).
12+
Unlike the rest of the contents of ROM, the address of this digest isn't scrambled.
13+
As such, software can't read it through the standard ROM interface (since the address isn't very predictable).
1414
In case software needs access to this value, it can be read at [`EXP_DIGEST_0`](registers.md#exp_digest) through [`EXP_DIGEST_7`](registers.md#exp_digest).
1515

1616
## Device Interface Functions (DIFs)

hw/ip/rom_ctrl/doc/rom_ctrl_blockdiag.svg

Lines changed: 13 additions & 13 deletions
Loading

hw/ip/rom_ctrl/doc/theory_of_operation.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ It runs exactly once, and releases the green multiplexer when it is done.
1616
## ROM access when chip is in operation
1717

1818
Once the chip has booted, ROM accesses are requested over the system TL-UL bus.
19-
These come in through the TL-UL SRAM adapter (top-left of block diagram).
19+
These arrive through the TL-UL SRAM adapter (top-left of block diagram).
2020
In normal operation, the green multiplexer will give access to these TL reads.
21-
The address is scrambled at the first substitution-permutation network (marked S&P in the diagram).
21+
The address is scrambled by a substitution-permutation network (marked S&P in the diagram).
2222

2323
In parallel with the ROM access, a reduced `prim_prince` primitive (7 rounds with latency 1; equivalent to the cipher used for SRAM) computes a 39-bit truncated keystream for the block.
24-
On the following cycle, the scrambled data from ROM goes through a substitution-permutation network and is then XOR'd with the keystream.
24+
On the following cycle, the data returned from ROM is XOR'd with the keystream.
2525
This scheme is the same as that used by the [SRAM controller](../../sram_ctrl/README.md), but is much simplified because the ROM doesn't have to deal with writes, byte accesses or key changes.
2626

27-
The output from the XOR is the unscrambled 32-bit data, plus seven ECC bits.
28-
This data is passed straight through the TL-UL SRAM adapter; the ECC bits are used as a signal integrity check by the system bus.
27+
The output from the XOR has a 32-bit data word plus seven ECC bits.
28+
This data word is passed straight through the TL-UL SRAM adapter; the ECC bits are used as a signal integrity check by the system bus.
2929

3030
The following diagram shows the timing of the different signals.
3131
The time from the `req` output from the `tlul_adapter_sram` to the response that appears on its `rvalid` input is one cycle.
@@ -40,9 +40,9 @@ The unscrambled ROM data for (logical) address 12 is denoted `d12`.
4040
{name: 'req', wave: '0.1...0...'},
4141
{name: 'addr', wave: 'x.3.4.x...', data: ['12', '34']},
4242
{name: 'scrambled addr', wave: 'x.3.4.x...', data: ['21', '43']},
43-
{name: 'scrambled rdata + ecc', wave: 'x...3.4.x.', data: ['w21', 'w43']},
43+
{name: 'encrypted rdata + ecc', wave: 'x...3.4.x.', data: ['w21', 'w43']},
4444
{name: 'keystream', wave: 'x...3.4.x.', data: ['k12', 'k34']},
45-
{name: 'rdata + ecc', wave: 'x...3.4.x.', data: ['d12', 'd34']},
45+
{name: 'cleartext rdata + ecc', wave: 'x...3.4.x.', data: ['d12', 'd34']},
4646
{name: 'rvalid', wave: '0...1...0.'},
4747
]}
4848
```
@@ -66,7 +66,6 @@ The checker FSM loops through almost all the words in ROM (from bottom to top),
6666
Once the last word has been sent, the FSM releases the multiplexer; this now switches over permanently to allow access through the TL-UL SRAM adapter.
6767

6868
The top eight words in ROM (by logical address) are interpreted as a 256-bit expected hash.
69-
Unlike the rest of ROM, their data is not stored scrambled, so the expected hash can be read directly.
7069
This is taken by the checker FSM (ignoring ECC bits) and will be compared with the digest that is read back from the KMAC block.
7170

7271
Once it comes back, the digest is forwarded directly to the [Key Manager](../../keymgr/README.md).

0 commit comments

Comments
 (0)