![](http://datasheet.mmic.net.cn/370000/TR4101_datasheet_16743144/TR4101_129.png)
TR4101 Exception Details and Handling
6-39
Loads the EPC register and the BD bit of the Cause register with
values as described in Section 6.3.5, “EPC Register and BD Bit
Values,” on page 6-31. These values indicate the instruction mode
and which instruction was executing when the exception occurred.
For a bus error exception to be precisely attributed to the instruction that
caused it (by precisely setting either the IBE or DBE code), the TR4101
must still be in the pipeline stage relevant to the bus error type. For data
bus errors, the TR4101 must still be in the X2 stage of the instruction
causing the bus error. For instruction bus errors, the TR4101 must still
be in the IF stage.
Buffering stores to main memory and using the load-scheduling feature
allow the TR4101 to continue execution of further instructions without
waiting for loads and stores to be completed. In these cases, assertion
of BBEP is considered an asynchronous event. For asynchronous bus
errors, the TR4101 may assign either the DBE code or the IBE code,
since the scheduled load or buffered write can occur in any pipeline
stage. If the scheduled load or buffered write occur in another
instruction's X2 stage, the TR4101 writes the DBE code into the Cause
register, otherwise, it writes the IBE code.
Bus errors for unscheduled loads, instruction fetches, and unbuffered
writes are considered synchronous. In this case, data bus error (DBE)
and instruction bus error (IBE) codes are assigned to the respective bus
errors.
If it is desirable to have precise bus error recognition, it is important that
load scheduling and write buffering not be implemented in the target
system. The BBCC building block implements both load scheduling and
write buffering. Therefore, systems using the BBCC building block will in
many cases have imprecise bus error exceptions. For more information
on the BBCC building block, please refer to Chapter 4 in the TinyRISC
TR4101 Building Blocks Technical Manual
Servicing –
The physical address where the fault occurred can be
computed from the information in the CP0 registers. The address of the
instruction in question is contained in the EPC register, unless the EPC
and BD bit rules state that the EPC points to another instruction. In this
case you must adjust the value in the EPC register by the amount in the
“EPC Adjustment” column of Table 6.6. (See Section 6.3.5, “EPC
Register and BD Bit Values,” on page 6-31.)