CN100373351C - A high-speed transaction-level software-hardware co-simulation method - Google Patents

A high-speed transaction-level software-hardware co-simulation method Download PDF

Info

Publication number
CN100373351C
CN100373351C CNB2006100207017A CN200610020701A CN100373351C CN 100373351 C CN100373351 C CN 100373351C CN B2006100207017 A CNB2006100207017 A CN B2006100207017A CN 200610020701 A CN200610020701 A CN 200610020701A CN 100373351 C CN100373351 C CN 100373351C
Authority
CN
China
Prior art keywords
software
message
incentive
simulation
state
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.)
Expired - Fee Related
Application number
CNB2006100207017A
Other languages
Chinese (zh)
Other versions
CN1828551A (en
Inventor
廖恬瑜
陈小平
涂晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CNB2006100207017A priority Critical patent/CN100373351C/en
Publication of CN1828551A publication Critical patent/CN1828551A/en
Application granted granted Critical
Publication of CN100373351C publication Critical patent/CN100373351C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种高速的事务级软硬件协同仿真方法,涉及集成电路芯片的功能仿真领域,它可以应用于将计算机与硬件仿真器联合进行仿真的软硬件协同仿真系统中。该事务级软硬件协同仿真方法在原有的事务级软硬件协同仿真系统结构下,改善了四个方面的处理机制,软件激励模块采用乐观预测方法判断输入事务处理器的接收状态,输入事务处理器提供四种接收状态来反映其缓存空间的使用程度,硬件方还定义了状态报告消息,该消息将所有的输入事务处理器的接收状态信息周期性的报告给软件方。通过改善事务级软硬件协同仿真系统中的激励消息的流控方法,该协同仿真系统减少了软件激励模块处于等待状态的次数,减小了状态反馈消息占用的通道带宽,由此提高了整个事务级软硬件协同仿真系统的仿真速度。

A high-speed transaction-level software-hardware co-simulation method relates to the field of functional simulation of integrated circuit chips, and can be applied to a software-hardware co-simulation system in which a computer and a hardware emulator are jointly simulated. The transaction-level software-hardware co-simulation method improves the processing mechanism in four aspects under the original transaction-level software-hardware co-simulation system structure. Four receiving states are provided to reflect the utilization degree of its cache space, and the hardware side also defines a status report message, which periodically reports the receiving state information of all input transaction processors to the software side. By improving the flow control method of the incentive message in the transaction-level software-hardware co-simulation system, the co-simulation system reduces the number of times the software stimulus module is in the waiting state, reduces the channel bandwidth occupied by the status feedback message, and thus improves the overall transaction efficiency. The simulation speed of the advanced software and hardware co-simulation system.

Description

一种高速事务级软硬件协同仿真方法 A high-speed transaction-level software-hardware co-simulation method

技术领域technical field

一种高速事务级软硬件协同仿真方法,属于集成电路芯片的功能仿真技术领域,可应用于计算机软硬件协同仿真系统中。A high-speed transaction-level software-hardware co-simulation method belongs to the technical field of integrated circuit chip function simulation and can be applied to computer software-hardware co-simulation systems.

背景技术Background technique

随着集成电路技术的飞速发展,集成电路芯片的集成度和复杂性日益增加,特别是SoC芯片的出现更加剧这个情况。SoC芯片可以达到几百门到几千门的复杂度,内部具有CPU,存储器,高速总线等各种复杂组件,同时SoC芯片还需要由复杂的软件支持,如嵌入式操作系统,各种通信协议,多媒体处理等程序。基于上述的复杂性,复杂的大规模集成电路芯片的功能仿真已经成为一个亟待解决的问题。为了提高人们对芯片进行功能仿真的效率,事务级软硬件协同仿真技术作为一种新的解决方案提供了更高速,更灵活的仿真方法。With the rapid development of integrated circuit technology, the integration and complexity of integrated circuit chips are increasing day by day, especially the emergence of SoC chips has exacerbated this situation. The SoC chip can reach the complexity of hundreds to thousands of gates. It has various complex components such as CPU, memory, and high-speed bus inside. At the same time, the SoC chip also needs to be supported by complex software, such as embedded operating systems and various communication protocols. , Multimedia processing and other programs. Based on the above complexity, the functional simulation of complex LSI chips has become an urgent problem to be solved. In order to improve the efficiency of people's functional simulation of chips, transaction-level software-hardware co-simulation technology provides a higher-speed and more flexible simulation method as a new solution.

事务级软硬件协同仿真技术是一种用于复杂的大规模集成电路芯片的功能仿真方法,主要用于验证芯片RTL级模型是否完成了需要的功能,保证该RTL级模型符合设计规范。在该方法中,事务级软硬件协同仿真系统使用计算机和硬件仿真器联合工作共同完成一个被测系统的仿真。Transaction-level software-hardware co-simulation technology is a functional simulation method for complex large-scale integrated circuit chips. It is mainly used to verify whether the RTL-level model of the chip has completed the required functions and ensure that the RTL-level model meets the design specifications. In this method, the transaction-level software-hardware co-simulation system uses a computer and a hardware simulator to work together to complete the simulation of a system under test.

事务级的软硬件协同仿真的基本思想是通过提高软件仿真方的建模层次和减少软硬件双方之间的同步信息量来提高协同仿真的速度,通过在硬件仿真方增加各种标准的和综合的事务处理器模块来加速各种标准接口的测试。为了实现上述目的,事务级的软硬件协同仿真系统需具备下述四个重要特性。The basic idea of transaction-level software-hardware co-simulation is to increase the speed of co-simulation by improving the modeling level of the software simulation side and reducing the amount of synchronization information between the software and hardware. The transaction processor module to accelerate the testing of various standard interfaces. In order to achieve the above goals, the transaction-level software-hardware co-simulation system needs to have the following four important characteristics.

软件仿真模块使用事务级建模,通常可以使用C/C++/SystemC等语言描述,这与用HDL语言描述的RTL级模型有很大的不同,它不再基于时钟或者信号变化。由于具有了更高的抽象级别,软件仿真模块可以有更加快速的建模速度和运行速度。The software simulation module uses transaction-level modeling, which can usually be described in languages such as C/C++/SystemC, which is very different from the RTL-level model described in HDL language, which is no longer based on clock or signal changes. Due to the higher abstraction level, the software simulation module can have faster modeling speed and running speed.

基于消息的通信,软硬件仿真双方以消息作为传输单元进行双方之间的仿真同步和信息交换。协同仿真系统定义了系统中可能的各种事务,仿真方在约定的事务发生后,将其用约定的消息表示,并传给对方。使用消息代替具体信号值进行通信,可以减少双方之间的数据传输频率和数据传输量。Based on message communication, the software and hardware simulation parties use messages as the transmission unit to carry out simulation synchronization and information exchange between the two parties. The co-simulation system defines various possible transactions in the system. After the agreed transaction occurs, the simulation party expresses it with the agreed message and sends it to the other party. Using messages instead of specific signal values for communication can reduce the frequency and amount of data transmission between two parties.

事务处理器完成消息与信号之间的数据格式的转换。由于硬件仿真模块本身使用信号工作,为了通过消息与软件仿真方通信,硬件仿真方中增加了事务处理器模块进行信息格式的转换工作,它可以将来自软件仿真方的消息转变成多个时钟周期的激励信号,同时也可以将多个时钟周期的响应信号转变成消息。事务处理器实现了软硬件双方的数据格式之间的转换。The transaction processor completes the data format conversion between messages and signals. Since the hardware simulation module itself uses signals to work, in order to communicate with the software simulation side through messages, a transaction processor module is added to the hardware simulation side to convert information formats, which can convert messages from the software simulation side into multiple clock cycles Stimulus signals for multiple clock cycles can also be converted into messages. The transaction processor realizes the conversion between the data formats of both hardware and software.

控制时钟和非控制时钟,非控制时钟控制整个硬件仿真方系统的工作,是一个实际的系统时钟。控制时钟控制硬件仿真模块的工作,它受到事务处理器模块的控制。当事务处理器进行消息转换时,硬件仿真模块需要的信号还没有产生,非控制时钟被关闭来停止硬件仿真模块的工作。The control clock and the non-control clock, the non-control clock controls the work of the entire hardware emulation side system, and is an actual system clock. The control clock controls the work of the hardware emulation module, which is controlled by the transaction processor module. When the transaction processor performs message conversion, the signal required by the hardware simulation module has not yet been generated, and the non-control clock is turned off to stop the work of the hardware simulation module.

在事务级的软硬件协同仿真系统中,被测系统中的各个子模块及其测试模块被分为两组,一组命名为软件仿真模块,在计算机中仿真,一组命名为硬件仿真模块,在硬件仿真器中仿真。软件仿真模块和硬件仿真模块分别利用计算机的灵活性和硬件仿真器的高速性共同完成SoC系统的功能仿真。In the transaction-level software-hardware co-simulation system, each sub-module in the system under test and its test module are divided into two groups, one group is named software simulation module, which is simulated in the computer, and one group is named hardware simulation module. Simulate in a hardware emulator. The software emulation module and the hardware emulation module respectively use the flexibility of the computer and the high speed of the hardware emulator to jointly complete the functional emulation of the SoC system.

事务级的软硬件协同仿真系统的基本结构如图1所示。软件仿真方包括多个软件仿真模块和消息通道的软件接口部分,硬件仿真方包括硬件仿真模块、多个事务处理器模块,消息通道的硬件接口部分。这些模块的作用如下:The basic structure of transaction-level software-hardware co-simulation system is shown in Figure 1. The software simulation side includes multiple software simulation modules and the software interface part of the message channel, and the hardware simulation side includes a hardware simulation module, multiple transaction processor modules, and a hardware interface part of the message channel. The functions of these modules are as follows:

软件仿真模块通常可以分为软件激励模块和软件响应模块。软件激励模块根据具体仿真/验证要求产生对应的激励消息,并将激励消息写入消息代理端口。软件响应模块分析来自消息代理端口的响应消息,记录被测系统的输出结果和验证其正确性。该模块通常使用C/C++等语言在计算机上实现。The software simulation module can usually be divided into a software stimulus module and a software response module. The software incentive module generates corresponding incentive messages according to specific simulation/verification requirements, and writes the incentive messages into the message agent port. The software response module analyzes the response message from the message agent port, records the output result of the system under test and verifies its correctness. This module is usually implemented on a computer using languages such as C/C++.

硬件仿真模块通常是待测试的芯片的RTL级模型。设计人员在完成待测试的被测系统的RTL(寄存器转移级)模型后,将其进行综合后下载到硬件仿真器进行验证。A hardware emulation module is usually an RTL-level model of the chip to be tested. After the designer completes the RTL (Register Transfer Level) model of the system under test to be tested, it is synthesized and downloaded to a hardware emulator for verification.

事务处理器分为输入事务处理器和输出事务处理器。输入事务处理器通过消息端口接收来自软件激励模块的激励消息,将其转换成对应的待测试系统的激励信号。一个对应的激励消息可以产生几十甚至上百的时钟周期的激励信号的输入。输出事务处理器监视待测试系统的响应信号,将其转换成对应的响应消息,然后传给软件响应模块。类似的,相关的多个时钟周期的响应信号可以被一个响应消息所表示。Transaction processors are divided into input transaction processors and output transaction processors. The input transaction processor receives the stimulus message from the software stimulus module through the message port, and converts it into a corresponding stimulus signal of the system to be tested. A corresponding stimulus message can generate tens or even hundreds of clock cycles of the input of the stimulus signal. The output transaction processor monitors the response signal of the system to be tested, converts it into a corresponding response message, and then transmits it to the software response module. Similarly, related response signals of multiple clock cycles can be represented by a response message.

消息通道用于连接软件仿真方和硬件仿真方,通过在通道上传输激励消息和响应消息实现软件仿真模块和硬件仿真模块的同步和信息交换。消息通道分别在软件仿真方和硬件仿真方提供了消息代理端口和消息端口,通过这些端口软件仿真模块和事务处理器模块就可以访问消息通道进行消息的传递。The message channel is used to connect the software emulation side and the hardware emulation side, and realize the synchronization and information exchange between the software emulation module and the hardware emulation module by transmitting the incentive message and the response message on the channel. The message channel provides a message agent port and a message port on the software emulation side and the hardware emulation side respectively, through which the software emulation module and the transaction processor module can access the message channel for message delivery.

在该事务级软硬件协同仿真系统中,通常定义了三种消息用于实现软件仿真方与硬件仿真方的信息交换和仿真同步:In this transaction-level software-hardware co-simulation system, three messages are usually defined to realize the information exchange and simulation synchronization between the software simulation party and the hardware simulation party:

1、激励消息。它通过消息通道从软件激励模块发送到对应的输入事务处理器,用于软件仿真方向硬件仿真模块通知一个激励事务。通常激励消息包括了目的输入事务处理器的编号和要产生的激励事务的编码。1. Incentive message. It is sent from the software stimulus module to the corresponding input transaction processor through the message channel, and is used for the software simulation to notify the hardware simulation module of a stimulus transaction. Typically the stimulus message includes the number of the destination input transaction processor and the code of the stimulus transaction to be generated.

2、响应消息。它通过消息通道从输出事务处理器发往软件响应模块,用于硬件仿真方向软件仿真方通知发生了一个响应事务。通常响应消息包括了目的软件仿真模块的编号和发生的响应事务的编码。2. Respond to the message. It is sent from the output transaction processor to the software response module through the message channel, and is used for hardware simulation to notify the software simulation side that a response transaction has occurred. Usually the response message includes the serial number of the target software simulation module and the encoding of the response transaction that occurs.

3、输入准备好消息。为了防止由于软件激励模块发送激励消息过快或者输入事务处理器的处理速度较慢,造成激励消息在输入事务处理器的溢出,系统使用输入准备好消息进行激励消息的流控。输入准备好消息通过消息通道从输入事务处理器发往软件激励模块,告知软件激励模块现在对应的输入事务处理器已经准备好接收激励消息。通常输入准备好消息包括输入事务处理器的编号和表示输入准备好的编码。输入准备好消息的格式示例如图2所示。8bit的编号可以实现含有256个输入事务处理器的协同仿真系统。3. Enter the ready message. In order to prevent the incentive message from overflowing in the input transaction processor due to the too fast sending of the incentive message by the software incentive module or the slow processing speed of the input transaction processor, the system uses the input ready message to control the flow of the incentive message. The input ready message is sent from the input transaction processor to the software incentive module through the message channel, informing the software incentive module that the corresponding input transaction processor is ready to receive the incentive message. Typically the input ready message includes the input transaction processor's number and a code indicating input ready. An example of the format of the input ready message is shown in Figure 2. The number of 8bit can realize the co-simulation system containing 256 input transaction processors.

软硬件协同仿真系统中的消息定义约定了软硬件仿真双方的同步操作的内容和格式,方便了软件仿真方的事务级建模。同时通过硬件方的事务处理器高速的实现激励输入和响应分析,并且减少了消息通道上的数据传输量,减小了通道上产生的仿真延迟。The message definition in the software-hardware co-simulation system stipulates the content and format of the synchronous operation of the software and hardware simulation parties, which facilitates the transaction-level modeling of the software simulation party. At the same time, the stimulus input and response analysis are realized at high speed through the transaction processor on the hardware side, and the amount of data transmission on the message channel is reduced, and the simulation delay generated on the channel is reduced.

在上述的事务级软硬件协同系统中,在软件仿真模块和硬件仿真模块被恰当的布置在该协同仿真系统后,通过三种消息进行软硬件双方的信息交换和仿真同步,通常整个仿真的步骤如下:In the above-mentioned transaction-level software-hardware collaborative system, after the software simulation module and hardware simulation module are properly arranged in the collaborative simulation system, information exchange and simulation synchronization between the software and hardware are carried out through three kinds of messages. Usually, the entire simulation step as follows:

1、软件仿真方进行初始化。软件仿真方先进行初始化,软件激励模块从初始化状态直接进入等待状态,软件响应模块处于等待响应消息状态。软件仿真方在稳定后向硬件仿真方发送复位信号,通知硬件仿真方进行初试化。1. The software simulation side initializes. The software simulation side initializes first, the software incentive module directly enters the waiting state from the initialization state, and the software response module is in the state of waiting for a response message. After the software emulation side is stable, it sends a reset signal to the hardware emulation side to notify the hardware emulation side to carry out the initial test.

2、硬件仿真方在收到复位信号后进行初始化,各个输入事务处理器向对应的软件激励模块发送输入准备好消息,然后准备接收激励消息。2. The hardware simulation side initializes after receiving the reset signal, and each input transaction processor sends an input ready message to the corresponding software stimulus module, and then prepares to receive the stimulus message.

3、软件激励模块在收到输入准备好消息后开始进行自己的仿真工作,在发生约定的事务后,向对应的输入事务处理器发送激励消息。然后处于等待状态,等待输入准备好消息的到来。3. The software incentive module starts its own simulation work after receiving the input ready message, and sends an incentive message to the corresponding input transaction processor after the agreed transaction occurs. Then it is in a waiting state, waiting for the arrival of the input ready message.

4、硬件仿真方的输入事务处理器在收到激励消息后将消息翻译成对应的多个时钟周期的激励信号,实现对被测模块的激励输入。同时,输入事务处理器根据自己的消息缓存空间空满状态,发送输入准备好消息。4. After receiving the stimulus message, the input transaction processor of the hardware emulation side translates the message into corresponding stimulus signals of multiple clock cycles, so as to realize the stimulus input to the module under test. At the same time, the input transaction processor sends an input ready message according to its own message buffer space fullness status.

5、软件激励模块在收到对应的输入事务处理器的输入准备好消息后,进入激励发送状态。软件激励模块继续之前的仿真任务,同时在发生约定的事务后,向对应的输入事务处理器发送激励消息。然后转移到等待状态。软件激励模块的状态转移图如图3所示,它采用悲观方法预测输入事务处理器的接收状态。5. The software incentive module enters the incentive sending state after receiving the input ready message from the corresponding input transaction processor. The software incentive module continues the previous simulation task, and at the same time sends an incentive message to the corresponding input transaction processor after the agreed transaction occurs. Then transfer to wait state. The state transition diagram of the software incentive module is shown in Figure 3, which uses a pessimistic method to predict the receiving state of the input transaction processor.

6、硬件仿真方的输出事务处理器在仿真过程中监视被测模块的输出端口,不断的将响应信号的变化用响应消息进行编码,并且发给对应的软件响应模块。6. The output transaction processor of the hardware simulation side monitors the output port of the module under test during the simulation process, continuously encodes the change of the response signal with a response message, and sends it to the corresponding software response module.

7、软件响应模块在接收响应消息后,进行相应的响应记录和分析,判断被测模块的输出是否正确。7. After receiving the response message, the software response module records and analyzes the corresponding response to judge whether the output of the module under test is correct.

在整个事务级软硬件协同仿真过程中,步骤4、5反复执行,由此推动硬件仿真模块和软件激励模块不断的完成仿真任务,推进被测模块的仿真进度。同时步骤6、7在仿真过程中不断完成被测模块的响应记录和分析。During the entire transaction-level software-hardware co-simulation process, steps 4 and 5 are executed repeatedly, thereby promoting the hardware simulation module and software incentive module to continuously complete the simulation tasks and promote the simulation progress of the tested module. At the same time, steps 6 and 7 continuously complete the response recording and analysis of the module under test during the simulation process.

在仿真过程中,激励消息完成对被测模块的激励输入,响应消息完成对被测模块的输出响应的分析,输入准备好消息实现对激励消息的流控功能,保证激励消息的发送速度不会超过输入事务处理器的接收能力。During the simulation process, the stimulus message completes the stimulus input to the module under test, the response message completes the analysis of the output response of the module under test, and the input ready message realizes the flow control function of the stimulus message, ensuring that the sending speed of the stimulus message will not The receiving capacity of the input transaction processor has been exceeded.

上述事务级软硬件协同仿真方法的优点:Advantages of the transaction-level hardware-software co-simulation approach described above:

1.该方法为用户提供了很方便的激励产生和响应分析方案。由于软件仿真模块在计算机上运行,可以使用软件语言(如C/C++)来描述,具有很灵活的数据处理能力。该协同仿真系统可以产生仿真覆盖率很高的激励形式,并对响应状况做各种计算和以各种形式输出。1. This method provides users with a very convenient stimulus generation and response analysis scheme. Because the software simulation module runs on the computer, it can be described by software language (such as C/C++), and has very flexible data processing capability. The co-simulation system can generate stimulus forms with high simulation coverage, and perform various calculations on response conditions and output them in various forms.

2.该方法提供了快速的仿真速度。在该方法中,被测模块通常放在硬件仿真器中运行,使得仿真系统中最复杂的部分得到最快的运行速度。2. The method provides fast simulation speed. In this method, the module under test is usually run in a hardware emulator, so that the most complex part of the emulation system can be run at the fastest speed.

3.该方法通过使用标准的事务处理器,使得对模块的测试是基于事务概念的宏操作,而不是具体信号变化,提高了用户的验证效率。3. By using the standard transaction processor, the method makes the test of the module based on the macro operation of the transaction concept, rather than the specific signal change, and improves the verification efficiency of the user.

4.该方法使用约定格式的消息实现激励形式的表示和响应结果的记录。与直接使用信号值来表示激励信号和响应信号,该方法降低了在通道上的数据传输造成的仿真延迟。4. The method uses the message in the agreed format to realize the expression of the incentive form and the record of the response result. Rather than directly using signal values to represent stimulus and response signals, this approach reduces simulation delays caused by data transmission on the channel.

该事务级软硬件协同仿真方法的缺点:Disadvantages of this transaction-level hardware-software co-simulation approach:

事务级软硬件协同仿真方法使用了由消息通道连接的两个独立仿真平台(软件方和硬件方)进行被测模块的功能仿真。在仿真过程中,在软件方的软件激励模块需要不断的产生激励消息,这些大量激励消息通过消息通道传到输入事务处理器,输入事务处理器将这些激励消息转换成对应的激励信号。为了防止软件激励模块发送激励消息的速度大于输入事务处理器的接收和处理能力,该协同仿真系统定义了一种输入准备好机制。输入准备好机制为每一个有可能发生激励消息溢出情况的输入事务处理器提供了一个状态反馈方法,它将对应输入事务处理器是否准备好接收激励消息的状态发给对应的软件激励模块,该软件激励模块根据该状态信息就可以判断是否可以继续发送激励消息而不会导致输入事务处理器的溢出。The transaction-level software-hardware co-simulation method uses two independent simulation platforms (software side and hardware side) connected by a message channel to simulate the function of the module under test. During the simulation process, the software stimulus module on the software side needs to continuously generate stimulus messages, and these massive stimulus messages are transmitted to the input transaction processor through the message channel, and the input transaction processor converts these stimulus messages into corresponding stimulus signals. In order to prevent the software stimulus module from sending stimulus messages faster than the receiving and processing capability of the input transaction processor, the co-simulation system defines an input ready mechanism. The input ready mechanism provides a state feedback method for each input transaction processor that may have an incentive message overflow situation, and it will send the status of whether the corresponding input transaction processor is ready to receive the incentive message to the corresponding software incentive module. The software incentive module can judge whether the incentive message can be sent continuously without causing overflow of the input transaction processor according to the state information.

在上述的实现方案中,软件激励模块采用的是悲观预测方法,在初始化时和每次发送激励消息后就认为对应的输入事务处理器没有准备好并进入等待状态。只有在接收到对应编号的输入事务处理器的准备好消息后才会从等待状态返回到激励发送状态,然后继续发送下一个激励消息。In the above implementation scheme, the software incentive module adopts a pessimistic prediction method, and considers that the corresponding input transaction processor is not ready and enters a waiting state during initialization and after each incentive message is sent. Only after receiving the ready message from the input transaction processor with the corresponding number, it will return from the waiting state to the incentive sending state, and then continue to send the next incentive message.

在仿真过程中,输入事务处理器产生的输入准备好消息与软件激励模块产生的激励消息一一对应,假设系统中有n个输入事务处理器,单位时间内每个输入事务处理器收到激励消息为v个,且输入准备好消息的大小如图2所示为9bit,则单位时间内输入准备好消息消耗了(9*n*v)bit的传输数据量。该传输数据量显示输入准备好消息与激励消息使用的带宽相当,会降低整个消息通道的使用效率。In the simulation process, the input ready message generated by the input transaction processor corresponds to the stimulus message generated by the software stimulus module. Assuming that there are n input transaction processors in the system, each input transaction processor receives the stimulus per unit time There are v messages, and the size of the input ready message is 9 bits as shown in Figure 2, then the input ready message consumes (9*n*v) bit transmission data volume per unit time. The amount of transmitted data shows that the bandwidth used by the input ready message is equivalent to that used by the incentive message, which will reduce the efficiency of the entire message channel.

通过该输入准备好机制的实现方案可以保证输入事务处理器只要能接收一个最大的激励消息就绝对不会产生溢出情况,但是该方案会降低协同仿真系统的仿真效率。The implementation scheme of the input ready mechanism can ensure that the input transaction processor will never overflow as long as it can receive a maximum stimulus message, but this scheme will reduce the simulation efficiency of the co-simulation system.

软件激励模块每发送一个激励消息就必须等待来自硬件方的输入事务处理器的输入准备好消息。由于软件激励模块采用了这种较悲观的预测方法,认为输入事务处理器很容易进入溢出状态,导致输入事务处理器即使有较大的缓存空间也必须在发出其输入准备好消息后才会有新的激励消息输入。因此软件激励模块不能流畅的发送激励消息给输入事务处理器,抑制了协同仿真速度的提高。Every time the software incentive module sends an incentive message, it must wait for the input ready message from the input transaction processor of the hardware side. Because the software incentive module adopts this relatively pessimistic prediction method, it is believed that the input transaction processor is easy to enter the overflow state, resulting in that even if the input transaction processor has a large buffer space, it must send out its input ready message. New incentive message input. Therefore, the software stimulus module cannot smoothly send stimulus messages to the input transaction processor, which inhibits the improvement of the co-simulation speed.

在该方案中,对于每一个激励消息都会有一个对应的输入准备好消息需要在通道上传输。这将大大增加通道上需要传输的数据量,通道对消息数据的传输延迟将进一步抑制协同仿真速度的提高。In this scheme, for every stimulus message there is a corresponding input ready message to be transmitted on the channel. This will greatly increase the amount of data that needs to be transmitted on the channel, and the transmission delay of the channel to message data will further inhibit the improvement of the co-simulation speed.

发明内容Contents of the invention

本发明在基于一种状态报告消息实现激励消息的流控功能的基础上,提供一种高速事务级软硬件协同仿真方法,和现有方法相比,本发明具有更高的仿真速度。The present invention provides a high-speed transaction-level software-hardware co-simulation method on the basis of realizing the flow control function of the incentive message based on a state report message. Compared with the existing method, the present invention has higher simulation speed.

在阐述本发明详细技术方案之前,首先介绍本发明的基本思想:Before setting forth the detailed technical scheme of the present invention, first introduce the basic idea of the present invention:

1.在本发明中,软件激励模块采用乐观预测方法实现输入准备好机制。软件激励模块认为输入事务处理器具有较大的缓存空间,在初始化时和发送激励消息后都认为对应的输入事务处理器依然是处于激励发送状态,只有在收到输入事务处理器反馈来的缓存空间满或者消息溢出情况才会等待。1. In the present invention, the software incentive module adopts an optimistic prediction method to realize the input ready mechanism. The software incentive module thinks that the input transaction processor has a large buffer space, and thinks that the corresponding input transaction processor is still in the incentive sending state at the time of initialization and after sending the incentive message. It will only wait when the space is full or the message overflows.

2.状态报告消息的状态信息不再是简单的反映输入事务处理器是否准备好接收激励消息。而是通过多个状态信息编码表示对应的输入事务处理器的缓存空间的使用情况,由此反映输入事务处理器能够接收新的激励消息的各种不同程度。2. The status information of the status report message no longer simply reflects whether the input transaction processor is ready to receive the incentive message. Instead, multiple state information codes are used to indicate the usage of the buffer space of the corresponding input transaction processor, thereby reflecting various degrees of the input transaction processor being able to receive new incentive messages.

3.硬件仿真方不是针对每个输入事务处理器单独进行激励发送状态信息的反馈,而是采用全体状态信息反馈。状态报告消息将所有的输入事务处理器的接收状态按照约定的编号排列打包成一个消息,然后一起给软件方。软件方通过解析后将各个输入事务处理器的接收状态告知对应的软件激励模块,用于指示软件激励模块是否可以发送激励消息。3. The hardware emulation side does not separately perform feedback of incentive sending status information for each input transaction processor, but adopts overall status information feedback. The status report message packs the receiving status of all input transaction processors into a message according to the agreed number, and then sends it to the software side together. After parsing, the software side notifies the corresponding software incentive module of the receiving status of each input transaction processor, which is used to indicate whether the software incentive module can send the incentive message.

4.硬件仿真方不是在每次收到激励消息就反馈输入事务处理器的接收状态信息,而是周期性的发送状态报告消息来报告输入事务处理器的接收状态。发送的周期根据输入事务处理器的缓存空间大小,激励消息的发送密度等具体情况来设置。4. The hardware emulator does not feed back the receiving status information of the input transaction processor every time it receives an incentive message, but periodically sends a status report message to report the receiving status of the input transaction processor. The sending cycle is set according to specific circumstances such as the size of the buffer space of the input transaction processor and the sending density of incentive messages.

事务级软硬件协同仿真系统的基本结构如图1所示,为了实现软件激励模块向输入事务处理器发送激励消息的流控功能,提高原来的输入准备好消息机制的处理效率,本发明对事务级软硬件协同仿真的仿真步骤和消息内容进行了改善。The basic structure of the transaction-level software-hardware co-simulation system is shown in Figure 1. In order to realize the flow control function that the software incentive module sends incentive messages to the input transaction processor and improve the processing efficiency of the original input ready message mechanism, the present invention provides The simulation steps and message content of level-software-hardware co-simulation have been improved.

根据上述基本思想,下面说明本发明提供的高速事务级软硬件协同仿真方法的技术方案案:According to the above-mentioned basic idea, the technical scheme of the high-speed transaction level software-hardware co-simulation method provided by the present invention is explained below:

一种高速事务级软硬件协同仿真方法,其特征在于,包括以下步骤:A high-speed transaction level software-hardware co-simulation method is characterized in that it comprises the following steps:

步骤1、软件仿真方进行初始化。软件仿真方先进行初始化,软件仿真方在稳定后向硬件仿真方发送复位信号,通知硬件仿真方进行初试化。然后经过一段时间的延迟,保证硬件仿真方已经进入正常工作状态后,软件激励模块直接转移到激励发送状态,发送激励消息。Step 1. The software simulation side performs initialization. The software emulation side initializes first, and the software emulation side sends a reset signal to the hardware emulation side after it is stable, and notifies the hardware emulation side to carry out initial testing. Then after a period of delay to ensure that the hardware emulator has entered the normal working state, the software incentive module directly transfers to the incentive sending state and sends the incentive message.

步骤2、硬件仿真方在收到复位信号后进行初始化,各个输入事务处理器开始准备接收激励消息。Step 2. The hardware emulator performs initialization after receiving the reset signal, and each input transaction processor starts to prepare to receive the incentive message.

步骤3、软件仿真方进行相应的仿真任务,在发生约定的事务后,软件激励模块向对应的输入事务处理器发送激励消息。然后软件激励模块继续保持在激励发送状态,并继续之后的仿真任务。Step 3. The software simulation party performs corresponding simulation tasks. After the agreed transaction occurs, the software incentive module sends an incentive message to the corresponding input transaction processor. Then the software stimulus module remains in the stimulus sending state, and continues the subsequent simulation tasks.

步骤4、硬件仿真方的输入事务处理器在收到激励消息后将消息翻译成对应的多个时钟周期的激励信号,实现对被测模块的激励输入。同时,硬件仿真方定期检查所有输入事务处理器的消息缓存空间的使用情况,向软件仿真方发送状态报告消息,状态报告消息格式如图6所示,由顺序编号的各输入事务处理器的状态编码组成。所述各输入事务处理器的状态编码如表1所述。Step 4. After receiving the stimulus message, the input transaction processor of the hardware emulation side translates the message into corresponding stimulus signals of multiple clock cycles, so as to realize the stimulus input to the module under test. At the same time, the hardware emulation side regularly checks the usage of the message buffer space of all input transaction processors, and sends a status report message to the software emulation side. The status report message format is shown in Figure 6. encoding composition. The status codes of the input transaction processors are as described in Table 1.

步骤5、软件激励模块在收到状态报告消息后,根据对应输入事务处理器的状态编码进行状态转移控制。若软件激励模块处于激励发送状态时,收到“10”或者“11”状态编码,则转入到等待状态,否则不变。若处于等待状态时,收到“00”状态编码则转入到激励发送状态。该状态变换如图4所示。Step 5. After receiving the state report message, the software incentive module performs state transition control according to the state code corresponding to the input transaction processor. If the software incentive module is in the incentive sending state and receives the "10" or "11" state code, it will enter the waiting state, otherwise it will remain unchanged. If it is in the waiting state, it will enter the excitation sending state if it receives the "00" state code. This state transition is shown in Figure 4.

步骤6、硬件仿真方的输出事务处理器在仿真过程中监视被测模块的输出端口,不断的将响应信号的变化用响应消息进行编码,并且将响应消息发给对应的软件响应模块。Step 6. The output transaction processor of the hardware simulation side monitors the output port of the module under test during the simulation process, continuously encodes the change of the response signal with a response message, and sends the response message to the corresponding software response module.

步骤7、软件响应模块在接收响应消息后,进行相应的响应记录和分析,判断被测模块的输出是否正确。Step 7: After receiving the response message, the software response module performs corresponding response recording and analysis to determine whether the output of the tested module is correct.

在整个仿真过程中,步骤3、4,5不断重复描述了软件仿真方通过激励消息对硬件仿真模块进行激励的过程。步骤6、7不断重复描述了硬件仿真模块的响应通过响应消息被软件仿真方进行记录和分析的过程。其中,周期性的状态报告消息有效的实现了激励消息的流控功能。Throughout the simulation process, steps 3, 4, and 5 are repeated to describe the process in which the software simulation side stimulates the hardware simulation module through incentive messages. Steps 6 and 7 repeatedly describe the process in which the response of the hardware simulation module is recorded and analyzed by the software simulation side through the response message. Among them, the periodic status report message effectively implements the flow control function of the incentive message.

本发明实质是在现有的事务级软硬件协同仿真方法的基础上,进行了下述四个方面的改善:The essence of the present invention is to improve the following four aspects on the basis of the existing transaction-level software-hardware co-simulation method:

一、软件激励模块的处理流程的改善1. Improvement of the processing flow of the software incentive module

在协同仿真的过程中,需要向输入事务处理器发送激励消息的软件激励模块不断的接收来自对应的输入事务处理器的接收状态信息,然后判断是否可以向该对应的输入事务处理器发送激励消息。通常,软件激励模块采取悲观预测的方法来判断输入事务处理器的接收状态,其处理过程的状态转移图如图3。软件激励模块具有初始化、输入准备好和等待三个状态。在系统复位后进入初始化状态,设置软件激励模块的各种初始参数。这时软件激励模块认为对应的输入事务处理器的状态为没有准备好。当其收到输入准备好消息时才进入激励发送状态。然后在激励发送状态时软件激励模块发送激励消息,并在发送后进入到等待状态。等待状态时认为输入事务处理还没有做好接收激励消息的准备。然后在等待状态时收到输入准备好消息软件激励模块返回到激励发送状态,继续发送下一个激励消息。由于在每次发送激励消息后软件激励模块都要进入等待状态等待接收输入准备好消息,所以该方法抑制了软件激励模块的运行速度。In the process of co-simulation, the software stimulus module that needs to send stimulus messages to the input transaction processor continuously receives the receiving status information from the corresponding input transaction processor, and then judges whether it can send stimulus messages to the corresponding input transaction processor . Usually, the software incentive module adopts the method of pessimistic prediction to judge the receiving state of the input transaction processor, and the state transition diagram of its processing process is shown in Figure 3. The software stimulus module has three states of initialization, input ready and waiting. Enter the initialization state after the system is reset, and set various initial parameters of the software excitation module. At this time, the software incentive module considers that the state of the corresponding input transaction processor is not ready. It enters the incentive sending state when it receives the input ready message. Then the software incentive module sends the incentive message in the incentive sending state, and enters the waiting state after sending. The wait state assumes that the input transaction is not yet ready to receive stimulus messages. Then when receiving the input ready message in the waiting state, the software incentive module returns to the incentive sending state and continues to send the next incentive message. Since the software stimulus module has to enter the waiting state to wait for receiving the input ready message every time after sending the stimulus message, this method restrains the running speed of the software stimulus module.

在本发明中,软件激励模块采取乐观方法预测输入事务处理器的接收状态。如图4所示,软件激励模块在系统复位后进入初始化状态设置各种参数,然后直接进入到激励发送状态,这时软件激励模块就可以发送激励消息了。每次发送激励消息后,软件激励模块仍然处于激励发送状态。只有在收到对应输入事务处理器的缓存空间满状态信息时,软件激励模块才进入等待状态。在等待状态软件激励模块不能发送激励消息。在等待状态时软件激励模块收到输入事务处理器的缓存空间空状态信息后返回到激励发送状态继续发送下一个激励消息。本处理流程减少了软件激励模块处于等待状态的时间,能够提高协同仿真的速度。In the present invention, the software incentive module takes an optimistic approach to predict the receiving status of the input transaction processor. As shown in Figure 4, the software incentive module enters the initialization state to set various parameters after the system is reset, and then directly enters the incentive sending state. At this time, the software incentive module can send incentive messages. After each incentive message is sent, the software incentive module is still in the incentive sending state. Only when receiving the buffer space full state information corresponding to the input transaction processor, the software incentive module enters the waiting state. In the wait state the software stimulus module cannot send stimulus messages. In the waiting state, the software incentive module returns to the incentive sending state and continues to send the next incentive message after receiving the buffer space empty state information input to the transaction processor. This processing flow reduces the time that the software incentive module is in a waiting state, and can improve the speed of co-simulation.

二、输入事务处理器的接收状态信息的编码2. Encoding of the receiving status information of the input transaction processor

为了对激励消息进行有效的流控,输入事务处理器需要向软件激励模块发送自己的接收状态信息,通常就是其缓存空间的使用信息。在现有的方法中,输入事务处理器采用了与上述的悲观预测匹配的状态报告机制。在每次收到激励消息后,输入事务处理器将检查其缓存空间是否为满。如果缓存为不满,则发送输入准备好消息告知软件激励模块继续发送激励消息,如果缓存空间为满,则等待,延迟输入准备好消息的发送,直到缓存空间为不满。这样的方法产生了较多的输入准备好消息,增加了消息通道上的数据传输量。而且由于输入事务处理器的反馈状态信息只包括了空满信息,不能反映缓存空间的使用程度,即使有较多剩余空间时,软件激励模块依然不能发送多个激励消息来提高运行效率。In order to effectively control the flow of incentive messages, the input transaction processor needs to send its own receiving status information to the software incentive module, which is usually the usage information of its buffer space. In existing approaches, the input transaction processor employs a status reporting mechanism that matches the pessimistic prediction described above. After each stimulus message is received, the input transaction processor will check whether its buffer space is full. If the buffer is not full, then send the input ready message to inform the software incentive module to continue sending the incentive message, if the buffer space is full, then wait and delay the sending of the input ready message until the buffer space is not full. Such a method generates more input ready messages, increasing the amount of data transmission on the message channel. Moreover, since the feedback state information input to the transaction processor only includes full and empty information, it cannot reflect the utilization degree of the cache space. Even if there is more space left, the software incentive module still cannot send multiple incentive messages to improve operating efficiency.

在本发明中,输入事务处理器根据其缓存空间的使用情况设置了四种接收状态,并进行了编码。输入事务处理器的基本结构如图5所示。激励消息从输入消息端口进入,然后由fifo(输入事务处理器的缓存)模块存储,激励信号产生模块根据激励消息产生需要的激励信号。根据fifo模块提供的4个信号empty,ae,af, full来区分输入事务处理器的四种接收状态。In the present invention, the input transaction processor sets and encodes four receiving states according to the usage of its cache space. The basic structure of the input transaction processor is shown in Figure 5. The incentive message enters from the input message port, and then is stored by the fifo (input transaction processor buffer) module, and the incentive signal generation module generates the required incentive signal according to the incentive message. According to the four signals empty, ae, af, and full provided by the fifo module, the four receiving states of the input transaction processor are distinguished.

信号empty表示fifo模块为空。The signal empty indicates that the fifo module is empty.

信号ae表示fifo模块使用单元数较少。具体实现时通常表示其使用单元数小于参数ae_num,参数ae_num由用户设置。The signal ae indicates that the fifo module uses less units. In the specific implementation, it usually means that the number of units used is less than the parameter ae_num, and the parameter ae_num is set by the user.

信号af表示fifo模块使用单元数较少。具体实现时通常表示其使用单元数大于参数af_num,参数af_num由用户设置。The signal af indicates that the fifo module uses less units. In actual implementation, it usually indicates that the number of units used is greater than the parameter af_num, and the parameter af_num is set by the user.

信号full表示fifo模块为满。The signal full indicates that the fifo module is full.

四个接收状态的设置如下表1:The settings of the four receiving states are shown in Table 1:

表1:输入事务处理器的四个接收状态表Table 1: Four Receive State Tables for Input Transaction Processors

  状态 state   输入事务处理器处于该状态的条件Enter the conditions for the transaction processor to be in this state   此状态下fifo的使用情况The usage of fifo in this state   状态编码Status code   较空状态Empty state   当信号empty或者ae有效时When the signal empty or ae is valid   0~ae_num0~ae_num   “00”"00"   中等状态Moderate state   当四个信号empty、ae、af、full都无效时When the four signals empty, ae, af, and full are invalid   ae_num~af_numae_num~af_num   “01”"01"   较满状态relatively full state   当信号af或者full有效时处于该状态It is in this state when the signal af or full is valid   af_num~fifo_numaf_num~fifo_num   “10”"10"   溢出状态overflow state   当full有效且还有新的激励消息企图写入fifo时处于该状态It is in this state when full is valid and there are new incentive messages trying to write to fifo   激励消息发生溢出Incentive message overflow   “11”"11"

注:fifo_num表示fifo总的单元数。Note: fifo_num represents the total number of units of fifo.

通过向软件激励模块返回输入事务处理器的上述的状态编码,软件激励模块可以知道输入事务处理器处于“较空状态”、“中等状态”、“较满状态”和“溢出状态”四个状态中的一个,由此知道输入事务处理器的缓存空间的使用程度。在本发明中,根据上述的乐观预测方法,软件激励模块在激励发送状态收到“较空状态”和“中等状态”时继续保持激励发送状态,在收到“较满状态”时进入等待状态,在收到“溢出状态”时根据用户需要可以进行报错处理。软件激励模块在等待状态收到“较满状态”和“中等状态”时继续保持等待状态,在收到“较空状态”后才返回激励发送状态。By returning the above-mentioned state code of the input transaction processor to the software incentive module, the software incentive module can know that the input transaction processor is in four states of "empty state", "medium state", "full state" and "overflow state" One of them, thus knowing the usage level of the buffer space of the input transaction processor. In the present invention, according to the above-mentioned optimistic prediction method, the software incentive module continues to maintain the incentive sending state when the incentive sending state receives the "empty state" and "medium state", and enters the waiting state when receiving the "full state" , when the "overflow status" is received, error processing can be performed according to user needs. The software incentive module continues to maintain the waiting state when the waiting state receives the "full state" and "medium state", and returns to the incentive sending state after receiving the "relatively empty state".

通过更多种的状态信息的报告,软件激励模块可以根据输入事务处理器的缓存空间的使用程度来发送适量的激励消息。在“较空状态”软件激励模块可以连续发送多个激励消息,在“中等状态”软件激励模块可以连续发送少量激励消息,在“较满状态”软件激励模块应该停止发送激励消息,“溢出状态”用于系统报错。同时在激励发送状态与等待状态之间的转换使用了两个不同的门限值来进行区分,只有fifo使用大于af_num,激励发送状态才进入等待状态,只有fifo使用小于ae_num,等待状态才返回激励发送状态。由于af_num与ae_num的差别可以防止软件激励模块在激励发送状态与等待状态之间频繁转换。而且用户可以通过配置ae_num和af_num的值来调节系统的效率与稳定。By reporting more kinds of status information, the software incentive module can send an appropriate amount of incentive messages according to the usage level of the buffer space of the input transaction processor. In the "empty state" the software incentive module can send multiple incentive messages continuously, in the "medium state" the software incentive module can send a small amount of incentive messages continuously, in the "full state" the software incentive module should stop sending incentive messages, and in the "overflow state" " is used for system error reporting. At the same time, two different thresholds are used to distinguish the transition between the incentive sending state and the waiting state. Only when the fifo usage is greater than af_num, the incentive sending state enters the waiting state, and only when the fifo usage is smaller than ae_num, the waiting state returns to the incentive send status. Due to the difference between af_num and ae_num, the software incentive module can be prevented from frequently switching between the incentive sending state and the waiting state. Moreover, users can adjust the efficiency and stability of the system by configuring the values of ae_num and af_num.

因此,输入事务处理器的多种接收状态信息配合软件激励模块的乐观预测方法减少了处于等待的时间,实现了激励消息的更快发送速度。Therefore, the combination of various receiving state information input into the transaction processor and the optimistic prediction method of the software incentive module reduces the waiting time and realizes faster sending speed of the incentive message.

三、输入事务处理器的接收状态信息的全体反馈3. The overall feedback of the receiving status information of the input transaction processor

在一个事务级软硬件协同仿真系统中,通常有多个输入事务处理器需要对其对应的软件激励模块进行接收状态的信息反馈。通常,每个输入事务处理器独立完成各自的状态信息的反馈,在需要状态信息反馈时,输入事务处理器发送一个输入准备好消息给对应的软件激励模块。单独的输入准备好消息的格式示例如图2。由于每个输入事务处理器独立的进行状态信息报告,在输入准备好消息中需要有输入事务处理器的编号信息,同时每个输入准备好消息都有自己的额外消耗。在本发明中,状态信息报告不在是单独地针对一个输入事务处理器,而是用一个状态报告消息对所有的输入事务处理器的状态信息进行报告。该状态报告消息的格式如图6所示。假设共有n个输入事务处理器需要进行状态信息报告,则状态报告消息分为n个区域,每个区域占用2bit。各个区域按顺序分别对应了各个编号的输入事务处理器器的接收状态。区域内的2bit信息就是上述的输入事务处理器的状态信息编码。In a transaction-level software-hardware co-simulation system, there are usually multiple input transaction processors that need to provide information feedback on the receiving status of their corresponding software stimulus modules. Usually, each input transaction processor completes the feedback of its own status information independently, and when the status information feedback is required, the input transaction processor sends an input ready message to the corresponding software activation module. An example of the format of a separate input ready message is shown in Figure 2. Since each input transaction processor independently reports status information, the number information of the input transaction processor is required in the input ready message, and each input ready message has its own additional consumption. In the present invention, the status information report is no longer aimed at one input transaction processor alone, but uses one status report message to report the status information of all input transaction processors. The format of the status report message is shown in FIG. 6 . Assuming that a total of n input transaction processors need to report status information, the status report message is divided into n areas, and each area occupies 2 bits. Each area corresponds to the receiving status of each numbered input transaction processor in sequence. The 2-bit information in the area is the above-mentioned status information code input into the transaction processor.

该状态报告消息发给软件方后,软件根据约定编号顺序将各个输入事务处理器的状态信息解析出来,分发给各个对应的软件激励模块。软件激励模块根据其状态信息进行激励消息的流控。After the status report message is sent to the software side, the software parses the status information of each input transaction processor according to the agreed number sequence, and distributes it to each corresponding software incentive module. The software incentive module controls the flow of incentive messages according to its state information.

这种状态信息的全体反馈机制通过状态报告消息的约定位置标志各个输入事务处理器的状态信息,减少了原来的用于识别输入事务处理器的编号信息。同时用一个状态报告消息代替n个独立的输入事务处理器的输入准备好消息。因此该方法既将减少了通道上的数据传输量,也节约了频繁发送输入准备好消息的时间消耗。This overall feedback mechanism of state information marks the state information of each input transaction processor through the agreed position of the state report message, reducing the original number information used to identify the input transaction processor. At the same time, a status report message is used to replace the input ready messages of n independent input transaction processors. Therefore, this method will not only reduce the amount of data transmission on the channel, but also save the time consumption of frequently sending input ready messages.

四、周期发送状态报告消息4. Periodically send status report messages

为了保证激励消息不造成输入事务处理器的溢出,在过去的方法中,软件激励模块每次发送激励消息后,对应的输入事务处理器就必须检查其缓存空间是否还有剩余空间。如果有剩余空间就发送输入准备好消息,如果没有就等待直到有剩余空间再发送输入准备好消息。因此每一个激励消息都对应了一个输入准备好消息,输入准备消息好消息的平均产生速度与激励消息的平均产生速度相同。在激励消息较多的情况下,输入准备好消息将占用了大量的消息通道带宽,延迟整个协同仿真系统的仿真进度。In order to ensure that the incentive message does not cause the overflow of the input transaction processor, in the past method, after the software incentive module sends the incentive message each time, the corresponding input transaction processor must check whether there is any remaining space in its buffer space. Send an input ready message if there is room left, or wait until there is room left before sending an input ready message. Therefore, each incentive message corresponds to an input ready message, and the average generation speed of the input ready message good news is the same as the average generation speed of the incentive message. In the case of many incentive messages, the input ready message will occupy a large amount of message channel bandwidth and delay the simulation progress of the entire co-simulation system.

在本发明中,事务级软硬件协同仿真系统使用上述的状态报告消息代替输入准备好消息完成激励消息的流控功能。由于状态报告消息不再是对应某一个输入事务处理器模块或者某一个激励消息进行的状态反馈,所以不能也不需要使用激励消息来触发状态报告消息的发送。在本发明中,状态报告消息采用周期性发送方式,硬件方按照固定的周期采集各个输入事务处理器的接收状态信息,然后封装成一个状态报告消息发送给软件仿真方。用户可以根据系统中激励消息发送的频率和输入事务处理器的缓存空间大小来设置发送周期。只要保证输入事务处理器的缓存空间比较大,在一个周期内的激励消息不会立即造成缓存空间的溢出,那么周期性的状态报告消息就可以帮助软件激励模块实现激励消息的流控。通常只要状态报告消息的发送速度是单个输入事务处理器的激励消息的平均发送速度的1/4到1/2,就可以有效地实现对激励消息的流控。In the present invention, the transaction-level software-hardware co-simulation system uses the above-mentioned status report message to replace the flow control function of the input ready message to complete the incentive message. Since the status report message is no longer a status feedback corresponding to a certain input transaction processor module or a certain incentive message, it is neither possible nor necessary to use the incentive message to trigger the sending of the status report message. In the present invention, the status report message is sent in a periodic manner, and the hardware side collects the receiving status information of each input transaction processor according to a fixed period, and then encapsulates it into a status report message and sends it to the software simulation side. The user can set the sending period according to the frequency of sending incentive messages in the system and the size of the buffer space of the input transaction processor. As long as the buffer space of the input transaction processor is relatively large, and the incentive message within a period will not immediately cause the overflow of the buffer space, then the periodic status report message can help the software incentive module realize the flow control of the incentive message. Generally, as long as the sending speed of the status report message is 1/4 to 1/2 of the average sending speed of a single input transaction processor's incentive message, the flow control of the incentive message can be effectively realized.

周期性的状态报告消息使得用于激励消息流控的状态反馈消息数量不再是与激励消息的数量呈正比,而是与用户设置的发送周期呈正比,大约是单个输入事务处理器发送的激励消息的四分之一。一旦设定了发送周期,在整个协同仿真过程中该状态报告消息占用的消息通道的带宽是一个较稳定的数值,不会和激励消息的发送速度相关。因此,周期性的状态报告消息机制即有助于节约消息通道的带宽也提高了协同仿真速度的稳定性。Periodic status report messages make the number of status feedback messages used for incentive message flow control no longer proportional to the number of incentive messages, but proportional to the sending cycle set by the user, which is about the incentive sent by a single input transaction processor a quarter of the message. Once the sending period is set, the bandwidth of the message channel occupied by the status report message in the whole co-simulation process is a relatively stable value, which will not be related to the sending speed of the stimulus message. Therefore, the periodic status report message mechanism not only helps to save the bandwidth of the message channel but also improves the stability of the co-simulation speed.

性能估计performance estimation

在仿真过程中,硬件仿真方周期性的产生的状态报告消息告知软件仿真方各个输入事务处理器的状态信息。假设系统中有n个输入事务处理器,单位时间内每个输入事务处理器平均收到激励消息为v个,且状态报告消息的大小根据图6所示为(2n)bit,设置状态报告消息的发送速度为激励消息发送速度的1/4,于是可以得出单位时间内状态报告消息平均消耗了(2n*(1/4)*v)bit=(1/2*n*v)bit的传输数据量。由此可见,对比原来方法的(9*n*v)bit,本发明中的状态报告消息完成同样的流控功能消耗了更少的消息通道带宽。During the emulation process, the hardware emulator periodically generates status report messages to inform the software emulator of the state information of each input transaction processor. Assuming that there are n input transaction processors in the system, each input transaction processor receives an average of v incentive messages per unit time, and the size of the status report message is (2n)bit as shown in Figure 6. Set the status report message The sending speed is 1/4 of the sending speed of the incentive message, so it can be concluded that the status report message per unit time consumes (2n*(1/4)*v)bit=(1/2*n*v)bit on average The amount of data transferred. It can be seen that, compared with the (9*n*v)bit in the original method, the status report message in the present invention consumes less message channel bandwidth to complete the same flow control function.

本发明的有益效果是:The beneficial effects of the present invention are:

本发明提供了更高速的事务级软硬件协同仿真的方法和用于激励消息的流控功能的状态报告消息的定义。在该方法中,软件激励模块采用乐观预测方法判断输入事务处理器的接收状态,输入事务处理器提供四种接收状态来反映其缓存空间的使用程度,硬件方还定义了状态报告消息,该消息将所有的输入事务处理器的接收状态信息周期性的报告给软件方。本发明通过用乐观预测代替悲观预测,用四种接收状态代替两种接收状态,用全体状态报告代替单独状态报告,用周期性状态报告代替激励消息触发状态报告等四个主要方面的改善,减少了软件激励模块处于等待状态的次数和时间,即加快了激励消息的发送速度,同时使用状态报告消息减小了状态反馈消息对消息通道的带宽的占用,即缩小了各种消息在通道上传输的延迟时间。总之本发明通过提高激励消息的流控效率,可以大大提高该仿真系统的仿真速度。该发明可以为事务级软硬件协同仿真系统提供以下优点:The invention provides a higher-speed transaction-level software-hardware co-simulation method and the definition of the status report message used for the flow control function of the incentive message. In this method, the software incentive module uses an optimistic prediction method to judge the receiving state of the input transaction processor, and the input transaction processor provides four receiving states to reflect the use degree of its buffer space. The hardware side also defines a status report message, the message Periodically report the receiving status information of all input transaction processors to the software side. The present invention replaces pessimistic prediction with optimistic prediction, replaces two receiving states with four kinds of receiving states, replaces single state report with overall state report, replaces incentive message trigger state report with periodic state report, and reduces Reduce the times and time that the software incentive module is in the waiting state, that is, speed up the sending speed of the incentive message, and use the status report message to reduce the bandwidth occupation of the message channel by the status feedback message, that is, reduce the transmission of various messages on the channel delay time. In a word, the present invention can greatly improve the simulation speed of the simulation system by improving the flow control efficiency of the incentive message. The invention can provide the following advantages for a transaction-level software-hardware co-simulation system:

1、通过乐观预测方法,使得软件激励模块更多的处于激励发送状态,激励消息可以更加流畅的发送到输入事务处理器。因此同样的时间内更多的激励消息被处理,协同仿真系统的仿真也更快。1. Through the optimistic prediction method, the software incentive module is more in the incentive sending state, and the incentive message can be sent to the input transaction processor more smoothly. Therefore, more stimulus messages are processed in the same time, and the simulation of the co-simulation system is faster.

2、通过输入事务处理器的多个接收状态的编码,软件激励模块可以更加详细的了解输入事务处理器的缓存空间的使用程度,由此可以更加精确的调节激励消息的发送速度。恰当的激励消息的发送速度可以帮助提高协同仿真系统的仿真速度。2. Through the encoding of multiple receiving states of the input transaction processor, the software incentive module can learn more about the utilization degree of the buffer space of the input transaction processor, thereby adjusting the sending speed of the incentive message more accurately. Proper sending speed of stimulus messages can help improve the simulation speed of the co-simulation system.

3、通过将所有的输入事务处理器的接收状态都放在一个状态报告消息里发送,协同仿真系统减少了需要发送的状态反馈消息的数量,减小了消息通道的带宽消耗,缩小了协同仿真系统中所有消息的传输延迟,由此提高了协同仿真系统的速度。3. By sending the receiving status of all input transaction processors in a status report message, the co-simulation system reduces the number of status feedback messages that need to be sent, reduces the bandwidth consumption of the message channel, and reduces the co-simulation The transmission delay of all messages in the system, thereby increasing the speed of the co-simulation system.

4、通过采用周期性的发送状态报告消息,在确定发送周期后,该协同仿真系统中的状态报告消息占用的消息通道带宽成为一个较稳定的数值。该方法可以进一步减小状态反馈消息的数量,提高协同仿真系统的速度,并且还可以提高协同仿真系统的仿真速度的稳定性。4. By sending the status report messages periodically, after the sending cycle is determined, the message channel bandwidth occupied by the status report messages in the co-simulation system becomes a relatively stable value. The method can further reduce the number of state feedback messages, increase the speed of the co-simulation system, and can also improve the stability of the simulation speed of the co-simulation system.

附图说明Description of drawings

图1:事务级的软硬件协同仿真系统的基本结构示意图。Figure 1: Schematic diagram of the basic structure of a transaction-level software-hardware co-simulation system.

图2:输入准备好消息的格式示意图。Figure 2: Schematic representation of the format of the input ready message.

图3:软件激励模块采用悲观方法预测接收状态示意图。Figure 3: Schematic diagram of the pessimistic approach used by the software incentive module to predict the receiving state.

图4:本发明采用乐观方法预测接收状态示意图。Fig. 4: Schematic diagram of the present invention using an optimistic method to predict the receiving state.

图5:输入事务处理器的基本结构示意图。Figure 5: Schematic diagram of the basic structure of an input transaction processor.

图6:状态报告消息的格式示意图。Figure 6: Schematic diagram of the format of a status report message.

Claims (1)

1.一种高速事务级软硬件协同仿真方法,其特征在于,包括以下步骤:1. A high-speed transaction level software-hardware co-simulation method, is characterized in that, comprises the following steps: 步骤1、软件仿真方进行初始化Step 1. The software simulation side initializes 软件仿真方先进行初始化,软件仿真方在稳定后向硬件仿真方发送复位信号,通知硬件仿真方进行初始化;然后经过一段时间的延迟,保证硬件仿真方已经进入正常工作状态后,软件激励模块直接转移到激励发送状态,发送激励消息;The software simulation side initializes first, and after the software simulation side is stable, it sends a reset signal to the hardware simulation side to notify the hardware simulation side to initialize; then after a period of delay, after the hardware simulation side has entered the normal working state, the software stimulates the module directly Transfer to the incentive sending state and send incentive messages; 步骤2、硬件仿真方在收到复位信号后进行初始化,各个输入事务处理器开始准备接收激励消息;Step 2, the hardware emulator initializes after receiving the reset signal, and each input transaction processor starts to prepare to receive the incentive message; 步骤3、软件仿真方进行相应的仿真任务,在发生约定的事务后,软件激励模块向对应的输入事务处理器发送激励消息,然后软件激励模块继续保持在激励发送状态,并继续之后的仿真任务;Step 3. The software simulation party performs the corresponding simulation task. After the agreed transaction occurs, the software incentive module sends an incentive message to the corresponding input transaction processor, and then the software incentive module continues to maintain the incentive sending state, and continues the subsequent simulation tasks ; 步骤4、硬件仿真方的输入事务处理器在收到激励消息后将消息翻译成对应的多个时钟周期的激励信号,实现对被测模块的激励输入;同时,硬件仿真方定期检查所有输入事务处理器的消息缓存空间的使用情况,向软件仿真方发送状态报告消息,状态报告消息格式由顺序编号的各输入事务处理器的状态编码组成;所述各输入事务处理器的状态编码如下表所述;Step 4. After receiving the stimulus message, the input transaction processor of the hardware emulator translates the message into corresponding stimulus signals of multiple clock cycles to realize the stimulus input to the module under test; at the same time, the hardware simulator regularly checks all input transactions The usage of the message cache space of the processor sends a status report message to the software simulation side, and the status report message format is composed of the status codes of each input transaction processor with sequential numbers; the status codes of each input transaction processor are as shown in the following table stated; 输入事务处理器的四个接收状态表Four Receive Status Tables for Input Transaction Processors     状态 state     输入事务处理器处于该状态的条件Enter the conditions for the transaction processor to be in this state 此状态下fifo的使用情况The usage of fifo in this state 此状态的编码code for this state   较空状态Empty state 当信号empty或者ae有效时When the signal empty or ae is active     0~ae_num0~ae_num     “00”"00"   中等状态Moderate state 当四个信号empty、ae、af、full都无效时When the four signals empty, ae, af, full are invalid     ae_num~af_numae_num~af_num     “01”"01"   较满状态relatively full state 当信号af或者full有效时处于该状态It is in this state when the signal af or full is valid     af_num~fifo_numaf_num~fifo_num     “10”"10"   溢出状态overflow state 当full有效且还有新的激励消息企图写入fifo时处于该状态It is in this state when full is valid and there are new stimulus messages trying to write to fifo     激励消息发生溢出Incentive message overflow     “11”"11"
注:fifo_num表示fifo总的单元数Note: fifo_num represents the total number of units of fifo 步骤5、软件激励模块在收到状态报告消息后,根据对应输入事务处理器的状态编码进行状态转移控制Step 5. After receiving the status report message, the software incentive module performs state transfer control according to the state code of the corresponding input transaction processor 软件激励模块处于激励发送状态时,若收到“10”或者“11”状态编码,则转入到等待状态,否则不变;软件激励模块处于等待状态时,若收到“00”状态编码,则转入到激励发送状态;When the software incentive module is in the incentive sending state, if it receives the "10" or "11" state code, it will enter the waiting state, otherwise it will remain unchanged; when the software incentive module is in the waiting state, if it receives the "00" state code, Then transfer to the incentive sending state; 步骤6、硬件仿真方的输出事务处理器在仿真过程中监视被测模块的输出端口,不断的将响应信号的变化用响应消息进行编码,并且将响应消息发给对应的软件响应模块;Step 6, the output transaction processor of the hardware simulation side monitors the output port of the module under test during the simulation process, continuously encodes the change of the response signal with a response message, and sends the response message to the corresponding software response module; 步骤7、软件响应模块在接收响应消息后,进行相应的响应记录和分析,判断被测模块的输出是否正确;Step 7, after receiving the response message, the software response module performs corresponding response recording and analysis to determine whether the output of the tested module is correct; 在整个仿真过程中,步骤3、4,5不断重复,步骤6、7不断重复。Throughout the simulation process, steps 3, 4, and 5 are repeated, and steps 6 and 7 are repeated.
CNB2006100207017A 2006-04-13 2006-04-13 A high-speed transaction-level software-hardware co-simulation method Expired - Fee Related CN100373351C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100207017A CN100373351C (en) 2006-04-13 2006-04-13 A high-speed transaction-level software-hardware co-simulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100207017A CN100373351C (en) 2006-04-13 2006-04-13 A high-speed transaction-level software-hardware co-simulation method

Publications (2)

Publication Number Publication Date
CN1828551A CN1828551A (en) 2006-09-06
CN100373351C true CN100373351C (en) 2008-03-05

Family

ID=36946962

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100207017A Expired - Fee Related CN100373351C (en) 2006-04-13 2006-04-13 A high-speed transaction-level software-hardware co-simulation method

Country Status (1)

Country Link
CN (1) CN100373351C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101365150B (en) * 2007-08-08 2011-08-24 华为技术有限公司 Method and node for improving multicast transmission efficiency based on random network coding
CN102760176B (en) * 2011-04-29 2015-02-11 无锡江南计算技术研究所 Hardware transaction level simulation method, engine and system
CN106326599B (en) * 2016-09-14 2020-03-10 苏州浪潮智能科技有限公司 System state monitoring method and device for multiprocessor system simulation
CN109213626A (en) * 2018-08-20 2019-01-15 上海集成电路研发中心有限公司 A kind of control method of state machine and its state machine
CN109683877B (en) * 2018-12-11 2022-03-15 中国航空工业集团公司西安航空计算技术研究所 SystemC-based GPU software and hardware interaction TLM system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1420434A (en) * 2001-11-16 2003-05-28 深圳市中兴通讯股份有限公司上海第二研究所 Board stage supporting packet simulation method
CN1582432A (en) * 2000-06-19 2005-02-16 P·C·克劳斯及合伙人公司 Distributed simulation
US20050223281A1 (en) * 2004-02-03 2005-10-06 Maly John W Transaction logging and intelligent error reporting in an expectation-based memory agent checker

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1582432A (en) * 2000-06-19 2005-02-16 P·C·克劳斯及合伙人公司 Distributed simulation
CN1420434A (en) * 2001-11-16 2003-05-28 深圳市中兴通讯股份有限公司上海第二研究所 Board stage supporting packet simulation method
US20050223281A1 (en) * 2004-02-03 2005-10-06 Maly John W Transaction logging and intelligent error reporting in an expectation-based memory agent checker

Also Published As

Publication number Publication date
CN1828551A (en) 2006-09-06

Similar Documents

Publication Publication Date Title
CN100399341C (en) A Vector Mode Software-Hardware Co-simulation/Verification Method
US6970966B2 (en) System of distributed microprocessor interfaces toward macro-cell based designs implemented as ASIC or FPGA bread boarding and relative common bus protocol
EP2413355B1 (en) An interconnect that eliminates routing congestion and manages simultaneous transactions
Fummi et al. A SystemC-based framework for modeling and simulation of networked embedded systems
US8499201B1 (en) Methods and systems for measuring and presenting performance data of a memory controller system
CN100373351C (en) A high-speed transaction-level software-hardware co-simulation method
CN109683877A (en) A kind of GPU software and hardware interaction TLM system based on SystemC
WO2024130861A1 (en) Cloud native hardware logic simulation fpga acceleration method and system
CN114253889A (en) Approximate data bus inversion techniques for delay sensitive applications
CN115562617B (en) Depth setting method and system of FIFO memory and electronic equipment
US20100161305A1 (en) Performance evaluation device, performance evaluation method and simulation program
CN112328460B (en) Bus performance simulation method and device, storage medium and electronic device
CN101777035A (en) Implementation method for AMBA AHB bus and device thereof
US11392533B1 (en) Systems and methods for high-speed data transfer to multiple client devices over a communication interface
US9075639B1 (en) Systems and methods for handling interrupts during software design simulation
Kurmi et al. Design of AHB protocol block for advanced microcontrollers
Mahesh et al. Functional verification of the Axi2OCP bridge using system verilog and effective bus utilization calculation for AMBA AXI 3.0 protocol
TWI427496B (en) Method and system of generating a model of an integrated circuit
Seiculescu et al. A dram centric noc architecture and topology design approach
CN112836455A (en) SOC simulation method and system
Stefanni et al. Systemc simulation of networked embedded systems
CN116842902B (en) System-level simulation modeling method for black box model
CN103164370B (en) A kind of high-speed local bus access control interface module
Lee et al. A prediction packetizing scheme for reducing channel traffic in transaction-level hardware/software co-emulation
Whangbo et al. Exploring Industry Standard System Integration for Hardware-Software Co-Design of PCI Express

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080305

Termination date: 20110413