Cache for processing requests, operation method of cache and electronic equipment comprising cache

By using tag memory in the cache system to mark whether the data has been ejected, and changing the status of the cache line when receiving a ejection request, the problem of the cache being unable to recognize that the data has been discarded is solved, improving performance and security, and avoiding unnecessary errors. Necessary operations and external read risks.

CN118689792APending Publication Date: 2024-09-24SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410336821.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-08
Filing Date
2024-03-22
Publication Date
2024-09-24

Smart Images

  • Figure CN118689792A_ABST
    Figure CN118689792A_ABST
Patent Text Reader

Abstract

The cache includes a data memory, a tag memory, and a cache controller. The data memory includes a stack region in which data used by an external processor is stored in a plurality of cache lines in a stack structure. The tag memory stores a tag entry including useless information indicating whether data stored in a corresponding cache line has been popped up. The cache controller is configured to change useless information of a cache line storing data subjected to a pop-up request to a useless state when the pop-up request for the data stored in the stack area is received.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This patent application claims the benefit of Korean Patent Application No. 10-2023-0038959 filed on March 24, 2023, with the Korean Intellectual Property Office, and Korean Patent Application No. 10-2003-0059419 filed on May 8, 2023, with the Korean Intellectual Property Office, the disclosures of which are incorporated herein by reference in their entirety. Technical Field

[0003] The inventive concept relates to a cache for processing a request for data stored in a stack area. Background Art

[0004] The processor included in the electronic device uses a cache to process data at high speed. The cache can be arranged between the main memory and the processor included in the electronic device, and can store data frequently accessed by the processor among the data stored in the main memory. The cache capacity is small, but data can be processed at high speed.

[0005] A stack is a data structure that serves as a collection of elements, with two main operations, one being a push to add an element to the collection, and the other being a pop to remove the most recently added element. A cache may include a stack area corresponding to a stack for storing data, such as a register used by a processor. The processor may write data in the stack area of ​​the cache by executing a push request to push, and read data from the stack area of ​​the cache by executing a pop request to pop. When data transmitted to the processor by a pop request is discarded and not reused by the processor, the data may not be deleted in the cache. However, since the cache may not recognize that the pop data has been discarded, the cache may perform unnecessary operations on the pop data, such as writing the pop data back to the main memory. In addition, the cache may transmit the pop data in response to a read request for the pop data from another device, thereby causing security issues. Summary of the invention

[0006] At least one embodiment of the inventive concept provides a cache for managing ejected data by using garbage information.

[0007] According to one aspect of the inventive concept, a cache includes a data memory, a tag memory, and a cache controller. The data memory includes a stack area that stores data used by an external processor in a plurality of cache lines in a stack structure. The tag memory stores a tag entry including useless information indicating whether the data stored in the corresponding cache line has been ejected. The cache controller is configured to, when receiving an eject request for data stored in the stack area, change the useless information of the cache line storing the data subjected to the eject request to a useless state.

[0008] According to one aspect of the inventive concept, a method for operating a cache is provided, the cache comprising a data memory, a tag memory and a cache controller, the data memory comprising a stack area storing data in a stack structure. The method comprises: receiving, by the cache controller, an eject request from a processor; and changing, by the cache controller, unused information of a cache line of the stack area storing data subjected to the eject request in the tag memory to an unused state, wherein the unused information indicates whether the data stored in the corresponding cache line has been ejected.

[0009] According to one aspect of the inventive concept, an electronic device includes a main memory, a cache, and a processor. The cache includes a data memory, a tag memory, and a cache controller. The data memory includes a stack area that stores data used by the processor in a plurality of cache lines in a stack structure. The tag memory is used to store tag entries including information about the data stored in the stack area. The cache controller is configured to process a request for data stored in the stack area based on the tag entry. The tag entry includes useless information indicating whether the data stored in the corresponding cache line has been ejected. The cache controller is also configured to, when a pop-up request for data stored in the stack area is received, change the useless information of the cache line storing the data subject to the pop-up request to a useless state. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Embodiments of the present invention will be more clearly understood through the following detailed description in conjunction with the accompanying drawings, in which:

[0011] Figure 1 is a block diagram of an electronic device according to an embodiment;

[0012] Figure 2 is a block diagram of a cache according to an embodiment;

[0013] Figure 3 is a diagram showing a detailed structure of a tag memory included in a cache according to an embodiment;

[0014] Figure 4 is a diagram showing state changes of a plurality of cache lines of a data memory when a cache receives a push request according to an embodiment;

[0015] Figure 5 is a diagram showing state changes of a plurality of cache lines of a data memory when a cache receives an eject request according to an embodiment;

[0016] Figure 6 is a flow chart of a method of operation when a cache receives a pop-up request according to an embodiment;

[0017] Figure 7is a flow chart of a method of operation when a cache receives a push request for a cache line in a useless state according to an embodiment;

[0018] Figure 8 is a flow chart of a method of operation when a read request for a cached stack area is received according to an embodiment;

[0019] Fig. 9 is a flowchart of an operating method when a cache performs an eviction operation or a refresh operation according to an embodiment; and

[0020] Fig.10 is a block diagram of a system according to an embodiment. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments are described in detail with reference to the accompanying drawings.

[0022] Figure 1 is a block diagram of an electronic device 10 according to an embodiment.

[0023] refer to Figure 1 , the electronic device 10 according to the embodiment includes a main memory 100 , a cache 200 , and a processor 300 .

[0024] In an embodiment, the electronic device 10 can be a smart phone, a tablet personal computer (PC), a smart TV (TV), a mobile phone, a personal digital assistant (PDA), a laptop computer, a media player, a micro server, a global positioning system (GPS) device, an e-book terminal, a digital broadcast terminal, a navigation, an information kiosk, a moving picture expert group layer three (MP3) player, a digital camera, a household appliance, and other mobile or non-mobile computing devices. However, the inventive concept is not limited to this. In addition, the electronic device 10 can be a wearable device with a data processing function, such as a watch, glasses, a hairband, and a ring. However, the inventive concept is not limited to this, and the electronic device 10 may include all types of devices that operate based on an operating system (OS) by using a processor.

[0025] In an embodiment, the main memory 100, the cache 200, and the processor 300 included in the electronic device 10 are implemented on a single system on chip (SoC) within the electronic device.

[0026] The main memory 100 may store data used by the processor 300. The main memory 100 may include a nonvolatile memory including a static random access memory (SRAM), a dynamic random access memory (DRAM), etc. However, the inventive concept is not limited thereto, and the main memory 100 may include any type of memory accessible by the processor 300, for example, a nonvolatile memory such as a flash memory, a phase change random access memory (PRAM), a magnetic random access memory (MRAM), and a ferroelectric random access memory (FeRAM).

[0027] The cache 200 may store some data stored in the main memory 100. In an embodiment, the capacity of the cache 200 for storing data is smaller than the capacity of the main memory 100. In an embodiment, the physical characteristics of the cache 200 are different from those of the main memory 100 so that data can be written to or read from the cache 100 faster than the main memory 100. The cache 200 may be implemented as a volatile memory (e.g., SRAM), but the inventive concept is not limited thereto. Figure 2 The structure and operation of cache 200 is described in more detail.

[0028] The processor 300 may control the overall operation of the electronic device 10. In an embodiment, the processor 300 may be a central processing unit (CPU).

[0029] The processor 300 may store some data used internally in the cache 200. The processor 300 may send a push request for data to the cache 200 and store the data in the stack area of ​​the cache 200. For example, the processor 300 may store data registered in an internal register in the cache 200 through a push request.

[0030] In addition, the processor 300 may send a pop request for data to the cache 200 to retrieve the data stored in the stack area of ​​the cache 200. For example, the processor 300 may retrieve the data temporarily stored in the cache 200 through the pop request. The push request may be an electronic message including a command for instructing the cache 200 to store the first data in the stack area. The pop request may be an electronic message including a command for instructing the cache 200 to output the first data from the stack area to the processor 300.

[0031] Figure 2 is a block diagram of a cache 200 according to an embodiment.

[0032] refer to Figure 2 , the cache 200 according to the embodiment includes a data memory 210, a tag memory 220, and a cache controller 230 (eg, a controller circuit).

[0033] The data memory 210 may store some data stored in the main memory 100 and some data used within the processor 300. The data memory 210 may include a plurality of cache lines.

[0034] The data memory 210 may include a stack area 211. The stack area 211 may include some cache lines among a plurality of cache lines, and may store data used by the processor 300 in a plurality of the included cache lines in the stack structure.

[0035] The tag memory 220 may store information about the data stored in the data memory 210 .

[0036] The tag storage 220 may store a plurality of tag entries 221. Figure 3 Describes the structure of multiple tag entries in more detail.

[0037] Figure 3 is a diagram illustrating a detailed structure of the tag memory 220 included in the cache 200 according to an embodiment.

[0038] refer to Figure 3 , a plurality of tag entries 221 included in the tag memory 220 according to the embodiment may be identified. Each of the plurality of tag entries 221 may store information about data stored in a corresponding cache line among a plurality of cache lines.

[0039] In an embodiment, each of the plurality of tag entries 221 includes valid information, dirty information, shared information, unused information, and a tag address.

[0040] The valid information may indicate whether the data stored in the corresponding cache line is valid. For example, when the valid information is in a valid state, it may indicate that the data stored in the corresponding cache line is valid data. In another example, when the valid information is in an invalid state, it may indicate that the data stored in the corresponding cache line is invalid data. For example, a computer program may be allowed to process valid data, but not invalid data.

[0041] The dirty information may indicate whether the data stored in the corresponding cache line is different from the data stored in the main memory 100. For example, when the dirty information is in a dirty state, it may indicate that the data stored in the corresponding cache line is different from the data stored in the main memory 100. In another example, when the dirty information is in a clean state, it may indicate that the data stored in the corresponding cache line is the same as the data stored in the main memory 100. For example, if a computer program operates on a variable storing variable data, the variable data has a first value in the main memory 100 and has a second other value in the cache 200, the dirty information of the variable data will be in a dirty state.

[0042] The sharing information may indicate whether the data stored in the corresponding cache line is data shared by caches other than itself. For example, when the sharing information is in a shared state, it may indicate that the data stored in the corresponding cache line is data shared by caches other than itself. In another example, when the sharing information is in a non-shared state, it may indicate that the data stored in the corresponding cache line is data not shared by caches other than itself.

[0043] Useless information can indicate whether the data stored in the corresponding cache line has been popped out. For example, when the useless information is in a useless state, it indicates that the data stored in the corresponding cache line has been popped out. For example, if the computer program is currently processing an instruction that needs to perform an operation on the variable data stored in the stack area 211, the computer program can request to pop out the variable data from the stack area 211 to read the variable data, and then perform an operation on the variable data read or popped out. The pop-up request can cause the useless information associated with the variable data to be set to a useless state. For example, if the computer program no longer needs the variable data after performing the operation, the variable data is no longer useful to the computer program. In another example, when the useless information is in a useful state, it indicates that the data stored in the corresponding cache line is data that has not yet been popped out. For example, if the computer program has not yet reached the instruction that needs to perform an operation on the variable data stored in the stack area 211, then because the computer program may still need to use the variable data, the useless information can remain in a useful state.

[0044] The tag address may be information for converting a virtual address included in a request for a corresponding cache line into a physical address.

[0045] Reference again Figure 2 , cache controller 230 may control the overall operation of cache 200. In an embodiment, cache controller 230 is implemented as a finite state machine (FSM).

[0046] The cache controller 230 may perform an operation corresponding to a request received from the processor 300 .

[0047] Cache controller 230 may receive a pop request to read data stored in stack area 211 from processor 300. When receiving a pop request for data stored in stack area 211, cache controller 230 may change useless information of a cache line subject to the pop request to a useless state.

[0048] In response to an eject request received from the processor 300, the cache controller 230 may output the data stored in the stack area 211 to the processor 300. In this case, the cache controller 230 may output the data of the stack area 211 subjected to the eject request to the processor 300.

[0049] Then, the cache controller 230 may change the useless information of the cache line storing the data subjected to the eject request to a useless state. When the cache controller 230 changes the useless information of the cache line storing the data subjected to the eject request to a useless state, unnecessary operations such as writing back the eject data based on the useless information are not performed. The computer program may load the first variable data of the variable stored in the main memory 100 at a first time, change the first variable data to the second other variable data at a second time, store the second variable data in the cache 200 at a third time, and then perform a write back at a fourth time to overwrite the variable stored in the main memory 100 with the second variable data. However, if the second variable data is located in the stack area 211 and its useless information indicates that it is in a useless state, the write back is not performed. If the second variable data is located in the stack area 211 and its useless information indicates that it is in a useful state, the write back may still be performed.

[0050] The cache controller 230 may receive a push request to write data in the stack area 211 from the processor 300. When receiving the push request to the stack area, the cache controller 230 may change the valid information of the cache line used to store the data subject to the push request to a valid state, and change the dirty information of the cache line used to store the data subject to the push request to a dirty state. For example, when the processor 300 desires to change the first variable data of the variable of the main memory 100 to the second variable data, the processor 300 may output a push request to store the second variable data in the stack area 211 of the cache 200. Since the variable still has the first variable data in the main memory 100, the dirty information is set to a dirty state.

[0051] In response to a push request received from the processor 300 , the cache controller 230 may write the data subject to the push request into the stack area 211 .

[0052] Then, the cache controller 230 may change the valid information of the cache line to a valid state to store the data subjected to the push request. Therefore, the cache controller 230 may identify that the cache line for storing the data subjected to the push request stores valid data. For example, a cache line for storing the second variable data of a variable may have an invalid state until the writing of the second variable data of the cache line is successfully completed.

[0053] In addition, the cache controller 230 may change the dirty information of the cache line storing the data subject to the push request to a dirty state. Therefore, the cache controller 230 may recognize that the data stored in the cache line storing the data subject to the push request is different from the data stored in the main memory 100.

[0054] In addition, when a push request is received for a cache line in which useless information is in a useless state, the cache controller 230 may change the useless information in the cache line storing the data subject to the push request to a useful state. In other words, when a write-back operation needs to be performed on the data written into the cache line by the push request, the cache controller 230 may change the useless information of the cache line storing the data subject to the push request to a useful state.

[0055] The cache controller 230 may receive a read request for data stored in the stack area 211 from the processor 300 or other external devices. When receiving a read request for data stored in the stack area 211, the cache controller 230 may set the read data based on the useless information of the cache line in which the data subject to the read request is stored.

[0056] In an embodiment, when the useless information of the cache line storing the data subjected to the read request is in a useless state, the cache controller 230 may set the virtual data to the read data. For example, when the data is in a useless state, the cache controller 230 may output virtual data different from the data subjected to the read request. When the useless information of the cache line storing the data subjected to the read request is in a useless state, it may indicate that the data subjected to the read request has been ejected by the eject request of the processor 300. In other words, when the useless information of the cache line storing the data subjected to the read request is in a useless state, it may indicate that the read request is for data no longer used by the processor 300. In this case, the cache controller 230 does not set the read data to the data subjected to the read request, but sets the read data to the virtual data. As described above, by setting the read data to the virtual data, the data discarded in the cache 200 by another external device can be prevented from being hacked or accessed by unauthorized parties. Therefore, the data security performance of the cache 200 can be improved.

[0057] In another embodiment, when the useless information of the cache line storing the data subject to the read request is in a useful state, the cache controller 230 may set the read data to the data stored in the cache line. When the useless information of the cache line storing the data subject to the read request is in a useful state, it may indicate that the data subject to the read request is data that has not been ejected by the eject request of the processor 300. In other words, when the useless information of the cache line storing the data subject to the read request is in a useful state, it may indicate that the read request is for data to be used by the processor 300. Therefore, the cache controller 230 may set the read data to the data subject to the read request.

[0058] The cache controller 230 may perform an eviction operation or a refresh operation on the cache line.

[0059] In an embodiment, when an eviction operation or a refresh operation is to be performed on a cache line, and the useless information corresponding to the cache line is in a useless state, and the dirty information of the cache line subjected to the eviction operation or the refresh operation is in a dirty state, the cache controller 230 changes the valid information of the cache line subjected to the eviction operation or the refresh operation to an invalid state. In other words, when an eviction operation or a refresh operation is performed on a cache line in which the useless information is in a useless state, the cache controller 230 changes the valid information of the cache line to an invalid state without performing a write-back operation, even when the dirty information in the cache line is in a dirty state. As described above, because unnecessary operations such as write-back are not performed on pop-up data based on useless information, the performance of the cache can be improved.

[0060] On the contrary, when an eviction operation or a refresh operation is to be performed on a cache line, and the useless information corresponding to the cache line is in a useful state, and the dirty information of the cache line subjected to the eviction operation or the refresh operation is in a dirty state, the cache controller 230 changes the valid information of the cache line subjected to the eviction operation or the refresh operation to an invalid state. In other words, when an eviction operation or a refresh operation is performed on a cache line in which the useless information is in a useful state and the dirty information of the cache line is in a dirty state, the cache controller 230 may perform a write-back operation and change the valid information of the cache line to an invalid state. For example, if the cache line stores the second variable data of a variable, and the main memory 100 stores the first variable data of the variable, the write-back operation may rewrite the variable of the main memory 100 with the second variable data.

[0061] The cache 200 according to the inventive concept as described above can process a request for data stored in the stack area 211 based on useless information, thereby not performing unnecessary operations on the pop-up data, thereby providing improved performance. In addition, when a read request for the pop-up data is received, dummy data can be output, thereby providing an enhanced security function.

[0062] Figure 4 is a diagram illustrating state changes of multiple cache lines of a data memory when the cache receives a push request according to an embodiment.

[0063] refer to Figure 4 , when a push request is received from the processor 300, a state change of a plurality of cache lines included in the stack area 211 may be identified. Figure 4 , showing the state of a plurality of cache lines included in the stack area 211 before receiving a push request, and at Figure 4 The lower end of FIG. 1 shows the state of multiple cache lines included in the stack area after receiving the push request.

[0064] The first cache line CL1 to the third cache line CL3 among the plurality of cache lines included in the stack area 211 before receiving the push request are invalid lines, in which valid information is in an invalid state. In this case, the useless information and dirty information of the invalid lines may have any value. The fourth cache line CL4 to the nth cache line CLn may be dirty lines, in which valid information is in a valid state and dirty information is in a dirty state. In this case, the useless information of the dirty lines may be in a useful state.

[0065] In the above state, a push request for data to be stored in the third cache line CL3 and the fourth cache line CL4 is received from the processor 300 .

[0066] The data subject to the push request may be stored in the third cache line CL3 and the fourth cache line CL4 .

[0067] The fourth cache line CL4 is a dirty line because there is pre-stored data, and therefore, information stored in a tag entry corresponding to the fourth cache line CL4 does not change.

[0068] Since the third cache line CL3 is an invalid line in which no stored data exists, the valid information stored in the tag entry corresponding to the third cache line CL3 is changed from an invalid state to a valid state. In addition, the dirty information stored in the tag entry corresponding to the third cache line CL3 may be set to a dirty state, and the useless information of the third cache line CL3 is set to a useful state. Therefore, the third cache line CL3 may be a dirty line.

[0069] Figure 5 is a diagram illustrating state changes of a plurality of cache lines of a data memory when the cache receives an eject request according to an embodiment.

[0070] refer to Figure 5 , when the states of the plurality of cache lines included in the stack area 211 are Figure 4In the state shown at the bottom, when an eject request is received from the processor 300, a state change of a plurality of cache lines included in the stack area 211 can be recognized. Figure 5 The upper end of FIG. 1 shows the state of multiple cache lines included in the stack area 211 before receiving the eject request (with Figure 4 The same state as shown at the lower end of the state) and Figure 5 The lower end of FIG. 1 shows the state of multiple cache lines included in the stack area after receiving a pop request.

[0071] In such Figure 5 In the upper end state, the slave processor 300 receives a pop request for data stored in the third cache line CL3.

[0072] The data subject to the eject request may be output to the processor 300 .

[0073] Since the data stored in the third cache line CL3 is ejected, the useless information of the third cache line CL3 is changed from a useful state to a useless state. For example, the useless information in the entry of the tag entry 221 of the third cache line CL3 may be set to a useless state. Therefore, the third cache line CL3 may be a useless dirty line, in which the useless information is in a useless state and the dirty information is in a dirty state.

[0074] In the third cache line CL3 as described above, although the data subjected to the ejection request is stored, the useless information is in a useless state, and therefore, the third cache line CL3 is not written back. In addition, even when a read request for the third cache line CL3 is received, the data stored in the third cache line CL3 is not transmitted. Therefore, the performance and security of the cache 200 can be improved.

[0075] Figure 6 is a flowchart of an operation method when the cache 200 receives an eject request according to an embodiment.

[0076] refer to Figure 6 , in operation S610 , the cache 200 receives an eject request from the processor 300 .

[0077] In operation S620 , the cache 200 outputs data corresponding to the eject request. In other words, in response to receiving the eject request from the processor 300 , the cache 200 may output data stored in the cache line of the stack area 211 to the processor 300 .

[0078] In operation S630, the cache 200 changes the useless information of the cache line storing the data subject to the eject request to a useless state. The cache 200 may change the useless information included in the tag entry of the tag memory 220 corresponding to the cache line storing the data subject to the eject request to a useless state.

[0079] When the cache 200 changes the useless information of the cache line storing the data subject to the eject request to the useless state, unnecessary operations such as write-back may not be performed on the ejected data based on the useless information.

[0080] Figure 7 is a flowchart of an operation method when the cache 200 receives a push request for a cache line in an unused state according to an embodiment.

[0081] refer to Figure 7 , in operation S710 , the cache 200 receives a push request for a cache line whose useless information is in a useless state from the processor 300 .

[0082] In operation S720 , the cache 200 stores the data corresponding to the push request. In other words, in response to receiving the push request from the processor 300 , the cache 200 may store the push-requested data in the stack area 211 .

[0083] In operation S730, the cache 200 may change the useless information of the cache line storing the data subject to the push request to a useful state. The cache 200 may change the useless information included in the tag entry of the tag memory 220 corresponding to the cache line storing the data subject to the push request to a useful state. Therefore, after the push request occurs, a write-back operation may be performed on the data written in the cache line.

[0084] Figure 8 is a flowchart of an operation method when a read request for the stack area 211 of the cache 200 is received according to an embodiment.

[0085] refer to Figure 8 , in operation S810 , the cache 200 receives a read request for data stored in the stack area 211 .

[0086] In operation S820 , the cache 200 determines whether useless information of a cache line storing data subject to a read request is in a useless state.

[0087] When the useless information of the cache line storing the data subjected to the read request is in a useless state, in operation S830, the cache 200 sets the dummy data as the read data. For example, when the useless information is in a useless state, the cache 200 may output the dummy data as the read data different from the data subjected to the read request. When the dummy data is set as the read data, other devices may be prevented from using the discarded data in the cache 200 to perform a hacker attack.

[0088] On the contrary, when the useless information of the cache line storing the data subjected to the read request is in a useful state, in operation S840, the cache 200 sets the data stored in the cache line as the read data. For example, when the useless information is in a useful state, the cache 200 can output the data subjected to the read request as the read data.

[0089] Fig. 9 is a flowchart of an operation method when the cache 200 performs an eviction operation or a refresh operation according to an embodiment.

[0090] refer to Fig. 9 , in operation S910 , the cache 200 performs an eviction operation or a refresh operation on a cache line whose dirty information is in a dirty state.

[0091] In operation S920 , the cache 200 determines whether useless information of the cache line is in a useless state.

[0092] When the useless information of the cache line is in the useless state, in operation S930, the cache 200 changes the valid information of the cache line to the invalid state. In other words, even when the dirty information of the cache line is in the dirty state, the cache 200 changes the valid information of the cache line to the invalid state without performing a write-back operation, thereby improving the performance of the cache 200.

[0093] In contrast, in operation S940, when the useless information of the cache line is in the useful state rather than the useless state, the cache 200 stores the data stored in the cache line in the main memory 100. Then, in operation S950, the cache 200 changes the valid information of the cache line to the invalid state.

[0094] Fig.10 is a block diagram of a system 20 according to an embodiment.

[0095] refer to Fig.10 , system 20 can be implemented in a handheld device, such as a mobile phone, a smart phone, a tablet computer, a personal digital assistant (PDA), an enterprise digital assistant (EDA), a digital still camera, a digital video camera, a portable multimedia player (PMP), a personal navigation device (PDA) or a portable navigation device, a handheld game console, or an electronic book.

[0096] The system 20 may include a SoC 1100 and a memory device 1200. The SoC 1100 may include a CPU 1110, a graphics processing unit (GPU) 1120, a neural processing unit (NPU) 1130, an image signal processor (ISP) 1140, a memory interface (MIF) 1150, a clock management unit (CMU) 1160, and a power management unit (PMU) 1170. The CPU 1110, the GPU 1120, the NPU 1130, the ISP 1140, and the MIF 1150 may be reference 1170. Figures 1 to 9 Embodiments of electronic devices are described.

[0097] The CPU 1110 may process or execute commands and / or data stored in the memory device 1200 in response to a clock signal generated by the CMU 1160 .

[0098] The GPU 1120 may obtain image data in the memory device 1200 in response to a clock signal generated by the CMU 1160. The GPU 1120 may generate data for an image output through a display device (not shown) from the image data received from the MIF 1150, or may encode and decode the image data.

[0099] NPU 1130 may refer to any device that executes a machine learning model. NPU 1130 may be a hardware block designed to execute a machine learning model. The machine learning model may be a model based on an artificial neural network, a decision tree, a support vector machine, a regression analysis, a Bayesian network, a genetic algorithm, etc. As a non-limiting example, an artificial neural network may include a convolutional neural network (CNN), a region using a convolutional neural network (R-CNN), a recurrent neural network (RNN), a stacked deep neural network (S-DNN), a state space dynamic neural network (S-SDNN), a deconvolution network, a deep belief network (DBN), a restricted Boltzmann machine (RBM), a fully convolutional network, a long short-term memory (LSTM) network, and a classification network.

[0100] The ISP 1140 may perform a signal processing operation on raw data received from an image sensor (not shown) located outside the SoC 1100 and generate digital data with improved image quality.

[0101] The MIF 1150 may provide an interface for a memory device 1200 located outside the SoC 1100. The memory device 1200 may be a dynamic random access memory (DRAM), a PRAM, a resistive random access memory, or a flash memory.

[0102] The CMU 1160 may generate a clock signal and provide the clock signal to the elements of the SoC 1100. The CMU 1160 may include a clock generation device such as a phase-locked loop (PLL), a delay-locked loop (DLL), and a crystal. The PMU 1170 may convert external power into internal power and provide the internal power to the elements of the SoC 1100.

[0103] While the inventive concepts have been particularly shown and described with reference to embodiments thereof, it will be understood that various changes in form and details may be made therein without departing from the spirit and scope of the appended claims.

Claims

1. A cache, include: a data memory including a stack area storing data used by an external processor in a stack structure in a plurality of cache lines; a tag memory for storing tag entries including useless information indicating whether data stored in a corresponding cache line has been ejected; as well as The cache controller is configured to, when receiving a pop request for data stored in the stack area, change useless information of a cache line storing the data subject to the pop request to a useless state.

2. The cache according to claim 1, in, The cache controller is further configured to, when receiving a push request for a cache line in which the garbage information is in a useless state, change the garbage information of the cache line storing the data subject to the push request to a useful state.

3. The cache according to claim 1, in, The cache controller is further configured to, when receiving a read request for data stored in the stack area, set the read data based on the garbage information of the cache line storing the data subject to the read request.

4. The cache according to claim 3, in, The cache controller is also configured to: When useless information of a cache line storing data subject to a read request is in a useless state, setting the read data to dummy data different from the data subject to the read request; as well as When useless information of a cache line storing data subject to a read request is in a useful state, the read data is set to the data stored in the cache line.

5. The cache according to claim 1, in, The tag entries also include: validity information indicating whether data stored in the corresponding cache line is valid; and Dirty information indicating whether data stored in the corresponding cache line is different from data stored in the external main memory.

6. The cache according to claim 5, in, The cache controller is further configured to, when an eviction operation or a refresh operation is performed on a cache line in which dirty information is in a dirty state and unused information of the cache line subjected to the eviction operation or the refresh operation is in an unused state, change valid information of the cache line subjected to the eviction operation or the refresh operation to an invalid state.

7. The cache according to claim 5, in, The cache controller is further configured to, when an eviction operation or a refresh operation is performed on a cache line in which dirty information is in a dirty state and an unusable state of the cache line subjected to the eviction operation or the refresh operation is in a useful state, store data stored in the cache line subjected to the eviction operation or the refresh operation in a main memory and change the valid information to an invalid state.

8. The cache according to claim 5, in, The cache controller is further configured to, when receiving a push request for the stack area, change valid information of a cache line storing data subject to the push request to a valid state, and change dirty information of a cache line storing data subject to the push request to a dirty state.

9. A method for operating a cache, the cache comprising a data memory, a tag memory and a cache controller, the data memory comprising a stack area storing data in a stack structure, the method for operating include: receiving, by the cache controller, an eject request from the processor; as well as The cache controller changes the useless information of the cache line of the stack area in the tag memory storing the data subjected to the eject request to a useless state, The useless information indicates whether the data stored in the corresponding cache line has been ejected.

10. The operating method according to claim 9, further comprising: include: receiving, by the cache controller, a push request for a cache line having useless information in a useless state; as well as The useless information of the cache line storing the data subjected to the push request is changed to a useful state by the cache controller.

11. The operating method according to claim 9, further comprising: include: receiving, by the cache controller, a read request for data stored in the stack area; as well as The read data is set by the cache controller based on the garbage information of the cache line storing the data subject to the read request.

12. The operating method according to claim 11, in, The settings for reading data include: When useless information of a cache line storing data subject to a read request is in a useless state, setting the read data to dummy data different from the data subject to the read request by the cache controller; and When useless information of a cache line storing data subject to a read request is in a useful state, the read data is set by the cache controller to the data stored in the cache line.

13. The operating method according to claim 9, in, The tag entries of the tag memory include: validity information indicating whether data stored in a cache line corresponding to the tag address is valid; and Dirty information indicating whether data stored in the cache line corresponding to the tag address is different from data stored in the main memory.

14. An electronic device, include: Main memory; cache; as well as processor, Wherein, the cache includes: a data memory including a stack area for storing data used by the processor in a stack structure in a plurality of cache lines; a tag memory for storing a tag entry including information about data stored in the stack area; and a cache controller configured to process a request for data stored in the stack region based on the tag entry, The tag entry includes useless information indicating whether the data stored in the corresponding cache line has been ejected, and The cache controller is further configured to, when receiving a pop request for data stored in the stack area, change useless information of a cache line storing the data subject to the pop request to a useless state.

15. The electronic device according to claim 14, in, The cache controller is further configured to, when receiving a push request for a cache line whose garbage information is in a useless state, change the garbage information of the cache line storing the data subjected to the push request to a useful state.

16. The electronic device according to claim 14, in, The cache controller is further configured to, when receiving a read request for data stored in the stack area, set the read data based on the garbage information of the cache line storing the data subject to the read request.

17. The electronic device according to claim 16, in, The cache controller is also configured to: When useless information of a cache line storing data subject to a read request is in a useless state, setting the read data to dummy data different from the data subject to the read request; as well as When useless information of a cache line storing data subject to a read request is in a useful state, the read data is set to the data stored in the cache line.

18. The electronic device according to claim 14, in, The tag entries also include: validity information indicating whether data stored in the corresponding cache line is valid; and Dirty information indicating whether data stored in the corresponding cache line is different from data stored in the main memory.

19. The electronic device according to claim 18, in, The cache controller is further configured to, when an eviction operation or a refresh operation is performed on a cache line in which dirty information is in a dirty state and unused information of the cache line subjected to the eviction operation or the refresh operation is in an unused state, change valid information of the cache line subjected to the eviction operation or the refresh operation to an invalid state.

20. The electronic device according to claim 18, in, The cache controller is further configured to, when an eviction operation or a refresh operation is performed on a cache line in which dirty information is in a dirty state and useless information of the cache line subjected to the eviction operation or the refresh operation is in a useful state, store data stored in the cache line subjected to the eviction operation or the refresh operation in a main memory and change valid information to an invalid state.

Citation Information

Cited By

  • Asynchronous direct writing method based on cache and artificial intelligence chip

    CN120848819A

  • A cache-based asynchronous direct write method and an artificial intelligence chip

    CN120848819B