SPRUJB6B November 2024 – May 2025 AM2612
The MAU has two error states, “error” and “panic”. Errors conditions are those which may be caused by illegal commands or out-of-bounds data, such as:
Errors can be cleared by asserting the ‘flush’ input to the MAU. If flush is asserted, then any error condition will be cleared and the MAU’s state will be flushed (as if by a FLUSH) command.
By contrast, panic conditions are the result of accidental or malicious hardware faults, or of bugs in the MAU design. They are triggered when internal control-path values have illegal or undefined values. Panics cannot be cleared except by (synchronously or asynchronously) resetting the core.
An error on one command will not interrupt the side effects of earlier commands (such as writing RAM or external conditions) – it will wait until the command is complete before halting the MAU and triggering the error signal. An error may prevent an earlier command from writing the scratchpad, but the scratchpad is erased anyway when the error is flushed.
The reverse is not true: because the MCG is pipelined, an arithmetic error in an earlier command can interrupt the side effects of a later one. This is because an arithmetic error might not be detected until the earlier command has reached the end of the pipeline, at which point the later command may already have produced side effects. When the MAU produces an error, it writes an error code into PKE_STATUS[23:16] according to the following table. This is a flag register: it is possible in extreme cases for more than one error to occur. For example, an illegal command and an overflow error can occur at the same time, since they are triggered in different pipeline stages.
| PKE_STATUS Bit | Meaning |
|---|---|
| 16 | INT_DIV_SMALL_EXACT did not divide exactly |
| 17 |
Arithmetic overflow or underflow: During reduction, after adding or subtracting the modulus, result was not expressible as a MAU_WORD*length+1 bits signed number. Integer addition result exceeded MAU_WORD*length bits Integer subtraction result was negative. Canonicalization failed because result+modulus was negative. |
| 18 | Read from PRNG, but the PRNG was not seeded |
| 19 | Memory read error |
| 20 |
Error related to even modulus: Montgomery multiply or square with even modulus INT_DIV_SMALL_EXACT with even divisor |
| 21 |
Any error detected during decode. Invalid opcode External user tried to issue MCG_READ Invalid special prime enumeration Memory reference does not lie in any region. Memory reference does not all lie in one region Command tells us to write to ROM, const or RNG SET_RAM_SLOTS with pointer not to RAM SET_ROM_SLOTS with pointer not to ROM Modular arithmetic with no modulus set Multiply, copy or INT_DIV_SMALL_EXACT with no multiplicand set Length is too short or too long (e.g., not between MAU_MIN_LENGTH and MAU_MAX _LENGTH). Scratchpad length does not match command’s length, for commands that require this (e.g., STORE) |