CN-121979688-A - Order-preserving control method and device
Abstract
The application provides a sequence-preserving control method and device, which relate to the technical field of computers and comprise the steps of distributing requests from a plurality of sources into a plurality of physical request queues according to an address mapping rule, maintaining a sequence record queue for each sequence-preserving request, recording sequence information of the sequence-preserving request and corresponding physical request queue identification, determining a currently-transmittable target sequence-preserving request and corresponding target physical request queue according to a sequence record state in the sequence record queue, transmitting a sequence permission signal to the target physical request queue, and transmitting the target sequence-preserving request into an output request queue by the target physical request queue in response to the sequence permission signal. The application realizes the order-preserving constraint control of the cross-physical independent queue without adding a special order-preserving queue, avoids the increase of storage resource consumption, and simultaneously controls the logic depth to meet the performance requirement.
Inventors
- ZHOU HAOYU
- XU YUE
Assignees
- 翼华科技(北京)股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260407
Claims (10)
- 1. The order-preserving control method is characterized by comprising the following steps of: distributing requests from a plurality of sources into a plurality of physical request queues according to an address mapping rule, wherein the requests from the plurality of sources comprise order-preserving requests and non-order-preserving requests; Maintaining a sequence record queue for each order-preserving request, which is used for recording the sequence information of the order-preserving request and the corresponding physical request queue identification, determining a currently-transmittable target order-preserving request and the corresponding target physical request queue according to the sequence record state in the sequence record queue; in response to the order grant signal, the target physical request queue sends the target order-preserving request to an output request queue.
- 2. The method as recited in claim 1, further comprising: inside each physical request queue, managing the sequence dependency relationship among all requests in the queue through a dependency matrix, wherein the rows and columns of the dependency matrix correspond to the request items in the queue, and matrix elements represent the dependency states among the request items; and the target physical request queue selects a request without unsatisfied dependencies from the order-preserving requests according to the dependency matrix to serve as the target order-preserving request.
- 3. The method of claim 2, further comprising updating a dependency matrix after sending the target order-preserving request into an output request queue; The updating of the dependency matrix includes clearing dependency tags of selected requests against other requests and adjusting dependency relationships between requests at the same address to ensure that order-preserving requests at the same address do not exist in the pipeline at the same time.
- 4. The method as recited in claim 1, further comprising: After finishing the processing of the main pipeline, the non-order-preserving request is directly sent into the output request queue without waiting for an order permission signal.
- 5. The method as recited in claim 1, further comprising: Performing arbitration selection on dequeue requests in an output request queue through a configurable arbitration module, wherein the arbitration module supports a plurality of configurable arbitration strategies; The arbitration policy includes at least one of: a fair arbitration policy based on least recently used LRUs; A load balancing policy based on the number of outstanding requests from each source; a dynamic priority policy based on historical completion delay information; an starvation control mechanism is also included to trigger a forced priority mechanism when a request from a source is not selected during a consecutive number of arbitration, wherein the starvation threshold parameter is configurable.
- 6. The method as recited in claim 1, further comprising: When detecting a sequence dependent exception or data error, suspending subsequent request transmissions from the associated source; Transmitting error information to a corresponding source through a feedback path; Clearing related requests in a physical request queue or an output request queue according to the error type; Reopening the request path after the execution state is recovered; the feedback path is a serial ring bus, and the error information includes at least one of an error code, an error request address, error data, and a CRC check value.
- 7. The method of claim 6, wherein flushing related requests in the physical request queue or the output request queue comprises selecting to flush specific requests or to flush all requests from the source of errors based on the type of error.
- 8. The method of claim 6, wherein sequential anomaly detection and recovery is controlled by a state machine, the state machine including an idle state, a wait for process state, an error report state, and a recovery process state, the state transitions triggered by an error detection signal and a recovery complete signal.
- 9. A sequence preserving control device, characterized by comprising: a plurality of physical request queues for receiving and storing requests from a plurality of sources according to an address mapping rule, responding to a sequence permission signal, and sending target order-preserving requests into an output request queue; The order information queue module is connected with the plurality of physical request queues and is used for maintaining an order record queue for each source, wherein the order record queue is used for recording the order information of the order-preserving requests and the corresponding physical request queue identifications; And the output request queue is connected with the physical request queues and is used for temporarily storing the requests which are processed by the main pipeline and meet the transmission conditions.
- 10. The apparatus of claim 9, wherein a dependency management unit is disposed in each physical request queue, and is configured to manage sequential dependency relationships between all requests in the queue through a dependency matrix, wherein a row and a column of the dependency matrix correspond to request items in the queue, and a matrix element represents a dependency state between the request items, and the physical request queue is further configured to select, from among order-preserving requests, a request without unsatisfied dependencies as the target order-preserving request according to the dependency matrix.
Description
Order-preserving control method and device Technical Field The application relates to the technical field of computers, in particular to a sequence-preserving control method and device. Background In multi-core processors, on-chip and high performance memory control, in order to improve throughput, a multi-physical independent queue structure is generally adopted, and requests from multiple sources are distributed to different physical queues according to address mapping rules for parallel processing. However, some request types (e.g., specific instructions, strong coherency operations) require sequential control of requests from the same source, i.e., requests from the same source must be issued in their order of generation. When requests are scattered to a plurality of physical queues according to address mapping, a plurality of requests requiring order preservation from the same source may enter different physical queues respectively, and because each queue is independently scheduled, if a unified coordination mechanism is lacking, an out-of-order request may occur. In the prior art, a mode of adding order-preserving queues can lead to the increase of the number of queues along with the number of sources, further leads to the increase of storage resource consumption and the decrease of the queue utilization rate, and a mode of adopting single physical queue order control is adopted, the request processing cannot be fully parallelized due to the lack of a parallel physical queue structure, the throughput capacity is limited, the logic depth of a single large queue is higher, the clock frequency is limited, and the performance requirement under a high concurrency scene is difficult to meet. Disclosure of Invention The embodiment of the application aims to provide a sequence-preserving control method and device for alleviating the technical problems. In a first aspect, the present invention provides a sequence preserving control method, including: Distributing requests from a plurality of sources into a plurality of physical request queues according to an address mapping rule, wherein the requests comprise order-preserving requests and non-order-preserving requests; Maintaining a sequence record queue for each order-preserving request, which is used for recording the sequence information of the order-preserving request and the corresponding physical request queue identification, determining the currently-transmittable target order-preserving request and the corresponding target physical request queue according to the sequence record state in the sequence record queue; in response to the order grant signal, the target physical request queue places the target order-preserving request into the output request queue. In an alternative embodiment, the method further comprises: inside each physical request queue, managing the sequence dependency relationship among all requests in the queue through a dependency matrix, wherein the rows and columns of the dependency matrix correspond to the request items in the queue, and matrix elements represent the dependency states among the request items; and the target physical request queue selects the requests without unsatisfied dependencies from the order-preserving requests according to the dependency matrix as target order-preserving requests. In an alternative embodiment, after sending the target order-preserving request into the output request queue, the method further comprises updating the dependency matrix; Updating the dependency matrix includes clearing dependency tags of selected requests against other requests and adjusting dependencies between requests at the same address to ensure that order-preserving requests at the same address do not exist in the pipeline at the same time. In an alternative embodiment, the method further comprises: After finishing the processing of the main pipeline, the non-order-preserving request is directly sent into the output request queue without waiting for an order permission signal. In an alternative embodiment, the method further comprises: carrying out arbitration selection on dequeue requests in an output request queue through a configurable arbitration module, wherein the arbitration module supports various configurable arbitration strategies; the arbitration policy includes at least one of: a fair arbitration policy based on least recently used LRUs; A load balancing policy based on the number of outstanding requests from each source; a dynamic priority policy based on historical completion delay information; an starvation control mechanism is also included to trigger a forced priority mechanism when a request from a source is not selected during a consecutive number of arbitration, wherein the starvation threshold parameter is configurable. In an alternative embodiment, the method further comprises: When detecting a sequence dependent exception or data error, suspending subsequent request transmissions from the associated s