Coherency Manager

By introducing a coherence manager into the computing system and using the reverse conversion module and the listening processor to manage listening requests, the problem of low data coherence management efficiency in a multi-processor environment is solved, and more efficient data access and system performance are achieved. .

CN110209599BActive Publication Date: 2024-08-30IMAGINATION TECH LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201910142332.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-02-26
Publication Date
2024-08-30
Estimated Expiration
2039-02-26

AI Technical Summary

Technical Problem

In modern computing systems, data coherence management in multi-processor environments is difficult to handle efficiently, resulting in increased system latency. Especially when monitoring requests involve virtual address spaces, reverse address translation takes a long time and affects system performance.

Method used

Design a coherence manager that includes a reverse translation module and a snoop processor. It receives snoop requests in the physical address space and determines virtual address mapping based on the reverse translation data structure to process snoop requests, including cache line status management and Response mechanism to ensure data consistency and efficiency.

Benefits of technology

It effectively reduces system latency, improves data access efficiency, and improves the performance of multi-processor systems by reducing the time-consuming reverse address translation and optimizing cache management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110209599B_ABST
    Figure CN110209599B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a coherence manager. A coherence manager for receiving a snoop request addressed in a physical address space, the snoop request being related to a cache memory addressable using a virtual address space, the cache memory having a plurality of coherent cache lines, the coherence manager comprising: a reverse translation module configured to maintain a mapping from a physical address to a virtual address for each coherent cache line held in the cache memory; and a snoop processor configured to: receive a snoop request related to a physical address; determine, in response to the received snoop request, whether the physical address is mapped to a virtual address in the reverse translation module; and process the snoop request according to the determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a coherency manager, and in particular to a coherency manager for receiving a snoop request addressed in a physical address space, wherein, for example, the snoop request relates to a cache memory addressable using a virtual address space. Background Art

[0002] Modern computing systems are expected to be able to process a variety of tasks and typically include multiple processors, such as a central processing unit (CPU) and a graphics processing unit (GPU). Each processor may be adapted to process a different processing task, but may operate on the same data stored in the main memory. For example, the results of a processing task of one processor may be used in another processor.

[0003] A separate cache may be associated with each processor. Each cache may store regularly or recently accessed data and help reduce the need to access main memory, which may otherwise increase latency. One processor is able to modify a data entry or cache line in its local cache, which may not be reflected (written back) to main memory. Therefore, the modified data entry is not immediately available to another processor. This may lead to data coherence issues.

[0004] Snoop requests can provide access to data stored at the coherent cache. However, this may result in multiple requests to the coherent cache from the bus, which may increase system latency.

[0005] An efficient method of managing data coherence is needed. Summary of the invention

[0006] This summary is provided to introduce some concepts in a simplified form that are further described in the detailed description below. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0007] According to aspects of the present disclosure, there is provided a coherence manager for receiving a snoop request addressed in a physical address space, the snoop request being related to a cache memory addressable using a virtual address space, the cache memory having a plurality of coherent cache lines, the coherence manager comprising: a reverse translation module configured to maintain a mapping from a physical address to a virtual address for each coherent cache line maintained in the cache memory; and a snoop processor configured to: receive a snoop request related to a physical address; determine, in response to the received snoop request, whether the physical address is mapped to a virtual address in the reverse translation module; and process the snoop request based on the determination.

[0008] Suitably, the reverse translation module comprises logic to calculate a virtual address from a physical address based on a known relationship between the physical address space and the virtual address space.

[0009] Suitably, the inverse translation module comprises an inverse translation data structure configured to maintain a mapping from the physical address space to the virtual address space. Suitably, the inverse translation data structure comprises a directory linking physical addresses in the physical address space to corresponding virtual addresses in the virtual address space.

[0010] Suitably, the coherency manager is configured to, upon determining that the inverse translation module does not comprise a mapping from the physical address to the virtual address space, cause the response to the snoop request to be sent without accessing the cache memory.

[0011] Suitably, the coherency manager is configured to, upon determining that the reverse translation module includes a mapping from a physical address to a virtual address space, access a cache line status data structure configured to store status information relating to the cache line at the cache memory, and cause a response to the snoop request to be sent based on the stored status information.

[0012] Suitably, in a case where state information relating to the cache line indicates that the cache line is at least one of: does not exist, is in an invalid state, is experiencing an overflow, and is undergoing writeback or eviction processing, the coherency manager is configured to determine that the snoop request results in a cache miss, and cause a corresponding response to the snoop request to be sent on the bus.

[0013] Suitably, the coherency manager is configured to handle snoop requests by accessing the cache.

[0014] Suitably, in the event that the state information relating to the cache line indicates that the cache line is present and in a clean state, the coherency manager is configured to cause the cache line to be evicted and the cache not to perform a write of the data at the cache line back to the main memory. Suitably, the coherency manager is configured to process the snoop request without accessing the cache.

[0015] Suitably, in the event that the state information relating to the cache line indicates that the cache line is present and in a dirty state, the coherency manager is configured to cause access to the cache to read the cache line in order to write the cache line back to the main memory and cause the cache line to be evicted from the cache. Suitably, the coherency manager is configured to queue the cache line for eviction and cause the eviction to proceed upon determining that the write back of the cache line to the main memory has been completed.

[0016] Suitably, the reverse translation data structure is configured to store data at a page granularity.

[0017] Suitably, the cache line state data structure is configured to store state information at cache line granularity.

[0018] Suitably, the cache line state data structure comprises a plurality of RAM instances, and the coherency manager is configured to access the plurality of RAM instances simultaneously.

[0019] Suitably, the cache line status data structure comprises an entry for at least one coherent cache line located at a page mapped by the inverse translation data structure Suitably, the cache line status data structure comprises a plurality of status bits in relation to the at least one coherent cache line.

[0020] Suitably, the snoop processor is configured to monitor a memory bus coupled to the coherency manager for read requests to the main memory and to cause updating of state information in the cache line state data structure in response to a monitored read request.

[0021] Suitably, the snoop processor comprises a buffer for storing received snoop requests. Suitably, the buffer comprises a first-in-first-out buffer. Suitably, the snoop processor is configured to process the snoop requests on the buffer in an order different from the order in which the snoop requests were received. Suitably, the snoop processor is configured to use the buffer to output responses to the snoop requests in an order corresponding to the order in which the snoop requests were received.

[0022] Suitably, the snoop processor comprises control logic for controlling at least one of access to a cache line state data structure, accessing the cache, sending commands to the cache, and issuing responses to snoop requests.

[0023] Suitably, the coherency manager is embodied in hardware on an integrated circuit.

[0024] According to another aspect of the present disclosure, a method for processing a snoop request addressed in a physical address space is provided, the snoop request being related to a cache memory having multiple coherent cache lines and addressable using a virtual address space, the method comprising: receiving a snoop request related to a physical address; determining whether the physical address is mapped to a virtual address based on a mapping from a physical address to a virtual address for each coherent cache line maintained in the cache memory; and processing the snoop request based on the determination.

[0025] Suitably, processing the snoop request comprises, upon determining that the physical address is not mapped to the virtual address, causing a response to the snoop request to be sent without accessing cache memory.

[0026] Suitably, processing the snoop request comprises, upon determining that the physical address is mapped to the virtual address, accessing a cache line status data structure configured to store status information relating to the cache line at the cache memory, and sending a response to the snoop request in accordance with the stored status information.

[0027] Suitably, where state information relating to the cache line indicates that the cache line is at least one of: does not exist, is in an invalid state, is experiencing an overflow, and is being written back or evicted, processing the snoop request further comprises determining that the snoop request results in a cache miss, and causing a corresponding response to the snoop request to be sent on the bus.

[0028] Suitably, processing the snoop request includes accessing a cache.

[0029] Suitably, in the event that the state information relating to the cache line indicates that the cache line exists and is in a clean state, the method further comprises causing the cache line to be evicted, and the cache does not perform writing of data at the cache line back to the main memory. Suitably, processing the snoop request comprises processing the snoop request without accessing the cache.

[0030] Suitably, in the event that the state information relating to the cache line indicates that the cache line is present and in a dirty state, the method further comprises causing access to the cache to read the cache line in order to write the cache line back to the main memory, and causing the cache line to be evicted from the cache. Suitably, the method further comprises queuing the cache line for eviction, and causing the eviction to proceed upon determining that the write back of the cache line to the main memory has been completed.

[0031] Suitably, the method further comprises monitoring the memory bus for read requests to the main memory and, in response to the monitored read requests, causing status information in the cache line status data structure to be updated.

[0032] Suitably, processing the snoop requests comprises processing the snoop requests in an order different from the order in which the snoop requests were received.

[0033] Suitably, processing the snoop requests comprises outputting responses to the snoop requests in an order corresponding to the order in which the snoop requests were received.

[0034] According to another aspect of the present disclosure, a method of manufacturing a coherency manager as described herein using an integrated circuit manufacturing system is provided.

[0035] According to another aspect of the present disclosure, an integrated circuit definition data set is provided that, when processed in an integrated circuit manufacturing system, configures the system to manufacture a coherency manager as described herein.

[0036] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is provided on which a computer-readable description of an integrated circuit is stored, which, when processed in an integrated circuit manufacturing system, enables the integrated circuit manufacturing system to manufacture a coherency manager as described herein.

[0037] According to another aspect of the present disclosure, an integrated circuit manufacturing system is provided, configured to manufacture the coherency manager as described herein.

[0038] According to another aspect of the present disclosure, an integrated circuit manufacturing system is provided, comprising: a non-transitory computer-readable storage medium having stored thereon a computer-readable integrated circuit description describing a coherence manager as described herein; a layout processing system configured to process the integrated circuit description to generate a circuit layout description of an integrated circuit embodying the coherence manager; and an integrated circuit generation system configured to manufacture the coherence manager based on the circuit layout description.

[0039] According to another aspect of the present disclosure, computer program code for executing the method as described herein is provided.

[0040] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed at a computer system, the computer system is caused to perform the method described herein.

[0041] Any one or more features of any aspect above can be combined with any one or more features of any other aspect above. Any device feature can be rewritten as a method feature, and necessary changes are made in the wording. These are not fully written out only for the sake of brevity. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The present invention will now be described by way of example with reference to the accompanying drawings. In the drawings:

[0043] Figure 1A A system including multiple processors and multiple caches is schematically shown;

[0044] Figure 1B A master-slave system is schematically shown;

[0045] Figure 2 A process for receiving a memory request is shown;

[0046] Figure 3 Another system including a plurality of processors and a plurality of caches is schematically illustrated;

[0047] Figure 4 Another system including a plurality of processors and a plurality of caches is schematically illustrated;

[0048] Figure 5 Schematically shows Figure 4 part of a system;

[0049] Fig. 6A A monitoring processor is schematically shown;

[0050] Figure 6B schematically illustrates example snoop buffer states;

[0051] Figure 7 schematically illustrates a reverse conversion data structure and a cache line status data structure;

[0052] Figure 8 Schematically illustrates example cache line states;

[0053] Fig. 9 schematically illustrates components of a memory interface;

[0054] Fig.10 Schematically illustrates the cache line status module architecture;

[0055] Fig.11 Another example of a cache line state is schematically shown;

[0056] Fig.12 The schematic diagram shows the cache bank interface architecture;

[0057] Fig.13 A process for receiving a memory transaction request is shown; and

[0058] Fig.14 It is a schematic diagram of the integrated circuit manufacturing system. DETAILED DESCRIPTION

[0059] The following description is presented by way of example to enable those skilled in the art to make and use the invention.The present invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be apparent to those skilled in the art.

[0060] Embodiments will now be described by way of example only.

[0061] A computing system such as computing system 100 includes a first processor 102, a first cache memory 104, and a main memory 114. The main memory 114 is adapted to store data longer term than the first cache memory 104. For example, the main memory 114 is less volatile than the first cache memory 104. The main memory 114 also typically has a much larger storage capacity than the first cache memory 104. The main memory 114 may be remote from the first processor 102. The first cache memory 104 is typically provided at the first processor 102, or adjacent to the first processor 102 in a data path so as to be between the first processor 102 and the main memory 114.

[0062] The data at the first cache memory and / or the main memory can be accessed, for example, by the first processor via a read transaction. The data can be written to the first cache memory and / or the main memory via a write transaction. For example, the data can be written to the first cache memory and / or the main memory by the first processor.

[0063] Cache 104 is configured to store data so that processor 102 can retrieve the data from cache 104 (and / or write modified data to cache 104) rather than needing to retrieve the data directly from main memory 114 (and / or write modified data to main memory 114). Access to cache is faster than corresponding access to main memory, typically. This means that transactions on the cache (e.g., read or write transactions) can be completed much faster than corresponding transactions on main memory. This helps reduce latency in the system.

[0064] The computing system 100 may be initialized without data in the first cache 104. All relevant data may alternatively be stored only in the main memory 114. When a read request for data at a particular physical address in the main memory (or an instruction at the processor) is issued by the processor, for example, as part of a read transaction, it is determined that there is a "cache miss", i.e., the required data is not contained in the cache (because the data is not yet in the cache). When a cache miss is determined, for example, in response to the read request, the addressed data is obtained from the main memory. Typically, the physical address will specify a location within a memory page. Appropriately, an entire row of data (e.g., 64 bytes in one example) is obtained rather than just the data at the specified location. This is because due to the location of the data in the main memory, the chance that data at a location near the specified location will also be needed in subsequent transactions increases.

[0065] The fetched data will be stored in the cache at a location with a cache address that corresponds to the main memory physical address from which the data was read. This makes the data accessible when subsequent requests are made for the data in the cache. The data can be stored in a portion of the cache called a "cache line".

[0066] Accessing the cache is faster than accessing the main memory. In the event that the processor subsequently issues a read instruction for the same address (i.e., the cache address where the data is stored), the cache will return a "cache hit," indicating that the data is present in the cache, and return the data from the cache to the processor (from the relevant cache line) without accessing the main memory. Therefore, since the cache has lower latency than the main memory, this read transaction can be completed faster.

[0067] The cache can be physically addressed adjacent to the system bus, which means that the physical address of the main memory data entry is also used to address the cache. This reduces system complexity because the same address can be used to address the cache to address the main memory.

[0068] In a transaction from a processor that requires a write to a main memory location, the write may be applied immediately to the main memory location. Due to the latency of the main memory, this may take a relatively long time to complete. Alternatively, the write may occur to a cache line in a cache associated with the main memory location. Thus, in the event that the processor initiates a write transaction, the write may occur to a physically addressed location in the cache. The write does not need to occur immediately to the corresponding physically addressed location in the main memory. Writing to the cache may be much faster than writing to the main memory, thereby reducing the time required to complete the write transaction, reducing latency in the system.

[0069] Write transactions can be completed in different ways. In one case, a write transaction to the main memory (corresponding to a completed write transaction to the cache) can be queued and can occur at a later time. The processor does not need to wait for this to happen, but can continue to process other instructions in parallel. In another case, the write transaction can stop at the cache, i.e., there will be no queued write transactions on the main memory. This means that the modified data in the cache will not be written to the main memory. Then, the data at the corresponding location in the main memory is old or outdated. In this case, it may be useful to identify that the cache data is the latest version and the main memory does not contain the latest version. For example, this can be done using a flag associated with the cache data, which can be represented by a bit. The bit may be located in the cache. The bit can be called a "dirty" bit and indicates that the cache line is "dirty", i.e., the data in the cache line has not been written back to the main memory because a modification has occurred.

[0070] On a subsequent write of the cache line data back to main memory (such a transaction may be referred to as a "write-back" transaction), the dirty bit or flag may be cleared to indicate that the cache line contains the same data as the data at the corresponding address in main memory, i.e., it is "clean." This may occur as part of a subsequent transaction, or as part of a closing process, to copy the updated cache contents in main memory before closing the cache and losing the cache contents.

[0071] After a write-back transaction, the data in that cache line may remain in the portion of the cache (i.e., the cache line) to which it was originally written, allowing subsequent access to that data in that cache line in the cache, or it may be evicted or flushed from the cache line. When cache line data is evicted from a cache line, it frees up space for other data to be stored in that cache line.

[0072] Cache line status

[0073] It is useful to introduce different cache line states at this stage. When the system is initialized and there is no data in the cache, each cache line may be empty. The state of these cache lines can be considered "invalid", that is, there is no valid data in the cache line. A cache line can be in an "invalid" state, in which it does not include a copy of any memory line from the main memory (or in which any data contained in the cache line is marked as invalid in an appropriate manner). A cache line can be in a "unique" state, in which it includes the only valid copy of the memory line, that is, any other copy of the memory line (for example, at other caches) is invalid. If the data in the cache line is dirty, the cache line can be in a "dirty" state. With respect to the "dirty" state of the cache line, the corresponding processor (or more generally, the main processor - see below) coupled to the cache including the cache line can be responsible for writing the data in the cache line back to the memory. If the data in the cache line is clean, the cache line can be in a "clean" state. With respect to the "clean" state of the cache line, the corresponding processor (or more generally, the main processor - see below) coupled to the cache including the cache line is not responsible for writing the data back to the cache line.

[0074] Where data in a cache line is evicted or flushed from the cache line, the cache line may be marked as invalid, and / or the data is overwritten and / or otherwise deleted, and thus the data may not be available for subsequent accesses in the cache.

[0075] Typically, a system will include at least two levels of cache: a level 1 (L1) cache at the processor (the L1 cache can be part of the processor), and a level 2 (L2) cache, typically in the data path between the L1 cache and the main memory. Typically, the lowest level cache is physically addressed. The lowest level cache is the closest cache in the data path to the bus coupled to the main memory, for example, an L2 cache in a system with only two levels of cache, or a level 3 cache in a system with three levels of cache, and so on. Providing a physically addressed lowest level cache can avoid problems with address aliasing, and can also allow for enhanced compatibility between the cache and the main memory, because instructions on the bus coupling the lowest level cache to the main memory are typically physically addressed. Therefore, with a physically addressed cache, both the cache and the bus will operate in the same address space (i.e., the physical address space).

[0076] Modern systems include multiple processors to improve performance. In such systems, there may be a shared cache between the multiple processors and the main memory, or there may be multiple caches, for example, one cache per processor, such as Figure 1A Reference Figure 1A , a first processor P1 102 has a first cache C1 104 associated therewith. A second processor P2 106 has a second cache C2 108 associated therewith. Caches C1, C2 are connected to a bus 112 via interfaces 110, 111. Bus 112 is coupled to a main memory 114. Interfaces 110, 111 may include a memory management unit (MMU). The MMU is capable of converting virtual addresses used in higher level cache memory hierarchies to physical addresses used in lower level cache memory hierarchies and main memory. To this end, the MMU may include or have access to a table storing mappings from a virtual address space to a physical address space. Typically, the MMU maps the entire virtual address space to a physical address space.

[0077] More generally, if Figure 1BAs shown, the computing system 150 may include multiple master (or main) devices that can be coupled to multiple slave (or auxiliary) devices. As shown, three master devices (master device A 152, master device B 154 and master device C 156) are coupled to four slave devices (slave device A 160, slave device B 162, slave device C 164 and slave device D 166). The number of master devices and slave devices can be the same, or can be different. Master devices 152, 154, 156 are coupled to slave devices 160, 162, 164 via a bus, a communication structure or an on-chip network (NoC) 170. Conceptually, a master device is a device that can initiate a transaction; a slave device is a device that responds to a transaction. For example, a master device can issue a write transaction, which can be on a write data channel to perform data writes from a master device to a slave device. A master device can issue a read transaction, which can be on a read data channel to perform data read by a master device from a slave device. One or more master devices can be processors. The computing system can be a multiprocessor system. The master device may be a central processing unit (CPU). The master device may be a graphics processing unit (GPU). One or more master devices may be peripheral devices. One or more slave devices may be memory storage, such as cache memory or main memory. Cache memory may be provided for each processor.

[0078] In such Figure 1A and Figure 1B In systems such as the system shown, data coherence should be considered because multiple master devices (e.g., processors) may attempt to access data at the same physical address in the main memory. For example, a first processor P1 102 may access location L1 116 in the main memory 114 in a read transaction, and may store a copy of the data at L1 in its local cache C1 104 at location LC1 118. A second processor P2 106 may then access L1 116 in a write transaction, and may modify the data stored at L1. The second processor may also modify the local copy of the data stored at location LC2 120 in its local cache, rather than modifying (or also modifying) the data at location L1 in the main memory 114. In either case, the data stored at LC1 will be out of date. Therefore, a subsequent read by the first processor will read incorrect data stored at LC1.

[0079] Therefore, the system suitably has methods for identifying transactions to different processors and avoiding subsequent use of stale data. One method of doing this is to identify when a processor issues a transaction at a physical address that is already cached at a cache associated with a different processor by monitoring all transactions on the bus, i.e. whether another cache "owns" particular data stored in a cache line. This monitoring of traffic on the bus may be referred to as "snooping".

[0080] Snooping can identify when a physical address in main memory is accessed where a local copy of the data is already stored in a cache line. Since the lowest level cache is typically physically addressed, snooping can monitor transactions on a physical address used in another cache.

[0081] The inventors have realized that it is desirable to provide a virtually addressed lowest level cache, which means that the lowest level cache is addressed in a virtual address space rather than the physical address space of the main memory. The virtual address space can be larger than the physical address space. One advantage of a virtual address space is that processor instructions (e.g., programs running on a processor) do not need to be concerned with the physical address space underlying the system, but can operate entirely within the desired virtual address space. This can provide additional cache space that is more easily accessed by program instructions while still operating in the virtual address space. When providing a virtually addressed lowest level cache, it is also desirable to maintain data coherence between such a cache and another cache in the system.

[0082] Transactions received at a virtually addressed coherent cache via a bus (rather than from a higher level cache), i.e., snoop transactions (or snoop requests) sent to the cache's bus, will be associated with physical addresses in the physical address space used, for example, at the main memory. The address conversion that can be performed in a typical system at the MMU is from virtual addresses to physical addresses. This allows read and write requests generated at the processor (in the virtual address space) to be correctly addressed to the main memory (in the physical address space). The reverse address conversion, i.e., from the physical address space to the virtual address space, is not usually performed at the MMU. In order to obtain the reverse address conversion at the MMU, it is necessary to exhaustively search all physical addresses corresponding to the cache lines in the cache so as to be able to identify which virtual address corresponds to the received physical address. In some cases, the cache may be provided as a set associative cache; then, the search needs to be performed exhaustively across each set in the cache. As described above, the MMU typically maps the entire virtual address space to the physical address space. Searching all physical addresses will be a very time-consuming process and is likely to result in a large increase in latency in the system.

[0083] Reverse conversion

[0084] The inventors have determined that it may be useful to provide additional functionality in or in association with the interface between the lowest level cache and the bus. The additional functionality includes physical to virtual address translation ("reverse translation") for converting a physical address received via the bus into a virtual address in the cache corresponding to the received physical address. Memory requests such as snoop requests may be received via the bus. Memory requests may be addressed in the physical address space. Memory requests may be converted into translation requests, where the translation requests are addressed in the virtual address space.

[0085] The memory interface between the bus and the cache memory may implement a coherency manager that is capable of continuously tracking cache lines within the lowest level cache of the device that have been marked as coherent. The lowest level cache may be implemented as a virtually indexed and virtually tagged (VIVT) cache. Thus, the memory interface is capable of performing reverse address translation because incoming snoop requests, for example via the ACE protocol, will always provide physical addresses, and these physical addresses are translated into virtual addresses to allow them to be associated with matching cache lines within the lowest level cache.

[0086] The reverse conversion function can be provided by a reverse conversion module. The reverse conversion module is configured to calculate the virtual address based on the physical address based on the known relationship between the physical address space and the virtual address space. Compared with an exhaustive search for the physical address in the cache, this can provide a delay reduction. The reverse conversion module can be implemented in software, hardware, or a combination of software and hardware. For example, the reverse conversion module can be implemented in fixed-function hardware. The reverse conversion module may include logic for calculating the virtual address based on the physical address based on the known relationship between the physical address space and the virtual address space.

[0087] In addition or alternatively, the reverse translation function can be obtained by providing a data structure for the reverse translation function. The data structure can be a table or other similar structure, as will be discussed in more detail below. The data structure can be located at an interface such as a memory interface, which is, for example, logically located between the lowest level cache and the bus. The data structure may include a directory that links a physical address to a corresponding virtual address. Therefore, when a transaction such as a memory request identifies a physical address, the virtual address corresponding to the physical address can be found in the reverse translation data structure. This allows access to the relevant virtual address in the cache with a lower latency than otherwise possible.

[0088] This method allows receiving memory requests addressed in the physical address space ( Figure 2202). A memory request, such as a snoop request, may be a request to a cache from a bus. The received memory request is converted to a translation memory request (204). The translation memory request is addressed in a virtual address space, for example, the virtual address space of the lowest level cache. Since the translation request is addressed in the address space of the lowest level cache (i.e., it is virtually addressed within the virtual address space), the translation request will then appropriately address a virtually addressed memory location in the cache and may therefore be processed in the virtual address space (206).

[0089] Now refer to Figure 3 and Figure 4 Describe the example system architecture. Figure 3 A system 300 is schematically shown that includes two devices or masters: device 1 302 and device 2 304. As shown, device 1 is a graphics processing unit (GPU) and device 2 is a central processing unit (CPU). However, the application of the technology discussed herein is not limited to one or more CPUs and one or more GPUs, but can be extended to any multi-processor system, or more generally, a master-slave system with multiple master devices and slave devices. Device 1 includes a processor 306 and a cache 308. Similarly, device 2 includes a processor 310 and a cache 312. Device 1 cache 308 and device 2 cache 312 are coupled to main memory 314 via a memory bus 316. Device 1 302 includes a memory interface 318. Interface 318 is shown as being between cache 308 and bus 316, but this is not the case in all examples. In some examples, it is sufficient for interface 318 to be coupled to cache 308 and bus 316. The interface 318 is suitably directly coupled to the cache 308 and the bus 316 (ie, no other module or processing unit is used to translate addresses provided between the interface and the cache or between the interface and the bus).

[0090] Memory interface 318 includes MMU 320 for translating virtual addresses into physical addresses. Memory interface 318 includes coherency manager 322. The structure and operation of coherency manager will be explained in more detail below. Coherency manager 322 is configured to maintain the coherence of address spaces used by device 1 and device 2, for example, address spaces including device 1 cache 308, device 2 cache 312, and main memory 314. The coherency manager is configured to perform the reverse translation, i.e., translating physical addresses into virtual addresses.

[0091] Figure 4 Another system 400 is schematically shown including two devices or master devices. Figure 4 The system 400 shown in FIG. Figure 3The same reference numerals are used to denote the same elements, and repetition of their descriptions is omitted. Figure 3 and Figure 4 differences between the systems. Figure 4 Device 1 402 includes two processor cores: core 1 406 and core 2 407. Each processor core 406, 407 is coupled to a corresponding cache 408, 409. Core 1 cache 408 can provide local cache memory for core 1 406. Core 2 cache 409 can provide local cache memory for core 2 407. Device 1 402 includes a lowest level cache 330, which is (at least logically) located between core 1 and core 2 caches 408, 409 and memory interface 318. The lowest level cache can include multiple cache banks. As shown, the lowest level cache 330 includes cache bank 1 331, cache bank 2 332, cache bank 3 333, and cache bank 4 334. Other numbers of cache banks can be provided.

[0092] The cache banks 331, 332, 333, 334 within the lowest level cache 330 provide separate storage areas within the cache. The separate cache banks within each cache are individually addressable. The cache banks can also be the same. Figure 4 In the example shown, device 1 402 includes two processor cores and four cache banks. In other examples, the number of processors and cache banks may vary.

[0093] The memory bus 316 includes two access paths 316a and 316b to the memory interface 318. This schematically represents that there may be multiple access paths or channels between the memory bus 316 and the device 1 402 via the memory interface 318. The number of access paths may be the same as the number of cache banks or less. For example, one access path may be coupled to each cache bank, or one access path may be coupled to multiple cache banks. This will refer to Figure 5 Further explanation.

[0094] Figure 5 The following is schematically shown with some additional details: Figure 4 A portion of system 400 is shown. Figure 5 The lowest level cache 330, memory interface 318 and memory bus 316 are shown. Here, the lowest level cache 330 has been shown to include two cache banks, cache bank 1 331 and cache bank 2 332. For clarity, cache bank 3 333 and cache bank 4 334 are not shown. However, Figure 5 Additional cache libraries are provided in the system shown.

[0095] The memory interface 318 is suitably a module within the hierarchy that allows one processor (e.g., a GPU) to communicate coherently with another processor (e.g., a CPU). This may mean that the GPU is able to act as a fully cached / coherent master within a coherent bus interconnect (e.g., within a coherent bus interconnect according to the AXI-ACE protocol).

[0096] The memory interface 318 includes two bus interfaces: bus interface 1 502 and bus interface 2 504. Each bus interface is configured to interface between the memory bus 316 and a portion of the cache memory. As shown, bus interface 1 interfaces between the bus 316 and cache bank 1 331; bus interface 2 interfaces between the bus 316 and cache bank 2 332. Although Figure 5 Cache bank 3 333 and cache bank 4 334 are not shown, but bus interface 1 502 may additionally interface between bus 316 and cache bank 3, and bus interface 2 504 may additionally interface between bus 316 and cache bank 4. Alternatively, two further bus interfaces may be provided, each arranged to interface in one of cache bank 3 and cache bank 4. Suitably, the bus interface is located next to the coherency manager in the memory interface. In addition to the interface between the bus and the cache bank, the bus interface is also coupled to the coherency manager 322 and the MMU 320.

[0097] The MMU 320 is coupled to the bus interfaces 502, 504, as schematically shown at 530. The MMU is capable of translating virtual addresses used by the cache 330 into physical addresses in the physical address space used on the memory bus 316. The bus interface is appropriately configured to send virtual addresses to the MMU and receive corresponding physical addresses from the MMU. The bus interface can then use those corresponding physical addresses to address transactions sent by the bus interface over the memory bus.

[0098] The bus interfaces 502 and 504 may be interface converters associated with the lowest level cache 330, such as AXI converters. A cache bank interface ( Figure 5 ). The cache library interface may be provided as a module separate from the cache, and / or as a module forming part of the cache.

[0099] In one implementation, the lowest level cache 330 is configured to issue requests to the memory through an AMBA 4.0 compliant interface, including coherency extensions (commonly referred to as AXI-ACE). The bus interfaces 502, 504 can help ensure compliance with protocols such as the AXI-ACE protocol. The coherency manager 322 of the memory interface 318 is connected to the channels on the bus 316 associated with the snoop request. The channels may include a snoop address channel 510, a snoop response channel 512, and an acknowledgement channel 514. Most of the remaining channels defined in the AXI protocol specification will be directly driven by the bus interfaces 502, 504 associated with the lowest level cache 330. The bus interfaces 502, 504 are coupled to the coherency manager 322 (shown at 516, 518) so that the coherency manager can monitor outgoing coherence transactions (e.g., on the address response (AR) interface, such as CleanUnique and ReadUnique transactions) and incoming responses (e.g., on the read (R) response channel, such as responses to CleanUnique and ReadUnique transactions) to be able to update the state of the coherent cache line being tracked and drive a read acknowledgement signal (“RACK”) 514. The coherence manager 322 can also monitor outgoing coherence transactions (e.g., writeback and eviction transactions) on the address write (AW) interface and incoming responses (e.g., responses to writeback and eviction transactions) on the write response (B) channel to be able to update the cache line state and drive a write acknowledgement signal (“WACK”) 514.

[0100] Snoop address ("AC") channel 510 is an input to a master device, such as processor 406 at device 1 402, with associated cache 330, that provides address and control information for snoop requests that have been issued to that processor (e.g., GPU). Memory interface 318 is capable of accepting and processing different snoop transaction types, e.g., as defined in the AXI-ACE protocol, as discussed herein.

[0101] Snoop Response ("CR") channel 512 is an output from a master device, such as processor 406 at device 1 402, with associated cache 330, that provides responses to snoop requests issued to that processor (e.g., GPU). Each snoop request on snoop address channel 510 has a corresponding response on snoop response channel 512. The response to the snoop request may include one or more of the following:

[0102] Indicates whether the snooped cache line was held in a unique state before the snoop request was received,

[0103] Instructs the snooping cache to keep a copy of the cache line,

[0104] Indicates that the cache line is dirty and the responsibility of writing the cache line back to memory is being transferred to the master,

[0105] Indicates if a cache line is corrupt, and

[0106] Indicates whether a cache line of data will be transferred.

[0107] The snoop response may include an indication that the cache line is not present in the cache, that the cache line exists but has been invalidated, or that the cache line exists and a copy of the cache line is retained.

[0108] In the event that the snooped cache line exists at cache 330, the lowest level cache may write the cache line back to memory (if it is dirty), or simply invalidate it. Thus, when a response is sent to the snoop request, the response may indicate that the cache line exists but has been invalidated. An exception may be that a copy of the cache line (if dirty) is retained in the cache after being written back to memory, in which case the response may indicate that the cache line exists and a copy of the cache line is retained.

[0109] The ACE extension includes two confirmation signals for indicating when the master device has completed a read or write transaction. These can be asserted almost immediately, rather than being delayed to wait for any other transaction. The memory interface 318 can use the confirmation signal to ensure that the transaction on the listening address channel 510 of the master device about a specific address (or cache line) is not issued until any previous transaction from the master device to the same address (same cache line) has been completed. The memory interface 318 can drive this signal to indicate that any state transition associated with the completion of the read or write transaction has been executed, and therefore by issuing a confirmation, the memory interface 318 ensures that it will be able to accurately respond to the snoop request for the cache line that has just been updated. Confirmations can be issued in the same order as the order in which the read / write response was received.

[0110] In order to enable the memory interface 318 to properly respond to incoming snoop requests, the memory interface can be configured to monitor the internal interface and update the cache line state, for example, by interacting with the cache library. The memory interface can also be configured to instruct the cache when to flush and / or invalidate cache lines, for example, through a "flush-invalidate" command 520 generated at the coherency manager 322.

[0111] The internal interfaces that the memory interface 318 is configured to monitor include:

[0112] A command interface that allows issuing flush-invalidate commands with respect to specific cache line addresses,

[0113] A flush_active mask that allows bits in the mask to be set and cleared to control the flush process. For example, when issuing a flush to a cache bank, the cache line to be flushed can be identified by a refresh ID, and the bit corresponding to the refresh ID can be set high in the flush_active mask; however, the bit can be cleared before the flush is processed, indicating that the refresh for that cache line should be ignored.

[0114] The flush_processed bit corresponding to the refresh ID can be set high for one cycle when processing or ignoring a refresh.

[0115] An update interface that allows updating cache line state (e.g., coherence or not) when related transactions complete,

[0116] Read channel request interface. The memory interface can be configured to monitor coherent transactions to be output on the address read ("AR") interface 522, for example, through the bus interfaces 502, 504. This allows the memory interface to change cache line states and / or create new entries in response to outgoing requests,

[0117] Overflow mask (or eviction mask) that indicates which entries of the reverse translation data structure are overflowing. If this bit is set, transactions on the address read bus are prevented from advancing to memory, i.e., read transactions should not be performed on entries in the reverse translation data structure that are overflowing.

[0118] Address Write ("AW") interface 522. The memory interface may be configured to monitor coherent transactions to be output on the address write interface ("write back / evicted" interface), e.g., via bus interfaces 502, 504. This allows the memory interface to be able to change cache line states in response to outgoing requests,

[0119] Multiplexed interface. Once a writeback and / or eviction transaction is ready to be output, the corresponding reverse translation data structure entry number of the cache line being written back and / or evicted may also be output. This allows combinatorial multiplexing (multiplexing) of the appropriate physical addresses stored within the reverse translation data structure, as this avoids relying on the rest of the memory interface to translate the request, and therefore may avoid the rest of the memory interface needing to perform a read request in response to a snoop,

[0120] Assertion channel response interface. The memory interface may be configured to monitor the assertion channel response interface so that the cache line status can be updated, and / or a read acknowledge signal ("RACK") 514 can be driven,

[0121] Write back channel response interface. The memory interface may be configured to monitor the write back channel response interface so that the cache line status can be updated, and / or a write acknowledge signal (“WACK”) 514 can be driven.

[0122] The coherency manager includes two snoop processors: snoop processor 1 541 and snoop processor 2 542. Typically, the coherency manager includes a snoop processor for each bus interface 502, 504. Each snoop processor is associated with a corresponding bus interface. The snoop processors are configured to process snoop requests received at the bus interfaces with which they are associated, as described in more detail elsewhere herein.

[0123] Monitor Processor

[0124] refer to Fig. 6A , the snoop processors 541, 542 are configured to receive snoop requests (e.g., snoop requests received via the snoop address channel 510). The snoop processor includes a bus calculation unit 602. The bus calculation unit is configured to calculate whether the received snoop request is related to a bus interface associated with the snoop processor (see below). The bus calculation unit 602 is coupled to a buffer (which may be referred to as a snoop buffer) 604. The buffer is bidirectionally coupled to the control logic 606. The control logic controls cache line state lookup requests and responses 608 and refresh commands to the cache 520. The control logic is arranged to issue snoop responses to the snoop response channel 512. One or more pointers may allow the snoops contained in the buffer to simultaneously undergo different processing stages in a pipelined manner. The snoop buffer may be a first-in, first-out buffer. The buffer may allow requests to be processed out of order, but output responses to the requests in the same order as the order in which the requests were received. This will be discussed in more detail elsewhere in this document.

[0125] When a snoop request is received on the snoop request interface (i.e., on the snoop address channel (AC) 510), a reverse translation data structure entry (e.g., a page translation table (PTT) entry) is searched (if it exists). The search can be performed by comparing the physical page and the protection bit. The entry number, the reverse translation data structure hit / miss result, and the virtual address are sent to the snoop processor. The snoop processor is instantiated for each AC port and is responsible for processing and responding to the snoop requests received on that port. It implements a FIFO (first in, first out) buffer. The buffer may include registers. The buffer may contain the snoop requests currently being processed, as well as the current processing status of those snoop requests. If the buffer is full, the snoop processor 541 may stop enabling the corresponding AC interface.

[0126] The processing of received snoop requests can be limited to the order in which they are received, but this may be inefficient. Alternatively, the snoop requests can be processed out of order. However, the responses can be sent on the snoop response (CR) channel 512 in the same order as the snoops were received (e.g., to meet the requirements of an operating protocol such as the ACE protocol). Thus, if a snoop for address A is received after a snoop for address B, and the snoop processing is able to determine that address B is invalid, the buffer can be updated immediately with the response for address B, but it will only be output on the snoop response bus once the response for address A is sent.

[0127] Buffer 604 is configured to store one or more intermediate responses generated in response to the received request. That is, in the above example, the buffer can store the response to the monitoring of address B. Subsequently, when the monitoring request on address A is completed, the monitoring processor can store the response to the request in the buffer and / or directly output the response. The monitoring processor can be configured to send an output in response to the received request based on the stored one or more intermediate responses. For example, once the monitoring processor determines that the response to the request on address A has been sent, the response to the request on address B stored in the buffer can be sent. In this way, the monitoring processor can maintain the order of responses to match the expected order, for example, the order in which the requests are received.

[0128] Now refer to Figure 6B Describes the status of the listen buffer.

[0129] When a new snoop request is received, an entry is written into the snoop buffer, e.g., using a write pointer. If the bus interface corresponding to the snoop address is different from the bus interface associated with the snoop processor receiving the snoop request, or the snoop address does not have a matching entry in the reverse conversion data structure, the snoop result is invalid and, for example, the state at the current write pointer is changed to NOT PRESENT 652. Note that the snoop buffer is configured so that a response will still be sent, regardless of whether the request is issued to the wrong bus interface and / or repeated snoops are issued to the same address. This method allows the memory interface to process requests (even wrong requests) in a coherent manner.

[0130] exist Figure 6BIn the example shown, if the bus interface corresponding to the snoop address matches the bus interface associated with the snoop processor that received the snoop request, and the snoop address has a matching entry in the reverse translation data structure, the state changes to RAM LOOKUP 654 and a request is issued to the cache line status unit 906, which will then return the status of the snoop cache line. The buffer write pointer can be pipelined with the cache line status lookup and used to update the correct buffer entry when the cache line status read data is returned.

[0131] When the cache line state is returned to read data, the state of the cache line is evaluated. If the monitored cache line is invalid, the state in the buffer entry can be updated from the RAM lookup 654 to not present 652. On the other hand, if the cache line state is not invalid, that is, it is one of unique P0 (UniqueP0), unique P1 (UniqueP1), or eviction (Evicting), the buffer entry state is updated to eviction P0 (EVICTP0) 656, eviction P1 (EVICTP1) 658, or waiting for eviction (AWAITEVICTION) 660, respectively. The buffer entry in the eviction P0 or eviction P1 state can then be selected, for example, by rotating the "send refresh" pointer, and issuing a corresponding refresh request (e.g., to the cache library interface module 910). Once the refresh request is accepted (e.g., by the cache library interface module 910), the state is updated to waiting for eviction 660. While in the Waiting for Eviction state 660 , the entry is sensitive to incoming writeback / eviction completions and matching completions that will cause the entry to move to the EVICTED state 662 .

[0132] In addition, to prevent flush requests from being issued when the cache bank has already evicted a cache line, the buffer entries are also sensitive to writeback / eviction requests. A matching request will cause an entry that was in the Eviction P0 656 or Eviction P1 658 state (e.g., an entry waiting for its turn to be sent to the cache bank interface 910) or an entry that was in the RAM Lookup state 654 to be moved to the Waiting for Eviction state 660 on a cycle that returns cache line status read data.

[0133] Once the buffer entry is in the non-existent 652 or ejected 662 state, a snoop response may be output. These buffer entries may be selected, for example, by rotating a read pointer. The buffer entries may be selected in order. The snoop response is published on the snoop response (CR) interface 512. In some examples, for entries in the ejected state 662, the response will be 0x10 (unique=1), or for entries in the non-existent state 652, the response will be 0x0 (unique=0). For all types of snoop requests, the snoop response may be driven in the same manner.

[0134] A snoop buffer entry may include a status, a reverse translation data structure entry number, and a cache line offset address (e.g., a 64-byte address offset within a 4KB page). The depth of the buffer defines the number of outstanding snoop requests that can be received on the bus before stalling. The snoop buffer depth may be set to 8, for example. Suitably, an empty buffer entry is implied by an INVALID status, so a separate valid bit is not required.

[0135] The memory interface may support a configuration with a single set of snoop request / snoop response (AC / CR) ports. The memory interface may support a configuration with multiple sets of snoop request / snoop response (AC / CR) ports, where the number of AC / CR ports is the same as the number of other memory ports. That is, a configuration with two address read / write address (AR / AW) ports and one or two AC ports is supported. In the presence of multiple AC ports, assuming that multiple memory buses are interconnected and treated as separate master devices (e.g., ACE master devices), a snoop issued on one AC port corresponds to a request on the corresponding bus interface.

[0136] In a configuration with a single AC port, where the single AC port is coupled to all bus interfaces (1, 2, 4, etc.), a single snoop processor instance is sensitive to writeback / eviction requests and responses on all bus interfaces. The logic for determining the correct bus interface corresponding to the snoop address does not need to be instantiated.

[0137] In a configuration with multiple AC ports, there may be the same number of AC ports as bus interfaces, in which case each AC port is coupled to a corresponding bus interface. In other examples, the number of AC ports and bus interfaces may be different. For example, there may be four bus interfaces and two AC ports, with two bus interfaces coupled to each AC port. Other configurations are possible. There may be a snoop processor instance corresponding to each AC port. Each snoop processor instance may be sensitive only to writeback / evict requests and responses from the corresponding bus interface or multiple bus interfaces (i.e., one or more bus interfaces corresponding to the snoop processor). Logic for determining the correct bus interface corresponding to the snoop address may be instantiated. The logic may be configured to determine the bus interface on which a request (e.g., a snoop request) is received.

[0138] Reverse conversion module

[0139] Reference again Figure 5, the coherency manager 322 includes a reverse translation module 550. The reverse translation module is configured to translate a physical address into a virtual address. For example, the reverse translation module is configured to translate a physical address received via the bus 316 into a corresponding virtual address in the virtual address space of the cache 330 at the device 1 402.

[0140] The reverse translation module 550 may include a reverse translation data structure 552. The reverse translation data structure 552 may include a page translation table (PTT) 554. The reverse translation module 550 appropriately includes register arrays and associated lookup logic for memory interface ports and listening address (AC) ports. Upon receiving a request such as a memory request associated with a physical address (e.g., a memory request addressed in a physical address space), the reverse translation module allows the physical address to be converted to a virtual address (e.g., a memory request can be converted to a converted memory request addressed in a virtual address space). The virtually addressed cache can then process the converted request. In order to maintain coherence with, for example, an AXI protocol, the response to the memory request is converted back to the physical address space (e.g., by the MMU) before being sent on the physically addressed bus.

[0141] The contents of the reverse translation data structure 552 allow the coherency manager 322 to respond to snoops using physical addresses while interfacing with the ACE converter and the lowest level cache library using corresponding virtual addresses. In addition to virtual and physical address information, each reverse translation data structure entry contains a status field indicating the overall status of the page entry. The status field can indicate whether the reverse translation data structure entry is currently in use or can be allocated, whether it is being overflowed (see elsewhere in this article), whether the cache line used in the page is in a state that allows overflow, or whether any cache line in the table is in a state for which a snoop request will be responded to as having ownership of the cache line. The snoop response can be determined without having to look up individual cache line states or cache lines, as will be explained elsewhere in this article.

[0142] For more details, refer to Figure 7, the reverse translation data structure 552 includes a PTT, which can be a fully associative table containing 4KB pages in which cache lines are tracked by the memory interface. These pages together can represent all coherent pages currently contained in the lowest level cache library or with flying requests within the ACE converter, except for new cache line allocations that the memory interface (or, for example, the coherence manager at the memory interface) is not yet aware of. In other words, the reverse translation data structure 552 only stores reverse translation information for coherent cache lines currently held in the cache memory. This is because reverse translation only needs to be performed for coherent cache lines rather than for the entire physical address space. This reduces the amount of data maintained at the reverse translation data structure 552. Each PTT entry (or more generally, a reverse translation data structure entry) contains the physical address 704 and virtual address 706 of the physical and virtual pages. This allows the memory interface 318 to respond to snoop requests using physical addresses while using corresponding virtual addresses to interface with various parts (e.g., the lowest level cache 330) of the system (e.g., a master-slave system (with multiple master devices and slave devices)). A particular cache line can be addressed more specifically by using an offset within the associated page. In the case where the virtual and physical pages are each aligned along the same page boundary, for example, in the case where both virtual and physical pages are 4KB aligned, the offset of a given cache line can be the same within the virtual page as within the physical page. This can simplify the reverse conversion.

[0143] Each reverse translation data structure entry may also include a protection ("protection"; security indicator) bit and a context / PASID (or process address space ID). More generally, any value may be provided for or in place of a context / PASID. A "context" is associated with an independent address space, commonly referred to in CPU terminology as a PASID, which refers to a processor design in which each application / process is typically assigned a new independent address space, meaning that it will have its own set of translation tables, e.g., MMU translation tables. A context / PASID value may include an identifier that may be associated with a process, a page table such as a PTT, or a virtual address within a page table.

[0144] The reverse translation data structure may include a status field 708 for storing the status of the mapping between the physical and virtual pages. The status field may include a flag for asserting that the mapping between the physical address 704 and the corresponding virtual address 706 is valid. The mapping may be valid in the case where the virtual page in the cache includes valid data associated with the physical page in the main memory. The assertion of the flag in the status field may indicate that the mapping of each cache line in the physical page is effectively mapped to each cache line in the virtual page. The assertion of the flag in the status field may indicate that the mapping of at least one cache line in the physical page is effectively mapped to the corresponding cache line in the virtual page. Suitably, the status field flag is not asserted, wherein none of the cache lines in the physical page are effectively mapped to the cache lines in the virtual page. Therefore, in the case where the status field flag is not asserted, the coherency manager can determine that none of the data in the cache lines stored at the cache is valid. This determination can be made without accessing the cache. Therefore, in this case, the coherency manager 322 can determine that the cache line is not valid without accessing the cache itself. In some examples, the status field 708 may include additional information or data.

[0145] Suitably, the reverse conversion data structure 552 is associated with a cache line state data structure 710. The cache line state data structure may be a directory. The reverse conversion data structure may include a cache line state data structure. The cache line state data structure may be provided separately from the reverse conversion data structure. The cache line state data structure may be provided together with the cache 330, or as part of the cache 330. However, preferably, the cache line data structure is provided at the memory interface 318, for example, at the coherence manager 322. The coherence manager is arranged to access the cache line state data structure. The cache line state data structure includes a state indicator of at least one cache line tracked in a page mapped by the reverse conversion data structure. The cache line state data structure may indicate the state of the cache line, as described above, for example, whether the cache line is "valid", "invalid", "clean", "dirty", whether the data at the cache line is being written back to the main memory (in this state, it may be indicated that the cache line is invalid), whether the data at the cache line is being evicted from the cache (in this state, it may be indicated that the cache line is invalid), etc.

[0146] Suitably, the coherency manager (e.g., a snoop processor at the coherency manager) is configured to query the cache line state data structure 710. Suitably, querying the cache line state data structure comprises determining the state of a particular cache line at the cache memory from the cache line state data structure (e.g., from an entry contained within a data field at the cache line state data structure). The particular cache line is suitably a cache line associated with or corresponding to the physical memory address identified in the snoop request. That is, the particular cache line is suitably a cache line that stores (e.g., where the cache memory owns the associated cache line), or will store (if the cache memory owns the associated cache line) data corresponding to a location in the memory identified by the physical memory address.

[0147] A cache line state data structure may be provided in a separate RAM. Suitably, the cache line state data structure (e.g., RAM) is located at device 1 402. For example, the cache line state data structure may be connected to the lowest level cache 330 at device 1, or may form a part thereof. Suitably, the RAM is coupled (or connected) to the lowest level cache, for example, provided on a data path adjacent to the lowest level cache. Suitably, the RAM is coupled (or connected) to the corresponding cache bank. The RAM is configured to store the state of the cache line stored in the corresponding cache bank. This will be discussed in more detail below.

[0148] In some implementations, when it is determined that the expected data is present in a cache line at the cache, the state of the cache line is determined from a cache line state data structure (e.g., a cache line data structure stored in RAM). The determination of the state of the cache line can be completed without accessing the cache line and / or the cache (or cache bank) storing the cache line data.

[0149] The reverse translation data structure can be scaled to obtain a tradeoff between area and capacity based on the maximum number of concurrent coherent pages that can be tracked within the lowest level cache at any time.

[0150] Reverse conversion of data structure entries

[0151] The reverse translation data structure can be used to track coherent cache lines in the following manner. When a virtual address and a 4KB aligned physical address (and optionally, a context / PASID) are presented at the interface of the coherence manager, for example, where the coherence manager monitors an outgoing request from a processor to main memory, the coherence manager looks up the physical address and protection bits in the reverse translation data structure, for example, in the PTT. If the incoming address / protection bits do not match an existing entry used in the reverse translation data structure, the coherence manager appropriately allocates a currently invalid reverse translation data structure entry (e.g., a PTT entry) without an outstanding request claiming the entry. If no such invalid entry currently exists, the request will stall at the coherence manager until an entry becomes free. Entries are appropriately allocated between multiple inputs at the coherence manager (e.g., inputs from multiple bus interfaces 502, 504) on a cyclic basis.

[0152] For write requests presented on the interface of the coherency manager, the virtual page and context / PASID are compared to find a matching entry, and again, only entries that are in use (i.e., in a valid state or have an outstanding request for that entry) are considered in the matching criteria. Checking for entries in use in the reverse translation data structure hit criteria prevents hitting stale entries where the virtual-to-physical address mapping may have changed.

[0153] The coherency manager is configured to output the physical page on the write-back / evict channel in response to the virtual page and context / PASID. Thus, the virtual page and context / PASID are appropriately in the reverse translation data structure registers as well as the physical address. If there is no such requirement, then the RAM entry can still be looked up based solely on the physical address and the protection (prot) bits.

[0154] The reverse translation data structure 552 (or PTT 554) may include the following fields per entry.

[0155] A "Status" field, indicating the overall status of the entry,

[0156] An "overflow" field, indicating whether the entry is experiencing overflow,

[0157] A "Request Counter" field indicating the number of outstanding read-only and / or clean-only requests on the cache line within the page,

[0158] A "valid counter" field, indicating the number of cache lines that are in a non-invalid state,

[0159] The "Vpage" field contains the virtual 4KB page,

[0160] The "Context / PASID" field contains the context or PASID,

[0161] The "Ppage" field, which includes the physical 4KB page, and

[0162] A "Protection" field, including protection bits, indicates the secure address space of the physical page.

[0163] The state field of each entry in the reverse translation data structure can be in one of two states: an "invalid" state and an "active" state. These states indicate whether the entry can be assigned to a new page mapping, whether it is a potential overflow candidate, and / or whether it is worth reading the cache line state from the state data structure (e.g., from RAM) on snoop.

[0164] When in the invalid state, the entry contains only invalid cache lines and can have a new mapping between the physical and virtual assigned to it if there are no outstanding claims or read requests on any of these cache lines indicated in the request counter field. Once the entry is assigned to a new page and / or a read-only or clean-only request is received for a currently assigned page, the request counter field is updated (e.g., the counter can be incremented) to prevent the entry from being reallocated before moving to the active state. Once a read-only or clean-only response is received for a cache line in the entry, the entry moves to the active state. If a snoop is received on a cache line whose entry is in the invalid state, the cache line state does not need to be read from the cache line state data structure because it is also in the invalid state. Therefore, a response to the snoop can be provided without having to access the cache line state data structure. Avoiding this step can reduce bandwidth and / or latency.

[0165] An entry in the active state contains cache lines that may not be invalid. That is, a cache line that may be in the unique or evicted state. When in this state, if the request counter field indicates that there are no outstanding requests, the entry can be selected for overflow. When reading the cache line state data structure, if it is determined that all cache lines have returned to the invalid state, then overflow does not need to occur and the entry itself moves to the invalid state. Once the overflow is completed, if all cache lines are evicted and return to the invalid state, the entry becomes invalid. If the overflow is aborted early so that not all cache lines are evicted and remain in the unique state, the entry remains in the active state. If a snoop is received for a cache line whose entry is in the active state, the cache line state data structure is read to find the current state of the cache line. This state can be passed to the overflow control unit and / or snoop processor within the memory interface. The memory interface can process incoming requests based on the state of the cache line.

[0166] Note that the request counter field and the valid counter field can each include a counter. For example, the request counter can count the outstanding read-only and clean-only requests on the cache lines in the page. When a read request is received on the request interface, the counter can be incremented, and when a response is received on the interface, the counter can be decremented. When the request counter is not zero (i.e., there is at least one outstanding request), the reverse conversion data structure entry cannot overflow. Providing a counter in this manner can improve power efficiency and / or reduce contention between ports compared to storing the idle / active bit in the state data structure. For example, the method can allow the number of state transitions in the cache line state data structure to be reduced. The valid counter can count the number of cache lines in the page that are in a non-invalid state. The reverse conversion data structure entry with a non-zero valid counter is a candidate for overflow. When the value of the counter decreases to zero, the overflow can be considered complete.

[0167] In one example, the lowest level cache may be a 256KB cache with 64 byte cache lines, giving a total of 4096 cache lines. If all possible cache lines in a page were present at any time, this would require only 64 entries, but in practice, since cache lines will not completely fill each 4KB page, more entries (e.g., 92-128 entries) may be required to avoid constant overflow. The number of entries may be 96, which provides the right balance between the required storage space (in terms of silicon area) and being able to store enough entries to allow smooth operation of the system.

[0168] overflow

[0169] The cache 330 has a finite size. Likewise, the reverse translation data structure 552 has a finite size. Therefore, it will be appropriate to monitor the fill level (e.g., of the cache and / or the reverse translation data structure) to ensure smooth operation of the system. If enough coherent pages are used in the system, the reverse translation data structure will eventually become full. In order to make room for new coherent pages, the data structure can therefore evict existing entries: this is called overflow. Overflow may involve selecting entries and instructing the cache library to refresh / invalidate the cache lines tracked in these entries, and then once all contained cache lines have been evicted and their corresponding writeback / eviction responses have been received, the entries are moved back to the invalid state. This allows those entries in the data structure to be reused for new cache lines.

[0170] Rather than waiting until the data structure is completely filled before overflowing begins (which would likely result in a long pause while entries are purged), the memory interface can be configured to preemptively begin overflowing entries in the data structure once the number of remaining free entries reaches a threshold value. Once the threshold is reached, a specified number of entries will be overflowed in sequence. Both the threshold and the specified number of entries to be overflowed once the threshold is reached can be configured via configuration registers.

[0171] The memory interface 318 may be configured to determine a fill level threshold. The fill level threshold may include a cache fill level threshold and / or a reverse conversion data structure fill level threshold. The fill level threshold may be predetermined. The fill level threshold may be changed in response to system operation. The fill level threshold may be appropriately less than the maximum fill level (i.e., the maximum fill level of the cache and / or the maximum fill level of the reverse conversion data structure). For example, the fill level threshold may be up to 90% of the maximum fill level and may be up to 80% of the maximum fill level. In some examples, the fill level threshold is 75% of the maximum fill level. The fill level threshold may be selected by a program running at the processor and / or by a user of the system (e.g., by modifying a corresponding value in a system configuration file).

[0172] When the fill level of the cache and / or reverse conversion data structure reaches a fill level threshold, the coherence manager 332 can be configured to start an overflow process. During the overflow process, cache line data will be evicted or refreshed from the cache. The process can continue until the determined fill level drops below the fill level threshold, until the data in a specific number of cache lines has been evicted, or until the coherence manager determines that the overflow process should stop. For example, a value for the number of cache lines evicted (or attempted to be evicted) can be provided. This value (the "evicted amount" value) can be stored in the coherence manager or associated with the coherence manager. The eviction amount value can be configurable, for example, user configurable. Therefore, in the case of reaching a threshold that causes an overflow or eviction process to begin, the coherence manager can be configured to evict a plurality of cache lines corresponding to the eviction amount value. In some examples, there may be a hysteresis in the overflow process, so that the overflow starts when the fill level threshold is reached, but does not stop until a second threshold value lower than the fill level threshold is reached. For example, overflowing may start when the fill level reaches or exceeds a fill level threshold of 75% of the maximum fill level, and will stop when the fill level decreases to or exceeds a second threshold (e.g., 60% of the maximum fill level). This hysteresis may reduce the overflow process from frequently starting and stopping when the fill level threshold is reached.

[0173] When a cache line of data is evicted from the cache during a spill process, and the corresponding entry in the inverse translation data structure is deleted or invalidated, space is freed for new entries in the cache and inverse translation data structure. New entries can still be written during the spill process.

[0174] Candidate overflow entries are those entries that are not currently overflowing and have a zero request counter and a non-zero valid counter. Entries in the cache and / or reverse conversion data structure can be selected to overflow based on eviction criteria. Eviction criteria can include one or more of the age of the data in the cache line, the access frequency of the cache line, the number of accesses to the cache line, the last access time of the cache line, and random cache line selection. Other ways of selecting the most appropriate cache line data to evict will be clear to the technician. The specific way of selecting the cache line data to be evicted can depend on the system, the program running at the processor, etc.

[0175] The memory interface or a coherency manager at the memory interface may be configured to determine whether there is an outstanding transaction (eg, a read request) on a cache line, and select a cache line of data for eviction only if it is determined that there is no outstanding transaction on the cache line.

[0176] Once overflow begins, candidate entries are selected in turn and read from the cache line status RAM. If the entry still contains a unique cache line, the overflow status bit is set for the entry and a flush is issued to the cache bank by the cache bank interface. Once a specified number of entries (e.g., as specified by a register) have gone through the process, or the required data structure space is reached through cache line evictions, the current overflow process ends, otherwise another data structure entry is selected. Once all cache lines in the overflow entry have been evicted and their responses received, the overflow bit is cleared and the entry can be reused.

[0177] Therefore, once the number of remaining available entries in the reverse conversion data structure 552 (e.g., PTT) at the coherency manager 322 reaches a predetermined threshold, the memory interface 318 is configured to begin instructing the cache libraries 331, 332 to evict cache line data to release more available entries. The threshold of the remaining space in the data structure 552 and the number of entries to be released once the threshold is reached can be defined in one or more overflow control registers, which can be implemented at the overflow control unit, as discussed in more detail below. The overflow control registers may include a spill_threshold register that defines a fill level threshold, i.e., a remaining space threshold at which the memory interface begins to overflow entries from the reverse conversion data structure. In one example, the spill_threshold register includes an 8-bit value, but values ​​of other sizes are possible. In one example, the default value of the spill_threshold register entry may be 16. The overflow control registers may include a spill_amount register that defines the number of entries that overflow once the threshold is reached. In one example, the spill_amount register includes an 8-bit value, but values ​​of other sizes are possible. In one example, the default value of the spill_number register entry may be 4.

[0178] The memory interface 318 may provide one or more status registers that allow performance analysis. The coherency manager 322 may provide one or more status registers. For example, the status registers may include a status_spilling register to indicate whether the spill control module is actively spilling cache lines from the memory interface.

[0179] The status registers may include a status_spill_entries register to indicate the number of reverse translation data structure entries that are being overflowed. Entries indicated as being overflowing are entries for which the memory interface has issued a refresh or is in the process of issuing a refresh for each active cache line, and are in a state of waiting for all such cache lines to be written back to memory before being available for reallocation. An address read (AR) transaction from the reverse translation data structure (e.g., translation table) on any of these entries will cause the memory interface to stall.

[0180] The status registers may include a status_active_entries register to indicate the number of data structure (eg, translation table) entries that are in an active state, ie, one or more cache lines are in a non-invalid state. This indicates the integrity of the data structure.

[0181] The status registers may include a status_snoop_count register to indicate the number of outstanding snoops from the snoop address (AC) channel 510 being processed within the memory interface.

[0182] Cache line lifecycle

[0183] The memory interface 318 is configured to keep track of coherent cache lines within the cache 330 so that it can respond to snoop requests issued by the bus 316 if another master attempts to access these same addresses at some point in time. The typical life cycle of a cache line is Figure 8 It is schematically shown in FIG.

[0184] It is useful to introduce some types of transactions. A read only transaction on a memory line invalidates all other copies of that memory line in other caches (i.e., all other cache lines related to that memory line in the coherent system) and reads the memory line from memory. Thus, a read only transaction is used to claim ownership of the associated cache line. A clean only transaction is similar to a read only transaction, but can be used in situations where reading the memory line is not required, i.e., the cache at the master device already has a copy of the memory line in the cache line. This transaction ensures that if the cache line at the master device is dirty, a copy of the cache line data is written back to the main memory. This transaction further ensures that all other copies of the cache line (i.e., copies of the memory line in other caches in the coherent system) are invalidated.

[0185] refer to Figure 8 , initially, all cache lines tracked by the memory interface 318 will start in an invalid state 802. Once the lowest level cache 330 issues a read unique transaction 804 or a clean unique transaction 806, the cache line can be considered to have entered a transient state in which the transaction is pending on the bus 316, which will ultimately cause the cache line to enter a unique state in which it exists only within that cache. However, it is worth noting that until this request is completed, the lowest level cache 330 will continue to respond to snoops as if the cache line does not exist, because from the system's perspective, the cache does not own the cache line until its bus transaction is processed and responded to by the interconnect. Therefore, it can be considered that any snoop requests received by the lowest level cache in the intermediate time period are ordered before the lowest level cache's own requests.

[0186] Once the lowest level cache 808, 810 receives a response to the transaction, it may be used to update the state of the cache line at the memory interface so that it is now considered to be owned by the lowest level cache. Once this state change is recorded, the memory interface is configured to issue a corresponding read / write acknowledgement signal on the ACE interface 514 to indicate to the interconnect that it is now safe to issue a snoop request for the same physical address to the lowest level cache, because the lowest level cache will now correctly respond that it owns that particular cache line.

[0187] A cache line may be evicted by an eviction or writeback process or transaction 816, depending on one of the Clean Unique 812 or Dirty Unique 814 states. As with other transaction types, the cache line will only return to the Invalid or Idle state 802 once the corresponding transaction is completed 818 on the bus. Furthermore, while cache evictions may occur naturally due to internal cache requests, this is also a very desirable behavior for the coherence scheme to work, because an incoming snoop request that detects a cache line in the Clean Unique or Dirty Unique state may then issue a request to the lowest level cache bank in question to forcibly evict the cache line (which will include writing back the data if the data is currently dirty). In this way, responding to a snoop request may cause the cache line to be forced into the Evicted Cache Line state 820, and a snoop response cannot be returned until the transaction is completed 818 and the cache line returns to the Invalid state 802, otherwise the interconnect may not accept any dirty data that was flushed by the cache at that stage.

[0188] As described above, the lowest level cache is a virtual index and virtual tag (VIVT) cache, i.e., a cache addressed in a virtual memory space. However, incoming snoop requests from the ACE protocol (e.g., on the snoop address channel 510) will always be provided with a physical address, so these requests are converted to virtual addresses to allow the lowest level cache library to issue a refresh for a specific cache line. To this end, the memory interface 318 is configured to maintain a mapping from physical to virtual addresses, such as a table of physical to virtual address mappings. Suitably, the reverse conversion data structure 552 includes a physical to virtual address mapping table. Physical to virtual address mapping can be completed with page granularity or cache line granularity. In one example, the memory interface (or, for example, the MMU at the memory interface) has a minimum granularity of 4KB. It is expected that variables or data related between the CPU and GPU will be in the same buffer. Therefore, there is a high probability of data locality. Therefore, using a 4KB granularity allows much fewer reverse conversion data structure entries to cover a much larger address space. Therefore, operating with a 4KB granularity or any other granularity that is actually greater than the minimum value helps to make the method implementation cost lower.

[0189] In one implementation, a memory interface (e.g., a reverse translation data structure at a memory interface) includes a fully associative table of 4KB aligned virtual addresses (V pages) and corresponding mappings to physical addresses (P pages). The table can be scaled to contain a variable number of entries to trade off area and capacity based on the maximum concurrent number of related 4KB pages that can be tracked by the memory interface within the lowest level cache at any one point in time. Augmenting the address mapping table are one or more cache line status data structures, e.g., RAM, containing the status of individual cache lines within a 4KB page. Once the table confirms whether a particular 4KB page is being tracked, it can be used to check individual cache line addresses.

[0190] Within a 4KB page, each 64-byte cache line is tracked by a separate state encoding (but cache lines of other lengths can also be tracked). The state encoding can include a finite state machine (FSM) or one or more state bits. The state encoding can be stored in RAM. This reduces the total number of triggers required in, for example, the coherence manager. Whenever the state of a cache line changes, the fields in the RAM corresponding to a given cache line can be updated to ensure that the coherence manager can correctly decide how to respond to subsequent snoop requests for the same address. In one implementation, the RAM can be divided into several instances, thereby reducing RAM access power and increasing the ability to access multiple entries in parallel. Further enhancements can be provided by implementing an L0 cache of recently used entries in registers.

[0191] Memory Interface Architecture

[0192] Now refer to Fig. 9 An example of a portion of the architecture of the memory interface 318 and an associated system is described.

[0193] The memory interface 318 includes a reverse translation module 550 having a reverse translation data structure 552, which in the illustrated example includes a page translation table (PTT) 554. The reverse translation module 550 is coupled to an overflow control unit 904, a cache line status unit 906 (which may include or have access to a cache line status data structure), and a snoop processor unit 908. The overflow control unit 904 is coupled to the cache line status unit 906. The cache line status unit 906 is coupled to the snoop processor unit 908. The memory interface 318 optionally also includes a cache bank interface 910 (the cache bank interface 910 may interface with each cache bank, or it may include multiple cache bank interface modules, each for interfacing with at least one cache bank). The cache bank interface 910 is coupled to the overflow control unit 904 and the snoop processor unit 908. The cache bank interface 910 may also be coupled to the cache line status unit 906. In the event that a cache bank interface 910 is not provided at the memory interface 318 (eg, because the cache includes one or more interface modules for interfacing with the cache bank), the overflow control unit 904, cache line status unit 906, and snoop processor unit 908 may each be coupled directly to the cache.

[0194] Overflow control unit 904 is configured to initiate and coordinate overflow operations. It is configured to monitor incoming writeback / eviction requests. Cache line status unit 906 is configured to store cache line status on a per-cache line granularity, optionally in multiple cache line status data structure instances, with crossbar switches and arbitration logic between input and cache line status data structure instances. The cache line status data structure instances may be RAM instances. Snoop processor unit 908 includes a snoop processor instance for each snoop address (AC) channel. For example, Figure 5 As shown, the coherency manager 322 at the memory interface 318 may include two snoop processor instances 541, 542, one for each of the bus interfaces 502, 504. Each snoop processor is configured to process snoops (snoop requests) and issue responses on the snoop response (CR) interface 512. The snoop processor unit 908 is configured to monitor incoming write-back / eviction requests and responses. The coherency manager 322 (optionally at the cache bank interface 910) is configured to issue refresh commands 520 to the cache banks 331, 332 based on signals generated at the overflow control unit 904 and the snoop processor unit 908. Where present, the cache bank interface 910 is configured to receive signals from the overflow control unit 904 and the snoop processor unit 908, and issue refresh commands on behalf of the overflow control unit and the snoop processor. Where present, the cache bank interface 910 may be configured to monitor incoming write-back / eviction requests.

[0195] Cache line status unit

[0196] The cache line state unit 906 will now be discussed in more detail. The cache line state of the cache line tracked by the reverse conversion module, for example, at the reverse conversion data structure, can be stored in one or more cache line state data structure instances. In one example, there are four cache line state data structures or RAM instances. Each cache line state data structure may include a single port. In an example of a system using a 4KB page and a 64-byte cache line size for each reverse conversion data structure entry, each of the four cache line state data structures is configured to maintain the state of 16 of the 64 cache line offset addresses present in the 4KB page. In another example of a system using a 4KB page, where there are four cache line state data structure instances and the cache line size is 128 bytes, each cache line state data structure is configured to maintain the state of 8 of the 32 cache line offset addresses. Each reverse conversion data structure entry can directly point to a corresponding address in the cache line state data structure instance. Providing multiple cache line state data structure instances allows the state of multiple cache lines in any reverse conversion data structure entry to be accessed simultaneously by different inputs.

[0197] In this example, it is expected that the required throughput for up to two sets of bus interfaces can be obtained by providing four cache line state data structures (e.g., four RAMs). For configurations with more bus interfaces, additional parallel RAM instances are provided to achieve the required throughput, but additional RAM will not be required in all cases. For example, an implementation using four bus interfaces may include four or eight RAM instances. Other numbers of RAM instances may be selected as needed. In actual implementations, the selection of the number of RAM instances may depend, among other things, on the results of performance testing.

[0198] The schematic diagram of the cache line status unit 906 architecture is shown in Fig.10 1004 receives input 1002 (discussed below). The crossbar / decode logic 1004 is coupled to RAM initialization logic 1006, which is coupled to four RAM instances 1008, 1010, 1012, 1014: RAM 0, RAM 1, RAM 2, and RAM 3. The four RAM instances are coupled to an overflow read multiplexer 1016, which is configured to receive an overflow control signal 1018. The overflow read multiplexer 1016 is coupled to read data decode logic 1020, which is configured to provide an output 1022.

[0199] The input 1002 of the cache line status unit may include:

[0200] A coherent read response, which may cause the state of a particular cache line to be written, e.g., the cache line is in a clean unique state;

[0201] Writeback / eviction requests, which may cause the state of a particular cache line to be written, e.g., the cache line is in an evicted state (i.e., the cache line is being evicted, but the eviction has not yet completed);

[0202] Coherent writeback / eviction responses, which can cause the state of a particular cache line to be written, e.g., the cache line is in an invalid state;

[0203] Snoop Read and / or Snoop Write, allowing each snooping processor (or snooping processor module) to read and / or write the state of a specific cache line.

[0204] Overflow control unit 904 is configured to provide input to cache line status unit 906. Input 1002 includes an overflow control write from overflow control unit 904. The signal input to overflow read multiplexer 1016 includes an overflow control read provided by overflow control read. Coupling the overflow control unit to the cache line status unit allows the overflow control unit 904 to read the status of all cache lines within a particular reverse translation data structure entry, and to write the status of a particular cache line.

[0205] Suitably, each cache line state requires 2 bits. Therefore, each of the four RAM instances is 32 bits wide. The depth of each RAM instance suitably corresponds to the number of reverse translation data structure entries.

[0206] The crossbar / decoding logic 1004 is configured to decode accesses to all inputs to determine the correct RAM (or more generally, the correct cache line state data structure) instance to which to direct the access (except for overflow control reads, which access all RAM instances). The accesses are mapped to the four RAM instances using the two least significant bits (LSBs) of the cache line offset. It can be assumed that similar cache line addresses may be received near the same time (e.g., when a large burst is divided across cache banks). Therefore, the first RAM instance 1008 may contain states for cache line offsets 0, 4, 8, etc. (for a four-RAM configuration), and the second RAM instance 1010 contains states for cache line offsets 1, 5, 9, etc. More generally, the states for cache line offsets may be sequentially contained in multiple RAM instances, and the states for multiple cache line offsets are greater than the number of RAMs that cycle through the available RAM instances. This configuration allows access to adjacent cache line addresses in parallel. The crossbar decoding logic 1004 drives the inputs of the arbiter of each RAM instance.

[0207] After reset, all locations in the RAM instance can be initialized to an invalid state. Initialization logic 1006 performs this operation after reset by writing zeros to each location in the RAM instance. These writes are multiplexed to the arbiter inputs, and all other inputs remain closed during initialization. Input accesses from the crossbar / decoding logic 1004 are arbitrated for each RAM instance. Reads and writes are arbitrated separately using, for example, a round-robin arbitration with equal priority for all inputs. Writes can take precedence over reads to ensure that if reads and writes to the same cache line occur in the same cycle, accesses occur in the correct order so that reads obtain the changes made by the writes. The arbitrator is also responsible for creating a complete write mask for RAM access based on the input cache line offset so that only the state of a specific cache line needs to be written.

[0208] The read from the overflow control unit 904 reads the state of all cache lines in the reverse transition data structure entry and therefore requires access to all RAM instances. In order to synchronize the reads of all four RAMs and ensure that the return data from all four RAMs can be returned to the overflow control unit at the same time without the need to go through the RAM pipeline back to the enable path of the arbiter, these reads are multiplexed after the arbiter when there is no request from the arbiter to any RAM instance.

[0209] The RAM instance, which may be a single-port RAM instance, contains a register pipeline through which sideband data is passed for read requests. The sideband includes fields for identifying the source of the read request, the cache line offset, and a pointer that the snooping processors use to write the state data they receive to the correct location in their internal buffers.

[0210] In one implementation, only one RAM instance can output the read data of a particular source in each clock cycle. This may be because there is no enable path through the RAM and the arbiter, and the access from a particular source is synchronized. The read data decode logic 1020 uses the ID field passed through the RAM instance pipeline to determine the correct output to be driven with the available RAM read data. The pipelined cache line offset is used to multiplex the correct bit from the RAM read data for the requested state and return it to the requester.

[0211] Each state of a cache line can be encoded as a four-state state machine. The states can include an "invalid" state, a "only P0" state, a "only P1" state, and an "eviction" state, such as Fig.11 Each cache line state may require 2 bits to encode these four states. Therefore, each of the four RAM instances is 32 bits wide. The depth of each RAM instance corresponds to the number of reverse translation data structure entries.

[0212] The invalid state 1102 occurs when the cache line has not been claimed by the GPU for unique ownership. This can occur after a reset. The cache line can move to the unique P0 state 1104 or the unique P1 state 1106 when a read unique or clean unique response is received, respectively.

[0213] In the unique P0 state 1104, the cache line is held uniquely by the GPU and is completely valid (i.e., Partial = 0: "P0"). In the case where the entire data stored in the cache line is valid, the cache line can be said to be completely valid. In the unique P1 state 1106, the cache line is held uniquely by the GPU and is partially valid (Partial = 1: "P1"). In the case where only a portion of the data stored in the cache line is valid, the cache line can be said to be partially valid. Completing a read unique transaction on a partially valid cache line will cause the cache line to become completely valid. Therefore, the state of the cache line will move from the unique P1 to the unique P0. If an eviction or writeback request is received, the state will move from the unique P0 state 1104 or the unique P1 state 1106 to the eviction state 1108. In the eviction state 1108, the cache line is in the process of being evicted as a result of snooping or because an entry is selected for overflow. Once the eviction is completed, the cache line returns to the invalid state 1102.

[0214] In order to ensure the correct ordering of coherent transactions and state changes between the bus and the coherent master device, the master device confirms the receipt of the response sent on the R (read response) and B (write response) channels by issuing signals on the RACK and WACK interfaces. This ensures that the bus can maintain a known order of transactions or responses sent on different interfaces such as R, B and AC (sniff request) channels. In this way, the bus, for example, ensures that a sniff cannot be received while a read response between the bus and the master device is in progress.

[0215] Acknowledge means that any cache line state changes required due to the receipt of a response have occurred. Acknowledgements can be sent in the same order as the responses were received on the bus, for example, on each listening address channel. Therefore, the memory interface will issue acknowledgement signals (RACK and / or WACK) while updating the cache line state data structure as a result of a read or write response. Acknowledgement signals (RACK and / or WACK) can also be sent for CPU incoherent read and write responses. In order to drive these outputs from a single location, the memory interface can also receive incoherent responses and use coherent responses to drive acknowledgement signal outputs in the correct order.

[0216] Cache library interface module

[0217] Now refer to Fig.12The cache bank interface module 910 is described. The cache bank interface module can manage the issuance of refresh commands from the overflow control and snooping processor to the lowest level cache bank. This module contains the crossbar switch and arbitration logic and the refresh buffer instance for each cache bank. This allows refreshes to be issued to each cache bank at the same time. The cache bank interface is also responsible for preventing duplicate refreshes that may cause data hazards.

[0218] Fig.12 An example of a cache bank interface is shown, wherein two cache banks are provided, cache bank 1 331 and cache bank 2 332. The crossbar switch / decode logic 1203 is configured to receive a signal 1201 from the snoop processor 908 (e.g., from a snoop buffer at the snoop processor) and a signal 1202 from the overflow control module 904. The crossbar switch / decode logic is coupled to two arbiters: a cache bank 1 arbiter 1204 and a cache bank 2 arbiter 1206. The cache bank 1 arbiter is coupled to a cache bank 1 flush buffer 1208, which is coupled to cache bank 1. The cache bank 2 arbiter is coupled to a cache bank 2 flush buffer 1210, which is coupled to cache bank 2.

[0219] In the example shown, the cache bank interface 910 has a single input 1202 from the overflow control and one input from each snoop processor (in Fig.12 The time taken to issue multiple flushes may be reduced by providing multiple inputs from the overflow control unit, allowing the overflow control unit to issue multiple flushes in the same cycle as long as the multiple flushes are directed to different cache banks.

[0220] The crossbar switch / decode logic 1203 is configured to determine the destination cache bank for each refresh input using the same address decoding mode and hash function used by the crossbar switch / decode logic 100. The refresh commands for each cache bank are arbitrated, for example, using a round-robin strategy with equal priority for all request sources. The selected input refresh is written to the refresh buffer instance 1208, 1210 corresponding to the cache bank.

[0221] The refresh buffer contains all refreshed entries to a specific cache storehouse. When the crossbar arbitration logic 1203 selects to refresh, the entry can be added to the refresh buffer 1208, 1210, and once the cache storehouse sets the corresponding refresh processing bit, the entry is removed from the refresh buffer. The exception to this is that a repeated refresh hazard is detected, wherein the refresh can be removed from the refresh buffer without being issued to the cache storehouse, or not added to the buffer at all. The cache storehouse interface can be configured to detect this repeated refresh hazard by monitoring the write interface. Repeated refresh can be prevented by making any entry with the same cache line address as the existing refresh in the refresh buffer inactive. The refresh in the entry stored in the refresh buffer 1208, 1210 can be sent to the cache storehouse based on FIFO. Each refresh buffer entry can store one or more of the virtual cache line address, context / PASID and reverse conversion data structure entry number. A control bit can also be provided, for example, to indicate whether the refresh is active and / or whether the refresh has been sent to the corresponding cache storehouse. The refresh buffer depth can be 4 entries per cache storehouse.

[0222] Bus Mapping

[0223] The reverse conversion data structure may include a list of memory addresses. Additionally or alternatively, the reverse conversion data structure may include a list of one or more memory address ranges. For example, the reverse conversion data structure may include a start address and an end address of a memory address range (or multiple start addresses and multiple end addresses of multiple memory address ranges). The memory address range may include an odd address or an even address. A group or set of memory addresses may include a list of memory addresses and / or one or more memory address ranges. More than multiple groups or sets of memory addresses may be provided. In one implementation, it may be determined whether the listening address has a matching entry in the reverse conversion data structure by comparing the listening address with the group or set of memory addresses. It may be determined that the listening address has a matching entry in the reverse conversion data structure, wherein the listening address is maintained in the reverse data structure or in the address range maintained in the reverse conversion data structure.

[0224] refer to Fig.13, the set of memory addresses may be associated with each of the plurality of bus interfaces 502, 504 (1302), for example, in a reverse translation data structure. When a memory request, such as a snoop request, is received at a bus interface (1304), a memory address identified in the request is determined. The determination may be made by the memory interface, for example, by a processor such as a snoop processor at a coherency manager. It is then determined at the memory interface (e.g., at the coherency manager) whether the identified memory address is associated with the bus interface 502, 504 that received the request (1306). The determination may be made with reference to the reverse translation data structure. For example, it may be determined at the memory interface (e.g., at the coherency manager) based on the reverse translation data structure whether the identified memory address is associated with the bus interface that received the request. It may be determined by the memory interface that the identified memory address is associated with the bus interface, wherein the identified memory address is included in a list of the reverse translation data structure and / or is part of or within one or more memory address ranges in the reverse translation data structure associated with the bus interface.

[0225] It is useful to determine whether the memory address identified in the request is associated with a specific bus interface for the following reasons. In the case where there are multiple bus interfaces and the memory request can be received through any bus interface, it is desirable to avoid processing duplicate requests. The memory request can be broadcast so that it is received through all bus interfaces. That is, the same memory request can be received separately at each bus interface. This can be done in the case where, for example, the bus is unclear which bus interface is the correct bus interface through which the request is sent, and therefore the request is sent through all bus interfaces to ensure that it is processed correctly. In this case, it is desirable to process the request only in the case where it is received through the correct bus interface. This can avoid multiple attempts to access the same data and can reduce wasteful processing. The "correct" bus interface is appropriately the bus interface associated with the memory address identified in the memory request, for example, at the reverse conversion data structure. In this way, for example, at the snooping processor, it can be determined whether the memory request should be processed.

[0226] If the identified memory address does not correspond to the set of memory addresses associated with the bus interface through which the request was received, the request is appropriately not processed. For example, the request does not cause the coherence manager to query the state of the page mapping, query the cache line status data structure, or access the cache. In some examples, the request can be ignored. However, this may cause data conflicts and / or other data hazards to occur. It is generally preferred to respond to each request even if the processing is not requested. Therefore, in the event that a memory request is not processed, a response can still be sent, for example, by a snooping processor. The response may indicate that the request has not been processed. In the event that a memory request is not processed, the snooping processor may be configured to respond as if the requested memory address is an invalid cache line.

[0227] If the identified memory address corresponds to the set of memory addresses associated with the bus interface through which the request was received, then the request is processed 1308. The request can be processed at the memory interface, for example, at a snooping processor. Processing the request can involve one or more of querying a state of a page mapping at a reverse translation module, querying a cache line state data structure, or accessing a cache.

[0228] This approach of processing only requests received through the correct bus interface can reduce processing overhead, for example, by reducing the number of requests that are processed unnecessarily. The number of requests propagated to the cache may be reduced, thereby saving cache processing overhead.

[0229] In some examples, a snoop request may be issued on all AC ports, and each snoop processor is configured to determine whether an address corresponding to the snoop address will be issued on the bus interface corresponding to the snoop processor, and will only look up the state if the instance number (i.e., the port and / or instance number of the snoop processor) (the port and instance number of the snoop processor may be the same) corresponds to the determined bus interface. Otherwise, the snoop processor is configured to treat the cache line as invalid.

[0230] Table 1 gives examples of bus interface numbers for four cache banks.

[0231] Library 0 Library 1 Library 2 Library 3 Single bus 0 0 0 0 Dual Bus 0 1 0 1 Four bus 0 1 2 3

[0232] Table 1 - Bus interface numbers for each library

[0233] In some examples, the request includes an address portion. The memory interface may be configured to map the address portion to a cache store in a first mapping. The memory interface may be configured to map the cache store to a bus interface in a second mapping. The memory interface may be configured to perform at least one of the first mapping and the second mapping by using a hash function (e.g., a single hash function). That is, in one example, a single hash function may perform both the first mapping and the second mapping.

[0234] The first mapping may be a one-to-one mapping between an address portion and a cache bank. The first mapping may allow a single address portion to be mapped to multiple cache banks. The second mapping may be a one-to-one mapping between a cache bank and a bus interface. The second mapping may allow one or more cache banks to be mapped to the same bus interface. The method allows a bus interface to be mapped to one cache bank, or a single bus interface to be mapped to multiple cache banks. A specific cache bank may be mapped to a single bus interface.

[0235] The memory interface may perform the first and / or second mapping at the reverse conversion module. The reverse conversion data structure may include the first and / or second mapping. A processor (e.g., a snoop processor) at the memory interface may be configured to perform the first and / or second mapping.

[0236] Suitably, the memory interface is configured to prevent repeated refreshes of cache lines that result in multiple write / eviction requests. Since cache line state may remain valid for a fully valid cache line for which a refresh request was received, if multiple such refreshes are erroneously issued, this may result in multiple writeback and / or eviction requests being erroneously issued to the memory. Therefore, repeated refreshes should be avoided.

[0237] Both the snoop processor and the overflow control module may issue a refresh to the same cache line, for example, if an overflow is started on an entry containing a unique cache line and then a snoop is received for the same cache line, or vice versa. The cache library interface can detect and remove incoming refreshes that match existing entries in the refresh buffer, but once the entry leaves the refresh buffer, the cache library interface is no longer able to detect such a hazard. Therefore, in addition to being sensitive to incoming write transactions, the snoop processor and the overflow buffer module can also be configured to be able to detect when the other of them issues a refresh to the cache line interface for the cache line for which they may issue a refresh themselves. This method also maintains this functionality in the absence of a cache library interface.

[0238] If both the overflow control and snoop processors attempt to issue a refresh to the cache bank interface module on the same cycle, one of them will be selected by the cache bank interface arbiter, and when enabled, the other of them will detect this and cancel its own refresh. When one of the snoop processor and the overflow buffer module has issued a refresh but is stopped by the cache line status module, both modules may only issue a refresh to the cache bank interface on the same cycle when or after writing to the cache line status module. This ensures that one module can miss a refresh from another module when reading the cache line status RAM.

[0239] Early processing of listen requests

[0240] In a system with multiple cache banks in a particular cache, a reverse conversion module or a reverse conversion data structure at the reverse conversion module provides the advantage of not needing to search each cache bank separately to determine the virtual address corresponding to the physical address associated with the received memory request. The reverse conversion module can identify the appropriate cache bank from the physical address associated with the received memory request. For example, the reverse conversion module can maintain a table that maps a physical address or a physical address range to multiple cache banks. In this way, when a memory request is received, the reverse conversion module can access the table to determine which of the multiple cache banks the physical address is mapped to. Then, only the relevant cache bank in the multiple cache banks needs to be accessed. This can reduce the load of other cache banks by avoiding unnecessary access to other cache banks, which may occur if they are searched to identify the correct cache bank. Therefore, the method can reduce interference in the operation of the cache and / or cache bank when a memory request is received. Therefore, access can be limited to cache banks that are known or more likely to return cache hits in response to a memory request. Additionally, the reverse translation module may determine that the cache does not include a mapping for the physical address from the memory request (e.g., no cache bank includes a mapping for the physical address from the memory request, such as would occur if the requested cache line is not already stored in the cache). In this case, the memory interface does not need to access the cache (e.g., any cache bank at the cache). This may improve performance by allowing a determination that the physical address of the memory request is not mapped to the cache without requiring access to the cache itself. Thus, the response may be sent by the memory interface without accessing the cache. This may reduce the time taken to issue the response and may reduce the load on the cache.

[0241] In the case where the reverse conversion data structure of the reverse conversion module does not contain a specific physical address, for example, because the processor has not accessed the physical address in the main memory and therefore the cache version has not yet been provided in the cache, no attempt to access the cache is required, otherwise a cache miss will result. Alternatively, the cache access step can be omitted, and the reverse conversion module can determine that there is (or will be) a cache miss. In response to determining that there is or will be a cache miss, the data at the specific physical address in the main memory can be accessed. This can reduce the delay in processing such a request, where there is a cache miss. The method can also reduce the unnecessary processing load on the cache.

[0242] The present technology allows memory requests in a coherent memory space to be processed at a coherence manager so that the memory requests can be processed more efficiently. For example, the coherence manager is suitably capable of processing memory requests so that the memory requests do not need to be processed entirely at or by the cache memory. Some memory requests, for example, memory requests that would result in a cache miss if processed at the cache memory, do not need to be passed to the cache memory. Instead, such memory requests are advantageously filtered out by the coherence manager so as not to occupy the processing time and / or bandwidth of the cache memory. Therefore, the coherence manager can be viewed as a "preprocessor" that can reduce the load on the processing cache memory itself. Suitably, the coherence manager can operate at least as fast as the cache memory (if not faster). Therefore, processing memory requests at the coherence manager, rather than requiring all requests to be passed to the cache memory, suitably improves the speed and / or efficiency of the entire system. The coherence manager is suitably configured to determine whether the identified memory address (i.e., the memory address identified in the memory request) is a memory address associated with a cache line at the cache memory. The coherency manager is suitably configured to process the memory request in accordance with whether the cache memory includes a cache line (and / or a state of the cache line, as will be further described below) associated with the identified memory address.

[0243] Suitably, the coherency manager is configured to output a response in response to determining that a memory address identified in the memory request is not associated with a cache memory in the reverse translation data structure. Suitably, the snoop processor is configured to output the response. Suitably, the response is output on the bus. Suitably, the coherency manager is configured to output the response directly. For example, the coherency manager is suitably configured to respond directly to such a memory request without accessing the cache memory.

[0244] This approach has the advantage of allowing memory requests to be processed without incurring the processing cost of accessing cache memory, without incurring the time cost due to delays at the cache memory, and / or without incurring the bandwidth cost of sending and receiving signals to and from the cache memory. This helps allow the coherency manager to efficiently process memory requests.

[0245] The coherency manager is suitably configured to process the memory request in response to determining at the snoop processor that the memory address identified in the memory request is associated with the cache memory in the reverse translation data structure. Processing the memory request may involve querying the reverse translation data structure for the state of the virtual page corresponding to the physical page associated with the memory request. The snoop processor is configured to process the memory request according to the state of the virtual page in the reverse translation data structure. In the case where the state of the virtual page is invalid, the snoop processor is suitably configured to respond to the memory request without accessing the cache line state data structure or the cache. In the case where the state of the virtual page is valid, the snoop processor suitably accesses the relevant cache line state data structure entry corresponding to the required cache line. The snoop processor is configured to process the memory request according to the state of the cache line in the cache line state data structure. In the case where the state of the cache line is invalid (e.g., no data is stored at the cache line, data stored at the cache line is corrupted, data stored at the cache line is evicted, etc.), the snoop processor is suitably configured to respond to the memory request without accessing the cache line at the cache. In the case where the state of the cache line is valid, the snoop processor may be configured to access the cache line at the cache and respond to the memory request according to the accessed cache line.

[0246] The above method can help reduce the processing load and bandwidth consumed by memory requests. In addition, the method can reduce the time required to process memory requests because accessing or querying the reverse transformation data structure and / or the cache line state data structure and outputting a response by the coherency manager based on the result of the access or query can be faster than accessing the cache memory itself.

[0247] In some examples, it may not be necessary to process a memory request at the cache memory, where the state of the cache line is pending eviction. In this case, the cache line exists in the cache memory, but eviction may be in progress (at some stage in the process) and a write back may also be performed if appropriate. In this case, it may be desirable to send a cache miss response in response to the memory request. Such a response can be sent without accessing the cache memory. The same is true for the other examples described above. It can be determined that a cache miss will occur, and the coherency manager can be caused to output a response accordingly.

[0248] The coherence manager may cause at least one of a write-back process and an eviction process to be performed with respect to a cache line based on a determination of a state of the cache line. In the event that a cache line state is determined to be clean (i.e., the data stored at the cache line in the cache is the same as the data in the corresponding data entry stored in the main memory), and the data stored at the cache line is required by another cache, the data stored at the cache line may be evicted from the cache so that it will not be inadvertently read in a subsequent transaction when it may no longer be up to date. In the event that the cache line is clean, no write-back transaction or write-back process needs to occur. Thus, the arrangement allows for quick and efficient identification of relevant cache lines and subsequent eviction of data stored at the cache line from the cache. Avoiding unnecessary cache line reads (if appropriate) before the data therein is evicted further helps to reduce latency in the system.

[0249] In the event that a cache line state is determined to be dirty (i.e., the data in the cache line has been modified in the cache since it was read from the main memory, and the version in the cache is up to date), the data in the cache line may be written back to the main memory before being evicted from the cache. This enables any subsequent transaction (e.g., a read transaction to a memory address corresponding to the cache data at the cache line) to access the latest version of the corresponding data entry. If write-back processing is appropriate, the reverse translation module (e.g., the reverse translation data structure) may allow a virtual address to be determined so that the cache line in the cache can be accessed and the data in the cache line written back to the main memory.

[0250] In the event that data in a cache line is evicted from the cache without being written back to main memory, a cache line may be indicated as invalid. This provides an indication that the cache line no longer holds valid data. Indicating a cache line as invalid means that subsequent read requests for that cache line will be cache misses. Indicating a cache line as invalid may be accomplished using a flag or other status indicator in the cache, a flag or other status indicator in a status data structure, or the like. Thus, existing data entries in the cache do not need to be rewritten in all examples, but may be done, for example, to increase data security. The cache line storing the evicted data may then become immediately available for writing new data to the cache.

[0251] This is not necessarily the case where a write-back transaction is required. In this case, the data from the cache line will be read so that it can be written back to the main memory. Therefore, the cache line may not be available to store new data until the read transaction is completed, and possibly until the corresponding write-back transaction on the main memory is completed. Typically, the data will remain in the cache line until a write-back confirmation is received, indicating that the write-back transaction has indeed completed. Receipt of this write-back confirmation indicates that it is no longer necessary to retain the data in this cache line in the cache because the write-back transaction has completed. However, as mentioned above, since the main memory is typically much slower than the cache, there will be increased latency due to the need to wait for the main memory to complete the transaction before the cache can proceed with the process of evicting the data in the cache line.

[0252] In some implementations, a portion of a cache (eg, a cache line) may be reallocated for storing new data before writing data already in the cache line back to memory is complete (ie, before a write-back confirmation is received).

[0253] The allocation of a cache line for storing new data (e.g., data stored at a new physical address in main memory) can be queued for later action. A queue can be formed at a memory interface. Data related to the new allocation can be stored at a reverse conversion module, for example, at a reverse conversion data structure. This allows processing of subsequent read transactions from above or below the lowest level cache in the hierarchy, for example, from a processor associated with the cache or from a processor coupled to the cache via a memory interface. For example, even before the allocation of new data to a cache line is completed, it can be determined at the reverse conversion module (e.g., from a reverse conversion data structure) whether a subsequent read transaction on the cache for the new data will be a cache miss or a cache hit for the queued allocation request.

[0254] If a subsequent read transaction would be a cache miss, the memory interface may cause a response to be sent to the request to indicate that the request resulted in a cache miss. The cache itself need not be accessed.

[0255] Note that the response need not be sent immediately; the responses may need to be output according to a particular order, for example, in an order corresponding to the order of the incoming memory requests. For example, this may need to satisfy a particular data protocol, as described below. Being able to pre-process received requests allows time to be saved. The responses can be queued until they are output in the correct order.

[0256] If the subsequent read transaction will be a cache hit (or possibly a cache miss if the allocation request was not queued), the result of the cache hit can be queued to await a response when appropriate. Note that although there is some latency in queuing the result of a cache hit to await a response, it may still reduce system latency because the process may be faster than if the result of the transaction was a cache miss and subsequently read the data from slower main memory.

[0257] Suitably, the coherency manager is configured to cause the memory request to be sent to the cache memory for processing at the cache memory. For example, in the event that a cache line exists in the cache memory and the cache line status data structure indicates, for example, that the status of the cache line is valid, the memory request may proceed to the cache memory. The cache memory may process the memory request. In accordance with or as part of processing the memory request, the cache memory is suitably configured to cause at least one of write-back processing and eviction processing to be performed with respect to the cache line.

[0258] The cache line status data structure is not required in all examples. For example, in the case where a cache line is present in the cache memory, the coherency manager can be configured to allow the memory request to pass to the cache memory, i.e., proceed to the cache memory for processing. It is not necessary to determine the state of the cache line at the cache memory. However, in the case where a cache line status data structure is present, it can be used to advantage to reduce the number of memory requests processed by the cache memory, thereby improving efficiency.

[0259] Suitably, allowing the memory request to proceed to the cache memory includes determining which of the multiple cache banks at the cache memory is associated with the identified memory address in the reverse conversion data structure, and passing the memory request to the corresponding cache bank based on the determination. The method allows the coherence manager to reduce the number of memory requests that proceed to any cache bank, and / or allows the memory request to be directed to the appropriate cache bank. For example, in the case of receiving a memory request such as a broadcast memory request over a bus, the coherence manager is appropriately configured to determine which cache bank (if any) holds the cache line associated with the identified memory address. If a particular cache bank holds the relevant cache line, the coherence manager can appropriately direct the memory request to the cache bank. In a coherent memory system, the memory location in the shared memory is appropriately claimed by one cache at a time. Therefore, if a particular cache bank holds a cache line associated with the identified memory address, no other cache bank will hold a cache line associated with the same identified memory address. This means that any memory request to those other cache banks will be redundant. Any such memory request will waste resources, such as processing time and / or bandwidth. Therefore, it is desirable that memory requests are directed only to the appropriate cache bank. Suitably, the coherency manager is configured, based on determining which cache bank is associated with the identified memory address in the reverse translation data structure, to pass the memory request only to the determined cache bank.

[0260] The coherency manager can be configured to monitor the bus (e.g., by monitoring the bus interface) for read requests to the memory that identify a read memory address and a response destination of the read request, and associate the read memory address with a cache memory corresponding to the response destination in a reverse translation data structure.

[0261] Suitably, the coherency manager is configured to associate a read memory address with a cache memory corresponding to a response destination by writing the read memory address into a reverse translation data structure. Monitoring the bus in this manner allows the coherency manager to track which cache memories (or cache banks) claim ownership of the cache line. It allows the coherency manager to automatically update the association between the memory address and the cache memory (or cache bank) in the reverse translation data structure. Tracking the memory address of the claimed cache line in this manner allows the coherency manager to efficiently process subsequently received memory requests, such as snoop requests. The response destination appropriately indicates the cache memory or cache bank of the device that issued the read request. In response to the read request, the coherency manager may associate the read memory address with the indicated cache memory or cache bank.

[0262] Figures 1-13 are shown as including many functional blocks. This is merely schematic and is not intended to define a strict division between the different logical elements of the entities shown in the figures. Each functional block may be provided in any appropriate manner. It should be understood that the intermediate values ​​described herein as being formed by the memory interface and / or the coherence manager need not be physically generated by the memory interface and / or the coherence manager at any point, and may merely represent logical values ​​that conveniently describe the processing performed by the memory interface and / or the coherence manager between its (or their) inputs and outputs.

[0263] The memory interface and / or coherence manager described herein may be implemented in hardware on an integrated circuit. The memory interface and / or coherence manager described herein may be configured to perform any of the methods described herein. In general, any of the functions, methods, techniques, or components described above may be implemented in software, firmware, hardware (e.g., fixed logic circuits), or any combination thereof. The terms "module," "function," "component," "element," "unit," "block," and "logic" may be used herein to generally represent software, firmware, hardware, or any combination thereof. In the case of a software implementation, a module, function, component, element, unit, block, or logic represents a program code that performs a specified task when executed on a processor. The algorithms and methods described herein may be performed by one or more processors that execute a code that causes (one or more) processors to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disks, flash memory, hard disk storage, and other memory devices that can use magnetic, optical, and other technologies to store instructions or other data and can be accessed by a machine.

[0264] The terms computer program code and computer readable instructions used herein refer to any type of executable code for a processor, including code expressed in machine language, interpreted language, or scripting language. Executable code includes binary code, machine code, byte code, code defining an integrated circuit (e.g., hardware description language or netlist), and code expressed in programming language code (e.g., C, Java, or OpenCL). Executable code can be, for example, any type of software, firmware, script, module, or library that, when properly executed, processed, interpreted, compiled, executed in a virtual machine or other software environment, causes a processor of a computer system supporting the executable code thereat to perform tasks specified by the code.

[0265] A processor, computer, or computer system may be any kind of device, machine, or special purpose circuit, or a collection or part thereof, having processing capabilities that enable it to execute instructions. A processor may be any kind of general or special purpose processor, such as a CPU, GPU, system on a chip, state machine, media processor, application specific integrated circuit (ASIC), programmable logic array, programmable gate array, field programmable gate array (FPGA), etc. A computer or computer system may include one or more processors.

[0266] It is also intended to include software that defines the hardware configuration described herein for use in designing an integrated circuit or for configuring a programmable chip to perform a desired function, for example, HDL (Hardware Description Language) software. That is, a computer-readable storage medium may be provided having encoded thereon computer-readable program code in the form of an integrated circuit definition data set that, when processed in an integrated circuit manufacturing system, configures the system to manufacture a memory interface and / or a coherence manager that is configured to perform any of the methods described herein, or to manufacture a memory interface and / or a coherence manager that includes any of the apparatus described herein. The integrated circuit definition data set may, for example, be an integrated circuit description.

[0267] A method of manufacturing a memory interface and / or a coherency manager as described herein in an integrated circuit manufacturing system may be provided. An integrated circuit definition data set may be provided which, when processed in an integrated circuit manufacturing system, causes execution of the method of manufacturing a memory interface and / or a coherency manager.

[0268] The integrated circuit definition data set may be in the form of computer code, for example, as a netlist, code for configuring a programmable chip, as a hardware description language that defines any level of integrated circuit, including as register transfer level (RTL) code, high-level circuit representations such as Verilog or VHDL, and low-level circuit representations such as OASIS (RTM) and GDSII. The higher-level representations (e.g., RTL) that logically define the integrated circuit may be processed at a computer system configured to generate a manufacturing definition of the integrated circuit in the context of a software environment, wherein the software environment includes definitions of circuit elements and rules for combining those elements to generate a manufacturing definition of the integrated circuit defined by the representation. As is typically the case with software that is executed at a computer system to define a machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required for a computer system configured to generate a manufacturing definition of an integrated circuit to execute the code that defines the integrated circuit to thereby generate a manufacturing definition of the integrated circuit.

[0269] Now refer to Fig.14An example of processing an integrated circuit definition data set in an integrated circuit manufacturing system to configure the system to manufacture a memory interface and / or a coherency manager is described.

[0270] Fig.14 An example of an integrated circuit (IC) manufacturing system 1402 configured to manufacture a memory interface and / or coherence manager as described in any of the examples herein is shown. Specifically, the IC manufacturing system 1402 includes a layout processing system 1404 and an integrated circuit generation system 1406. The IC manufacturing system 1402 is configured to receive an IC definition data set (e.g., defining a memory interface and / or coherence manager as described in any of the examples herein), process the IC definition data set, and generate an IC (e.g., which implements the memory interface and / or coherence manager described in any of the examples herein) based on the IC definition data set. The processing of the IC definition data set configures the IC manufacturing system 1402 to manufacture an integrated circuit that implements the memory interface and / or coherence manager described in any of the examples herein.

[0271] The layout processing system 1404 is configured to receive and process an IC definition data set to determine a circuit layout. Methods for determining a circuit layout from an IC definition data set are known in the art and may involve, for example, synthesizing RTL code to determine a gate level representation of a circuit to be generated, for example, in terms of logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining the positioning information of the logic components, the circuit layout can be determined from the gate level representation of the circuit. This can be done automatically or with user participation to optimize the circuit layout. When the layout processing system 1404 determines the circuit layout, it can output the circuit layout definition to the IC generation system 1406. The circuit layout definition can be, for example, a circuit layout description.

[0272] As is known in the art, IC generation system 1406 generates an IC according to a circuit layout definition. For example, IC generation system 1406 may implement a semiconductor device manufacturing process to generate an IC, and the semiconductor device manufacturing process may involve a multi-step sequence of photolithography and chemical processing steps during which electronic circuits are gradually formed on a wafer made of semiconductor material. The circuit layout definition may be in the form of a mask that can be used in a photolithography process for generating an IC according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 1406 may be in the form of a computer-readable code that IC generation system 1406 may use to form an appropriate mask for generating an IC.

[0273] The different processes performed by IC manufacturing system 1402 may all be implemented at one location (e.g., by one party). Alternatively, IC manufacturing system 1402 may be a distributed system such that some processes may be performed at different locations and may be performed by different parties. For example, some of the following stages may be performed at different locations and / or by different parties: (i) synthesizing RTL code representing an IC definition data set to form a gate-level representation of a circuit to be generated, (ii) generating a circuit layout based on the gate-level representation, (iii) forming a mask based on the circuit layout, and (iv) using the mask to manufacture the integrated circuit.

[0274] In other examples, processing of an integrated circuit definition data set at an integrated circuit manufacturing system may configure the system to manufacture a memory interface and / or a coherency manager without requiring processing of the IC definition data set to determine a circuit layout. For example, an integrated circuit definition data set may define a configuration for a reconfigurable processor such as an FPGA, and processing of the data set may configure the IC manufacturing system to generate a reconfigurable processor having the defined configuration (e.g., by loading the configuration data into the FPGA).

[0275] In some embodiments, the integrated circuit manufacturing definition data set, when processed in the integrated circuit manufacturing system, can cause the integrated circuit manufacturing system to generate the device described herein. Fig.14 Configuration of an integrated circuit manufacturing system by means of an integrated circuit manufacturing definition data set in the described manner may enable the apparatus described herein to be manufactured.

[0276] In some examples, the integrated circuit definition data set may include software that runs on or in conjunction with hardware defined in the data set. Fig.14 In the example shown, the IC generation system may also be configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined in the integrated circuit definition dataset when manufacturing the integrated circuit, or to otherwise provide program code to the integrated circuit for use with the integrated circuit.

[0277] Compared to known implementations, the implementations of the concepts set forth in the present application in devices, apparatuses, modules and / or systems (and methods implemented herein) can produce performance improvements. Performance improvements can include one or more of increased computing performance, reduced latency, increased throughput, and / or reduced power consumption. During the manufacture of such devices, apparatuses, modules and systems (e.g., integrated circuits), performance improvements can be weighed against physical implementations to improve manufacturing methods. For example, performance improvements can be weighed against layout areas to match the performance of known implementations but using less silicon. For example, this can be accomplished by reusing functional blocks in a serial manner or sharing functional blocks between elements of devices, apparatuses, modules and / or systems. In contrast, the concepts of improvements (e.g., reduced silicon area) in the physical implementations of the generation devices, apparatuses, modules and systems set forth in the present application can be weighed to improve performance. For example, this can be accomplished by manufacturing multiple instances of a module within a predefined area budget.

[0278] The applicant hereby independently discloses each individual feature described herein and any combination of two or more such features, so that such features or combinations can be performed based on this specification (as a whole) according to the common general knowledge of those skilled in the art, regardless of whether such features or feature combinations solve any problems disclosed herein. In view of the above description, it is obvious that those skilled in the art can make various modifications within the scope of the present invention.

Claims

1. A coherency manager for receiving a snoop request addressed in a physical address space, the snoop request being related to a cache memory addressable using a virtual address space, the cache memory having a plurality of coherent cache lines, the coherency manager include: a reverse translation module configured to maintain a mapping from a physical address to a virtual address for each coherent cache line held in the cache memory; as well as A monitoring processor, wherein the monitoring processor is configured to: receiving a monitoring request associated with a physical address; In response to the received snoop request, determining whether the physical address is mapped to a virtual address in the reverse translation module; and processing the monitoring request based on the determination; The coherency manager is configured to, upon determining that the reverse translation module does not include a mapping from the physical address to the virtual address space, send a response to the snoop request without accessing the cache memory.

2. The coherency manager according to claim 1, in, The reverse translation module includes logic to calculate the virtual address from the physical address based on a known relationship between the physical address space and the virtual address space.

3. A coherency manager according to claim 1 or 2, in, The reverse translation module includes a reverse translation data structure configured to maintain a mapping from the physical address space to the virtual address space.

4. The coherency manager according to claim 3, in, The reverse translation data structure includes a directory linking physical addresses in the physical address space to corresponding virtual addresses in the virtual address space.

5. The coherency manager according to claim 1 or 2, in, The coherency manager is configured to, upon determining that the reverse translation module includes a mapping from the physical address to the virtual address space, access a cache line status data structure configured to store status information related to the cache line at the cache memory, and cause a response to the snoop request to be sent based on the stored status information.

6. The coherency manager of claim 5, in, In a case where the state information related to the cache line indicates that the cache line is at least one of the following: does not exist, Inactive is experiencing overflow, and Writeback or eviction processing is in progress, The coherency manager is configured to determine that the snoop request resulted in a cache miss and cause a corresponding response to the snoop request to be sent on a bus.

7. The coherency manager of claim 5, in, In a case where the state information related to the cache line indicates that the cache line exists and is in a clean state, the coherency manager is configured to cause the cache line to be evicted and the cache memory to not write data at the cache line back to the main memory, and the coherency manager is configured to process the snoop request without accessing the cache memory.

8. The coherency manager of claim 5, in, In a case where the state information related to the cache line indicates that the cache line exists and is in a dirty state, the coherency manager is configured to cause the cache memory to be accessed to read the cache line for writing the cache line back to a main memory, and to cause the cache line to be evicted from the cache memory.

9. The coherency manager of claim 3, in, The reverse translation data structure is configured to store data at a page granularity.

10. The coherency manager of claim 5, in, The cache line status data structure is configured to store the status information at a cache line granularity.

11. The coherency manager of claim 5, in, The cache line state data structure includes a plurality of RAM instances, and the coherency manager is configured to access more than one of the RAM instances simultaneously.

12. The coherency manager of claim 5, in, The cache line state data structure includes an entry for at least one coherent cache line located at a page mapped by the inverse translation data structure.

13. The coherency manager of claim 12, in, The cache line status data structure includes a plurality of status bits regarding the at least one coherent cache line.

14. A coherency manager according to claim 1 or 2, in, The snoop processor is configured to monitor a memory bus coupled to the coherency manager for read requests to main memory and cause status information in the cache line status data structure to be updated in response to the monitored read requests.

15. The coherency manager according to claim 1 or 2, in, The snoop processor comprises a buffer for storing received snoop requests.

16. The coherency manager of claim 15, in, The snoop processor is configured to process the snoop requests on the buffer in an order different from the order in which the snoop requests were received.

17. The coherency manager according to claim 1 or 2, in, The snoop processor includes control logic for at least one of controlling access to the cache line status data structure, accessing the cache memory, sending commands to the cache memory, and issuing responses to snoop requests.

18. A method for processing a snoop request addressed in a physical address space, the snoop request being associated with a cache memory having a plurality of coherent cache lines and being addressable using a virtual address space, the method include: receiving a monitoring request associated with a physical address; determining whether the physical address is mapped to a virtual address based on a mapping from physical addresses to virtual addresses maintained for each coherent cache line held in the cache memory; and processing the monitoring request based on the determination; Processing the snoop request includes, when it is determined that the physical address is not mapped to the virtual address, sending a response to the snoop request without accessing the cache memory.

19. A computer readable storage medium having stored thereon a computer readable description of an integrated circuit, the computer readable description, when processed in an integrated circuit manufacturing system, causing the integrated circuit manufacturing system to manufacture a coherency manager for receiving a snoop request addressed in a physical address space, the snoop request being related to a cache memory addressable using a virtual address space, the cache memory having a plurality of coherent cache lines, the coherency manager include: a reverse translation module configured to maintain a mapping from a physical address to a virtual address for each coherent cache line held in the cache memory; as well as A monitoring processor, wherein the monitoring processor is configured to: receiving a monitoring request associated with a physical address; In response to the received snoop request, determining whether the physical address is mapped to a virtual address in the reverse translation module; and processing the monitoring request based on the determination; The coherency manager is configured to, upon determining that the reverse translation module does not include a mapping from the physical address to the virtual address space, send a response to the snoop request without accessing the cache memory.

Citation Information

Patent Citations

  • An apparatus and method for operating a virtually indexed physically tagged cache

    GB201518257D0

  • Method and mechanism to use a cache to translate from a virtual bus to a physical bus

    US20020073281A1

  • Systems and methods for processing memory requests

    US20110060879A1

  • Enforcing ordering of snoop transactions in an interconnect for an integrated circuit

    US20160055085A1

  • Microprocessor having improved memory management unit and cache memory

    US6598128B1