The board works fine with the old SDRAM library, I am able to run both the read/write and the multi-client demos (using the Community tools 13.2.0), so I think the hardware is working as expected.
I have written a simple test program to write data to the SDRAM and read it back using the new library. When I run it, it always returns the same value: 67109888 (0x04000400):
Code: Select all
#include <platform.h>
#include <xs1.h>
#include <print.h>
#include "sdram.h"
#define MAX_BUF (16)
s_sdram_state sdram_state;
on tile[0]: out buffered port:32 sdram_dq_ah = XS1_PORT_16A;
on tile[0]: out buffered port:32 sdram_cas = XS1_PORT_1B;
on tile[0]: out buffered port:32 sdram_ras = XS1_PORT_1G;
on tile[0]: out buffered port:8 sdram_we = XS1_PORT_1C;
on tile[0]: out port sdram_clk = XS1_PORT_1F;
on tile[0]: clock sdram_cb = XS1_CLKBLK_1;
void sdram_test(streaming chanend c_server)
{
int i;
unsigned buffer_W[MAX_BUF];
unsigned buffer_R[MAX_BUF];
unsigned * movable buffer_pointer_W = buffer_W;
unsigned * movable buffer_pointer_R = buffer_R;
// write data then read back to check
for (i = 0; i < MAX_BUF; i++) {
buffer_pointer_W[i] = i;
buffer_pointer_R[i] = 0;
}
sdram_init_state(c_server, sdram_state);
sdram_write (c_server, sdram_state, 0, MAX_BUF, move(buffer_pointer_W));
sdram_read (c_server, sdram_state, 0, MAX_BUF, move(buffer_pointer_R));
sdram_complete(c_server, sdram_state, buffer_pointer_W);
sdram_complete(c_server, sdram_state, buffer_pointer_R);
sdram_shutdown(c_server);
for (i = 0; i < MAX_BUF; i++) {
if (buffer_pointer_W[i] != buffer_pointer_R[i]) {
printstr("Buffer mismatch at ");
printint(i);
printstr(" Wrote: ");
printint(buffer_pointer_W[i]);
printstr(" Read: ");
printintln(buffer_pointer_R[i]);
}
}
printstrln("Finished SDRAM test");
return;
}
int main() {
streaming chan c_sdram[1];
par {
on tile[0]: sdram_server(c_sdram, 1, sdram_dq_ah, sdram_cas, sdram_ras, sdram_we, sdram_clk, sdram_cb, 2, 128, 16, 8, 12, 2, 64, 4096, 4);
on tile[0]: sdram_test(c_sdram[0]);
}
return 0;
}
Has anyone had any success with this combination of hardware and library/tools?