#include "leon.h" #include "test.h" // Registers on APB bus volatile int *REGFILE0 = (int *) 0x80000300; volatile int *REGFILE1 = (int *) 0x80000308; volatile int *REGFILE2 = (int *) 0x8000030C; volatile int *REGFILE3 = (int *) 0x80000310; volatile int *REGFILE4 = (int *) 0x80000314; volatile int *REGFILE5 = (int *) 0x80000318; // The "volatile" keyword is used to prevent GCC from // performing optimizations with these memory locations. // In general (not necessarily in this case), the values of special purpose registers // in a chip can be changed outside the control of the software. int value0, value1,value2,value3,value4,value5; leon_test() { // report(RAM_INIT); // ramfill(); // ramtest(); // dsu_ram_test(); report(SYS_TEST); *REGFILE0 = 0x00000001; // write into reg0 *REGFILE1 = 0xBACDAC23; // write into reg1 *REGFILE2 = 0xBACDAC23; *REGFILE3 = 0xBACDAC24; *REGFILE4 = 0x00000111; *REGFILE5 = 0xBACDAC26; value0 = *REGFILE0; // read from reg0 value1 = *REGFILE1; // read from reg1 value2 = *REGFILE2; value3 = *REGFILE3; value4 = *REGFILE4; value5 = *REGFILE5; // Comment out the rest of the original test /* report(REG_TEST); if (regtest() != 1) fail(1); multest(); divtest(); wp_test(); fpu_test(); memtest(); edac_test(); cache_test(); irq_test(); uart_test(); timer_test(); ioport_test(); */ report(TEST_END); }