void run_test(void) { tty_puts("\nSDRAM test started\n"); #ifdef TEST_RANDOM tty_puts("Random data\n"); while(1) random_longs(DRAM_START, DRAM_END); #endif #ifdef TEST_PARALLEL parallel_longs(DRAM_START, (unsigned long *)DRAM_START, (unsigned long *)(DRAM_START+((DRAM_END-DRAM_START)/2)), (unsigned long *)DRAM_END, inc_addr); parallel_longs(0x00000000, (unsigned long *)DRAM_START, (unsigned long *)(DRAM_START+((DRAM_END-DRAM_START)/2)), (unsigned long *)DRAM_END, nop); #endif #ifdef TEST_LONG tty_puts("*** Testing LONG\n"); test_longs("ZERO: ", 0x00000000, (unsigned long *)DRAM_START, (unsigned long *)DRAM_END, nop, 1, 1); test_longs("ONES: ", 0xFFFFFFFF, (unsigned long *)DRAM_START, (unsigned long *)DRAM_END, nop, 1, 1); test_longs("ALTS: ", 0x55AA55AA, (unsigned long *)DRAM_START, (unsigned long *)DRAM_END, toggle, 1, 1); test_longs("ADDR: ", DRAM_START, (unsigned long *)DRAM_START, (unsigned long *)DRAM_END, inc_addr, 1, 1); #endif #ifdef TEST_SHORTS tty_puts("*** Testing SHORT\n"); test_shorts("ZERO: ", 0x0000, (unsigned short *)DRAM_START, (unsigned short *)DRAM_END, nop, 1, 1); test_shorts("ONES: ", 0xFFFF, (unsigned short *)DRAM_START, (unsigned short *)DRAM_END, nop, 1, 1); test_shorts("ALTS: ", 0x55AA, (unsigned short *)DRAM_START, (unsigned short *)DRAM_END, toggle, 1, 1); test_shorts("ADDR: ", 0, (unsigned short *)DRAM_START, (unsigned short *)DRAM_END, inc_addr, 1, 1); #endif #ifdef TEST_BYTES tty_puts("*** Testing BYTE\n"); test_bytes("ZERO: ", 0x00, (unsigned char *)DRAM_START, (unsigned char *)DRAM_END, nop, 1, 1); test_bytes("ONES: ", 0xFF, (unsigned char *)DRAM_START, (unsigned char *)DRAM_END, nop, 1, 1); test_bytes("ALTS: ", 0xAA, (unsigned char *)DRAM_START, (unsigned char *)DRAM_END, toggle, 1, 1); test_bytes("ADDR: ", 0, (unsigned char *)DRAM_START, (unsigned char *)DRAM_END, inc_addr, 1, 1); #endif #ifdef TEST_REFRESH tty_puts("*** Testing REFRESH\n"); test_longs("LONG: ", DRAM_START, (unsigned long *)DRAM_START, (unsigned long *)DRAM_END, inc_addr, 32, 32); test_shorts("SHORT: ", 0, (unsigned short *)DRAM_START, (unsigned short *)DRAM_END, inc_addr, 32, 32); test_bytes("BYTE: ", 0, (unsigned char *)DRAM_START, (unsigned char *)DRAM_END, inc_addr, 32, 32); #endif // Done tty_puts("Done\n"); }
int start (void) { int i; unsigned int reg = 0x5B5AB714; for (i = 0; i < 6; i++) { reg = next(reg); int_x[i] = reg; reg = next(reg); int_y[i] = reg; } for (i = 0; i < 6; i++) { reg = next(reg); short_x[i] = reg; reg = next(reg); short_y[i] = reg; } i = 0; float_x[i++] = 0.055237; float_x[i++] = 0.615051; float_x[i++] = -1.964783; float_x[i++] = 0.054016; float_x[i++] = 0.800354; float_x[i++] = 1.106262; i = 0; float_y[i++] = -0.324402; float_y[i++] = -1.755798; float_y[i++] = 1.130188; float_y[i++] = -0.162537; float_y[i++] = 0.073059; float_y[i++] = 0.309631; return test_ints() ^ (int)test_floats() ^ test_shorts(); }