OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [tags/] [stable_0_2_0_rc3/] [or1ksim/] [pic/] [pic.c] - Diff between revs 1506 and 1545

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1506 Rev 1545
Line 62... Line 62...
  if(cpu_state.sprs[SPR_SR] & SPR_SR_IEE) {
  if(cpu_state.sprs[SPR_SR] & SPR_SR_IEE) {
    TRACE("Delivering interrupt on cycle %lli\n", runtime.sim.cycles);
    TRACE("Delivering interrupt on cycle %lli\n", runtime.sim.cycles);
    except_handle(EXCEPT_INT, cpu_state.sprs[SPR_EEAR_BASE]);
    except_handle(EXCEPT_INT, cpu_state.sprs[SPR_EEAR_BASE]);
  } else if(cpu_state.sprs[SPR_PICSR] & (1 << (int)dat))
  } else if(cpu_state.sprs[SPR_PICSR] & (1 << (int)dat))
    /* Reschedule only if the interrupt hasn't been cleared */
    /* Reschedule only if the interrupt hasn't been cleared */
    SCHED_ADD(pic_clock, dat, 1);
    sched_next_insn(pic_clock, dat);
}
}
 
 
/* WARNING: Don't eaven try and call this function *during* a simulated
/* WARNING: Don't eaven try and call this function *during* a simulated
 * instruction!! (as in during a read_mem or write_mem callback).  except_handle
 * instruction!! (as in during a read_mem or write_mem callback).  except_handle
 * assumes that this is the case, it breaks otherwise. */
 * assumes that this is the case, it breaks otherwise. */
Line 87... Line 87...
    if (cpu_state.sprs[SPR_SR] & SPR_SR_IEE) {
    if (cpu_state.sprs[SPR_SR] & SPR_SR_IEE) {
      TRACE("Delivering interrupt on cycle %lli\n", runtime.sim.cycles);
      TRACE("Delivering interrupt on cycle %lli\n", runtime.sim.cycles);
      except_handle(EXCEPT_INT, cpu_state.sprs[SPR_EEAR_BASE]);
      except_handle(EXCEPT_INT, cpu_state.sprs[SPR_EEAR_BASE]);
    } else
    } else
      /* Interrupts not currently enabled, retry next clock cycle */
      /* Interrupts not currently enabled, retry next clock cycle */
      SCHED_ADD(pic_clock, (void *)line, 1);
      sched_next_insn(pic_clock, (void *)line);
  }
  }
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.