Integrated circuits and their cache memory valid bit clearing methods

By introducing a cache memory and flash memory controller into the integrated circuit, and utilizing the valid bit clearing procedure and data pre-writing mechanism, the problem of long valid bit clearing time of the cache memory is solved, achieving fast boot-up and low power consumption.

CN117636970BActive Publication Date: 2026-11-10NUVOTON
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310433228.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-08-30
Filing Date
2023-04-21
Publication Date
2026-11-10
Estimated Expiration
2043-04-21

AI Technical Summary

Technical Problem

Traditional cache memory valid bit clearing mechanisms consume a lot of time, leading to longer system boot or wake-up times and increased power consumption.

Method used

Integrating a cache memory controller and a flash memory controller into the integrated circuit, the valid bits in the cache memory are cleared by a valid bit clearing program, and the clearing program is paused when the flash memory data is ready, so that the data is directly written to the cache memory and the valid bits are restored.

Benefits of technology

It reduces system boot or wake-up time, lowers power consumption, and improves system response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117636970B_ABST
    Figure CN117636970B_ABST
Patent Text Reader

Abstract

This invention discloses an integrated circuit and a method for clearing valid bits of its cache memory. The method includes: when the integrated circuit is powered on or enters a working state from a sleep state, executing a valid bit clearing procedure using a cache memory controller to sequentially clear the tags corresponding to each address in the cache memory; in response to the flash memory controller reading a piece of data corresponding to a specific address from the flash memory, notifying the cache memory controller to pause the valid bit clearing procedure using the flash memory controller, writing the data to the specific address in the cache memory using the cache memory controller, and setting the corresponding valid bit to valid; and in response to the valid bit being set to valid, reading the data from the specific address in the cache memory using the cache memory controller to transmit it to the processor, and resuming the valid bit clearing procedure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to memory control circuits, and more particularly to an integrated circuit and a method for clearing valid bits of its cache memory. Background Technology

[0002] In hierarchical memory design, when a circuit (such as the central processing unit (CPU) or other circuits) needs to access a certain memory, if the operating speed of the CPU differs significantly from the operating speed of the memory being accessed, a memory with a speed between that of the CPU and the memory being accessed (the slower memory) is inserted. This memory is called cache memory. Besides acting as a buffer, cache memory also reads data that is not currently being accessed. If the CPU needs this data again, the cache memory can quickly fetch it back to the CPU without having to read it from the slower memory again.

[0003] However, each piece of data read from the cache has a corresponding tag to indicate the address mapping between that piece of data and the accessed object. When the CPU wants to access data from the cache controller, it first checks if a corresponding tag exists in the cache. If the tag exists and its valid bits are valid, the cache will directly transfer the data to the CPU. Caches are typically implemented using static random access memory (SRAM).

[0004] In low-power system design, when the system enters sleep mode or power-saving mode, it tries to power down the static random access memory (SRAM) as a means of reducing power consumption. This power-down SRAM includes the cache. However, when the system is first powered on or wakes up from sleep mode, the SRAM is awakened from a power-down state. Depending on the length of the sleep state and the system operating environment, the SRAM used for valid bits may still contain undischarged charges, resulting in the cached content being in a pseudo-valid state.

[0005] However, traditional cache memory valid bit clearing mechanisms often take a lot of time, which increases the boot time or wake-up time of the entire system and thus causes power consumption loss. Summary of the Invention

[0006] In view of this, the present invention provides an integrated circuit and a method for clearing valid bits of the cache memory to solve the above problems.

[0007] This invention provides an integrated circuit, comprising: a processor; a cache memory including a plurality of addresses, wherein the content of each address includes a valid bit, a tag, and a data field; a cache memory controller for controlling access to the cache memory; a flash memory; and a flash memory controller for controlling access to the flash memory; wherein when the integrated circuit is powered on or enters a working state from a sleep state, the cache memory controller executes a valid bit clearing procedure to sequentially clear the valid bits corresponding to each address in the cache memory, wherein, in response to the flash memory controller clearing the data from the cache memory... The flash memory reads a piece of data corresponding to a specific address. The flash memory controller instructs the cache controller to pause the valid bit clearing procedure. The cache controller writes the data to the specific address in the cache, writes the specific mapped address to the tag in the cache, and sets its valid bit. The valid bit corresponding to the specific address in the cache is set to valid. The cache controller reads the data from the specific address in the cache, transmits the data to the processor, and resumes the valid bit clearing procedure.

[0008] In some embodiments, when the cache controller writes the data to the specific address of the cache, the cache controller writes the specific address to a temporary register.

[0009] In some embodiments, when the valid bit clearing procedure reaches the specific address, the cache controller skips the valid bit clearing operation of the specific address in the cache based on the specific address stored in the register.

[0010] In some embodiments, when the valid bit clearing procedure is executed to the specific address, the temporary register is used to store a second specific address and a corresponding second mapped address, and the second specific address is greater than the specific address.

[0011] In some embodiments, when the integrated circuit is powered on or enters the working state from the hibernation state, the processor sends a data read instruction to the flash memory controller to read the data from the specific address of the flash memory.

[0012] The present invention also provides a method for clearing valid bits of a cache memory, used in an integrated circuit, wherein the integrated circuit includes a processor, a cache memory, a cache memory controller, a flash memory, and a flash memory controller. The method includes: when the integrated circuit is powered on or enters a working state from a hibernation state, executing a valid bit clearing procedure using the cache memory controller to sequentially clear the valid bits corresponding to each address in the cache memory; in response to the flash memory controller reading a piece of data corresponding to a specific address from the flash memory, notifying the cache memory controller to pause the valid bit clearing procedure using the flash memory controller, writing the piece of data to the specific address in the cache memory using the cache memory controller, and setting the valid bits corresponding to the specific address in the cache memory to be valid; reading the piece of data from the specific address in the cache memory using the cache memory controller, transmitting the piece of data to the processor, and resuming the valid bit clearing procedure.

[0013] In some embodiments, when the flash memory controller writes the data to the specific address of the cache, the flash memory controller writes the specific address, the corresponding tag, and the data to a temporary register.

[0014] In some embodiments, when the valid bit clearing procedure reaches the specific address, the cache controller uses the specific address stored in the temporary register to skip the valid bit clearing operation of the specific address in the cache.

[0015] In some embodiments, when the valid bit clearing procedure is executed to the specific address, the temporary register is used to store a second specific address and the corresponding tag and data, and the second specific address is greater than the specific address.

[0016] In some embodiments, when the integrated circuit is powered on or enters the working state from the hibernation state, the processor transmits a data read instruction to the flash memory controller to read the data from the specific address of the flash memory. Attached Figure Description

[0017] Figure 1 This is a block diagram of an integrated circuit according to an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of the data architecture of a cache memory according to an embodiment of the present invention.

[0019] Figure 3 This is a waveform diagram of a processor accessing a flash memory according to an embodiment of the present invention.

[0020] Figure 4This is a waveform diagram of a processor accessing a flash memory according to another embodiment of the present invention.

[0021] Figure 5 This is a flowchart of a cache valid bit clearing method according to an embodiment of the present invention.

[0022] Explanation of reference numerals in the attached figures:

[0023] 100: Integrated Circuits

[0024] 110: Processor

[0025] 111: Cache Memory Controller

[0026] 120: Flash Memory Controller

[0027] 130: Cache memory

[0028] 140: Flash Memory

[0029] 150: Temporary Register

[0030] S510-S540: Steps

[0031] VALID: Significant Bits Field

[0032] TAG: Tag Field

[0033] DATA: Data field

[0034] TAG1-TAG4: Tags

[0035] DATA1-DATA4: Data

[0036] V: Valid

[0037] NV: Invalid

[0038] CPU_CLK: Processor clock signal

[0039] CPU_RDEN: Processor read enable signal

[0040] CPU_ADDR: Processor address signal

[0041] CPU_RDATA: Processor reads data signal

[0042] CPU_RREADY: Processor read ready signal

[0043] SRAM_TAG_CLK: Cache tag clock signal

[0044] SRAM_TAG_WREN: Cache tag write enable signal

[0045] SRAM_TAG_ADDR: Cache tag address signal

[0046] SRAM_TAG_WDATA: Data write signal for cache tag.

[0047] SRAM_DATA_ADDR: Data address signal for cache memory

[0048] SRAM_DATA_WDATA: Data write signal to cache memory

[0049] SRAM_DATA_RDATA: Data read signal from cache memory

[0050] FLASH_DATA_RDATA: Flash memory read data signal

[0051] ADDR_x: address

[0052] DATA_x: data

[0053] Invalid: Invalid

[0054] valid: effective

[0055] T1-T5, T F+1 T F+2 T F+3 :time Detailed Implementation

[0056] The following description illustrates a preferred embodiment of the invention and is intended to describe the basic spirit of the invention, but is not intended to limit the invention. The actual invention must be understood within the scope of the foregoing claims.

[0057] It must be understood that the words “comprising” and “including” used in this specification are used to indicate the presence of specific technical features, values, method steps, work processes, elements and / or components, but do not preclude the addition of more technical features, values, method steps, work processes, elements, components, or any combination thereof.

[0058] The use of terms such as "first," "second," and "third" in the claims is to modify the elements in the claims, and is not to indicate a priority order, a prior relationship, or that one element precedes another, or the chronological order of the execution of method steps. It is only used to distinguish elements with the same name.

[0059] Figure 1 This is a block diagram of an integrated circuit according to an embodiment of the present invention.

[0060] Integrated circuit 100 may be, for example, a system-on-a-chip (SoC) or an application-specific integrated circuit (ASIC). Figure 1 As shown, integrated circuit 100 includes a processor 110, a flash memory controller 120, a cache memory 130, a flash memory 140, and a temporary register 150. The processor 110 may be, for example, a central processing unit (CPU), a microcontroller (MCU), a digital signal processor (DSP), etc., but the invention is not limited thereto. The cache memory 130 may be implemented, for example, with static random access memory (SRAM), but the invention is not limited thereto.

[0061] In some embodiments, the processor 110 includes a cache controller 111 for controlling operations such as data access and valid bit clearing in the cache. In other embodiments, the cache controller 111 may be located outside the processor 110, but the present invention is not limited thereto.

[0062] Flash memory controller 120 is electrically connected to processor 110, cache 130, flash memory 140, and scratchpad 150. Flash memory controller 120 controls data access to flash memory 140 and can write data read from flash memory 140 to cache 130 and / or scratchpad 150. Furthermore, both cache controller 111 and flash memory controller 120 can control data access to scratchpad 150.

[0063] Figure 2 This is a schematic diagram of the data architecture of a cache memory according to an embodiment of the present invention. Please also refer to... Figure 1 and Figure 2 .

[0064] like Figure 2 As shown, the cache memory 130 includes multiple indices, such as index 1 to index N, where each index stores content including a valid bit field (VALID), a tag field (TAG), and a data field (DATA). When the content of a specific index in the cache memory 130 is updated by the processor 110's access request, the valid bits of that specific index are marked as valid, such as... Figure 2 The valid bit field VALID indicates the value of V. When the content of a specific index in the cache 130 is not updated, the valid bits of that specific index are marked as invalid, such as... Figure 2The NV is indicated by the VALID field, which represents the valid bit.

[0065] exist Figure 2 In the embodiment, the valid bits located at indices 1 and 4 are marked as valid (V), so the corresponding tags TAG1 and TAG2, and data DATA1 and DATA4 are valid. The valid bits located at indices 2 and 3 are marked as invalid (NV), so the corresponding tags TAG2 and TAG3, and data DATA2 and DATA3 are invalid, and so on.

[0066] In detail, when the system is first powered on or wakes up from hibernation mode, the cache 130 is awakened from a power-off state. Therefore, the contents of the TAG and DATA fields of each index in the cache 130 are very likely to be incorrect. Thus, the VALID field of each index in the cache 130 needs to be cleared and marked as invalid (NV) to prevent the processor 110 from reading incorrect data from the cache 130. Only after the VALID field of each index in the cache 130 has been marked as invalid (NV) will the processor 110 begin subsequent access operations. Then, if the processor 110 wants to read data from a specific index in the cache 130, the valid bits of that specific index must first be set to valid (V). This invention... Figure 3 and Figure 4 Two different methods for clearing valid bits of the cache memory are provided in the embodiments.

[0067] Figure 3 The image shows a waveform diagram of a processor accessing flash memory according to an embodiment of the present invention. Please also refer to... Figure 1 and Figure 3 .

[0068] exist Figure 3 In this embodiment, the definitions of various signals are first explained. Signals related to processor 110 include: CPU_CLK, representing the processor clock signal; CPU_RDEN, representing the processor read enable signal; CPU_ADDR, representing the processor address signal; CPU_RDATA, representing the processor read data signal; and CPU_RREADY, representing the processor read ready signal.

[0069] Signals associated with cache memory 130 include: SRAM_TAG_CLK, representing the cache memory tag clock signal; SRAM_TAG_WREN, representing the cache memory tag write enable signal; SRAM_TAG_ADDR, representing the cache memory tag address signal; SRAM_TAG_WDATA, representing the cache memory tag write data signal; SRAM_DATA_ADDR, representing the cache memory data address signal; SRAM_DATA_WDATA, representing the cache memory write data signal; and SRAM_DATA_RDATA, representing the cache memory read data signal.

[0070] Signals associated with flash memory 140 include: FLASH_DATA_RDATA, which indicates the flash memory read data signal.

[0071] like Figure 3 As shown, at time T1, processor 110 issues a read request for address ADDR_x. In this embodiment, because the system has just been powered on or woken from hibernation mode, cache controller 111 executes a first valid bit clearing procedure to clear the valid bits of each index in cache memory 130 to an invalid state one by one. It should be noted that when cache controller 111 executes the first valid bit clearing procedure, cache controller 111 can set the busy flag of cache memory 130 to 1 to prevent processor 110 or flash memory controller 120 from accessing cache memory 130.

[0072] However, compared to the processor clock signal CPU_CLK and the cache tag clock signal SRAM_TAG_CLK (e.g., 100MHz or higher), the flash memory 140 has a relatively slow read speed (e.g., 25MHz), so the flash memory 140 cannot prepare the data that the processor 110 wants to read in time T2 (i.e. the next clock cycle).

[0073] For ease of explanation, this embodiment assumes that the flash memory 140 has already read the data DATA_x required by the processor 110's read request at time T3 (note: in reality, it usually finishes reading after time T3). At this time, although the flash memory 140 has prepared the data DATA_x at time T3, because the cache controller 111 is still executing the first valid bit clearing procedure to clear the valid bits of each index in the cache memory 130 one by one, the flash memory controller 120 still cannot write the data DATA_x to the cache memory 130 through the cache controller 111. After the first valid bit clearing procedure is completed, the cache controller 111 can set the busy flag of the cache memory 130 to 0 to notify the processor 110 and the flash memory controller 120 that the data in the cache memory 130 can be accessed.

[0074] For example, at time T F At that time, the cache controller 111 is ready to clear the last valid bit VALID_final, and at time T F+1 At this time, the cache controller 111 has cleared all valid bits in the cache memory 130. The flash memory controller 120 can then write the read data DATA_x to the data field DATA of index x in the cache memory 130 via the cache controller 111, write the corresponding mapped address of index x to the tag field TAG, and set the valid bit VALID to valid (V).

[0075] Next, at time T F+2 At time T, because valid data at address ADDR_x already exists in cache memory 130, cache memory controller 111 can transfer the data DATA_x at index x in cache memory 130 to processor 110 and raise the processor read-ready signal CPU_RREADY to a high logic state to indicate that the read operation is complete. Therefore, at time T F+3 At that time, the cache memory controller 111 can accept new read requests.

[0076] Figure 4 The following is a waveform diagram of a processor accessing flash memory according to another embodiment of the present invention. Please also refer to... Figure 1 and Figure 4 .

[0077] Figure 4 The various signals shown are Figure 3 Similarly, its content will not be repeated here. Figure 4As shown, at time T1, processor 110 issues a read request for address ADDR_x. In this embodiment, because the system has just been powered on or just woken from hibernation mode, cache controller 111 executes a second valid bit clearing procedure to clear the valid bits of each index in cache memory 130 to an invalid state one by one. It should be noted that when cache controller 111 executes the second valid bit clearing procedure, cache controller 111 can also set the busy flag of cache memory 130 to 1 to prevent processor 110 or flash memory controller 120 from accessing cache memory 130.

[0078] However, compared to the processor clock signal CPU_CLK and the cache tag clock signal SRAM_TAG_CLK (e.g., 100MHz or higher), the flash memory 140 has a relatively slow read speed (e.g., 25MHz), so the flash memory 140 cannot prepare the data that the processor 110 wants to read in time T2 (i.e. the next clock cycle).

[0079] For ease of explanation, this embodiment assumes that the flash memory 140 has already read the data DATA_x required by the processor 110's read request at time T3 (note: in reality, it usually completes the reading after time T3). At this time, the flash memory 140 has prepared the data DATA_x at time T3 and notifies the cache controller 111 to pause the second valid bit clearing procedure, for example, when the cache tag address signal SRAM_TAG_ADDR = 2. The cache controller 111 directly sets the valid bit of the corresponding address in the cache 130 (note: corresponding to the cache tag address signal) to valid and directly writes the read data DATA_x into the data field DATA at the corresponding address in the cache 130. It should be noted that the above-mentioned corresponding address depends on different cache architectures. For example, if the cache is a direct-mapped architecture, then this corresponding address is the remainder of ADDR_x divided by the number of cache blocks, but the present invention is not limited to this.

[0080] Next, at time T4, the cache controller 111 resumes the second valid bit clearing procedure from the cache tag address signal SRAM_TAG_ADDR = 3. Furthermore, at time T4, the cache controller 111 can transfer the data DATA_x at the corresponding address in the cache 130 to the processor 110 and raise the processor read-ready signal CPU_RREADY to a high logic state to indicate that the read operation is complete.

[0081] It is important to note that at time T3, when the flash memory controller 120 directly writes the read data DATA_x to the data field DATA of index x in the cache memory 130 via the cache memory controller 111, the flash memory controller 120 will write the address of index x to the temporary register 150. For example, the second valid bit clearing procedure also clears the valid bits of each index in the cache memory 130 to an invalid state one by one. Assuming index x = 5, when the second valid bit clearing procedure clears the valid bits of each index one by one until index x = 5, because the temporary register 150 has already stored index x = 5, it means that index x = 5 has been accessed during the execution of the second valid bit clearing procedure. That is, the content value (including valid bits, tag, and data) of index x = 5 is valid. Therefore, the second valid bit clearing procedure will skip the valid bit clearing operation of index x = 5 and continue clearing the valid bits from index x = 6.

[0082] It should be noted that because the read speed of flash memory 140 is much slower than that of cache memory 130, generally a small number of temporary registers 150 are sufficient for the cache memory controller 111 to use when executing the second valid bit clearing procedure. If the difference between the access speed of cache memory 130 and the read speed of flash memory 140 is large (greater than 4 times), the number of temporary registers 150 can be reduced accordingly. If the difference between the access speed of cache memory 130 and the read speed of flash memory 140 is small (less than 4 times), the number of temporary registers 150 can be increased accordingly.

[0083] In detail, Figure 4 In this embodiment, the cache controller 111 can perform a second valid bit clearing procedure to clear the valid bits of each index in the cache 130 at the same time that the flash memory controller 120 reads data from the flash memory 140. When the second valid bit clearing procedure has reached the position of index x, the content value of the temporary register 150 can be used to determine whether the valid bits of index x need to be cleared or are valid. For example, when the second valid bit clearing procedure reaches index x, the processor 110 issues a read request for address ADDR_y (corresponding to index y), and if index y > index x, then the content of index y is updated and index y is written to the temporary register 150. If index x > index y, then the processor directly checks index y to determine whether the corresponding tag has been hit.

[0084] Compared to Figure 3 Implementation examples, Figure 4The embodiment can more efficiently pre-write data read from flash memory 140 to cache memory 130 without waiting for the valid bit clearing procedure executed by cache memory controller 111 to be fully completed, and cache memory controller 111 can immediately transmit the data pre-written to cache memory 130 to processor 110 in the next clock cycle, thereby reducing the waiting time when the integrated circuit 100 is powered on or enters working state from hibernation state, thus reducing the power consumption of integrated circuit 100.

[0085] Figure 5 This is a flowchart of a cache valid bit clearing method according to an embodiment of the present invention. Please also refer to... Figure 1 , Figure 4 and Figure 5 .

[0086] In step S510, the system powers on or enters the operating state from a sleep state. For example, when the system (e.g., including integrated circuit 100 and connected components) enters a sleep mode or a power-saving mode, it will try to power off the static random access memory (including cache memory) as a means of reducing power consumption. This power-off static random access memory naturally includes the cache memory. However, when the system is first powered on or wakes up from a sleep mode, the static random access memory (including cache memory) is woken up from a power-off state. Depending on the duration of the sleep state and the system operating environment, the static random access memory used as valid bits may still have undischarged charges. This can cause the static random access memory used as valid bits to still contain random values ​​after waking up, leading the cache memory controller 111 to mistakenly determine it as valid.

[0087] In step S520, the cache memory controller 111 executes a valid bit clearing procedure (e.g., Figure 4 The second valid bit clearing procedure in the embodiment sequentially clears the valid bits corresponding to each address in the cache memory 130. For example, when the cache memory controller 111 executes the second valid bit clearing procedure, the cache memory controller 111 can also set the busy flag of the cache memory 130 to 1 to prevent the processor 110 or the flash memory controller 120 from accessing the cache memory 130.

[0088] In step S530, in response to the flash memory controller 120 reading a piece of data corresponding to a specific address from the flash memory 140, the flash memory controller 120 notifies the cache memory controller 111 to pause the valid bit clearing procedure, writes the data to the specific address of the cache memory 130, and sets the tag corresponding to the specific address of the cache memory 130 as valid. In one embodiment, for example, assuming that the valid bit clearing procedure has now reached index x and the processor 110 issues an access request to access index y, when index y is greater than index x, the flash memory controller 120, through the cache memory controller 111, directly writes the read data DATA_x into the data field of index y in the cache memory 130 and writes index y to the temporary register 150, and the cache memory controller 111 then responds to the access request from the processor 110. That is, the temporary register 150 can be used by a later indexing operation to determine whether data has been written to the cache during the valid bit clearing process for this index y, and the cache controller 111 can perform the valid bit clearing procedure at the same time that the flash memory controller 120 reads data from the flash memory 140 (e.g., Figure 4 The second valid bit clearing procedure of the embodiment clears the valid bits of each index in the cache memory 130. If the processor 110 wants to access the data of index y again during the valid bit clearing procedure, the cache memory controller 111 will directly respond to the access request of the processor 110. When index y is less than or equal to index x, the flash memory controller 120 writes the read data DATA_x directly to the data field DATA of index x in the cache memory 130 through the cache memory controller 111 and writes the tag field of index x as valid (V), and the cache memory controller 111 then responds to the access request of the processor 110.

[0089] In step S540, the cache controller 111 reads the data from the specific address in the cache memory 130, transmits the data to the processor 110, and resumes the valid bit clearing procedure. For example, the flash memory controller 120 can pre-write data read from the flash memory 140 into the cache memory 130 through the cache controller 111 without waiting for the valid bit clearing procedure executed by the cache controller 111 to complete. Furthermore, the cache controller 111 can immediately transmit the data pre-written into the cache memory 130 to the processor 110 in the next clock cycle, thereby reducing the waiting time when the integrated circuit 100 is powered on or enters the working state from the sleep state, thus reducing the power consumption of the integrated circuit 100.

[0090] In summary, this invention provides an integrated circuit and a method for clearing valid bits of its cache memory. When the cache memory controller executes a valid bit clearing procedure, and the flash memory controller has finished reading data from a specific address in the flash memory, the flash memory controller can notify the cache memory controller to pause the valid bit clearing procedure. The cache memory controller then pre-writes this data into the cache memory. The cache memory controller can then immediately transmit this pre-written data to the processor in the next clock cycle, reducing the waiting time during system power-on or transition from sleep to operating state, thereby reducing the power consumption of the integrated circuit.

[0091] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the scope of the invention. Any person skilled in the art can make some modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the scope defined in the claims.

Claims

1. An integrated circuit, characterized in that, include: One processor; A cache memory includes multiple addresses, and the contents of each address include valid bits, tags, and data fields; A cache controller for controlling access to the cache; A flash memory; and A flash memory controller for controlling access to the flash memory; When the integrated circuit is powered on or enters a working state from a sleep state, the cache memory controller executes a valid bit clearing procedure to sequentially clear the valid bits corresponding to each address in the cache memory. In this process, in response to the flash memory controller reading a piece of data corresponding to a specific address from the flash memory, the flash memory controller notifies the cache controller to pause the valid bit clearing procedure, and the cache controller then writes the data to the specific address of the cache, writes the corresponding mapping address of the specific address to the tag of the specific address of the cache, and sets the valid bit of the specific address to valid; Wherein, in accordance with the fact that the valid bit corresponding to the specific address of the cache memory is set to valid, the cache memory controller reads the data from the specific address of the cache memory, transmits the data to the processor, and resumes the valid bit clearing procedure.

2. The integrated circuit as described in claim 1, characterized in that, When the cache controller writes the data to the specific address of the cache, the cache controller also writes the specific address and the corresponding mapped address to a temporary register.

3. The integrated circuit as described in claim 2, characterized in that, When the valid bit clearing procedure reaches the specific address, the cache controller skips the valid bit clearing operation of the specific address in the cache based on the specific address stored in the temporary register.

4. The integrated circuit as described in claim 3, characterized in that, When the valid bit clearing procedure is executed to the specific address, the temporary register is used to store a second specific address and a corresponding second mapped address, and the second specific address is greater than the specific address.

5. The integrated circuit as described in claim 1, characterized in that, When the integrated circuit is powered on or enters the working state from the hibernation state, the processor sends a data read instruction to the flash memory controller to read the data from the specific address of the flash memory.

6. A method for clearing valid bits of a cache memory, used in an integrated circuit, characterized in that, The integrated circuit includes a processor, a cache memory, a cache memory controller, a flash memory, and a flash memory controller. The cache memory includes multiple addresses, and the content of each address includes valid bits, a tag, and a data field. The method includes: When the integrated circuit is powered on or enters a working state from a sleep state, the cache memory controller executes a valid bit clearing procedure to sequentially clear the valid bits corresponding to each address in the cache memory. In response to the flash memory controller reading a piece of data corresponding to a specific address from the flash memory, the flash memory controller notifies the cache memory controller to pause the valid bit clearing procedure, and the cache memory controller writes the data to the specific address in the cache memory, writes the corresponding mapped address to the tag corresponding to the specific address in the cache memory, and sets the valid bit corresponding to the specific address to valid; and When the valid bit corresponding to the specific address in the cache is set to valid, the cache controller reads the data from the specific address in the cache, transmits the data to the processor, and resumes the valid bit clearing procedure.

7. The cache memory valid bit clearing method as described in claim 6, characterized in that, Also includes: When the cache controller writes the data to the specific address of the cache, the cache controller writes the specific address and the corresponding mapped address to a temporary register.

8. The cache memory valid bit clearing method as described in claim 7, characterized in that, Also includes: When the valid bit clearing procedure reaches the specific address, the cache controller uses the specific address stored in the temporary register to skip the valid bit clearing operation of the specific address in the cache.

9. The cache memory valid bit clearing method as described in claim 8, characterized in that, When the valid bit clearing procedure is executed to the specific address, the temporary register is used to store a second specific address and a corresponding second mapping address and data, and the second specific address is greater than the specific address.

10. The cache memory valid bit clearing method as described in claim 6, characterized in that, Also includes: When the integrated circuit is powered on or enters the working state from the hibernation state, the processor transmits a data read instruction to the flash memory controller to read the data from the specific address of the flash memory.

Citation Information

Patent Citations

  • Apparatus and method for reading-writing and rapidly fetching hard disk data

    CN101256535A

  • Electronic computer with cache memory

    JP1996095861A