models/processor/zesto/ZPIPE-exec/exec-DPM.cpp
void core_exec_DPM_t::insert_ready_uop(struct uop_t * const uop)
{
  struct core_knobs_t * knobs = core->knobs;

#ifdef ZDEBUG
	fprintf(stdout,"\n[%lld][Core%d]EXEC MOP=%d UOP=%d in Insert readyQ %d in_fusion %d ",core->sim_cycle,core->id,uop->decode.Mop_seq,uop->decode.uop_seq,uop->alloc.port_assignment,uop->decode.in_fusion);
	fflush(stdout);
#endif

  zesto_assert((uop->alloc.port_assignment >= 0) && (uop->alloc.port_assignment < knobs->exec.num_exec_ports),(void)0);
  zesto_assert(uop->timing.when_completed == TICK_T_MAX,(void)0);
  zesto_assert(uop->timing.when_exec == TICK_T_MAX,(void)0);
  zesto_assert(uop->timing.when_issued == TICK_T_MAX,(void)0);
  zesto_assert(!uop->exec.in_readyQ,(void)0);

  struct readyQ_node_t ** RQ = &port[uop->alloc.port_assignment].readyQ;
  struct readyQ_node_t * new_node = get_readyQ_node();
  new_node->uop = uop;
  new_node->uop_seq = uop->decode.uop_seq;
  uop->exec.in_readyQ = true;
  uop->exec.action_id = core->new_action_id();
  new_node->action_id = uop->exec.action_id;

  if(!*RQ) /* empty ready queue */
  {
    *RQ = new_node;
    return;
  }

  struct readyQ_node_t * current = *RQ, * prev = NULL;

  /* insert in age order: first find insertion point */
  while(current && (current->uop_seq < uop->decode.uop_seq))
  {
    prev = current;
    current = current->next;
  }

  if(!prev) /* uop is oldest */
  {
    new_node->next = *RQ;
    *RQ = new_node;
  }
  else
  {
    new_node->next = current;
    prev->next = new_node;
  }
}
/* Add the uop to the corresponding readyQ (based on port binding - we maintain
   one readyQ per execution port) */
Add the uop to the corresponding readyQ (based on port binding - we maintain
one readyQ per execution port)
Add the uop to the corresponding readyQ ( based on port binding - we maintain one readyQ per execution port )
void core_exec_DPM_t::insert_ready_uop(struct uop_t * const uop)
{
  struct core_knobs_t * knobs = core->knobs;
#ifdef ZDEBUG
	fprintf(stdout,"\n[%lld][Core%d]EXEC MOP=%d UOP=%d in Insert readyQ %d in_fusion %d ",core->sim_cycle,core->id,uop->decode.Mop_seq,uop->decode.uop_seq,uop->alloc.port_assignment,uop->decode.in_fusion);
	fflush(stdout);
#endif
  zesto_assert((uop->alloc.port_assignment >= 0) && (uop->alloc.port_assignment < knobs->exec.num_exec_ports),(void)0);
  zesto_assert(uop->timing.when_completed == TICK_T_MAX,(void)0);
  zesto_assert(uop->timing.when_exec == TICK_T_MAX,(void)0);
  zesto_assert(uop->timing.when_issued == TICK_T_MAX,(void)0);
  zesto_assert(!uop->exec.in_readyQ,(void)0);
  struct readyQ_node_t ** RQ = &port[uop->alloc.port_assignment].readyQ;
  struct readyQ_node_t * new_node = get_readyQ_node();
  new_node->uop = uop;
  new_node->uop_seq = uop->decode.uop_seq;
  uop->exec.in_readyQ = true;
  uop->exec.action_id = core->new_action_id();
  new_node->action_id = uop->exec.action_id;
  if(!*RQ) 
  {
    *RQ = new_node;
    return;
  }
  struct readyQ_node_t * current = *RQ, * prev = NULL;
  while(current && (current->uop_seq < uop->decode.uop_seq))
  {
    prev = current;
    current = current->next;
  }
  if(!prev) 
  {
    new_node->next = *RQ;
    *RQ = new_node;
  }
  else
  {
    new_node->next = current;
    prev->next = new_node;
  }
}
void core_exec_DPM_t :: insert_ready_uop ( struct uop_t * const uop ) { struct core_knobs_t * knobs = core -> knobs ; #ifdef ZDEBUG fprintf ( stdout , " \n " , core -> sim_cycle , core -> id , uop -> decode . Mop_seq , uop -> decode . uop_seq , uop -> alloc . port_assignment , uop -> decode . in_fusion ) ; fflush ( stdout ) ; #endif zesto_assert ( ( uop -> alloc . port_assignment >= 0 ) && ( uop -> alloc . port_assignment < knobs -> exec . num_exec_ports ) , ( void ) 0 ) ; zesto_assert ( uop -> timing . when_completed == TICK_T_MAX , ( void ) 0 ) ; zesto_assert ( uop -> timing . when_exec == TICK_T_MAX , ( void ) 0 ) ; zesto_assert ( uop -> timing . when_issued == TICK_T_MAX , ( void ) 0 ) ; zesto_assert ( ! uop -> exec . in_readyQ , ( void ) 0 ) ; struct readyQ_node_t * * RQ = & port [ uop -> alloc . port_assignment ] . readyQ ; struct readyQ_node_t * new_node = get_readyQ_node ( ) ; new_node -> uop = uop ; new_node -> uop_seq = uop -> decode . uop_seq ; uop -> exec . in_readyQ = true ; uop -> exec . action_id = core -> new_action_id ( ) ; new_node -> action_id = uop -> exec . action_id ; if ( ! * RQ ) { * RQ = new_node ; return ; } struct readyQ_node_t * current = * RQ , * prev = NULL ; while ( current && ( current -> uop_seq < uop -> decode . uop_seq ) ) { prev = current ; current = current -> next ; } if ( ! prev ) { new_node -> next = * RQ ; * RQ = new_node ; } else { new_node -> next = current ; prev -> next = new_node ; } }
Add the uop to the corresponding readyQ (based on port binding - we maintain
one readyQ per execution port)
Add the uop to the corresponding readyQ ( based on port binding - we maintain one readyQ per execution port )
/* empty ready queue */ /* insert in age order: first find insertion point */ /* uop is oldest */