From: whitequark Date: Wed, 10 Jul 2019 12:54:59 +0000 (+0000) Subject: back.pysim: avoid malformed VCD files when a decoder uses tabs. X-Git-Tag: locally_working~78 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=278b624c66ad658804130ab0af64df4cdf6cbe2b;p=nmigen.git back.pysim: avoid malformed VCD files when a decoder uses tabs. --- diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index c5dd494..a32a967 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -543,7 +543,7 @@ class Simulator: if signal.decoder: var_type = "string" var_size = 1 - var_init = signal.decoder(signal.reset).replace(" ", "_") + var_init = signal.decoder(signal.reset).expandtabs().replace(" ", "_") else: var_type = "wire" var_size = signal.nbits @@ -649,7 +649,7 @@ class Simulator: for vcd_signal in self._vcd_signals[signal_slot]: signal = self._slot_signals[signal_slot] if signal.decoder: - var_value = signal.decoder(new).replace(" ", "_") + var_value = signal.decoder(new).expandtabs().replace(" ", "_") else: var_value = new vcd_timestamp = (self._timestamp + self._delta) / self._epsilon