Study and Implementation of Gem5-Based CM3 Simulator
In the embedded systems area,the industry mainly uses the ARM Keil series simulation tools for ARM embedded system development,where software simulation of chip is an important function.However,ARM Keil is a foreign commercial software,and purchasing a license is expensiv.To address this situation,a system call simulation method based on the open source simulator Gem5 is proposed with Cortex-M3 chip as an example.Firstly,the Gem5 simulator's source code structure,operation process and instruction set simulation flow were analyzed to describe the Gem5 simulation principle.Secondly,the simulation of Cortex-M3 in System Emulation(SE)mode of AtomicSim-pleCPU was implemented by adding Cortex-M3 registers and instruction set support to Gem5.Finally,a flexible and scalable instruction set test tool was designed to verify that the instruction functions are simulated correctly.The ex-perimental results show that the simulator implemented can work correctly and efficiently in testing,which provides an open source and technically controllable soft simulation solution for Cortex-M3.