void simpledisk_bus_delay_complete (int devno, ioreq_event *curr, int sentbusno)
{
   simpledisk_t *currdisk;
   intchar slotno;
   intchar busno;
   int depth;

   currdisk = getsimpledisk (devno);

   // fprintf (outputfile, "Entered disk_bus_delay_complete\n");

   if (curr == currdisk->buswait) {
      currdisk->buswait = curr->next;
   } else {
      ioreq_event *tmp = currdisk->buswait;
      while ((tmp->next != NULL) && (tmp->next != curr)) {
         tmp = tmp->next;
      }
      if (tmp->next != curr) {
         fprintf(stderr, "Bus delay complete for unknown simpledisk request - devno %d, busno %d\n", devno, busno.value);
         exit(1);
      }
      tmp->next = curr->next;
   }
   busno.value = curr->busno;
   slotno.value = curr->slotno;
   depth = currdisk->depth[0];
   slotno.byte[depth] = slotno.byte[depth] >> 4;
   curr->time = 0.0;
   if (depth == 0) {
      intr_request ((event *)curr);
   } else {
      bus_deliver_event(busno.byte[depth], slotno.byte[depth], curr);
   }
}
Beispiel #2
0
static void iodriver_send_event_down_path (ioreq_event *curr)
{
   intchar busno;
   intchar slotno;

   busno.value = curr->busno;
   slotno.value = curr->slotno;
   slotno.byte[0] = slotno.byte[0] & 0x0F;
#ifdef DEBUG_IODRIVER
   fprintf (outputfile, "%f: iodriver_send_event_down_path: busno %d, slotno %d, type=%d\n", simtime, busno.byte[0], slotno.byte[0], curr->type);
#endif
   bus_deliver_event(busno.byte[0], slotno.byte[0], curr);
}
static void iodriver_send_event_down_path (ioreq_event *curr)
{
   intchar busno;
   intchar slotno;

   busno.value = curr->busno;
   slotno.value = curr->slotno;
   slotno.byte[0] = slotno.byte[0] & 0x0F;
/*
fprintf (outputfile, "iodriver_send_event_down_path: busno %d, slotno %d\n", busno.byte[0], slotno.byte[0]);
*/
   bus_deliver_event(busno.byte[0], slotno.byte[0], curr);
}
Beispiel #4
0
void controller_passthru_event_arrive (controller *currctlr, ioreq_event *curr)
{
    int busno;
    int slotno;

#ifdef DEBUG_CTLRDUMB
    dumpIOReq("controller_passthru_event_arrive", curr );
    fflush(outputfile );
#endif

    switch (curr->type) {

    case IO_INTERRUPT_COMPLETE:
        currctlr->outbusowned = controller_get_downward_busno(currctlr, curr, NULL);
        controller_send_event_down_path(currctlr, curr, PASSTHRU_DELAY);
        currctlr->outbusowned = -1;
        break;

    case IO_ACCESS_ARRIVE:
        /*
        fprintf (outputfile, "Following passthru_event path, and passing access down\n");
        */
        controller_send_event_down_path(currctlr, curr, PASSTHRU_DELAY);
        break;

    case IO_INTERRUPT_ARRIVE:
        if (curr->cause == READY_TO_TRANSFER) {
            curr->cause = RECONNECT;
        }
        controller_send_event_up_path(currctlr, curr, PASSTHRU_DELAY);
        break;

    case DEVICE_DATA_TRANSFER_COMPLETE:
        controller_send_event_up_path(currctlr, curr, (double) 0.0);
        break;

    case IO_QLEN_MAXCHECK:
        busno = controller_get_downward_busno(currctlr, curr, &slotno);
        bus_deliver_event(busno, slotno, curr);
        break;

    default:
        fprintf(stderr, "Unknown event type arriving at passthru controller: %d\n", curr->type);
        exit(1);
    }
}
Beispiel #5
0
void controller_53c700_event_arrive (controller *currctlr, ioreq_event *curr)
{
    int busno;
    int slotno;

#ifdef DEBUG_CTLRDUMB
    dumpIOReq("controller_53c700_event_arrive", curr );
    fflush(outputfile );
#endif

    switch (curr->type) {

    case IO_ACCESS_ARRIVE:
        controller_53c700_request_arrive(currctlr, curr);
        break;

    case IO_INTERRUPT_ARRIVE:
        controller_53c700_interrupt_arrive(currctlr, curr);
        break;

    case IO_INTERRUPT_COMPLETE:
        controller_53c700_interrupt_complete(currctlr, curr);
        break;

    case DEVICE_DATA_TRANSFER_COMPLETE:
        controller_53c700_data_transfer(currctlr, curr);
        break;

    case CONTROLLER_DATA_TRANSFER_COMPLETE:
        controller_53c700_data_transfer_complete(currctlr, curr);
        break;

    case IO_QLEN_MAXCHECK:
        busno = controller_get_downward_busno(currctlr, curr, &slotno);
        bus_deliver_event(busno, slotno, curr);
        break;

    default:
        fprintf(stderr, "Unknown event type arriving at 53c700 controller: %d\n", curr->type);
        exit(1);
    }
}
Beispiel #6
0
void ssd_bus_delay_complete (int devno, ioreq_event *curr, int sentbusno)
{
   ssd_t *currdisk;
   intchar slotno;
   intchar busno;
   int depth;

   currdisk = getssd (devno);
   ssd_assert_current_activity(currdisk, curr);

   // fprintf (outputfile, "Entered ssd_bus_delay_complete\n");

   // EPW: I think the buswait logic doesn't do anything, is confusing, and risks
   // overusing the "next" field, although an item shouldn't currently be a queue.
   if (curr == currdisk->buswait) {
      currdisk->buswait = curr->next;
   } else {
      ioreq_event *tmp = currdisk->buswait;
      while ((tmp->next != NULL) && (tmp->next != curr)) {
         tmp = tmp->next;
      }
      if (tmp->next != curr) {
          // fixed a warning here
          //fprintf(stderr, "Bus delay complete for unknown ssd request - devno %d, busno %d\n", devno, busno.value);
          fprintf(stderr, "Bus delay complete for unknown ssd request - devno %d, busno %d\n", devno, curr->busno);
         exit(1);
      }
      tmp->next = curr->next;
   }
   busno.value = curr->busno;
   slotno.value = curr->slotno;
   depth = currdisk->depth[0];
   slotno.byte[depth] = slotno.byte[depth] >> 4;
   curr->time = 0.0;
   if (depth == 0) {
      intr_request ((event *)curr);
   } else {
      bus_deliver_event(busno.byte[depth], slotno.byte[depth], curr);
   }
}