input/vcd: unbreak U and - values for single bit input data

The previous implementation already mapped L/H/U/- literals for input
data values to the 0/1/0/0 logic levels which sigrok can handle. But
missed these literals in the condition which dispatches real/integer,
bit vector, and single bit data types. Which made VCD import fail for
some of the files in the SpinalWorkshop repo.

Extend the test condition for single bit values. This unbreaks the
import of the Apb3TimerTester.vcd and ApbPwmTester.vcd files, which
contained phrases like these:

  ...
  $var reg 1 % io_apb_pwrite $end
  ...
  #0
  bUUUUUUUU !
  b0 "
  0#
  1$
  U%

and

  ...
  $var reg 8 # io_apb_paddr[7:0] $end
  $var reg 1 $ io_apb_pwrite $end
  ...
  #0
  b0 !
  0"
  b-------- #
  -$
  b-------------------------------- %
  b00000000000000000000000000000000 &
  1'
This commit is contained in:
Gerhard Sittig 2020-10-17 10:42:56 +02:00
parent a3fe36d01e
commit 358105152a
1 changed files with 4 additions and 0 deletions

View File

@ -1235,6 +1235,8 @@ static uint8_t vcd_char_to_value(char bit_char, int *warn)
return 0;
if (bit_char == 'u')
return 0;
if (bit_char == '-')
return 0;
/* Unhandled input text. */
return ~0;
@ -1449,7 +1451,9 @@ static int parse_textline(const struct sr_input *in, char *lines)
is_real = curr_first == 'r' && curr_word[1];
is_multibit = curr_first == 'b' && curr_word[1];
is_singlebit = curr_first == '0' || curr_first == '1';
is_singlebit |= curr_first == 'l' || curr_first == 'h';
is_singlebit |= curr_first == 'x' || curr_first == 'z';
is_singlebit |= curr_first == 'u' || curr_first == '-';
if (is_real) {
char *real_text;
float real_val;