URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/or1ksim/testsuite/test-code-or1k/tick
- from Rev 460 to Rev 538
- ↔ Reverse comparison
Rev 460 → Rev 538
/Makefile.in
1,4 → 1,4
# Makefile.in generated by automake 1.11.1 from Makefile.am. |
# Makefile.in generated by automake 1.11 from Makefile.am. |
# @configure_input@ |
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
/tick.c
28,6 → 28,8
#include "spr-defs.h" |
#include "support.h" |
|
/*! Whether to perform spurious interrupt test */ |
#define DO_SPURIOUS_INT_TEST 0 |
|
/*! Number of spurious interrupts we'll allow before properly disabling them */ |
#define MAX_SPURIOUS 5 |
48,8 → 50,10
/*! Global count of number of times interrupt handler has been called */ |
static volatile int tick_cnt = 0; |
|
#if DO_SPURIOUS_INT_TEST==1 |
/*! Global flag to indicate if the TTMR_IP flag should be cleared */ |
static int clear_ip = 1; |
#endif |
|
|
/* --------------------------------------------------------------------------*/ |
105,8 → 109,8
set_period (unsigned long int ttmr, |
unsigned long int period) |
{ |
ttmr &= ~SPR_TTMR_PERIOD; |
ttmr |= period & SPR_TTMR_PERIOD; |
ttmr &= ~SPR_TTMR_TP; |
ttmr |= period & SPR_TTMR_TP; |
|
return ttmr; |
|
220,6 → 224,7
} /* tick_count () */ |
|
|
#if DO_SPURIOUS_INT_TEST==1 |
/* --------------------------------------------------------------------------*/ |
/*!Tick interrupt handler generting spurious interrupts |
|
257,8 → 262,8
|
} |
} /* tick_int_spurious () */ |
#endif |
|
|
/* --------------------------------------------------------------------------*/ |
/*!Waste a little time |
|
504,8 → 509,8
waste_time(); |
ASSERT (GET_TTCR () > 0x20000, "Timer started counting from high value"); |
|
/* If TTCR is greater than TTMR_PERIOD then the interrupt gets delivered after |
TTCR wraps around to 0 and counts to SPR_TTMR_PERIOD. |
/* If TTCR is greater than TTMR_TP then the interrupt gets delivered after |
TTCR wraps around to 0 and counts to SPR_TTMR_TP. |
|
Set up an auto-restart timer to wrap around. Reset the tick count, |
because it may have incremented since the last match. */ |
533,11 → 538,13
|
/* Wait for trigger, then check that we have carried on counting. */ |
wait_match(); |
ttcr = GET_TTCR () & SPR_TTCR_PERIOD; |
ttcr = GET_TTCR () & SPR_TTCR_CNT; |
|
ASSERT ((0x10000 < ttcr) && (ttcr < 0xffffc00), |
ASSERT ((0x00010000 < ttcr) && (ttcr < 0xfffffc00), |
"Continuous mode wrapped round"); |
|
#if DO_SPURIOUS_INT_TEST==1 |
|
/* Disable the timer and set up the special spurious interrupt handler, to |
check spurious interrupts occur as expected. */ |
ttmr = clear_ttmr (); |
584,6 → 591,8
{ |
} |
|
#endif |
|
/* If we get here everything worked. */ |
report(0xdeaddead); |
return 0; |