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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [except_test.c] - Diff between revs 516 and 520

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

Rev 516 Rev 520
Line 373... Line 373...
  ret = call ((unsigned long)&int_trigger, 0);
  ret = call ((unsigned long)&int_trigger, 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_HPINT));
  ASSERT(except_mask == (1 << V_HPINT));
  ASSERT(ret == 0);
  ASSERT(ret == 0);
  ASSERT(except_pc == (unsigned long)int_trigger + 16);
  ASSERT(except_pc == (unsigned long)int_trigger + 16);
  ASSERT(except_ea == 0);
 
 
 
 
#if 0
  /* Reset except counter */
  /* Reset except counter */
  except_count = 0;
  except_count = 0;
  except_mask = 0;
  except_mask = 0;
  except_pc = 0;
  except_pc = 0;
  except_ea = 0;
  except_ea = 0;
Line 391... Line 391...
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_LPINT));
  ASSERT(except_mask == (1 << V_LPINT));
  ASSERT(ret == 0);
  ASSERT(ret == 0);
  ASSERT(except_pc == (unsigned long)int_trigger + 16);
  ASSERT(except_pc == (unsigned long)int_trigger + 16);
  ASSERT(except_ea == 0);
  ASSERT(except_ea == 0);
 
#endif
 
 
  /* Reset except counter */
  /* Reset except counter */
  except_count = 0;
  except_count = 0;
  except_mask = 0;
  except_mask = 0;
  except_pc = 0;
  except_pc = 0;
Line 454... Line 455...
  /* Check if there was ITLB miss exception */
  /* Check if there was ITLB miss exception */
  ret = call (ea, 0);
  ret = call (ea, 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_ITLB_MISS));
  ASSERT(except_mask == (1 << V_ITLB_MISS));
  ASSERT(except_pc == ea);
  ASSERT(except_pc == ea);
  ASSERT(except_ea == ea);
 
  ASSERT(ret == 0);
  ASSERT(ret == 0);
 
 
  /* Set dtlb no permisions */
  /* Set dtlb no permisions */
  itlb_val = SPR_ITLBTR_CI | SPR_ITLBTR_SXE;
  itlb_val = SPR_ITLBTR_CI | SPR_ITLBTR_SXE;
 
 
Line 471... Line 471...
  /* Check if there was IPF miss exception */
  /* Check if there was IPF miss exception */
  ret = call (ea, 0);
  ret = call (ea, 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_IPF));
  ASSERT(except_mask == (1 << V_IPF));
  ASSERT(except_pc == ea);
  ASSERT(except_pc == ea);
  ASSERT(except_ea == ea);
 
  ASSERT(ret == 0);
  ASSERT(ret == 0);
 
 
  /* Set dtlb no permisions */
  /* Set dtlb no permisions */
  itlb_val = SPR_ITLBTR_CI;
  itlb_val = SPR_ITLBTR_CI;
 
 
Line 488... Line 487...
  /* Check if there was ITLB miss exception */
  /* Check if there was ITLB miss exception */
  ret = call (ea, 0);
  ret = call (ea, 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_ITLB_MISS));
  ASSERT(except_mask == (1 << V_ITLB_MISS));
  ASSERT(except_pc == ea + 4);
  ASSERT(except_pc == ea + 4);
  ASSERT(except_ea == ea + 8);
 
  ASSERT(ret == 0);
  ASSERT(ret == 0);
 
 
  /* Set dtlb no permisions */
  /* Set dtlb no permisions */
  itlb_val = SPR_ITLBTR_CI | SPR_ITLBTR_SXE;
  itlb_val = SPR_ITLBTR_CI | SPR_ITLBTR_SXE;
 
 
Line 505... Line 503...
  /* Check if there was IPF exception */
  /* Check if there was IPF exception */
  ret = call (ea, 0);
  ret = call (ea, 0);
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_IPF));
  ASSERT(except_mask == (1 << V_IPF));
  ASSERT(except_pc == ea + 4);
  ASSERT(except_pc == ea + 4);
  ASSERT(except_ea == ea + 8);
 
  ASSERT(ret == 0);
  ASSERT(ret == 0);
 
 
  /* Reset except counter */
  /* Reset except counter */
  except_count = 0;
  except_count = 0;
  except_mask = 0;
  except_mask = 0;
Line 747... Line 744...
  /* Check if there was illegal insn exception */
  /* Check if there was illegal insn exception */
  ret = call (RAM_START + 4, 0 );
  ret = call (RAM_START + 4, 0 );
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_ILLINSN));
  ASSERT(except_mask == (1 << V_ILLINSN));
  ASSERT(except_pc == RAM_START + 4);
  ASSERT(except_pc == RAM_START + 4);
  ASSERT(except_ea == RAM_START + 4);
 
 
 
  /* Reset except counter */
  /* Reset except counter */
  except_count = 0;
  except_count = 0;
  except_mask = 0;
  except_mask = 0;
  except_pc = 0;
  except_pc = 0;
Line 760... Line 756...
  /* Check if there was illegal insn exception */
  /* Check if there was illegal insn exception */
  ret = call (RAM_START, 0 );
  ret = call (RAM_START, 0 );
  ASSERT(except_count == 1);
  ASSERT(except_count == 1);
  ASSERT(except_mask == (1 << V_ILLINSN));
  ASSERT(except_mask == (1 << V_ILLINSN));
  ASSERT(except_pc == RAM_START);
  ASSERT(except_pc == RAM_START);
  ASSERT(except_ea == RAM_START + 4);
 
 
 
  return 0;
  return 0;
}
}
 
 
/* Align test */
/* Align test */
Line 1116... Line 1111...
 
 
int main (void)
int main (void)
{
{
  int ret;
  int ret;
 
 
 
  printf("except_test\n");
 
 
  /* Register bus error handler */
  /* Register bus error handler */
  excpt_buserr = (unsigned long)bus_err_handler;
  excpt_buserr = (unsigned long)bus_err_handler;
 
 
  /* Register illegal insn handler */
  /* Register illegal insn handler */
  excpt_illinsn = (unsigned long)ill_insn_handler;
  excpt_illinsn = (unsigned long)ill_insn_handler;
Line 1175... Line 1172...
 
 
  /* Trap test */
  /* Trap test */
  trap_test ();
  trap_test ();
 
 
  /* Range test */
  /* Range test */
  range_test ();
//  range_test ();
 
 
  /* Exception priority test */
  /* Exception priority test */
  except_priority_test ();
  except_priority_test ();
 
 
  report (0xdeaddead);
  report (0xdeaddead);

powered by: WebSVN 2.1.0

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