cxxrtl: fix handling of 0-bit variables in `vcd_writer.sample()`.

This commit is contained in:
Jean-François Nguyen 2024-10-11 23:24:13 +02:00 committed by Catherine
parent 0f762f75a6
commit f953a516d0
1 changed files with 2 additions and 0 deletions

View File

@ -127,6 +127,8 @@ class vcd_writer {
bool bit_curr = var.curr[bit / (8 * sizeof(chunk_t))] & (1 << (bit % (8 * sizeof(chunk_t)))); bool bit_curr = var.curr[bit / (8 * sizeof(chunk_t))] & (1 << (bit % (8 * sizeof(chunk_t))));
buffer += (bit_curr ? '1' : '0'); buffer += (bit_curr ? '1' : '0');
} }
if (var.width == 0)
buffer += '0';
buffer += ' '; buffer += ' ';
emit_ident(var.ident); emit_ident(var.ident);
buffer += '\n'; buffer += '\n';