A memory access method, processor, electronic device and readable storage medium
By setting up a cache unit in the processor's retention station and combining read requests, the register stack read port pressure problem during vector instructions execution in RVV is solved, and the processing frequency of the processor is increased.
Patent Information
- Application Number
- CN202411287927.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-09-13
AI Technical Summary
In RVV of the RISC-V architecture, the vector instruction execution leads to an increase in the register stack read port pressure, reducing the processor's processing frequency.
By setting up a cache unit in the retention station, split the target vector instruction into multiple vector elements, and using the cache unit to merge read requests according to the source register number, reducing the number of accesses to the register stack and improving read efficiency.
The read port pressure of the register stack is reduced and the processing frequency of the processor when the vector instruction is executed is increased.
Smart Images

Figure CN118796272B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a memory access method, a processor, an electronic device and a readable storage medium. Background Art
[0002] RISC-V Vector Extension (RVV) is an important extension of the RISC-V architecture, designed to improve the performance of the processor on vector and parallel computing tasks. RVV introduces a flexible vector length design, allowing developers to dynamically adjust the scale of vector operations according to specific application requirements during processor operation. This feature greatly enhances the flexibility and efficiency of RISC-V processors in processing vector data of different sizes and complexities.
[0003] In RVV, a vector instruction can be split into multiple vector elements for execution. For example, when the total length of a single vector register (Vector Length, VLEN) is 128 bits, the number of "logical" channels in the vector register (Lane Multiplication Factor, LMUL) is 8, and the nominal width of a single vector element (Select Element Width, SEW) is 8 bits, a vector instruction will be split into 128 vector elements for execution.
[0004] However, each vector element needs to read the register file (for example, the integer register file and the vector register file) during execution. Especially in the scenario of high concurrent execution of vector elements, the reading pressure of the register file increases, which reduces the processing frequency of the processor. Summary of the invention
[0005] The embodiments of the present invention provide a memory access method, a processor, an electronic device and a readable storage medium, which can solve the problem that when a processor in the related art executes a vector instruction, the read port pressure of the register stack increases and the processing frequency of the processor decreases.
[0006] In order to solve the above problem, an embodiment of the present invention discloses a memory access method, which is applied to a processor, wherein the processor includes a register file, a reservation station, and a cache unit arranged in the reservation station; the method includes:
[0007] The reservation station splits the target vector instruction to obtain at least two first vector elements, and sends a first read request corresponding to the first vector element to the cache unit; the first read request carries the source register number of the first vector element;
[0008] The cache unit receives the first read request, and returns a target index value corresponding to the first vector element to the reservation station according to a source register number carried in the first read request;
[0009] The cache unit merges the requests carrying the same source register number in the received first read requests to obtain at least one second read request;
[0010] The cache unit obtains a first register value corresponding to the second read request from the register file;
[0011] The reservation station obtains the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met.
[0012] On the other hand, an embodiment of the present invention discloses a processor, the processor comprising a register file, a reservation station, and a cache unit arranged in the reservation station;
[0013] The reservation station is used to split the target vector instruction to obtain at least two first vector elements, and send a first read request corresponding to the first vector element to the cache unit; the first read request carries the source register number of the first vector element;
[0014] The cache unit is configured to receive the first read request, and return a target index value corresponding to the first vector element to the reservation station according to a source register number carried in the first read request; merge requests carrying the same source register number in the received first read requests to obtain at least one second read request; and obtain a first register value corresponding to the second read request from the register stack;
[0015] The reservation station is further configured to obtain, when an execution condition of the first vector element is met, a second register value corresponding to the first vector element from the cache unit according to the target index value.
[0016] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned memory access method.
[0017] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned memory access method.
[0018] The embodiments of the present invention include the following advantages:
[0019] An embodiment of the present invention provides a memory access method. When a reservation station needs to access a register stack to obtain a register value corresponding to a target vector instruction, the reservation station first splits the target vector instruction into at least two first vector elements, and then sends a first read request corresponding to the first vector element to a cache unit set in the reservation station; the cache unit returns a target index value corresponding to the first vector element to the reservation station according to a source register number carried in the first read request, and merges the requests carrying the same source register number in the received first read requests, and accesses the register stack based on the merged second read request to obtain the first register value corresponding to the second read request, thereby avoiding repeated access to the register stack, reducing the number of times the register stack is accessed, and thus reducing the read port pressure of the register stack; when the execution condition of the first vector element is met, the reservation station can directly obtain the second register value corresponding to the first vector element from the cache unit according to the target index value corresponding to the first vector element, without accessing the register stack again, thereby improving the efficiency of reading register values from the register stack during the parallel execution of the first vector element, thereby improving the processing frequency of the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0021] Figure 1 is a flow chart of steps of an embodiment of a memory access method of the present invention;
[0022] Figure 2 is a logic block diagram of a processor of the present invention;
[0023] Figure 3 is a structural block diagram of another processor of the present invention;
[0024] Figure 4 It is a structural block diagram of an electronic device for accessing memory provided by an example of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.
[0027] Method Embodiment
[0028] Reference Figure 1 , shows a flow chart of steps of an embodiment of a memory access method of the present invention, and the method may specifically include the following steps:
[0029] Step 101: The reservation station splits the target vector instruction to obtain at least two first vector elements, and sends a first read request corresponding to the first vector element to the cache unit; the first read request carries the source register number of the first vector element.
[0030] Step 102: The cache unit receives a first read request, and returns a target index value corresponding to a first vector element to a reservation station according to a source register number carried in the first read request.
[0031] Step 103: The cache unit merges the received first read requests that carry the same source register number to obtain at least one second read request.
[0032] Step 104: The cache unit obtains a first register value corresponding to the second read request from the register file.
[0033] Step 105: When the execution condition of the first vector element is met, the reservation station obtains the second register value corresponding to the first vector element from the cache unit according to the target index value.
[0034] The memory access method provided in the embodiment of the present invention can be applied to a processor, which can be a vector processor based on the RVV instruction set. A vector processor (also called an array processor) is a central processing unit (CPU) that directly operates a one-dimensional array (vector) instruction set. The vector processor can perform calculation operations on integrated data synchronously, thereby greatly improving performance in a specific working environment, especially in numerical simulation or other fields that require processing of a large amount of similar data.
[0035] Reference Figure 2 , shows a logic block diagram of a processor of the present invention. In an embodiment of the present invention, the processor includes a register file 20, a reservation station 10 and a cache unit 11. Among them, the register file, also known as the register file, is a key hardware component in a computer processor, mainly composed of an array of multiple registers, which is usually implemented by a fast static random access memory (SRAM), with a dedicated read port (read port) and a write port (write port), which can access different registers in multiple ways concurrently. The memory access method provided in the embodiment of the present invention is mainly used to reduce the pressure of the register file read port when the first vector element is executed concurrently.
[0036] A reservation station (also called a launch queue or reorder cache) is a special structure in the processor that is used to temporarily store instructions and their operands waiting to be executed. The reservation station uses technical means such as register renaming to achieve out-of-order execution and parallel processing of instructions, thereby improving processor performance.
[0037] The cache unit (regCache) is a functional unit set in the reservation station. The cache unit is used to receive a read request sent by the reservation station, and read the register value corresponding to the read request from the register stack through the read port of the register stack based on the read request sent by the reservation station, and store the read register value so that the reservation station can directly obtain the target register value corresponding to the target instruction from the register value stored in the cache unit when it needs to issue the target instruction.
[0038] Specifically, the instructions to be executed in the processor will be sent to the reservation station. After receiving the target vector instruction and before transmitting the target instruction for execution, the reservation station will first split the target vector instruction into at least two first vector elements through step 101; it can be understood that the complete target vector instruction can be obtained by splicing the various first vector elements.
[0039] The target vector instruction is any vector instruction among the vector instructions that the processor needs to execute.
[0040] In an embodiment of the present invention, the reservation station can split the target vector instruction according to the length of a single vector source register corresponding to the target vector instruction, the number of "logical" channels of the vector source register, and the nominal width of the vector elements in the vector source register to obtain at least two first vector elements.
[0041] Specifically, the number of first vector elements can be calculated by the following formula:
[0042] (1)
[0043] in, represents the number of elements of the first vector; Indicates the length of a single vector source register corresponding to the target vector instruction; Indicates the number of "logical" channels of the vector source register; Indicates the nominal width of the vector elements in the vector source register.
[0044] Exemplarily, when the length of a single vector source register corresponding to the target vector instruction is 128 bits, the number of "logical" channels of the vector source register is 8, and the nominal width of the vector elements in the vector source register is 8 bits, the number of first vector elements obtained in step 101 is 128.
[0045] It is understandable that each first vector element can be executed concurrently, and before concurrent execution, the reservation station needs to obtain the register value required to execute each first vector element. In an embodiment of the present invention, after obtaining the first vector elements through step 101, the reservation station can generate a first read request corresponding to each first vector element for each first vector element, and send the first read request corresponding to each first vector element to the cache unit.
[0046] The number of first read requests is the same as the number of first vector elements, and the first read request carries the source register number of the first vector element, and the source register corresponding to the source register number stores the second register value corresponding to the first vector element.
[0047] It should be noted that the source register corresponding to the source register number is a register in the register stack. The reservation station can access the source register corresponding to the source register number through the read port of the register stack and obtain the register value from the source register; the source register corresponding to the source register number may include but is not limited to a vector source register, an integer source register, etc. in the register stack.
[0048] In an embodiment of the present invention, when the cache unit receives a first read request, it can first determine the index value corresponding to the source register number locally in the cache unit based on the source register number carried in the first read request; then, determine the index value corresponding to the source register number as the target index value corresponding to the first vector element, and return the target index value to the reservation station.
[0049] It should be noted that, before step 102, the local cache area of the cache unit may be in a blank state or in a non-blank state.
[0050] Specifically, the local cache area of the cache unit being in a non-blank state means that before step 102, the cache unit has locally stored at least one index value corresponding to a register number and a register value corresponding to the register number; in the local cache area of the cache unit, the register number, the index value and the register value can be stored according to a preset corresponding relationship, so that the cache unit can determine the index value corresponding to the register number according to the register number, and determine the register value corresponding to the register number according to the index value.
[0051] Among them, the register number is the number of the register in the register file, and the register value corresponding to the register number is the register data stored in the register corresponding to the register number. It can be understood that the register in the register file includes the source register corresponding to the target vector instruction, and the register number includes the source register number of the first vector element. It should be noted that the register number stored locally in the cache unit is the number of at least one register in the register file. Before step 102, the register number stored in the cache unit may include the source register number of the first vector element, or may not include the source register number of the first vector element.
[0052] The register numbers, index values, and register values stored according to the preset corresponding relationship may specifically include, but are not limited to: a linked list, an array, a hash table, and the like.
[0053] The blank state of the local cache area of the cache unit means that before step 102 , the local cache unit has not stored the register number, index value and register value yet.
[0054] In an embodiment of the present invention, when the cache unit receives the first read request sent by the reservation station, if the local cache area is in a blank state, an index value corresponding to the source register number carried by the first read request is created in the cache area, and the index value corresponding to the source register number carried by the created first read request is determined as the target index value; illustratively, if the local cache area is in a blank state, the index value corresponding to the source register number carried by the first read request created in the cache area may be id0.
[0055] If the local cache area is in a non-blank state, the cache unit can first search the local cache area for the index value corresponding to the source register number carried by the first read request; if the index value corresponding to the source register number exists in the local cache area, the index value corresponding to the source register number is determined as the target index value corresponding to the first vector element, and the target index value is returned to the reservation station; if the index value corresponding to the source register number does not exist in the local cache area, the index value corresponding to the source register number carried by the first read request is created in the local cache area as the target index value corresponding to the first vector element, and the target index value is sent to the reservation station. It should be noted that, when the local cache area is in a non-blank state, the index value created in the local cache area is an index value different from the index value already stored locally; illustratively, the index values in the cache unit are created in ascending order, and the index values stored in the current cache area include id0, id1, and id2, then the index value corresponding to the source register number carried by the first read request that the cache unit continues to create in the local cache area can be id3.
[0056] In an embodiment of the present invention, when the cache unit receives the first read request, it will also merge the requests carrying the same source register number in the received first read request according to the source register number carried in the first read request through step 103 to obtain at least one second read request.
[0057] It should be noted that the requests carrying the same source register number in the first read requests are merged, which can be specifically: at least two first read requests carrying the same source register number are merged, any one of the at least two first read requests carrying the same source register number is retained, and the retained first read request is determined as the second read request; in addition, in the case that the first read requests received by the cache unit include first read requests carrying different source register numbers, the cache unit can determine the first read requests carrying different source register numbers as the second read request, so that the source register numbers carried by the second read requests obtained in step 103 are different, thereby avoiding repeated access to the register stack by the cache unit.
[0058] It can be understood that the second read request includes: a request obtained by merging requests carrying the same source register number in the first read request, and / or first read requests carrying different source register numbers (that is, first read requests that do not need to be merged).
[0059] In an optional implementation, the cache unit may execute step 103 when the number of received first read requests reaches a first preset threshold; illustratively, the first preset threshold may be 5, 10, 20, etc.
[0060] In another optional implementation, the cache unit may execute step 103 according to a preset duration. Specifically, when the duration between the first moment of the last execution of 103 and the current moment reaches the preset duration, the cache unit executes step 103. Exemplarily, the preset duration may be 1s, 5s, 30s, etc.
[0061] In an embodiment of the present invention, when the cache unit obtains the second read request through step 103, it can read the register value from the register corresponding to the source register number in the register stack according to the source register number carried in the second read request, and determine the read register value as the first register value corresponding to the second read request; thereafter, according to the correspondence between the source register number carried in the second read request and the target index value returned to the reservation station in step 102, the first register value is stored in the local cache area of the cache unit.
[0062] It should be noted that the first register value corresponding to the second read request obtained by the cache unit from the register file is all the data stored in the register corresponding to the source register number carried by the second read request.
[0063] In an embodiment of the present invention, the reservation station obtains the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met. Specifically, it can be as follows: when the execution condition of the first vector element is met, a data acquisition request is sent to the cache unit, and the data acquisition request carries the target index value corresponding to the first vector element; the cache unit searches for the register value corresponding to the target index value in the local cache area according to the target index value in the data acquisition request, determines the register value corresponding to the target index value as the second register value, and sends the second register value to the reservation station; when the second register value is obtained, the reservation station can send the first vector element to the functional unit used to execute the first vector element, so that the functional unit executes the first vector element based on the second register value.
[0064] Among them, the execution condition of the first vector element is the condition for emitting the first vector element from the reservation station for execution. In an embodiment of the present invention, the execution condition of the first vector element may include but is not limited to: the functional unit used to execute the first vector element in the processor is in an available state, the dependent instructions of the first vector element are executed, etc.
[0065] It should be noted that the second register value corresponding to the first vector element can be the same register value as the first register value obtained in step 104, or a register value different from the first register value obtained in step 104. The second register value can also be a data fragment of the first register value obtained in step 104, and the embodiment of the present invention does not specifically limit this.
[0066] Wherein, in the case where the second register value is a data fragment of the first register value, before step 105, the reservation station can obtain the configuration parameters of the first vector element from the configuration register corresponding to the target vector instruction, and the configuration parameters include the address offset of the second register value corresponding to the first vector element in the first register value. In the process of obtaining the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met, the reservation station also carries the address offset of the second register value corresponding to the first vector element in the first register value in the data acquisition request sent to the cache unit; when the cache unit receives the data acquisition request sent by the reservation station, it first searches for the first register value corresponding to the target index value in the local cache area according to the target index value in the data acquisition request, and then determines the second register value corresponding to the first vector element from the first register value corresponding to the target index value according to the address offset in the data acquisition request, and sends the second register value to the reservation station.
[0067] In an embodiment of the present invention, the target vector instruction may be a memory access vector instruction, and the reservation station may split the memory access vector instruction into at least two scalar memory access instructions (first vector elements) through step 101. Each scalar memory access instruction is represented as "ld src imm", wherein "ld" (load) indicates that the scalar memory access instruction is a load instruction; "src" indicates the source register number corresponding to the scalar memory access instruction; and "imm" indicates the immediate value corresponding to the scalar memory access instruction.
[0068] Exemplarily, the scalar memory access instruction is "ld 3 100", where "3" indicates that the source register number corresponding to the scalar memory access instruction is "3", that is, the register value required to execute the scalar memory access instruction needs to be read from the source register numbered "3". When the reservation station obtains the second register value ("1") corresponding to the scalar memory access instruction through step 105, the second register value "1" plus "100" can be used as the final memory access address of the scalar memory access instruction; it can be understood that when the reservation station determines the final memory access address of the scalar memory access instruction, the scalar memory access instruction can be emitted to the functional unit corresponding to the scalar memory access instruction for execution.
[0069] In addition, the vector memory access instruction also includes a memory access format. For example, for a stride type memory access instruction, the memory access format includes the destination register number and source register number of the vector memory access instruction, and the configuration parameters corresponding to the vector memory access instruction written in the configuration register. The configuration parameters indicate the address offset of the register file each time the vector memory access instruction accesses the register file, and the number of times the register file needs to be accessed.
[0070] For example, when the address offset is 100 and the number of accesses is 4, the reservation station can split a vector memory access instruction into the following four scalar memory access instructions:
[0071] Scalar memory access instruction 1: Src + 100;
[0072] Scalar memory access instruction 2: Src + 200;
[0073] Scalar memory access instruction 3: Src + 300;
[0074] Scalar memory access instruction 4: Src + 400.
[0075] Since the source register numbers of the four scalar memory access instructions are all "Src"; in step 101, the source register numbers carried in the first read request 1 corresponding to scalar memory access instruction 1, the first read request 2 corresponding to scalar memory access instruction 2, the first read request 3 corresponding to scalar memory access instruction 3, and the first read request 4 corresponding to scalar memory access instruction 4 sent by the reservation station to the cache unit are all "Src".
[0076] In step 102, the target index values corresponding to the scalar memory access instructions returned by the cache unit to the reservation station are the same, which is idx0:
[0077] Scalar memory access instruction 1: Src + 100 → idx0;
[0078] Scalar memory access instruction 2: Src + 200 → idx0;
[0079] Scalar memory access instruction 3: Src + 300 → idx0;
[0080] Scalar memory access instruction 4: Src + 400 → idx0.
[0081] In step 103, the cache unit may merge the first read request 1, the first read request 2, the first read request 3 and the first read request 4 to obtain one second read request, and the source register number carried by the second read request is "Src"; in step 104, the cache unit only needs to access the register stack once to obtain the first register values corresponding to the four first read requests, thereby reducing the number of times the register stack is accessed; in step 105, the reservation station may obtain the second register value corresponding to each scalar memory access instruction from the first register value stored in the cache unit according to the target index value and the address offset of the scalar memory access instruction.
[0082] As another example, when the reservation station splits a vector memory access instruction into four scalar memory access instructions as follows:
[0083] Scalar memory access instruction 1: Src 0+ 100;
[0084] Scalar memory access instruction 2: Src0 + 100;
[0085] Scalar memory access instruction 3: Src 1+ 100;
[0086] Scalar memory access instruction 4: Src 1+ 100.
[0087] Since the source register numbers of the four scalar memory access instructions are "Src0" and "Src1" respectively, in step 101, the source register number carried in the first read request 1 corresponding to the scalar memory access instruction 1 and the first read request 2 corresponding to the scalar memory access instruction 2 sent by the reservation station to the cache unit is "Src0", and the source register number carried in the first read request 3 corresponding to the scalar memory access instruction 3 and the first read request 4 corresponding to the scalar memory access instruction 4 sent by the reservation station to the cache unit is "Src1"; in step 102, the target index values corresponding to the scalar memory access instructions returned by the cache unit to the reservation station are as follows:
[0088] Scalar memory access instruction 1: Src 0+ 100→idx0;
[0089] Scalar memory access instruction 2: Src 0+ 100→idx0;
[0090] Scalar memory access instruction 3: Src 1+ 100→idx1;
[0091] Scalar memory access instruction 4: Src 1+ 100→idx1.
[0092] In step 103, the cache unit may merge the first read request 1 and the first read request 2 to obtain the second read request 1, and the source register number carried by the second read request 1 is "Src 0"; merge the first read request 3 and the first read request 4 to obtain the second read request 2, and the source register number carried by the second read request 2 is "Src 1"; in step 104, the cache unit only needs to access the register stack twice to obtain the first register values corresponding to the four first read requests, thereby reducing the number of times the register stack is accessed.
[0093] It can be understood that the storage capacity of the cache unit is fixed, and the cache unit can store at least one first register value locally; after the cache unit obtains the first register value through step 104 each time, before storing the obtained first register value, it can first determine whether the local cache area is full.
[0094] When the local cache area of the cache unit is not full, the cache unit may store the first register value obtained through step 104 in the local cache area of the cache unit according to the correspondence between the source register number and the target index value carried by the second read request.
[0095] When the local cache area of the cache unit is full, the cache unit first releases at least one first register value stored locally according to a preset cache release rule, and then stores the first register value obtained through step 104 in the local cache area of the cache unit according to the correspondence between the source register number and the target index value carried by the second read request.
[0096] The preset cache release rule may include but is not limited to: giving priority to releasing the register value that has been stored locally in the cache unit for the longest time, giving priority to releasing the register value that has been acquired the least number of times by the reservation station through step 105, etc.
[0097] In the related art, when a vector instruction can be split into multiple vector elements for execution, each vector element needs to read the register stack during execution. In order to achieve high concurrent execution of each vector element, a large number of register stack read ports are usually required, and a large number of register stack read ports will increase the area and power consumption of the register stack, and at the same time increase the timing path of the processor, which seriously reduces the processing frequency of the processor. The embodiment of the present invention provides a memory access method, by adding a cache unit in the reservation station, using the cache unit to return the target index value corresponding to the first vector element to the reservation station according to the source register number carried by the first read request, and merging the requests carrying the same source register number in the received first read request, and accessing the register stack based on the merged second read request to obtain the first register value corresponding to the second read request, thereby avoiding repeated access to the register stack, reducing the number of accesses to the register stack, and reducing the read port pressure of the register stack.
[0098] It can be understood that the embodiments of the present invention only need to store a small number of register values in the register file locally in the cache unit to provide second register values for a large number of first vector elements. When the execution condition of the first vector element is met, the retention station can directly obtain the second register value corresponding to the first vector element from the cache unit according to the target index value corresponding to the first vector element without accessing the register file again. A larger emission window is provided for the target vector instruction with less register file read port overhead, thereby improving the efficiency of reading register values from the register file during the parallel execution of the first vector elements, thereby improving the processing frequency of the processor.
[0099] In an optional embodiment of the present invention, the cache unit in step 102 receives the first read request, and returns the target index value corresponding to the first vector element to the reservation station according to the source register number carried in the first read request, including:
[0100] Step 1021: The cache unit receives a first read request, and determines, based on the source register number carried in the first read request, whether a first index value corresponding to the source register number exists locally.
[0101] Step 1022: When the cache unit has the first index value locally, the cache unit determines the first index value as the target index value corresponding to the first vector element, and returns the target index value to the reservation station.
[0102] Step 1023: If the first index value does not exist locally, the cache unit creates a target index value corresponding to the first vector element, and returns the target index value to the reservation station.
[0103] In an embodiment of the present invention, when the cache unit receives the first read request sent by the reservation station, the process of returning the target index value corresponding to the first vector element to the reservation station according to the source register number carried in the first read request can be implemented through operations corresponding to steps 1021 to 1023.
[0104] Specifically, when the cache unit receives the first read request sent by the reservation station, it can first obtain the source register number carried by the first read request from the first read request; then match the source register number with the register numbers corresponding to the respective index values stored locally; when there is a register number identical to the source register number carried by the first read request among the register numbers corresponding to the locally stored index values, it indicates that the first index value corresponding to the source register number carried by the first read request exists locally in the cache unit; when there is no register number identical to the source register number carried by the first read request among the register numbers corresponding to the locally stored index values, it indicates that the first index value corresponding to the source register number carried by the first read request does not exist locally in the cache unit.
[0105] Wherein, if the first index value exists locally in the cache unit, the cache unit may directly determine the first index value as the target index value corresponding to the first vector element, and return the target index value to the reservation station. If the first index value does not exist locally in the cache unit, the cache unit may locally create the target index value corresponding to the first vector element, and return the target index value to the reservation station.
[0106] It can be understood that, when the source register numbers of the first vector elements are the same, the target index values returned by the cache unit to the reservation station are the same.
[0107] In the memory access method provided by the embodiment of the present invention, when the cache unit receives the first read request, firstly determines whether there is a first index value corresponding to the source register number locally according to the source register number carried in the first read request, and when the first index value exists locally, determines the first index value as the target index value corresponding to the first vector element, and when the first index value does not exist locally, creates the target index value corresponding to the first vector element, so that the cache unit can return the target index value corresponding to each first vector element to the reservation station, ensuring that the reservation station can accurately obtain the second register value corresponding to the first vector element according to the target index value in step 105, thereby improving the feasibility and reliability of the embodiment of the present invention.
[0108] In an optional embodiment of the present invention, the cache unit in step 104 obtains the first register value corresponding to the second read request from the register file, including:
[0109] Step 1041: If the cache unit does not have the first register value corresponding to the source register number carried in the second read request locally, the cache unit obtains the first register value from the source register corresponding to the source register number carried in the second read request in the register file.
[0110] Step 1042: The cache unit stores the first register value locally according to the correspondence between the source register number and the target index value.
[0111] In an embodiment of the present invention, in the process of obtaining the first register value corresponding to the second read request from the register stack, the cache unit may first confirm whether the first register value corresponding to the second read request exists locally; if the first register value corresponding to the second read request exists locally, the cache unit does not need to access the register stack; if the first register value corresponding to the second read request does not exist locally, the cache unit may obtain the first register value corresponding to the second read request from the register stack through steps 1041 to 1042.
[0112] It can be understood that the first register value corresponding to the second read request is all the data stored in the register corresponding to the source register number carried by the second read request.
[0113] Among them, according to the correspondence between the source register number and the target index value, the first register value is stored locally, specifically: according to the correspondence between the source register number carried by the second read request and the target index value returned to the reservation station in step 102, the first register value is stored locally in an area corresponding to the target index value corresponding to the source register number carried by the second read request, so that the reservation station can determine the first register value corresponding to the target index value from the cache unit locally according to the target index value in step 105, and obtain the second register value corresponding to the first vector element according to the first register value corresponding to the target index value.
[0114] According to the memory access method provided by an embodiment of the present invention, in the process of the cache unit obtaining the first register value corresponding to the second read request from the register stack, it is only necessary to obtain the first register value from the register stack and store the first memory value when the first register value corresponding to the source register number carried by the second read request does not exist locally in the cache unit. When the first register value corresponding to the source register number carried by the second read request exists locally in the cache unit, there is no need to access the register stack, which further reduces the number of times the cache unit accesses the register stack and reduces the read port pressure of the register stack.
[0115] In an optional embodiment of the present invention, the reservation station in step 101 splits the target vector instruction to obtain at least two first vector elements, including:
[0116] Step 1011: When receiving a target vector instruction, the reservation station determines a vector source register corresponding to the target vector instruction.
[0117] Step 1012: The reservation station splits the vector instruction according to the vector source registers to obtain first vector elements; the number of the first vector elements is the same as the number of the vector source registers.
[0118] The method further comprises:
[0119] Step A11: When receiving the target index value corresponding to the first vector element, the reservation station splits the first vector element twice according to the length of the vector source register and the nominal width of the vector elements in the vector source register to obtain at least two second vector elements.
[0120] The source registers corresponding to the target vector instruction include vector source registers, and the number of the vector source registers is at least 2.
[0121] In an embodiment of the present invention, the reservation station may split the target vector instruction once and twice, wherein the reservation station may split the target vector instruction once through steps 1011 to 1022 to obtain a first vector element, and may split the first vector element twice through step A11 to obtain a second vector element.
[0122] The basis for the first split is the vector source register corresponding to the target vector instruction, and the basis for the second split is the length of the vector source register corresponding to the target vector instruction and the nominal width of the vector elements in the vector source register.
[0123] Specifically, in a splitting process corresponding to step 1011 to step 1022, the reservation station can first determine the source register corresponding to the target vector instruction according to the configuration parameters corresponding to the target vector instruction, and determine the vector source register corresponding to the target vector instruction from the source registers corresponding to the target vector instruction.
[0124] When the vector source register corresponding to the target vector instruction is determined, the reservation station can split the vector instruction according to the vector source register to obtain the first vector elements corresponding to the vector source register; wherein the number of first vector elements is the same as the number of vector source registers corresponding to the target vector instruction, and each first vector element corresponds to a vector source register, and the second register value corresponding to the first vector element is stored in the vector source register corresponding to the first vector element.
[0125] In the secondary splitting process of step A11, the reservation station can perform secondary splitting on the first vector element according to the length of the vector source register and the nominal width of the vector element in the vector source register to obtain at least two second vector elements corresponding to the first vector element when receiving the target index value corresponding to the first vector element returned by the cache unit through step 102. It can be understood that the second vector elements corresponding to the first vector element are concatenated to obtain the first vector element.
[0126] As an example, the source registers corresponding to the target vector instruction include 1 integer source register and 8 vector source registers (s0, s1, s2, s3, s4, s5, s6, s7); the length of a single vector source register corresponding to the target vector instruction is 128 bits, and the nominal width of the vector elements in the vector source register is 8 bits.
[0127] The reservation station can split the target vector instruction into 8 first vector elements corresponding to the vector source registers (s0, s1, s2, s3, s4, s5, s6, s7) respectively during a splitting process according to the vector source register corresponding to the target vector instruction.
[0128] During the secondary splitting process, the reservation station can split each first vector element into 16 second vector elements through step A11, wherein the total number of second vector elements corresponding to the target vector instruction is 8×16=128.
[0129] It should be noted that, while the retention station is executing step A11, the cache unit can simultaneously execute the operations of step 103 and step 104, thereby realizing the synchronization of the secondary splitting process of the target vector instruction and the acquisition process of the first register value. The cache unit uses the splitting time of the target vector instruction to access the register stack to read the first register value, thereby hiding the read delay of the cache unit in reading the first register value, and further improving the efficiency of reading the register value from the register stack and the processing frequency of the processor during the parallel execution of the first vector elements.
[0130] In an optional embodiment of the present invention, the reservation station in step 105 obtains the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met, including:
[0131] Step 1051: When the execution condition of any second vector element in the first vector element is met, the reservation station obtains the address offset information corresponding to the second vector element.
[0132] Step 1052: The reservation station obtains the third register value corresponding to the second vector element from the cache unit according to the target index value and the address offset information.
[0133] The address offset information includes the address offset of the third register value corresponding to the second vector element in the second register value. The reservation station can obtain the address offset information corresponding to the second vector element from the configuration register corresponding to the target vector instruction.
[0134] In an embodiment of the present invention, when the process of splitting the target vector instruction at the reservation station includes a primary split and a secondary split, the second register value includes a third register value corresponding to the second vector element; it can be understood that the third register value corresponding to the second vector element is a data fragment in the second register value.
[0135] Specifically, the reservation station is in the process of obtaining the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is satisfied:
[0136] First, the reservation station obtains the address offset information corresponding to the second vector element from the configuration register corresponding to the target vector instruction.
[0137] Then, the reservation station sends a data acquisition request to the cache unit, where the data acquisition request carries a target index value corresponding to the first vector element and address offset information corresponding to the second vector element.
[0138] Then, the cache unit first searches locally for the first register value corresponding to the target index value in the data acquisition request, and determines the first register value corresponding to the target index value as the second register value corresponding to the first vector element, and then determines the third register value corresponding to the second vector element from the second register value according to the address offset information corresponding to the second vector element, and sends the third register value to the reservation station.
[0139] Finally, the reservation station receives the third register value sent by the cache unit, and sends the second vector element to a functional unit for executing the second vector element, so that the functional unit executes the first vector element based on the third register value.
[0140] In an optional embodiment of the present invention, the processor further includes a rename module, and the rename module is used to allocate physical registers for vector instructions in the reservation station; the method further includes:
[0141] Step B11, when the physical register corresponding to the target vector instruction changes, the renaming module sends a synchronization signal to the cache unit; the synchronization signal is used to indicate the register number of the changed physical register.
[0142] Step B12: The cache unit releases the register value corresponding to the register number in the local memory according to the register number indicated by the synchronization signal.
[0143] The changes in the physical register may include, but are not limited to: updating data in the physical register, deleting data in the physical register, changing the physical register, etc.
[0144] In an embodiment of the present invention, the cache unit can establish a communication connection with a renaming module in the processor. When the physical register corresponding to the target vector instruction changes, the renaming module sends a synchronization signal to the cache unit in real time. When the cache unit receives the synchronization signal, it releases the register value corresponding to the register number locally according to the register number indicated by the synchronization signal. When the source register number carried by the second read request obtained in the subsequent step 103 is the register number indicated by the synchronization signal, the cache unit can re-obtain the first register value from the changed register through step 104, thereby improving the accuracy of the register value stored locally in the cache unit.
[0145] An embodiment of the present invention provides another implementation method for releasing register values stored locally in a cache unit; specifically, the cache unit receives a synchronization signal sent by a renaming module in real time, and upon receiving the synchronization signal sent by the renaming module, based on the register number of the physical register that has changed as indicated by the synchronization signal, releases the register corresponding to the locally stored register number, thereby improving the flexibility of the storage method of register values in the cache unit in the embodiment of the present invention.
[0146] In summary, an embodiment of the present invention provides a memory access method, by adding a cache unit in a reservation station, using the cache unit to return a target index value corresponding to a first vector element to the reservation station according to a source register number carried in a first read request, and merging the requests carrying the same source register number in the received first read request, and accessing the register stack based on the merged second read request to obtain the first register value corresponding to the second read request, thereby avoiding repeated access to the register stack, reducing the number of accesses to the register stack, and thus reducing the read port pressure of the register stack; when the execution condition of the first vector element is met, the reservation station can directly obtain the second register value corresponding to the first vector element from the cache unit according to the target index value corresponding to the first vector element, without accessing the register stack again, thereby improving the efficiency of reading register values from the register stack during the parallel execution of the first vector element, thereby improving the processing frequency of the processor.
[0147] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0148] Device Embodiment
[0149] Reference Figure 3 , shows a structural block diagram of another processor of the present invention, the processor includes a register file 20, a reservation station 10 and a cache unit 11 arranged in the reservation station 10;
[0150] The reservation station 10 is used to split the target vector instruction to obtain at least two first vector elements, and send a first read request corresponding to the first vector element to the cache unit 11; the first read request carries the source register number of the first vector element;
[0151] The cache unit 11 is configured to receive the first read request, and return a target index value corresponding to the first vector element to the reservation station 10 according to a source register number carried in the first read request; merge requests carrying the same source register number in the received first read request to obtain at least one second read request; and obtain a first register value corresponding to the second read request from the register stack 20;
[0152] The reservation station 10 is further configured to obtain a second register value corresponding to the first vector element from the cache unit 11 according to the target index value when an execution condition of the first vector element is met.
[0153] Optionally, the cache unit is specifically used to:
[0154] receiving the first read request, and determining, according to the source register number carried in the first read request, whether a first index value corresponding to the source register number exists locally;
[0155] In a case where the first index value exists locally, determining the first index value as a target index value corresponding to the first vector element, and returning the target index value to the reservation station;
[0156] If the first index value does not exist locally, create a target index value corresponding to the first vector element, and return the target index value to the reservation station.
[0157] Optionally, the cache unit is specifically used to:
[0158] If the first register value corresponding to the source register number carried by the second read request does not exist locally, obtain the first register value from the source register corresponding to the source register number carried by the second read request in the register file;
[0159] According to the corresponding relationship between the source register number and the target index value, the first register value is stored locally.
[0160] Optionally, the source register includes a vector source register; and the reservation station is specifically used for:
[0161] Upon receiving a target vector instruction, determining a vector source register corresponding to the target vector instruction;
[0162] The vector instruction is split according to the vector source register to obtain first vector elements; the number of the first vector elements is the same as the number of the vector source registers.
[0163] Optionally, the reservation station is further used for:
[0164] When the target index value corresponding to the first vector element is received, the first vector element is split twice according to the length of the vector source register and the nominal width of the vector elements in the vector source register to obtain at least two second vector elements.
[0165] Optionally, the second register value includes a third register value corresponding to the second vector element; and the reservation station is specifically used to:
[0166] When an execution condition of any second vector element in the first vector element is met, acquiring address offset information corresponding to the second vector element;
[0167] According to the target index value and the address offset information, a third register value corresponding to the second vector element is obtained from the cache unit.
[0168] Optionally, the processor further comprises a renaming module, the renaming module being used to allocate physical registers for the vector instructions in the reservation station;
[0169] The renaming module is used to send a synchronization signal to the cache unit when the physical register corresponding to the target vector instruction changes; the synchronization signal is used to indicate the register number of the physical register that has changed;
[0170] The cache unit is further used to release the register value corresponding to the register number in the local according to the register number indicated by the synchronization signal.
[0171] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0172] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0173] Regarding the processor in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0174] Reference Figure 4 , is a structural block diagram of an electronic device for accessing memory provided by an embodiment of the present invention. Figure 4 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the memory access method of the aforementioned embodiment.
[0175] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmble Gate Array) or other editable devices, transistor logic devices, hardware components or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0176] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.
[0177] The memory may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable ReadOnly), a CD-ROM (Compact Disa Read Only), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0178] The embodiment of the present invention also provides a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor can execute Figure 1 The memory access method shown.
[0179] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0180] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0181] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0184] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0185] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0186] The memory access method, processor, electronic device and readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A memory access method, characterized in that: Applied to a processor, the processor includes a register file, a reservation station, and a cache unit arranged in the reservation station; the method includes: The reservation station splits the target vector instruction to obtain at least two first vector elements, and sends a first read request corresponding to the first vector element to the cache unit; the first read request carries the source register number of the first vector element; The cache unit receives the first read request, and returns a target index value corresponding to the first vector element to the reservation station according to a source register number carried in the first read request; The cache unit merges the received first read requests that carry the same source register number to obtain at least one second read request; The cache unit obtains a first register value corresponding to the second read request from the register file; The reservation station obtains the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met.
2. The method according to claim 1, characterized in that The cache unit receives the first read request, and returns a target index value corresponding to the first vector element to the reservation station according to the source register number carried in the first read request, including: The cache unit receives the first read request, and determines, according to the source register number carried in the first read request, whether a first index value corresponding to the source register number exists locally; When the cache unit has the first index value locally, determining the first index value as a target index value corresponding to the first vector element, and returning the target index value to the reservation station; When the first index value does not exist locally, the cache unit creates a target index value corresponding to the first vector element and returns the target index value to the reservation station.
3. The method according to claim 1, characterized in that The cache unit obtains the first register value corresponding to the second read request from the register file, including: The cache unit obtains the first register value from a source register corresponding to the source register number carried by the second read request in the register file when the first register value corresponding to the source register number carried by the second read request does not exist locally; The cache unit stores the first register value locally according to the corresponding relationship between the source register number and the target index value.
4. The method according to claim 1, characterized in that: The source register includes a vector source register; the reservation station splits the target vector instruction to obtain at least two first vector elements, including: The reservation station determines, upon receiving a target vector instruction, a vector source register corresponding to the target vector instruction; The reservation station splits the vector instruction according to the vector source registers to obtain first vector elements; the number of the first vector elements is the same as the number of the vector source registers.
5. The method according to claim 4, characterized in that The method further comprises: When receiving the target index value corresponding to the first vector element, the reservation station splits the first vector element twice according to the length of the vector source register and the nominal width of the vector elements in the vector source register to obtain at least two second vector elements.
6. The method according to claim 5, characterized in that The second register value includes a third register value corresponding to the second vector element; the reservation station obtains the second register value corresponding to the first vector element from the cache unit according to the target index value when the execution condition of the first vector element is met, including: The reservation station obtains address offset information corresponding to the second vector element when an execution condition of any second vector element in the first vector element is satisfied; The reservation station obtains a third register value corresponding to the second vector element from the cache unit according to the target index value and the address offset information.
7. The method according to claim 1, characterized in that The processor further includes a renaming module, the renaming module being used to allocate physical registers for the vector instructions in the reservation station; the method further includes: The renaming module sends a synchronization signal to the cache unit when the physical register corresponding to the target vector instruction changes; the synchronization signal is used to indicate the register number of the physical register that has changed; The cache unit releases the register value corresponding to the register number in the local memory according to the register number indicated by the synchronization signal.
8. A processor, characterized in that: The processor includes a register file, a reservation station, and a cache unit disposed in the reservation station; The reservation station is used to split the target vector instruction to obtain at least two first vector elements, and send a first read request corresponding to the first vector element to the cache unit; the first read request carries the source register number of the first vector element; The cache unit is configured to receive the first read request, and return a target index value corresponding to the first vector element to the reservation station according to a source register number carried in the first read request; merge requests carrying the same source register number in the received first read requests to obtain at least one second read request; and obtain a first register value corresponding to the second read request from the register stack; The reservation station is further configured to obtain, when an execution condition of the first vector element is met, a second register value corresponding to the first vector element from the cache unit according to the target index value.
9. The processor according to claim 8, characterized in that The cache unit is specifically used for: receiving the first read request, and determining, according to the source register number carried in the first read request, whether a first index value corresponding to the source register number exists locally; In a case where the first index value exists locally, determining the first index value as a target index value corresponding to the first vector element, and returning the target index value to the reservation station; If the first index value does not exist locally, create a target index value corresponding to the first vector element, and return the target index value to the reservation station.
10. The processor according to claim 8, characterized in that The cache unit is specifically used for: If the first register value corresponding to the source register number carried by the second read request does not exist locally, obtain the first register value from the source register corresponding to the source register number carried by the second read request in the register file; According to the corresponding relationship between the source register number and the target index value, the first register value is stored locally.
11. The processor according to claim 8, characterized in that The source register includes a vector source register; the reservation station is specifically used for: Upon receiving a target vector instruction, determining a vector source register corresponding to the target vector instruction; The vector instruction is split according to the vector source register to obtain first vector elements; the number of the first vector elements is the same as the number of the vector source registers.
12. The processor according to claim 11, characterized in that The reservation station is also used for: When the target index value corresponding to the first vector element is received, the first vector element is split twice according to the length of the vector source register and the nominal width of the vector elements in the vector source register to obtain at least two second vector elements.
13. The processor according to claim 12, characterized in that The second register value includes a third register value corresponding to the second vector element; the reservation station is specifically used for: When an execution condition of any second vector element in the first vector element is met, acquiring address offset information corresponding to the second vector element; According to the target index value and the address offset information, a third register value corresponding to the second vector element is obtained from the cache unit.
14. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the memory access method described in any one of claims 1 to 7.
15. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the memory access method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Instructions and logic for load-indices-and-prefetch-gathers operations
CN108292215A
Instructions and logic for load-indices-and-prefetch-scatters operations
CN108369516A
Instructions and logic for vector-based bit manipulation
CN108369572A
Memory access method, processor, electronic equipment and readable storage medium
CN116932202A
Shift-folding for efficient load coalescing in a binary translation based processor
US20200201632A1
