06-16-09-FTRAP

From Msim

Jump to: navigation, search

This refers to the requirement that F_TRAP instructions must wait for the ROB to drain before they can be renamed.

Old Code

//drain ROB for TRAPs and system calls
if(MD_OP_FLAGS(op) & F_TRAP)
{
 /* else, syscall is only instruction in the machine, at this
 point we should not be in (mis-)speculative mode */
 if(contexts[disp_context_id].spec_mode)
 {
  /* then stall: it will be flushed anyway */
  contexts_left.erase(contexts_left.begin()+current_context);
  if(contexts_left.empty())
   break;
  current_context%=contexts_left.size();
  continue;
 }
}

New Code

If spec_mode is set, then the ROB can't be empty (assuming that only branch mispredictions cause spec_mode to be set). The check is no longer needed.

//drain ROB for TRAPs and system calls
if(MD_OP_FLAGS(op) & F_TRAP)
{
 //Must stall until all prior instructions are guaranteed not to generate exceptions
 if(contexts[disp_context_id].ROB_num != 0)
 {
  contexts_left.erase(contexts_left.begin()+current_context);
  if(contexts_left.empty())
   break;
  current_context%=contexts_left.size();
  continue;
 }
}
Personal tools