CN117910398A - Method for simulating logic system design, electronic device and storage medium - Google Patents
Method for simulating logic system design, electronic device and storage medium Download PDFInfo
- Publication number
- CN117910398A CN117910398A CN202410151321.5A CN202410151321A CN117910398A CN 117910398 A CN117910398 A CN 117910398A CN 202410151321 A CN202410151321 A CN 202410151321A CN 117910398 A CN117910398 A CN 117910398A
- Authority
- CN
- China
- Prior art keywords
- system design
- logic system
- configuration file
- hardware
- clock cycle
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/327—Logic synthesis; Behaviour synthesis, e.g. mapping logic, HDL to netlist, high-level language to RTL or netlist
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/333—Design for testability [DFT], e.g. scan chain or built-in self-test [BIST]
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)
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
本申请提供一种在硬件仿真工具上仿真逻辑系统设计的方法,包括:编译所述逻辑系统设计以分别生成第一配置文件和第二配置文件;根据所述第一配置文件配置所述硬件仿真工具的第一硬件资源以仿真所述逻辑系统设计;获取所述逻辑系统设计的仿真在第一时钟周期的第一快照;根据所述第二配置文件配置所述硬件仿真工具的第二硬件资源以调试所述逻辑系统设计;以及根据所述第一快照在所述第二硬件资源上还原所述逻辑系统设计到所述第一时钟周期。
The present application provides a method for simulating a logic system design on a hardware simulation tool, comprising: compiling the logic system design to generate a first configuration file and a second configuration file respectively; configuring a first hardware resource of the hardware simulation tool according to the first configuration file to simulate the logic system design; obtaining a first snapshot of the simulation of the logic system design in a first clock cycle; configuring a second hardware resource of the hardware simulation tool according to the second configuration file to debug the logic system design; and restoring the logic system design to the first clock cycle on the second hardware resource according to the first snapshot.
Description
技术领域Technical Field
本申请涉及芯片验证技术领域,尤其涉及一种仿真逻辑系统设计的方法、电子装置和存储介质。The present application relates to the field of chip verification technology, and in particular to a method, electronic device and storage medium for emulating logic system design.
背景技术Background technique
硬件仿真工具(例如,原型验证板或硬件仿真器(emulator))可以原型化(prototype)并且调试一个包括一个或多个模块的逻辑系统设计。所述逻辑系统设计可以是,例如,用于供专门应用的集成电路(ApplicationSpecificIntegratedCircuit,简称ASIC)或者片上系统芯片(System-On-Chip,简称SOC)的设计。因此,在仿真工具中被测试的逻辑系统设计又可以称为待测设计(DesignUnderTest,简称DUT)。仿真工具可以通过一个或多个可配置组件(例如,现场可编程逻辑门阵列(FieldProgrammableGateArray,简称FPGA))来仿真该待测设计,包括执行该待测设计的各种操作,从而在制造之前就测试并验证待测设计的各个模块的功能。通过在仿真工具上外接多种外设子卡还可以测试待测设计与各种外设作为一个完整系统进行运行的效果。A hardware simulation tool (e.g., a prototype verification board or a hardware emulator) can prototype and debug a logic system design including one or more modules. The logic system design can be, for example, a design for an integrated circuit (Application Specific Integrated Circuit, ASIC) or a system-on-chip (SOC) for a specific application. Therefore, the logic system design tested in the simulation tool can also be called a design under test (DUT). The simulation tool can simulate the design under test through one or more configurable components (e.g., a field programmable gate array (FPGA)), including executing various operations of the design under test, thereby testing and verifying the functions of each module of the design under test before manufacturing. By connecting a variety of peripheral daughter cards to the simulation tool, the effect of the design under test and various peripherals running as a complete system can also be tested.
硬件仿真工具可以包括,例如,原型验证板和硬件仿真器。通常,原型验证板侧重于电子系统的整体运行,强调运行速度,通常不具有调试能力。而硬件仿真器侧重于芯片设计本身的仿真,强调调试能力,但是运行速度慢。Hardware simulation tools may include, for example, prototype boards and hardware simulators. Typically, prototype boards focus on the overall operation of electronic systems, emphasize operation speed, and generally do not have debugging capabilities. Hardware simulators focus on the simulation of the chip design itself, emphasize debugging capabilities, but have slow operation speeds.
发明内容Summary of the invention
本申请的第一方面提供一种在硬件仿真工具上仿真逻辑系统设计的方法,包括:编译所述逻辑系统设计以分别生成第一配置文件和第二配置文件;根据所述第一配置文件配置所述硬件仿真工具的第一硬件资源以仿真所述逻辑系统设计;获取所述逻辑系统设计的仿真在第一时钟周期的第一快照;根据所述第二配置文件配置所述硬件仿真工具的第二硬件资源以调试所述逻辑系统设计;以及根据所述第一快照在所述第二硬件资源上还原所述逻辑系统设计到所述第一时钟周期。A first aspect of the present application provides a method for simulating a logic system design on a hardware simulation tool, comprising: compiling the logic system design to generate a first configuration file and a second configuration file respectively; configuring a first hardware resource of the hardware simulation tool according to the first configuration file to simulate the logic system design; obtaining a first snapshot of the simulation of the logic system design in a first clock cycle; configuring a second hardware resource of the hardware simulation tool according to the second configuration file to debug the logic system design; and restoring the logic system design to the first clock cycle on the second hardware resource according to the first snapshot.
本申请的第二方面提供一种电子装置,包括:存储器,用于存储一组指令;以及至少一个处理器,配置为执行所述一组指令以使得所述电子装置执行如第一方面所述的方法。A second aspect of the present application provides an electronic device, comprising: a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device executes the method described in the first aspect.
本申请的第三方面提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机的一组指令,该组指令用于在被执行时使所述计算机执行如第一方面所述的方法。A third aspect of the present application provides a non-transitory computer-readable storage medium, which stores a set of instructions for a computer, and when the set of instructions is executed, causes the computer to perform the method as described in the first aspect.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1示出了根据本申请实施例的示例性主机的结构示意图。FIG1 shows a schematic diagram of the structure of an exemplary host according to an embodiment of the present application.
图2示出了根据本申请实施例的仿真系统的示意图。FIG. 2 shows a schematic diagram of a simulation system according to an embodiment of the present application.
图3示出了根据本申请实施例的生成配置文件的过程的示意图。FIG. 3 is a schematic diagram showing a process of generating a configuration file according to an embodiment of the present application.
图4示出了根据本申请实施例的配置硬件仿真资源的示意图。FIG. 4 shows a schematic diagram of configuring hardware simulation resources according to an embodiment of the present application.
图5示出了根据本申请实施例的调试逻辑系统设计的过程的示意图。FIG. 5 is a schematic diagram showing a process of debugging a logic system design according to an embodiment of the present application.
图6示出了根据本申请实施例的调试逻辑系统设计的又一过程的示意图。FIG. 6 is a schematic diagram showing another process of designing a debugging logic system according to an embodiment of the present application.
图7示出了根据本申请实施例的一种在硬件仿真工具上仿真逻辑系统设计的方法的流程图。FIG. 7 shows a flow chart of a method for simulating a logic system design on a hardware simulation tool according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本申请进一步详细说明。In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
需要说明的是,除非另外定义,本申请使用的技术术语或者科学术语应当为本申请所属领域内具有一般技能的人士所理解的通常意义。本申请中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。It should be noted that, unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which this application belongs. The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
如上所述,原型验证版和硬件仿真器同属于硬件仿真工具。在硬件层面上具有相似性。但是在实际使用过程中,原型验证板可以以较高的运行速度持续地提供原型仿真,但是对于原型仿真过程中出现的错误,却无法记录和还原,更加无法进行调试。硬件仿真器可以利用触发等手段来记录和还原仿真错误,但是运行速度非常慢,并且硬件仿真器本身非常昂贵。As mentioned above, prototype verification boards and hardware emulators are both hardware simulation tools. They are similar at the hardware level. However, in actual use, prototype verification boards can continuously provide prototype simulation at a high running speed, but errors that occur during prototype simulation cannot be recorded and restored, let alone debugged. Hardware emulators can use triggers and other means to record and restore simulation errors, but the running speed is very slow, and the hardware emulator itself is very expensive.
针对上述问题,本申请的发明人试图提供一种同时具有原型验证能力和调试能力的硬件仿真工具。通常,原型验证和调试无法在一个硬件设备上同时进行。同时,原型验证功能需要的硬件资源较少,而调试功能需要的硬件资源较多。如果本申请提供的硬件仿真工具在两种模式下使用相同的硬件资源,会造成硬件资源的浪费,并大大降低原型验证模式的效率。因此,如何在支持原型验证能力和硬件仿真能力的同时尽可能保证硬件仿真工具的整体运行速度是一个亟待解决的技术问题。In view of the above problems, the inventor of the present application attempts to provide a hardware simulation tool with both prototype verification capability and debugging capability. Usually, prototype verification and debugging cannot be performed simultaneously on a hardware device. At the same time, the hardware resources required for the prototype verification function are relatively few, while the hardware resources required for the debugging function are relatively many. If the hardware simulation tool provided by the present application uses the same hardware resources in two modes, it will cause a waste of hardware resources and greatly reduce the efficiency of the prototype verification mode. Therefore, how to ensure the overall operating speed of the hardware simulation tool as much as possible while supporting the prototype verification capability and the hardware simulation capability is a technical problem to be solved urgently.
鉴于此,本申请实施例提供了一种在硬件仿真工具上仿真逻辑系统设计的方法,通过向硬件仿真工具的不同运行模式提供不同的硬件资源,有效提高了硬件仿真工具的整体效率。In view of this, an embodiment of the present application provides a method for simulating a logic system design on a hardware simulation tool, which effectively improves the overall efficiency of the hardware simulation tool by providing different hardware resources to different operating modes of the hardware simulation tool.
图1示出了根据本申请实施例的主机100的结构示意图。主机100可以是运行仿真系统的电子设备。如图1所示,主机100可以包括:处理器102、存储器104、网络接口106、外围接口108和总线110。其中,处理器102、存储器104、网络接口106和外围接口108通过总线110实现彼此之间在电子设备内部的通信连接。FIG. 1 shows a schematic diagram of the structure of a host 100 according to an embodiment of the present application. The host 100 may be an electronic device running a simulation system. As shown in FIG. 1 , the host 100 may include: a processor 102, a memory 104, a network interface 106, a peripheral interface 108, and a bus 110. The processor 102, the memory 104, the network interface 106, and the peripheral interface 108 are connected to each other in communication within the electronic device through the bus 110.
处理器102可以是中央处理器(Central Processing Unit,CPU)、图像处理器、神经网络处理器(NPU)、微控制器(MCU)、可编程逻辑器件、数字信号处理器(DSP)、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路。处理器102可以用于执行与本申请描述的技术相关的功能。在一些实施例中,处理器102还可以包括集成为单一逻辑组件的多个处理器。如图1所示,处理器102可以包括多个处理器102a、102b和102c。The processor 102 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. The processor 102 may be used to perform functions related to the technology described in this application. In some embodiments, the processor 102 may also include multiple processors integrated into a single logical component. As shown in FIG. 1 , the processor 102 may include multiple processors 102a, 102b, and 102c.
存储器104可以配置为存储数据(例如,指令集、计算机代码、中间数据等)。在一些实施例中,用于仿真测试设计的仿真测试系统可以是存储器104中存储的计算机程序。如图1所示,存储器存储的数据可以包括程序指令(例如,用于实现本申请的定位错误的方法的程序指令)以及要处理的数据(例如,存储器可以存储在编译过程产生的临时代码)。处理器102也可以访问存储器存储的程序指令和数据,并且执行程序指令以对要处理的数据进行操作。存储器104可以包括易失性存储装置或非易失性存储装置。在一些实施例中,存储器104可以包括随机访问存储器(RAM)、只读存储器(ROM)、光盘、磁盘、硬盘、固态硬盘(SSD)、闪存、存储棒等。The memory 104 may be configured to store data (e.g., instruction sets, computer codes, intermediate data, etc.). In some embodiments, the simulation test system for simulation test design may be a computer program stored in the memory 104. As shown in FIG. 1 , the data stored in the memory may include program instructions (e.g., program instructions for implementing the method for locating errors of the present application) and data to be processed (e.g., the memory may store temporary codes generated during the compilation process). The processor 102 may also access the program instructions and data stored in the memory, and execute the program instructions to operate on the data to be processed. The memory 104 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 104 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
网络接口106可以配置为经由网络向主机100提供与其他外部设备的通信。该网络可以是能够传输和接收数据的任何有线或无线的网络。例如,该网络可以是有线网络、本地无线网络(例如,蓝牙、WiFi、近场通信(NFC)等)、蜂窝网络、因特网、或上述的组合。可以理解的是,网络的类型不限于上述具体示例。在一些实施例中,网络接口106可以包括任意数量的网络接口控制器(NIC)、射频模块、接收发器、调制解调器、路由器、网关、适配器、蜂窝网络芯片等的任意组合。The network interface 106 can be configured to provide communication with other external devices to the host 100 via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network interface 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
外围接口108可以配置为将主机100与一个或多个外围装置连接,以实现信息输入及输出。例如,外围装置可以包括键盘、鼠标、触摸板、触摸屏、麦克风、各类传感器等输入设备以及显示器、扬声器、振动器、指示灯等输出设备。The peripheral interface 108 can be configured to connect the host 100 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
总线110可以被配置为在主机100的各个组件(例如处理器102、存储器104、网络接口106和外围接口108)之间传输信息,诸如内部总线(例如,处理器-存储器总线)、外部总线(USB端口、PCI-E总线)等。The bus 110 may be configured to transmit information between various components of the host 100 (e.g., the processor 102, the memory 104, the network interface 106, and the peripheral interface 108), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
需要说明的是,尽管上述电子设备架构仅示出了处理器102、存储器104、网络接口106、外围接口108和总线110,但是在具体实施过程中,该电子设备架构还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述电子设备架构中也可以仅包含实现本申请实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that, although the above electronic device architecture only shows the processor 102, the memory 104, the network interface 106, the peripheral interface 108 and the bus 110, in the specific implementation process, the electronic device architecture may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above electronic device architecture may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.
图2示出了根据本申请实施例的仿真系统200的示意图。FIG. 2 shows a schematic diagram of a simulation system 200 according to an embodiment of the present application.
如图2所示,仿真系统200可以包括仿真工具202以及与仿真工具202连接的主机100。As shown in FIG. 2 , the simulation system 200 may include a simulation tool 202 and a host 100 connected to the simulation tool 202 .
仿真工具202是一种用于仿真待测设计(DUT)的硬件系统。仿真工具202可以是原型验证板或者硬件仿真器(emulator)。一个待测设计可以包括多个模块。待测设计可以是组合逻辑电路、时序逻辑电路、或上述两者的组合。仿真工具202可以包括一个或多个可配置电路(例如,FPGA),用于仿真待测设计。可以理解的是,尽管在图2中,仿真工具202仅显示为一个块电路板,但是实际上仿真工具202可以包括多个电路板(例如,多个原型验证板或者双模验证板)。The simulation tool 202 is a hardware system for simulating a design under test (DUT). The simulation tool 202 may be a prototype verification board or a hardware simulator (emulator). A design under test may include multiple modules. The design under test may be a combinational logic circuit, a sequential logic circuit, or a combination of the two. The simulation tool 202 may include one or more configurable circuits (e.g., FPGA) for simulating the design under test. It is understood that, although in FIG. 2 , the simulation tool 202 is shown as only one circuit board, in fact, the simulation tool 202 may include multiple circuit boards (e.g., multiple prototype verification boards or dual-mode verification boards).
仿真工具202可以包括接口单元2022,用于与主机100通信地耦接,以进行主机100和仿真工具202之间的通信。在一些实施例中,接口单元2022可以包括具有电连接能力的一个或多个接口。例如,接口单元2022可以包括RS232接口、USB接口、LAN口、光纤接口、IEEE1394(火线接口)等。在一些实施例中,接口单元2022可以是无线网络接口。例如,接口单元2022可以是WIFI接口、蓝牙接口等。The simulation tool 202 may include an interface unit 2022 for communicatively coupling with the host 100 to perform communication between the host 100 and the simulation tool 202. In some embodiments, the interface unit 2022 may include one or more interfaces with electrical connection capability. For example, the interface unit 2022 may include an RS232 interface, a USB interface, a LAN port, an optical fiber interface, an IEEE1394 (FireWire interface), etc. In some embodiments, the interface unit 2022 may be a wireless network interface. For example, the interface unit 2022 may be a WIFI interface, a Bluetooth interface, etc.
主机100可以经由接口单元2022向仿真工具202传输编译后的DUT、调试指令等。仿真工具202也可以经由接口单元2022向主机100传输仿真数据等。The host 100 may transmit the compiled DUT, debugging instructions, etc. to the simulation tool 202 via the interface unit 2022. The simulation tool 202 may also transmit simulation data, etc. to the host 100 via the interface unit 2022.
仿真工具202还可以包括存储器2024,用于存储在仿真过程中待测设计产生的仿真数据(例如,各种信号值)。在一些实施例中,仿真过程中待测设计产生的信号值可以直接被主机100读取。可以理解的是,存储器2024也可以独立仿真工具202,例如,使用一种外接存储器。The simulation tool 202 may also include a memory 2024 for storing simulation data (e.g., various signal values) generated by the design under test during the simulation process. In some embodiments, the signal values generated by the design under test during the simulation process may be directly read by the host 100. It is understood that the memory 2024 may also be independent of the simulation tool 202, for example, using an external memory.
仿真工具202还可以包括FPGA 2026,用于将逻辑系统设计硬件地实现到FPGA上。可以理解的是,仿真工具202可以包括多个FPGA,图中仅为示例。The simulation tool 202 may also include an FPGA 2026 for implementing the logic system design in hardware on the FPGA. It is understandable that the simulation tool 202 may include multiple FPGAs, which are only examples in the figure.
除了连接到主机100,仿真工具202还可以经由接口单元2022连接到一个或多个子卡204。In addition to being connected to the host 100 , the emulation tool 202 may also be connected to one or more daughter cards 204 via an interface unit 2022 .
子卡用于在使用仿真工具202进行原型验证时向DUT提供外设以构成完整的电子系统。原型验证是指在芯片流片之前,尽可能的还原芯片真实使用场景,验证芯片功能是否准确和完整的一种验证方式。子卡204可以包括存储器子卡(例如,提供DDR内存接口)、通信子卡(例如,提供多种网络接口或无线网卡接口)等。The daughter card is used to provide peripherals to the DUT to form a complete electronic system when using the simulation tool 202 for prototype verification. Prototype verification refers to a verification method that restores the actual use scenario of the chip as much as possible before the chip is taped out to verify whether the chip function is accurate and complete. The daughter card 204 can include a memory daughter card (for example, providing a DDR memory interface), a communication daughter card (for example, providing a variety of network interfaces or a wireless network card interface), etc.
主机100可以用于配置仿真工具202以仿真一个待测设计。该待测设计可以是一个完整的逻辑系统设计或一个完整逻辑系统设计的一个或多个模块。在一些实施例中,主机100可以是云计算系统中的一个虚拟主机。逻辑系统设计(例如,ASIC或者System-On-Chip)可以由硬件描述语言(例如Verilog、VHDL、System C、或System Verilog)设计。主机100配置仿真工具202可以包括配置仿真环境(例如,多个仿真工具202之间的连接关系或者仿真工具与子卡的连接关系)等。The host 100 can be used to configure the simulation tool 202 to simulate a design to be tested. The design to be tested can be a complete logic system design or one or more modules of a complete logic system design. In some embodiments, the host 100 can be a virtual host in a cloud computing system. The logic system design (e.g., ASIC or System-On-Chip) can be designed by a hardware description language (e.g., Verilog, VHDL, System C, or System Verilog). The host 100 configuration simulation tool 202 may include configuring the simulation environment (e.g., the connection relationship between multiple simulation tools 202 or the connection relationship between the simulation tool and the daughter card), etc.
主机100可以将以源代码形式的逻辑系统设计编译为可执行文件。从设计的角度看,逻辑系统设计可以包括待测设计和与待测设计对应的测试台(Testbench)。此时,编译可以涵盖从源代码到可执行文件(例如,位文件)的整个过程。The host 100 may compile the logic system design in the form of source code into an executable file. From a design perspective, the logic system design may include a design to be tested and a test bench (Testbench) corresponding to the design to be tested. At this time, the compilation may cover the entire process from source code to an executable file (e.g., a bit file).
从综合的角度看,逻辑系统设计可以包括可综合部分和不可综合部分。可综合部分通常与实际的物理设计(例如,芯片)对应,而不可综合部分通常包括初始化模块、测试台等。不可综合部分在经过编译后形成的可执行文件通常可以由主机100运行。可综合部分在经过编译后还需要进行综合,以形成位文件。位文件可以用于将FPGA 2026配置为根据可综合部分的设计要求运行。From the perspective of synthesis, the logical system design may include a synthesizable part and a non-synthesizable part. The synthesizable part usually corresponds to the actual physical design (e.g., a chip), while the non-synthesizable part usually includes an initialization module, a test bench, etc. The executable file formed by the non-synthesizable part after compilation can usually be run by the host 100. The synthesizable part also needs to be synthesized after compilation to form a bit file. The bit file can be used to configure the FPGA 2026 to run according to the design requirements of the synthesizable part.
主机100还可以从用户接收调试待测设计的请求。如上所述,待测设计可以包括一个或多个模块。待测设计的描述可以用硬件描述语言来完成。主机100可以基于待测设计的描述来进行综合,以生成,例如,待测设计的门级电路网表(未示出)。待测设计的该门级电路网表可以被载入仿真工具202中运行,进而可以在仿真工具202中形成与待测设计相对应的电路结构。因此,待测设计的电路结构可以根据该描述而获得,并且相应地,待测设计中的每个块的电路结构也可以类似地获得。The host 100 may also receive a request from a user to debug the design to be tested. As described above, the design to be tested may include one or more modules. The description of the design to be tested may be completed in a hardware description language. The host 100 may perform synthesis based on the description of the design to be tested to generate, for example, a gate-level circuit netlist (not shown) of the design to be tested. The gate-level circuit netlist of the design to be tested may be loaded into the simulation tool 202 for operation, and then a circuit structure corresponding to the design to be tested may be formed in the simulation tool 202. Therefore, the circuit structure of the design to be tested may be obtained according to the description, and accordingly, the circuit structure of each block in the design to be tested may also be obtained similarly.
图3示出了根据本申请实施例的生成配置文件的过程的示意图。FIG. 3 is a schematic diagram showing a process of generating a configuration file according to an embodiment of the present application.
如图3所述,主机100可以将逻辑系统设计302(以下也简称为设计302)编译为配置文件,以配置仿真工具202上的硬件仿真资源。仿真工具202可以是芯华章股份有限公司出品的HuaPro P2E仿真工具。可以理解,在一些实施例中,仿真工具202的硬件仿真资源可以包括一个或多个FPGA,而每个FPGA可以仅模拟逻辑系统设计的至少一部分(例如,一个或多个模块)。仿真工具202可以实现原型验证功能和调试功能。As shown in FIG. 3 , the host 100 may compile a logic system design 302 (hereinafter also referred to as design 302) into a configuration file to configure hardware simulation resources on the simulation tool 202. The simulation tool 202 may be a HuaPro P2E simulation tool produced by Xinhuazhang Co., Ltd. It is understood that in some embodiments, the hardware simulation resources of the simulation tool 202 may include one or more FPGAs, and each FPGA may only simulate at least a portion of the logic system design (e.g., one or more modules). The simulation tool 202 may implement prototype verification functions and debugging functions.
对于同一个逻辑系统设计302,由于环境变量的不同以及是否具有调试功能,配置文件可以包括分别编译生成的配置文件304和配置文件306。在一些实施例中,配置文件304和306可以是位文件(bit file)类型的二进制文件。通常,一个FPGA可以对应一份位文件,也就是说,配置文件304或306可以包括一个或多个位文件。For the same logic system design 302, due to the difference in environment variables and whether there is a debugging function, the configuration file may include a configuration file 304 and a configuration file 306 that are compiled and generated respectively. In some embodiments, the configuration files 304 and 306 may be binary files of the bit file type. Generally, one FPGA may correspond to one bit file, that is, the configuration file 304 or 306 may include one or more bit files.
配置文件304和原型验证功能相对应,配置文件306和调试功能相对应。Configuration file 304 corresponds to the prototype verification function, and configuration file 306 corresponds to the debugging function.
原型验证功能通常可以指代不具有调试能力的仿真功能。例如,用户可以将逻辑系统设计(例如,芯片设计)实现到硬件仿真工具202的可编程逻辑器件(例如,FPGA 2026)上,并且将一个或多个子卡(提供不同的外设功能)连接到硬件仿真工具202,从而实现了一整个电子系统的原型。在此基础上,通过不断向该电子系统的原型提供测试用例(例如,提供激励)来完成该逻辑系统设计在电子系统的原型下的各项功能的仿真。在仿真过程中,逻辑系统设计在多个时钟周期(clock cycle)的值可以被保存。例如,可以保存逻辑系统设计的关键信号在多个时钟周期的值。逻辑系统设计的关键信号是指可以足以还原逻辑系统设计在目标时钟周期的一部分信号。关键信号通常可以包括逻辑系统设计的主要输入和寄存器的至少部分输出。根据关键信号的值以及逻辑系统设计的描述,可以计算出逻辑系统设计的每个信号的值,因此可以相应地还原逻辑系统设计到给定的目标时钟周期。例如,对于C=A and B的逻辑系统设计,A和B是关键信号,一旦获取了A和B的值,那么C的值可以直接根据逻辑系统设计的描述(即,C=A and B)来计算。The prototype verification function may generally refer to a simulation function without debugging capability. For example, a user may implement a logic system design (e.g., a chip design) on a programmable logic device (e.g., FPGA 2026) of a hardware simulation tool 202, and connect one or more daughter cards (providing different peripheral functions) to the hardware simulation tool 202, thereby realizing a prototype of an entire electronic system. On this basis, the simulation of various functions of the logic system design under the prototype of the electronic system is completed by continuously providing test cases (e.g., providing stimuli) to the prototype of the electronic system. During the simulation process, the values of the logic system design in multiple clock cycles may be saved. For example, the values of the key signals of the logic system design in multiple clock cycles may be saved. The key signals of the logic system design refer to a portion of the signals that can be sufficient to restore the logic system design in the target clock cycle. The key signals may generally include the main inputs of the logic system design and at least a portion of the outputs of the registers. According to the values of the key signals and the description of the logic system design, the values of each signal of the logic system design may be calculated, and thus the logic system design may be restored to a given target clock cycle accordingly. For example, for a logic system design of C=A and B, A and B are key signals. Once the values of A and B are obtained, the value of C can be directly calculated based on the description of the logic system design (ie, C=A and B).
但是,原型验证功能通常无法根据用户的意愿在特定的时钟周期停止或者回退到给定的时钟周期,也无法查看给定的信号在给定的时钟周期范围内的波形等。However, the prototype verification function usually cannot stop at a specific clock cycle or roll back to a given clock cycle according to the user's wishes, nor can it view the waveform of a given signal within a given clock cycle range.
与原型验证功能相对,调试功能可以根据用户的意愿在特定的时钟周期停止逻辑系统设计的仿真或者回退到给定的时钟周期,也可以查看给定的信号在给定的时钟周期范围内的波形等,从而允许用户找到逻辑系统设计的错误的根本原因。Compared with the prototype verification function, the debugging function can stop the simulation of the logic system design at a specific clock cycle or roll back to a given clock cycle according to the user's wishes, or view the waveform of a given signal within a given clock cycle range, etc., thereby allowing the user to find the root cause of the error in the logic system design.
调试功能的实现往往依赖于仿真数据。也就是说,用户需要首先对逻辑系统设计完成一次仿真,并且获得仿真数据(例如,逻辑系统设计的关键信号在多个给定时钟周期的值),从而在调试过程中依赖这些仿真数据去进行调试功能。The implementation of debugging functions often relies on simulation data. That is, the user needs to first complete a simulation of the logic system design and obtain simulation data (for example, the values of key signals of the logic system design in multiple given clock cycles), and then rely on these simulation data to perform debugging functions during the debugging process.
用户可以通过在编译和综合逻辑系统设计的时候选择原型验证功能或调试功能来将特定功能(原型验证功能或调试功能)体现在配置文件中。The user can reflect a specific function (prototype verification function or debug function) in the configuration file by selecting the prototype verification function or the debug function when compiling and synthesizing the logic system design.
与原型验证功能对应,配置文件304通常仅需要在FPGA 2026上配置生成逻辑系统设计并配置物理针脚的连接关系就可以了。Corresponding to the prototype verification function, the configuration file 304 usually only needs to configure the generated logic system design on the FPGA 2026 and configure the connection relationship of the physical pins.
相对的,配置文件306中还可以包括对调试功能进行配置的信息。在一些实施例中,在仿真工具202实现调试功能的过程中,用户需要观察和记录一个或多个关键信号在逻辑系统设计的仿真过程中的值。这些关键信号的值可以经由在配置文件306中指定的一个或多个针脚引出到接口2022并传输到主机100。因此,相比于配置文件304,配置文件306需要额外在FPGA 2026上配置这些用于读取关键信号的值的针脚以及这些针脚到接口2022的连接。此外,在一些实施例中,配置文件306还需要在FPGA 2026上配置生成一个小型CPU用于处理触发等调试功能。In contrast, the configuration file 306 may also include information for configuring the debugging function. In some embodiments, during the process of implementing the debugging function by the simulation tool 202, the user needs to observe and record the values of one or more key signals during the simulation process of the logic system design. The values of these key signals can be led to the interface 2022 via one or more pins specified in the configuration file 306 and transmitted to the host 100. Therefore, compared with the configuration file 304, the configuration file 306 needs to additionally configure the pins for reading the values of the key signals and the connection of these pins to the interface 2022 on the FPGA 2026. In addition, in some embodiments, the configuration file 306 also needs to configure and generate a small CPU on the FPGA 2026 for processing debugging functions such as triggering.
可以理解的是,配置文件306中可以包括更多的调试功能,而不限于以上示例。It is understandable that the configuration file 306 may include more debugging functions and is not limited to the above examples.
由此可见,相比于配置文件304,配置文件306需要在FPGA 2026上配置出更多的功能和模块,这会导致经由配置文件306配置的硬件仿真工具的运行速度显著低于经由配置文件304配置的硬件仿真工具。It can be seen that compared with configuration file 304, configuration file 306 needs to configure more functions and modules on FPGA 2026, which will cause the running speed of the hardware simulation tool configured via configuration file 306 to be significantly lower than that of the hardware simulation tool configured via configuration file 304.
对于通常的专注于调试功能的硬件仿真器(emulator),由于调试功能的拖累,其运行逻辑系统设计的速度是较慢的(例如,几百kHz或者1MHz左右)。而专注于原型验证功能的原型验证板尽管可以运行在较快的速度(例如,高达10MHz),但是原型验证板无法支持调试功能。For common hardware emulators that focus on debugging, the speed of running logic system design is relatively slow (for example, several hundred kHz or about 1MHz) due to the drag of debugging functions. Although the prototype verification board that focuses on prototyping functions can run at a faster speed (for example, up to 10MHz), the prototype verification board cannot support debugging functions.
如何在一个硬件仿真工具上同时支持原型验证功能和调试功能并且提高仿真逻辑系统设计的运行频率是一个亟待解决的技术问题。How to support both prototype verification and debugging functions on a hardware simulation tool and improve the operating frequency of simulation logic system design is a technical problem that needs to be solved urgently.
图4示出了根据本申请实施例的配置硬件仿真资源的示意图。FIG. 4 shows a schematic diagram of configuring hardware simulation resources according to an embodiment of the present application.
仿真工具202通常具有足够的硬件资源以完成原型验证功能或者调试功能。硬件资源通常可以包括一个或多个可编程逻辑器件(例如,FPGA)、可配置的接口或一个或多个子卡的至少一个。硬件资源的资源量可以用可编程逻辑器件的数量(例如,等效门电路的数量)、可配置的接口的数量以及子卡的数量来衡量。The simulation tool 202 usually has enough hardware resources to complete the prototype verification function or the debugging function. The hardware resources usually include at least one of one or more programmable logic devices (e.g., FPGA), configurable interfaces, or one or more daughter cards. The amount of hardware resources can be measured by the number of programmable logic devices (e.g., the number of equivalent gate circuits), the number of configurable interfaces, and the number of daughter cards.
当仿真工具202对设计302进行原型验证时,主机100可以调用配置文件304以配置硬件仿真资源410。如图4所示,硬件仿真资源410可以包括一个或多个可编程逻辑器件(例如,FPGA 401-404)。当仿真工具对设计302进行调试时,主机100可以调用配置文件306以配置硬件仿真资源420。如图4所示,硬件仿真资源420可以包括一个或多个可编程逻辑器件(例如,FPGA 401-408)。When the simulation tool 202 performs prototype verification on the design 302, the host 100 can call the configuration file 304 to configure the hardware simulation resource 410. As shown in FIG4, the hardware simulation resource 410 may include one or more programmable logic devices (e.g., FPGA 401-404). When the simulation tool performs debugging on the design 302, the host 100 can call the configuration file 306 to configure the hardware simulation resource 420. As shown in FIG4, the hardware simulation resource 420 may include one or more programmable logic devices (e.g., FPGA 401-408).
在一些实施例中,硬件仿真资源还可以包括连接到仿真工具202上的硬件设备,例如,外设子卡。In some embodiments, the hardware simulation resources may also include hardware devices connected to the simulation tool 202, such as peripheral daughter cards.
通常,由于调试功能需要处理和保存更多的信号,硬件仿真资源420的资源量会大于或等于硬件仿真资源410的资源量。Generally, since the debugging function needs to process and save more signals, the resource amount of the hardware emulation resource 420 is greater than or equal to the resource amount of the hardware emulation resource 410 .
图5示出了根据本申请实施例的调试逻辑系统设计302的过程500的示意图。FIG. 5 is a schematic diagram showing a process 500 of debugging a logic system design 302 according to an embodiment of the present application.
在原型验证逻辑系统设计302时,主机100可以在特定的时钟周期设置还原点。还原点可以包括给定时钟周期或者出错的时钟周期。在一些实施例中,用户可以设定某些时钟周期为还原点。在另一些实施例中,主机100可以保存在原型验证过程中出现报错信息的时钟周期为还原点。还原点包括了需要仿真工具202进行后续调试的仿真时钟周期。本申请中未示出还原点的示例。以下叙述假定在同一个还原点a,即,时钟周期a。When prototyping the logic system design 302, the host 100 can set a restore point at a specific clock cycle. The restore point can include a given clock cycle or an erroneous clock cycle. In some embodiments, the user can set certain clock cycles as restore points. In other embodiments, the host 100 can save the clock cycle in which the error message appears during the prototype verification process as a restore point. The restore point includes the simulation clock cycle that requires the simulation tool 202 to perform subsequent debugging. Examples of restore points are not shown in this application. The following description assumes the same restore point a, that is, clock cycle a.
如图5所示,设计302可以包括多个模块,例如,模块A。其中,模块A的输出端口的信号502可以是逻辑系统设计302的关键信号。As shown in FIG. 5 , the design 302 may include multiple modules, for example, module A. A signal 502 at an output port of module A may be a key signal of the logic system design 302 .
如图5所示,当仿真工具202对逻辑系统设计302进行原型验证时,主机100可以调用配置文件302以配置硬件仿真资源410。在时钟周期a,仿真工具202和主机100可以获取硬件仿真资源410上与关键信号对应的第一物理信号(例如,物理信号501)在时钟周期a的信号值。根据配置文件304和逻辑系统设计302,主机100可以确定从设计302到硬件仿真资源410的第一映射510。第一映射510至少包括设计302的关键信号502到FPGA 401的的物理信号501的映射关系。主机100可以将物理信号501在时钟周期a的值保存到快照(snapshot)(未示出)。快照通常是一种数据库(例如,波形数据库)。在本申请的实施例中,快照可以包括在还原点(即,时钟周期)的硬件仿真资源410中与关键信号对应的物理信号的信号值。在另一些实施例中,快照也可以包括在还原点(即,时钟周期)的逻辑系统设计的关键信号的信号值。As shown in FIG5 , when the simulation tool 202 performs prototype verification on the logic system design 302, the host 100 may call the configuration file 302 to configure the hardware simulation resource 410. In clock cycle a, the simulation tool 202 and the host 100 may obtain the signal value of the first physical signal (e.g., physical signal 501) corresponding to the critical signal on the hardware simulation resource 410 in clock cycle a. According to the configuration file 304 and the logic system design 302, the host 100 may determine the first mapping 510 from the design 302 to the hardware simulation resource 410. The first mapping 510 includes at least a mapping relationship between the critical signal 502 of the design 302 and the physical signal 501 of the FPGA 401. The host 100 may save the value of the physical signal 501 in clock cycle a to a snapshot (not shown). The snapshot is generally a database (e.g., a waveform database). In an embodiment of the present application, the snapshot may include the signal value of the physical signal corresponding to the critical signal in the hardware simulation resource 410 at the restore point (i.e., clock cycle). In other embodiments, the snapshot may also include signal values of key signals of the logic system design at the restore point (ie, clock cycle).
根据第一物理信号的信号值以及逻辑系统设计的描述(例如,配置文件或网表等),主机100可以确定逻辑系统设计的关键信号的信号值。例如,主机100可以根据逻辑系统设计302和配置文件304确定逻辑系统设计的关键信号502和物理信号501之间的第一映射510;并且根据快照(未示出)和第一映射510确定与硬件资源410的物理信号501对应的逻辑系统设计的关键信号502在时钟周期a的值。According to the signal value of the first physical signal and the description of the logic system design (e.g., configuration file or netlist, etc.), the host 100 can determine the signal value of the key signal of the logic system design. For example, the host 100 can determine the first mapping 510 between the key signal 502 of the logic system design and the physical signal 501 according to the logic system design 302 and the configuration file 304; and determine the value of the key signal 502 of the logic system design corresponding to the physical signal 501 of the hardware resource 410 in clock cycle a according to the snapshot (not shown) and the first mapping 510.
在一些实施例中,如图5所示,第一映射510可以包括关键信号502到物理信号501的映射关系。仿真工具202和主机100将在还原点a(即,给定时钟周期a)的物理信号501的信号值保存到快照(未示出)中。根据第一映射510和快照(未示出),主机100可以确定与物理信号501对应的设计302中关键信号502在还原点a(即,时钟周期a)的信号值。可以理解,快照(未示出)也可以包括关键信号502在在还原点a(即,时钟周期a)的信号值。In some embodiments, as shown in FIG5 , the first mapping 510 may include a mapping relationship between the critical signal 502 and the physical signal 501. The simulation tool 202 and the host 100 save the signal value of the physical signal 501 at the restore point a (i.e., a given clock cycle a) to a snapshot (not shown). Based on the first mapping 510 and the snapshot (not shown), the host 100 may determine the signal value of the critical signal 502 at the restore point a (i.e., clock cycle a) in the design 302 corresponding to the physical signal 501. It is understood that the snapshot (not shown) may also include the signal value of the critical signal 502 at the restore point a (i.e., clock cycle a).
当仿真工具202开始对逻辑系统设计302进行调试时,主机100可以调用配置文件306,以重新配置硬件仿真资源420。根据配置文件306和逻辑系统设计302,主机100可以确定从设计302到硬件仿真资源420的第二映射520。第二映射520至少包括设计302的关键信号502到FPGA 403的的物理信号503的映射关系。When the simulation tool 202 starts to debug the logical system design 302, the host 100 can call the configuration file 306 to reconfigure the hardware simulation resources 420. According to the configuration file 306 and the logical system design 302, the host 100 can determine the second mapping 520 from the design 302 to the hardware simulation resources 420. The second mapping 520 includes at least a mapping relationship between the key signal 502 of the design 302 and the physical signal 503 of the FPGA 403.
在上述实施例中,如图5所示,根据关键信号502在时钟周期a的值和第二映射520,主机100可以确定硬件仿真资源420的物理信号503在时钟周期a的信号值。更具体地,根据第二映射520,主机100可以通过设计302的关键信号502在时钟周期a的信号值,得到硬件仿真工具420上的FPGA 403的物理信号503在时钟周期a的信号值。这样,主机100可以使用物理信号503在时钟周期a的信号值初始化该物理信号503,从而使得硬件仿真资源420上的逻辑系统设计302被还原到时钟周期a。In the above embodiment, as shown in FIG5 , according to the value of the key signal 502 at clock cycle a and the second mapping 520, the host 100 can determine the signal value of the physical signal 503 of the hardware simulation resource 420 at clock cycle a. More specifically, according to the second mapping 520, the host 100 can obtain the signal value of the physical signal 503 of the FPGA 403 on the hardware simulation tool 420 at clock cycle a by using the signal value of the key signal 502 of the design 302 at clock cycle a. In this way, the host 100 can use the signal value of the physical signal 503 at clock cycle a to initialize the physical signal 503, so that the logical system design 302 on the hardware simulation resource 420 is restored to clock cycle a.
综上,本申请实施例为硬件仿真工具的原型验证功能和调试功能分别提供不同的配置文件以配置不同的硬件资源,加快了硬件仿真工具的原型验证的速度,同时保留了硬件仿真工具的调试能力,从而提升了硬件仿真工具仿真逻辑系统设计的运行效率。In summary, the embodiments of the present application provide different configuration files for the prototype verification function and debugging function of the hardware simulation tool to configure different hardware resources, thereby speeding up the prototype verification of the hardware simulation tool while retaining the debugging capability of the hardware simulation tool, thereby improving the operating efficiency of the hardware simulation tool in simulating the logic system design.
图6示出了根据本申请实施例的调试逻辑系统设计302的又一过程600的示意图。FIG. 6 is a schematic diagram showing another process 600 of debugging the logic system design 302 according to an embodiment of the present application.
在一些实施例中,如图6所示,仿真工具202可以在硬件仿真资源410上对逻辑系统设计302进行原型验证。硬件仿真资源410的配置文件在图6未示出。逻辑系统设计302到硬件仿真资源410的映射612可以包括了关键信号603到FPGA 401的物理信号601的映射关系和关键信号604到FPGA 404的物理信号602的映射关系。根据映射612以及物理信号601和物理信号602在时钟周期a的信号值,主机100可以确定关键信号603和关键信号604在时钟周期a的信号值。In some embodiments, as shown in FIG6 , the simulation tool 202 can perform prototype verification on the logic system design 302 on the hardware simulation resource 410. The configuration file of the hardware simulation resource 410 is not shown in FIG6 . The mapping 612 of the logic system design 302 to the hardware simulation resource 410 may include a mapping relationship of the key signal 603 to the physical signal 601 of the FPGA 401 and a mapping relationship of the key signal 604 to the physical signal 602 of the FPGA 404. According to the mapping 612 and the signal values of the physical signal 601 and the physical signal 602 in the clock cycle a, the host 100 can determine the signal values of the key signal 603 and the key signal 604 in the clock cycle a.
在一些实施例中,原有用于原型验证逻辑系统设计302的仿真工具202的资源量不足以实现具有调试功能的逻辑系统设计302。此时,主机100可以将逻辑系统设计302分割为多个部分,选择调试功能并且编译逻辑系统设计302的一部分以生成新的配置文件,从而在仿真工具202上完成对该部分的调试。主机100可以确定仿真工具202的资源量不满足调试功能的需要,并且如图6所示,分割逻辑系统设计302为子设计312和子设计322。子设计312的模块B的输出信号例如是一个关键信号602,子设计322的模块C的输出信号例如是一个关键信号604。主机100可以将子设计312实现在硬件仿真资源620上并进行调试,以及将子设计322实现在硬件仿真资源630上并进行调试。这样,就产生了从子设计312到硬件仿真资源620上的实际电路的映射622以及从子设计322到硬件仿真资源630上的实际电路的映射632。在一些实施例中,映射622可以包括关键信号603到FPGA 641的物理信号605的映射关系;映射632可以包括关键信号604到FPGA 651的物理信号606的映射关系。In some embodiments, the amount of resources of the simulation tool 202 originally used for prototyping the logic system design 302 is insufficient to implement the logic system design 302 with the debugging function. At this time, the host 100 can divide the logic system design 302 into multiple parts, select the debugging function and compile a part of the logic system design 302 to generate a new configuration file, so as to complete the debugging of the part on the simulation tool 202. The host 100 can determine that the amount of resources of the simulation tool 202 does not meet the needs of the debugging function, and as shown in FIG6, divide the logic system design 302 into a sub-design 312 and a sub-design 322. The output signal of the module B of the sub-design 312 is, for example, a key signal 602, and the output signal of the module C of the sub-design 322 is, for example, a key signal 604. The host 100 can implement the sub-design 312 on the hardware simulation resource 620 and debug it, and implement the sub-design 322 on the hardware simulation resource 630 and debug it. In this way, a mapping 622 from sub-design 312 to the actual circuit on hardware simulation resource 620 and a mapping 632 from sub-design 322 to the actual circuit on hardware simulation resource 630 are generated. In some embodiments, mapping 622 may include a mapping relationship between key signal 603 and physical signal 605 of FPGA 641; mapping 632 may include a mapping relationship between key signal 604 and physical signal 606 of FPGA 651.
根据映射622和关键信号603在时钟周期a的信号值,主机100可以得到物理信号605在时钟周期a的信号值,以对物理信号605进行初始化,并最终将逻辑系统设计302的一部分(即,子设计312)初始化到时钟周期a。类似地,根据映射632和关键信号604在时钟周期a的信号值,主机100可以得到物理信号606在时钟周期a的信号值,以对物理信号606进行初始化,并最终将逻辑系统设计302的另一部分(即,子设计322)初始化到时钟周期a。According to the mapping 622 and the signal value of the key signal 603 at the clock cycle a, the host 100 can obtain the signal value of the physical signal 605 at the clock cycle a to initialize the physical signal 605, and finally initialize a part of the logic system design 302 (i.e., the sub-design 312) to the clock cycle a. Similarly, according to the mapping 632 and the signal value of the key signal 604 at the clock cycle a, the host 100 can obtain the signal value of the physical signal 606 at the clock cycle a to initialize the physical signal 606, and finally initialize another part of the logic system design 302 (i.e., the sub-design 322) to the clock cycle a.
这样,通过在调试阶段对逻辑系统设计进行分割,不仅仅解决了仿真工具的硬件资源不足的问题,还可以将复杂的逻辑系统设计的验证任务分割为多个子任务并且在规格较低的硬件工具上进行调试。同时,由于装载大量FPGA的硬件仿真工具的成本较高,本申请实施例通过在规格较低的硬件工具上进行调试降低了对高性能硬件工具的需求,降低了用户的成本。In this way, by segmenting the logic system design during the debugging phase, not only the problem of insufficient hardware resources of the simulation tool is solved, but also the verification task of the complex logic system design can be segmented into multiple subtasks and debugged on hardware tools with lower specifications. At the same time, since the cost of hardware simulation tools loaded with a large number of FPGAs is high, the embodiments of the present application reduce the demand for high-performance hardware tools by debugging on hardware tools with lower specifications, thereby reducing the cost for users.
综上,本申请通过对硬件仿真工具的原型验证功能和调试功能分别提供不同的配置文件以配置不同的硬件资源,加快了硬件仿真工具的原型验证的速度,同时保留了硬件仿真工具的调试能力,从而提升了硬件仿真工具仿真逻辑系统设计的运行效率。本申请还通过对逻辑系统设计进行分割后再验证或调试,解决了仿真工具可能存在的硬件资源不足的问题,还将复杂繁多的验证任务简单化,减轻了仿真工具的仿真任务,加快了仿真系统的效率。同时,由于装载大量FPGA的硬件仿真工具的开发成本较高,将逻辑系统设计进行分割后分别使用资源量较小的硬件仿真工具进行仿真,还大大解决了仿真成本。In summary, this application provides different configuration files for the prototype verification function and debugging function of the hardware simulation tool to configure different hardware resources, thereby speeding up the prototype verification of the hardware simulation tool, while retaining the debugging ability of the hardware simulation tool, thereby improving the operating efficiency of the hardware simulation tool in simulating the logic system design. This application also solves the problem of insufficient hardware resources that may exist in the simulation tool by segmenting the logic system design and then verifying or debugging it, and also simplifies the complex and numerous verification tasks, reduces the simulation tasks of the simulation tool, and speeds up the efficiency of the simulation system. At the same time, since the development cost of hardware simulation tools loaded with a large number of FPGAs is high, the simulation cost is greatly solved by segmenting the logic system design and then using hardware simulation tools with smaller resources for simulation.
本申请实施例还提供了一种在硬件仿真工具上仿真逻辑系统设计的方法。The embodiment of the present application also provides a method for simulating a logic system design on a hardware simulation tool.
图7示出了根据本申请实施例的一种在硬件仿真工具上仿真逻辑系统设计的方法700的流程图,其中,方法700可以由如图2所示的主机100执行。方法700可以包括如下步骤。Fig. 7 shows a flow chart of a method 700 for simulating a logic system design on a hardware simulation tool according to an embodiment of the present application, wherein the method 700 may be executed by the host 100 shown in Fig. 2. The method 700 may include the following steps.
在步骤701,主机100可以编译所述逻辑系统设计(例如,图3中的逻辑系统设计302)以分别生成第一配置文件(例如,图3中的配置文件304)和第二配置文件(例如,图3中的配置文件306)。In step 701 , the host 100 may compile the logic system design (eg, the logic system design 302 in FIG. 3 ) to generate a first configuration file (eg, the configuration file 304 in FIG. 3 ) and a second configuration file (eg, the configuration file 306 in FIG. 3 ), respectively.
所述第一配置文件与所述逻辑系统设计的原型验证功能对应,所述第二配置文件与所述逻辑系统设计的调试功能对应。The first configuration file corresponds to a prototype verification function of the logic system design, and the second configuration file corresponds to a debugging function of the logic system design.
在一些实施例中,响应于选择所述原型验证功能,主机100可以结合所述原型验证功能编译所述逻辑系统设计以生成所述第一配置文件;响应于选择所述调试功能,主机100可以结合所述调试功能编译所述逻辑系统设计以生成所述第二配置。In some embodiments, in response to selecting the prototype verification function, the host 100 can compile the logic system design in combination with the prototype verification function to generate the first configuration file; in response to selecting the debug function, the host 100 can compile the logic system design in combination with the debug function to generate the second configuration file.
在步骤702,主机100可以根据所述第一配置文件(例如,图3中的配置文件304)配置所述硬件仿真工具(例如,图2中的硬件仿真工具202)的第一硬件资源(图4的硬件仿真资源410)以仿真所述逻辑系统设计(例如,图3中的逻辑系统设计302)。In step 702, the host 100 may configure the first hardware resource (the hardware simulation resource 410 of FIG. 4 ) of the hardware simulation tool (e.g., the hardware simulation tool 202 of FIG. 2 ) according to the first configuration file (e.g., the configuration file 304 of FIG. 3 ) to simulate the logic system design (e.g., the logic system design 302 of FIG. 3 ).
在步骤703,主机100获取所述逻辑系统设计(例如,图3中的逻辑系统设计302)的仿真在第一时钟周期(例如,上述时钟周期a)的第一快照(未示出)。In step 703 , the host 100 obtains a first snapshot (not shown) of the simulation of the logic system design (eg, the logic system design 302 in FIG. 3 ) in a first clock cycle (eg, the above-mentioned clock cycle a).
在一些实施例中,所述第一快照包括所述第一硬件资源(例如,图5的硬件仿真资源410)上的第一物理信号(例如,图5中的物理信号501)在所述第一时钟周期的值。In some embodiments, the first snapshot includes a value of a first physical signal (eg, physical signal 501 in FIG. 5 ) on the first hardware resource (eg, hardware emulation resource 410 in FIG. 5 ) in the first clock cycle.
在另一些实施例中,除了上述物理信号在所述第一时钟周期的值之外,所述第一快照进一步还包括所述逻辑系统设计的关键信号(例如,图5中的关键信号502)在所述第一时钟周期的值。In some other embodiments, in addition to the value of the physical signal in the first clock cycle, the first snapshot further includes the value of a key signal of the logic system design (eg, key signal 502 in FIG. 5 ) in the first clock cycle.
第一快照可以由硬件仿真工具202直接输出或者由主机100获取物理信号的值之后生成关键信号的值并存储。例如,方法700可以进一步包括:根据所述逻辑系统设计和所述第一配置文件,确定所述逻辑系统设计的关键信号和所述第一物理信号之间的第一映射(例如,图5的映射510);根据所述第一快照和所述第一映射确定与所述第一硬件资源的第一物理信号对应的所述逻辑系统设计的关键信号在所述第一时钟周期的值。The first snapshot may be directly output by the hardware simulation tool 202 or the host 100 may obtain the value of the physical signal and then generate and store the value of the key signal. For example, the method 700 may further include: determining a first mapping (e.g., mapping 510 of FIG. 5 ) between the key signal of the logic system design and the first physical signal according to the logic system design and the first configuration file; determining the value of the key signal of the logic system design corresponding to the first physical signal of the first hardware resource in the first clock cycle according to the first snapshot and the first mapping.
在步骤704,主机100可以根据所述第二配置文件(例如,图3中的配置文件304)配置所述硬件仿真工具的第二硬件资源(例如,图5中的硬件仿真资源420)以调试所述逻辑系统设计。In step 704 , the host 100 may configure a second hardware resource (eg, the hardware simulation resource 420 in FIG. 5 ) of the hardware simulation tool according to the second configuration file (eg, the configuration file 304 in FIG. 3 ) to debug the logic system design.
可以理解的是,由于调试功能占用更多的硬件资源,所以所述第二硬件资源的资源量大于或者等于所述第一硬件资源的资源量。这里所说的硬件资源的资源量可以指代可编程逻辑器件的容量、子卡等硬件资源的数量。例如,所述第一硬件资源包括可编程逻辑器件。It is understandable that, since the debugging function occupies more hardware resources, the resource amount of the second hardware resource is greater than or equal to the resource amount of the first hardware resource. The resource amount of the hardware resource mentioned here may refer to the capacity of a programmable logic device, the number of hardware resources such as a subcard, etc. For example, the first hardware resource includes a programmable logic device.
在步骤705,主机100可以根据所述第一快照在所述第二硬件资源(例如,图5中的硬件仿真资源420)上还原所述逻辑系统设计到所述第一时间周期。In step 705 , the host 100 may restore the logic system design to the first time period on the second hardware resource (eg, the hardware simulation resource 420 in FIG. 5 ) according to the first snapshot.
在一些实施例中,主机100可以:根据所述逻辑系统设计和所述第二配置文件(例如,图3中的配置文件304)在所述第二硬件资源上确定与所述关键信号(例如,图5的关键信号502)对应的第二物理信号(例如,图5的物理信号503)以及所述关键信号和所述第二物理信号之间的第二映射(例如,图5的映射520);以及根据所述关键信号在所述第一时钟周期的值和所述第二映射确定所述第二物理信号在所述第一时钟周期的值。In some embodiments, the host 100 may: determine, on the second hardware resource, a second physical signal (e.g., physical signal 503 of FIG. 5 ) corresponding to the critical signal (e.g., critical signal 502 of FIG. 5 ) and a second mapping between the critical signal and the second physical signal (e.g., mapping 520 of FIG. 5 ) based on the logical system design and the second configuration file (e.g., configuration file 304 of FIG. 3 ); and determine a value of the second physical signal in the first clock cycle based on the value of the critical signal in the first clock cycle and the second mapping.
在一些实施例中,当硬件仿真工具不足以承载具有调试功能的逻辑系统设计时,第二配置文件可以仅与逻辑系统设计的一部分对应。In some embodiments, when the hardware simulation tool is not sufficient to support the logic system design with debugging function, the second configuration file may correspond to only a part of the logic system design.
通过本申请实施例,用户可以将原型验证功能和调试功能分离,并且在原型验证阶段和调试阶段使用不同的配置文件,从而使得硬件仿真工具可以在原型验证阶段具有较高的运行频率,而同时在调试阶段具有所需要的调试功能。Through the embodiments of the present application, the user can separate the prototype verification function and the debugging function, and use different configuration files in the prototype verification stage and the debugging stage, so that the hardware simulation tool can have a higher operating frequency in the prototype verification stage, while having the required debugging function in the debugging stage.
本申请实施例还提供一种电子装置。该电子装置可以是图1的主机100。该主机100可以包括存储器,用于存储一组指令;以及至少一个处理器,配置为执行该组指令以使得所述电子装置执行方法700。The embodiment of the present application also provides an electronic device. The electronic device may be the host 100 in FIG. 1 . The host 100 may include a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device executes the method 700 .
本申请实施例还提供一种非暂态计算机可读存储介质。该非暂态计算机可读存储介质存储计算机的一组指令,该组指令用于在被执行时使该计算机执行方法700。The embodiment of the present application further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores a set of instructions for a computer, and the set of instructions is used to enable the computer to perform method 700 when executed.
上述对本申请的一些实施例进行了描述。其他实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。 在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。Some embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请的范围(包括权利要求)被限于这些例子;在本申请的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本申请的不同方面的许多其它变化,为了简明它们没有在细节中提供。A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present application as described above, which are not provided in detail for the sake of simplicity.
尽管已经结合了本申请的具体实施例对本申请进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。例如,其它存储器架构(例如,动态RAM(DRAM))可以使用所讨论的实施例。Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
本申请旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本申请的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本申请的保护范围之内。This application is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410151321.5A CN117910398B (en) | 2024-02-02 | 2024-02-02 | Method, electronic device and storage medium for designing simulation logic system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410151321.5A CN117910398B (en) | 2024-02-02 | 2024-02-02 | Method, electronic device and storage medium for designing simulation logic system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117910398A true CN117910398A (en) | 2024-04-19 |
| CN117910398B CN117910398B (en) | 2025-07-01 |
Family
ID=90692111
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410151321.5A Active CN117910398B (en) | 2024-02-02 | 2024-02-02 | Method, electronic device and storage medium for designing simulation logic system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117910398B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118211533A (en) * | 2024-05-21 | 2024-06-18 | 上海合见工业软件集团有限公司 | Prototype verification system resource mapping allocation method, electronic device and storage medium |
| CN121279206A (en) * | 2025-12-10 | 2026-01-06 | 上海合见工业软件集团有限公司 | Method for acquiring intermediate state simulation framework, storage medium and electronic equipment |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5920712A (en) * | 1994-05-13 | 1999-07-06 | Quickturn Design Systems, Inc. | Emulation system having multiple emulator clock cycles per emulated clock cycle |
| US7480609B1 (en) * | 2005-01-31 | 2009-01-20 | Sun Microsystems, Inc. | Applying distributed simulation techniques to hardware emulation |
| US20200242006A1 (en) * | 2019-01-28 | 2020-07-30 | Tsair-Chin Lin | Realization of functional verification debug station via cross-platform record-mapping-replay technology |
| CN114780402A (en) * | 2022-04-21 | 2022-07-22 | 南京英锐创电子科技有限公司 | Debugging method and device of chip simulation system and server |
| CN115291963A (en) * | 2022-06-17 | 2022-11-04 | 芯华章科技股份有限公司 | Method for configuring hardware resources, electronic device and storage medium |
| CN116151187A (en) * | 2023-02-14 | 2023-05-23 | 芯华章科技(北京)有限公司 | Method, apparatus and storage medium for processing trigger condition |
| CN117113908A (en) * | 2023-10-17 | 2023-11-24 | 北京开源芯片研究院 | Verification method, verification device, electronic equipment and readable storage medium |
-
2024
- 2024-02-02 CN CN202410151321.5A patent/CN117910398B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5920712A (en) * | 1994-05-13 | 1999-07-06 | Quickturn Design Systems, Inc. | Emulation system having multiple emulator clock cycles per emulated clock cycle |
| US7480609B1 (en) * | 2005-01-31 | 2009-01-20 | Sun Microsystems, Inc. | Applying distributed simulation techniques to hardware emulation |
| US20200242006A1 (en) * | 2019-01-28 | 2020-07-30 | Tsair-Chin Lin | Realization of functional verification debug station via cross-platform record-mapping-replay technology |
| CN114780402A (en) * | 2022-04-21 | 2022-07-22 | 南京英锐创电子科技有限公司 | Debugging method and device of chip simulation system and server |
| CN115291963A (en) * | 2022-06-17 | 2022-11-04 | 芯华章科技股份有限公司 | Method for configuring hardware resources, electronic device and storage medium |
| CN116151187A (en) * | 2023-02-14 | 2023-05-23 | 芯华章科技(北京)有限公司 | Method, apparatus and storage medium for processing trigger condition |
| CN117113908A (en) * | 2023-10-17 | 2023-11-24 | 北京开源芯片研究院 | Verification method, verification device, electronic equipment and readable storage medium |
Non-Patent Citations (2)
| Title |
|---|
| 熊宇舟: "纯电动客车整车控制器软件开发方法研究", 中国优秀硕士学位论文全文数据库, no. 9, 15 September 2018 (2018-09-15), pages 2 * |
| 胡军强, 杜平, 李津生, 洪佩琳: "数字通信系统设计中FPGA的仿真", 电路与系统学报, no. 04, 30 August 2003 (2003-08-30) * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118211533A (en) * | 2024-05-21 | 2024-06-18 | 上海合见工业软件集团有限公司 | Prototype verification system resource mapping allocation method, electronic device and storage medium |
| CN118211533B (en) * | 2024-05-21 | 2024-08-02 | 上海合见工业软件集团有限公司 | Resource mapping allocation method for prototype verification system, electronic equipment and storage medium |
| CN121279206A (en) * | 2025-12-10 | 2026-01-06 | 上海合见工业软件集团有限公司 | Method for acquiring intermediate state simulation framework, storage medium and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117910398B (en) | 2025-07-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7786005B2 (en) | Verification system, verification method, electronic device, and storage medium | |
| CN111931445B (en) | Method, emulator and storage medium for debugging logic system design | |
| CN117910398B (en) | Method, electronic device and storage medium for designing simulation logic system | |
| CN112100957B (en) | Method, emulator, storage medium for debugging a logic system design | |
| CN112434478B (en) | Method for simulating virtual interface of logic system design and related equipment | |
| CN114912396A (en) | Method and equipment for realizing physical interface of logic system design based on virtual interface | |
| CN115809620B (en) | Method for simulating logic system design, electronic device and storage medium | |
| CN115599618B (en) | Register dynamic change-allocation verification method and device, storage medium and processor | |
| CN114548027B (en) | Method, electronic device and storage medium for tracking signals in verification system | |
| CN114912397A (en) | Programmable logic device, prototype verification system, method, apparatus and storage medium | |
| CN115688643A (en) | Method, device and storage medium for simulation logic system design | |
| CN116594830B (en) | Hardware simulation tool, debugging method and storage medium | |
| CN119167841A (en) | Simulation logic system design method, electronic device and storage medium | |
| CN221746452U (en) | Hardware emulation tools and interface adapters | |
| JPH0877035A (en) | Central processing unit and microcomputer | |
| CN118504478B (en) | Method, electronic device and storage medium for designing simulation logic system | |
| CN117933151A (en) | Method for simulating logic system design, electronic device and storage medium | |
| CN117454835B (en) | Method for storing and reading waveform data, electronic device and storage medium | |
| CN114169287B (en) | Method for generating connection schematic diagram of verification environment, electronic equipment and storage medium | |
| CN118915562A (en) | Method, device, electronic apparatus and storage medium for processing signals designed for logic system | |
| CN116841697B (en) | Method for processing MMIO request, electronic device and storage medium | |
| CN116738906B (en) | Method, circuit, device and storage medium for realizing circulation circuit | |
| CN117172203B (en) | Method for processing script commands, electronic device and storage medium | |
| CN115186017B (en) | Methods, devices, and storage media for reading and writing waveform files in a target waveform format. | |
| CN120386677A (en) | Hardware emulation tools, interface adapters, and hardware emulation systems |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |