gem5: fix --gem5-readfile

Was completely broken due to confusion between --gem5-readfile and a common
variable with the same name which referred to the file path... OMG.

Conclusion: no one has ever used this tutorial!

Improve ./gem5.sh documentation.

Also fix ./gem5-bench-dhrystone.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-13 00:00:00 +00:00
parent 2438410c25
commit d334a0db53
4 changed files with 77 additions and 24 deletions

6
run
View File

@@ -432,8 +432,8 @@ Extra options to append at the end of the emulator command line.
if not os.path.exists(self.env['linux_image']):
raise_image_not_found(self.env['image'])
self.sh.run_cmd([os.path.join(self.env['extract_vmlinux'], self.env['linux_image'])])
os.makedirs(os.path.dirname(self.env['gem5_readfile']), exist_ok=True)
self.sh.write_string_to_file(self.env['gem5_readfile'], self.env['gem5_readfile'])
os.makedirs(os.path.dirname(self.env['gem5_readfile_file']), exist_ok=True)
self.sh.write_string_to_file(self.env['gem5_readfile_file'], self.env['gem5_readfile'])
memory = '{}B'.format(self.env['memory'])
gem5_exe_args = self.sh.shlex_split(self.env['gem5_exe_args'])
if do_trace:
@@ -476,7 +476,7 @@ Extra options to append at the end of the emulator command line.
'--kernel', self.env['image'], LF,
'--mem-size', memory, LF,
'--num-cpus', str(self.env['cpus']), LF,
'--script', self.env['gem5_readfile'], LF,
'--script', self.env['gem5_readfile_file'], LF,
])
if self.env['arch'] == 'x86_64':
if self.env['kvm']: