1. Field of the Invention
The present invention relates to a cache controller device, an interfacing method and a programming method using the same.
2. Description of the Related Art
In general, cache controller is a device that prefetches data of an adjacent block memory having high possibility required from a program, and provides the fetched data via the fastest memory access cycle when a main processor requires the data, thereby reducing a memory access cycle of the main processor. In the cache operation, a method fetching data adjacent to any memory access block is used.
The operation of a general cache controller considers a feature that data stored in an adjacent memory block can be used frequently in a next instruction execution. That is, the general cache controller previously reads data from an adjacent data block regardless of a use of a program, and provides the data to a main processor upon being used in the program, thereby improving efficiency in a memory access.
However, such an operation causes cache miss when a sequence of data used in a program has a great address difference and is stored in a memory, and a time delay occurs to again read missed data, thereby resulting in cycle consumption. In order to avoid this, great researches on a memory allocation of data rows for efficient use of a memory space as well as the optimization of cycle of a program to be executed in a main processor have been required. In some cases, since the foregoing improvement is impossible, it leads to inevitable consumption of an execution cycle. In other cases, if data required in a program are not continuously distributed to have a great width displacement, cache miss occurs. Consequently, this case can cause a greater penalty than a case where a cache is not used.
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a cache controller device, an interfacing method and a programming method using the same that may prevent the occurrence of penalty due to cache miss from a previous fetch of an adjacent memory data having a relatively simple rule being an operation of a conventional cache controller, by rearranging and supplying data rows necessary in a main processor to a cache in a processing order, and continuously transferring the data rows to an original target memory in a background process although the data rows are written into an adjacent memory block in a cache in a write operation of data occurring in the main processor.
It is another object of the present invention to provide a cache controller device, an interfacing method and a programming method using the same that may execute a program of a specific block at optimum speed without the occurrence of cache miss.
It is a further object of the present invention to provide a cache controller device, an interfacing method and a programming method using the same that may improve efficient memory access in a specific program block and efficiency of an execution cycle by using a general cache method prefetching data of a continuous memory, adding a function forcing only data of the location to be efficiently read into a cache memory since it is known a distribution of data necessary in a program block in a case where a general cache method is not rather efficient.
In accordance with an exemplary embodiment of the present invention, there is provided a cache controller device according to claim 1 prefetching and supplying data distributed in a memory to a main processor, comprising: a cache temporarily storing data in a memory block having a limited size; a cache controller circularly reading out the data from the memory block to a cache memory, or transferring the data from the cache memory to the cache; and a memory input/output controller controlling prefetching of the data to the cache, or transferring the data from the cache to a memory.
In a cache controller device of claim 2 according to the cache controller device being claim 1, the cache controller includes: a mode control register controlling converting caching operation into a circular caching operation or converting the circular caching operation into the caching operation by execution of the main processor; a cache map size register defining a size of a block as a target in the circular caching operation to be converted by the execution of the main processor; a cache map address register defining a location of the block as a target in the circular caching operation to be converted by the execution of the main processor; an interface performing synchronization with the memory input/output controller through read and write data counter registers of the cache; and a control logic unit controlling the circular caching operation.
In a cache controller device of claim 3 according to the cache controller device being claim 1, the cache includes: a buffer memory block being simultaneously accessed from the cache controller and the memory input/output controller; and read and write data counter registers accessing synchronization with the cache controller and the memory input/output controller.
In a cache controller device of claim 4 according to the cache controller device being claim 1, the memory input/output controller includes: a read sequence number register defining the number of read data sequence rows; a write sequence number register defining the number of write data sequence rows; a read descriptor ENTRY indicating a start descriptor among read transfer rule descriptors; a write descriptor ENTRY indicating a start descriptor among write transfer rule descriptors; a transfer rule descriptor group defining respective transfer rules of the read data sequence and the write data sequence; and an interface performing synchronization with the cache controller through the read and write data counter registers.
In a cache controller device of claim 5 according to the cache controller device being claim 4, the transfer rule descriptor group includes: a transfer rule descriptor index; a direction filed designating a read mode or a write mode; an indicator field indicating an index of a next data sequence; a number field of a data sequence; a start address field of the data sequence; and an interval field of the data sequence.
An interfacing method of a cache controller device of claim 6 interfacing the cache controller, the memory input/output controller, and the cache map zone upon reading data from a memory to a cache using the cache controller device according to any one of claims 1 to 5, comprises the steps of: (i) rearranging elements of data in a memory location from an interval value of corresponding times from a start address of a read transfer rule descriptor having the same number as the number of contents of a read sequence number register, and reading the elements of the data to the cache by the memory input/output controller; (ii) increasing a value of a read data counter register of the cache and transferring an increase event to the cache controller by the memory input/output controller; (iii) transferring data of the cache to the cache memory; and (iv) reducing a value of the read counter register, and transferring a reduction event to the memory input/output controller to circulate step (i) by the cache controller.
An interfacing method of a cache controller device of claim 7 interfacing the cache controller, the memory input/output controller, and the cache map zone upon writing data from the cache memory to the memory using the cache controller device according to any one of claims 1 to 5, comprises the steps of: (a) preparing data in the cache memory through a program by the main processor; (b) transferring the data from the cache memory to the cache by the cache controller; (c) increasing a value of a write data counter register of the cache and transferring an increase event to the memory input/output controller by the cache controller; (d) rearranging elements of data from an interval value of corresponding times from a start address of a write transfer rule descriptor having the same number as the number of contents of a write sequence number register, and writing the elements of the data to a memory location by the memory input/output controller; and (e) reducing a value of a write data counter register of the cache and transferring a reduction event to the cache controller to be circulated to step (b) by the memory input/output controller.
A programming method of a cache controller device of claim 8 in consideration of a circular cache operation using the cache controller device according to any one of claims 1 to 5, comprises the steps of: producing a read descriptor by data rows necessary in a processing order of a program; producing a write descriptor by data rows output in the processing order of the program; designating a location and a size of a cache to be used in the program; converting an operation of a cache into a circular caching operation by setting the program; and
As mentioned above, in a cache controller device, an interfacing method and a programming method using the same according to the present invention, the occurrence of penalty due to cache miss from a previous fetch of an adjacent memory data having a relatively simple rule being an operation of a conventional cache controller may be prevented by rearranging and supplying data rows necessary in a main processor to a cache in a processing order, and continuously transferring the data rows to an original target memory in a background process although the data rows are written into an adjacent memory block in a cache in a write operation of data occurring in the main processor.
Further, the present invention may execute a program of a specific block at optimum speed without the occurrence of cache miss.
Moreover, the present invention may improve efficient memory access in a specific program block and efficiency of an execution cycle by using a general cache method prefetching data of a continuous memory, adding a function forcing only data of the location to be efficiently read into a cache memory since it is known a distribution of data necessary in a program block in a case where a general cache method is not rather efficient.
Specific details other than objects, means for solving the objects, effects are included in following embodiments and drawings. Merits, features, and methods for achieving them of the present invention will be more apparent from the following detailed description in conjunction with the accompanying drawings. In the specification, the same reference numerals are used throughout the drawings to refer to the same or like parts.
The objects, features and advantages of the present invention will be more apparent from the following detailed description in conjunction with the accompanying drawings, in which:
Hereinafter, exemplary embodiments of the present invention are described in detail referring to the accompanying drawings. It will be understood by those skilled in the art that the accompanying drawings have been illustrated for readily explaining the present invention and the present invention is not limited to the drawings.
Referring to
The cache 130 is a memory block having a limited size, namely, a memory buffer block having a limited size. Preferably, the cache 130 is a block that the cache controller 120 and the memory input/output controller 140 may simultaneously access.
The memory input/output controller 140 controls prefetching and supplying data to the cache 130 or controls moving of the data from the cache 130 to the memory 150. That is, data are copied to the cache 130 in an order described in a transfer rule descriptor during a read operation. At the same time, a simultaneously accessible cache controller 120 transfers data previously copied by a memory accessing device to a cache memory 110 or transfers data written in the cache memory 110 to the cache 130.
Preferably, the cache controller 120 has a function accessing only a cache 130 being a memory buffer of a predetermined size circularly accessing in addition to a general caching operation. In read and write operations of the cache controller 120 from and to the cache 130, it caches a continuously one-dimensional memory block in the same operation in 1-way cache memory 110 being the simplest performing operation of a conventional cache controller 120, but circulates by a size of the cache 130 and accesses the cache 130. Accordingly, the conventional cache controller 120 is characterized by caching a memory block having an area wider than the cache 130. However, the cache controller 120 of the present invention caches only a limited area of the cache 130, and ensures a cache hit in a main processor 100 for data entered in the cache 130.
Namely, the cache controller 120 transfers one-dimensional data stored in a continuous memory block of the cache 130 in a read operation. However, data rows written to the cache 130 are read in a memory 150 in an order referred in a program by the memory input/output controller 140, and rearranged and recorded in the cache 130.
Further, the cache controller 120 and the memory input/output controller 140 further include an interface (not shown) synchronizing data of the cache memory 110. In this case, it is preferred that the interface includes a read/write data transfer counter register (not shown) causing the cache controller 120 to share the cache 130 with the memory input/output controller 140. In this case, the cache controller 120 and the memory input/output controller 140 performs synchronization with the cache memory 110 and the cache 130 via the read/write counter register included in the cache 130.
Accordingly, the cache controller device of the present invention having a structure as described above includes a cache controller 120 for a circular access, a cache map functioning as a space of data for rearrangement, and a memory input/output controller 140 rearranging a data sequence between the cache map and a memory 150 to perform read and write operations. By the construction, the cache controller device maintains a continuous memory access to a limited area, and an additional memory input/output controller 140 rearranges data according to an execution order of a main processor 100 to read or write them.
Referring to
Referring to
Meanwhile, data rows required in a program should refer to a plurality of sequence rows distributed in different memory areas not a simple one-dimensional unit arrangement. A memory input/output controller 140 has a transfer rule descriptor group 310 defining a transfer rule every unit data sequence. Each unit transfer rule descriptor includes a transfer rule descriptor index 311, a direction field designating a read or write mode, an indicator field 313 indicating an index of a next data descriptor, a data element number field 314, a start address field 315 of a data sequence, and an interval field 316 of the data sequence.
In this case, a field of each unit descriptor defines an element distribution rule by arrangements of a source memory space 200, and a mapping rule thereof to a cache. After a start data element of a first descriptor arrangement is mapped to the cache in a reference order 220 in the program of
In a case of a write operation, on the contrary to this, data are mapped from the cache to a source memory space in such a way that rows and columns are transposed. By the foregoing procedure, the memory input/output controller of the present invention provides data area information referring to a program using the transfer rule descriptor, thereby supplying necessary data in a referred order.
Referring to
Referring to
The cache controller 120 is activated by a corresponding event (step 501) to transfer data from the cache to a real memory (step 502), and reduces a value of a transfer write data counter register (step 503). The cache controller 120 is activated by a reduction event in a value of the transfer counter register (step 513), thereby transferring a new data sequence entered in a cache memory to the cache.
In the meantime, in a case of a processor including a cache controller, a cache map, and a memory input/output controller of the cache controller device according to the present invention, if data are configured in a different format from that of programming of a conventional cache or a processor without a cache, it can be efficiently executed. Although a method referring to a data row is not different, it should change to a method referring a data row in an order entering in a cache map. Further, a descriptor should be made prior to execution, and a program element setting an operation of a cache should be added.
Meanwhile, in a construction of the cache controller device according to the present invention, some steps can be simplified according to an embodiment selection. The cache and the cache memory may be integrated with each other. The cache controller and a memory accessing device can be implemented by one device. For example, a data path from a memory to a cache memory through a cache can be simplified to a data path from the memory to the cache memory. A reverse data path from the cache memory to the memory through a cache can be simplified to a data path from the cache memory to the memory.
Referring to
Referring to
Accordingly, in the cache controller device, the interfacing method and a programming method using the same according to the present invention, a reference of read data of a main processor may maintain a read cache hit rate of 100% as long as a cycle of a memory input/output device is not late because data in an order required in the main processor are always prepared in the faster cache memory. Meanwhile, in a case of a writ operation, since data are only written into a cache being a continuous memory block, a write cache hit rate may maintain 100%. Further, because a memory input/output device other than a cache controller performs rearrangement, accessing a real memory address can reduce an execution load of the main processor.
Although embodiments in accordance with the present invention have been described in detail hereinabove, it should be understood that many variations and modifications of the basic inventive concept herein described, which may appear to those skilled in the art, will still fall within the spirit and scope of the exemplary embodiments of the present invention as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2009-0005849 | Jan 2009 | KR | national |