libsigrok/hardware/zeroplus-logic-cube
Russ Dill 42ceb77726 zeroplus: Major rework of sample buffer processing
The sample buffer is a still a bit of a mystery, but this should help.
The variables in play:

triggerbar/ramsize_trigger - These two variables added together indicate
how many samples we want captured. ramsize_trigger - triggerbar
indicades how many samples must be captured. The ratio between the two
is determined by capture ratio.

memory_size - This indicates the number of samples in the circular
capture buffer. stop_address, now_address, and trigger_address are
pointers within the zeroplus that wrap based on this size.

now_address - The address that the zeroplus was about to write to when
it finished capturing, and now the address that will be read from when
reads are done from the capture buffer

stop_address - The address that the zeroplus last wrote to when it
completed capture.

trigger_address - The sample address for which the trigger occured.

status - This one is a bit tricky. Some testing has shown that if the
zeroplus has captured memory_size or less samples, the STATUS_READY bit
is set. For all captures generated with more samples than this,
STATUS_READY was cleared. However, boundary conditions are difficult to
test and values such as, memory_size + 1 have not been tested. We use
this to determine if the capture has wrapped through the sample buffer.

More testing is required, but this improves behavior in a number of
cases, specifically capturing sample amounts that are not a power of 2
of the sample buffer size. Before, random data was passed to libsigrok.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:11 +01:00
..
Makefile.am Use consistent naming for internal libtool helper libs. 2013-05-10 17:44:01 +02:00
analyzer.c zeroplus: Add getters for memory configuration 2014-01-03 15:09:10 +01:00
analyzer.h zeroplus: Add getters for memory configuration 2014-01-03 15:09:10 +01:00
api.c zeroplus: Major rework of sample buffer processing 2014-01-03 15:09:11 +01:00
gl_usb.c zeroplus: Modify analyzer_read_start to just prep for bulk reads. 2014-01-03 15:09:10 +01:00
gl_usb.h zeroplus: Modify analyzer_read_start to just prep for bulk reads. 2014-01-03 15:09:10 +01:00
protocol.c zeroplus: Ignore capture ratio if there is no trigger 2014-01-03 15:09:10 +01:00
protocol.h Centralise duplicated logging helper defines. 2013-12-27 12:54:05 +01:00