[doc] Update documentation to align with recent RTL changes - #2484
[doc] Update documentation to align with recent RTL changes#2484SamuelRiedel wants to merge 2 commits into
Conversation
nasahlpa
left a comment
There was a problem hiding this comment.
LGTM apart from one question.
| | | | | (only relevant when ICacheScramble == 1) | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``ICacheTweakInfection`` | bit | SecureIbex | Enable :ref:`icache-tweak-infection` | | ||
| | | | | (only relevant when ICacheScramble == 1) | |
There was a problem hiding this comment.
Is that correct? As far as I remember, it is only useful when having SecureIbex enabled (because then ECC errors are flagged by a wrong un-XOR operation) and when we have an icache available.
There was a problem hiding this comment.
You're right. That was a copy-paste error.
Signed-off-by: Samuel Riedel <sriedel@lowrisc.org>
We check all incoming valid responses, not just load data Fixes lowRISC#2200 Signed-off-by: Samuel Riedel <sriedel@lowrisc.org>
andreaskurth
left a comment
There was a problem hiding this comment.
Thanks @SamuelRiedel for updating the Ibex documentation with many recent RTL changes (not just CHERIoT)!
This mostly LGTM, but I have see a few points that should be changed: one factual mix-up on ICacheScrNumPrinceRoundsHalf, a few over- or under-stated qualifiers, and some stale text sitting at the far end of the new cross-references.
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``PMPNumRegions`` | int (1..16) | 4 | Number implemented PMP regions (ignored if PMPEnable == 0) | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``MHPMCounterNum`` | int (0..10) | 0 | Number of :ref:`performance-counters` | |
There was a problem hiding this comment.
Following this new :ref: lands on performance_counters.rst:85-90, which uses WidthMHPMCounters/NumMHPMCounters (RTL names them MHPMCounterWidth/MHPMCounterNum) and caps the useful count at 8 (mhpmcounter3 - mhpmcounter10). The RTL defines events up to mhpmcounter12 (ibex_cs_registers.sv:1583-1597), i.e. 10, which matches this row and that page's own event table. Worth fixing there too while we're at it?
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``ICacheECC`` | bit | 0 | Enable :ref:`icache-ecc` (if ICache == 1) | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``BranchPredictor`` | bit | 0 | *EXPERIMENTAL* Enable :ref:`branch-prediction` | |
There was a problem hiding this comment.
The :ref: target still calls the parameter BranchPrediction (instruction_fetch.rst:34). Rename it there too so the cross-reference doesn't contradict the name in this row?
| | ``SecureIbex`` | bit | 0 | Enable various :ref:`security`. Note: SecureIbex == 1'b1 and | | ||
| | | | | RV32M == ibex_pkg::RV32MNone is an illegal combination. | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``LockstepOffset`` | int (>= 1) | 1 | Number of cycles to delay the :ref:`lockstep` shadow core | |
There was a problem hiding this comment.
Add "(only relevant when SecureIbex == 1)" here, like the neighbouring rows carry? Lockstep = SecureIbex, so the offset has no effect otherwise.
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``LockstepOffset`` | int (>= 1) | 1 | Number of cycles to delay the :ref:`lockstep` shadow core | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``MemECC`` | bit | SecureIbex | Enable SECDED ECC for :ref:`bus-integrity` | |
There was a problem hiding this comment.
Following this new :ref: lands on security.rst:93, which still says "When the SecureIbex parameter is set, incoming data will be checked ..." (same in load_store_unit.rst:68). Now that MemECC is documented as an independent parameter, should those two name MemECC instead?
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``MemECC`` | bit | SecureIbex | Enable SECDED ECC for :ref:`bus-integrity` | | ||
| +----------------------------------+---------------------+-------------------------+----------------------------------------------------------------------------------------------+ | ||
| | ``MemDataWidth`` | int (>= 32) | MemECC ? 32 + 7 : 32 | Data width of memory interface including integrity bits | |
There was a problem hiding this comment.
int (>= 32) reads as if this were freely choosable, but it is derived from MemECC and effectively fixed at 32 or 39: ibex_top.sv:864 slices data_wdata_core[MemDataWidth-1:32] into a prim_buf #(.Width(7)), so any other value breaks elaboration. Say "derived" or "32 or 39" in the range column?
| | 0 | RW | **CY:** Enable U-mode access to ``cycle`` / ``cycleh``. | | ||
| +--------+------+-------------------------------------------------------------------------------------+ | ||
|
|
||
| Writes to ``mcounteren`` are only accepted when the ``mcounteren_writable_i`` input is set to ``IbexMuBiOn``. |
There was a problem hiding this comment.
performance_counters.rst:77 describes the same mechanism but calls the signal mcounteren_writeable. Fix the name there and cross-reference here, so the behaviour is only spelled out once?
| +-----------------------+--------------------------------------+-------------------------------------------------------------+ | ||
| | CSR Access | 0 | CSR Access Instruction are defined in 'Zicsr' of the | | ||
| | | | RISC-V specification. | | ||
| | | | RISC-V specification. Note that any CSR *write* flushes the | |
There was a problem hiding this comment.
"any CSR write" is slightly too strong: mscratch and mepc are exempt via no_flush_csr_addr (ibex_id_stage.sv:593), and the RTL comment says "on most CSR modification". Mention the two exceptions?
|
|
||
| .. note:: | ||
|
|
||
| **Zcmp interrupt and exception behaviour** |
There was a problem hiding this comment.
Could the note also cover debug-mode entry? It is blocked over a wider window than interrupts: INSTR_EXPANDED and INSTR_EXPANDED_COMMIT (ibex_controller.sv:474-477), versus INSTR_EXPANDED_COMMIT only for handle_irq (ibex_controller.sv:499).
|
|
||
| **Zcmp interrupt and exception behaviour** | ||
|
|
||
| * **Interrupt masking:** Interrupts are suppressed for the duration of a Zcmp push/pop commit sequence. |
There was a problem hiding this comment.
cm.push never reaches INSTR_EXPANDED_COMMIT (it goes INSTR_EXPANDED -> INSTR_EXPANDED_LAST), so interrupts are not suppressed during it. The sentence two lines down already says as much, so dropping "push/" here would remove the contradiction.
| * **minstret counting:** An entire Zcmp push/pop sequence (regardless of how many register load/store micro-operations it expands to) is counted as a single retired instruction in ``minstret``. | ||
|
|
||
| * **Exception/interrupt during expansion:** If an exception or interrupt is signalled before the commit sequence has started, the Zcmp state machine is flushed and the partial sequence is abandoned. | ||
| The core takes the trap as if the Zcmp instruction had not yet started, so software can safely restart it on return from the handler. |
There was a problem hiding this comment.
"as if the Zcmp instruction had not yet started" seems a bit strong: a partial cm.push has already written stack memory (negative offsets from sp, see cm_push_store_reg) and a partial cm.pop has already overwritten registers. The reason restarting is safe is that sp is adjusted last, so the micro-ops are idempotent. Say that instead?
Some new changes to Ibex were not reflected in the documentation. This PR updates it:
ibex_topparametersThe CHERIoT documentation is deferred to a separate PR