mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	gem5: Add checkpoint support
We add the ability to explicitly take checkpoints when running with a gem5 system. As we cannot have any state which is shared between the host and simulated system, we first unmount the VirtIO device, take the checkpoint, and then remount the VirtIO device into the simulated system.
This commit is contained in:
		
				
					committed by
					
						
						setrofim
					
				
			
			
				
	
			
			
			
						parent
						
							9e45d65c94
						
					
				
				
					commit
					085737bbfa
				
			@@ -806,6 +806,21 @@ class Gem5Connection(TelnetConnection):
 | 
			
		||||
        unmount_command = "umount {}".format(self.gem5_input_dir)
 | 
			
		||||
        self._gem5_shell(unmount_command, as_root=True)
 | 
			
		||||
 | 
			
		||||
    def take_checkpoint(self):
 | 
			
		||||
        """
 | 
			
		||||
        Take a checkpoint of the simulated system.
 | 
			
		||||
 | 
			
		||||
        In order to take a checkpoint we first unmount the virtio
 | 
			
		||||
        device, take then checkpoint, and then remount the device to
 | 
			
		||||
        allow us to continue the current run. This needs to be done to
 | 
			
		||||
        ensure that future gem5 simulations are able to utilise the
 | 
			
		||||
        virtio device (i.e., we need to drop the current state
 | 
			
		||||
        information that the device has).
 | 
			
		||||
        """
 | 
			
		||||
        self._unmount_virtio()
 | 
			
		||||
        self._gem5_util("checkpoint")
 | 
			
		||||
        self._mount_virtio()
 | 
			
		||||
 | 
			
		||||
    def _move_to_temp_dir(self, source):
 | 
			
		||||
        """
 | 
			
		||||
        Move a file to the temporary directory on the host for copying to the
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user