1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-06-26 02:33:17 +03:00
Commit Graph

279 Commits

Author SHA1 Message Date
Werner Almesberger
760e8a893a ubb-la/ubb-la.c (xfers): revert to "safe" end-of-command synchronization
This seems to be the best compromise between stability and performance.
2013-01-30 01:51:12 -03:00
Werner Almesberger
3b007ebaf1 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.)
2013-01-29 00:15:24 -03:00
Werner Almesberger
bf62b209e5 ubb-la/ubb-la.c: raise MMC bus clock to 84 MHz during overhead
We also de-optimize the start bit (DAT0=0) phase for now. In the
12 MHz scenario, this produces the following results:

1       3       gap+0   2       0       1       3
------- ------- ------- ------- ------- ------- -------
8               38              26      100     146
        102     38      26                      6
        52      39      26                      55
        147     41      26                      105
97              39              26      10      146

Note that the gap now includes the start bit phase, since the clock
change may complicate the calculation of how many 12 MHz samples
it corresponds to.
2013-01-28 23:24:29 -03:00
Werner Almesberger
128590bee0 ubb-patgen/ubb-patgen.c: new option -I inter_s to select "unsafe" frequencies 2013-01-28 21:20:25 -03:00
Werner Almesberger
04b235cedf ubb-patgen/ubb-patgen.c: new option -F freq_Hz to select "unsafe" frequencies 2013-01-28 21:14:53 -03:00
Werner Almesberger
f862a82a2d ubb-la/ubb-la.c: new option -F freq_MHz to select "unsafe" frequencies 2013-01-28 21:06:00 -03:00
Werner Almesberger
85bda4c41d ubb-la/ubb-la.c (frequency): adapt use of mmcclk for API change 2013-01-28 21:05:01 -03:00
Werner Almesberger
66a487b634 ubb-patgen/ubb-patgen.c (frequencies): adapt use of mmcclk for API change 2013-01-28 21:04:26 -03:00
Werner Almesberger
591bb6427b libubb/mmcclk.c (mmcclk_first): add flags to relax clock selection constraints 2013-01-28 20:49:17 -03:00
Werner Almesberger
14b7a9cdee ubb-la/ubb-la.c (xfers): instead of waiting for event, use hand-optimized delay loop
The gap is just as long as when waiting for an event but the "start bit"
on DAT0 has vanished completely:

1       3       gap     2       0       1       3
------- ------- ------- ------- ------- ------- -------
53              77                      16      146
66              79                      1       146
81              79                              132
96              79                              117
2013-01-28 16:43:29 -03:00
Werner Almesberger
18a822b845 ubb-la/ubb-la.c (xfers): wait for END_CMD_RES instead of DATA_FIFO_EMPTY
This seems to make no difference for the gap but the "start bit" (DAT0
pulled low) seem to get 1-2 samples shorter:

1       3       gap     2       0       1       3
------- ------- ------- ------- ------- ------- -------
146             77      9                       60
147     13      79      9                       45
145     28      79      10                      29
146     43      79      9                       15
2013-01-28 16:43:23 -03:00
Werner Almesberger
4ffd61093b ubb-la/ubb-la.c (do_bufs): don't skip 122 nibbled (for evaluation)
A series of measurements of

A# ./ubb-patgen  -f 41kHz 1
A# ./ubb-patgen  -f 41kHz -c
B# ./ubb-la -f 12 -n 10

yielded these results:

1       3       gap     2       0       1       3
------- ------- ------- ------- ------- ------- -------
106             77      11                      98
120             78      11                      83
134             79      11                      68
        3       79      11                      53
        18      78      11                      39
        33      78      11                      24
        47      79      11                      9
        62      79      5       6       140     147
        77      79              11      125     147

Where for example the last entry corresponds to

...1{146}3{77}
0{11}1{125}3{147}...

Since this looks as if DAT1 was 1 for 77 samples before the first capture
ended, was 0 throughout the pulling low of DAT0 (11 cycles), stayed low
for another 125 cycles, and then went high for the 146.29 nominal
half-period, we thus get a gap length of 2*146-77-11-125 = 79
2013-01-27 18:23:38 -03:00
Werner Almesberger
37a219b0b9 ubb-la/ubb-la.c: option -n N to enter experimental multi-buffer mode (WIP) 2013-01-26 23:25:17 -03:00
Werner Almesberger
96ae3319c5 libubb/physmem.c (physmem_xlat): don't close the (supposedly) cached fd 2013-01-26 21:09:19 -03:00
Werner Almesberger
13f34170de ubb-la/ubb-la.c (do_buf): physmem_xlat doesn't need a cast
We inherited the cast from ubb-patgen where the buffer was "const" and thus
had to be cast for the the non-const argument of physmem_xlat. We never
needed a cast in ubb-la, though.

Since physmem_xlat now uses "const" as well, the cast is even doubly
superfluous.
2013-01-26 20:49:09 -03:00
Werner Almesberger
b0d89b25eb ubb-patgen/ubb-patgen.c (send_buffer): physmem_xlat no longer needs a cast 2013-01-26 20:48:21 -03:00
Werner Almesberger
c796ab1c54 libubb/physmem.c (physmem_xlat): make "v" "const"
Since we may use the buffer as well for reading only, there is no point in
pretending physmem_xlat itself would try to write to it.
2013-01-26 20:42:33 -03:00
Werner Almesberger
8316bc0070 ubb-la/ubb-la.c (do_buf): move pretty-printing to new function print_samples 2013-01-26 20:01:32 -03:00
Werner Almesberger
4ceee66c79 ubb-la/ubb-la.c (INITIAL_SKIP): describe how the value was obtained 2013-01-26 19:55:44 -03:00
Werner Almesberger
a947b5ef85 ubb-patgen/Makefile (CFLAGS): use more specific -O9 -fno-tree-cselim
... instead of -O0. See previous commit for details.
2013-01-25 19:55:49 -03:00
Werner Almesberger
09de2454ef ubb-la/Makefile (CFLAGS): use more specific -O9 -fno-tree-cselim
Third time lucky, I hope. -fno-tree-cselim is much more specific than
disabling all optimization and results in a considerably less severe
performance reduction (about 30-40% of -O0).
2013-01-25 19:49:20 -03:00
Werner Almesberger
07026753de ubb-la/README: brief description of ubb-la 2013-01-24 20:04:40 -03:00
Werner Almesberger
4ce6866767 ubb-la/ubb-la.c (do_buf): skip over the first 122 samples
They are from the setup process and therefore invalid (DAT0) and/or out
of sync (DAT0-3) with the rest of the samples.
2013-01-24 20:00:59 -03:00
Werner Almesberger
fc4b8e720a ubb-patgen/Makefile (CFLAGS): even -O1 isn't safe; use -O0 instead
In ubb-la, -O1 still exhibited problems. Didn't verify for ubb-patgen,
but let's play this safe for now.
2013-01-24 18:33:08 -03:00
Werner Almesberger
62284fb78e ubb-la/ubb-la.c: add command-line options, keyboard abort 2013-01-24 18:26:34 -03:00
Werner Almesberger
bac21bf8cb ubb-la/Makefile (CFLAGS): even -O1 isn't safe; use -O0 instead
While -O1 gets rid of the unexpected read in the simple code of a synthetic
test, it's still there in the more complex environment we have in ubb-la.c
Turning off optimization completely seems to do the trick.
2013-01-24 17:35:52 -03:00
Werner Almesberger
00ef01ada8 ubb-patgen/Makefile (CFLAGS): -O9 is currently unsafe; use -O1
Higher optimizations can cause the generation of code that unexpectedly
does the equivalent of  PDFUNS = PDFUNS;

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56098
2013-01-24 15:34:04 -03:00
Werner Almesberger
e1eea4fa86 ubb-la/Makefile (CFLAGS): -O9 is currently unsafe; use -O1
Higher optimizations can cause the generation of code that unexpectedly
does the equivalent of  PDFUNS = PDFUNS;

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56098
2013-01-24 15:31:59 -03:00
Werner Almesberger
2c5b3625a7 ubb-la/: data capture via UBB and MSC+DMA (WIP) 2013-01-23 11:54:23 -03:00
Werner Almesberger
d4c1f5666c ubb-la/hw/: proof-of-concept passive LA adapter board
Note that the pull-ups on DAT1 through DAT3 and the pull-whichever-way on
DAT0 are likely to get in the way of any real-life use. But it's good enough
for exploring the system's characteristics and limitations.
2013-01-23 11:52:11 -03:00
Werner Almesberger
5025f360cc ubb-patgen/ubb-patgen.c: use symbolic bit/field definitions for DMA 2013-01-20 19:16:36 -03:00
Werner Almesberger
5efafd6fcc libubb/include/ubb/regs4740.h: add symbolic bit/field definitions for DMA 2013-01-20 19:16:17 -03:00
Werner Almesberger
486471e8fc ubb-patgen/ubb-patgen.c: use symbolic bit/field definitions for MSC_* 2013-01-20 17:34:39 -03:00
Werner Almesberger
4cb68b7ece libubb/mmcclk.c: use symbolic bit/field definitions for MSC_* 2013-01-20 17:34:17 -03:00
Werner Almesberger
8509c1f7b9 libubb/include/ubb/regs4740.h: add symbolic bit/field definitions for MSC_* 2013-01-20 17:34:01 -03:00
Werner Almesberger
a31351545c ubb-patgen/timeline.fig: timeline of pattern generation (description in README) 2013-01-18 14:18:44 -03:00
Werner Almesberger
8dda1200c1 ubb/solder-cable.fig: drawing to illustrate soldering a cable to UBB 2013-01-16 22:53:14 -03:00
Werner Almesberger
f920c6695b ubb-patgen/README: add "!\r" to UART example 2013-01-16 12:08:10 -03:00
Werner Almesberger
5be0b56aa1 swuart-chat/chat.c: options -r and -t to select pins; bit rate argument 2013-01-16 12:07:27 -03:00
Werner Almesberger
b8f2a8b764 ubb-patgen/ubb-patgen.c (send_buffer): track physmem_xlat_vec renaming 2013-01-16 10:30:41 -03:00
Werner Almesberger
e669a1b2d1 libubb/physmem.c (physmem_xlat_vec): rename to physmem_xlat 2013-01-16 10:29:46 -03:00
Werner Almesberger
35d4b9f381 libubb/physmem.c: remove physmem_xlat; cache open pagemap fd
To avoid contamination, we open the pagemap file with O_CLOEXEC.
2013-01-16 10:26:51 -03:00
Werner Almesberger
2de15b9aec ubb-patgen/ubb-patgen.c (send_buffer): use physmem_xlat_vec 2013-01-16 10:16:09 -03:00
Werner Almesberger
3161d5555b libubb/physmem.c (physmem_xlat_vec): more general version of physmem_xlat 2013-01-16 10:15:24 -03:00
Werner Almesberger
66080fe72e ubb-patgen/ubb-patgen.c: support trigger sequences, e.g., 01 for a rising edge 2013-01-16 04:45:49 -03:00
Werner Almesberger
4729d00b30 ubb-patgen/ubb-patgen.c: run at realtime priority while waiting for trigger 2013-01-16 03:56:17 -03:00
Werner Almesberger
6d749fafb8 ubb-patgen/ubb-patgen.c (main): sort options alphabetically in "switch" statement 2013-01-16 03:45:22 -03:00
Werner Almesberger
2161341267 ubb-patgen/ubb-patgen.c: new option -w to add delay before sending the pattern 2013-01-16 03:44:30 -03:00
Werner Almesberger
0129a59f86 ubb-patgen/ubb-patgen.c: new option -d to debounce the trigger 2013-01-16 03:30:04 -03:00
Werner Almesberger
39f4e48f8d ubb-patgen/ubb-patgen.c: new option -i to select frequency by cycle time 2013-01-16 01:58:16 -03:00