def _instantiate(self) -> None: """ This method will instantiate the board and carry out necessary boilerplate code before the instantiation such as setting up root and setting the sim_quantum (if running in KVM mode). """ if not self._instantiated: root = Root(full_system=self._full_system, board=self._board) # We take a copy of the Root in case it's required elsewhere # (for example, in `get_stats()`). self._root = root if CPUTypes.KVM in [ core.get_type() for core in self._board.get_processor().get_cores() ]: m5.ticks.fixGlobalFrequency() root.sim_quantum = m5.ticks.fromSeconds(0.001) m5.instantiate() self._instantiated = True
# The location of the x86 SPEC CPU 2017 image disk_image=CustomDiskImageResource( args.image, disk_root_partition=args.partition, ), readfile_contents=command, ) # We need this for long running processes. m5.disableAllListeners() root = Root(full_system=True, system=board) # sim_quantum must be set when KVM cores are used. root.sim_quantum = int(1e9) m5.instantiate() # We maintain the wall clock time. globalStart = time.time() print("Running the simulation") print("Using KVM cpu") start_tick = m5.curTick() end_tick = m5.curTick() m5.stats.reset() exit_event = m5.simulate()