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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel-0-3-0-rc1/] [or1ksim/] [cpu/] [or1k/] [sprs.c] - Diff between revs 1531 and 1532

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

Rev 1531 Rev 1532
Line 39... Line 39...
#include "sprs.h"
#include "sprs.h"
#include "dcache_model.h"
#include "dcache_model.h"
#include "icache_model.h"
#include "icache_model.h"
#include "debug.h"
#include "debug.h"
 
 
 
DEFAULT_DEBUG_CHANNEL(spr);
DECLARE_DEBUG_CHANNEL(immu);
DECLARE_DEBUG_CHANNEL(immu);
 
 
extern int flag;
 
 
 
int audio_cnt = 0;
int audio_cnt = 0;
 
 
static FILE *fo = 0;
static FILE *fo = 0;
 
 
/* Set a specific SPR with a value. */
/* Set a specific SPR with a value. */
void
void mtspr(uint16_t regno, const uorreg_t value)
mtspr(uint16_t regno, const uorreg_t value)
 
{
{
  uorreg_t prev_val;
  uorreg_t prev_val;
 
 
  prev_val = cpu_state.sprs[regno];
  prev_val = cpu_state.sprs[regno];
  cpu_state.sprs[regno] = value;
  cpu_state.sprs[regno] = value;
 
 
 
  TRACE("%s\n", dump_spr(regno, value));
 
 
  /* MM: Register hooks.  */
  /* MM: Register hooks.  */
  switch (regno) {
  switch (regno) {
  case SPR_TTCR:
  case SPR_TTCR:
    spr_write_ttcr (value);
    spr_write_ttcr (value);
    break;
    break;
Line 218... Line 219...
    /* Links to GPRS */
    /* Links to GPRS */
    if(regno >= 0x0400 && regno < 0x0420)
    if(regno >= 0x0400 && regno < 0x0420)
      ret = cpu_state.reg[regno - 0x0400];
      ret = cpu_state.reg[regno - 0x0400];
  }
  }
 
 
 
  TRACE("%s\n", dump_spr(regno, ret));
 
 
  return ret;
  return ret;
}
}
 
 
/* Show status of important SPRs. */
/* Show status of important SPRs. */
void sprs_status(void)
void sprs_status(void)

powered by: WebSVN 2.1.0

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