Skip to content

Commit

Permalink
cxxrtl: fix handling of 0-bit variables in vcd_writer.sample().
Browse files Browse the repository at this point in the history
  • Loading branch information
jfng authored and whitequark committed Oct 13, 2024
1 parent 0f762f7 commit f953a51
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backends/cxxrtl/runtime/cxxrtl/cxxrtl_vcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class vcd_writer {
bool bit_curr = var.curr[bit / (8 * sizeof(chunk_t))] & (1 << (bit % (8 * sizeof(chunk_t))));
buffer += (bit_curr ? '1' : '0');
}
if (var.width == 0)
buffer += '0';
buffer += ' ';
emit_ident(var.ident);
buffer += '\n';
Expand Down

0 comments on commit f953a51

Please sign in to comment.