A method for synchronizing multi-chip parallel simulation
Through multiple rounds of parallel simulation, combined with functional simulation, network simulation and timing simulation, the problems of low simulation accuracy of existing parallel simulation machines in multi-core systems are solved, and efficient clock synchronization and accurate simulation results are achieved.
Patent Information
- Application Number
- CN202411230492.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Existing parallel emulators have problems with performance limitations and low simulation accuracy in multi-core system simulation, especially in clock synchronization strategies, which leads to increased simulation time overhead and impaired accuracy.
Multi-round parallel simulation method is adopted, and the combination of functional simulation, network simulation and timing simulation can ensure the correctness of event causality and accuracy of clock synchronization, and only synchronize between core particles with information interaction to reduce the need for global synchronization. .
It improves simulation speed and accuracy, ensures the accuracy of functional models and timing models, reduces simulation time overhead, and ensures clock synchronization between each core particle.
Smart Images

Figure CN118733200B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of parallel simulation, and in particular to a method for synchronizing multi-core parallel simulation. Background Art
[0002] The mainstream CPU parallel simulators are Gem5 (Binkert, N., Beckmann, B., Black, G., Reinhardt, SK, Saidi, A., Basu, A., et al.: The gem5 simulator. SIGARCH Comput. Archit. News 39(2), 1–7 (Aug 2011)) and Sniper (Trevor E. Carlson, Wim Heirman, and Lieven Eeckhout. 2011. Sniper: exploring the level of abstraction for scalable and accurate parallel multi-core simulation. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11). Association for Computing Machinery, New York, NY, USA, Article 52, 1–12). The main problem with Gem5 is that it uses a single-threaded DES core, which limits its performance and scalability in simulating multi-core systems. Sniper has a great advantage in multi-core parallel simulation, but because it is based on trace simulation, the simulation accuracy is relatively low. The current mainstream GPU simulator is GPGPU-Sim (Ali Bakhoda, George L Yuan, Wilson WL Fung, Henry Wong, and Tor MAamodt. 2009. Analyzing CUDA workloads using a detailed GPU simulator. InPerformance Analysis of Systems and Software, 2009. ISPASS 2009. IEEEInternational Symposium on. IEEE, 163–174.).
[0003] In addition to these basic simulators, many studies have proposed some simulators for multi-core parallelism, which have improved their parallel simulation capabilities and scalability compared to the original simulators. Daniel Sanchez and Christos Kozyrakis proposed the Zsim simulator (Daniel Sanchez and Christos Kozyrakis. 2013. ZSim:fast and accurate microarchitectural simulation of thousand-core systems.SIGARCH Comput. Archit. News 41, 3 (June 2013), 475–486.). This simulator improves the scalability of parallel simulation on multi-core hosts through binding-weaving parallelism, but because it uses phased clock synchronization, that is, although the simulation of each core is parallel, the simulation of all cores will be synchronized through a synchronization barrier when the predetermined number of cycles is reached. This synchronization method will cause the core that completes in advance to wait for all other cores to complete the tasks of this stage before entering the next stage, which increases the time overhead of the simulation. JE Miller et al. proposed the Graphite simulator (JE Miller et al., "Graphite: A distributed parallel simulator formulticores," HPCA - 16 2010 The Sixteenth International Symposium on High-Performance Computer Architecture, Bangalore, India, 2010, pp.), which uses a loosely synchronized clock synchronization strategy. The characteristic of this strategy is that the clocks on each core run independently of each other and are synchronized only at specific times. The disadvantage of this simulator's synchronization strategy is that when processing events, Graphite does not strictly enforce the order of all events. In some cases, it ignores timestamps and determines the delay of operations based on the order in which events are executed locally, rather than the exact order they should have in the simulated system.Rafael Ubal et al. proposed the Multi2Sim simulator (Rafael Ubal, Byunghyun Jang, Perhaad Mistry, Dana Schaa, and David Kaeli. 2012. Multi2Sim: a simulation framework for CPU-GPU computing. In Proceedings of the 21st international conference on Parallel architectures and compilation techniques (PACT '12). Association for Computing Machinery, New York, NY, USA, 335–344.), which simulates the interaction between the CPU and GPU through an exhaustive synchronization strategy. Since this strategy uses instruction-level synchronization, although it improves the simulation accuracy, it greatly increases the simulation overhead.
[0004] The main problem of parallel simulation is to synchronize multiple processes or threads accurately and quickly. Quantum-based barrier synchronization (Mohammad, A. Darbaz, U. Dozsa, G. Diestelhorst, S, Kim, D. and Kim, NS dist-gem5: Distributed simulation of computerclusters. In 2017 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS) (pp. 153-162). 2017, April) is a global synchronization algorithm. Compared with cycle-by-cycle synchronization, this synchronization method reduces the synchronization overhead. Compared with complete synchronization, this synchronization method has an advantage in accuracy. However, it still needs to set barriers to synchronize all core particles.
[0005] There are two typical clock synchronization algorithms for parallel simulation: LBTS and FNM. The LBTS algorithm (RMFujimoto, "Parallel and distributed simulation systems," Proceeding of the2001 Winter Simulation Conference (Cat. No.01CH37304), Arlington, VA, USA, 2001, pp. 147-157 vol.1, doi: 10.1109 / WSC.2001.977259.) is used to manage and control the advancement of simulation time in parallel and distributed simulation. It ensures that events are processed in a consistent order of causality, that is, in a non-decreasing order of timestamps, which is essential to maintaining the integrity and correctness of the simulation. The Forecast Null-Message (FNM) algorithm (Jun Wang, Zhenjiang Dong, Sudhakar Yalamanchili, and George Riley. 2013. Optimizing parallel simulation of multicore systems usingdomain-specific knowledge. In Proceedings of the 1st ACM SIGSIM Conference onPrinciples of Advanced Discrete Simulation (SIGSIM PADS '13). Association forComputing Machinery, New York, NY, USA, 127–136.) is an event scheduling and time management algorithm for parallel discrete event simulation. It avoids timestamp reversal and inconsistency problems between different processors by sending null messages, thereby ensuring the correctness of the simulation. The disadvantage of this method is that it requires prediction of inter-chip network transmission delay, and the timing model has a certain error.
[0006] The advantage of this method is that it not only ensures the accuracy of the functional and timing models, but also reduces the simulation synchronization overhead. Since this method only performs clock synchronization between core particles that have information exchange, the simulation time is greatly shortened. Through functional simulation, the correctness of event causality is guaranteed, and through network simulation, the network transmission delay is calculated; through timing simulation, the accurate synchronization of the clock is achieved, ensuring the accuracy of the functional model and timing model of the parallel simulation. Summary of the invention
[0007] The object of the present invention is to provide a method for multi-core parallel simulation synchronization in view of the deficiencies in the prior art.
[0008] To achieve the above object, the present invention provides a method for multi-core parallel simulation synchronization, comprising the following steps:
[0009] (1) Functional simulation: By matching the read and write between the core particle and the global manager, the causal relationship of the read and write events is ensured to be correct, and accurate functional model simulation is achieved; at the same time, the time of access to the shared memory and the communication traffic generated during the simulation are recorded; the global manager is used to record the timing of each event sent from the core particle;
[0010] (2) Network simulation: Based on the communication traffic generated during the simulation process in step (1), the inter-chip network simulator simulates the read and write events, calculates the transmission delay of each read and write event in the inter-chip network, and obtains the transmission delay data;
[0011] (3) Timing simulation: Combine the transmission delay data obtained in step (2) with the functional model simulated in step (1) to obtain the inter-chip network delay; then re-perform the complete simulation to accurately construct the timing model;
[0012] (4) Repeat steps (2) and (3) until the timing simulation results converge and the clocks between the cores are synchronized.
[0013] Furthermore, the functional simulation of step (1) includes remote read operation and remote write operation;
[0014] Remote read operation: When the application calls the corresponding chiplet read operation, the requested instruction is executed by executing its functional model and timing model through the chiplet simulator; the chiplet simulator sends a read request to the global controller of the functional model; after the global controller matches the read and write requests of the two chiplets, it sends an approval message to the chiplet simulator that sent the read request, allowing the chiplet simulator to read data from the shared memory; when the chiplet simulator receives the read permission, the functional model reads the data from the shared memory to the network interface module of the corresponding chiplet; the chiplet simulator then transfers the data from the network interface module to the local storage module; at the same time, the clock cycle is adjusted to the clock cycle when the sender sends the data through the global manager;
[0015] Remote write operation: When the application calls the corresponding chiplet write operation, the chiplet simulator executes its functional model and timing model to execute the requested instruction; the chiplet simulator sends a write request to the global controller of the functional model; after the global controller matches the read and write requests of the two chiplets, it sends an approval message to the chiplet simulator that sent the write request, allowing the chiplet simulator to write data to the shared memory; when the chiplet simulator receives the write permission, the functional model transfers the data to the network interface module of the corresponding chiplet, and the chiplet simulator then transfers the data from the network interface module to the shared memory.
[0016] Furthermore, the step (2) is specifically as follows: according to the flow of inter-chip information transmission during the simulation process of step (1) and the set inter-chip network topology, the inter-chip network information transmission is simulated by the inter-chip network simulator, the transmission delay of each read and write event in the inter-chip network is calculated, and the transmission delay data is obtained.
[0017] Furthermore, in the step (3), the timing simulation adds synchronization of the timing model to the read and write operations of the functional simulation, specifically: the core particle simulator sends a time request to the global controller of the timing model to obtain the clock cycle when the data arrives; the timing model of the global manager calculates the clock cycle when the data arrives based on the inter-chip network delay obtained by the timing simulation; during the timing synchronization process, the clock cycle is passed to the core particle simulator, and the clock cycle of the core particle simulator is modified accordingly.
[0018] To achieve the above object, the present invention further provides a multi-chip parallel simulation synchronization device, comprising one or more processors, for implementing the multi-chip parallel simulation synchronization method.
[0019] To achieve the above-mentioned purpose, the present invention also provides an electronic device, including a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned multi-core parallel simulation synchronization method.
[0020] To achieve the above object, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for multi-chip parallel simulation synchronization is implemented.
[0021] The beneficial effect of the present invention is that, through multiple rounds of parallel simulation, the present invention not only ensures the accurate construction of the event causal relationship of the functional model, but also ensures the synchronization of the clocks between the various core particles; and ensures the accuracy of parallel simulation. Since the core particles involved in the interaction are synchronized only when there is information interaction, global synchronization is not required; the simulation speed is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a diagram of the overall simulation synchronization architecture of the present invention;
[0023] Figure 2 is a simulation flow chart of the present invention; wherein, Figure 2 (a) is the functional simulation flow chart. Figure 2 (b) in the figure is the network simulation flow chart. Figure 2 (c) is the timing simulation flow chart;
[0024] Figure 3 is a flow chart of a read operation in the functional simulation of the present invention;
[0025] Figure 4 It is a flow chart of the write operation in the functional simulation of the present invention;
[0026] Figure 5 It is a flow chart of the read and write operations in the functional simulation of the present invention;
[0027] Figure 6 It is a flow chart of the read and write operations in the timing simulation of the present invention;
[0028] Figure 7 It is a schematic diagram of the structure of the device of the present invention;
[0029] Figure 8 It is a schematic diagram of an electronic device of the present invention. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0031] The core technology of the present invention is to build accurate functional models and timing models through 2 or more rounds of parallel simulation of multi-chip system.
[0032] The implementation architecture of the method of the present invention mainly includes: a global manager for recording the timing of each event sent from a core particle; multiple core particle simulators, such as GEM5 and SniperSim for simulating CPU core particles, GPGPU-Sim and Accel-Sim for simulating GPU core particles, and MNSIM for simulating CiM core particles; an inter-chip network simulator for calculating inter-chip network transmission delay. Among them, GEM5 is a cycle-accurate CPU simulator, SniperSim is a trace-driven CPU simulator, GPGPU-Sim is a cycle-accurate GPU simulator, Accel-Sim is a trace-driven GPU simulator, MNSIM is a simulation platform for memristor neuromorphic computing systems, and CiM is a chip unit that integrates computing functions with storage functions.
[0033] See also Figure 1 and Figure 2 (PA in the figure is an interface for information exchange between chips). The present invention proposes a method for parallel simulation synchronization of multiple chips, including the following steps:
[0034] (1) First round of simulation: see Figure 2 In (a), by matching the read and write between the core particle and the global manager, the causal relationship of the read and write events is ensured to be correct, thereby achieving accurate functional model simulation; at the same time, the time of access to the shared memory and the communication traffic generated during the simulation are recorded; the global manager is used to record the timing of each event emitted from the core particle.
[0035] Furthermore, the step (1) includes the following sub-steps:
[0036] (1.1) Remote read operation:
[0037] See also Figure 3 In the first step, when the application (the benchmark in the figure is a set of standardized test programs) calls the corresponding core grain read operation API (Application Programming Interface), the core grain simulator simultaneously executes its functional model and timing model to execute the requested instructions. However, in the first round, only the accuracy of the functional model is ensured. The timing model does not add the network transmission delay, resulting in inaccurate timing results. The remote read-write module and the network interface will synchronize information. When the remote read-write module receives the read permission from the global controller, it will notify the network interface to prepare to read data from the shared memory. When the network interface finishes reading the data, it will return a signal to the read-write module and transfer the data to the local memory.
[0038] In the second step, the core particle simulator sends a read request to the global controller of the functional model; before receiving the confirmation information, the core particle simulator cannot read data from the shared memory, and the clock cycle will be paused. The global controller is used to match the sending and receiving data request information between different core particles to ensure the accuracy of the simulation function and timing.
[0039] In the third step, after the global controller matches the read and write requests of the two chiplets, it sends an approval message RESULT to the chiplet emulator that sends the read request, allowing the chiplet emulator to read data from the shared memory.
[0040] In the fourth step, when the core-grain simulator receives the read permission, the functional model reads the data from the shared memory to its network interface module. The core-grain simulator then transfers the data from the network interface module to the local storage module. At the same time, the clock cycle is adjusted to the clock cycle when the sender sends the data. Since the inter-chip network delay is unknown in the first round, the synchronized clock cycle is not accurate.
[0041] (1.2) Remote write operation:
[0042] See also Figure 4 ,In the first step, when the application calls the corresponding ,chiplet write operation API, the chiplet simulator executes its ,functional model and timing model simultaneously.
[0043] In the second step, the chip simulator sends a write request to the global controller of the functional model. Before receiving the confirmation message, the chip simulator cannot write data to the shared memory.
[0044] In the third step, after the global controller matches the read and write requests of the two core particles, it sends approval information RESULT to the core particle emulator that sends the write request, allowing it to write data to the shared memory.
[0045] In the fourth step, when the chiplet simulator receives the write permission, the functional model will transfer the data to the network interface module. The chiplet simulator then transfers the data from the network interface module to the shared memory.
[0046] In order to realize the control of the read and write operations and timing synchronization of the core particles by the global manager, this method defines several specific commands for the interaction between the global manager and the core particles, as shown in Table 1:
[0047]
[0048] Table 1
[0049] In Table 1, RECEIVE (receive data), SEND (send data) and RESULT (function read / write permission) commands are used for function synchronization. Each command contains the original address <source address>and destination address<destination address> , and then distinguish different core particles to achieve their read and write matching in the global manager. RECEIVE and SEND commands are sent from the core particle simulator to the global manager, corresponding to the read and write operations respectively. Figure 5 and Figure 6 ,RESULT command is mainly: sent from the global manager to the chip emulator as a reply to the request sent by the chip to the global manager.
[0050] (2) Round 1.5 simulation: see Figure 2 In (b), according to the communication traffic generated during the simulation process of step (1), the inter-chip network simulator simulates the read and write events, calculates the transmission delay of each read and write event in the inter-chip network, and obtains the transmission delay data.
[0051] Specifically, the traffic of inter-chip information transmission is obtained from sub-steps (1.1) and (1.2), and according to the set inter-chip network topology, the inter-chip network information transmission is simulated through the inter-chip network simulator NoI (baikeina / popnet_chiplet: Chiplet simulatorbase on popnet (github.com)) to obtain the delay of data transmission in the network. The inter-chip network simulator can simulate any network topology (including the connection information between each node and the delay information of the routing node).
[0052] The inter-chip network simulator needs to build a routing port mapping table based on the topology file. The inter-chip network simulator can read the routing table file as input, and the routing table can be calculated using the Floyd-Warshall All-Pairs Shortest Path Algorithm (Floyd-Warshall All-Pairs Shortest Path Algorithm). The routing table contains the current address, the destination address, and the next hop address. After the routing table is built, the network simulation is performed according to the traffic file generated by the first round of functional simulation to obtain the corresponding network delay.
[0053] (3) Second round of simulation: see Figure 2 In (c), a complete simulation is performed again. After ensuring that the functional model is correct, the transmission delay of the inter-chip network in the 1.5th round is added to achieve accurate construction of the timing model.
[0054] The second round adds synchronization of the timing model to the read and write operations of the first round. Figure 6After reading or writing data in the fifth step, the following operations are added to achieve accurate time synchronization. First, the chip simulator sends a time request to the global controller of the timing model to obtain the accurate clock cycle when the data arrives; the timing model of the global manager calculates the accurate clock cycle when the data arrives based on the inter-chip network delay obtained in the second round; during the timing synchronization process, the clock cycle is passed to the chip simulator and the clock cycle of the chip simulator is modified accordingly.
[0055] (4) To further improve the simulation accuracy of the timing model, rounds 1.5 and 2 can be repeated to obtain a more accurate timing model, thereby achieving synchronization of the clocks between the various core particles; the simulation can be terminated when the timing simulation results converge.
[0056] The second round of simulation focuses on timing synchronization. The main commands used for timing synchronization include READ (read data), WRITE (write data) and SYNC (timing synchronization) in Table 1. READ and WRITE commands are sent from the chip to the global manager. The commands contain the clock cycle, source address and destination address when sending. These two commands will request clock synchronization. See Figure 5 and Figure 6 , the SYNC command is used to send from the global manager to the chip simulator. It also contains the clock cycle. Assume that the clock cycle sent at the time is , the inter-chip network delay calculated in the second round is , the clock cycle contained in SYNC is .
[0057] In Table 2, the present invention defines three functions in the global manager for message transmission and clock synchronization respectively.
[0058] Function name Received execution command Purpose handle_pipe_cmd() RECEIVE, SEND Sending and receiving data handle_read_cmd() READ Clock synchronization handle_write_cmd() WRITE Clock synchronization
[0059] Table 2
[0060] Global management workflow: Functional and time synchronization is achieved by pairing the commands of interactive chiplets in the global manager, where SEND and RECEIVE commands are paired, and READ and WRITE commands are paired. After successful pairing, handle_pipe_cmd() creates a PIPE channel for data transmission and responds with a RESULT command, while handle_read_cmd() and handle_write_cmd() determine the cycle value of the read or write operation and respond to the chiplet with the SYNC command.
[0061] To implement the above simulation method, this method makes certain modifications to each core particle simulator and needs to set up a global manager. The specific modifications and implementation contents are as follows:
[0062] 1. When using SniperSim, a trace-based CPU simulator, this method defines SYSCALL_REMOTE_READ and SYSCALL_REMOTE_WRITE as system call instructions for the functional model and timing model to support the application calling API (receiveMessage and sendMessage) to achieve inter-chip data transmission and functional and timing synchronization. In the functional model, the SYSCALL_REMOTE_READ instruction executes the receiveSync() and read_data() functions, and the SYSCALL_REMOTE_WRITE instruction executes the sendSync() and write_data() functions to achieve functional synchronization and data reading and writing. In the timing model, the SYSCALL_REMOTE_READ instruction executes the readSync() function, and the SYSCALL_REMOTE_WRITE instruction executes the writeSync() function. By calling these two functions, the second round of simulation achieves accurate simulation of the timing model. At the same time, since SniperSim is not a clock-driven simulator, the clock cycle cannot be directly modified. This method injects a sleep instruction into the timing model to advance its clock cycle to the cycle received from the SYNC command to achieve the purpose of clock synchronization.
[0063] It should be noted that trace refers to path dependency, receiveMessage refers to the data reading interface called by the upper-level application, sendMessage refers to the data sending interface called by the upper-level application, SYSCALL_REMOTE_READ refers to the system call read instruction, SYSCALL_REMOTE_WRITE refers to the system call write instruction, receiveSync() refers to the function for functional synchronization of the data receiver to ensure the correct causal relationship of events on different chiplets, read_data() refers to the function that only reads data, sendSync() refers to the function that sends data for functional synchronization, write_data() refers to the function that only writes data, readSync() refers to the function for clock synchronization of the data receiver, and writeSync() refers to the function for the data sender to send its current clock.
[0064] 2. When using GPGPUSim, a cycle-accurate GPU simulator, this method defines sendMessage() and receiveMessage() functions as CUDA (Compute Unified Device Architecture) program runtime APIs, and includes both timing models and functional models. For the functional model, sendMessage() calls sendSync() and write_data(), and receiveMessage() calls receiveSync() and read_data() to implement Figure 5 The second and fifth steps in . Since CUDA operations are performed in a storage space independent of the CPU memory, sendMessage() must first execute cudaMemcpy to transfer data from the GPU storage space to the CPU storage space before the second step. Similarly, for receiveMessage(), cudaMemcpy is required to transfer data from the CPU storage space to the GPU storage space before the fifth step. For the timing model, GPGPUSim uses two variables, gpgpu_sim::gpu_sim_cycle and gpgpu_sim::gpu_tot_sim_cycle, to track the execution cycle. The former is used to record the number of cycles in the current simulation, and the latter is used to record the total number of cycles accumulated in all previous simulation runs. When executing the timing model, writeSync() and readSync() are used to execute steps 7 and 9 to achieve clock cycle synchronization. When SYNC is received in step 10, gpgpu_sim::gpu_tot_sim_cycle can be directly updated to the received clock cycle.
[0065] It should be noted that sendMessage() refers to the data sending interface called by the upper-level application, receiveMessage() refers to the data receiving interface called by the upper-level application, cudaMemcpy refers to the function interface for transferring data from the CPU's storage space to the GPU's storage space, gpgpu_sim::gpu_sim_cycle refers to the variable that records the number of cycles in the current simulation, and gpgpu_sim::gpu_tot_sim_cycle refers to the variable that records the number of cycles for the entire simulation.
[0066] 3. When using GEM5 as a CPU chip simulator, it is also necessary to add instructions for message transmission and reception. Each ISA (Instruction Set Architecture) in GEM5 has a corresponding system call table, which is stored in the src / arch folder. To define additional APIs, they first need to be added to the system call table of an ISA, and their implementation is then handled in src / sim / syscall_emul.cc. In GEM5, the present invention defines SYSCALL_REMOTE_READ and SYSCALL_REMOTE_WRITE in the x86 and ARM system call tables. The handlers for these system calls are implemented through the interChipletReceive() and interChipletSend() functions. These functions include a functional model and a timing model. In order to Figure 5 These steps are performed from step 2 to step 5 in GEM5. The sendSync() and write_data() functions are used to send messages, while the receiveSync() and read_data() functions are used to receive messages. In GEM5, the copyIn and copyOut functions are used to transfer data between the memory space of the simulated process and the host. For the timing model, GEM5 uses gem5::interchiplet_end_tick_valid to determine whether the simulator cycle needs to be updated, and gem5::interchiplet_end_tick to record the simulator cycle. Similar to GPGPUSim, writeSync() or readSync() is executed after executing steps 7 to 9, and then gem5::interchiplet_end_tick is updated with the cycle received from SYNC in step 10.
[0067] It should be noted that src / arch refers to the folder name where the system call table is stored, src / sim / syscall_emul.cc refers to the file name that implements the read and write operation API, interChipletReceive() refers to the receiving data interface called by the upper-layer application, interChipletSend() refers to the sending data interface called by the upper-layer application, gem5::interchiplet_end_tick_valid refers to the variable that records whether the clock cycle synchronization is currently required, and gem5::interchiplet_end_tick refers to the variable that records the current clock cycle.
[0068] 4. The global manager, as the system control center, is implemented in interchiplet.cpp and cmd_handler.cpp. The global manager has two main responsibilities: creating new threads to start each chiplet and processing commands from different chiplets. When the simulator starts, the global manager starts each chiplet simulator as a separate thread according to the configuration file (YAML file). This initialization is handled by the bridge_thread() function in interchiplet.cpp. Functional synchronization and time synchronization are achieved through the command processing function parse_command() in interchiplet.cpp. The parse_command() function calls different functions defined in cmd_handler.cpp according to the command it receives from the chiplet.
[0069] It should be noted that interchiplet.cpp and cmd_handler.cpp are the file names that implement the global manager, bridge_thread() refers to the function that initializes the chiplet process, and parse_command() refers to the function that calls the interface in the global manager.
[0070] Corresponding to the above-mentioned embodiment of the method for synchronizing multi-chip parallel simulation, the present invention further provides an embodiment of the device for synchronizing multi-chip parallel simulation.
[0071] See also Figure 7 The multi-chip parallel simulation synchronization device provided by the embodiment of the present invention includes one or more processors, which are used to implement the multi-chip parallel simulation synchronization method in the above embodiment.
[0072] The embodiment of the apparatus for multi-core parallel simulation synchronization of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The apparatus embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the processor of any device with data processing capability reads the corresponding computer program instructions in the non-volatile memory into the memory and runs them. From the hardware level, if Figure 7 As shown, it is a hardware structure diagram of any device with data processing capability where the multi-chip parallel simulation synchronization device of the present invention is located, except Figure 7 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0073] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0074] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0075] Corresponding to the embodiment of the method for synchronizing the multi-chip parallel simulation described above, the embodiment of the present application further provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method for synchronizing the multi-chip parallel simulation described above. Figure 8 As shown, it is a hardware structure diagram of any device with data processing capability where the multi-chip parallel simulation synchronization method provided by the embodiment of the present application is located, except Figure 8 In addition to the processor, memory, DMA controller, disk, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, which will not be described in detail here.
[0076] Corresponding to the embodiment of the multi-chip parallel simulation synchronization method described above, an embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the multi-chip parallel simulation synchronization method described above.
[0077] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0079] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.
Claims
1. A method for multi-chip parallel simulation synchronization, characterized in that: The steps include: (1) Functional simulation: Functional model simulation is achieved through read-write matching between the core particle and the global manager. At the same time, the time of access to shared memory and the communication traffic generated during the simulation are recorded. The global manager is used to record the timing of each event sent from the core particle; In functional simulation, remote read operations and remote write operations are included; among them: Remote read operation: When the application calls the corresponding chiplet read operation, the requested instruction is executed by executing its functional model and timing model through the chiplet simulator; the chiplet simulator sends a read request to the global controller of the functional model; after the global controller matches the read and write requests of the two chiplets, it sends an approval message to the chiplet simulator that sent the read request, allowing the chiplet simulator to read data from the shared memory; when the chiplet simulator receives the read permission, the functional model reads the data from the shared memory to the network interface module of the corresponding chiplet; the chiplet simulator then transfers the data from the network interface module to the local storage module; at the same time, the clock cycle is adjusted to the clock cycle when the sender sends the data through the global manager; Remote write operation: When the application calls the corresponding chiplet write operation, the chiplet simulator executes its functional model and timing model to execute the requested instruction; the chiplet simulator sends a write request to the global controller of the functional model; after the global controller matches the read and write requests of the two chiplets, it sends approval information to the chiplet simulator that sent the write request, allowing the chiplet simulator to write data to the shared memory; when the chiplet simulator receives the write permission, the functional model transfers the data to the network interface module of the corresponding chiplet, and the chiplet simulator then transfers the data from the network interface module to the shared memory; (2) Network simulation: Based on the communication traffic generated during the simulation process in step (1), the inter-chip network simulator simulates the read and write events, calculates the transmission delay of each read and write event in the inter-chip network, and obtains the transmission delay data; (3) Timing simulation: Combine the transmission delay data obtained in step (2) with the functional model simulated in step (1) to obtain the inter-chip network delay; then re-perform the complete simulation to accurately construct the timing model; (4) Repeat steps (2) and (3) until the timing simulation results converge and the clocks between the cores are synchronized.
2. The method for multi-chip parallel simulation synchronization according to claim 1, characterized in that: The step (2) is specifically as follows: according to the flow of inter-chip information transmission during the simulation process of step (1) and the set inter-chip network topology, the inter-chip network information transmission is simulated by the inter-chip network simulator, the transmission delay of each read and write event in the inter-chip network is calculated, and the transmission delay data is obtained.
3. The method for multi-chip parallel simulation synchronization according to claim 1, characterized in that: In the step (3), the timing simulation adds synchronization of the timing model to the read and write operations of the functional simulation, specifically: the core particle simulator sends a time request to the global controller of the timing model to obtain the clock cycle when the data arrives; the timing model of the global manager calculates the clock cycle when the data arrives based on the inter-chip network delay obtained by the timing simulation; during the timing synchronization process, the clock cycle is passed to the core particle simulator, and the clock cycle of the core particle simulator is modified accordingly.
4. A device for multi-chip parallel simulation synchronization, characterized in that: The invention comprises one or more processors, and is used to implement the multi-chip parallel simulation synchronization method according to any one of claims 1 to 3.
5. An electronic device comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the multi-core parallel simulation synchronization method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for synchronizing multi-core parallel simulation as claimed in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Improvement in step-spindles
US101109A
Processor performance event dynamic monitoring method based on simulation
CN110688289A
Rail transit network passenger flow parallel simulation method
CN117634189A
