mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-21 21:49:15 +01:00
[SC64][SW] SDRAM test use cached memory address
This commit is contained in:
parent
e170abdcd3
commit
129bb4b800
@ -190,7 +190,7 @@ static void test_sdram (void) {
|
|||||||
for (int offset = 0; offset < SDRAM_SIZE; offset += BUFFER_SIZE) {
|
for (int offset = 0; offset < SDRAM_SIZE; offset += BUFFER_SIZE) {
|
||||||
if (!patterns[pattern].constant) {
|
if (!patterns[pattern].constant) {
|
||||||
for (int i = 0; i < BUFFER_SIZE / sizeof(uint32_t); i++) {
|
for (int i = 0; i < BUFFER_SIZE / sizeof(uint32_t); i++) {
|
||||||
*UNCACHED(&w_buffer[i]) = (rand() << 31) | rand();
|
w_buffer[i] = (rand() << 31) | rand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,12 +199,12 @@ static void test_sdram (void) {
|
|||||||
pi_dma_read((io32_t *) (SDRAM_ADDRESS + offset), r_buffer, BUFFER_SIZE);
|
pi_dma_read((io32_t *) (SDRAM_ADDRESS + offset), r_buffer, BUFFER_SIZE);
|
||||||
|
|
||||||
for (int i = 0; i < BUFFER_SIZE / sizeof(uint32_t); i++) {
|
for (int i = 0; i < BUFFER_SIZE / sizeof(uint32_t); i++) {
|
||||||
if (*UNCACHED(&w_buffer[i]) != *UNCACHED(&r_buffer[i])) {
|
if (w_buffer[i] != r_buffer[i]) {
|
||||||
display_printf(
|
display_printf(
|
||||||
"\nMISMATCH: [0x%08X]: 0x%08X (R) != 0x%08X (W)\n",
|
"\nMISMATCH: [0x%08X]: 0x%08X (R) != 0x%08X (W)\n",
|
||||||
SDRAM_ADDRESS + offset,
|
SDRAM_ADDRESS + offset,
|
||||||
*UNCACHED(&r_buffer[i]),
|
r_buffer[i],
|
||||||
*UNCACHED(&w_buffer[i])
|
w_buffer[i]
|
||||||
);
|
);
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user