Data processor having cache memory

Abstract: A data processor has a main memory (203) which stores data and instructions to be used by the processor, an instruction processor (201) and two cache memories (100,101). The first cache memory (101) is a large capacity port direct mapped cache memory, and the second cache memory (100) is a small capacity two port set associative cache memory. The instruction processor (201) controls the transfer of data to/from the cache memories (100,102) on the basis of instruction from the main memory, so that data needed frequently is stored in the first cache memory (101) and data needed less frequently is stored in the second cache memory (100). With such an arrangement, data stored in the second cache memory (100) can be removed therefrom after it has been accessed, and other data stored therein, thereby increasing the probability that data needed at any time will be in the first or second cache memories (101,100), without storing useless data on the first cache memory (101).

Description: The present invention relates to a data processor 5 having a cache memory, particularly to software prefetch for efficiently using two types of cache memories and control for most favorably controlling the access of the cache memories. Moreover, the present invention relates to a data processor having a controller for these operations. In general, a computer having, a cache memory stores data to be frequently used in a small-capacity high-speed cache memory out of the data stored in a large-capacity low-speed main memory, in which an instruction unit such as a CPU makes high-speed data access to the cache memory and accesses the main memory only when no data is present in the cache memory. However, because the machine cycle of the CPU is suddenly shortened compared with that of the memory, the penalty in the case of a cache miss (a time until requested data is obtained from the main memory) increases. The method called software prefetch for solving the above problem is described in David Callhan et al., "Software Prefetching" Fourth International Conference on Architectural Support for Programming Languages and Operating Systems, 1991, pp. 40-52. In the case of the first prior art, an address is computed by a prefetch instruction before an instruction unit requires data, it is checked if data indicated by the address is present in a cache memory, 5 and if not, the data is transferred from the main memory to the cache memory. Therefore, it is possible to improve the hit ratio of the cache memory and minimize the penalty because data is previously stored in the cache memory by the prefetch instruction whenever data is required. A cache memory comprising two buffers with different purposes which are properly used by hardware is disclosed in JP-A-4 303 248. In the case of the second prior art, the cache memory has an S buffer and a P buffer. The S buffer stores data to be accessed frequently over time. The P buffer stores data of which the addresses to be referenced from now on by program are close to the currently referenced address, i.e., the P buffer stores the array data to be accessed in array computation. Any one of the two buffers is used selectively depending on the addressing mode in effect and on the type of the register being used for address calculation. In general, a computer stores instructions or data to be frequently called and processed by a processor in a high-speed small-capacity memory called a cache memory in addition to a comparatively low-speed large-capacity main memory. Thus, the computer operation speed is increased. Data access system for the cache memory includes direct-mapped memory and set associative memory. The direct mapping system is used for accessing a cache memory by directly outputting data or an instruction stored in an address designated by a processor or the like and storing it in the designated address. The set associative memory is used for accessing a plurality of sets of data values or a plurality of instructions (called data set) in a cache memory having a plurality of sets each of which comprises a plurality of memories common in allocation of addresses. A plurality of accessed sets of data values or a plurality of accessed instructions required are selected and processed in the processor. The first prior art has the first problems that an expensive two-port cache memory must be used in order to process transfer of data from the main memory to the cache memory and a memory referencing instruction sent from the instruction unit at the same time. Unless the simultaneous processing is carried out, it is possible to use a generally-used one-port cache memory. In this case, however, a lot of processing time is required and the feature of software prefetch cannot effectively be used. Moreover, the first prior art has the second problem that, when data which is read from a cache memory only once and immediately expelled from the cache memory is held in the cache memory, the cache memory is filled with useless data and the hit ratio decreases. These problems frequently occur in a program for handling large-scale data exceeding the capacity of a cache memory. The second prior art has the third problem that, because a cache memory for storing data between two cache memories is determined by an address designation system and a register used for address computation, two cache memories must properly be used by considering data characteristics including data size. Therefore, it is desirable to provide a data processor for solving the above problems, quickly and efficiently processing small-capacity data stored in a cache memory and frequently accessed and large-scale data exceeding the capacity of the cache memory, lessening the contamination of the cache memory, and improving the hit ratio. In an article by M Baron et al entitled "32-bit CMOS CPU chip acts like a Mainframe", publishing in Electronic Design, Vol. 35, No. 9 of April 1987 pp. 95 to 100, a data processor was disclosed having a data processing part and two cache memories. One cache acted as a cache for instruction data and the other acting as a cache for general data. A control part identified the cache from which to prefetch data by one of a prefetch instruction. IBM Technical Disclosure Bulletin, Vol. 33 No. 1A of June 1990 pp. 264 and 265, also disclosed a data processor with two cache memories. One cache memory was larger, the other faster. Data was written to both caches simultaneously, and from the smaller cache to the main memory as the smaller cache ages out. US-A-3618041 disclosed a processor with a plurality of buffer memories which stored information from a main memory under the control of a memory controller. The buffer memories each had the same configuration. According to the present invention, there is provided a data processor comprising: (a) a main memory storing data and instructions; (b) an instruction processor for processing the data in accordance with the instructions; (c) a cache memory part storing only data and connected between the main memory and the instruction processor, wherein the cache memory part includes a first cache memory and a second cache memory; wherein: the second cache memory has a storage capacity less than or equal to the storage capacity of the first cache memory, the first cache memory has one port, the second cache memory has two or more ports, and the data processor further comprises: (d) a controller included in the cache memory part, for receiving information for indicating instruction to be executed and address from the instruction processor, and for selecting one of the first and second cache memories based on the information and address, and storing data into the selected cache memory; and (e) the controller being arranged to control either the first cache memory or the second cache memory to store data thereinto, with data of high access frequency being stored into the first cache memory and data of low access frequency being stored into the second cache memory. Because data to be frequently accessed is stored in the first cache memory, the hit ratio is improved. Moreover, because data to be less frequently accessed is not stored in the first cache memory, the useless data of the first cache memory can be lessened. Because data to be less frequently accessed is stored in the second cache memory, the data can be removed from the second cache memory after it is processed. That is, because data to be always accessed is stored in the second cache memory though the capacity of the second cache memory is small, the hit ratio can be improved. Moreover, because the second cache memory has two ports, efficient processing is realized by simultaneously processing the transfer of large-scale data to be less frequently accessed from the main memory and the memory referencing instruction sent from the instruction unit. Furthermore, because it is enough to provide only the small-capacity second cache memory with the function for simultaneously processing the data transfer from the main memory and the memory referencing instruction sent from the instruction unit, it is possible to decrease the hardware volume and the cost. These and other objects, features, and advantages of the present invention will be understood more clearly from the following detailed description with reference to the accompanying drawings, wherein FIG. 1 shows the general view of an embodiment of the present invention; FIG. 2 shows the first constitution of the memory unit 202 in FIG. 1; FIG. 3 shows a constitution of the instruction unit 201 in FIG. 2; FIG. 4 shows an illustration for explaining a pipeline; FIG. 5 shows a constitution of the prefetch queue in FIG. 2; FIG. 6 shows a constitution of the cell 502 in FIG. 5; FIG. 7 shows a constitution of the priority circuit 500 in FIG. 5; FIG. 8 shows a constitution of the judging Circuit 501 in FIG. 5; FIG. 9 shows a constitution of the second cache memory 100 in FIG. 2; FIG. 10 shows a constitution of the cell 901 in FIG. 9; FIG. 11 shows a constitution of the first cache memory in FIG. 1; FIG. 12 shows an illustration for explaining an instruction format; FIG. 13 shows an illustration for explaining types of instructions; FIG. 14 shows a constitution of the control 5 circuit 103 in FIG. 2; FIG. 15 shows the second constitution of the memory unit 202 in FIG. 1; Fig. 16 shows the general view of the second embodiment of the present invention; Fig. 17 shows a constitution of the memory unit 3502 in Fig. 16; Fig. 18 shows a constitution of the instruction unit 3501 in Fig. 16; Fig. 19 shows an illustration for explaining the pipeline operation in effect when the data processor in Fig. 16 executes instructions; Fig. 20 shows a constitution of the second cache memory 3490 in Fig. 17; Fig. 21 shows a constitution of the cell 3801 in Fig. 20; Fig. 22 shows a constitution of the control circuit 3403 in Fig. 17; Fig. 23 shows the second constitution of the first cache memory 101 in Fig. 2; Fig. 24 shows the second constitution of the second cache memory 100 in Fig. 2; Fig. 25 shows the general view of the third embodiment of the present invention; Fig. 26 shows a constitution of the memory unit 4402 in Fig. 43; Figs. 27 (A), 27 (B), 27 (C) and 27 (D) show illustrations for explaining the pipeline operation in effect when the data processor in Fig. 25 executes instructions; Fig. 28 shows a constitution of the second cache memory 4390 in Fig. 26; Fig. 29 shows a constitution of the cell 4601 in Fig. 46; Fig. 30 shows a constitution of the control circuit 4303 in Fig. 26; FIG. 1 shows a schematic view of the present invention. The computer of the present invention comprises an instruction unit 201, a memory unit 202, and a main memory 203. The instruction unit 201 uses, for example, a CPU for performing operations and control. The memory unit 202 comprises a control section comprising a first cache memory 101, a second cache memory 100, selectors 104 and 1605 for transferring data to and from these memories, and a control unit 1600. The main memory 203 is a memory for storing 0 instructions and data. The first cache memory 101 is a one-port cache memory having a capacity larger than that of the second cache memory. The second cache memory 100 is a two-port cache 5 memory having a capacity smaller than that of the first cache memory. The instruction unit 201 is a unit for processing instructions, which transfers data to and from the first cache memory 101 and the second cache memory 100 through buses 210, 211, and 212. That is, the unit 201 transmits an address, data, and a control signal to the memory unit 202 and main memory 203 through the address bus 210, four-byte-width write data bus 211, and control signal line 213. The memory unit 202 transmits data and a wait signal to the instruction unit 201 through the four-byte-width read data bus 212 and a wait signal line 214 and a request signal to the main memory 203 through a request signal line 218. The main memory 203 transmits data to the first cache memory 101 and the second cache memory 100 through buses 215 and 216. That is, the main memory 203 transmits data, an address, and a response signal to the memory unit 202 through the transfer address bus 216 and a response signal line 217. FIG. 12 is an illustration for explaining a format of the operation code of an instruction processed by the instruction unit 201 in FIG. 1. In FIG. 12, symbol OP represents an operation code, A and B represent fields for designating a source register, C represents a field for designating a target register, and d represents a field for showing immediate data. FIG. 13 is an illustration showing types of instructions processed by the instruction unit 201 in FIG. 1. Though the number of instructions is restricted to 10 in this embodiment for easy understanding, this does not restrict the purposes of the present invention. The present invention can also be applied to a computer having several tens of instructions to more than one hundred instructions similarly to a normal processor. Instructions AND, OR, ADD, and SUB perform operations corresponding to the source registers A and B and store data in the target register C. The instruction NOT stores the negation of bits in the source register A into the target register C. The branch instruction BRA adds the immediate data d to the program counter PC and stores it in the program counter PC. The load instruction LD stores read data in the register C by using the sum of the contents of the register A and those of the register B as an address. The store instruction ST writes the contents of the register B by using the contents of the register A as an address. A prefetch instruction is described below. The prefetch instruction PF1 checks if data corresponding to the first cache memory 101 and the second cache memory 100 is present by using the sum of the contents of the register A and those of the register B as an address. If not, the instruction PF1 transfers data to the first cache memory 101 from the main memory 203. The prefetch instruction PF2 has the same functions as PF1 except that PP2 writes transferred data in the second cache memory 100. Though described in detail rater, the first cache memory 101 is a cache memory with the capacity of 1M bits and the block size of 16 bytes using the direct map system. The direct map system is a system in which a place for storing data in a cache memory is uniquely determined by an address of a memory. The second cache memory 100 is a cache memory with the block size of 4 bytes and 64 entries using the full associative system. The full associative system is a system for storing data of optional address of a memory in an optional storing place of a cache memory. The instruction PF1 is used to prefetch data to be probably roused and the instruction PF2 is used to prefetch data not to be roused. A compiler judges whether to rouse the data when generating an object code. For example, when accessing large-scale data exceeding the capacity of a cache memory, the compiler uses the instruction PF2 by judging that the data will not be roused even if storing the data in the cache memory. Though the first cache memory 101 has the capacity of 1M bits which is larger than that of the second cache memory, the entire size of the cache memory 101 is not very large and the cache memory 101 operates at a high speed because it has one port. The second cache memory 100 uses the full associative system and processes the memory referencing instruction sent from the instruction unit 1 and the transfer of the data sent from the main memory 203 at the same time. Therefore, through the cell structure is complicated, the entire size of the cache memory 100 is small and moreover the operation speed of it can be increased because the cache memory 100 has only 64 entries. The second cache memory 100 is used to store data not to be roused by the instruction PF2. Therefore, because the cache memory 100 only temporarily stores data transferred from the main memory 203 by the instruction PF2 but not used yet by the instruction LD, it has a high hit ratio though its capacity is small and the performance of it can be improved. When executing a load instruction, the instruction unit 201 sends the address of data to be loaded to the address bus 210 and designates the load instruction by the control signal 213. When data corresponding to a cache memory in the memory unit 202 is present, the memory unit 202 reads the data and sends it to the data bus 212. Unless the data is present, the memory unit 202 transmits the wait signal 214 to the instruction unit 201 and sets the request signal 218 for requesting the main memory 203 to transfer the data to '1'. When receiving the signal 218, the main memory 203 reads the data, sends the data to the transfer data bus 215, and returns the response signal 217 to the memory unit 202. The memory unit 202 writes the data in a stored cache memory, reads the data to the instruction unit 201 to send it through the data bus 212, and sets the wait signal 214 to '0'. When executing a store instruction, the instruction unit 201 sends a write address to the address bus 210 and data to be written to the write data bus 211 to send the data to the memory unit 202, main memory 203, and input/output unit 204. In the case of this embodiment, data is written in both the cache memory 100 or 101 and the main memory 203 (write-through) for easy understanding. Even if the cache memory makes a mistake when writing the data, the data is not transferred from the main memory 203 to the cache memory. When data is written in a data space, the memory unit 202 writes the data sent from the write data 211 in the cache memory if the cache memory hits and the main memory 203 also writes the same data in the main memory. Symbol 301 represents an instruction cache memory, 320 represents an arithmetic unit, and 302 represents a memory interface. The instruction cache memory 301 converts an instruction into a signal 307 and sends the signal 307 to the arithmetic unit 320 and memory interface 302. When executing the instructions LD, ST, PF1, and PF2, the memory interface 302 sends the control signal 213 and receives the signal 214. When the wait signal 214 is set to '1', the interface 302 transmits the signal 308 to the arithmetic unit 320 and stops the pipeline until the wait signal 214 comes to '0'. Symbol 1600 represents a control unit and 1605 and 104 represent selectors. The control unit 1600 transfers the control signals 213, 214, 217, and 218 to and from the memory interface 302 and main memory 203 and controls the selector 1605, second cache memory 100, and first cache memory 101 by the signals 111, 113, and 122 to 125. The selector 104 selects correct data out of the data sent through the data bus 110 close to the second cache memory 100 and the data sent though the data bus 112 close to the first cache memory 101 and sends the selected data to the instruction unit 201 as the signal 212. Because the first cache memory 101 has only one port, it is only able to sequentially process the access from the main memory 203 and the access from the instruction unit 201. The control unit 1600 decides which accesses the first cache memory 101 by the selector 1605. FIG. 3 shows a constitution of the instruction unit 201 in FIG. 1. In FIG. 3, symbol 301 represents an instruction cache memory, 303 represents a decoder 302 represents a memory interface, 305 represents a register, 306 represents an ALU, and 304 represents an address adder. The instruction cache memory 301 transmits an instruction to the decoder 303 and memory interface 302 through a bus 307. The decoder 303 decodes the received instruction and controls the register 305, ALU 306, and address adder 304 by a signal 330. The ALU 306 receives data from the register 305 through buses 312 and 313, provides the data with operation, and writes the operation result in the register 305 through a bus 314. The address adder 304 reads data from the register 305 through buses 310 and 311, add the read data values, and transmits the result to the bus 210 as an address to be loaded or stored. To store the result, data to be stored is read from the register 305 and transmitted to the bus 211. To load the result, the adder 304 received read data through the bus 212 and writes it in the register 305. The memory interface 302 outputs the control signal 213 when executing the instructions LD, ST, PF1, and PF2 and receives the signal 214. When the wait signal 214 is set to '1', the interface 302 transmits the signal 308 to the decoder 303 and stops the pipeline until the wait signal 214 comes to '0'. FIG. 4 shows an illustration for explaining the processing by the pipeline. In FIG. 4, symbol IF represents an instruction read stage, D represents a decode stage, E represents an operation and address addition stage, A represents a cache memory access stage, and W represents a register write stage. When a load instruction is executed, a cache memory is accessed at the stage A and data read at the stage W is written in the register, 305. When a store instruction is executed, a cache memory is checked at the stage A and, if it is hit, data is written in the cache memory at the stage A. FIG. 2 shows a constitution of the memory unit 202 in FIG. 1. In FIG. 2, symbol 100 represents a second cache memory with the capacity of 1M bytes and the block size of 16 bytes using the direct map system, 101 represents a cache memory with the capacity of 256 bytes using the full associative system, 102 represents a four-entry prefetch queue, 103 represents a control circuit, and 104 and 105 represent selectors. The first cache memory 101 receives an address 130, a transfer data 215, a selector control signal 123, a write signal 122, and write data 211 and outputs read data 112 and a hit signal 113. The second cache memory 100 receives an address 210, a transfer address 216, transfer data 215, an entry signal 124, a write signal 125, and write data 211 and outputs read data 110 and a hit signal 111. The prefetch queue 102 receives a cache memory selection signal 213-1, a transfer address 216, an address 210, a set signal 120, and a reset signal 121, and outputs a full signal 114, a hit signal 115, and a cache memory selection signal 116. The control circuit 103 receives a control signal 213-2 from the instruction unit 201; the full signal 114, the hit signal 115, and the cache memory selection signal 116 from the prefetch queue 102; the response signal 217 from the main memory 203; the hit signal 111 from the second cache memory 100; and the hit signal 113 from the first cache memory 101, and transmits the wait signal 214 to the instruction unit 201; the set signal 120 and the reset signal 121 to the to the prefetch queue 102; the transfer request signal 218 to the main memory 203; the entry signal 124 and the write signal 125 to the second cache memory 100; the write signal 122 and the selector control signal 123 to the first cache memory 101; and the selector control signal 123 to the selector 105. The selector 104 receives the data 110 and the hit signal 111 from the second cache memory 100 and the data 112 and the hit signal 113 from the first cache memory 101, and reads the data 110 as an output when the hit signal 111 is asserted and the data 110 as an output when the hit signal 113 is asserted to output the data to the data bus 212. The selector 105 selects either of the address 210 and the transfer address 216 in accordance with the control by the selector control signal 123 and transmits it to the first cache memory 101 as an output 130. The first cache memory 101 reads data from the cache memory in accordance with the contents of the address 130 when the write signal 122 designates data read and outputs the read data 112 and the hit signal 113. When the write signal 122 designates data write, the cache memory 101 writes the transfer data 215 if the selector control signal 123 is set to 1 and the contents of the write data 211 if the signal 123 is set to 0. The second cache memory 100 checks the contents of the cache memory at the address 210 and outputs the read data 110 and the hit signal 111 when the write signal 125 is negated and designates data read. When the write signal 125 is asserted and designates data write, the cache memory 100 checks the contents of the cache memory and, if they are hit, the cache memory 100 writes the contents of the write data bus 211. When the entry signal 124 is asserted simultaneously with the above operation, the cache memory 100 enters a set of the transfer address 216 and the transfer data 215. The prefetch queue 102 is a queue for holding the address of the data being transferred from the main memory 203 up to four entries, and enters the contents of the address 210 and set selection signal 213-1 in the queue when the set signal 120 is asserted and outputs the cache memory selection signal 116 corresponding to the transfer address 216 when the reset signal 121 is asserted to negate the entry. Moreover, the queue 102 compares the address 210 with its holding address and asserts the hit signal 115 if the entry is currently transferred from the main memory 203. Moreover, while an address valid for every entry is held, the queue 102 asserts the full signal 114 showing the address. Finally, the operation of the control circuit 103 is described below. FIG. 14 shows a constitution of the control circuit 103. The control circuit 103 decodes the control signal 213-2 and accepts the start of each of the instructions LD, ST, PF1, and PF2. When the instruction LD is under execution and both the hit signal 111 sent from the second cache memory 100 and the hit signal 113 sent from the first cache memory 101 are negated, the circuit 103 asserts the wait signal 214 to make the instruction unit 201 wait while transferring data from the main memory 203 because of errors of the both cache memories. When the instructions LD, Pal, and PF2 are under execution, both the hit signal 111 sent from the second cache memory 100 and the hit signal 113 sent from the first cache memory 101 are negated, and the full signal 114 sent from the prefetch queue 102 is asserted though the hit signal 115 sent from the prefetch queue 102 is also negated, the circuit 103 asserts the wait signal 214 in order to make the instruction unit 201 wait because the prefetch queue 102 is full and therefore no instruction can be loaded in the queue. When the instruction LD, PF1, or PF2 is under execution, the full signal 114 sent, from the prefetch queue 102 is negated, and the hit signal 111 sent from the second cache memory 100 and the hit signal 113 sent from the first cache memory 101 are also negated, the circuit 103 asserts the transfer request signal 218 to be sent to the main memory 203 and also asserts the set signal 120 to be sent to the prefetch queue 102 to enter them in the prefetch queue 102. Moreover, when the response signal 217 sent from the main memory 203 is asserted, the circuit 103 asserts the reset signal 121 to be sent to the prefetch queue 102 in order to reset the entry from the prefetch queue 102 and, in order to enter transfer data in a cache memory, asserts the write signal 122 to be sent to the first cache memory 101 when the cache memory selection signal 116 designates write of data in the first cache memory 101 and asserts the entry signal 124 to be sent to the second cache memory 100 when the signal 116 designates write of data in the second cache memory 100. When the instruction ST is under execution and the hit signal 113 sent from the first cache memory 101 is asserted, the circuit 103 asserts the write signal 122 to be sent to the first cache memory 101 in order to write the data showing that the signal 113 is asserted in the first cache memory 101. Similarly, when the instruction ST is under execution and the hit signal 111 sent from the second cache memory 100 is asserted, the circuit 103 asserts the write signal 125 to be sent to the second cache memory 100 in order to write the data showing that the signal 111 is asserted. FIG. 5 shows a constitution of the prefetch queue 102 in FIG. 2. In PIG. 5, symbol 500 represents a priority circuit, 501 represents a judging circuit, and 502 to 505 represent cells. The cells 502 to 505 receive a read address 212, a cache memory selection signal 213-1, a transfer address 216, and a reset signal 121, and outputs a valid signals 506, 509, 512, and 515, hit signals 507, 510, 513, and 516, and a selection signal 116. Moreover, the cells receive set signals 508, 511, 514, and 517. The priority circuit 500 receives the valid signals 506, 509, 512, and 515 from the cells 502 to 505 and the reset signal 120 from the control circuit 103, and transmits the set signals 508, 511, 514, and 517 to the cells 502 to 505. The judging circuit 501 receives the valid signals 506, 509, 512, and 515 and the hit signals 507, 510, 513, and 516 from the cells 502 to 505 and transmits the full signal 114 and hit signal 115 to the control circuit 103. Because the cells 502 to 505 have the same function, the operation of only the cell 502 is described below. The cell 502 stores a register for holding addresses and a cache memory selection bit and its valid bit. When the set signal 508 is asserted, the cell 502 asserts the valid bit and incorporates the contents of the transfer address 216 and those of the cache memory selection signal 213-1 and compares the read address 212 with its holding valid address. When they coincide with each other, the cell 502 transmits a holding corresponding cache memory selection bit to the signal 116. When the transfer address 216 coincides with a holding address and the reset signal 121 is asserted, the cell 502 negates the valid bit. When the set signal 120 is asserted, the priority circuit 500 checks the valid signals 506, 509, 512, and 515 and selects one of valid cells to assert the corresponding signals 508, 511, 514, and 517. The most priority is given to the cell 502 and the least priority is given to the cell 505 and the cells are set starting with the cell 502. The judging circuit 501 asserts the hit signal 115 if there is only one cell in which both the valid signal and hit signal are asserted. When valid signals 506, 509, 512, and 515 are all asserted, the circuit 501 asserts the full signal 114. FIG. 6 shows a constitution of the cell 502 in FIG. 5. In FIG. 6, symbol 601 represents a register for holding an invalid bit, 602 represents a register for holding addresses, 603 represents a register for holding cache memory selection bits, 604 and 605 represent comparators, 630 represents a tristate buffer, and 631 and 632 represent AND gales. The valid bit 601 is set when the set signal 508 is asserted and reset when the signal 608 is asserted. The set signal 508 is connected to the valid bit 601, address register 602, and cache memory selection bit 603. When the set signal 508 is asserted, the valid bit 601 is set, the address register 602 incorporates the read address 212, and the cache memory selection register 603 incorporates the cache memory selection signal 213-1. The valid bit transmits its output as the valid signal 506. The comparator 604 compares the address 212 with an output 606 of the address register 602. When they coincide with each other and the valid bit 601 is asserted, the comparator 604 asserts the hit signal 507. The comparator 605 compares the output 606 of the address register 602 with the transfer address 216. When they coincide with each other, the comparator 605 opens the tristate buffer 630 and transmits the contents of the cache memory selection bit register 603 to the signal 116. Moreover, when the reset signal 121 is asserted, the signal 608 is asserted and the valid bit 601 is reset. FIG. 7 shows a constitution of the priority circuit 500 in FIG. 5. In FIG. 7, symbols 705 to 707 represent inverters and 701 to 704 represent AND gales. PIG. 8 shows a constitution of the judging circuit 501 in FIG. 5. In FIG. 8, symbols 801 to 804 and 806 represent AND gales and 805 represents an OR gate. FIG. 9 shows a constitution of the cache memory 100 in FIG. 2. In FIG. 9, symbol 900 represents a judging circuit and 901 to 903 represent cells for holding a set of a valid bit, address, and data. The cells 901 to 903 receive the read address 210, entry request 124, write data 211, and write request 125 as inputs and they output the data 110. Moreover, the cells 901 to 903 transmits the hit signals 910 to 912 to the judging circuit 900 respectively. The cell 901 receives the transfer address 216 and transfer data 215 and sends an address 913 and data 914 to the cell 902. Similarly, the cell 902 sends addresses 915 and 916 to the next cell. The last cell 912 receives an address 917 and data 918. If any one of the hit signals 910 to 912 sent from the cells 901 to 903 is asserted, the judging circuit 900 asserts the hit signal 111 to be sent to the control circuit 103 and selector 104. The cell 901 compares the address 210 with its holding address. When they coincide with each other and are valid, the cell 901 transmits the hit signal 910 and outputs the corresponding holding data to the bus 110. When the write request 125 is asserted, the cell 901 compares its holding address with the write address 210. When they coincide with each other and the valid bit is asserted, the cell 901 incorporates the contents of the write data 211. When the entry request 124 is asserted simultaneously with the above operation, the cell 901 asserts the valid bit and incorporates the transfer address 216 and transfer data 215. In this case, the cell 902 incorporates the address and data held by the cell 901 through the signals 913 and 914. That is, the cells 901 to 903 follow FIFO. FIG. 10 shows a constitution of the cell 901 in FIG. 9. In FIG. 10, symbols 1000, 1001, and 1002 represent registers for holding a valid bit, addresses, and data respectively. Symbol 1004 represents a comparator, 1005 and 1006 represent AND gales, and 1003 represents a tristate buffer. The entry request 124 is connected to the register 1000 for holding a valid bit, the register 1001 for holding addresses, and the register 1002 for holding data. When the entry request 124 is asserted, the register 1000 for holding a valid bit is set, the register 1001 for holding addresses incorporates the transfer address 216, and the register 1002 for holding data incorporates the data 215. The comparator 1004 compares an output 913 of the register for holding addresses with the address 210. When an output of the comparator 1004 is asserted and also the valid bits is asserted, the AND gate 1006 asserts the hit signal 910 and opens the tristate buffer 1003 to transmit the contents of the register for holding data to the data bus 110. Moreover, when the AND gate 1005 detects that the hit signal 910 and a write request are asserted, it asserts the signal 1008 to be sent to the register 1002 for holding data and incorporates the write data 211 into the register 1002 for holding data. As described above, the second cache memory 100 uses the full associative system and processes a memory referencing instruction sent from the instruction unit 201 and transfer of the data sent from the main memory 203 at the same time. Therefore, the entire size of the cache memory 100 is small and the operation speed of it can be increased because it has only 64 entries though the cell structure is complicated. Moreover, the second cache memory 100 has a high hit ratio though the capacity of it is small and the operation speed of it can be increased because it stores data not to be roused in accordance with the instruction PF2 and thereby only temporarily stores the data transferred from the main memory 203 in accordance with the instruction PF2 but not used yet by the instruction LD. The cache memory in Fig. 9 has a block size of as small as 4 bytes. This means that the cache memory provides, given the same capacity, a greater number of entries than if the block size were the same as that of the first cache memory, i.e., 16 bytes. Thus even when a large number of array data need to be processed at one time, each array may be stored in a separate entry, whereby any drop in performance attributed conventionally to the lack of entries is prevented. Since data is transferred from the main memory in units of 4 bytes, data of discontinuous addresses may be processed without transfering unnecessary data. This ensures high-speed data processing. FIG. 11 shows a constitution of the first cache memory in FIG. 2. In FIG. 11, symbol 1100 represents an address array, 1101 represents a valid bit, 1102 represents a data array, 1104 represents a comparator, and 1105 represents an AND gate, and 1103 represents a selector. The selector 1103 is controlled by the control signal 123, which selects the transfer data 215 or write data 211 and transmits its output to the data array 1102. The address array 1100 and the valid bit 1101 are accessed by a low-order bit 30-1 of the address 130. The comparator 1104 compares an address array output 1106 with a high-order bit 130-2 of the address 130. The AND gate 1105 outputs the hit signal 112 when detecting that an output of the comparator is asserted and the valid bit 1107 is asserted. Moreover, when the write signal 122 is asserted, the AND gate 1105 incorporates the address 130-2 and sets a corresponding valid bit. The data array is accessed by the low-order bit 130-1 of the address 130, which transmits read data to the bus 113. When the write signal 122 is asserted, the data array writes an output of the selector 1103. Though the first cache memory 101 has the capacity of 1M bits which is larger than that of the second cache memory, the entire size of it is not very large because it has only one port and increase of its operation speed can be expected. FIG. 14 shows a constitution of the control circuit in FIG. 2. In FIG. 14, symbols 1400, 1406, and 1410 represent OR gales and 1401 to 1405, 1407 to 1409, and 1411 represent AND gales. Symbol 1412 represents a decoder which has a function for decoding the control signal 213-2 by the instruction unit 201 to judge whether an instruction under execution is LD, ST, PF1, or PF2. FIG. 15 shows a constitution of the memory unit 202 in FIG. 1. The constitution in FIG. 15 is almost the same as that in FIG. 2 except that an interface 130 is present between the first cache memory 101 and the second cache memory 100. The first problem of the constitution in FIG. 2 is that the second cache memory is useless when a medium-or small-scale program is run by using the instruction PP1. The second problem of it is that the hit ratio is low compared with that of a same-capacity cache memory using the set associative system. The embodiment in FIG. 15 solves the problem. In the case of the embodiment in PIG. 15, if the first cache memory 101 causes an error, the second cache memory 100 is searched. If it is hit, corresponding data is transferred from the second cache memory 100 to the first cache memory 101 through the interface 130. To enter data in the first cache memory, overflown data is entered in the second cache memory 100 through the interface 130. It is described in Norman P. Jouppi, "Improving Direct-Mapped Cache Performance by the Addition of a small Fully-Associative Cache and Prefetch Buffers," Proc. 17th Symp. on Camp. Arch., Settle, WA, pp. 364-373, May, 1990, that the above cache memory is called a victim cache memory which improves the hit ratio compared with a cache memory using the direct map system. The second embodiment in FIG. 15 makes it possible to improve the performance of a medium- of small-scale program by effectively using both the first cache memory 101 and the second cache memory 100. The present invention makes it possible to inexpensively improve the performance of a computer having a prefetch function for a cache memory about a medium- or small-scale program for reusing data stored in the cache memory and a large-scale program not for reusing data stored in the cache memory. Fig. 23 shows the second constitution of the first cache memory 101 in Fig. 2. The cache memory in Fig. 23 is a two-way set associative type cache memory that has a capacity of 1 megabytes and a block size of 16 bytes. Reference numerals 4101 and 4103 are address arrays; 4102 and 4104 are valid bits; 4105 and 4106 are data arrays; 4107 and 4108 are comparators; 4109 is an array selection memory ; 4110, 4112, 4113, 4114 and 4115 are AND gates; 4111 and 4116 are OR gates; and 4120 and 4122 are selectors. In the description that follows, the address array 4101, valid bit 4102 and data array 4105 are referred to collectively as an array 1; likewise the address array 4103, valid bit 4104 and data array 4106 are referred to collectively as an array 2. Under control of a control signal 123, the selector 4120 selects either transfer data 215 or write data 211 and sends its output 4130 to the data arrays 4105 and 4106. The first address array 4101 and valid bit 4102 are accessed using the low-order bit 130-1 of address 130. The comparator 4107 compares an address array output 4131 with the high-order bit 130-2 of address 130. When the AND gate 4114 senses that the output of the comparator 4107 and the valid bit 4132 are both asserted, the AND gate 4114 outputs a hit signal 4135 indicating a hit in the array 1. When a write signal 4137 to the array 1 is asserted, the first address array 4101 and valid bit 4102 fetch address 130-2 and set the corresponding valid bit. Similarly, the second address array 4103 and valid bit 4104 are accessed using the low-order bit 130-1 of address 130. The comparator 4108 compares an address array output 4133 with the high-order bit 130-2 of address 130. When the AND gate 4115 senses that the output of the comparator 4108 and the valid bit 4134 are both asserted, the AND gate 4115 outputs a hit signal 4136 indicating a hit in the array 2. When a write signal 4138 to the array 2 is asserted, the second address array 4103 and valid bit 4104 fetch address 130-2 and set the corresponding valid bit. The OR gate 4116 outputs a hit signal 113 when either the hit signal 4135 of the array 1 or the hit signal 4136 of the array 2 is asserted. The first data array 4105 is accessed using the low-order bit 130-1 of address 130. The data thus read out is placed onto a bus 4139. When the write signal 4137 to the array 1 is asserted, the output 4130 of the selector 4120 is written to the array 1. Likewise, the second data array 4106 is accessed using the low-order bit 130-1 of address 130. The data thus read out is placed onto a bus 4140. When the write signal 4138 to the array 2 is asserted, the output 4130 of the selector 4120 is written to the array 2. When the hit signal 4135 of the array 1 is asserted, the selector 4122 selects the output 4139 of the first data array; otherwise the selector 4122 selects the output 4140 of the second data array. The selected result is placed onto a data bus 112. When a write signal 122 is asserted, the array selection memory 4109 retains information about which of the arrays 1 and 2 has the data written thereto. The transfer data 215 from the main memory is written either to the array 2 if the preceding data was written to the array 1, or to the array 1 if the preceding data was written to the array 2. The write data 211 of the store instruction transferred from the instruction unit is written to either the array 1 or the array 2 in which a hit has been detected. In this case, the information retained in the array selection memory 4109 is ignored. What follows is a description of how the write signal 4137 to the array 1 and the write signal 4138 to the array 2 are generated. The array selection memory 4109 is accessed using the low-order bit 130-1 of address 130. The data thus read out is sent to the AND gate 4110. When the write signal 122 is asserted, the value of an array selection signal 4141 is written to the array selection memory 4109. When neither the hit signal 113 nor the output of the array selection memory 4109 is asserted, the AND gate 4110 outputs a control signal 4142. When either the hit signal 4135 of the array 1 or the control signal 4142 is asserted, the OR gate 4111 outputs the array selection signal 4141. The array selection signal 4141 indicates that the array 1 is selected for writing data thereto when asserted; the array selection signal 4141 indicates that the array 2 is selected for writing data thereto when not asserted. When both the write signal 122 and the array selection signal 4141 are asserted, the AND gate 4112 outputs the write signal 4137 to the array 1. Likewise, the AND gate 4113 outputs the write signal 4138 to the array 2 when the write signal 122 is asserted while the array selection signal 4141 is not asserted. The cache memory in Fig. 23, structured as a two-way set associative type, is more massive than the cache memory in Fig.ll but prevents the occurrence of block conflict. Thus the hit rate of the cache memory in Fig. 23 is higher than that of the cache memory in Fig. 11. Fig. 24 shows the second constitution of the second cache memory 100 in Fig. 2. The cache memory in Fig. 24 is a two-way set associative type cache memory that has a capacity of 2 kilobytes and a block size of 32 bytes. Reference numerals 4201 and 4203 are address arrays; 4202 and 4204 are valid bits; 4205 and 4206 are data arrays; 4207 and 4208 are comparators; 4209 is an array selection memory; 4210, 4211, 4212, 4213, 4214 and 4215 are AND gates; 4216 is an OR gate; 4217 is an inverting circuit; and 4222 is a selector. In the description that follows, the address array 4201, valid bit 4202 and data array 4205 are referred to collectively as an array 1; the address array 4203, valid bit 4204 and data array 4206 are referred to collectively as an array 2. The first address array 4201 and valid bit 4202 output the value of the address designated by the low-order bit 210-1 of read address 210. The comparator 4207 compares an address array output 4231 with the high-order bit 210-2 of address 210. When the AND gate 4214 senses that both the output of the comparator 4207 and a valid bit 4232 are asserted, the AND gate 4214 outputs a hit signal 4235 indicating a hit in the array 1. When a first write signal 4237 to the array 1 is asserted, the first address array 4201 and valid bit 4202 set the high-order bit 210-2 of read address 210 to the address designated by the low-order bit 210-1 of read address 210, and set the corresponding valid bit. When a second write signal 4239 to the array 1 is asserted, the high-order bit 216-2 of transfer address 216 is set to the address designated by the low-order bit 216-1 of transfer address 216, and the corresponding valid bit is set. Likewise, the second address array 4203 and valid bit 4204 output the value of the address designated by the low-order bit 210-1 of read address 210. The comparator 4208 compares an address array output 4233 with the high-order bit 210-2 of address 210. When the AND gate 4215 senses that the output of the comparator 4208 and the valid bit 4234 are both asserted, the AND gate 4215 outputs a hit signal 4236 indicating a hit in the array 2. When a first write signal 4238 to the array 2 is asserted, the second address array 4203 and valid bit 4204 set the high-order bit 210-2 of read address 210 to the address designated by the low-order bit 210-1 of read address 210, and set the corresponding valid bit. When a second write signal 4240 to the array 2 is asserted, the high-order bit 216-2 of transfer address 216 is set to the address designated by the low-order bit 216-1 of transfer address 216, and the corresponding valid bit is set. The OR gate 4216 outputs a hit signal 111 when either the hit signal 4235 of the array 1 or the hit signal 4236 of the array 2 is asserted. The first data array 4205 places onto a bus 4241 the data of the address designated by the low-order bit 210-1 of read address 210. When the first write signal 4237 to the array 1 is asserted, the write data 211 is written to the address designated by the low-order bit 210-1 of read address 210. When the second write signal 4239 to the array 1 is asserted, the transfer data 215 is written to the address designated by the low-order bit 216-1 of transfer address 216. Likewise, the first data array 4206 places onto a bus 4242 the data of the address designated by the low-order bit 210-1 of read address 210. When the first write signal 4238 to the array 2 is asserted, the write data 211 is written to the address designated by the low-order bit 210-1 of read address 210. When the write signal 4240 to the array 2 is asserted, the transfer data 215 is written to the address designated by the low-order bit 216-1 of transfer address 216. When the hit signal 4235 of the array 1 is asserted, the selector 4222 selects the output 4241 of the first data array; otherwise the selector 4222 selects the output 4242 of the second data array. The selected result is placed onto a data bus 110. When an entry request 124 or a write request 125 is asserted, the array selection memory 4209 retains information about which of the arrays 1 and 2 has the data written thereto. The transfer data 215 from the main memory is written either to the array 2 if the preceding data was written to the array 1, or to the array 1 if the preceding data was written to the array 2. The write data 211 of the store instruction transferred from the instruction unit is written to either the array 1 or the array 2 in which a hit has been detected. In this case, the information retained in the array selection memory 4209 is ignored. What follows is a description of how the write signals 4237 and 4239 to the array 1 and the write signals 4238 and 4240 to the array 2 are generated. The array selection memory 4209 supplies the inverting circuit 4217 with the data of the address designated by the low-order bit 216-1 of transfer address 216. When the write request 125 is asserted, the value of the hit signal 4235 for the array 1 is written to the address designated by the low-order bit 210-1 of read address 210. When the entry request 124 is asserted, the value of an array selection signal 4243 is written to the address designated by the low-order bit 216-1 of transfer address 216. The inverting circuit 4217 outputs the array selection signal 4243 when the output of the array selection memory 4209 is not asserted. The AND gate 4210 outputs the first write signal 4237 to the array 1 when both the write request 125 and the hit signal 4235 of the array 1 are asserted. The AND gate 4211 outputs the first write signal 4238 to the array 2 when the write request 125 is asserted while the hit signal 4235 of the array 1 is not asserted. Similarly, the AND gate 4212 outputs the second write signal 4239 to the array 1 when the entry request 124 and the array selection signal 4243 are both asserted. The AND gate 4213 outputs the second write signal 4240 to the array 2 when the entry request 124 is asserted while the array selection signal 4243 is not asserted. The cache memory in Fig. 24, being a two-way set associative type, is less massive than the full set associative type cache memory in Fig. 9 yet provides a greater capacity. The block size of as many as 32 bytes allows a large amount of data to be transferred at one time from the main memory. Thus when data of contiguous addresses are to be processed, an appreciably smaller number of prefetch instructions are needed to transfer a fixed quantity of data from the main memory to the second cache memory. This enhances data processing performance. Fig. 16 shows the general view of the second embodiment of the present invention. Of the components of the second embodiment in Fig. 16, those identical to their counterparts in the embodiment of Fig. 1 are given the same reference numerals. The second embodiment is characterized in that it has two address buses 3510 and 3513, and four data buses 3511, 3512, 3514 and 3515. This constitution allows two memory reference instructions to be processed in parallel. The second embodiment in Fig. 16 comprises an instruction unit 3501, a memory unit 3502 and a main memory 3503. The instruction unit 3501, a unit for executing instructions, comprises an instruction cache memory 3601, a memory interface 3602 and an arithmetic unit 3620. The instruction unit 3501 exchanges data with a first and a second cache memory 101 and 3490 over the buses 3510 through 3512 and 3513 through 3515. More specifically, the instruction unit 3501 sends addresses, data and control signals to the memory unit 3502 and main memory 3503 over the address buses 3510 and 3513, four-byte-wide write data buses 3511 and 3514, and a control signal line 3516. The memory unit 3502 is constituted by the first cache memory 101, the second cache memory 3490, selectors 104 and 3495 to input/output these data, and a control section comprising a control unit 3492. The first cache memory 101 is the same in constitution as the first cache memory of the first embodiment in Fig. 1; the first cache memory 101 is a one-port large-capacity cache memory. The second cache memory 3490 is a three-port small-capacity cache memory. The memory unit 3502 sends data and a wait signal to the instruction unit 3501 over the four-byte-wide read data buses 3512 and 3515 and via a wait signal line 3517, and transmits a request signal to the main memory 3503 over request signal lines 3523 and 3524. The main memory 3503 stores instructions and data, and transfers data over buses 3520 and 3521 to the first cache memory 101 and the second cache memory 3490. That is, the main memory 3503 sends data, addresses and a response signal to the memory unit 3502 over the transfer data bus 3520, transfer address bus 3521 and a response signal line 3522. The operation code of the instructions processed by the instruction unit 3501 in Fig. 16 is the same in format as the operation code shown in Fig. 12. The types of the instructions to be processed are the same as those listed in Fig. 13. Fig. 18 shows a constitution of the instruction unit 3501 in Fig. 16. In Fig. 18, reference numeral 3601 is an instruction cache memory; 3603 is a decoder; 3602 is a memory interface; 3605 is a register; 3606 is an ALU; and 3641 and 3642 are address adders. The instruction cache memory 3601 sends an instruction to the decoder 3603 and memory interface 3602 over a bus 3607. The decoder 3603 decodes the received instruction, and controls the register 3605, ALU 3606 and address adders 3641 and 3642 using a signal 3630. The ALU 3606 receives data from the register 3605 over buses 3612 and 3613, operates on the data, and writes the result of the operation to the register 3605 over a bus 3614. The first address adder 3641 receives data from the register 3605 over buses 3610 and 3611, performs an add operation on the data, and places onto the bus 3513 the result of the operation as the address for a load or a store operation. For a store operation, the data to be stored is read from the register 3605 and placed onto the bus 3514. For a load operation, the data that was read out is received via the bus 3515 and written to the register 3605. Likewise, the second address adder 3642 reads data from the register 3605 over the buses 3614 and 3615, performs an add operation on the data, and places onto the bus 3510 the result of the operation as the address for a load or a store operation. For a store operation, the data to be stored is read from the register 3605 and placed onto the bus 3511. For a load operation, the data that was read out is received over the bus 3512 and written to the register 3605. Upon execution of instructions LD, ST, PF1 and PF2, the memory interface 3602 outputs a control signal 3516 and receives a wait signal 3517. When the wait signal 3517 is set to 1, a signal 3608 is output to the decoder 3603 to halt the pipeline operation until the wait signal 3517 is brought to 0. Fig. 19 shows an illustration for explaining the pipeline operation in effect when the data processor in Fig. 18 executes instructions. In Fig. 19, IF represents an instruction fetch stage; D is a decode stage; E is an operation and address add stage; A is a cache access stage; W is a register write stage; R is a cache access retry stage; and X is a wait stage. When two load instructions (instructions 1 and 2) are to be processed in parallel, the instruction 1 causes the first and the second cache memory to be accessed concurrently in stage A whereas the instruction 2 causes the second cache memory alone to be accessed in stage A. Following a hit in the second cache memory, the instruction 1 causes the data read from the second cache memory to be written to the register in stage W. When there occurs a hit in the second cache memory, the instruction 2 causes the data read from the second cache memory to be written to the register in stage W. The instruction 3 causes the first and the second cache memory to be accessed concurrently in stage A, and the instruction 4 causes only the second cache memory to be accessed in stage A. Following a hit in the second cache memory, the instruction 3 causes the data read from the second cache memory to be written to the register in stage W. When there occurs a miss in the second cache memory, the instruction 4 causes the first cache memory to be accessed in stage R so as to write the read-out data to the register in stage W. Where instructions 5 and 6 are to be processed in parallel, the instruction 5 causes the first and the second cache memory to be accessed concurrently in stage A whereas the instruction 6 causes the second cache memory alone to be accessed in stage A. Following a hit in the first cache memory, the instruction 5 causes the data read from the first cache memory to be written to the register in stage W. When there occurs a hit in the second memory, the instruction 6 causes the data read from the second cache memory to be written to the register in stage W. Where instructions 7 and 8 are to be processed in parallel, the instruction 7 causes the first and the second cache memory to be accessed concurrently in stage A whereas the instruction 8 cases the second cache memory alone to be accessed. Following a hit in the first cache memory, the instruction 7 causes the data read from the first cache memory to be written to the register in stage W. When there occurs a miss in the second cache memory, the instruction 8 causes the first cache memory to be accessed in stage R so as to write the read-out data to the register in stage W. The pipeline operation upon execution of the store operation is the same as that upon execution of the load instruction. That is, the cache memories are checked in stage A or R for a hit. In case of a hit, the data is written to the applicable cache memory in stage A or R. As described, two memory reference instructions are processed in parallel when the second instruction attains a hit in the second cache memory. Thus if the PF2 instruction is used to transfer data to the second cache memory, two memory reference instructions are always carried out in parallel, whereby the processing performance is enhanced. Fig. 17 shows a constitution of the memory unit 3502 in Fig. 16. In Fig. 17, reference numeral 101 is a first cache memory; 3490 is a second cache memory; 102 is a four-entry prefetch queue; 3403 is a control circuit; and 104, 3540, 3542, 3531 and 3534 are selectors. The first cache memory 101 receives as its input an address 3430, transfer data 3520, a selector control signal 3423, a write signal 3422 and write data 3544; and outputs read data 3412 and a hit signal 3413. The second cache memory 3490 receives addresses 3510 and 3513, a transfer address 3521, transfer data 3520, an entry signal 3424, write signals 3425 and 3426, and write data 3511 and 3514; and outputs read data 3410 and 3512 and hit signals 3411 and 3481. The prefetch queue 102 receives a cache selection signal 3533, the transfer address 3521, an address 3530, a set signal 120 and a reset signal 121; and outputs a full signal 114, a hit signal 115 and a cache selection signal 116. The control circuit 3403 receives control signals 3516-3 and 3516-4 from the instruction unit; the full signal 114, hit signal 115 and cache selection signal 116 from the prefetch queue 102; the response signal 3522 from the main memory; the hit signals 3411 and 3481 from the second cache memory 3490; and the hit signal 3413 from the first cache memory. In turn, the control circuit 3403 outputs the wait signal 3517 to the instruction unit; the set signal 120, reset signal 121 and a selection signal 3532 to the prefetch queue 102; the request signals 3523 and 3524 to the main memory; the entry signal 3424 and write signals 3425 and 3526 to the second cache memory 3490; the write signal 3422 and selector control signal 3423 to the first cache memory 101; and the selector control signals 3423 and 3427 to the selectors 3540 and 3542. The selector 104 receives the data 3410 and hit signal 3411 from the second cache memory 3490, and the data 3412 and hit signal 3413 from the first cache memory 101. When the hit signal 3411 is asserted, the selector 104 reads and outputs the data 3410 that is placed onto the data bus 3515; when the hit signal 3413 is asserted, the selector 104 reads and outputs the data 3412 that is also placed onto the data bus 3515. Under control of the selector control signals 3423 and 3427, the selector 3540 selects one of address 3513, address 3510 and transfer address 3521. The selected address is sent as the selector output 3430 to the first cache memory 101. Under control of the selector control signal 3427, the selector 3542 selects either the write data 3514 or the write data 3511. The selected data is sent as the selector output 3544 to the first cache memory 101. The selector 3531, under control of the selection signal 3532, selects either address 3513 or address 3510. The selected address is sent as the selector output 3530 to the prefetch queue 102. The selector 3534, controlled by the selection signal 3532, selects either a set selection signal 3516-1 or a set selection signal 3516-2. The selected signal is sent as the selector output 3533 to the prefetch queue 102. Where the write signal 3422 designates a read operation from the first cache memory 101, the content of address 3430 is read from the first cache memory 101; the read data 3412 and the hit signal 3413 are output from the first cache memory 101. Where the write signal 3422 designates a write operation to the first cache memory 101, the transfer data 3520 is written to the first cache memory 101 if the selector control signal 3423 is 1, or the content of the write data 3544 is written to the first cache memory 101 if the selector control signal 3423 is 0. Where the write signal 3425 is negated to designate a read operation from the second cache memory 3490, the cache memory is searched for the content of address 3513. The data 3410 read out accordingly and the hit signal 3411 are then output from the second cache memory 3490. Where the write signal 3425 is asserted to designate a write operation to the second cache memory 3490, the cache memory is searched for a hit. In case of a hit, the content of the write data bus 3514 is written to the second cache memory 3490. Likewise, where the write signal 3426 is negated to designate a read operation from the second cache memory 3490, the second cache memory is searched for the content of address 3510. The data 3512 read out accordingly and the hit signal 3481 are then output from the second cache memory 3490. Where the write signal 3426 is asserted to designate a write operation to the second cache memory 3490, the second cache memory is searched for a hit. In case of a hit, the content of the write data bus 3511 is written to the second cache memory 3490. If the entry signal 3424 is asserted concurrently with the above operation, the transfer address 3521 paired with the transfer data 3520 is entered. The prefetch queue 102 is capable of retaining up to four entries of data addresses being transferred from the main memory. When the set signal 120 is asserted, address 3530 and the content of the cache selection signal 3533 are entered into the queue 102. Where the reset signal 121 is asserted, the cache selection signal 116 corresponding to the transfer address 3521 is output from the queue and the corresponding entry is invalidated. If comparing address 3530 with the internally retained addresses reveals that the corresponding entry is being transferred from the main memory, the hit signal 115 is asserted. If the retained addresses are valid for all entries, the full signal 114 indicating that state is asserted. Fig. 22 shows a constitution of the control circuit 3403 in Fig. 17. The control circuit 3403 decodes the control signal 3516-3 regarding the first instruction and the control signal 3516-4 regarding the second instruction, and accepts the start of any one of instructions LD, ST, PF1 and PF2. If the first instruction is LD and if the hit signal 3413 from the first cache memory and the first hit signal 3411 from the second cache memory are both negated, it means that a miss has occurred in both cache memories. In that case, the wait signal 4001 of the first instruction is asserted so that the instruction unit will wait while the data is being transferred from the main memory. If the first instruction is LD, PF1 or PF2, if the hit signal 3413 from the first cache memory and the first hit signal 3411 from the second cache memory are both negated, and if the hit signal 115 from the prefetch queue is negated but the full signal 114 therefrom is asserted, that means the prefetch queue is full and no more instruction can be placed into the queue. In that case, the wait signal 4001 of the first instruction is asserted so that the instruction unit will wait until the prefetch queue is vacated. If the first instruction is LD, PF1 or PF2, if the hit signal 3413 from the first cache memory and the first hit signal 3411 from the second cache memory are both negated, and if the hit signal 115 and full signal 114 from the prefetch queue are both negated, then the transfer request signal 3523 to the main memory is asserted. At the same time, the selection signal 3532 and set signal 120 to the prefetch queue are both asserted and the first instruction is entered into the prefetch queue. If the first instruction is ST and if the hit signal 3413 from the first cache memory is asserted, then the write signal 3422 to the first cache memory is asserted so that the corresponding data will be written to the first cache memory. Likewise, if the first instruction is ST and if the first hit signal 3411 from the second cache memory is asserted, then the first write signal 3425 to the second cache memory is asserted so that the corresponding data will be written to the second cache memory. If the second instruction is LD, ST, PF1 or PF2 and if the second hit signal 3481 from the second cache memory is negated, it is necessary to access the first cache memory in the next cycle. Thus the wait signal 4002 of the second instruction is asserted. Access to the first cache memory by the second instruction is accomplished after access to the cache memory by the first instruction has ended with the wait signal 4001 of the first instruction getting negated. An AND gate 4011 asserts a control signal 4003 when the wait signal 4001 of the first instruction is negated and the wait signal 4002 of the second instruction is asserted. A register 4012 asserts the selection signal 3427 to the first cache memory one cycle after the control signal 4003 is asserted. When the selection signal 3427 is 1, the first cache memory is accessed by the second instruction and the first instruction is kept from accessing any cache memory. If the second instruction is LD, if the selection signal 3427 to the first cache memory is asserted, and if the hit signal 3413 from the first cache memory is negated, that means a miss has occurred in both cache memories. In that case, the wait signal 4002 of the second instruction is asserted so that the instruction unit will wait while the data is being transferred from the main memory. If the second instruction is LD, PF1 or PF2, if the selection signal 3427 to the first cache memory is asserted, if the hit signal 3413 from the first cache memory is negated, and if the hit signal 115 from the prefetch queue is negated but the full signal 114 therefrom is asserted, that means the prefetch queue is full and no more instruction can be placed into the queue. In that case, the wait signal 4002 of the second instruction is asserted so that the instruction unit will wait until the prefetch queue is vacated. If the second instruction is LD, PF1 or PF2, if the selection signal 3427 to the first cache memory is asserted, if the hit signal 3413 from the first cache memory is negated, and the hit signal 115 and the full signal 114 from the prefetch queue are negated, then the transfer request signal 3523 to the main memory is asserted. At the same time, the set signal 120 to the prefetch queue is asserted and the second instruction is entered into the prefetch queue. If the second instruction is ST, if the selection signal 3427 to the first cache memory is asserted, and if the hit signal 3413 from the first cache memory is asserted, then the write signal 3422 to the first cache memory is asserted so that the applicable data will be written thereto. If the second instruction is ST and if the second hit signal 3481 from the second cache memory is asserted, then the second write signal 3426 to the second cache memory is asserted so that the applicable data will be written thereto. An OR gate 4013 asserts the wait signal 3517 to the instruction unit when either the wait signal 4001 of the first instruction or the wait signal 4002 of the second instruction is asserted. When the response signal 3522 from the main memory is asserted, the reset signal 121 to the prefetch queue is asserted so that the applicable entry will be reset from the prefetch queue 102. At the same time, a check is made on the cache selection signal 116 to see if the signal designates a write operation to the first cache memory. If the cache selection signal 116 is found to designate a write operation to the first cache memory, the write signal 3422 and selection signal 3423 to the first cache memory are asserted. If the cache selection signal 116 is found to designate a write operation to the second cache memory, the entry signal 3424 to the second cache memory is asserted. Fig. 20 shows a constitution of the second cache memory 3490 in Fig. 17. The cache memory of Fig. 20 is a full associative type cache memory having a block size of 4 bytes and a capacity of 256 bytes. In Fig. 20, reference numeral 3800 is a judging circuit, and 3801 through 3803 are cells that hold combinations of valid bits, addresses and data. The cells 3801 through 3803 receive the read addresses 3513 and 3510, the entry request 3424, the write data 3514 and 3511, and the write requests 3425 and 3426; in turn, the cells output the data 3410 and 3512. The cells 3801 through 3803 also output hit signals 3810 through 3812 and 3820 through 3822 to the judging circuit 3800. The cell 3801 receives the transfer address 3521 and transfer data 3520, and forwards address 3813 and data 3814 to the cell 3802. Likewise, the cell 3802 forwards address 3815 and data 3816. The last cell 3803 receives address 3817 and data 3818. The judging circuit 3800 asserts the hit signal 3411 if any one of the hit signals 3810 through 3812 from the cells 3801 trough 3803 is asserted. Similarly, the judging circuit 3800 asserts the hit signal 3481 if any one of the hit signals 3820 through 3822 from the cells 3801 through 3803 is asserted. The cell 3801 compares read address 3513 with the internally retained address. If the two addresses match and are found valid, the cell 3801 outputs the hit signal 3810 and places the internally retained applicable data onto a bus 3410. If the write request 3425 is asserted, the cell 3801 compares the internally retained address with address 3513. If the two addresses match and the valid bit is asserted, the cell 3801 fetches the content of the write data 3514. Likewise, the cell 3801 compares read address 3510 with the internally retained address. If the two addresses match and are found valid, the cell 3801 outputs the hit signal 3820 and places the internally retained applicable data onto a bus 3512. When the write request 3426 is asserted, the cell 3801 compares the internally retained address with address 3510. If the two addresses match and the valid bit is asserted, the cell 3801 fetches the content of the write data 3511. If the entry request 3424 is asserted in parallel with the above operation, the cell 3801 asserts its valid bit and fetches the transfer address 3521 and transfer data 3520. At this point, the cell 3802 fetches via the signals 3813 and 3814 the address and data that were retained by the cell 3801. That is, the cells 3801 through 3803 constitute an FIFO structure. Fig. 21 shows a constitution of the cell 3801 in Fig. 20. In Fig. 21, reference numerals 3900, 3901 and 3902 are registers that hold a valid bit, an address and data, respectively; 3904 and 3914 are comparators; 3905, 3906, 3915 and 3916 are AND gates; and 3903 and 3913 are tri-state buffers. The entry request 3424 is connected to the register 3900 that holds a valid bit, to the register 3901 that holds an address, and to the register 3902 that holds data. When the entry request 3424 is asserted, the valid bit 3900 is set, the register 3901 fetches the transfer address 3521, and the register 3902 fetches the transfer data 3520. The comparator 3904 compares address 3513 with the output 3813 of the address-holding register. When the output of the comparator 3904 and the valid bit are both asserted, the AND gate 3906 asserts the hit signal 3810 and opens the tri-state buffer 3903 to place the content of the data-holding register onto the data bus 3410. When the AND gate 3905 senses that the hit signal 3810 and the write request 3425 are both asserted, the AND gate 3905 asserts a signal 3908 to the data-holding register 3902 and causes the register 3902 to fetch the write data 3514. Likewise, the comparator 3914 compares address 3510 with the output 3813 of the address-holding register. When the output of the comparator 3914 and the valid bit are both asserted, the AND gate 3916 asserts the hit signal 3820 and opens the tri-state buffer 3913 to place the content of the data-holding register onto the data bus 3512. When the AND gate 3915 senses that the hit signal 3820 and the write request 3426 are both asserted, the AND gate 3915 asserts the signal 3918 to the data-holding register 3902 and causes the register 3902 to fetch the write data 3511. As described, the cache memory of Fig. 20 is a full associative type cache memory that processes in parallel the access by two memory reference instructions and the write operation of transfer data from the main memory. Although complicated structurally so as to implement such functions, the cache memory of Fig. 38 is reduced in overall size because of its capacity of as small as 256 bytes. This means that the cache memory can operate at high speed. Fig. 25 shows the general view of the third embodiment of the present invention. Of the components of the third embodiment in Fig. 25, those identical to their counterparts in the embodiment of Fig. 1 are given the same reference numerals. The third embodiment is characterized in that its memory unit 4402 has a register 4380 for holding information about the ST instruction. The arrangement allows a cache hit judgment on the ST instruction and a data write operation to be carried out in different machine cycles. This reduces the time required to process the ST instruction per machine cycle and boosts the operating frequency correspondingly. The third embodiment in Fig. 25 comprises an instruction unit 201, the memory unit 4402 and a main memory 203. The instruction unit 201 is the same in constitution as that of the embodiment in Fig. 1. The memory unit 4402 comprises a first cache memory 101, a second cache memory 4390, and a control section including selectors 104 and 4395 as well as a control unit 4392 for exchanging data with the first and the second cache memory. The first cache memory 101 is a single-port large-capacity cache memory which is the same in constitution as the first cache memory of the embodiment in Fig. 1. The second cache memory 4390 has three ports for parallel processing of access by a memory reference instruction, the writing of data by the ST instruction, and the writing of transfer data from the main memory. The memory unit 4402 sends data and a wait signal to the instruction unit 201 over a four-byte-wide read data bus 212 and a wait signal line 214, and transmits a request signal to the main memory 203 over a request signal line 218. The main memory 203 is the same in structure as the main memory of the embodiment in Fig. 1. The operation code of the instructions processed by the instruction unit 201 in Fig. 25 is the same in format as the operation code shown in Fig. 12. The types of the instructions to be processed are the same as those listed in Fig. 13. Figs. 27 (a), 27 (b), 27 (c) and 27 (d) show illustrations for explaining the pipeline operation in effect when the data processor of Fig. 25 executes instructions. In Figs. 27 (a) through 27 (d), IF represents an instruction fetch stage; D is a decode stage; E is an operation and address add stage; A is a cache access stage; W is a register write stage; R is a cache access retry stage; X is a wait stage; and S is an ST instruction data write stage. Unlike the pipeline operation in Fig. 4, the pipeline operation depicted in Figs. 27 (a) through 27 (d) has the writing of data by the ST instruction carried out not in stage A but in stage S. Referring now to Fig. 27 (a), instruction 1 gains access to both the first and the second cache memory simultaneously in stage A. Following a hit in the second cache memory, instruction 1 causes the applicable data to be written to the second cache memory in stage S. Instruction 2 accesses both the first and the second cache memory simultaneously in stage A. The reading of data from the second cache memory by instruction 2 is accomplished in the same cycle as that in which data is written to the second cache memory by instruction 1, whereas the second cache memory allows the reading of data by the LD instruction and the writing of data by the ST instruction to be processed in a single machine cycle. That is, the processing of instruction 2 is carried out without extra penalty. Following a hit in the second cache memory, instruction 2 causes the data read from the second cache memory to be written to the register in stage W. Referring to Fig. 27 (b), instruction 1 gains access to both the first and the second cache memory simultaneously in stage A. Following a hit in the second cache memory, instruction 1 causes the applicable data to be written to the second cache memory in stage S. Instruction 2 accesses the first and the second cache memory simultaneously in stage A. The reading of data from the second cache memory by instruction 2 is performed in the same cycle as that in which data is written to the second cache memory by instruction 1, whereas the second cache memory allows the reading of data by the LD instruction and the writing of data by the ST instruction to be processed in a single machine cycle. That is, the processing of instruction 2 is carried out without extra penalty. Following a hit in the first cache memory, instruction 2 causes the data read from the first cache memory to be written to the register in stage W. Referring now to Fig. 27 (c), instruction 1 gains access to the first and the second cache memory simultaneously in stage A. Following a hit in the first cache memory, instruction 1 causes the applicable data to be written to the first cache memory in stage S. Instruction 2 accesses the second cache memory alone in stage A. Because the reading of data from the first cache memory by instruction 2 cannot be performed in the same cycle as that in which data is written to the first cache memory by instruction 1, the first cache memory is not accessed in stage A. Following a hit in the second cache memory, instruction 2 causes the data read from the second cache memory to be written to the register in stage W without gaining access to the first cache memory. Referring to Fig. 27 (d), instruction 1 accesses the first and the second cache memory simultaneously in stage A. Following a hit in the first cache memory, instruction 1 causes the applicable data to be written to the first cache memory in stage S. Instruction 2 gains access only to the second cache memory in stage A. Because the reading of data from the first cache memory by instruction 2 cannot be performed in the same cycle as that in which data is written to the first cache memory by instruction 1, the first cache memory is not accessed in stage A. Following a miss in the second cache memory, instruction 2 accesses the first cache memory in stage R. With a hit taking place in the first cache memory as a result of access thereto in stage R, the data read from the first cache memory is written to the register in stage W. When the hit check of the ST instruction and the writing of data thereby are carried out in different stages, the amount of processing per stage is reduced and the processing speed is enhanced. When the ST instruction attains a hit in the second cache memory, the next LD instruction is executed without extra penalty. This means that if the PF2 instruction is used to transfer data to the second cache memory in advance, the processing is always carried out without extra penalty, whereby the performance is enhanced. Fig. 26 shows a constitution of the memory unit 4402 in Fig. 25. In Fig. 26, reference numeral 101 is a first cache memory, 4390 is a second cache memory, 102 is a four-entry prefetch queue, 4303 is a control circuit, 104 and 4440 are selectors, and 4431 and 4432 are registers. The first cache memory 101 receives address 4330, transfer data 215, a selector control signal 4323, a write signal 4322 and write data 4444; and outputs read data 3212 and a hit signal 4313. The second cache memory 4390 receives read address 210, a write address 4413, transfer address 216, transfer data 215, an entry signal 4324, a write signal 4325 and the write data 4444; and outputs a read data 4310 and a hit signal 4311. The prefetch queue 102 receives a cache selection signal 213-1, transfer address 216, address 210, a set signal 120 and a reset signal 121; and outputs a full signal 114, a hit signal 115 and a cache selection signal 116. The control circuit 4303 receives a control signal 213-2 from the instruction unit; the full signal 114, hit signal 115 and cache selection signal 116 from the prefetch queue 102; a response signal 217 from the main memory; the hit signal 4311 from the second cache memory 4390; and the hit signal 4313 from the first cache memory. In turn, the control circuit 4303 outputs a wait signal 214 to the instruction unit; the set signal 120 and reset signal 121 to the prefetch queue 102; a transfer request signal 218 to the main memory; the entry signal 4324 and write signal 4325 to the second cache memory 4390; the write signal 4322 and selector control signal 4323 to the first cache memory 101; and the selector control signals 4323 and 4327 to the selector 4440 respectively. The selector 104 receives the data 4310 and hit signal 4311 from the second cache memory, and the data 4312 and hit signal 4313 from the first cache memory 101. When the hit signal 4311 is asserted, the selector 104 reads and outputs the data 4310 that is placed onto a read data bus 212; when the hit signal 4313 is asserted, the selector 104 reads and outputs the data 4312 that is also placed onto the read data bus 212. The selector 4440, under control of the selector control signals 4323 and 4327, selects one of address 210, address 4413 and transfer address 216. The selected address is output as the selector output 4330 to the first cache memory 101. Where the write signal 4322 designates a read operation from the first cache memory 101, the content of address 4330 is read from the first cache memory 101. The read data 4312 is output along with the hit signal 4313. Where the write signal 4322 designates a write operation to the first cache memory 101, either the transfer data 215 is written thereto if the selector control signal 4323 is 1, or the content of the write data 4444 is written if the selector control signal 4323 is 0. The second cache memory 4390 is checked for the content of address 210. The data 4310 read out accordingly and the hit signal 4311 are then output from the second cache memory 4390. If the write signal 4325 is asserted to designate a write operation, the second cache memory 4390 is checked for the content of address 4413. In case of a hit, the content of the data bus 4444 is written to the second cache memory 4390. If the entry signal 4324 is asserted in parallel with the above operation, transfer address 216 paired with the transfer data 215 is entered into the second cache memory 4390. The operation of the prefetch queue 102 in Fig. 26 is the same as that of the prefetch queue 102 in Fig. 2. The register 4431 receives the write data 211 and places it onto the data bus 4444 in the next cycle. The register 4432 receives address 210 and places it onto the bus 4413 in the next cycle. Fig. 30 shows a constitution of the control circuit 4303 in Fig. 26. The control circuit 4303 decodes the control signal 213-2 to accept the start of any one of instructions LD, ST, PF1 and PF2. The control signal 4327 designates the writing of store data to the first cache memory. When the control signal 4327 is set to 1, the first cache memory cannot be accessed by any other instruction. If the control signal 4327 is set to 1, if the LD, ST, PF1 or PF2 instruction is being executed, and if the hit signal 4311 from the second cache memory is negated, then the wait signal 214 is asserted because of the need to access the first cache memory in the next cycle. If the control signal 4327 is set to 0, if the LD instruction is being executed, and if the hit signal 4313 from the first cache memory and the hit signal 4311 from the second cache memory are both negated, that means a miss in both cache memories. Thus the wait signal 214 is asserted so that the instruction unit will wait while data is being transferred from the main memory. If the control signal 4327 is set to 0, if the LD, PF1 or PF2 instruction is being executed, if the hit signal 4313 from the first cache memory and the hit signal 4311 from the second cache memory are both negated, and if the hit signal 115 from the prefetch queue is negated but the full signal 114 therefrom is asserted, that means the prefetch queue is full and no more instruction can be placed into the queue. In that case, the wait signal 214 is asserted so that the instruction unit will wait until the prefetch queue is vacated. If the control signal 4327 is set to 0, if the LD, PF1 or PF2 instruction is being executed, if the hit signal 4313 from the first cache memory and the hit signal 4311 from the second cache memory are both negated, and if the hit signal 115 and full signal 114 from the prefetch queue are both negated, then the transfer request signal 218 to the main memory is asserted. At the same time, the set signal 120 to the prefetch queue is asserted and an entry is made into the prefetch queue. If the control signal 4327 is set to 0, if the ST instruction is being executed, and if the hit signal 4313 from the first cache memory is asserted, then a control signal 4801 is asserted. When the control signal 4801 is asserted, a register 4811 asserts the control signal 4327 in the next cycle. When the control signal 4327 is asserted, an OR gate 4813 asserts the write signal 4322 to the first cache memory. This causes store data to be written to the first cache memory. Likewise, if the hit signal 4311 from the second cache memory is asserted during execution of the ST instruction, a control signal 4802 is asserted. With the control signal 4802 asserted, the register 4812 asserts the write signal 4325 to the second cache memory in the next cycle. This causes store data to be written to the second cache memory. When the response signal 217 from the main memory is asserted, the reset signal 121 to the prefetch queue 102 is asserted so that the applicable entry will be reset from the queue. At the same time, a check is made on the cache selection signal 116 to see if it designates a write operation to the first cache memory. If the cache selection signal 116 is found to designate a write operation to the first cache memory, then the write signal 4322 and selection signal 4323 to the first cache memory are asserted. If the cache selection signal 116 is found to designate a write operation to the second cache memory, then the entry signal 4324 to the second cache memory is asserted. The transfer data is then entered into the selected cache memory. Fig. 28 shows a constitution of the second cache memory 4390 in Fig. 26. The cache memory in Fig. 28 is a full associative type cache memory that has a block size of 4 bytes and a capacity of 256 bytes. In Fig. 28, reference numeral 4600 is a judging circuit, and 4601 through 4603 are cells that hold combinations of valid bits, addresses and data. The cells 4601 through 4603 receive read address 210, write address 4413, the entry request 4324, the write data 4444 and write request 4325; and outputs the data 4310. In addition, the cells 4601 through 4603 send hit signals 4610 through 4612 respectively to the judging circuit 4600. The cell 4601 receives transfer address 216 and the transfer data 215, and outputs address 4613 and data 4614 to the cell 4602. Likewise, the cell 4602 sends address 4615 and data 4616 to the next cell. The last cell 4612 receives address 4617 and data 4618. When any one of the hit signals 4610 through 4612 is asserted, the judging circuit 4600 asserts the hit signal 4311. The cell 4601 compares read address 210 with the internally retained address. If the two addresses match and are found valid, the cell 4601 outputs the hit signal 4610 and places the internally retained corresponding data onto a bus 4310. If the write request 4325 is asserted, the cell 4601 compares write address 4413 with the internally retained address. If the two addresses match and the valid bit is asserted, the cell 4601 fetches the content of the write data 4444. If the entry request 4324 is asserted in parallel with the above operation, the cell 4601 asserts its valid bit and fetches transfer address 216 and the transfer data 215. At this point, the cell 4602 fetches via the signals 4613 and 4614 the address and data which are retained in the cell 4601. That is, the cells 4601 through 4603 constitute an FIFO structure. Fig. 29 shows a constitution of the cell 4601 in Fig. 28. In Fig. 29, reference numerals 4700, 4701 and 4702 are registers that hold a valid bit, an address and data, respectively; 4704 and 4714 are comparators; 4706, 4715 and 4716 are AND gates; and 4703 is a tri-stage buffer. The entry request 4324 is connected to the register 4700 that holds a valid bit, to the register 4701 that holds an address and to the register 4702 that retains data. When the entry request 4324 is asserted, the valid bit 4700 is set, the address-holding register 4701 fetches transfer address 216, and the data-holding register 4702 fetches transfer data 215. The comparator 4704 compares read address 210 with the output 4613 of the address-holding register. If the output of the comparator 4704 and the valid bit are both asserted, then the AND gate 4706 asserts the hit signal 4610 and opens the tri-state buffer 4703 to place the content of the data-holding register onto the data bus 4310. Meanwhile, the comparator 4714 compares write address 4413 with the output 4613 of the address-holding register. If the output of the comparator 4714 and the valid bit are both asserted, the AND gate 4716 asserts a hit signal 4720. When the hit signal 4720 and write request 4325 are both asserted, the AND gate 4715 asserts a signal 4718 to the data-holding register 4702 to place the write data 4444 into the data-holding register 4702. As described, the cache memory of Fig. 28 is a full associative type cache memory that processes in parallel the access by memory reference instructions, the writing of data by the ST instruction and the writing of transfer data from the main memory. Although complicated structurally so as to implement such functions, the cache memory of Fig. 28 is reduced in overall size because of its capacity of as small as 256 bytes. This means that the cache memory can operate at high speed.

Claims: A data processor comprising: (a) a main memory (203) storing data and instructions; (b) an instruction processor (201) for processing the data in accordance with the instructions; (c) a cache memory part storing only data and connected between the main memory and the instruction processor, wherein the cache memory part includes a first cache memory (101) and a second cache memory (100) having a storage capacity less than or equal to the storage capacity of the first cache memory; characterised in that : the first cache memory (101) has one port, the second cache memory (100) has two or more ports, and the data processor further comprises: (d) a controller (1600,104), included in the cache memory part, for receiving information for indicating instruction to be executed and address from the instruction processor, and for selecting one of the first and second cache memories based on the information and address, and storing data into the selected cache memory; and (e) the controller being arranged to control either the first cache memory or the second cache memory to store data thereinto, with data of high access frequency being stored into the first cache memory (101) and data of low access frequency being stored into the second cache memory (100). A data processor according to claim 1, wherein said first cache memory (101) is a direct mapped cache memory. A data processor according to claim 1, wherein said second cache memory (100) is a fully associative cache memory. A data processor according to claim 1, wherein said second cache memory (100) is arranged to execute in one machine cycle both the transfer of data from said main memory (203) and the referencing to data in said second cache memory (100) as designated by said instruction processor (201). A data processor according to claim 1, wherein said controller includes a prefetch queue and a control processor (1600), said prefetch queue retaining at least one address of the data being transferred from said main memory (203), said control processor (1600) being arranged to control data access to either said first cache memory or said second cache memory based on the retained address. A data processor according to claim 5, wherein said prefetch queue is arranged to retain write information for designating the writing of prefetched data to one of said first cache memory (101) and said second cache memory (100).

Inventors: HOTTA TAKASHI, KURIHARA TOSHIHIKO, OSUMI AKIYOSHI, SAITO KOJI, SAWAMOTO HIDEO, SHIMAMURA KOTARO, TANAKA SHIGEYA, HOTTA, TAKASHI, KURIHARA, TOSHIHIKO, OSUMI, AKIYOSHI, SAITO, KOJI, SAWAMOTO, HIDEO, SHIMAMURA, KOTARO, TANAKA, SHIGEYA
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1994
Main classification: G06F12
IPC codes: G06F12