CN116841624A - Scheduling method and device of access instruction, electronic equipment and storage medium - Google Patents

Scheduling method and device of access instruction, electronic equipment and storage medium Download PDF

Info

Publication number
CN116841624A
CN116841624A CN202310797986.9A CN202310797986A CN116841624A CN 116841624 A CN116841624 A CN 116841624A CN 202310797986 A CN202310797986 A CN 202310797986A CN 116841624 A CN116841624 A CN 116841624A
Authority
CN
China
Prior art keywords
instruction
access instruction
memory
buffer
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310797986.9A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Moore Threads Technology Co Ltd
Original Assignee
Moore Threads Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Moore Threads Technology Co Ltd filed Critical Moore Threads Technology Co Ltd
Priority to CN202310797986.9A priority Critical patent/CN116841624A/en
Publication of CN116841624A publication Critical patent/CN116841624A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3814Implementation provisions of instruction buffers, e.g. prefetch buffer; banks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The disclosure relates to a scheduling method, a scheduling device, electronic equipment and a storage medium for access instructions. The method comprises the following steps: in response to receiving any memory access instruction, sequentially storing the memory access instructions in an instruction buffer, wherein the scheduling priority of the memory access instruction written in the instruction buffer is higher than that of the memory access instruction written later; setting a value of a specified flag bit corresponding to the access instruction, wherein the specified flag bit is used for indicating whether the access instruction can be scheduled; and dispatching the memory access instruction with the highest dispatching priority from the memory access instruction with the value of the designated zone bit in the instruction buffer meeting a first preset condition, wherein the first preset condition is a preset condition for indicating that the memory access instruction can be dispatched.

Description

Scheduling method and device of access instruction, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a memory access instruction scheduling method, a memory access instruction scheduling device, electronic equipment and a storage medium.
Background
With the development of related art, for processors such as GPU (Graphics Processing Unit, graphics processor), CPU (Central Processing Unit ) and the like, the operation speed is often higher than the read-write speed of the memory, so one or more levels of cache are usually provided in such processors to solve the problem that the operation speed of the processor does not match the read-write speed of the memory. In particular, caches may be used to store data that is frequently used by the processor, thereby reducing the latency of accessing such data in order to improve processing efficiency. After the access instruction arrives, the scheduling sequence of different access instructions aiming at the same cache line is ensured, and the method has important significance.
Disclosure of Invention
The present disclosure provides a scheduling technical scheme for access instructions.
According to an aspect of the present disclosure, there is provided a method for scheduling a memory access instruction, including:
in response to receiving any memory access instruction, sequentially storing the memory access instructions in an instruction buffer, wherein the scheduling priority of the memory access instruction written in the instruction buffer is higher than that of the memory access instruction written later;
setting a value of a specified flag bit corresponding to the access instruction, wherein the specified flag bit is used for indicating whether the access instruction can be scheduled;
and dispatching the memory access instruction with the highest dispatching priority from the memory access instruction with the value of the designated zone bit in the instruction buffer meeting a first preset condition, wherein the first preset condition is a preset condition for indicating that the memory access instruction can be dispatched.
In a possible implementation manner, the setting a value of a designated flag bit corresponding to the access instruction includes:
responding to the access instruction as a read instruction, and setting a value of a designated flag bit corresponding to the access instruction according to the existence condition of data requested by the access instruction in a cache;
Or alternatively, the process may be performed,
and responding to the access instruction as a write instruction, and setting a value of a specified zone bit corresponding to the access instruction according to the existence condition of a conflict read instruction corresponding to the access instruction in the instruction buffer, wherein the conflict read instruction corresponding to the access instruction represents a read instruction which corresponds to the same cache line with the access instruction before the access instruction and does not meet the first preset condition.
In one possible implementation of the present invention,
the responding the access instruction as a read instruction, and setting the value of the designated flag bit corresponding to the access instruction according to the existence of the data requested by the access instruction in the cache, includes: responding to the access instruction as a read instruction, and setting the value of a designated flag bit corresponding to the access instruction to meet the first preset condition when data requested by the access instruction exists in a cache; or, in response to the access instruction being a read instruction, and no data requested by the access instruction exists in the cache, setting a value of a specified flag bit corresponding to the access instruction to satisfy a second preset condition;
or alternatively, the process may be performed,
the responding the access instruction as a write instruction, setting the value of the designated flag bit corresponding to the access instruction according to the existence condition of the conflict read instruction corresponding to the access instruction in the instruction buffer, including: responding to the access instruction as a write instruction, wherein no conflict read instruction corresponding to the access instruction exists in the instruction buffer, and setting the value of a designated zone bit corresponding to the access instruction to meet the first preset condition; or, in response to the memory access instruction being a write instruction and the instruction buffer having a conflict read instruction corresponding to the memory access instruction, setting a value of a designated flag bit corresponding to the memory access instruction to satisfy a second preset condition;
The second preset condition is a preset condition indicating that the memory access instruction waits for downstream return data.
In one possible implementation, the specified flag bit includes an output valid bit and a wait valid bit;
the setting the value of the designated flag bit corresponding to the access instruction to satisfy the first preset condition includes: the output effective position corresponding to the access instruction is a first preset value, and the waiting effective position corresponding to the access instruction is a second preset value;
or alternatively, the process may be performed,
the setting the value of the designated flag bit corresponding to the access instruction to satisfy the second preset condition includes: and taking the output effective position corresponding to the access instruction as the second preset value, and taking the waiting effective position corresponding to the access instruction as the first preset value.
In one possible implementation, the method further includes:
and responding to the access instruction as a read instruction, wherein the cache does not contain data requested by the access instruction, and requesting to acquire the data corresponding to the access instruction from the downstream.
In one possible implementation, the method further includes:
and in response to receiving the downstream returned data, comparing the path group information corresponding to the downstream returned data with the path group information corresponding to the memory access instruction of which the value of the designated mark bit in the instruction buffer meets a second preset condition, and updating the designated mark bit corresponding to the memory access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition for indicating that the memory access instruction waits for downstream returned data.
In one possible implementation, the method further includes:
and in response to receiving the downstream returned data, writing the downstream returned data into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue.
In one possible implementation, the instruction buffer is a ring buffer;
the responding to receiving any access instruction, storing the access instruction in order in an instruction buffer, comprising:
in response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer;
the write pointer is updated by one bit in the circular direction of the instruction buffer.
In one possible implementation of the present invention,
the response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer, including: in response to receiving any access instruction, storing group information and path information in the access instruction at a target position pointed by a write pointer of the instruction buffer;
the method further comprises the steps of: and storing the accompanying information of the memory instruction at a position corresponding to the target position in a target memory corresponding to the instruction buffer.
In one possible implementation, the read pointer of the instruction buffer points to the first stored memory instruction in the instruction buffer.
According to an aspect of the present disclosure, there is provided a scheduling apparatus for access instructions, including:
the storage module is used for responding to any access instruction, and sequentially storing the access instructions in an instruction buffer, wherein the scheduling priority of the access instruction written in the instruction buffer is higher than that of the access instruction written later;
the setting module is used for setting the value of a specified flag bit corresponding to the access instruction, wherein the specified flag bit is used for indicating whether the access instruction can be scheduled;
and the scheduling module is used for scheduling the access instruction with the highest scheduling priority from the access instructions with the values of the specified flag bits in the instruction buffer meeting the first preset condition, wherein the first preset condition is a preset condition indicating that the access instruction can be scheduled.
In one possible implementation, the setting module is configured to:
responding to the access instruction as a read instruction, and setting a value of a designated flag bit corresponding to the access instruction according to the existence condition of data requested by the access instruction in a cache;
Or alternatively, the process may be performed,
and responding to the access instruction as a write instruction, and setting a value of a specified zone bit corresponding to the access instruction according to the existence condition of a conflict read instruction corresponding to the access instruction in the instruction buffer, wherein the conflict read instruction corresponding to the access instruction represents a read instruction which corresponds to the same cache line with the access instruction before the access instruction and does not meet the first preset condition.
In one possible implementation, the setting module is configured to:
responding to the access instruction as a read instruction, and setting the value of a designated flag bit corresponding to the access instruction to meet the first preset condition when data requested by the access instruction exists in a cache;
or alternatively, the process may be performed,
responding to the access instruction as a read instruction, wherein no data requested by the access instruction exists in the cache, and setting the value of a designated flag bit corresponding to the access instruction to meet a second preset condition;
or alternatively, the process may be performed,
responding to the access instruction as a write instruction, wherein no conflict read instruction corresponding to the access instruction exists in the instruction buffer, and setting the value of a designated zone bit corresponding to the access instruction to meet the first preset condition;
Or alternatively, the process may be performed,
responding to the access instruction as a write instruction, and setting the value of a designated zone bit corresponding to the access instruction to meet a second preset condition when a conflict read instruction corresponding to the access instruction exists in the instruction buffer;
the second preset condition is a preset condition indicating that the memory access instruction waits for downstream return data.
In one possible implementation, the specified flag bit includes an output valid bit and a wait valid bit;
the setting module is used for:
responding to the access instruction as a read instruction, caching data requested by the access instruction, taking an output effective position corresponding to the access instruction as a first preset value, and taking a waiting effective position corresponding to the access instruction as a second preset value;
or alternatively, the process may be performed,
responding to the access instruction as a read instruction, wherein no data requested by the access instruction exists in the cache, taking the output effective position corresponding to the access instruction as the second preset value, and taking the waiting effective position corresponding to the access instruction as the first preset value;
or alternatively, the process may be performed,
responding to the memory access instruction as a write instruction, wherein no conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is a first preset value, and the waiting effective position corresponding to the memory access instruction is a second preset value;
Or alternatively, the process may be performed,
responding to the memory access instruction as a write instruction, wherein a conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is the second preset value, and the waiting effective position corresponding to the memory access instruction is the first preset value.
In one possible implementation, the apparatus further includes:
and the data request module is used for responding to the access instruction as a read instruction, and the data requested by the access instruction does not exist in the cache, so as to request to acquire the data corresponding to the access instruction from the downstream.
In one possible implementation, the apparatus further includes:
and the updating module is used for responding to the received data returned from the downstream, comparing the path group information corresponding to the data returned from the downstream with the path group information corresponding to the memory access instruction of which the value of the designated mark bit meets a second preset condition in the instruction buffer, and updating the designated mark bit corresponding to the memory access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition for indicating that the memory access instruction waits for the data returned from the downstream.
In one possible implementation, the apparatus further includes:
and the writing module is used for responding to the received data returned from the downstream, and writing the data returned from the downstream into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue.
In one possible implementation, the instruction buffer is a ring buffer;
the storage module is used for:
in response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer;
the write pointer is updated by one bit in the circular direction of the instruction buffer.
In one possible implementation, the storage module is configured to:
in response to receiving any access instruction, storing group information and path information in the access instruction at a target position pointed by a write pointer of the instruction buffer;
and storing the accompanying information of the memory instruction at a position corresponding to the target position in a target memory corresponding to the instruction buffer.
In one possible implementation, the read pointer of the instruction buffer points to the first stored memory instruction in the instruction buffer.
According to an aspect of the present disclosure, there is provided an electronic apparatus including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored by the memory to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
According to an aspect of the present disclosure, there is provided a computer program product comprising a computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in an electronic device, a processor in the electronic device performs the above method.
In the embodiment of the disclosure, in response to receiving any memory instruction, the memory instruction is sequentially stored in an instruction buffer, where the scheduling priority of the memory instruction written in advance in the instruction buffer is higher than the scheduling priority of the memory instruction written later, a value of a specified flag bit corresponding to the memory instruction is set, where the specified flag bit is used to indicate whether the memory instruction can be scheduled, and from among the memory instructions whose values of the specified flag bit in the instruction buffer meet a first preset condition, the memory instruction with the highest scheduling priority is scheduled, where the first preset condition is a preset condition indicating that the memory instruction can be scheduled, so that the scheduling sequence of different memory instructions for the same cache line can be ensured, and the scheduling efficiency of the memory instructions for different cache lines can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the technical aspects of the disclosure.
Fig. 1 shows an example block diagram of an electronic device 100 in the related art.
Fig. 2 shows a flowchart of a method for scheduling access instructions provided by an embodiment of the present disclosure.
Fig. 3 shows a schematic diagram of a hardware architecture for scheduling access instructions provided by an embodiment of the present disclosure.
Fig. 4 shows a block diagram of a scheduling apparatus for access instructions provided by an embodiment of the present disclosure.
Fig. 5 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
Fig. 1 shows an example block diagram of an electronic device 100 in the related art. As shown, electronic device 100 may include a processor 110 and a memory 120. Alternatively, the processor 110 may be a CPU, GPU, or the like, which may include an execution unit 111 and a cache unit 112. Illustratively, the execution unit 111 may initiate an access request to an address in the memory 120 to retrieve data stored in the address. At this time, whether the data of the address exists in the cache entry of the cache unit 112 may be first searched, if so, the address may be regarded as hit, and the data of the address may be directly read from the cache entry of the cache unit 112 and returned to the execution unit 111; if not, the address may be considered a miss (miss) and the data of the address may be subsequently requested from the memory 120, and the data returned by the memory 120 may be fed back to the execution unit 111 via the cache unit 112 and may optionally be stored in the cache unit 112 by replacing a cache entry in the cache unit 112.
Further, the processor 110 may optionally further include a memory management unit (Memory Management Unit, MMU) 113. The memory management unit 113 may implement the mapping between virtual addresses and physical addresses based on an address mapping table, which may take the form of a page table, for example, which may be stored, for example, local to the memory management unit 113, in the memory 120, or in a combination of both. Illustratively, the address in the access request issued by the execution unit 111 may be a virtual address, which may be converted to a physical address by the memory management unit 113, and further provided to the cache unit 112 for processing. For example, the virtual address space and the physical address space may each be divided in units of pages, each page may have a preset size, for example, 4KB or other preset size, and each mapping entry in the address mapping table used by the memory management unit 113 may correspond to an address mapping of one page.
In general, the cache molecules may have a pre-designed cache size, i.e., the size of the total space of the cache. The cache may be divided into a number of cache lines, each cache line having a size that defines the amount of data that a cache record can store. Further, the cache size and cache line size may determine the number of cache lines. In order to implement data exchange between the memory space and the cache space, a preset mapping relationship is generally established between the cache address and the memory address, for example, direct mapping, full association mapping, set association mapping, and the like. Specifically, for direct mapping, each data block in the memory can only be mapped to a specific cache line, i.e., the data blocks mapped to the same cache line compete for use of the cache line; for fully associative mapping, each data block in the memory may be mapped to any cache line, i.e., all data blocks compete for use of all cache lines; for set associative mapping, each data block in memory may be mapped to any one of a set of cache lines, i.e., the data blocks mapped to the same set compete for use of several cache lines within the set. Under the mapping mechanism, when a certain access request for a certain data block is not hit in a cache, the data block needs to be obtained from a memory, and a cache line is selected to be replaced in one or more cache lines having a mapping relation with the data block. In general, to ensure the efficiency of subsequent data reading and writing, a cache line that is least likely to be reused may be selected for replacement.
A cache line may be understood as the smallest unit of cache. Each cache line corresponds to the storage of data (data) and the storage of tags (tags), respectively. Wherein the data is stored in RAM (Random Access Memory ).
Since the memory access instruction is essentially complete reading and writing, in embodiments of the present disclosure, the memory access instruction may be reduced to a read instruction and a write instruction. Taking the group association mapping as an example, after receiving the access instruction, according to the request address of the access instruction, which group (set) of data requested by the access instruction is in the cache can be judged, then the labels of all ways (ways) in the group are respectively compared with the labels in the request address of the access instruction, whether the labels of all ways in the group have the same label as the labels in the request address of the access instruction or not is judged, and then the hit (hit) or miss (miss) of the access instruction in the cache is judged. For each cache line, a partial flag bit may also be used to identify whether or not the cache line has been overwritten. For any cache line, if a write operation occurs for that cache line, then partial=1 may be marked; if a read operation occurs for that cache line, then partial=0 may be marked. For a partial=1 cache line, data needs to be fetched from downstream. If hit, the cache line can be read or written directly, if miss, a new cache line can be allocated. If the access instruction is a read instruction, the data can be acquired from the downstream, and if the access instruction is a write instruction, the cache line can be directly updated.
After the access instruction arrives, how to ensure the scheduling sequence of different access instructions aiming at the same cache line is a technical problem to be solved.
In the embodiment of the disclosure, in response to receiving any memory instruction, the memory instruction is sequentially stored in an instruction buffer, where the scheduling priority of the memory instruction written in advance in the instruction buffer is higher than the scheduling priority of the memory instruction written later, a value of a specified flag bit corresponding to the memory instruction is set, where the specified flag bit is used to indicate whether the memory instruction can be scheduled, and from among the memory instructions whose values of the specified flag bit in the instruction buffer meet a first preset condition, the memory instruction with the highest scheduling priority is scheduled, where the first preset condition is a preset condition indicating that the memory instruction can be scheduled, so that the scheduling sequence of different memory instructions for the same cache line can be ensured, and the scheduling efficiency of the memory instructions for different cache lines can be improved.
The following describes in detail a method for scheduling access instructions according to an embodiment of the present disclosure with reference to the accompanying drawings.
Fig. 2 shows a flowchart of a method for scheduling access instructions provided by an embodiment of the present disclosure. In one possible implementation manner, the execution body of the scheduling method of the access instruction may be a scheduling device of the access instruction, for example, the scheduling method of the access instruction may be executed by a terminal device or a server or other electronic devices. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or the like. In some possible implementations, the method for scheduling the access instruction may be implemented by a manner in which the processor calls computer readable instructions stored in the memory. As shown in fig. 2, the method for scheduling the access instruction includes steps S21 to S23.
In step S21, in response to receiving any memory access instruction, the memory access instructions are sequentially stored in an instruction buffer, where the scheduling priority of the memory access instruction written first in the instruction buffer is higher than the scheduling priority of the memory access instruction written later.
In step S22, setting a value of a specified flag bit corresponding to the access instruction, where the specified flag bit is used to indicate whether the access instruction can be scheduled;
in step S23, from the memory access instructions whose values of the specified flag bits in the instruction buffer satisfy the first preset condition, the memory access instruction with the highest scheduling priority is scheduled, where the first preset condition is a preset condition indicating that the memory access instruction can be scheduled.
In the disclosed embodiments, the instruction buffer may represent a buffer for buffering memory access instructions, i.e., the instruction buffer may be used to buffer memory access instructions. In some application scenarios, the instruction buffer may also be referred to as an instruction buffer, an instruction queue, a memory instruction buffer, a memory instruction queue, etc., without limitation. In one example, the instruction BUFFER may be denoted REORDER_BUFFER.
In the embodiment of the disclosure, for a new access instruction, a location may be applied in the instruction buffer to store the access instruction. Wherein the instruction buffer is a sequentially stored buffer. For example, the depth of the instruction buffer is 9, and the 9 positions are denoted as position 0 to position 8, respectively. Before the access instruction D arrives, the access instruction a, the access instruction B and the access instruction C apply for the position 0, the position 1 and the position 2 in the instruction buffer respectively, and the access instruction a applying for the position 0 has been scheduled out of the instruction buffer, then the access instruction D applies for the position 3, not for the position 0.
In the embodiment of the disclosure, the scheduling priority of the access instruction written in advance in the instruction buffer is higher than the scheduling priority of the access instruction written in later, so that the scheduling sequence of different access instructions aiming at the same cache line can be ensured.
In one possible implementation, the instruction buffer is a ring buffer (ring buffer); the responding to receiving any access instruction, storing the access instruction in order in an instruction buffer, comprising: in response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer; the write pointer is updated by one bit in the circular direction of the instruction buffer. In this implementation, the target location may represent the location at which the write pointer of the instruction buffer is currently pointing.
In some application scenarios, the ring buffer may also be referred to as a circular queue (circular buffer), a circular buffer (circular buffer), or the like, which is not limited herein.
In this implementation, if the location pointed by the write pointer of the instruction buffer is already occupied, it may be determined that the instruction buffer is full, and the new memory access instruction needs to wait for the memory access instruction corresponding to the location pointed by the write pointer to be scheduled, and then can be stored in the location pointed by the write pointer.
As an example of this implementation, it may be determined whether the position pointed by the write pointer is occupied according to the value of the specified flag bit corresponding to the position pointed by the write pointer. In this example, it may be determined that the location pointed to by the write pointer has been occupied in response to the value of the specified flag bit corresponding to the location pointed to by the write pointer satisfying the first preset condition or the second preset condition; and determining that the position pointed by the write pointer is unoccupied in response to the fact that the value of the designated flag bit corresponding to the position pointed by the write pointer neither meets the first preset condition nor meets the second preset condition. For example, the specified flag bit includes an output valid bit and a waiting valid bit, the first preset condition is that the output valid bit is 1, and the second preset condition is that the waiting valid bit is 1; if the output valid bit or the waiting valid bit corresponding to the position pointed by the write pointer is 1, the position pointed by the write pointer can be determined to be occupied; if the output valid bit and the waiting valid bit corresponding to the position pointed by the write pointer are both 0, it can be determined that the position pointed by the write pointer is unoccupied.
In the implementation manner, in response to receiving any memory access instruction, the memory access instruction is stored at a target position pointed by a write pointer of the instruction buffer, and the write pointer is updated by one bit along the annular direction of the instruction buffer, so that the memory access instruction can be buffered in sequence through the instruction buffer.
As an example of this implementation, in response to receiving any memory instruction, storing the memory instruction at a target location pointed to by a write pointer of the instruction buffer, including: in response to receiving any memory instruction, storing group (set) information and way information in the memory instruction at a target location pointed by a write pointer of the instruction buffer; the method further comprises the steps of: and storing the accompanying information of the memory instruction at a position corresponding to the target position in a target memory corresponding to the instruction buffer.
In this example, the target memory corresponding to the instruction buffer may be a Random Access Memory (RAM) or the like, which is not limited herein.
In this example, the depth of the target memory to which the instruction buffer corresponds may be consistent with the depth of the instruction buffer. For example, the depth of the instruction buffer and the target memory corresponding to the instruction buffer may each be 9. Of course, the depth of the instruction buffer and the target memory corresponding to the instruction buffer can be flexibly set by a person skilled in the art according to the actual application scene requirement, and the method is not limited herein.
In this example, the accompanying information of the access instruction may represent information that is not used in the scheduling process in the information carried by the access instruction. That is, the scheduling of the memory access instruction may be completed only according to the information of the memory access instruction stored in the instruction buffer.
In this example, for any memory access instruction, when the memory access instruction is scheduled from the instruction buffer, the accompanying information of the memory access instruction may be read from the target memory corresponding to the instruction buffer.
In this example, in response to receiving any memory instruction, group information and way information in the memory instruction are stored at a target location pointed by a write pointer of the instruction buffer, and accompanying information of the memory instruction is stored at a location corresponding to the target location in a target memory corresponding to the instruction buffer, so that the memory instruction is buffered by the instruction buffer, and accompanying information of the memory instruction is buffered by the target memory corresponding to the instruction buffer, thereby improving efficiency of scheduling the memory instruction.
As another example of this implementation, all information in any memory instruction may be stored in response to receiving the memory instruction at a target location pointed to by a write pointer of the instruction buffer.
As an example of this implementation, the read pointer of the instruction buffer points to the first stored memory instruction in the instruction buffer.
The memory access instruction pointed by the read pointer is the memory access instruction with the highest scheduling priority in the instruction buffer. The first stored memory access instruction in the instruction buffer is the memory access instruction with the highest scheduling priority in the instruction buffer.
In this example, the read pointer of the instruction buffer points to the first stored memory access instruction in the instruction buffer, so that the memory access instruction with the highest scheduling priority in the instruction buffer can be determined according to the position pointed by the read pointer of the instruction buffer, and the scheduling sequence of different memory access instructions for the same cache line can be ensured. Specifically, the read pointer is used for providing a basis for selecting the dispatched instruction, that is, when the memory instruction is dispatched outwards from the instruction buffer, whether the dispatched instruction can be dispatched is judged in sequence from the memory instruction which is first stored, and when the memory instruction pointed by the read pointer is confirmed to be dispatched, the instruction pointed by the read pointer is dispatched preferentially without considering other memory instructions, so that the highest dispatching priority is reflected. If the memory access instruction pointed by the read pointer cannot be scheduled, sequentially detecting whether other memory access instructions can be scheduled out of the instruction buffer according to a certain sequence or direction, such as an instruction writing sequence or a preset updating sequence of the read pointer.
In other possible implementations, the instruction buffer may also be implemented using other sequentially stored data structures, without limitation.
In the disclosed embodiments, the designated flag bit may be set separately for each location (i.e., each row) in the instruction buffer. In one possible implementation, the designated flag bit corresponding to any location in the instruction buffer may be used to determine whether the location is occupied, and if so, whether the memory access instruction stored in the location can be scheduled. In another possible implementation, a designated flag bit corresponding to any location in the instruction buffer may be used to determine whether a memory access instruction stored at that location can be dispatched. In this implementation, it may be determined whether the location is occupied by another flag bit.
In a possible implementation manner, the setting a value of a designated flag bit corresponding to the access instruction includes: responding to the access instruction as a read instruction, and setting a value of a designated flag bit corresponding to the access instruction according to the existence condition of data requested by the access instruction in a cache; or, in response to the memory access instruction being a write instruction, setting a value of a specified flag bit corresponding to the memory access instruction according to a presence condition of a conflict read instruction corresponding to the memory access instruction in the instruction buffer, where the conflict read instruction corresponding to the memory access instruction represents a read instruction which corresponds to the same cache line as the memory access instruction before the memory access instruction and the value of the specified flag bit does not meet the first preset condition.
In this implementation manner, in response to receiving any one of the read instructions, a value of a designated flag bit corresponding to the read instruction may be set according to the existence of data requested by the read instruction in the cache. That is, whether the data requested by the read instruction exists in the cache may be determined in response to receiving any read instruction, and the value of the specified flag bit corresponding to the read instruction may be set according to the determination result.
In this implementation manner, in response to receiving any write instruction, according to the existence of a conflict read instruction corresponding to the write instruction in an instruction buffer, setting a value of a designated flag bit corresponding to the write instruction, where the conflict read instruction corresponding to the write instruction indicates a read instruction that corresponds to the same cache line as the write instruction before the write instruction and that does not satisfy a first preset condition. That is, in response to receiving any write instruction, it may be determined whether there is a read instruction which corresponds to the same cache line as the write instruction and cannot be scheduled in the instruction buffer, and the value of the specified flag bit corresponding to the write instruction may be set according to the determination result.
In this implementation manner, the value of the designated flag bit corresponding to the access instruction is set according to the existence condition of the data requested by the access instruction in the cache by responding to the access instruction as the read instruction, or the value of the designated flag bit corresponding to the access instruction is set according to the existence condition of the conflict read instruction corresponding to the access instruction in the instruction buffer by responding to the access instruction as the write instruction, wherein the conflict read instruction corresponding to the access instruction represents the read instruction which is before the access instruction, corresponds to the same cache line with the access instruction and the value of the designated flag bit does not meet the first preset condition, so that the scheduling sequence of different access instructions for the same cache line can be ensured based on the designated flag bit, and the scheduling efficiency of the access instructions for different cache lines can be improved.
As an example of this implementation manner, the responding to the access instruction as a read instruction, according to the existence of the data requested by the access instruction in the cache, sets a value of a specified flag bit corresponding to the access instruction, includes: responding to the access instruction as a read instruction, and setting the value of a designated flag bit corresponding to the access instruction to meet the first preset condition when data requested by the access instruction exists in a cache; or, in response to the access instruction being a read instruction, and no data requested by the access instruction exists in the cache, setting a value of a specified flag bit corresponding to the access instruction to satisfy a second preset condition; or, the responding to the memory access instruction as a write instruction, setting a value of a designated flag bit corresponding to the memory access instruction according to the existence of a conflict read instruction corresponding to the memory access instruction in the instruction buffer, including: responding to the access instruction as a write instruction, wherein no conflict read instruction corresponding to the access instruction exists in the instruction buffer, and setting the value of a designated zone bit corresponding to the access instruction to meet the first preset condition; or, in response to the memory access instruction being a write instruction and the instruction buffer having a conflict read instruction corresponding to the memory access instruction, setting a value of a designated flag bit corresponding to the memory access instruction to satisfy a second preset condition; the second preset condition is a preset condition indicating that the memory access instruction waits for downstream return data.
In this example, the value of the specified flag bit corresponding to the access instruction is set to satisfy the first preset condition by responding to the access instruction as a read instruction and the data requested by the access instruction is present in the cache, the value of the specified flag bit corresponding to the access instruction is set to satisfy a second preset condition in response to the access instruction as a write instruction and the conflict read instruction corresponding to the access instruction is not present in the instruction buffer, the value of the specified flag bit corresponding to the access instruction is set to satisfy the first preset condition in response to the access instruction as a write instruction and the conflict read instruction corresponding to the access instruction is present in the instruction buffer, the value of the specified flag bit corresponding to the access instruction is set to satisfy the second preset condition, wherein the second preset condition is a preset condition indicating that the access instruction waits for the access instruction, and thus whether the specified flag bit can be returned based on the specified instruction can be scheduled.
In one example, the specified flag bits include an output valid bit and a wait valid bit; the setting the value of the designated flag bit corresponding to the access instruction to satisfy the first preset condition includes: the output effective position corresponding to the access instruction is a first preset value, and the waiting effective position corresponding to the access instruction is a second preset value; or, the setting the value of the designated flag bit corresponding to the access instruction to satisfy the second preset condition includes: and taking the output effective position corresponding to the access instruction as the second preset value, and taking the waiting effective position corresponding to the access instruction as the first preset value.
In this example, each location (i.e., each row) in the instruction buffer corresponds to one output valid bit and one wait valid bit, respectively, where the output valid bit and the wait valid bit may be 1 bit, respectively. The output valid bit being a first preset value may indicate that the memory access instruction can be scheduled, the waiting valid bit being a first preset value may indicate that the memory access instruction waits for downstream return data, and the output valid bit and the waiting valid bit being both a second preset value may indicate that the position in the instruction buffer is unoccupied, i.e. the position has no memory access instruction.
In this example, any access instruction may be received, where the access instruction is a read instruction, and data requested by the access instruction exists in a cache, an output valid position corresponding to the access instruction is a first preset value, and a waiting valid position corresponding to the access instruction is a second preset value; the method comprises the steps that any access instruction can be received, the access instruction is a read instruction, data requested by the access instruction does not exist in the cache, an output effective position corresponding to the access instruction is the second preset value, and a waiting effective position corresponding to the access instruction is the first preset value; the method comprises the steps that any access instruction can be received, the access instruction is a write instruction, a conflict read instruction corresponding to the access instruction does not exist in an instruction buffer, an output effective position corresponding to the access instruction is a first preset value, and a waiting effective position corresponding to the access instruction is a second preset value; and responding to receiving any memory access instruction, wherein the memory access instruction is a write instruction, a conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is the second preset value, and the waiting effective position corresponding to the memory access instruction is the first preset value.
In one example, the first preset value is 1 and the second preset value is 0. In this example, the output valid position corresponding to the access instruction may be 1, and the waiting valid position corresponding to the access instruction may be 0 in response to receiving any access instruction, where the access instruction is a read instruction, and data requested by the access instruction exists in a cache; the method comprises the steps that any access instruction can be received, the access instruction is a read instruction, data requested by the access instruction does not exist in the cache, the output effective position corresponding to the access instruction is 0, and the waiting effective position corresponding to the access instruction is 1; the method comprises the steps that in response to receiving any memory access instruction, the memory access instruction is a write instruction, a conflict read instruction corresponding to the memory access instruction does not exist in an instruction buffer, the output effective position corresponding to the memory access instruction is 1, and the waiting effective position corresponding to the memory access instruction is 0; and responding to receiving any memory access instruction, wherein the memory access instruction is a write instruction, a conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is 0, and the waiting effective position corresponding to the memory access instruction is 1.
In another example, the first preset value is 0 and the second preset value is 1.
In one example, the output valid bit may be denoted as output_valid and the wait valid bit may be denoted as wait_valid.
In this example, the output valid position corresponding to the access instruction is a first preset value by responding to any access instruction, the access instruction is a read instruction, and data requested by the access instruction exists in a cache, the output valid position corresponding to the access instruction is a second preset value, or the output valid position corresponding to the access instruction is a first preset value in response to any access instruction being received, the output valid position corresponding to the access instruction is a read instruction, and no data requested by the access instruction exists in the cache, the output valid position corresponding to the access instruction is the second preset value, and the waiting valid position corresponding to the access instruction is the first preset value, or the output valid position corresponding to the access instruction is a write instruction in response to any conflict read instruction corresponding to the access instruction being not stored in an instruction buffer, and the waiting valid position corresponding to the access instruction is the first preset value, and the waiting valid position corresponding to the access instruction is the second preset value, or the waiting valid position corresponding to the access instruction is the first preset value, and the waiting position corresponding to the access instruction is able to be judged based on the first preset value.
In another example, the specified flag bit includes an output valid bit and a wait valid bit; the setting the value of the designated flag bit corresponding to the access instruction to satisfy the first preset condition includes: the output effective position corresponding to the access instruction is taken as a second preset value, and the waiting effective position corresponding to the access instruction is taken as a first preset value; the setting the value of the designated flag bit corresponding to the access instruction to satisfy the second preset condition includes: and taking the output effective position corresponding to the access instruction as the first preset value, and taking the waiting effective position corresponding to the access instruction as the second preset value.
In another example, any location in the instruction buffer may correspond to a designated flag bit, which may include two bits, 00 may indicate that the location in the instruction buffer is free of memory instructions (i.e., the location in the instruction buffer is unoccupied), 01 may indicate that the memory instructions for the location in the instruction buffer can be scheduled, and 10 may indicate that the memory instructions for the location in the instruction buffer are waiting for downstream return data.
In one possible implementation, the method further includes: for any cache line, in response to the existence of data of the cache line in the cache (i.e., the data of the cache line has been acquired from downstream and the data of the cache line exists in the cache), marking the data existence flag bit corresponding to the cache line as 1; and in response to the fact that the data of the cache line does not exist in the cache, marking the data existence flag bit corresponding to the cache line as 0.
In this implementation manner, for any memory access instruction, if the memory access instruction is a read instruction, a flag bit of data corresponding to a cache line requested by the memory access instruction may be marked as 1, an output valid position corresponding to the memory access instruction is a first preset value, and a waiting valid position corresponding to the memory access instruction is a second preset value; or, the data presence flag bit corresponding to the cache line requested by the access instruction may be marked as 0, the output valid position corresponding to the access instruction is the second preset value, and the waiting valid position corresponding to the access instruction is the first preset value.
The process of acquiring the data of the cache line from the downstream and updating the data existence flag bit corresponding to the cache line from 0 to 1 may be referred to as activation of the cache line. The process of updating the output valid bit corresponding to the memory access instruction from 0 to 1 may be referred to as activation of the output valid bit.
In one possible implementation, the method further includes: and responding to the access instruction as a read instruction, wherein the cache does not contain data requested by the access instruction, and requesting to acquire the data corresponding to the access instruction from the downstream.
In this implementation manner, the data corresponding to the access instruction is requested to be obtained from the downstream by responding to the access instruction as a read instruction and no data requested by the access instruction exists in the cache, so that the data corresponding to the access instruction is requested to be obtained from the downstream before the access instruction is scheduled from the instruction buffer, thereby being beneficial to improving the scheduling efficiency of the access instruction.
As an example of this implementation, the method further comprises: and in response to receiving the downstream returned data, comparing the path group information corresponding to the downstream returned data with the path group information corresponding to the memory access instruction of which the value of the designated mark bit in the instruction buffer meets a second preset condition, and updating the designated mark bit corresponding to the memory access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition for indicating that the memory access instruction waits for downstream returned data.
In one example, the specified flag bits include an output valid bit and a wait valid bit; the second preset condition is: the wait valid bit is a first preset value. For example, the first preset value is 1, and the second preset value is 0. In this example, the way set information corresponding to the downstream returned data may be compared with the way set information corresponding to the access instruction waiting for the valid bit to be 1 in the instruction buffer in response to receiving the downstream returned data, and the output valid bit and the waiting valid bit corresponding to the access instruction in the instruction buffer may be updated according to the comparison result. For example, if the way set information corresponding to the data returned from the downstream is the same as the way set information corresponding to any access instruction with a waiting valid bit of 1 in the instruction buffer, the output valid bit corresponding to the access instruction may be updated to 1, and the waiting valid bit corresponding to the access instruction may be updated to 0.
In this example, the method includes comparing the way set information corresponding to the downstream returned data with the way set information corresponding to the access instruction in which the value of the specified flag bit in the instruction buffer meets a second preset condition, and updating the specified flag bit corresponding to the access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition indicating that the access instruction waits for the downstream returned data, so that activation of the specified flag bit can be achieved, that is, the value of the specified flag bit can meet the first preset condition, so that the access instruction can be scheduled.
In one example, the method further comprises: and in response to receiving the downstream returned data, writing the downstream returned data into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue.
In one example, the PENDING data queue may be denoted as a MISS_PENDING_FIFO.
In this example, the operation source of the cache may include a write instruction that the data in the pending data queue and the value of the specified flag bit satisfy a first preset condition. The priority of the data in the data queue to be processed may be higher than the priority of the write instruction in which the value of the specified flag bit satisfies the first preset condition.
In this example, the downstream returned data is written into the data queue to be processed in response to receiving the downstream returned data, wherein the data queue to be processed is a first-in first-out queue, so that the order of memory access operation corresponding to the downstream returned data can be kept.
In the disclosed embodiment, the memory access instructions written to the instruction buffer first have a higher scheduling priority than the memory access instructions written to the instruction buffer later. However, when the specified flag bit of the access instruction written in the instruction buffer at first does not meet the first preset condition and then the specified flag bit of the access instruction written in the instruction buffer at last meets the first preset condition, the access instruction written in the specified buffer at last can be scheduled out and processed earlier than the access instruction written in the instruction buffer at first, so that the efficiency of scheduling the access instruction can be improved. In addition, because the designated flag bits of all access instructions aiming at the same cache line in the instruction buffer are the same, different access instructions aiming at the same cache line are scheduled according to the written sequence, and therefore, the correctness of the processing logic for scheduling different access instructions aiming at the same cache line can be ensured.
The following describes a scheduling method of a memory access instruction provided by the embodiment of the present disclosure through a specific application scenario. Fig. 3 shows a schematic diagram of a hardware architecture for scheduling access instructions provided by an embodiment of the present disclosure.
In fig. 3, the instruction buffer may be a ring buffer including a write pointer and a read pointer. For a new access instruction, the group information and the way information in the access instruction can be stored in the target position pointed by the write pointer of the instruction buffer. And, the accompanying information of the memory access instruction may be stored in a location corresponding to the target location in the RAM corresponding to the instruction buffer. In addition, the read pointer of the instruction buffer may point to the first stored memory access instruction in the instruction buffer.
In this application scenario, for any cache line, in response to the data of the cache line existing in the cache (that is, the data of the cache line has been acquired from downstream and the data of the cache line exists in the cache), the data existence flag corresponding to the cache line may be set to 1; the data presence flag corresponding to the cache line may be set to 0 in response to the absence of data for the cache line in the cache.
The method comprises the steps that any access instruction can be received, the access instruction is a read instruction, data requested by the access instruction exist in a cache, the output effective position corresponding to the access instruction is 1, and the waiting effective position corresponding to the access instruction is 0; the method comprises the steps that any access instruction can be received, the access instruction is a read instruction, data requested by the access instruction does not exist in the cache, the output effective position corresponding to the access instruction is 0, and the waiting effective position corresponding to the access instruction is 1; the method comprises the steps that in response to receiving any memory access instruction, the memory access instruction is a write instruction, a conflict read instruction corresponding to the memory access instruction does not exist in an instruction buffer, the output effective position corresponding to the memory access instruction is 1, and the waiting effective position corresponding to the memory access instruction is 0; and responding to receiving any memory access instruction, wherein the memory access instruction is a write instruction, a conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is 0, and the waiting effective position corresponding to the memory access instruction is 1.
For a memory access instruction waiting for the valid bit to be 1, a cache line corresponding to the memory access instruction needs to be activated. That is, the data of the cache line corresponding to the access instruction needs to be acquired from the downstream. The data returned from the downstream can be written into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue. The data existence flag bit corresponding to any cache line can be updated to 1 in response to the data of the cache line being acquired from the downstream. And in response to the update of the data existence flag bit corresponding to the cache line to be 1, updating the output valid bit corresponding to the access instruction corresponding to the cache line in the instruction buffer to be 1, and waiting for the update of the valid bit to be 0.
For the memory access instruction with the highest dispatching priority in the instruction buffer, the memory access instruction can be dispatched from the instruction buffer in response to the output valid bit corresponding to the memory access instruction being 1, and the accompanying information of the memory access instruction can be read from the RAM corresponding to the instruction buffer. If the access instruction is a write instruction, writing the access instruction into a corresponding way group in the cache; if the access instruction is a read instruction, the read data can be returned to the upper module.
It will be appreciated that the above-mentioned method embodiments of the present disclosure may be combined with each other to form a combined embodiment without departing from the principle logic, and are limited to the description of the present disclosure. It will be appreciated by those skilled in the art that in the above-described methods of the embodiments, the particular order of execution of the steps should be determined by their function and possible inherent logic.
In addition, the disclosure further provides a scheduling device, an electronic device, a computer readable storage medium and a computer program product for the memory access instruction, and the foregoing may be used to implement any scheduling method for the memory access instruction provided in the disclosure, and the corresponding technical scheme and the technical effect may be referred to the corresponding records of the method section and are not repeated.
Fig. 4 shows a block diagram of a scheduling apparatus for access instructions provided by an embodiment of the present disclosure. As shown in fig. 4, the scheduling device of the access instruction includes:
a storage module 41, configured to sequentially store access instructions in an instruction buffer in response to receiving any access instruction, where a scheduling priority of an access instruction written first in the instruction buffer is higher than a scheduling priority of an access instruction written later;
The setting module 42 is configured to set a value of a specified flag bit corresponding to the access instruction, where the specified flag bit is used to indicate whether the access instruction can be scheduled;
the scheduling module 43 is configured to schedule, from the memory access instructions whose values of the specified flag bits in the instruction buffer satisfy the first preset condition, a memory access instruction with a highest scheduling priority, where the first preset condition is a preset condition indicating that the memory access instruction can be scheduled.
In one possible implementation, the setting module 42 is configured to:
responding to the access instruction as a read instruction, and setting a value of a designated flag bit corresponding to the access instruction according to the existence condition of data requested by the access instruction in a cache;
or alternatively, the process may be performed,
and responding to the access instruction as a write instruction, and setting a value of a specified zone bit corresponding to the access instruction according to the existence condition of a conflict read instruction corresponding to the access instruction in the instruction buffer, wherein the conflict read instruction corresponding to the access instruction represents a read instruction which corresponds to the same cache line with the access instruction before the access instruction and does not meet the first preset condition.
In one possible implementation, the setting module 42 is configured to:
responding to the access instruction as a read instruction, and setting the value of a designated flag bit corresponding to the access instruction to meet the first preset condition when data requested by the access instruction exists in a cache;
or alternatively, the process may be performed,
responding to the access instruction as a read instruction, wherein no data requested by the access instruction exists in the cache, and setting the value of a designated flag bit corresponding to the access instruction to meet a second preset condition;
or alternatively, the process may be performed,
responding to the access instruction as a write instruction, wherein no conflict read instruction corresponding to the access instruction exists in the instruction buffer, and setting the value of a designated zone bit corresponding to the access instruction to meet the first preset condition;
or alternatively, the process may be performed,
responding to the access instruction as a write instruction, and setting the value of a designated zone bit corresponding to the access instruction to meet a second preset condition when a conflict read instruction corresponding to the access instruction exists in the instruction buffer;
the second preset condition is a preset condition indicating that the memory access instruction waits for downstream return data.
In one possible implementation, the specified flag bit includes an output valid bit and a wait valid bit;
The setting module 42 is configured to:
responding to the access instruction as a read instruction, caching data requested by the access instruction, taking an output effective position corresponding to the access instruction as a first preset value, and taking a waiting effective position corresponding to the access instruction as a second preset value;
or alternatively, the process may be performed,
responding to the access instruction as a read instruction, wherein no data requested by the access instruction exists in the cache, taking the output effective position corresponding to the access instruction as the second preset value, and taking the waiting effective position corresponding to the access instruction as the first preset value;
or alternatively, the process may be performed,
responding to the memory access instruction as a write instruction, wherein no conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is a first preset value, and the waiting effective position corresponding to the memory access instruction is a second preset value;
or alternatively, the process may be performed,
responding to the memory access instruction as a write instruction, wherein a conflict read instruction corresponding to the memory access instruction exists in the instruction buffer, the output effective position corresponding to the memory access instruction is the second preset value, and the waiting effective position corresponding to the memory access instruction is the first preset value.
In one possible implementation, the apparatus further includes:
and the data request module is used for responding to the access instruction as a read instruction, and the data requested by the access instruction does not exist in the cache, so as to request to acquire the data corresponding to the access instruction from the downstream.
In one possible implementation, the apparatus further includes:
and the updating module is used for responding to the received data returned from the downstream, comparing the path group information corresponding to the data returned from the downstream with the path group information corresponding to the memory access instruction of which the value of the designated mark bit meets a second preset condition in the instruction buffer, and updating the designated mark bit corresponding to the memory access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition for indicating that the memory access instruction waits for the data returned from the downstream.
In one possible implementation, the apparatus further includes:
and the writing module is used for responding to the received data returned from the downstream, and writing the data returned from the downstream into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue.
In one possible implementation, the instruction buffer is a ring buffer;
The storage module 41 is configured to:
in response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer;
the write pointer is updated by one bit in the circular direction of the instruction buffer.
In one possible implementation, the storage module 41 is configured to:
in response to receiving any access instruction, storing group information and path information in the access instruction at a target position pointed by a write pointer of the instruction buffer;
and storing the accompanying information of the memory instruction at a position corresponding to the target position in a target memory corresponding to the instruction buffer.
In one possible implementation, the read pointer of the instruction buffer points to the first stored memory instruction in the instruction buffer.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementation and technical effects of the functions or modules may refer to the descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The disclosed embodiments also provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method. Wherein the computer readable storage medium may be a non-volatile computer readable storage medium or may be a volatile computer readable storage medium.
The disclosed embodiments also propose a computer program comprising computer readable code which, when run in an electronic device, causes a processor in the electronic device to carry out the above method.
Embodiments of the present disclosure also provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in an electronic device, causes a processor in the electronic device to perform the above method.
The embodiment of the disclosure also provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored by the memory to perform the above-described method.
The electronic device may be provided as a terminal, server or other form of device.
Fig. 5 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure. For example, electronic device 1900 may be provided as a server. Referring to FIG. 5, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output interface 1958 (I/O interface). Electronic device 1900 may operate an operating system based on memory 1932, such as the Microsoft Server operating system (Windows Server) TM ) Apple Inc. developed graphical user interface based operating System (Mac OS X TM ) Multi-user multi-process computer operating system (Unix) TM ) Unix-like operating system (Linux) of free and open source code TM ) Unix-like operating system (FreeBSD) with open source code TM ) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1932, including computer program instructions executable by processing component 1922 of electronic device 1900 to perform the methods described above.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
If the technical scheme of the embodiment of the disclosure relates to personal information, the product applying the technical scheme of the embodiment of the disclosure clearly informs the personal information processing rule and obtains personal independent consent before processing the personal information. If the technical solution of the embodiment of the present disclosure relates to sensitive personal information, the product applying the technical solution of the embodiment of the present disclosure obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of "explicit consent". For example, a clear and remarkable mark is set at a personal information acquisition device such as a camera to inform that the personal information acquisition range is entered, personal information is acquired, and if the personal voluntarily enters the acquisition range, the personal information is considered as consent to be acquired; or on the device for processing the personal information, under the condition that obvious identification/information is utilized to inform the personal information processing rule, personal authorization is obtained by popup information or a person is requested to upload personal information and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing mode, and a type of personal information to be processed.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (13)

1. The scheduling method of the access instruction is characterized by comprising the following steps of:
in response to receiving any memory access instruction, sequentially storing the memory access instructions in an instruction buffer, wherein the scheduling priority of the memory access instruction written in the instruction buffer is higher than that of the memory access instruction written later;
setting a value of a specified flag bit corresponding to the access instruction, wherein the specified flag bit is used for indicating whether the access instruction can be scheduled;
and dispatching the memory access instruction with the highest dispatching priority from the memory access instruction with the value of the designated zone bit in the instruction buffer meeting a first preset condition, wherein the first preset condition is a preset condition for indicating that the memory access instruction can be dispatched.
2. The method of claim 1, wherein the setting the value of the designated flag bit corresponding to the access instruction comprises:
responding to the access instruction as a read instruction, and setting a value of a designated flag bit corresponding to the access instruction according to the existence condition of data requested by the access instruction in a cache;
or alternatively, the process may be performed,
and responding to the access instruction as a write instruction, and setting a value of a specified zone bit corresponding to the access instruction according to the existence condition of a conflict read instruction corresponding to the access instruction in the instruction buffer, wherein the conflict read instruction corresponding to the access instruction represents a read instruction which corresponds to the same cache line with the access instruction before the access instruction and does not meet the first preset condition.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the responding the access instruction as a read instruction, and setting the value of the designated flag bit corresponding to the access instruction according to the existence of the data requested by the access instruction in the cache, includes: responding to the access instruction as a read instruction, and setting the value of a designated flag bit corresponding to the access instruction to meet the first preset condition when data requested by the access instruction exists in a cache; or, in response to the access instruction being a read instruction, and no data requested by the access instruction exists in the cache, setting a value of a specified flag bit corresponding to the access instruction to satisfy a second preset condition;
Or alternatively, the process may be performed,
the responding the access instruction as a write instruction, setting the value of the designated flag bit corresponding to the access instruction according to the existence condition of the conflict read instruction corresponding to the access instruction in the instruction buffer, including: responding to the access instruction as a write instruction, wherein no conflict read instruction corresponding to the access instruction exists in the instruction buffer, and setting the value of a designated zone bit corresponding to the access instruction to meet the first preset condition; or, in response to the memory access instruction being a write instruction and the instruction buffer having a conflict read instruction corresponding to the memory access instruction, setting a value of a designated flag bit corresponding to the memory access instruction to satisfy a second preset condition;
the second preset condition is a preset condition indicating that the memory access instruction waits for downstream return data.
4. The method of claim 3, wherein the designated flag bit comprises an output valid bit and a wait valid bit;
the setting the value of the designated flag bit corresponding to the access instruction to satisfy the first preset condition includes: the output effective position corresponding to the access instruction is a first preset value, and the waiting effective position corresponding to the access instruction is a second preset value;
Or alternatively, the process may be performed,
the setting the value of the designated flag bit corresponding to the access instruction to satisfy the second preset condition includes: and taking the output effective position corresponding to the access instruction as the second preset value, and taking the waiting effective position corresponding to the access instruction as the first preset value.
5. The method according to any one of claims 1 to 4, further comprising:
and responding to the access instruction as a read instruction, wherein the cache does not contain data requested by the access instruction, and requesting to acquire the data corresponding to the access instruction from the downstream.
6. The method of claim 5, wherein the method further comprises:
and in response to receiving the downstream returned data, comparing the path group information corresponding to the downstream returned data with the path group information corresponding to the memory access instruction of which the value of the designated mark bit in the instruction buffer meets a second preset condition, and updating the designated mark bit corresponding to the memory access instruction in the instruction buffer according to the comparison result, wherein the second preset condition is a preset condition for indicating that the memory access instruction waits for downstream returned data.
7. The method of claim 6, wherein the method further comprises:
and in response to receiving the downstream returned data, writing the downstream returned data into a data queue to be processed, wherein the data queue to be processed is a first-in first-out queue.
8. The method of any one of claims 1 to 4, wherein the instruction buffer is a ring buffer;
the responding to receiving any access instruction, storing the access instruction in order in an instruction buffer, comprising:
in response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer;
the write pointer is updated by one bit in the circular direction of the instruction buffer.
9. The method of claim 8, wherein the step of determining the position of the first electrode is performed,
the response to receiving any memory access instruction, storing the memory access instruction at a target position pointed by a write pointer of the instruction buffer, including: in response to receiving any access instruction, storing group information and path information in the access instruction at a target position pointed by a write pointer of the instruction buffer;
The method further comprises the steps of: and storing the accompanying information of the memory instruction at a position corresponding to the target position in a target memory corresponding to the instruction buffer.
10. The method of claim 8, wherein the read pointer of the instruction buffer points to a first-stored memory instruction in the instruction buffer.
11. A scheduling apparatus for access instructions, comprising:
the storage module is used for responding to any access instruction, and sequentially storing the access instructions in an instruction buffer, wherein the scheduling priority of the access instruction written in the instruction buffer is higher than that of the access instruction written later;
the setting module is used for setting the value of a specified flag bit corresponding to the access instruction, wherein the specified flag bit is used for indicating whether the access instruction can be scheduled;
and the scheduling module is used for scheduling the access instruction with the highest scheduling priority from the access instructions with the values of the specified flag bits in the instruction buffer meeting the first preset condition, wherein the first preset condition is a preset condition indicating that the access instruction can be scheduled.
12. An electronic device, comprising:
one or more processors;
a memory for storing executable instructions;
wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the method of any of claims 1 to 10.
13. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 10.
CN202310797986.9A 2023-06-30 2023-06-30 Scheduling method and device of access instruction, electronic equipment and storage medium Pending CN116841624A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310797986.9A CN116841624A (en) 2023-06-30 2023-06-30 Scheduling method and device of access instruction, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310797986.9A CN116841624A (en) 2023-06-30 2023-06-30 Scheduling method and device of access instruction, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116841624A true CN116841624A (en) 2023-10-03

Family

ID=88159360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310797986.9A Pending CN116841624A (en) 2023-06-30 2023-06-30 Scheduling method and device of access instruction, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116841624A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117331525A (en) * 2023-11-21 2024-01-02 苏州元脑智能科技有限公司 Information scheduling method, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117331525A (en) * 2023-11-21 2024-01-02 苏州元脑智能科技有限公司 Information scheduling method, device, computer equipment and storage medium
CN117331525B (en) * 2023-11-21 2024-02-23 苏州元脑智能科技有限公司 Information scheduling method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110275841B (en) Access request processing method and device, computer equipment and storage medium
CN107870728B (en) Method and apparatus for moving data
EP2478441B1 (en) Read and write aware cache
US10565131B2 (en) Main memory including hardware accelerator and method of operating the same
US10303608B2 (en) Intelligent data prefetching using address delta prediction
US20190065384A1 (en) Expediting cache misses through cache hit prediction
CN111737564B (en) Information query method, device, equipment and medium
KR20150106132A (en) Method and apparatus for controlling a cache memory of electronic device
CN116841624A (en) Scheduling method and device of access instruction, electronic equipment and storage medium
CN115599707A (en) Memory management method, device, medium and electronic equipment
CN111183411A (en) Dynamic address translation for virtual machines
CN116820579A (en) Scheduling method and device of access instruction, electronic equipment and storage medium
US20200371827A1 (en) Method, Apparatus, Device and Medium for Processing Data
US10684857B2 (en) Data prefetching that stores memory addresses in a first table and responsive to the occurrence of loads corresponding to the memory addresses stores the memory addresses in a second table
CN116303126B (en) Caching method, data processing method and electronic equipment
CN113157477A (en) Memory leak attribution method and device, electronic equipment and storage medium
CN114924794B (en) Address storage and scheduling method and device for transmission queue of storage component
CN114385891B (en) Data searching method and device, electronic equipment and storage medium
US20140189182A1 (en) Method to accelerate message signaled interrupt processing
US11942962B2 (en) Methods and apparatus to write data to registers
CN112764668A (en) Method, electronic device and computer program product for expanding GPU memory
CN116841623A (en) Scheduling method and device of access instruction, electronic equipment and storage medium
US20170293554A1 (en) Hardware-assisted garbage collection
US7421536B2 (en) Access control method, disk control unit and storage apparatus
US20240028519A1 (en) Data processing method, electronic device and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination