From 7af03a797084db3099cdf3506e8eec464037abf6 Mon Sep 17 00:00:00 2001 From: Wiktoria Kuna Date: Thu, 19 Dec 2024 11:25:45 +0100 Subject: [PATCH] i2c_worker: Extend I2CState to enable sim with VCD Resolve reported issues when running I2C tests via 'run_simulation' with 'vcd_name' specified. Internal-tag: [#69926] Signed-off-by: Wiktoria Kuna --- litex/soc/cores/i2c_worker.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litex/soc/cores/i2c_worker.py b/litex/soc/cores/i2c_worker.py index 1c1a3d8e76..a718ec981e 100644 --- a/litex/soc/cores/i2c_worker.py +++ b/litex/soc/cores/i2c_worker.py @@ -28,6 +28,14 @@ class I2CState(IntEnum): ABORT = 9 CLR_FIFO = 10 + @classmethod + def encode(self): + return list(map(lambda c: c.value, self)) + + @classmethod + def __len__(self): + return 11 + @dataclass class I2CQueueEntry(param.Parameterized):