Unverified Commit be8fda17 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

symphony/orchestration: helper connect methods for hosts & switches

parent 0afce61c
......@@ -91,6 +91,11 @@ class BaseEthNetComponent(base.Component):
def fromJSON(cls, system: base.System, json_obj: dict) -> BaseEthNetComponent:
return super().fromJSON(system, json_obj)
def connect_eth_peer_if(self, peer_i: EthInterface) -> EthChannel:
i = EthInterface(self)
self.add_if(i)
return EthChannel(peer_i, i)
class EthWire(BaseEthNetComponent):
def __init__(self, s: base.System) -> None:
......
......@@ -70,6 +70,11 @@ class Host(base.Component):
return instance
def connect_pcie_dev(self, dev: pcie.PCIeSimpleDevice):
pcie_if = pcie.PCIeHostInterface(self)
self.add_if(pcie_if)
pcichannel0 = pcie.PCIeChannel(pcie_if, dev._pci_if)
class FullSystemHost(Host):
def __init__(self, s: base.System) -> None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment