src/node_stage.c
void node_issue(Stage_Data* src_sd) {
  Flag on_path = FALSE;
  uns  ii;

  /* if nothing to process, return */
  if(src_sd->op_count == 0)
    return;

  // Go through all the ops in the issue buffer and stick them into the Node
  // Table.
  // We will stick them into the RS later
  for(ii = 0; ii < src_sd->max_op_count; ii++) {
    /* if node table is full, stall */
    if(is_node_table_full()) {
      collect_node_table_full_stats(node->node_head);
      rob_block_issue_reason = ROB_BLOCK_ISSUE_FULL;
      return;
    }
    rob_block_issue_reason = ROB_BLOCK_ISSUE_NONE;

    // If it is not full, issue the next op
    Op* op = src_sd->ops[ii];
    if(!op)
      continue;

    ASSERT(node->proc_id, node->proc_id == op->proc_id);
    /* check if it's a synchronizing op that can't issue  */
    if((op->table_info->bar_type & BAR_ISSUE) && (node->node_count > 0))
      break;

    /* remove op from previous stage */
    src_sd->ops[ii] = NULL;
    src_sd->op_count--;
    ASSERT(node->proc_id, src_sd->op_count >= 0);

    /* set op fields */
    op->node_id     = node->node_count;
    op->issue_cycle = cycle_count;

    /* add to node list & update node state*/
    ASSERT(node->proc_id, !op->in_node_list);
    if(node->node_tail)
      node->node_tail->next_node = op;
    if(node->node_head == NULL)
      node->node_head = op;
    op->next_node    = NULL;
    op->in_node_list = TRUE;
    node->node_tail  = op;

    STAT_EVENT(node->proc_id, OP_ISSUED);

    if(!node->next_op_into_rs)    /* if there are no ops waiting to enter RS */
      node->next_op_into_rs = op; /* this will be the first one */

    node->node_count++;
    ASSERTM(node->proc_id, node->node_count <= NODE_TABLE_SIZE,
            "node_count: %d src_max_op_count: %d src_op_count: %d\n",
            node->node_count, src_sd->max_op_count, src_sd->op_count);

    on_path |= !op->off_path;

    DEBUG(node->proc_id, "Issuing the op op_num:%s off_path:%d\n",
          unsstr64(op->op_num), op->off_path);

    op->state = OS_ISSUED;

    /* always stop issuing after a synchronizing op */
    if(op->table_info->bar_type & BAR_ISSUE)
      break;
  }
}
/**************************************************************************************/
/* node_issue:This function takes ops from the map stage and allocates them into
 *    the node table. Note, this function does not place the Op in the RS, that
 * is done later.*/
This function takes ops from the map stage and allocates them into
the node table. Note, this function does not place the Op in the RS, that
is done later.
This function takes ops from the map stage and allocates them into the node table . Note this function does not place the Op in the RS that is done later .
void node_issue(Stage_Data* src_sd) {
  Flag on_path = FALSE;
  uns  ii;
  if(src_sd->op_count == 0)
    return;
  for(ii = 0; ii < src_sd->max_op_count; ii++) {
    if(is_node_table_full()) {
      collect_node_table_full_stats(node->node_head);
      rob_block_issue_reason = ROB_BLOCK_ISSUE_FULL;
      return;
    }
    rob_block_issue_reason = ROB_BLOCK_ISSUE_NONE;
    Op* op = src_sd->ops[ii];
    if(!op)
      continue;
    ASSERT(node->proc_id, node->proc_id == op->proc_id);
    if((op->table_info->bar_type & BAR_ISSUE) && (node->node_count > 0))
      break;
    src_sd->ops[ii] = NULL;
    src_sd->op_count--;
    ASSERT(node->proc_id, src_sd->op_count >= 0);
    op->node_id     = node->node_count;
    op->issue_cycle = cycle_count;
    ASSERT(node->proc_id, !op->in_node_list);
    if(node->node_tail)
      node->node_tail->next_node = op;
    if(node->node_head == NULL)
      node->node_head = op;
    op->next_node    = NULL;
    op->in_node_list = TRUE;
    node->node_tail  = op;
    STAT_EVENT(node->proc_id, OP_ISSUED);
    if(!node->next_op_into_rs)    
      node->next_op_into_rs = op; 
    node->node_count++;
    ASSERTM(node->proc_id, node->node_count <= NODE_TABLE_SIZE,
            "node_count: %d src_max_op_count: %d src_op_count: %d\n",
            node->node_count, src_sd->max_op_count, src_sd->op_count);
    on_path |= !op->off_path;
    DEBUG(node->proc_id, "Issuing the op op_num:%s off_path:%d\n",
          unsstr64(op->op_num), op->off_path);
    op->state = OS_ISSUED;
    if(op->table_info->bar_type & BAR_ISSUE)
      break;
  }
}
void node_issue ( Stage_Data * src_sd ) { Flag on_path = FALSE ; uns ii ; if ( src_sd -> op_count == 0 ) return ; for ( ii = 0 ; ii < src_sd -> max_op_count ; ii ++ ) { if ( is_node_table_full ( ) ) { collect_node_table_full_stats ( node -> node_head ) ; rob_block_issue_reason = ROB_BLOCK_ISSUE_FULL ; return ; } rob_block_issue_reason = ROB_BLOCK_ISSUE_NONE ; Op * op = src_sd -> ops [ ii ] ; if ( ! op ) continue ; ASSERT ( node -> proc_id , node -> proc_id == op -> proc_id ) ; if ( ( op -> table_info -> bar_type & BAR_ISSUE ) && ( node -> node_count > 0 ) ) break ; src_sd -> ops [ ii ] = NULL ; src_sd -> op_count -- ; ASSERT ( node -> proc_id , src_sd -> op_count >= 0 ) ; op -> node_id = node -> node_count ; op -> issue_cycle = cycle_count ; ASSERT ( node -> proc_id , ! op -> in_node_list ) ; if ( node -> node_tail ) node -> node_tail -> next_node = op ; if ( node -> node_head == NULL ) node -> node_head = op ; op -> next_node = NULL ; op -> in_node_list = TRUE ; node -> node_tail = op ; STAT_EVENT ( node -> proc_id , OP_ISSUED ) ; if ( ! node -> next_op_into_rs ) node -> next_op_into_rs = op ; node -> node_count ++ ; ASSERTM ( node -> proc_id , node -> node_count <= NODE_TABLE_SIZE , " \n " , node -> node_count , src_sd -> max_op_count , src_sd -> op_count ) ; on_path |= ! op -> off_path ; DEBUG ( node -> proc_id , " \n " , unsstr64 ( op -> op_num ) , op -> off_path ) ; op -> state = OS_ISSUED ; if ( op -> table_info -> bar_type & BAR_ISSUE ) break ; } }
node_issue:This function takes ops from the map stage and allocates them into
    the node table.
node_issue : This function takes ops from the map stage and allocates them into the node table .
/* if nothing to process, return */ // Go through all the ops in the issue buffer and stick them into the Node // Table. // We will stick them into the RS later /* if node table is full, stall */ // If it is not full, issue the next op /* check if it's a synchronizing op that can't issue  */ /* remove op from previous stage */ /* set op fields */ /* add to node list & update node state*/ /* if there are no ops waiting to enter RS */ /* this will be the first one */ /* always stop issuing after a synchronizing op */