diff --git a/b_asic/port.py b/b_asic/port.py index 958917c93538261d6a519eb3d479a3d136c5867d..2b83eafda07232189af3e0171ea1d412731fb836 100644 --- a/b_asic/port.py +++ b/b_asic/port.py @@ -122,7 +122,7 @@ class InputPort(Port): self._signal = signal if not signal.port_is_destination(self): # Connect this inputport as destination for this signal if it isn't already. - signal.connect_destination_port(self) + signal.connect_destination(self) def disconnect_signal(self, i: int = 0) -> None: assert 0 <= i < self.signal_count(), "Signal Index out of range." @@ -174,7 +174,7 @@ class OutputPort(Port): self._signals.append(signal) if not signal.port_is_source(self): # Connect this outputport to the signal if it isn't already - signal.connect_source_port(self) + signal.connect_source(self) def disconnect_signal(self, i: int = 0) -> None: assert 0 <= i < self.signal_count(), "Signal index out of bounds." diff --git a/b_asic/signal.py b/b_asic/signal.py index f6683a6159959dfc8c03c709f3a8e1f92154af64..ef1a45978ae430ee76d8c955369b734ccad79be4 100644 --- a/b_asic/signal.py +++ b/b_asic/signal.py @@ -22,13 +22,13 @@ class Signal(AbstractGraphComponent): super().__init__(name) self._source = source - self._destination = destination + self._destination = destination if source is not None: - self.connect_source_port(source) + self.connect_source(source) if destination is not None: - self.connect_destination_port(destination) + self.connect_destination(destination) @property def source(self) -> "OutputPort": @@ -40,7 +40,7 @@ class Signal(AbstractGraphComponent): """Returns the destination "InputPort" of the signal.""" return self._destination - def connect_source_port(self, src: "OutputPort") -> None: + def connect_source(self, src: "OutputPort") -> None: """Disconnects the previous source OutputPort of the signal and connects to the entered source OutputPort. Also connects the entered source port to the signal if it hasn't already been connected. @@ -54,7 +54,7 @@ class Signal(AbstractGraphComponent): # If the new source isn't connected to this signal then connect it. src.connect_signal(self) - def connect_destination_port(self, dest: "InputPort") -> None: + def connect_destination(self, dest: "InputPort") -> None: """Disconnects the previous destination InputPort of the signal and connects to the entered destination InputPort. Also connects the entered destination port to the signal if it hasn't already been connected.