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 1513 and 1529

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

Rev 1513 Rev 1529
Line 66... Line 66...
  case SPR_TTMR:
  case SPR_TTMR:
    spr_write_ttmr (value);
    spr_write_ttmr (value);
    break;
    break;
  /* Data cache simulateing stuff */
  /* Data cache simulateing stuff */
  case SPR_DCBPR:
  case SPR_DCBPR:
    if(value) {
    /* FIXME: This is not correct.  The arch. manual states: "Memory accesses
      /* FIXME: The arch. manual says "DCBPR is written with the effective
     * are not recorded (Unlike load or store instructions) and cannot invoke
       *        address" which suggests it is written with a _virtual_ address,
     * any exception".  If the physical address is invalid a bus error will be
       *        but it seems that the cache sits behind the mmu.  How is this
     * generated.  Also if the effective address is not resident in the mmu
       *        address translated then? */
     * the read will happen from address 0, which is naturally not correct. */
      dc_simulate_read(value, value, 4);
    dc_simulate_read(peek_into_dtlb(value, 0, 1), value, 4);
      cpu_state.sprs[SPR_DCBPR] = 0;
      cpu_state.sprs[SPR_DCBPR] = 0;
    }
 
    break;
    break;
  case SPR_DCBFR:
  case SPR_DCBFR:
    if(value != -1) {
 
      dc_inv(value);
      dc_inv(value);
      cpu_state.sprs[SPR_DCBFR] = -1;
      cpu_state.sprs[SPR_DCBFR] = -1;
    }
 
    break;
    break;
  case SPR_DCBIR:
  case SPR_DCBIR:
    if(value != 0) {
 
      dc_inv(value);
      dc_inv(value);
      cpu_state.sprs[SPR_DCBIR] = 0;
      cpu_state.sprs[SPR_DCBIR] = 0;
    }
 
    break;
    break;
  case SPR_DCBWR:
  case SPR_DCBWR:
    cpu_state.sprs[SPR_DCBWR] = 0;
    cpu_state.sprs[SPR_DCBWR] = 0;
    break;
    break;
  case SPR_DCBLR:
  case SPR_DCBLR:
    cpu_state.sprs[SPR_DCBLR] = 0;
    cpu_state.sprs[SPR_DCBLR] = 0;
    break;
    break;
  /* Instruction cache simulateing stuff */
  /* Instruction cache simulateing stuff */
  case SPR_ICBPR:
  case SPR_ICBPR:
    if(value) {
    /* FIXME: The arch manual does not say what happens when an invalid memory
      /* FIXME: The arch. manual says "ICBPR is written with the effective
     * location is specified.  I guess the same as for the DCBPR register */
       *        address" which suggests it is written with a _virtual_ address,
    ic_simulate_fetch(peek_into_itlb(value, 1), value);
       *        but it seems that the cache sits behind the mmu.  How is this
 
       *        address translated then? */
 
      ic_simulate_fetch(value, value);
 
      cpu_state.sprs[SPR_ICBPR] = 0;
      cpu_state.sprs[SPR_ICBPR] = 0;
    }
 
    break;
    break;
  case SPR_ICBIR:
  case SPR_ICBIR:
    if(value) {
 
      ic_inv(value);
      ic_inv(value);
      cpu_state.sprs[SPR_ICBIR] = 0;
      cpu_state.sprs[SPR_ICBIR] = 0;
    }
 
    break;
    break;
  case SPR_ICBLR:
  case SPR_ICBLR:
    cpu_state.sprs[SPR_ICBLR] = 0;
    cpu_state.sprs[SPR_ICBLR] = 0;
    break;
    break;
  case SPR_SR:
  case SPR_SR:

powered by: WebSVN 2.1.0

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