Commit 23629578 authored by Hejing Li's avatar Hejing Li
Browse files

example script checkpoint: constructing simulation error clear

parent fe223e29
...@@ -12,7 +12,7 @@ This scripts generates the experiments with all the combinations of different ex ...@@ -12,7 +12,7 @@ This scripts generates the experiments with all the combinations of different ex
# host_types = ['qemu', 'gem5', 'qt'] # host_types = ['qemu', 'gem5', 'qt']
host_types = ['gem5'] host_types = ['gem5']
nic_types = ['bm'] nic_types = ['i40e', 'vr']
net_types = ['switch'] net_types = ['switch']
experiments = [] experiments = []
...@@ -49,68 +49,63 @@ ethchannel1 = system.EthChannel(switch.eth_ifs[1], nic1.eth_if) ...@@ -49,68 +49,63 @@ ethchannel1 = system.EthChannel(switch.eth_ifs[1], nic1.eth_if)
host0.add_app(system.NetperfClient(host0, nic1.ip)) host0.add_app(system.NetperfClient(host0, nic1.ip))
host1.add_app(system.NetperfServer(host1)) host1.add_app(system.NetperfServer(host1))
'''
""" """
Execution Config Execution Config
""" """
for host_type in host_types: for host_type in host_types:
for nic_type in nic_types: for nic_type in nic_types:
for net_type in net_types: for net_type in net_types:
e = exp.Experiment( e = sim.Simulation(
'n-' + host_type + '-' + nic_type + '-' + net_type 'n-' + host_type + '-' + nic_type + '-' + net_type
) )
allobj = runobj.AllObj()
# Host # Host
if host_type == 'gem5': if host_type == 'gem5':
host_sim = impl.Gem5Sim host_sim = sim.Gem5Sim
elif host_type == 'qemu': elif host_type == 'qemu':
def qemu_sim(e): def qemu_sim(e):
h = impl.QemuSim(e) h = sim.QemuSim(e)
h.sync = False h.sync = False
return h return h
host_sim = qemu_sim host_sim = qemu_sim
elif host_type == 'qt': elif host_type == 'qt':
host_sim = impl.QemuSim host_sim = sim.QemuSim
else: else:
raise NameError(host_type) raise NameError(host_type)
# NIC # NIC
if nic_type == 'bm': if nic_type == 'i40e':
nic_sim = impl.CorundumBMNICSim nic_sim = sim.I40eNicSim
elif nic_type == 'vr': elif nic_type == 'vr':
nic_sim = impl.CorundumVerilatorNICSim nic_sim = sim.CorundumVerilatorNICSim
else: else:
raise NameError(nic_type) raise NameError(nic_type)
# Net # Net
if net_type == 'switch': if net_type == 'switch':
net_sim = impl.SwitchBMSim net_sim = sim.SwitchNet
else: else:
raise NameError(net_type) raise NameError(net_type)
host_inst0 = host_sim(e)
host_inst0 = host_sim(e, allobj)
host_inst0.add(host0) host_inst0.add(host0)
host_inst1 = host_sim(e, allobj) host_inst1 = host_sim(e)
host_inst1.add(host1) host_inst1.add(host1)
nic_inst0 = nic_sim(e, allobj) nic_inst0 = nic_sim(e)
nic_inst0.add(nic0) nic_inst0.add(nic0)
nic_inst1 = nic_sim(e, allobj) nic_inst1 = nic_sim(e)
nic_inst1.add(nic1) nic_inst1.add(nic1)
net_inst = net_sim(e, allobj) net_inst = net_sim(e)
net_inst.add(switch) net_inst.add(switch)
print(e.name + " all simulators:") print(e.name + " all simulators:")
sims = e.all_simulators() sims = e.all_simulators()
for sim in sims: for s in sims:
print(sim) print(s)
experiments.append(e) experiments.append(e)
'''
\ No newline at end of file
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