
Exception Handling Registers
6-5
Since the processor is pipelined, there is no guarantee that all processor
and associated system states will remain completely unchanged after the
possibly incomplete execution of the instruction that immediately follows
the instruction that caused an exception. State changes can occur under
the following conditions:
Instructions might have been read from memory and loaded into the
I-cache.
The D-cache might have been updated on a cacheable, memory
write operation before a bus error for that write transaction could halt
execution.
The above events can normally be ignored because the machine’s state
is restored sufficiently to allow execution to resume properly after the
exception has been serviced.
6.2 Exception Handling Registers
The TR4101 uses four internal registers to handle exceptions. During
exception processing, software can examine these registers to determine
the cause of an exception and the state of the TR4101.
The MMU also helps the TR4101 to handle exceptions. Since the MMU
is not implemented as part of the TR4101 Microprocessor Core, the
MMU registers (EntryHi, EntryLo, Index, Random, BadVA, and Context)
are implemented only when an external MMU is attached to the TR4101.
The TR4101 CBus interface includes signals for attaching an MMU as
an external part of Coprocessor 0. The registers in the external MMU are
accessed as if they were part of the TR4101 core, and the TR4101 maps
these accesses to the registers in the MMU. For information about the
MMU registers, you should refer to Chapter 4 of the TinyRISC TR4101
Building Blocks Technical Manual
The only way to access the internal CP0 registers is by using the move
from and to coprocessor zero instructions, MFC0 and MTC0. The
transaction protocols initiated by MFC0 and MTC0 to these integrated
CP0 registers do not resemble the MFC/MTC instructions for external
coprocessors, because the CP0 is integrated into the TR4101, allowing
direct access to the internal data flow.