Uwe Hermann [Wed, 19 Mar 2014 22:04:55 +0000 (23:04 +0100)]
Switch to a non-recursive automake setup.
Instead of >= 44 Makefile.am's we now only have one top-level
Makefile.am, and use the 'subdir-objects' automake option to
handle the build via non-recursive (auto)make.
This has the advantage of fewer (boilerplate or other) files and less
clutter in general, as well as performance advantages since the new
setup can build many files in parallel (with 'make -j'), not only 2 or 3
files within the same (e.g. hardware/xxxx/* subdirectory) and also since
we no longer need to build intermediate libtool helper libs per subdirectory.
A quick, non-scientific test build on a quad-core laptop with 'make -j 4'
yields a build time reduction from 35s to 19s.
All autotools features that worked before are still intact without any
regressions, including the Make targets 'install', 'uninstall', 'check',
'dist', 'clean', 'distclean' and so on, as well as all the usual portability
handling (build works on any OS, with any Make implementation such as
GNU Make or BSD Make, with any shell such as sh/ksh/zsh/bash/dash, etc. etc.)
and features such as out-of-tree build support, cross-compile support,
testsuite support (also with colored output), "silent make rules", etc. etc.
Daniel Elstner [Tue, 4 Feb 2014 23:25:32 +0000 (00:25 +0100)]
input/vcd: Remove debug output from inner loops.
(parse_contents): Do not call sr_dbg() on every signal change.
This would be excessive even for sr_spew().
(read_until): Do not call ftell() just to be able to show some
number in a debug message later on.
Daniel Elstner [Thu, 30 Jan 2014 21:11:10 +0000 (22:11 +0100)]
vcd: Remove bogus $dumpvars and $dumpoff commands.
These commands are superfluous and do not seem to make sense in
the context they were used. Also, $dumpvars was missing an $end,
and $dumpoff was used without any content.
Daniel Elstner [Thu, 30 Jan 2014 20:57:49 +0000 (21:57 +0100)]
vcd: Output timestamp only once per change.
Avoid writing a new timestamp for every changed signal if multiple
signals change state simultaneously. Also, keep signal transitions
on the same line with their timestamp to make the output easier to
inspect in a text editor. (VCD does not care whether newlines or
spaces are used to separate tokens.)
Daniel Elstner [Thu, 30 Jan 2014 19:49:36 +0000 (20:49 +0100)]
vcd: Fix output for more than 8 channels.
(receive): Use probe index for sample byte selection too, not just
for bit selection. Also simplify the indexing expressions a bit.
This fixes the problem of incorrect output for probes indices 8 to
31.
Also, use double rather than float in the timestamp calculation,
and format the result directly as floating point number rather than
converting it back to uint64_t.
Additionally, make sure that the state of all signals is written
for the very first sample in the stream. This fixes the problem
that signals would be displayed as indeterminate until the first
change.
(context.samplecount): Make the sample counter part of the context
struct, rather than keeping it as a global static.
Daniel Elstner [Wed, 29 Jan 2014 19:53:51 +0000 (20:53 +0100)]
hwdriver: Add SR_CONF_CLOCK_EDGE option.
Allow the edge of an external clock input to be configured by
means of an SR_CONF_CLOCK_EDGE configuration setting. This is
a string option with the same format as SR_CONF_TRIGGER_SLOPE.
Daniel Elstner [Sun, 26 Jan 2014 20:42:22 +0000 (21:42 +0100)]
sysclk-lwla: Add support for external trigger input.
Implement the configuration setting TRIGGER_SOURCE with the
choices CH (logic channels) and TRG (external trigger input).
Also implement the TRIGGER_SLOPE setting for selecting the
edge to trigger on (rising or falling).
Daniel Elstner [Sun, 26 Jan 2014 19:28:59 +0000 (20:28 +0100)]
sysclk-lwla: Simplify and optimize word extraction.
It turns out that all LWLA protocol responses consist either
of 32-bit units or of 32-bit units combined into 64-bit units.
Thus it makes sense to double the basic unit size for reading
from 16 bit to 32 bit.
We cannot do the same for command messages though, as those
actually do use 16-bit quantities in some places, and 32-bit
arguments are not always aligned to 32-bit boundaries.
(acquisition_state.xfer_buf_in): Change unit type to uint32_t,
and update related macros and code accordingly.
(LWLA_TO_UINT32): New macro to replace LWLA_READ32, operating
directly on 32-bit values instead of pointers to 16-bit units.
Make use of a compiler-recognized idiom for bitwise rotation
to efficiently swap the 16-bit halves of a 32-bit word.
(LWLA_TO_UINT16): New macro to replace LWLA_READ16.
(LWLA_READ64): Remove unused macro.
(LWLA_WORD_[0123]): Slightly simplify 16-bit word extraction.
Daniel Elstner [Sat, 25 Jan 2014 22:27:40 +0000 (23:27 +0100)]
sysclk-lwla: Limit use of SR_ERR_ARG to user-supplied arguments.
The return code SR_ERR_ARG is intended for reporting unsupported
or inapplicable device configuration settings and is not a hard
error. In order to indicate failure of internal sanity checks,
use SR_ERR_BUG instead.
demo: Cast to double while calculating the pattern frequency.
Without the cast non integer frequencies weren't possible (e.g. with a sampling
frequency of 50Hz we would end up with a signal frequency of 2Hz instead of
2.5Hz). The result were signals which had an incorrect number of samples per
period.
Daniel Elstner [Sun, 26 Jan 2014 23:22:01 +0000 (00:22 +0100)]
hwdriver: Change TRIGGER_SLOPE setting to string type.
Drivers interpreted the uint64 values to the SR_CONF_TRIGGER_SLOPE
configuration setting in different ways. In order to orthogonalize
the API, change the type of the setting to a string with the same
format as uses for logic probes.
Daniel Elstner [Sat, 25 Jan 2014 01:21:19 +0000 (02:21 +0100)]
sysclk-lwla: Load bitstream files in RBF format.
Modify the bitstream loading routine to work directly with the
Raw Binary Files (.rbf) generated by Altera tools. Previously,
a custom format was used which was basically an RBF preceded by
a 4-byte header specifying the transfer length.
Uwe Hermann [Thu, 23 Jan 2014 21:45:08 +0000 (22:45 +0100)]
sr file format: Bump version to 2.
The *.sr (libsigrok session) file format has changed since the last
libsigrok release. Frontends using older libsigrok versions will not
be able to read *.sr files created by frontends using the new file format.
Thus, bump the version number of the file format to 2.
Current libsigrok will read both version 1 and version 2 files
correctly, and always write version 2 files.
Daniel Elstner [Thu, 23 Jan 2014 01:35:51 +0000 (02:35 +0100)]
sysclk-lwla: Implement config_commit() callback.
Move pre-acquisition hardware setup to the new config_commit()
callback. At the moment, the only setting applied at commit
time is switching the clock source, which involves uploading
a new bitstream to the FPGA.
Move setup of channels and trigger masks to the new probe
configuration callback. Although the actual hardware setup
still happens just before acquisition, the new approach
already has the advantage that invalid settings are caught
early.
Also, it turns out that the LWLA1034 allows triggering on
channels which are not enabled for data acquisition. This
feature is now supported as well.
Daniel Elstner [Thu, 23 Jan 2014 00:24:29 +0000 (01:24 +0100)]
sysclk-lwla: Do not reset drv_context.instances on scan.
Apparently, frontends may call scan() more than once to accumulate
multiple devices, so do not reset the instance list pointer at the
start of each scan. Also, number devices continuously across scans.
Martin Ling [Wed, 22 Jan 2014 00:25:32 +0000 (00:25 +0000)]
rigol-ds: Overhaul VS5000 and DS1000 support.
This change moves the handling of series differences out to the points in the
code where they actually matter, unifying the overall structure of the code.
It also adds new VS5000/DS1000 series equivalents for commands that were
previously only implemented on the later models.
After this change, trigger waiting and the 'Memory' data source are supported
on the VS5000/DS1000 series.