Commit 3f25a60d authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: support passing extra arguments to gem5 for experiments

parent 794a721c
...@@ -294,6 +294,8 @@ class Gem5Host(HostSim): ...@@ -294,6 +294,8 @@ class Gem5Host(HostSim):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.extra_main_args = []
self.extra_config_args = []
def set_config(self, nc): def set_config(self, nc):
nc.sim = 'gem5' nc.sim = 'gem5'
...@@ -313,8 +315,9 @@ class Gem5Host(HostSim): ...@@ -313,8 +315,9 @@ class Gem5Host(HostSim):
if env.create_cp: if env.create_cp:
cpu_type = self.cpu_type_cp cpu_type = self.cpu_type_cp
cmd = (f'{env.gem5_path} --outdir={env.gem5_outdir(self)} ' cmd = f'{env.gem5_path} --outdir={env.gem5_outdir(self)} '
f'{env.gem5_py_path} --caches --l2cache --l3cache ' cmd += ' '.join(self.extra_main_args)
cmd += (f' {env.gem5_py_path} --caches --l2cache --l3cache '
'--l1d_size=32kB --l1i_size=32kB --l2_size=2MB --l3_size=32MB ' '--l1d_size=32kB --l1i_size=32kB --l2_size=2MB --l3_size=32MB '
'--l1d_assoc=8 --l1i_assoc=8 --l2_assoc=4 --l3_assoc=16 ' '--l1d_assoc=8 --l1i_assoc=8 --l2_assoc=4 --l3_assoc=16 '
f'--cacheline_size=64 --cpu-clock={self.cpu_freq} --sys-clock={self.sys_clock} ' f'--cacheline_size=64 --cpu-clock={self.cpu_freq} --sys-clock={self.sys_clock} '
...@@ -349,6 +352,8 @@ class Gem5Host(HostSim): ...@@ -349,6 +352,8 @@ class Gem5Host(HostSim):
if cpu_type == 'TimingSimpleCPU': if cpu_type == 'TimingSimpleCPU':
cmd += ':sync' cmd += ':sync'
cmd +=' ' cmd +=' '
cmd += ' '.join(self.extra_config_args)
return cmd return cmd
......
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