src/node_stage.c
void node_sched_ops() {
  Op* op;

  /* the next stage is supposed to clear them out, regardless of
     whether they are actually sent to a functional unit */
  ASSERT(node->proc_id, node->sd.op_count == 0);

  // Check to see if the L1 Q is (still) full
  check_if_mem_blocked();

  for(op = node->rdy_head; op; op = op->next_rdy) {
    ASSERT(node->proc_id, node->proc_id == op->proc_id);
    ASSERTM(node->proc_id, op->in_rdy_list, "op_num %llu\n", op->op_num);
    if(op->state == OS_WAIT_MEM) {
      if(node->mem_blocked)
        continue;
      else
        op->state = OS_READY;
    }
    if(op->state == OS_TENTATIVE || op->state == OS_WAIT_DCACHE)
      continue;
    ASSERTM(node->proc_id,
            op->state == OS_IN_RS || op->state == OS_READY ||
              op->state == OS_WAIT_FWD,
            "op_num: %llu, op_state: %s\n", op->op_num,
            Op_State_str(op->state));
    DEBUG(node->proc_id,
          "Scheduler examining    op_num:%s op:%s l1:%d st:%s rdy:%s exec:%s "
          "done:%s\n",
          unsstr64(op->op_num), disasm_op(op, TRUE), op->engine_info.l1_miss,
          Op_State_str(op->state), unsstr64(op->rdy_cycle),
          unsstr64(op->exec_cycle), unsstr64(op->done_cycle));


    /* op will be ready next cycle, try to schedule  */
    if(cycle_count >= op->rdy_cycle - 1) {
      ASSERT(node->proc_id, op->srcs_not_rdy_vector == 0x0);
      DEBUG(node->proc_id, "Scheduler considering  op_num:%s op:%s l1:%d\n",
            unsstr64(op->op_num), disasm_op(op, TRUE), op->engine_info.l1_miss);

      // Put your own scheduling algorithm here
      if(OLDEST_FIRST_SCHED) {
        oldest_first_sched(op);
      } else {
        // oldest first is currently the only scheduling algorithm
        oldest_first_sched(op);
      }
    }
  }
}
/**************************************************************************************/
/* node_sched_ops: schedule read ops (ops that are currently in the ready list).
 *   All of the scheduling algs take the ready_list as input and produce
 * node->sd as output. node->sd are the ops that are being passed to the
 * functional units. If the FUs are availible, they will grab the op and it
 * will be removed from the ready_list. If they are not available, then the op
 * will remain in the ready_list for the next round of scheduling. There is
 * only one ready list that holds all of the ops that are ready from each of
 * the reservation stations.*/
schedule read ops (ops that are currently in the ready list).
All of the scheduling algs take the ready_list as input and produce
node->sd as output. node->sd are the ops that are being passed to the
functional units. If the FUs are availible, they will grab the op and it
will be removed from the ready_list. If they are not available, then the op
will remain in the ready_list for the next round of scheduling. There is
only one ready list that holds all of the ops that are ready from each of
the reservation stations.
schedule read ops ( ops that are currently in the ready list ) . All of the scheduling algs take the ready_list as input and produce node - > sd as output . node - > sd are the ops that are being passed to the functional units . If the FUs are availible they will grab the op and it will be removed from the ready_list . If they are not available then the op will remain in the ready_list for the next round of scheduling . There is only one ready list that holds all of the ops that are ready from each of the reservation stations .
void node_sched_ops() {
  Op* op;
  ASSERT(node->proc_id, node->sd.op_count == 0);
  check_if_mem_blocked();
  for(op = node->rdy_head; op; op = op->next_rdy) {
    ASSERT(node->proc_id, node->proc_id == op->proc_id);
    ASSERTM(node->proc_id, op->in_rdy_list, "op_num %llu\n", op->op_num);
    if(op->state == OS_WAIT_MEM) {
      if(node->mem_blocked)
        continue;
      else
        op->state = OS_READY;
    }
    if(op->state == OS_TENTATIVE || op->state == OS_WAIT_DCACHE)
      continue;
    ASSERTM(node->proc_id,
            op->state == OS_IN_RS || op->state == OS_READY ||
              op->state == OS_WAIT_FWD,
            "op_num: %llu, op_state: %s\n", op->op_num,
            Op_State_str(op->state));
    DEBUG(node->proc_id,
          "Scheduler examining    op_num:%s op:%s l1:%d st:%s rdy:%s exec:%s "
          "done:%s\n",
          unsstr64(op->op_num), disasm_op(op, TRUE), op->engine_info.l1_miss,
          Op_State_str(op->state), unsstr64(op->rdy_cycle),
          unsstr64(op->exec_cycle), unsstr64(op->done_cycle));
    if(cycle_count >= op->rdy_cycle - 1) {
      ASSERT(node->proc_id, op->srcs_not_rdy_vector == 0x0);
      DEBUG(node->proc_id, "Scheduler considering  op_num:%s op:%s l1:%d\n",
            unsstr64(op->op_num), disasm_op(op, TRUE), op->engine_info.l1_miss);
      if(OLDEST_FIRST_SCHED) {
        oldest_first_sched(op);
      } else {
        oldest_first_sched(op);
      }
    }
  }
}
void node_sched_ops ( ) { Op * op ; ASSERT ( node -> proc_id , node -> sd . op_count == 0 ) ; check_if_mem_blocked ( ) ; for ( op = node -> rdy_head ; op ; op = op -> next_rdy ) { ASSERT ( node -> proc_id , node -> proc_id == op -> proc_id ) ; ASSERTM ( node -> proc_id , op -> in_rdy_list , " \n " , op -> op_num ) ; if ( op -> state == OS_WAIT_MEM ) { if ( node -> mem_blocked ) continue ; else op -> state = OS_READY ; } if ( op -> state == OS_TENTATIVE || op -> state == OS_WAIT_DCACHE ) continue ; ASSERTM ( node -> proc_id , op -> state == OS_IN_RS || op -> state == OS_READY || op -> state == OS_WAIT_FWD , " \n " , op -> op_num , Op_State_str ( op -> state ) ) ; DEBUG ( node -> proc_id , " " " \n " , unsstr64 ( op -> op_num ) , disasm_op ( op , TRUE ) , op -> engine_info . l1_miss , Op_State_str ( op -> state ) , unsstr64 ( op -> rdy_cycle ) , unsstr64 ( op -> exec_cycle ) , unsstr64 ( op -> done_cycle ) ) ; if ( cycle_count >= op -> rdy_cycle - 1 ) { ASSERT ( node -> proc_id , op -> srcs_not_rdy_vector == 0x0 ) ; DEBUG ( node -> proc_id , " \n " , unsstr64 ( op -> op_num ) , disasm_op ( op , TRUE ) , op -> engine_info . l1_miss ) ; if ( OLDEST_FIRST_SCHED ) { oldest_first_sched ( op ) ; } else { oldest_first_sched ( op ) ; } } } }
node_sched_ops: schedule read ops (ops that are currently in the ready list).
node_sched_ops : schedule read ops ( ops that are currently in the ready list ) .
/* the next stage is supposed to clear them out, regardless of
     whether they are actually sent to a functional unit */ // Check to see if the L1 Q is (still) full /* op will be ready next cycle, try to schedule  */ // Put your own scheduling algorithm here // oldest first is currently the only scheduling algorithm