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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_34/] [or1ksim/] [cache/] [icache_model.c] - Diff between revs 1085 and 1308

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

Rev 1085 Rev 1308
Line 84... Line 84...
      printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", fetchaddr);
      printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", fetchaddr);
      except_handle(EXCEPT_BUSERR, cur_vadd);
      except_handle(EXCEPT_BUSERR, cur_vadd);
      return 0;
      return 0;
    }
    }
    if (!pending.valid && cur_area->log)
    if (!pending.valid && cur_area->log)
      fprintf (cur_area->log, "[%08x] -> read %08x\n", fetchaddr, tmp);
      fprintf (cur_area->log, "[%08lx] -> read %08lx\n", fetchaddr, tmp);
    return tmp;
    return tmp;
  }
  }
 
 
  /* Which set to check out? */
  /* Which set to check out? */
  set = (fetchaddr / config.ic.blocksize) % config.ic.nsets;
  set = (fetchaddr / config.ic.blocksize) % config.ic.nsets;
Line 132... Line 132...
        printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", fetchaddr);
        printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", fetchaddr);
        except_handle(EXCEPT_BUSERR, cur_vadd);
        except_handle(EXCEPT_BUSERR, cur_vadd);
        return 0;
        return 0;
      }
      }
      if (!pending.valid && cur_area->log)
      if (!pending.valid && cur_area->log)
        fprintf (cur_area->log, "[%08x] -> read %08x\n", fetchaddr, tmp);
        fprintf (cur_area->log, "[%08lx] -> read %08lx\n", fetchaddr, tmp);
    }
    }
 
 
    ic[set].way[minway].tagaddr = tagaddr;
    ic[set].way[minway].tagaddr = tagaddr;
    for (i = 0; i < config.ic.nways; i++)
    for (i = 0; i < config.ic.nways; i++)
      if (ic[set].way[i].lru)
      if (ic[set].way[i].lru)
Line 187... Line 187...
 
 
inline void ic_clock()
inline void ic_clock()
{
{
  unsigned long addr;
  unsigned long addr;
 
 
  if (addr = mfspr(SPR_ICBPR)) {
  if ((addr = mfspr(SPR_ICBPR))) {
    ic_simulate_fetch(addr);
    ic_simulate_fetch(addr);
    mtspr(SPR_ICBPR, 0);
    mtspr(SPR_ICBPR, 0);
  }
  }
  if (addr = mfspr(SPR_ICBIR)) {
  if ((addr = mfspr(SPR_ICBIR))) {
    ic_inv(addr);
    ic_inv(addr);
    mtspr(SPR_ICBIR, 0);
    mtspr(SPR_ICBIR, 0);
  }
  }
  if (addr = mfspr(SPR_ICBLR)) {
  if ((addr = mfspr(SPR_ICBLR))) {
    mtspr(SPR_ICBLR, 0);
    mtspr(SPR_ICBLR, 0);
  }
  }
}
}
 
 
 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.