From 1a00ecfaf926bc605e75709c4d93ae71fb2fd52c Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 18 Jun 2024 09:34:39 -0700 Subject: [PATCH] stdlib,configs,tests: Add gem5 MultiSim (MultiProcessing for gem5) (#1167) This allows for multiple gem5 simulations to be spawned from a single parent gem5 process, as defined in a simgle gem5 configuration. In this design _all_ the `Simulator`s are defined in the simulation script and then added to the mutlisim module. For example: ```py from gem5.simulate.Simulator import Simulator import gem5.utils.multisim as multisim # Construct the board[0] and board[1] as you wish here... simulator1 = Simulator(board=board[0], id="board-1") simulator2 = Simulator(board=board[1], id="board-2") multisim.add_simulator(simulator1) multisim.add_simulator(simulator2) ``` This specifies that two simulations are to be run in parallel in seperate threads: one specified by `simulator1` and another by `simulator2`. They are then added to MultiSim via the `multisim.add_simulator` function. The user can specify an id via the Simulator constructor. This is used to give each process a unique id and output directory name. Given this, the id should be a helpful name describing the simulation being specified. If not specified one is automatically given. To run these simulators we use ` -m gem5.utils.multisim