From 278b624c66ad658804130ab0af64df4cdf6cbe2b Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 10 Jul 2019 12:54:59 +0000 Subject: [PATCH] back.pysim: avoid malformed VCD files when a decoder uses tabs. --- nmigen/back/pysim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2