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"