Commit bfc53781 authored by Tristan Gingold's avatar Tristan Gingold

test_vme.c: improve output of DMA tests.

parent 57fdecdc
......@@ -257,14 +257,8 @@ rate_done (struct timespec *start_ts, unsigned int nbr_bytes)
}
static void
do_test_dma (uint8_t am)
do_test_error_counter (void)
{
struct vme_dma dma;
uint32_t base;
void *buf;
int s;
struct timespec start_ts;
// Clear pattern write error counter
map_for_am (0x39);
ptr32[0x1004] = 0;
......@@ -276,6 +270,26 @@ do_test_dma (uint8_t am)
report (swapbe32 (ptr32[0x1004]) == 1,
"write error counter is working (on correct)");
ptr32[0x1004] = 0;
}
static void
do_test_dma (uint8_t am)
{
struct vme_dma dma;
uint32_t base;
void *buf;
int s;
struct timespec start_ts;
enum vme_dma_block_size bsize;
// Clear pattern write error counter
map_for_am (0x39);
ptr32[0x1004] = 0;
if (ptr32[0x1004] != 0)
{
printf ("FATAL: write error counter correctly reset\n");
exit (3);
}
printf ("INFO: test DMA for am 0x%02x\n", am);
base = map_for_am (am);
......@@ -301,9 +315,17 @@ do_test_dma (uint8_t am)
dma.dst.addru = ((uintptr_t)buf) >> 32;
dma.dst.addrl = (uintptr_t)buf;
dma.ctrl.vme_block_size = VME_DMA_BSIZE_256;
if (am == VME_A24_SUP_MBLT
|| am == VME_A24_USER_MBLT
|| am == VME_A32_SUP_MBLT
|| am == VME_A32_USER_MBLT)
bsize = VME_DMA_BSIZE_2048;
else
bsize = VME_DMA_BSIZE_256;
dma.ctrl.vme_block_size = bsize;
dma.ctrl.vme_backoff_time = VME_DMA_BACKOFF_1;
dma.ctrl.pci_block_size = VME_DMA_BSIZE_256;
dma.ctrl.pci_block_size = bsize;
dma.ctrl.pci_backoff_time = VME_DMA_BACKOFF_1;
rate_start (&start_ts);
......@@ -347,9 +369,9 @@ do_test_dma (uint8_t am)
dma.dst.addru = 0;
dma.dst.addrl = base + 0xc000;
dma.ctrl.vme_block_size = VME_DMA_BSIZE_256;
dma.ctrl.vme_block_size = bsize;
dma.ctrl.vme_backoff_time = VME_DMA_BACKOFF_1;
dma.ctrl.pci_block_size = VME_DMA_BSIZE_256;
dma.ctrl.pci_block_size = bsize;
dma.ctrl.pci_backoff_time = VME_DMA_BACKOFF_1;
rate_start (&start_ts);
......@@ -360,7 +382,8 @@ do_test_dma (uint8_t am)
free (buf);
map_for_am (0x39);
report (ptr32[0x1004] == 0, "no write error during DMA");
report (ptr32[0x1004] == 0, "no write error during DMA (%d errors)",
swapbe32 (ptr32[0x1004]));
}
static void
......@@ -421,11 +444,18 @@ do_vme_test (void)
do_test_mem (0x0a);
// DMA
do_test_error_counter ();
printf ("\n"
"PERF: SCT rate\n");
do_test_dma (0x3d); // Single
printf ("\n"
"PERF: BLT rate\n");
do_test_dma (0x3f); // BLT
printf ("\n"
"PERF: MBLT rate\n");
do_test_dma (0x3c); // MBLT
do_test_dma (0x38); // MBLT
printf ("\n");
do_irq_test ();
do_berr_test ();
......@@ -436,7 +466,9 @@ do_vme_test (void)
}
else
{
printf ("FAILED!!!\n");
printf ("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
printf ("FAILED!!! FAILED!!! FAILED!!! FAILED!!! FAILED!!! FAILED!!!\n");
printf ("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
return 1;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment