WO2001004760A1 - Memory controller - Google Patents

Memory controller Download PDF

Info

Publication number
WO2001004760A1
WO2001004760A1 PCT/JP1999/003669 JP9903669W WO0104760A1 WO 2001004760 A1 WO2001004760 A1 WO 2001004760A1 JP 9903669 W JP9903669 W JP 9903669W WO 0104760 A1 WO0104760 A1 WO 0104760A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
prefetch
data
state
access
Prior art date
Application number
PCT/JP1999/003669
Other languages
French (fr)
Japanese (ja)
Inventor
Shin Kokura
Kenichi Kurosawa
Hidehito Takewa
Shuji Ishikura
Koji Matsuda
Original Assignee
Hitachi, Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi, Ltd. filed Critical Hitachi, Ltd.
Priority to PCT/JP1999/003669 priority Critical patent/WO2001004760A1/en
Priority to JP2001510096A priority patent/JP3956698B2/en
Publication of WO2001004760A1 publication Critical patent/WO2001004760A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0215Addressing or allocation; Relocation with look ahead addressing means

Definitions

  • the present invention relates to a data processing device, and more particularly to a prefetch control of a memory control device that performs a prefetch from a memory.
  • cache memory In the field of computers, general programs tend to reuse data that has been accessed once, and also tend to refer to data that is near data that has been accessed once. These tendencies are called local references.
  • a high-speed memory called cache memory is placed between the CPU and the memory in order to reduce the latency of memory access by utilizing this local referability.
  • This cache memory has a copy of the recently accessed memory, and instead of accessing the memory, accesses the cache memory, which is faster than the memory, to reduce the latency of memory access. We are working to reduce this and improve processing performance.
  • the cache controller that manages the cache memory manages the validity and invalidity of the contents stored in the cache memory in units of n times the data size processed by the CPU.
  • a unit that manages this cache memory is called a cache line. In the case of a 32-bit architecture CPU, this cache line is n times 4 bytes, usually 16, 32, 64, and 128 kb. .
  • the transfer from the memory to the cache memory performed by the cache controller is a management unit. This is done on a cache line basis.
  • a DRAM or a synchronous DRAM is used in a memory.
  • storage elements are arranged in a grid, and each storage element is accessed by designating a row and a column. Do In these memories, the access time for different columns in the same row is shorter than the access time for specifying a row and then specifying a column.
  • a method of successively accessing storage elements in different columns in the same row is called page mode access, and in the case of synchronous DRAM, it is called burst mode access.
  • the case where instructions and data necessary for processing by the CPU do not exist in the cache memory is called a cache miss.
  • the cache controller continuously reads data of the cache line size from the memory. This read operation is called a cache fill operation.
  • the memory controller assumes that when a read access from the CPU to the memory occurs, a cache miss occurs and a cache file operation occurs, and the memory controller performs a page mode or a burst mode. Data is read ahead of time. The read data is stored in a buffer in the memory controller. This operation is called prefetch.
  • Japanese Patent Application Laid-Open No. H10-55307 a CPU generates a control signal indicating whether a request for a memory is a request for an instruction or a request for data.
  • a prefetch logic circuit that determines the amount of data to be prefetched from the memory to the cache memory according to this control signal, unnecessary memory access is reduced and the efficiency of the memory system is reduced. Has been improved.
  • Japanese Patent Application Laid-Open No. 5-2717163 discloses a technique for efficiently using a cache by controlling the replacement of data once prefetched in a cache memory. I have.
  • Japanese Unexamined Patent Publication No. Hei 10-55307 discloses a method of prefetching data from memory due to the difference between memory access to instructions (instruction fetch) and memory access to data (data fetch). By changing the amount, the efficiency of the memory system is improved.
  • the re-fetch is controlled by a control signal indicating whether it is a request for an instruction or a request for data.
  • Very high possibility of continuous access like data used for array or matrix operation, and passing data that is effective to prefetch and data with IZ0 or other CPU
  • An object of the present invention is to prefetch data from a memory in accordance with how data is used. It is to improve the efficiency of the memory system by making it possible to change the amount of data to be touched. Disclosure of the invention
  • the memory address space is divided into a plurality of areas, and a mode register that determines whether or not the memory controller performs prefetching for each of the divided areas is provided to the memory controller.
  • a mode register that determines whether or not the memory controller performs prefetching for each of the divided areas is provided to the memory controller.
  • the memory controller operates the prefetch function for each area including the address of the memory accessed by the CPU, and accesses data from the memory.
  • FIG. 1 is a block diagram showing a configuration of a data processing device according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing a configuration of a prefetch state management unit.
  • FIG. 3 is a timing chart showing the operation of the computer according to the embodiment of the present invention. It is a gujaat.
  • FIG. 4 is a diagram showing a state transition of the state management unit.
  • FIG. 5 is a state transition diagram showing the operation of the memory sequencer.
  • FIG. 6 is a configuration diagram of a computer having a function of setting a mode register.
  • FIG. 7 is a configuration diagram of the access monitoring unit.
  • FIG. 8 is a diagram showing a state transition of a continuous access determination logic.
  • FIG. 1 is a block diagram showing the configuration of a portion related to memory control of a data processing device, such as a computer or a programmable controller to which the present invention is applied, according to an embodiment of the present invention.
  • the CPU 1 has a cache memory 20 composed of a memory that can be accessed at high speed. A copy of the contents of DRAM 7 is stored in cache memory 20, but no distinction is made between instructions and data.
  • CPU 1 has a 32-bit architecture, and has an address bus ADDR, a 4-byte data bus DAT, a bus start signal BS- indicating the start of the bus, and an access space.
  • the DRAM 7 is a DRAM that can be accessed in the page mode, and has a row address select signal RAS and a column address select signal. It has a function to output read data corresponding to the row address and column address output to the address bus A to the 4-byte data bus D by the CAS— operation.
  • the memory controller 2 includes a prefetch state management unit 5, a memory sequencer 4, a prefetch buffer 6, and a selector 11.
  • the CPU 1 reads data from the DRAM 7 via the memory controller 2 when an instruction or data necessary for processing is not present in the cache memory 20.
  • the bus start signal B S— is asserted for one cycle.
  • the address storing the instruction data necessary for processing is output to the address signal ADDR.
  • one of the chip select signals CS0—, CS1— and CS2— indicating the address area of the memory where the instruction data is stored is asserted.
  • the bus start signal B S- and the chip select signals C S0—, C S1—, and C S2— are input to the prefetch state management unit 5 of the memory controller 2.
  • the prefetch state management unit 5 prefetches data from the DRAM 7 to an address area corresponding to each of the chip select signals CS0_, CS1, and CS2—.
  • a mode register 8 is provided to control the two modes of whether or not. That is, in the present embodiment, the unit of the area for controlling the prefetch is for each chip select space.
  • the prefetch state management unit 5 controls the memory sequencer 4, the prefetch buffer 6, and the output selector 11 according to the value of the mode register 8. From the prefetch state management unit 5, a start signal REQ to the memory sequencer 4 and a prefetch access indicating whether the memory access requested by the start signal REQ is a prefetch access or not. Signal PRF is output Is forced. Also, a data valid signal DV indicating that valid data is being output from the DRAM 7 to the data bus D is input.
  • the memory sequencer 4 controls the row address select signal RAS— and the column address select signal CAS— in accordance with the start signal REQ and the prefetch access signal PRF from the prefetch state management unit 5, and Control to read data from DRAM7.
  • the memory sequencer 4 includes a row / column address generator 51.
  • the row / column address generator 51 generates a row address and a column address according to the address ADDR from the CPU 1, and outputs a row address select signal RAS— and a column address select signal output from the memory sequencer 4.
  • the row and column addresses are output to address bus A in synchronization with the control timing of the control signal CAS—.
  • the prefetch state management unit 5 includes a prefetch buffer data set signal PBSET for setting data in the prefetch buffer 6 and an output selector selection signal OPSEL for selecting an output of the output selector 11.
  • the prefetch buffer 6 is composed of four-stage buffers for storing data to be read ahead in one prefetch.
  • one prefetch prefetches cache line data, which is the number of data stored in one entry of the cache 20.
  • One cache line is 16 notes, equivalent to four 32 bits (four bytes) of data. Accordingly, one stage of 32-bit data is stored in each stage of the prefetch buffer.
  • the prefetch state management unit 5 has a function of setting the data output from the DRAM 7 to the data bus D to the buffer of an arbitrary stage in accordance with the value of the prefetch buffer data set signal PBSET. It has. Specifically, when the prefetch buffer data set signal PBSET is 0, the data output from the DRAM 7 is set in the first-stage buffer, and when the signal PBSET is 1, The data output by DRAM 7 is set in the second-stage buffer, and when the signal PBSET is 2, the data output by DRAM 7 is set in the third buffer, and the signal PBSET is output. In the case of 3, the data output from DRAM7 is set in the fourth buffer. All data stored in all buffers are output to the output selector 11.
  • the output selector 11 selects the data output by the DRAM 7 and the data output by the prefetch buffer 6 according to the value of the output selector selection signal OPSEL, and outputs the selected data to the processor data bus DAT. Specifically, when the signal OPSEL is 0, the first stage of the prefetcher buffer 6 is output to the processor data bus DAT, and when the signal OPSEL is 1, the second stage buffer and signal are output. When the OPSEL power is 2, the third buffer and when the signal OPSEL is 3, the value of the fourth buffer is output to the processor data bus DAT.
  • data is classified into the following two types. One is very likely to be accessed continuously, such as data used for array or matrix operations, and the data that can be prefetched is effective. Data that cannot be used by the cache memory because data is transferred to and from ZO, or data that requires unnecessary memory access frequently if prefetching is performed because the size of the data to be processed is small. You. Such a classification is to be performed in advance by a program creator when a program is created. Then, when compiling and linking the program, the area of DRAM 7 that stores valid data to be prefetched and the unnecessary access when prefetching is performed. The area of DRAM 7 that stores data that frequently occurs is placed in a different chip select space. Instructions are placed in areas that store data that is valid for prefetching.
  • the mode register 8 corresponding to the chip selector signal indicating the area where prefetch valid data is stored is set to the prefetch accessible mode, and the prefetch is performed.
  • the means for setting the value of the mode register 8 is not particularly shown, but is performed by access from CPU 1 to a specific address in the register space determined by hardware.
  • the mode register 8 may be provided independently for each chip select space as many as the number of chip select signals or in the form of a register file.
  • a circuit capable of storing a 1-bit state may be provided for each chip select space, as long as it is possible to identify whether or not the pre-fetch is possible for each chip space. However, in the following description, at least chip select is required. The explanation is made by associating the chip select space with each bit of one register having the bit width of the number of signals. Then, by examining the value 0Z1 of each bit of the mode register 8, it is determined whether or not the prefetch can be performed at the time of access in the corresponding chip select space.
  • FIG. 2 is a block diagram showing a configuration of the prefetch state management unit 5.
  • the prefetch state management unit 5 includes a state management unit 52, a buffer management unit 53, an access determination unit 56, a mode register 8, a comparator 54, and an address buffer 55.
  • the access determination unit 56 receives the chip select signals CS 0—, CS 1—, and CS 2— output from the CPU 1 and the value of the mode register 8 as inputs, and outputs the prefetch availability determination result signal JUG. Output.
  • the prefetch enable / disable determination result signal JUG is a logical product of the chip select signals CS0—, CS1—, and CS2—and the set value of the mode register 8 corresponding to each chip select signal. And the logical sum of the results.
  • the prefetch enable / disable judgment result signal JUG indicates whether the memory area indicated by the currently asserted chip select signal is set to enable prefetch or disable prefetch. This signal is asserted if prefetching is possible, or negated if prefetching is disabled.
  • the address buffer 55 holds the value of the address bus ADDR of the CPU 1 when the address buffer set signal ABSET from the state management unit 52 is asserted.
  • the comparator 54 compares the value of the address bus 55 with the address bus ADDR of the CPU 1, and compares the value of the address buffer 55 with the value of the address bus ADDR of the CPU 1 with the lower 4 bits. Asserts the comparison result signal HIT if the values except the bits match, or negates if they do not match.
  • the value to be compared except for the lower 4 bits is the data force 16 bits that are prefetched at a time, and the address is within the range of the lower 4 bits.
  • the state management unit 52 includes a bus start signal BS— which is an output signal of the CPU 1, a prefetch determination result signal JUG which is a determination result of the access determination unit 56, and a data validator from the memory sequencer 4. This is a state transition block in which the internal state transitions when the input signal DV is input.
  • the state management unit 52 outputs a start signal REQ, a prefetch access signal PRF, an address buffer set signal ABSET and a wait signal WAIT— according to the transition of the internal state, and furthermore, the state management. Outputs the internal state of section 52 to status signal ST.
  • FIG. 4 shows a state transition diagram of the state management unit 52.
  • the state 100 is a state indicating that the data stored in the prefetch buffer 6 in FIG. 1 is invalid.
  • State 101 is a wait state in which the start of prefetch is instructed by the prefetch access signal PRF and the first data is ready.
  • state 102 is a state in which prefetching has been started and the second data is being waited for.
  • states 103 and 104 are states in which the third and fourth data are being waited for, respectively. In the present embodiment, since four data are pre-read by one prefetch, there are four states in which each data is temporarily waited until it is ready.
  • the state 106 is a state indicating that prefetching has been started and four valid data have been stored in the prefetch buffer 6.
  • the state 105 is a single access state indicating that only the data requested by the CPU is accessed without executing the prefetch access. Therefore, the activation signal REQ is asserted in the states 101, 102, 103, 104 and 105, and the prefetch access signal PRF is set in the states 101, 102, 1 Asserted at 0 3, 104, and transmitted to memory sequencer 4.
  • state 100 When transitioning from state 106 to state 105, state 106 to state 101, and from state 106 to state 105, that is, instructing the start of prefetch or single-shot access At this time, the address buffer set signal ABSET is asserted, and the address buffer 55 holds the value of the address bus ADDR of CPU 1.
  • state 10 ⁇ 108 is an internal state indicating a request state from the CPU.
  • State 107 is a state in which an access request from the CPU can be accepted.
  • State 108 is a state in which the data requested by the CPU is not ready, and thus the CPU is waiting for data.
  • WAIT Eight signal WAIT— is asserted at the time of transition from state 107 to state 108 and at state 108, and is reported to CPU1.
  • the initial state of the state management unit 52 is such that there is no access request from the CPU 1, there is no prefetched data, and the access request from the CPU 1 can be accepted at any time. It is in state 100 and state 107.
  • the transition condition for transition from state 1001 to state 101 is that bus start signal BS— is asserted and prefetching is performed. That is, the judgment result signal JUG is asserted.
  • this is a case where an access request from the CPU 1 is generated and the value of the mode register 8 corresponding to the chip selector space including the address specified by the access indicates a state in which prefetching is performed.
  • the transition condition from the state 100 to the state 105 is that the bus start signal BS— is asserted and the prefetch availability judgment result signal JUG is negated. is there.
  • State from state 101 to state 102, state from state 102 The conditions for transition from state 103, state 103 to state 104, state 104 to state 106, and state 105 to state 100 are as follows.
  • Signal DV is asserted. That is, the data from the memory output for each data request becomes valid.
  • the transition condition from the state 106 to the state 101 is that the bus start signal BS— is asserted or the state 108, the comparison result signal HI HI is negated, and the pre- Switch enable / disable determination result signal JUG is asserted. That is, an access from CPU 1 occurs, and the address range of the address previously read ahead stored in address buffer 55 does not overlap with the address of the next access, and This is the case when the access is to an area that performs prefetching.
  • the transition condition from the state 106 to the state 105 is that the bus start signal BS— is asserted or the state 108, and the prefetch availability judgment result signal JUG is negative.
  • the transition condition for transition from state 100 to state 105 in which an access from CPU1 occurs and the access is to an area where prefetching is not performed.
  • the transition conditions from the state 107 to the state 108 are as follows: 1) The bus start signal BS- is an assert and the prefetch availability judgment result signal JUG is a negative, or 2) The comparison result signal HIT of the comparator 54 is asserted and the pref X switch enable / disable judgment result signal JUG is asserted, and any of the states 101, 102, 103, 104 If it is determined that the data to be read is not set in the prefetch buffer 6 according to the ADDR of the CPU 1 and the current state, either of the above is true. Whether the data to be read by the CPU 1 is set in the prefetch buffer 6 is determined by, for example, the address buffer 55 if the internal state is state 102.
  • the address indicated by the address buffer 55 and the value stored next to the address indicated by the address buffer 55 are both prefetch buffers. It can be determined based on whether or not it has already been set to 6.
  • the other states can be similarly determined.
  • the condition for transition from the state 108 to the state 107 is that necessary data is set in the prefetch buffer 6 or the data knowledge signal DV is asserted in the state 105.
  • the buffer management unit 53 includes a state signal ST indicating the internal state of the state management unit 52, the lower 4 bits of the address bus ADDR from the CPU 1, and the comparison result signal HIT of the comparator 54.
  • the signal OPSEL has four values from 0 to 3 corresponding to the number of data of one cache line to be read ahead by prefetching, and outputs 0 when the signal HIT is negated. When the signal HIT is asserted, the result of decoding the lower 4 bits of the address bus ADDR is output.
  • the prefetch buffer set signal PBSET also has four values from 0 to 3, and the state management unit 52 is in the state 102 in FIG. 4 according to the value of the state signal ST. 1 if the state management unit 52 is in the state 103 in FIG. 4, 2 if the state management unit 52 is in the state 104 in FIG. 4, and otherwise. Asserts 0 in the state of.
  • FIG. 5 shows the operation of the memory sequencer 4 as a state transition diagram.
  • the state 110 is the idle state, and the prefetch state management unit 5 It indicates the state of waiting for the start signal REQ from.
  • State 1 1 1 1 indicates a row address access state, in which the RAS address of DRAM 7 corresponding to the address accessed from CPU 1 is output to address bus A, and row address select signal RAS -Is asserted.
  • State 1 1 2 indicates the first column address access state, in which the DRAM 7 CAS address corresponding to the address accessed from CPU 1 is output to address bus A, and the column address select signal is output. CAS— is asserted.
  • States 113, 111, and 115 indicate the second, third, and fourth row address access states that are performed prior to the prefetch, respectively.
  • the initial state of the memory sequencer 4 is state 110.
  • the transition condition from state 110 to state 111 is the assertion of the activation signal REQ. This starts access to DRAM 7.
  • the transition conditions for transitioning from state 1 1 1, state 1 1 2, state 1 1 3, state 1 1 4, state 1 15 to the next state are determined by the DRAM 7 access time, and the DRAM 7 access time Each time elapses, the state transits to the next state.
  • state 112 when the access time of DRAM 7 elapses, the state transits from state 112 to state 113 if the prefetch access signal PRF is asserted, and if it is negated. Transition from state 1 1 2 to state 1 110 is made. That is, after one data is accessed from the DRAM 7, if the prefetch is specified, the CAS address of the data to be prefetched is continuously output under the same RAS address, and One cache line of data will be accessed continuously.
  • FIG. 3 is a timing chart showing the operation of the memory controller 2 shown in FIG.
  • the CPU 1 and the memory controller 2 shown in FIG. 1 operate in synchronization with a clock signal CLK not shown in FIG. 1, and are selected by CS 0— of the CPU 1.
  • the area corresponding to the address space of the DRAM chip (hereinafter referred to as the CS0_ area; the same applies to other areas) is the prefetch disabled mode, and the CS1 area is the prefetch area. It is assumed that the switchable mode is set.
  • CPU 1 shall access address ADDR 1 in the CS 0— area.
  • BS_, CS 0— is asserted, and the address ADDR 1 is output to ADDR.
  • the prefetch state management unit 5 of the memory controller 2 asserts WAIT—until the data of ADDR1 is ready, that is, until the data is determined on the data bus DAT.
  • REQ is asserted to the memory sequencer 4 to notify the occurrence of access.
  • the prefetch access signal PRF is not asserted because the CSO area is set to the prefetch disable mode.
  • the memory sequencer 4 outputs the row address R1 corresponding to the address ADDR1 accessed from the CPU 1 to the address bus A, and asserts RAS—.
  • the column address C1 of ADDR1 is output to address node A, and CAS— is asserted to determine the access address to DRAM 7.
  • the DRAM 7 outputs the data D1 corresponding to ADDR1 to the memory data bus D. Therefore, the memory sequencer 4 asserts the data read signal DV to the fetch state manager 6 at the timing when the data D1 is output to the memory data bus D.
  • the prefetch state management unit 5 negates the wait signal WAIT.
  • selects the selector. 11 outputs the data D 1 output to the memory data bus D to the processor data node DAT of the CPU 1.
  • CPU 1 accesses the address ADDR5 of the CS1-region. Since the CS1—area is set in the prefetch enabled mode, the prefetch state management unit 5 asserts PRF.
  • the memory sequencer 4 outputs the row address R5 corresponding to the address ADDR5 to the address bus A, and asserts RAS—.
  • RAS— the address address
  • a column address C5 corresponding to ADDR5 is output and CAS— is asserted.
  • C6, C7, and C8 are continuously output to the address bus A, and CAS— is also asserted in response to the output of each column address. Repeat the steps in the same way.
  • the column address C 6 is a value obtained by adding 1 to the column address C 5
  • C 7 is obtained by adding 1 to C 6
  • C 8 is obtained by adding 1 to C 7.
  • the data corresponding to the row address R5 and the column address C5 is D5
  • the data corresponding to the row address R5 and the column address C6 is D6, and the row address is D5.
  • the data corresponding to R5 and column address C7 is D7
  • the data corresponding to row address R5 and column address C8 is D8. Then, these data D5 to D8 are continuously output to the memory data bus D.
  • the CS1 area it is possible to set the CS1 area to the prefetchable mode, and the instructions and data stored in the CS1 area can be accessed continuously like data used for array or matrix operations. If the fetch is very large and prefetching is a valid data or instruction, then access to ADDR5 followed by ADDR6 is likely to occur.
  • the row address of ADDR6 is R5, and the column address is C6.
  • the data corresponding to ADDR 6 is D6, and if CPU 1 next accesses ADDR 6, Since this data has already been read from the DRAM 7 and stored in the prefetch buffer 6, it is possible to output D6 to the processor data bus without asserting the wait signal WAIT— to the CPU 1. And become possible.
  • DRAM7 is idle between the time when D1 is output to the memory data bus D and the time when D5 is output. State. In other words, there is no additional unnecessary memory access, which increases the efficiency of DRAM 7 and increases the data processing capacity of the entire system.
  • the chip select signal has been used to identify, when the DRAM 7 is divided into a predetermined area, the access from the CPU 1 to the divided area.
  • the chip select signal may be used in its original sense to distinguish the DRAM chip itself that constitutes the memory. In this case, execution / non-execution of prefetch is controlled for each memory chip. This makes it possible to control the prefetch according to the re-memory configuration.
  • FIG. 6 shows an embodiment provided with a function of changing the setting of the mode register 8 described in FIG. 1 based on the actually accessed address.
  • an access monitoring unit 70 for changing the value of the mode register 8 is provided inside the prefetch state management unit 5.
  • the access monitoring unit 70 receives the chip select signals CS 0—, CS 1—, CS 2—, the bus start signal BS—, and the comparison result signal HIT as input, and outputs the chip select signal as output.
  • Set 0, Set 1, and Set 2 are signals that set the value of mode register 8 corresponding to signals CS 0—, CS 1—, and CS 2—, respectively, and Rset 0 is a signal that resets similarly. , Rset 1 or Rset 2 is asserted.
  • the access monitor 70 includes a continuous access determination logic 71 and a mode register selection logic 72.
  • FIG. 8 is a state transition diagram for explaining the operation of the continuous access determination logic 71.
  • the initial state of the continuous access determination logic 71 is the first state in which access is performed first, which is state 910.
  • the HIT signal which indicates that the previously accessed address matches the address accessed this time except for the lower 4 bits, is asserted.
  • the same chip select signal as the previously accessed chip select space is asserted, that is, if the next access is made within the same cache line as the first access, Transit to the second consecutive access state, which is state 9 1 1.
  • the continuous access decision logic 71 asserts the prefetchable signal PFON.
  • the continuous access decision logic 71 asserts the prefetch disable signal PFOFF, that is, one cache line. If all of the accesses are made within the same prefetch range when accessing the same amount of data, the prefetch is valid in the chip select space where the access was made.
  • the continuous access determination logic 71 Upon determining that data is stored, the continuous access determination logic 71 asserts the prefetch enable signal PF0N, but otherwise, the preselection space is stored in the chip select space. Judge that the switch is invalid and assert the prefetch disable signal PFOFF.
  • the mode register selection logic 72 has the function of retaining the chip select signal accessed last time.When the PFON signal is asserted, the mode register 8 sets the signal corresponding to the retained chip select signal. Assert any one of Set 0, Set 1, and Set 2. When the PFOFF signal is asserted, one of Rset0, Rset1, and Rset2, which is the reset signal of the mode register 8 corresponding to the held chip select signal, is asserted. When the mode register 8 is set, it indicates the prefetch access enabled mode, and when reset, it indicates the prefetch access prohibition mode. In this way, it is possible to change the setting of mode register 8 based on the state of the address actually accessed, and to automatically set whether or not to execute prefetch processing for each chip select space. it can.
  • the present invention is not limited to a DRAM as a memory.
  • the present invention can be applied to storage elements typified by general semiconductor memories such as SDRAM and PBRAM, and the configuration in that case is the same as that of the present embodiment.
  • the data to be accessed has been described as being continuously stored in the same DRAM, but the memory may have an interleaved configuration. . In this case, it can be realized by setting the mode register 8 so that the execution and non-execution of the prefetch between the memory chips constituting the continuous addresses are the same.
  • the chip select signal from the CPU 1 is used to identify whether prefetching is possible or not.
  • the upper bits of the address accessed by the CPU may be used. Since the chip select signal is determined by the CPU, the input from the CPU 1 to the prefetch state management unit 5 may be only the address bus ADDR and the bus start signal BS—. In this case, the access determination unit 56 needs to perform processing for obtaining the chip selector space based on the address data from the address bus ADDR. Thus, the number of signal pins of CPU 1 can be reduced. However, a delay occurs due to the time for the address data output to the address bus ADDR to settle and the processing for obtaining the chip selector space from the address data.
  • the unit of the area for controlling the prefetch matches the chip select space.
  • the mode register 8 of the prefetch state management unit 5 may be The address register that stores the boundary of the area is used.
  • the address ADDR value accessed by the CPU 1 input to the prefetch state management unit 5 is used as the address of the area boundary stored in the mode register 8.
  • the mode is used to divide the memory into two areas. If register 1 is divided into three areas and the memory is divided into three areas, mode register 8 is required for each divided area, so that mode register 8 is divided into two. Since the number of comparisons with this value increases, the processing in the access determination unit 56 becomes complicated, and the number of registers increases, resulting in an increase in circuit scale.
  • a memory area for storing data that can be effectively prefetched and a memory area for storing data that is frequently accessed unnecessarily when prefetching is performed include: In the case where data that is placed in different chip select spaces but data that is effective for prefetching and data that is frequently accessed unnecessarily after prefetching are not classified are as follows: Create a program as follows.
  • all the mode registers 8 are set in advance to a prefetch accessible mode. After that, when performing a process in which the data to be processed is data in which unnecessary access frequently occurs when prefetching is performed, immediately before performing the process, a chip indicating an address in which the corresponding data is stored. An instruction to set the mode register 8 corresponding to the select signal to the prefetch access disabled mode is described. Furthermore, when the processing of data that is frequently accessed when prefetching is completed is completed, the value of the mode register 8 that was previously set to the prefetch access prohibition mode is set to the prefetch access mode. Write the instruction to return to the end of the processing. This makes it possible to explicitly describe whether or not to execute prefetching in the program.
  • the memory controller 2 is provided independently of the CPU 1.
  • the etch buffer 6 and the selector 11 may be provided between the cache memory 20 and the main memory DRAM 7, and may be provided in the CPU 1 together with the cache memory 20.
  • the cache memory 20 may be provided externally to the CPU.
  • the present invention it is possible to divide an area for storing programs and data and to control whether or not to prefetch each area. Therefore, in the data access, when the prefetch function is activated, the prefetch function is activated when the data stored in the area that stores data is accessed, and the prefetch access function is activated. If this is done, unnecessary data will be prefetched and memory access performance will be degraded.When accessing an area where data is stored, the prefetch function will be suppressed. The efficiency of memory access can be improved. Industrial applicability
  • the memory control device is useful as an efficient memory system by controlling the prefetch function in data access, and is useful for data processing. Suitable for memory control of equipment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

In data prefetching, there can be a case where previously accessed data becomes useless and the memory efficiency declines. To control data prefetching for an area where data to be accessed sequentially is stored and an area where data is not sequentially accessed, a memory is divided in areas and a register is provided for judging for each area whether data is prefetched or not by a memory controller. A mode register for the area where data to be accessed sequentially is stored is set in a prefetch mode and a mode register for the area where data is not sequentially accessed is set in a non-prefetch mode. Thus, the memory controller prefetches data only in accessing the area where data prefetching is necessary, thereby improving the memory efficiency.

Description

明 細 書  Specification
メ モリ 制御装置 技術分野  Memory controller Technical field
本発明はデータ処理装置に関し、 特にメ モ リ からのプリ フ ェ ッチを行 う メモリ制御装置のプリ フ ェ ッチ制御に関する。 背景技術  The present invention relates to a data processing device, and more particularly to a prefetch control of a memory control device that performs a prefetch from a memory. Background art
計算機の分野において、 一般的なプロ グラムでは一度アクセス したデ ータ を再度利用する傾向が高く 、 ま た、 一度アクセスされたデータの近 傍にあるデータも参照される傾向がある。 これらの傾向は、 局所参照性 と呼ばれている。 多く の計算機では、 この局所参照性を活用 し、 メモリ アクセスの待ち時間を減らす目的で、 キヤ ッ シュメモ リ と呼ばれる高速 なメモリ を C P Uと メモリ の間に配置している。 このキャ ッ シュメモリ には最近アクセス したメモリ の写しを持ち、 メモリ に対してアクセスす る代わり にメモリ よ リ アクセスが高速なキヤ ッ シュメモリ に対してァク セスする ことで、 メモリ アクセスの待ち時間を減ら し、 処理性能の向上 を図っている。  In the field of computers, general programs tend to reuse data that has been accessed once, and also tend to refer to data that is near data that has been accessed once. These tendencies are called local references. In many computers, a high-speed memory called cache memory is placed between the CPU and the memory in order to reduce the latency of memory access by utilizing this local referability. This cache memory has a copy of the recently accessed memory, and instead of accessing the memory, accesses the cache memory, which is faster than the memory, to reduce the latency of memory access. We are working to reduce this and improve processing performance.
キヤ ッ シュメモ リ を管理するキヤ ッ シュコ ン 卜 ローラは、 C P Uが処 理するデータサイ ズの n倍の単位でキヤ ッ シュ メモリ に記憶されている 内容が有効, 無効を管理している。 このキャ ッ シュメ モ リ を管理する単 位をキャ ッ シュライ ンと呼ぶ。 3 2 ビッ トアーキテクチャの C P Uの場 合、 このキャ ッシュライ ンは 4バイ トの n倍とな り 、 通常 1 6, 3 2, 6 4, 1 2 8ノ イ トといっ た値となっている。 ま た、 キャ ッ シュコ ン ト ローラが行う メモ リ からキャ ッシュメモリ への転送は、 管理単位である キャ ッ シュライ ン単位で行っている。 The cache controller that manages the cache memory manages the validity and invalidity of the contents stored in the cache memory in units of n times the data size processed by the CPU. A unit that manages this cache memory is called a cache line. In the case of a 32-bit architecture CPU, this cache line is n times 4 bytes, usually 16, 32, 64, and 128 kb. . The transfer from the memory to the cache memory performed by the cache controller is a management unit. This is done on a cache line basis.
一方、 メモリ には、 D R AMやシンク ロナス D R AMが使われている D R AMやシンク ロナス D R AMは格子状に記憶素子が構成されており 各記憶素子へは行と列を指定してアクセスを行う 。 これらのメモリ にお いては、 同一行内の異なる列に対するアクセス時間は、 行を指定してか ら列を指定するアクセス時間に比べ短い。 D R AMの場合、 この同一行 で異なる列の記憶素子を連続してアクセスする方式をページモー ドァク セスと呼び、 シンク ロナス D R AMの場合バース トモー ドアクセスと呼 ぶ。  On the other hand, in a memory, a DRAM or a synchronous DRAM is used. In a DRAM or a synchronous DRAM, storage elements are arranged in a grid, and each storage element is accessed by designating a row and a column. Do In these memories, the access time for different columns in the same row is shorter than the access time for specifying a row and then specifying a column. In the case of DRAM, a method of successively accessing storage elements in different columns in the same row is called page mode access, and in the case of synchronous DRAM, it is called burst mode access.
C P Uが処理を行う上で必要な命令やデータがキャ ッ シュメモリ 上に 存在しない場合をキャ ッ シュ ミ スと呼ぶ。 キャ ッシュ ミ スが発生すると キャ ッ シュコ ン トローラは、 メモリ からキャ ッ シュライ ンサイ ズ分のデ ータ を連続的に読み出す。 この読み出す動作をキヤ ッシュフ ィ ル動作と 呼ぶ。 メモリ コ ン ト ローラは、 C P Uからメモリ へのリ ー ドアクセスが 発生すると、 キャ ッシュ ミ スが生じキャ ッシュフ ィル動作が発生したと 仮定し、 ページモー ド、 又は、 バース トモー ドでメモリ からデータ を先 行して読み出している。 読み出 したデータは、 メモリ コ ン トローラ内の バッフ ァ に格納する。 この動作をプリ フ ェ ッチと呼ぶ。  The case where instructions and data necessary for processing by the CPU do not exist in the cache memory is called a cache miss. When a cache miss occurs, the cache controller continuously reads data of the cache line size from the memory. This read operation is called a cache fill operation. The memory controller assumes that when a read access from the CPU to the memory occurs, a cache miss occurs and a cache file operation occurs, and the memory controller performs a page mode or a burst mode. Data is read ahead of time. The read data is stored in a buffer in the memory controller. This operation is called prefetch.
このプリ フエ ツチ動作を制御する技術と して、 日本国特開平 10— 55307号に記載の技術が挙げられる。 日本国特開平 10— 55307号では、 C P Uにおいて、 メモリ に対する要求が命令に対する要求であるかデー タに対する要求であるかを示す制御信号を生成している。 この制御信号 に従い、 メモリ からキヤ ッシュメモリ にプリ フ ェ ッチされるデータ量を 判断するプリ フ ェ ッチ論理回路を組み込むこ と によ り 、 不必要なメモリ アクセスを低減し、 メモリ システムの効率を向上させている。 また、 日本国特開平 5— 27 1 673 号では、 キャ ッシュメモリ に一旦プリ フ ェ ッチされたデータのリ プレースを制御する ことによ リ 、 キヤ ッシュ を効率的に使用する技術が開示されている。 As a technique for controlling this prefetch operation, there is a technique described in Japanese Patent Application Laid-Open No. H10-55307. In Japanese Patent Application Laid-Open No. H10-55307, a CPU generates a control signal indicating whether a request for a memory is a request for an instruction or a request for data. By incorporating a prefetch logic circuit that determines the amount of data to be prefetched from the memory to the cache memory according to this control signal, unnecessary memory access is reduced and the efficiency of the memory system is reduced. Has been improved. Further, Japanese Patent Application Laid-Open No. 5-2717163 discloses a technique for efficiently using a cache by controlling the replacement of data once prefetched in a cache memory. I have.
日本国特開平 10— 55307 号は、 命令に対するメモリ アクセス (命令フ エ ッチ) とデータ に対するメモリ アクセス (データ フ ェ ッチ) の違いに よ り 、 メモリ からのプリ フ ェ ッチされるデータ量を変える こ とでメモリ システムの効率化を図っている。 しかし、 日本国特開平 10— 55307 号で は、 命令に対する要求であるかデータ に対する要求であるかを示す制御 信号によ リ ブリ フ エ ツチを制御しているが、 計算機が処理するデータ に は、 配列や行列演算に用いるデータのよ う に連続的にアクセスする可能 性が非常に大き く 、 プリ フ ェ ッチを行う こ とが有効なデータ と、 I Z 0 や他の C P Uとデータ を受渡しするためのデータや、 処理するデータサ ィズが小さ く プリ フ ェ ッチを用いると不必要なメモリ アクセスが多発す るデータ などの、 プリ フ ェ ッチが有効に働かないデータがある。 このよ う にデータ と言っても、 プリ フ ェ ッチを行う と性能が向上する場合のデ —タ と、 逆にプリ フ ェ ッチを行う ことによ り性能が低下する場合がある ため、 データアクセスであるからという理由だけで、 メモリ からプリ フ ェ ツチするデータ量を決めて しま う と、 メモリ システムのアクセス効率 を向上させる ことは難しい。  Japanese Unexamined Patent Publication No. Hei 10-55307 discloses a method of prefetching data from memory due to the difference between memory access to instructions (instruction fetch) and memory access to data (data fetch). By changing the amount, the efficiency of the memory system is improved. However, in Japanese Patent Application Laid-Open No. 10-55307, the re-fetch is controlled by a control signal indicating whether it is a request for an instruction or a request for data. Very high possibility of continuous access like data used for array or matrix operation, and passing data that is effective to prefetch and data with IZ0 or other CPU For example, there are data that cannot be prefetched effectively, such as data to be processed and data whose processing size is small and unnecessary memory access occurs frequently when prefetching is used. Even if it says data in this way, there is a case where the performance is improved by performing pre-fetching, and a case where the performance is deteriorated by performing pre-fetching conversely. However, it is difficult to improve the access efficiency of the memory system if the amount of data to be prefetched from the memory is determined solely because of data access.
一方、 日本国特開平 5— 271 673 号では、 キャ ッシュのエン ト リ 単位に プリ フ エ ツチの有無並びに リ プレースを制御しているが、 予めプリ フ エ ツチ要のデータ に対応したェン ト リ のァ ドレスを登録してお く 必要があ り 、 ま たプリ フ ェ ッチの要 · 不要も細かく 指定する必要があ り 、 メモリ からプリ フ ェ ッチされるデータ量を変更する ことが難しい。  On the other hand, in Japanese Patent Application Laid-Open No. Hei 5-271 673, the presence or absence of a prefetch and the replacement are controlled in units of cache entries. It is necessary to register the address of the tree, and it is necessary to specify the necessity and unnecessary of prefetching in detail, and change the amount of data prefetched from the memory. It is difficult.
本発明の課題は、 データ の使われ方に対応してメモリ からプリ フ ェ ツ チされるデータ量を変更可能にする こと によ リ 、 メモリ システムの効率 を向上させる こ とである。 発明の開示 An object of the present invention is to prefetch data from a memory in accordance with how data is used. It is to improve the efficiency of the memory system by making it possible to change the amount of data to be touched. Disclosure of the invention
メ モリ のア ド レス空間を複数の領域に分割 し、 更に、 分割した領域毎 に、 メモリ コ ン ト ローラがプリ フ ェ ッチを行う か否かを決めるモー ドレ ジスタ をメモリ コ ン トローラに設ける。 メモリ コ ン トローラでは、 この モー ドレジスタ に従い、 C P Uがアクセスするメモリ のァ ドレスが含ま れる領域毎にプリ フ ェ ッチ機能を動作させ、 メモリ からデータ をァクセ スする。  The memory address space is divided into a plurality of areas, and a mode register that determines whether or not the memory controller performs prefetching for each of the divided areas is provided to the memory controller. Provide. In accordance with the mode register, the memory controller operates the prefetch function for each area including the address of the memory accessed by the CPU, and accesses data from the memory.
処理を行う プログラムにおいては、 プリ フ ェ ッチを行う ことが有効な データ を格納する領域のモー ドレジスタ をプリ フ ェ ッチ動作モー ドに設 定し、 プリ フ ェ ッチを用いると不必要なアクセスが多発するデータ を格 納する領域のモー ドレジスタ をプリ フ ェ ッチ非動作モー ドに設定する。  In a program that performs processing, it is unnecessary to set the mode register in the area that stores valid data for prefetching to the prefetch operation mode and use prefetching. Set the mode register in the area that stores data that frequently accesses frequently to the prefetch non-operation mode.
これによ り 、 連続的にデータ を読み出す場合は、 プリ フ ェ ッチ機能を 動作させ、 先行して連続的にデータ を読み出 し、 単発でアクセスするデ ータ に対しては、 プリ フ ェ ッチを行う ことによ リ生じる不必要なデータ 読み出 しを生じさせないよ う にプログラムから制御する こ とが可能にな リ 、 メモ リ アクセス効率が向上する。 図面の簡単な説明  By this, when reading data continuously, the prefetch function is operated, and the data is read continuously continuously in advance, and the data to be accessed by one shot is prefetched. This makes it possible to control from a program so that unnecessary data reading caused by performing the etching is not caused, thereby improving the memory access efficiency. BRIEF DESCRIPTION OF THE FIGURES
第 1 図は、 本発明の実施の形態におけるデータ処理装置の構成を示す プロ ック図である。  FIG. 1 is a block diagram showing a configuration of a data processing device according to an embodiment of the present invention.
第 2 図は、 プリ フ ェ ッチ状態管理部の構成を示すプロ ッ ク図である。 第 3 図は、 本発明の実施の形態における計算機の動作を示すタイ ミ ン グチヤー トである。 FIG. 2 is a block diagram showing a configuration of a prefetch state management unit. FIG. 3 is a timing chart showing the operation of the computer according to the embodiment of the present invention. It is a gujaat.
第 4図は、 状態管理部の状態遷移を示す図である。  FIG. 4 is a diagram showing a state transition of the state management unit.
第 5図は メモリ シーケンサの動作を示す状態遷移図である。  FIG. 5 is a state transition diagram showing the operation of the memory sequencer.
第 6図は モー ドレジスタ を設定する機能を備えた計算機の構成図で ある。  FIG. 6 is a configuration diagram of a computer having a function of setting a mode register.
第 7 図は アクセス監視部の構成図である。  FIG. 7 is a configuration diagram of the access monitoring unit.
第 8図は 連続アクセス判定論理の状態遷移を示す図である 発明を実施するための最良の形態  FIG. 8 is a diagram showing a state transition of a continuous access determination logic.
本発明の実施の形態を図面を用いて以下に説明する。  Embodiments of the present invention will be described below with reference to the drawings.
第 1 図は、 本発明の一実施で、 本発明を適応した計算機やプログラマ ブル · コン ト ローラ に代表される、 データ処理装置のメモリ 制御に関連 する部分の構成を示すブロ ッ ク図である。 C P U 1 は、 高速アクセス可 能なメモリ で構成したキャ ッ シュメモリ 2 0 を備えている。 キャ ッ シュ メモリ 2 0 には、 D R AM 7 の内容の写しを格納するが、 命令とデータ の区別はしていないものとする。 本実施の形態においては、 C P U 1 は 3 2 ビッ トアーキテクチャであるものと し、 ア ドレスバス A D D Rと 4 バイ ト幅のデータバス D A T , バスの開始を示すバススター ト信号 B S ―, アクセス空間を示す信号で通常複数接続した記憶素子を選択するた めのチップセ レク ト信号 C S 0—, C S 1 — , C S 2—を計 3 本備え、 ま た、 リ ー ドデータ が無効の間、 C P U 1 を停止させる手段と して、 ゥ エイ ト信号 WA I T—の各端子を備えているものとする。 なお、 信号名 の最後の "―" は、 信号が口一アクティ ブである こ と を示している。 メモリ である D R AM 7 はページモー ドでアクセス可能な D R AMで あ り 、 行ア ドレスセ レク ト信号 R A S と列ア ドレスセ レク ト信号 C A S—の動作で、 ァ ドレスバス Aに出力された行ァ ドレスと列ァ ドレ スに対応したリ一ドデータ を 4バイ ト幅のデータバス D に出力する機能 を備えている。 メモリ コ ン ト ローラ 2 は、 プリ フ ェ ッチ状態管理部 5, メモリ シーケンサ 4 , プリ フ ェ ッチバッフ ァ 6 , セレク タ 1 1 で構成さ れている。 FIG. 1 is a block diagram showing the configuration of a portion related to memory control of a data processing device, such as a computer or a programmable controller to which the present invention is applied, according to an embodiment of the present invention. . The CPU 1 has a cache memory 20 composed of a memory that can be accessed at high speed. A copy of the contents of DRAM 7 is stored in cache memory 20, but no distinction is made between instructions and data. In the present embodiment, CPU 1 has a 32-bit architecture, and has an address bus ADDR, a 4-byte data bus DAT, a bus start signal BS- indicating the start of the bus, and an access space. Normally, three chip select signals CS0—, CS1—, and CS2—are used to select the memory elements connected in multiples, and CPU1 is used while read data is invalid. As means for stopping, each terminal of ゥ 8 signal WA IT— shall be provided. The "-" at the end of the signal name indicates that the signal is active. The DRAM 7 is a DRAM that can be accessed in the page mode, and has a row address select signal RAS and a column address select signal. It has a function to output read data corresponding to the row address and column address output to the address bus A to the 4-byte data bus D by the CAS— operation. The memory controller 2 includes a prefetch state management unit 5, a memory sequencer 4, a prefetch buffer 6, and a selector 11.
C P U 1 は、 処理に必要な命令又はデータがキャ ッ シュメモリ 2 0 に 存在しない場合、 メモリ コ ン ト ローラ 2 を介して D R AM 7 からデータ を読み出す。 この時、 バススター ト信号 B S—を 1 サイ クルアサー トす る。 バススター ト信号 B S—のアサー トと同時に、 処理に必要な命令 データが格納されているァ ドレスをァ ドレス信号 A D D Rに出力する。 更にこの時、 この命令ノデータが格納されているメモリ のァ ドレス領域 を示すチップセレク ト信号 C S 0—, C S 1 — , C S 2—の何れか 1 信 号をアサー トするものとする。 バススター ト信号 B S―, チップセレク ト信号 C S 0—, C S 1 —, C S 2—は、 メモリ コ ン ト ローラ 2 のプリ フ ェ ッチ状態管理部 5 に入力される。 プリ フ ェ ッチ状態管理部 5 は、 チ ップセ レク ト信号 C S 0 _, C S 1 , C S 2—のそれぞれが対応する ァ ドレス領域に対して、 D R AM 7 からデータ をプリ フ ェ ッチするか否 かという 2つのモー ドを制御するモー ドレジスタ 8 を備えている。 即ち、 本実施の形態では、 プリ フ エ ツチを制御する領域の単位は各チップセレ ク ト空間毎という こと になる。  The CPU 1 reads data from the DRAM 7 via the memory controller 2 when an instruction or data necessary for processing is not present in the cache memory 20. At this time, the bus start signal B S— is asserted for one cycle. At the same time as the assertion of the bus start signal BS—, the address storing the instruction data necessary for processing is output to the address signal ADDR. Further, at this time, one of the chip select signals CS0—, CS1— and CS2— indicating the address area of the memory where the instruction data is stored is asserted. The bus start signal B S- and the chip select signals C S0—, C S1—, and C S2— are input to the prefetch state management unit 5 of the memory controller 2. The prefetch state management unit 5 prefetches data from the DRAM 7 to an address area corresponding to each of the chip select signals CS0_, CS1, and CS2—. A mode register 8 is provided to control the two modes of whether or not. That is, in the present embodiment, the unit of the area for controlling the prefetch is for each chip select space.
プリ フ ェ ッチ状態管理部 5 はこのモー ドレジスタ 8 の値に従い、 メモ リ シーケンサ 4 , プリ フ ェ ッチバッフ ァ 6 , 出力セレク タ 1 1 を制御す る。 プリ フ ェ ッチ状態管理部 5 からは、 メモリ シーケンサ 4への起動信 号 R E Q , 起動信号 R E Qによ って要求したメモリ アクセスがプリ フ エ ツチアクセスであるか否かを示すプリ フ ェ ッチアクセス信号 P R Fが出 力される。 ま た D R AM 7からデータバス Dに有効なデータ を出力 して いる こと を示すデータバリ ッ ド信号 D Vが入力される。 The prefetch state management unit 5 controls the memory sequencer 4, the prefetch buffer 6, and the output selector 11 according to the value of the mode register 8. From the prefetch state management unit 5, a start signal REQ to the memory sequencer 4 and a prefetch access indicating whether the memory access requested by the start signal REQ is a prefetch access or not. Signal PRF is output Is forced. Also, a data valid signal DV indicating that valid data is being output from the DRAM 7 to the data bus D is input.
メモリ シーケンサ 4は、 プリ フ ェ ッチ状態管理部 5 からの起動信号 R E Qとプリ フ ェ ッチアクセス信号 P R Fに従い、 行ア ドレスセ レク ト 信号 R A S—と列ァ ドレスセレク ト信号 C A S—を制御して、 DRAM7 か らデータ を読み出す制御を行う。 このメモリ シーケンサ 4は、 行 · 列ァ ドレス生成部 5 1 を備えている。 行 · 列ア ドレス生成部 5 1 は、 C P U 1 からのァ ドレス A D D Rに従い行ァ ドレスと列ァ ドレスを生成 し、 メ モリ シーケンサ 4が出力する行ァ ドレスセレク ト信号 R A S—と列ァ ド レスセレク ト信号 C A S—の制御タイ ミ ングと同期してァ ドレスバス A に行ァ ドレス · 列ァ ドレスを出力する。  The memory sequencer 4 controls the row address select signal RAS— and the column address select signal CAS— in accordance with the start signal REQ and the prefetch access signal PRF from the prefetch state management unit 5, and Control to read data from DRAM7. The memory sequencer 4 includes a row / column address generator 51. The row / column address generator 51 generates a row address and a column address according to the address ADDR from the CPU 1, and outputs a row address select signal RAS— and a column address select signal output from the memory sequencer 4. The row and column addresses are output to address bus A in synchronization with the control timing of the control signal CAS—.
プリ フ ェ ッチ状態管理部 5 は、 プリ フ ェ ッチバッフ ァ 6 にデータ をセ ッ 卜するプリ フ ェ ッチバッフ ァデータセ ッ ト信号 P B S E Tと、 出力セ レクタ 1 1 の出力を選択する出力セレクタ選択信号 O P S E L によ り 、 プリ フ ェ ッチバッフ ァ 6 と出力セレク タ 1 1 を制御している。 プリ フ エ ツチバッ フ ァ 6 は、 1 回のプリ フ ェ ッチで先読みするデータ を格納する ため、 4段のバッフ ァから構成されている。 本実施の形態においては、 1 回のプリ フ ェ ッチはキャ ッシュ 2 0 の 1 エン ト リ に格納されるデータ 数であるキヤ ッ シュライ ン分のデータ を先読みするものとする。 そ して 1 キャ ッ シュライ ンは、 3 2 ビッ ト ( 4バイ ト) データ 4個分の 1 6ノ イ トであるものとする。 従って、 プリ フ ェ ッチバッフ ァの各段には、 3 2 ビッ トデータ 1 つが格納される こ とになる。 なおこのキャ ッ シュラ イ ンのデータサイ ズはキヤ ッ シュの構成によって変わるものであ り 、 本 発明においてプリ フ ェ ッチするデータサイズが 1 6バイ 卜 に制限される ものではない。 また、 プリ フ ェ ッチ状態管理部 5は、 プリ フ ェ ッチバッフ ァデータセ ッ ト信号 P B S E Tの値に従い、 D RAM 7がデータバス Dに出力 した データ を任意の段のバッフ ァ にセ ッ トする機能を備えている。 具体的に は、 プリ フ ェ ッチバッフ ァデータセ ッ ト信号 P B S E Tが 0のと き、 D R AM 7が出力するデータ を 1段目のノ ッフ ァ にセ ッ ト し、 信号 P B S E Tが 1 のと き、 D R AM 7が出力するデータ を 2段目のノ ッフ ァにセッ ト し、 信号 P B S E Tが 2のと き、 3段目のバッフ ァ に DRAM7 が出力するデータ をセ ッ ト し、 信号 P B S E Tが 3の場合には、 DRAM7 が出力するデータ を 4段目のバッフ ァ にセ ッ トする。 ま た、 全てのバッ フ ァ に格納されているデータは、 すべて出力セレクタ 1 1 に出力されて いる。 The prefetch state management unit 5 includes a prefetch buffer data set signal PBSET for setting data in the prefetch buffer 6 and an output selector selection signal OPSEL for selecting an output of the output selector 11. Thus, the prefetch buffer 6 and the output selector 11 are controlled. The prefetch buffer 6 is composed of four-stage buffers for storing data to be read ahead in one prefetch. In the present embodiment, one prefetch prefetches cache line data, which is the number of data stored in one entry of the cache 20. One cache line is 16 notes, equivalent to four 32 bits (four bytes) of data. Accordingly, one stage of 32-bit data is stored in each stage of the prefetch buffer. The data size of the cache line varies depending on the configuration of the cache, and the data size to be prefetched in the present invention is not limited to 16 bytes. The prefetch state management unit 5 has a function of setting the data output from the DRAM 7 to the data bus D to the buffer of an arbitrary stage in accordance with the value of the prefetch buffer data set signal PBSET. It has. Specifically, when the prefetch buffer data set signal PBSET is 0, the data output from the DRAM 7 is set in the first-stage buffer, and when the signal PBSET is 1, The data output by DRAM 7 is set in the second-stage buffer, and when the signal PBSET is 2, the data output by DRAM 7 is set in the third buffer, and the signal PBSET is output. In the case of 3, the data output from DRAM7 is set in the fourth buffer. All data stored in all buffers are output to the output selector 11.
出力セレクタ 1 1 は、 D R AM 7が出力するデータ とプリ フ ェ ッチバ ッフ ァ 6が出力するデータ を、 出力セレク タ選択信号 O P S E Lの値に 従って選択し、 プロセッサデータバス D A Tに出力する。 具体的には、 信号 O P S E Lが 0のと き、 プリ フ ェ ツチノくッフ ァ 6の 1段目をプロセ ッサデータバス D A Tに出力 し、 信号 O P S E Lが 1 の時には 2段目の ノ ッフ ァ、 信号 O P S E L力 2の時は 3段目のバッフ ァ , 信号 OPSEL が 3のとき、 4段目のバッフ ァの値を各々 プロセ ッサデータバス D A Tに 出力する。  The output selector 11 selects the data output by the DRAM 7 and the data output by the prefetch buffer 6 according to the value of the output selector selection signal OPSEL, and outputs the selected data to the processor data bus DAT. Specifically, when the signal OPSEL is 0, the first stage of the prefetcher buffer 6 is output to the processor data bus DAT, and when the signal OPSEL is 1, the second stage buffer and signal are output. When the OPSEL power is 2, the third buffer and when the signal OPSEL is 3, the value of the fourth buffer is output to the processor data bus DAT.
C P U 1 が実行するソフ トウエアでは、 データが以下の 2つに分類さ れるものとする。 1 つは、 配列や行列演算に用いるデータのよ う に連続 的にアクセスする可能性が非常に大き く 、 プリ フ ェ ッチを行う こ とが有 効なデータ と、 もう 1つは、 I ZOとデータ を受渡しするためキヤ ッシ ュメモリ が使用できないデータや、 処理するデータのサイ ズが小さいた めプリ フ エ ツチを行う と不必要なメモリ アクセスが多発するデータであ る。 このよ う な分類は、 プログラムを作成する時にプログラム作成者が 予め行う ものとする。 そ して、 プログラムをコ ンパイルし リ ンクする時 に、 プリ フ ェ ッチを行う こ とが有効なデータ を格納する D R A M 7 の領 域と、 プリ フ ェ ッチを行う と不必要なアクセスが多発するデータ を格納 する D R A M 7 の領域を異なるチッ プセレク ト空間に配置する。 ま た命 令は、 プリ フ ェ ッチを行う こ とが有効なデータ を格納する領域に配置す る。 In the software executed by CPU 1, data is classified into the following two types. One is very likely to be accessed continuously, such as data used for array or matrix operations, and the data that can be prefetched is effective. Data that cannot be used by the cache memory because data is transferred to and from ZO, or data that requires unnecessary memory access frequently if prefetching is performed because the size of the data to be processed is small. You. Such a classification is to be performed in advance by a program creator when a program is created. Then, when compiling and linking the program, the area of DRAM 7 that stores valid data to be prefetched and the unnecessary access when prefetching is performed. The area of DRAM 7 that stores data that frequently occurs is placed in a different chip select space. Instructions are placed in areas that store data that is valid for prefetching.
プログラムの初期化ルーチンにおいては、 プリ フ ェ ッチが有効なデー タ を格納する領域を示すチップセレクタ信号に対応したモー ドレジスタ 8 をプリ フ ェ ッチアクセス可能モー ドに設定し、 プリ フ ェ ッチが不必要 なデータ を格納する領域を示すチップセレクタ信号に対応するモー ドレ ジスタ 8 をプリ フ ェ ッチアクセス禁止モー ドに設定する。 モー ドレジス タ 8 の値の設定手段は特に図示されていないが、 ハー ドウェアによ って 決まる レジスタ空間内の特定のァ ドレスに対する C P U 1 からのァクセ スによ って行われる。  In the program initialization routine, the mode register 8 corresponding to the chip selector signal indicating the area where prefetch valid data is stored is set to the prefetch accessible mode, and the prefetch is performed. Sets the mode register 8 corresponding to the chip selector signal indicating the area for storing unnecessary data to the prefetch access prohibition mode. The means for setting the value of the mode register 8 is not particularly shown, but is performed by access from CPU 1 to a specific address in the register space determined by hardware.
モー ドレジスタ 8 は、 チップセレク ト空間毎に独立してチップセレク ト信号の数だけ独立したレジスタ と して、 又はレジスタ フ ァイルの形で 備えてもよいが、 本実施の形態においては、 チップセレク ト空間毎にプ リ フ エ ツチの可否を識別できればよいので、 チップセ レク ト空間毎に 1 ビッ トの状態を記憶できる回路を設けても良いが、 以下の説明では、 少 なく ともチッ プセレク ト信号数のビッ ト幅を持った 1 つのレジスタの 1 ビッ ト毎にチップセレク ト空間を対応させる こ と と して説明を行う。 そ して、 モー ドレジスタ 8 の各ビッ トの値 0 Z 1 を調べる こ と によ り 、 対 応するチップセレク ト空間におけるアクセスの際のプリ フ ェ ッチの可否 を判断するものとする。 第 2 図は、 プリ フ ェ ッチ状態管理部 5 の構成を示したプロ ック図であ る。 第 2図を用いてプリ フ ェ ッチ状態管理部の詳細な機能を説明する。 プリ フ ェ ッチ状態管理部 5 は、 状態管理部 5 2 , バッフ ァ管理部 5 3 , アクセス判定部 5 6 , モー ドレジスタ 8 , 比較器 5 4 とア ドレスバッフ ァ 5 5 から構成される。 アクセス判定部 5 6 は、 C P U 1 から出力され るチップセレク ト信号 C S 0— , C S 1 — , C S 2—とモー ドレジスタ 8 の値を入力と し、 プリ フ ェ ッチ可否判定結果信号 J U Gを出力する。 プリ フ ェ ッチ可否判定結果信号 J U Gは、 チップセレク ト信号 C S 0— , C S 1 —, C S 2—とそれぞれのチップセレク ト信号に対応するモ一 ドレジスタ 8 の設定値の論理積をと リ 、 その結果の論理和をと つたもの である。 プリ フ ェ ッチ可否判定結果信号 J U Gは、 現在アサー ト してい るチップセレク ト信号が示すメモリ領域がプリ フ ェ ッチ可能に設定して いるかプリ フ ェ ッチ禁止に設定しているかを示し、 プリ フ ェ ッチ可能な らアサー ト、 プリ フ ェ ッチ禁止ならネゲー トとなる信号である。 The mode register 8 may be provided independently for each chip select space as many as the number of chip select signals or in the form of a register file. A circuit capable of storing a 1-bit state may be provided for each chip select space, as long as it is possible to identify whether or not the pre-fetch is possible for each chip space. However, in the following description, at least chip select is required. The explanation is made by associating the chip select space with each bit of one register having the bit width of the number of signals. Then, by examining the value 0Z1 of each bit of the mode register 8, it is determined whether or not the prefetch can be performed at the time of access in the corresponding chip select space. FIG. 2 is a block diagram showing a configuration of the prefetch state management unit 5. The detailed function of the prefetch state management unit will be described with reference to FIG. The prefetch state management unit 5 includes a state management unit 52, a buffer management unit 53, an access determination unit 56, a mode register 8, a comparator 54, and an address buffer 55. The access determination unit 56 receives the chip select signals CS 0—, CS 1—, and CS 2— output from the CPU 1 and the value of the mode register 8 as inputs, and outputs the prefetch availability determination result signal JUG. Output. The prefetch enable / disable determination result signal JUG is a logical product of the chip select signals CS0—, CS1—, and CS2—and the set value of the mode register 8 corresponding to each chip select signal. And the logical sum of the results. The prefetch enable / disable judgment result signal JUG indicates whether the memory area indicated by the currently asserted chip select signal is set to enable prefetch or disable prefetch. This signal is asserted if prefetching is possible, or negated if prefetching is disabled.
ァ ドレスバッフ ァ 5 5 は、 状態管理部 5 2 からの了 ドレスバッフ ァセ ッ ト信号 A B S E Tがアサー ト されると、 C P U 1 のァ ドレスバス ADDR の値を保持するバッフ ァである。 比較器 5 4は、 ア ドレスノ ッフ ァ 5 5 と C P U 1 のァ ドレスバス A D D Rの値を比較し、 ァ ド レスバッ フ ァ 5 5 の値と C P U 1 のァ ドレスバス A D D Rの値の各々下位 4 ビッ ト を 除く 値が一致している場合、 比較結果信号 H I Tをアサー ト し、 不一致 ならネゲー トする。 こ こで、 下位 4 ビッ トを除いて値を比較するのは、 一度にプリ フ ェ ッチするデータ力 1 6 ノ ィ トであ りア ドレスと しては下 位 4 ビッ トの範囲に相当する こ とから、 同 じプリ フ ェ ッチ範囲のァ ドレ スに対してアクセス しているかどう かを判定するために下位 4 ビッ ト を 除いてァ ドレス比較を行っている。 状態管理部 5 2 は、 C P U 1 の出力信号であるバススター ト信号 B S—と、 アクセス判定部 5 6 の判定結果であるプリ フ ヱ ツチ可否判定 結果信号 J U G及び、 メモリ シーケンサ 4からのデータバリ ッ ド信号 D Vを入力と して内部状態が遷移する状態遷移プロ ッ クである。 状態管 理部 5 2からは、 その内部状態の遷移に従い、 起動信号 R E Qとプリ フ エ ッチアクセス信号 P R F とァ ドレスバッフ ァセ ッ ト信号 A B S E Tと ウェイ ト信号 WA I T—を出力 し、 更に、 状態管理部 5 2 の内部状態を 状態信号 S Tに出力 している。 The address buffer 55 holds the value of the address bus ADDR of the CPU 1 when the address buffer set signal ABSET from the state management unit 52 is asserted. The comparator 54 compares the value of the address bus 55 with the address bus ADDR of the CPU 1, and compares the value of the address buffer 55 with the value of the address bus ADDR of the CPU 1 with the lower 4 bits. Asserts the comparison result signal HIT if the values except the bits match, or negates if they do not match. Here, the value to be compared except for the lower 4 bits is the data force 16 bits that are prefetched at a time, and the address is within the range of the lower 4 bits. For this reason, the address comparison is performed excluding the lower 4 bits to determine whether or not an address in the same prefetch range is being accessed. The state management unit 52 includes a bus start signal BS— which is an output signal of the CPU 1, a prefetch determination result signal JUG which is a determination result of the access determination unit 56, and a data validator from the memory sequencer 4. This is a state transition block in which the internal state transitions when the input signal DV is input. The state management unit 52 outputs a start signal REQ, a prefetch access signal PRF, an address buffer set signal ABSET and a wait signal WAIT— according to the transition of the internal state, and furthermore, the state management. Outputs the internal state of section 52 to status signal ST.
第 4図にこ の状態管理部 5 2 の状態遷移図を示す。 状態 1 0 0 は、 第 1 図のプリ フ ェ ッチバッフ ァ 6 に格納 しているデータ が無効である こと を示している状態である。 状態 1 0 1 はプリ フ ェ ッチアクセス信号 PRF によ り プリ フ ェ ッチの開始を指示し、 一番最初のデータの準備ができる までのウェイ ト状態である。 同様に状態 1 0 2 は、 プリ フ ェ ッチを開始 し 2つ目のデータ をウェイ 卜 している状態である。 状態 1 0 3 , 1 0 4 も同様にそれぞれ 3 つ目, 4つ目のデータ をウェイ ト している状態であ る。 本実施の形態では 1 回のプリ フ エ ツチで 4つのデータ を先読みする ため、 各々のデータの準備ができる まで一旦ウェイ トする状態が 4つあ るこ とになる。 状態 1 0 6 は、 プリ フ ェ ッチが開始されプリ フ ェ ッチバ ッフ ァ 6 に有効なデータが 4つ格納されたこ と を示す状態である。 これ に対し、 状態 1 0 5 は、 プリ フ ェ ッチアクセスを実行せずに C P Uが要 求しているデータのみをアクセス している こ と を示す単発アクセス状態 である。 従って、 起動信号 R E Qは状態 1 0 1 , 1 0 2 , 1 0 3 , 1 0 4 及び 1 0 5 の時にアサー ト され、 プリ フ ェ ッチアクセス信号 P R Fは、 状態 1 0 1 , 1 0 2 , 1 0 3 , 1 0 4の時にアサー ト され、 メモリ シー ケンサ 4 に伝え られる。 又、 状態 1 0 0から状態 1 0 1 へ、 状態 1 0 0 から状態 1 0 5へ、 状態 1 0 6から状態 1 0 1 へ、 そ して状態 1 0 6か ら状態 1 0 5へと遷移する時、 即ちプリ フ ェ ッチ開始を指示するか単発 アクセスを行う際に、 ァ ドレスバッフ ァセ ッ ト信号 A B S E Tをアサ一 卜 し、 ア ドレスノ ッフ ァ 5 5に C P U 1 のア ドレスバス A D D Rの値を 保持させる。 FIG. 4 shows a state transition diagram of the state management unit 52. The state 100 is a state indicating that the data stored in the prefetch buffer 6 in FIG. 1 is invalid. State 101 is a wait state in which the start of prefetch is instructed by the prefetch access signal PRF and the first data is ready. Similarly, state 102 is a state in which prefetching has been started and the second data is being waited for. Similarly, states 103 and 104 are states in which the third and fourth data are being waited for, respectively. In the present embodiment, since four data are pre-read by one prefetch, there are four states in which each data is temporarily waited until it is ready. The state 106 is a state indicating that prefetching has been started and four valid data have been stored in the prefetch buffer 6. On the other hand, the state 105 is a single access state indicating that only the data requested by the CPU is accessed without executing the prefetch access. Therefore, the activation signal REQ is asserted in the states 101, 102, 103, 104 and 105, and the prefetch access signal PRF is set in the states 101, 102, 1 Asserted at 0 3, 104, and transmitted to memory sequencer 4. Also, from state 100 to state 101, state 100 When transitioning from state 106 to state 105, state 106 to state 101, and from state 106 to state 105, that is, instructing the start of prefetch or single-shot access At this time, the address buffer set signal ABSET is asserted, and the address buffer 55 holds the value of the address bus ADDR of CPU 1.
これらはプリ フ ェ ッチの状態に関する内部状態であるが、 これらの内 部状態とは別に C P Uからの要求状態を示す内部状態と して状態 1 0 Ί 1 0 8がある。 状態 1 0 7は、 C P Uからのアクセス要求が受付可能な 状態である。 状態 1 0 8は C P Uが要求しているデータの準備ができて いないため、 C P Uをデータ待ちに している こ と を示す状態である。 ゥ エイ ト信号 WA I T—は状態 1 0 7から状態 1 0 8へ遷移する時と状態 1 0 8のときアサー トされ、 C P U 1 に通知される。  These are the internal states related to the prefetch state. Apart from these internal states, there is state 10Ί108 as an internal state indicating a request state from the CPU. State 107 is a state in which an access request from the CPU can be accepted. State 108 is a state in which the data requested by the CPU is not ready, and thus the CPU is waiting for data.エ イ Eight signal WAIT— is asserted at the time of transition from state 107 to state 108 and at state 108, and is reported to CPU1.
次に、 各状態の遷移を説明する。 状態管理部 5 2の初期状態は、 ま だ 一度も C P U 1 からのアクセス要求がなく 、 プリ フ ェ ッチされたデータ もな く 、 いつでも C P U 1 からのアクセス要求を受け付けられる状態に あるため、 状態 1 0 0及び状態 1 0 7 にある。  Next, transition of each state will be described. The initial state of the state management unit 52 is such that there is no access request from the CPU 1, there is no prefetched data, and the access request from the CPU 1 can be accepted at any time. It is in state 100 and state 107.
まず、 プリ フ ェ ッチに関する状態の遷移と しては、 状態 1 0 0から状 態 1 0 1 へ遷移する遷移条件は、 バススター ト信号 B S—がアサー トで あり 、 かつプリ フ エ ツチ可否判定結果信号 J U Gがアサ一トされること である。 即ち、 C P U 1 からのアクセス要求が発生し、 アクセスで指示 されたァ ドレスを含むチップセレク タ空間に対応したモー ドレジスタ 8 の値がプリ フ ェ ッチを行う状態を示している場合である。 これに対し、 状態 1 0 0から状態 1 0 5へ遷移する遷移条件は、 バススター ト信号 B S—がアサー トであ り 、 かつプリ フ ェ ッチ可否判定結果信号 J U Gが ネゲー トの場合である。 状態 1 0 1 から状態 1 0 2, 状態 1 0 2から状 態 1 0 3 , 状態 1 0 3 から状態 1 0 4 , 状態 1 0 4から状態 1 0 6 , 状 態 1 0 5 から状態 1 0 0へ遷移する条件は、 メモ リ シーケンサ 4からの データバリ ッ ド信号 D Vがアサー トである。 即ち、 各データ要求に対し て出力されるメモリ からのデータ が有効になった場合である。 状態 106 から状態 1 0 1 へ遷移する遷移条件は、 バススター ト信号 B S—がアサ ー ト又は状態 1 0 8 であ り 、 かつ、 比較結果信号 H I Τがネゲー ト、 か つ、 プリ フ ェ ッチ可否判定結果信号 J U Gがアサー トである。 即ち、 C P U 1 からのアクセスが発生し、 ア ドレスバッ フ ァ 5 5 に格納されて いる これま で先読み していたァ ドレスの範囲と今度のアクセスのァ ドレ スが重ならず、 かつ、 今度のアクセスがプリ フ ェ ッチを行う領域に対す るアクセスの場合である。 一方、 状態 1 0 6 から状態 1 0 5へ遷移する 遷移条件は、 バススター ト信号 B S—がアサー ト又は状態 1 0 8 であ り , かつ、 プリ フ ェ ッチ可否判定結果信号 J U Gがネゲー トの場合である。 これは、 状態 1 0 0から状態 1 0 5へ遷移する遷移条件と同じで、 CPU1 からのアクセスが発生し、 かつアクセスがプリ フ ェ ッチを行わない領域 に対するものであっ た場合である。 First, as for the state transition related to prefetching, the transition condition for transition from state 1001 to state 101 is that bus start signal BS— is asserted and prefetching is performed. That is, the judgment result signal JUG is asserted. In other words, this is a case where an access request from the CPU 1 is generated and the value of the mode register 8 corresponding to the chip selector space including the address specified by the access indicates a state in which prefetching is performed. On the other hand, the transition condition from the state 100 to the state 105 is that the bus start signal BS— is asserted and the prefetch availability judgment result signal JUG is negated. is there. State from state 101 to state 102, state from state 102 The conditions for transition from state 103, state 103 to state 104, state 104 to state 106, and state 105 to state 100 are as follows. Signal DV is asserted. That is, the data from the memory output for each data request becomes valid. The transition condition from the state 106 to the state 101 is that the bus start signal BS— is asserted or the state 108, the comparison result signal HI HI is negated, and the pre- Switch enable / disable determination result signal JUG is asserted. That is, an access from CPU 1 occurs, and the address range of the address previously read ahead stored in address buffer 55 does not overlap with the address of the next access, and This is the case when the access is to an area that performs prefetching. On the other hand, the transition condition from the state 106 to the state 105 is that the bus start signal BS— is asserted or the state 108, and the prefetch availability judgment result signal JUG is negative. In the case of This is the same as the transition condition for transition from state 100 to state 105, in which an access from CPU1 occurs and the access is to an area where prefetching is not performed.
次に、 状態 1 0 7 から状態 1 0 8への遷移条件は、 1 ) バススター ト 信号 B S—がアサ一卜でプリ フ エ ツチ可否判定結果信号 J U Gがネゲ一 卜であるか、 又は、 2 ) 比較器 5 4の比較結果信号 H I Tがアサー トで プリ フ X ツチ可否判定結果信号 J U Gがアサー ト、 かつ状態 1 0 1 , 1 0 2 , 1 0 3 , 1 0 4のいずれかの状態であ り 、 なおかつ C P U 1 の A D D Rと現在の状態によ り読み出すデータ がプリ フ ェ ッチバッフ ァ 6 にセッ ト されていないと判定された場合、 のいずれかである。 C P U 1 が読み出すデータ がプリ フ ェ ッチバッフ ァ 6 にセ ッ 卜されているかどう かは、 例えば、 内部状態が状態 1 0 2 であれば、 ア ドレスバッフ ァ 5 5 の示すア ドレスに格納されている値がプリ フ ェ ッチバッフ ァ 6に既にセ ッ 卜済であるかどう かによ り判別する こ とができる。 ま た、 内部状態が 状態 1 0 2であれば、 ア ドレスバッフ ァ 5 5の示すア ドレスとア ドレス バッフ ァ 5 5の示すァ ドレスの次に格納されている値がいずれもプリ フ エ ッチバッフ ァ 6 に既にセッ ト済であるかどうかによ り判別する ことが できる。 他の状態についても、 同様に して判別が可能である。 状態 108 から状態 1 0 7への遷移条件は、 必要なデータがプリ フ ェ ッチバッフ ァ 6 にセッ ト してあるか、 又は、 状態 1 0 5でデータノ リ ツ ド信号 D Vが アサー トである。 Next, the transition conditions from the state 107 to the state 108 are as follows: 1) The bus start signal BS- is an assert and the prefetch availability judgment result signal JUG is a negative, or 2) The comparison result signal HIT of the comparator 54 is asserted and the pref X switch enable / disable judgment result signal JUG is asserted, and any of the states 101, 102, 103, 104 If it is determined that the data to be read is not set in the prefetch buffer 6 according to the ADDR of the CPU 1 and the current state, either of the above is true. Whether the data to be read by the CPU 1 is set in the prefetch buffer 6 is determined by, for example, the address buffer 55 if the internal state is state 102. It can be determined based on whether or not the value stored in the address indicated by is already set in the prefetch buffer 6. If the internal state is state 102, the address indicated by the address buffer 55 and the value stored next to the address indicated by the address buffer 55 are both prefetch buffers. It can be determined based on whether or not it has already been set to 6. The other states can be similarly determined. The condition for transition from the state 108 to the state 107 is that necessary data is set in the prefetch buffer 6 or the data knowledge signal DV is asserted in the state 105.
バッフ ァ管理部 5 3は、 前述の状態管理部 5 2の内部状態を示す状態 信号 S Tと、 C P U 1 からのァ ドレスバス A D D Rの下位 4 ビッ 卜と、 比較器 5 4の比較結果信号 H I Tと を入力と し、 プリ フ ェ ッチバッフ ァ 6にデータ をセッ トするプリ フ ェ ツチノくッフ ァセ ッ ト信号 P B S E Tと 出力セレク タ 1 1 の出力選択信号 O P S E Lを出力する論理ブロ ックで ある。 信号 O P S E Lはプリ フ ェ ッチで先読みする 1 キャ ッ シュライ ン のデータ個数に対応して 0から 3の 4つの値を持ち、 信号 H I Tがネゲ ー ト している場合 0 を出力する。 ま た、 信号 H I Tがアサー ト している 場合、 ア ドレスバス A D D Rの下位 4 ビッ ト をデコー ド した結果を出力 する。 同様に、 プリ フ ェ ッチバッフ ァセ ッ ト信号 P B S E Tも、 0から 3の 4つの値を持ち、 状態信号 S Tの値によ り 、 状態管理部 5 2が第 4 図の状態 1 0 2である場合は 1 、 状態管理部 5 2が第 4図の状態 1 0 3 である場合には 2、 状態管理部 5 2が第 4図の状態 1 0 4である場合は 3、 そ してそれ以外の状態の場合には 0 をアサー トする。  The buffer management unit 53 includes a state signal ST indicating the internal state of the state management unit 52, the lower 4 bits of the address bus ADDR from the CPU 1, and the comparison result signal HIT of the comparator 54. Is a logic block that takes the input as an input and outputs the prefetch buffer set signal PBSET that sets data in the prefetch buffer 6 and the output selection signal OPSEL of the output selector 11. . The signal OPSEL has four values from 0 to 3 corresponding to the number of data of one cache line to be read ahead by prefetching, and outputs 0 when the signal HIT is negated. When the signal HIT is asserted, the result of decoding the lower 4 bits of the address bus ADDR is output. Similarly, the prefetch buffer set signal PBSET also has four values from 0 to 3, and the state management unit 52 is in the state 102 in FIG. 4 according to the value of the state signal ST. 1 if the state management unit 52 is in the state 103 in FIG. 4, 2 if the state management unit 52 is in the state 104 in FIG. 4, and otherwise. Asserts 0 in the state of.
第 5図は、 メモリ シーケンサ 4の動作を状態遷移図と して示したもの である。 状態 1 1 0はアイ ドル状態であ り 、 プリ フ ェ ッチ状態管理部 5 からの起動信号 R E Qを待っている状態を示す。 状態 1 1 1 は、 行ア ド レスアクセス状態を示し、 C P U 1 からアクセスされたァ ドレスに対応 する D RAM 7の R A Sァ ドレスをァ ドレスバス Aに出力 し、 行ァ ドレ スセレク ト信号 RA S—をアサー トする状態である。 状態 1 1 2は、 1 回目の列ァ ドレスアクセス状態を示し、 C P U 1 からアクセスされたァ ドレスに対応する D R AM 7の C A Sァ ドレスをァ ドレスバス Aに出力 し、 列ア ドレスセレク ト信号 C A S—をアサー トする状態である。 状態 1 1 3, 1 1 , 1 1 5は、 それぞれプリ フ ェ ッチによ り 先行して行う 2回目, 3回目, 4回目の行ア ドレスアクセス状態を示している。 メモ リ シーケンサ 4の初期状態は状態 1 1 0である。 状態 1 1 0から状態 1 1 1 への遷移条件は、 起動信号 R E Qのアサー トである。 これによ り D R AM 7へのアクセスが開始される。 FIG. 5 shows the operation of the memory sequencer 4 as a state transition diagram. The state 110 is the idle state, and the prefetch state management unit 5 It indicates the state of waiting for the start signal REQ from. State 1 1 1 indicates a row address access state, in which the RAS address of DRAM 7 corresponding to the address accessed from CPU 1 is output to address bus A, and row address select signal RAS -Is asserted. State 1 1 2 indicates the first column address access state, in which the DRAM 7 CAS address corresponding to the address accessed from CPU 1 is output to address bus A, and the column address select signal is output. CAS— is asserted. States 113, 111, and 115 indicate the second, third, and fourth row address access states that are performed prior to the prefetch, respectively. The initial state of the memory sequencer 4 is state 110. The transition condition from state 110 to state 111 is the assertion of the activation signal REQ. This starts access to DRAM 7.
状態 1 1 1 , 状態 1 1 2, 状態 1 1 3, 状態 1 1 4, 状態 1 1 5から 次の状態に遷移する遷移条件は、 D R AM 7のアクセス時間で決定され、 D R A M 7のアクセス時間が経過する毎に次の状態に遷移する。 特に状 態 1 1 2においては、 D R A M 7のアクセス時間が経過した時に、 プリ フ ェ ッチアクセス信号 P R Fがアサー ト していれば状態 1 1 2から状態 1 1 3へ遷移し、 ネゲー トであれば状態 1 1 2から状態 1 1 0へ遷移す る。 即ち、 D R AM 7からデータ を 1 つアクセス した後、 プリ フ ェ ッチ が指示されていれば、 引 き続き同じ R A Sァ ドレスの下で先読み対象と なるデータの C A Sア ドレスを出力 して、 1 キャ ッシュライ ン分のデー タ に対し連続してアクセスする ことになる。 なお、 データノ リ ツ ド信号 D Vは、 C A Sァ ドレスが出力され D R AM 7から読み出されたデータ が確定して 1 データ分のアクセスが完了する状態 1 1 2, 1 1 3, 1 1 4 , 1 1 5から次の状態への遷移の際にアサー ト される。 第 3図に第 1 図に示すメモリ コ ン トローラ 2の動作を示したタイ ミ ン グチャー トを示す。 第 1 図の C P U 1及びメモリ コ ン トローラ 2は、 第 1 図には図示されていないク ロ ック信号 C L Kに同期して動作するもの と し、 C P U 1 の C S 0—によ って選択される D RAMチップのァ ドレ ス空間に対応する領域 (以下、 C S 0 _領域と呼ぶ。 他も同様である ) は、 プリ フ ェ ッチ禁止モー ド、 C S 1—領域はプリ フ ェ ッチ可能モー ド に設定しているものとする。 The transition conditions for transitioning from state 1 1 1, state 1 1 2, state 1 1 3, state 1 1 4, state 1 15 to the next state are determined by the DRAM 7 access time, and the DRAM 7 access time Each time elapses, the state transits to the next state. In particular, in state 112, when the access time of DRAM 7 elapses, the state transits from state 112 to state 113 if the prefetch access signal PRF is asserted, and if it is negated. Transition from state 1 1 2 to state 1 110 is made. That is, after one data is accessed from the DRAM 7, if the prefetch is specified, the CAS address of the data to be prefetched is continuously output under the same RAS address, and One cache line of data will be accessed continuously. Note that the data knowledge signal DV is in a state where the CAS address is output, the data read from the DRAM 7 is determined, and the access for one data is completed 1 1 2, 1 1 3, 1 1 4, Asserted on transition from 1 15 to the next state. FIG. 3 is a timing chart showing the operation of the memory controller 2 shown in FIG. The CPU 1 and the memory controller 2 shown in FIG. 1 operate in synchronization with a clock signal CLK not shown in FIG. 1, and are selected by CS 0— of the CPU 1. The area corresponding to the address space of the DRAM chip (hereinafter referred to as the CS0_ area; the same applies to other areas) is the prefetch disabled mode, and the CS1 area is the prefetch area. It is assumed that the switchable mode is set.
はじめに、 C P U 1 は、 C S 0—領域のア ドレス A D D R 1 にァクセ スするものとする。 この場合、 B S_, C S 0—をアサー ト し、 A D D Rにはア ドレス A D D R 1 を出力する。 メモリ コ ン トローラ 2のプリ フ ェ ツチ状態管理部 5は、 A D D R 1 のデータが準備できる まで、 即ちデ ータバス D A T上でデータが確定する まで WA I T—をアサー トする。 同時にメモリ シーケンサ 4に R E Qをアサ一ト して、 アクセスの発生を 通知する。 この時、 C S O—領域は、 プリ フ ェ ッチ禁止モー ドに設定し ているので、 プリ フ ェ ッチアクセス信号 P R Fはアサー ト しない。 メモ リ シーケンサ 4は、 C P U 1 からアクセスされたア ドレス AD D R 1 に 対応する行ァ ドレス R 1 をァ ドレスバス Aに出力 し、 R A S—をアサ一 トする。 次に、 A D D R 1 の列ア ドレス C 1 をア ドレスノ ス Aに出力 し, C A S—をアサー ト して D R AM 7 に対するアクセスア ドレスを確定す る。 このメモリ コ ン トローラ 2の動作によ り D R AM 7は A D D R 1 に 対応するデータ D 1 をメモリ データバス Dに出力する。 そこでメモリ シ 一ケンサ 4はメモリ データバス Dにデータ D 1 が出力されたタイ ミ ング で、 フ ェ ッチ状態管理部 6 にデ一タ ノくリ ッ ド信号 D Vをアサー トする。 プリ フ ェ ッチ状態管理部 5では、 データバリ ッ ド信号 D Vがアサー ト されたこ とによ り 、 ウェイ ト信号 WA I T .をネゲー ト し、 セレクタ 1 1 は C P U 1 のプロセ ッサデータノ ス D A Tに、 メモリ データバス D に出力されているデータ D 1 を出力する。 First, CPU 1 shall access address ADDR 1 in the CS 0— area. In this case, BS_, CS 0— is asserted, and the address ADDR 1 is output to ADDR. The prefetch state management unit 5 of the memory controller 2 asserts WAIT—until the data of ADDR1 is ready, that is, until the data is determined on the data bus DAT. At the same time, REQ is asserted to the memory sequencer 4 to notify the occurrence of access. At this time, the prefetch access signal PRF is not asserted because the CSO area is set to the prefetch disable mode. The memory sequencer 4 outputs the row address R1 corresponding to the address ADDR1 accessed from the CPU 1 to the address bus A, and asserts RAS—. Next, the column address C1 of ADDR1 is output to address node A, and CAS— is asserted to determine the access address to DRAM 7. By the operation of the memory controller 2, the DRAM 7 outputs the data D1 corresponding to ADDR1 to the memory data bus D. Therefore, the memory sequencer 4 asserts the data read signal DV to the fetch state manager 6 at the timing when the data D1 is output to the memory data bus D. The prefetch state management unit 5 negates the wait signal WAIT. In response to the assertion of the data valid signal DV, and selects the selector. 11 outputs the data D 1 output to the memory data bus D to the processor data node DAT of the CPU 1.
次に、 C P U 1 が C S 1 —領域のア ドレス A D D R 5 にアクセスする ものとする。 C S 1 —領域はプリ フ ェ ッチ可能モー ドに設定しているの で、 プリ フ ェ ッチ状態管理部 5 は P R F をアサー トする。 メモリ シーケ ンサ 4は、 ァ ドレス A D D R 5 の対応する行ァ ドレス R 5 をァ ドレスバ ス Aに出力 し、 R A S—をアサ一 トする。 続いて、 A D D R 5 に対応す る列ァ ドレス C 5 を出力 し C A S—をアサー トする。 こ の時 P R Fがァ サー トされているため更に、 ア ドレスバス Aに C 6 , C 7 , C 8 と連続 に出力 し、 C A S—も各列ア ドレスの出力に対応してアサー ト Zネゲー 卜を同様に繰り返す。 こ こで、 列ア ドレス C 6 は、 列ア ドレス C 5 に 1 加算した値であ り 、 C 7 は C 6 に 1 加算、 C 8 は C 7 に 1 加算したもの である。 ま た、 行ア ドレス R 5 と列ア ドレス C 5 に対応するデータが D 5であ り 、 行ア ドレス R 5 と列ア ドレス C 6 に対応するデータ が D 6 であ り 、 行ア ドレス R 5 と列ア ドレス C 7 に対応するデータが D 7 であ リ 、 行ア ドレス R 5 と列ア ドレス C 8 に対応するデータが D 8 である。 そ して、 これらデータ D 5 〜 D 8 が連続してメモリ データバス Dに出力 される。  Next, it is assumed that CPU 1 accesses the address ADDR5 of the CS1-region. Since the CS1—area is set in the prefetch enabled mode, the prefetch state management unit 5 asserts PRF. The memory sequencer 4 outputs the row address R5 corresponding to the address ADDR5 to the address bus A, and asserts RAS—. Subsequently, a column address C5 corresponding to ADDR5 is output and CAS— is asserted. At this time, since the PRF is asserted, C6, C7, and C8 are continuously output to the address bus A, and CAS— is also asserted in response to the output of each column address. Repeat the steps in the same way. Here, the column address C 6 is a value obtained by adding 1 to the column address C 5, C 7 is obtained by adding 1 to C 6, and C 8 is obtained by adding 1 to C 7. The data corresponding to the row address R5 and the column address C5 is D5, the data corresponding to the row address R5 and the column address C6 is D6, and the row address is D5. The data corresponding to R5 and column address C7 is D7, and the data corresponding to row address R5 and column address C8 is D8. Then, these data D5 to D8 are continuously output to the memory data bus D.
ま た、 C S 1 —領域をプリ フ ェ ッチ可能モー ドに設定し、 この CS1— 領域に格納する命令やデータが、 配列や行列演算に用いるデータ のよ う に連続的にアクセスする可能性が非常に大き く 、 プリ フ ェ ッチを行う こ とが有効なデータ か命令である場合、 次に、 A D D R 5 に続いて ADDR6 に対するアクセスが生じる可能が高い。 こ の A D D R 6 の行ァ ドレスは R 5であ り 、 列ア ドレスは C 6 である。 つま り 、 A D D R 6 に対応する データは D 6 であ り 、 仮に C P U 1 が次に A D D R 6 にアクセスすると . このデータ は既に D R AM 7 から読み出 しプリ フ ェ ッチバッフ ァ 6 に格 納してあるため、 C P U 1 にウェイ ト信号 WA I T—をアサー トする こ となく プロセ ッサデータバスに D 6 を出力する こ とが可能になる。 さ ら に、 C S 0—領域に対しては、 プリ フ ェ ッチ動作を行わないため、 メモ リ データバス Dに D 1 を出力 してから D 5 を出力する までの間、 DRAM7 はアイ ドル状態になる。 つま り 、 新たに不要なメモリ アクセスが生じな いため、 D R AM 7 の効率が向上し、 システム全体のデータ処理能力が 向上する。 Also, it is possible to set the CS1 area to the prefetchable mode, and the instructions and data stored in the CS1 area can be accessed continuously like data used for array or matrix operations. If the fetch is very large and prefetching is a valid data or instruction, then access to ADDR5 followed by ADDR6 is likely to occur. The row address of ADDR6 is R5, and the column address is C6. In other words, the data corresponding to ADDR 6 is D6, and if CPU 1 next accesses ADDR 6, Since this data has already been read from the DRAM 7 and stored in the prefetch buffer 6, it is possible to output D6 to the processor data bus without asserting the wait signal WAIT— to the CPU 1. And become possible. In addition, since the prefetch operation is not performed for the CS0—area, DRAM7 is idle between the time when D1 is output to the memory data bus D and the time when D5 is output. State. In other words, there is no additional unnecessary memory access, which increases the efficiency of DRAM 7 and increases the data processing capacity of the entire system.
以上の説明においては、 チップセレク ト信号は D R A M 7 を所定の領 域に分割した際に、 C P U 1 からのアクセスがこれら分割した領域のど こに対するアクセスなのかを識別する意味で用いて きたが、 チップセレ ク ト信号をその本来の意味で用いて、 メモリ を構成する D R AMチップ 自体を区別するよ う に用いてもよい。 この場合、 メモリ チップ毎にプリ フ ェ ッチの実行 非実行を制御する ことになる。 これによ リ メモリ構成 に応じたプリ フ ェ ッチの制御を行う ことが可能となる。  In the above description, the chip select signal has been used to identify, when the DRAM 7 is divided into a predetermined area, the access from the CPU 1 to the divided area. The chip select signal may be used in its original sense to distinguish the DRAM chip itself that constitutes the memory. In this case, execution / non-execution of prefetch is controlled for each memory chip. This makes it possible to control the prefetch according to the re-memory configuration.
第 6図は、 第 1 図で説明 したモー ドレジスタ 8 の設定を実際にァクセ ス したァ ドレスを元に変更を行う機能を備えた実施の形態である。 この 実施の形態ではプリ フ ェ ッチ状態管理部 5 の内部に、 モー ドレジスタ 8 の値を変更するアクセス監視部 7 0 を備えている。 アクセス監視部 7 0 は、 チップセレク ト信号 C S 0—, C S 1 —, C S 2—, バススター ト 信号 B S―、 そ して比較結果信号 H I Tを入力と し、 出力と してチッ プ セレク ト信号 C S 0—, C S 1 —, C S 2—に対応するモー ドレジスタ 8 の値をそれぞれセ ッ トする信号である Set 0, Set 1 , Set 2 と、 同様 に リ セッ 卜する信号である Rset 0 , Rset 1 , Rset 2 のいずれか 1 っをァ サ一 卜する。 第 7 図はアクセス監視部 7 0 の内部の概要を示した図である。 ァクセ ス監視部 7 0 は、 連続アクセス判定論理 7 1 とモー ドレジスタ選択論理 7 2 で構成される。 第 8 図は連続アクセス判定論理 7 1 の動作を説明す るための状態遷移図である。 連続アクセス判定論理 7 1 の初期状態は、 状態 9 1 0である最初にアクセスが行われる 1 回目の状態である。 次に C P U 1 からのアクセスが開始されると、 前回アクセス したァ ドレスと 今回アクセスするァ ドレスとが下位 4 ビッ ト を除いて一致している こ と を示している H I T信号がアサー ト していて、 なおかつ、 前回アクセス したチップセレク ト空間と同一チップセレク ト信号がアサー ト している 場合、 即ち最初のアクセスと同 じキヤ ッ シユライ ンの範囲で続いてァク セスが行われた場合、 状態 9 1 1 である連続 2 回目アクセス状態へ遷移 する。 この状態は、 同一プリ フ ェ ッチ範囲に対して連続して 2 回のァク セスが行われた状態である。 この状態 9 1 1 において、 更に C P U 1 が 同一チップセレク ト空間にアクセス し、 同様に前回アクセス したァ ドレ スと今回アクセスするァ ドレスが下位 4 ビッ トを除いて一致している こ と を示す H I T信号がアサー ト していると、 状態 9 1 2 である連続 3 回 目アクセス状態に遷移する。 この状態は即ち連続 3 回のアクセスが同じ プリ フ ェ ッチ範囲に対して行われた状態である。 ま た連続 3 回目ァクセ ス状態に遷移する条件が成立しない C P U 1 のアクセスが生じる初期状 態である状態 9 1 0 に遷移する。 状態 9 1 2 の連続 3 回目アクセス状態 においても、 同様に、 C P U 1 が同一チップセレク ト空間にアクセス し、 更に、 H I T信号がアサー ト していると、 状態 9 1 3 である連続 4回目 アクセス状態に遷移し、 一方、 状態 9 1 3 に遷移しない C P U 1 のァク セスが生じると状態 9 1 0 に遷移する。 FIG. 6 shows an embodiment provided with a function of changing the setting of the mode register 8 described in FIG. 1 based on the actually accessed address. In this embodiment, an access monitoring unit 70 for changing the value of the mode register 8 is provided inside the prefetch state management unit 5. The access monitoring unit 70 receives the chip select signals CS 0—, CS 1—, CS 2—, the bus start signal BS—, and the comparison result signal HIT as input, and outputs the chip select signal as output. Set 0, Set 1, and Set 2 are signals that set the value of mode register 8 corresponding to signals CS 0—, CS 1—, and CS 2—, respectively, and Rset 0 is a signal that resets similarly. , Rset 1 or Rset 2 is asserted. FIG. 7 is a diagram showing an outline of the inside of the access monitoring unit 70. The access monitor 70 includes a continuous access determination logic 71 and a mode register selection logic 72. FIG. 8 is a state transition diagram for explaining the operation of the continuous access determination logic 71. The initial state of the continuous access determination logic 71 is the first state in which access is performed first, which is state 910. Next, when access from CPU 1 starts, the HIT signal, which indicates that the previously accessed address matches the address accessed this time except for the lower 4 bits, is asserted. In addition, if the same chip select signal as the previously accessed chip select space is asserted, that is, if the next access is made within the same cache line as the first access, Transit to the second consecutive access state, which is state 9 1 1. In this state, two consecutive accesses are made to the same prefetch range. In this state 911, CPU 1 further accesses the same chip select space, indicating that the previously accessed address and the currently accessed address are identical except for the lower 4 bits. When the HIT signal is asserted, the state transits to the third consecutive access state, state 912. In this state, three consecutive accesses are made to the same prefetch range. Also, the condition for transition to the third consecutive access state is not satisfied. The state transits to state 910, which is the initial state in which CPU 1 accesses occur. Similarly, in the third consecutive access state in state 912, if CPU 1 accesses the same chip select space and the HIT signal is asserted, the fourth consecutive access in state 913 is performed. The state transits to state 910. On the other hand, when an access of CPU 1 that does not transit to state 913 occurs, the state transits to state 910.
状態 9 1 3 では、 C P U 1 がアクセスを開始すると状態 9 1 0 に遷移 する。 しかし状態 9 1 3 から状態 9 1 0へ遷移する時、 連続アクセス判 定論理 7 1 は、 プリ フ ェ ッチ可能信号 P F O Nをアサー トする。 ま た、 状態 9 1 1 又は状態 9 1 2 から状態 9 1 0 に遷移する時には、 連続ァク セス判定論理 7 1 は、 プリ フ ェ ッチ禁止信号 P F O F F をアサー トする 即ち、 1 キャ ッ シュライ ン分のデータ をアクセス したと き、 そのァクセ スの全てが同一プリ フ エ ツチ範囲内に対するアクセスであれば、 そのァ クセスが行われたチップセレク ト空間にはプリ フ ェ ッチが有効なデータ が格納されているものと判断して、 連続アクセス判定論理 7 1 はプリ フ エ ッチ可能信号 P F 0 Nをアサー トするが、 そう でなければ、 そのチッ プセレク ト空間にはプリ フ ェ ッチが無効であると判断して、 プリ フ ェ ツ チ禁止信号 P F O F F をアサー トする。 In state 9 13, transition to state 9 10 when CPU 1 starts access I do. However, when transitioning from state 913 to state 910, the continuous access decision logic 71 asserts the prefetchable signal PFON. When transitioning from state 911 or state 912 to state 91, the continuous access decision logic 71 asserts the prefetch disable signal PFOFF, that is, one cache line. If all of the accesses are made within the same prefetch range when accessing the same amount of data, the prefetch is valid in the chip select space where the access was made. Upon determining that data is stored, the continuous access determination logic 71 asserts the prefetch enable signal PF0N, but otherwise, the preselection space is stored in the chip select space. Judge that the switch is invalid and assert the prefetch disable signal PFOFF.
モー ドレジスタ選択論理 7 2 は、 前回アクセス したチップセレク ト信 号を保持する機能を備え、 P F O N信号がアサー トすると、 保持してい るチップセレク ト信号に対応するモー ドレジスタ 8 のセ ッ ト信号である Set 0 , Set 1 , Set 2 のいずれかをアサー トする。 ま た P F O F F信号 がアサー トすると、 保持しているチップセレク ト信号に対応するモー ド レジスタ 8 のリ セッ ト信号である Rset 0, Rset 1 , Rset 2 のいずれかを アサー トする。 なお、 モー ドレジスタ 8 はセッ トされると、 プリ フ ェ ツ チアクセス可能モー ドを示し、 リ セッ トするとプリ フ ェ ッチアクセス禁 止モー ドを示すものとする。 この様に、 モー ドレジスタ 8 の設定を実際 にアクセス したア ドレスの状態に基づいて変更し、 各チップセレク ト空 間に対してプリ フェ ッチ処理の実行の有無を自動的に設定する ことがで きる。  The mode register selection logic 72 has the function of retaining the chip select signal accessed last time.When the PFON signal is asserted, the mode register 8 sets the signal corresponding to the retained chip select signal. Assert any one of Set 0, Set 1, and Set 2. When the PFOFF signal is asserted, one of Rset0, Rset1, and Rset2, which is the reset signal of the mode register 8 corresponding to the held chip select signal, is asserted. When the mode register 8 is set, it indicates the prefetch access enabled mode, and when reset, it indicates the prefetch access prohibition mode. In this way, it is possible to change the setting of mode register 8 based on the state of the address actually accessed, and to automatically set whether or not to execute prefetch processing for each chip select space. it can.
以上の実施の形態ではいずれもメモリ に D R A Mを用いた場合を説明 してきたが、 本発明はメモリ が D R A Mに限定されるものではなく 、 S D RAM, P B R AM等、 一般の半導体メモリ に代表される記憶素子 に適用する こ とができ、 その場合の構成も本実施の形態と同様のものと なる。 ま た、 上述の実施の形態においてはアクセスを行う データは同 じ D R AMに連続して格納されているものと して説明 してきたが、 メモリ はイ ンターリ ーブ構成を採る ことも可能である。 この場合は、 連続する ァ ドレスを構成するメモリ チップ同士のプリ フ ェ ッチの実行 非実行が 一致するよ う にモー ドレジスタ 8 を設定する ことによ り実現できる。 前述の実施の形態では、 いずれもプリ フ ェ ツチの可否を識別するため に C P U 1 からのチップセレク ト信号を用いているが、 システムによ つ ては、 C P Uがアクセスするァ ドレスの上位ビッ トによ ってチップセレ ク ト信号が決ま るため、 C P U 1 からプリ フ ェ ッチ状態管理部 5への入 カはァ ドレスバス A D D Rとバススター ト信号 B S—だけでもかまわな い。 この場合アクセス判定部 5 6では、 ア ドレスバス AD D Rからのァ ドレスデータ を元にチップセレクタ空間を求める処理が必要となる。 こ れによ り 、 C P U 1 の信号ピンの数を減らすことができる。 しかし、 ァ ドレスバス A D D Rに出力されるア ドレスデータが静定する時間とア ド レスデータからチップセレクタ空間を求めるための処理によ り遅延が発 生して しま う 。 In each of the above embodiments, the case where a DRAM is used as a memory has been described. However, the present invention is not limited to a DRAM as a memory. The present invention can be applied to storage elements typified by general semiconductor memories such as SDRAM and PBRAM, and the configuration in that case is the same as that of the present embodiment. Further, in the above embodiment, the data to be accessed has been described as being continuously stored in the same DRAM, but the memory may have an interleaved configuration. . In this case, it can be realized by setting the mode register 8 so that the execution and non-execution of the prefetch between the memory chips constituting the continuous addresses are the same. In the above embodiments, the chip select signal from the CPU 1 is used to identify whether prefetching is possible or not. However, depending on the system, the upper bits of the address accessed by the CPU may be used. Since the chip select signal is determined by the CPU, the input from the CPU 1 to the prefetch state management unit 5 may be only the address bus ADDR and the bus start signal BS—. In this case, the access determination unit 56 needs to perform processing for obtaining the chip selector space based on the address data from the address bus ADDR. Thus, the number of signal pins of CPU 1 can be reduced. However, a delay occurs due to the time for the address data output to the address bus ADDR to settle and the processing for obtaining the chip selector space from the address data.
ま た、 前述の実施の形態では、 プリ フ ェ ッチを制御する領域の単位が チップセレク ト空間と一致していたが、 例えばプリ フ ェ ッチ状態管理部 5のモー ドレジスタ 8 を、 各領域の境界を格納するァ ドレスレジスタ と し、 プリ フ ェ ッチ状態管理部 5に入力される C P U 1 のアクセス したァ ドレス A D D Rの値をモー ドレジスタ 8に格納された領域境界のァ ドレ スと比較する こと によ り 、 任意サイ ズの領域毎にプリ フ ェ ッチを制御す る ことができる。 この場合、 メモリ を 2つの領域に分ける場合はモー ド レジスタ 8 が 1 つ、 メモリ を 3 つの領域に分ける場合はモー ドレジスタ 8 が 2 つと言う よ う に、 モー ドレジスタ 8 は分割する領域の数一 1 個必 要にな り 、 ま たそれだけァ ドレス A D D Rの値との比較が増える こ と に なるため、 アクセス判定部 5 6 における処理が複雑にな り 、 ま たレジス タ数も増える ことから回路規模が大き く なつて しま う 。 Further, in the above-described embodiment, the unit of the area for controlling the prefetch matches the chip select space. For example, the mode register 8 of the prefetch state management unit 5 may be The address register that stores the boundary of the area is used.The address ADDR value accessed by the CPU 1 input to the prefetch state management unit 5 is used as the address of the area boundary stored in the mode register 8. By performing the comparison, it is possible to control the prefetch for each area of an arbitrary size. In this case, the mode is used to divide the memory into two areas. If register 1 is divided into three areas and the memory is divided into three areas, mode register 8 is required for each divided area, so that mode register 8 is divided into two. Since the number of comparisons with this value increases, the processing in the access determination unit 56 becomes complicated, and the number of registers increases, resulting in an increase in circuit scale.
本発明においては、 プリ フ ェ ッチを行う ことが有効なデータ を格納す るメモリ領域と、 プリ フ ェ ッチを行う と不必要なアクセスが多発するデ ータ を格納するメモリ 領域を、 異なるチップセ レク ト空間に配置してい るが、 プリ フ ェ ッチを行う ことが有効なデータ と、 プリ フ ェ ッチを行う と不必要なアクセスが多発するデータ を分類しない場合、 以下のよ う に プログラムを作成する。  In the present invention, a memory area for storing data that can be effectively prefetched and a memory area for storing data that is frequently accessed unnecessarily when prefetching is performed include: In the case where data that is placed in different chip select spaces but data that is effective for prefetching and data that is frequently accessed unnecessarily after prefetching are not classified are as follows: Create a program as follows.
まずプログラムの初期化処理の際に、 全てのモー ドレジスタ 8 をプリ フェ ッチアクセス可能モー ドに予め設定しておく 。 その後、 処理対象と なるデータがプリ フ ェ ッチを行う と不必要なアクセスが多発するデータ である処理を実行する場合、 その処理を行う 直前に、 該当するデータ を 格納するァ ドレスを示すチッ プセレク 卜信号に対応するモー ドレジスタ 8 をプリ フ 工 ツチアクセス禁止モー ドに設定する命令を記述しておく 。 更に、 プリ フ 工 ツチを行う と不必要なアクセスが多発するデータの処理 が終了 した時、 先にプリ フェ ッチアクセス禁止モー ドにセ ヅ 卜 したモー ドレジスタ 8 の値をプリ フ ェ ッチアクセス可能モー ドに戻す命令をその 処理の終わり に記述しておく 。 これによ り プログラムで明示的にプリ フ エ ッチを実行するか否かを記述する こ とができる。  First, at the time of program initialization processing, all the mode registers 8 are set in advance to a prefetch accessible mode. After that, when performing a process in which the data to be processed is data in which unnecessary access frequently occurs when prefetching is performed, immediately before performing the process, a chip indicating an address in which the corresponding data is stored. An instruction to set the mode register 8 corresponding to the select signal to the prefetch access disabled mode is described. Furthermore, when the processing of data that is frequently accessed when prefetching is completed is completed, the value of the mode register 8 that was previously set to the prefetch access prohibition mode is set to the prefetch access mode. Write the instruction to return to the end of the processing. This makes it possible to explicitly describe whether or not to execute prefetching in the program.
なお、 以上の実施の形態においては、 メモリ コ ン ト ローラ 2 は C P U 1 と独立して設けられていたが、 メモリ コ ン トローラ 2 内のプリ フ ェ ツ チを制御するメ モ リ シーケンサ 4 , プリ フ ェ ッチ状態管理部 5 , プリ フ エ ツチノ ッフ ァ 6 , セレクタ 1 1 は、 キャ ッ シュメモリ 2 0 と主メモリ D R A M 7 の間にあればよ く 、 キャ ッシュメモリ 2 0 とともに C P U 1 内に設けてもよい。 逆に、 キャ ッ シュメモリ 2 0 は C P Uに対して外付 けで設けても良い。 In the above embodiment, the memory controller 2 is provided independently of the CPU 1. However, the memory sequencer 4, which controls the prefetch in the memory controller 2, Prefetch state management unit 5, prefetch The etch buffer 6 and the selector 11 may be provided between the cache memory 20 and the main memory DRAM 7, and may be provided in the CPU 1 together with the cache memory 20. Conversely, the cache memory 20 may be provided externally to the CPU.
以上説明したよう に本発明によ って、 プログラムやデータ を格納する 領域を分割し、 各領域毎にプリ フ ェ ッチを行うか否かを制御する こ とが 可能になる。 よって、 データアクセスにおいてもプリ フ ェ ッチ機能を動 作させると有効に動作するデータが格納された領域に対するアクセス場 合にはプリ フ ェ ッチ機能を動作させ、 プリ フ ェ ッチアクセス機能を動作 させると不必要なデータ をプリ フ ェ ッチして しまいメモリ アクセス性能 を低下させて しま う データが格納された領域に対するアクセス場合には プリ フ ェ ッチ機能を抑止する こ とによ り 、 メモリ アクセスの効率を向上 する ことが可能になる。 産業上の利用可能性  As described above, according to the present invention, it is possible to divide an area for storing programs and data and to control whether or not to prefetch each area. Therefore, in the data access, when the prefetch function is activated, the prefetch function is activated when the data stored in the area that stores data is accessed, and the prefetch access function is activated. If this is done, unnecessary data will be prefetched and memory access performance will be degraded.When accessing an area where data is stored, the prefetch function will be suppressed. The efficiency of memory access can be improved. Industrial applicability
以上のよ う に、 本発明にかかるメモリ 制御装置は、 データアクセスに おいてプリ フ ェ ッチ機能を制御する こと によ り 、 効率の良いメモリ シス テムと して有用であ り 、 データ処理装置のメモリ 制御に用いるのに適し ている。  As described above, the memory control device according to the present invention is useful as an efficient memory system by controlling the prefetch function in data access, and is useful for data processing. Suitable for memory control of equipment.

Claims

請 求 の 範 囲 The scope of the claims
1 . プロセ ッサとメモリ の間に配置され、 プロセ ッサからメモリ へァク セスする際、 先読みを行う プリ フ ェ ッチ手段と、 プリ フ ヱ ツチ結果を格 納する記憶手段を備えたメモリ 制御装置において、  1. It is located between the processor and the memory, and has a prefetching means for prefetching and a storage means for storing the prefetch result when accessing the memory from the processor. In the memory controller,
前記メモリ制御装置は、 プロセッサからメモリ に対するアクセスの際 にプリ フ ェ ッチを行うか否かを決定するプリ フェ ッチ管理手段を備え、 前記メモリ のア ドレス空間は複数の管理領域に分割され、  The memory control device includes a prefetch management unit that determines whether to perform prefetching when the processor accesses the memory, and an address space of the memory is divided into a plurality of management areas. ,
前記プリ フ ェ ッチ管理手段は、 前記各管理領域毎にプリ フ ェ ッチを制 御するためのレジスタ を備え、  The prefetch management means includes a register for controlling the prefetch for each of the management areas,
前記プロセッサから前記メモリ に対してアクセスが行われた時、 ァク セスするア ドレスが含まれる管理領域に対応する前記レジスタの値に基 づき、 当該アクセスにおいてプリ フ ェ ッチを行うか否かを決定する こと を特徴とするメモ リ 制御装置。  When the processor accesses the memory, based on the value of the register corresponding to the management area including the address to be accessed, whether or not to prefetch in the access, A memory control device characterized by determining the following.
2 . 前記プロセッサは前記メモリ の記憶素子を選択する選択信号を出力 し、  2. The processor outputs a selection signal for selecting a storage element of the memory,
前記メモリ のァ ドレス空間は、 該選択信号に対応して前記管理領域に 分割され、  The address space of the memory is divided into the management area according to the selection signal,
プロセ ッサからのアクセスにおいては、 前記選択信号に基づき前記レ ジスタの値が決定される こ と を特徴とする請求の範囲第 1 項記載のメモ リ 制御装置。  2. The memory control device according to claim 1, wherein in access from a processor, a value of the register is determined based on the selection signal.
3 . 前記プリ フ ェ ッチ管理手段は、 同一の前記管理領域に対するプロセ ッサからのアクセスが所定の回数以上行われた場合、 当該管理領域に対 応する レジスタ を当該管理領域に対してプリ フ ェ ッチを行う よ う に設定 する手段を備えたこと を特徴とする請求の範囲第 1 項記載のメモ リ 制御 3. When the processor accesses the same management area a predetermined number of times or more, the prefetch management means pre-registers the register corresponding to the management area with respect to the management area. 2. The memory control according to claim 1, further comprising means for setting to perform fetching.
4 . 前記プロセ ッサは前記メモリ の記憶素子を選択する選択信号を出力 し、 4. The processor outputs a selection signal for selecting a storage element of the memory,
前記管理領域は、 メモリ を構成する記憶素子であ り 、  The management area is a storage element forming a memory,
プロセッサからのアクセスにおいては、 アクセス対象となる記憶素子 に基づき前記レジスタの値が決定される こ と を特徴とする請求の範囲第 In an access from a processor, a value of the register is determined based on a storage element to be accessed.
1 項記載のメモリ 制御装置。 The memory controller according to item 1.
5 . 前記プリ フ ヱ ツチ管理手段は、 プロセ ッサからの所定の回数の連続 したアクセスが同一のプリ フ ェ ッチ範囲に対して行われた場合、 当該プ リ フ エ ツチ範囲を含む管理領域に対応する前記レジスタ を当該管理領域 に対してプリ フ ェ ッチを行う よ う に設定する手段を備えたこ と を特徴と する請求の範囲第 1 項記載のメモリ 制御装置。  5. When the predetermined number of consecutive accesses from the processor are performed to the same prefetch range, the prefetch management means includes a management including the prefetch range. 2. The memory control device according to claim 1, further comprising: means for setting the register corresponding to an area so as to prefetch the management area.
6 . 演算処理装置とメモリ を備えたプログラマブル · コ ン ト ローラであ つて、 当該演算処理装置から前記メ モ リ へアクセスする際、 先読みを行 う プリ フ ェ ッチ手段と、 当該プリ フ ェ ッチ手段によるプリ フ ェ ッチ結果 を格納する記憶手段を備えたプログラマブル · コ ン ト ローラにおいて、 前記演算処理装置が前記メモリ に対するアクセスの際に、 前記プリ フ エ ッチ手段がプリ フ ェ ッチを行うか否かを決定するプリ フ ェ ッチ管理手 段を備え、  6. A programmable controller having an arithmetic processing unit and a memory, wherein when accessing the memory from the arithmetic processing unit, prefetch means for prefetching, and the prefetch unit In a programmable controller provided with storage means for storing a result of prefetching by the switching means, when the arithmetic processing unit accesses the memory, the prefetching means controls the prefetching. Equipped with prefetch management means to determine whether or not to perform
当該プリ フ ェ ッチ管理手段は、 ァ ドレス空間が複数の管理領域に分割 された前記メモリ の各管理領域毎にプリ フ エ ツチを制御するためのレジ スタ を備え、 アクセスするァ ドレスが含まれる管理領域に対応する前記 レジスタの値に基づき、 当該アクセスにおいてプリ フ ェ ッチを行う か否 かを決定する こと  The prefetch management means includes a register for controlling prefetch for each management area of the memory in which an address space is divided into a plurality of management areas, and includes an address to be accessed. To determine whether to perform prefetching in the access based on the value of the register corresponding to the management area to be accessed.
を特徴とするプログラマブル · コ ン トローラ。 A programmable controller.
7 . プロセ ッサからメモリ へアクセスする際、 先読みを行う プリ フ ェ ツ チを行う機能を備えたメモリ 制御装置におけるメモリ 制御処理であって 以下の処理を備える。 7. Prefetches to read ahead when accessing memory from the processor Memory control processing in a memory control device having a function of performing a
前記プロセ ッサから前記メモリ に対してアクセスが行われる時、 複数の管理領域にァ ドレス空間が分割されている前記メモリ の内、 当 該アクセスが行われる管理領域を求める処理と、  When accessing the memory from the processor, a process of determining a management area to be accessed in the memory in which the address space is divided into a plurality of management areas;
前記メモリ の管理領域別に、 アクセスが行われた回数をカウ ン トする 処理と、  A process of counting the number of accesses performed for each management area of the memory;
同一の前記管理領域に対するプロセ ッサからのアクセスが所定の回数 以上行われたこと を検出する処理と、  Processing for detecting that the processor has accessed the same management area by a predetermined number of times or more;
所定回数以上のアクセスが行われた当該管理領域に対応する レジスタ の値を当該管理領域に対してアクセスが行われた際にはプリ フ ェ ッチを 行う よ う に設定する処理。  A process of setting a register value corresponding to the management area that has been accessed a predetermined number of times or more so as to perform prefetching when the management area is accessed.
PCT/JP1999/003669 1999-07-07 1999-07-07 Memory controller WO2001004760A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP1999/003669 WO2001004760A1 (en) 1999-07-07 1999-07-07 Memory controller
JP2001510096A JP3956698B2 (en) 1999-07-07 1999-07-07 Memory control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP1999/003669 WO2001004760A1 (en) 1999-07-07 1999-07-07 Memory controller

Publications (1)

Publication Number Publication Date
WO2001004760A1 true WO2001004760A1 (en) 2001-01-18

Family

ID=14236172

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1999/003669 WO2001004760A1 (en) 1999-07-07 1999-07-07 Memory controller

Country Status (2)

Country Link
JP (1) JP3956698B2 (en)
WO (1) WO2001004760A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007500402A (en) * 2003-05-07 2007-01-11 フリースケール セミコンダクター インコーポレイテッド Data processing system with peripheral device access protection

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04270431A (en) * 1990-03-27 1992-09-25 Digital Equip Corp <Dec> Memory system of data processing apparatus
JPH04326437A (en) * 1991-04-26 1992-11-16 Mitsubishi Electric Corp Information processor
JPH0628180A (en) * 1991-07-30 1994-02-04 Hitachi Ltd Prefetch buffer
JPH06103169A (en) * 1992-09-18 1994-04-15 Nec Corp Read data prefetching mechanism for central arithmetic processor
JPH06295263A (en) * 1993-04-08 1994-10-21 Mitsubishi Electric Corp Memory system
JPH07210454A (en) * 1994-01-25 1995-08-11 Sharp Corp High-speed processor
JPH08137754A (en) * 1994-11-10 1996-05-31 Fuji Xerox Co Ltd Disk cache device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04270431A (en) * 1990-03-27 1992-09-25 Digital Equip Corp <Dec> Memory system of data processing apparatus
JPH04326437A (en) * 1991-04-26 1992-11-16 Mitsubishi Electric Corp Information processor
JPH0628180A (en) * 1991-07-30 1994-02-04 Hitachi Ltd Prefetch buffer
JPH06103169A (en) * 1992-09-18 1994-04-15 Nec Corp Read data prefetching mechanism for central arithmetic processor
JPH06295263A (en) * 1993-04-08 1994-10-21 Mitsubishi Electric Corp Memory system
JPH07210454A (en) * 1994-01-25 1995-08-11 Sharp Corp High-speed processor
JPH08137754A (en) * 1994-11-10 1996-05-31 Fuji Xerox Co Ltd Disk cache device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007500402A (en) * 2003-05-07 2007-01-11 フリースケール セミコンダクター インコーポレイテッド Data processing system with peripheral device access protection

Also Published As

Publication number Publication date
JP3956698B2 (en) 2007-08-08

Similar Documents

Publication Publication Date Title
US6298424B1 (en) Computer system including priorities for memory operations and allowing a higher priority memory operation to interrupt a lower priority memory operation
US8725987B2 (en) Cache memory system including selectively accessible pre-fetch memory for pre-fetch of variable size data
EP1421490B1 (en) Methods and apparatus for improving throughput of cache-based embedded processors by switching tasks in response to a cache miss
US5367494A (en) Randomly accessible memory having time overlapping memory accesses
US5265236A (en) Method and apparatus for increasing the speed of memory access in a virtual memory system having fast page mode
JP4417715B2 (en) Method and apparatus for decoupling tag and data access in cache memory
JPH1055307A (en) Computer system
EP1029280B1 (en) Cache memory operation
JPH10232827A (en) Method and device for writing back prefetch cache
JPS63150731A (en) Computer system and execution thereof
JP2000242558A (en) Cache system and its operating method
JPH04343151A (en) Memory access device
JP2005533295A5 (en)
US20080098176A1 (en) Method and Apparatus for Implementing Memory Accesses Using Open Page Mode for Data Prefetching
US5860117A (en) Apparatus and method to improve primary memory latencies using an eviction buffer to store write requests
JPH05210589A (en) High-speed buffer copying method
US20100106910A1 (en) Cache memory and method of controlling the same
US20030196072A1 (en) Digital signal processor architecture for high computation speed
KR960007833B1 (en) Method and apparatus for fast page mode selection
JP2020095345A (en) Arithmetic processing apparatus, memory apparatus, and method of controlling arithmetic processing apparatus
WO2001004760A1 (en) Memory controller
US20040103267A1 (en) Data processor having cache memory
JP2851777B2 (en) Bus control method and information processing device
JP2927160B2 (en) Register device
JP2007108882A (en) Memory controller, memory-controlling method, and information processing device

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP KR US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
ENP Entry into the national phase

Ref country code: JP

Ref document number: 2001 510096

Kind code of ref document: A

Format of ref document f/p: F

122 Ep: pct application non-entry in european phase