input/vcd: unbreak the logic which skips a user specified period
Rephrase the default value for the 'skip' option and the detection of a
user specified value. This is tricky because: Sample numbers are kept in
64bit values. Skip and downsample are fed to formulae so we want them
both to be unsigned. Yet absence of a user spec as well as possible user
values 0 and positive must be told apart. Use all-ones for the default
of "-1" which translates to "first timestamp", users need not be able to
specify that negative value.
Make sure to only downsample 'skip' values when the user specified some.
Which avoids the undesired insertion of huge idle gaps at the start of
the capture. An earlier implementation had to check for -1, this recent
version uses an unsigned number in combination with a boolean flag to
achieve this.
Reword some diagnostics messages, and print the samples count between
timestamps while we are here. Add a check for successful text to number
conversion of timestamp values.
How to reproduce:
$ pulseview -i file.vcd
$ pulseview -i file.vcd -I vcd:downsample=5
$ pulseview -i file.vcd -I vcd:skip=
111381600
Example file:
$timescale 1 ns $end
$scope module top $end
$var wire 1 ! d1 $end
$upscope $end
$enddefinitions $end
#
111381815
0!
#
111381905
1!
#
111381990
0!
#
111382075