URL
https://opencores.org/ocsvn/aemb/aemb/trunk
Subversion Repositories aemb
Compare Revisions
- This comparison shows the changes necessary to convert path
/aemb/trunk/sw/cc
- from Rev 191 to Rev 206
- ↔ Reverse comparison
Rev 191 → Rev 206
/exception.S
0,0 → 1,13
|
|
.section .vectors.hw_exception |
|
.global _hw_exception_handler |
.func _hw_exception_handler |
_hw_exception_handler: |
//rtsd r15, 8 |
rted r17, 0 |
nop |
|
.end |
|
/corefunc.hh
29,8 → 29,44
#ifndef COREFUNC_HH |
#define COREFUNC_HH |
|
#define MAGIC 0xAE62AE62 // magic number |
#ifdef __cplusplus |
extern "C" { |
#endif |
|
#define MAGIC 0xAE63AE63 // magic number |
|
volatile int exce = 0; |
|
void exceptionHandler() |
{ |
exce++; // flag the exception service routine |
} |
|
|
volatile void _hw_exception_handler() |
{ |
//exceptionHandler(); |
exce++; |
asm volatile (//"lwi r15,r1,0\n" |
"rted r17, 0\n" |
"nop\n"); |
//"addik r1,r1,28\n"); |
} |
|
/** |
EXCEPTION TEST ROUTINE |
*/ |
|
int exceptionTest(int timeout) |
{ |
volatile int *toggle = (int *)0xFFFFFFE2; |
// enable exceptions |
asm volatile (".long 0xDEADC0DE"); // define illegal instruction (1 error) |
*toggle = *toggle; // test unaligned memory access (2 errors) |
// disable exceptions |
return (exce != 3) ? EXIT_FAILURE : EXIT_SUCCESS; |
} |
|
volatile int intr = 0; |
|
void __attribute__ ((interrupt_handler)) interruptHandler() |
96,17 → 132,9
return (magic == MAGIC) ? EXIT_SUCCESS : EXIT_FAILURE; |
} |
|
#ifdef __cplusplus |
} |
#endif |
|
/* |
$Log: not supported by cvs2svn $ |
Revision 1.3 2008/05/01 08:37:37 sybreon |
Added interrupt capability. |
#endif |
|
Revision 1.2 2008/04/28 20:30:24 sybreon |
Changed to new headers. |
|
Revision 1.1 2008/04/27 16:04:42 sybreon |
Minor cosmetic changes. |
|
*/ |
/testbench.cc
75,7 → 75,11
printtest("Hardware Interrupts"); |
checkcode(interruptTest(MAX_TEST)); |
|
// *** 6. EXTENSION *** |
// *** 6. EXCEPTIONS *** |
printtest("Hardware Exceptions"); |
checkcode(exceptionTest(MAX_TEST)); |
|
// *** 7. EXTENSION *** |
printtest("Accellerator Link"); |
checkcode(xslTest(MAX_TEST)); |
} |
90,19 → 94,3
|
return EXIT_SUCCESS; |
} |
|
/* |
$Log: not supported by cvs2svn $ |
Revision 1.5 2008/04/26 19:32:00 sybreon |
Made headers C compatible. |
|
Revision 1.4 2008/04/26 18:08:12 sybreon |
Made single-thread compatible. |
|
Revision 1.3 2008/04/26 00:25:19 sybreon |
switched printf's to iprintf's because iprintf's don't work by |
-O3 for some reason. |
|
Revision 1.2 2008/04/21 12:13:12 sybreon |
Passes arithmetic tests with single thread. |
*/ |