CN118313325A - A design method for CMU simulator of onboard computer based on QEMU virtual environment - Google Patents
A design method for CMU simulator of onboard computer based on QEMU virtual environment Download PDFInfo
- Publication number
- CN118313325A CN118313325A CN202410524841.6A CN202410524841A CN118313325A CN 118313325 A CN118313325 A CN 118313325A CN 202410524841 A CN202410524841 A CN 202410524841A CN 118313325 A CN118313325 A CN 118313325A
- Authority
- CN
- China
- Prior art keywords
- interrupt
- simulator
- cmu
- sparc
- virtual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013461 design Methods 0.000 title claims abstract description 39
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000002093 peripheral effect Effects 0.000 claims abstract description 41
- 238000010276 construction Methods 0.000 claims abstract description 5
- 238000004088 simulation Methods 0.000 claims description 53
- 230000006870 function Effects 0.000 claims description 32
- 238000010586 diagram Methods 0.000 claims description 10
- 230000001360 synchronised effect Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 9
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 6
- 230000003993 interaction Effects 0.000 claims description 5
- 230000007246 mechanism Effects 0.000 claims description 4
- 238000013519 translation Methods 0.000 claims description 4
- 230000000903 blocking effect Effects 0.000 claims description 3
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000007958 sleep Effects 0.000 claims description 3
- 238000001514 detection method Methods 0.000 claims 1
- 230000010354 integration Effects 0.000 claims 1
- 238000012360 testing method Methods 0.000 abstract description 21
- 230000008901 benefit Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000005284 excitation Effects 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000007711 solidification Methods 0.000 description 1
- 230000008023 solidification Effects 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/30—Circuit design
- G06F30/32—Circuit design at the digital level
- G06F30/33—Design verification, e.g. functional simulation or model checking
- G06F30/3308—Design verification, e.g. functional simulation or model checking using simulation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本发明公开了一种基于QEMU虚拟环境的星载计算机CMU模拟器设计方法,该方法包括:a)定制SPARC架构的QEMU系统模拟器;b)仿真SPARC V8架构的处理器芯片,模拟星载嵌入式软件真实运行环境;c)仿真CMU模拟器外围IO控制器接口芯片,实现卫星控制分系统联调等设计步骤。本发明与现有技术相比具有更好的可重用性和快速搭建性,更强的可控性,以及更丰富的调试和测试手段高性能、灵活性和保障实时性的优点,通过对星载计算机CMU硬件设备的仿真,在虚拟CPU内加载真实的星载嵌入式软件以模拟真实的卫星状态,可以更逼真地模拟星载嵌入式软件的真实运行环境,大大降低硬件测试的风险和成本,具有良好的应用前景和商业价值。
The present invention discloses a design method of a satellite computer CMU simulator based on a QEMU virtual environment, the method comprising: a) customizing a QEMU system simulator of a SPARC architecture; b) simulating a processor chip of a SPARC V8 architecture to simulate a real operating environment of satellite embedded software; c) simulating a peripheral IO controller interface chip of a CMU simulator to implement satellite control subsystem joint debugging and other design steps. Compared with the prior art, the present invention has better reusability and rapid construction, stronger controllability, and more abundant debugging and testing means, high performance, flexibility and real-time guarantee. By simulating the satellite computer CMU hardware device, loading the real satellite embedded software in the virtual CPU to simulate the real satellite state, the real operating environment of the satellite embedded software can be simulated more realistically, greatly reducing the risk and cost of hardware testing, and has good application prospects and commercial value.
Description
技术领域Technical Field
本发明涉及虚拟卫星测试技术领域,尤其是一种基于QEMU虚拟环境的星载计算机CMU模拟器设计方法。The invention relates to the technical field of virtual satellite testing, in particular to a design method of a satellite-borne computer CMU simulator based on a QEMU virtual environment.
背景技术Background technique
随着航天技术的飞速发展,卫星任务变得愈加复杂,传统基于硬件的星载嵌入式软件测试方法构建困难、成本昂贵、测试周期长且运行状态难以监控,存在很大的局限性。目前,航天领域针对硬件测试改进方案包括半实物仿真测试以及全数字仿真测试,而半实物仿真的测试可控性不及全数字仿真环境。星载计算机CMU模拟器是指在宿主机平台上基于软件模拟真实星载计算机CMU硬件设备,为星载嵌入式软件提供仿真执行环境,使得用于固化的二进制代码可以直接运行在星载计算机CMU模拟器上,表征出与真实硬件相同的功能特性。模拟星载计算机CMU硬件设备依托于系统级虚拟仿真技术,With the rapid development of aerospace technology, satellite missions have become increasingly complex. Traditional hardware-based onboard embedded software testing methods are difficult to build, expensive, have long testing cycles, and are difficult to monitor operating status, which has great limitations. At present, the aerospace field’s hardware testing improvement solutions include semi-physical simulation testing and full-digital simulation testing, but the test controllability of semi-physical simulation is not as good as that of a full-digital simulation environment. The onboard computer CMU simulator refers to a software-based simulation of a real onboard computer CMU hardware device on a host platform, providing a simulation execution environment for onboard embedded software, so that the binary code used for solidification can run directly on the onboard computer CMU simulator, representing the same functional characteristics as the real hardware. The simulation of onboard computer CMU hardware devices relies on system-level virtual simulation technology.
目前,市面上典型的系统级解决方案包括由Kevin Lawton研发的Bochs, ARM公司研发的ARMulator,风河公司研发的Simics,清华大学团队研发的SkyEye以及最初由法国工程师Fabrice Bellard开发并开放源代码的 QEMU(Quick Emulator)。QEMU 的灵活性、跨平台支持、多架构指令集模拟、硬件设备模拟以及开源社区的积极支持,使其成为虚拟化、模拟和仿真领域的一种强大的技术支撑。目前,国内外众多系统级虚拟化解决方案都基于QEMU实现。At present, typical system-level solutions on the market include Bochs developed by Kevin Lawton, ARMulator developed by ARM, Simics developed by Wind River, SkyEye developed by Tsinghua University team, and QEMU (Quick Emulator) originally developed and open-sourced by French engineer Fabrice Bellard. QEMU's flexibility, cross-platform support, multi-architecture instruction set simulation, hardware device simulation, and active support from the open source community make it a powerful technical support in the field of virtualization, simulation, and emulation. At present, many system-level virtualization solutions at home and abroad are implemented based on QEMU.
现有技术的虚拟卫星测试硬件技术不完备,存在着测试成本昂贵、测试周期长且运行状态难以监控等问题。The existing virtual satellite testing hardware technology is incomplete, and has problems such as high testing cost, long testing cycle and difficult monitoring of operating status.
发明内容Summary of the invention
本发明的目的是针对现有技术的不足而提供的一种基于QEMU虚拟环境的星载计算机CMU模拟器设计方法,采用虚拟CPU内加载真实的星载嵌入式软件的方法,设计SPARC架构的星载计算机CMU模拟器,该方法基于软件模拟星载计算机中心管理单元CMU,包含两个关键部分,一是提供指令集模拟器,实现星载计算机SPARC架构指令集到宿主机x86指令集的翻译;二是实现对星载嵌入式软件的硬件运行环境的仿真;三是完成卫星控制分系统联调设计。本发明通过对星载计算机CMU硬件设备的仿真,在虚拟CPU内加载真实的星载嵌入式软件以模拟真实的卫星状态,对于虚拟卫星测试有重要意义。相较于直接屏蔽真实硬件交互接口的卫星模型,该方法可以更逼真地模拟星载嵌入式软件的真实运行环境;相较于基于硬件的测试平台,该方法具有更好的可重用性和快速搭建性,能够大大降低硬件测试的风险和成本,同时具备更强的可控性,以及更丰富的调试和测试手段;相较于其他卫星数字化仿真方案,该方法具有高性能、灵活性和保障实时性的优点,本发明具有良好的应用前景和商业价值。The purpose of the present invention is to provide a method for designing a satellite computer CMU simulator based on a QEMU virtual environment in view of the deficiencies in the prior art. The method adopts a method of loading real satellite embedded software in a virtual CPU to design a SPARC architecture satellite computer CMU simulator. The method is based on software simulation of the satellite computer central management unit CMU, and includes two key parts: one is to provide an instruction set simulator to realize the translation of the satellite computer SPARC architecture instruction set to the host machine x86 instruction set; the second is to realize the simulation of the hardware operating environment of the satellite embedded software; and the third is to complete the satellite control subsystem joint debugging design. The present invention simulates the satellite computer CMU hardware equipment and loads real satellite embedded software in the virtual CPU to simulate the real satellite state, which is of great significance for virtual satellite testing. Compared with the satellite model that directly shields the real hardware interaction interface, this method can more realistically simulate the real operating environment of the onboard embedded software; compared with the hardware-based test platform, this method has better reusability and rapid construction, can greatly reduce the risk and cost of hardware testing, and at the same time has stronger controllability and more abundant debugging and testing methods; compared with other satellite digital simulation solutions, this method has the advantages of high performance, flexibility and real-time guarantee. The present invention has good application prospects and commercial value.
实现本发明目的的具体技术方案是:一种基于QEMU虚拟环境的星载计算机CMU模拟器的实现方法,其特点是采用虚拟CPU内加载真实的星载嵌入式软件的方法,产生与运行在真实硬件中一致的效果, SPARC架构的星载计算机CMU模拟器的具体设计包括以下步骤:The specific technical solution for achieving the purpose of the present invention is: a method for implementing a CMU simulator for a spaceborne computer based on a QEMU virtual environment, which is characterized by adopting a method of loading real spaceborne embedded software in a virtual CPU to produce an effect consistent with running in real hardware. The specific design of the CMU simulator for a spaceborne computer based on a SPARC architecture includes the following steps:
步骤1:配置QEMU环境,定制SPARC架构的QEMU系统模拟器,搭建虚拟测试环境;Step 1: Configure the QEMU environment, customize the QEMU system simulator for the SPARC architecture, and build a virtual test environment;
步骤2:仿真SPARC V8架构处理器芯片,模拟星载嵌入式软件真实运行环境;Step 2: Simulate the SPARC V8 architecture processor chip and simulate the real operating environment of the onboard embedded software;
步骤3:仿真CMU模拟器外围IO控制器接口芯片,集成CMU模块,实现卫星控制分系统联调设计。Step 3: Simulate the CMU simulator peripheral IO controller interface chip, integrate the CMU module, and realize the satellite control subsystem joint debugging design.
所述步骤1具体包括:基于虚拟化平台QEMU部署虚拟目标机;构建SPARC交叉编译环境,在x86_64架构的宿主机上生成运行于SPARC架构目标机的可执行代码。The step 1 specifically includes: deploying a virtual target machine based on the virtualization platform QEMU; building a SPARC cross-compilation environment, and generating executable code running on a SPARC architecture target machine on an x86_64 architecture host machine.
所述部署虚拟目标机的具体步骤如下:The specific steps of deploying the virtual target machine are as follows:
步骤01. 在宿主机操作系统中安装QEMU编译所需的基本库和工具。Step 01. Install the basic libraries and tools required for QEMU compilation in the host operating system.
步骤02. 基于configure设置QEMU配置项。Step 02. Set QEMU configuration items based on configure.
步骤03. 并行编译并安装虚拟目标机至系统环境。Step 03. Compile and install the virtual target machine in parallel to the system environment.
所述步骤2具体包括:仿真SPARC V8架构处理器芯片中断控制器、定时单元、串口等片上外围设备以及构建SPARC V8架构处理器芯片Machine。The step 2 specifically includes: simulating on-chip peripherals such as an interrupt controller, a timing unit, and a serial port of a SPARC V8 architecture processor chip, and building a SPARC V8 architecture processor chip Machine.
所述仿真SPARC V8架构处理器芯片中断控制器的具体步骤如下:The specific steps of simulating the SPARC V8 architecture processor chip interrupt controller are as follows:
步骤01. 向QEMU主事件循环中注册中断处理事件,在处理器执行每个翻译块结束时检测中断信号,一旦检测到中断,就立即响应并启动相应的中断处理程序,程序计数器指向相应中断处理程序起始地址。Step 01. Register interrupt handling events in the QEMU main event loop, detect interrupt signals at the end of each translation block executed by the processor, and once an interrupt is detected, respond immediately and start the corresponding interrupt handler, with the program counter pointing to the starting address of the corresponding interrupt handler.
步骤02. 根据SPARC V8架构处理器芯片中断控制器硬件框图及硬件数据描述,设计虚拟中断控制器,实现功能包括:中断控制器IO空间硬件寄存器的访问控制,接收中断源产生的中断请求,中断仲裁,上报中断,响应中断,中断清除。具体如下:Step 02. Based on the hardware block diagram and hardware data description of the interrupt controller of the SPARC V8 architecture processor chip, design a virtual interrupt controller to implement functions including: access control of the hardware registers of the interrupt controller IO space, receiving interrupt requests generated by interrupt sources, interrupt arbitration, reporting interrupts, responding to interrupts, and clearing interrupts. The details are as follows:
ⅰ. 基于QOM设计模式,设计虚拟中断控制器设备结构,具体包括:所挂载系统总线对象、内存映射IO区域、中断请求状态信息以及中断请求信号。ⅰ. Based on the QOM design pattern, design the virtual interrupt controller device structure, including: mounted system bus objects, memory mapped IO areas, interrupt request status information and interrupt request signals.
ⅱ. 将虚拟中断控制器设备模型注册至QEMU系统中。具体包括:为虚拟中断控制器设备QOM模型设置唯一标识符;提供虚拟中断控制器设备类初始化接口和实例初始化接口;实现虚拟中断控制器复位接口的注册。ⅱ. Register the virtual interrupt controller device model to the QEMU system. Specifically, it includes: setting a unique identifier for the virtual interrupt controller device QOM model; providing a virtual interrupt controller device class initialization interface and an instance initialization interface; and implementing the registration of the virtual interrupt controller reset interface.
所述仿真SPARC V8架构处理器芯片定时单元的具体步骤如下:The specific steps of simulating the timing unit of the SPARC V8 architecture processor chip are as follows:
步骤01. 根据SPARC V8架构处理器芯片定时单元硬件框图及硬件数据描述,设计虚拟定时单元,实现功能包括:定时单元寄存器的访问控制、定时器时钟模拟、定时器中断模拟。Step 01. Based on the hardware block diagram and hardware data description of the timing unit of the SPARC V8 architecture processor chip, design a virtual timing unit to implement functions including: access control of timing unit registers, timer clock simulation, and timer interrupt simulation.
所述设计虚拟定时单元的具体步骤如下:The specific steps of designing the virtual timing unit are as follows:
ⅰ. 基于内存映射IO区域实现定时单元寄存器的访问控制,为其分配与硬件规模一致的空间,并按照硬件描述将其映射至系统总线空间的某一特定位置,使该段内存映射IO区域在系统总线可寻址。ⅰ. Implement access control of the timing unit register based on the memory-mapped IO area, allocate space consistent with the hardware scale, and map it to a specific location in the system bus space according to the hardware description, so that the memory-mapped IO area is addressable on the system bus.
ⅱ. 基于QEMU的ptimer机制初始化定时器完成定时器时钟模拟。在定时单元中并不精确仿真预分频器产生的每个滴答脉冲, 仅维护分频系数 scaler,共享预分频器的四个定时器和一个看门狗的时钟频率设定为CLK/(scaler+1)。其中,CLK为CPU时钟频率。ⅱ. Based on QEMU's ptimer mechanism, the timer is initialized to complete the timer clock simulation. In the timing unit, each tick pulse generated by the prescaler is not accurately simulated, only the scaler is maintained, and the clock frequency of the four timers and one watchdog that share the prescaler is set to CLK/(scaler+1). Among them, CLK is the CPU clock frequency.
ⅲ. 定时器产生下溢时,执行相应的定时器中断处理程序;若看门狗超时未进行喂狗操作,则产生系统复位信号。设计定时器到期回调函数实现定时器中断模拟。ⅲ. When the timer underflows, the corresponding timer interrupt handler is executed; if the watchdog times out and the dog is not fed, a system reset signal is generated. Design a timer expiration callback function to implement timer interrupt simulation.
步骤02. 添加定时事件到QEMU主事件循环中的监听列表,完成定时单元初始化。Step 02. Add the timer event to the listener list in the QEMU main event loop to complete the timer unit initialization.
步骤03. 启动定时器后开启定时器的计时处理流程。Step 03. Start the timer and then start the timer timing process.
所述仿真SPARC V8架构处理器芯片串口的具体步骤如下:The specific steps of simulating the serial port of the SPARC V8 architecture processor chip are as follows:
步骤01. 为串口设备分配并绑定以文件描述符的形式存在的字符设备。Step 01. Allocate and bind a character device in the form of a file descriptor to the serial port device.
步骤02. 通过对串口设备的控制寄存器、状态寄存器以及数据寄存器的读写访问控制来对字符设备进行中断和数据传输控制。Step 02. Control the interruption and data transmission of the character device by reading and writing access control to the control register, status register and data register of the serial port device.
步骤03. 向QEMU主事件循环中注册对应文件描述符的监听事件。当字符设备文件描述符有可读或可写事件发生时,根据具体的字符设备执行接收和发送数据操作。Step 03. Register the corresponding file descriptor's listening event in the QEMU main event loop. When a readable or writable event occurs on the character device file descriptor, receive and send data operations are performed according to the specific character device.
步骤04. 实现串口设备发送数据功能。Step 04. Realize the function of sending data through the serial port device.
步骤05. 实现串口设备接收数据功能。Step 05. Realize the function of receiving data on the serial port device.
所述构建SPARC V8架构处理器芯片Machine的具体步骤如下:The specific steps of constructing the SPARC V8 architecture processor chip Machine are as follows:
步骤01. 指定SPARC V8架构处理器芯片Machine默认CPU类型为LEON3。Step 01. Specify the SPARC V8 architecture processor chip. The default CPU type of Machine is LEON3.
步骤02. 在QEMU已提供对LEON3 CPU的支持的基础上,自行设计CPU响应中断时需执行的回调函数,实现相应处理逻辑。Step 02. Based on the support provided by QEMU for LEON3 CPU, design the callback function to be executed when the CPU responds to an interrupt and implement the corresponding processing logic.
步骤03. 分配SPARC V8架构处理器芯片存储空间地址,包括PROM、RAM、IO等区域;Step 03. Allocate the storage space address of the SPARC V8 architecture processor chip, including PROM, RAM, IO and other areas;
步骤04. 自行设计Bootloader,并将其加载至SPARC V8架构处理器芯片存储器的ROM区。Step 04. Design your own Bootloader and load it into the ROM area of the SPARC V8 architecture processor chip memory.
步骤05. CPU上电后即开始执行Bootloader启动程序,完成SPARC V8架构处理器芯片片上设备的初始化(可选),随后跳转至RAM区的入口地址。Step 05. After the CPU is powered on, it starts to execute the Bootloader startup program, completes the initialization of the on-chip devices of the SPARC V8 architecture processor chip (optional), and then jumps to the entry address of the RAM area.
步骤06. 将星载嵌入式软件以kernel的形式加载至RAM区入口地址。Step 06. Load the onboard embedded software into the RAM area entry address in the form of kernel.
步骤07. 根据用户指定内存区域大小设置CPU的堆栈指针,具体初始化为RAM区首地址+用户指定RAM大小。Step 07. Set the CPU stack pointer according to the user-specified memory area size, specifically initialized to the RAM area first address + user-specified RAM size.
步骤08. 完成SPARC V8架构处理器芯片中断控制器、定时单元、串口设备的注册及实例化,将各片上设备挂接在系统总线SysBus上,为各设备分配的IO地址空间映射至内存空间。Step 08. Complete the registration and instantiation of the SPARC V8 architecture processor chip interrupt controller, timing unit, and serial port device, connect each on-chip device to the system bus SysBus, and map the IO address space allocated to each device to the memory space.
步骤09. 使用GPIO输入、输出线来抽象硬件设备的输入、输出引脚属性;设备彼此间通过GPIO线连接;硬件上信号的触发,在软件上设计为监听到某事件发生并执行相应的回调函数。Step 09. Use GPIO input and output lines to abstract the input and output pin properties of hardware devices; devices are connected to each other through GPIO lines; the triggering of signals on the hardware is designed in the software to monitor the occurrence of an event and execute the corresponding callback function.
所述步骤3具体包括:仿真CMU模拟器外围IO控制器接口芯片;集成CMU模块,实现卫星控制分系统联调设计。The step 3 specifically includes: simulating the CMU simulator peripheral IO controller interface chip; integrating the CMU module to realize the satellite control subsystem joint debugging design.
所述仿真CMU模拟器外围IO控制器接口芯片设计的具体步骤如下:The specific steps of the simulated CMU simulator peripheral IO controller interface chip design are as follows:
步骤01. 基于系统总线设备抽象出外围IO控制器接口设备xxxDevice,外围IO控制器接口芯片组成结构中的80路GPIO口、16路异步串口、10路同步串口、星时模块等设备均继承至该结构,最终将各设备注册至外围IO控制器接口芯片。Step 01. Based on the system bus device, the peripheral IO controller interface device xxxDevice is abstracted. The 80-channel GPIO ports, 16-channel asynchronous serial ports, 10-channel synchronous serial ports, star time module and other devices in the peripheral IO controller interface chip structure are inherited to this structure, and finally each device is registered to the peripheral IO controller interface chip.
步骤02. 设计CMU模块与提供目标数据环境的其他外围硬件模拟器进行数据交互的接口,综合考虑传输速率、资源利用率及代码复用性等因素选用共享内存解决方案,具体使用Linux系统下的POSIX接口mmap实现。Step 02. Design an interface for data exchange between the CMU module and other peripheral hardware simulators that provide the target data environment. Consider factors such as transmission rate, resource utilization, and code reusability to select a shared memory solution. Specifically, use the POSIX interface mmap under the Linux system to implement it.
所述卫星控制分系统具体包括中心管理单元CMU、遥控遥测单元TTU、敏感器、执行机构、动力学模型等。在虚拟环境下完成整个控制分系统测试,需要构建各个组件的模拟器。本发明实现的基于QEMU仿真的SPARC架构处理器芯片以及外围IO控制器接口芯片,在航天器整个控制分系统中作为CMU模拟器。实现卫星控制分系统联调设计的具体步骤如下:The satellite control subsystem specifically includes a central management unit CMU, a remote control and telemetry unit TTU, sensors, actuators, dynamic models, etc. To complete the entire control subsystem test in a virtual environment, it is necessary to build simulators for each component. The SPARC architecture processor chip and the peripheral IO controller interface chip based on QEMU simulation implemented by the present invention serve as CMU simulators in the entire control subsystem of the spacecraft. The specific steps for implementing the satellite control subsystem joint debugging design are as follows:
步骤01. 根据星上软件控制周期,对提供目标数据环境的外围硬件模拟器与CMU模拟器进行同步控制。Step 01. According to the onboard software control cycle, the peripheral hardware simulator and CMU simulator that provide the target data environment are synchronously controlled.
所述同步控制的具体步骤如下:The specific steps of the synchronous control are as follows:
ⅰ. 在启动CMU模拟器时,以阻塞的方式启动Monitor,添加“-S”选项,使虚拟机初始化完成后,VCPU线程阻塞等待在第一条指令执行前。ⅰ. When starting the CMU simulator, start the Monitor in blocking mode and add the "-S" option so that after the virtual machine is initialized, the VCPU thread blocks and waits before the first instruction is executed.
ⅱ. 在提供目标数据环境的外围硬件模拟器初始化时,连接Monitor,CMU模拟器开始执行初始化工作,并停在第一条指令执行前。ⅱ. When the peripheral hardware simulator that provides the target data environment is initialized, the Monitor is connected, and the CMU simulator starts to perform initialization work and stops before the first instruction is executed.
ⅲ. 在目标数据环境模拟器的每个控制周期内,先向Monitor发送cont指令恢复运行CMU模拟器。ⅲ. In each control cycle of the target data environment simulator, first send a cont command to the Monitor to resume running the CMU simulator.
ⅳ. 目标数据环境模拟器基于宿主机时钟休眠64ms,再向Monitor发送stop指令停止运行CMU模拟器。ⅳ. The target data environment simulator sleeps for 64ms based on the host machine clock, and then sends a stop command to the Monitor to stop running the CMU simulator.
步骤02. 星上软件完成一个控制周期内的任务调度,产生推力脉冲数据。Step 02. The onboard software completes the task scheduling within a control cycle and generates thrust pulse data.
步骤03. 目标数据环境模拟器完成动力学模拟并继续向CMU产生数据激励。Step 03. The target data environment simulator completes the dynamics simulation and continues to generate data excitation to the CMU.
步骤04. 循环执行,完成整个控制分系统闭环的联调。Step 04. Execute the loop to complete the closed-loop joint debugging of the entire control subsystem.
本发明与现有技术相比具有以下有益的技术效果和显著的技术进步:Compared with the prior art, the present invention has the following beneficial technical effects and significant technical progress:
1) 相较于直接屏蔽真实硬件交互接口的卫星模型,本发明可以更逼真地模拟星载嵌入式软件的真实运行环境。1) Compared with the satellite model that directly shields the real hardware interaction interface, the present invention can simulate the real operating environment of the satellite-borne embedded software more realistically.
2) 相较于基于硬件的测试平台,本发明具有更好的可重用性和快速搭建性,能够大大降低硬件测试的风险和成本,同时具备更强的可控性,以及更丰富的调试和测试手段。2) Compared with the hardware-based test platform, the present invention has better reusability and rapid construction, can greatly reduce the risk and cost of hardware testing, and has stronger controllability and more abundant debugging and testing methods.
3) 相较于其他卫星数字化仿真方案,本发明具有高性能、灵活性和实时性的优点,适用于各种星载计算机的仿真和测试需求。利用QEMU的优势,提供快速且高效的星载计算机模拟环境;仿真控制接口允许用户根据需要定制模拟过程,适应不同的应用场景;模拟器与实际硬件同步,保证模拟结果的准确性和实时性。3) Compared with other satellite digital simulation solutions, this invention has the advantages of high performance, flexibility and real-time performance, and is suitable for the simulation and testing needs of various onboard computers. By taking advantage of QEMU, a fast and efficient onboard computer simulation environment is provided; the simulation control interface allows users to customize the simulation process as needed to adapt to different application scenarios; the simulator is synchronized with the actual hardware to ensure the accuracy and real-time performance of the simulation results.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明的流程图;Fig. 1 is a flow chart of the present invention;
图2为SPARC V8架构处理器芯片虚拟中断控制器的模型结构图;FIG2 is a model structure diagram of a virtual interrupt controller of a SPARC V8 architecture processor chip;
图3为SPARC V8架构处理器芯片定时单元使用的虚拟独立时钟模型结构图;FIG3 is a diagram showing the structure of a virtual independent clock model used by a timing unit of a SPARC V8 architecture processor chip;
图4为SPARC V8架构处理器芯片最小片上系统的结构图;FIG4 is a block diagram of the minimum system-on-chip of a SPARC V8 architecture processor chip;
图5为SPARC V8架构处理器芯片硬件设备连接关系图;FIG5 is a diagram showing the connection relationship between the hardware devices of the SPARC V8 architecture processor chip;
图6为卫星控制分系统数据流示意图;FIG6 is a schematic diagram of the satellite control subsystem data flow;
图7为卫星控制分系统虚拟环境的架构图。FIG7 is an architectural diagram of the satellite control subsystem virtual environment.
具体实施方式Detailed ways
下面结合具体实例和附图,对本发明作进一步的详细说明。实施本发明的过程,方法等,除以下专门提及的内容之外,均为本领域的普遍知识和公知常识,本发明没有特别限制的内容。The present invention is further described in detail below in conjunction with specific examples and drawings. The processes and methods for implementing the present invention, except for the contents specifically mentioned below, are common knowledge and common common sense in the art and are not particularly limited by the present invention.
实施例1Example 1
参阅图1,本发明提供了一种基于QEMU虚拟环境的星载计算机CMU模拟器的实现方法,,具体包括以下步骤:Referring to FIG. 1 , the present invention provides a method for implementing a CMU simulator of a satellite computer based on a QEMU virtual environment, specifically comprising the following steps:
步骤1:配置QEMU环境,定制SPARC架构的QEMU系统模拟器,搭建虚拟测试环境。Step 1: Configure the QEMU environment, customize the QEMU system simulator for the SPARC architecture, and build a virtual test environment.
在宿主机操作系统中安装QEMU编译所需的基本库和工具,具体包括:提供进行软件编译所需的基本工具build-essential;用于检查系统上已安装库的版本信息的工具pkg-config,帮助QEMU在编译时找到外部库的正确版本;提供GLib库的libglib2.0-dev,确保QEMU编译时可以正确链接 GLib 库。基于configure设置QEMU配置项,设置“target-list”参数为“sparc-softmmu”,指定目标机指令集架构为SPARC,且基于QEMU虚拟化平台下的系统态模式;添加配置项“--enable-debug”,以允许调试QEMU。使用命令“make -j4”进行并行编译;使用命令“make install”安装虚拟目标机至系统环境。Install the basic libraries and tools required for QEMU compilation in the host operating system, including: providing the basic tool build-essential required for software compilation; the tool pkg-config used to check the version information of the installed libraries on the system to help QEMU find the correct version of the external library when compiling; providing libglib2.0-dev of the GLib library to ensure that the GLib library can be correctly linked when QEMU is compiled. Set the QEMU configuration items based on configure, set the "target-list" parameter to "sparc-softmmu", specify the target machine instruction set architecture as SPARC, and based on the system state mode under the QEMU virtualization platform; add the configuration item "--enable-debug" to allow debugging of QEMU. Use the command "make -j4" for parallel compilation; use the command "make install" to install the virtual target machine to the system environment.
步骤2:仿真SPARC V8架构处理器芯片,模拟星载嵌入式软件真实运行环境。具体包括对SPARC V8架构处理器芯片中断控制器、定时单元、串口等片上外围设备的仿真以及对SPARC V8架构处理器芯片Machine的构建。Step 2: Simulate the SPARC V8 architecture processor chip and simulate the real operating environment of the onboard embedded software. Specifically, it includes the simulation of the SPARC V8 architecture processor chip interrupt controller, timing unit, serial port and other on-chip peripheral devices and the construction of the SPARC V8 architecture processor chip Machine.
步骤3:仿真CMU模拟器外围IO控制器接口芯片,实现卫星控制分系统联调设计。所述外围IO控制器接口芯片的仿真包括对80路GPIO口、16路异步串口、10路同步串口、星时等模块的仿真。通过共享内存解决方案,提高QEMU指令集仿真内核对外围IO空间读写仿真效率。Step 3: Simulate the CMU simulator peripheral IO controller interface chip to realize the satellite control subsystem joint debugging design. The simulation of the peripheral IO controller interface chip includes the simulation of 80 GPIO ports, 16 asynchronous serial ports, 10 synchronous serial ports, satellite time and other modules. Through the shared memory solution, the QEMU instruction set simulation kernel can improve the efficiency of peripheral IO space reading and writing simulation.
参阅图2,本发明设计的SPARC V8架构处理器芯片虚拟中断控制器实现功能包括:IO空间硬件寄存器的访问控制,接受中断源产生的中断请求,中断仲裁,上报中断,响应中断,中断清除等。本发明仿真的SPARC V8架构处理器芯片中断控制器设备结构基于QOM设计模式,由所挂载系统总线对象、内存映射IO区域、中断请求状态信息以及中断请求信号组成。Referring to FIG. 2 , the functions of the virtual interrupt controller of the SPARC V8 architecture processor chip designed by the present invention include: access control of the hardware registers of the IO space, receiving interrupt requests generated by the interrupt source, interrupt arbitration, reporting interrupts, responding to interrupts, clearing interrupts, etc. The device structure of the interrupt controller of the SPARC V8 architecture processor chip simulated by the present invention is based on the QOM design mode, and is composed of a mounted system bus object, a memory-mapped IO area, interrupt request status information, and an interrupt request signal.
所述SPARC V8架构处理器芯片虚拟中断控制器的具体实施步骤如下:The specific implementation steps of the SPARC V8 architecture processor chip virtual interrupt controller are as follows:
步骤01. 设计虚拟中断控制器继承自系统总线设备SysBusDvice,将SPARC V8架构处理器芯片片上中断控制器直接挂载至系统总线。Step 01. Design a virtual interrupt controller that inherits from the system bus device SysBusDvice and directly mounts the on-chip interrupt controller of the SPARC V8 architecture processor chip to the system bus.
步骤02. 设计虚拟中断控制器寄存器的访问控制依赖于内存映射IO区域,为中断控制器的寄存器分配内存映射区域。Step 02. Design the access control of the virtual interrupt controller registers to rely on the memory mapped IO area and allocate the memory mapped area for the registers of the interrupt controller.
步骤03. 为步骤02所述内存映射IO区域注册读写回调函数,模拟对中断屏蔽和优先级控制器、中断挂起寄存器、强制中断寄存器、中断清除寄存器四个寄存器的读写访问控制逻辑。Step 03. Register a read/write callback function for the memory-mapped IO area described in step 02, and simulate the read/write access control logic for the four registers of the interrupt mask and priority controller, interrupt pending register, forced interrupt register, and interrupt clear register.
步骤04. 中断请求状态信息维护在VICIRQState结构体中,具体包括:15个中断源的中断等级位图ilevel、中断屏蔽位图imask、中断挂起位图ipend、中断强制位图iforce以及中断清除位图iclear。Step 04. The interrupt request status information is maintained in the VICIRQState structure, including: the interrupt level bitmap ilevel of the 15 interrupt sources, the interrupt mask bitmap imask, the interrupt suspension bitmap ipend, the interrupt force bitmap iforce, and the interrupt clear bitmap iclear.
步骤05. 使用IRQState实现中断请求信号的模拟,设计函数指针指向中断源触发中断时的回调函数,对外提供函数接口实现中断信号的处理。Step 05. Use IRQState to simulate the interrupt request signal, design a function pointer to point to the callback function when the interrupt source triggers the interrupt, and provide a function interface to the outside to implement the processing of the interrupt signal.
QEMU仿真中在每个翻译块执行结束时检测中断信号,一旦检测到中断,会立即响应并启动相应的中断处理程序,确保对中断的及时响应和有效处理。当产生中断请求时,若中断没有被屏蔽,则检测是否为强制中断,若不是,则挂起中断。所有挂起的中断及强制中断会转发到优先级选择器,优先级选择器中会选择高优先级级别上中断号最高的中断,如果不存在高优先级级别的挂起中断,则选择低优先级别上中断号最高的挂起中断并将其转发到CPU。当CPU收到中断控制器发送的中断请求信号后,会响应中断,中断控制器将清除中断,若为强制中断则清除强制中断,否则,清除对应的挂起中断。In QEMU simulation, the interrupt signal is detected at the end of the execution of each translation block. Once an interrupt is detected, it will immediately respond and start the corresponding interrupt handler to ensure timely response and effective processing of the interrupt. When an interrupt request is generated, if the interrupt is not masked, it will detect whether it is a forced interrupt. If not, the interrupt will be suspended. All suspended interrupts and forced interrupts will be forwarded to the priority selector. The priority selector will select the interrupt with the highest interrupt number at the high priority level. If there is no suspended interrupt at the high priority level, the suspended interrupt with the highest interrupt number at the low priority level will be selected and forwarded to the CPU. When the CPU receives the interrupt request signal sent by the interrupt controller, it will respond to the interrupt, and the interrupt controller will clear the interrupt. If it is a forced interrupt, the forced interrupt will be cleared. Otherwise, the corresponding suspended interrupt will be cleared.
参阅图3,SPARC V8架构处理器芯片定时单元使用的虚拟定时器(虚拟独立时钟),其功能的实现与虚拟处理器VCPU内部时钟源的应用密切相关,基于QEMU提供的ptimer机制可以使定时器与CPU内部时钟源建立联系。仿真定时单元时并不精确仿真预分频器产生的每个滴答脉冲, 仅维护分频系数 scaler。四个定时器和看门狗分别绑定一个ptimer用于执行底层计数操作,对定时器的操作最后都相当于对ptimer的操作。定时器初始化完成后,即添加到QEMU主事件循环中的监听列表。如果定时器已经到期,则定时器到期回调函数会向中断控制器上报相应的定时器中断。如果当前到期定时器处于循环计数模式,则需要借助QEMU提供的接口函数timer_mod重新进行计数。Refer to Figure 3. The virtual timer (virtual independent clock) used by the timing unit of the SPARC V8 architecture processor chip is closely related to the application of the internal clock source of the virtual processor VCPU. The ptimer mechanism provided by QEMU can establish a connection between the timer and the internal clock source of the CPU. When simulating the timing unit, each tick pulse generated by the prescaler is not accurately simulated, and only the scaler factor is maintained. The four timers and the watchdog are each bound to a ptimer to perform the underlying counting operation. The operation of the timer is ultimately equivalent to the operation of the ptimer. After the timer is initialized, it is added to the listening list in the QEMU main event loop. If the timer has expired, the timer expiration callback function will report the corresponding timer interrupt to the interrupt controller. If the current expired timer is in the loop counting mode, it is necessary to use the interface function timer_mod provided by QEMU to re-count.
本发明模拟串口设备的具体实施步骤如下:The specific implementation steps of the present invention to simulate the serial port device are as follows:
步骤01. 为串口设备分配并绑定以文件描述符的形式存在的字符设备。Step 01. Allocate and bind a character device in the form of a file descriptor to the serial port device.
步骤02. 通过对串口设备的控制寄存器、状态寄存器以及数据寄存器的读写访问控制来对字符设备进行中断和数据传输控制。Step 02. Control the interruption and data transmission of the character device by reading and writing access control to the control register, status register and data register of the serial port device.
步骤03. 向QEMU主事件循环中注册对应文件描述符的监听事件。当字符设备文件描述符有可读或可写事件发生时,根据具体的字符设备执行接收和发送数据操作。Step 03. Register the corresponding file descriptor's listening event in the QEMU main event loop. When a readable or writable event occurs on the character device file descriptor, receive and send data operations are performed according to the specific character device.
步骤04. 实现串口设备发送数据功能。当向串口数据寄存器写入字节数据后,判断与串口模型相连的字符设备是否处于可用状态,若可用,判断串口控制寄存器发送位是否使能,若使能则通过字符设备发送一字节数据。写入完成后,判断中断控制器中屏蔽寄存器相应位是否使能,若使能,则向中断控制器发送一个中断脉冲。若字符设备不可用或串口控制寄存器发送位不使能则屏蔽数据发送操作。Step 04. Implement the function of sending data from the serial port device. After writing byte data to the serial port data register, determine whether the character device connected to the serial port model is in an available state. If it is available, determine whether the send bit of the serial port control register is enabled. If it is enabled, send a byte of data through the character device. After writing is completed, determine whether the corresponding bit of the mask register in the interrupt controller is enabled. If it is enabled, send an interrupt pulse to the interrupt controller. If the character device is not available or the send bit of the serial port control register is not enabled, the data sending operation is masked.
步骤05. 实现串口设备接收数据功能,串口模型接收外部数据时,QEMU事件主循环会根据绑定到字符设备的IOCanReadHandler回调函数不断轮询来判断串口是否可接收数据,若可接收,则会调用绑定到字符设备的IOReadHandler回调函数xxx_uart_receive,来处理具体数据接收逻辑。具体实现时设计了FIFO 缓冲区来存放接收到的数据。FIFO在接收到数据后需要修改状态寄存器中的Data Ready位来通知程序数据已经接收完毕。如果串口控制寄存器中接收中断标志位使能,串口也会发送中断信号,请求进行数据接收中断处理。Step 05. Implement the function of receiving data by the serial port device. When the serial port model receives external data, the QEMU event main loop will continuously poll according to the IOCanReadHandler callback function bound to the character device to determine whether the serial port can receive data. If it can, it will call the IOReadHandler callback function xxx_uart_receive bound to the character device to process the specific data receiving logic. In the specific implementation, a FIFO buffer is designed to store the received data. After receiving the data, the FIFO needs to modify the Data Ready bit in the status register to notify the program that the data has been received. If the receive interrupt flag bit in the serial port control register is enabled, the serial port will also send an interrupt signal to request data reception interrupt processing.
参阅图4,本发明设计的SPARC V8架构处理器芯片最小片上系统,构建SPARC V8架构处理器芯片Machine的具体步骤如下:Referring to FIG. 4 , the minimum system-on-chip of the SPARC V8 architecture processor chip designed by the present invention, the specific steps of constructing the SPARC V8 architecture processor chip Machine are as follows:
步骤01. 指定SPARC V8架构处理器芯片Machine默认CPU类型为LEON3。Step 01. Specify the SPARC V8 architecture processor chip. The default CPU type of Machine is LEON3.
步骤02. 在QEMU已提供对LEON3 CPU的支持的基础上,自行设计CPU响应中断时需执行的回调函数,实现相应处理逻辑。Step 02. Based on the support provided by QEMU for LEON3 CPU, design the callback function to be executed when the CPU responds to an interrupt and implement the corresponding processing logic.
步骤03. 分配SPARC V8架构处理器芯片存储空间地址,包括PROM、RAM、IO等区域。Step 03. Allocate the storage space address of the SPARC V8 architecture processor chip, including PROM, RAM, IO and other areas.
步骤04. 自行设计Bootloader,并将其加载至SPARC V8架构处理器芯片存储器的ROM区。Step 04. Design your own Bootloader and load it into the ROM area of the SPARC V8 architecture processor chip memory.
步骤05. CPU上电后即开始执行Bootloader启动程序,完成SPARC V8架构处理器芯片片上设备的初始化(可选),随后跳转至RAM区的入口地址。Step 05. After the CPU is powered on, it starts executing the Bootloader startup program, completes the initialization of the on-chip devices of the SPARC V8 architecture processor chip (optional), and then jumps to the entry address of the RAM area.
步骤06. 将星载嵌入式软件以kernel的形式加载至RAM区入口地址。Step 06. Load the onboard embedded software into the RAM area entry address in the form of kernel.
步骤07. 根据用户指定内存区域大小设置CPU的堆栈指针,具体初始化为RAM区首地址+用户指定RAM大小。Step 07. Set the CPU stack pointer according to the user-specified memory area size, specifically initialized to the RAM area first address + user-specified RAM size.
步骤08. 完成如权利要求3所述SPARC V8架构处理器芯片中断控制器、定时单元、串口设备的注册及实例化;将各片上设备挂接在系统总线SysBus上;将为各设备分配的IO地址空间映射至内存空间。Step 08. Complete the registration and instantiation of the SPARC V8 architecture processor chip interrupt controller, timing unit, and serial port device as described in claim 3; mount each on-chip device on the system bus SysBus; and map the IO address space allocated for each device to the memory space.
步骤09. 使用GPIO输入、输出线来抽象硬件设备的输入、输出引脚属性。Step 09. Use GPIO input and output lines to abstract the input and output pin properties of hardware devices.
参阅图5,设备彼此间通过GPIO线连接,硬件上信号的触发,在软件上设计为监听到某事件发生并执行相应的回调函数。启动CMU模拟器时,用户可使用“-M”选项指定待测星载嵌入式软件运行的Machine,本发明中为SPARC V8架构处理器芯片Machine设置唯一标识。Referring to Figure 5, the devices are connected to each other through GPIO lines. The triggering of the signal on the hardware is designed in the software to monitor the occurrence of a certain event and execute the corresponding callback function. When starting the CMU simulator, the user can use the "-M" option to specify the Machine on which the onboard embedded software to be tested runs. In the present invention, a unique identifier is set for the SPARC V8 architecture processor chip Machine.
外围IO控制器接口芯片用于航天器整个控制分系统设备间的数据传输,具体由80路GPIO口、16路异步串口、10路同步串口、星时等模块组成。仿真过程中采用高度模块化的思想,基于系统总线设备SysbusDevice抽象出IO接口设备 xxxDevice,外围IO接口芯片中包含设备均继承至该结构,最终注册至外围IO接口芯片。在xxxDevice中提供统一的数据处理接口,在具体组件仿真时实例化。本发明便于外围IO接口设备的扩展,可以不改变现有模型,方便地在外围IO接口芯片上注册其他设备。在对数据交互接口设计时,本发明提出共享内存解决方案,可以有效提高QEMU指令集仿真内核对外围IO空间读写仿真效率。The peripheral IO controller interface chip is used for data transmission between the entire control subsystem devices of the spacecraft, and is specifically composed of 80 GPIO ports, 16 asynchronous serial ports, 10 synchronous serial ports, star time and other modules. The idea of high modularity is adopted in the simulation process, and the IO interface device xxxDevice is abstracted based on the system bus device SysbusDevice. The devices contained in the peripheral IO interface chip are all inherited to this structure and finally registered to the peripheral IO interface chip. A unified data processing interface is provided in xxxDevice and instantiated during the simulation of specific components. The present invention facilitates the expansion of peripheral IO interface devices, and other devices can be conveniently registered on the peripheral IO interface chip without changing the existing model. When designing the data interaction interface, the present invention proposes a shared memory solution, which can effectively improve the efficiency of the QEMU instruction set simulation kernel in reading and writing peripheral IO space.
参阅图6,本发明集成CMU模块,并完成卫星控制分系统联调设计,所述卫星控制分系统具体包括中心管理单元CMU、遥控遥测单元TTU、敏感器、执行机构以及动力学模型。在虚拟环境下完成整个控制分系统测试,需要构建各个组件的模拟器。Referring to Figure 6, the present invention integrates the CMU module and completes the satellite control subsystem joint debugging design, wherein the satellite control subsystem specifically includes the central management unit CMU, the remote control and telemetry unit TTU, the sensor, the actuator and the dynamic model. To complete the entire control subsystem test in a virtual environment, it is necessary to build simulators for each component.
参阅图7,本发明实现的基于QEMU仿真的SPARC架构处理器芯片以及外围IO控制器接口芯片在航天器整个控制分系统中作为CMU模拟器,在SPARC V8架构处理器芯片上挂接3块外围IO接口芯片,分别作为PM板、IO1板、IO2板,内存映射基址分别为0x20000000、0x20300000、0x20400000。根据具体型号的设计决定各个外围设备的数据通路接通到哪块外围IO接口芯片的某种硬件接口上,具体包括:GPIO口、异步串口、同步串口等。外围IO接口芯片与外围硬件模拟器的数据交互接口使用共享内存实现。Referring to FIG. 7 , the SPARC architecture processor chip and the peripheral IO controller interface chip based on QEMU simulation implemented by the present invention are used as CMU simulators in the entire control subsystem of the spacecraft. Three peripheral IO interface chips are mounted on the SPARC V8 architecture processor chip, which are used as PM board, IO1 board, and IO2 board respectively, and the memory mapping base addresses are 0x20000000, 0x20300000, and 0x20400000 respectively. The data path of each peripheral device is connected to a certain hardware interface of which peripheral IO interface chip according to the design of the specific model, including: GPIO port, asynchronous serial port, synchronous serial port, etc. The data interaction interface between the peripheral IO interface chip and the peripheral hardware simulator is realized using shared memory.
所述卫星控制分系统联调设计的具体步骤如下:The specific steps of the satellite control subsystem joint debugging design are as follows:
步骤01. 根据星上软件控制周期,对提供目标数据环境的外围硬件模拟器与CMU模拟器进行同步控制。Step 01. According to the onboard software control cycle, the peripheral hardware simulator and CMU simulator that provide the target data environment are synchronously controlled.
步骤02. 星上软件完成一个控制周期内的任务调度,产生推力脉冲数据。Step 02. The onboard software completes the task scheduling within a control cycle and generates thrust pulse data.
步骤03. 目标数据环境模拟器完成动力学模拟并继续向CMU产生数据激励;Step 03. The target data environment simulator completes the dynamics simulation and continues to generate data excitation to the CMU;
步骤04. 循环执行,完成整个控制分系统闭环的联调。Step 04. Execute the loop to complete the closed-loop joint debugging of the entire control subsystem.
所述同步控制的具体实施步骤如下:The specific implementation steps of the synchronous control are as follows:
步骤01. 在启动CMU模拟器时,以阻塞的方式启动Monitor,添加“-S”选项,使虚拟机初始化完成后,VCPU线程阻塞等待在第一条指令执行前。Step 01. When starting the CMU simulator, start Monitor in blocking mode and add the "-S" option so that after the virtual machine is initialized, the VCPU thread blocks and waits before the first instruction is executed.
步骤02. 在提供目标数据环境的外围硬件模拟器初始化时,连接Monitor,CMU模拟器开始执行初始化工作,并停在第一条指令执行前。Step 02. When the peripheral hardware simulator that provides the target data environment is initialized, connect the Monitor, the CMU simulator starts to perform initialization work, and stops before the first instruction is executed.
步骤03. 在目标数据环境模拟器的每个控制周期内,先向Monitor发送cont指令恢复运行CMU模拟器。Step 03. In each control cycle of the target data environment simulator, first send a cont command to Monitor to resume running the CMU simulator.
步骤04. 目标数据环境模拟器基于宿主机时钟休眠64ms,再向Monitor发送stop指令停止运行CMU模拟器。Step 04. The target data environment simulator sleeps for 64ms based on the host machine clock, and then sends a stop command to the Monitor to stop running the CMU simulator.
以上只是对本发明作进一步的说明,并非用以限制本专利,凡为本发明等效实施,均应包含于本专利的权利要求范围之内。The above is only a further explanation of the present invention and is not intended to limit this patent. Any equivalent implementation of the present invention should be included in the scope of the claims of this patent.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410524841.6A CN118313325A (en) | 2024-04-29 | 2024-04-29 | A design method for CMU simulator of onboard computer based on QEMU virtual environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410524841.6A CN118313325A (en) | 2024-04-29 | 2024-04-29 | A design method for CMU simulator of onboard computer based on QEMU virtual environment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118313325A true CN118313325A (en) | 2024-07-09 |
Family
ID=91720796
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410524841.6A Pending CN118313325A (en) | 2024-04-29 | 2024-04-29 | A design method for CMU simulator of onboard computer based on QEMU virtual environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118313325A (en) |
-
2024
- 2024-04-29 CN CN202410524841.6A patent/CN118313325A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6427224B1 (en) | Method for efficient verification of system-on-chip integrated circuit designs including an embedded processor | |
US5771370A (en) | Method and apparatus for optimizing hardware and software co-simulation | |
CN101344899B (en) | Simulation test method and system of on-chip system | |
US6539522B1 (en) | Method of developing re-usable software for efficient verification of system-on-chip integrated circuit designs | |
US6212489B1 (en) | Optimizing hardware and software co-verification system | |
US5838948A (en) | System and method for simulation of computer systems combining hardware and software interaction | |
US8180620B2 (en) | Apparatus and method for performing hardware and software co-verification testing | |
Gligor et al. | Using binary translation in event driven simulation for fast and flexible MPSoC simulation | |
CN117422026B (en) | RISC-V architecture-based processor verification system | |
Ceng et al. | A high-level virtual platform for early MPSoC software development | |
CN112764981B (en) | Cooperative testing system and method | |
Engblom et al. | Full-system simulation from embedded to high-performance systems | |
Forin et al. | Giano: The two-headed system simulator | |
Chevalier et al. | A SystemC refinement methodology for embedded software | |
Bacivarov et al. | Timed HW-SW cosimulation using native execution of OS and application SW | |
US20050091022A1 (en) | Ultra fast multi-processor system simulation using dedicated virtual machines | |
CN117149536B (en) | A test method and system for processor system-level design | |
CN118313325A (en) | A design method for CMU simulator of onboard computer based on QEMU virtual environment | |
Fummi et al. | SystemC co-simulation for core-based embedded systems | |
US12073155B2 (en) | Method and system for building hardware images from heterogeneous designs for electronic systems | |
Ecker et al. | Using a dataflow abstracted virtual prototype for HdS-design | |
Engblom et al. | A fully virtual multi-node 1553 bus computer system | |
Devins | SoC Verification Software–Test Operating System | |
US20180011956A1 (en) | Data Injection In Emulation Without Rebooting | |
Kleinert et al. | Adaptive synchronization interface for hardware-software co-simulation based on systemc and QEMU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |