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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [cpu/] [or1k/] [sprs.c] - Diff between revs 19 and 98

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

Rev 19 Rev 98
Line 48... Line 48...
#include "pic.h"
#include "pic.h"
 
 
 
 
DECLARE_DEBUG_CHANNEL(immu);
DECLARE_DEBUG_CHANNEL(immu);
 
 
static int audio_cnt = 0;
 
 
 
static FILE *fo = 0;
 
 
 
/* Set a specific SPR with a value. */
/* Set a specific SPR with a value. */
void mtspr(uint16_t regno, const uorreg_t value)
void mtspr(uint16_t regno, const uorreg_t value)
{
{
  uorreg_t prev_val;
  uorreg_t prev_val;
 
 
Line 162... Line 158...
    break;
    break;
  case SPR_PICMR:
  case SPR_PICMR:
    if(cpu_state.sprs[SPR_SR] & SPR_SR_IEE)
    if(cpu_state.sprs[SPR_SR] & SPR_SR_IEE)
      pic_ints_en();
      pic_ints_en();
    break;
    break;
  case 0xFFFD:
 
    fo = fopen ("audiosim.pcm", "wb+");
 
    if (!fo) PRINTF("Cannot open audiosim.pcm\n");
 
    PRINTF("Audio opened.\n");
 
    break;
 
  case 0xFFFE:
 
    if (!fo) PRINTF("audiosim.pcm not opened\n");
 
    fputc (value & 0xFF, fo);
 
    if ((audio_cnt % 1024) == 0)
 
      PRINTF("%i\n", audio_cnt);
 
    audio_cnt++;
 
    break;
 
  case 0xFFFF:
 
    fclose(fo);
 
    PRINTF("Audio closed.\n");
 
    sim_done();
 
    break;
 
  case SPR_PMR:
  case SPR_PMR:
    /* PMR[SDF] and PMR[DCGE] are ignored completely. */
    /* PMR[SDF] and PMR[DCGE] are ignored completely. */
    if (config.pm.enabled && (value & SPR_PMR_SUME)) {
    if (config.pm.enabled && (value & SPR_PMR_SUME)) {
      PRINTF ("SUSPEND: PMR[SUME] bit was set.\n");
      PRINTF ("SUSPEND: PMR[SUME] bit was set.\n");
      sim_done();
      sim_done();

powered by: WebSVN 2.1.0

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