WO2011020353A1 - Emulation method and system - Google Patents

Emulation method and system Download PDF

Info

Publication number
WO2011020353A1
WO2011020353A1 PCT/CN2010/073117 CN2010073117W WO2011020353A1 WO 2011020353 A1 WO2011020353 A1 WO 2011020353A1 CN 2010073117 W CN2010073117 W CN 2010073117W WO 2011020353 A1 WO2011020353 A1 WO 2011020353A1
Authority
WO
WIPO (PCT)
Prior art keywords
hardware
abstraction module
interface abstraction
cpu
command
Prior art date
Application number
PCT/CN2010/073117
Other languages
French (fr)
Chinese (zh)
Inventor
缪众林
李彧
王志忠
刘衡祁
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011020353A1 publication Critical patent/WO2011020353A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking
    • G06F30/3308Design verification, e.g. functional simulation or model checking using simulation
    • G06F30/331Design verification, e.g. functional simulation or model checking using simulation with hardware acceleration, e.g. by using field programmable gate array [FPGA] or emulation

Definitions

  • the present invention relates to the field of communications, and in particular to a simulation method and system.
  • An integrated circuit or field programmable gate array Field Programable Gate Array, referred to as
  • FPGAs need to be supported by the driver and business software to achieve their specific functions.
  • chip development and simulation phase how to implement the configuration and management functions of the driver and business software determines the sufficiency and completeness of the chip simulation.
  • the conventional practice is to write a program in the function development stage, using the Register Transfer Language (RTL) or SYSTEMC description language, simulate the driver and business software functions, complete the initialization, configuration and management of the chip, and complete Functional simulation of the chip and - insurance.
  • RTL Register Transfer Language
  • SYSTEMC System for the hardware
  • real drive and business software are implemented in the target software environment. The method can meet the needs of chip simulation with few functions and relatively simple configuration management.
  • the main object of the present invention is to provide a simulation solution to solve the above problems. one.
  • a simulation method for the development of hardware device drivers and/or business software includes: setting a hardware interface abstraction module to provide an access interface for hardware device drivers and/or business software, the access interface for using the hardware
  • the hardware access operation of the device driver and/or the business software is encapsulated into a system call command data packet; the central processor CPU interface abstraction module receives the system call command data packet, generates a timing conforming to the chip simulation model, and performs the hardware access operation.
  • the hardware interface abstraction module interacts with the CPU interface abstraction module to exchange messages.
  • the hardware interface abstraction module and the CPU interface abstraction module are connected through a virtual bus, and perform message exchange through the virtual bus.
  • the hardware interface abstraction module and the CPU interface abstraction module are connected and interacted through the virtual bus, including: encapsulating the exchanged message data into a communication between the hardware interface abstraction module and the CPU interface abstraction module. a data packet in a format required by the protocol; the data packet interaction is performed through the virtual bus. .
  • the hardware interface abstraction module and the CPU interface abstraction module interacting through the virtual bus include: when the hardware interface abstraction module receives the write command from the hardware device driver, the hardware interface abstraction module encapsulates the data to be written corresponding to the write command into data.
  • the package is sent to the CPU interface abstraction module via the virtual bus.
  • the hardware interface abstraction module and the CPU interface abstraction module interacting through the virtual bus include: the hardware interface abstraction module acquires a message from the CPU interface abstraction module through the virtual bus, wherein when the message is a read return command, the hardware device driver is ended.
  • the read request returns the data corresponding to the read request; when the command is a read command from the external device, the direct storage register access DMA read operation is directly initiated, and after reading the data corresponding to the read command, the external device is Return the read data;
  • the communication protocol comprises a transmission control protocol.
  • an emulation system is provided.
  • the simulation system according to the present invention is for the development of hardware device drivers and/or business software, comprising: a hardware interface abstraction module for providing an access interface for hardware device drivers and/or service software, the access interface for The hardware access operation of the hardware device driver and/or the service software is encapsulated into a system call command data packet; the CPU interface abstraction module is connected to the chip simulation model, and is configured to receive the system call command data packet to generate a chip simulation model. Timing, the hardware access operation is performed; the hardware interface abstraction module and the CPU interface abstraction module perform message interaction.
  • the system further includes: a virtual bus, configured to connect the hardware interface abstraction module and the CPU interface abstraction module, and perform message interaction between the hardware interface abstraction module and the CPU interface abstraction module.
  • the virtual bus is specifically configured to connect the hardware interface abstraction module and the CPU interface abstraction module through a communication protocol, and encapsulate the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module into a data packet in a format required by the communication protocol.
  • FIG. 2 is a schematic diagram of a module in a simulation method according to an embodiment of the present invention.
  • FIG. 3 is a module in a simulation method according to an embodiment of the present invention
  • Figure 2 is a schematic diagram showing the structure of the data on the virtual bus in the embodiment of the present invention
  • Figure 5 is a functional flow chart of the hardware interface abstraction module processing the driving hardware operation according to an embodiment of the present invention
  • 6 is a flowchart of processing a message between a hardware interface abstraction module and a virtual bus according to an embodiment of the present invention
  • FIG. 7 is a flowchart of processing a virtual bus message message by a hardware interface abstraction module according to an embodiment of the present invention
  • a hardware interface abstraction module according to an embodiment of the present invention processes a flowchart of an on-chip bus or a chip external bus direct storage register access operation request and interrupt processing; and FIG.
  • FIG. 9 is a structural block diagram of a simulation system according to an embodiment of the present invention.
  • DETAILED DESCRIPTION OF THE INVENTION Related Art In the chip development and simulation stage, the workload is large, the debugging is complicated, and the development period is long.
  • the embodiment of the present invention provides a simulation solution, and the communication between the simulation model and the software environment is established through the solution, and the software pair is The hardware access requirements are transferred to the simulation platform by the model, and the results of the model execution and the interrupt messages generated by the model and the model's Direct Memory Access (DMA) operations are passed to the software environment.
  • DMA Direct Memory Access
  • the virtual bus shields the implementation details of the hardware and provides a real hardware environment for the software to achieve a unified virtual and real environment.
  • FIG. 1 is a flowchart of a simulation method according to an embodiment of the present invention, as shown in FIG.
  • the process includes the following steps S102 to S106: Step SI 02, setting a hardware interface abstraction module, providing an access interface for the hardware device driver and/or the service software; the access interface is configured to encapsulate the hardware device driver and/or the hardware access operation of the service software into a system call command data packet. Step S104, setting a central processor CPU interface abstraction module, receiving a system call command data packet, generating a timing conforming to the chip simulation model, performing a hardware access operation; step S106, the hardware interface abstraction module and the CPU interface abstraction module performing message interaction . In step S106, the hardware interface abstraction module and the CPU interface abstraction module are connected through a virtual bus, and perform message exchange through the virtual bus.
  • the hardware interface abstraction module by providing a hardware interface abstraction module, the upper layer hardware operation is closed into a system call command, and the timing is generated by the CPU interface abstraction module, so that the driver and the business software can be seamlessly transplanted to the actual software and hardware environment to realize parallel development.
  • the hardware interface abstraction module and the CPU interface abstraction module are connected by a communication protocol, and the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module is encapsulated into a data packet of a format required by the communication protocol, and the following aspects are performed on J3 ⁇ 4 from the following aspects: Detailed description.
  • the hardware interface abstraction module receives a read/write command from the hardware device driver, and generates a data packet of the read/write command according to at least one of the following: an address of the read/write command, and a length of the data corresponding to the read/write command The type of data corresponding to the read/write command; the hardware interface abstraction module sends a data packet to the CPU interface abstraction module through the virtual bus.
  • Aspect 2 When the hardware interface abstraction module receives the write command from the hardware device driver, the hardware interface abstraction module encapsulates the data to be written corresponding to the write command into a data packet, and sends the data to the CPU interface abstraction module through the virtual bus.
  • the hardware interface abstraction module obtains a message from the CPU interface abstraction module through the virtual bus, wherein when the message is a read return command, the hardware device driver read request is ended, and the data corresponding to the read request is returned; when the command is When a read command from an external device directly initiates a direct storage register access DMA read operation, after reading the data corresponding to the read command, it returns a read operation of the external device; when the above command is a write command from an external device, Directly initiate DMA Write operation, write the data corresponding to the write command to the memory.
  • the communication protocol comprises a transmission control protocol.
  • Aspect 1 implements a hardware interface abstraction module at the bottom of the target software (ie, business software) environment
  • the hardware interface abstraction module provides basic hardware operations for upper layer drivers (ie, hardware device drivers) and business software, wherein hardware operations may include However, it is not limited to: read and write access to hardware registers, block data copy during system memory and target, response hardware interrupt function, etc.
  • This module provides an interface for hardware device drivers and/or business software to encapsulate hardware operations into and A consistent system call of the target software system for the upper hardware device driver and/or business software to make calls.
  • the hardware interface abstraction module is replaced by the hardware operation provided by the actual hardware.
  • the actual hardware interface is PCI or LOCAL BUS.
  • Aspect 2 also relates to a CPU interface abstraction module connected to the chip simulation model in this embodiment.
  • the CPU interface abstraction module is connected to the chip internal on-chip bus or directly connected to the chip's external CPU interface bus to realize access and control of internal devices. Mask out the hardware details of the CPU side interface and connect directly to the software development environment.
  • Aspect 3 In actual development, commonly used operating system platforms include vxworks, linux, windows mobile systems, etc. Commonly used model simulation softwares include Modelsim, Ncsim, SystemC, etc. Therefore, various simulation platforms need to run in different operating system environments, such as Windows, Linux, and so on.
  • Cross-platform communication can be implemented using the TCP protocol, but it is not limited to this communication protocol. For example, if the emulation and software environment are running on the same computer, shared memory can be used to implement inter-process communication, or in communication requirements. In higher cases, dedicated hardware is used to achieve cross-platform communication.
  • Aspect 4 may use a communication protocol to communicate between the hardware interface abstraction module and the CPU interface abstraction module, and the communication protocol encapsulates the basic hardware operation of the hardware interface abstraction module into a data packet transmission to The CPU interface abstraction module of the chip simulation platform is handed over to the simulation model for execution.
  • FIG. 2 is a schematic diagram of a module in a simulation method according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a service software 101, a hardware device driver 102 (ie, a hardware device driver), a hardware interface abstraction module 103, and a CPU interface.
  • a hardware device driver 102 ie, a hardware device driver
  • a hardware interface abstraction module 103 ie, a hardware interface abstraction module
  • FIG. 3 is a schematic diagram 2 of a module in a simulation method according to an embodiment of the present invention. As shown in FIG. 3, the method includes: a service software 101, a hardware device driver 102, a hardware interface abstraction module 103, a CPU interface abstraction module 104, and a virtual bus 105.
  • the on-chip bus 106 and the chip emulation environment 107 differ from FIG. 2 in that the CPU interface abstraction module is directly connected to the internal bus in FIG. The present embodiment will be described below based on FIGS. 2 and 3.
  • the hardware device driver 102 encapsulates the implementation details of the hardware and encapsulates the different hardware implementations into a unified interface.
  • the hardware device driver 102 invokes basic hardware operations to implement control and access to the hardware. For newly developed chips, all hardware device drivers 102 and some business software 101 need to be re-developed.
  • the hardware interface abstraction modules in Figures 2 and 3 are used for communication between hardware drivers and simulation models. For the driver side, the interface simulates the actual hardware behavior, provides a hardware operation interface, and uses the virtual bus 105 to connect to the chip emulation environment 107. If it is an actual board, the actual bus is connected to the chip.
  • the CPU interface abstraction module 104 receives the messages from the virtual bus 105 and generates timings that conform to the chip interface requirements to enable access to the chip external or internal bus 106.
  • the virtual bus 105 is a cross-platform communication means, and the command and data are transmitted in a packet manner.
  • FIG. 4 is a schematic diagram showing the structure of a data packet on the virtual bus according to an embodiment of the present invention.
  • the hardware operation is converted into a 4-head header and an optional data portion.
  • the header includes a message type, such as a write command, a read command, a read return command, an interrupt status update command, and the like.
  • For the write command and the read return command the corresponding data part is required later, and the length is reported by
  • the length field in the header is determined.
  • a start address field is also defined. However, the actual implementation of the command according to hardware support will increase or decrease.
  • the CPU interface abstraction module 104 and the hardware interface abstraction module 103 need to generate corresponding commands and data according to the requirements of hardware and software, and process the returned data. The details will be described below with reference to FIGS. 5 to 8.
  • 5 is a functional flow diagram of a hardware interface abstraction module processing driver hardware operation according to an embodiment of the present invention.
  • the hardware interface abstraction module 103 receives a read/write command from a hardware device driver (ie, a driver layer).
  • the corresponding header is generated according to the address, data length and type of the read/write command and sent to the CPU interface abstraction module 104 through the virtual bus. If the command is a write command, the data to be written is also sent to the CPU through the virtual bus 105.
  • Interface abstraction module 104 FIG.
  • FIG. 6 is a flowchart of processing a message between a hardware interface abstraction module and a virtual bus according to an embodiment of the present invention.
  • the hardware interface abstraction module 103 also continuously monitors messages from the virtual bus. If it is a read return command, the drive layer read request is terminated, and the data is returned; if it is a read/write command from an external device (peripheral), the DMA operation is directly initiated, and the write operation directly writes the data to the specified memory, and reads The operation accesses the data from within and ends the peripheral read operation. If the interrupt is switched from the peripheral, the interrupt service routine of the driver is executed according to the state of the interrupt signal.
  • FIG. 7 is a flowchart of a hardware interface abstraction module processing a virtual bus message message according to an embodiment of the present invention
  • FIG. 8 is a hardware interface abstraction module for processing an on-chip bus or chip external bus DMA operation request and interrupt processing according to an embodiment of the present invention.
  • the CPU interface abstract module function and the hardware interface function are basically similar, and the same is not mentioned here, the difference is that the CPU interface module only generates the interrupt status update command, and The hardware interface abstraction module will only respond to interrupt requests.
  • the hardware interface abstraction module provides an interface to the driver software, and there is no timing, and the CPU interface abstraction module needs to communicate with the chip interface model, and its interface timing must meet the design requirements.
  • FIG. 9 is a structural block diagram of a simulation system according to an embodiment of the present invention, as shown in FIG.
  • the system includes: a hardware interface abstraction module 92, a CPU interface abstraction module 94, which is described in detail below.
  • the hardware interface abstraction module 92 is configured to provide a real access interface for the hardware device driver and/or the service software, where the access interface is used to encapsulate the hardware device driver and/or the hardware access operation of the service software into a system call command data packet;
  • the CPU interface abstraction module 94 is connected to the chip simulation model, configured to receive the system call command data packet, generate a timing conforming to the chip simulation model, and perform the hardware access operation; the hardware interface abstraction module and the CPU interface abstraction module perform the message Interaction. As shown in FIG.
  • the system further includes a virtual bus for connecting the hardware interface abstraction module and the CPU interface abstraction module, and performing interaction between the hardware interface abstraction module and the CPU interface abstraction module.
  • the virtual bus is specifically configured to connect the hardware interface abstraction module and the CPU interface abstraction module through a communication protocol, and encapsulate the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module into a data packet in a format required by the communication protocol.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Abstract

An emulation method and system, the method for developing a hardware device driver (91) and/or a service software comprises: setting a hardware interface abstract module for providing a real access interface for the hardware device driver (91) and/or the service software, wherein the access interface used for encapsulating hardware access operations of the hardware device driver (91) and/or the service software to a system call command data package; setting a central processing unit (CPU) interface abstract module (94) for receiving the system call command data package, generating a time sequence consistent with a chip emulation model (95) and performing the hardware access operations; performing the message interaction between the hardware interface abstract module and the CPU interface abstract module (94). The driver and the service software can be seamlessly migrated to the real software-hardware environment by the method and the system to be parallel developed, thereby accelerating the development progress of the project.

Description

仿真方法及系统 技术领域 本发明涉及通信领域, 具体而言, 涉及一种仿真方法及系统。 背景技术 集成电路或现场可编程门阵列 (Field Programable Gate Array, 简称为 TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a simulation method and system. BACKGROUND OF THE INVENTION An integrated circuit or field programmable gate array (Field Programable Gate Array, referred to as
FPGA ) 都需要在驱动和业务软件的支持下才能实现其特定功能, 在芯片开 发仿真阶段, 如何实现驱动和业务软件的配置管理功能, 决定了芯片仿真的 充分性和完备性。 目前, 常规的做法是在功能开发阶段, 釆用寄存器传输语言 (Register Transfer Language, 简称为 RTL ) 或 SYSTEMC描述语言编写程序, 模拟驱 动和业务软件功能, 完成对芯片的初始化、 配置和管理, 完成芯片的功能仿 真和-险证。 在硬件调试阶段, 在目标软件环境实现真实的驱动和业务软件。 该方法可以满足功能不多、 配置管理相对简单的芯片仿真需求。 但是, 对于大规模和功能复杂芯片,用 RTL实现与实际功能一致的业务软件的工作 是一项庞大的工作, 在转换成实际驱动和业务软件过程中, 会再次消耗大量 工作量。 模拟程序和实际软件之间的微小差异, 将导致硬件调试时遇到的问 题无法在仿真环境中的再现。 同时真实驱动软件的开发需要在硬件阶段才能 完成, 导致开发周期的延长。 目前, 在芯片仿真阶段, 相关技术中缺少完整的跨平台软硬件协同开发 方法。 发明内容 针对相关技术中的在芯片开发仿真阶段中工作量大、 调试复杂、 开发周 期长的问题而提出本发明, 为此,本发明的主要目的在于提供一种仿真方案, 以解决上述问题至少之一。 为了实现上述目的, 才艮据本发明的一个方面, 提供了一种仿真方法。 根据本发明的仿真方法,用于硬件设备驱动和 /或业务软件的开发,包括: 设置硬件接口抽象模块为硬件设备驱动和 /或业务软件提供访问接口,所述访 问接口用于将所述硬件设备驱动和 /或业务软件的硬件访问操作封装成系统 调用命令数据包;中央处理器 CPU接口抽象模块接收所述系统调用命令数据 包,, 产生符合芯片仿真模型的时序, 进行所述硬件访问操作; 硬件接口抽象 模块与 CPU接口抽象模块进行报文交互。 优选地,硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线连接, 并 通过虚拟总线进行报文交互。 优选地,硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线连接并进 行交互包括:将交互的报文数据封装成所述硬件接口抽象模块与所述 CPU接 口抽象模块之间报文交互使用的通讯协议所要求的格式的数据包; 通过所述 虚拟总线进行所述数据包交互。。 优选地,硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线进行交互 包括: 硬件接口抽象模块接收来自硬件设备驱动的读 /写命令, 并根据以下至 少之一产生读 /写命令的数据包: 读 /写命令的地址、 读 /写命令对应的数据的 长度、读 /写命令对应的数据的类型;硬件接口抽象模块通过虚拟总线向 CPU 接口抽象模块发送数据包。 优选地,硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线进行交互 包括: 在硬件接口抽象模块接收来自硬件设备驱动的写命令时, 硬件接口抽 象模块将写命令对应的待写的数据封装成数据包, 并通过虚拟总线发送给 CPU接口抽象模块。 优选地,硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线进行交互 包括: 硬件接口抽象模块通过虚拟总线获取来自 CPU接口抽象模块的消息, 其中, 当消息为读返回命令时, 则结束硬件设备驱动的读请求, 并返回读请 求所对应的数据; 当命令为来自外部设备的读命令时, 则直接发起直接存储 寄存器访问 DMA读取操作, 在读取到读命令对应的数据后, 向外部设备返 回读取到的数据; 当命令为来自外部设备的写命令时, 则直接发起 DMA写 操作, 将写命令对应的数据写入内存。 优选地, 通讯协议包括传输控制协议。 为了实现上述目的, 才艮据本发明的另一方面, 提供了一种仿真系统。 根据本发明的仿真系统,用于硬件设备驱动和 /或业务软件的开发,包括: 硬件接口抽象模块, 用于为硬件设备驱动和 /或业务软件提供访问接口, 所述 访问接口用于将将所述硬件设备驱动和 /或业务软件的硬件访问操作封装成 系统调用命令数据包; CPU接口抽象模块, 与芯片仿真模型连接, 用于接收 所述系统调用命令数据包, 产生符合芯片仿真模型的时序, 进行所述硬件访 问操作; 硬件接口抽象模块与 CPU接口抽象模块进行报文交互。 优选地,上述系统还包括:虚拟总线,用于连接硬件接口抽象模块与 CPU 接口抽象模块,并在硬件接口抽象模块和 CPU接口抽象模块之间进行报文交 互。 优选地, 虚拟总线具体用于通过通讯协议连接硬件接口抽象模块与 CPU 接口抽象模块,并将硬件接口抽象模块和 CPU接口抽象模块之间交互的数据 封装成通讯协议所要求的格式的数据包。 通过本发明, 釆用设置向上层提供硬件操作的硬件接口抽象模块、 CPU 接口抽象模块和连接至硬件接口抽象模块的芯片仿真模型, 解决了相关技术 中的在芯片开发仿真阶段中工作量大、 调试复杂、 开发周期长的问题, 使驱 动和业务软件可以无缝移植到实际的软硬件环境, 实现并行开发, 进而加快 了项目开发进度。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的 不当限定。 在附图中: 图 1是 居本发明实施例的仿真方法的流程图; 图 2是 居本发明实施例的仿真方法中模块的示意图一; 图 3是 居本发明实施例的仿真方法中模块的示意图二; 图 4是 居本发明实施例的虚拟总线上的数据 4艮文组成结构的示意图; 图 5是根据本发明实施例的硬件接口抽象模块处理驱动硬件操作的功能 流程图; 图 6是根据本发明实施例的硬件接口抽象模块和虚拟总线之间消息的处 理流程图; 图 7是根据本发明实施例的硬件接口抽象模块处理虚拟总线报文消息的 流程图; 图 8是根据本发明实施例的硬件接口抽象模块处理片上总线或芯片外部 总线直接存储寄存器访问操作请求和中断处理的流程图; 图 9是 居本发明实施例的仿真系统的结构框图。 具体实施方式 相关技术在芯片开发仿真阶段中工作量大、 调试复杂、 开发周期长, 本 发明实施例提供了一种仿真方案, 通过该方案在仿真模型和软件环境之间建 立通信, 将软件对硬件访问需求传输到仿真平台中由模型来完成, 同时模型 执行的结果和模型产生的中断消息以及模型的直接存储寄存器访问 ( Directory Memory Access, 简称为 DMA )操作传替给软件环境。 虚拟总线 屏蔽了硬件的实现细节, 提供一个真实的硬件环境给软件, 实现虚拟和真实 环境的统一。 该方案的处理原则如下: 设置硬件接口抽象模块, 硬件接口抽 象模块用于为硬件设备驱动和 /或业务软件提供真实的访问接口;设置中央处 理器 CPU接口抽象模块, CPU接口抽象模块用于与芯片仿真模型连接, 产 生符合芯片仿真模型的时序;硬件接口抽象模块与 CPU接口抽象模块进行报 文交互。 需要说明的是, 在不冲突的情况下, 本申请中的实施例及实施例中的特 征可以相互组合。 下面将参考附图并结合实施例来详细说明本发明。 在以下实施例中, 在附图的流程图示出的步 4聚可以在诸如一组计算机可 执行指令的计算机系统中执行, 并且, 虽然在流程图中示出了逻辑顺序, 但 是在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤。 方法实施例 根据本发明的实施例, 提供了一种仿真方法, 用于硬件设备驱动和 /或业 务软件的开发, 图 1是 居本发明实施例的仿真方法的流程图,如图 1所示, 该流程包括如下步骤 S 102至步骤 S 106: 步骤 S I 02, 设置硬件接口抽象模块, 为硬件设备驱动和 /或业务软件提 供访问接口; 所述访问接口用于将硬件设备驱动和 /或业务软件的硬件访问操作封装 成系统调用命令数据包。 步骤 S 104 , 设置中央处理器 CPU接口抽象模块, 接收系统调用命令数 据包, 产生符合芯片仿真模型的时序, 进行硬件访问操作; 步骤 S 106 , 硬件接口抽象模块与 CPU接口抽象模块进行报文交互。 在步骤 S 106中, 硬件接口抽象模块与 CPU接口抽象模块通过虚拟总线 连接, 并通过虚拟总线进行报文交互。 相关技术在芯片仿真阶段, 缺少完整的跨平台软硬件协同开发方法, 相 应的软件只有通过真实的硬件接口进行芯片仿真。 本实施例通过提供硬件接 口抽象模块, 将上层硬件操作封闭成系统调用命令, 通过 CPU接口抽象模块 产生时序, 使驱动和业务软件可以无缝移植到实际的软硬件环境, 实现并行 开发。 硬件接口抽象模块与 CPU接口抽象模块通过通讯协议连接 ,硬件接口抽 象模块和 CPU 接口抽象模块之间交互的数据被封装成通讯协议所要求的格 式的数据包, 下面从以下几个方面对 J¾进行详细的描述。 方面一, 硬件接口抽象模块接收来自硬件设备驱动的读 /写命令, 并将根 据以下至少之一产生读 /写命令的数据包: 读 /写命令的地址、 读 /写命令对应 的数据的长度、 读 /写命令对应的数据的类型; 硬件接口抽象模块通过虚拟总 线向 CPU接口抽象模块发送数据包。 方面二, 在硬件接口抽象模块接收来自硬件设备驱动的写命令时, 硬件 接口抽象模块将写命令对应的待写的数据封装成数据包, 并通过虚拟总线发 送给 CPU接口抽象模块。 方面三,硬件接口抽象模块通过虚拟总线获取来自 CPU接口抽象模块的 消息, 其中, 当消息为读返回命令时, 则结束硬件设备驱动的读请求, 并返 回读请求所对应的数据; 当命令为来自外部设备的读命令时, 则直接发起直 接存储寄存器访问 DMA读取操作, 在读取到读命令对应的数据后, 返回外 部设备的读操作; 当上述命令为来自外部设备的写命令时,则直接发起 DMA 写操作, 将写命令对应的数据写入内存。 优选地, 通讯协议包括传输控制协议。 下面从四个方面对本实施例进行详细的说明。 方面一 在目标软件 (即, 业务软件 ) 环境底层实现一个硬件接口抽象模块, 该 硬件接口抽象模块对上层驱动 (即, 硬件设备驱动) 和业务软件提供基本的 硬件操作, 其中, 硬件操作可以包括但不限于: 对硬件寄存器读写访问、 系 统内存和目标期间的块数据拷贝、 响应硬件中断功能等, 该模块为硬件设备 驱动和 /或业务软件提供访问接口,用于将硬件操作封装成和目标软件系统一 致的系统调用, 以便上层的硬件设备驱动和 /或业务软件进行调用。 而在实际 硬件环境中, 该硬件接口抽象模块被实际硬件提供的硬件操作代替, 实际的 硬件接口为 PCI或者 LOCAL BUS , 因此, 只需要开发接口的驱动, 位于基 本硬件操作之上的驱动和业务软件无需修改可以直接使用。 方面二 在本实施例中还涉及到一个和芯片仿真模型连接的 CPU接口抽象模块。 该 CPU接口抽象模块连接到芯片内部片上总线或者直接连接到芯片的外部 CPU接口总线, 实现对内部设备的访问和控制。 屏蔽掉 CPU侧接口硬件细 节, 直接连接到软件开发环境。 方面三 在实际的开发中,常用的操作系统平台有 vxworks , linux , windows mobile 系统等, 常用的模型仿真软件有 Modelsim , Ncsim , SystemC等。 因此, 各 种仿真平台需要在不同的操作系统环境运行, 例如 Windows, Linux等。 可 以釆用 TCP协议实现跨平台通信, 但是不仅仅限于此通信协议, 例如, 如果 仿真和软件环境在同一台计算机上运行, 也可以釆用共享存贮器方式实现进 程间通信,或者在通信要求较高的场合, 釆用专用硬件来实现跨平台间通信。 方面四 在硬件接口抽象模块和 CPU接口抽象模块之间可以釆用通信协议进行 通讯, 该通信协议把硬件接口抽象模块的基本硬件操作封装成数据包传输给 芯片仿真平台的 CPU接口抽象模块, 交给仿真模型执行。 需要返回给软件平 台的数据由 CPU接口抽象模块封装成包后再传输给硬件接口抽象模块,通过 基本硬件抽象接口模块传输给软件。 模型的中断信号状态也封装成数据包传 输给硬件接口抽象模块, 交给中断服务程序执行。 下面将结合附图和实施例对本发明进行详细描述。 图 2是 居本发明实施例的仿真方法中模块的示意图一, 如图 2所示, 包括: 业务软件 101 , 硬件设备驱动程序 102 (即, 硬件设备驱动), 硬件接 口抽象模块 103 , CPU接口抽象模块 104 , 虚拟总线 105 , 芯片外部总线 106 和芯片仿真环境 107。 图 3是 居本发明实施例的仿真方法中模块的示意图二, 如图 3所示, 包括: 业务软件 101 , 硬件设备驱动程序 102 , 硬件接口抽象模块 103 , CPU 接口抽象模块 104 , 虚拟总线 105 , 芯片片上总线 106和芯片仿真环境 107, 与图 2不同的是, 在图 3中 CPU接口抽象模块直接和内部总线相连。 下面基 于图 2和图 3对本实施例进行说明。 图 2和图 3中的业务软件 101是实现芯片功能对应的应用软件, 其功能 实现构建在硬件设备驱动程序 102的基础上。 硬件设备驱动程序 102封装了 硬件的实现细节, 将不同的硬件实现封装成统一的接口。 硬件设备驱动程序 102 调用基本硬件操作来实现对硬件的控制和访问。 对新开发的芯片, 需要 重新开发全部硬件设备驱动程序 102和部分业务软件 101. 图 2和图 3中的硬件接口抽象模块用于硬件驱动和仿真模型间的通信。 对驱动侧, 该接口模拟实际的硬件行为, 提供硬件操作接口, 并釆用虚拟总 线 105和芯片仿真环境 107连接, 如果是实际的单板, 则釆用实际总线连接 到芯片。 FPGAs need to be supported by the driver and business software to achieve their specific functions. In the chip development and simulation phase, how to implement the configuration and management functions of the driver and business software determines the sufficiency and completeness of the chip simulation. At present, the conventional practice is to write a program in the function development stage, using the Register Transfer Language (RTL) or SYSTEMC description language, simulate the driver and business software functions, complete the initialization, configuration and management of the chip, and complete Functional simulation of the chip and - insurance. In the hardware debugging phase, real drive and business software are implemented in the target software environment. The method can meet the needs of chip simulation with few functions and relatively simple configuration management. However, for large-scale and functionally complex chips, the use of RTL to implement business software that is consistent with the actual functions is a huge task, and in the process of converting into actual drive and business software, it will consume a lot of work again. Minor differences between the simulation program and the actual software will cause problems in hardware debugging that cannot be reproduced in the simulation environment. At the same time, the development of real driver software needs to be completed in the hardware phase, resulting in an extension of the development cycle. At present, in the chip simulation phase, the related technology lacks a complete cross-platform software and hardware collaborative development method. SUMMARY OF THE INVENTION The present invention has been made in view of the problems of large workload, complicated debugging, and long development cycle in the chip development simulation stage in the related art. Therefore, the main object of the present invention is to provide a simulation solution to solve the above problems. one. In order to achieve the above object, in accordance with an aspect of the present invention, a simulation method is provided. The simulation method according to the present invention for the development of hardware device drivers and/or business software includes: setting a hardware interface abstraction module to provide an access interface for hardware device drivers and/or business software, the access interface for using the hardware The hardware access operation of the device driver and/or the business software is encapsulated into a system call command data packet; the central processor CPU interface abstraction module receives the system call command data packet, generates a timing conforming to the chip simulation model, and performs the hardware access operation. The hardware interface abstraction module interacts with the CPU interface abstraction module to exchange messages. Preferably, the hardware interface abstraction module and the CPU interface abstraction module are connected through a virtual bus, and perform message exchange through the virtual bus. Preferably, the hardware interface abstraction module and the CPU interface abstraction module are connected and interacted through the virtual bus, including: encapsulating the exchanged message data into a communication between the hardware interface abstraction module and the CPU interface abstraction module. a data packet in a format required by the protocol; the data packet interaction is performed through the virtual bus. . Preferably, the hardware interface abstraction module interacts with the CPU interface abstraction module through the virtual bus comprises: the hardware interface abstraction module receives a read/write command from the hardware device driver, and generates a read/write command data packet according to at least one of the following: The address of the /write command, the length of the data corresponding to the read/write command, and the type of data corresponding to the read/write command; the hardware interface abstraction module sends the data packet to the CPU interface abstraction module through the virtual bus. Preferably, the hardware interface abstraction module and the CPU interface abstraction module interacting through the virtual bus include: when the hardware interface abstraction module receives the write command from the hardware device driver, the hardware interface abstraction module encapsulates the data to be written corresponding to the write command into data. The package is sent to the CPU interface abstraction module via the virtual bus. Preferably, the hardware interface abstraction module and the CPU interface abstraction module interacting through the virtual bus include: the hardware interface abstraction module acquires a message from the CPU interface abstraction module through the virtual bus, wherein when the message is a read return command, the hardware device driver is ended. The read request returns the data corresponding to the read request; when the command is a read command from the external device, the direct storage register access DMA read operation is directly initiated, and after reading the data corresponding to the read command, the external device is Return the read data; When the command is a write command from an external device, the DMA write operation is directly initiated, and the data corresponding to the write command is written into the memory. Preferably, the communication protocol comprises a transmission control protocol. In order to achieve the above object, in accordance with another aspect of the present invention, an emulation system is provided. The simulation system according to the present invention is for the development of hardware device drivers and/or business software, comprising: a hardware interface abstraction module for providing an access interface for hardware device drivers and/or service software, the access interface for The hardware access operation of the hardware device driver and/or the service software is encapsulated into a system call command data packet; the CPU interface abstraction module is connected to the chip simulation model, and is configured to receive the system call command data packet to generate a chip simulation model. Timing, the hardware access operation is performed; the hardware interface abstraction module and the CPU interface abstraction module perform message interaction. Preferably, the system further includes: a virtual bus, configured to connect the hardware interface abstraction module and the CPU interface abstraction module, and perform message interaction between the hardware interface abstraction module and the CPU interface abstraction module. Preferably, the virtual bus is specifically configured to connect the hardware interface abstraction module and the CPU interface abstraction module through a communication protocol, and encapsulate the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module into a data packet in a format required by the communication protocol. Through the invention, the hardware interface abstraction module, the CPU interface abstraction module and the chip simulation model connected to the hardware interface abstraction module which provide the hardware operation to the upper layer are solved, and the workload in the chip development and simulation stage is solved in the related art. Debugging complex and long development cycles, enabling drivers and business software to be seamlessly ported to the actual hardware and software environment, enabling parallel development, thereby accelerating project development. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1 is a flowchart of a simulation method in an embodiment of the present invention; FIG. 2 is a schematic diagram of a module in a simulation method according to an embodiment of the present invention; and FIG. 3 is a module in a simulation method according to an embodiment of the present invention; Figure 2 is a schematic diagram showing the structure of the data on the virtual bus in the embodiment of the present invention; Figure 5 is a functional flow chart of the hardware interface abstraction module processing the driving hardware operation according to an embodiment of the present invention; 6 is a flowchart of processing a message between a hardware interface abstraction module and a virtual bus according to an embodiment of the present invention; FIG. 7 is a flowchart of processing a virtual bus message message by a hardware interface abstraction module according to an embodiment of the present invention; A hardware interface abstraction module according to an embodiment of the present invention processes a flowchart of an on-chip bus or a chip external bus direct storage register access operation request and interrupt processing; and FIG. 9 is a structural block diagram of a simulation system according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION Related Art In the chip development and simulation stage, the workload is large, the debugging is complicated, and the development period is long. The embodiment of the present invention provides a simulation solution, and the communication between the simulation model and the software environment is established through the solution, and the software pair is The hardware access requirements are transferred to the simulation platform by the model, and the results of the model execution and the interrupt messages generated by the model and the model's Direct Memory Access (DMA) operations are passed to the software environment. The virtual bus shields the implementation details of the hardware and provides a real hardware environment for the software to achieve a unified virtual and real environment. The processing principles of the scheme are as follows: Set hardware interface abstraction module, hardware interface abstraction module is used to provide real access interface for hardware device driver and/or business software; set central processor CPU interface abstraction module, CPU interface abstraction module is used for The chip simulation model is connected to generate timings in accordance with the chip simulation model; the hardware interface abstraction module and the CPU interface abstraction module perform message interaction. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. In the following embodiments, the steps shown in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some In this case, the steps shown or described may be performed in a different order than the ones described herein. Method Embodiments According to an embodiment of the present invention, a simulation method is provided for hardware device driver and/or service software development. FIG. 1 is a flowchart of a simulation method according to an embodiment of the present invention, as shown in FIG. The process includes the following steps S102 to S106: Step SI 02, setting a hardware interface abstraction module, providing an access interface for the hardware device driver and/or the service software; the access interface is configured to encapsulate the hardware device driver and/or the hardware access operation of the service software into a system call command data packet. Step S104, setting a central processor CPU interface abstraction module, receiving a system call command data packet, generating a timing conforming to the chip simulation model, performing a hardware access operation; step S106, the hardware interface abstraction module and the CPU interface abstraction module performing message interaction . In step S106, the hardware interface abstraction module and the CPU interface abstraction module are connected through a virtual bus, and perform message exchange through the virtual bus. Related technologies In the chip simulation phase, there is a lack of a complete cross-platform software and hardware collaborative development method, and the corresponding software only performs chip simulation through a real hardware interface. In this embodiment, by providing a hardware interface abstraction module, the upper layer hardware operation is closed into a system call command, and the timing is generated by the CPU interface abstraction module, so that the driver and the business software can be seamlessly transplanted to the actual software and hardware environment to realize parallel development. The hardware interface abstraction module and the CPU interface abstraction module are connected by a communication protocol, and the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module is encapsulated into a data packet of a format required by the communication protocol, and the following aspects are performed on J3⁄4 from the following aspects: Detailed description. Aspect 1, the hardware interface abstraction module receives a read/write command from the hardware device driver, and generates a data packet of the read/write command according to at least one of the following: an address of the read/write command, and a length of the data corresponding to the read/write command The type of data corresponding to the read/write command; the hardware interface abstraction module sends a data packet to the CPU interface abstraction module through the virtual bus. Aspect 2: When the hardware interface abstraction module receives the write command from the hardware device driver, the hardware interface abstraction module encapsulates the data to be written corresponding to the write command into a data packet, and sends the data to the CPU interface abstraction module through the virtual bus. Aspect 3: The hardware interface abstraction module obtains a message from the CPU interface abstraction module through the virtual bus, wherein when the message is a read return command, the hardware device driver read request is ended, and the data corresponding to the read request is returned; when the command is When a read command from an external device directly initiates a direct storage register access DMA read operation, after reading the data corresponding to the read command, it returns a read operation of the external device; when the above command is a write command from an external device, Directly initiate DMA Write operation, write the data corresponding to the write command to the memory. Preferably, the communication protocol comprises a transmission control protocol. The present embodiment will be described in detail in four aspects below. Aspect 1 implements a hardware interface abstraction module at the bottom of the target software (ie, business software) environment, the hardware interface abstraction module provides basic hardware operations for upper layer drivers (ie, hardware device drivers) and business software, wherein hardware operations may include However, it is not limited to: read and write access to hardware registers, block data copy during system memory and target, response hardware interrupt function, etc. This module provides an interface for hardware device drivers and/or business software to encapsulate hardware operations into and A consistent system call of the target software system for the upper hardware device driver and/or business software to make calls. In the actual hardware environment, the hardware interface abstraction module is replaced by the hardware operation provided by the actual hardware. The actual hardware interface is PCI or LOCAL BUS. Therefore, only the driver of the development interface needs to be driven, and the driver and service located above the basic hardware operation. The software can be used directly without modification. Aspect 2 also relates to a CPU interface abstraction module connected to the chip simulation model in this embodiment. The CPU interface abstraction module is connected to the chip internal on-chip bus or directly connected to the chip's external CPU interface bus to realize access and control of internal devices. Mask out the hardware details of the CPU side interface and connect directly to the software development environment. Aspect 3 In actual development, commonly used operating system platforms include vxworks, linux, windows mobile systems, etc. Commonly used model simulation softwares include Modelsim, Ncsim, SystemC, etc. Therefore, various simulation platforms need to run in different operating system environments, such as Windows, Linux, and so on. Cross-platform communication can be implemented using the TCP protocol, but it is not limited to this communication protocol. For example, if the emulation and software environment are running on the same computer, shared memory can be used to implement inter-process communication, or in communication requirements. In higher cases, dedicated hardware is used to achieve cross-platform communication. Aspect 4 may use a communication protocol to communicate between the hardware interface abstraction module and the CPU interface abstraction module, and the communication protocol encapsulates the basic hardware operation of the hardware interface abstraction module into a data packet transmission to The CPU interface abstraction module of the chip simulation platform is handed over to the simulation model for execution. The data that needs to be returned to the software platform is encapsulated into a packet by the CPU interface abstraction module and then transmitted to the hardware interface abstraction module, and transmitted to the software through the basic hardware abstraction interface module. The interrupt signal state of the model is also encapsulated into a data packet transmission to the hardware interface abstraction module, which is passed to the interrupt service routine for execution. The invention will now be described in detail in conjunction with the drawings and embodiments. 2 is a schematic diagram of a module in a simulation method according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a service software 101, a hardware device driver 102 (ie, a hardware device driver), a hardware interface abstraction module 103, and a CPU interface. Abstract module 104, virtual bus 105, chip external bus 106 and chip emulation environment 107. 3 is a schematic diagram 2 of a module in a simulation method according to an embodiment of the present invention. As shown in FIG. 3, the method includes: a service software 101, a hardware device driver 102, a hardware interface abstraction module 103, a CPU interface abstraction module 104, and a virtual bus 105. The on-chip bus 106 and the chip emulation environment 107 differ from FIG. 2 in that the CPU interface abstraction module is directly connected to the internal bus in FIG. The present embodiment will be described below based on FIGS. 2 and 3. The service software 101 in FIG. 2 and FIG. 3 is an application software that implements a chip function, and its function implementation is built on the hardware device driver 102. The hardware device driver 102 encapsulates the implementation details of the hardware and encapsulates the different hardware implementations into a unified interface. The hardware device driver 102 invokes basic hardware operations to implement control and access to the hardware. For newly developed chips, all hardware device drivers 102 and some business software 101 need to be re-developed. The hardware interface abstraction modules in Figures 2 and 3 are used for communication between hardware drivers and simulation models. For the driver side, the interface simulates the actual hardware behavior, provides a hardware operation interface, and uses the virtual bus 105 to connect to the chip emulation environment 107. If it is an actual board, the actual bus is connected to the chip.
CPU接口抽象模块 104接收来自虚拟总线 105的报文, 并产生符合芯片 接口要求的时序, 从而实现对芯片外部或内部总线 106的访问。 其中, 虚拟总线 105是某种跨平台的通信手段, 其命令和数据釆用封包 的方式传输, 图 4是根据本发明实施例的虚拟总线上的数据报文组成结构的 示意图, 如图 4所示, 硬件操作被转换成 4艮文头和可选的数据部分, 4艮文头 包括一个报文类型, 例如, 写命令、 读命令、 读返回命令、 中断状态更新命 令等。 对于写命令和读返回命令, 后面需要有相应的数据部分, 其长度由报 文头中的长度字段决定。 另外定义了一个起始地址字段。 但是, 实际实现时 根据硬件支持的命令会有所增减。 The CPU interface abstraction module 104 receives the messages from the virtual bus 105 and generates timings that conform to the chip interface requirements to enable access to the chip external or internal bus 106. The virtual bus 105 is a cross-platform communication means, and the command and data are transmitted in a packet manner. FIG. 4 is a schematic diagram showing the structure of a data packet on the virtual bus according to an embodiment of the present invention. The hardware operation is converted into a 4-head header and an optional data portion. The header includes a message type, such as a write command, a read command, a read return command, an interrupt status update command, and the like. For the write command and the read return command, the corresponding data part is required later, and the length is reported by The length field in the header is determined. A start address field is also defined. However, the actual implementation of the command according to hardware support will increase or decrease.
CPU接口抽象模块 104和硬件接口抽象模块 103需要根据硬件、软件的 要求产生相应的命令及数据, 并对返回的数据进行处理。 下面结合图 5至图 8对进行详细的说明。 图 5是根据本发明实施例的硬件接口抽象模块处理驱动硬件操作的功能 流程图, 如图 5所示, 硬件接口抽象模块 103如果接收到来自硬件设备驱动 (即, 驱动层) 的读写命令, 会根据读写命令的地址, 数据长度及类型产生 对应的报文头并通过虚拟总线发送给 CPU接口抽象模块 104 ,如果是写命令, 再把待写的数据也通过虚拟总线 105发送给 CPU接口抽象模块 104。 图 6是根据本发明实施例的硬件接口抽象模块和虚拟总线之间消息的处 理流程图, 如图 6所示, 硬件接口抽象模块 103也不断的监测来自虚拟总线 的消息 4艮文。 如果是读返回命令, 则结束驱动层的读请求, 返回数据; 如果 是来自外部设备(外设) 的读写命令, 则直接发起 DMA操作, 对写操作直 接把数据写入指定内存, 对读操作则从内存取数据, 结束外设读操作。 如果 来自外设的是中断状态切换, 则根据中断信号状态决定是否执行驱动程序的 中断服务程序。 图 7是根据本发明实施例的硬件接口抽象模块处理虚拟总线报文消息的 流程图, 图 8是根据本发明实施例的硬件接口抽象模块处理片上总线或芯片 外部总线 DMA操作请求和中断处理的流程图, 如图 7和图 8所示, CPU接 口抽象模块功能和硬件接口功能基本相似, 对于相同的在此不再赞述, 不同 的在于, CPU接口模块只会产生中断状态更新命令, 而硬件接口抽象模块只 会响应中断请求。硬件接口抽象模块对驱动软件提供接口,没有时序,而 CPU 接口抽象模块需要和芯片接口模型通信, 其接口时序必须满足设计要求。 综上所述, 由图 2和图 3可见, 如果釆用真实的硬件单板调试软件, 只 需要用硬件接口驱动程序代替硬件接口抽象模块,而其他软件模块完全相同。 因此, 通过本实施例可以实现基于仿真模型基础上的驱动和业务软件开发, 移植到实际硬件系统中时只需要增加实际硬件接口的驱动, 而硬件驱动和业 务软件可以无缝移植。 系统实施例 根据本发明的实施例, 提供了一种仿真系统, 用于硬件设备驱动和 /或业 务软件的开发, 图 9是才艮据本发明实施例的仿真系统的结构框图, 如图 9所 示, 该系统包括: 硬件接口抽象模块 92、 CPU接口抽象模块 94 , 下面对该 系统进行详细的描述。 硬件接口抽象模块 92 , 用于为硬件设备驱动和 /或业务软件提供真实的 访问接口,所述访问接口用于将硬件设备驱动和 /或业务软件的硬件访问操作 封装成系统调用命令数据包; CPU接口抽象模块 94 , 与芯片仿真模型连接, 用于接收所述系统调用命令数据包, 产生符合芯片仿真模型的时序, 进行所 述硬件访问操作; 硬件接口抽象模块与 CPU接口抽象模块进行报文交互。 如图 9所示, 该系统还包括虚拟总线, 该虚拟总线用于连接硬件接口抽 象模块与 CPU接口抽象模块, 并在硬件接口抽象模块和 CPU接口抽象模块 之间进行 4艮文交互。 虚拟总线具体用于通过通讯协议连接硬件接口抽象模块与 CPU接口抽 象模块,并将硬件接口抽象模块和 CPU接口抽象模块之间交互的数据封装成 通讯协议所要求的格式的数据包。 综上所述, 通过本发明的上述实施例, 可以实现基于模型的驱动和业务 软件的开发, 方便芯片功能的仿真和调试; 同时, 开发的硬件驱动和业务软 件可以无缝移植到实际的软硬件环境中, 从而实现了并行开发, 加快了项目 开发进度。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可 以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布 在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程 序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 或 者将它们分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制 作成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软 件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。 The CPU interface abstraction module 104 and the hardware interface abstraction module 103 need to generate corresponding commands and data according to the requirements of hardware and software, and process the returned data. The details will be described below with reference to FIGS. 5 to 8. 5 is a functional flow diagram of a hardware interface abstraction module processing driver hardware operation according to an embodiment of the present invention. As shown in FIG. 5, the hardware interface abstraction module 103 receives a read/write command from a hardware device driver (ie, a driver layer). The corresponding header is generated according to the address, data length and type of the read/write command and sent to the CPU interface abstraction module 104 through the virtual bus. If the command is a write command, the data to be written is also sent to the CPU through the virtual bus 105. Interface abstraction module 104. FIG. 6 is a flowchart of processing a message between a hardware interface abstraction module and a virtual bus according to an embodiment of the present invention. As shown in FIG. 6, the hardware interface abstraction module 103 also continuously monitors messages from the virtual bus. If it is a read return command, the drive layer read request is terminated, and the data is returned; if it is a read/write command from an external device (peripheral), the DMA operation is directly initiated, and the write operation directly writes the data to the specified memory, and reads The operation accesses the data from within and ends the peripheral read operation. If the interrupt is switched from the peripheral, the interrupt service routine of the driver is executed according to the state of the interrupt signal. 7 is a flowchart of a hardware interface abstraction module processing a virtual bus message message according to an embodiment of the present invention, and FIG. 8 is a hardware interface abstraction module for processing an on-chip bus or chip external bus DMA operation request and interrupt processing according to an embodiment of the present invention. Flowchart, as shown in Figure 7 and Figure 8, the CPU interface abstract module function and the hardware interface function are basically similar, and the same is not mentioned here, the difference is that the CPU interface module only generates the interrupt status update command, and The hardware interface abstraction module will only respond to interrupt requests. The hardware interface abstraction module provides an interface to the driver software, and there is no timing, and the CPU interface abstraction module needs to communicate with the chip interface model, and its interface timing must meet the design requirements. In summary, as can be seen from Figure 2 and Figure 3, if you use real hardware board debugging software, you only need to replace the hardware interface abstract module with the hardware interface driver, and the other software modules are identical. Therefore, the driving and service software development based on the simulation model can be realized by the embodiment, and only the driver of the actual hardware interface needs to be added when transplanting into the actual hardware system, and the hardware driver and the business software can be seamlessly transplanted. System embodiment According to an embodiment of the present invention, a simulation system is provided for hardware device driver and/or business software development, and FIG. 9 is a structural block diagram of a simulation system according to an embodiment of the present invention, as shown in FIG. The system includes: a hardware interface abstraction module 92, a CPU interface abstraction module 94, which is described in detail below. The hardware interface abstraction module 92 is configured to provide a real access interface for the hardware device driver and/or the service software, where the access interface is used to encapsulate the hardware device driver and/or the hardware access operation of the service software into a system call command data packet; The CPU interface abstraction module 94 is connected to the chip simulation model, configured to receive the system call command data packet, generate a timing conforming to the chip simulation model, and perform the hardware access operation; the hardware interface abstraction module and the CPU interface abstraction module perform the message Interaction. As shown in FIG. 9, the system further includes a virtual bus for connecting the hardware interface abstraction module and the CPU interface abstraction module, and performing interaction between the hardware interface abstraction module and the CPU interface abstraction module. The virtual bus is specifically configured to connect the hardware interface abstraction module and the CPU interface abstraction module through a communication protocol, and encapsulate the data exchanged between the hardware interface abstraction module and the CPU interface abstraction module into a data packet in a format required by the communication protocol. In summary, through the above embodiments of the present invention, model-based driving and business software development can be realized, and the simulation and debugging of the chip function can be facilitated. Meanwhile, the developed hardware driver and business software can be seamlessly transplanted to the actual soft. In the hardware environment, parallel development is realized, and the project development progress is accelerated. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or they may be Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种仿真方法, 用于硬件设备驱动和 /或业务软件的开发, 其特征在于, 包括: A simulation method for hardware device driver and/or business software development, comprising:
设置硬件接口抽象模块, 为所述硬件设备驱动和 /或业务软件提供访 问接口, 所述访问接口用于将所述硬件设备驱动和 /或业务软件的硬件访 问操作封装成系统调用命令数据包;  Setting a hardware interface abstraction module, providing an access interface for the hardware device driver and/or service software, the access interface for packaging the hardware device driver and/or the hardware access operation of the service software into a system call command data packet;
设置中央处理器 CPU 接口抽象模块, 接收所述系统调用命令数据 包, 产生符合芯片仿真模型的时序, 进行所述硬件访问操作;  Setting a central processor CPU interface abstraction module, receiving the system call command data packet, generating a timing conforming to a chip simulation model, and performing the hardware access operation;
所述硬件接口抽象模块与 CPU接口抽象模块进行报文交互。  The hardware interface abstraction module interacts with the CPU interface abstraction module to perform packet exchange.
2. 根据权利要求 1所述的方法, 其特征在于, 所述硬件接口抽象模块与所 述 CPU接口抽象模块进行报文交互的步骤包括: The method according to claim 1, wherein the step of the hardware interface abstraction module interacting with the CPU interface abstraction module comprises:
所述硬件接口抽象模块与所述 CPU 接口抽象模块通过虚拟总线进 行 4艮文交互。  The hardware interface abstraction module interacts with the CPU interface abstraction module through a virtual bus.
3. 根据权利要求 2所述的方法, 其特征在于, 所述硬件接口抽象模块与所 述 CPU接口抽象模块通过虚拟总线进行报文交互的步骤包括: The method according to claim 2, wherein the step of the hardware interface abstraction module interacting with the CPU interface abstraction module through the virtual bus comprises:
将交互的报文数据封装成所述硬件接口抽象模块与所述 CPU 接口 抽象模块之间报文交互使用的通讯协议所要求的格式的数据包;  Encapsulating the exchanged message data into a data packet in a format required by a communication protocol used by the hardware interface abstraction module and the CPU interface abstraction module;
通过所述虚拟总线进行所述数据包交互。  The data packet interaction is performed through the virtual bus.
4. 根据权利要求 2所述的方法, 其特征在于, 所述硬件接口抽象模块与所 述 CPU接口抽象模块通过虚拟总线进行报文交互的步骤包括: The method according to claim 2, wherein the step of the hardware interface abstraction module interacting with the CPU interface abstraction module through the virtual bus comprises:
所述硬件接口抽象模块接收来自所述硬件设备驱动的读 /写命令, 并 根据以下至少之一产生所述读 /写命令的数据包: 所述读 /写命令的地址、 所述读 /写命令对应的数据的长度、 所述读 /写命令对应的数据的类型; 所述硬件接口抽象模块通过所述虚拟总线向所述 CPU 接口抽象模 块发送所述数据包。  The hardware interface abstraction module receives a read/write command from the hardware device driver, and generates a data packet of the read/write command according to at least one of: an address of the read/write command, the read/write The length of the data corresponding to the command, the type of the data corresponding to the read/write command; the hardware interface abstraction module sends the data packet to the CPU interface abstraction module through the virtual bus.
5. 根据权利要求 2所述的方法, 其特征在于, 所述硬件接口抽象模块与所 述 CPU接口抽象模块通过虚拟总线进行报文交互的步骤包括: 在所述硬件接口抽象模块接收来自所述硬件设备驱动的写命令时, 所述硬件接口抽象模块将所述写命令对应的待写的数据封装成数据包, 并通过所述虚拟总线发送给所述 CPU接口抽象模块。 The method according to claim 2, wherein the step of the hardware interface abstraction module and the CPU interface abstraction module performing packet exchange through the virtual bus comprises: When the hardware interface abstraction module receives a write command from the hardware device driver, the hardware interface abstraction module encapsulates the data to be written corresponding to the write command into a data packet, and sends the data to the server through the virtual bus. The CPU interface abstraction module.
6. 根据权利要求 2所述的方法, 其特征在于, 所述硬件接口抽象模块与所 述 CPU接口抽象模块通过虚拟总线进行报文交互的步骤包括: The method according to claim 2, wherein the step of the hardware interface abstraction module interacting with the CPU interface abstraction module through the virtual bus comprises:
所述硬件接口抽象模块通过所述虚拟总线获取来自所述 CPU 接口 抽象模块的消息, 其中,  The hardware interface abstraction module acquires a message from the CPU interface abstraction module through the virtual bus, where
当所述消息为读返回命令时, 则结束所述硬件设备驱动的读请求, 并返回所述读请求所对应的数据;  When the message is a read return command, the hardware device driver read request is ended, and the data corresponding to the read request is returned;
当所述命令为来自外部设备的读命令时, 则直接发起直接存储寄存 器访问 DMA读取操作, 在读取到所述读命令对应的数据后, 向所述外 部设备返回所述读取到的数据;  When the command is a read command from an external device, directly initiating a direct storage register access DMA read operation, and after reading the data corresponding to the read command, returning the read to the external device Data
当所述命令为来自所述外部设备的写命令时, 则直接发起 DMA写 操作, 将所述写命令对应的数据写入内存。  When the command is a write command from the external device, a DMA write operation is directly initiated, and data corresponding to the write command is written into the memory.
7. 居权利要求 3所述的方法, 其特征在于, 所述通讯协议包括传输控制 协议。 7. The method of claim 3, wherein the communication protocol comprises a transmission control protocol.
8. —种仿真系统, 用于硬件设备驱动和 /或业务软件的开发, 其特征在于, 包括: 8. A simulation system for the development of hardware device drivers and/or business software, characterized in that it comprises:
硬件接口抽象模块, 用于为所述硬件设备驱动和 /或业务软件提供访 问接口, 所述访问接口用于将所述硬件设备驱动和 /或业务软件的硬件访 问操作封装成系统调用命令数据包;  a hardware interface abstraction module, configured to provide an access interface for the hardware device driver and/or service software, where the access interface is used to encapsulate the hardware device driver and/or the hardware access operation of the service software into a system call command data packet. ;
CPU接口抽象模块, 与芯片仿真模型连接, 用于接收所述系统调用 命令数据包, 产生符合芯片仿真模型的时序, 进行所述硬件访问操作; 所述硬件接口抽象模块与 CPU接口抽象模块进行报文交互。  a CPU interface abstraction module, connected to the chip simulation model, configured to receive the system call command data packet, generate a timing conforming to a chip simulation model, and perform the hardware access operation; and the hardware interface abstraction module and the CPU interface abstraction module report Text interaction.
9. 根据权利要求 8所述的系统, 其特征在于, 还包括: 9. The system according to claim 8, further comprising:
虚拟总线,用于连接所述硬件接口抽象模块与所述 CPU接口抽象模 块,并在所述硬件接口抽象模块和所述 CPU接口抽象模块之间进行报文 交互。 根据权利要求 9所述的系统, 其特征在于, 所述虚拟总线具体用于通过 通讯协议连接所述硬件接口抽象模块与所述 CPU接口抽象模块,并将所 述硬件接口抽象模块和所述 CPU 接口抽象模块之间交互的数据封装成 所述通讯协议所要求的格式的数据包。 And a virtual bus, configured to connect the hardware interface abstraction module and the CPU interface abstraction module, and perform message interaction between the hardware interface abstraction module and the CPU interface abstraction module. The system according to claim 9, wherein the virtual bus is specifically configured to connect the hardware interface abstraction module and the CPU interface abstraction module by a communication protocol, and the hardware interface abstraction module and the CPU The data exchanged between the interface abstraction modules is encapsulated into data packets in the format required by the communication protocol.
PCT/CN2010/073117 2009-08-18 2010-05-24 Emulation method and system WO2011020353A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2009101661814A CN101630343B (en) 2009-08-18 2009-08-18 Simulation method and simulation system
CN200910166181.4 2009-08-18

Publications (1)

Publication Number Publication Date
WO2011020353A1 true WO2011020353A1 (en) 2011-02-24

Family

ID=41575448

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/073117 WO2011020353A1 (en) 2009-08-18 2010-05-24 Emulation method and system

Country Status (2)

Country Link
CN (1) CN101630343B (en)
WO (1) WO2011020353A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630343B (en) * 2009-08-18 2011-07-13 中兴通讯股份有限公司 Simulation method and simulation system
CN101944152B (en) * 2010-09-29 2012-07-04 中国电子科技集团公司第十四研究所 Simulation method of switch control chip
CN101950167B (en) * 2010-10-20 2012-05-30 广州数控设备有限公司 Simulated embedded type numerical control system based on Windows operating system and implementation method thereof
CN103093777B (en) * 2012-12-28 2015-12-23 Tcl康钛汽车信息服务(深圳)有限公司 A kind of method and system adopting android system control DVD equipment
CN108008945A (en) * 2017-12-13 2018-05-08 天津津航计算技术研究所 Device PCI drives development approach under a kind of LINUX system
CN109683877B (en) * 2018-12-11 2022-03-15 中国航空工业集团公司西安航空计算技术研究所 SystemC-based GPU software and hardware interaction TLM system
CN112861468B (en) * 2021-02-08 2022-12-06 山东云海国创云计算装备产业创新中心有限公司 Software and hardware collaborative simulation verification method, device and medium
CN114118356B (en) * 2021-10-11 2023-02-28 北京百度网讯科技有限公司 Neural network processor verification method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030088710A1 (en) * 2001-07-05 2003-05-08 Sukhwinder Sandhu Simulation environment software
CN1731337A (en) * 2005-08-23 2006-02-08 深圳市盈宁科技有限公司 Network simulated floppy disk driving method and simulated floppy disk driver
CN201222243Y (en) * 2007-12-24 2009-04-15 深圳市富怡时代科技有限公司 Artificial floppy disk drive
CN101630343A (en) * 2009-08-18 2010-01-20 中兴通讯股份有限公司 Simulation method and simulation system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100535868C (en) * 2005-12-28 2009-09-02 中国科学院微电子研究所 Real-time simulation development system and method therefor
CN101261600B (en) * 2007-03-06 2010-04-07 中兴通讯股份有限公司 Software test apparatus and test software design method
CN101499937A (en) * 2009-03-16 2009-08-05 盛科网络(苏州)有限公司 Software and hardware collaborative simulation verification system and method based on FPGA

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030088710A1 (en) * 2001-07-05 2003-05-08 Sukhwinder Sandhu Simulation environment software
CN1731337A (en) * 2005-08-23 2006-02-08 深圳市盈宁科技有限公司 Network simulated floppy disk driving method and simulated floppy disk driver
CN201222243Y (en) * 2007-12-24 2009-04-15 深圳市富怡时代科技有限公司 Artificial floppy disk drive
CN101630343A (en) * 2009-08-18 2010-01-20 中兴通讯股份有限公司 Simulation method and simulation system

Also Published As

Publication number Publication date
CN101630343B (en) 2011-07-13
CN101630343A (en) 2010-01-20

Similar Documents

Publication Publication Date Title
WO2011020353A1 (en) Emulation method and system
US10324873B2 (en) Hardware accelerated communications over a chip-to-chip interface
US20210294643A1 (en) Dynamic Reconfiguration of Applications on a Multi-Processor Embedded System
US9311437B2 (en) Modeling a bus for a system design incorporating one or more programmable processors
CN111745651B (en) Intelligent robot operating system structure and operating method thereof
CN110658751B (en) Implementation method of EtherCAT field bus control system
CN100464535C (en) Dynamic loading and control method for router virtual drive module
WO2021223744A1 (en) Method for realizing live migration, chip, board, and storage medium
CN108829530B (en) Image processing method and device
CN112764981B (en) Cooperative testing system and method
JP6965943B2 (en) Configuration management device, configuration management system, configuration management method, and configuration management program
CN115903569A (en) Full-digital comprehensive modular avionics system
CN102004667A (en) SOPC (system on programmable chip) software and hardware cooperative system based on Linux
CN115017845A (en) Bus driving type chip simulation excitation model for IP unit level verification
CN117407123B (en) USB equipment virtual sharing system based on multi-system isolation
JP2000298596A (en) Vlsi emulator using processor and resettable chip
CN114826938B (en) Method for realizing communication protocol simulation
CN110865960B (en) Emulating a PCIe bus over a network
CN116841731A (en) FPGA (field programmable Gate array) virtualized resource scheduling system and method
Beichler et al. Optimization of a novel WLAN Simulation Framework for Prototyping Network Applications and Protocols.
CN116521603A (en) Method for realizing MCTP protocol based on FPGA
Drivers Networking Solutions
Abdi et al. Hardware-dependent software synthesis for many-core embedded systems
US7843961B2 (en) Hardware device emulation
Gajski et al. Model based synthesis of embedded software

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10809486

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10809486

Country of ref document: EP

Kind code of ref document: A1