Hi Giacomo, thanks for the feedback. However, I didn't follow when you said
> I gave a quick look. _build_kvm seems more or less the same. There is a manipulation of the event queues specifically for the KVM case in fs_bigLITTLE.py that I couldn't find in fs.py. In my experiments, if those are not present the boot never advances. > The problem is in the fs.py sim_quantum: > > root.sim_quantum = int(1e9) # 1 ms > > This is obviously wrong > > And it should align with fs_bigLITTLE. I could not find root.sim_quantum = int(1e9) # 1 ms in the fs.py (https://gem5.googlesource.com/public/gem5/+/refs/heads/master/configs/example/fs.py) as you mentioned. In fact, if that was the case (if it was in fs.py) I would say the value is correct because if I print the root.sim_quantum in the fs_bigLITTLE (which works) after it is assigned inside the instantiate function, I do get "1000000000" as output, i.e. (1e9). So I'm not sure I'm on the same page as you... Anyway, the following is the reported diff between my own branch (my modifications to make fs.py work) compared to the stable branch of gem5 (v21.0.0.0). Hope it helps to explain my point. diff --git a/configs/example/fs.py b/configs/example/fs.py index f388503e2..438175d69 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -63,6 +63,21 @@ from common import ObjectList from common.Caches import * from common import Options +def _to_ticks(value): # copied from fs_bigLITTLE.py + """Helper function to convert a latency from string format to Ticks""" + + return m5.ticks.fromSeconds(m5.util.convert.anyToLatency(value)) + +def _using_pdes(root): # copied from fs_bigLITTLE.py + """Determine if the simulator is using multiple parallel event queues""" + + for obj in root.descendants(): + if not m5.proxy.isproxy(obj.eventq_index) and \ + obj.eventq_index != root.eventq_index: + return True + + return False + def cmd_line_template(): if options.command_line and options.command_line_file: print("Error: --command-line and --command-line-file are " @@ -75,6 +90,7 @@ def cmd_line_template(): return None def build_test_system(np): + m5.ticks.fixGlobalFrequency() # copied from fs_bigLITTLE.py, otherwise gem5 complains the frequency is not fixed for kvm multicore cmdline = cmd_line_template() if buildEnv['TARGET_ISA'] == "mips": test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0], cmdline=cmdline) @@ -147,6 +163,20 @@ def build_test_system(np): if ObjectList.is_kvm_cpu(TestCPUClass) or \ ObjectList.is_kvm_cpu(FutureClass): test_sys.kvm_vm = KvmVM() + # Assign KVM CPUs to their own event queues / threads. This + # has to be done after creating caches and other child objects + # since these mustn't inherit the CPU event queue. + cpus = test_sys.cpu # adapted from fs_bigLITTLE.py + if len(cpus) > 1: + device_eq = 0 + first_cpu_eq = 1 + for idx, cpu in enumerate(cpus): + # Child objects usually inherit the parent's event + # queue. Override that and use the same event queue for + # all devices. + for obj in cpu.descendants(): + obj.eventq_index = device_eq + cpu.eventq_index = first_cpu_eq + idx if options.ruby: bootmem = getattr(test_sys, '_bootmem', None) @@ -368,6 +398,10 @@ if buildEnv['TARGET_ISA'] == "arm" and not options.bare_metal \ sys.workload.dtb_filename = \ os.path.join(m5.options.outdir, '%s.dtb' % sysname) sys.generateDtb(sys.workload.dtb_filename) + if root and _using_pdes(root): # adapted from bigLITTLE.py + m5.util.inform("Running in PDES mode with a %s simulation quantum.", + "1ms") # reporting as in fs_bigLITTLE.py, not really needed but well + root.sim_quantum = _to_ticks("1ms") # adapted from bigLITTLE.py Simulation.setWorkCountOptions(test_sys, options) Simulation.run(options, root, test_sys, FutureClass) > Are you keen on posting a patch fixing it? > > Otherwise I can post it myself (if you don't want to) I am kind of in a rush to get some experiments working and never really contributed to the gem5 upstream, so if you don't mind pushing it to the main repo that would save me some time. I can do it otherwise, but I'd have to check how to contribute and all of that (likely not to be done today). Again, thank you very much for the help. Best, Pedro. _______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s