From 3b007ebaf1b6764466fbdde5e3d26974eb4c132c Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 29 Jan 2013 00:15:24 -0300 Subject: [PATCH] ubb-la/ubb-la. (xfers): re-optimize the start bit Combined with the 84 MHz speedup, this yields: 1 3 gap+0 2 0 1 3 ------- ------- ------- ------- ------- ------- ------- 118 36 1 138 89 35 1 22 59 36 1 51 30 36 1 80 So in this case we gain only about 3 samples or 10% by making this risky optimization. (The gain would be higher at higher sample rates, lower at lower rates.) --- ubb-la/ubb-la.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ubb-la/ubb-la.c b/ubb-la/ubb-la.c index 7b4750d..9c478c1 100644 --- a/ubb-la/ubb-la.c +++ b/ubb-la/ubb-la.c @@ -199,14 +199,13 @@ static void xfers(unsigned long *bufs, int n_bufs, int nibbles, MSCCDR = 0; /* - * Experimental value for 12 MSa/s: hangs always/usually with - * 231 cycles, hangs sometimes with 232, hands never (so far) - * with 233. + * Experimental value for 12 MSa/s with speedup to 84 MSa/s: + * hangs often with 29 cycles, hangs never (so far) with 30. */ -// for (j = 0; j != 233; j++) asm volatile (""); + for (j = 0; j != 30; j++) asm volatile (""); // while (MSC_STAT & MSC_STAT_DATA_FIFO_EMPTY); - while (!(MSC_STAT & MSC_STAT_END_CMD_RES)); +// while (!(MSC_STAT & MSC_STAT_END_CMD_RES)); IN(UBB_CMD);