Instruction Fetch

class ember.front.fetch.FetchUnit(*args, src_loc_at=0, **kwargs)

Instruction fetch logic.

Instruction fetch is responsible for handling requests to bring instruction bytes into the pipeline from the L1I cache.

There are two cases where a request cannot be completed:

  1. A miss in the TLB causes the request to stall for the availability of the associated physical address. This causes a PTW request.

  2. A miss in the L1I cache causes the request to stall for the availability of the associated cacheline. This causes an L1I fill request.

Ports:
elaborate_s0(m: Module)

Instruction Fetch - Stage #0

  1. Drive inputs to the L1I arrays and to the TLB.

  2. Results from the L1I arrays and TLB are available on the next cycle.

elaborate_s1(m: Module)

Instruction Fetch - Stage #1

  1. If we’re handling a passthrough request, output from TLB will be invalid. Instead, we use the VPN to select a matching cache way.

  2. Valid output from the TLB will either indicate a hit or a miss. When a hit occurs, use the PPN to select a matching cache way. When a miss occurs, send a request to the PTW.

  3. If a matching cache way is found, respond with the hitting line. If no match occurs, send a request to the L1I fill interface. The way index is selected with an LFSR.

class ember.uarch.fetch.FTQIndex(param: EmberParams)

An index into the FTQ.

class ember.uarch.fetch.FetchResponseStatus(value, *args, **kwargs)

Status of a fetch request that has passed through the IFU.

Values:
  • NONE

  • L1_HIT – Request hit in the L1 instruction cache

  • L1_MISS – Request missed in the L1 instruction cache

  • TLB_MISS – Request missed in the L1I TLB

class ember.uarch.fetch.FetchRequest(p: EmberParams)

A request to fetch a cache line at some virtual address.

Members:
  • vaddr – Virtual address of the requested cacheline

  • passthru – Bypass virtual-to-physical translation

class ember.uarch.fetch.FetchResponse(p: EmberParams)

Response to a fetch request.

Members:
  • valid – This response is valid

  • vaddr – Virtual address associated with this response

  • sts (FetchResponseStatus) – Status associated with this response

  • data – Response data (an L1I cache line)

  • ftq_idx – FTQ index responsible for the associated request