ocr_mib: Architecture¶
1. Structure¶
The register map, the VHDL constants of the addresses and fields (ocr_regs_pkg), the documentation
(register_map.md) and the C header (sw/ocr_regs.h) are generated by tools/regmap.py from
hdl/ocr_mib/regs/ocr_regs.yml; python tools/regmap.py --check verifies that they are current.
olo_axi_lite_slave converts the AXI4-Lite transactions into single-cycle register bus accesses; the register file
answers a read in the next cycle. All registers are in Clk (D1).
2. Key load¶
| Step | Register file | Key table |
|---|---|---|
| 1 | KEY0 to KEY7 (4, 6 or 8 words), IV_FIXED, IV_COUNT_LO/HI written; they read as zero | |
| 2 | KEY_LOAD with START: load request with slot and IV construction, unless the slot is out of range or a load is pending | |
| 3 | M_Load_Valid with the staged values |
takes the load (M_Load_Ready), Kt_Busy = '1' |
| 4 | Staging registers cleared in the cycle of the acceptance | writes the slot, computes the hash subkey |
| 5 | LOAD_DONE event when Kt_Busy returns to '0' |
slot valid |
STATUS.BUSY is the OR of the pending request, the running load and Kt_Busy (erasure after the reset and zeroize).
ZEROIZE clears the staging registers and a pending request and gives a one-cycle Zeroize command to the key table.
The staging registers never hold a key longer than up to the acceptance of its load or the next zeroize.
3. Slot query¶
A write of SLOT_QUERY stores the slot number, sets PENDING and requests the query from the key table. The answer of
the key table is stored in the response registers (SLOT_STATUS, SLOT_FIXED, SLOT_COUNT) and clears PENDING. A slot
number of NumKeys_g or above reads as an erased slot: the response registers are cleared, whatever the key table
answers for the slot.
4. Counters and events¶
Evt_Valid marks every status that the data path writes. An OK status increments ENCRYPTIONS or DECRYPTIONS by its
direction, an error status the counter of its code and sets its event flag (EVENTS bits 0 to 7 for the codes 1 to
8). The counters are 32 bits wide and saturate. The SEC and DED events of the EDAC monitor set ECC_SEC and ECC_DED,
the end of a load LOAD_DONE. Irq is registered: it follows the OR of the enabled flags one cycle later.
5. EDAC monitor and error injection¶
| Channel | Source | Injection target |
|---|---|---|
| 0 to 10 | Data path: data, keystream, J0, hash, output, hash subkey, descriptor, summary, result, status FIFO, release buffer | 0 to 10 |
| 11, 12, 13 | Key table: read of the key, H and IV memory | 16, 17, 18 (next key load) |
| 14, 15, 16 | Key table: scrubbers of the key, H and IV memory | |
| 17 | Key table: job FIFO | 19 |
olo_ft_ecc_monitor counts SEC and DED per channel in 16-bit counters and keeps a sticky DED flag per channel.
ECC_INJECT forwards the target and the pattern ("01" single, "11" double error) with a one-cycle valid to the data path
(targets below 16) or to the key table (targets from 16).
6. Ports¶
| Port | Direction | Width | Description |
|---|---|---|---|
Clk, Rst |
in | 1 | Clock, synchronous high-active reset |
S_AxiLite_* |
8-bit address, 32-bit data | AXI4-Lite slave | |
Irq |
out | 1 | Interrupt |
M_Load_*, Zeroize, Kt_Busy |
out, out, in | Key load, zeroize command and busy flag of the key table | |
M_Query_*, S_Query_* |
out, in | Slot query and its answer | |
Evt_Valid, Evt_Code, Evt_Decrypt |
in | 1, 4, 1 | Status of every message |
Ecc_Sec, Ecc_Ded |
in | 18 | ECC events of the channels (section 5) |
Gcm_ErrInj_Sel, Kt_ErrInj_Sel, ErrInj_BitFlip, Gcm_ErrInj_Valid, Kt_ErrInj_Valid |
out | 4, 2, 2, 1, 1 | Error injection |