Method and device for detecting and filling cache, electronic device and storage medium

By detecting and recording irreparable bad pixels in cache groups, and using the group associative structure to avoid bad pixels, the performance loss problem caused by irreparable bad pixels in the computer system is solved, and the chip yield rate is improved and the cost is reduced.

CN117435381BActive Publication Date: 2024-08-30HYGON YUNXIN INTEGRATED CIRCUIT DESIGN (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311451686.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2024-08-30
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

Unrepairable bad pixels in the cache of a computer system cause the processor to idle, resulting in system performance loss. It is difficult to effectively avoid bad pixels with existing technology, and the cost of adding hardware resources to repair bad pixels is high.

Method used

By detecting irreparable bad pixels in the cache group, recording their path information into the bad pixel information data, and using the group associative structure to avoid bad pixels, there is no need to add additional hardware resources and the cache itself can be repaired.

Benefits of technology

It improves the chip yield, reduces costs, avoids chips being marked as unusable due to irreparable bad pixels, and ensures the correctness of system storage functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117435381B
    Figure CN117435381B
Patent Text Reader

Abstract

A detection method and device for cache, a filling method and device for cache, an electronic device and a storage medium. The cache includes multiple groups and multiple ways, each group includes multiple cache lines corresponding to the multiple ways, the multiple groups include a target group, and the target group includes a target cache line corresponding to a first way. The detection method for cache includes: detecting whether there are unrepairable bad points in the multiple cache lines of the target group; in response to the existence of unrepairable bad points in the target cache line of the target group, recording the way information of the first way corresponding to the target cache line into the bad point information data. When there are unrepairable bad points in the set-associative structure of the cache, the detection method can update the information of the way where the unrepairable bad points are located into the bad point information data, and the bad points can be avoided by using the set-associative structure of the cache itself, without the need to increase additional hardware resources, thereby improving the yield of the chip and reducing the cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to a method and device for detecting and filling a cache, an electronic device, and a storage medium. Background Art

[0002] The performance of a computer system is related to factors such as the system architecture, instruction structure, the speed at which information is transmitted between various components, and the access speed of storage components, especially the access speed between the processor and the memory. The operating frequency of the processor is much higher than the operating frequency of the memory. Therefore, it takes hundreds of clock cycles to obtain data or instructions from the memory, causing the processor to idle due to the inability to continue to run related instructions, resulting in system performance loss. In order to improve the operating speed and access efficiency, a high-speed cache storage device (Cache, or simply cache) is used to save part of the data for the processor to read at high speed, which can reduce the speed difference between the processor and the memory, allowing the processor to access the data in the memory faster, thereby improving system performance. Summary of the invention

[0003] At least one embodiment of the present disclosure provides a detection method for cache, wherein the cache includes multiple groups and multiple ways, each group in the multiple groups includes multiple cache lines corresponding to the multiple ways respectively, the multiple groups include a target group, and the target group includes a target cache line corresponding to a first way. The detection method for cache includes: detecting whether there are unrepairable bad pixels in the multiple cache lines of the target group; in response to the existence of unrepairable bad pixels in the target cache line of the target group, recording the way information of the first way corresponding to the target cache line into the bad pixel information data.

[0004] For example, the detection method for cache provided by at least one embodiment of the present disclosure further includes: in response to the presence of repairable bad pixels in multiple cache lines of the target group, requesting to repair the repairable bad pixels.

[0005] For example, in the detection method for cache provided in at least one embodiment of the present disclosure, before detecting whether the unrepairable bad pixels exist in multiple cache lines of the target group, the detection method for cache further includes: initializing the bad pixel information data.

[0006] For example, in a detection method for cache provided in at least one embodiment of the present disclosure, the cache is divided into a plurality of cache blocks, the plurality of cache blocks include a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

[0007] For example, the detection method for cache provided by at least one embodiment of the present disclosure also includes: in response to the completion of detection of multiple cache lines of the target group of the target cache block, determining whether the way information of multiple ways of the target cache block is fully updated into the bad pixel information data; in response to the way information of multiple ways of the target cache block being fully updated into the bad pixel information data, the target cache block is marked as unavailable.

[0008] For example, the detection method for cache provided by at least one embodiment of the present disclosure also includes: in response to the presence of at least one second way in the multiple ways of the target cache block that has not been updated to the bad pixel information data, comparing the number of the at least one second way with a bad pixel threshold; in response to the number of the at least one second way being less than the bad pixel threshold, the target cache block is marked as unavailable.

[0009] For example, the detection method for cache provided by at least one embodiment of the present disclosure further includes: in response to all of the multiple cache blocks of the cache being marked as unavailable, the cache is marked as unavailable.

[0010] At least one embodiment of the present disclosure also provides a filling method for a cache, wherein the cache includes multiple groups and multiple ways, each group in the multiple groups includes multiple cache lines corresponding to the multiple ways, respectively, the multiple groups include a target group, and the target group includes a target cache line corresponding to a first way. The filling method for the cache includes: reading the way information of the first way recorded in the bad pixel information data, wherein there are unrepairable bad pixels in the target cache line corresponding to the first way; selecting at least one to-be-filled line from the multiple cache lines of the multiple groups; in response to the target cache line being included in the at least one to-be-filled line, excluding the target cache line from the at least one to-be-filled line based on the bad pixel information data to obtain a filling line for filling the data to be cached.

[0011] For example, in a filling method for cache provided in at least one embodiment of the present disclosure, way information of at least one third way corresponding to the at least one to-be-filled row is recorded in the to-be-filled information data, in which the at least one third way is marked as available, and the target cache row is excluded from the at least one to-be-filled row based on the bad pixel information data to obtain a filling row for filling the to-be-filled data, including: setting non-bad pixel information data based on the bad pixel information data, wherein the non-bad pixel information data is the negative of the bad pixel information data, and in the non-bad pixel information data, the first way is marked as unavailable; performing an AND operation on the to-be-filled information data and the non-bad pixel information data to obtain filling information data, wherein the filling information data includes way information of a fourth way obtained after excluding the first way in the at least one third way, and the fourth way is marked as available; based on the filling information data, selecting the filling row for filling the to-be-filled data from the cache row corresponding to the fourth way.

[0012] For example, in the filling method for cache provided in at least one embodiment of the present disclosure, selecting the at least one to-be-filled row from the multiple cache lines of the target group includes: in response to the existence of at least one invalid cache line that has not been filled with data among the multiple cache lines of the multiple groups, selecting the at least one invalid cache line as the at least one to-be-filled row; in response to the absence of the at least one invalid cache line and the existence of at least one old cache line among the multiple cache lines of the multiple groups, selecting the at least one old cache line as the at least one to-be-filled row.

[0013] For example, in a cache filling method provided in at least one embodiment of the present disclosure, the cache is divided into a plurality of cache blocks, the plurality of cache blocks include a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

[0014] At least one embodiment of the present disclosure further provides a detection device for cache, wherein the cache includes multiple groups and multiple ways, each group in the multiple groups includes multiple cache lines corresponding to the multiple ways respectively, the multiple groups include a target group, and the target group includes a target cache line corresponding to a first way. The detection device for cache includes: a detection module, configured to detect whether there are unrepairable bad pixels in the multiple cache lines of the target group; and a recording module, configured to record the way information of the first way corresponding to the target cache line into the bad pixel information data in response to the presence of unrepairable bad pixels in the target cache line of the target group.

[0015] For example, the detection device for cache provided by at least one embodiment of the present disclosure further includes: a request module configured to request repair of the repairable bad pixels in response to the presence of the repairable bad pixels in the multiple cache lines of the target group.

[0016] For example, the detection device for cache provided in at least one embodiment of the present disclosure further includes: an initialization module configured to initialize the bad pixel information data.

[0017] For example, in a detection device for cache provided in at least one embodiment of the present disclosure, the cache is divided into a plurality of cache blocks, the plurality of cache blocks include a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

[0018] At least one embodiment of the present disclosure further provides a filling device for a cache, wherein the cache includes multiple groups and multiple ways, each group in the multiple groups includes multiple cache lines corresponding to the multiple ways respectively, the multiple groups include a target group, and the target group includes a target cache line corresponding to a first way. The filling device for the cache includes: a reading module, configured to read the way information of the first way recorded in the bad pixel information data, wherein there are unrepairable bad pixels in the target cache line corresponding to the first way; a selection module, configured to select at least one to-be-filled line from the multiple cache lines of the target group; and an exclusion module, configured to exclude the target cache line from the at least one to-be-filled line based on the bad pixel information data in response to the target cache line being included in the at least one to-be-filled line, so as to obtain a filling line for filling the data to be cached.

[0019] For example, in a filling device for a cache provided in at least one embodiment of the present disclosure, the cache is divided into a plurality of cache blocks, the plurality of cache blocks include a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

[0020] At least one embodiment of the present disclosure further provides an electronic device. The electronic device includes: a processor; a memory including one or more computer program modules; wherein the one or more computer program modules are stored in the memory and configured to be executed by the processor, and the one or more computer program modules are used to implement the detection method for cache provided in any embodiment of the present disclosure or the filling method for cache provided in any embodiment of the present disclosure.

[0021] At least one embodiment of the present disclosure further provides a storage medium storing non-temporary computer-readable instructions, which, when executed by a computer, implements the detection method for cache provided by any embodiment of the present disclosure or the filling method for cache provided by any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.

[0023] Figure 1A A schematic diagram of an example of a basic principle of caching;

[0024] Figure 1B A schematic diagram of a mapping relationship principle between memory and cache in direct associative, fully associative and set associative;

[0025] Figure 1C A schematic diagram of a cache set associative organization and addressing method;

[0026] Figure 2 An exemplary flow chart of a detection method for cache provided for at least one embodiment of the present disclosure;

[0027] Figure 3 A schematic diagram of an example of cache segmentation provided for at least one embodiment of the present disclosure;

[0028] Figure 4 Another exemplary flow chart of a detection method for cache provided for at least one embodiment of the present disclosure;

[0029] Figure 5 Another exemplary flow chart of a detection method for cache provided for at least one embodiment of the present disclosure;

[0030] Figure 6 An exemplary flow chart of a method for filling a cache provided for at least one embodiment of the present disclosure;

[0031] Figure 7 Another exemplary flow chart of a method for filling a cache provided for at least one embodiment of the present disclosure;

[0032] Figure 8 A schematic block diagram of a detection device for caching provided for at least one embodiment of the present disclosure;

[0033] Fig. 9 A schematic block diagram of a cache filling device provided for at least one embodiment of the present disclosure;

[0034] Fig.10 A schematic block diagram of an electronic device provided for at least one embodiment of the present disclosure;

[0035] Fig.11 A schematic block diagram of another electronic device provided for at least one embodiment of the present disclosure; and

[0036] Fig.12 A schematic diagram of a storage medium provided for at least one embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0038] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0039] The present disclosure is described below through several specific embodiments. In order to keep the following description of the embodiments of the present disclosure clear and concise, detailed descriptions of known functions and known components may be omitted. When any component of the embodiments of the present disclosure appears in more than one figure, the component is represented by the same or similar reference numeral in each figure.

[0040] Figure 1A A schematic diagram of an example of a basic principle of a cache. For example, a computer generally includes a main memory and a cache. Compared with the access speed to the cache, the access speed of the processor (a single-core CPU or a processing core of a multi-core CPU) to the main memory is relatively slow. Therefore, the cache can be used to compensate for the slow access speed of the main memory and improve the memory access speed.

[0041] For example, in Figure 1AIn the computing system shown, multiple levels of cache are used, for example, a first-level cache (L1Cache, also called L1 cache), a second-level cache (L2 Cache, also called L2 cache), and a third-level cache (L3 Cache, also called L3 cache) are usually used. L1 cache is private to the CPU, and each CPU has an L1 cache. For example, in some CPUs, the L1 cache can be further divided into a data-only L1 cache (L1D Cache) and an instruction-only L1 cache (L1I Cache); all CPUs (for example, CPU0 and CPU1) in a cluster (for example, cluster 0) share an L2 cache, for example, the L2 cache does not distinguish between instructions and data, and both can be cached; the L3 cache is connected to the main memory through a bus, for example, the L3 cache does not distinguish between instructions and data, and both can be cached. Accordingly, the L1 cache is the fastest, followed by the L2 cache, and then the L3 cache. When data or instructions are needed, the processor will first look for the required data or instructions in the L1 cache. If it is not found in the L1 cache, it will look for it in the L2 cache. If it still is not found, it will look for it in the L3 cache. If the required data is not found in the L1 cache, L2 cache, and L3 cache, it will look for it in the main memory. When data or instructions are obtained from a certain level of cache or memory other than the L1 cache, in addition to returning it to the CPU for use, the data or instructions will also be filled into the previous cache for temporary storage.

[0042] For example, in addition to Figure 1A The computer system shown includes a three-level cache architecture of L1, L2, and L3. The computer system may also include more levels of cache. The level of cache may be selected according to actual needs, and the embodiments of the present disclosure are not limited to this. For example, the last-level cache (LLC) is generally used for multi-core shared cache, has a large capacity, and can reduce memory access latency. In addition, the embodiments of the present disclosure are not limited to the setting method of the cache in the CPU.

[0043] The capacity of the cache is very small. The content stored in the cache is only a subset of the content of the main memory, and the data exchange between the cache and the main memory is in blocks. In order to cache the data in the main memory into the cache, for example, a function is used to locate the main memory address to the cache, which is called address mapping. After the data in the main memory is cached into the cache according to this mapping relationship, when the CPU executes the program, it will transform the main memory address in the program into the cache address. The address mapping methods of different types of caches are usually direct mapping, fully associative, and set associative mapping.

[0044] Although the capacity of the cache is smaller than that of the main memory, its speed is much faster than that of the main memory. Therefore, the main function of the cache is to store data that the processor may need to access frequently in the near future. In this way, the processor can directly read data from the cache without frequently accessing the slower main memory, thereby increasing the processor's access speed to the memory. The basic unit of the cache is the cache line (also called a cache block). Similar to the division of the cache into multiple cache lines, the data stored in the main memory is also similarly divided. The divided data blocks in the memory can be called memory blocks. Generally, the size of a memory block can be 64 bytes, and the size of a cache line can also be 64 bytes. It is understandable that in actual applications, the size of the memory block and the cache line can also be set to other values, such as 32-256 bytes, as long as the size of the memory block is the same as the size of the cache line.

[0045] Figure 1B The following is a schematic diagram of the mapping relationship between memory and cache in direct associative, fully associative and set associative. Assume that the memory has 32 memory blocks (such as Figure 1B As shown on the right), the cache has 8 cache lines (as shown Figure 1B In direct associative mode, each memory block can only be placed in one location in the cache; Figure 1B As shown in (a), suppose you want to put the 12th memory block into the cache. Since the cache has only 8 cache lines, it can only be placed on the (12mod 8=4)th cache line and cannot be placed anywhere else. Therefore, it can be seen that the 4th, 12th, 20th, and 28th memory blocks all correspond to the 4th cache line of the cache. If there is a conflict, they can only be replaced. The hardware required for the direct associative method is simple but inefficient. In the fully associative method, each memory block can be placed at any position in the cache; as shown in (a). Figure 1B As shown in (b), memory blocks 4, 12, 20, and 28 can be put into the cache at the same time. The hardware required for the fully associative method is complex but efficient. Set associativity is a compromise between direct associativity and full associativity; Figure 1B As shown in (c), taking two-way set associative as an example, the cache positions 0, 2, 4, and 6 are one way (here called way 0), and positions 1, 3, 5, and 7 are another way (here called way 1), with 4 cache lines in each way. For the 12th block of the memory, since the remainder of 12 divided by 4 is 0, the 12th block can be placed in the 0th position of the 0th way of the cache (i.e., the 0th position of the cache), or in the 0th position of the 1st way (i.e., the 1st position of the cache).

[0046] Figure 1C A schematic diagram of a cache set associative organization and addressing method. Figure 1CAs shown in the figure, the cache is organized as an array of cache lines. A column of cache lines forms a way, and multiple cache lines at the same position in multiple columns of cache lines form a group (set); multiple cache lines in the same group are equivalent to each other and are distinguished (or read or written) by different ways. The location of the data or instruction in the cache is obtained by the physical address of the data or instruction to be read (set, way, byte). Each physical address is divided into three parts:

[0047] (1) Index, which is used to select different sets in the cache. All cache lines in the same set are selected by the same index.

[0048] (2) Tag: used to select different cache lines in the same set. The tag part in the physical address is compared with the tag of the cache line in each way. If they match, it is a cache hit, and this cache line is selected. Otherwise, it is a cache miss.

[0049] (3) Offset: This is used to select the corresponding address in the selected cache line. It indicates the address difference (offset) between the first byte of the target data or instruction in the selected cache line and the first byte of the cache line. The corresponding data or instruction is read from the position of this byte.

[0050] With the development of multi-core processors, the demand for cache capacity (especially the capacity demand of the last-level cache (LLC)) is also gradually increasing; the cache capacity has obvious help in improving the performance of multi-core processors, which can effectively reduce the delay of memory access operations and improve processing speed. For example, the cache hardware can be implemented by static random access memory (SRAM). In order to effectively use SRAM, a group-associated mapping management method can be adopted to achieve effective physical address mapping under limited capacity, thereby ensuring that the cache can store data in any memory address space.

[0051] However, as the capacity of the cache increases, the capacity and area of ​​the SRAM increase significantly; and as the number of cache lines increases, the number of ways, groups, etc. under the group-connected mapping management method will also increase, resulting in an increase in the complexity of the hardware design required for cache access operations, thereby increasing physical resources, which is not conducive to the control of area and power consumption, and thus affects the yield.

[0052] There are many ways to improve the yield rate in the industry, but the main method is to add some redundant interfaces (redundancy IO) in the hard core (Hard Macro) to replace the unavailable cache lines (defect columns, also known as bad pixels), so as to ensure a certain yield rate by repairing the bad pixels. However, each additional redundant interface will increase the physical resources and power consumption, so it is not possible to achieve the target yield rate by infinitely adding redundant interfaces.

[0053] It should be noted that the redundant interface in at least one embodiment of the present disclosure is not limited to a certain type of redundant resources, and can be either row redundancy, column redundancy, or redundant resources of registers, etc. The embodiments of the present disclosure do not impose any restrictions on this.

[0054] At least one embodiment of the present disclosure provides a detection method for a cache, the cache comprising a plurality of groups and a plurality of ways, each group comprising a plurality of cache lines corresponding to the plurality of ways respectively, the plurality of groups comprising a target group, the target group comprising a target cache line corresponding to a first way. The detection method for a cache comprises: detecting whether there are unrepairable bad pixels in the plurality of cache lines of the target group; in response to the presence of unrepairable bad pixels in the target cache line of the target group, recording the way information of the first way corresponding to the target cache line into the bad pixel information data.

[0055] At least one embodiment of the present disclosure also provides a method for filling a cache, wherein the cache includes multiple groups and multiple ways, each group includes multiple cache lines corresponding to the multiple ways, the multiple groups include a target group, and the target group includes a target cache line corresponding to the first way. The method for filling a cache includes: reading the way information of the first way recorded in the bad pixel information data, wherein there are unrepairable bad pixels in the target cache line corresponding to the first way; selecting at least one to-be-filled line from the multiple cache lines of the target group; in response to at least one to-be-filled line including the target cache line, excluding the target cache line from the at least one to-be-filled line based on the bad pixel information data to obtain a filling line for filling the to-be-filled data.

[0056] At least one embodiment of the present disclosure further provides a detection device for cache, a filling device for cache, an electronic device and a storage medium.

[0057] The method, apparatus, device and storage medium provided by at least one embodiment of the present disclosure can update the information of the path where the irreparable bad point exists in the group-associative structure of the cache into the bad point information data when an unrepairable bad point exists. The bad point can be avoided by utilizing the group-associative structure of the cache itself without adding additional hardware resources, thereby improving the yield of the chip and reducing the cost.

[0058] Hereinafter, at least one embodiment of the present disclosure will be described in detail with reference to the accompanying drawings. It should be noted that the same reference numerals in different drawings will be used to refer to the same elements described.

[0059] Figure 2 An exemplary flow chart of a detection method for cache provided for at least one embodiment of the present disclosure.

[0060] For example, Figure 2 As shown, at least one embodiment of the present disclosure provides a detection method for a cache, the cache includes multiple groups and multiple ways, each group includes multiple cache lines corresponding to the multiple ways, the multiple groups include a target group, and the target group includes a target cache line corresponding to the first way. For example, the detection method for a cache includes the following steps S110 to S120.

[0061] Step S110: Detect whether there are unrepairable bad pixels in multiple cache lines of the target group;

[0062] Step S120: In response to the presence of an unrepairable bad pixel in the target cache line of the target group, recording way information of a first way corresponding to the target cache line into the bad pixel information data.

[0063] For example, the cache provided by at least one embodiment of the present disclosure may adopt a set associative structure, but is not limited to a certain set associative structure, and may also be fully associative, or a multi-way set associative structure, etc., and the embodiments of the present disclosure do not limit this. In addition, the cache provided by at least one embodiment of the present disclosure may be a last level cache (LLC), or may be L1, L2, L3, L4, etc., or may be a memory cache, etc., and the embodiments of the present disclosure do not limit this.

[0064] For example, in step S110, multiple cache lines in the cache can be detected in a specific order. For example, multiple cache lines can be read and written in an index-way manner. For example, for a certain data to be accessed, the part corresponding to the index in the address of the data is used to query a certain set, and a certain cache line is queried in the set through a tag, and then output through the corresponding way. For example, for the i-th cache line in different groups, it can be output through the same way (corresponding output port), where i is a positive integer. It should be noted that in addition to the index-way method, other detection orders can be selected according to actual needs, and the embodiments of the present disclosure are not limited to this.

[0065] For example, in step S110, when a cached target group is detected, it is first determined whether there is a bad pixel in multiple cache lines of the target group (for example, the target cache line corresponding to the bad pixel is unavailable); if there is a bad pixel, the bad pixel repair mechanism is started to determine whether the bad pixel is repairable.

[0066] For example, the bad pixel repair mechanism replaces the hardware resources storing the bad pixels by enabling redundant interfaces (redundancy IO). If the number of bad pixels is less than or equal to the total number of redundant interfaces, they can be replaced with redundant interfaces; if the number of redundant interfaces does not meet the requirement for the number of bad pixels, unrepairable bad pixels will appear. For example, for the bad pixels corresponding to the above-mentioned target cache line, when the bad pixel repair mechanism is started, if the redundant interface resources are insufficient (for example, the redundant interfaces have all been used to replace the previously detected bad pixels), it can be determined that the bad pixels corresponding to the target cache line are unrepairable.

[0067] For example, the bad pixel detection in step S110 can adopt the built-in self-test (BIST) technology. The built-in self-test technology adds some additional self-test circuits to the chip design. During the test, only necessary control signals need to be applied from the outside. By running the built-in self-test hardware and software, it is detected whether there are bad pixels in the group-associative structure. The test vectors of the built-in self-test are generally generated internally rather than input externally. Therefore, the built-in self-test technology can reduce the demand for expensive test equipment such as semiconductor automatic test equipment (ATE).

[0068] It should be noted that the built-in self-test technology in at least one embodiment of the present disclosure is not limited to a specific built-in self-test process, and can be a hardware BIST (hardware BIST) or a software BIST (software BIST), and can be a general or customized process (flow), and the embodiments of the present disclosure are not limited to this; in addition, in addition to using BIST technology, the bad pixel detection in step S110 can also select other detection technologies according to actual needs, and the embodiments of the present disclosure are not limited to this.

[0069] For example, if it is determined through the detection of step S110 that the bad pixel corresponding to the target cache line is unrepairable, step S120 is executed to record the way information of the first way corresponding to the target cache line into the bad pixel information data. For example, if the way information of the first way is recorded in the bad pixel information data, it means that the first way needs to be avoided (that is, all valid information will not be stored in the first way), thereby avoiding the use of the bad pixel, so that the storage function of the system is still correct, and the chip can continue to be used.

[0070] It should be noted that the number of the target cache lines may be one or more, and accordingly, the number of the first ways corresponding to the target cache lines may also be one or more.

[0071] In the detection method for cache provided in at least one embodiment of the present disclosure, even if the redundant interface resources are insufficient in the bad pixel repair mechanism, the bad pixel can be avoided based on the data recorded in the bad pixel information data, thereby avoiding the situation where the entire chip is marked as unavailable and discarded when the bad pixel is unrepairable. Therefore, the detection method for cache provided in at least one embodiment of the present disclosure can avoid bad pixels by using the group-connected structure of the cache itself, without the need to increase additional hardware resources, thereby improving the yield of the chip and reducing costs.

[0072] In some examples, the detection method for cache may further include step S130:

[0073] Step S130: In response to the presence of repairable bad pixels in the plurality of cache lines of the target group, requesting to repair the repairable bad pixels.

[0074] For example, in the bad pixel repair mechanism, if the number of bad pixels is less than or equal to the total number of redundant interfaces, then the redundant interfaces can be used for replacement, that is, there are repairable bad pixels in the multiple cache lines of the target group. For example, for a bad pixel in the multiple cache lines of the target group, when the bad pixel repair mechanism is started, if the redundant interface resources are sufficient, it can be determined that the bad pixel is repairable. At this time, step S130 can be executed to request to repair the repairable bad pixel.

[0075] It should be noted that, in addition to the redundant interface replacement method, other repair methods can also be used in the bad pixel repair mechanism to repair the repairable bad pixels, and the embodiments of the present disclosure are not limited to this.

[0076] In some examples, before step S110, the detection method for cache may further include: initializing bad pixel information data. For example, after initialization, the bad pixel information data is reset.

[0077] For example, for an n-way group associative structure, the bad point information data can be expressed as defect_way = (way (n-1), ..., way1, way0), where n is a positive integer, that is, each bit of defect_way can represent the path information of a path, and the corresponding bit value can be modified to mark whether the corresponding path is available. For example, for multiple groups and multiple paths used for detection in a cache, before starting the detection method for a cache provided by at least one embodiment of the present disclosure, the bad point information data can be initialized for reset (for example, all data in defect_way are set to zero).

[0078] For example, assuming that the cache is a 4-way set associative structure, the bad pixel information data defect_way = (way3, way2, way1, way0); when defect_way = (0, 0, 1, 1), it means that the first way way1 and way0 corresponding to the target cache line are unavailable. For example, for a 4-way set associative structure, after initialization, the reset bad pixel information data defect_way = (0, 0, 0, 0).

[0079] It should be noted that, in the above examples, the unavailable way is represented by 1, and the bad pixel information data defect_way after reset is all set to 0; in other examples, the unavailable way can also be represented by 0, and the bad pixel information data defect_way after reset is all set to 1, or other values ​​can be set according to actual needs, and the embodiments of the present disclosure are not limited to this.

[0080] In some examples, the cache is divided into multiple cache slices. Specifically, a large block of hardware resources (e.g., SRAM) can be physically divided into multiple small blocks of hardware resources. For example, multiple cache slices can perform non-uniform memory access (NUMA). In the software optimization process, different physical cores can give priority to accessing cache slices that are closer, thereby reducing the cache access latency and improving the cache processing efficiency.

[0081] However, as the cache capacity increases, the number of cache blocks cannot be increased indefinitely. The more cache blocks there are, the more routes are required to support cache access operations, and the more complex the layout between routes is; the increase in the complexity of hardware design will lead to an increase in physical resources, which is not conducive to the control of area and power consumption. In addition, the increase in cache capacity will also lead to an increase in the capacity and area of ​​the hardware resources in each cache block, resulting in an increase in the probability of bad pixels in each cache block, thus affecting the yield.

[0082] For example, in order to improve the yield of each cache block, the detection method for cache provided by at least one embodiment of the present disclosure may be implemented on each cache block. For example, the multiple cache blocks include a target cache block, and the target cache block includes multiple groups and multiple ways applicable to the detection method for cache provided by at least one embodiment of the present disclosure. Further, the multiple groups of the target cache block include a target group, and the target group includes a target cache line corresponding to the first way. For example, for the above target cache block, it is possible to execute Figure 2 Steps S110 to S120 may be performed to record the way information of the first way corresponding to the unrepairable bad pixel in the target cache block into the bad pixel information data, or step S130 may be performed to request to repair the repairable bad pixel in the target cache block.

[0083] Figure 3 A schematic diagram of an example of cache segmentation provided in at least one embodiment of the present disclosure. For example, Figure 3 Shown is applicable to Figure 2 A specific example of cache segmentation of the detection method shown.

[0084] For example, Figure 3 As shown in the figure, the cache is divided into multiple cache blocks (cache block 0, cache block 1, cache block 2 and cache block 3), and cache blocks 0 to 3 respectively adopt a set associative structure. For example, when the target cache block is cache block 0, cache block 0 includes multiple groups and multiple ways for detection; the multiple groups of cache block 0 include a target group (not shown in the figure), and the target group includes a target cache line corresponding to the first way (for example, Figure 3 ).

[0085] For example, Figure 3 As shown in FIG. 1 , multiple cache lines in cache block 0 are detected in an index-way manner. For example, when executing Figure 2Before step S110, the bad pixel information data is initialized to reset the bad pixel information data. For example, the bad pixel information data is represented as defect_way=(way(n-1), ..., way1, way0). After initialization, the bad pixel information data is defect_way=(0, ..., 0, 0), where n is a positive integer.

[0086] For example, in Figure 2 In step S110, multiple cache lines in cache block 0 are tested using a built-in self-test (BIST) or other technology to determine whether there is a bad pixel in cache block 0. For example, when a target group of cache block 0 is detected, it is first determined whether there is a bad pixel in multiple cache lines of the target group (for example, whether there is an unavailable target cache line); if there is a bad pixel, a bad pixel repair mechanism is started to determine whether the bad pixel is repairable.

[0087] For example, when the bad pixel corresponding to the target cache line is detected in step S110, insufficient redundant interface resources or the like occur, and the bad pixel corresponding to the target cache line is determined to be unrepairable. Figure 2 In step S120, the way information of the first way corresponding to the target cache line is recorded in the defective pixel information data (defect_way). Figure 3 As shown, the first way corresponds to way0, and the bad pixel information data is updated to defect_way = (0, ..., 0, 1). For example, if the way information of the first way way0 is recorded in the bad pixel information data, it means that the first way way0 needs to be avoided (that is, all valid information will not be stored in the first way way0), thereby avoiding the use of the bad pixel, so that the storage function of the system is still correct, and the chip can continue to be used.

[0088] For example, when a bad pixel corresponding to the target cache line is detected in step S110, if there are sufficient redundant interface resources, etc., it is determined that the bad pixel corresponding to the target cache line can be repaired. Figure 2 In step S130, a request is made to repair the repairable bad pixel; the repair method includes but is not limited to replacing the hardware resource storing the bad pixel by enabling a redundant interface, etc., which is not limited in the embodiment of the present disclosure.

[0089] It should be noted that Figure 3 The cache blocks shown are only an example, and the embodiments of the present disclosure do not limit the number of cache blocks, the division method, the detection method and order, the specific implementation method of the bad pixel repair mechanism, etc.

[0090] Figure 4Another exemplary flow chart of a detection method for caching provided in at least one embodiment of the present disclosure. For example, Figure 4 for Figure 2 Further processing of the detection method for cache is shown.

[0091] For example, Figure 4 As shown, the detection method for caching may further include steps S140 to S150:

[0092] Step S140: in response to the completion of the detection of multiple cache lines of the target group of the target cache block, determining whether way information of multiple ways of the target cache block is completely updated into the bad pixel information data;

[0093] Step S150: In response to the way information of multiple ways of the target cache block being all updated into the bad pixel information data, the target cache block is marked as unavailable.

[0094] For example, in step S140, after the detection of multiple cache lines of the target group of the target cache block is completed, the bad pixel information data corresponding to the target cache block is also updated. Further, it is determined whether the way information of all ways in the bad pixel information data at this time is marked as unavailable (defect); if the way information of all ways is marked as unavailable, it means that the way information of multiple ways of the target cache block is all updated to the bad pixel information data.

[0095] For example, in step S150, if the road information of multiple roads of the target cache block is all updated to the bad point information data, it means that all roads in the target cache block are marked as unavailable, which further indicates that there are too many bad points in the target cache block and it cannot be repaired; therefore, the target cache block is marked as unavailable.

[0096] For example, if after step S140, it is found that the road information of multiple roads of the target cache block has not been fully updated to the bad pixel information data, that is, there are still available roads in the target cache block, then the next group that has not been detected in the target cache block can be used as the target group, and steps S110 to S140 are re-executed to check whether the roads that have not been marked in the bad pixel information data are available.

[0097] Furthermore, if Figure 4 As shown, the detection method for caching may further include steps S160 to S170:

[0098] Step S160: In response to the existence of at least one second way in the multiple ways of the target cache block that has not been updated to the bad pixel information data, the number of the at least one second way is compared with the bad pixel threshold value,

[0099] Step S170: In response to the number of at least one second way being less than a bad point threshold, the target cache block is marked as unavailable.

[0100] For example, in step S160, a bad pixel threshold (min_way_num) can be set according to actual needs such as product form and performance requirements to indicate the minimum acceptable number of unavailable ways in the target cache block, thereby ensuring that the chips screened out by the detection method provided by at least one embodiment of the present disclosure can be used while meeting performance requirements.

[0101] For example, in step S160, after all the ways of the target cache block are detected, if there is a second way among the multiple ways that has not been updated to the bad pixel information data (that is, the second way is available), and the number of second ways can be one or more, the number of second ways is compared with the bad pixel threshold.

[0102] For example, in step S170, if none of the ways in the target cache block is available or the number of available second ways is less than the set bad point threshold (min_way_num), the target cache block is marked as unavailable. This is because if the number of unavailable ways in the target cache block is too large, the capacity of the target cache block will be too small, resulting in poor performance of the target cache block and no longer being available.

[0103] Furthermore, the detection method for cache may also include: in response to all of the plurality of cache blocks of the cache being marked as unavailable, marking the cache as unavailable.

[0104] For example, after performing the detection of steps S110 to S170 on all cache blocks of the cache, if it is found that all cache blocks are marked as unavailable, the cache is marked as unavailable.

[0105] For example, during the detection process of executing steps S110 to S170 on all cache blocks of the cache, if there are available cache blocks, the bad pixel information data corresponding to each available cache block and the repair information in the detection process are recorded in the storage device respectively to ensure that when the chip is officially started, the corresponding bad pixel information and repair information can be stored in the relevant registers inside the chip, thereby guiding the correct operation of the hardware circuit.

[0106] For example, the storage device may be a one-time programmable memory (OTP). After the bad pixel information data is burned into the OTP, it cannot be changed or cleared again. Other types of slave storage devices may also be selected according to actual needs, and the embodiments of the present disclosure are not limited to this.

[0107] Figure 5 Another exemplary flow chart of a detection method for cache provided in at least one embodiment of the present disclosure. For example, Figure 5 is a specific example of the detection process, using Figure 2 and Figure 4 The detection method shown.

[0108] For example, Figure 5 As shown, the cache is divided into cache block 0, cache block 1, cache block 2 and cache block 3 (as shown in Figure 3 For example, for each cache block 0 to 3, the detection method for cache provided by at least one embodiment of the present disclosure is executed respectively. Figure 5 The left side shows the detection process for cache block 0. Figure 5 The right side shows the detection process for cache block 3. It should be noted that the detection process for cache block 1 and cache block 2 is basically the same as that for cache block 0 or cache block 3. Figure 5 The detection process of cache block 1 and cache block 2 is omitted.

[0109] For example, Figure 5 Take the detection process of the left cache block 0 as an example. Before starting the detection, initialize the bad pixel information data defect_way0 of cache block 0; express the bad pixel information data as defect_way0 = (way(n-1), ..., way1, way0), where n is a positive integer. After initialization, the reset bad pixel information data is expressed as, for example, defect_way0 = (0, ..., 0, 0) (for example, simplified to defect_way0 = 0). After starting the detection, first execute Figure 2 In step S110, a built-in self-test (BIST) or other technology is used to detect whether there are bad pixels in multiple cache lines of the target group: if there are no bad pixels and the entire cache block 0 has not been detected, the next group that has not been detected in cache block 0 is used as the target group to continue detecting cache block 0; if there are no bad pixels and the entire cache block 0 has been detected and there are no bad pixels, the cache block 0 detection passes; if there are bad pixels in the target cache line of the target group (the number of target cache lines can be one or more), a bad pixel repair mechanism is started to determine whether the bad pixel is repairable.

[0110] For example, Figure 5 As shown, if there are sufficient redundant interface resources, it is determined that the bad pixel corresponding to the target cache line can be repaired. Further, execute Figure 2Step S130 requests to repair the repairable bad pixels. Further, when all the bad pixels corresponding to the target cache lines can be repaired, if the entire cache block 0 has not been detected, the next group that has not been detected in the cache block 0 is used as the target group to continue to detect the cache block 0; if the entire cache block 0 is detected and the bad pixels can be repaired, the cache block 0 is detected and passed, and the repair information of the cache block 0 and the bad pixel information data defect_way0 are loaded into the storage device (for example, OTP).

[0111] For example, Figure 5 As shown, if the redundant interface resources are insufficient, it is determined that the bad pixel corresponding to the target cache line cannot be repaired. Further, the execution Figure 2 In step S120, the way information of the first way corresponding to the target cache line is recorded in the bad pixel information data defect_way0. For example, if the first way corresponding to the target cache line is way0, the bad pixel information data is updated to defect_way0 = (0, ..., 0, 1).

[0112] For example, further, if all detections of cache block 0 are completed, the updated bad pixel information data defect_way0 is loaded into the storage device (e.g., OTP). For example, if there are 2 unrepairable bad pixels in cache block 0, and the 2 unrepairable bad pixels correspond to the 2 first ways way0 and way(n-1), respectively, then after the detection of cache block 0 is completed, the updated bad pixel information data defect_way0 = (1, ..., 0, 1).

[0113] For example, Figure 5 As shown, after the detection of multiple cache lines of the target group of cache block 0 is completed, execution Figure 4 Step S140 is to determine whether the way information of multiple ways of cache block 0 is all updated to the bad point information data defect_way0, that is, to determine whether the way information of all ways in defect_way0 at this time is all marked as unavailable.

[0114] For example, Figure 5 As shown, if the way information of multiple ways of cache block 0 is all updated to the bad point information data defect_way0, then execute Figure 4 In step S150, cache block 0 is marked as unavailable. At this time, the bad pixel information data can be represented as defect_way0=(1, ..., 1, 1) (for example, simplified to defect_way0=1).

[0115] For example, Figure 5As shown, if there is a second way (the number of the second ways can be one or more) among multiple ways of cache block 0 that has not been updated to the bad point information data defect_way0, then perform Figure 4 step S160 of comparing the number of the second ways non_defect_way_num0 with the bad point threshold min_way_num0 corresponding to cache block 0. For example, when defect_way0 = (1,…,0,1), it means that n - 2 second ways way(n - 1) to way1 have not been updated to the bad point information data defect_way0, so the number of the second ways non_defect_way_num0 = n - 2.

[0116] For example, as Figure 5 shown, if none of the ways in cache block 0 are available (for example, defect_way0 = 1) or the number of available second ways is less than the set bad point threshold (for example, (&(defect_way0) == 1) | (non_defect_way_num0 < min_way_num0)), then perform Figure 4 step S170 of marking cache block 0 as unavailable (for example, represented as Slice0_BIST_Fail).

[0117] For example, if the entire cache block 0 has been detected and the obtained bad point information data defect_way0 = (1,…,0,1), it means that the number of the second ways way(n - 1) to way1 non_defect_way_num0 = n - 2. When n = 4, the number of the second ways non_defect_way_num0 = 2. If the bad point threshold min_way_num0 = 3, then non_defect_way_num0 < min_way_num0 is satisfied, indicating that the number of available second ways is less than the set bad point threshold, and then perform Figure 4 step S170 of marking cache block 0 as unavailable, represented as Slice0_BIST_Fail.

[0118] For example, as Figure 5 shown, if the entire cache block 0 has not been detected yet, then take the next un-detected group in cache block 0 as the target group, and repeat the above steps to continue detecting the next group of cache block 0 until the entire cache block 0 is detected.

[0119] It should be noted that the detection processes of cache blocks 1 to 3 are basically the same as that of cache block 0, and will not be elaborated here.

[0120] For example, as Figure 5As shown, after the detection of all cache slices 0 to 3 of the cache is completed, the detection results of all cache slices are collected. If all cache slices 0 to 3 are marked as unavailable, the cache is marked as unavailable (for example, expressed as BIST_FAIL = (Slice0_BIST_Fail | Slice1_BIST_Fail | Slice2_BIST_Fail | Slice3_BIST_Fail)).

[0121] At least one embodiment of the present disclosure provides a detection method for cache. By separately detecting and recording bad pixel information in different cache blocks, different cache blocks can be screened and repaired with different intensities, thereby improving detection flexibility, reducing hardware consumption, and further improving yield to ensure the availability of the entire chip.

[0122] In some examples, in order to improve the hit rate of the cache, it is necessary to store the data that may be used recently in the cache as much as possible. Since the capacity of the cache is limited, when the cache space is full, some data can be deleted from the cache in a specific way (for example, cache replacement policy, etc.), and then the new data can be filled into the released space. For example, the cache replacement policy is actually a data elimination mechanism. The use of a reasonable cache replacement policy can effectively improve the hit rate; commonly used cache replacement policies include, but are not limited to, First In Fist Out (FIFO), Least Recently Used (LRU), Most Recently Used (MRU), Re-Reference Interval Prediction (RRIP), etc., and the embodiments of the present disclosure do not limit this.

[0123] In at least one embodiment of the present disclosure, taking the cache replacement strategy as an example, when the cache is full and there is no space to store new data, a cache line that will not be frequently used in the short term can be selected, the cache blocks therein can be replaced, and the new cache blocks can be filled in the cache line. For example, when selecting a cache line to be filled, it is necessary to identify the information of unrepairable bad pixels from the bad pixel information data obtained by the detection method for cache provided by at least one embodiment of the present disclosure, to prevent data from being written to the cache line corresponding to the bad pixel, thereby ensuring that the hardware resources for storing data are available.

[0124] It should be noted that, in addition to the cache replacement strategy, the cache filling method provided in at least one embodiment of the present disclosure is also applicable to other situations of filling data into cache lines, and the embodiments of the present disclosure are not limited to this.

[0125] Figure 6 An exemplary flow chart of a method for filling a cache provided for at least one embodiment of the present disclosure. Figure 6 When using the cache filling method in , you can use the execution Figure 2 to Figure 5 The bad pixel information data obtained by the detection method used for cache.

[0126] For example, Figure 6 As shown, at least one embodiment of the present disclosure provides a method for filling a cache, the cache comprising a plurality of groups and a plurality of ways, each group comprising a plurality of cache lines corresponding to the plurality of ways, the plurality of groups comprising a target group, the target group comprising a target cache line corresponding to a first way. For example, the method for filling a cache comprises the following steps S210 to S230.

[0127] Step S210: reading the first path information recorded in the bad pixel information data;

[0128] Step S220: selecting at least one to-be-filled row from a plurality of cache rows of a plurality of groups;

[0129] Step S230: In response to at least one to-be-filled row including the target cache row, excluding the target cache row from the at least one to-be-filled row based on the bad pixel information data to obtain a filling row for filling the to-be-cached data.

[0130] For example, in step S210, an unrepairable bad pixel exists in the target cache line corresponding to the first way; that is, based on the way information of the first way recorded in the bad pixel information data, the target cache line where the unrepairable bad pixel exists can be avoided.

[0131] For example, step S220 may further include: in response to the presence of at least one invalid cache line that has not been filled with data among the multiple cache lines of the multiple groups, selecting at least one invalid cache line as at least one row to be filled; in response to the presence of at least one old cache line but not at least one invalid cache line among the multiple cache lines of the multiple groups, selecting at least one old cache line as at least one row to be filled.

[0132] For example, an invalid cache line has not been filled with any data, and the consistency state of the road where the invalid cache line is located is invalid; if data is stored in this road, the consistency state of the road is valid. For example, an aged cache line is a cache line that has been stored in the cache for a long time. If the cache line has not been used for a long time, it is predicted that it will not be used frequently in the future. For example, an aged cache line can be a cache line that has been stored in the cache for the longest time, or it can include multiple cache lines with a storage time greater than a certain time threshold, and the embodiments of the present disclosure are not limited to this.

[0133] It should be noted that the number of rows to be filled can be one or more, and invalid cache rows that have never been filled with data can be selected as rows to be filled, or old cache rows with the longest storage time can be selected as rows to be filled, or other types of cache rows can be selected as rows to be filled according to actual needs, and the embodiments of the present disclosure do not limit this. In addition, invalid cache rows can be selected first and then old cache rows, or old cache rows can be selected first and then invalid cache rows, and the embodiments of the present disclosure do not limit the order of selecting rows to be filled.

[0134] For example, in step S230, when the rows to be filled include a target cache row where an irreparable bad pixel is located, the target cache row can be excluded from the rows to be filled based on the bad pixel information data to obtain a filling row for filling the data to be cached.

[0135] In some examples, at least one to-be-filled row corresponds to at least one third way, and the way information of the third way can be recorded in the to-be-filled information data. For example, in the to-be-filled information data, the third way corresponding to the to-be-filled row is marked as available. For example, when an invalid cache row is selected as the to-be-filled row, the to-be-filled information data can be represented as invalid_way; when an old cache row is selected as the to-be-filled row, the to-be-filled information data can be represented as oldest_age_way.

[0136] For example, step S230 may further include: setting non-bad pixel information data based on bad pixel information data; performing an AND operation on the information data to be filled and the non-bad pixel information data to obtain filling information data; based on the filling information data, selecting a filling row for filling the data to be cached from the cache row corresponding to the fourth way.

[0137] For example, the non-bad pixel information data is set to the non-bad pixel information data (defect_way), and the non-bad pixel information data is expressed as used_way, used_way=~defect_way; since the first way corresponding to the target cache line in defect_way is marked as unavailable, in the non-bad pixel information data (used_way), the first way is also marked as unavailable.

[0138] For example, the filling information data can be represented as pick_way, and the information data to be filled and the non-bad pixel information data are ANDed to obtain the filling information data, that is, pick_way=invalid_way&used_way or pick_way=oldest_age_way&used_way (or other representation methods are selected according to the type of the information data to be filled). For example, since the third way corresponding to the to-be-filled row in the information data to be filled (invalid_way, oldest_age_way or others) is marked as available, and the first way corresponding to the target cache row in the non-bad pixel information data (used_way) is marked as unavailable, after the "AND operation", the first way in at least one third way can be excluded, thereby obtaining the way information of the fourth way; in the filling information data (pick_way), the fourth way is marked as available.

[0139] For example, further, based on the filling information data (pick_way), a filling row for filling the data to be cached can be selected from the cache row corresponding to the fourth way, so as to exclude the target cache row from the rows to be cached; that is, since used_way has eliminated the way information of the first way in defect_way, after the "AND operation", the target cache row will not be selected when the filling row is selected from the cache row corresponding to the fourth way, thereby avoiding the data to be filled from being written into the cache row corresponding to the bad point.

[0140] In some examples, the cache is divided into a plurality of cache slices. For example, the method for filling a cache provided by at least one embodiment of the present disclosure may be implemented for each cache slice. For example, the plurality of cache slices includes a target cache slice, and the target cache slice includes a plurality of groups and a plurality of ways applicable to the method for filling a cache provided by at least one embodiment of the present disclosure. Further, the plurality of groups of the target cache slice includes a target group, and the target group includes a target cache line corresponding to a first way. For example, for the target cache slice, the following may be performed: Figure 6 Steps S210 to S230 are performed to obtain a filling row excluding bad pixel information, thereby avoiding writing the data to be filled into the cache row corresponding to the bad pixel.

[0141] For example, as for the specific method of dividing the cache into multiple cache blocks, the partitioning may be performed by direct mapping according to the physical address (PA), or by hash mapping according to the physical address, and the embodiments of the present disclosure do not limit this.

[0142] Figure 7 Another exemplary flow chart of a method for filling a cache provided for at least one embodiment of the present disclosure. For example, Figure 7is a specific example of a filling process, using Figure 6 Filling method shown.

[0143] For example, Figure 7 As shown, taking the filling method provided by at least one embodiment of the present disclosure executed on the target cache block as an example, in step S210, the bad pixel information data (defect_way) corresponding to the target cache block is loaded from the storage device (e.g., OTP) to the bad pixel information data register of the target cache block to read the way information of the first way recorded in the defect_way.

[0144] For example, further, in step S220, at least one to-be-filled row is selected from a plurality of cache rows of the target cache block; Figure 7 In the example, invalid cache lines that have not been filled with data are preferentially selected as the lines to be filled. When there are no invalid cache lines but there are old cache lines, the old cache lines are selected as the lines to be filled.

[0145] For example, assuming that the cache is a 4-way set associative structure, the bad pixel information data defect_way=(way3,way2,way1,way0); when defect_way=(0,0,1,1), it means that the first ways way1 and way0 corresponding to the target cache line are unavailable. For example, in step S230, the non-bad pixel information data (used_way) is first set based on the bad pixel information data (defect_way), that is, used_way=~defect_way, thereby obtaining the non-bad pixel information data used_way=(1,1,0,0), indicating that way3 and way2 are valid and can be used, while the two first ways way1 and way0 are unavailable.

[0146] For example, since an invalid cache line is preferentially selected as the line to be filled, the information data to be filled can be represented as invalid_way. Further, in step S230, the information data to be filled (invalid_way) and the non-bad pixel information data are ANDed to obtain the filling information data (pick_way), that is, pick_way=invalid_way&used_way; further, based on the filling information data (pick_way), a filling line for filling the data to be cached is selected.

[0147] For example, in one example, if the to-be-filled information data invalid_way=(1,0,0,1), it means that the to-be-filled row corresponds to two third ways way3 and way0; when the non-bad pixel information data used_way=(1,1,0,0), the filling information data pick_way=1001&1100=(1,0,0,0) can be obtained, that is, after the "AND operation", the first way way0 in the third way way3 and way0 is excluded, thereby obtaining the way information of the fourth way way3. Therefore, in the filling information data pick_way, the fourth way way3 is marked as available (that is, way3=1), which means |(invalid_way&used_way)==1. For example, Figure 7 As shown, in response to |(invalid_way&used_way)==1, the target cache line can be excluded from the invalid cache lines to obtain the fill line corresponding to the fourth way way3.

[0148] For example, in another example, if the information data to be filled invalid_way=(0,0,0,1), it means that the row to be filled corresponds to the third way0; when the non-bad pixel information data used_way=(1,1,0,0), the filling information data pick_way=0001&1100=(0,0,0,0) can be obtained, that is, after the "AND operation", the first way0 in the third way0 is excluded, and there is no available fourth way, which means |(invalid_way&used_way)==0.

[0149] For example, Figure 7 As shown, in response to |(invalid_way&used_way)==0, the aged cache row can continue to be selected as the row to be filled, and the information data to be filled is represented as oldest_age_way at this time. Assuming that the information data to be filled is oldest_age_way=(0,1,0,0), it means that the row to be filled corresponds to the third way way2; when used_way=(1,1,0,0), the filling information data pick_way=0100&1100=(0,1,0,0) can be obtained, that is, after the "AND operation", it is found that the first way does not exist in the third way way2, so way2 can be directly used as the fourth way. Therefore, in the filling information data pick_way, the fourth way2 is marked as available (that is, way2=1), which means |(oldest_age_way&used_way)==1. For example, as Figure 7As shown, in response to |(oldest_age_way&used_way)==1, the target cache line can be excluded from the invalid cache lines to obtain the fill line corresponding to the fourth way way2.

[0150] For example, in some other examples, if there is still no cache line available for use as a filling line after selecting an old cache line as the line to be filled (eg, oldest_age_way=(0,0,1,0) etc.), the filling operation is exited.

[0151] It should be noted that Figure 7 The filling process is only an example. The embodiments of the present disclosure do not limit the division of the target cache blocks, the way information included in the target cache blocks, the type of rows to be filled and the selection method, etc.

[0152] At least one embodiment of the present disclosure provides a cache filling method, which fills different cache blocks separately and uses bad pixel information data of different cache blocks to fill each cache block separately, thereby improving the flexibility and accuracy of the filling operation and reducing the complexity of the filling operation, thereby further improving the yield of the chip.

[0153] Figure 8 A schematic block diagram of a detection device for a cache provided for at least one embodiment of the present disclosure. For example, the cache includes multiple groups and multiple ways, each group includes multiple cache lines corresponding to the multiple ways, the multiple groups include a target group, and the target group includes a target cache line corresponding to the first way.

[0154] For example, Figure 8 As shown, the detection device 200 for caching includes a detection module 210 and a recording module 220 .

[0155] For example, the detection module 210 is configured to detect whether there are unrepairable bad pixels in multiple cache lines of the target group. That is, the detection module 210 can be configured to perform, for example Figure 2 Step S110 is shown.

[0156] For example, the recording module 220 is configured to record the way information of the first way corresponding to the target cache line into the bad pixel information data in response to the presence of an unrepairable bad pixel in the target cache line of the target group. That is, the recording module 220 can be configured to perform, for example Figure 2 Step S120 is shown.

[0157] In some examples, such as Figure 8As shown, the detection device 200 for cache may further include a request module 230 configured to request repair of the repairable bad pixels in response to the presence of repairable bad pixels in multiple cache lines of the target group. That is, the request module 230 may be configured to perform, for example, Figure 2 Step S130 is shown.

[0158] In some examples, such as Figure 8 As shown, the detection device 200 for caching may further include an initialization module 230 configured to initialize the bad pixel information data. For example, after initialization, the bad pixel information data is reset.

[0159] In some examples, the cache is divided into a plurality of cache partitions. For example, each cache partition may be tested using the detection device for cache provided by at least one embodiment of the present disclosure. For example, the plurality of cache partitions include a target cache partition, and the target cache partition includes a plurality of groups and a plurality of paths applicable to the detection device for cache provided by at least one embodiment of the present disclosure.

[0160] In some examples, the detection module 210 may also be configured to, in response to the completion of the detection of multiple cache lines of the target group of the target cache block, determine whether the way information of multiple ways of the target cache block has been completely updated to the bad pixel information data; further, the recording module 220 may also be configured to, in response to the way information of multiple ways of the target cache block being completely updated to the bad pixel information data, mark the target cache block as unavailable. That is, the detection module 210 may also be configured to perform, for example, Figure 4 In step S140 shown in FIG. 1 , the recording module 220 may also be configured to perform, for example, Figure 4 Step S150 is shown.

[0161] For example, the detection module 210 may also be configured to, in response to at least one second way in the multiple ways of the target cache block that has not been updated to the bad pixel information data, compare the number of at least one second way with the bad pixel threshold; further, the recording module 220 may also be configured to, in response to the number of at least one second way being less than the bad pixel threshold, mark the target cache block as unavailable. That is, the detection module 210 may also be configured to perform, for example Figure 4 In step S160 shown in FIG. 1 , the recording module 220 may also be configured to perform, for example, Figure 4 Step S170 shown.

[0162] For example, further, the recording module 220 may also be configured to, in response to all of the plurality of cache blocks of the cache being marked as unavailable, mark the cache as unavailable.

[0163] Fig. 9A schematic block diagram of a filling device for a cache provided for at least one embodiment of the present disclosure. For example, the cache includes multiple groups and multiple ways, each group includes multiple cache lines corresponding to the multiple ways, the multiple groups include a target group, and the target group includes a target cache line corresponding to the first way.

[0164] For example, Fig. 9 As shown, the filling device 300 for cache includes a reading module 310 , a selection module 320 and an exclusion module 330 .

[0165] For example, the reading module 310 is configured to read the way information of the first way recorded in the bad pixel information data; there is an unrepairable bad pixel in the target cache line corresponding to the first way. That is, the reading module 310 can be configured to perform, for example Figure 6 Step S210 is shown.

[0166] For example, the selection module 320 is configured to select at least one to-be-filled row from a plurality of cache rows of a plurality of groups. That is, the selection module 320 may be configured to perform, for example Figure 6 Step S220 is shown.

[0167] For example, the exclusion module 330 is configured to exclude the target cache line from the at least one to-be-filled row based on the bad pixel information data in response to the at least one to-be-filled row including the target cache line, so as to obtain a filling row for filling the to-be-cached data. That is, the exclusion module 330 may be configured to perform, for example, Figure 6 Step S230 is shown.

[0168] In some examples, the selection module 320 can also be configured to: in response to the presence of at least one invalid cache line that has not been filled with data among the multiple cache lines of the multiple groups, select at least one invalid cache line as at least one row to be filled; in response to the absence of at least one invalid cache line and the presence of at least one old cache line among the multiple cache lines of the multiple groups, select at least one old cache line as at least one row to be filled.

[0169] In some examples, at least one to-be-filled row corresponds to at least one third way, and the way information of the third way can be recorded in the to-be-filled information data. For example, in the to-be-filled information data, the third way corresponding to the to-be-filled row is marked as available. For example, the exclusion module 330 can also be configured to: set non-bad pixel information data based on bad pixel information data; perform an AND operation on the to-be-filled information data and the non-bad pixel information data to obtain filling information data; based on the filling information data, select a filling row for filling the to-be-cached data from the cache row corresponding to the fourth way.

[0170] For example, the non-bad pixel information data is the non-bad pixel information data, and in the non-bad pixel information data, the first path is marked as unavailable. For example, the filling information data includes the path information of the fourth path obtained after excluding the first path in at least one third path, and the fourth path is marked as available.

[0171] In some examples, the cache is divided into a plurality of cache blocks. For example, a filling operation can be performed on each cache block using a filling device for cache provided by at least one embodiment of the present disclosure. For example, the plurality of cache blocks include a target cache block, and the target cache block includes a plurality of groups and a plurality of ways applicable to the filling device for cache provided by at least one embodiment of the present disclosure.

[0172] Since in the above description, for example Figure 2 The detection method for cache shown and e.g. Figure 6 In the process of the cache filling method shown in FIG. 1 , the details of the operations of the cache detection device 200 and the cache filling device 300 have been introduced, so for the sake of brevity, they will not be repeated here. For relevant details, please refer to the above description of FIG. 1 to FIG. Figure 7 Description.

[0173] It should be noted that in Figure 8 The detection device 200 for caching shown in FIG. Fig. 9 In the illustrated cache filling device 300, the above modules can be configured as software, hardware, firmware or any combination of the above items to perform specific functions. For example, these modules can correspond to dedicated integrated circuits, pure software codes, or modules that combine software and hardware. Figure 8 and Fig. 9 The described device may be a PC computer, a tablet device, a personal digital assistant, a smart phone, a web application, or other device capable of executing program instructions, but is not limited thereto.

[0174] In addition, although the detection device 200 for cache and the filling device 300 for cache are divided into modules for performing corresponding processing respectively in the above description, it is clear to those skilled in the art that the processing performed by each module can also be performed without any specific module division in the device or without clear demarcation between the modules. Figure 8 The detection device 200 for caching described Fig. 9 The described filling device 300 for cache is not limited to include the modules described above, but some other modules (for example, a writing module, a control module, etc.) may be added as needed, or the above modules may also be combined.

[0175] At least one embodiment of the present disclosure also provides an electronic device, which includes a processor and a memory; the memory includes one or more computer program modules; the one or more computer program modules are stored in the memory and are configured to be executed by the processor, and the one or more computer program modules include a method for implementing the detection method for cache or the filling method for cache provided by the embodiments of the present disclosure described above.

[0176] Fig.10 A schematic block diagram of an electronic device provided for at least one embodiment of the present disclosure

[0177] For example, Fig.10 As shown, the electronic device 400 includes a processor 410 and a memory 420. For example, the memory 420 is used to store non-transitory computer-readable instructions (e.g., one or more computer program modules). The processor 410 is used to run non-transitory computer-readable instructions, and when the non-transitory computer-readable instructions are run by the processor 410, one or more steps of the detection method for cache or the filling method for cache described above can be executed. The memory 420 and the processor 410 can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0178] For example, the processor 410 may be a central processing unit (CPU), a digital signal processor (DSP), or other forms of processing units with data processing capabilities and / or program execution capabilities, such as a field programmable gate array (FPGA), etc.; for example, the central processing unit (CPU) may be an X86 or ARM architecture, etc. The processor 410 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 400 to perform desired functions.

[0179] For example, the memory 420 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 410 may run one or more computer program modules to implement various functions of the electronic device 400. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.

[0180] It should be noted that in the embodiments of the present disclosure, the specific functions and technical effects of the electronic device 400 can refer to the above description of the detection method for cache and the filling method for cache provided in at least one embodiment of the present disclosure, and will not be repeated here.

[0181] Fig.11 A schematic block diagram of another electronic device provided for at least one embodiment of the present disclosure.

[0182] For example, Fig.11 As shown, the electronic device 500 is suitable for implementing the detection method for cache or the filling method for cache provided in the embodiment of the present disclosure. It should be noted that, Fig.11 The electronic device 500 shown is only an example and does not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0183] For example, Fig.11 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 51, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 52 or a program loaded from a storage device 58 into a random access memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 500 for cache system simulation are also stored. The processing device 51, the ROM 52, and the RAM 53 are connected to each other through a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54. Generally, the following devices can be connected to the I / O interface 55: an input device 56 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 57 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 58 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 59. The communication device 59 can allow the electronic device 500 to communicate with other electronic devices wirelessly or by wire to exchange data.

[0184] Although Fig.11 The electronic device 500 is shown to have various devices, but it should be understood that it is not required to implement or possess all the devices shown, and the electronic device 500 may alternatively implement or possess more or fewer devices.

[0185] For the detailed description and technical effects of the electronic device 500, please refer to the above description of the detection method for cache or the filling method for cache, which will not be repeated here.

[0186] Fig.12 A schematic diagram of a storage medium provided for at least one embodiment of the present disclosure.

[0187] For example, Fig.12 As shown, the storage medium 600 stores non-transitory computer-readable instructions 610. For example, when the non-transitory computer-readable instructions 610 are executed by a computer, one or more steps of the detection method for cache or the filling method for cache described above are performed.

[0188] For example, the storage medium 600 can be applied to Fig.10 For example, the storage medium 600 may be the memory 420 in the electronic device 400. For example, the description of the storage medium 600 may refer to Fig.10 The corresponding description of the memory 420 in the electronic device 400 is shown and will not be repeated here.

[0189] There are a few points to note about this disclosure:

[0190] (1) In the drawings of the embodiments of the present disclosure, only the structures related to the embodiments of the present disclosure are involved, and other structures can refer to the general design.

[0191] (2) In the absence of conflict, features in the same embodiment or in different embodiments of the present disclosure may be combined with each other.

[0192] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A detection method for cache, wherein: The cache includes a plurality of groups and a plurality of ways, each of the plurality of groups includes a plurality of cache lines corresponding to the plurality of ways respectively, The plurality of groups include a target group, the target group includes a target cache line corresponding to the first way, The detection method for caching includes: Detecting whether there are unrepairable bad pixels in a plurality of cache lines of the target group, wherein in response to the absence of unoccupied redundant interfaces for replacing bad pixels, it is determined that the unrepairable bad pixels exist in the target cache line; In response to the existence of the unrepairable bad pixel in the target cache line of the target group, the way information of the first way corresponding to the target cache line is recorded in the bad pixel information data, wherein, in response to the way information of the first way being recorded in the bad pixel information data, the first way is marked as unavailable.

2. The method for detecting cache according to claim 1, further comprising: In response to the presence of repairable bad pixels in the plurality of cache lines of the target group, a request is made to repair the repairable bad pixels.

3. The detection method for cache according to claim 1, wherein: Before detecting whether the unrepairable bad pixels exist in the plurality of cache lines of the target group, the detection method for cache further includes: Initialize the bad pixel information data.

4. The detection method for cache according to claim 1, wherein: The cache is divided into a plurality of cache blocks, the plurality of cache blocks including a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

5. The detection method for cache according to claim 4, further comprising: In response to completion of detection of multiple cache lines of the target group of the target cache block, determining whether way information of multiple ways of the target cache block is completely updated into the bad pixel information data; In response to the way information of the multiple ways of the target cache block being all updated into the bad pixel information data, the target cache block is marked as unavailable.

6. The method for detecting cache according to claim 5, further comprising: In response to at least one second way in the plurality of ways of the target cache block not being updated to the bad pixel information data, comparing the number of the at least one second way with a bad pixel threshold; In response to the number of the at least one second way being less than the bad point threshold, the target cache block is marked as unavailable.

7. The method for detecting cache according to claim 4, further comprising: In response to all of the plurality of cache blocks of the cache being marked as unavailable, the cache is marked as unavailable.

8. A method for filling a cache, wherein: The cache includes a plurality of groups and a plurality of ways, each of the plurality of groups includes a plurality of cache lines corresponding to the plurality of ways respectively, The plurality of groups include a target group, the target group includes a target cache line corresponding to the first way, The filling method for cache includes: Reading the way information of the first way recorded in the bad pixel information data, wherein, in response to the absence of an unoccupied redundant interface for replacing the bad pixel, determining that an unrepairable bad pixel exists in the target cache line corresponding to the first way, and wherein, in response to the way information of the first way being recorded in the bad pixel information data, the first way is marked as unavailable; Selecting at least one to-be-filled row from among the plurality of cache rows of the plurality of groups; In response to the at least one to-be-filled row including the target cache row, the target cache row is excluded from the at least one to-be-filled row based on the bad pixel information data to obtain a filling row for filling the to-be-cached data.

9. The method for filling a cache according to claim 8, wherein: The road information of at least one third road corresponding to the at least one to-be-filled row is recorded in the to-be-filled information data. In the information data to be filled, the at least one third way is marked as available, Excluding the target cache line from the at least one to-be-filled line based on the bad pixel information data to obtain a filling line for filling the to-be-cached data, comprising: Setting non-bad pixel information data based on the bad pixel information data, wherein the non-bad pixel information data is the non-bad pixel information data, and in the non-bad pixel information data, the first path is marked as unavailable; Performing an AND operation on the information data to be filled and the non-bad pixel information data to obtain filling information data, wherein the filling information data includes path information of a fourth path obtained after excluding the first path in the at least one third path, and the fourth path is marked as available; Based on the filling information data, the filling row for filling the data to be cached is selected from the cache rows corresponding to the fourth way.

10. The method for filling a cache according to claim 8, wherein: Selecting the at least one to-be-filled row from a plurality of cache rows of the target group comprises: In response to at least one invalid cache line that has not been filled with data among the plurality of cache lines of the plurality of groups, selecting the at least one invalid cache line as the at least one to-be-filled line; In response to the at least one invalid cache line not existing in the plurality of cache lines of the plurality of groups and at least one aged cache line existing, the at least one aged cache line is selected as the at least one to-be-filled line.

11. The method for filling a cache according to claim 8, wherein: The cache is divided into a plurality of cache blocks, the plurality of cache blocks including a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

12. A detection device for cache, wherein: The cache includes a plurality of groups and a plurality of ways, each of the plurality of groups includes a plurality of cache lines corresponding to the plurality of ways respectively, The plurality of groups include a target group, the target group includes a target cache line corresponding to the first way, The detection device for caching comprises: a detection module configured to detect whether there are unrepairable bad pixels in the plurality of cache lines of the target group, wherein in response to the absence of unoccupied redundant interfaces for replacing bad pixels, it is determined that the unrepairable bad pixels exist in the target cache line; a recording module configured to record the way information of the first way corresponding to the target cache line into the bad pixel information data in response to the presence of an unrepairable bad pixel in the target cache line of the target group, In response to the bad pixel information data recording the path information of the first path, the first path is marked as unavailable.

13. The detection device for caching according to claim 12, further comprising: The request module is configured to request repair of the repairable bad pixels in response to the presence of the repairable bad pixels in the multiple cache lines of the target group.

14. The detection device for caching according to claim 12, further comprising: An initialization module is configured to initialize the bad pixel information data.

15. The detection device for caching according to claim 12, wherein: The cache is divided into a plurality of cache blocks, the plurality of cache blocks including a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

16. A filling device for a cache, the cache comprising a plurality of groups and a plurality of ways, each of the plurality of groups comprising a plurality of cache lines corresponding to the plurality of ways, The plurality of groups include a target group, the target group includes a target cache line corresponding to the first way, The filling device for cache comprises: a reading module configured to read the way information of the first way recorded in the bad pixel information data, wherein, in response to the absence of an unoccupied redundant interface for replacing the bad pixel, it is determined that an unrepairable bad pixel exists in the target cache line corresponding to the first way, and wherein, in response to the way information of the first way being recorded in the bad pixel information data, the first way is marked as unavailable; A selection module, configured to select at least one to-be-filled row from a plurality of cache rows of the target group; The exclusion module is configured to exclude the target cache line from the at least one to-be-filled line based on the bad pixel information data in response to the at least one to-be-filled line including the target cache line, so as to obtain a filling line for filling the to-be-cached data.

17. The filling device for a cache according to claim 16, wherein: The cache is divided into a plurality of cache blocks, the plurality of cache blocks including a target cache block, and the target cache block includes the plurality of groups and the plurality of ways.

18. An electronic device, comprising: processor; a memory including one or more computer program modules; Wherein, the one or more computer program modules are stored in the memory and configured to be executed by the processor, and the one or more computer program modules are used to implement the detection method for cache described in any one of claims 1-7 or the filling method for cache described in any one of claims 8-11.

19. A storage medium storing non-transitory computer-readable instructions, which, when executed by a computer, implement the detection method for cache described in any one of claims 1 to 7 or the filling method for cache described in any one of claims 8 to 11.

Citation Information

Patent Citations

  • Dirty cacheline duplication

    US20140173379A1