Lecture 20 assignment

To help your prepare for Monday's paper (the Disco paper), you are asked to write pseudo code for three of Disco's subroutines whose specifications are given below. You should fill in the body of the subroutines, as your answer.

// Disco's tlb miss handler.
// Called when a memory refernce for virutal adddress
// 'VA' is made, but there is not VA->MA (virtual -> machine)
// mapping in the cpu's TLB.
tlb_miss_handler (VA)
{
}

// Disco's procedure which emulates the MIPS
// instruction which writes to the tlb.
//
// VA -- virtual addresss
// PA -- physical address (NOT MA machine address!)
emulate_tlbwrite_instruction (VA, PA)
{
}

// Disco's procedure which emulates the MIPS
// instruction which read the tlb.
//
emulate_tlbread_instruction (VA)
{
  // Hint: should this return a PA or an MA?
}