Directory access method, consistent directory and processor chip

By dividing the consistency directory into virtual groups and using different indexing functions, the latency and security issues of cache consistency protocols in multi-core processor systems are resolved, resulting in more efficient directory access and improved system performance.

CN122111889APending Publication Date: 2026-05-29LOONGSON TECH CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LOONGSON TECH CORP
Filing Date
2026-04-09
Publication Date
2026-05-29

Smart Images

  • Figure CN122111889A_ABST
    Figure CN122111889A_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a directory access method, a consistent directory and a processor chip, and the method comprises the following steps: querying the consistent directory based on a request address; the consistent directory is divided into a plurality of virtual groups based on index bits, each virtual group comprises a first part and a second part; the first part is used for storing a plurality of directory entries, and different index functions are used in each path in the same virtual group; the second part is used for storing the positions of invalid directory entries in the same virtual group; based on the first part and the second part obtained by querying, a target operation to be executed is determined, and the target operation comprises one of the following: an update operation, a replacement operation, an insertion operation, a moving and insertion operation; the target operation is executed in a target virtual group, and the first part and / or the second part are updated. On the basis of reducing the number of reading SRAM and the control complexity, the embodiment of the present application can reduce the replacement operation of the directory entry, so that the access delay is reduced and the system performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a directory access method, a consistent directory, and a processor chip. Background Technology

[0002] In multi-core processor systems, each core typically has its own private cache to improve data access speed. However, when multiple cores simultaneously access and modify the same data in shared memory, data inconsistencies may arise between the private caches. Therefore, cache coherence protocols are needed to ensure correct execution.

[0003] In cache consistency protocols, the consistency directory is widely used to track the distribution of shared data across core caches. Due to limited storage resources, the number of directory entries has an upper limit. When the cached memory area exceeds the directory capacity, old entries must be replaced to accommodate new ones.

[0004] To ensure consistency, the private cache lines corresponding to the replaced old directory entries need to be marked as invalid. This has two major drawbacks: First, after the cache line is invalidated, the core needs to read the data from the main memory again, which increases access latency and reduces system performance. Second, observable changes in the cache state can be used by attackers to build side-channel attacks, steal sensitive information, and threaten system security. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a directory access method that overcomes or at least partially solves the above problems. By reducing the number of SRAM reads and control complexity, the method can reduce the occurrence of directory entry replacement operations, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0006] Accordingly, embodiments of the present invention also provide a consistency catalog and processor chip to ensure the implementation and application of the above methods.

[0007] In a first aspect, embodiments of the present invention disclose a directory access method, the method comprising: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

[0008] Secondly, embodiments of the present invention disclose a consistency catalog applied to a multi-core processor system, the consistency catalog comprising: Directory storage, configured to store multiple directory entries; and The directory controller, coupled to the directory storage, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

[0009] Thirdly, embodiments of the present invention disclose a processor chip, comprising: Multiple processor cores, each core including a private cache for storing copies of cache lines; On-chip network, providing interconnect communication paths between the multiple processor cores and the consistency catalog subsystem; and The consistency catalog subsystem, coupled to the on-chip network, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

[0010] The embodiments of the present invention have the following advantages: The consistency directory structure proposed in this invention divides the directory into several virtual groups based on index bits. Each virtual group includes a first part and a second part. The first part stores multiple directory entries, and within the same virtual group, each path uses a different indexing function, i.e., each virtual group adopts a skewed concatenation structure. When querying the consistency directory, all the information required to complete subsequent operations can be read from a single virtual group at once, such as a directory entry at each mapping position of the requested address within that virtual group, and the validity information of that virtual group represented by the second part. Therefore, only the first part and the second part need to be read once each to obtain all the required information, reducing the number of SRAM reads and control complexity.

[0011] Based on the consistent directory structure of this invention, using skewed associations within groups can reduce index conflicts. Furthermore, in the event of an index conflict, if there are empty positions within the virtual group, a move and insertion operation can be performed within the virtual group, which can reduce the occurrence of replacement operations, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0012] Furthermore, this embodiment of the invention divides the consistent directory structure into two parts, using an independent structure to record the location of invalid directory entries within the same virtual group. This allows for the determination of whether a directory entry is invalid without reading it, further reducing the number of SRAM reads while minimizing replacement operations and improving system performance. Moreover, the storage and power overhead introduced by this invention is minimal, and it does not require modification of the traditional directory pipeline structure, resulting in low control complexity and wide applicability. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating the steps of an embodiment of the directory access method of the present invention; Figure 2 This is a schematic diagram of the structure of a consistency catalog according to the present invention; Figure 3 This is a schematic diagram of the move and insert operation in Example 1 of the present invention; Figure 4 This is a schematic diagram of another consistency catalog structure of the present invention; Figure 5 This is a structural block diagram of an embodiment of the directory access device of the present invention; Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0014] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0015] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, the first object can be one or more. Furthermore, the term "and / or" in the specification and claims is used to describe the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. In embodiments of this invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0016] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a directory access method according to the present invention, the method including the following steps: Step 101: Query the consistency directory based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Step 102: Based on the first and second parts retrieved, determine the target operation to be performed; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; Step 103: Perform the target operation in the target virtual group that the requested address hits, and update the first part and / or the second part of the target virtual group.

[0017] The directory access method provided in this invention can be applied to multi-core processor systems. A multi-core processor system refers to a computing system integrating multiple processor cores, each of which can independently execute instructions and has concurrent access requirements to shared memory. Each core includes a private cache for storing copies of cache lines; a cache line is a data block of fixed size in the system's main memory. Multiple cores are interconnected via an on-chip network and share the system's main memory. The system further includes a consistency directory subsystem, which maintains the distribution information of the copies of the cache lines in the private cache through the consistency directory. The multi-core processor system can be a single multi-core chip or a multi-processor system composed of multiple chips, covering computing devices such as servers, personal computers, and embedded devices.

[0018] Each processor core can independently execute program instructions, process data, and includes a private Level 1 cache (L1 cache) and Level 2 cache (L2 cache). The multi-core processor system may further include a shared LLC (Last Level Cache), which is accessed by all cores via an on-chip network.

[0019] It should be noted that this application does not limit the specific cache hierarchy. The private cache can be single-level (e.g., L1 cache only) or multi-level (e.g., L1 and L2 caches); the L2 cache can be private to each core or shared by a cluster of multiple cores; the last-level cache can be chip-level shared or distributed. Regardless of the cache hierarchy, as long as multiple private caches exist and data consistency needs to be maintained among them, the technical solution provided in this application is applicable.

[0020] It is understood that the multi-core processor system may contain 2, 4, 8, 16, 32, 64 or more cores, and increasing the number of cores does not affect the applicability of the technical solution of this application. The consistency directory uses on-chip SRAM (Static Random-Access Memory) as a carrier, and each directory entry in the directory is used to maintain the distribution information of a copy of a cache line in the private cache. The consistency directory can be centralized or distributed, and can be integrated into an LLC or used as an independent module.

[0021] Furthermore, the consistency catalog subsystem may include a consistency catalog and a catalog controller; the catalog controller is used to maintain the consistency catalog in response to kernel access requests for cached lines.

[0022] The purpose of this invention is to solve the problem of frequent directory item replacement at a lower cost, reduce the occurrence of replacements, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0023] Based on this, embodiments of the present invention propose a structure for a consistency directory, wherein the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store validity information corresponding to the same virtual group in the first part, and the validity information includes the position of invalid directory entries within the virtual group.

[0024] For example, each channel of the first part includes one or more SRAMs, and the second part includes one or more SRAMs.

[0025] It should be noted that the specific format of the directory entries in this embodiment of the invention is not limited. For example, the directory entry is used to record the sharing information of a cache line and the address tag of the cache line. The sharing information is used to identify the processor core currently holding a copy of the cache line. The address tag is used to uniquely identify the memory cache line corresponding to the directory entry. The address tag is the high-order part of the requested address. When a directory lookup occurs, the tag bit of the requested address is compared with the address tag stored in the directory entry. If they match and the directory entry is valid, it is determined that the directory entry has been matched.

[0026] In addition, the directory entry may optionally include at least one of the following: valid bits: used to indicate whether the directory entry currently stores valid consistency information; consistency status: used to indicate the current consistency protocol status of the cache line, including but not limited to modified, exclusive, shared, invalid, etc.

[0027] Reference Figure 2 The diagram illustrates a structural schematic of a consistency directory according to the present invention. Figure 2 As shown, the consistency directory includes a first part (also known as the directory entry storage part) and a second part (also known as the validity record part). Both parts are logically grouped according to the index bits corresponding to the directory entries, and are called virtual groups.

[0028] The first part is divided into multiple paths for storing multiple directory entries. Each path corresponds to one or a group of physical memory locations, and the path division is orthogonal to the virtual group division. Within each virtual group of the first part, a skewed associative structure is used, meaning each path uses a different hash function to map addresses to storage locations. The second part stores the locations of invalid directory entries within the same virtual group of the first part.

[0029] The requested address can be a memory access address issued by the processor core. This memory access address is typically divided into three parts: an address tag, an index, and a block offset. The address tag (e.g., the high-order bits) uniquely identifies a cache line in the cache or directory. The index (e.g., the middle bits) locates the virtual group in the consistency directory. The block offset (e.g., the low-order bits) selects a specific byte or word within the cache line.

[0030] The query for the consistency directory based on the requested address may specifically include: determining the target virtual group in the consistency directory based on the index of the requested address, and reading the second part of the target virtual group; and calculating the address tag of the requested address using different hash functions to obtain the mapping position of the requested address in each path of the target virtual group, and reading the first part corresponding to the mapping position.

[0031] In Example 1, a consistency directory is queried based on the requested address Y. First, based on the index of the requested address Y (e.g., ... Figure 2 The Virtual Set Index (VSE) determines the target virtual group in the consistency directory. Assuming the target virtual group is set0, the second part of the target virtual group is read. Assume the read second part records the following position pointers: ptr1 and ptr2. Assume ptr1 points to the first position in the second path of the target virtual group set0, denoted as (2,2). ptr2 points to the first position in the third path of the target virtual group set0, denoted as (3,1). Then these two positions are empty, meaning they both store invalid directory entries, or neither of these positions stores a valid directory entry.

[0032] The address tag of the request address Y is calculated using different hash functions to obtain the mapping position of the request address Y in each path of the target virtual group set0, and the first part corresponding to each mapping position is read.

[0033] Taking a 3-way directory entry as an example (e.g.) Figure 2 Let's consider the three paths (way1, way2, and way3) in the target virtual group set0. Assume that way1 uses hash function hash1, way2 uses hash function hash2, and way3 uses hash function hash3. For the tag of the request address Y, hash function hash1 is used to calculate the mapping position of the request address Y in way1 of the target virtual group set0, such as the first position in way1 of set0 (e.g., the first row of way1). The first part corresponding to this position is read, that is, the directory entry stored at this position is read. For the tag of the request address Y, hash function hash2 is used to calculate the mapping position of the request address Y in way2 of the target virtual group set0, such as the second position in way2 of set0 (e.g., the second row of way2). The directory entry stored at this position is read. For the tag of the request address Y, hash function hash3 is used to calculate the mapping position of the request address Y in way3 of the target virtual group set0, such as the third position in way3 of set0 (e.g., the third row of way3). The directory entry stored at this position is read.

[0034] It should be noted that, Figure 2 In this context, `concat` is short for `concatenate`, meaning to concatenate. When locating a virtual group, only the index (Virtual Set Index) is used; when locating the mapping position of each path within that virtual group, only the hash calculation result of the tag is used. For ease of demonstration, Figure 2 The two steps are combined into a single concat expression.

[0035] Based on the request type (such as read missing, write request, or eviction notice) and the first and second parts read, the target operation to be performed can be determined; the target operation includes one of the following: update operation, replacement operation, insertion operation, and move and insert operation.

[0036] The update operation refers to modifying the internal state information of an existing directory entry in the consistency directory. The internal state information includes at least one of the following: sharer information, consistency state, and valid bits. The triggering condition for the update operation includes: the request address matches the consistency directory, meaning the directory entry corresponding to the request address already exists in the consistency directory.

[0037] The replacement operation refers to replacing an old directory entry in the consistency directory with a new directory entry. Before the replacement, all private cache copies recorded by the old directory entry must be invalidated, and then the old directory entry is overwritten with the new directory entry. The triggering conditions for the replacement operation include: the request address does not hit the consistency directory, that is, the directory entry corresponding to the request address does not exist in the consistency directory, and all mapping locations of the request address in the consistency directory have stored valid directory entries.

[0038] The insertion operation refers to writing a new directory entry into an empty position in the consistency directory. The triggering conditions for the insertion operation include: the request address does not match the consistency directory, that is, the directory entry corresponding to the request address does not exist in the consistency directory, and there is an empty position in the mapping position of the request address in the consistency directory.

[0039] The move-and-insert operation refers to moving an old directory entry from position A to position B within a virtual group in the consistency directory, and writing a new directory entry to position A. The triggering conditions for the move-and-insert operation include: the requested address does not match the consistency directory, meaning the directory entry corresponding to the requested address does not exist in the consistency directory; all mapping positions of the requested address in the consistency directory have stored valid directory entries, but there exists a directory entry in a certain mapping position that is the target directory entry; the address label recorded by the target directory entry exists in another path at the target location, and the target location is an empty location.

[0040] The move and insert operation moves an old directory entry from its original position (position A) to an empty position (position B) in the mapping position of the old directory entry in other paths within the virtual group, thereby freeing up an empty position (position A) for the requested address so that a new directory entry created for the requested address can be written to position A, thus avoiding the need to perform a replacement operation.

[0041] In this embodiment of the invention, the target operation triggered by a request address is performed only within the corresponding target virtual group. For example, for a request address Y, assume the corresponding target virtual group is a. If the target operation is an update or replacement operation, the updated or replaced directory entry must be located in virtual group a; if the target operation is an insert operation, the new directory entry must be written to virtual group a; if the target operation is a move and insert operation, the moved directory entry must be moved from one position to another in virtual group a, and the newly inserted directory entry must be inserted into the original position of the moved directory entry.

[0042] In practical implementation, if a skewed connection structure is used directly without dividing into virtual groups, when a move operation is needed, a directory entry in one path may be mapped to any position in another path. Reading all directory entries to determine if they are invalid incurs a huge overhead, making it difficult to implement. Therefore, it is necessary to read the directory entries mapped to the other paths based on the address label in the directory entry to determine if there is an empty position to move the directory entry. This requires multiple SRAM reads. Since each potentially moveable directory entry requires an SRAM read, the number of additional SRAM reads is at most equal to the number of paths.

[0043] The consistent directory structure proposed in this invention divides the directory into several virtual groups based on index bits. When a move operation is required, a directory entry in a certain path will only be mapped to its own virtual group. By simply reading the validity information of that virtual group in the second part, it can be determined whether there is an empty position in that virtual group that can be used to move the directory entry read from the first part, which can greatly reduce the number of SRAM reads. In addition, the overhead of reading the second part once (if the second part uses a finite pointer form, only a small number of bits need to be read) is very small, usually no more than the overhead of reading a directory entry in a certain path once.

[0044] The consistency directory structure proposed in this invention divides the directory into several virtual groups based on index bits. Each virtual group includes a first part and a second part. The first part stores multiple directory entries, and within the same virtual group, each path uses a different indexing function, i.e., each virtual group adopts a skewed concatenation structure. When querying the consistency directory, all the information required to complete subsequent operations can be read from a single virtual group at once, such as a directory entry at each mapping position of the requested address within that virtual group, and the validity information of that virtual group represented by the second part. Therefore, only the first part and the second part need to be read once each to obtain all the required information, reducing the number of SRAM reads and control complexity.

[0045] Based on the consistent directory structure of this invention, using skewed associations within groups can reduce index conflicts. Furthermore, in the event of an index conflict, if there are empty positions within the virtual group, a move and insertion operation can be performed within the virtual group, which can reduce the occurrence of replacement operations, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0046] This invention does not restrict the way virtual groups are divided; they can be divided arbitrarily. To improve performance, when designing the consistency directory, the index bits of the directory can be consistent with the index bits of the private cache. This aligns the organizational structure of the directory with that of the private cache, ensuring that the same address maps to the same group number in both the private cache and the directory. Therefore, after alignment, the number of private cache copies required for the directory within each virtual group is fixed, preventing this number from fluctuating due to different addresses, and thus reducing the number of replacements (i.e., reducing mapping location conflicts). The index bits are the bits in the memory address used to locate the cache group; assuming they are the middle 3 bits of the memory address, the index bits in the consistency directory used to locate the virtual group also use the middle 3 bits of the memory address.

[0047] In an optional embodiment of the present invention, the index bit for dividing the virtual group is the same as the index bit of the private cache connected to the group, and the size of a single virtual group is the same as the sum of the connectivity of the private caches. For example, if there are 16 private caches, each with 8 paths, then the sum of connectivity is 8 × 16 = 128. After determining the size of the virtual group, dividing by the number of paths gives the number of rows per path within the virtual group. The number of paths needs to be determined by weighing physical implementation factors, etc. To maximize the effect, the number of paths should not be less than the number of rows within the virtual group, that is, not less than the arithmetic square root of the sum of the connectivity of the private caches.

[0048] In an optional embodiment of the present invention, determining the target operation to be performed based on the first and second parts retrieved may include: Based on the first part of the query, determine whether the requested address already has a corresponding valid directory entry in the consistency directory; if so, determine that the target operation to be performed is an update operation. Otherwise, determine whether there is an empty position among all the mapping positions of the requested address in the consistency directory; if so, determine that the target operation to be executed is an insertion operation. Otherwise, determine whether a target directory entry exists in all the directory entries of the mapping locations of the requested address in the consistency directory; if so, determine that the target operation to be performed is a move and insert operation; the address label recorded by the target directory entry has a target location in other paths, and the target location is recorded in the second part; Otherwise, the target operation to be executed is determined to be a replacement operation.

[0049] In one example, the process of accessing the consistency directory for a request address issued by a certain processor core is as follows: First, the target virtual group is determined in the consistency directory based on the index of the request address, and the validity record part of the target virtual group is read (second part); then, the mapping position of the address in each path in the target virtual group is calculated through different hash functions, and the directory entry storage part of each mapping position is read (first part).

[0050] Then, the target operation to be performed is determined based on the request type and the content to be read. If the requested address already has a corresponding valid directory entry in the consistency directory (i.e., a directory entry is matched), and no new directory entry needs to be allocated, then the target operation to be performed is determined to be an update operation. The existing directory entry is updated directly, and the update content includes sharer information and / or consistency status, etc.

[0051] If the requested address does not have a corresponding valid directory entry in the consistency directory (i.e., the directory entry is missing), and a new directory entry needs to be allocated, then it is determined whether there is an empty position among all the mapping positions of the requested address in the consistency directory. An empty position means that the position has not yet stored a valid directory entry, or that the position stores an invalid directory entry.

[0052] Whether a directory entry stored at a certain location is valid or invalid can be determined by the valid bit in that directory entry. The valid bit is a 1-bit flag used to indicate whether the directory entry currently stores valid consistency information. For example, a valid bit of 1 indicates that the directory entry is in use, and the stored address tag and consistency information are valid, corresponding to a cache line that is being cached. A valid bit of 0 indicates that the directory entry is invalid, and the stored address tag and consistency information are invalid (possibly residual old data), and new requests can directly overwrite it.

[0053] Taking Example 1 as an example, assuming the target virtual group is determined to be set0 in the consistency directory based on the index of the request address Y, the address label of the request address Y is calculated using different hash functions to obtain the mapping position of the request address Y in each path of the target virtual group set0, such as: the first row of the first path, the second row of the second path, and the third row of the third path, denoted as (1,1), (2,2), and (3,3) respectively. If there are empty positions among these mapping positions, the target operation to be performed is determined to be an insertion operation, and a new directory entry allocated for the request address Y is directly written into the empty position.

[0054] If all mapping locations of the requested address in the consistency directory have stored valid directory entries and there are no empty locations, then it is determined whether a target directory entry exists among the directory entries stored in all mapping locations of the requested address in the consistency directory; the target directory entry satisfies the following condition: the address label recorded by the target directory entry has a target location in another path, and the target location is recorded in the second part.

[0055] For example, in Example 1, the requested address Y has valid directory entries stored at each mapping position in the target virtual group set0. However, the directory entry stored at the first row of the first path (let's call it directory entry 1) records the address label A at mapping positions (1,1), (2,2), and (3,3) in each path of set0. The second part of set0 (the validity record part) records the following position pointers: (2,2) and (3,1). Since position (2,2) is recorded in the second part, directory entry 1 can be determined as the target directory entry. The label A recorded in directory entry 1 has a target position (2,2) in the second path, which is recorded in the second part, meaning that the target position is an empty position. Therefore, the target operation to be performed can be determined as a move and insert operation. Specifically, the target directory entry can be moved to the target position, and a new directory entry created for the requested address can be inserted at the original position of the target directory entry. In this example, directory entry 1 in set0 can be moved to the target position (2,2). That is, directory entry 1 is moved from the first row of the first path in set0 to the second row of the second path, and a new directory entry created for the requested address Y is inserted at the original position of directory entry 1 (i.e., the position of the first row of the first path in set0).

[0056] Reference Figure 3 The diagram illustrates a move and insert operation in Example 1 of the present invention. Figure 3As shown, based on the request type and the information read, request address Y needs to be allocated a new directory entry, and all mapping positions of address Y in the consistency directory have stored valid directory entries. The first mapping position (first row of the first path) stores address label A in its valid directory entry; the second mapping position (third row of the second path) stores address label B in its valid directory entry; and the third mapping position (third row of the third path) stores address label C in its valid directory entry. However, the address label A recorded in one of the directory entries (first row of the first path) is empty in the corresponding position in the second path according to its validity record (a valid bit of V indicates the directory entry is valid, and a valid bit of I indicates the directory entry is invalid). Therefore, this directory entry is moved from the first row of the first path in set0 to the second row of the second path in set0. This creates an empty slot for address Y to store the new directory entry created for address Y, avoiding a directory entry replacement operation.

[0057] like Figure 3 The directory access process shown includes three steps: read, remap, and write. The first step (read) queries the consistent directory based on the requested address Y and reads the relevant information. The second step (remap) calculates the location of each read directory entry in other paths and checks if there are any invalid directory entries in these locations. If such a location exists, the third step performs a move and insert operation. Figure 3 (as shown), otherwise a replacement operation is performed. The third step (write) is to specifically perform the move and insert operation.

[0058] If the requested address does not have a target directory entry in any of the directory entries stored in all mapping locations of the consistency directory, then the target operation to be performed is determined to be a replacement operation. A directory entry is selected from all mapping locations of the requested address in the consistency directory for replacement. The selected directory entry is called the sacrifice. This embodiment of the invention does not limit the replacement algorithm used, such as Least Recently Used (LRU) or a random algorithm. Specifically, when performing the replacement operation, firstly, based on the sharer information recorded in the sacrifice, an invalidation confirmation request is sent to all cores holding a copy of the corresponding cache line, notifying them to set the corresponding copy in their private cache to an invalid state and wait for confirmation. After all relevant cores complete the confirmation, the new directory entry created for the requested address is written to the location of the sacrifice, overwriting the original content, thereby completing the replacement.

[0059] It should be noted that, in this embodiment of the invention, an independent structure (second part) is used to record the location of invalid directory entries within the same virtual group. The storage format used in this embodiment is not limited; for example, it can use finite pointers or bit vectors, etc.

[0060] The finite pointer form refers to using a preset number of pointers to record the location of invalid directory entries within a virtual group, with each pointer pointing to a single location.

[0061] The bit vector form refers to using a vector to record the position of invalid directory entries within a virtual group. Each bit in the vector corresponds to a position in the virtual group. A bit of 0 indicates that the corresponding position is an invalid directory entry, and a bit of 1 indicates that the corresponding position is a valid directory entry.

[0062] In an optional embodiment of the invention, for the finite pointer form, each directory entry in the first part contains valid bits, an address tag, and consistency information; in the second part, finite pointers are used to record the positions of invalid directory entries within the same virtual group corresponding to the first part.

[0063] like Figure 2 The diagram illustrates a consistent directory structure using finite pointers. The consistent directory structure comprises a directory entry storage portion (part one) and a validity record portion (part two). Both portions are logically grouped based on the index bits corresponding to the directory entries, forming virtual groups. The directory entry storage portion is multi-pathed, with each path corresponding to one or a group of physical memories; the path division is orthogonal to the virtual group division. Within each virtual group of the directory entry storage portion, a skewed associative structure is used, meaning each path uses a different hash function to map addresses to storage locations. Each directory entry in the directory entry storage portion contains a valid bit (V), an address tag (Tag), and consistency information (meta). The validity record portion uses finite pointers to record the locations of invalid directory entries within the same virtual group in the directory entry storage portion.

[0064] In an optional embodiment of the invention, for the bit vector format, each directory entry in the first part contains an address label and consistency information; in the second part, a bit vector is used to record the position of invalid directory entries within the same virtual group corresponding to the first part.

[0065] Reference Figure 4 This illustrates another structural diagram of the consistency directory of the present invention, where the second part adopts a bit vector form. For example... Figure 4 As shown, compared to the finite pointer form, the consistent directory structure using bit vectors omits the valid bits in the directory entry storage portion, and the validity record portion instead uses bit vectors to record the positions of non-valid directory entries within the same virtual group's directory entry storage portion. Using bit vectors reduces the additional storage overhead of valid bits in the finite pointer form.

[0066] In one example, assume each virtual group contains 3 paths, each path contains 3 rows, and a bit vector is 011111101. Assume that each bit, from most significant bit to least significant bit (from left to right), corresponds to a position in the virtual group from path 1 to path 3. For example, from left to right, bit 1 (0) corresponds to the first position in path 1 (path 1, row 1), bit 2 (1) corresponds to the second position in path 1 (path 1, row 2), bit 3 (1) corresponds to the third position in path 1 (path 1, row 3), bit 4 (1) corresponds to the first position in path 2 (path 2, row 1), and so on. This vector (011111101) indicates that the positions in path 1, row 1, and path 3, row 2 of this virtual group do not store valid directory entries, while all other positions store valid directory entries.

[0067] It should be noted that the bit vector in this example is only for illustrative purposes, and the embodiments of the present invention do not limit the length or representation of the bit vector.

[0068] In specific implementation, based on the request type (such as read / write / eviction, etc.) and the status of the read directory entry (such as directory entry hit / directory entry missing / there is a movable target directory entry, etc.), the target operation to be performed (such as update / replace / insert / move and insert, etc.) is determined. After the target operation is completed, the first part and / or the second part of the target virtual group is updated.

[0069] The first part of updating the target virtual group includes updating sharer information, consistency status, valid bits, address labels, etc.

[0070] For example, for update operations, it's not necessary to replace the entire existing directory entry; only some information needs to be modified, such as sharer information and / or consistency status. For insert operations, a new directory entry is written to an empty location (with valid bits set to 0), and the valid bits, address label, sharer information, and consistency status of the new directory entry are set. For move-and-insert operations, the target directory entry is first moved to the position indicated by the validity record section, and a new directory entry is written to its original position, along with the valid bits, address label, sharer information, and consistency status of the new directory entry. For replacement operations, an old directory entry is selected as the sacrifice, its contents are cleared, and the corresponding private cache copy is invalidated. Then, the same write process as the insert operation is performed, setting all the information of the new directory entry.

[0071] Update the second part of the target virtual group, including updating finite pointers or bit vectors.

[0072] In an optional embodiment of the present invention, the step of updating the second part of the target virtual group may include: If the target operation causes an invalid directory entry stored in the first location indicated by the second part to become a valid directory entry, then the record information in the first location is removed from the second part; If the target operation causes a valid directory entry stored in the second location indicated by the second part to become an invalid directory entry or a non-recorded invalid directory entry is found, and the second part has not reached the record limit, then the record information of the second location is added to the second part.

[0073] For the finite pointer form, the operation to update the second part is as follows: if the target operation makes a certain position (the first position) pointed to by the finite pointer a valid directory entry, then remove it from the finite pointer; if it makes a certain position (the second position) an invalid directory entry or finds an invalid directory entry that has not been recorded, then add it to the finite pointer until the finite pointer reaches the upper limit of records, and then overwrite the original finite pointer with the updated finite pointer.

[0074] For bit vector format, updating the second part is similar: modify the corresponding bits in the bit vector according to the validity or invalidity of the directory entry, and then overwrite the original bit vector.

[0075] In Example 2, taking a 4-core processor as an example, each core has a 4-way private cache with 256 groups, and a 4-way coherent directory with 256 virtual groups. Each virtual group has 4 rows per way, meaning each way includes 4 directory entry storage spaces. For ease of calculation, assume a cache line is 1 byte. For the commonly used 64-byte cache line, simply left-shift all the following addresses by 6 bits.

[0076] Assuming that the private cache determines its group based on address bits 0-7, the directory also determines its virtual group based on address bits 0-7.

[0077] The ^ symbol represents bitwise XOR. Suppose hash1(x) = x%4, hash2(x) = (x^(x / 4))%4, hash3(x) = (x^(x / 4)^(x / 16))%4, hash4(x) = (x^(x / 4)^(x / 16)^(x / 64))%4.

[0078] It is understood that the above hash function is only used as an example. The embodiments of the present invention do not restrict which hash function to choose for each path, as long as a different hash function is used for each path.

[0079] Assuming the request address is 0x12345678, the group number is 0x78, and the tag is 0x123456, then hash1(tag)=2, hash2(tag)=3, hash3(tag)=2, and hash4(tag)=3. The mapping positions of this request address in each path are the concatenation of the virtual group number and the hash results of each path, respectively: the mapping position of path 1: 0x278; the mapping position of path 2: 0x378; the mapping position of path 3: 0x278; and the mapping position of path 4: 0x378.

[0080] Read the directory entries from the four mapping locations mentioned above, as well as the validity record of virtual group 0x78. Determine the target operation to be performed based on the request type and the content read. If no new directory entry needs to be allocated, or if there are empty positions among the four mapping locations, perform an update operation directly or perform an insert operation in an empty position.

[0081] If a new directory entry needs to be allocated, and there are no empty positions among the four mapping locations mentioned above, then the process of a possible move and insert operation is as follows: Assume the address tags in the directory entries read from paths 1-4 are 0xa78, 0x2c78, 0x3178, and 0x1778, respectively. That is, the address tag recorded in the directory entry read at mapping position 0x278 of path 1 (let's call it directory entry 1) is 0xa78, the address tag recorded in the directory entry read at mapping position 0x378 of path 2 (let's call it directory entry 2) is 0x2c78, the address tag recorded in the directory entry read at mapping position 0x278 of path 3 (let's call it directory entry 3) is 0x3178, and the address tag recorded in the directory entry read at mapping position 0x378 of path 4 (let's call it directory entry 4) is 0x1778.

[0082] For each address tag read, hash1-hash4 is calculated separately, assuming the results are as follows: (3,1,1,1), (1,4,2,2), (2,2,3,3), (4,3,4,4). Here, (3,1,1,1) is obtained by hash1-hash4 for the address tag 0xa78 in directory entry 1, indicating that 0xa78 maps to the 3rd position in the 1st path, the 1st position in the 2nd path, the 1st position in the 3rd path, and the 1st position in the 4th path. Similarly, (1,4,2,2) is obtained by hash1-hash4 for the address tag 0x2c78 in directory entry 2, indicating that 0x2c78 maps to the 1st position in the 1st path, the 4th position in the 2nd path, the 2nd position in the 3rd path, and the 2nd position in the 4th path. And so on.

[0083] The four directory entries read from these four mapping locations correspond to 16 mapping locations (which may be duplicated) in the consistency directory. Using the validity record portion of the 0x78 virtual group read above, it can be determined whether any of these 16 mapping locations does not store a valid directory entry. That is, it can be determined whether any of these 16 mapping locations is recorded in the validity record portion of the 0x78 virtual group.

[0084] Suppose that for directory entry 1, its recorded address label is mapped to the following four locations within the 0x78 virtual group: the 3rd location of path 1, the 1st location of path 2, the 1st location of path 3, and the 1st location of path 4. Assuming that the 1st location of path 2 is recorded in the validity record section of the 0x78 virtual group, this indicates that the location is an invalid directory entry. Therefore, this location can be determined as the target location, and directory entry 1 can be identified as the target directory entry. Thus, directory entry 1 can be moved from its original mapping location 0x278 in path 1 to the 1st location 0x078 in path 2, and the new directory entry corresponding to address 0x12345678 can be written to the original location of directory entry 1 (location 0x278 in path 1). Since the two write operations belong to different paths, they can be completed within the same clock cycle, improving directory access efficiency.

[0085] If there are no invalid directory entries among the 16 mapping locations mentioned above, then one of the four directory entries (directory entry 1 to directory entry 4) read out will be selected for replacement.

[0086] In summary, the consistency directory structure proposed in this invention divides the directory into several virtual groups based on index bits. Each virtual group includes a first part and a second part. The first part stores multiple directory entries, and within the same virtual group, each path uses a different indexing function, i.e., each virtual group employs a skewed concatenation structure. When querying the consistency directory, all the information required for subsequent operations can be read from a single virtual group at once, such as a directory entry for each path's mapping position within that virtual group for the requested address, and the validity information of the virtual group represented by the second part. For example, the address tags in the mapping positions of all paths in the virtual group can be obtained through a single SRAM read operation, and then compared in parallel. Regardless of the number of paths, as long as they are within a single virtual group, the data is read in a single operation. Therefore, only one read each of the first and second parts is needed to obtain all the required information, reducing the number of SRAM reads and control complexity.

[0087] Based on the consistent directory structure of this invention, using skewed associations within groups can reduce index conflicts. Furthermore, in the event of an index conflict, if there are empty positions within the virtual group, a move and insertion operation can be performed within the virtual group, which can reduce the occurrence of replacement operations, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0088] Furthermore, this embodiment of the invention divides the consistent directory structure into two parts, using an independent structure to record the location of invalid directory entries within the same virtual group. This allows for the determination of whether a directory entry is invalid without reading it, further reducing the number of SRAM reads while minimizing replacement operations and improving system performance. Moreover, the storage and power overhead introduced by this invention is minimal, and it does not require modification of the traditional directory pipeline structure, resulting in low control complexity and wide applicability.

[0089] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0090] Reference Figure 5 The diagram illustrates a structural block diagram of an embodiment of a directory access device according to the present invention. The device may include: The directory query module 501 is used to query the consistency directory based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. The operation determination module 502 is used to determine the target operation to be executed based on the first part and the second part retrieved; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The update module 503 is used to perform the target operation in the target virtual group hit by the requested address, and update the first part and / or the second part of the target virtual group.

[0091] Optionally, the directory query module includes: The first query and read submodule is used to determine the target virtual group in the consistency directory based on the index bit of the requested address, and read the second part of the target virtual group; The second query and read submodule is used to calculate the address tag of the requested address using different hash functions to obtain the mapping position of the requested address in each path of the target virtual group, and read the first part corresponding to the mapping position.

[0092] Optionally, the operation determination module is specifically used for: Based on the first part of the query, determine whether the requested address already has a corresponding valid directory entry in the consistency directory; if so, determine that the target operation to be performed is an update operation. Otherwise, determine whether there is an empty position among all the mapping positions of the requested address in the consistency directory; if so, determine that the target operation to be executed is an insertion operation. Otherwise, determine whether a target directory entry exists in all the directory entries of the mapping locations of the requested address in the consistency directory; if so, determine that the target operation to be performed is a move and insert operation; the address label recorded by the target directory entry has a target location in other paths, and the target location is recorded in the second part; Otherwise, the target operation to be executed is determined to be a replacement operation.

[0093] Optionally, the update execution module is specifically used for: Move the target directory entry to the target location, and insert a new directory entry created for the requested address in the original position of the target directory entry.

[0094] Optionally, in the first part, each directory entry contains valid bits, an address tag, and consistency information; in the second part, a finite number of pointers are used to record the positions of invalid directory entries within the same virtual group in the first part.

[0095] Optionally, in the first part, each directory entry contains an address label and consistency information; in the second part, a bit vector is used to record the position of invalid directory entries within the same virtual group in the first part.

[0096] Optionally, the update module is executed, specifically for: If the target operation causes a valid directory entry stored in the first location indicated by the second part to become an invalid directory entry, then the record information of the first location is removed from the second part; if the target operation causes an invalid directory entry stored in the second location indicated by the second part to become a valid directory entry, and the second part has not reached the record limit, then the record information of the second location is added to the second part.

[0097] Optionally, the index bits used to divide virtual groups are the same as the index bits of the group-connected private caches, and the size of a single virtual group is the same as the sum of the connectivity of the private caches.

[0098] The consistency directory structure proposed in this invention divides the directory into several virtual groups based on index bits. Each virtual group includes a first part and a second part. The first part stores multiple directory entries, and within the same virtual group, each entry uses a different indexing function, i.e., each virtual group employs a skewed concatenation structure. When querying the consistency directory, all the information required for subsequent operations can be read from a single virtual group at once, such as a directory entry for each path's mapping position within that virtual group for the requested address, and the validity information of the virtual group represented by the second part. For example, the address tags in the mapping positions of all paths in the virtual group can be obtained through a single SRAM read operation, and then compared in parallel. Regardless of the number of paths, as long as they are within a single virtual group, the data is read in a single operation. Therefore, only one read each of the first and second parts is needed to obtain all the required information, reducing the number of SRAM reads and control complexity.

[0099] Based on the consistent directory structure of this invention, using skewed associations within groups can reduce index conflicts. Furthermore, in the event of an index conflict, if there are empty positions within the virtual group, a move and insertion operation can be performed within the virtual group, which can reduce the occurrence of replacement operations, thereby reducing access latency and improving system performance, as well as preventing side-channel attacks and improving system security.

[0100] Furthermore, this embodiment of the invention divides the consistent directory structure into two parts, using an independent structure to record the location of invalid directory entries within the same virtual group. This allows for the determination of whether a directory entry is invalid without reading it, further reducing the number of SRAM reads while minimizing replacement operations and improving system performance. Moreover, the storage and power overhead introduced by this invention is minimal, and it does not require modification of the traditional directory pipeline structure, resulting in low control complexity and wide applicability.

[0101] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0102] This invention provides a consistency catalog, characterized in that it is applied to a multi-core processor system, and the consistency catalog includes: Directory storage, configured to store multiple directory entries; and The directory controller, coupled to the directory storage, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

[0103] This invention provides a processor chip, comprising: Multiple processor cores, each core including a private cache for storing copies of cache lines; On-chip network, providing interconnect communication paths between the multiple processor cores and the consistency catalog subsystem; and The consistency catalog subsystem, coupled to the on-chip network, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

[0104] Reference Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Figure 6 As shown, the electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other through the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the steps of the directory access method of the aforementioned embodiment.

[0105] This invention provides a non-transitory computer-readable storage medium that, when the instructions in the storage medium are executed by a terminal's program or processor, enables the terminal to perform the steps of the directory access method described in the foregoing embodiments. The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0106] Those skilled in the art will understand that embodiments of the present invention can be provided as a directory access method, apparatus, conformance catalog, electronic device, or computer program product. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0107] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0108] These computer program instructions may also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing terminal device to operate in a predictive manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0110] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0111] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A directory access method, characterized in that, The method includes: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

2. The method according to claim 1, characterized in that, The query for a consistent directory based on the request address includes: Based on the index bit of the requested address, the target virtual group is determined in the consistency directory, and the second part of the target virtual group is read. The address tag of the requested address is calculated using different hash functions to obtain the mapping position of the requested address in each path of the target virtual group, and the first part corresponding to the mapping position is read.

3. The method according to claim 1, characterized in that, The process of determining the target operation to be performed based on the first and second parts retrieved includes: Based on the first part of the query, determine whether the requested address already has a corresponding valid directory entry in the consistency directory; if so, determine that the target operation to be performed is an update operation. Otherwise, determine whether there is an empty position among all the mapping positions of the requested address in the consistency directory; if so, determine that the target operation to be executed is an insertion operation. Otherwise, determine whether a target directory entry exists in all the directory entries of the mapping locations of the requested address in the consistency directory; if so, determine that the target operation to be performed is a move and insert operation; the address label recorded by the target directory entry has a target location in other paths, and the target location is recorded in the second part; Otherwise, the target operation to be executed is determined to be a replacement operation.

4. The method according to claim 3, characterized in that, The move and insert operation includes: moving the target directory entry to the target location, and inserting a new directory entry created for the requested address at the original location of the target directory entry.

5. The method according to claim 1, characterized in that, In the first part, each directory entry contains valid bits, an address tag, and consistency information; in the second part, a finite number of pointers are used to record the positions of invalid directory entries within the same virtual group in the first part.

6. The method according to claim 1, characterized in that, In the first part, each directory entry contains an address label and consistency information; in the second part, a bit vector is used to record the position of an invalid directory entry within the same virtual group in the first part.

7. The method according to claim 1, characterized in that, The steps for updating the second part of the target virtual group include: If the target operation causes a valid directory entry stored at the first location indicated by the second part to become an invalid directory entry, then the record information at the first location is removed from the second part; If the target operation causes an invalid directory entry stored in the second location indicated by the second part to become a valid directory entry, and the second part has not reached its record limit, then the record information for the second location is added to the second part.

8. The method according to claim 1, characterized in that, The index used to divide virtual groups is the same as the index of the group-connected private cache, and the size of a single virtual group is the same as the sum of the connectivity of the private caches.

9. A consistent directory, characterized in that, The consistency catalog, applied to multi-core processor systems, includes: Directory storage, configured to store multiple directory entries; and The directory controller, coupled to the directory storage, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; the second part is used to store the positions of invalid directory entries within the same virtual group corresponding to the first part. Based on the first and second parts retrieved, the target operation to be performed is determined; the target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

10. The consistency catalog according to claim 9, characterized in that, The directory controller is also configured to: Based on the index bit of the requested address, the target virtual group is determined in the consistency directory, and the second part of the target virtual group is read. The address tag of the requested address is calculated using different hash functions to obtain the mapping position of the requested address in each path of the target virtual group, and the first part corresponding to the mapping position is read.

11. The consistency catalog according to claim 9, characterized in that, The directory controller is also configured to: Based on the first part of the query, determine whether the requested address already has a corresponding valid directory entry in the consistency directory; if so, determine that the target operation to be performed is an update operation. Otherwise, determine whether there is an empty location among all the mapping locations of the requested address in the consistency directory; If so, then the target operation to be executed is determined to be an insertion operation; Otherwise, determine whether the target directory entry exists in all the directory entries stored in the mapping locations of the requested address in the consistency directory; If so, then the target operation to be performed is determined to be a move and insert operation; The address tag recorded in the target directory entry indicates that the target location exists in other roads, and the target location is recorded in the second part; Otherwise, the target operation to be executed is determined to be a replacement operation.

12. A processor chip, characterized in that, include: Multiple processor cores, each core including a private cache for storing copies of cache lines; On-chip network provides interconnect communication paths between the multiple processor cores and the consistency catalog subsystem; as well as The consistency catalog subsystem, coupled to the on-chip network, is configured as follows: The consistency directory is queried based on the request address; the consistency directory is divided into several virtual groups based on index bits, and each virtual group includes a first part and a second part; the first part is used to store multi-way directory entries, and within the same virtual group, each way uses a different index function; The second part is used to store the location of invalid directory entries within the same virtual group as the first part; Based on the first and second parts retrieved, determine the target operation to be performed; The target operation includes one of the following: update operation, replace operation, insert operation, move and insert operation; The target operation is performed in the target virtual group that the requested address matches, and the first and / or second part of the target virtual group is updated.

13. The processor chip according to claim 12, characterized in that, The consistency catalog subsystem is also configured as follows: Based on the index bit of the requested address, the target virtual group is determined in the consistency directory, and the second part of the target virtual group is read. The address tag of the requested address is calculated using different hash functions to obtain the mapping position of the requested address in each path of the target virtual group, and the first part corresponding to the mapping position is read.

14. The processor chip according to claim 12, characterized in that, The consistency catalog subsystem is also configured as follows: Based on the first part of the query, determine whether the requested address already has a corresponding valid directory entry in the consistency directory; if so, determine that the target operation to be performed is an update operation. Otherwise, determine whether there is an empty location among all the mapping locations of the requested address in the consistency directory; If so, then the target operation to be executed is determined to be an insertion operation; Otherwise, determine whether the target directory entry exists in all the directory entries stored in the mapping locations of the requested address in the consistency directory; If so, then the target operation to be performed is determined to be a move and insert operation; The address tag recorded in the target directory entry indicates that the target location exists in other roads, and the target location is recorded in the second part; Otherwise, the target operation to be executed is determined to be a replacement operation.