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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [or1k/] [sprs.c] - Diff between revs 914 and 997

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

Rev 914 Rev 997
Line 68... Line 68...
      /* This is usually done to reissue an instruction
      /* This is usually done to reissue an instruction
         which just caused a breakpoint exception. */
         which just caused a breakpoint exception. */
      pc = value;
      pc = value;
 
 
      if(!value && config.sim.verbose)
      if(!value && config.sim.verbose)
        printf("WARNING: PC just set to 0!\n");
        PRINTF("WARNING: PC just set to 0!\n");
 
 
      /* Clear any pending delay slot jumps also */
      /* Clear any pending delay slot jumps also */
      delay_insn = 0;
      delay_insn = 0;
      pcnext = value + 4;
      pcnext = value + 4;
    }
    }
    break;
    break;
  case 0xFFFD:
  case 0xFFFD:
    fo = fopen ("audiosim.pcm", "wb+");
    fo = fopen ("audiosim.pcm", "wb+");
    if (!fo) printf("Cannot open audiosim.pcm\n");
    if (!fo) PRINTF("Cannot open audiosim.pcm\n");
    printf("Audio opened.\n");
    PRINTF("Audio opened.\n");
    break;
    break;
  case 0xFFFE:
  case 0xFFFE:
    if (!fo) printf("audiosim.pcm not opened\n");
    if (!fo) PRINTF("audiosim.pcm not opened\n");
    fputc (value & 0xFF, fo);
    fputc (value & 0xFF, fo);
    if ((audio_cnt % 1024) == 0)
    if ((audio_cnt % 1024) == 0)
      printf("%i\n", audio_cnt);
      PRINTF("%i\n", audio_cnt);
    audio_cnt++;
    audio_cnt++;
    break;
    break;
  case 0xFFFF:
  case 0xFFFF:
    fclose(fo);
    fclose(fo);
    printf("Audio closed.\n");
    PRINTF("Audio closed.\n");
    runtime.sim.cont_run = 0;
    runtime.sim.cont_run = 0;
    break;
    break;
        case SPR_PMR:
        case SPR_PMR:
          /* PMR[SDF] and PMR[DCGE] are ignored completely. */
          /* PMR[SDF] and PMR[DCGE] are ignored completely. */
          if (value & SPR_PMR_SUME) {
          if (value & SPR_PMR_SUME) {
                  printf ("SUSPEND: PMR[SUME] bit was set.\n");
                  PRINTF ("SUSPEND: PMR[SUME] bit was set.\n");
                  runtime.sim.cont_run = 0;
                  runtime.sim.cont_run = 0;
          }
          }
          break;
          break;
  default:
  default:
    /* Mask reseved bits in DTLBMR and DTLBMR registers */
    /* Mask reseved bits in DTLBMR and DTLBMR registers */
Line 136... Line 136...
}
}
 
 
/* Show status of important SPRs. */
/* Show status of important SPRs. */
void sprs_status()
void sprs_status()
{
{
  printf("VR   : 0x%.8x  UPR  : 0x%.8x\n", mfspr(SPR_VR), mfspr(SPR_UPR));
  PRINTF("VR   : 0x%.8x  UPR  : 0x%.8x\n", mfspr(SPR_VR), mfspr(SPR_UPR));
  printf("SR   : 0x%.8x\n", mfspr(SPR_SR));
  PRINTF("SR   : 0x%.8x\n", mfspr(SPR_SR));
  printf("MACLO: 0x%.8x  MACHI: 0x%.8x\n", mfspr(SPR_MACLO), mfspr(SPR_MACHI));
  PRINTF("MACLO: 0x%.8x  MACHI: 0x%.8x\n", mfspr(SPR_MACLO), mfspr(SPR_MACHI));
  printf("EPCR0: 0x%.8x  EPCR1: 0x%.8x\n", mfspr(SPR_EPCR_BASE), mfspr(SPR_EPCR_BASE+1));
  PRINTF("EPCR0: 0x%.8x  EPCR1: 0x%.8x\n", mfspr(SPR_EPCR_BASE), mfspr(SPR_EPCR_BASE+1));
  printf("EEAR0: 0x%.8x  EEAR1: 0x%.8x\n", mfspr(SPR_EEAR_BASE), mfspr(SPR_EEAR_BASE+1));
  PRINTF("EEAR0: 0x%.8x  EEAR1: 0x%.8x\n", mfspr(SPR_EEAR_BASE), mfspr(SPR_EEAR_BASE+1));
  printf("ESR0 : 0x%.8x  ESR1 : 0x%.8x\n", mfspr(SPR_ESR_BASE), mfspr(SPR_ESR_BASE+1));
  PRINTF("ESR0 : 0x%.8x  ESR1 : 0x%.8x\n", mfspr(SPR_ESR_BASE), mfspr(SPR_ESR_BASE+1));
  printf("TTMR : 0x%.8x  TTCR : 0x%.8x\n", mfspr(SPR_TTMR), mfspr(SPR_TTCR));
  PRINTF("TTMR : 0x%.8x  TTCR : 0x%.8x\n", mfspr(SPR_TTMR), mfspr(SPR_TTCR));
  printf("PICMR: 0x%.8x  PICSR: 0x%.8x\n", mfspr(SPR_PICMR), mfspr(SPR_PICSR));
  PRINTF("PICMR: 0x%.8x  PICSR: 0x%.8x\n", mfspr(SPR_PICMR), mfspr(SPR_PICSR));
  printf("PPC:   0x%.8x  NPC   : 0x%.8x\n", mfspr(SPR_PPC), mfspr(SPR_NPC));
  PRINTF("PPC:   0x%.8x  NPC   : 0x%.8x\n", mfspr(SPR_PPC), mfspr(SPR_NPC));
}
}
 
 
 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.