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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_37/] [or1ksim/] [cpu/] [or1k/] [except.c] - Diff between revs 572 and 599

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

Rev 572 Rev 599
Line 65... Line 65...
}
}
 
 
/* Actually handles exception */
/* Actually handles exception */
void except_handle_backend (int except, unsigned long ea, unsigned long pc_saved)
void except_handle_backend (int except, unsigned long ea, unsigned long pc_saved)
{
{
  /* Ignore masked exceptions */
 
  if (! IS_NME(except) && (!(mfspr(SPR_SR) & SPR_SR_EXR))) {
 
    if (config.sim.verbose)
 
      printf("INFO: Exception occured while exception detection was disabled.\n");
 
    return;
 
  }
 
 
 
#if ONLY_VIRTUAL_MACHINE
#if ONLY_VIRTUAL_MACHINE
  fprintf(stderr, "WARNING: No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
  fprintf(stderr, "WARNING: No exception processing while ONLY_VIRTUAL_MACHINE is defined.\n");
  cont_run = 0;
  cont_run = 0;
#else
#else
 
 
Line 121... Line 114...
  mtspr(SPR_SR, mfspr(SPR_SR) & ~(SPR_SR_DME));
  mtspr(SPR_SR, mfspr(SPR_SR) & ~(SPR_SR_DME));
  mtspr(SPR_SR, mfspr(SPR_SR) & ~(SPR_SR_IME));
  mtspr(SPR_SR, mfspr(SPR_SR) & ~(SPR_SR_IME));
 
 
  mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_OVE);   /* Disable overflow flag exception. */
  mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_OVE);   /* Disable overflow flag exception. */
 
 
  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SUPV);   /* SUPV mode */
  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_SM);     /* SUPV mode */
  mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_EIR);   /* Disable interrupts. */
  mtspr(SPR_SR, mfspr(SPR_SR) & ~(SPR_SR_IEE | SPR_SR_TEE));    /* Disable interrupts. */
 
 
  clear_pending_exception ();
  clear_pending_exception ();
 
 
  pc = (unsigned long)except + (testsprbits (SPR_SR, SPR_SR_EP) ? 0xf0000000 : 0x00000000);
  pc = (unsigned long)except + (testsprbits (SPR_SR, SPR_SR_EPH) ? 0xf0000000 : 0x00000000);
 
 
  /* This has been removed. All exceptions (not just SYSCALL) suffer
  /* This has been removed. All exceptions (not just SYSCALL) suffer
     from the same problem. The solution is to continue just like
     from the same problem. The solution is to continue just like
     the pipeline would, and issue the exception on the next
     the pipeline would, and issue the exception on the next
     clock cycle. We assume now that this function is being called
     clock cycle. We assume now that this function is being called

powered by: WebSVN 2.1.0

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