EP0945787A2

Risc microprocessor architecture implementing fast trap and exception state

Abstract

Fast trap mechanism for a microprocessor, wherein a vector trap table is maintained which contains space for a plurality of instructions in each table entry. When a fast trap occurs, control is transferred directly into the table entry corresponding to the trap number. The trap handler can be located completely inside the table entry, or it can transfer control to additional handler code.

EP0945787A2, drawing sheet 1
Sheet 1 of 16

Term

Term ended

Projected expiry passed 7 July 2012, 14.2 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

6 claims: 2 independent, 4 dependent

  1. 1
    An apparatus for handling traps in a microprocessor (100), comprising:means for prefetching an instruction;a main buffer (188) to store said prefetched instruction if it is from a main instruction stream;a target buffer (190) to store said prefetched instruction if it is from a branch instruction stream;an emulation buffer (192) to store a trap handler if said prefetched instruction causes an exception, regardless of whether said prefetched instruction was stored in said main buffer (188) or said target buffer (190);and means (266) for determining whether said prefetched instruction should be placed in said main buffer, said target buffer or said emulation buffer;in the event that said prefetched instruction is part of said trap handler.
  2. 4
    A method for use in a microprocessor (100), comprising the steps of:fetching instructions from a main instruction stream and storing them in a main buffer section (188) of a prefetch buffer (260);executing said instructions from said main buffer (188);in response to a procedural or branch target instruction in said main instruction stream, (a) fetching further instructions from an emulation or a branch target instruction stream and storing them in a procedural buffer section (192) of the prefetch buffer (260) or a target buffer section (190) of the prefetch buffer, respectively;(b) executing said further instructions, while maintaining said instructions in said main buffer (188) that follow said procedural or target instruction so that they do not have to be refetched and an indication of a first return address to said main instruction stream;in response to a synchronous exception occurring relative to a given instruction in said main instruction steam, (a) fetching a first handler instruction stream and storing it in the procedural buffer section (192) of the prefetch buffer (260);(b) executing instructions from said first handler instruction stream, while maintaining said instructions in said main buffer (188) that follow said given instruction so that they do not have to be refetched and an indication of a second return address to said main instruction stream;and in response to a synchronous exception occurring relative to a further given instruction in said emulation or said branch target instruction stream, (a) fetching a second handler instruction stream and storing it in the procedural buffer section (192) of the prefetch buffer;(b) executing instructions from said second handler instruction stream, while maintaining both an indication of a third return address to said emulation or said branch target instruction stream and said indication of said first return address to said main instruction stream.