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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [testbench/] [except_test.c] - Diff between revs 956 and 970

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

Rev 956 Rev 970
Line 5... Line 5...
#include "int.h"
#include "int.h"
 
 
/* Define RAM physical location and size
/* Define RAM physical location and size
   Bottom half will be used for this program, the rest
   Bottom half will be used for this program, the rest
   will be used for testing */
   will be used for testing */
#define FLASH_START 0x00000000
#define FLASH_START 0xf0000000
#define FLASH_SIZE  0x00200000
#define FLASH_SIZE  0x00200000
#define RAM_START   0x40000000
#define RAM_START   0x00000000
#define RAM_SIZE    0x00200000
#define RAM_SIZE    0x04000000
 
 
 
#define TEST_BASE   0xa5000000
 
 
/* MMU page size */
/* MMU page size */
#define PAGE_SIZE 8192
#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) */
Line 700... Line 702...
  except_mask = 0;
  except_mask = 0;
  except_pc = 0;
  except_pc = 0;
  except_ea = 0;
  except_ea = 0;
 
 
  /* Check if there was bus error exception */
  /* Check if there was bus error exception */
  ret = call ((unsigned long)&load_b_acc_32, ea );
  ret = call ((unsigned long)&load_acc_32, ea );
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_BERR));
  ASSERT(except_mask == (1 << V_BERR));
  ASSERT(except_pc == (unsigned long)load_b_acc_32 + 8);
  ASSERT(except_pc == (unsigned long)load_acc_32 + 8);
  ASSERT(except_ea == ea);
  ASSERT(except_ea == ea);
  ASSERT(ret == 0x12345678);
  ASSERT(ret == 0x12345678);
 
 
  return 0;
  return 0;
}
}
Line 971... Line 973...
  except_count = 0;
  except_count = 0;
  except_mask = 0;
  except_mask = 0;
  except_pc = 0;
  except_pc = 0;
  except_ea = 0;
  except_ea = 0;
 
 
printf("Buserrrrr!\n");
 
  /* Check if there was bus error exception */
  /* Check if there was bus error exception */
  call (RAM_START + (RAM_SIZE) + (TLB_TEXT_SET_NB*PAGE_SIZE), 0);
  call (RAM_START + (RAM_SIZE) + (TLB_TEXT_SET_NB*PAGE_SIZE), 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_BERR));
  ASSERT(except_mask == (1 << V_BERR));
  ASSERT(except_pc == (RAM_START + (RAM_SIZE) + (TLB_TEXT_SET_NB*PAGE_SIZE)));
  ASSERT(except_pc == (RAM_START + (RAM_SIZE) + (TLB_TEXT_SET_NB*PAGE_SIZE)));
Line 1140... Line 1141...
  interrupt_test ();
  interrupt_test ();
 
 
  /* ITLB exception test */
  /* ITLB exception test */
  itlb_test ();
  itlb_test ();
 
 
 
printf("dtlb_test\n");
  /* DTLB exception test */
  /* DTLB exception test */
  dtlb_test ();
  dtlb_test ();
 
 
 
printf("buserr_test\n");
  /* Bus error exception test */
  /* Bus error exception test */
  buserr_test ();
  buserr_test ();
 
 
 
printf("illegal_insn_test\n");
 
  /* Bus error exception test */
  /* Illegal insn test */
  /* Illegal insn test */
  illegal_insn_test ();
  illegal_insn_test ();
 
 
 
printf("align_test\n");
  /* Alignment test */
  /* Alignment test */
  align_test ();
  align_test ();
 
 
 
printf("trap_test\n");
  /* Trap test */
  /* Trap test */
  trap_test ();
  trap_test ();
 
 
 
printf("except_priority_test\n");
  /* Range test */
  /* Range test */
//  range_test ();
//  range_test ();
 
 
  /* Exception priority test */
  /* Exception priority test */
  except_priority_test ();
  except_priority_test ();

powered by: WebSVN 2.1.0

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