Commit 4e584719 authored by Hejing Li's avatar Hejing Li Committed by Jonas Kaufmann
Browse files

simple_ping_sysconf.py: use LinuxHost and set driver as a list

parent 4b7d203d
......@@ -12,16 +12,16 @@ HOST0 -- NIC0 ------ SWITCH ------ NIC1 -- HOST1
system = spec.System()
# create a host instance and a NIC instance then install the NIC on the host
host0 = spec.Host(system)
host0 = spec.LinuxHost(system)
nic0 = spec.i40eNIC(system)
host0.nic_driver = 'i40e'
host0.nic_driver = ['i40e']
host0.ip = '10.0.0.1'
pcichannel0 = spec.PCI(system)
pcichannel0.install(host0, nic0)
host1 = spec.Host(system)
host1 = spec.LinuxHost(system)
nic1 = spec.i40eNIC(system)
host1.nic_driver = 'i40e'
host1.nic_driver = ['i40e']
host1.ip = '10.0.0.2'
pcichannel1 = spec.PCI(system)
pcichannel1.install(host1, nic1)
......
......@@ -13,6 +13,9 @@ class System():
self.pci_channels: tp.List[PCI] = []
self.eth_channels: tp.List[Eth] = []
class SimObject():
def __init__(self) -> None:
self.sync_period = 500 #nano second
class Channel():
def __init__(self) -> None:
......@@ -62,7 +65,7 @@ class Host():
self.sync = True
self.pci_channel: PCI = None
self.nics: tp.List[NIC] = []
self.nic_driver = 'i40e'
self.nic_driver = ['i40e']
self.sim = None
# HostSim & NodeConfig parameters
......@@ -165,13 +168,12 @@ class LinuxHost(Host):
def __init__(self, sys) -> None:
super().__init__(sys)
self.ifname = 'eth0'
self.drivers: tp.List[str] = []
self.force_mac_addr: tp.Optional[str] = None
def prepare_post_cp(self) -> tp.List[str]:
l = []
for d in self.drivers:
for d in self.nic_driver:
if d[0] == '/':
l.append('insmod ' + d)
else:
......
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