Bus hanging-up prevention method, device and chip
By registering the correspondence relationship with the timeout response timer in the bus system and sending pseudo-data intercepting access request and response message when the timeout, the problem of being unable to intercept part of the access request and response message separately in the prior art is solved, and a more flexible bus-hook-proof processing is achieved.
Patent Information
- Application Number
- CN202510208193.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art cannot realize the separate interception of partial access requests and corresponding response messages, resulting in the inability to flexibly process when the bus is dead.
By receiving and parsing the access request sent by the master device, storing the response message parameters and registering the correspondence with the timeout response timer, and sending pseudo-data after the timeout is sent to intercept the timeout access request and response message.
It realizes separate interception of timeout access requests and response messages, and does not affect other access requests and response messages, improving the flexibility of bus anti-hook.
Smart Images

Figure CN120104392A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a bus anti-hang method, device, and chip. Background Art
[0002] In the System On Chip (SOC), the bus is an important part of data transmission. All system accesses through the bus in the SOC need to have corresponding responses, otherwise the bus will be hung. Therefore, the design of the SOC's bus protection unit (BPU) is an important part of SOC design.
[0003] In the related art, when a slave device needs to be reset or hangs, an interception mode enable signal can be configured to instruct the generation of false data to replace the access request response message returned to the master device, and the access request sent by the master device and the response message returned by the slave device will be discarded.
[0004] However, by configuring the interception mode signal to instruct to generate false data instead of the response message to be returned to the master device, all access requests and response messages between the master device and the slave device will be intercepted, and it is impossible to implement separate interception of some access requests and corresponding response messages. Summary of the invention
[0005] Based on this, it is necessary to provide a bus anti-hang method, device and chip that can realize separate interception of some access requests and corresponding response messages in order to solve the above technical problems.
[0006] In a first aspect, the present application provides a bus anti-hang method, comprising:
[0007] Receive and parse the access request sent by the master device, obtain the request identifier and response message parameters of the access request, and store the response message parameters in the timeout detection information storage table;
[0008] According to the request identifier, register the corresponding relationship between the access request and the timeout response timer and start the timeout response timer;
[0009] When the timeout response timer times out, dummy data corresponding to the access request is sent to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table.
[0010] In one of the embodiments, when the timeout response timer times out, sending dummy data corresponding to the access request to the master device according to the response message parameter corresponding to the access request in the timeout detection information storage table includes:
[0011] When the timeout response timer times out, the state flag information of the access request is updated from the first state information to the second state information in the timeout detection information storage table, wherein the first state information is used to indicate that the response message corresponding to the access request has not timed out, and the second state information is used to indicate that the response message corresponding to the access request has timed out;
[0012] In response to the second state information, dummy data corresponding to the access request is sent to the master device according to a response message parameter corresponding to the access request.
[0013] In one embodiment, the method further comprises:
[0014] According to the timeout detection information storage table, updating the status flag information of the access request in the response message storage table;
[0015] receiving a response message to the access request sent from the device;
[0016] If it is found that the state flag information of the access request in the response message storage table is the second state information, discarding the response message of the access request;
[0017] If it is found that the state flag information of the access request in the response message storage table is the first state information, a response message of the access request is sent to the master device.
[0018] In one embodiment, the method further comprises:
[0019] If the state flag information of the access request in the response message storage table is the first state information, the timeout response timer corresponding to the access request is paused and the corresponding relationship between the timeout response timer and the access request is released.
[0020] In one embodiment, the method further comprises:
[0021] In response to the second status information, an interrupt message is sent to the master device, where the interrupt message is used to indicate to the master device that a response message corresponding to the access request is dummy data.
[0022] In a second aspect, the present application provides a bus anti-hanging device, comprising:
[0023] A timing module, configured to receive and parse an access request sent by a master device, obtain a request identifier and a response message parameter of the access request, and store the response message parameter in a timeout detection information storage table; register a corresponding relationship between the access request and a timeout response timer according to the request identifier and start the timeout response timer;
[0024] A detection information storage table module, used to store the response message parameters;
[0025] The response message generating module is used for sending the pseudo data corresponding to the access request to the main device according to the response message parameters corresponding to the access request in the timeout detection information storage table when the timeout response timer times out.
[0026] In one of the embodiments, the response message generating module is also used to update the status flag information of the access request from the first status information to the second status information in the timeout detection information storage table when the timeout response timer times out, the first status information being used to indicate that the response message corresponding to the access request has not timed out, and the second status information being used to indicate that the response message corresponding to the access request has timed out; in response to the second status information, according to the response message parameters corresponding to the access request, send pseudo data corresponding to the access request to the master device.
[0027] In one of the embodiments, the bus anti-hanging device further includes a response message recording module;
[0028] The response message recording module is used to update the status flag information of the access request in the response message storage table according to the timeout detection information storage table; receive the response message of the access request sent by the slave device; if the status flag information of the access request in the response message storage table is the second status information, discard the response message of the access request; if the status flag information of the access request in the response message storage table is the first status information, send the response message of the access request to the master device.
[0029] In one of the embodiments, the timing module is also used to pause the timeout response timer corresponding to the access request and release the correspondence between the timeout response timer and the access request if the status flag information of the access request in the response message storage table is the first status information.
[0030] In one of the embodiments, the timeout detection recording module is further used to send an interrupt message to the master device in response to the second status information, wherein the interrupt message is used to indicate to the master device that the response message corresponding to the access request is pseudo data.
[0031] In a third aspect, the present application further provides a chip including the bus anti-hanging device described in the second manner above.
[0032] In a fourth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned bus anti-hanging method when executing the computer program.
[0033] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the above-mentioned bus anti-hang method when executed by a processor.
[0034] In a sixth aspect, the present application also provides a computer program product, including a computer program, which implements the above-mentioned bus anti-hang method when executed by a processor.
[0035] The above-mentioned bus anti-hanging method, device, and chip first receive and parse the access request sent by the master device, obtain the request identifier and response message parameters of the access request, and store the response message parameters in the timeout detection information storage table; then, according to the request identifier, register the corresponding relationship between the access request and the timeout response timer and start the timeout response timer; when the timeout response timer times out, according to the response message parameters corresponding to the access request in the timeout detection information storage table, send the pseudo data corresponding to the access request to the master device. Since after receiving the access request, the timeout response timer corresponding to the access request is registered and started, when the timeout response timer times out, according to the response message parameters corresponding to the timeout access request, only the pseudo data corresponding to the access request is sent to the master device, so that only the timeout access request and response message can be intercepted, without affecting other access requests and response messages between the master device and the slave device, and the separate interception of some access requests and corresponding response messages is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a schematic diagram of the principle of the anti-deadlock system in the related art;
[0038] Figure 2 A schematic diagram of an application scenario of a bus anti-hanging method provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of a process flow of a bus anti-hanging method provided in an embodiment of the present application;
[0040] Figure 4 A flowchart of another bus anti-hanging method provided in an embodiment of the present application;
[0041] Figure 5 A structural block diagram of a bus anti-hanging device provided in an embodiment of the present application;
[0042] Figure 6 A hardware schematic diagram of a bus anti-hanging device provided in an embodiment of the present application;
[0043] Figure 7 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] First, the related technology is described below.
[0046] Figure 1 FIG. 1 is a schematic diagram of the principle of an anti-deadlock system in the related art. Figure 1 As shown in the figure, the access request sent by the master device through the bus will be stored in the request information storage table (req info table) with the request identifier (req_id) as the address. When the slave device needs to be reset or hangs, the intercept mode enable signal can be configured to 1 to instruct the response information generation module (rspinfo gen) to generate false data to replace the response message corresponding to the access request in the information storage table, and return the false data to the master device. At this time, the access request sent by the master device and the response message returned by the slave device will be discarded.
[0047] When the slave device does not need to be reset or hung, the intercept mode enable signal can be configured to 0. At this time, the access request sent by the master device can be transmitted normally to the slave device, and the response message sent by the slave device can also be transmitted normally to the master device.
[0048] The request information storage table may be stored in a register or a memory.
[0049] However, when the interception mode enable signal is configured as 1, all request messages between the master and slave devices will be returned to the master device with fake data instead of corresponding response messages, and all access requests and response messages between the master and slave devices will be intercepted, making the bus anti-hanging flexibility insufficient and unable to implement separate interception of some access requests and corresponding response messages. At the same time, when a single access request hangs, the entire slave device needs to be reset, and the reset cost is relatively high.
[0050] To solve the above problems, the embodiments of the present application provide a bus anti-hanging method, apparatus, chip, device, storage medium and program product. After receiving an access request, a timeout response timer corresponding to the access request is registered and started. When the timeout response timer times out, only pseudo data corresponding to the access request is sent to the master device according to the response message parameters corresponding to the timed-out access request. In this way, only the timed-out access request and response message can be intercepted without affecting other access requests and response messages between the master device and the slave device, thereby realizing the separate interception of some access requests and corresponding response messages.
[0051] The following describes the application scenarios of the wire hanging prevention method provided in the embodiments of the present application.
[0052] The bus anti-hang method provided in the embodiment of the present application can be applied to Figure 2 In the application environment shown, a bus anti-hanging device is provided between the master device and the slave device, and the bus anti-hanging device transmits data with the master device and the slave device through the bus.
[0053] The bus anti-hanging device can first receive and parse the access request sent by the master device, obtain the request identifier and response message parameters of the access request, and store the response message parameters in the timeout detection information storage table. Subsequently, the bus anti-hanging device registers the corresponding relationship between the access request and the timeout response timer according to the request identifier and starts the timeout response timer. When the timeout response timer times out, the pseudo data corresponding to the access request is sent to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table.
[0054] The master device may be a device that actively initiates an access request. In the SOC, the master device may include a central processing unit (CPU), a data processing unit (DPU), a direct memory access (DMA) controller, etc. The slave device may be a device that responds to the access request initiated by the master device. In the SOC, the slave device may include a memory, a peripheral controller, a graphics processing unit, a wireless module, etc. The bus anti-hang device may be a BPU on the SOC.
[0055] In an exemplary embodiment, Figure 3 As shown, a bus anti-hang method is provided, and the method is applied to Figure 2 Taking the bus anti-hanging device in the example as an example, the bus anti-hanging method includes S301-S303:
[0056] S301, receiving and parsing an access request sent by a master device, obtaining a request identifier and a response message parameter of the access request, and storing the response message parameter in a timeout detection information storage table.
[0057] In the present application, a bus anti-hanging device can be set between the master device and the slave device. When the master device sends an access request to the slave device, the bus anti-hanging device can receive and parse the access request sent by the master device, thereby obtaining the request identifier and response message parameters of the access request, and storing the response message parameters in the timeout detection information storage table.
[0058] Among them, the above-mentioned access request may include a read request, a write request, etc., and the embodiment of the present application does not limit this part.
[0059] In some embodiments, the access request may include a request identifier and a response message parameter, and the bus anti-deadlock device may parse the access request to obtain the request identifier and the response message parameter.
[0060] The request identifier may be a unique code (Identity Document, ID) of the access request, and the response message parameters include data transmission parameters of the response message.
[0061] Exemplarily, the data transmission parameter of the response message may be the hop count (len) of the response message. The hop count may be the number of intermediate network devices that a message needs to pass through when sent from one node to another node during network communication. The hop count may be used to measure the quality of a routing path. The fewer the hop count, the better the path.
[0062] It should be noted that in the application embodiment, after the bus anti-hang device receives an access request sent by the master device through the bus, whether the slave device is hung or needs to be reset does not affect the transmission of the access request, and the access request can still be sent to the slave device through the bus.
[0063] In some embodiments, after the bus anti-hang-up device obtains the request identifier and the response message parameter, it can store the response message parameter corresponding to the access request in the timeout detection information storage table.
[0064] It should be understood that the embodiments of the present application do not limit how to store the response message parameters corresponding to the access request in the timeout detection information storage table. In some embodiments, the bus anti-hanging device can use the request identifier as the address and store the response message parameters corresponding to the access request in the timeout detection information storage table.
[0065] The above-mentioned timeout detection information storage table may record the status flag information of the access request between the master device and the slave device, the response message corresponding to the access request, and the like.
[0066] The status flag information of the access request may include first status information and second status information. The first status information is used to indicate that the response message corresponding to the access request has not timed out, and the second status information is used to indicate that the response message corresponding to the access request has timed out.
[0067] Exemplarily, the first state information may be state flag information when the value of the specific flag bit is 0, and the second state information may be state flag information when the value of the specific flag bit is 1.
[0068] S302: According to the request identifier, register the correspondence between the access request and the timeout response timer and start the timeout response timer.
[0069] In this step, when the bus anti-hanging device receives the access request sent by the master device and stores the response message parameters in the access request in the timeout detection information storage table, it can register the correspondence between the access request and the timeout response timer according to the request identifier and start the timeout response timer.
[0070] The above-mentioned timeout response timer starts counting after being started, and when the counting time exceeds the configured timeout time, the corresponding bus anti-hanging operation can be triggered.
[0071] It should be understood that the embodiment of the present application does not limit the above timeout period, and the timeout periods configured for different timeout response timers may be the same or different. Exemplarily, the timeout periods of timeout response timer 1 and timeout response timer 2 are configured to be 10 seconds. Exemplarily, the timeout period of timeout response timer 1 is configured to be 10 seconds, and the timeout period of timeout response timer 2 is configured to be 5 seconds.
[0072] Exemplarily, the bus anti-hanging device includes a timing module, and the timing module includes multiple timeout response timers. When the bus anti-hanging device receives an access request A sent by a master device, a timeout response timer 1 can be allocated to the access request A. By registering a corresponding relationship between the access request A and the allocated timeout response timer 1 and starting the timeout response timer 1, the timeout response timer 1 is used to time the return time of the response message of the access request A.
[0073] It should be understood that the embodiments of the present application do not limit how to register the correspondence between access requests and timeout response timers. In some embodiments, if the timeout periods configured for each timeout response timer are the same, the correspondence between the received access requests can be registered in sequence according to the numbering order of the idle timeout response timers.
[0074] In other embodiments, if the timeout periods configured for each timeout response timer are different, a timeout response timer with a suitable timeout period can be selected from the idle timeout response timers according to the type of access request, and then a corresponding relationship can be registered between the selected timeout response timer and the access request.
[0075] In some embodiments, whether the timeout response timer has timed out can be updated in real time in the status flag information of the timeout detection information storage table. Exemplarily, the status flag information includes first status information and second status information, the first status information is used to indicate that the response message corresponding to the access request has not timed out, and the second status information is used to indicate that the response message corresponding to the access request has timed out.
[0076] S303: When the timeout response timer times out, send dummy data corresponding to the access request to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table.
[0077] In this step, after registering the corresponding relationship between the access request and the timeout response timer and starting the timeout response timer, it can be determined in real time whether the timeout response timer has timed out. When the timeout response timer has timed out, the bus anti-hanging device can send dummy data corresponding to the access request to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table.
[0078] In some embodiments, when the timeout response timer times out, the bus anti-hanging device can update the state flag information of the access request from the first state information to the second state information in the timeout detection information storage table. Subsequently, the bus anti-hanging device responds to the second state information and sends dummy data corresponding to the access request to the master device according to the response message parameters corresponding to the access request.
[0079] Exemplarily, updating the state flag information of the access request from the first state information to the second state information in the timeout detection information storage table can be achieved by changing the value of a specific flag bit in the state flag information of the access request. When the timeout response timer corresponding to the access request times out, the value of the specific flag bit of the state flag information corresponding to the access request can be changed from 0 to 1 in the timeout detection information storage table.
[0080] It should be understood that the embodiments of the present application do not limit how to send dummy data corresponding to the access request to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table. In some embodiments, the bus anti-hanging device may include a response message generation module, which may pre-set dummy data corresponding to each access request. When the state flag corresponding to the access request is the second state information, the response message generation module may use the request identifier as the address to obtain the response message parameters corresponding to the access request from the timeout detection information storage table. Subsequently, the pre-configured dummy data corresponding to the access request is sent to the master device according to the transmission mode corresponding to the response message parameters corresponding to the access request.
[0081] In other embodiments, the bus anti-hanging device can also update the status flag information of the access request in the response message storage table according to the timeout detection information storage table. After the bus anti-hanging device receives the response message of the access request sent by the slave device through the bus, it will not return it directly to the master device. Instead, it will first query the corresponding status flag information in the response message storage table. If the status flag information of the access request in the response message storage table is the second status information, the response message of the access request is discarded. If the status flag information of the access request in the response message storage table is the first status information, the response message of the access request is sent to the master device through the bus.
[0082] Exemplarily, if the state flag information of the access request in the response message storage table is the second state information with a specific flag bit value of 1, it indicates that the response message corresponding to the access request has timed out, and the bus anti-hanging device begins to intercept the response message corresponding to the access request and replace it with pseudo data, and the response message of the access request can be discarded at this time. Exemplarily, if the state flag information of the access request in the response message storage table is the first state information with a specific flag bit value of 0, it indicates that the response message corresponding to the access request has not timed out, and the response message of the access request can be returned normally through the bus.
[0083] In some embodiments, if the state flag information of the access request in the response message storage table is the first state information, the bus anti-hanging device pauses the timeout response timer corresponding to the access request and releases the correspondence between the timeout response timer and the access request.
[0084] The line hanging prevention method provided in the embodiment of the present application can intercept only the response message corresponding to the timed-out access request when a timeout occurs, and does not intercept the new access request generated by the master device and the response message corresponding to the new access request, and transmits them normally between the master device and the slave device, thereby improving the flexibility of bus hanging prevention. At the same time, the line hanging prevention method can be used for resetting when a fatal problem occurs in the slave device or the timeout of a single response message from the slave device, and the system adaptability is stronger.
[0085] The line anti-hanging method provided by the embodiment of the present application first receives and parses the access request sent by the master device, obtains the request identifier and response message parameters included in the access request, and stores the response message parameters in the timeout detection information storage table; secondly, according to the request identifier, registers the corresponding relationship between the access request and the timeout response timer and starts the timeout response timer; finally, when the timeout response timer times out, according to the response message parameters corresponding to the access request in the timeout detection information storage table, sends the pseudo data corresponding to the access request to the master device. Since after receiving the access request, the timeout response timer corresponding to the access request is registered and started, when the timeout response timer times out, according to the response message parameters corresponding to the timeout access request, only the pseudo data corresponding to the access request is sent to the master device, so that only the timeout access request and response message can be intercepted, without affecting other access requests and response messages between the master device and the slave device, and the separate interception of some access requests and corresponding response messages is realized.
[0086] Figure 4 A flowchart of another bus anti-hanging method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the bus hanging prevention method includes S401-S410:
[0087] S401, receiving and parsing an access request sent by a master device, obtaining a request identifier and a response message parameter in the access request, and storing the response message parameter in a timeout detection information storage table.
[0088] S402: According to the request identifier, register the corresponding relationship between the access request and the timeout response timer and start the timeout response timer.
[0089] S403: When the timeout response timer times out, the state flag information of the access request is updated from the first state information to the second state information in the timeout detection information storage table.
[0090] The first status information is used to indicate that the response message corresponding to the access request has not timed out, and the second status information is used to indicate that the response message corresponding to the access request has timed out.
[0091] S404. In response to the second status information, according to the response message parameters corresponding to the access request, send dummy data corresponding to the access request to the master device.
[0092] S405: Update the status flag information of the access request in the response message storage table according to the timeout detection information storage table.
[0093] S406: Receive a response message to the access request sent by the slave device.
[0094] S407: Determine whether the state flag information of the access request found in the response message storage table is the second state information.
[0095] If yes, execute S408, if no, execute S409-S410.
[0096] S408: discard the response message of the access request.
[0097] S409: Send a response message of the access request to the master device via the bus.
[0098] S410: Pause the timeout response timer corresponding to the access request and release the correspondence between the timeout response timer and the access request.
[0099] The line anti-hanging method provided by the embodiment of the present application first receives and parses the access request sent by the master device, obtains the request identifier and response message parameters in the access request, and stores the response message parameters in the timeout detection information storage table; secondly, according to the request identifier, registers the corresponding relationship between the access request and the timeout response timer and starts the timeout response timer; finally, when the timeout response timer times out, according to the response message parameters corresponding to the access request in the timeout detection information storage table, sends the pseudo data corresponding to the access request to the master device. Since after receiving the access request, the timeout response timer corresponding to the access request is registered and started, when the timeout response timer times out, according to the response message parameters corresponding to the timeout access request, only the pseudo data corresponding to the access request is sent to the master device, so that only the timeout access request and response message can be intercepted, without affecting other access requests and response messages between the master device and the slave device, and the separate interception of some access requests and corresponding response messages is realized.
[0100] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0101] Based on the same inventive concept, the embodiment of the present application also provides a bus anti-hanging device for implementing the above-mentioned bus anti-hanging method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more bus anti-hanging device embodiments provided below can refer to the above-mentioned limitations on the bus anti-hanging method, and will not be repeated here.
[0102] In an exemplary embodiment, Figure 5 As shown, a bus anti-hanging device 500 is provided, including: a timing module 501, a detection information storage table module 502 and a timeout detection recording module 503, wherein:
[0103] The timing module 501 is used to receive the access request sent by the main device, obtain the request identifier and response message parameters in the access request, and store the response message parameters in the timeout detection information storage table; according to the request identifier, register the correspondence between the access request and the timeout response timer and start the timeout response timer.
[0104] The detection information storage table module 502 is used to store response message parameters.
[0105] The response message generating module 503 is used to send dummy data corresponding to the access request to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table when the timeout response timer times out.
[0106] In one of the embodiments, the response message generation module 503 is also used to update the status flag information of the access request from the first status information to the second status information in the timeout detection information storage table when the timeout response timer times out, the first status information being used to indicate that the response message corresponding to the access request has not timed out, and the second status information being used to indicate that the response message corresponding to the access request has timed out; in response to the second status information, according to the response message parameters corresponding to the access request, pseudo data corresponding to the access request is sent to the main device.
[0107] In one embodiment, the bus deadlock prevention device 500 further includes a response message recording module 504 .
[0108] The response message recording module 504 is used to update the status flag information of the access request in the response message storage table according to the timeout detection information storage table; receive the response message of the access request sent by the slave device; if the status flag information of the access request in the response message storage table is the second status information, discard the response message of the access request; if the status flag information of the access request in the response message storage table is the first status information, send the response message of the access request to the master device.
[0109] In one embodiment, the timing module 501 is used to pause the timeout response timer corresponding to the access request and release the correspondence between the timeout response timer and the access request if the state flag information of the access request in the response message storage table is the first state information.
[0110] In one embodiment, the timeout detection recording module 502 is further used to send an interrupt message to the master device in response to the second status information, where the interrupt message is used to indicate to the master device that the response message corresponding to the access request is pseudo data.
[0111] Each module in the above-mentioned bus anti-hanging device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules. Exemplarily, the above-mentioned timing module can be implemented by a timer on the SCO, and the above-mentioned timeout detection recording module, response message generation module and response message generation module can be implemented by registers on the SCO.
[0112] The following describes the interaction between the various modules in the bus anti-hanging device provided in the embodiment of the present application. Figure 6 The hardware schematic diagram of a bus anti-hanging device provided in an embodiment of the present application. Figure 6 As shown, the bus anti-hanging device includes a timing module, a detection information storage table module, a response message generating module and a response message recording module.
[0113] When the master device sends an access request to the slave device through the bus, the timing module in the bus anti-hanging device can also obtain the access request, so that the timing module can register the corresponding relationship between the access request and the timeout response timer according to the request identifier and start the timeout response timer. At the same time, the timing module will also send the access request to the detection information storage table module, so that the detection information storage table module can store the response message parameters corresponding to the access request in the timeout detection information storage table.
[0114] When the timer in the timing module times out, the timing module will send relevant status update indication information to the detection information storage table module, so as to update the status flag information of the access request in the timeout detection information storage table from the first status information to the second status information. At this time, the detection information storage table module, in response to the second status information, can send the response message parameters corresponding to the access request in the timeout detection information storage table to the response message generation module, so that the response message generation module generates pseudo data corresponding to the access request, and according to the response message parameters, sends the pseudo data corresponding to the access request to the main device. At the same time, the detection information storage table module, in response to the second status information, can also send an interrupt message to the main device to indicate to the main device that the response message corresponding to the access request is pseudo data.
[0115] In addition, the detection information storage table module can also update the status flag information of the access request in the response message storage table in the response message recording module. When the response message recording module receives the response message of the access request sent by the slave device through the bus, if the response message of the access request has not timed out, the response message recording module sends the response message of the access request to the master device, and sends an indication message to the timing module to suspend the timeout response timer corresponding to the access request and release the corresponding relationship between the timeout response timer and the access request. If the response message of the access request times out, the response message recording module discards the response message of the access request.
[0116] In one embodiment, a computer device is provided, the computer device includes a chip, and the computer device can implement the above bus hanging prevention method. The internal structure diagram of the computer device can be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a bus anti-hanging method as described above.
[0117] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In one embodiment, a chip is provided. The chip includes a memory and a processor, and the memory stores a computer program. When the processor executes the computer program, the above bus anti-hang method is implemented. The chip may be a data processing unit (DPU) chip.
[0119] In one embodiment, a network interface card is provided, the network interface card includes the above chip and multiple interfaces, and the chip communicates with the outside through the interface. The interface includes a PCI / PCIE interface, a network interface, and the like.
[0120] In one embodiment, an electronic device is provided. The electronic device includes a processor and the above-mentioned network interface card. The network interface card is used to dispatch messages to the processor or the network interface card itself for processing, and the processor is used to process the messages dispatched by the network interface card.
[0121] In one embodiment, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the bus anti-hang method is implemented.
[0122] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the bus anti-hang method is implemented.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0125] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A bus anti-hang method, characterized in that: The method comprises: Receive and parse the access request sent by the master device, obtain the request identifier and response message parameters of the access request, and store the response message parameters in the timeout detection information storage table; According to the request identifier, register the corresponding relationship between the access request and the timeout response timer and start the timeout response timer; When the timeout response timer times out, dummy data corresponding to the access request is sent to the master device according to the response message parameters corresponding to the access request in the timeout detection information storage table.
2. The method according to claim 1, characterized in that When the timeout response timer times out, sending dummy data corresponding to the access request to the master device according to the response message parameter corresponding to the access request in the timeout detection information storage table includes: When the timeout response timer times out, the state flag information of the access request is updated from the first state information to the second state information in the timeout detection information storage table, wherein the first state information is used to indicate that the response message corresponding to the access request has not timed out, and the second state information is used to indicate that the response message corresponding to the access request has timed out; In response to the second state information, dummy data corresponding to the access request is sent to the master device according to a response message parameter corresponding to the access request.
3. The method according to claim 2, characterized in that The method further comprises: According to the timeout detection information storage table, updating the status flag information of the access request in the response message storage table; receiving a response message to the access request sent from the device; If it is found that the state flag information of the access request in the response message storage table is the second state information, discarding the response message of the access request; If it is found that the state flag information of the access request in the response message storage table is the first state information, a response message of the access request is sent to the master device.
4. The method according to claim 3, characterized in that The method further comprises: If the state flag information of the access request in the response message storage table is the first state information, the timeout response timer corresponding to the access request is paused and the corresponding relationship between the timeout response timer and the access request is released.
5. The method according to claim 2, characterized in that: The method further comprises: In response to the second status information, an interrupt message is sent to the master device, where the interrupt message is used to indicate to the master device that a response message corresponding to the access request is dummy data.
6. A bus anti-hanging device, characterized in that: The device comprises: A timing module, configured to receive and parse an access request sent by a master device, obtain a request identifier and a response message parameter of the access request, and store the response message parameter in a timeout detection information storage table; register a corresponding relationship between the access request and a timeout response timer according to the request identifier and start the timeout response timer; A detection information storage table module, used to store the response message parameters; The response message generating module is used for sending the pseudo data corresponding to the access request to the main device according to the response message parameters corresponding to the access request in the timeout detection information storage table when the timeout response timer times out.
7. The device according to claim 6, characterized in that The response message generating module is further configured to update the state flag information of the access request from the first state information to the second state information in the timeout detection information storage table when the timeout response timer times out, wherein the first state information is used to indicate that the response message corresponding to the access request has not timed out, and the second state information is used to indicate that the response message corresponding to the access request has timed out; In response to the second state information, dummy data corresponding to the access request is sent to the master device according to a response message parameter corresponding to the access request.
8. The device according to claim 6, characterized in that The bus anti-hanging device also includes a response message recording module; The response message recording module is used to update the status flag information of the access request in the response message storage table according to the timeout detection information storage table; receive the response message of the access request sent by the slave device; If it is found that the state flag information of the access request in the response message storage table is the second state information, discarding the response message of the access request; If it is found that the state flag information of the access request in the response message storage table is the first state information, a response message of the access request is sent to the master device.
9. The device according to claim 8, characterized in that The timing module is further configured to pause a timeout response timer corresponding to the access request and release the corresponding relationship between the timeout response timer and the access request if the status flag information of the access request in the response message storage table is the first status information.
10. The device according to claim 7, characterized in that The timeout detection recording module is further used to send an interrupt message to the master device in response to the second status information, wherein the interrupt message is used to indicate to the master device that the response message corresponding to the access request is pseudo data.
11. A chip, characterized in that: The invention comprises the bus anti-hanging device according to any one of claims 6 to 10.
Citation Information
Cited By
Peripheral access control method, circuit, device, medium and program product
CN121234393A