stdlib: Fix SwitchableProcessor to allow switch to KVM
An exception was raised if the SwitchableProcessor was setup to switch to a KVM core from a non-KVM core (i.e., if KVM cores were present they needed to be the starting core). This was due to a bug in the Simulator module where the `root.sim_quantum` as not setup for cases where the SwitchableProcessor was not starting with a KVM core, thus causing an error when switched to KVM cores. This has been fixed by modifying the Simulator module to always set root.sim_quantum. This is acceptable as this is only used in KVM setups. Change-Id: If57352ba67b7bca81882eae2ef1e9013ef45272f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62471 Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Bobby Bruce
parent
18ab41965c
commit
50fd37a3b1
@@ -79,11 +79,6 @@ class SwitchableProcessor(AbstractProcessor):
|
||||
)
|
||||
|
||||
if self._prepare_kvm:
|
||||
if not self._current_cores[0].is_kvm_core():
|
||||
raise Exception(
|
||||
"When using KVM, the switchable processor must start "
|
||||
"with the KVM cores."
|
||||
)
|
||||
from m5.objects import KvmVM
|
||||
|
||||
self.kvm_vm = KvmVM()
|
||||
|
||||
@@ -283,12 +283,8 @@ class Simulator:
|
||||
# (for example, in `get_stats()`).
|
||||
self._root = root
|
||||
|
||||
if any(
|
||||
core.is_kvm_core()
|
||||
for core in self._board.get_processor().get_cores()
|
||||
):
|
||||
m5.ticks.fixGlobalFrequency()
|
||||
root.sim_quantum = m5.ticks.fromSeconds(0.001)
|
||||
m5.ticks.fixGlobalFrequency()
|
||||
root.sim_quantum = m5.ticks.fromSeconds(0.001)
|
||||
|
||||
# m5.instantiate() takes a parameter specifying the path to the
|
||||
# checkpoint directory. If the parameter is None, no checkpoint
|
||||
|
||||
Reference in New Issue
Block a user