From b1ddc8c38790169f56c74a0976721a1e6ee98570 Mon Sep 17 00:00:00 2001 From: Honza Date: Sun, 17 Apr 2022 13:25:10 +0200 Subject: [PATCH] Small bugfix in python code generation (I initially thought this line is useless). --- ariths_gen/wire_components/wires.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ariths_gen/wire_components/wires.py b/ariths_gen/wire_components/wires.py index 99daead..645674c 100644 --- a/ariths_gen/wire_components/wires.py +++ b/ariths_gen/wire_components/wires.py @@ -41,6 +41,10 @@ class Wire(): """ if self.is_const(): return f"({self.c_const}) << {offset}\n" + # If wire is part of an input bus (where wire names are concatenated from bus prefix and their index position inside the bus in square brackets) + # then the wire value is obtained from bitwise shifting the required wire from the parent bus ('parent_bus.prefix' is the same value as 'self.prefix') + elif self.is_buswire(): + return f"(({self.prefix} >> {self.index}) & 0x01) << {offset}\n" else: return f"(({self.name} >> 0) & 0x01) << {offset}\n"