Source: http://www.google.com/patents/US20030061452?dq=6016038
Timestamp: 2016-06-30 06:22:05
Document Index: 438919370

Matched Legal Cases: ['art. 9', 'art 12', 'art 13', 'art 21', 'art 22', 'art 22', 'art 13', 'art 22', 'art 14', 'art 22', 'art 12', 'art 13', 'art 21', 'art 22', 'art 22', 'art 13', 'art 22', 'art 14', 'art 22']

Patent US20030061452 - Processor and method of arithmetic processing thereof - Google PatentsSearch Images Maps Play YouTube News Gmail Drive More »Sign inPatentsA processor system, comprising: a processor having a function to write back data stored in a cache memory to an external memory in units of a cache line formed of a plurality of words; a small unit dirty information storing part which stores non-write-back information in units of address range smaller...http://www.google.com/patents/US20030061452?utm_source=gb-gplus-sharePatent US20030061452 - Processor and method of arithmetic processing thereofAdvanced Patent SearchPublication numberUS20030061452 A1Publication typeApplicationApplication numberUS 10/256,079Publication dateMar 27, 2003Filing dateSep 27, 2002Priority dateSep 27, 2001Also published asEP1298532A2, EP1298532A3, US6931495Publication number10256079, 256079, US 2003/0061452 A1, US 2003/061452 A1, US 20030061452 A1, US 20030061452A1, US 2003061452 A1, US 2003061452A1, US-A1-20030061452, US-A1-2003061452, US2003/0061452A1, US2003/061452A1, US20030061452 A1, US20030061452A1, US2003061452 A1, US2003061452A1InventorsYasumasa NakadaOriginal AssigneeKabushiki Kaisha ToshibaExport CitationBiBTeX, EndNote, RefManPatent Citations (16), Referenced by (14), Classifications (10), Legal Events (5) External Links: USPTO, USPTO Assignment, EspacenetProcessor and method of arithmetic processing thereof
US 20030061452 A1Abstract
A processor system, comprising: a processor having a function to write back data stored in a cache memory to an external memory in units of a cache line formed of a plurality of words; a small unit dirty information storing part which stores non-write-back information in units of address range smaller than that of the cache line, the information indicating that the write-back to the external memory is not yet performed; a mode information storing part which stores specific mode flag information which is set or reset by software in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and; and a write-back determining part which decides whether or not to write back a certain cache line before performing the DMA transfer based on the non-write-back information, when the specific mode flag is set and the write-back of the cache line is instructed. Images(6) Claims(16)
What is claimed is: 1. A processor system, comprising: a processor having a function to write back data stored in a cache memory to an external memory in units of a cache line formed of a plurality of words; a small unit dirty information storing part which stores non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; a mode information storing part which stores specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and a write-back determining part which decides whether or not to write back a certain cache line before performing the DMA transfer based on said non-write-back information, when said specific mode flag is set and the write-back of the cache line is instructed. 2. The processor system according to claim 1, wherein said write-back determining part performs the DMA transfer without writing back the cache line, when the DMA transfer from the I/O circuit to the external memory is instructed, the dirty bit of the cache line in which DMA objective is included is set, and all of said non-write-back information stored in said small unit dirty information storing part except for the DMA objective data in the cache line is not set. 3. The processor system according to claim 1, wherein said write-back determining part performs the DMA transfer after performing the write-back of the cache line, when the DMA transfer from said I/O circuit to said external memory is instructed, the dirty bit of the cache line in which DMA objective is included is set and at least one of said non-write-back information stored in said small unit dirty information storing part except for the DMA objective data in the cache line is set. 4. The processor system according to claim 1, wherein said write-back determining part performs the DMA transfer after writing back said cache line when said specific mode flag is not set. 5. The processor system according to claim 1, wherein said small unit dirty information storing part stores said non-write-back information in units of word or byte included in the cache line. 6. The processor system according to claim 1, further comprising a large unit dirty information storing part which stores for each cache line, information indicating whether or not data in said cache memory has to be written back to said external memory. 7. The processor system according to claim 1, wherein said small unit dirty information storing part is provided to inside of said cache memory, and said mode information storing part is provided to inside of said processor. 8. The processor system according to claim 1, further comprising a snoop control part which searches whether or not said cache memory holds newest data to be stored in said external memory, wherein said write-back-determining part determines whether or not to write back the cache line based on said non-write-back information when said specific mode flag is set and the write-back of a certain cache line is instructed by said snoop control part. 9. A method of arithmetic processing of a processor having a function to write back data stored in a cache memory to an external memory, in units of a cache line consisted of a plurality of words, comprising: storing non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; storing specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; which is set when data of addresses in the case that data is transferred by DMA (Direct Memory Access) transfer from an I/O circuit to said external memory is stored in said cache memory; and determining whether or not to write back the cache line before the DMA transfer based on said non-write-back information when said specific mode flag is set and the write-back of a certain cache line is instructed. 10. The method of arithmetic processing of the processor according to claim 9, wherein said write-back determining part performs the DMA transfer without writing back the cache line, when the DMA transfer from the I/O circuit to the external memory is instructed, it is determined whether or not to write back the cache line before DMA transfer, and the dirty bit of the cache line in which DMA objective is included is set, and all of said non-write-back information stored in said small unit dirty information storing part except for the DMA objective data in the cache line is not set. 11. The method of arithmetic processing of the processor according to claim 9, wherein said write-back determining part performs the DMA transfer after performing the write-back of the cache line, when the DMA transfer from said I/O circuit to said external memory is instructed, it is determined whether or not to write back the cache line before DMA transfer, and the dirty bit of the cache line in which DMA objective is included is set and at least one of said non-write-back information stored in said small unit dirty information storing part except for the DMA objective data in the cache line is set. 12. The method of arithmetic processing of the processor according to claim 9, wherein said write-back determining part performs the DMA transfer after writing back said cache line when said specific mode flag is not set. 13. The method of arithmetic processing of the processor according to claim 9, wherein said small unit dirty information storing part stores said non-write-back information in units of word or byte included in the cache line. 14. The method of arithmetic processing of the processor according to claim 9, further comprising a large unit dirty information storing part which stores for each cache line, information indicating whether or not data in said cache memory has to be written back to said external memory. 15. The method of arithmetic processing of the processor according to claim 9, wherein said small unit dirty information storing part is provided to inside of said cache memory, and said mode information storing part is provided to inside of said processor. 16. The method of arithmetic processing of the processor according to claim 9, further comprising a snoop control part which searches whether or not said cache memory holds newest data to be stored in said external memory, wherein said write-back-determining part determines whether or not to write back the cache line based on said non-write-back information when said specific mode flag is set and the write-back of a certain cache line is instructed by said snoop control part. Description
CROSS REFERENCE TO RELATED APPLICATIONS [0001] This application is based upon and claims the benefit of priority from the prior Japanese Patent Applications No. 2001-296289, filed on Sep. 27, 2001, the entire contents of which are incorporated herein by reference. BACKGROUND OF THE INVENTION [0002] 1. Field of the Invention [0003] The present invention relates to a processor system which includes a processor having a function for writing back data stored in a cache memory to an external memory. Especially, the present invention relates to a processor system capable of performing DMA transfer from an I/O circuit to the external memory. [0004] 2. Related Background Art [0005] Operational frequency of a processor tends to increase year by year. However, an external memory used for a main memory is not faster than the processor. Because of this, a cache memory is generally used to infill a difference of speed between the processor and the cache memory. [0006] The cache memory sends and receives data in regard to the external memory for each cache line formed of a plurality of words. In the case of a system having the cache memory called as a write-back cache, data written into the cache memory by the processor has to be written back to the external memory. Because of this, a dirty bit indicating whether or not the data has been written back to the external memory is provided for each cache line. When the dirty bit is set, it is indicated that the write-back to the external memory is not yet finished. [0007] Various I/O circuits are connected to the processor. When data is transferred by DMA between each I/O circuit and the external memory without passing through the processor, the processing burden of the processor is reduced, and it is possible to transfer data from the I/O circuit to the external memory at high latency. [0008] However, the DMA transfer in which data is transferred from the external memory to the I/O circuits and the copy of this data in the cache memory is dirty may be instructed. In such a case, before performing the DMA transfer, the write-back operation has to be performed in regard to the external memory. Furthermore, when the DMA transfer is performed in regard to address range including the address of the cache line to which the write-back operation is not yet performed, it is necessary to invalidate the cache line. Otherwise, if the dirty bit of the cache line is set, it is necessary to perform the write-back operation and then to invalidate the cache line. [0009] For example, FIG. 8 shows an example in which “0x2000” is stored in the tag for storing the address information of the cache memory and a certain cache line is formed of four words. In this case, four words data from 0x2000 to 0x200f is stored in the cache line. [0010] In the case of FIG. 8, even if only a portion of the cache line is updated, the dirty bit of the cache line is set. That is, it is impossible to know the updated location of the cache line. [0011] When the dirty bit is set, and for example, one word data from address 0x2004 is transferred by DMA from the I/O circuit to the external memory, the write-back operation of the cache line is first performed before the DMA transfer. [0012] However, when only one byte of address 0x2005 is updated in the cache line, this one byte is rewritten by the DMA transfer. Because of this, the write-back operation becomes meaningless. [0013] Thus, although the conventional processor system has dirty bits in units of the cache line, it has no information indicating the updated location in the cache line. Because of this, despite being practically unnecessary, the write-back operation may be performed, thereby causing the unnecessary bus transaction. [0014] Furthermore, in order to avoid occurrence of such an unnecessary bus transaction, a method of changing data declaration so that data is arranged one by one when defining data as a target of DMA may be adopted. The method is that, for example, dummy declaration is inserted between data declarations. Such a method causes development efficiency of software to lower. [0015] On the other hand, in the case of the processor having a snoop function for detecting whether or not to hold newest data in the cache memory to be stored in the external memory, the operation for maintaining data consistency by software is unnecessary. In the case of performing the DMA transfer from the I/O circuit to the external memory, the following operation is performed by hardware. [0016] When the cache-hit of the subject for the DMA transfer occurs, the cache line is invalidated. When the dirty bit is set to the cache line, the cache line is written back before performing the DMA transfer, and then the DMA transfer is performed. [0017] Even in this case, for example, when address 0x2000 is stored in the tag and the dirty bit is set, even if data to be updated exists in only the address 0x2005, the entire cache line is written back. [0018] Thus, because the conventional processor having the snoop function did not have the information indicating the updated location in the cache line, the write-back operation is necessary, thereby occurring the unnecessary bus transaction. [0019] Furthermore, when the method for changing the data declaration by software is adopted, there was a problem in which the development efficiency of software deteriorates. SUMMARY OF THE INVENTION [0020] A processor system according to one embodiment of the present invention, comprising: [0021] a processor having a function to write back data stored in a cache memory to an external memory in units of a cache line formed of a plurality of words; [0022] a small unit dirty information storing part which stores non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; [0023] a mode information storing part which stores specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and [0024] a write-back determining part which decides whether or not to write back a certain cache line before performing the DMA transfer based on said non-write-back information, when said specific mode flag is set or reset by software in order to determine whether or not to be in a mode for not performing unnecessary write-back operation. [0025] A method of arithmetic processing of a processor according to one embodiment of the present invention, said method having a function to write back data stored in a cache memory to an external memory, in units of a cache line consisted of a plurality of words, comprising: [0026] storing non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; [0027] storing specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and [0028] determining whether or not to write back the cache line before the DMA transfer based on said non-write-back information when said specific mode flag is set and the write-back of a certain cache line is instructed.
BRIEF DESCRIPTION OF THE DRAWINGS [0029] [0029]FIG. 1 is a diagram showing schematic configuration a processor system according to a first embodiment of the present invention. [0030] [0030]FIG. 2 is a block diagram showing schematic configuration of a cache memory of the first embodiment. [0031] [0031]FIG. 3 is a flowchart showing processing operation of a write-back determining part. [0032] [0032]FIG. 4 is a block diagram showing schematic configuration of a processor system according to a second embodiment of the present invention. [0033] [0033]FIG. 5 is a block diagram showing a detailed configuration of a cache memory of the second embodiment. [0034] [0034]FIG. 6 is a block diagram showing schematic configuration of a processor system according to a third embodiment of the present invention. [0035] [0035]FIG. 7 is a block diagram showing a modified example of the third embodiment. [0036] [0036]FIG. 8 is a diagram describing the write-back operation of the cache memory.
DESCRIPTION OF THE PREFERRED EMBODIMENTS [0037] Hereinafter, a processor system according to the present invention will be more specifically described with reference to drawings. [0038] (First Embodiment) [0039] [0039]FIG. 1 is a block diagram showing schematic configuration of a processor system according to a first embodiment of the present invention. The processor system of FIG. 1 has a CPU1 for performing various arithmetic processings based on the designated program, an external memory 2, a cache memory 3 for temporarily storing data to be stored in the external memory 2, and an arbiter 4 for arbitrating a bus. The cache memory 3, the external memory 2 and the arbiter 4 are connected to the bus 5. Various I/O circuits 6 are connected to the bus 5. [0040] The cache memory 3 updates data in units of a cache line 10 formed of a plurality of word data. The cache memory 3 has a tag 11 for storing address information corresponding to data of each cache line 10, a dirty bit storing part 12 for storing information (dirty bit) indicating whether or not it is necessary to write back data of the cache line 10 to the external memory 2, and a word dirty bit storing part 13 for storing information indicating that the write-back to the external memory 2 is not yet finished for each of words 1-4 in the cache line 10. [0041] The word dirty bits are set when the corresponding word data is in the dirty state (the state in which the word data is updated, and the write-back to the external memory 2 is not yet performed). At this time, the dirty bit of the cache line 10 in which the word data belongs is also set. [0042] The CPU 1 has a mode information storing part 21 for storing a specific mode flag indicating a mode (a mode of the present invention) for determining whether or not to write back the corresponding address of the cache memory 3 when the DMA (Direct Memory Access) transfer is performed from the I/O circuit 6 to the external memory 2, and a write-back determining part 22 for deciding whether or not to practically perform the write-back to the cache line 10. [0043] The write-back determining part 22 determines whether or not to practically perform the write-back to the cache line 10 based on the information stored in the word dirty bit storing part 13 when the specific mode flag is set and the write-back of a certain cache lime 10 is instructed. [0044] [0044]FIG. 3 is a flowchart showing processing operation of the write-back determining part 22. First, it is determined whether or not the dirty bit of the cache line corresponding to the address for performing the DMA transfer is set (step S1). If determined that the dirty bit is not set, the processings of FIG. 3 is finished. [0045] If determined that the above-mentioned dirty bit is set, it is next determined whether or not the specific mode flag is set (step S2). The flag is set by software, and indicates whether or not to enter a mode for reducing bus transaction proposed by the present invention. If determined that the flag is not set, the after-mentioned processing of step S5 is performed. [0046] When the specific mode flag is set, it is determined whether or not the word dirty bit of the word data of the address besides the address for performing the DMA transfer is set (step S3). [0047] When the determination of step S3 is denied, that is, when all the word data that the word dirty bits are set is included in DMA object, the DMA transfer from the I/O circuit 6 is performed without performing the write-back (step S4). [0048] On the other hand, when the determination of step S3 is affirmative, that is, when the word dirty bit is set in regard to the word data besides the word data as the subject of the DMA transfer, the write-back of the cache line 10 corresponding to the corresponding address is performed, and then the DMA transfer from the I/O circuit 6 to the external memory 2 is performed (step S5). [0049] Thus, according to the first embodiment, the word dirty bit indicating whether or not each word data in the cache line 10 is in the dirty state is provided for each word data. When the DMA transfer is instructed in regard to the addresses corresponding to all the word data that the word dirty bits are set (when the DMA objective area includes all the word data that the word dirty bits are set), the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10. Because of this, unnecessary bus transaction can be reduced. Furthermore, it is unnecessary to modify software processings such as consideration of cache boundary in the case of performing declaration of variables_in order to reduce unnecessary bus transaction. Accordingly, it is possible to improve the development efficiency of software. [0050] (Second Embodiment) [0051] [0051]FIG. 4 is a block diagram showing schematic configuration of a processor system according to a second embodiment of the present invention. In FIG. 4, the same reference numerals are attached to constituents common to those of FIG. 1. Hereinafter, differences from FIG. 1 will be mainly described. [0052] A cache memory 3 of FIG. 4 has a byte dirty storing part 14 for storing information indicating that the write-back to the external memory 2 is not yet performed for each byte data in the cache line 10. [0053] A write-back determining part 22 in the CPU 1 performs the DMA transfer from the I/O circuit 6 without writing back the cache line 10 when addresses corresponding to all the byte data that the byte dirty bit is set is included in the addresses of DMA transfer objective of data transferred from the I/O circuits to the main memory, and performs the DMA transfer from the I/O circuit 6 after writing back the cache line 10 when at least one bit of the byte dirty bits of the byte data corresponding to the addresses in the cache line that the DMA transfer is not indicated is also set. [0054] Thus, according to the second, embodiment, the byte dirty bit indicating whether or not each byte data in the cache line 10 is in the dirty state is provided for each byte data, and the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10 when in the case of the DMA transfer from the I/O circuits to the external memory, the dirty bit of the cache line of the DMA objective is set, and the byte dirty bit of data besides the DMA objective in the cache line is not set. Because of this, unnecessary bus transaction can be reduced. Furthermore, it is unnecessary to modify software processing in order to reduce unnecessary bus transaction, thereby improving development efficiency of software. [0055] Especially, according to the second embodiment, because the byte dirty bits indicating whether or not each byte data in the cache line 10 is in the dirty state are provided for each byte data, it is possible to perform the determination of whether or not the write-back is necessary more strictly than in the first embodiment. [0056] (Third Embodiment) [0057] [0057]FIG. 6 is a block diagram showing schematic configuration of a processor system according to a third embodiment of the present invention. In FIG. 6, the same reference numerals are attached to constituents common to those of FIG. 1. Hereinafter, differences from FIG. 1 will be mainly described. [0058] A processor system of FIG. 6 has a snoop controller 23 realizing snoop function, besides configuration of FIG. 1. Here, the snoop determines whether or not the cache memory holds data corresponding to the address by confirming the address of the DMA transfer appearing on the bus when the I/O circuit performs the DMA transfer, and performs necessary processings in regard to the cache memory in accordance with the kinds of the DMA transfer. [0059] In the case of performing the DMA transfer from the I/O circuit 6 to the external memory 2, when the address issued by the snoop controller 23 hits to a certain cache line 10 at the state in which the specific mode flag is set, the dirty bit of the cache line is set and the word dirty bit except for the word data corresponding to the address of DMA objective in the cache line including the address is not set, or when the dirty bit of the cache line is not set, the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10, and when at least one bit of the word dirty bits corresponding to data except for the DMA objective in the cache line is set, the write-back of the cache line 10 is performed, and then the DMA transfer from the I/O circuit 6 is performed. [0060] Thus, according to the third embodiment, in the processor system having snoop function, as a result of performing snoop processing, even if determined that the newest data is not stored in the external memory 2, when the word data to be written back is overwritten by the DMA transfer, the DMA transfer from the I/O circuit 6 is performed without the write-back. Because of this, similarly to the first and second embodiments, it is possible to reduce unnecessary bus transaction. [0061] Although FIG. 6 shows the example in which the word dirty bits are provided for the respective word data in the cache line 10, the byte dirty bits may be provided for the respective byte data in the cache line 10. The block diagram in this case is shown in FIG. 7. In this case, both of advantageous effects of the processor systems of FIG. 3 and FIG. 5 are obtained. CROSS REFERENCE TO RELATED APPLICATIONS [0001] This application is based upon and claims the benefit of priority from the prior Japanese Patent Applications No. 2001-296289, filed on Sep. 27, 2001, the entire contents of which are incorporated herein by reference. BACKGROUND OF THE INVENTION [0002] 1. Field of the Invention [0003] The present invention relates to a processor system which includes a processor having a function for writing back data stored in a cache memory to an external memory. Especially, the present invention relates to a processor system capable of performing DMA transfer from an I/O circuit to the external memory. [0004] 2. Related Background Art [0005] Operational frequency of a processor tends to increase year by year. However, an external memory used for a main memory is not faster than the processor. Because of this, a cache memory is generally used to infill a difference of speed between the processor and the cache memory. [0006] The cache memory sends and receives data in regard to the external memory for each cache line formed of a plurality of words. In the case of a system having the cache memory called as a write-back cache, data written into the cache memory by the processor has to be written back to the external memory. Because of this, a dirty bit indicating whether or not the data has been written back to the external memory is provided for each cache line. When the dirty bit is set, it is indicated that the write-back to the external memory is not yet finished. [0007] Various I/O circuits are connected to the processor. When data is transferred by DMA between each I/O circuit and the external memory without passing through the processor, the processing burden of the processor is reduced, and it is possible to transfer data from the I/O circuit to the external memory at high latency. [0008] However, the DMA transfer in which data is transferred from the external memory to the I/O circuits and the copy of this data in the cache memory is dirty may be instructed. In such a case, before performing the DMA transfer, the write-back operation has to be performed in regard to the external memory. Furthermore, when the DMA transfer is performed in regard to address range including the address of the cache line to which the write-back operation is not yet performed, it is necessary to invalidate the cache line. Otherwise, if the dirty bit of the cache line is set, it is necessary to perform the write-back operation and then to invalidate the cache line. [0009] For example, FIG. 8 shows an example in which “0x2000” is stored in the tag for storing the address information of the cache memory and a certain cache line is formed of four words. In this case, four words data from 0x2000 to 0x200f is stored in the cache line. [0010] In the case of FIG. 8, even if only a portion of the cache line is updated, the dirty bit of the cache line is set. That is, it is impossible to know the updated location of the cache line. [0011] When the dirty bit is set, and for example, one word data from address 0x2004 is transferred by DMA from the I/O circuit to the external memory, the write-back operation of the cache line is first performed before the DMA transfer. [0012] However, when only one byte of address 0x2005 is updated in the cache line, this one byte is rewritten by the DMA transfer. Because of this, the write-back operation becomes meaningless. [0013] Thus, although the conventional processor system has dirty bits in units of the cache line, it has no information indicating the updated location in the cache line. Because of this, despite being practically unnecessary, the write-back operation may be performed, thereby causing the unnecessary bus transaction. [0014] Furthermore, in order to avoid occurrence of such an unnecessary bus transaction, a method of changing data declaration so that data is arranged one by one when defining data as a target of DMA may be adopted. The method is that, for example, dummy declaration is inserted between data declarations. Such a method causes development efficiency of software to lower. [0015] On the other hand, in the case of the processor having a snoop function for detecting whether or not to hold newest data in the cache memory to be stored in the external memory, the operation for maintaining data consistency by software is unnecessary. In the case of performing the DMA transfer from the I/O circuit to the external memory, the following operation is performed by hardware. [0016] When the cache-hit of the subject for the DMA transfer occurs, the cache line is invalidated. When the dirty bit is set to the cache line, the cache line is written back before performing the DMA transfer, and then the DMA transfer is performed. [0017] Even in this case, for example, when address 0x2000 is stored in the tag and the dirty bit is set, even if data to be updated exists in only the address 0x2005, the entire cache line is written back. [0018] Thus, because the conventional processor having the snoop function did not have the information indicating the updated location in the cache line, the write-back operation is necessary, thereby occurring the unnecessary bus transaction. [0019] Furthermore, when the method for changing the data declaration by software is adopted, there was a problem in which the development efficiency of software deteriorates. SUMMARY OF THE INVENTION [0020] A processor system according to one embodiment of the present invention, comprising: [0021] a processor having a function to write back data stored in a cache memory to an external memory in units of a cache line formed of a plurality of words; [0022] a small unit dirty information storing part which stores non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; [0023] a mode information storing part which stores specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and [0024] a write-back determining part which decides whether or not to write back a certain cache line before performing the DMA transfer based on said non-write-back information, when said specific mode flag is set or reset by software in order to determine whether or not to be in a mode for not performing unnecessary write-back operation. [0025] A method of arithmetic processing of a processor according to one embodiment of the present invention, said method having a function to write back data stored in a cache memory to an external memory, in units of a cache line consisted of a plurality of words, comprising: [0026] storing non-write-back information in units of address range smaller than that of said cache line, said information indicating that the write-back to said external memory is not yet performed; [0027] storing specific mode flag information which is set or reset in order to determine whether or not to be in a mode for not performing unnecessary write-back operation; and [0028] determining whether or not to write back the cache line before the DMA transfer based on said non-write-back information when said specific mode flag is set and the write-back of a certain cache line is instructed.
DESCRIPTION OF THE PREFERRED EMBODIMENTS [0037] Hereinafter, a processor system according to the present invention will be more specifically described with reference to drawings. [0038] (First Embodiment) [0039] [0039]FIG. 1 is a block diagram showing schematic configuration of a processor system according to a first embodiment of the present invention. The processor system of FIG. 1 has a CPU1 for performing various arithmetic processings based on the designated program, an external memory 2, a cache memory 3 for temporarily storing data to be stored in the external memory 2, and an arbiter 4 for arbitrating a bus. The cache memory 3, the external memory 2 and the arbiter 4 are connected to the bus 5. Various I/O circuits 6 are connected to the bus 5. [0040] The cache memory 3 updates data in units of a cache line 10 formed of a plurality of word data. The cache memory 3 has a tag 11 for storing address information corresponding to data of each cache line 10, a dirty bit storing part 12 for storing information (dirty bit) indicating whether or not it is necessary to write back data of the cache line 10 to the external memory 2, and a word dirty bit storing part 13 for storing information indicating that the write-back to the external memory 2 is not yet finished for each of words 1-4 in the cache line 10. [0041] The word dirty bits are set when the corresponding word data is in the dirty state (the state in which the word data is updated, and the write-back to the external memory 2 is not yet performed). At this time, the dirty bit of the cache line 10 in which the word data belongs is also set. [0042] The CPU 1 has a mode information storing part 21 for storing a specific mode flag indicating a mode (a mode of the present invention) for determining whether or not to write back the corresponding address of the cache memory 3 when the DMA (Direct Memory Access) transfer is performed from the I/O circuit 6 to the external memory 2, and a write-back determining part 22 for deciding whether or not to practically perform the write-back to the cache line 10. [0043] The write-back determining part 22 determines whether or not to practically perform the write-back to the cache line 10 based on the information stored in the word dirty bit storing part 13 when the specific mode flag is set and the write-back of a certain cache lime 10 is instructed. [0044] [0044]FIG. 3 is a flowchart showing processing operation of the write-back determining part 22. First, it is determined whether or not the dirty bit of the cache line corresponding to the address for performing the DMA transfer is set (step S1). If determined that the dirty bit is not set, the processings of FIG. 3 is finished. [0045] If determined that the above-mentioned dirty bit is set, it is next determined whether or not the specific mode flag is set (step S2). The flag is set by software, and indicates whether or not to enter a mode for reducing bus transaction proposed by the present invention. If determined that the flag is not set, the after-mentioned processing of step S5 is performed. [0046] When the specific mode flag is set, it is determined whether or not the word dirty bit of the word data of the address besides the address for performing the DMA transfer is set (step S3). [0047] When the determination of step S3 is denied, that is, when all the word data that the word dirty bits are set is included in DMA object, the DMA transfer from the I/O circuit 6 is performed without performing the write-back (step S4). [0048] On the other hand, when the determination of step S3 is affirmative, that is, when the word dirty bit is set in regard to the word data besides the word data as the subject of the DMA transfer, the write-back of the cache line 10 corresponding to the corresponding address is performed, and then the DMA transfer from the I/O circuit 6 to the external memory 2 is performed (step S5). [0049] Thus, according to the first embodiment, the word dirty bit indicating whether or not each word data in the cache line 10 is in the dirty state is provided for each word data. When the DMA transfer is instructed in regard to the addresses corresponding to all the word data that the word dirty bits are set (when the DMA objective area includes all the word data that the word dirty bits are set), the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10. Because of this, unnecessary bus transaction can be reduced. Furthermore, it is unnecessary to modify software processings such as consideration of cache boundary in the case of performing declaration of variables_in order to reduce unnecessary bus transaction. Accordingly, it is possible to improve the development efficiency of software. [0050] (Second Embodiment) [0051] [0051]FIG. 4 is a block diagram showing schematic configuration of a processor system according to a second embodiment of the present invention. In FIG. 4, the same reference numerals are attached to constituents common to those of FIG. 1. Hereinafter, differences from FIG. 1 will be mainly described. [0052] A cache memory 3 of FIG. 4 has a byte dirty storing part 14 for storing information indicating that the write-back to the external memory 2 is not yet performed for each byte data in the cache line 10. [0053] A write-back determining part 22 in the CPU 1 performs the DMA transfer from the I/O circuit 6 without writing back the cache line 10 when addresses corresponding to all the byte data that the byte dirty bit is set is included in the addresses of DMA transfer objective of data transferred from the I/O circuits to the main memory, and performs the DMA transfer from the I/O circuit 6 after writing back the cache line 10 when at least one bit of the byte dirty bits of the byte data corresponding to the addresses in the cache line that the DMA transfer is not indicated is also set. [0054] Thus, according to the second, embodiment, the byte dirty bit indicating whether or not each byte data in the cache line 10 is in the dirty state is provided for each byte data, and the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10 when in the case of the DMA transfer from the I/O circuits to the external memory, the dirty bit of the cache line of the DMA objective is set, and the byte dirty bit of data besides the DMA objective in the cache line is not set. Because of this, unnecessary bus transaction can be reduced. Furthermore, it is unnecessary to modify software processing in order to reduce unnecessary bus transaction, thereby improving development efficiency of software. [0055] Especially, according to the second embodiment, because the byte dirty bits indicating whether or not each byte data in the cache line 10 is in the dirty state are provided for each byte data, it is possible to perform the determination of whether or not the write-back is necessary more strictly than in the first embodiment. [0056] (Third Embodiment) [0057] [0057]FIG. 6 is a block diagram showing schematic configuration of a processor system according to a third embodiment of the present invention. In FIG. 6, the same reference numerals are attached to constituents common to those of FIG. 1. Hereinafter, differences from FIG. 1 will be mainly described. [0058] A processor system of FIG. 6 has a snoop controller 23 realizing snoop function, besides configuration of FIG. 1. Here, the snoop determines whether or not the cache memory holds data corresponding to the address by confirming the address of the DMA transfer appearing on the bus when the I/O circuit performs the DMA transfer, and performs necessary processings in regard to the cache memory in accordance with the kinds of the DMA transfer. [0059] In the case of performing the DMA transfer from the I/O circuit 6 to the external memory 2, when the address issued by the snoop controller 23 hits to a certain cache line 10 at the state in which the specific mode flag is set, the dirty bit of the cache line is set and the word dirty bit except for the word data corresponding to the address of DMA objective in the cache line including the address is not set, or when the dirty bit of the cache line is not set, the DMA transfer from the I/O circuit 6 is performed without writing back the cache line 10, and when at least one bit of the word dirty bits corresponding to data except for the DMA objective in the cache line is set, the write-back of the cache line 10 is performed, and then the DMA transfer from the I/O circuit 6 is performed. [0060] Thus, according to the third embodiment, in the processor system having snoop function, as a result of performing snoop processing, even if determined that the newest data is not stored in the external memory 2, when the word data to be written back is overwritten by the DMA transfer, the DMA transfer from the I/O circuit 6 is performed without the write-back. Because of this, similarly to the first and second embodiments, it is possible to reduce unnecessary bus transaction. [0061] Although FIG. 6 shows the example in which the word dirty bits are provided for the respective word data in the cache line 10, the byte dirty bits may be provided for the respective byte data in the cache line 10. The block diagram in this case is shown in FIG. 7. In this case, both of advantageous effects of the processor systems of FIG. 3 and FIG. 5 are obtained. Patent CitationsCited PatentFiling datePublication dateApplicantTitleUS5155824 *May 15, 1989Oct 13, 1992Motorola, Inc.System for transferring selected data words between main memory and cache with multiple data words and multiple dirty bits for each addressUS5485592 *Jul 12, 1993Jan 16, 1996Video Technology Computers, Ltd.Write back cache controller method and apparatus for use in a system having a CPU with internal cache memoryUS5586297 *Mar 24, 1994Dec 17, 1996Hewlett-Packard CompanyPartial cache line write transactions in a computing system with a write back cacheUS5623633 *Jul 27, 1993Apr 22, 1997Dell Usa, L.P.Cache-based computer system employing a snoop control circuit with write-back suppressionUS5694575 *Nov 7, 1995Dec 2, 1997International Business Machines Corp.Direct I/O control system with processor, main memory, and cache employing data consistency retaining schemeUS5784699 *May 24, 1996Jul 21, 1998Oracle CorporationDynamic memory allocation in a computer using a bit map indexUS5802559 *Nov 4, 1996Sep 1, 1998Advanced Micro Devices, Inc.Mechanism for writing back selected doublewords of cached dirty data in an integrated processorUS5860105 *Nov 13, 1995Jan 12, 1999National Semiconductor CorporationNDIRTY cache line lookaheadUS5860111 *Jun 29, 1995Jan 12, 1999National Semiconductor CorporationCoherency for write-back cache in a system designed for write-through cache including export-on-holdUS6119205 *Dec 22, 1997Sep 12, 2000Sun Microsystems, Inc.Speculative cache line write backs to avoid hotspotsUS6272033 *Feb 24, 2000Aug 7, 2001Arm LimitedStatus bits for cache memoryUS6658537 *May 8, 1998Dec 2, 20033Com CorporationDMA driven processor cacheUS6754781 *Aug 17, 2001Jun 22, 2004Texas Instruments IncorporatedCache with DMA and dirty bitsUS20010049771 *Oct 9, 1998Dec 6, 2001Brett A. TischlerDynamic replacement technique in a shared cacheUS20020065985 *Aug 24, 2001May 30, 2002Garnett Paul JeffreyEfficient memory modification trackingUS20020169947 *May 11, 2001Nov 14, 2002Gianfranco BilardiScalable processer* Cited by examinerReferenced byCiting PatentFiling datePublication dateApplicantTitleUS7991965Aug 2, 2011Intel CorporationTechnique for using memory attributesUS8078801Dec 13, 2011Intel CorporationObscuring memory access patternsUS8560781Jul 4, 2011Oct 15, 2013Intel CorporationTechnique for using memory attributesUS8732409 *Nov 16, 2009May 20, 2014Entropic Communications, Inc.Cache management policy and corresponding deviceUS8812792Sep 21, 2013Aug 19, 2014Intel CorporationTechnique for using memory attributesUS9195596 *Nov 2, 2011Nov 24, 2015Avago Technologies General Ip (Singapore) Pte. Ltd.Mapping of valid and dirty flags in a caching systemUS20050091458 *Mar 12, 2004Apr 28, 2005Yumi SatoStorage control apparatus, control system capable of DMA transfer, and method of controlling DMA transferUS20070162475 *Dec 30, 2005Jul 12, 2007Intel CorporationMethod and apparatus for hardware-based dynamic escape detection in managed run-time environmentsUS20070186055 *Feb 7, 2006Aug 9, 2007Jacobson Quinn ATechnique for using memory attributesUS20100299479 *Sep 17, 2009Nov 25, 2010Mark BuxtonObscuring memory access patternsUS20110246723 *Nov 16, 2009Oct 6, 2011Trident Microsystems, IncCache management policy and corresponding deviceUS20130111145 *Nov 2, 2011May 2, 2013Mark IshMapping of valid and dirty flags in a caching systemUS20150269077 *Apr 24, 2014Sep 24, 2015Advanced Digital Chips Inc.Method for running cache invalidation in computer systemUS20150293847 *Apr 13, 2014Oct 15, 2015Qualcomm IncorporatedMethod and apparatus for lowering bandwidth and power in a cache using read with invalidate* Cited by examinerClassifications U.S. Classification711/144, 711/143, 711/E12.04, 711/E12.035International ClassificationG06F13/28, G06F12/08Cooperative ClassificationG06F12/0804, G06F12/0835European ClassificationG06F12/08B4P4P, G06F12/08B2Legal EventsDateCodeEventDescriptionSep 27, 2002ASAssignmentOwner name: KABUSHIKI KAISHA TOSHIBA, JAPANFree format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:NAKADA, YASUMASA;REEL/FRAME:013337/0846Effective date: 20020925Jan 15, 2009FPAYFee paymentYear of fee payment: 4Apr 1, 2013REMIMaintenance fee reminder mailedAug 16, 2013LAPSLapse for failure to pay maintenance feesOct 8, 2013FPExpired due to failure to pay maintenance feeEffective date: 20130816RotateOriginal ImageGoogle Home - Sitemap - USPTO Bulk Downloads - Privacy Policy - Terms of Service - About Google Patents - Send FeedbackData provided by IFI CLAIMS Patent Services