Method and device for sending reply message, computer equipment and storage medium
The adapter device in the simulation platform accurately simulates RTL and SystemC communication by determining data operation completion, addressing the delay discrepancies in current simulation methods and enhancing simulation accuracy.
Patent Information
- Application Number
- CN202411080431.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-03
AI Technical Summary
Current simulation platforms fail to accurately simulate the communication process between Register Transfer Level (RTL) and SystemC due to uncertain delay times, leading to discrepancies between simulated and actual scenarios.
An adapter device is used to determine the completion of data operations by the SystemC module, sending a response message only when the operation is finished, thereby aligning the simulation with actual delays and ensuring accurate communication simulation between RTL and SystemC.
The solution allows for real-time tracking of data operation progress, reducing resource consumption, and ensuring accurate simulation results by adapting to different data scales and types, while avoiding data loss and damage.
Smart Images

Figure CN119067024A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, an apparatus, a computer device and a storage medium for sending a reply message. Background Art
[0002] In the field of computer technology, the design of System-on-a-Chip (SoC) is very complex. Before designing SOC, it is necessary to simulate each module in SOC to determine whether the design of each module can meet the actual needs.
[0003] The current simulation platform generally uses RTL modules and adapter devices to simulate the communication process between SystemC and register transfer level circuits (Register Transfer Level) of SOC. The RTL module sends a request message to the adapter device, and a fixed response delay is configured in the adapter device. After receiving the request message sent by the RTL module, the timing starts. When the timing reaches the pre-configured response delay, the response message is returned to the RTL module.
[0004] However, in actual application scenarios, the delay time for SystemC to process each read and write request is also uncertain, and the communication process between RTL and SystemC simulated by the above simulation method does not conform to the actual situation. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, computer device, storage medium and program product for sending a reply message to solve the problem that the related art cannot simulate the actual communication process between RTL and SystemC.
[0006] In a first aspect, the present invention provides a method for sending a reply message, the method is applied to a simulation platform, the simulation platform includes an adapter device, a SystemC module and a register conversion stage circuit module, the method is performed by the adapter device, and the method includes:
[0007] Obtain at least one copy request message, at least one original request message, and a first response message generated by the SystemC module;
[0008] Determining, according to the first response message, a first copy request message corresponding to the first response message in at least one of the copy request messages;
[0009] Determining, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message, wherein the first original request is an original request message in at least one of the original request messages corresponding to the first copy request message;
[0010] When it is determined that the data operation corresponding to the first original request message is completed, a total reply message corresponding to the first original request message is sent to the register conversion stage circuit module.
[0011] The method for sending a reply message provided by the present invention has the following advantages:
[0012] The adapter device can send a response message to the RTL module according to the actual delay of the SystemC module in processing data, that is, it can determine in real time whether the relevant data operation is completed by copying the request message and the response message, and send the response message to the RTL module only when it is determined that the relevant data operation is completed. In this way, the communication process between RTL and SystemC can be truly simulated, the corresponding problems can be found, and corrected in time.
[0013] In an optional implementation, the response message includes data operation information, the copy request message includes operation progress information and address information, the address information includes data length, the operation progress information is an array, the array includes at least one element, and the number of elements included in the array is proportional to the data length;
[0014] The determining, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message includes:
[0015] According to the first data operation information included in the first response message, determining a target element corresponding to the first data operation information from at least one element of the array included in the first replication request message;
[0016] Modify the original value of the target element in the array included in the first replication request message to the first value, to obtain an updated first replication request message;
[0017] Determining whether the values of all elements in the array included in the updated first replication request message are all the first values;
[0018] When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, determining that the SystemC module completes the data operation corresponding to the first original request message;
[0019] or,
[0020] When it is determined that the value of any element in the updated first replication request message is not the first value, it is determined that the SystemC module has not completed the data operation corresponding to the first original request message.
[0021] Specifically, by maintaining an array proportional to the data length, the operation progress of each data block can be accurately tracked. The size of the array can be dynamically adjusted according to the data length, which is suitable for data operations of different scales and various types of data operations, such as reading and writing. The array can reflect the operation progress in real time, which helps to adjust the task scheduling or resource allocation strategy in time.
[0022] In an optional implementation, the total reply message is the updated first replication request message.
[0023] Specifically, there is no need to generate a new total reply message, but the updated first replication request message is used as the total reply message, which can save computing resources and storage resources.
[0024] In an optional implementation, when it is determined that the SystemC module has not completed the data operation corresponding to the first original request message, the method further includes:
[0025] Waiting for a second response message corresponding to the first original request message;
[0026] Upon receiving the second response message, determining again based on the second response message and the updated first copy request message whether the SystemC module has completed the data operation corresponding to the first original request message;
[0027] When it is determined that the SystemC module has completed the data operation corresponding to the first original request message, the updated first copy request message is updated according to the second response message to obtain the first copy request message that is updated again;
[0028] The first copy request message that has been updated again is sent to the register conversion stage circuit module as a total reply message corresponding to the first original request message.
[0029] Specifically, in the case of incompleteness, by continuously waiting for a new response message, the continuity of data operations can be ensured and data loss or damage due to abnormal situations can be avoided.
[0030] In an optional implementation, the replication request message also includes a request status;
[0031] When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, the method further includes:
[0032] The first request status included in the first replication request message is modified to a completion status.
[0033] Specifically, by changing the request status to the completed status, it can be clearly indicated that the data operation has been successfully completed. When subsequently determining the copy request message corresponding to the corresponding response message, only the copy request message whose request status is not the completed status can be focused on, thereby narrowing the comparison scope and speeding up the processing.
[0034] In an optional embodiment, the method further includes:
[0035] Obtaining a second original request message sent by the register conversion stage circuit module;
[0036] Copying the second original request message to obtain a second copied request message;
[0037] The second replication request message is stored.
[0038] Specifically, this solution can realize the concurrent processing of request messages, without waiting for the previous request message to be processed before processing the next request message, which is more in line with the actual situation and makes the simulation results more accurate.
[0039] In an optional implementation, the communication protocol between the register conversion stage circuit module and the SystemC module is an Advanced eXtensible Interface AXI protocol;
[0040] After obtaining the second original request message sent by the register conversion stage circuit module, the method further includes:
[0041] A handshake message is sent to the register conversion stage circuit module, wherein the handshake message is used to instruct the register conversion stage circuit module to send a next original request message corresponding to the second original request message.
[0042] Specifically, for different communication protocols, the way in which the adapter device sends the response message can be adaptively modified, which has wider applicability.
[0043] In a second aspect, the present invention provides an adapter device, the device comprising:
[0044] An acquisition module, used for acquiring at least one copy request message, at least one original request message and a first response message generated by the SystemC module;
[0045] A determination module, configured to determine, according to the first response message, a first copy request message corresponding to the first response message in at least one of the copy request messages; and determine, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message, wherein the first original request is an original request message corresponding to the first copy request message in at least one of the original request messages;
[0046] A sending module is used to send a total reply message corresponding to the first original request message to the register conversion stage circuit module when it is determined that the data operation corresponding to the first original request message is completed.
[0047] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method for sending a reply message of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for sending a reply message of the above-mentioned first aspect or any corresponding embodiment thereof.
[0049] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the method for sending a reply message of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 is a schematic diagram of the architecture of a simulation platform according to an embodiment of the present invention;
[0052] Figure 2 is a flowchart of a method for sending a reply message according to an embodiment of the present invention;
[0053] Figure 3 is a data flow diagram of a simulation platform according to an embodiment of the present invention;
[0054] Figure 4is a schematic diagram of a processing timing of a read request message according to an embodiment of the present invention;
[0055] Figure 5 is a structural block diagram of an adapter device according to an embodiment of the present invention;
[0056] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0058] The embodiments of the present invention can be applied to Figure 1 The simulation platform shown in the figure may include an adapter device, a SystemC module and a register transfer level (RTL) module. SystemC is a language for system design based on the C++ language, and the SystemC module is used to simulate the hardware configured with the SystemC software system. In the actual product, the hardware where the SystemC software system is located and the RTL interact with each other through electrical signals. In the simulation platform, the SystemC module and the RTL module are software programs, and the interaction process between the hardware where the SystemC software system is located and the RTL is simulated through messages. The simulation platform can be a computer device or a computer device cluster, for example, the computer device can be a server, a terminal, etc.
[0059] The design of System-on-a-Chip (SoC) is very complex. Before designing SOC, it is necessary to simulate each module in SOC to determine whether the design of each module can meet the actual needs. When simulating the communication process between SystemC and Register Transfer Level of SOC, the above simulation platform can be used to simulate to find out whether there are problems in SOC design and make corresponding improvements.
[0060] The embodiment of the present invention provides a method for sending a reply message. The adapter device sends a reply message to the RTL according to the real delay of the SystemC module actually processing the request message, which complies with the real communication process between the RTL and the SystemC in the SOC.
[0061] According to an embodiment of the present invention, a method embodiment for sending a reply message is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] In this embodiment, a method for sending a reply message is provided, which can be executed by the adapter device in the above simulation platform. Figure 2 is a flow chart of a method for sending a reply message according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0063] Step S201, obtaining at least one copy request message, at least one original request message and a first response message generated by the SystemC module.
[0064] Among them, the original request message (which may be tlm_trans_req) may be a transaction-level request message. The original request message and the copy request message (tlm_trans_req_copy) may include message identification information, operation type, address information, operation progress information, request status and delay information. The operation type may be a read operation type or a write operation type. When the operation type is a write operation type, the original request message may also include total write data. The address information may include a starting position and a data length. The operation progress information may be an array, and the array may include at least one element, and the number of elements in the array may be proportional to the data length in the address information. The request status may be a completed state or an uncompleted state. The request status may be represented by a numerical value, for example, a first numerical value may represent a completed state, and a second numerical value may represent an uncompleted state, and the first numerical value may be 1, and the second numerical value may be 0.
[0065] The response message may include address information and data operation information. When the operation type is a read operation type, the data operation information may include data information of the completed read operation, for example, the data information may be the starting position and address information of the data of the completed read operation, or it may be the order of the data of the completed read operation in the total data that needs to be read. When the operation type is a write operation type, the data operation information may include data information of the completed write operation, for example, the data information may be the starting position and address information of the data of the completed write operation, or it may be the order of the data of the completed write operation in the total write data. The response message may include identification information, address information, data operation information and operation type of the message. When the operation type is a read operation type, the response message may also include read data.
[0066] Specifically, the RTL module can generate an original request message according to its own processing rules and send it to the adapter device. The adapter device can monitor whether the data port connected to the RTL module receives the original request message. If yes, the operation progress information and request status of the message can be initialized, that is, the operation progress information is set to a zero progress state, for example, each element in the array corresponding to the operation progress information can be initialized to a third value, and the request status is set to an unfinished state, for example, the target parameter value in the request status is initialized to a third value. For example, the third value can be 0.
[0067] Furthermore, the adapter device can copy the initialized original request message, obtain the copy request message and store it. The adapter device also needs to send the original request message to the SystemC module to send the original request message. After receiving the original request message, the SystemC module can perform corresponding operations according to the operation type and address information in the original request message (when the operation type is a write operation type, the original request message can also include write data), and generate a response message to send to the adapter device. Since the data length included in the address information carried in different original request messages is different, and the adapter device and the SystemC module can only transmit a certain length of data when transmitting data, therefore, for each original request message, the adapter device and the SystemC module need to complete at least one data transmission process corresponding to the data length, that is, one original request message can correspond to at least one response message.
[0068] In some optional embodiments, when the communication protocol between the register conversion level circuit module and the SystemC module is the Advanced eXtensible Interface (AXI) protocol, since the AXI protocol needs to transmit a handshake signal when transmitting data, accordingly, the adapter device can send a handshake message to the RTL module every time it receives an original request message, and the RTL module can send the next original request message after receiving the handshake message.
[0069] Step S202: According to the first response message, determine in at least one copy request message a first copy request message corresponding to the first response message.
[0070] Specifically, after the adapter device receives the first response message, the first identification information, the first address information, the first operation type and the first data operation information can be parsed from the first response message, and when the operation type of the first copy request message is a read operation type, the first read data can also be parsed from the first response message. Further, the first copy request message that matches the first identification information, the first address information and the first operation type can be determined from at least one copy request message stored in the adapter device.
[0071] Step S203: determining, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message.
[0072] The first original request may be an original request message in at least one original request message corresponding to the first copied request message.
[0073] Specifically, since the first response message may be the first response message corresponding to the first original request message received by the adapter device, or may be the last response message corresponding to the first original request message received by the adapter device, or may be other response messages corresponding to the first original request message, in order to timely update the operation progress corresponding to the first original request message, and determine whether the data operation corresponding to the first original request message is completed according to the operation progress, the following steps may be performed:
[0074] Step 1: According to the first data operation information included in the first response message, determine a target element corresponding to the first data operation information from at least one element of the array included in the first replication request message.
[0075] Step 2: modify the original value of the target element in the array included in the first replication request message to the first value, and obtain an updated first replication request message.
[0076] Step three: determine whether the values of all elements in the array included in the updated first replication request message are all first values.
[0077] Step 4: when it is determined that the values of all elements in the array included in the updated first replication request message are the first values, it is determined that the SystemC module completes the data operation corresponding to the first original request message.
[0078] Step 5: When it is determined that the value of any element in the updated first replication request message is not the first value, it is determined that the SystemC module has not completed the data operation corresponding to the first original request message.
[0079] Example 1, the first data operation information is "2", it can be considered that the first response message is the second response message in at least one response message corresponding to the first copy request, the array includes 5 elements [1,0,0,0,0], the adapter device can modify the original value "0" of the second element to the first value "1", then the updated array is [1,1,0,0,0], not all elements are "1", therefore, it can be determined that the SystemC module has not completed the data operation corresponding to the first original request message.
[0080] Example 2, the first data operation information is "5", it can be considered that the first response message is the fifth response message of at least one response message corresponding to the first copy request, the array includes 5 elements [1,1,1,1,0], the adapter device can modify the original value "0" of the fifth element to the first value "1", then the updated array is [1,1,1,1,1], all elements are "1", therefore, it can be determined that the SystemC module has completed the data operation corresponding to the first original request message.
[0081] In some optional implementations, the adapter device may modify the first request state included in the first copy request message to a completed state when it is determined that all elements in the array in the first copy request message are the first numerical value, and specifically may modify the numerical value used to represent the request state to the first numerical value. The adapter device monitors the first request state in the first copy request message, and may determine that the SystemC module has completed the data operation corresponding to the first original request message when it is monitored that the first request state in the first copy request message has changed to the first numerical value.
[0082] In this way, each time the adapter device receives a response message, it can determine the copy request message corresponding to the response message from the copy request messages whose request status is incomplete, thereby reducing the comparison scope.
[0083] In some optional embodiments, when the adapter device determines that all elements in the array are the first numerical value, it can obtain the reception time of the first original request message and the reception time of the last response message corresponding to the first original request message, calculate the delay length, and fill it into the delay information of the first copy request message, so as to subsequently analyze the data processing behavior of the adapter device and the SystemC module.
[0084] In some optional implementations, when the operation type included in the first copy request message is a read operation type, the adapter device may add the first read data in the first response message to the first copy request message.
[0085] Step S204: When it is determined that the data operation corresponding to the first original request message is completed, a total reply message corresponding to the first original request message is sent to the register conversion stage circuit module.
[0086] Specifically, when it is determined that the data operation corresponding to the first original request message is completed, the updated first copy request message can be sent to the register conversion level circuit module as a total reply message corresponding to the first original request message. When sending the total reply message, the adapter device can simulate the conversion of the transaction level message into a signal level stimulus and determine it on the port of the RTL module.
[0087] Alternatively, when it is determined that the SystemC module has not completed the data operation corresponding to the first original request message, the following steps may also be performed:
[0088] Step 1: Wait for a second response message corresponding to the first original request message.
[0089] Step 2: upon receiving the second response message, determining again based on the second response message and the updated first copy request message whether the SystemC module has completed the data operation corresponding to the first original request message.
[0090] Step three: when it is determined that the SystemC module has completed the data operation corresponding to the first original request message, the updated first copy request message is updated according to the second response message to obtain a further updated first copy request message.
[0091] Step 4: Send the updated first copy request message as a total reply message corresponding to the first original request message to the register conversion stage circuit module.
[0092] The specific processing of step 2 to step 3 in step S204 can refer to the specific processing in step S204, which will not be repeated here.
[0093] If after receiving the second response message, it is determined that the SystemC module has not yet completed the data operation corresponding to the first original request message, you can wait again for the third response message corresponding to the first original request message, and so on, until it is determined that the SystemC module has completed the data operation corresponding to the first original request message.
[0094] The above method of sending a reply message can be used in the data flow of the simulation platform as follows Figure 3 shown.
[0095] In the method for sending a reply message provided in this embodiment, the adapter device can send a response message to the RTL module according to the actual delay of the SystemC module in processing data, that is, by determining in real time whether the relevant data operation is completed by copying the request message and the response message, and sending the response message to the RTL module only when it is determined that the relevant data operation is completed. In this way, the communication process between the RTL and SystemC can be truly simulated, the corresponding problems can be found, and then corrected.
[0096] In addition, this solution can realize concurrent processing of the original request message, which is consistent with the actual situation. The response message received by the adapter device from SystemC can be received in disorder, and it does not need to be received in the order in which the original request message is sent, thus realizing disorderly processing of requests. Figure 4 As shown in the figure, the RTL module sends three read request messages, which are recorded as request message 0, request message 1, and request message 2. The delays of the SystemC module in processing the read request are recorded as: latency0, latency1, and latency2. When latency1>latency2>latency0, the order of responses received by the RTL module is request 1->request 3->request 2.
[0097] In this embodiment, an adapter device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0098] This embodiment provides an adapter device, such as Figure 5 As shown, including:
[0099] An acquisition module 501 is used to acquire at least one copy request message, at least one original request message and a first response message generated by the SystemC module;
[0100] The determination module 502 is used to determine, according to the first response message, a first copy request message corresponding to the first response message in at least one copy request message; and determine, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message, wherein the first original request is an original request message corresponding to the first copy request message in the at least one original request message;
[0101] The sending module 503 is used to send a total reply message corresponding to the first original request message to the register conversion stage circuit module when it is determined that the data operation corresponding to the first original request message is completed.
[0102] In some optional implementations, the response message includes data operation information, the copy request message includes operation progress information and address information, the address information includes the data length, the operation progress information is an array, the array includes at least one element, and the number of elements included in the array is proportional to the data length;
[0103] The determination module 502 is specifically configured to:
[0104] According to the first data operation information included in the first response message, determining a target element corresponding to the first data operation information from at least one element of the array included in the first replication request message;
[0105] Modify the original value of the target element in the array included in the first replication request message to the first value, to obtain an updated first replication request message;
[0106] Determine whether the values of all elements in the array included in the updated first replication request message are all first values;
[0107] When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, determining that the SystemC module completes the data operation corresponding to the first original request message;
[0108] or,
[0109] When it is determined that the value of any element in the updated first replication request message is not the first value, it is determined that the SystemC module has not completed the data operation corresponding to the first original request message.
[0110] In some optional implementations, the total reply message is the updated first replication request message.
[0111] In some optional implementations, the determination module 502 is further configured to:
[0112] When it is determined that the SystemC module has not completed the data operation corresponding to the first original request message, waiting for a second response message corresponding to the first original request message;
[0113] When the second response message is received, determining again based on the second response message and the updated first copy request message whether the SystemC module has completed the data operation corresponding to the first original request message;
[0114] When it is determined that the SystemC module has completed the data operation corresponding to the first original request message, the updated first copy request message is updated according to the second response message to obtain a first copy request message that is updated again;
[0115] The sending module is further used to send the first copied request message after the re-update as a total reply message corresponding to the first original request message to the register conversion stage circuit module.
[0116] In some optional implementations, the replication request message also includes a request status; the determination module 502 is further configured to:
[0117] When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, the first request status included in the first replication request message is modified to a completion status.
[0118] In some optional implementations, the acquisition module 501 is further used to:
[0119] Obtaining a second original request message sent by the register conversion stage circuit module;
[0120] Copying the second original request message to obtain a second copied request message;
[0121] The second replication request message is stored.
[0122] In some optional implementations, the communication protocol between the register conversion stage circuit module and the SystemC module is an Advanced Extensible Interface AXI protocol;
[0123] The acquisition module 501 is further used for:
[0124] A handshake message is sent to the register conversion stage circuit module, wherein the handshake message is used to instruct the register conversion stage circuit module to send a next original request message corresponding to the second original request message.
[0125] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0126] The adapter device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0127] The embodiment of the present invention also provides a computer device having the above Figure 5 Adapter assembly shown.
[0128] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0129] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0130] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0131] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0132] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0133] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0134] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0135] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0136] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for sending a reply message, characterized in that: The method is applied to a simulation platform, the simulation platform includes an adapter device, a SystemC module and a register conversion stage circuit module, the method is performed by the adapter device, and the method includes: Obtain at least one copy request message, at least one original request message, and a first response message generated by the SystemC module; Determining, according to the first response message, a first copy request message corresponding to the first response message in at least one of the copy request messages; Determining, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message, wherein the first original request is an original request message in at least one of the original request messages corresponding to the first copy request message; When it is determined that the data operation corresponding to the first original request message is completed, a total reply message corresponding to the first original request message is sent to the register conversion stage circuit module.
2. The method according to claim 1, characterized in that: The response message includes data operation information, the copy request message includes operation progress information and address information, the address information includes data length, the operation progress information is an array, the array includes at least one element, and the number of elements included in the array is proportional to the data length; The determining, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message includes: According to the first data operation information included in the first response message, determining a target element corresponding to the first data operation information from at least one element of the array included in the first replication request message; Modify the original value of the target element in the array included in the first replication request message to the first value, to obtain an updated first replication request message; Determining whether the values of all elements in the array included in the updated first replication request message are all the first values; When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, determining that the SystemC module completes the data operation corresponding to the first original request message; or, When it is determined that the value of any element in the updated first replication request message is not the first value, it is determined that the SystemC module has not completed the data operation corresponding to the first original request message.
3. The method according to claim 2, characterized in that The total reply message is the updated first replication request message.
4. The method according to claim 1 or 2, characterized in that: When it is determined that the SystemC module has not completed the data operation corresponding to the first original request message, the method further includes: Waiting for a second response message corresponding to the first original request message; Upon receiving the second response message, determining again based on the second response message and the updated first copy request message whether the SystemC module has completed the data operation corresponding to the first original request message; When it is determined that the SystemC module has completed the data operation corresponding to the first original request message, the updated first copy request message is updated according to the second response message to obtain the first copy request message that is updated again; The first copy request message that has been updated again is sent to the register conversion stage circuit module as a total reply message corresponding to the first original request message.
5. The method according to claim 2, characterized in that: The copy request message also includes a request status; When it is determined that the values of all elements in the array included in the updated first replication request message are the first values, the method further includes: The first request status included in the first replication request message is modified to a completion status.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtaining a second original request message sent by the register conversion stage circuit module; Copying the second original request message to obtain a second copied request message; The second replication request message is stored.
7. The method according to claim 6, characterized in that The communication protocol between the register conversion stage circuit module and the SystemC module is the Advanced eXtensible Interface AXI protocol; After obtaining the second original request message sent by the register conversion stage circuit module, the method further includes: A handshake message is sent to the register conversion stage circuit module, wherein the handshake message is used to instruct the register conversion stage circuit module to send a next original request message corresponding to the second original request message.
8. An adapter device, characterized in that: The device comprises: An acquisition module, used for acquiring at least one copy request message, at least one original request message and a first response message generated by the SystemC module; A determination module, configured to determine, according to the first response message, a first copy request message corresponding to the first response message in at least one of the copy request messages; and determine, according to the first response message and the first copy request message, whether the SystemC module has completed the data operation corresponding to the first original request message, wherein the first original request is an original request message corresponding to the first copy request message in at least one of the original request messages; A sending module is used to send a total reply message corresponding to the first original request message to the register conversion stage circuit module when it is determined that the data operation corresponding to the first original request message is completed.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for sending a reply message according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for sending a reply message according to any one of claims 1 to 7.
