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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [mmu/] [immu.c] - Diff between revs 1174 and 1308

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

Rev 1174 Rev 1308
Line 23... Line 23...
#include "abstract.h"
#include "abstract.h"
#include "stats.h"
#include "stats.h"
#include "sprs.h"
#include "sprs.h"
#include "except.h"
#include "except.h"
#include "sim-config.h"
#include "sim-config.h"
 
#include "debug.h"
 
 
extern int cont_run;
extern int cont_run;
 
 
/* Insn MMU */
/* Insn MMU */
 
 
Line 79... Line 80...
    runtime.sim.mem_cycles += config.immu.hitdelay;
    runtime.sim.mem_cycles += config.immu.hitdelay;
    ppn = mfspr(SPR_ITLBTR_BASE(way) + set) / config.immu.pagesize;
    ppn = mfspr(SPR_ITLBTR_BASE(way) + set) / config.immu.pagesize;
    return (ppn * config.immu.pagesize) + (virtaddr % config.immu.pagesize);
    return (ppn * config.immu.pagesize) + (virtaddr % config.immu.pagesize);
  }
  }
  else {  /* No, we didn't. */
  else {  /* No, we didn't. */
    int minlru = config.immu.nsets - 1;
 
    int minway = 0;
 
 
 
    immu_stats.fetch_tlbmiss++;
    immu_stats.fetch_tlbmiss++;
#if 0
#if 0
    for (i = 0; i < config.immu.nways; i++)
    for (i = 0; i < config.immu.nways; i++)
      if (getsprbits(SPR_ITLBMR_BASE(i) + set, SPR_ITLBMR_LRU) < minlru)
      if (getsprbits(SPR_ITLBMR_BASE(i) + set, SPR_ITLBMR_LRU) < minlru)
        minway = i;
        minway = i;
Line 218... Line 216...
  /* Scan set(s) and way(s). */
  /* Scan set(s) and way(s). */
  for (set = start_set; set < end_set; set++) {
  for (set = start_set; set < end_set; set++) {
    PRINTF("\nSet %x: ", set);
    PRINTF("\nSet %x: ", set);
    for (way = 0; way < config.immu.nways; way++) {
    for (way = 0; way < config.immu.nways; way++) {
      PRINTF("  way %d: ", way);
      PRINTF("  way %d: ", way);
      PRINTF("vpn=%x ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_VPN));
      PRINTF("vpn=%lx ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_VPN));
      PRINTF("lru=%x ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_LRU));
      PRINTF("lru=%lx ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_LRU));
      PRINTF("pl1=%x ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_PL1));
      PRINTF("pl1=%lx ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_PL1));
      PRINTF("v=%x ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_V));
      PRINTF("v=%lx ", getsprbits(SPR_ITLBMR_BASE(way) + set, SPR_ITLBMR_V));
 
 
      PRINTF("a=%x ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_A));
      PRINTF("a=%lx ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_A));
      PRINTF("d=%x ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_D));
      PRINTF("d=%lx ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_D));
      PRINTF("uxe=%x ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_UXE));
      PRINTF("uxe=%lx ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_UXE));
      PRINTF("sxe=%x ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_SXE));
      PRINTF("sxe=%lx ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_SXE));
      PRINTF("ppn=%x ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_PPN));
      PRINTF("ppn=%lx ", getsprbits(SPR_ITLBTR_BASE(way) + set, SPR_ITLBTR_PPN));
    }
    }
  }
  }
  if (start_set < end_set) PRINTF("\n");
  if (start_set < end_set) PRINTF("\n");
}
}
 
 
 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.