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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [mmu.c] - Diff between revs 448 and 457

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

Rev 448 Rev 457
Line 17... Line 17...
 
 
#define TLB_TEXT_SET_NB 6
#define TLB_TEXT_SET_NB 6
#define TLB_DATA_SET_NB 2
#define TLB_DATA_SET_NB 2
 
 
/* MMU page size */
/* MMU page size */
#define PAGE_SIZE 4096
#define PAGE_SIZE 8192
 
 
/* Number of DTLB sets used (power of 2, max is 256) */
/* Number of DTLB sets used (power of 2, max is 256) */
#define DTLB_SETS 32
#define DTLB_SETS 32
 
 
/* Number of DTLB ways (1, 2, 3 etc., max is 4). */
/* Number of DTLB ways (1, 2, 3 etc., max is 4). */
Line 103... Line 103...
unsigned long itlb_miss_ea;
unsigned long itlb_miss_ea;
 
 
/* EA of last insn page fault exception */
/* EA of last insn page fault exception */
unsigned long ipage_fault_ea;
unsigned long ipage_fault_ea;
 
 
 
void sys_call (void)
 
{
 
  asm("l.sys\t0");
 
}
 
 
void fail (char *func, int line)
void fail (char *func, int line)
{
{
#ifndef __FUNCTION__
#ifndef __FUNCTION__
#define __FUNCTION__ "?"
#define __FUNCTION__ "?"
#endif
#endif
Line 133... Line 138...
        asm("_jr:");
        asm("_jr:");
        asm("l.jr\t\tr9") ;
        asm("l.jr\t\tr9") ;
        asm("l.nop" : :);
        asm("l.nop" : :);
}
}
 
 
void sys_call (void)
 
{
 
  asm("l.sys\t0");
 
}
 
 
 
void copy_jump(unsigned long phy_add)
void copy_jump(unsigned long phy_add)
{
{
        memcpy((void *)phy_add, (void *)&jr, 8);
        memcpy((void *)phy_add, (void *)&jr, 8);
}
}
 
 
Line 1049... Line 1049...
   in user and supervisor mode and chack triggering
   in user and supervisor mode and chack triggering
   of page fault exceptions */
   of page fault exceptions */
int itlb_premission_test (int set)
int itlb_premission_test (int set)
{
{
  int i, j;
  int i, j;
  unsigned long ea, ta, tmp;
  unsigned long ea, ta;
 
 
  /* Disable IMMU */
  /* Disable IMMU */
  immu_disable();
  immu_disable();
 
 
  /* Invalidate all entries in ITLB */
  /* Invalidate all entries in ITLB */

powered by: WebSVN 2.1.0

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