[go: up one dir, main page]

WO2016033949A1 - L2 cache and implementation method of consistency thereof, system and storage medium - Google Patents

L2 cache and implementation method of consistency thereof, system and storage medium Download PDF

Info

Publication number
WO2016033949A1
WO2016033949A1 PCT/CN2015/073046 CN2015073046W WO2016033949A1 WO 2016033949 A1 WO2016033949 A1 WO 2016033949A1 CN 2015073046 W CN2015073046 W CN 2015073046W WO 2016033949 A1 WO2016033949 A1 WO 2016033949A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
cache
operation data
data
ram
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.)
Ceased
Application number
PCT/CN2015/073046
Other languages
French (fr)
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.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips 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 Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Publication of WO2016033949A1 publication Critical patent/WO2016033949A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems

Definitions

  • the present invention relates to a cache technology in the field of data processing, and in particular, to a L2Cache and a consistent implementation method, system and storage medium thereof.
  • the cache Cache can cache data in the shared storage space locally, speeding up the process of multi-core acquisition of data. Since the storage views seen by each processor are obtained through the local cache, different processors may obtain different data values for data in the same storage location.
  • the cache integrated with the central processing unit CPU on the same circuit board or on the main board is called a first-level L1Cache, and the cache independent of the CPU is called a second-level L2Cache.
  • the Cache consistency with the L1Cache is implemented under the control of the processor; however, in order to improve the performance such as the system processing rate, multiple CPUs in a cluster cluster usually share an L2Cache; The L2Cache set by the CPU does not support consistent access. This will result in Cache consistency between L1Cache and L2Cache. L2Cache cannot implement Cache consistency.
  • the embodiment of the present invention is to provide an L2Cache, a data processing system, and a storage medium, which are capable of receiving consistent access and achieve Cache consistency.
  • the embodiment of the present invention also provides the L2Cache consistency implementation method.
  • a first aspect of the embodiment of the present invention provides a two-level independent cache L2Cache, where the L2Cache includes a Slave interface, a controller, a Master interface, and a RAM.
  • the slave interface is configured to receive a consistent access indication signal and access, and when the consistent access indication signal is received, determine that the access is a consistent access, and according to the consistent access indication signal and the access Access to classify and form indication information according to the classification result;
  • the controller is configured to receive the indication information, query operation data in the RAM according to the indication information, and perform a consistency operation according to the indication information after querying the operation data;
  • the master interface is configured to output the consistent access indication signal and the consistent access to the peripheral device according to the indication information when the operation data is not queried in the RAM, and query the operation The data is then output to the external memory in accordance with the indication information.
  • the consistent access indication signal includes a consistent access type indication signal
  • the slave interface is configured to receive the consistent access type indication signal, and determine, according to the consistent access type indication signal, that the access is a consistent access.
  • the consistent access indication signal further includes the consistent access global signal
  • the slave interface includes a first read address channel, a first read data channel, and a first write address channel;
  • the Slave interface is configured to receive the consistent access global signal, generate a slave interface control signal according to the consistent access global signal, and drive each of the channel receiving stations in the Slave interface according to the Slave interface control signal. Consistent access
  • the first read address channel is configured to receive the consistent access type indication signal
  • the first read data channel is configured to send a read response signal to the request source according to the query result
  • the first write address channel is configured to receive an external memory update signal for consistent access.
  • the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access.
  • the master interface includes a second read address channel, a second read data channel, and a second write address channel;
  • the second read address channel is configured to output the consistent access indication signal when the operation data is not queried in the RAM
  • the second read data channel is configured to receive a read response signal and a listening response signal
  • the second write address channel is configured to output an indication signal that writes the operation data to an external memory and invalidates the operation data in the cache.
  • the L2Cache also includes:
  • the first buffer is configured to store the access type, the query status in the other Cache, the query status in the L2Cache, and the request source of the consistent access, and provide a basis for querying the operation data and implementing Cache consistency. information.
  • the first buffer is further configured to store invalid failure information, and notify the request source according to the invalid failure information.
  • the RAM includes a Data RAM and a Tag RAM; the Data RAM is configured to store operation data; the Data RAM includes a plurality of the cache storage units; the Tag RAM a storage address configured to store operation data and status information of the cache storage unit;
  • the controller is configured to follow the indication information,
  • the updating the Tag RAM includes at least one of an update operation address and the status information.
  • the controller is further configured to: according to the indication information,
  • the operation data is output to the external memory through the master interface.
  • the controller includes:
  • a Tag Access fifo queue configured to store, after querying the operation data, whether to update information of the Tag RAM and an indication of accessing the Data RAM;
  • a Tag Write fifo queue configured to store operation information that needs to update the Tag RAM after querying the operation data and determining that the Tag RAM needs to be updated;
  • a data read fifo queue configured to store, after querying the operation data, operation information that needs to update the Tag RAM and read the Data RAM;
  • the control unit is configured to perform the consistency operation according to the Tag Access fifo queue, the Tag Write fifo queue, and the Data read fifo queue.
  • the controller includes a control unit
  • the control unit is configured to perform an access collision detection, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.
  • a second aspect of the embodiments of the present invention provides a data processing system, where the system includes at least one cluster;
  • the cluster includes at least two processors, an intra-cluster frame listening controller, and the L2Cache according to any one of claims 1 to 9; wherein each of the processors is integrally provided with an L1Cache;
  • the in-cluster frame listening controller is respectively connected to the L1Cache and the L2Cache, configured to listen for consistent access, and assist any two of the L1Caches and the L1Cache to implement Cache consistency between the L1Cache and the L2Cache. .
  • the system also includes an inter-cluster frame listening controller
  • the inter-cluster frame listening controller is connected to the L2Cache and configured to listen for consistent access, and assists in implementing Cache consistency between the clusters.
  • the L1Cache is configured to query, in the L1Cache, the operation data corresponding to the consistent access when receiving the consistent access; when the L1Cache queries the operation data, respond to the consistent access while in the cluster
  • the Cache consistency of the cluster where the L1Cache is located is implemented with the assistance of the internal cache frame listening controller, and the consistency of the Cache between the clusters is realized with the assistance of the inter-cluster cache frame listening controller.
  • the in-cluster cache frame listening controller is configured to send the consistent access to the L2Cache when the operation data is not queried in the L1Cache in the cluster;
  • the L2Cache is configured to receive the consistent access and the consistent access sent by other clusters when the operation data corresponding to the consistent access is not queried in the L1Cache of the cluster, and query whether the L2Cache stores the The operating data, when the L2Cache does not query the operation data corresponding to the consistent access, querying the operation data by using the inter-cluster cache frame listening controller to other clusters other than the cluster where the L2Cache is located, in the query Responding to the consistent access after the operation data, and implementing Cache consistency between the clusters with the assistance of the inter-cluster cache frame listening controller.
  • a third aspect of the embodiments of the present invention provides a method for implementing L2Cache consistency, where the method includes:
  • the operation data is output to the external memory according to the indication information.
  • the consistent access indication signal includes a consistent access type indication signal
  • the L2Cache includes a Slave interface; the Slave interface includes a first read address channel, a first read data channel, and a first write address channel;
  • the consistent access indication signal further includes the consistent access global signal
  • An external memory update signal for consistent access is received through the first write address channel.
  • the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access.
  • the L2Cache includes a master interface, and the master interface includes a second read address channel, a second read data channel, and a second write address channel.
  • the method further includes:
  • the method further includes:
  • the storage access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access are used to provide basis information for querying the operation data and implementing Cache consistency.
  • the method further includes:
  • the slave interface includes a control module; the RAM includes a data RAM and a Tag RAM; the data RAM is used to store operation data; the Tag RAM is used to store a storage address of the operation data and state information of a cache storage unit;
  • the querying the operation data according to the indication information, after querying the operation data, includes at least one of the following:
  • the Tag RAM is read and the Data RAM is queried according to the result of the Tag RAM and the queried operation data is written to the external memory and the status information is updated.
  • the operation data is output to the external memory according to the indication information, including:
  • the operation data is output to the external memory through the master interface.
  • the method further includes:
  • the access conflict detection is performed by the control unit, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.
  • a fourth aspect of the embodiments of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the present invention. At least one of the methods of the third aspect of the embodiments.
  • the L2Cache and the consistency implementation method and the data processing system of the embodiments of the present invention can achieve consistency with other Caches according to the consistent access indication signal by using the consistent access indication signal; the CPU independent L2Cache
  • the ability to perform consistent access operations enables consistency between L1Cache and L2Cache in the data processing system and Cache consistency between clusters and clusters, which expands the scope of Cache consistency and reduces the inability of L2Cache to be realized during data processing.
  • the resulting data handles the chance of errors and reduces the cost of maintaining Cache coherency.
  • FIG. 1 is a schematic structural diagram of an L2Cache according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a data processing system according to an embodiment of the present invention.
  • FIG. 3 is a second schematic structural diagram of a data processing system according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for implementing L2Cache consistency according to an embodiment of the present disclosure.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • a L2Cache is included in the embodiment, and the L2Cache includes a Slave interface 110, a controller 120, a Master interface 130, and a RAM 140.
  • the RAM 140 is generally further divided into a Tag RAM and a Data RAM.
  • the slave interface 110 is configured to receive a consistent access indication signal and access, and when the consistent access indication signal is received, determine that the access is a consistent access, according to the consistent access indication signal and the access Access to classify and form indication information according to the classification result;
  • the controller 120 is configured to receive the indication information, query operation data in the RAM 140 according to the indication information, and perform a consistency operation according to the indication information after querying the operation data;
  • the master interface 130 is configured to output the consistent access indication signal and the consistent access to the peripheral device according to the indication information when the operation data is not queried in the RAM 140, and query the The operation data is output to the external memory according to the indication information after the operation data.
  • the L2Cache described in this embodiment is an independent Cache with respect to the L1Cache integrated on the same motherboard as the CPU.
  • the slave interface 110 in the embodiment receives the consistent access indication signal with respect to the existing L2Cache when receiving the access, and determines the access according to the consistent access indication signal; It is divided into consistent access and non-uniform access; generally, when the slave interface receives the consistent access indication signal while receiving the access, it is considered that the access is received as a consistent access.
  • the consistent access is an access operation that needs to maintain data consistency between the Caches.
  • the data consistency between the Caches may also be referred to as Cache consistency. If the access is consistent, the indication information corresponding to the consistent access is generated, so that the L2Cache performs a corresponding consistency operation according to the indication information, such as an invalid data operation.
  • the classifying the access according to the consistent access indication signal and the access including dividing the access type into a consistent access and a non-uniform access, and the operation in response to the access may include performing a read operation, a write operation, or The query operation, in order to simplify the controller's processing of data, the Slave interface will also be re-classified according to the specific operations required to facilitate the controller to quickly respond to the access with the indication information.
  • the consistent access indication signal includes a consistent access type indication signal
  • the slave interface 110 is configured to receive the consistent access type indication signal according to the one
  • the causal access type indication signal determines that the access is a consistent access.
  • the consistent access is specifically defined with respect to the non-uniform access.
  • the slave interface When receiving the consistent access, the slave interface also receives the consistent access type indication signal, so that the current access can be confirmed as a consistent access.
  • the consistent access indication signal further includes the consistent access global signal
  • the slave interface includes a first read address channel, a first read data channel, and a first write address channel;
  • the Slave interface is configured to receive the consistent access global signal, generate a slave interface control signal according to the consistent access global signal, and drive each of the channel receiving stations in the Slave interface according to the Slave interface control signal. Consistent access
  • the first read address channel is configured to receive the consistent access type indication signal
  • the first read data channel is configured to send a read response signal to the request source according to the query result
  • the first write address channel is configured to receive an external memory update signal for consistent access.
  • the slave interface of the embodiment is preferably an interface including five channels.
  • the slave interface further includes the first three channels, and further includes a first read data channel and a first write response channel. .
  • the slave interface may receive an access (the access may be a read access or a write access, etc.); and how to receive access and which channels receive access to the Slave interface described in the prior art
  • the receiving access is consistent; in order to indicate that the access is a consistent access, the slave interface will also receive the consistent access type indication signal; in order to determine the status of the consistent access in other Caches, the consistency
  • the access will also receive the consistent access global signal; the salve interface will synthesize the access and the information carried in the consistent access global signal, determine the operation that the L2Cache needs to perform, and form the indication information.
  • the controller controls the slave interface, the master interface, and the RAM to perform corresponding operations according to the indication information. Consistent operation. Specifically, the method sends a read response signal to the request source according to the query result, and is a consistent access Read response added in the L2Cache.
  • the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source of the consistent access.
  • the other Cache may be an L1Cache or other L2Cache.
  • the specific request source may be a CPU integrated with the L1Cache, an AXI master device, an AXI slave device, and the like.
  • the corresponding data may be queried in the L2Cache, and the data is obtained by the other Cache, and the corresponding operation is performed in the L2Cache, and the read operation or the write operation control is performed according to whether the operation is performed.
  • the other Cache performs a consistency operation, for example, when the L2Cache performs a write operation, the controller will output control information according to the consistent access global signal to invalidate other caches to internally stored data.
  • the Master interface 130 includes a second read address channel and a second read data. Channel and second write address channel;
  • the second read address channel is configured to output the consistent access indication signal when the operation data is not queried in the RAM; the consistent access indication signal specifically includes the consistent access type indication signal;
  • the second read data channel is configured to receive a read response signal and a sounding response signal; the read response signal is generally a signal outputted by the downstream processing structure of the L2Cache when the operation data is returned; the downstream processing structure is specifically an external memory memory .
  • the second write address channel is configured to output an indication signal that writes the operation data to an external memory and invalidates the operation data in the cache.
  • the external memory may be various types of registers or the like.
  • the master interface 130 is also preferably a 5-channel interface, and further includes a second write data channel and a second write response channel; the second write data channel is used for outputting and receiving data write operations. Signal; the second write response channel for receiving and outputting Write a response signal.
  • the L2Cache further includes: a first buffer, configured to store an access type, a query status in another Cache, a query status in the L2Cache, and a request source of the consistent access, for Query the operation data and implement Cache consistency to provide basis information.
  • a first buffer configured to store an access type, a query status in another Cache, a query status in the L2Cache, and a request source of the consistent access, for Query the operation data and implement Cache consistency to provide basis information.
  • the first buffer may be a specially configured buffer; the access type includes whether the access type is an execution access or a non-uniform access; the other cache includes an L1Cache and other L2Caches. Storing the query status in the L2Cache, so that other Caches maintain consistency with the Cache of the L2Cache when performing consistent access.
  • the first buffer may be configured to store the foregoing information obtained from the consistent access global signal and the interception signal to assist the L2Cache to achieve consistency with other caches.
  • the first buffer may be further configured to store invalid failure information, and notify the request source according to the invalid failure information.
  • the RAM includes a Data RAM and a Tag RAM; the Data RAM is configured to store operational data.
  • the Tag RAM is configured to store a storage address of the operation data and status information of a cache storage unit.
  • the data RAM includes a plurality of the cache storage units; the cache storage unit may be a cache line or the like, and is a minimum unit for performing a cache read and write operation.
  • the controller 120 is configured to follow the indication information,
  • the updating the Tag RAM includes at least one of an update operation address and the status information.
  • the control logic of the controller in the existing L2Cache is relatively simple, and the update of the Tag RAM only occurs when the replacement by the write operation or the read-write allocation occurs, and in the present embodiment, the update of the Tag RAM is also performed.
  • Other operations for consistent access such as manipulating data queries. For example, when other Caches perform write operations in the consistent access, it may be necessary to invalidate the copy of the operation data in the L2Cache, and may need to invalidate the corresponding Cache unit, and the controller may execute the read Tag RAM. And according to the result of the Tag RAM query to update the control logic of the Tag RAM.
  • the specific controller 120 uses which control logic responds to the current access, based on information such as the operation pointed to by the access and the type of access and the status of the query in other Caches.
  • the controller can implement an increase in control logic by adding a control chip or a logic control circuit or the like.
  • controller 120 is further configured to: according to the indication information,
  • the operation data is output to the external memory through the master interface.
  • the state of the operation data is dirty, indicating that the operation data in the current time Cache has been updated, but the operation data in the external memory has not been updated.
  • controller 120 includes:
  • a Tag Access fifo queue configured to store, after querying the operation data, whether to update information of the Tag RAM and an indication of accessing the Data RAM;
  • a Tag Write fifo queue configured to: after the querying the operation data and determining that the Tag RAM needs to be updated, storing operation information that needs to update the Tag RAM; so as to ensure that the consistent access of the Tag RAM is updated, and pressing Return in order;
  • a data read fifo queue after querying the operation data, storing operation information that needs to update the Tag RAM and read the Data RAM; so as to ensure that the data update of the Tag RAM is performed after the data is read;
  • the control unit is configured to perform the consistency operation according to the Tag Access fifo queue, the Tag Write fifo queue, and the Data read fifo queue.
  • the fifo queue described in this embodiment is a first-in first-out queue; the controller 120 in this embodiment has three new queues to assist in implementing the new control logic with respect to the existing L2 cache.
  • the controller 120 includes a control unit
  • the control unit is configured to perform an access collision detection, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.
  • the above fifo queue may be located inside the control unit, and is respectively connected to the Slave interface, the Master interface, the Tag RAM and the Data RAM.
  • the control unit needs to perform access collision detection and access using the blocking mechanism.
  • Conflict handling the access A conflict can be all of the access violations involved in an existing Cache consistent access.
  • the blocking mechanism can be as follows:
  • the access request needs to modify the state of a cache thread Cache
  • the access request for the same Cache may not be received during the state of modifying the Tag RAM, otherwise the state of the Tag RAM will not be updated; and then the subsequent from the Tag RAM
  • the query result obtained by the query will be inaccurate, causing problems in the access of the subsequent Cache. Therefore, for all requests, the controller needs to perform collision detection with the address in the Tag Write fifo queue, and block the access request of the same index.
  • the present embodiment provides an L2Cache that uses five channels to implement consistent access.
  • the specific L2Cache includes an L2Cache that does not support consistent access supported by the AXI protocol.
  • the L2Cache Slave interface that supports the AXI protocol.
  • the L2Cache in this embodiment may be an L2Cache improved on the L2Cache supporting the AXI protocol, and the control logic is added to the controller through multiplexing of each channel in the Slave interface and the Master interface. (The added control logic can be implemented by specifically adding new logic circuits or adding new control chips) to enable the L2Cache to support consistent access.
  • the L2Cache When the L2Cache is applied to the data processing system, it can be used to implement Cache consistency with the L1Cache and the L2Cache; and the L2Cache and the existing L1Cache and the listening controller are provided in the embodiment. Very good compatibility.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • this embodiment provides a data processing system, where the system includes at least one cluster;
  • the cluster includes at least two processors, an intra-cluster frame listening controller, and an L2Cache as described in the first embodiment; wherein each of the processors is integrally provided with an L1Cache;
  • the in-cluster frame listening controller L1Cache Snoop Controller is respectively connected to the L1Cache and the L2Cache, and is configured to listen for consistent access and assist any two of the L1Caches. And implementing Cache consistency between the L1Cache and the L2Cache.
  • the L1Cache integrated in the CPU first queries whether there is corresponding operation data.
  • the intra-cluster listening controller queries the other L1Caches.
  • the operation data of the query is returned to the corresponding L1Cache and the CPU with the assistance of the intra-cluster listening controller; if there is no query, the intra-cluster listening control is performed.
  • the device queries the L2Cache; the L2Cache responds to the consistency operation.
  • the L2Cache described in this embodiment supports consistent access, so that the Cache consistency with the L1Cache can be implemented, and the data access efficiency and the data processing inconsistency can be improved.
  • the system further includes an inter-cluster frame listening controller; the inter-cluster frame listening controller is connected to the L2Cache for listening for consistent access, and assists in implementing Cache coherency between clusters.
  • the inter-cluster frame listen controller When the corresponding operation data in the consistency access does not query the corresponding data in the L1Cache and the L2Cache in a cluster, the inter-cluster frame listen controller to the other clusters to query the corresponding operation data, and the same
  • the L2Cache and the L1Cache also receive operations such as data query operations of consistency operations sent by other clusters through the inter-cluster frame listening controller.
  • the system shown in FIG. 3 includes a plurality of clusters Cluster; Cluster 0 and Cluster N are shown in the figure; wherein N is an integer not less than 1.
  • Each of the clusters includes an L1Cache, an L2Cache, and an intra-cluster cache frame listen controller.
  • the L1Cache is configured to query, in the L1Cache, the operation data corresponding to the consistent access when receiving the consistent access; when the L1Cache queries the operation data, respond to the consistent access while in the cluster
  • the Cache consistency of the cluster where the L1Cache is located is implemented with the assistance of the internal cache frame listening controller, and the consistency of the Cache between the clusters is realized with the assistance of the inter-cluster cache frame listening controller.
  • the intra-cluster cache frame listening controller is configured to not be queried in the L1Cache in the cluster. Sending the consistent access to the L2Cache when the data is operated;
  • the L2Cache is configured to receive the consistent access and the consistent access sent by other clusters when the operation data corresponding to the consistent access is not queried in the L1Cache of the cluster, and query whether the secondary cache is stored in the L2Cache.
  • the operating data when the L2Cache does not query the operation data corresponding to the consistent access, querying the operation data by using the inter-cluster cache frame listening controller to other clusters other than the cluster where the L2Cache is located, Responding to the consistent access after querying the operation data, and implementing Cache consistency between clusters with the assistance of the inter-cluster cache frame listening controller.
  • the operation data corresponding to the consistent access is first queried in the L1Cache; usually, one operation data includes multiple copies; in the L1Cache corresponding to the CPU, A copy of the operational data may or may not be stored.
  • the CPU queries the corresponding operation data in its corresponding L1Cache it can directly respond to the consistent access; if it is not found in the L1Cache, it needs to go to the L2Cache to search; if the L2Cache in the cluster If not, go to other clusters to query.
  • the operation data B when the operation data B stores two copies in the Cluster 0, it is located in the L1Cache corresponding to the CPU 0 and the L2Cache of the cluster in which it is located, and when the consistency access is performed, the L1Cache corresponding to the CPU 0 is stored.
  • the operation data B is used to perform a write operation on the operation data B, and at the same time, the L2Cache invalidates the stored operation data with the assistance of the cluster frame frame listening controller. Specifically, how to invalidate the controller that can use the Cache by updating the status information of the storage address in the Tag RAM from the valid state to the invalid state. This achieves Cache consistency within the cluster.
  • the Cache consistency is that the information content of the same operation data stored by different Caches is consistent.
  • the operation data B When the operation data B stores one copy in each of the Cluster 0 and the Cluster N, it is stored in the L1Cache corresponding to the CPU 0 in the Cluster 0 and the L1Cache corresponding to the CPU N corresponding to the Cluster N. Query to store the L1Cache corresponding to CPU 0 in Cluster 0.
  • the operation data B is written to the operation data B, and the L1Cache corresponding to the CPU N in the Cluster N is invalidated with the assistance of the intra-cluster frame frame listening controller and the inter-cluster buffer listening controller. Its stored operational data. Specifically, how to invalidate the controller that can use the Cache by invalidating the storage address in the Tag RAM, such as erasing the address and the like. This achieves Cache coherency between clusters.
  • the operation data B when the operation data B is stored in the Cluster 0, there are two copies, which are respectively located in the L1Cache corresponding to the CPU0 and the L1Cache corresponding to the CPU N, wherein the N is an integer that is not less than one;
  • the operating data B is stored in the L1Cache corresponding to the CPU 0, and the operation data B is written, and the CPU N is correspondingly assisted by the buffered frame listening controller in the cluster.
  • L1Cache invalidates its stored operational data. Specifically, how to invalidate the controller that can use the Cache by invalidating the storage address in the Tag RAM, such as erasing the address and the like. This achieves Cache consistency within the cluster.
  • the secondary cache finds the operation data B itself, in response to the write request, the operation data B in the other clusters will be invalidated with the assistance of the inter-cluster cache listening controller.
  • the write access includes an operation of deleting operation data, adding new content to the operation data, and performing replacement modification on the content in the operation data.
  • the system described in the present embodiment When performing the consistent access response, the system described in the present embodiment first performs query processing by the primary cache, and responds according to the query result, and then has a secondary cache to perform query and response, and maintains the cluster without modifying the prior art. On the basis of the internal cache consistency, the Cache consistency between the clusters is realized, and the compatibility with the prior art is strong.
  • the primary cache is configured to query the Performing a read operation on the operation data after operating the data;
  • the secondary cache is configured to perform a read operation on the operational data after querying the operational data.
  • the operation data corresponding to the consistent access is not modified, added, and deleted, and new operation data is not generated, so that the action of invalidating the data is not required.
  • the L2Cache and the inter-cluster cache snooping controller that can implement consistent access can implement the consistency of the Cache between the cluster and the cluster in the system, and avoid the data inconsistency between the cluster and the cluster. The probability of data processing errors.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • this embodiment provides a method for implementing L2Cache consistency, where the method includes:
  • Step S110 Receive a consistent access indication signal and access, and determine that the access is a consistent access when receiving the consistent access indication signal;
  • Step S120 classify the access according to the consistent access indication signal and the access, and form indication information according to the classification result;
  • Step S130 Query operation data according to the indication information, perform a consistency operation according to the indication information after querying the operation data, and output the foregoing to the peripheral device according to the indication information when the operation data is not queried
  • the consistent access indication signal and the consistent access; the peripherals herein are relative to the L2Cache, and the peripherals may be a three-level cache or RAM.
  • Step S140 When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information.
  • L2Cache has the advantage of simple implementation, such as the implementation method of responding to consistent access.
  • the consistent access indication signal includes a consistent access type indication signal
  • the step S110 includes: receiving the consistent access type indication signal, and determining, according to the consistency type indication signal, that the access is a consistent access. It is further defined herein how to determine that the access is a consistent access.
  • the L2Cache includes a Slave interface;
  • the Slave interface includes a first read address channel, a first read data channel, and a first write address channel;
  • the consistent access indication signal further includes the consistent access global signal
  • the step S110 includes:
  • the step S110 further includes at least one of the following:
  • An external memory update signal for consistent access is received through the first write address channel.
  • the slave interface is a 5-channel interface.
  • the slave interface further includes a first write response channel and a first write data channel.
  • the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source of the consistent access.
  • the step S110 includes the received consistent access global signal
  • the step S120 includes performing classification according to the consistent access global signal to form indication information.
  • the L2Cache includes a master interface, and the master interface includes a second read address channel, a second read data channel, and a second write address channel.
  • the step S130 specifically includes: outputting the consistent access indication signal when the operation data is not queried in the RAM through the second read address channel;
  • the method further includes:
  • the read response signal is typically a signal from a downstream processing structure; the downstream processing structure is such as memory or the like.
  • the intercept response signal is from the inter-cluster listening controller or the intra-cluster listening controller described in the second embodiment.
  • the method further includes:
  • the storage access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access are used to provide basis information for querying the operation data and implementing Cache consistency.
  • the access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access may all be obtained in the access and the consistent access indication signal.
  • the slave interface parses the access and the consistent access indication signal, and stores the information in a buffer, so that the controller performs the consistent access operation according to the information. .
  • the method further includes:
  • This embodiment further specifies how the L2Cache feeds back the invalidation failure letter to the request source. In order to facilitate the subsequent processing operations of the request source.
  • the slave interface includes a control module; the RAM includes a data RAM and a Tag RAM; the data RAM is used to store operation data; the data RAM includes a plurality of the cache storage units; and the Tag RAM is used. And storing a storage address of the operation data and status information of the cache storage unit.
  • the step S130 includes at least one of the following:
  • Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor reading the Tag RAM and querying the result according to the result of the Tag RAM Data RAM and return the queried operation data to the processor and write the operation data to the external memory, read the Tag RAM, and read the Tag RAM and query the Data RAM according to the result of the Tag RAM and query the operation data. Write to the external memory and update the status information.
  • the controller adds a controller to the existing L2Cache, and specifically provides control logic for how the L2Cache implements consistent access, which has the advantages of simple implementation.
  • step S140 includes:
  • the operation data is output to the external memory through the master interface.
  • the controller includes: a Tag Access fifo queue, configured to store, after querying the operation data, an update information of the Tag RAM and an indication of accessing the Data RAM; a Tag Write fifo queue, After the operation data is queried and it is determined that the Tag RAM needs to be updated, the operation information of the Tag RAM needs to be updated to ensure that the consistent access of the updated Tag RAM is returned in the order in which the access is initiated; the Data read fifo queue For After querying the operation data, storing operation information that needs to update the Tag RAM and reading the Data RAM to ensure that the update of the Tag RAM is performed after the data is read; the control unit is configured to use the Tag Access according to the Tag Access The fifo queue, the Tag Write fifo queue, and the Data read fifo queue perform the consistency operation.
  • the controller specifically uses the above-mentioned first-in-first-out fifo to control the L2Cache to implement consistent access.
  • the method further includes:
  • the access conflict detection is performed by the control unit, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.
  • the conflicting access includes, for example, a read operation and a write operation to the same cache storage unit.
  • the method in this embodiment is based on the L2Cache described in the first embodiment, and can implement the Cache consistency between the L2Cache and other Caches, including the consistency of the Cache in the cluster and the consistency of the Cache between the clusters.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the embodiment further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, where the computer executable instructions are used to perform at least one of the methods described in the third embodiment, specifically as shown in FIG. The method shown.
  • the computer storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program code.
  • the computer storage medium is a non-transitory storage medium.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • each shown or discussed The coupling, or direct coupling, or communication connection of the components to each other may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or other.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing storage device includes the following steps: the foregoing storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or an optical disk.
  • optical disk A medium that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Disclosed are an L2 Cache and an implementation method of consistency thereof, a data processing system and a storage medium. The L2 Cache comprises a Slave interface, a controller, a Master interface and a RAM; the Slave interface is used for receiving a consistency access indication signal and access, determining that the access is a consistency access when receiving the consistency access indication signal, classifying the access according to the consistency access indication signal and access, and forming indication information according to a classification result; the controller is used for receiving the indication information, querying operation data in the RAM according to the indication information, and executing a consistency operation according to the indication information after the operation data is queried; and the Master interface is used for outputting the consistency access indication signal and the consistency access to a peripheral according to the indication information when the operation data is not queried in the RAM, and outputting the operation data to an external memory according to the indication information after the operation data is queried.

Description

L2Cache及其一致性实现方法、系统和存储介质L2Cache and its consistency implementation method, system and storage medium 技术领域Technical field

本发明涉及数据处理领域的缓存技术,尤其涉及一种L2Cache及其一致性实现方法、系统和存储介质。The present invention relates to a cache technology in the field of data processing, and in particular, to a L2Cache and a consistent implementation method, system and storage medium thereof.

背景技术Background technique

在共享存储的多核处理器中,高速缓冲存储器Cache可以将共享存储空间中的数据缓存在本地,加速多核获取数据的过程。由于每个处理器看到的存储视图都是通过本地Cache得到的,因此对于同一个存储位置的数据而言,不同的处理器可能会获取到不同的数据值。In a shared-core multi-core processor, the cache Cache can cache data in the shared storage space locally, speeding up the process of multi-core acquisition of data. Since the storage views seen by each processor are obtained through the local cache, different processors may obtain different data values for data in the same storage location.

目前多核系统中,将与中央处理器CPU集成在同一块电路板上或主板上的缓存,称为一级L1Cache,而与CPU独立的缓存称为二级L2Cache。在现有技术中,在处理器的控制下实现与L1Cache间的Cache一致性;然而为了提高系统处理速率等性能,一个簇Cluster内的多个CPU通常还会共享一个L2Cache;然而现有的与CPU分离设置的L2Cache是不支持一致性访问,这将导致L1Cache与L2Cache不能实现Cache一致性;L2Cache不能实现Cache一致性。In the current multi-core system, the cache integrated with the central processing unit CPU on the same circuit board or on the main board is called a first-level L1Cache, and the cache independent of the CPU is called a second-level L2Cache. In the prior art, the Cache consistency with the L1Cache is implemented under the control of the processor; however, in order to improve the performance such as the system processing rate, multiple CPUs in a cluster cluster usually share an L2Cache; The L2Cache set by the CPU does not support consistent access. This will result in Cache consistency between L1Cache and L2Cache. L2Cache cannot implement Cache consistency.

显然不能很好的维护Cache一致性,将会导致数据不一致性导致的处理错误率高及处理效率低等诸多问题。Obviously, the Cache consistency cannot be well maintained, which will lead to many problems such as high processing error rate and low processing efficiency caused by data inconsistency.

发明内容Summary of the invention

有鉴于此,本发明实施例期望提供一种能够接收一致性访问实现Cache一致性的L2Cache、数据处理系统和存储介质;本发明实施例还同时提供了所述L2Cache一致性实现方法。 In view of the above, the embodiment of the present invention is to provide an L2Cache, a data processing system, and a storage medium, which are capable of receiving consistent access and achieve Cache consistency. The embodiment of the present invention also provides the L2Cache consistency implementation method.

本发明的技术方案是这样实现的:The technical solution of the present invention is implemented as follows:

本发明实施例第一方面提供一种二级独立高速缓存器L2Cache,所述L2Cache包括Slave接口、控制器、Master接口以及RAM;A first aspect of the embodiment of the present invention provides a two-level independent cache L2Cache, where the L2Cache includes a Slave interface, a controller, a Master interface, and a RAM.

所述Slave接口,配置为接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,及依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息;The slave interface is configured to receive a consistent access indication signal and access, and when the consistent access indication signal is received, determine that the access is a consistent access, and according to the consistent access indication signal and the access Access to classify and form indication information according to the classification result;

所述控制器,配置为接收所述指示信息,依据所述指示信息在所述RAM中查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;The controller is configured to receive the indication information, query operation data in the RAM according to the indication information, and perform a consistency operation according to the indication information after querying the operation data;

所述Master接口,配置为在所述RAM中未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问,及在查询到所述操作数据后依据所述指示信息将所述操作数据输出到外部存储器。The master interface is configured to output the consistent access indication signal and the consistent access to the peripheral device according to the indication information when the operation data is not queried in the RAM, and query the operation The data is then output to the external memory in accordance with the indication information.

基于上述方案,Based on the above scheme,

所述一致性访问指示信号包括一致性访问类型指示信号;The consistent access indication signal includes a consistent access type indication signal;

所述Slave接口,配置为接收所述一致性访问类型指示信号,依据所述一致性访问类型指示信号确定所述访问为一致性访问。The slave interface is configured to receive the consistent access type indication signal, and determine, according to the consistent access type indication signal, that the access is a consistent access.

基于上述方案,Based on the above scheme,

所述一致性访问指示信号还包括所述一致性访问全局信号;The consistent access indication signal further includes the consistent access global signal;

所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;The slave interface includes a first read address channel, a first read data channel, and a first write address channel;

所述Slave接口,配置为接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问;The Slave interface is configured to receive the consistent access global signal, generate a slave interface control signal according to the consistent access global signal, and drive each of the channel receiving stations in the Slave interface according to the Slave interface control signal. Consistent access

所述第一读地址通道,配置为接收所述一致性访问类型指示信号; The first read address channel is configured to receive the consistent access type indication signal;

所述第一读数据通道,配置为依据所述查询结果向请求源发送读响应信号;The first read data channel is configured to send a read response signal to the request source according to the query result;

所述第一写地址通道,配置为接收一致性访问的外部存储器更新信号。The first write address channel is configured to receive an external memory update signal for consistent access.

基于上述方案,Based on the above scheme,

所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。The consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access.

基于上述方案,Based on the above scheme,

所述Master接口包括第二读地址通道、第二读数据通道及第二写地址通道;The master interface includes a second read address channel, a second read data channel, and a second write address channel;

所述第二读地址通道,配置为在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;The second read address channel is configured to output the consistent access indication signal when the operation data is not queried in the RAM;

所述第二读数据通道,配置为接收读响应信号及侦听响应信号;The second read data channel is configured to receive a read response signal and a listening response signal;

所述第二写地址通道,配置为输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。The second write address channel is configured to output an indication signal that writes the operation data to an external memory and invalidates the operation data in the cache.

基于上述方案,Based on the above scheme,

所述L2Cache还包括:The L2Cache also includes:

第一缓冲区,配置为存储访问类型、在其他Cache中的查询状态、在所述L2Cache中的查询状态及所述一致性访问的请求源,为查询所述操作数据及实现Cache一致性提供依据信息。The first buffer is configured to store the access type, the query status in the other Cache, the query status in the L2Cache, and the request source of the consistent access, and provide a basis for querying the operation data and implementing Cache consistency. information.

基于上述方案,Based on the above scheme,

所第一述缓冲区,还配置为存储无效失败信息,依据所述无效失败信息通知向所述请求源。The first buffer is further configured to store invalid failure information, and notify the request source according to the invalid failure information.

基于上述方案,Based on the above scheme,

所述RAM包括Data RAM以及Tag RAM;所述Data RAM配置为存储操作数据;所述Data RAM包括若干个所述cache存储单元;所述Tag RAM 配置为存储操作数据的存储地址及所述cache存储单元的状态信息;The RAM includes a Data RAM and a Tag RAM; the Data RAM is configured to store operation data; the Data RAM includes a plurality of the cache storage units; the Tag RAM a storage address configured to store operation data and status information of the cache storage unit;

所述控制器,配置为依据所述指示信息,The controller is configured to follow the indication information,

读取Tag RAM并依据Tag RAM的结果查询更新所述Tag RAM,Read the Tag RAM and update the Tag RAM according to the result of the Tag RAM.

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述Tag RAM,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and updating the Tag RAM.

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor.

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and writing the operation data to the external memory,

or

读取Tag RAM,Read the Tag RAM,

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述Tag RAM;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and writing the queried operation data to the external memory and updating the Tag RAM;

其中,更新所述Tag RAM包括更新操作地址及所述状态信息的至少其中之一。The updating the Tag RAM includes at least one of an update operation address and the status information.

基于上述方案,Based on the above scheme,

所述控制器,还配置为依据所述指示信息,The controller is further configured to: according to the indication information,

在所述Data RAM查询到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。When the data RAM queries the operation data and the status of the operation data is dirty, the operation data is output to the external memory through the master interface.

基于上述方案,Based on the above scheme,

所述控制器包括: The controller includes:

Tag Access fifo队列,配置为在查询到所述操作数据后,存储是否要更新所述Tag RAM的信息及访问所述Data RAM的指示;a Tag Access fifo queue, configured to store, after querying the operation data, whether to update information of the Tag RAM and an indication of accessing the Data RAM;

Tag Write fifo队列,配置为在查询到所述操作数据后且确定需要更新所述Tag RAM时,存储需要更新所述Tag RAM的操作信息;a Tag Write fifo queue, configured to store operation information that needs to update the Tag RAM after querying the operation data and determining that the Tag RAM needs to be updated;

Data read fifo队列,配置为在查询到所述操作数据后,存储需要更新所述Tag RAM且读取Data RAM的操作信息;a data read fifo queue, configured to store, after querying the operation data, operation information that needs to update the Tag RAM and read the Data RAM;

控制单元,配置为依据所述Tag Access fifo队列、Tag Write fifo队列及Data read fifo队列执行所述一致性操作。The control unit is configured to perform the consistency operation according to the Tag Access fifo queue, the Tag Write fifo queue, and the Data read fifo queue.

基于上述方案,Based on the above scheme,

所述控制器包括控制单元;The controller includes a control unit;

所述控制单元,配置为进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。The control unit is configured to perform an access collision detection, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.

本发明实施例第二方面提供一种数据处理系统,所述系统包括至少一个簇;A second aspect of the embodiments of the present invention provides a data processing system, where the system includes at least one cluster;

所述簇包括至少两个处理器、簇内帧听控制器以及上述权利要求1至9任一项所述的L2Cache;其中,每一个所述处理器都集成设置有一个L1Cache;The cluster includes at least two processors, an intra-cluster frame listening controller, and the L2Cache according to any one of claims 1 to 9; wherein each of the processors is integrally provided with an L1Cache;

所述簇内帧听控制器,分别与所述L1Cache及所述L2Cache相连,配置为侦听一致性访问,协助任一两个所述L1Cache以及所述L1Cache与所述L2Cache之间实现Cache一致性。The in-cluster frame listening controller is respectively connected to the L1Cache and the L2Cache, configured to listen for consistent access, and assist any two of the L1Caches and the L1Cache to implement Cache consistency between the L1Cache and the L2Cache. .

基于上述方案,Based on the above scheme,

所述系统还包括簇间帧听控制器;The system also includes an inter-cluster frame listening controller;

所述簇间帧听控制器,与所述L2Cache相连,配置为侦听一致性访问,协助实现簇之间的Cache一致性。The inter-cluster frame listening controller is connected to the L2Cache and configured to listen for consistent access, and assists in implementing Cache consistency between the clusters.

基于上述方案, Based on the above scheme,

所L1Cache,配置为当接收一致性访问在所述L1Cache中查询所述一致性访问对应的操作数据;当所述L1Cache查询到所述操作数据时,响应所述一致性访问,同时在所述簇内缓存帧听控制器的协助下实现所述L1Cache所在簇的Cache一致性,并在所述簇间缓存帧听控制器的协助下实现簇间的Cache的一致性;The L1Cache is configured to query, in the L1Cache, the operation data corresponding to the consistent access when receiving the consistent access; when the L1Cache queries the operation data, respond to the consistent access while in the cluster The Cache consistency of the cluster where the L1Cache is located is implemented with the assistance of the internal cache frame listening controller, and the consistency of the Cache between the clusters is realized with the assistance of the inter-cluster cache frame listening controller.

所述簇内缓存帧听控制器,配置为在本簇内所述L1Cache中未查询到所述操作数据时,向所述L2Cache发送所述一致性访问;The in-cluster cache frame listening controller is configured to send the consistent access to the L2Cache when the operation data is not queried in the L1Cache in the cluster;

所述L2Cache,配置为在本簇所述L1Cache中未查询到一致性访问对应的操作数据时,接收所述一致性访问及其他簇发送的一致性访问,查询所述L2Cache中是否存储有所述操作数据,当所述L2Cache未查询到所述一致性访问对应的操作数据时,通过所述簇间缓存帧听控制器到所述L2Cache所在簇以外的其他簇中查询所述操作数据,在查询到所述操作数据后响应所述一致性访问,并在所述簇间缓存帧听控制器协助下实现簇间的Cache一致性。The L2Cache is configured to receive the consistent access and the consistent access sent by other clusters when the operation data corresponding to the consistent access is not queried in the L1Cache of the cluster, and query whether the L2Cache stores the The operating data, when the L2Cache does not query the operation data corresponding to the consistent access, querying the operation data by using the inter-cluster cache frame listening controller to other clusters other than the cluster where the L2Cache is located, in the query Responding to the consistent access after the operation data, and implementing Cache consistency between the clusters with the assistance of the inter-cluster cache frame listening controller.

本发明实施例第三方面提供一种L2Cache一致性实现方法,所述方法包括:A third aspect of the embodiments of the present invention provides a method for implementing L2Cache consistency, where the method includes:

接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问;Receiving a consistent access indication signal and access, and determining that the access is a consistent access when receiving the consistent access indication signal;

依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息;And classifying the access according to the consistent access indication signal and the access, and forming indication information according to the classification result;

依据所述指示信息查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;在未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问;Querying the operation data according to the indication information, performing a consistency operation according to the indication information after querying the operation data; and when the operation data is not queried, outputting the consistency access to the peripheral device according to the indication information Indication signal and the consistent access;

当所述访问需要将所述操作数据输出到外部存储器时,则在查询到所述操作数据后,依据所述指示信息将所述操作数据输出到外部存储器。 When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information.

基于上述方案,Based on the above scheme,

所述一致性访问指示信号包括一致性访问类型指示信号;The consistent access indication signal includes a consistent access type indication signal;

所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,包括:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, including:

接收所述一致性访问类型指示信号,依据所述一致性类型指示信号确定所述访问为一致性访问。Receiving the consistent access type indication signal, and determining, according to the consistency type indication signal, that the access is a consistent access.

基于上述方案,Based on the above scheme,

所述L2Cache包括Slave接口;所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;The L2Cache includes a Slave interface; the Slave interface includes a first read address channel, a first read data channel, and a first write address channel;

所述一致性访问指示信号还包括所述一致性访问全局信号;The consistent access indication signal further includes the consistent access global signal;

所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,包括:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, including:

接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问;Receiving the consistent access global signal, and forming a slave interface control signal according to the consistent access global signal, and driving each of the channels in the Slave interface to receive the consistent access according to the slave interface control signal;

通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal;

所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,还包括以下至少其中之一:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, and further comprising at least one of the following:

通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal;

通过所述第一读数据通道依据所述查询结果向请求源发送读响应信号;Transmitting, by the first read data channel, a read response signal to the request source according to the query result;

通过所述第一写地址通道接收一致性访问的外部存储器更新信号。An external memory update signal for consistent access is received through the first write address channel.

基于上述方案,Based on the above scheme,

所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。 The consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access.

基于上述方案,Based on the above scheme,

所述L2Cache包括Master接口;所述Master接口包括第二读地址通道、第二读数据通道及第二写地址通道;The L2Cache includes a master interface, and the master interface includes a second read address channel, a second read data channel, and a second write address channel.

所述在未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问,包括:And outputting the consistent access indication signal and the consistent access to the peripheral device according to the indication information, when the operation data is not queried, including:

通过所述第二读地址通道在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;Outputting the consistent access indication signal when the operation data is not queried in the RAM through the second read address channel;

所述方法还包括:The method further includes:

通过所述第二读数据通道接收读响应信号及侦听响应信号;Receiving a read response signal and a sounding response signal through the second read data channel;

通过所述第二写地址通道输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。And outputting, by the second write address channel, the operation data to the external memory and invalidating the indication signal of the operation data in the Cache.

基于上述方案,Based on the above scheme,

在接收到所述一致性访问指示信号后,所述方法还包括:After receiving the consistent access indication signal, the method further includes:

存储访问类型、在其他Cache中的查询状态、在L2Cache中的查询状态及所述一致性访问的请求源,用于为查询所述操作数据及实现Cache一致性提供依据信息。The storage access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access are used to provide basis information for querying the operation data and implementing Cache consistency.

基于上述方案,Based on the above scheme,

所述方法还包括:The method further includes:

在L2Cache中未查询到所述操作数据时,形成并存储无效失败信息,依据所述无效失败信息通知向所述请求源。When the operation data is not queried in the L2Cache, invalid failure information is formed and stored, and the request source is notified according to the invalid failure information.

基于上述方案,Based on the above scheme,

所述Slave接口包括控制模块;所述RAM包括Data RAM以及Tag RAM;所述Data RAM用于存储操作数据;所述Tag RAM用于存储所述操作数据的存储地址及cache存储单元的状态信息;The slave interface includes a control module; the RAM includes a data RAM and a Tag RAM; the data RAM is used to store operation data; the Tag RAM is used to store a storage address of the operation data and state information of a cache storage unit;

所述依据所述指示信息查询操作数据,在查询到所述操作数据后依据 所述指示信息执行一致性操作包括以下至少其中之一:The querying the operation data according to the indication information, after querying the operation data, The indicating information performing the consistency operation includes at least one of the following:

通过所述控制模块,依据所述指示信息,读取Tag RAM并依据Tag RAM的结果查询更新所述状态信息;Reading, by the control module, the Tag RAM according to the indication information, and querying and updating the status information according to the result of the Tag RAM;

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述状态信息;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and updating the status information;

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor;

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and writing the operation data to the external memory;

读取Tag RAM;及Read Tag RAM; and

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述状态信息。The Tag RAM is read and the Data RAM is queried according to the result of the Tag RAM and the queried operation data is written to the external memory and the status information is updated.

基于上述方案,Based on the above scheme,

所述当所述访问需要将所述操作数据输出到外部存储器时,则在查询到所述操作数据后,依据所述指示信息将所述操作数据输出到外部存储器,包括:When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information, including:

依据所述指示信息,在所述Data RAM查询到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。And according to the indication information, when the data RAM queries the operation data and the status of the operation data is dirty, the operation data is output to the external memory through the master interface.

基于上述方案,Based on the above scheme,

所述方法还包括:The method further includes:

通过控制单元进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。The access conflict detection is performed by the control unit, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.

本发明实施例第四方面还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行本发明 实施例第三方面所述方法的至少其中之一。A fourth aspect of the embodiments of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the present invention. At least one of the methods of the third aspect of the embodiments.

本发明实施例所述的L2Cache及其一致性实现方法和数据处理系统,通过一致性访问指示信号的接收,依据所述一致性访问指示信号能够实现与其他Cache的一致性;独立于CPU的L2Cache能够执行一致性访问操作,能够实现数据处理系统内L1Cache与L2Cache之间的一致性以及簇与簇之间的Cache一致性,扩大了Cache一致性的范围,降低了数据处理过程中因L2Cache无法实现导致的数据处理差错几率,并且减少了维护Cache一致性的成本。The L2Cache and the consistency implementation method and the data processing system of the embodiments of the present invention can achieve consistency with other Caches according to the consistent access indication signal by using the consistent access indication signal; the CPU independent L2Cache The ability to perform consistent access operations enables consistency between L1Cache and L2Cache in the data processing system and Cache consistency between clusters and clusters, which expands the scope of Cache consistency and reduces the inability of L2Cache to be realized during data processing. The resulting data handles the chance of errors and reduces the cost of maintaining Cache coherency.

附图说明DRAWINGS

图1为本发明实施例所述L2Cache的结构示意图;FIG. 1 is a schematic structural diagram of an L2Cache according to an embodiment of the present invention;

图2为本发明实施例所述的数据处理系统的结构示意图之一;2 is a schematic structural diagram of a data processing system according to an embodiment of the present invention;

图3为本发明实施例所述的数据处理系统的结构示意图之二;3 is a second schematic structural diagram of a data processing system according to an embodiment of the present invention;

图4为本法实施例所述的L2Cache一致性实现方法的流程示意图。FIG. 4 is a schematic flowchart of a method for implementing L2Cache consistency according to an embodiment of the present disclosure.

具体实施方式detailed description

以下结合说明书附图及具体实施例对本发明的技术方案做进一步的详细阐述;应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The present invention is further described in detail with reference to the accompanying drawings and specific embodiments.

实施例一:Embodiment 1:

如1所示、本实施例一种二级高速缓存器L2Cache,所述L2Cache包括Slave接口110、控制器120、Master接口130以及RAM 140;所述RAM140通常又分为Tag RAM和Data RAM。As shown in FIG. 1 , a L2Cache is included in the embodiment, and the L2Cache includes a Slave interface 110, a controller 120, a Master interface 130, and a RAM 140. The RAM 140 is generally further divided into a Tag RAM and a Data RAM.

所述Slave接口110,配置为接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息; The slave interface 110 is configured to receive a consistent access indication signal and access, and when the consistent access indication signal is received, determine that the access is a consistent access, according to the consistent access indication signal and the access Access to classify and form indication information according to the classification result;

所述控制器120,配置为接收所述指示信息,依据所述指示信息在所述RAM 140中查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;The controller 120 is configured to receive the indication information, query operation data in the RAM 140 according to the indication information, and perform a consistency operation according to the indication information after querying the operation data;

所述Master接口130,配置为在所述RAM 140中未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问及在查询到所述操作数据后依据所述指示信息将所述操作数据输出到外部存储器。The master interface 130 is configured to output the consistent access indication signal and the consistent access to the peripheral device according to the indication information when the operation data is not queried in the RAM 140, and query the The operation data is output to the external memory according to the indication information after the operation data.

本实施例所述的L2Cache是相对于与CPU集成在同一块主板上的L1Cache而言的独立Cache。The L2Cache described in this embodiment is an independent Cache with respect to the L1Cache integrated on the same motherboard as the CPU.

本实施例中所述Slave接口110在接收访问的时候,相对于现有的L2Cache还会接收所述一致性访问指示信号,并根据所述一致性访问指示信号对访问进行判断;将所述访问分为一致性访问和非一致性访问;通常当所述Slave接口接收到访问的同时接收到一致性访问指示信号,则认为接收到所述访问为一致性访问。所述一致性访问为需要保持Cache之间存储数据一致性的访问操作,这种Cache之间数据一致性,也可以称为Cache一致性。若是一致性访问则将生成对应于所述一致性访问的指示信息,以便所述L2Cache根据所述指示信息执行相应的一致性操作,具体如无效数据等操作。The slave interface 110 in the embodiment receives the consistent access indication signal with respect to the existing L2Cache when receiving the access, and determines the access according to the consistent access indication signal; It is divided into consistent access and non-uniform access; generally, when the slave interface receives the consistent access indication signal while receiving the access, it is considered that the access is received as a consistent access. The consistent access is an access operation that needs to maintain data consistency between the Caches. The data consistency between the Caches may also be referred to as Cache consistency. If the access is consistent, the indication information corresponding to the consistent access is generated, so that the L2Cache performs a corresponding consistency operation according to the indication information, such as an invalid data operation.

所述依据一致性访问指示信号及所述访问对所述访问进行分类,包括将访问类型分为一致性访问和非一致性访问,响应访问时的操作可包括对RAM执行读操作、写操作或查询操作,为了简化控制器对数据处理,所述Slave接口还将根据具体所需执行的操作进行再次分类,便于控制器能够快速的更具所述指示信息响应所述访问。The classifying the access according to the consistent access indication signal and the access, including dividing the access type into a consistent access and a non-uniform access, and the operation in response to the access may include performing a read operation, a write operation, or The query operation, in order to simplify the controller's processing of data, the Slave interface will also be re-classified according to the specific operations required to facilitate the controller to quickly respond to the access with the indication information.

可选地,所述一致性访问指示信号包括一致性访问类型指示信号;所述Slave接口110,配置为接收所述一致性访问类型指示信号,依据所述一 致性访问类型指示信号确定所述访问为一致性访问。Optionally, the consistent access indication signal includes a consistent access type indication signal, and the slave interface 110 is configured to receive the consistent access type indication signal according to the one The causal access type indication signal determines that the access is a consistent access.

在本实施例中具体限定了一致性访问相对于非一致性访问,Slave接口在接收一致性访问时,还将接收到所述一致性访问类型指示信号,从而能确认当前访问为一致性访问。In this embodiment, the consistent access is specifically defined with respect to the non-uniform access. When receiving the consistent access, the slave interface also receives the consistent access type indication signal, so that the current access can be confirmed as a consistent access.

可选地,所述一致性访问指示信号还包括所述一致性访问全局信号;Optionally, the consistent access indication signal further includes the consistent access global signal;

所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;The slave interface includes a first read address channel, a first read data channel, and a first write address channel;

所述Slave接口,配置为接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问;The Slave interface is configured to receive the consistent access global signal, generate a slave interface control signal according to the consistent access global signal, and drive each of the channel receiving stations in the Slave interface according to the Slave interface control signal. Consistent access

所述第一读地址通道,配置为接收所述一致性访问类型指示信号;The first read address channel is configured to receive the consistent access type indication signal;

所述第一读数据通道,配置为依据所述查询结果向请求源发送读响应信号;The first read data channel is configured to send a read response signal to the request source according to the query result;

所述第一写地址通道,配置为接收一致性访问的外部存储器更新信号。The first write address channel is configured to receive an external memory update signal for consistent access.

本实施例所述的Slave接口优选为包括5个通道的接口;在具体的实现过程中,所述Slave接口还将包括上述3个通道以外,还包括第一读数据通道及第一写响应通道。The slave interface of the embodiment is preferably an interface including five channels. In a specific implementation process, the slave interface further includes the first three channels, and further includes a first read data channel and a first write response channel. .

当所述访问为一致性访问时,所述Slave接口会接收访问(所述访问可如读访问或写访问等);针对如何接收访问及由哪些通道接收访问与现有技术中所述Slave接口接收访问是一致的;为了指示该访问为一致性访问,所述Slave接口还将接收所述一致性访问类型指示信号;为了确定该一致性访问在其他Cache中的状态等信息,所述一致性访问还将接收所述一致性访问全局信号;所述salve接口将综合所述访问以及所述一致性访问全局信号中携带的信息,确定L2Cache需要执行的操作,进而形成指示信息。所述控制器将根据所述指示信息控制Slave接口、Master接口及RAM执行对应 的一致性操作。具体的所述依据所述查询结果向请求源发送读响应信号,为L2Cache中增加的一种一致性访问Read response。When the access is a consistent access, the slave interface may receive an access (the access may be a read access or a write access, etc.); and how to receive access and which channels receive access to the Slave interface described in the prior art The receiving access is consistent; in order to indicate that the access is a consistent access, the slave interface will also receive the consistent access type indication signal; in order to determine the status of the consistent access in other Caches, the consistency The access will also receive the consistent access global signal; the salve interface will synthesize the access and the information carried in the consistent access global signal, determine the operation that the L2Cache needs to perform, and form the indication information. The controller controls the slave interface, the master interface, and the RAM to perform corresponding operations according to the indication information. Consistent operation. Specifically, the method sends a read response signal to the request source according to the query result, and is a consistent access Read response added in the L2Cache.

可选地,所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。Optionally, the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source of the consistent access.

所述其他Cache可以是L1Cache或其他L2Cache。具体的所述请求源可以是与L1Cache集成设置的CPU、AXI主设备、AXI从设备等设备。The other Cache may be an L1Cache or other L2Cache. The specific request source may be a CPU integrated with the L1Cache, an AXI master device, an AXI slave device, and the like.

当存储所述其他Cache中的查询状态,可以在本L2Cache中查询不到对应的数据时,去其他Cache获取数据,拷贝到本L2Cache中执行对应的操作,同时根据操作是读操作还是写操作控制其他Cache执行一致性操作,具体如当本L2Cache进行写操作时,所述控制器将根据所述一致性访问全局信号输出控制信息以使其他Cache无效其内部存储的数据。When the query status in the other Cache is stored, the corresponding data may be queried in the L2Cache, and the data is obtained by the other Cache, and the corresponding operation is performed in the L2Cache, and the read operation or the write operation control is performed according to whether the operation is performed. The other Cache performs a consistency operation, for example, when the L2Cache performs a write operation, the controller will output control information according to the consistent access global signal to invalidate other caches to internally stored data.

对应的为了使L2Cache支持一致性访问,本实施例中不仅对Slave接口进行了改进,同时还对Master接口进行了改进,具体如下:所述Master接口130包括第二读地址通道、第二读数据通道及第二写地址通道;Correspondingly, in order to enable the L2Cache to support the consistent access, in this embodiment, not only the Slave interface is improved, but also the Master interface is improved, as follows: The Master interface 130 includes a second read address channel and a second read data. Channel and second write address channel;

所述第二读地址通道,配置为在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;所述一致性访问指示信号具体包括所述一致性访问类型指示信号;The second read address channel is configured to output the consistent access indication signal when the operation data is not queried in the RAM; the consistent access indication signal specifically includes the consistent access type indication signal;

所述第二读数据通道,配置为接收读响应信号及侦听响应信号;所述读响应信号通常为L2Cache的下游处理结构返回操作数据时输出的信号;所述下游处理结构具体如外部存储器memory。The second read data channel is configured to receive a read response signal and a sounding response signal; the read response signal is generally a signal outputted by the downstream processing structure of the L2Cache when the operation data is returned; the downstream processing structure is specifically an external memory memory .

所述第二写地址通道,配置为输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。所述外部存储器可以是各种类型的寄存器等。在本实施例中所述Master接口130也优选为5通道的接口,还包括第二写数据通道及第二写响应通道;所述第二写数据通道,用于输出和接收数据写操作相关的信号;所述第二写响应通道,用于接收和输出 写响应信号。The second write address channel is configured to output an indication signal that writes the operation data to an external memory and invalidates the operation data in the cache. The external memory may be various types of registers or the like. In the embodiment, the master interface 130 is also preferably a 5-channel interface, and further includes a second write data channel and a second write response channel; the second write data channel is used for outputting and receiving data write operations. Signal; the second write response channel for receiving and outputting Write a response signal.

可选地,所述L2Cache还包括:第一缓冲区,配置为存储访问类型、在其他Cache中的查询状态、在所述L2Cache中的查询状态及所述一致性访问的请求源,用于为查询所述操作数据及实现Cache一致性提供依据信息。Optionally, the L2Cache further includes: a first buffer, configured to store an access type, a query status in another Cache, a query status in the L2Cache, and a request source of the consistent access, for Query the operation data and implement Cache consistency to provide basis information.

所述第一缓冲区可以为专门设置的buffer;所述访问类型包括访问的类型是一执行访问还是非一致性访问;所述其他Cache包括L1Cache以及其他L2Cache等。存储所述L2Cache中的查询状态,方便其他Cache在执行一致性访问时,保持与所述L2Cache的Cache的一致性。The first buffer may be a specially configured buffer; the access type includes whether the access type is an execution access or a non-uniform access; the other cache includes an L1Cache and other L2Caches. Storing the query status in the L2Cache, so that other Caches maintain consistency with the Cache of the L2Cache when performing consistent access.

所述第一缓冲区,可配置为存储从所述一致性访问全局信号以及侦听信号中做获取的上述信息,以协助所述L2Cache实现与其他Cache的一致性。The first buffer may be configured to store the foregoing information obtained from the consistent access global signal and the interception signal to assist the L2Cache to achieve consistency with other caches.

所述第一缓冲区,还可配置为存储无效失败信息,依据所述无效失败信息通知向所述请求源。The first buffer may be further configured to store invalid failure information, and notify the request source according to the invalid failure information.

可选地,所述RAM包括Data RAM以及Tag RAM;所述Data RAM配置为存储操作数据。所述Tag RAM配置为存储所述操作数据的存储地址及cache存储单元的状态信息。所述Data RAM包括若干个所述cache存储单元;所述cache存储单元具体可以为cache行等,是进行cache读写操作的最小单元。Optionally, the RAM includes a Data RAM and a Tag RAM; the Data RAM is configured to store operational data. The Tag RAM is configured to store a storage address of the operation data and status information of a cache storage unit. The data RAM includes a plurality of the cache storage units; the cache storage unit may be a cache line or the like, and is a minimum unit for performing a cache read and write operation.

所述控制器120,配置为依据所述指示信息,The controller 120 is configured to follow the indication information,

读取Tag RAM并依据Tag RAM的结果查询更新所述Tag RAM,Read the Tag RAM and update the Tag RAM according to the result of the Tag RAM.

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述Tag RAM,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and updating the Tag RAM.

Or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor.

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and writing the operation data to the external memory,

or

读取Tag RAM,Read the Tag RAM,

or

读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述Tag RAM;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and writing the queried operation data to the external memory and updating the Tag RAM;

其中,更新所述Tag RAM包括更新操作地址及所述状态信息的至少其中之一。The updating the Tag RAM includes at least one of an update operation address and the status information.

在现有的L2Cache中的控制器的控制逻辑相对简单,对Tag RAM更新仅发生在写操作或读写分配导致的替换的时候,而在本实施例中对所述Tag RAM的更新还发生执行一致性访问的其他操作时,如操作数据查询。具体如;在其他Cache在执行一致性访问中的写操作时,可能需要无效本L2Cache中的操作数据的副本,可能需要无效对应的Cache单元,则可以所述控制器可能会执行读取Tag RAM并依据Tag RAM的结果查询更新所述Tag RAM的控制逻辑。The control logic of the controller in the existing L2Cache is relatively simple, and the update of the Tag RAM only occurs when the replacement by the write operation or the read-write allocation occurs, and in the present embodiment, the update of the Tag RAM is also performed. Other operations for consistent access, such as manipulating data queries. For example, when other Caches perform write operations in the consistent access, it may be necessary to invalidate the copy of the operation data in the L2Cache, and may need to invalidate the corresponding Cache unit, and the controller may execute the read Tag RAM. And according to the result of the Tag RAM query to update the control logic of the Tag RAM.

具体的控制器120采用哪种控制逻辑响应当前访问,依据所述访问指向的操作以及该访问进行类型以及在其他Cache中的查询状态等信息来确定。The specific controller 120 uses which control logic responds to the current access, based on information such as the operation pointed to by the access and the type of access and the status of the query in other Caches.

所述控制器可以通过新增控制芯片或逻辑控制电路等来实现控制逻辑的增加。The controller can implement an increase in control logic by adding a control chip or a logic control circuit or the like.

可选地,所述控制器120,还配置为依据所述指示信息, Optionally, the controller 120 is further configured to: according to the indication information,

在所述Data RAM读到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。When the data RAM reads the operation data and the state of the operation data is dirty, the operation data is output to the external memory through the master interface.

操作数据的状态为dirty,表示当前时刻Cache中的所述操作数据已经更新了,但是外部存储器中的所述操作数据还未更新的状态。The state of the operation data is dirty, indicating that the operation data in the current time Cache has been updated, but the operation data in the external memory has not been updated.

可选地,所述控制器120包括:Optionally, the controller 120 includes:

Tag Access fifo队列,配置为在查询到所述操作数据后,存储是否要更新所述Tag RAM的信息及访问所述Data RAM的指示;a Tag Access fifo queue, configured to store, after querying the operation data, whether to update information of the Tag RAM and an indication of accessing the Data RAM;

Tag Write fifo队列,配置为在查询到所述操作数据后且确定需要更新所述Tag RAM时,存储需要更新所述Tag RAM的操作信息;以便保证更新所述Tag RAM的一致性访问,按发起顺序返回;a Tag Write fifo queue, configured to: after the querying the operation data and determining that the Tag RAM needs to be updated, storing operation information that needs to update the Tag RAM; so as to ensure that the consistent access of the Tag RAM is updated, and pressing Return in order;

Data read fifo队列,用于在查询到所述操作数据后,存储需要更新所述Tag RAM且读取Data RAM的操作信息;以便保证Tag RAM的数据更新是在数据读取之后进行的;a data read fifo queue, after querying the operation data, storing operation information that needs to update the Tag RAM and read the Data RAM; so as to ensure that the data update of the Tag RAM is performed after the data is read;

控制单元,配置为依据所述Tag Access fifo队列、Tag Write fifo队列及Data read fifo队列执行所述一致性操作。The control unit is configured to perform the consistency operation according to the Tag Access fifo queue, the Tag Write fifo queue, and the Data read fifo queue.

本实施例所述的fifo队列为先进先出队列;本实施例所述的控制器120相对于现有的L2cache有新增3个队列来协助实现新增的控制逻辑。The fifo queue described in this embodiment is a first-in first-out queue; the controller 120 in this embodiment has three new queues to assist in implementing the new control logic with respect to the existing L2 cache.

可选地,所述控制器120包括控制单元;Optionally, the controller 120 includes a control unit;

所述控制单元,配置为进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。The control unit is configured to perform an access collision detection, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict.

上述fifo队列可位于所述控制单元内部,分别与所述Slave接口,Master接口、Tag RAM及Data RAM相连。The above fifo queue may be located inside the control unit, and is respectively connected to the Slave interface, the Master interface, the Tag RAM and the Data RAM.

当所述L2cache需要实现一致性访问时,可能存在着不同的CPU对同一Cache存储单元进行读写操作,这将导致冲突,此时需要所述控制单元进行访问冲突检测,并采用阻塞机制对访问冲突进行协调处理;所述访问 冲突可以为现有Cache一致性访问中所涉及的所有的访问冲突。When the L2 cache needs to implement consistent access, different CPUs may perform read and write operations on the same Cache storage unit, which may cause conflicts. In this case, the control unit needs to perform access collision detection and access using the blocking mechanism. Conflict handling; the access A conflict can be all of the access violations involved in an existing Cache consistent access.

所述阻塞机制可如下:The blocking mechanism can be as follows:

若访问请求需要对一个缓存线程Cache的状态进行修改,那么在修改Tag RAM的状态期间,针对同一Cache的访问请求不可以被接收,否则Tag RAM的状态将无法被更新;进而后续从Tag RAM中查询得到的查询结果将出现不准确现象,导致后续Cache的访问出现问题。因此所有请求,控制器都需要同Tag Write fifo队列中的地址做冲突检测,对相同索引的访问请求做阻塞机制。If the access request needs to modify the state of a cache thread Cache, the access request for the same Cache may not be received during the state of modifying the Tag RAM, otherwise the state of the Tag RAM will not be updated; and then the subsequent from the Tag RAM The query result obtained by the query will be inaccurate, causing problems in the access of the subsequent Cache. Therefore, for all requests, the controller needs to perform collision detection with the address in the Tag Write fifo queue, and block the access request of the same index.

综合上述,本实施例提供了一种L2Cache采用5个通道来实现一致性访问,具体的现有的L2Cache包括支持AXI协议的不支持一致性访问的L2Cache;这种支持AXI协议的L2Cache的Slave接口通常为5个通道,本实施例所述的L2Cache可以为在所述支持AXI协议的L2Cache上改进的L2Cache,通过Slave接口和Master接口中各通道的复用,在所述控制器中增加控制逻辑(所增加的控制逻辑可具体采用新增的逻辑电路或新增控制芯片来实现)使所述L2Cache支持一致性访问。当所述L2Cache应用于数据处理系统中,可以用于与L1Cache和或L2Cache实现Cache一致性;且实践证明,本实施例所述的L2Cache与现有的中的L1Cache以及侦听控制器等设备有很好的兼容性。In summary, the present embodiment provides an L2Cache that uses five channels to implement consistent access. The specific L2Cache includes an L2Cache that does not support consistent access supported by the AXI protocol. The L2Cache Slave interface that supports the AXI protocol. Generally, the L2Cache in this embodiment may be an L2Cache improved on the L2Cache supporting the AXI protocol, and the control logic is added to the controller through multiplexing of each channel in the Slave interface and the Master interface. (The added control logic can be implemented by specifically adding new logic circuits or adding new control chips) to enable the L2Cache to support consistent access. When the L2Cache is applied to the data processing system, it can be used to implement Cache consistency with the L1Cache and the L2Cache; and the L2Cache and the existing L1Cache and the listening controller are provided in the embodiment. Very good compatibility.

实施例二:Embodiment 2:

如图2所示,本实施例提供一种数据处理系统,所述系统包括至少一个簇;As shown in FIG. 2, this embodiment provides a data processing system, where the system includes at least one cluster;

所述簇包括至少两个处理器、簇内帧听控制器以及如实施例一中所述的L2Cache;其中,每一个所述处理器都集成设置有一个L1Cache;The cluster includes at least two processors, an intra-cluster frame listening controller, and an L2Cache as described in the first embodiment; wherein each of the processors is integrally provided with an L1Cache;

所述簇内帧听控制器L1Cache Snoop Controller,分别与所述L1Cache及所述L2Cache相连,用于侦听一致性访问,协助任一两个所述L1Cache 以及所述L1Cache与所述L2Cache之间实现Cache一致性。The in-cluster frame listening controller L1Cache Snoop Controller is respectively connected to the L1Cache and the L2Cache, and is configured to listen for consistent access and assist any two of the L1Caches. And implementing Cache consistency between the L1Cache and the L2Cache.

通常当CPU发起一个访问,首先在该CPU集成的所述L1Cache中查询是否有对应的操作数据,当没有查询到对应的操作数据时,通过所述簇内侦听控制器到其他L1Cache中查询,当在其他Cache中查询到所述操作数据,在所述簇内侦听控制器的协助下将查询的所述操作数据返回给对应的L1Cache及CPU;若没有查询到则通过簇内侦听控制器到L2Cache中进行查询;由L2Cache响应所述一致性操作。Generally, when the CPU initiates an access, the L1Cache integrated in the CPU first queries whether there is corresponding operation data. When the corresponding operation data is not queried, the intra-cluster listening controller queries the other L1Caches. When the operation data is queried in the other Cache, the operation data of the query is returned to the corresponding L1Cache and the CPU with the assistance of the intra-cluster listening controller; if there is no query, the intra-cluster listening control is performed. The device queries the L2Cache; the L2Cache responds to the consistency operation.

本实施例所述的L2Cache支持一致性访问,从而能够实现与所述L1Cache实现Cache一致性,能够提高数据访问效率及降低数据处理不一致性的问题。The L2Cache described in this embodiment supports consistent access, so that the Cache consistency with the L1Cache can be implemented, and the data access efficiency and the data processing inconsistency can be improved.

如图3所示,所述系统还包括簇间帧听控制器;所述簇间帧听控制器,与所述L2Cache相连用于侦听一致性访问,协助实现簇间的Cache一致性。As shown in FIG. 3, the system further includes an inter-cluster frame listening controller; the inter-cluster frame listening controller is connected to the L2Cache for listening for consistent access, and assists in implementing Cache coherency between clusters.

当一致性访问中对应的操作数据在一个簇内的L1Cache及L2Cache都未查询到对应的数据的时候,通过所述簇间帧听控制器到其他簇去查询对应的操作数据,同样的所述L2Cache及所述L1Cache也通过所述簇间帧听控制器接收其他簇发送的一致性操作的数据查询操作等操作。When the corresponding operation data in the consistency access does not query the corresponding data in the L1Cache and the L2Cache in a cluster, the inter-cluster frame listen controller to the other clusters to query the corresponding operation data, and the same The L2Cache and the L1Cache also receive operations such as data query operations of consistency operations sent by other clusters through the inter-cluster frame listening controller.

图3所示的系统中包括多个簇Cluster;图示中显示有Cluster 0和Cluster N;其中,所述N为不小于1的整数。每一个所述簇都包括L1Cache、L2Cache及簇内缓存帧听控制器。The system shown in FIG. 3 includes a plurality of clusters Cluster; Cluster 0 and Cluster N are shown in the figure; wherein N is an integer not less than 1. Each of the clusters includes an L1Cache, an L2Cache, and an intra-cluster cache frame listen controller.

所L1Cache,配置为当接收一致性访问在所述L1Cache中查询所述一致性访问对应的操作数据;当所述L1Cache查询到所述操作数据时,响应所述一致性访问,同时在所述簇内缓存帧听控制器的协助下实现所述L1Cache所在簇的Cache一致性,并在所述簇间缓存帧听控制器的协助下实现簇间的Cache的一致性;The L1Cache is configured to query, in the L1Cache, the operation data corresponding to the consistent access when receiving the consistent access; when the L1Cache queries the operation data, respond to the consistent access while in the cluster The Cache consistency of the cluster where the L1Cache is located is implemented with the assistance of the internal cache frame listening controller, and the consistency of the Cache between the clusters is realized with the assistance of the inter-cluster cache frame listening controller.

所述簇内缓存帧听控制器,配置为在本簇内所述L1Cache中未查询到 所述操作数据时,向所述L2Cache发送所述一致性访问;The intra-cluster cache frame listening controller is configured to not be queried in the L1Cache in the cluster. Sending the consistent access to the L2Cache when the data is operated;

所述L2Cache,配置为在本簇所述L1Cache中未查询到一致性访问对应的操作数据时,接收所述一致性访问及其他簇发送的一致性访问,查询所述二级Cache中是否存储有所述操作数据,当所述L2Cache未查询到所述一致性访问对应的操作数据时,通过所述簇间缓存帧听控制器到所述L2Cache所在簇以外的其他簇中查询所述操作数据,在查询到所述操作数据后响应所述一致性访问,并在所述簇间缓存帧听控制器协助下实现簇间的Cache一致性。The L2Cache is configured to receive the consistent access and the consistent access sent by other clusters when the operation data corresponding to the consistent access is not queried in the L1Cache of the cluster, and query whether the secondary cache is stored in the L2Cache. The operating data, when the L2Cache does not query the operation data corresponding to the consistent access, querying the operation data by using the inter-cluster cache frame listening controller to other clusters other than the cluster where the L2Cache is located, Responding to the consistent access after querying the operation data, and implementing Cache consistency between clusters with the assistance of the inter-cluster cache frame listening controller.

在接收一致性访问(如CPU发出的一致性访问)后,将首先到L1Cache中查询所述一致性访问对应的操作数据;通常一份操作数据会包括多个副本;在CPU对应的L1Cache中可能存储有所述操作数据的副本,也可能没有。当CPU在其对应的L1Cache中查询到对应的操作数据后,直接响应所述一致性访问即可;如若在所述L1Cache中没有查找到则需要到L2Cache中去查找;若本簇内的L2Cache中没有则到其他簇中去查询。After receiving the consistent access (such as the consistent access sent by the CPU), the operation data corresponding to the consistent access is first queried in the L1Cache; usually, one operation data includes multiple copies; in the L1Cache corresponding to the CPU, A copy of the operational data may or may not be stored. After the CPU queries the corresponding operation data in its corresponding L1Cache, it can directly respond to the consistent access; if it is not found in the L1Cache, it needs to go to the L2Cache to search; if the L2Cache in the cluster If not, go to other clusters to query.

具体如,当操作数据B在Cluster 0中存储有两个副本,分别是位于CPU 0对应的L1Cache中及其所在簇的L2Cache中,在执行一致性访问时,查询到CPU 0对应的L1Cache中存储有所述操作数据B,对所述操作数据B进行写操作,同时在所述簇内缓存帧听控制器的协助下,使L2Cache无效掉其存储的操作数据。具体的如何无效可以采用Cache的控制器通过将Tag RAM中的存储地址的状态信息由有效状态更新为无效状态。这样就实现簇内的Cache一致性。所述Cache一致性为不同的Cache存储的同一操作数据的信息内容是一致的。For example, when the operation data B stores two copies in the Cluster 0, it is located in the L1Cache corresponding to the CPU 0 and the L2Cache of the cluster in which it is located, and when the consistency access is performed, the L1Cache corresponding to the CPU 0 is stored. The operation data B is used to perform a write operation on the operation data B, and at the same time, the L2Cache invalidates the stored operation data with the assistance of the cluster frame frame listening controller. Specifically, how to invalidate the controller that can use the Cache by updating the status information of the storage address in the Tag RAM from the valid state to the invalid state. This achieves Cache consistency within the cluster. The Cache consistency is that the information content of the same operation data stored by different Caches is consistent.

当操作数据B在Cluster 0及Cluster N中各存储一个副本时,具体是存储在Cluster 0中CPU 0对应的L1Cache中及Cluster N对应的CPU N对应的L1Cache中。查询到Cluster 0中CPU 0对应的L1Cache中存储有所述 操作数据B,对所述操作数据B进行写操作,同时在所述簇内缓存帧听控制器及所述簇间缓存侦听控制器的协助下,使Cluster N中CPU N对应的L1Cache无效掉其存储的操作数据。具体的如何无效可以采用Cache的控制器通过将Tag RAM中的存储地址进行无效,具体如擦除所述地址等类似的操作。这样就实现簇间的Cache一致性。When the operation data B stores one copy in each of the Cluster 0 and the Cluster N, it is stored in the L1Cache corresponding to the CPU 0 in the Cluster 0 and the L1Cache corresponding to the CPU N corresponding to the Cluster N. Query to store the L1Cache corresponding to CPU 0 in Cluster 0. The operation data B is written to the operation data B, and the L1Cache corresponding to the CPU N in the Cluster N is invalidated with the assistance of the intra-cluster frame frame listening controller and the inter-cluster buffer listening controller. Its stored operational data. Specifically, how to invalidate the controller that can use the Cache by invalidating the storage address in the Tag RAM, such as erasing the address and the like. This achieves Cache coherency between clusters.

再比如,当操作数据B在Cluster 0中存储有两个副本,分别是位于CPU0对应的L1Cache中和CPU N对应的L1Cache中,其中,所述N为不小1的整数;在执行一致性访问时,查询到CPU 0对应的L1Cache中存储有所述操作数据B,对所述操作数据B进行写操作,同时在所述簇内缓存帧听控制器的协助下,使所述CPU N对应的L1Cache无效掉其存储的操作数据。具体的如何无效可以采用Cache的控制器通过将Tag RAM中的存储地址进行无效,具体如擦除所述地址等类似的操作。这样就实现簇内的Cache一致性。For example, when the operation data B is stored in the Cluster 0, there are two copies, which are respectively located in the L1Cache corresponding to the CPU0 and the L1Cache corresponding to the CPU N, wherein the N is an integer that is not less than one; The operating data B is stored in the L1Cache corresponding to the CPU 0, and the operation data B is written, and the CPU N is correspondingly assisted by the buffered frame listening controller in the cluster. L1Cache invalidates its stored operational data. Specifically, how to invalidate the controller that can use the Cache by invalidating the storage address in the Tag RAM, such as erasing the address and the like. This achieves Cache consistency within the cluster.

同样的所述二级Cache在其自身查找到操作数据B,响应所述写请求时,同样的将在所述簇间缓存侦听控制器的协助下,使其他簇内的操作数据B无效。Similarly, when the secondary cache finds the operation data B itself, in response to the write request, the operation data B in the other clusters will be invalidated with the assistance of the inter-cluster cache listening controller.

在本实施例中如何触发Cache无效其内部的操作数据的副本,可以参见现有技术在此就不再一一详细阐述了。How to trigger the Cache to invalidate the copy of the internal operation data in the embodiment can be omitted from the prior art.

所述写访问包括对操作数据进行删除、在所述操作数据中添加新的内容以及对所述操作数据中的内容进行替换修改的操作。The write access includes an operation of deleting operation data, adding new content to the operation data, and performing replacement modification on the content in the operation data.

本实施出所述的系统在进行一致性访问响应时,首先由一级Cache进行查询处理,并依据查询结果进行响应,再有二级Cache进行查询和响应,在不修改现有技术中保持簇内Cache一致性的基础上,实现了簇间的Cache一致性,与现有技术的兼容性强。When performing the consistent access response, the system described in the present embodiment first performs query processing by the primary cache, and responds according to the query result, and then has a secondary cache to perform query and response, and maintains the cluster without modifying the prior art. On the basis of the internal cache consistency, the Cache consistency between the clusters is realized, and the compatibility with the prior art is strong.

当所述一致性访问为读访问时,所述一级Cache,配置为在查询到所述 操作数据后对所述操作数据执行读操作;When the consistent access is a read access, the primary cache is configured to query the Performing a read operation on the operation data after operating the data;

当所述一致性访问为写访问时,所述二级Cache,配置为在查询到所述操作数据之后对所述操作数据进行读操作。When the consistent access is a write access, the secondary cache is configured to perform a read operation on the operational data after querying the operational data.

由于一致性访问为读访问,不会对一致性访问对应的操作数据进行修改、添加以及删除等动作,不会产生新的操作数据,从而无需无效操作数据的动作。Since the consistent access is a read access, the operation data corresponding to the consistent access is not modified, added, and deleted, and new operation data is not generated, so that the action of invalidating the data is not required.

在本实施例中可以通过能够实现一致性访问的L2Cache、簇间缓存侦听控制器的引入,实现了系统中簇与簇之间Cache的一致性,避免了簇与簇之间数据不一致导致的数据处理错误的几率。In this embodiment, the L2Cache and the inter-cluster cache snooping controller that can implement consistent access can implement the consistency of the Cache between the cluster and the cluster in the system, and avoid the data inconsistency between the cluster and the cluster. The probability of data processing errors.

实施例三:Embodiment 3:

如图4所示,本实施例提供一种L2Cache一致性实现方法,所述方法包括:As shown in FIG. 4, this embodiment provides a method for implementing L2Cache consistency, where the method includes:

步骤S110:接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问;Step S110: Receive a consistent access indication signal and access, and determine that the access is a consistent access when receiving the consistent access indication signal;

步骤S120:依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息;Step S120: classify the access according to the consistent access indication signal and the access, and form indication information according to the classification result;

步骤S130:依据所述指示信息查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;在未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问;此处的所述外设是相对于L2Cache而言的,所述外设可为三级Cache或RAM等。Step S130: Query operation data according to the indication information, perform a consistency operation according to the indication information after querying the operation data, and output the foregoing to the peripheral device according to the indication information when the operation data is not queried The consistent access indication signal and the consistent access; the peripherals herein are relative to the L2Cache, and the peripherals may be a three-level cache or RAM.

步骤S140:当所述访问需要将所述操作数据输出到外部存储器时,则在查询到所述操作数据后,依据所述指示信息将所述操作数据输出到外部存储器。Step S140: When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information.

本实施例所述的方法应用于实施例一中所述的L2Cache中,具体提供 了L2Cache如响应一致性访问的实现方法,具有实现简便的优点。The method described in this embodiment is applied to the L2Cache described in Embodiment 1, and is specifically provided. L2Cache has the advantage of simple implementation, such as the implementation method of responding to consistent access.

可选地,所述一致性访问指示信号包括一致性访问类型指示信号;Optionally, the consistent access indication signal includes a consistent access type indication signal;

所述步骤S110包括:接收所述一致性访问类型指示信号,依据所述一致性类型指示信号确定所述访问为一致性访问。此处进一步限定了如何确定所述访问为一致性访问。The step S110 includes: receiving the consistent access type indication signal, and determining, according to the consistency type indication signal, that the access is a consistent access. It is further defined herein how to determine that the access is a consistent access.

可选地,所述L2Cache包括Slave接口;所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;Optionally, the L2Cache includes a Slave interface; the Slave interface includes a first read address channel, a first read data channel, and a first write address channel;

所述一致性访问指示信号还包括所述一致性访问全局信号;The consistent access indication signal further includes the consistent access global signal;

所述步骤S110包括:The step S110 includes:

接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问;Receiving the consistent access global signal, and forming a slave interface control signal according to the consistent access global signal, and driving each of the channels in the Slave interface to receive the consistent access according to the slave interface control signal;

通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal;

所述步骤S110还包括以下至少其中之一:The step S110 further includes at least one of the following:

通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal;

通过所述第一读数据通道依据所述查询结果向请求源发送读响应信号;Transmitting, by the first read data channel, a read response signal to the request source according to the query result;

通过所述第一写地址通道接收一致性访问的外部存储器更新信号。An external memory update signal for consistent access is received through the first write address channel.

本实施例进一步限定了所述slave中各个通道是如何响应所述一致性访问的。所述Slave接口为5通道的接口,在具体的实现过程中,所述Slave接口还包括第一写响应通道及第一写数据通道。This embodiment further defines how each channel in the slave responds to the consistent access. The slave interface is a 5-channel interface. In a specific implementation process, the slave interface further includes a first write response channel and a first write data channel.

可选地,所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。Optionally, the consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source of the consistent access.

所述步骤S110包括接收的所述一致性访问全局信号,所述步骤S120中包括依据所述一致性访问全局信号进行分类,形成指示信息。 The step S110 includes the received consistent access global signal, and the step S120 includes performing classification according to the consistent access global signal to form indication information.

可选地,所述L2Cache包括Master接口;所述Master接口包括第二读地址通道、第二读数据通道及第二写地址通道;Optionally, the L2Cache includes a master interface, and the master interface includes a second read address channel, a second read data channel, and a second write address channel.

所述步骤S130具体包括:通过所述第二读地址通道在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;The step S130 specifically includes: outputting the consistent access indication signal when the operation data is not queried in the RAM through the second read address channel;

所述方法还包括:The method further includes:

通过所述第二读数据通道接收读响应信号及侦听响应信号;Receiving a read response signal and a sounding response signal through the second read data channel;

通过所述第二写地址通道输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。And outputting, by the second write address channel, the operation data to the external memory and invalidating the indication signal of the operation data in the Cache.

所述读响应信号通常为来自下游处理结构的信号;所述下游处理结构如memory等。所述侦听响应信号来自实施例二中所述的簇间侦听控制器或簇内侦听控制器等。The read response signal is typically a signal from a downstream processing structure; the downstream processing structure is such as memory or the like. The intercept response signal is from the inter-cluster listening controller or the intra-cluster listening controller described in the second embodiment.

可选地,在步骤S110中接收到所述一致性访问指示信号后,所述方法还包括:Optionally, after the consistent access indication signal is received in step S110, the method further includes:

存储访问类型、在其他Cache中的查询状态、在L2Cache中的查询状态及所述一致性访问的请求源,用于为查询所述操作数据及实现Cache一致性提供依据信息。The storage access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access are used to provide basis information for querying the operation data and implementing Cache consistency.

所述访问类型、在其他Cache中的查询状态、在L2Cache中的查询状态及所述一致性访问的请求源都可以是访问及所述一致性访问指示信号中获得的。在具体的实现过程中,所述Slave接口解析所述访问及所述一致性访问指示信号,并将所述信息存储在buffer中,便于所述控制器根据所述信息执行所述一致性访问操作。The access type, the query status in other Caches, the query status in the L2Cache, and the request source of the consistent access may all be obtained in the access and the consistent access indication signal. In a specific implementation process, the slave interface parses the access and the consistent access indication signal, and stores the information in a buffer, so that the controller performs the consistent access operation according to the information. .

可选地,所述方法还包括:Optionally, the method further includes:

在L2Cache中未查询到所述操作数据时,形成并存储无效失败信息,依据所述无效失败信息通知向所述请求源。When the operation data is not queried in the L2Cache, invalid failure information is formed and stored, and the request source is notified according to the invalid failure information.

本实施例还进一步规定了L2Cache如何向请求源反馈存储无效失败信 息,以便于所述请求源进行后续处理操作。This embodiment further specifies how the L2Cache feeds back the invalidation failure letter to the request source. In order to facilitate the subsequent processing operations of the request source.

可选地,所述Slave接口包括控制模块;所述RAM包括Data RAM以及Tag RAM;所述Data RAM用于存储操作数据;所述Data RAM包括若干个所述cache存储单元;所述Tag RAM用于存储所述操作数据的存储地址及所述cache存储单元的状态信息。Optionally, the slave interface includes a control module; the RAM includes a data RAM and a Tag RAM; the data RAM is used to store operation data; the data RAM includes a plurality of the cache storage units; and the Tag RAM is used. And storing a storage address of the operation data and status information of the cache storage unit.

所述步骤S130包括以下至少其中之一:The step S130 includes at least one of the following:

通过所述控制器,依据所述指示信息,读取Tag RAM并依据Tag RAM的结果查询更新所述状态信息,读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述状态信息,读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器,读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器,读取Tag RAM,及读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述状态信息。Reading, by the controller, the Tag RAM according to the indication information, and updating the status information according to the result of the Tag RAM, reading the Tag RAM, and querying the Data RAM according to the result of the Tag RAM and querying the operation data. Returning to the processor and updating the status information, reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor, reading the Tag RAM and querying the result according to the result of the Tag RAM Data RAM and return the queried operation data to the processor and write the operation data to the external memory, read the Tag RAM, and read the Tag RAM and query the Data RAM according to the result of the Tag RAM and query the operation data. Write to the external memory and update the status information.

在本实施例中所述控制器相对于现有的L2Cache新增了控制器,具体提供如何所述L2Cache实现一致性访问的控制逻辑,具有实现简单的优点。In this embodiment, the controller adds a controller to the existing L2Cache, and specifically provides control logic for how the L2Cache implements consistent access, which has the advantages of simple implementation.

可选地,所述步骤S140包括:Optionally, the step S140 includes:

依据所述指示信息,在所述Data RAM查询到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。And according to the indication information, when the data RAM queries the operation data and the status of the operation data is dirty, the operation data is output to the external memory through the master interface.

具体地,所述控制器包括:Tag Access fifo队列,用于在查询到所述操作数据后,存储是否要所述Tag RAM的更新信息及访问所述Data RAM的指示;Tag Write fifo队列,用于在查询到所述操作数据后且确定需要更新所述Tag RAM时,存储需要更新所述Tag RAM的操作信息,以保证更新Tag RAM的一致性访问按访问发起的顺序返回;Data read fifo队列,用于 在查询到所述操作数据后,存储需要更新所述Tag RAM且读取Data RAM的操作信息,以保证Tag RAM的更新是在数据读取之后执行的;控制单元,用于依据所述Tag Access fifo队列、Tag Write fifo队列及Data read fifo队列执行所述一致性操作。Specifically, the controller includes: a Tag Access fifo queue, configured to store, after querying the operation data, an update information of the Tag RAM and an indication of accessing the Data RAM; a Tag Write fifo queue, After the operation data is queried and it is determined that the Tag RAM needs to be updated, the operation information of the Tag RAM needs to be updated to ensure that the consistent access of the updated Tag RAM is returned in the order in which the access is initiated; the Data read fifo queue For After querying the operation data, storing operation information that needs to update the Tag RAM and reading the Data RAM to ensure that the update of the Tag RAM is performed after the data is read; the control unit is configured to use the Tag Access according to the Tag Access The fifo queue, the Tag Write fifo queue, and the Data read fifo queue perform the consistency operation.

所述控制器具体利用上述先进先出的fifo来控制所述L2Cache实现一致性访问。The controller specifically uses the above-mentioned first-in-first-out fifo to control the L2Cache to implement consistent access.

可选地,所述方法还包括:Optionally, the method further includes:

通过控制单元进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。所述冲突访问包括如对同一cache存储单元的读操作和写操作The access conflict detection is performed by the control unit, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict. The conflicting access includes, for example, a read operation and a write operation to the same cache storage unit.

本实施例所述方法是在实施例一中所述的L2Cache的基础上提出的方法,能够实现L2Cache与其他Cache的Cache一致性,包括簇内Cache一致性和簇间Cache的一致性。The method in this embodiment is based on the L2Cache described in the first embodiment, and can implement the Cache consistency between the L2Cache and other Caches, including the consistency of the Cache in the cluster and the consistency of the Cache between the clusters.

实施例四:Embodiment 4:

本实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行实施例三所述方法的至少其中之一,具体如图4所示的方法。所述计算机存储介质可为U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质;在一些实施例中,所述计算机存储介质为非瞬间存储介质。The embodiment further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, where the computer executable instructions are used to perform at least one of the methods described in the third embodiment, specifically as shown in FIG. The method shown. The computer storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program code. In some embodiments, the computer storage medium is a non-transitory storage medium.

在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各 组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed. In addition, each shown or discussed The coupling, or direct coupling, or communication connection of the components to each other may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or other.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本发明各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing storage device includes the following steps: the foregoing storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A medium that can store program code.

以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。 The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Modifications made in accordance with the principles of the invention are understood to fall within the scope of the invention.

Claims (25)

一种二级独立高速缓存器L2 Cache,所述L2 Cache包括Slave接口、控制器、Master接口以及RAM;A two-level independent cache L2 Cache, the L2 Cache includes a Slave interface, a controller, a Master interface, and a RAM; 所述Slave接口,配置为接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,及依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息;The slave interface is configured to receive a consistent access indication signal and access, and when the consistent access indication signal is received, determine that the access is a consistent access, and according to the consistent access indication signal and the access Access to classify and form indication information according to the classification result; 所述控制器,配置为接收所述指示信息,依据所述指示信息在所述RAM中查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;The controller is configured to receive the indication information, query operation data in the RAM according to the indication information, and perform a consistency operation according to the indication information after querying the operation data; 所述Master接口,配置为在所述RAM中未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问,及在查询到所述操作数据后依据所述指示信息将所述操作数据输出到外部存储器。The master interface is configured to output the consistent access indication signal and the consistent access to the peripheral device according to the indication information when the operation data is not queried in the RAM, and query the operation The data is then output to the external memory in accordance with the indication information. 根据权利要求1所述的L2 Cache,其中,The L2 Cache according to claim 1, wherein 所述一致性访问指示信号包括一致性访问类型指示信号;The consistent access indication signal includes a consistent access type indication signal; 所述Slave接口,配置为接收所述一致性访问类型指示信号,依据所述一致性访问类型指示信号确定所述访问为一致性访问。The slave interface is configured to receive the consistent access type indication signal, and determine, according to the consistent access type indication signal, that the access is a consistent access. 根据权利要求2所述的L2 Cache,其中,The L2 Cache according to claim 2, wherein 所述一致性访问指示信号还包括所述一致性访问全局信号;The consistent access indication signal further includes the consistent access global signal; 所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;The slave interface includes a first read address channel, a first read data channel, and a first write address channel; 所述Slave接口,配置为接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问; The Slave interface is configured to receive the consistent access global signal, generate a slave interface control signal according to the consistent access global signal, and drive each of the channel receiving stations in the Slave interface according to the Slave interface control signal. Consistent access 所述第一读地址通道,配置为接收所述一致性访问类型指示信号;The first read address channel is configured to receive the consistent access type indication signal; 所述第一读数据通道,配置为依据所述查询结果向请求源发送读响应信号;The first read data channel is configured to send a read response signal to the request source according to the query result; 所述第一写地址通道,配置为接收一致性访问的外部存储器更新信号。The first write address channel is configured to receive an external memory update signal for consistent access. 根据权利要求3所述的L2 Cache,其中,The L2 Cache according to claim 3, wherein 所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。The consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access. 根据权利要求1所述的L2 Cache,其中,The L2 Cache according to claim 1, wherein 所述Master接口包括第二读地址通道、第二读数据通道及第二写地址通道;The master interface includes a second read address channel, a second read data channel, and a second write address channel; 所述第二读地址通道,配置为在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;The second read address channel is configured to output the consistent access indication signal when the operation data is not queried in the RAM; 所述第二读数据通道,配置为接收读响应信号及侦听响应信号;The second read data channel is configured to receive a read response signal and a listening response signal; 所述第二写地址通道,配置为输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。The second write address channel is configured to output an indication signal that writes the operation data to an external memory and invalidates the operation data in the cache. 根据权利要求1所述的L2 Cache,其中,The L2 Cache according to claim 1, wherein 所述L2 Cache还包括:The L2 Cache further includes: 第一缓冲区,配置为存储访问类型、在其他Cache中的查询状态、在所述L2 Cache中的查询状态及所述一致性访问的请求源,为查询所述操作数据及实现Cache一致性提供依据信息。The first buffer is configured to store an access type, a query status in another Cache, a query status in the L2 Cache, and a request source of the consistent access, to query the operation data and implement Cache consistency. Based on information. 根据权利要求6所述的L2 Cache,其中,The L2 Cache according to claim 6, wherein 所第一述缓冲区,还配置为存储无效失败信息,依据所述无效失败信息通知向所述请求源。The first buffer is further configured to store invalid failure information, and notify the request source according to the invalid failure information. 根据权利要求1所述的L2 Cache,其中,The L2 Cache according to claim 1, wherein 所述RAM包括Data RAM以及Tag RAM;所述Data RAM配置为存储 操作数据;所述Data RAM包括若干个所述cache存储单元;所述Tag RAM配置为存储操作数据的存储地址及所述cache存储单元的状态信息;The RAM includes a Data RAM and a Tag RAM; the Data RAM is configured to be stored Operating data; the Data RAM includes a plurality of the cache storage units; the Tag RAM is configured to store a storage address of the operation data and status information of the cache storage unit; 所述控制器,配置为依据所述指示信息,The controller is configured to follow the indication information, 读取Tag RAM并依据Tag RAM的结果查询更新所述Tag RAM,Read the Tag RAM and update the Tag RAM according to the result of the Tag RAM. or 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述Tag RAM,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and updating the Tag RAM. or 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor. or 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器,Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and writing the operation data to the external memory, or 读取Tag RAM,Read the Tag RAM, or 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述Tag RAM;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and writing the queried operation data to the external memory and updating the Tag RAM; 其中,更新所述Tag RAM包括更新操作地址及所述状态信息的至少其中之一。The updating the Tag RAM includes at least one of an update operation address and the status information. 根据权利要求8所述的L2 Cache,其中,The L2 Cache according to claim 8, wherein 所述控制器,还配置为依据所述指示信息,The controller is further configured to: according to the indication information, 在所述Data RAM查询到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。When the data RAM queries the operation data and the status of the operation data is dirty, the operation data is output to the external memory through the master interface. 根据权利要求8所述的L2 Cache,其中, The L2 Cache according to claim 8, wherein 所述控制器包括:The controller includes: Tag Access fifo队列,配置为在查询到所述操作数据后,存储是否要更新所述Tag RAM的信息及访问所述Data RAM的指示;a Tag Access fifo queue, configured to store, after querying the operation data, whether to update information of the Tag RAM and an indication of accessing the Data RAM; Tag Write fifo队列,配置为在查询到所述操作数据后且确定需要更新所述Tag RAM时,存储需要更新所述Tag RAM的操作信息;a Tag Write fifo queue, configured to store operation information that needs to update the Tag RAM after querying the operation data and determining that the Tag RAM needs to be updated; Data read fifo队列,配置为在查询到所述操作数据后,存储需要更新所述Tag RAM且读取Data RAM的操作信息;a data read fifo queue, configured to store, after querying the operation data, operation information that needs to update the Tag RAM and read the Data RAM; 控制单元,配置为依据所述Tag Access fifo队列、Tag Write fifo队列及Data read fifo队列执行所述一致性操作。The control unit is configured to perform the consistency operation according to the Tag Access fifo queue, the Tag Write fifo queue, and the Data read fifo queue. 根据权利要求1所述的L2 Cache,其中,The L2 Cache according to claim 1, wherein 所述控制器包括控制单元;The controller includes a control unit; 所述控制单元,配置为进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。The control unit is configured to perform an access collision detection, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict. 一种数据处理系统,其中,A data processing system, wherein 所述系统包括至少一个簇;The system includes at least one cluster; 所述簇包括至少两个处理器、簇内帧听控制器以及上述权利要求1至9任一项所述的L2 Cache;其中,每一个所述处理器都集成设置有一个L1Cache;The cluster includes at least two processors, an intra-cluster frame listening controller, and the L2 Cache according to any one of claims 1 to 9; wherein each of the processors is integrally provided with an L1Cache; 所述簇内帧听控制器,分别与所述L1Cache及所述L2 Cache相连,配置为侦听一致性访问,协助任一两个所述L1Cache以及所述L1Cache与所述L2 Cache之间实现Cache一致性。The in-cluster frame listening controller is respectively connected to the L1Cache and the L2 Cache, configured to listen for consistent access, and assist any two of the L1Cache and the L1Cache and the L2 Cache to implement a Cache consistency. 根据权利要求12所述的系统,其中,The system of claim 12, wherein 所述系统还包括簇间帧听控制器;The system also includes an inter-cluster frame listening controller; 所述簇间帧听控制器,与所述L2 Cache相连,配置为侦听一致性访问,协助实现簇之间的Cache一致性。 The inter-cluster frame listening controller is connected to the L2 Cache and configured to listen for consistent access, and assists in implementing Cache consistency between the clusters. 根据权利要求13所述的系统,其中,The system of claim 13 wherein 所L1Cache,配置为当接收一致性访问在所述L1Cache中查询所述一致性访问对应的操作数据;当所述L1Cache查询到所述操作数据时,响应所述一致性访问,同时在所述簇内缓存帧听控制器的协助下实现所述L1Cache所在簇的Cache一致性,并在所述簇间缓存帧听控制器的协助下实现簇间的Cache的一致性;The L1Cache is configured to query, in the L1Cache, the operation data corresponding to the consistent access when receiving the consistent access; when the L1Cache queries the operation data, respond to the consistent access while in the cluster The Cache consistency of the cluster where the L1Cache is located is implemented with the assistance of the internal cache frame listening controller, and the consistency of the Cache between the clusters is realized with the assistance of the inter-cluster cache frame listening controller. 所述簇内缓存帧听控制器,配置为在本簇内所述L1Cache中未查询到所述操作数据时,向所述L2 Cache发送所述一致性访问;The in-cluster cache frame listening controller is configured to send the consistent access to the L2 Cache when the operation data is not queried in the L1Cache in the cluster; 所述L2 Cache,配置为在本簇所述L1Cache中未查询到一致性访问对应的操作数据时,接收所述一致性访问及其他簇发送的一致性访问,查询所述L2 Cache中是否存储有所述操作数据,当所述L2 Cache未查询到所述一致性访问对应的操作数据时,通过所述簇间缓存帧听控制器到所述L2Cache所在簇以外的其他簇中查询所述操作数据,在查询到所述操作数据后响应所述一致性访问,并在所述簇间缓存帧听控制器协助下实现簇间的Cache一致性。The L2 Cache is configured to receive the consistent access and the consistent access sent by other clusters when the operation data corresponding to the consistent access is not queried in the L1Cache of the cluster, and query whether the L2 Cache stores the L2 Cache. The operating data, when the L2 Cache does not query the operation data corresponding to the consistent access, querying the operation data by using the inter-cluster cache frame listening controller to other clusters other than the cluster where the L2Cache is located. And responding to the consistent access after querying the operation data, and implementing Cache consistency between the clusters with the assistance of the inter-cluster cache frame listening controller. 一种L2 Cache一致性实现方法,所述方法包括:An L2 Cache consistency implementation method, the method comprising: 接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问;Receiving a consistent access indication signal and access, and determining that the access is a consistent access when receiving the consistent access indication signal; 依据一致性访问指示信号及所述访问对所述访问进行分类,依据分类结果形成指示信息;And classifying the access according to the consistent access indication signal and the access, and forming indication information according to the classification result; 依据所述指示信息查询操作数据,在查询到所述操作数据后依据所述指示信息执行一致性操作;在未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问;Querying the operation data according to the indication information, performing a consistency operation according to the indication information after querying the operation data; and when the operation data is not queried, outputting the consistency access to the peripheral device according to the indication information Indication signal and the consistent access; 当所述访问需要将所述操作数据输出到外部存储器时,则在查询到所述操作数据后,依据所述指示信息将所述操作数据输出到外部存储器。 When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 所述一致性访问指示信号包括一致性访问类型指示信号;The consistent access indication signal includes a consistent access type indication signal; 所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,包括:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, including: 接收所述一致性访问类型指示信号,依据所述一致性类型指示信号确定所述访问为一致性访问。Receiving the consistent access type indication signal, and determining, according to the consistency type indication signal, that the access is a consistent access. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 所述L2 Cache包括Slave接口;所述Slave接口包括第一读地址通道、第一读数据通道及第一写地址通道;The L2 Cache includes a Slave interface; the Slave interface includes a first read address channel, a first read data channel, and a first write address channel; 所述一致性访问指示信号还包括所述一致性访问全局信号;The consistent access indication signal further includes the consistent access global signal; 所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,包括:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, including: 接收所述一致性访问全局信号,依据所述一致性访问全局信号驱动形成Slave接口控制信号,依据所述Slave接口控制信号驱动所述Slave接口内各个所述通道接收所述一致性访问;Receiving the consistent access global signal, and forming a slave interface control signal according to the consistent access global signal, and driving each of the channels in the Slave interface to receive the consistent access according to the slave interface control signal; 通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal; 所述接收一致性访问指示信号及访问,当接收到所述一致性访问指示信号时确定所述访问为一致性访问,还包括以下至少其中之一:Receiving the consistent access indication signal and the access, when the consistent access indication signal is received, determining that the access is a consistent access, and further comprising at least one of the following: 通过所述第一读地址通道接收所述一致性访问类型指示信号;Receiving, by the first read address channel, the consistent access type indication signal; 通过所述第一读数据通道依据所述查询结果向请求源发送读响应信号;Transmitting, by the first read data channel, a read response signal to the request source according to the query result; 通过所述第一写地址通道接收一致性访问的外部存储器更新信号。An external memory update signal for consistent access is received through the first write address channel. 根据权利要求17所述的方法,其中,The method of claim 17, wherein 所述一致性访问全局信号包括所述一致性访问的操作数据在其他Cache中的查询状态以及所述一致性访问的请求源。 The consistent access global signal includes a query status of the consistently accessed operational data in other Caches and a request source for the consistent access. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 所述L2 Cache包括Master接口;所述Master接口包括第二读地址通道、第二读数据通道及第二写地址通道;The L2 Cache includes a Master interface, and the Master interface includes a second read address channel, a second read data channel, and a second write address channel. 所述在未查询所述操作数据时,依据所述指示信息向外设输出所述一致性访问指示信号及所述一致性访问,包括:And outputting the consistent access indication signal and the consistent access to the peripheral device according to the indication information, when the operation data is not queried, including: 通过所述第二读地址通道在所述RAM中未查询所述操作数据时,输出所述一致性访问指示信号;Outputting the consistent access indication signal when the operation data is not queried in the RAM through the second read address channel; 所述方法还包括:The method further includes: 通过所述第二读数据通道接收读响应信号及侦听响应信号;Receiving a read response signal and a sounding response signal through the second read data channel; 通过所述第二写地址通道输出将所述操作数据写到外部存储器并无效Cache内所述操作数据的指示信号。And outputting, by the second write address channel, the operation data to the external memory and invalidating the indication signal of the operation data in the Cache. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 在接收到所述一致性访问指示信号后,所述方法还包括:After receiving the consistent access indication signal, the method further includes: 存储访问类型、在其他Cache中的查询状态、在L2 Cache中的查询状态及所述一致性访问的请求源,用于为查询所述操作数据及实现Cache一致性提供依据信息。The storage access type, the query status in other Caches, the query status in the L2 Cache, and the request source of the consistent access are used to provide basis information for querying the operation data and implementing Cache consistency. 根据权利要求20所述的方法,其中,The method of claim 20, wherein 所述方法还包括:The method further includes: 在L2 Cache中未查询到所述操作数据时,形成并存储无效失败信息,依据所述无效失败信息通知向所述请求源。When the operation data is not queried in the L2 Cache, invalid failure information is formed and stored, and the request source is notified according to the invalid failure information. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 所述Slave接口包括控制模块;所述RAM包括Data RAM以及Tag RAM;所述Data RAM用于存储操作数据;所述Tag RAM用于存储所述操作数据的存储地址及cache存储单元的状态信息;The slave interface includes a control module; the RAM includes a data RAM and a Tag RAM; the data RAM is used to store operation data; the Tag RAM is used to store a storage address of the operation data and state information of a cache storage unit; 所述依据所述指示信息查询操作数据,在查询到所述操作数据后依据 所述指示信息执行一致性操作包括以下至少其中之一:The querying the operation data according to the indication information, after querying the operation data, The indicating information performing the consistency operation includes at least one of the following: 通过所述控制模块,依据所述指示信息,读取Tag RAM并依据Tag RAM的结果查询更新所述状态信息通;Reading, by the control module, the Tag RAM according to the indication information, and querying and updating the status information according to the result of the Tag RAM; 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器及更新所述状态信息;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and updating the status information; 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor; 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据返回给处理器并将所述操作数据写到外部存储器;Reading the Tag RAM and querying the Data RAM according to the result of the Tag RAM and returning the queried operation data to the processor and writing the operation data to the external memory; 读取Tag RAM;及Read Tag RAM; and 读取Tag RAM并依据Tag RAM的结果查询所述Data RAM且将查询的操作数据写到外部存储器及更新所述状态信息。The Tag RAM is read and the Data RAM is queried according to the result of the Tag RAM and the queried operation data is written to the external memory and the status information is updated. 根据权利要求22所述的方法,其中,The method of claim 22, wherein 所述当所述访问需要将所述操作数据输出到外部存储器时,则在查询到所述操作数据后,依据所述指示信息将所述操作数据输出到外部存储器,包括:When the access needs to output the operation data to the external memory, after the operation data is queried, the operation data is output to the external memory according to the indication information, including: 依据所述指示信息,在所述Data RAM查询到所述操作数据且所述操作数据的状态为dirty时,将所述操作数据通过所述master接口输出到外部存储器。And according to the indication information, when the data RAM queries the operation data and the status of the operation data is dirty, the operation data is output to the external memory through the master interface. 根据权利要求15所述的方法,其中,The method of claim 15 wherein 所述方法还包括:The method further includes: 通过控制单元进行访问冲突检测,在检测到冲突访问时,采用阻塞机制对访问冲突进行处理。The access conflict detection is performed by the control unit, and when the conflicting access is detected, the blocking mechanism is used to process the access conflict. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求15至24所述方法的至 少其中之一。 A computer storage medium having stored therein computer executable instructions for performing the method of claims 15-24 One of them is less.
PCT/CN2015/073046 2014-09-04 2015-02-13 L2 cache and implementation method of consistency thereof, system and storage medium Ceased WO2016033949A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410448635.8A CN105468540B (en) 2014-09-04 2014-09-04 L2 Cache and its consistency implementation method and data processing system
CN201410448635.8 2014-09-04

Publications (1)

Publication Number Publication Date
WO2016033949A1 true WO2016033949A1 (en) 2016-03-10

Family

ID=55439078

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073046 Ceased WO2016033949A1 (en) 2014-09-04 2015-02-13 L2 cache and implementation method of consistency thereof, system and storage medium

Country Status (2)

Country Link
CN (1) CN105468540B (en)
WO (1) WO2016033949A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083548A (en) * 2018-01-26 2019-08-02 华为技术有限公司 Data processing method and related network elements, equipment, system
CN112395244A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118939595A (en) * 2024-09-29 2024-11-12 芯来智融半导体科技(上海)有限公司 Multi-core consistent ICB bus transmission method, system, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354682A (en) * 2008-09-12 2009-01-28 中国科学院计算技术研究所 A device and method for solving multiprocessor access directory conflicts
CN101430664A (en) * 2008-09-12 2009-05-13 中国科学院计算技术研究所 Multiprocessor system and Cache consistency message transmission method
US20140164700A1 (en) * 2012-12-10 2014-06-12 Facebook, Inc. System and method of detecting cache inconsistencies

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354682A (en) * 2008-09-12 2009-01-28 中国科学院计算技术研究所 A device and method for solving multiprocessor access directory conflicts
CN101430664A (en) * 2008-09-12 2009-05-13 中国科学院计算技术研究所 Multiprocessor system and Cache consistency message transmission method
US20140164700A1 (en) * 2012-12-10 2014-06-12 Facebook, Inc. System and method of detecting cache inconsistencies

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083548A (en) * 2018-01-26 2019-08-02 华为技术有限公司 Data processing method and related network elements, equipment, system
CN110083548B (en) * 2018-01-26 2023-01-13 华为技术有限公司 Data processing method and related network element, equipment and system
CN112395244A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method

Also Published As

Publication number Publication date
CN105468540A (en) 2016-04-06
CN105468540B (en) 2019-11-15

Similar Documents

Publication Publication Date Title
CN105900076B (en) Data processing system and method for processing multiple transactions
US7941584B2 (en) Data processing apparatus and method for performing hazard detection
US8838907B2 (en) Notification protocol based endpoint caching of host memory
US9170946B2 (en) Directory cache supporting non-atomic input/output operations
CN104106061B (en) Multiprocessor data processing system and method, cache memory and processing unit therein
CN105095254B (en) A method and device for realizing data consistency
EP4124963B1 (en) System, apparatus and methods for handling consistent memory transactions according to a cxl protocol
US10423354B2 (en) Selective data copying between memory modules
US8423736B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
TW201537454A (en) Method and processor for processing data
CN102567255A (en) Data processing system having selective invalidation of snoop requests and method thereof
CN112612725B (en) Apparatus and method for handling cache maintenance operations
CN112074822A (en) Data processing network with stream compression for streaming data transmission
CN108536473A (en) The method and apparatus for reading data
CN116601613A (en) Data placement with grouping metadata
KR20240112266A (en) Marshallese data consistency
US7089376B2 (en) Reducing snoop response time for snoopers without copies of requested data via snoop filtering
CN105468540B (en) L2 Cache and its consistency implementation method and data processing system
US20070061519A1 (en) Early return indication for read exclusive requests in shared memory architecture
CN105103139B (en) Method and apparatus for improving the performance across the semaphore supervisory sequence of coherent bus
US20180189181A1 (en) Data read method and apparatus
US9183149B2 (en) Multiprocessor system and method for managing cache memory thereof
JP2006260159A (en) Information processing apparatus and data control method in information processing apparatus
CN110232030A (en) Multichip system and method for caching and processing
US11803470B2 (en) Multi-level cache coherency protocol for cache line evictions

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15837802

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15837802

Country of ref document: EP

Kind code of ref document: A1